@trycourier/courier 6.0.1 → 6.0.3
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 +8 -8
- package/Client.js +16 -16
- package/README.md +112 -110
- package/api/resources/audiences/client/Client.d.ts +5 -5
- package/api/resources/audiences/client/Client.js +7 -7
- package/api/resources/audiences/client/requests/{ListAudienceMembersRequest.d.ts → AudienceMembersListParams.d.ts} +1 -2
- package/{dist/api/resources/audiences/types/AudienceRequest.d.ts → api/resources/audiences/client/requests/AudienceUpdateParams.d.ts} +2 -4
- package/api/resources/audiences/client/requests/{ListAudiencesRequest.d.ts → AudiencesListParams.d.ts} +1 -2
- package/api/resources/audiences/client/requests/index.d.ts +3 -2
- package/api/resources/audiences/types/{AudiencePutResponse.d.ts → AudienceUpdateResponse.d.ts} +1 -1
- package/api/resources/audiences/types/BaseFilterConfig.d.ts +1 -4
- package/api/resources/audiences/types/index.d.ts +1 -2
- package/api/resources/audiences/types/index.js +1 -2
- package/api/resources/auditEvents/client/Client.d.ts +2 -2
- package/api/resources/auditEvents/client/Client.js +3 -3
- package/api/resources/auditEvents/client/requests/ListAuditEventsRequest.d.ts +0 -1
- package/api/resources/authTokens/client/Client.d.ts +3 -3
- package/api/resources/authTokens/client/Client.js +2 -2
- package/api/resources/authTokens/client/index.d.ts +1 -1
- package/api/resources/authTokens/client/index.js +15 -0
- package/api/resources/authTokens/{types/AuthIssueTokenParameters.d.ts → client/requests/IssueTokenParams.d.ts} +2 -2
- package/api/resources/authTokens/client/requests/index.d.ts +1 -0
- package/api/resources/authTokens/types/{AuthIssueTokenResponse.d.ts → IssueTokenResponse.d.ts} +1 -1
- package/api/resources/authTokens/types/index.d.ts +1 -2
- package/api/resources/authTokens/types/index.js +1 -2
- package/api/resources/automations/client/Client.d.ts +3 -3
- package/api/resources/automations/client/Client.js +6 -5
- package/api/resources/brands/client/Client.d.ts +6 -2
- package/api/resources/brands/client/Client.js +49 -5
- package/api/resources/brands/{types/BrandPutParameters.d.ts → client/requests/BrandUpdateParameters.d.ts} +3 -4
- package/api/resources/brands/client/requests/index.d.ts +1 -0
- package/api/resources/brands/types/index.d.ts +0 -1
- package/api/resources/brands/types/index.js +0 -1
- package/api/resources/bulk/client/Client.d.ts +4 -4
- package/api/resources/bulk/client/Client.js +8 -9
- package/api/resources/bulk/client/index.d.ts +1 -1
- package/api/resources/bulk/client/index.js +15 -0
- package/{dist/api/resources/bulk/types → api/resources/bulk/client/requests}/BulkCreateJobParams.d.ts +1 -1
- package/api/resources/bulk/client/requests/index.d.ts +1 -0
- package/api/resources/bulk/types/BulkIngestUsersParams.d.ts +0 -1
- package/api/resources/bulk/types/InboundBulkContentMessage.d.ts +15 -0
- package/api/resources/bulk/types/InboundBulkMessage.d.ts +2 -2
- package/api/resources/bulk/types/InboundBulkMessageV1.d.ts +23 -0
- package/api/resources/bulk/types/InboundBulkMessageV2.d.ts +16 -0
- package/api/resources/bulk/types/InboundBulkTemplateMessage.d.ts +11 -0
- package/api/resources/bulk/types/index.d.ts +4 -4
- package/api/resources/bulk/types/index.js +4 -4
- package/api/resources/index.d.ts +7 -4
- package/api/resources/index.js +8 -5
- package/api/resources/lists/client/Client.d.ts +14 -6
- package/api/resources/lists/client/Client.js +99 -13
- package/api/resources/lists/client/requests/GetAllListsRequest.d.ts +0 -1
- package/api/resources/lists/client/requests/GetListRequest.d.ts +0 -1
- package/api/resources/lists/client/requests/SubscribeUserToListRequest.d.ts +0 -2
- package/api/resources/messages/client/Client.d.ts +2 -2
- package/api/resources/messages/client/Client.js +8 -8
- package/api/resources/messages/client/requests/ListMessagesRequest.d.ts +1 -1
- package/api/resources/notifications/client/Client.d.ts +29 -0
- package/api/resources/notifications/client/Client.js +392 -0
- package/api/resources/notifications/client/index.d.ts +1 -0
- package/api/resources/notifications/client/index.js +17 -0
- package/api/resources/notifications/client/requests/NotificationDraftUpdateVariationsParams.d.ts +8 -0
- package/api/resources/{bulk/types/BulkRunJobParams.d.ts → notifications/client/requests/NotificationListParams.d.ts} +2 -2
- package/api/resources/notifications/client/requests/NotificationUpdateVariationsParams.d.ts +8 -0
- package/api/resources/notifications/client/requests/SubmissionChecksReplaceParams.d.ts +7 -0
- package/api/resources/notifications/client/requests/index.d.ts +4 -0
- package/api/resources/notifications/types/BaseCheck.d.ts +9 -0
- package/api/resources/notifications/types/BlockType.d.ts +15 -0
- package/api/resources/notifications/types/BlockType.js +17 -0
- package/api/resources/{tokenManagement/types/PatchUserTokenOpts.d.ts → notifications/types/Check.d.ts} +2 -2
- package/api/resources/notifications/types/CheckStatus.d.ts +9 -0
- package/api/resources/notifications/types/CheckStatus.js +11 -0
- package/api/resources/notifications/types/MessageRouting.d.ts +8 -0
- package/api/resources/notifications/types/MessageRoutingChannel.d.ts +5 -0
- package/api/resources/notifications/types/MessageRoutingMethod.d.ts +8 -0
- package/api/resources/notifications/types/MessageRoutingMethod.js +10 -0
- package/api/resources/notifications/types/Notification.d.ts +9 -0
- package/api/resources/notifications/types/NotificationBlock.d.ts +13 -0
- package/api/resources/notifications/types/NotificationChannel.d.ts +11 -0
- package/api/resources/notifications/types/NotificationChannelContent.d.ts +7 -0
- package/api/resources/notifications/types/NotificationContent.d.ts +5 -0
- package/api/resources/notifications/types/NotificationContentHierarchy.d.ts +7 -0
- package/api/resources/notifications/types/NotificationGetContentResponse.d.ts +9 -0
- package/api/resources/notifications/types/NotificationListResponse.d.ts +8 -0
- package/api/resources/notifications/types/SubmissionChecksGetResponse.d.ts +7 -0
- package/api/resources/notifications/types/SubmissionChecksReplaceResponse.d.ts +7 -0
- package/api/resources/notifications/types/index.d.ts +17 -0
- package/api/resources/notifications/types/index.js +33 -0
- package/api/resources/profiles/client/Client.d.ts +2 -3
- package/api/resources/profiles/client/Client.js +8 -9
- package/api/resources/send/types/BaseMessage.d.ts +1 -8
- package/api/resources/send/types/Channel.d.ts +0 -4
- package/api/resources/send/types/ContentMessage.d.ts +2 -2
- package/api/resources/send/types/ElementalChannelNode.d.ts +0 -4
- package/api/resources/send/types/ElementalMetaNode.d.ts +0 -1
- package/api/resources/send/types/ElementalTextNode.d.ts +0 -1
- package/api/resources/send/types/MessageContext.d.ts +0 -1
- package/api/resources/send/types/MessageProvidersType.d.ts +0 -1
- package/api/resources/send/types/Routing.d.ts +0 -2
- package/api/resources/send/types/TemplateMessage.d.ts +2 -1
- package/api/resources/send/types/UserRecipient.d.ts +0 -1
- package/api/resources/templates/client/Client.d.ts +2 -2
- package/api/resources/templates/client/Client.js +2 -2
- package/api/resources/tenants/client/Client.d.ts +9 -3
- package/api/resources/tenants/client/Client.js +130 -2
- package/api/resources/tenants/client/index.d.ts +1 -1
- package/api/resources/tenants/client/index.js +15 -0
- package/{dist/api/resources/tenants/types/CreateOrReplaceTenantRequest.d.ts → api/resources/tenants/client/requests/TenantCreateOrReplaceParams.d.ts} +7 -7
- package/api/resources/tenants/client/requests/index.d.ts +1 -0
- package/api/resources/tenants/types/{CreateOrReplaceTenantResponse.d.ts → Tenant.d.ts} +3 -3
- package/api/resources/tenants/types/TenantListResponse.d.ts +21 -0
- package/api/resources/tenants/types/index.d.ts +2 -2
- package/api/resources/tenants/types/index.js +2 -2
- package/api/resources/translations/client/Client.d.ts +2 -2
- package/api/resources/translations/client/Client.js +3 -3
- package/api/resources/users/client/Client.d.ts +28 -0
- package/api/resources/users/client/Client.js +27 -0
- package/api/resources/users/client/index.js +2 -0
- package/api/resources/users/index.d.ts +2 -0
- package/api/resources/users/index.js +18 -0
- package/api/resources/users/resources/index.d.ts +8 -0
- package/api/resources/users/resources/index.js +37 -0
- package/api/resources/users/resources/preferences/client/Client.d.ts +36 -0
- package/api/resources/{userPreferences → users/resources/preferences}/client/Client.js +14 -14
- package/api/resources/users/resources/preferences/client/index.d.ts +1 -0
- package/api/resources/users/resources/preferences/client/index.js +17 -0
- package/api/resources/{userPreferences/types/UpdateSubscriptionTopicRequest.d.ts → users/resources/preferences/client/requests/UserPreferencesUpdateParams.d.ts} +3 -3
- package/api/resources/users/resources/preferences/client/requests/index.d.ts +1 -0
- package/api/resources/users/resources/preferences/client/requests/index.js +2 -0
- package/api/resources/{userPreferences → users/resources/preferences}/types/TopicPreference.d.ts +1 -1
- package/api/resources/users/resources/preferences/types/UserPreferencesGetResponse.d.ts +7 -0
- package/api/resources/{userPreferences/types/UserPreferences.d.ts → users/resources/preferences/types/UserPreferencesListResponse.d.ts} +3 -3
- package/{dist/api/resources/userPreferences/types/UpdateSubscriptionTopicResponse.d.ts → api/resources/users/resources/preferences/types/UserPreferencesUpdateResponse.d.ts} +1 -1
- package/api/resources/users/resources/preferences/types/index.d.ts +4 -0
- package/{dist/api/resources/userPreferences → api/resources/users/resources/preferences}/types/index.js +3 -3
- package/api/resources/users/resources/tenants/client/Client.d.ts +45 -0
- package/api/resources/users/resources/tenants/client/Client.js +254 -0
- package/api/resources/users/resources/tenants/client/index.d.ts +1 -0
- package/api/resources/users/resources/tenants/client/index.js +17 -0
- package/api/resources/users/resources/tenants/client/requests/AddUserToMultipleTenantsParams.d.ts +7 -0
- package/api/resources/users/resources/tenants/client/requests/AddUserToSingleTenantsParams.d.ts +7 -0
- package/api/resources/users/resources/tenants/client/requests/ListTenantsForUserParams.d.ts +14 -0
- package/api/resources/users/resources/tenants/client/requests/index.d.ts +3 -0
- package/api/resources/users/resources/tenants/client/requests/index.js +2 -0
- package/api/resources/users/resources/tenants/types/AddUserToSingleTenantsParamsProfile.d.ts +14 -0
- package/api/resources/users/resources/tenants/types/ListTenantsForUserResponse.d.ts +23 -0
- package/api/resources/users/resources/tenants/types/UserTenantAssociation.d.ts +8 -0
- package/api/resources/users/resources/tenants/types/index.d.ts +3 -0
- package/api/resources/users/resources/tenants/types/index.js +19 -0
- package/api/resources/users/resources/tokens/client/Client.d.ts +46 -0
- package/api/resources/{tokenManagement → users/resources/tokens}/client/Client.js +14 -14
- package/api/resources/users/resources/tokens/client/index.js +2 -0
- package/api/resources/{tokenManagement → users/resources/tokens}/types/GetAllTokensResponse.d.ts +2 -2
- package/api/resources/users/resources/tokens/types/GetUserTokenResponse.d.ts +9 -0
- package/api/resources/users/resources/tokens/types/PatchUserTokenOpts.d.ts +7 -0
- package/{dist/api/resources/tokenManagement → api/resources/users/resources/tokens}/types/PutUserTokenOpts.d.ts +2 -2
- package/api/resources/{tokenManagement → users/resources/tokens}/types/PutUserTokensOpts.d.ts +2 -2
- package/{dist/api/resources/tokenManagement → api/resources/users/resources/tokens}/types/UserToken.d.ts +5 -5
- package/api/types/SendMessageResponse.d.ts +0 -1
- package/core/fetcher/APIResponse.d.ts +1 -0
- package/core/fetcher/Fetcher.d.ts +1 -4
- package/core/fetcher/Fetcher.js +52 -31
- package/core/fetcher/getHeader.d.ts +1 -0
- package/core/fetcher/getHeader.js +12 -0
- package/core/fetcher/index.d.ts +1 -0
- package/core/fetcher/index.js +3 -1
- package/dist/Client.d.ts +8 -8
- package/dist/Client.js +16 -16
- package/dist/api/resources/audiences/client/Client.d.ts +5 -5
- package/dist/api/resources/audiences/client/Client.js +7 -7
- package/dist/api/resources/audiences/client/requests/{ListAudienceMembersRequest.d.ts → AudienceMembersListParams.d.ts} +1 -2
- package/{api/resources/audiences/types/AudienceRequest.d.ts → dist/api/resources/audiences/client/requests/AudienceUpdateParams.d.ts} +2 -4
- package/dist/api/resources/audiences/client/requests/{ListAudiencesRequest.d.ts → AudiencesListParams.d.ts} +1 -2
- package/dist/api/resources/audiences/client/requests/index.d.ts +3 -2
- package/dist/api/resources/audiences/types/{AudiencePutResponse.d.ts → AudienceUpdateResponse.d.ts} +1 -1
- package/dist/api/resources/audiences/types/AudienceUpdateResponse.js +5 -0
- package/dist/api/resources/audiences/types/BaseFilterConfig.d.ts +1 -4
- package/dist/api/resources/audiences/types/index.d.ts +1 -2
- package/dist/api/resources/audiences/types/index.js +1 -2
- package/dist/api/resources/auditEvents/client/Client.d.ts +2 -2
- package/dist/api/resources/auditEvents/client/Client.js +3 -3
- package/dist/api/resources/auditEvents/client/requests/ListAuditEventsRequest.d.ts +0 -1
- package/dist/api/resources/authTokens/client/Client.d.ts +3 -3
- package/dist/api/resources/authTokens/client/Client.js +2 -2
- package/dist/api/resources/authTokens/client/index.d.ts +1 -1
- package/dist/api/resources/authTokens/client/index.js +15 -0
- package/dist/api/resources/authTokens/{types/AuthIssueTokenParameters.d.ts → client/requests/IssueTokenParams.d.ts} +2 -2
- package/dist/api/resources/authTokens/client/requests/IssueTokenParams.js +5 -0
- package/dist/api/resources/authTokens/client/requests/index.d.ts +1 -0
- package/dist/api/resources/authTokens/client/requests/index.js +2 -0
- package/dist/api/resources/authTokens/types/{AuthIssueTokenResponse.d.ts → IssueTokenResponse.d.ts} +1 -1
- package/dist/api/resources/authTokens/types/IssueTokenResponse.js +5 -0
- package/dist/api/resources/authTokens/types/index.d.ts +1 -2
- package/dist/api/resources/authTokens/types/index.js +1 -2
- package/dist/api/resources/automations/client/Client.d.ts +3 -3
- package/dist/api/resources/automations/client/Client.js +6 -5
- package/dist/api/resources/brands/client/Client.d.ts +6 -2
- package/dist/api/resources/brands/client/Client.js +49 -5
- package/dist/api/resources/brands/{types/BrandPutParameters.d.ts → client/requests/BrandUpdateParameters.d.ts} +3 -4
- package/dist/api/resources/brands/client/requests/BrandUpdateParameters.js +5 -0
- package/dist/api/resources/brands/client/requests/index.d.ts +1 -0
- package/dist/api/resources/brands/types/index.d.ts +0 -1
- package/dist/api/resources/brands/types/index.js +0 -1
- package/dist/api/resources/bulk/client/Client.d.ts +4 -4
- package/dist/api/resources/bulk/client/Client.js +8 -9
- package/dist/api/resources/bulk/client/index.d.ts +1 -1
- package/dist/api/resources/bulk/client/index.js +15 -0
- package/{api/resources/bulk/types → dist/api/resources/bulk/client/requests}/BulkCreateJobParams.d.ts +1 -1
- package/dist/api/resources/bulk/client/requests/BulkCreateJobParams.js +5 -0
- package/dist/api/resources/bulk/client/requests/index.d.ts +1 -0
- package/dist/api/resources/bulk/client/requests/index.js +2 -0
- package/dist/api/resources/bulk/types/BulkIngestUsersParams.d.ts +0 -1
- package/dist/api/resources/bulk/types/InboundBulkContentMessage.d.ts +15 -0
- package/dist/api/resources/bulk/types/InboundBulkContentMessage.js +5 -0
- package/dist/api/resources/bulk/types/InboundBulkMessage.d.ts +2 -2
- package/dist/api/resources/bulk/types/InboundBulkMessageV1.d.ts +23 -0
- package/dist/api/resources/bulk/types/InboundBulkMessageV1.js +5 -0
- package/dist/api/resources/bulk/types/InboundBulkMessageV2.d.ts +16 -0
- package/dist/api/resources/bulk/types/InboundBulkMessageV2.js +5 -0
- package/dist/api/resources/bulk/types/InboundBulkTemplateMessage.d.ts +11 -0
- package/dist/api/resources/bulk/types/InboundBulkTemplateMessage.js +5 -0
- package/dist/api/resources/bulk/types/index.d.ts +4 -4
- package/dist/api/resources/bulk/types/index.js +4 -4
- package/dist/api/resources/index.d.ts +7 -4
- package/dist/api/resources/index.js +8 -5
- package/dist/api/resources/lists/client/Client.d.ts +14 -6
- package/dist/api/resources/lists/client/Client.js +99 -13
- package/dist/api/resources/lists/client/requests/GetAllListsRequest.d.ts +0 -1
- package/dist/api/resources/lists/client/requests/GetListRequest.d.ts +0 -1
- package/dist/api/resources/lists/client/requests/SubscribeUserToListRequest.d.ts +0 -2
- package/dist/api/resources/messages/client/Client.d.ts +2 -2
- package/dist/api/resources/messages/client/Client.js +8 -8
- package/dist/api/resources/messages/client/requests/ListMessagesRequest.d.ts +1 -1
- package/dist/api/resources/notifications/client/Client.d.ts +29 -0
- package/dist/api/resources/notifications/client/Client.js +392 -0
- package/dist/api/resources/notifications/client/index.d.ts +1 -0
- package/dist/api/resources/notifications/client/index.js +17 -0
- package/dist/api/resources/notifications/client/requests/NotificationDraftUpdateVariationsParams.d.ts +8 -0
- package/dist/api/resources/notifications/client/requests/NotificationDraftUpdateVariationsParams.js +5 -0
- package/dist/api/resources/notifications/client/requests/NotificationListParams.d.ts +6 -0
- package/dist/api/resources/notifications/client/requests/NotificationListParams.js +5 -0
- package/dist/api/resources/notifications/client/requests/NotificationUpdateVariationsParams.d.ts +8 -0
- package/dist/api/resources/notifications/client/requests/NotificationUpdateVariationsParams.js +5 -0
- package/dist/api/resources/notifications/client/requests/SubmissionChecksReplaceParams.d.ts +7 -0
- package/dist/api/resources/notifications/client/requests/SubmissionChecksReplaceParams.js +5 -0
- package/dist/api/resources/notifications/client/requests/index.d.ts +4 -0
- package/dist/api/resources/notifications/client/requests/index.js +2 -0
- package/dist/api/resources/notifications/index.d.ts +2 -0
- package/dist/api/resources/notifications/index.js +18 -0
- package/dist/api/resources/notifications/types/BaseCheck.d.ts +9 -0
- package/dist/api/resources/notifications/types/BaseCheck.js +5 -0
- package/dist/api/resources/notifications/types/BlockType.d.ts +15 -0
- package/dist/api/resources/notifications/types/BlockType.js +17 -0
- package/dist/api/resources/{tokenManagement/types/PatchUserTokenOpts.d.ts → notifications/types/Check.d.ts} +2 -2
- package/dist/api/resources/notifications/types/Check.js +5 -0
- package/dist/api/resources/notifications/types/CheckStatus.d.ts +9 -0
- package/dist/api/resources/notifications/types/CheckStatus.js +11 -0
- package/dist/api/resources/notifications/types/MessageRouting.d.ts +8 -0
- package/dist/api/resources/notifications/types/MessageRouting.js +5 -0
- package/dist/api/resources/notifications/types/MessageRoutingChannel.d.ts +5 -0
- package/dist/api/resources/notifications/types/MessageRoutingChannel.js +5 -0
- package/dist/api/resources/notifications/types/MessageRoutingMethod.d.ts +8 -0
- package/dist/api/resources/notifications/types/MessageRoutingMethod.js +10 -0
- package/dist/api/resources/notifications/types/Notification.d.ts +9 -0
- package/dist/api/resources/notifications/types/Notification.js +5 -0
- package/dist/api/resources/notifications/types/NotificationBlock.d.ts +13 -0
- package/dist/api/resources/notifications/types/NotificationBlock.js +5 -0
- package/dist/api/resources/notifications/types/NotificationChannel.d.ts +11 -0
- package/dist/api/resources/notifications/types/NotificationChannel.js +5 -0
- package/dist/api/resources/notifications/types/NotificationChannelContent.d.ts +7 -0
- package/dist/api/resources/notifications/types/NotificationChannelContent.js +5 -0
- package/dist/api/resources/notifications/types/NotificationContent.d.ts +5 -0
- package/dist/api/resources/notifications/types/NotificationContent.js +5 -0
- package/dist/api/resources/notifications/types/NotificationContentHierarchy.d.ts +7 -0
- package/dist/api/resources/notifications/types/NotificationContentHierarchy.js +5 -0
- package/dist/api/resources/notifications/types/NotificationGetContentResponse.d.ts +9 -0
- package/dist/api/resources/notifications/types/NotificationGetContentResponse.js +5 -0
- package/dist/api/resources/notifications/types/NotificationListResponse.d.ts +8 -0
- package/dist/api/resources/notifications/types/NotificationListResponse.js +5 -0
- package/dist/api/resources/notifications/types/SubmissionChecksGetResponse.d.ts +7 -0
- package/dist/api/resources/notifications/types/SubmissionChecksGetResponse.js +5 -0
- package/dist/api/resources/notifications/types/SubmissionChecksReplaceResponse.d.ts +7 -0
- package/dist/api/resources/notifications/types/SubmissionChecksReplaceResponse.js +5 -0
- package/dist/api/resources/notifications/types/index.d.ts +17 -0
- package/dist/api/resources/notifications/types/index.js +33 -0
- package/dist/api/resources/profiles/client/Client.d.ts +2 -3
- package/dist/api/resources/profiles/client/Client.js +8 -9
- package/dist/api/resources/send/types/BaseMessage.d.ts +1 -8
- package/dist/api/resources/send/types/Channel.d.ts +0 -4
- package/dist/api/resources/send/types/ContentMessage.d.ts +2 -2
- package/dist/api/resources/send/types/ElementalChannelNode.d.ts +0 -4
- package/dist/api/resources/send/types/ElementalMetaNode.d.ts +0 -1
- package/dist/api/resources/send/types/ElementalTextNode.d.ts +0 -1
- package/dist/api/resources/send/types/MessageContext.d.ts +0 -1
- package/dist/api/resources/send/types/MessageProvidersType.d.ts +0 -1
- package/dist/api/resources/send/types/Routing.d.ts +0 -2
- package/dist/api/resources/send/types/TemplateMessage.d.ts +2 -1
- package/dist/api/resources/send/types/UserRecipient.d.ts +0 -1
- package/dist/api/resources/templates/client/Client.d.ts +2 -2
- package/dist/api/resources/templates/client/Client.js +2 -2
- package/dist/api/resources/tenants/client/Client.d.ts +9 -3
- package/dist/api/resources/tenants/client/Client.js +130 -2
- package/dist/api/resources/tenants/client/index.d.ts +1 -1
- package/dist/api/resources/tenants/client/index.js +15 -0
- package/{api/resources/tenants/types/CreateOrReplaceTenantRequest.d.ts → dist/api/resources/tenants/client/requests/TenantCreateOrReplaceParams.d.ts} +7 -7
- package/dist/api/resources/tenants/client/requests/TenantCreateOrReplaceParams.js +5 -0
- package/dist/api/resources/tenants/client/requests/index.d.ts +1 -0
- package/dist/api/resources/tenants/client/requests/index.js +2 -0
- package/dist/api/resources/tenants/types/{CreateOrReplaceTenantResponse.d.ts → Tenant.d.ts} +3 -3
- package/dist/api/resources/tenants/types/Tenant.js +5 -0
- package/dist/api/resources/tenants/types/TenantListResponse.d.ts +21 -0
- package/dist/api/resources/tenants/types/TenantListResponse.js +5 -0
- package/dist/api/resources/tenants/types/index.d.ts +2 -2
- package/dist/api/resources/tenants/types/index.js +2 -2
- package/dist/api/resources/translations/client/Client.d.ts +2 -2
- package/dist/api/resources/translations/client/Client.js +3 -3
- package/dist/api/resources/users/client/Client.d.ts +28 -0
- package/dist/api/resources/users/client/Client.js +27 -0
- package/dist/api/resources/users/client/index.js +2 -0
- package/dist/api/resources/users/index.d.ts +2 -0
- package/dist/api/resources/users/index.js +18 -0
- package/dist/api/resources/users/resources/index.d.ts +8 -0
- package/dist/api/resources/users/resources/index.js +37 -0
- package/dist/api/resources/users/resources/preferences/client/Client.d.ts +36 -0
- package/dist/api/resources/{userPreferences → users/resources/preferences}/client/Client.js +14 -14
- package/dist/api/resources/users/resources/preferences/client/index.d.ts +1 -0
- package/dist/api/resources/users/resources/preferences/client/index.js +17 -0
- package/dist/api/resources/{userPreferences/types/UpdateSubscriptionTopicRequest.d.ts → users/resources/preferences/client/requests/UserPreferencesUpdateParams.d.ts} +3 -3
- package/dist/api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.js +5 -0
- package/dist/api/resources/users/resources/preferences/client/requests/index.d.ts +1 -0
- package/dist/api/resources/users/resources/preferences/client/requests/index.js +2 -0
- package/dist/api/resources/users/resources/preferences/index.d.ts +2 -0
- package/dist/api/resources/users/resources/preferences/index.js +18 -0
- package/dist/api/resources/{userPreferences → users/resources/preferences}/types/TopicPreference.d.ts +1 -1
- package/dist/api/resources/users/resources/preferences/types/TopicPreference.js +5 -0
- package/dist/api/resources/users/resources/preferences/types/UserPreferencesGetResponse.d.ts +7 -0
- package/dist/api/resources/users/resources/preferences/types/UserPreferencesGetResponse.js +5 -0
- package/dist/api/resources/{userPreferences/types/UserPreferences.d.ts → users/resources/preferences/types/UserPreferencesListResponse.d.ts} +3 -3
- package/dist/api/resources/users/resources/preferences/types/UserPreferencesListResponse.js +5 -0
- package/{api/resources/userPreferences/types/UpdateSubscriptionTopicResponse.d.ts → dist/api/resources/users/resources/preferences/types/UserPreferencesUpdateResponse.d.ts} +1 -1
- package/dist/api/resources/users/resources/preferences/types/UserPreferencesUpdateResponse.js +5 -0
- package/dist/api/resources/users/resources/preferences/types/index.d.ts +4 -0
- package/{api/resources/userPreferences → dist/api/resources/users/resources/preferences}/types/index.js +3 -3
- package/dist/api/resources/users/resources/tenants/client/Client.d.ts +45 -0
- package/dist/api/resources/users/resources/tenants/client/Client.js +254 -0
- package/dist/api/resources/users/resources/tenants/client/index.d.ts +1 -0
- package/dist/api/resources/users/resources/tenants/client/index.js +17 -0
- package/dist/api/resources/users/resources/tenants/client/requests/AddUserToMultipleTenantsParams.d.ts +7 -0
- package/dist/api/resources/users/resources/tenants/client/requests/AddUserToMultipleTenantsParams.js +5 -0
- package/dist/api/resources/users/resources/tenants/client/requests/AddUserToSingleTenantsParams.d.ts +7 -0
- package/dist/api/resources/users/resources/tenants/client/requests/AddUserToSingleTenantsParams.js +5 -0
- package/dist/api/resources/users/resources/tenants/client/requests/ListTenantsForUserParams.d.ts +14 -0
- package/dist/api/resources/users/resources/tenants/client/requests/ListTenantsForUserParams.js +5 -0
- package/dist/api/resources/users/resources/tenants/client/requests/index.d.ts +3 -0
- package/dist/api/resources/users/resources/tenants/client/requests/index.js +2 -0
- package/dist/api/resources/users/resources/tenants/index.d.ts +2 -0
- package/dist/api/resources/users/resources/tenants/index.js +18 -0
- package/dist/api/resources/users/resources/tenants/types/AddUserToSingleTenantsParamsProfile.d.ts +14 -0
- package/dist/api/resources/users/resources/tenants/types/AddUserToSingleTenantsParamsProfile.js +5 -0
- package/dist/api/resources/users/resources/tenants/types/ListTenantsForUserResponse.d.ts +23 -0
- package/dist/api/resources/users/resources/tenants/types/ListTenantsForUserResponse.js +5 -0
- package/dist/api/resources/users/resources/tenants/types/UserTenantAssociation.d.ts +8 -0
- package/dist/api/resources/users/resources/tenants/types/UserTenantAssociation.js +5 -0
- package/dist/api/resources/users/resources/tenants/types/index.d.ts +3 -0
- package/dist/api/resources/users/resources/tenants/types/index.js +19 -0
- package/dist/api/resources/users/resources/tokens/client/Client.d.ts +46 -0
- package/dist/api/resources/{tokenManagement → users/resources/tokens}/client/Client.js +14 -14
- package/dist/api/resources/users/resources/tokens/client/index.js +2 -0
- package/dist/api/resources/users/resources/tokens/index.d.ts +2 -0
- package/dist/api/resources/users/resources/tokens/index.js +18 -0
- package/dist/api/resources/users/resources/tokens/types/DeleteUserTokenOpts.js +5 -0
- package/dist/api/resources/users/resources/tokens/types/Device.js +5 -0
- package/dist/api/resources/users/resources/tokens/types/ExpiryDate.js +5 -0
- package/dist/api/resources/{tokenManagement → users/resources/tokens}/types/GetAllTokensResponse.d.ts +2 -2
- package/dist/api/resources/users/resources/tokens/types/GetAllTokensResponse.js +5 -0
- package/dist/api/resources/users/resources/tokens/types/GetUserTokenOpts.js +5 -0
- package/dist/api/resources/users/resources/tokens/types/GetUserTokenResponse.d.ts +9 -0
- package/dist/api/resources/users/resources/tokens/types/GetUserTokenResponse.js +5 -0
- package/dist/api/resources/users/resources/tokens/types/GetUserTokensOpts.js +5 -0
- package/dist/api/resources/users/resources/tokens/types/PatchOperation.js +5 -0
- package/dist/api/resources/users/resources/tokens/types/PatchUserTokenOpts.d.ts +7 -0
- package/dist/api/resources/users/resources/tokens/types/PatchUserTokenOpts.js +5 -0
- package/{api/resources/tokenManagement → dist/api/resources/users/resources/tokens}/types/PutUserTokenOpts.d.ts +2 -2
- package/dist/api/resources/users/resources/tokens/types/PutUserTokenOpts.js +5 -0
- package/dist/api/resources/{tokenManagement → users/resources/tokens}/types/PutUserTokensOpts.d.ts +2 -2
- package/dist/api/resources/users/resources/tokens/types/PutUserTokensOpts.js +5 -0
- package/dist/api/resources/users/resources/tokens/types/Tracking.js +5 -0
- package/{api/resources/tokenManagement → dist/api/resources/users/resources/tokens}/types/UserToken.d.ts +5 -5
- package/dist/api/resources/users/resources/tokens/types/UserToken.js +5 -0
- package/dist/api/types/SendMessageResponse.d.ts +0 -1
- package/dist/core/fetcher/APIResponse.d.ts +1 -0
- package/dist/core/fetcher/Fetcher.d.ts +1 -4
- package/dist/core/fetcher/Fetcher.js +52 -31
- package/dist/core/fetcher/getHeader.d.ts +1 -0
- package/dist/core/fetcher/getHeader.js +12 -0
- package/dist/core/fetcher/index.d.ts +1 -0
- package/dist/core/fetcher/index.js +3 -1
- package/package.json +6 -4
- package/api/resources/bulk/types/InboundBulkMessageApiV1.d.ts +0 -13
- package/api/resources/bulk/types/InboundBulkMessageApiV2.d.ts +0 -4
- package/api/resources/tokenManagement/client/Client.d.ts +0 -46
- package/api/resources/tokenManagement/types/GetUserTokenResponse.d.ts +0 -9
- package/api/resources/userPreferences/client/Client.d.ts +0 -36
- package/api/resources/userPreferences/types/index.d.ts +0 -4
- package/dist/api/resources/bulk/types/BulkRunJobParams.d.ts +0 -6
- package/dist/api/resources/bulk/types/InboundBulkMessageApiV1.d.ts +0 -13
- package/dist/api/resources/bulk/types/InboundBulkMessageApiV2.d.ts +0 -4
- package/dist/api/resources/tokenManagement/client/Client.d.ts +0 -46
- package/dist/api/resources/tokenManagement/types/GetUserTokenResponse.d.ts +0 -9
- package/dist/api/resources/userPreferences/client/Client.d.ts +0 -36
- package/dist/api/resources/userPreferences/types/index.d.ts +0 -4
- /package/api/resources/audiences/client/requests/{ListAudienceMembersRequest.js → AudienceMembersListParams.js} +0 -0
- /package/api/resources/audiences/client/requests/{ListAudiencesRequest.js → AudienceUpdateParams.js} +0 -0
- /package/api/resources/audiences/{types/AudiencePutResponse.js → client/requests/AudiencesListParams.js} +0 -0
- /package/api/resources/audiences/types/{AudienceRequest.js → AudienceUpdateResponse.js} +0 -0
- /package/api/resources/authTokens/{types/AuthIssueTokenParameters.js → client/requests/IssueTokenParams.js} +0 -0
- /package/api/resources/{tokenManagement/client → authTokens/client/requests}/index.js +0 -0
- /package/api/resources/authTokens/types/{AuthIssueTokenResponse.js → IssueTokenResponse.js} +0 -0
- /package/api/resources/brands/{types/BrandPutParameters.js → client/requests/BrandUpdateParameters.js} +0 -0
- /package/api/resources/bulk/{types → client/requests}/BulkCreateJobParams.js +0 -0
- /package/api/resources/{userPreferences/client → bulk/client/requests}/index.js +0 -0
- /package/api/resources/bulk/types/{BulkRunJobParams.js → InboundBulkContentMessage.js} +0 -0
- /package/api/resources/bulk/types/{InboundBulkMessageApiV1.js → InboundBulkMessageV1.js} +0 -0
- /package/api/resources/bulk/types/{InboundBulkMessageApiV2.js → InboundBulkMessageV2.js} +0 -0
- /package/api/resources/{tenants/types/CreateOrReplaceTenantRequest.js → bulk/types/InboundBulkTemplateMessage.js} +0 -0
- /package/api/resources/{tenants/types/CreateOrReplaceTenantResponse.js → notifications/client/requests/NotificationDraftUpdateVariationsParams.js} +0 -0
- /package/api/resources/{tokenManagement/types/DeleteUserTokenOpts.js → notifications/client/requests/NotificationListParams.js} +0 -0
- /package/api/resources/{tokenManagement/types/Device.js → notifications/client/requests/NotificationUpdateVariationsParams.js} +0 -0
- /package/api/resources/{tokenManagement/types/ExpiryDate.js → notifications/client/requests/SubmissionChecksReplaceParams.js} +0 -0
- /package/{dist/api/resources/tokenManagement/client → api/resources/notifications/client/requests}/index.js +0 -0
- /package/api/resources/{tokenManagement → notifications}/index.d.ts +0 -0
- /package/api/resources/{tokenManagement → notifications}/index.js +0 -0
- /package/api/resources/{tokenManagement/types/GetAllTokensResponse.js → notifications/types/BaseCheck.js} +0 -0
- /package/api/resources/{tokenManagement/types/GetUserTokenOpts.js → notifications/types/Check.js} +0 -0
- /package/api/resources/{tokenManagement/types/GetUserTokenResponse.js → notifications/types/MessageRouting.js} +0 -0
- /package/api/resources/{tokenManagement/types/GetUserTokensOpts.js → notifications/types/MessageRoutingChannel.js} +0 -0
- /package/api/resources/{tokenManagement/types/PatchOperation.js → notifications/types/Notification.js} +0 -0
- /package/api/resources/{tokenManagement/types/PatchUserTokenOpts.js → notifications/types/NotificationBlock.js} +0 -0
- /package/api/resources/{tokenManagement/types/PutUserTokenOpts.js → notifications/types/NotificationChannel.js} +0 -0
- /package/api/resources/{tokenManagement/types/PutUserTokensOpts.js → notifications/types/NotificationChannelContent.js} +0 -0
- /package/api/resources/{tokenManagement/types/Tracking.js → notifications/types/NotificationContent.js} +0 -0
- /package/api/resources/{tokenManagement/types/UserToken.js → notifications/types/NotificationContentHierarchy.js} +0 -0
- /package/api/resources/{userPreferences/types/TopicPreference.js → notifications/types/NotificationGetContentResponse.js} +0 -0
- /package/api/resources/{userPreferences/types/UpdateSubscriptionTopicRequest.js → notifications/types/NotificationListResponse.js} +0 -0
- /package/api/resources/{userPreferences/types/UpdateSubscriptionTopicResponse.js → notifications/types/SubmissionChecksGetResponse.js} +0 -0
- /package/api/resources/{userPreferences/types/UserPreferences.js → notifications/types/SubmissionChecksReplaceResponse.js} +0 -0
- /package/{dist/api/resources/audiences/client/requests/ListAudienceMembersRequest.js → api/resources/tenants/client/requests/TenantCreateOrReplaceParams.js} +0 -0
- /package/{dist/api/resources/userPreferences/client → api/resources/tenants/client/requests}/index.js +0 -0
- /package/{dist/api/resources/audiences/client/requests/ListAudiencesRequest.js → api/resources/tenants/types/Tenant.js} +0 -0
- /package/{dist/api/resources/audiences/types/AudiencePutResponse.js → api/resources/tenants/types/TenantListResponse.js} +0 -0
- /package/api/resources/{tokenManagement → users}/client/index.d.ts +0 -0
- /package/{dist/api/resources/audiences/types/AudienceRequest.js → api/resources/users/resources/preferences/client/requests/UserPreferencesUpdateParams.js} +0 -0
- /package/api/resources/{userPreferences → users/resources/preferences}/index.d.ts +0 -0
- /package/api/resources/{userPreferences → users/resources/preferences}/index.js +0 -0
- /package/{dist/api/resources/userPreferences → api/resources/users/resources/preferences}/types/TopicPreference.js +0 -0
- /package/{dist/api/resources/authTokens/types/AuthIssueTokenParameters.js → api/resources/users/resources/preferences/types/UserPreferencesGetResponse.js} +0 -0
- /package/{dist/api/resources/authTokens/types/AuthIssueTokenResponse.js → api/resources/users/resources/preferences/types/UserPreferencesListResponse.js} +0 -0
- /package/{dist/api/resources/brands/types/BrandPutParameters.js → api/resources/users/resources/preferences/types/UserPreferencesUpdateResponse.js} +0 -0
- /package/{dist/api/resources/bulk/types/BulkCreateJobParams.js → api/resources/users/resources/tenants/client/requests/AddUserToMultipleTenantsParams.js} +0 -0
- /package/{dist/api/resources/bulk/types/BulkRunJobParams.js → api/resources/users/resources/tenants/client/requests/AddUserToSingleTenantsParams.js} +0 -0
- /package/{dist/api/resources/bulk/types/InboundBulkMessageApiV1.js → api/resources/users/resources/tenants/client/requests/ListTenantsForUserParams.js} +0 -0
- /package/{dist/api/resources/tokenManagement → api/resources/users/resources/tenants}/index.d.ts +0 -0
- /package/{dist/api/resources/tokenManagement → api/resources/users/resources/tenants}/index.js +0 -0
- /package/{dist/api/resources/bulk/types/InboundBulkMessageApiV2.js → api/resources/users/resources/tenants/types/AddUserToSingleTenantsParamsProfile.js} +0 -0
- /package/{dist/api/resources/tenants/types/CreateOrReplaceTenantRequest.js → api/resources/users/resources/tenants/types/ListTenantsForUserResponse.js} +0 -0
- /package/{dist/api/resources/tenants/types/CreateOrReplaceTenantResponse.js → api/resources/users/resources/tenants/types/UserTenantAssociation.js} +0 -0
- /package/api/resources/{userPreferences → users/resources/tokens}/client/index.d.ts +0 -0
- /package/{dist/api/resources/userPreferences → api/resources/users/resources/tokens}/index.d.ts +0 -0
- /package/{dist/api/resources/userPreferences → api/resources/users/resources/tokens}/index.js +0 -0
- /package/api/resources/{tokenManagement → users/resources/tokens}/types/DeleteUserTokenOpts.d.ts +0 -0
- /package/{dist/api/resources/tokenManagement → api/resources/users/resources/tokens}/types/DeleteUserTokenOpts.js +0 -0
- /package/api/resources/{tokenManagement → users/resources/tokens}/types/Device.d.ts +0 -0
- /package/{dist/api/resources/tokenManagement → api/resources/users/resources/tokens}/types/Device.js +0 -0
- /package/api/resources/{tokenManagement → users/resources/tokens}/types/ExpiryDate.d.ts +0 -0
- /package/{dist/api/resources/tokenManagement → api/resources/users/resources/tokens}/types/ExpiryDate.js +0 -0
- /package/{dist/api/resources/tokenManagement → api/resources/users/resources/tokens}/types/GetAllTokensResponse.js +0 -0
- /package/api/resources/{tokenManagement → users/resources/tokens}/types/GetUserTokenOpts.d.ts +0 -0
- /package/{dist/api/resources/tokenManagement → api/resources/users/resources/tokens}/types/GetUserTokenOpts.js +0 -0
- /package/{dist/api/resources/tokenManagement → api/resources/users/resources/tokens}/types/GetUserTokenResponse.js +0 -0
- /package/api/resources/{tokenManagement → users/resources/tokens}/types/GetUserTokensOpts.d.ts +0 -0
- /package/{dist/api/resources/tokenManagement → api/resources/users/resources/tokens}/types/GetUserTokensOpts.js +0 -0
- /package/api/resources/{tokenManagement → users/resources/tokens}/types/PatchOp.d.ts +0 -0
- /package/api/resources/{tokenManagement → users/resources/tokens}/types/PatchOp.js +0 -0
- /package/api/resources/{tokenManagement → users/resources/tokens}/types/PatchOperation.d.ts +0 -0
- /package/{dist/api/resources/tokenManagement → api/resources/users/resources/tokens}/types/PatchOperation.js +0 -0
- /package/{dist/api/resources/tokenManagement → api/resources/users/resources/tokens}/types/PatchUserTokenOpts.js +0 -0
- /package/api/resources/{tokenManagement → users/resources/tokens}/types/ProviderKey.d.ts +0 -0
- /package/api/resources/{tokenManagement → users/resources/tokens}/types/ProviderKey.js +0 -0
- /package/{dist/api/resources/tokenManagement → api/resources/users/resources/tokens}/types/PutUserTokenOpts.js +0 -0
- /package/{dist/api/resources/tokenManagement → api/resources/users/resources/tokens}/types/PutUserTokensOpts.js +0 -0
- /package/api/resources/{tokenManagement → users/resources/tokens}/types/TokenStatus.d.ts +0 -0
- /package/api/resources/{tokenManagement → users/resources/tokens}/types/TokenStatus.js +0 -0
- /package/api/resources/{tokenManagement → users/resources/tokens}/types/Tracking.d.ts +0 -0
- /package/{dist/api/resources/tokenManagement → api/resources/users/resources/tokens}/types/Tracking.js +0 -0
- /package/{dist/api/resources/tokenManagement → api/resources/users/resources/tokens}/types/UserToken.js +0 -0
- /package/api/resources/{tokenManagement → users/resources/tokens}/types/index.d.ts +0 -0
- /package/api/resources/{tokenManagement → users/resources/tokens}/types/index.js +0 -0
- /package/dist/api/resources/{userPreferences/types/UpdateSubscriptionTopicRequest.js → audiences/client/requests/AudienceMembersListParams.js} +0 -0
- /package/dist/api/resources/{userPreferences/types/UpdateSubscriptionTopicResponse.js → audiences/client/requests/AudienceUpdateParams.js} +0 -0
- /package/dist/api/resources/{userPreferences/types/UserPreferences.js → audiences/client/requests/AudiencesListParams.js} +0 -0
- /package/dist/api/resources/{tokenManagement → users}/client/index.d.ts +0 -0
- /package/dist/api/resources/{userPreferences → users/resources/tokens}/client/index.d.ts +0 -0
- /package/dist/api/resources/{tokenManagement → users/resources/tokens}/types/DeleteUserTokenOpts.d.ts +0 -0
- /package/dist/api/resources/{tokenManagement → users/resources/tokens}/types/Device.d.ts +0 -0
- /package/dist/api/resources/{tokenManagement → users/resources/tokens}/types/ExpiryDate.d.ts +0 -0
- /package/dist/api/resources/{tokenManagement → users/resources/tokens}/types/GetUserTokenOpts.d.ts +0 -0
- /package/dist/api/resources/{tokenManagement → users/resources/tokens}/types/GetUserTokensOpts.d.ts +0 -0
- /package/dist/api/resources/{tokenManagement → users/resources/tokens}/types/PatchOp.d.ts +0 -0
- /package/dist/api/resources/{tokenManagement → users/resources/tokens}/types/PatchOp.js +0 -0
- /package/dist/api/resources/{tokenManagement → users/resources/tokens}/types/PatchOperation.d.ts +0 -0
- /package/dist/api/resources/{tokenManagement → users/resources/tokens}/types/ProviderKey.d.ts +0 -0
- /package/dist/api/resources/{tokenManagement → users/resources/tokens}/types/ProviderKey.js +0 -0
- /package/dist/api/resources/{tokenManagement → users/resources/tokens}/types/TokenStatus.d.ts +0 -0
- /package/dist/api/resources/{tokenManagement → users/resources/tokens}/types/TokenStatus.js +0 -0
- /package/dist/api/resources/{tokenManagement → users/resources/tokens}/types/Tracking.d.ts +0 -0
- /package/dist/api/resources/{tokenManagement → users/resources/tokens}/types/index.d.ts +0 -0
- /package/dist/api/resources/{tokenManagement → users/resources/tokens}/types/index.js +0 -0
|
@@ -45,7 +45,7 @@ const Courier = __importStar(require("../../.."));
|
|
|
45
45
|
const url_join_1 = __importDefault(require("url-join"));
|
|
46
46
|
const errors = __importStar(require("../../../../errors"));
|
|
47
47
|
class Tenants {
|
|
48
|
-
constructor(_options) {
|
|
48
|
+
constructor(_options = {}) {
|
|
49
49
|
this._options = _options;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
@@ -61,7 +61,7 @@ class Tenants {
|
|
|
61
61
|
Authorization: yield this._getAuthorizationHeader(),
|
|
62
62
|
"X-Fern-Language": "JavaScript",
|
|
63
63
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
64
|
-
"X-Fern-SDK-Version": "
|
|
64
|
+
"X-Fern-SDK-Version": "v6.0.3",
|
|
65
65
|
},
|
|
66
66
|
contentType: "application/json",
|
|
67
67
|
body: request,
|
|
@@ -97,6 +97,134 @@ class Tenants {
|
|
|
97
97
|
}
|
|
98
98
|
});
|
|
99
99
|
}
|
|
100
|
+
/**
|
|
101
|
+
* @throws {@link Courier.BadRequestError}
|
|
102
|
+
*/
|
|
103
|
+
get(tenantId, requestOptions) {
|
|
104
|
+
var _a;
|
|
105
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
106
|
+
const _response = yield core.fetcher({
|
|
107
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/tenants/${tenantId}`),
|
|
108
|
+
method: "GET",
|
|
109
|
+
headers: {
|
|
110
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
111
|
+
"X-Fern-Language": "JavaScript",
|
|
112
|
+
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
113
|
+
"X-Fern-SDK-Version": "v6.0.3",
|
|
114
|
+
},
|
|
115
|
+
contentType: "application/json",
|
|
116
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
117
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
118
|
+
});
|
|
119
|
+
if (_response.ok) {
|
|
120
|
+
return _response.body;
|
|
121
|
+
}
|
|
122
|
+
if (_response.error.reason === "status-code") {
|
|
123
|
+
switch (_response.error.statusCode) {
|
|
124
|
+
case 400:
|
|
125
|
+
throw new Courier.BadRequestError(_response.error.body);
|
|
126
|
+
default:
|
|
127
|
+
throw new errors.CourierError({
|
|
128
|
+
statusCode: _response.error.statusCode,
|
|
129
|
+
body: _response.error.body,
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
switch (_response.error.reason) {
|
|
134
|
+
case "non-json":
|
|
135
|
+
throw new errors.CourierError({
|
|
136
|
+
statusCode: _response.error.statusCode,
|
|
137
|
+
body: _response.error.rawBody,
|
|
138
|
+
});
|
|
139
|
+
case "timeout":
|
|
140
|
+
throw new errors.CourierTimeoutError();
|
|
141
|
+
case "unknown":
|
|
142
|
+
throw new errors.CourierError({
|
|
143
|
+
message: _response.error.errorMessage,
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
});
|
|
147
|
+
}
|
|
148
|
+
list(requestOptions) {
|
|
149
|
+
var _a;
|
|
150
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
151
|
+
const _response = yield core.fetcher({
|
|
152
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, "/tenants"),
|
|
153
|
+
method: "GET",
|
|
154
|
+
headers: {
|
|
155
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
156
|
+
"X-Fern-Language": "JavaScript",
|
|
157
|
+
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
158
|
+
"X-Fern-SDK-Version": "v6.0.3",
|
|
159
|
+
},
|
|
160
|
+
contentType: "application/json",
|
|
161
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
162
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
163
|
+
});
|
|
164
|
+
if (_response.ok) {
|
|
165
|
+
return _response.body;
|
|
166
|
+
}
|
|
167
|
+
if (_response.error.reason === "status-code") {
|
|
168
|
+
throw new errors.CourierError({
|
|
169
|
+
statusCode: _response.error.statusCode,
|
|
170
|
+
body: _response.error.body,
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
switch (_response.error.reason) {
|
|
174
|
+
case "non-json":
|
|
175
|
+
throw new errors.CourierError({
|
|
176
|
+
statusCode: _response.error.statusCode,
|
|
177
|
+
body: _response.error.rawBody,
|
|
178
|
+
});
|
|
179
|
+
case "timeout":
|
|
180
|
+
throw new errors.CourierTimeoutError();
|
|
181
|
+
case "unknown":
|
|
182
|
+
throw new errors.CourierError({
|
|
183
|
+
message: _response.error.errorMessage,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
});
|
|
187
|
+
}
|
|
188
|
+
delete(tenantId, requestOptions) {
|
|
189
|
+
var _a;
|
|
190
|
+
return __awaiter(this, void 0, void 0, function* () {
|
|
191
|
+
const _response = yield core.fetcher({
|
|
192
|
+
url: (0, url_join_1.default)((_a = (yield core.Supplier.get(this._options.environment))) !== null && _a !== void 0 ? _a : environments.CourierEnvironment.Production, `/tenants/${tenantId}`),
|
|
193
|
+
method: "DELETE",
|
|
194
|
+
headers: {
|
|
195
|
+
Authorization: yield this._getAuthorizationHeader(),
|
|
196
|
+
"X-Fern-Language": "JavaScript",
|
|
197
|
+
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
198
|
+
"X-Fern-SDK-Version": "v6.0.3",
|
|
199
|
+
},
|
|
200
|
+
contentType: "application/json",
|
|
201
|
+
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
202
|
+
maxRetries: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries,
|
|
203
|
+
});
|
|
204
|
+
if (_response.ok) {
|
|
205
|
+
return;
|
|
206
|
+
}
|
|
207
|
+
if (_response.error.reason === "status-code") {
|
|
208
|
+
throw new errors.CourierError({
|
|
209
|
+
statusCode: _response.error.statusCode,
|
|
210
|
+
body: _response.error.body,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
switch (_response.error.reason) {
|
|
214
|
+
case "non-json":
|
|
215
|
+
throw new errors.CourierError({
|
|
216
|
+
statusCode: _response.error.statusCode,
|
|
217
|
+
body: _response.error.rawBody,
|
|
218
|
+
});
|
|
219
|
+
case "timeout":
|
|
220
|
+
throw new errors.CourierTimeoutError();
|
|
221
|
+
case "unknown":
|
|
222
|
+
throw new errors.CourierError({
|
|
223
|
+
message: _response.error.errorMessage,
|
|
224
|
+
});
|
|
225
|
+
}
|
|
226
|
+
});
|
|
227
|
+
}
|
|
100
228
|
_getAuthorizationHeader() {
|
|
101
229
|
var _a;
|
|
102
230
|
return __awaiter(this, void 0, void 0, function* () {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export
|
|
1
|
+
export * from "./requests";
|
|
@@ -1,2 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
2
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -1,18 +1,18 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as Courier from "
|
|
5
|
-
export interface
|
|
4
|
+
import * as Courier from "../../../..";
|
|
5
|
+
export interface TenantCreateOrReplaceParams {
|
|
6
6
|
/** Name of the tenant. */
|
|
7
7
|
name: string;
|
|
8
8
|
/** Tenant's parent id (if any). */
|
|
9
|
-
parent_tenant_id
|
|
9
|
+
parent_tenant_id?: string;
|
|
10
10
|
/** Defines the preferences used for the tenant when the user hasn't specified their own. */
|
|
11
|
-
default_preferences
|
|
11
|
+
default_preferences?: Courier.DefaultPreferences;
|
|
12
12
|
/** Arbitrary properties accessible to a template. */
|
|
13
|
-
properties
|
|
13
|
+
properties?: (Courier.TemplateProperty | undefined)[];
|
|
14
14
|
/** A user profile object merged with user profile on send. */
|
|
15
|
-
user_profile?: any
|
|
15
|
+
user_profile?: Record<string, any>;
|
|
16
16
|
/** Brand to be used for the account when one is not specified by the send call. */
|
|
17
|
-
brand_id
|
|
17
|
+
brand_id?: string;
|
|
18
18
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { TenantCreateOrReplaceParams } from "./TenantCreateOrReplaceParams";
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
4
|
import * as Courier from "../../..";
|
|
5
|
-
export interface
|
|
5
|
+
export interface Tenant {
|
|
6
6
|
/** Id of the tenant. */
|
|
7
7
|
id: string;
|
|
8
8
|
/** Name of the tenant. */
|
|
@@ -14,7 +14,7 @@ export interface CreateOrReplaceTenantResponse {
|
|
|
14
14
|
/** Arbitrary properties accessible to a template. */
|
|
15
15
|
properties?: Courier.TemplateProperty | undefined;
|
|
16
16
|
/** A user profile object merged with user profile on send. */
|
|
17
|
-
user_profile?: any
|
|
17
|
+
user_profile?: Record<string, any>;
|
|
18
18
|
/** Brand to be used for the account when one is not specified by the send call. */
|
|
19
|
-
brand_id
|
|
19
|
+
brand_id?: string;
|
|
20
20
|
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as Courier from "../../..";
|
|
5
|
+
export interface TenantListResponse {
|
|
6
|
+
/** A pointer to the next page of results. Defined only whenhas_more is set to true. */
|
|
7
|
+
cursor?: string;
|
|
8
|
+
/** Set to true when there are more pages that can be retrieved. */
|
|
9
|
+
has_more: boolean;
|
|
10
|
+
/** An array of Tenants */
|
|
11
|
+
items: Courier.Tenant[];
|
|
12
|
+
/**
|
|
13
|
+
* A url that may be used to generate fetch the next set of results.
|
|
14
|
+
* Defined only whenhas_more is set to true
|
|
15
|
+
*/
|
|
16
|
+
next_url?: string;
|
|
17
|
+
/** A url that may be used to generate these results. */
|
|
18
|
+
url: string;
|
|
19
|
+
/** Always set to "list". Represents the type of this object. */
|
|
20
|
+
type: "list";
|
|
21
|
+
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
export * from "./CreateOrReplaceTenantRequest";
|
|
2
1
|
export * from "./DefaultPreferences";
|
|
3
2
|
export * from "./SubscriptionTopic";
|
|
4
3
|
export * from "./SubscriptionTopicStatus";
|
|
5
|
-
export * from "./
|
|
4
|
+
export * from "./Tenant";
|
|
5
|
+
export * from "./TenantListResponse";
|
|
6
6
|
export * from "./TemplateProperty";
|
|
@@ -14,9 +14,9 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
14
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
15
|
};
|
|
16
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
-
__exportStar(require("./CreateOrReplaceTenantRequest"), exports);
|
|
18
17
|
__exportStar(require("./DefaultPreferences"), exports);
|
|
19
18
|
__exportStar(require("./SubscriptionTopic"), exports);
|
|
20
19
|
__exportStar(require("./SubscriptionTopicStatus"), exports);
|
|
21
|
-
__exportStar(require("./
|
|
20
|
+
__exportStar(require("./Tenant"), exports);
|
|
21
|
+
__exportStar(require("./TenantListResponse"), exports);
|
|
22
22
|
__exportStar(require("./TemplateProperty"), exports);
|
|
@@ -6,7 +6,7 @@ import * as core from "../../../../core";
|
|
|
6
6
|
export declare namespace Translations {
|
|
7
7
|
interface Options {
|
|
8
8
|
environment?: core.Supplier<environments.CourierEnvironment | string>;
|
|
9
|
-
authorizationToken
|
|
9
|
+
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
|
|
10
10
|
}
|
|
11
11
|
interface RequestOptions {
|
|
12
12
|
timeoutInSeconds?: number;
|
|
@@ -15,7 +15,7 @@ export declare namespace Translations {
|
|
|
15
15
|
}
|
|
16
16
|
export declare class Translations {
|
|
17
17
|
protected readonly _options: Translations.Options;
|
|
18
|
-
constructor(_options
|
|
18
|
+
constructor(_options?: Translations.Options);
|
|
19
19
|
/**
|
|
20
20
|
* Get translations by locale
|
|
21
21
|
* @throws {@link Courier.NotFoundError}
|
|
@@ -45,7 +45,7 @@ const Courier = __importStar(require("../../.."));
|
|
|
45
45
|
const url_join_1 = __importDefault(require("url-join"));
|
|
46
46
|
const errors = __importStar(require("../../../../errors"));
|
|
47
47
|
class Translations {
|
|
48
|
-
constructor(_options) {
|
|
48
|
+
constructor(_options = {}) {
|
|
49
49
|
this._options = _options;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
@@ -62,7 +62,7 @@ class Translations {
|
|
|
62
62
|
Authorization: yield this._getAuthorizationHeader(),
|
|
63
63
|
"X-Fern-Language": "JavaScript",
|
|
64
64
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
65
|
-
"X-Fern-SDK-Version": "
|
|
65
|
+
"X-Fern-SDK-Version": "v6.0.3",
|
|
66
66
|
},
|
|
67
67
|
contentType: "application/json",
|
|
68
68
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -111,7 +111,7 @@ class Translations {
|
|
|
111
111
|
Authorization: yield this._getAuthorizationHeader(),
|
|
112
112
|
"X-Fern-Language": "JavaScript",
|
|
113
113
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
114
|
-
"X-Fern-SDK-Version": "
|
|
114
|
+
"X-Fern-SDK-Version": "v6.0.3",
|
|
115
115
|
},
|
|
116
116
|
contentType: "application/json",
|
|
117
117
|
body: request,
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../environments";
|
|
5
|
+
import * as core from "../../../../core";
|
|
6
|
+
import { Preferences } from "../resources/preferences/client/Client";
|
|
7
|
+
import { Tenants } from "../resources/tenants/client/Client";
|
|
8
|
+
import { Tokens } from "../resources/tokens/client/Client";
|
|
9
|
+
export declare namespace Users {
|
|
10
|
+
interface Options {
|
|
11
|
+
environment?: core.Supplier<environments.CourierEnvironment | string>;
|
|
12
|
+
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
|
|
13
|
+
}
|
|
14
|
+
interface RequestOptions {
|
|
15
|
+
timeoutInSeconds?: number;
|
|
16
|
+
maxRetries?: number;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
export declare class Users {
|
|
20
|
+
protected readonly _options: Users.Options;
|
|
21
|
+
constructor(_options?: Users.Options);
|
|
22
|
+
protected _preferences: Preferences | undefined;
|
|
23
|
+
get preferences(): Preferences;
|
|
24
|
+
protected _tenants: Tenants | undefined;
|
|
25
|
+
get tenants(): Tenants;
|
|
26
|
+
protected _tokens: Tokens | undefined;
|
|
27
|
+
get tokens(): Tokens;
|
|
28
|
+
}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
4
|
+
*/
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Users = void 0;
|
|
7
|
+
const Client_1 = require("../resources/preferences/client/Client");
|
|
8
|
+
const Client_2 = require("../resources/tenants/client/Client");
|
|
9
|
+
const Client_3 = require("../resources/tokens/client/Client");
|
|
10
|
+
class Users {
|
|
11
|
+
constructor(_options = {}) {
|
|
12
|
+
this._options = _options;
|
|
13
|
+
}
|
|
14
|
+
get preferences() {
|
|
15
|
+
var _a;
|
|
16
|
+
return ((_a = this._preferences) !== null && _a !== void 0 ? _a : (this._preferences = new Client_1.Preferences(this._options)));
|
|
17
|
+
}
|
|
18
|
+
get tenants() {
|
|
19
|
+
var _a;
|
|
20
|
+
return ((_a = this._tenants) !== null && _a !== void 0 ? _a : (this._tenants = new Client_2.Tenants(this._options)));
|
|
21
|
+
}
|
|
22
|
+
get tokens() {
|
|
23
|
+
var _a;
|
|
24
|
+
return ((_a = this._tokens) !== null && _a !== void 0 ? _a : (this._tokens = new Client_3.Tokens(this._options)));
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
exports.Users = Users;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./resources"), exports);
|
|
18
|
+
__exportStar(require("./client"), exports);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export * as preferences from "./preferences";
|
|
2
|
+
export * from "./preferences/types";
|
|
3
|
+
export * as tenants from "./tenants";
|
|
4
|
+
export * from "./tenants/types";
|
|
5
|
+
export * as tokens from "./tokens";
|
|
6
|
+
export * from "./tokens/types";
|
|
7
|
+
export * from "./preferences/client/requests";
|
|
8
|
+
export * from "./tenants/client/requests";
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
26
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
27
|
+
};
|
|
28
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
+
exports.tokens = exports.tenants = exports.preferences = void 0;
|
|
30
|
+
exports.preferences = __importStar(require("./preferences"));
|
|
31
|
+
__exportStar(require("./preferences/types"), exports);
|
|
32
|
+
exports.tenants = __importStar(require("./tenants"));
|
|
33
|
+
__exportStar(require("./tenants/types"), exports);
|
|
34
|
+
exports.tokens = __importStar(require("./tokens"));
|
|
35
|
+
__exportStar(require("./tokens/types"), exports);
|
|
36
|
+
__exportStar(require("./preferences/client/requests"), exports);
|
|
37
|
+
__exportStar(require("./tenants/client/requests"), exports);
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* This file was auto-generated by Fern from our API Definition.
|
|
3
|
+
*/
|
|
4
|
+
import * as environments from "../../../../../../environments";
|
|
5
|
+
import * as core from "../../../../../../core";
|
|
6
|
+
import * as Courier from "../../../../..";
|
|
7
|
+
export declare namespace Preferences {
|
|
8
|
+
interface Options {
|
|
9
|
+
environment?: core.Supplier<environments.CourierEnvironment | string>;
|
|
10
|
+
authorizationToken?: core.Supplier<core.BearerToken | undefined>;
|
|
11
|
+
}
|
|
12
|
+
interface RequestOptions {
|
|
13
|
+
timeoutInSeconds?: number;
|
|
14
|
+
maxRetries?: number;
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
export declare class Preferences {
|
|
18
|
+
protected readonly _options: Preferences.Options;
|
|
19
|
+
constructor(_options?: Preferences.Options);
|
|
20
|
+
/**
|
|
21
|
+
* Fetch all user preferences.
|
|
22
|
+
* @throws {@link Courier.BadRequestError}
|
|
23
|
+
*/
|
|
24
|
+
list(userId: string, requestOptions?: Preferences.RequestOptions): Promise<Courier.users.UserPreferencesListResponse>;
|
|
25
|
+
/**
|
|
26
|
+
* Fetch user preferences for a specific subscription topic.
|
|
27
|
+
* @throws {@link Courier.NotFoundError}
|
|
28
|
+
*/
|
|
29
|
+
get(userId: string, topicId: string, requestOptions?: Preferences.RequestOptions): Promise<Courier.users.UserPreferencesGetResponse>;
|
|
30
|
+
/**
|
|
31
|
+
* Fetch user preferences for a specific subscription topic.
|
|
32
|
+
* @throws {@link Courier.BadRequestError}
|
|
33
|
+
*/
|
|
34
|
+
update(userId: string, topicId: string, request: Courier.users.UserPreferencesUpdateParams, requestOptions?: Preferences.RequestOptions): Promise<Courier.users.UserPreferencesUpdateResponse>;
|
|
35
|
+
protected _getAuthorizationHeader(): Promise<string>;
|
|
36
|
+
}
|
|
@@ -38,21 +38,21 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
38
38
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
39
39
|
};
|
|
40
40
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
41
|
-
exports.
|
|
42
|
-
const environments = __importStar(require("
|
|
43
|
-
const core = __importStar(require("
|
|
44
|
-
const Courier = __importStar(require("
|
|
41
|
+
exports.Preferences = void 0;
|
|
42
|
+
const environments = __importStar(require("../../../../../../environments"));
|
|
43
|
+
const core = __importStar(require("../../../../../../core"));
|
|
44
|
+
const Courier = __importStar(require("../../../../.."));
|
|
45
45
|
const url_join_1 = __importDefault(require("url-join"));
|
|
46
|
-
const errors = __importStar(require("
|
|
47
|
-
class
|
|
48
|
-
constructor(_options) {
|
|
46
|
+
const errors = __importStar(require("../../../../../../errors"));
|
|
47
|
+
class Preferences {
|
|
48
|
+
constructor(_options = {}) {
|
|
49
49
|
this._options = _options;
|
|
50
50
|
}
|
|
51
51
|
/**
|
|
52
52
|
* Fetch all user preferences.
|
|
53
53
|
* @throws {@link Courier.BadRequestError}
|
|
54
54
|
*/
|
|
55
|
-
|
|
55
|
+
list(userId, requestOptions) {
|
|
56
56
|
var _a;
|
|
57
57
|
return __awaiter(this, void 0, void 0, function* () {
|
|
58
58
|
const _response = yield core.fetcher({
|
|
@@ -62,7 +62,7 @@ class UserPreferences {
|
|
|
62
62
|
Authorization: yield this._getAuthorizationHeader(),
|
|
63
63
|
"X-Fern-Language": "JavaScript",
|
|
64
64
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
65
|
-
"X-Fern-SDK-Version": "
|
|
65
|
+
"X-Fern-SDK-Version": "v6.0.3",
|
|
66
66
|
},
|
|
67
67
|
contentType: "application/json",
|
|
68
68
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -101,7 +101,7 @@ class UserPreferences {
|
|
|
101
101
|
* Fetch user preferences for a specific subscription topic.
|
|
102
102
|
* @throws {@link Courier.NotFoundError}
|
|
103
103
|
*/
|
|
104
|
-
|
|
104
|
+
get(userId, topicId, requestOptions) {
|
|
105
105
|
var _a;
|
|
106
106
|
return __awaiter(this, void 0, void 0, function* () {
|
|
107
107
|
const _response = yield core.fetcher({
|
|
@@ -111,7 +111,7 @@ class UserPreferences {
|
|
|
111
111
|
Authorization: yield this._getAuthorizationHeader(),
|
|
112
112
|
"X-Fern-Language": "JavaScript",
|
|
113
113
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
114
|
-
"X-Fern-SDK-Version": "
|
|
114
|
+
"X-Fern-SDK-Version": "v6.0.3",
|
|
115
115
|
},
|
|
116
116
|
contentType: "application/json",
|
|
117
117
|
timeoutMs: (requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1000 : 60000,
|
|
@@ -150,7 +150,7 @@ class UserPreferences {
|
|
|
150
150
|
* Fetch user preferences for a specific subscription topic.
|
|
151
151
|
* @throws {@link Courier.BadRequestError}
|
|
152
152
|
*/
|
|
153
|
-
|
|
153
|
+
update(userId, topicId, request, requestOptions) {
|
|
154
154
|
var _a;
|
|
155
155
|
return __awaiter(this, void 0, void 0, function* () {
|
|
156
156
|
const _response = yield core.fetcher({
|
|
@@ -160,7 +160,7 @@ class UserPreferences {
|
|
|
160
160
|
Authorization: yield this._getAuthorizationHeader(),
|
|
161
161
|
"X-Fern-Language": "JavaScript",
|
|
162
162
|
"X-Fern-SDK-Name": "@trycourier/courier",
|
|
163
|
-
"X-Fern-SDK-Version": "
|
|
163
|
+
"X-Fern-SDK-Version": "v6.0.3",
|
|
164
164
|
},
|
|
165
165
|
contentType: "application/json",
|
|
166
166
|
body: request,
|
|
@@ -209,4 +209,4 @@ class UserPreferences {
|
|
|
209
209
|
});
|
|
210
210
|
}
|
|
211
211
|
}
|
|
212
|
-
exports.
|
|
212
|
+
exports.Preferences = Preferences;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests";
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./requests"), exports);
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* This file was auto-generated by Fern from our API Definition.
|
|
3
3
|
*/
|
|
4
|
-
import * as Courier from "
|
|
5
|
-
export interface
|
|
6
|
-
status
|
|
4
|
+
import * as Courier from "../../../../../..";
|
|
5
|
+
export interface UserPreferencesUpdateParams {
|
|
6
|
+
status: Courier.PreferenceStatus;
|
|
7
7
|
/** Should contain unique items. */
|
|
8
8
|
custom_routing?: Courier.ChannelClassification[];
|
|
9
9
|
default_status: Courier.PreferenceStatus;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { UserPreferencesUpdateParams } from "./UserPreferencesUpdateParams";
|