@ichos/sdk 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -0
- package/dist/BaseClient.d.ts +43 -0
- package/dist/BaseClient.js +29 -0
- package/dist/Client.d.ts +38 -0
- package/dist/Client.js +53 -0
- package/dist/api/errors/ForbiddenError.d.ts +6 -0
- package/dist/api/errors/ForbiddenError.js +17 -0
- package/dist/api/errors/InternalServerError.d.ts +6 -0
- package/dist/api/errors/InternalServerError.js +17 -0
- package/dist/api/errors/NotFoundError.d.ts +6 -0
- package/dist/api/errors/NotFoundError.js +17 -0
- package/dist/api/errors/UnauthorizedError.d.ts +6 -0
- package/dist/api/errors/UnauthorizedError.js +17 -0
- package/dist/api/errors/UnprocessableEntityError.d.ts +6 -0
- package/dist/api/errors/UnprocessableEntityError.js +17 -0
- package/dist/api/errors/index.d.ts +5 -0
- package/dist/api/errors/index.js +5 -0
- package/dist/api/index.d.ts +3 -0
- package/dist/api/index.js +3 -0
- package/dist/api/resources/ads/client/Client.d.ts +226 -0
- package/dist/api/resources/ads/client/Client.js +732 -0
- package/dist/api/resources/ads/client/index.d.ts +1 -0
- package/dist/api/resources/ads/client/index.js +1 -0
- package/dist/api/resources/ads/client/requests/AdCreate.d.ts +24 -0
- package/dist/api/resources/ads/client/requests/AdCreate.js +8 -0
- package/dist/api/resources/ads/client/requests/AdInsertionPointCreate.d.ts +11 -0
- package/dist/api/resources/ads/client/requests/AdInsertionPointCreate.js +2 -0
- package/dist/api/resources/ads/client/requests/AdUpdate.d.ts +23 -0
- package/dist/api/resources/ads/client/requests/AdUpdate.js +8 -0
- package/dist/api/resources/ads/client/requests/DeleteAdRequest.d.ts +12 -0
- package/dist/api/resources/ads/client/requests/DeleteAdRequest.js +2 -0
- package/dist/api/resources/ads/client/requests/LinkAdAudioRequest.d.ts +13 -0
- package/dist/api/resources/ads/client/requests/LinkAdAudioRequest.js +2 -0
- package/dist/api/resources/ads/client/requests/ListAdInsertionPointsRequest.d.ts +10 -0
- package/dist/api/resources/ads/client/requests/ListAdInsertionPointsRequest.js +2 -0
- package/dist/api/resources/ads/client/requests/ListVirtualUserAdsRequest.d.ts +8 -0
- package/dist/api/resources/ads/client/requests/ListVirtualUserAdsRequest.js +2 -0
- package/dist/api/resources/ads/client/requests/UpdateAdWeightRequest.d.ts +9 -0
- package/dist/api/resources/ads/client/requests/UpdateAdWeightRequest.js +2 -0
- package/dist/api/resources/ads/client/requests/index.d.ts +8 -0
- package/dist/api/resources/ads/client/requests/index.js +1 -0
- package/dist/api/resources/ads/index.d.ts +1 -0
- package/dist/api/resources/ads/index.js +1 -0
- package/dist/api/resources/analytics/client/Client.d.ts +28 -0
- package/dist/api/resources/analytics/client/Client.js +68 -0
- package/dist/api/resources/analytics/client/index.d.ts +1 -0
- package/dist/api/resources/analytics/client/index.js +1 -0
- package/dist/api/resources/analytics/client/requests/GetAverageMonthlyListenersRequest.d.ts +9 -0
- package/dist/api/resources/analytics/client/requests/GetAverageMonthlyListenersRequest.js +2 -0
- package/dist/api/resources/analytics/client/requests/index.d.ts +1 -0
- package/dist/api/resources/analytics/client/requests/index.js +1 -0
- package/dist/api/resources/analytics/index.d.ts +1 -0
- package/dist/api/resources/analytics/index.js +1 -0
- package/dist/api/resources/audio/client/Client.d.ts +130 -0
- package/dist/api/resources/audio/client/Client.js +402 -0
- package/dist/api/resources/audio/client/index.d.ts +1 -0
- package/dist/api/resources/audio/client/index.js +1 -0
- package/dist/api/resources/audio/client/requests/DeleteAudioRequest.d.ts +10 -0
- package/dist/api/resources/audio/client/requests/DeleteAudioRequest.js +2 -0
- package/dist/api/resources/audio/client/requests/FinalizeAudioUploadRequest.d.ts +16 -0
- package/dist/api/resources/audio/client/requests/FinalizeAudioUploadRequest.js +2 -0
- package/dist/api/resources/audio/client/requests/GetAudioPullStatusRequest.d.ts +10 -0
- package/dist/api/resources/audio/client/requests/GetAudioPullStatusRequest.js +2 -0
- package/dist/api/resources/audio/client/requests/GetAudioRequest.d.ts +10 -0
- package/dist/api/resources/audio/client/requests/GetAudioRequest.js +2 -0
- package/dist/api/resources/audio/client/requests/PullAudioDto.d.ts +9 -0
- package/dist/api/resources/audio/client/requests/PullAudioDto.js +2 -0
- package/dist/api/resources/audio/client/requests/TextToSpeechRequest.d.ts +10 -0
- package/dist/api/resources/audio/client/requests/TextToSpeechRequest.js +2 -0
- package/dist/api/resources/audio/client/requests/index.d.ts +6 -0
- package/dist/api/resources/audio/client/requests/index.js +1 -0
- package/dist/api/resources/audio/index.d.ts +1 -0
- package/dist/api/resources/audio/index.js +1 -0
- package/dist/api/resources/episodes/client/Client.d.ts +234 -0
- package/dist/api/resources/episodes/client/Client.js +746 -0
- package/dist/api/resources/episodes/client/index.d.ts +1 -0
- package/dist/api/resources/episodes/client/index.js +1 -0
- package/dist/api/resources/episodes/client/requests/DeleteEpisodeRequest.d.ts +12 -0
- package/dist/api/resources/episodes/client/requests/DeleteEpisodeRequest.js +2 -0
- package/dist/api/resources/episodes/client/requests/EpisodeCreate.d.ts +45 -0
- package/dist/api/resources/episodes/client/requests/EpisodeCreate.js +15 -0
- package/dist/api/resources/episodes/client/requests/EpisodeUpdate.d.ts +45 -0
- package/dist/api/resources/episodes/client/requests/EpisodeUpdate.js +15 -0
- package/dist/api/resources/episodes/client/requests/GenerateEpisodeCoverUploadUrlRequest.d.ts +10 -0
- package/dist/api/resources/episodes/client/requests/GenerateEpisodeCoverUploadUrlRequest.js +2 -0
- package/dist/api/resources/episodes/client/requests/GetEpisodeAudioRequest.d.ts +10 -0
- package/dist/api/resources/episodes/client/requests/GetEpisodeAudioRequest.js +2 -0
- package/dist/api/resources/episodes/client/requests/GetEpisodeCoverRequest.d.ts +10 -0
- package/dist/api/resources/episodes/client/requests/GetEpisodeCoverRequest.js +2 -0
- package/dist/api/resources/episodes/client/requests/GetEpisodeListenersReportRequest.d.ts +10 -0
- package/dist/api/resources/episodes/client/requests/GetEpisodeListenersReportRequest.js +2 -0
- package/dist/api/resources/episodes/client/requests/GetEpisodeRequest.d.ts +10 -0
- package/dist/api/resources/episodes/client/requests/GetEpisodeRequest.js +2 -0
- package/dist/api/resources/episodes/client/requests/LinkEpisodeAudioRequest.d.ts +13 -0
- package/dist/api/resources/episodes/client/requests/LinkEpisodeAudioRequest.js +2 -0
- package/dist/api/resources/episodes/client/requests/ListPodcastEpisodesRequest.d.ts +10 -0
- package/dist/api/resources/episodes/client/requests/ListPodcastEpisodesRequest.js +2 -0
- package/dist/api/resources/episodes/client/requests/PublishEpisodeRequest.d.ts +10 -0
- package/dist/api/resources/episodes/client/requests/PublishEpisodeRequest.js +2 -0
- package/dist/api/resources/episodes/client/requests/PullEpisodeCoverFromUrlRequest.d.ts +12 -0
- package/dist/api/resources/episodes/client/requests/PullEpisodeCoverFromUrlRequest.js +2 -0
- package/dist/api/resources/episodes/client/requests/index.d.ts +12 -0
- package/dist/api/resources/episodes/client/requests/index.js +1 -0
- package/dist/api/resources/episodes/index.d.ts +1 -0
- package/dist/api/resources/episodes/index.js +1 -0
- package/dist/api/resources/index.d.ts +17 -0
- package/dist/api/resources/index.js +17 -0
- package/dist/api/resources/organizations/client/Client.d.ts +40 -0
- package/dist/api/resources/organizations/client/Client.js +122 -0
- package/dist/api/resources/organizations/client/index.d.ts +1 -0
- package/dist/api/resources/organizations/client/index.js +1 -0
- package/dist/api/resources/organizations/index.d.ts +1 -0
- package/dist/api/resources/organizations/index.js +1 -0
- package/dist/api/resources/podcasts/client/Client.d.ts +246 -0
- package/dist/api/resources/podcasts/client/Client.js +787 -0
- package/dist/api/resources/podcasts/client/index.d.ts +1 -0
- package/dist/api/resources/podcasts/client/index.js +1 -0
- package/dist/api/resources/podcasts/client/requests/DeletePodcastRequest.d.ts +10 -0
- package/dist/api/resources/podcasts/client/requests/DeletePodcastRequest.js +2 -0
- package/dist/api/resources/podcasts/client/requests/GeneratePodcastCoverUploadUrlRequest.d.ts +10 -0
- package/dist/api/resources/podcasts/client/requests/GeneratePodcastCoverUploadUrlRequest.js +2 -0
- package/dist/api/resources/podcasts/client/requests/GetPodcastCoverRequest.d.ts +10 -0
- package/dist/api/resources/podcasts/client/requests/GetPodcastCoverRequest.js +2 -0
- package/dist/api/resources/podcasts/client/requests/GetPodcastListenersReportRequest.d.ts +10 -0
- package/dist/api/resources/podcasts/client/requests/GetPodcastListenersReportRequest.js +2 -0
- package/dist/api/resources/podcasts/client/requests/GetPodcastRequest.d.ts +10 -0
- package/dist/api/resources/podcasts/client/requests/GetPodcastRequest.js +2 -0
- package/dist/api/resources/podcasts/client/requests/GetPodcastRssRequest.d.ts +10 -0
- package/dist/api/resources/podcasts/client/requests/GetPodcastRssRequest.js +2 -0
- package/dist/api/resources/podcasts/client/requests/ImportPodcastFromRssRequest.d.ts +10 -0
- package/dist/api/resources/podcasts/client/requests/ImportPodcastFromRssRequest.js +2 -0
- package/dist/api/resources/podcasts/client/requests/PodcastCreate.d.ts +59 -0
- package/dist/api/resources/podcasts/client/requests/PodcastCreate.js +9 -0
- package/dist/api/resources/podcasts/client/requests/PodcastUpdate.d.ts +60 -0
- package/dist/api/resources/podcasts/client/requests/PodcastUpdate.js +9 -0
- package/dist/api/resources/podcasts/client/requests/PublishPodcastRequest.d.ts +10 -0
- package/dist/api/resources/podcasts/client/requests/PublishPodcastRequest.js +2 -0
- package/dist/api/resources/podcasts/client/requests/PullPodcastCoverFromUrlRequest.d.ts +12 -0
- package/dist/api/resources/podcasts/client/requests/PullPodcastCoverFromUrlRequest.js +2 -0
- package/dist/api/resources/podcasts/client/requests/ValidatePodcastRequest.d.ts +10 -0
- package/dist/api/resources/podcasts/client/requests/ValidatePodcastRequest.js +2 -0
- package/dist/api/resources/podcasts/client/requests/index.d.ts +12 -0
- package/dist/api/resources/podcasts/client/requests/index.js +1 -0
- package/dist/api/resources/podcasts/index.d.ts +1 -0
- package/dist/api/resources/podcasts/index.js +1 -0
- package/dist/api/resources/segments/client/Client.d.ts +120 -0
- package/dist/api/resources/segments/client/Client.js +374 -0
- package/dist/api/resources/segments/client/index.d.ts +1 -0
- package/dist/api/resources/segments/client/index.js +1 -0
- package/dist/api/resources/segments/client/requests/DeleteSegmentRequest.d.ts +12 -0
- package/dist/api/resources/segments/client/requests/DeleteSegmentRequest.js +2 -0
- package/dist/api/resources/segments/client/requests/LinkSegmentAudioRequest.d.ts +13 -0
- package/dist/api/resources/segments/client/requests/LinkSegmentAudioRequest.js +2 -0
- package/dist/api/resources/segments/client/requests/ListPodcastSegmentsRequest.d.ts +10 -0
- package/dist/api/resources/segments/client/requests/ListPodcastSegmentsRequest.js +2 -0
- package/dist/api/resources/segments/client/requests/SegmentCreate.d.ts +29 -0
- package/dist/api/resources/segments/client/requests/SegmentCreate.js +13 -0
- package/dist/api/resources/segments/client/requests/SegmentUpdate.d.ts +29 -0
- package/dist/api/resources/segments/client/requests/SegmentUpdate.js +13 -0
- package/dist/api/resources/segments/client/requests/index.d.ts +5 -0
- package/dist/api/resources/segments/client/requests/index.js +1 -0
- package/dist/api/resources/segments/index.d.ts +1 -0
- package/dist/api/resources/segments/index.js +1 -0
- package/dist/api/resources/users/client/Client.d.ts +89 -0
- package/dist/api/resources/users/client/Client.js +293 -0
- package/dist/api/resources/users/client/index.d.ts +1 -0
- package/dist/api/resources/users/client/index.js +1 -0
- package/dist/api/resources/users/client/requests/UpdateCurrentVirtualUserRequest.d.ts +7 -0
- package/dist/api/resources/users/client/requests/UpdateCurrentVirtualUserRequest.js +2 -0
- package/dist/api/resources/users/client/requests/index.d.ts +1 -0
- package/dist/api/resources/users/client/requests/index.js +1 -0
- package/dist/api/resources/users/index.d.ts +1 -0
- package/dist/api/resources/users/index.js +1 -0
- package/dist/api/resources/webhooks/client/Client.d.ts +76 -0
- package/dist/api/resources/webhooks/client/Client.js +236 -0
- package/dist/api/resources/webhooks/client/index.d.ts +1 -0
- package/dist/api/resources/webhooks/client/index.js +1 -0
- package/dist/api/resources/webhooks/client/requests/CreateWebhookDestinationRequest.d.ts +10 -0
- package/dist/api/resources/webhooks/client/requests/CreateWebhookDestinationRequest.js +2 -0
- package/dist/api/resources/webhooks/client/requests/DeleteWebhookDestinationRequest.d.ts +10 -0
- package/dist/api/resources/webhooks/client/requests/DeleteWebhookDestinationRequest.js +2 -0
- package/dist/api/resources/webhooks/client/requests/index.d.ts +2 -0
- package/dist/api/resources/webhooks/client/requests/index.js +1 -0
- package/dist/api/resources/webhooks/index.d.ts +1 -0
- package/dist/api/resources/webhooks/index.js +1 -0
- package/dist/api/types/Ad.d.ts +16 -0
- package/dist/api/types/Ad.js +8 -0
- package/dist/api/types/AdId.d.ts +9 -0
- package/dist/api/types/AdId.js +7 -0
- package/dist/api/types/AdInsertionPoint.d.ts +5 -0
- package/dist/api/types/AdInsertionPoint.js +2 -0
- package/dist/api/types/AdInsertionPointListResponse.d.ts +6 -0
- package/dist/api/types/AdInsertionPointListResponse.js +2 -0
- package/dist/api/types/AdInsertionPointResponse.d.ts +6 -0
- package/dist/api/types/AdInsertionPointResponse.js +2 -0
- package/dist/api/types/AdListResponse.d.ts +6 -0
- package/dist/api/types/AdListResponse.js +2 -0
- package/dist/api/types/AdResponse.d.ts +6 -0
- package/dist/api/types/AdResponse.js +2 -0
- package/dist/api/types/AdWeight.d.ts +5 -0
- package/dist/api/types/AdWeight.js +2 -0
- package/dist/api/types/AdWeightListResponse.d.ts +6 -0
- package/dist/api/types/AdWeightListResponse.js +2 -0
- package/dist/api/types/ApiMeta.d.ts +3 -0
- package/dist/api/types/ApiMeta.js +2 -0
- package/dist/api/types/ApiMetaSuccess.d.ts +5 -0
- package/dist/api/types/ApiMetaSuccess.js +2 -0
- package/dist/api/types/ApplePodcastCategory.d.ts +113 -0
- package/dist/api/types/ApplePodcastCategory.js +113 -0
- package/dist/api/types/Audio.d.ts +27 -0
- package/dist/api/types/Audio.js +12 -0
- package/dist/api/types/AudioEntityLink.d.ts +16 -0
- package/dist/api/types/AudioEntityLink.js +2 -0
- package/dist/api/types/AudioProcessedPayload.d.ts +3 -0
- package/dist/api/types/AudioProcessedPayload.js +2 -0
- package/dist/api/types/AudioPullResponse.d.ts +12 -0
- package/dist/api/types/AudioPullResponse.js +2 -0
- package/dist/api/types/AudioPullStatusResponse.d.ts +22 -0
- package/dist/api/types/AudioPullStatusResponse.js +15 -0
- package/dist/api/types/AudioPulledPayload.d.ts +3 -0
- package/dist/api/types/AudioPulledPayload.js +2 -0
- package/dist/api/types/AudioResponse.d.ts +6 -0
- package/dist/api/types/AudioResponse.js +2 -0
- package/dist/api/types/AudioUploadOptions.d.ts +11 -0
- package/dist/api/types/AudioUploadOptions.js +2 -0
- package/dist/api/types/AudioUploadResponse.d.ts +24 -0
- package/dist/api/types/AudioUploadResponse.js +10 -0
- package/dist/api/types/AuthenticatedOrganizationResponse.d.ts +6 -0
- package/dist/api/types/AuthenticatedOrganizationResponse.js +2 -0
- package/dist/api/types/Chapter.d.ts +5 -0
- package/dist/api/types/Chapter.js +2 -0
- package/dist/api/types/CoverUploadOptions.d.ts +11 -0
- package/dist/api/types/CoverUploadOptions.js +2 -0
- package/dist/api/types/CoverUploadResponse.d.ts +23 -0
- package/dist/api/types/CoverUploadResponse.js +10 -0
- package/dist/api/types/Episode.d.ts +42 -0
- package/dist/api/types/Episode.js +15 -0
- package/dist/api/types/EpisodeCreateResponse.d.ts +6 -0
- package/dist/api/types/EpisodeCreateResponse.js +2 -0
- package/dist/api/types/EpisodeCreatedResponseData.d.ts +44 -0
- package/dist/api/types/EpisodeCreatedResponseData.js +15 -0
- package/dist/api/types/EpisodeId.d.ts +9 -0
- package/dist/api/types/EpisodeId.js +7 -0
- package/dist/api/types/EpisodeResponse.d.ts +6 -0
- package/dist/api/types/EpisodeResponse.js +2 -0
- package/dist/api/types/EpisodeTranscript.d.ts +6 -0
- package/dist/api/types/EpisodeTranscript.js +2 -0
- package/dist/api/types/EpisodesResponse.d.ts +6 -0
- package/dist/api/types/EpisodesResponse.js +2 -0
- package/dist/api/types/InternalServerErrorBody.d.ts +8 -0
- package/dist/api/types/InternalServerErrorBody.js +2 -0
- package/dist/api/types/InternalServerErrorResponse.d.ts +6 -0
- package/dist/api/types/InternalServerErrorResponse.js +2 -0
- package/dist/api/types/ListWebhookDestinationsResponse.d.ts +6 -0
- package/dist/api/types/ListWebhookDestinationsResponse.js +2 -0
- package/dist/api/types/ListWebhookEventsResponse.d.ts +6 -0
- package/dist/api/types/ListWebhookEventsResponse.js +2 -0
- package/dist/api/types/Listeners.d.ts +4 -0
- package/dist/api/types/Listeners.js +2 -0
- package/dist/api/types/ListenersReport.d.ts +5 -0
- package/dist/api/types/ListenersReport.js +2 -0
- package/dist/api/types/ListenersReportResponse.d.ts +6 -0
- package/dist/api/types/ListenersReportResponse.js +2 -0
- package/dist/api/types/MonthlyListenersResponse.d.ts +6 -0
- package/dist/api/types/MonthlyListenersResponse.js +2 -0
- package/dist/api/types/NotFoundErrorBody.d.ts +8 -0
- package/dist/api/types/NotFoundErrorBody.js +2 -0
- package/dist/api/types/NotFoundErrorResponse.d.ts +6 -0
- package/dist/api/types/NotFoundErrorResponse.js +2 -0
- package/dist/api/types/NullResponse.d.ts +6 -0
- package/dist/api/types/NullResponse.js +2 -0
- package/dist/api/types/Organization.d.ts +19 -0
- package/dist/api/types/Organization.js +12 -0
- package/dist/api/types/Person.d.ts +7 -0
- package/dist/api/types/Person.js +2 -0
- package/dist/api/types/Podcast.d.ts +65 -0
- package/dist/api/types/Podcast.js +15 -0
- package/dist/api/types/PodcastImportCompletedPayload.d.ts +3 -0
- package/dist/api/types/PodcastImportCompletedPayload.js +2 -0
- package/dist/api/types/PodcastImportFailedPayload.d.ts +5 -0
- package/dist/api/types/PodcastImportFailedPayload.js +2 -0
- package/dist/api/types/PodcastResponse.d.ts +6 -0
- package/dist/api/types/PodcastResponse.js +2 -0
- package/dist/api/types/PodcastsResponse.d.ts +6 -0
- package/dist/api/types/PodcastsResponse.js +2 -0
- package/dist/api/types/PublishPodcastOutput.d.ts +3 -0
- package/dist/api/types/PublishPodcastOutput.js +2 -0
- package/dist/api/types/RetrieveCoverResponse.d.ts +11 -0
- package/dist/api/types/RetrieveCoverResponse.js +2 -0
- package/dist/api/types/Segment.d.ts +25 -0
- package/dist/api/types/Segment.js +13 -0
- package/dist/api/types/SegmentId.d.ts +9 -0
- package/dist/api/types/SegmentId.js +7 -0
- package/dist/api/types/SegmentListResponse.d.ts +6 -0
- package/dist/api/types/SegmentListResponse.js +2 -0
- package/dist/api/types/SegmentResponse.d.ts +6 -0
- package/dist/api/types/SegmentResponse.js +2 -0
- package/dist/api/types/StringOrNullResponse.d.ts +6 -0
- package/dist/api/types/StringOrNullResponse.js +2 -0
- package/dist/api/types/StringResponse.d.ts +6 -0
- package/dist/api/types/StringResponse.js +2 -0
- package/dist/api/types/TranscriptCompletedPayload.d.ts +4 -0
- package/dist/api/types/TranscriptCompletedPayload.js +2 -0
- package/dist/api/types/UnauthenticatedError.d.ts +8 -0
- package/dist/api/types/UnauthenticatedError.js +2 -0
- package/dist/api/types/UnauthenticatedErrorResponse.d.ts +6 -0
- package/dist/api/types/UnauthenticatedErrorResponse.js +2 -0
- package/dist/api/types/UnauthorizedErrorBody.d.ts +8 -0
- package/dist/api/types/UnauthorizedErrorBody.js +2 -0
- package/dist/api/types/UnauthorizedErrorResponse.d.ts +6 -0
- package/dist/api/types/UnauthorizedErrorResponse.js +2 -0
- package/dist/api/types/UserUploadAudioResponse.d.ts +6 -0
- package/dist/api/types/UserUploadAudioResponse.js +2 -0
- package/dist/api/types/UserUploadAudioResult.d.ts +5 -0
- package/dist/api/types/UserUploadAudioResult.js +2 -0
- package/dist/api/types/UserUploadCoverResponse.d.ts +6 -0
- package/dist/api/types/UserUploadCoverResponse.js +2 -0
- package/dist/api/types/UserUploadCoverResult.d.ts +5 -0
- package/dist/api/types/UserUploadCoverResult.js +2 -0
- package/dist/api/types/UserUploadCoverResultResponse.d.ts +6 -0
- package/dist/api/types/UserUploadCoverResultResponse.js +2 -0
- package/dist/api/types/ValidationErrorResponse.d.ts +6 -0
- package/dist/api/types/ValidationErrorResponse.js +2 -0
- package/dist/api/types/ValidationIssue.d.ts +17 -0
- package/dist/api/types/ValidationIssue.js +11 -0
- package/dist/api/types/VirtualUser.d.ts +10 -0
- package/dist/api/types/VirtualUser.js +2 -0
- package/dist/api/types/VirtualUserListResponse.d.ts +6 -0
- package/dist/api/types/VirtualUserListResponse.js +2 -0
- package/dist/api/types/VirtualUserResponse.d.ts +6 -0
- package/dist/api/types/VirtualUserResponse.js +2 -0
- package/dist/api/types/WebhookDestination.d.ts +7 -0
- package/dist/api/types/WebhookDestination.js +2 -0
- package/dist/api/types/WebhookDestinationResponse.d.ts +6 -0
- package/dist/api/types/WebhookDestinationResponse.js +2 -0
- package/dist/api/types/WebhookEvent.d.ts +28 -0
- package/dist/api/types/WebhookEvent.js +16 -0
- package/dist/api/types/index.d.ts +76 -0
- package/dist/api/types/index.js +76 -0
- package/dist/auth/BearerAuthProvider.d.ts +16 -0
- package/dist/auth/BearerAuthProvider.js +23 -0
- package/dist/auth/index.d.ts +1 -0
- package/dist/auth/index.js +1 -0
- package/dist/core/auth/AuthProvider.d.ts +7 -0
- package/dist/core/auth/AuthProvider.js +1 -0
- package/dist/core/auth/AuthRequest.d.ts +9 -0
- package/dist/core/auth/AuthRequest.js +1 -0
- package/dist/core/auth/BasicAuth.d.ts +8 -0
- package/dist/core/auth/BasicAuth.js +24 -0
- package/dist/core/auth/BearerToken.d.ts +7 -0
- package/dist/core/auth/BearerToken.js +13 -0
- package/dist/core/auth/NoOpAuthProvider.d.ts +5 -0
- package/dist/core/auth/NoOpAuthProvider.js +5 -0
- package/dist/core/auth/index.d.ts +5 -0
- package/dist/core/auth/index.js +3 -0
- package/dist/core/base64.d.ts +2 -0
- package/dist/core/base64.js +22 -0
- package/dist/core/exports.d.ts +1 -0
- package/dist/core/exports.js +1 -0
- package/dist/core/fetcher/APIResponse.d.ts +20 -0
- package/dist/core/fetcher/APIResponse.js +1 -0
- package/dist/core/fetcher/BinaryResponse.d.ts +19 -0
- package/dist/core/fetcher/BinaryResponse.js +14 -0
- package/dist/core/fetcher/EndpointMetadata.d.ts +13 -0
- package/dist/core/fetcher/EndpointMetadata.js +1 -0
- package/dist/core/fetcher/EndpointSupplier.d.ts +12 -0
- package/dist/core/fetcher/EndpointSupplier.js +10 -0
- package/dist/core/fetcher/Fetcher.d.ts +49 -0
- package/dist/core/fetcher/Fetcher.js +295 -0
- package/dist/core/fetcher/Headers.d.ts +2 -0
- package/dist/core/fetcher/Headers.js +83 -0
- package/dist/core/fetcher/HttpResponsePromise.d.ts +58 -0
- package/dist/core/fetcher/HttpResponsePromise.js +90 -0
- package/dist/core/fetcher/RawResponse.d.ts +29 -0
- package/dist/core/fetcher/RawResponse.js +40 -0
- package/dist/core/fetcher/Supplier.d.ts +4 -0
- package/dist/core/fetcher/Supplier.js +10 -0
- package/dist/core/fetcher/createRequestUrl.d.ts +1 -0
- package/dist/core/fetcher/createRequestUrl.js +5 -0
- package/dist/core/fetcher/getErrorResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getErrorResponseBody.js +30 -0
- package/dist/core/fetcher/getFetchFn.d.ts +1 -0
- package/dist/core/fetcher/getFetchFn.js +3 -0
- package/dist/core/fetcher/getHeader.d.ts +1 -0
- package/dist/core/fetcher/getHeader.js +8 -0
- package/dist/core/fetcher/getRequestBody.d.ts +7 -0
- package/dist/core/fetcher/getRequestBody.js +13 -0
- package/dist/core/fetcher/getResponseBody.d.ts +1 -0
- package/dist/core/fetcher/getResponseBody.js +55 -0
- package/dist/core/fetcher/index.d.ts +11 -0
- package/dist/core/fetcher/index.js +6 -0
- package/dist/core/fetcher/makeRequest.d.ts +1 -0
- package/dist/core/fetcher/makeRequest.js +27 -0
- package/dist/core/fetcher/requestWithRetries.d.ts +1 -0
- package/dist/core/fetcher/requestWithRetries.js +53 -0
- package/dist/core/fetcher/signals.d.ts +5 -0
- package/dist/core/fetcher/signals.js +20 -0
- package/dist/core/headers.d.ts +2 -0
- package/dist/core/headers.js +27 -0
- package/dist/core/index.d.ts +6 -0
- package/dist/core/index.js +6 -0
- package/dist/core/json.d.ts +15 -0
- package/dist/core/json.js +19 -0
- package/dist/core/logging/exports.d.ts +18 -0
- package/dist/core/logging/exports.js +9 -0
- package/dist/core/logging/index.d.ts +1 -0
- package/dist/core/logging/index.js +1 -0
- package/dist/core/logging/logger.d.ts +126 -0
- package/dist/core/logging/logger.js +140 -0
- package/dist/core/runtime/index.d.ts +1 -0
- package/dist/core/runtime/index.js +1 -0
- package/dist/core/runtime/runtime.d.ts +9 -0
- package/dist/core/runtime/runtime.js +99 -0
- package/dist/core/url/encodePathParam.d.ts +1 -0
- package/dist/core/url/encodePathParam.js +18 -0
- package/dist/core/url/index.d.ts +3 -0
- package/dist/core/url/index.js +3 -0
- package/dist/core/url/join.d.ts +1 -0
- package/dist/core/url/join.js +65 -0
- package/dist/core/url/qs.d.ts +6 -0
- package/dist/core/url/qs.js +64 -0
- package/dist/environments.d.ts +4 -0
- package/dist/environments.js +4 -0
- package/dist/errors/IchosError.d.ts +12 -0
- package/dist/errors/IchosError.js +31 -0
- package/dist/errors/IchosTimeoutError.d.ts +3 -0
- package/dist/errors/IchosTimeoutError.js +11 -0
- package/dist/errors/handleNonStatusCodeError.d.ts +2 -0
- package/dist/errors/handleNonStatusCodeError.js +29 -0
- package/dist/errors/index.d.ts +2 -0
- package/dist/errors/index.js +2 -0
- package/dist/exports.d.ts +1 -0
- package/dist/exports.js +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.js +5 -0
- package/package.json +23 -0
|
@@ -0,0 +1,293 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
3
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js";
|
|
4
|
+
import * as core from "../../../../core/index.js";
|
|
5
|
+
import * as environments from "../../../../environments.js";
|
|
6
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js";
|
|
7
|
+
import * as errors from "../../../../errors/index.js";
|
|
8
|
+
import * as Ichos from "../../../index.js";
|
|
9
|
+
export class UsersClient {
|
|
10
|
+
_options;
|
|
11
|
+
constructor(options) {
|
|
12
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Retrieve the current virtual user based on the header.
|
|
16
|
+
*
|
|
17
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
18
|
+
*
|
|
19
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
20
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
21
|
+
* @throws {@link Ichos.NotFoundError}
|
|
22
|
+
* @throws {@link Ichos.InternalServerError}
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* await client.users.getCurrentVirtualUser()
|
|
26
|
+
*/
|
|
27
|
+
getCurrentVirtualUser(requestOptions) {
|
|
28
|
+
return core.HttpResponsePromise.fromPromise(this.__getCurrentVirtualUser(requestOptions));
|
|
29
|
+
}
|
|
30
|
+
async __getCurrentVirtualUser(requestOptions) {
|
|
31
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
32
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, mergeOnlyDefinedHeaders({ "x-virtual-user": requestOptions?.virtualUser ?? this._options?.virtualUser }), requestOptions?.headers);
|
|
33
|
+
const _response = await core.fetcher({
|
|
34
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
35
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
36
|
+
environments.IchosEnvironment.Default, "v1/users"),
|
|
37
|
+
method: "GET",
|
|
38
|
+
headers: _headers,
|
|
39
|
+
queryParameters: requestOptions?.queryParams,
|
|
40
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
41
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
42
|
+
abortSignal: requestOptions?.abortSignal,
|
|
43
|
+
fetchFn: this._options?.fetch,
|
|
44
|
+
logging: this._options.logging,
|
|
45
|
+
});
|
|
46
|
+
if (_response.ok) {
|
|
47
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
48
|
+
}
|
|
49
|
+
if (_response.error.reason === "status-code") {
|
|
50
|
+
switch (_response.error.statusCode) {
|
|
51
|
+
case 401:
|
|
52
|
+
throw new Ichos.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
53
|
+
case 403:
|
|
54
|
+
throw new Ichos.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
55
|
+
case 404:
|
|
56
|
+
throw new Ichos.NotFoundError(_response.error.body, _response.rawResponse);
|
|
57
|
+
case 500:
|
|
58
|
+
throw new Ichos.InternalServerError(_response.error.body, _response.rawResponse);
|
|
59
|
+
default:
|
|
60
|
+
throw new errors.IchosError({
|
|
61
|
+
statusCode: _response.error.statusCode,
|
|
62
|
+
body: _response.error.body,
|
|
63
|
+
rawResponse: _response.rawResponse,
|
|
64
|
+
});
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users");
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Delete the currently authenticated virtual user.
|
|
71
|
+
*
|
|
72
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
73
|
+
*
|
|
74
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
75
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
76
|
+
* @throws {@link Ichos.NotFoundError}
|
|
77
|
+
* @throws {@link Ichos.InternalServerError}
|
|
78
|
+
*
|
|
79
|
+
* @example
|
|
80
|
+
* await client.users.deleteCurrentVirtualUser()
|
|
81
|
+
*/
|
|
82
|
+
deleteCurrentVirtualUser(requestOptions) {
|
|
83
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteCurrentVirtualUser(requestOptions));
|
|
84
|
+
}
|
|
85
|
+
async __deleteCurrentVirtualUser(requestOptions) {
|
|
86
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
87
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, mergeOnlyDefinedHeaders({ "x-virtual-user": requestOptions?.virtualUser ?? this._options?.virtualUser }), requestOptions?.headers);
|
|
88
|
+
const _response = await core.fetcher({
|
|
89
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
90
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
91
|
+
environments.IchosEnvironment.Default, "v1/users"),
|
|
92
|
+
method: "DELETE",
|
|
93
|
+
headers: _headers,
|
|
94
|
+
queryParameters: requestOptions?.queryParams,
|
|
95
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
96
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
97
|
+
abortSignal: requestOptions?.abortSignal,
|
|
98
|
+
fetchFn: this._options?.fetch,
|
|
99
|
+
logging: this._options.logging,
|
|
100
|
+
});
|
|
101
|
+
if (_response.ok) {
|
|
102
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
103
|
+
}
|
|
104
|
+
if (_response.error.reason === "status-code") {
|
|
105
|
+
switch (_response.error.statusCode) {
|
|
106
|
+
case 401:
|
|
107
|
+
throw new Ichos.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
108
|
+
case 403:
|
|
109
|
+
throw new Ichos.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
110
|
+
case 404:
|
|
111
|
+
throw new Ichos.NotFoundError(_response.error.body, _response.rawResponse);
|
|
112
|
+
case 500:
|
|
113
|
+
throw new Ichos.InternalServerError(_response.error.body, _response.rawResponse);
|
|
114
|
+
default:
|
|
115
|
+
throw new errors.IchosError({
|
|
116
|
+
statusCode: _response.error.statusCode,
|
|
117
|
+
body: _response.error.body,
|
|
118
|
+
rawResponse: _response.rawResponse,
|
|
119
|
+
});
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/users");
|
|
123
|
+
}
|
|
124
|
+
/**
|
|
125
|
+
* Update details of the current virtual user.
|
|
126
|
+
*
|
|
127
|
+
* @param {Ichos.UpdateCurrentVirtualUserRequest} request
|
|
128
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
129
|
+
*
|
|
130
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
131
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
132
|
+
* @throws {@link Ichos.NotFoundError}
|
|
133
|
+
* @throws {@link Ichos.InternalServerError}
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* await client.users.updateCurrentVirtualUser()
|
|
137
|
+
*/
|
|
138
|
+
updateCurrentVirtualUser(request = {}, requestOptions) {
|
|
139
|
+
return core.HttpResponsePromise.fromPromise(this.__updateCurrentVirtualUser(request, requestOptions));
|
|
140
|
+
}
|
|
141
|
+
async __updateCurrentVirtualUser(request = {}, requestOptions) {
|
|
142
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
143
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, mergeOnlyDefinedHeaders({ "x-virtual-user": requestOptions?.virtualUser ?? this._options?.virtualUser }), requestOptions?.headers);
|
|
144
|
+
const _response = await core.fetcher({
|
|
145
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
146
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
147
|
+
environments.IchosEnvironment.Default, "v1/users"),
|
|
148
|
+
method: "PATCH",
|
|
149
|
+
headers: _headers,
|
|
150
|
+
contentType: "application/json",
|
|
151
|
+
queryParameters: requestOptions?.queryParams,
|
|
152
|
+
requestType: "json",
|
|
153
|
+
body: request,
|
|
154
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
155
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
156
|
+
abortSignal: requestOptions?.abortSignal,
|
|
157
|
+
fetchFn: this._options?.fetch,
|
|
158
|
+
logging: this._options.logging,
|
|
159
|
+
});
|
|
160
|
+
if (_response.ok) {
|
|
161
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
162
|
+
}
|
|
163
|
+
if (_response.error.reason === "status-code") {
|
|
164
|
+
switch (_response.error.statusCode) {
|
|
165
|
+
case 401:
|
|
166
|
+
throw new Ichos.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
167
|
+
case 403:
|
|
168
|
+
throw new Ichos.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
169
|
+
case 404:
|
|
170
|
+
throw new Ichos.NotFoundError(_response.error.body, _response.rawResponse);
|
|
171
|
+
case 500:
|
|
172
|
+
throw new Ichos.InternalServerError(_response.error.body, _response.rawResponse);
|
|
173
|
+
default:
|
|
174
|
+
throw new errors.IchosError({
|
|
175
|
+
statusCode: _response.error.statusCode,
|
|
176
|
+
body: _response.error.body,
|
|
177
|
+
rawResponse: _response.rawResponse,
|
|
178
|
+
});
|
|
179
|
+
}
|
|
180
|
+
}
|
|
181
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v1/users");
|
|
182
|
+
}
|
|
183
|
+
/**
|
|
184
|
+
* Retrieve all virtual users associated with the authenticated organization.
|
|
185
|
+
*
|
|
186
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
187
|
+
*
|
|
188
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
189
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
190
|
+
* @throws {@link Ichos.NotFoundError}
|
|
191
|
+
* @throws {@link Ichos.InternalServerError}
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* await client.users.listVirtualUsers()
|
|
195
|
+
*/
|
|
196
|
+
listVirtualUsers(requestOptions) {
|
|
197
|
+
return core.HttpResponsePromise.fromPromise(this.__listVirtualUsers(requestOptions));
|
|
198
|
+
}
|
|
199
|
+
async __listVirtualUsers(requestOptions) {
|
|
200
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
201
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, mergeOnlyDefinedHeaders({ "x-virtual-user": requestOptions?.virtualUser ?? this._options?.virtualUser }), requestOptions?.headers);
|
|
202
|
+
const _response = await core.fetcher({
|
|
203
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
204
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
205
|
+
environments.IchosEnvironment.Default, "v1/users/all"),
|
|
206
|
+
method: "GET",
|
|
207
|
+
headers: _headers,
|
|
208
|
+
queryParameters: requestOptions?.queryParams,
|
|
209
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
210
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
211
|
+
abortSignal: requestOptions?.abortSignal,
|
|
212
|
+
fetchFn: this._options?.fetch,
|
|
213
|
+
logging: this._options.logging,
|
|
214
|
+
});
|
|
215
|
+
if (_response.ok) {
|
|
216
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
217
|
+
}
|
|
218
|
+
if (_response.error.reason === "status-code") {
|
|
219
|
+
switch (_response.error.statusCode) {
|
|
220
|
+
case 401:
|
|
221
|
+
throw new Ichos.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
222
|
+
case 403:
|
|
223
|
+
throw new Ichos.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
224
|
+
case 404:
|
|
225
|
+
throw new Ichos.NotFoundError(_response.error.body, _response.rawResponse);
|
|
226
|
+
case 500:
|
|
227
|
+
throw new Ichos.InternalServerError(_response.error.body, _response.rawResponse);
|
|
228
|
+
default:
|
|
229
|
+
throw new errors.IchosError({
|
|
230
|
+
statusCode: _response.error.statusCode,
|
|
231
|
+
body: _response.error.body,
|
|
232
|
+
rawResponse: _response.rawResponse,
|
|
233
|
+
});
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users/all");
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* Retrieve listener analytics for the current virtual user.
|
|
240
|
+
*
|
|
241
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
242
|
+
*
|
|
243
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
244
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
245
|
+
* @throws {@link Ichos.NotFoundError}
|
|
246
|
+
* @throws {@link Ichos.InternalServerError}
|
|
247
|
+
*
|
|
248
|
+
* @example
|
|
249
|
+
* await client.users.getVirtualUserListenersReport()
|
|
250
|
+
*/
|
|
251
|
+
getVirtualUserListenersReport(requestOptions) {
|
|
252
|
+
return core.HttpResponsePromise.fromPromise(this.__getVirtualUserListenersReport(requestOptions));
|
|
253
|
+
}
|
|
254
|
+
async __getVirtualUserListenersReport(requestOptions) {
|
|
255
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
256
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, mergeOnlyDefinedHeaders({ "x-virtual-user": requestOptions?.virtualUser ?? this._options?.virtualUser }), requestOptions?.headers);
|
|
257
|
+
const _response = await core.fetcher({
|
|
258
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
259
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
260
|
+
environments.IchosEnvironment.Default, "v1/users/analytics/listens"),
|
|
261
|
+
method: "GET",
|
|
262
|
+
headers: _headers,
|
|
263
|
+
queryParameters: requestOptions?.queryParams,
|
|
264
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
265
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
266
|
+
abortSignal: requestOptions?.abortSignal,
|
|
267
|
+
fetchFn: this._options?.fetch,
|
|
268
|
+
logging: this._options.logging,
|
|
269
|
+
});
|
|
270
|
+
if (_response.ok) {
|
|
271
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
272
|
+
}
|
|
273
|
+
if (_response.error.reason === "status-code") {
|
|
274
|
+
switch (_response.error.statusCode) {
|
|
275
|
+
case 401:
|
|
276
|
+
throw new Ichos.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
277
|
+
case 403:
|
|
278
|
+
throw new Ichos.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
279
|
+
case 404:
|
|
280
|
+
throw new Ichos.NotFoundError(_response.error.body, _response.rawResponse);
|
|
281
|
+
case 500:
|
|
282
|
+
throw new Ichos.InternalServerError(_response.error.body, _response.rawResponse);
|
|
283
|
+
default:
|
|
284
|
+
throw new errors.IchosError({
|
|
285
|
+
statusCode: _response.error.statusCode,
|
|
286
|
+
body: _response.error.body,
|
|
287
|
+
rawResponse: _response.rawResponse,
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
}
|
|
291
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/users/analytics/listens");
|
|
292
|
+
}
|
|
293
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export type { UpdateCurrentVirtualUserRequest } from "./UpdateCurrentVirtualUserRequest.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./client/index.js";
|
|
@@ -0,0 +1,76 @@
|
|
|
1
|
+
import type { BaseClientOptions, BaseRequestOptions } from "../../../../BaseClient.js";
|
|
2
|
+
import { type NormalizedClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
3
|
+
import * as core from "../../../../core/index.js";
|
|
4
|
+
import * as Ichos from "../../../index.js";
|
|
5
|
+
export declare namespace WebhooksClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class WebhooksClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<WebhooksClient.Options>;
|
|
12
|
+
constructor(options: WebhooksClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Register a new webhook destination.
|
|
15
|
+
* Events will be POSTed to this URL.
|
|
16
|
+
*
|
|
17
|
+
* @param {Ichos.CreateWebhookDestinationRequest} request
|
|
18
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
19
|
+
*
|
|
20
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
21
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
22
|
+
* @throws {@link Ichos.InternalServerError}
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* await client.webhooks.createWebhookDestination({
|
|
26
|
+
* destinationUrl: "destinationUrl"
|
|
27
|
+
* })
|
|
28
|
+
*/
|
|
29
|
+
createWebhookDestination(request: Ichos.CreateWebhookDestinationRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<Ichos.WebhookDestinationResponse>;
|
|
30
|
+
private __createWebhookDestination;
|
|
31
|
+
/**
|
|
32
|
+
* List all webhook destinations for the organization.
|
|
33
|
+
*
|
|
34
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
35
|
+
*
|
|
36
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
37
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
38
|
+
* @throws {@link Ichos.InternalServerError}
|
|
39
|
+
*
|
|
40
|
+
* @example
|
|
41
|
+
* await client.webhooks.listWebhookDestinations()
|
|
42
|
+
*/
|
|
43
|
+
listWebhookDestinations(requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<Ichos.ListWebhookDestinationsResponse>;
|
|
44
|
+
private __listWebhookDestinations;
|
|
45
|
+
/**
|
|
46
|
+
* Delete a registered webhook destination.
|
|
47
|
+
*
|
|
48
|
+
* @param {Ichos.DeleteWebhookDestinationRequest} request
|
|
49
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
50
|
+
*
|
|
51
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
52
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
53
|
+
* @throws {@link Ichos.InternalServerError}
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* await client.webhooks.deleteWebhookDestination({
|
|
57
|
+
* destinationId: "destinationId"
|
|
58
|
+
* })
|
|
59
|
+
*/
|
|
60
|
+
deleteWebhookDestination(request: Ichos.DeleteWebhookDestinationRequest, requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<void>;
|
|
61
|
+
private __deleteWebhookDestination;
|
|
62
|
+
/**
|
|
63
|
+
* List recent webhook events triggered for the organization.
|
|
64
|
+
*
|
|
65
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
66
|
+
*
|
|
67
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
68
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
69
|
+
* @throws {@link Ichos.InternalServerError}
|
|
70
|
+
*
|
|
71
|
+
* @example
|
|
72
|
+
* await client.webhooks.listWebhookEvents()
|
|
73
|
+
*/
|
|
74
|
+
listWebhookEvents(requestOptions?: WebhooksClient.RequestOptions): core.HttpResponsePromise<Ichos.ListWebhookEventsResponse>;
|
|
75
|
+
private __listWebhookEvents;
|
|
76
|
+
}
|
|
@@ -0,0 +1,236 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
import { normalizeClientOptionsWithAuth } from "../../../../BaseClient.js";
|
|
3
|
+
import { mergeHeaders, mergeOnlyDefinedHeaders } from "../../../../core/headers.js";
|
|
4
|
+
import * as core from "../../../../core/index.js";
|
|
5
|
+
import * as environments from "../../../../environments.js";
|
|
6
|
+
import { handleNonStatusCodeError } from "../../../../errors/handleNonStatusCodeError.js";
|
|
7
|
+
import * as errors from "../../../../errors/index.js";
|
|
8
|
+
import * as Ichos from "../../../index.js";
|
|
9
|
+
export class WebhooksClient {
|
|
10
|
+
_options;
|
|
11
|
+
constructor(options) {
|
|
12
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Register a new webhook destination.
|
|
16
|
+
* Events will be POSTed to this URL.
|
|
17
|
+
*
|
|
18
|
+
* @param {Ichos.CreateWebhookDestinationRequest} request
|
|
19
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
20
|
+
*
|
|
21
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
22
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
23
|
+
* @throws {@link Ichos.InternalServerError}
|
|
24
|
+
*
|
|
25
|
+
* @example
|
|
26
|
+
* await client.webhooks.createWebhookDestination({
|
|
27
|
+
* destinationUrl: "destinationUrl"
|
|
28
|
+
* })
|
|
29
|
+
*/
|
|
30
|
+
createWebhookDestination(request, requestOptions) {
|
|
31
|
+
return core.HttpResponsePromise.fromPromise(this.__createWebhookDestination(request, requestOptions));
|
|
32
|
+
}
|
|
33
|
+
async __createWebhookDestination(request, requestOptions) {
|
|
34
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
35
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, mergeOnlyDefinedHeaders({ "x-virtual-user": requestOptions?.virtualUser ?? this._options?.virtualUser }), requestOptions?.headers);
|
|
36
|
+
const _response = await core.fetcher({
|
|
37
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
38
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
39
|
+
environments.IchosEnvironment.Default, "v1/webhooks/destination"),
|
|
40
|
+
method: "POST",
|
|
41
|
+
headers: _headers,
|
|
42
|
+
contentType: "application/json",
|
|
43
|
+
queryParameters: requestOptions?.queryParams,
|
|
44
|
+
requestType: "json",
|
|
45
|
+
body: request,
|
|
46
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
47
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
48
|
+
abortSignal: requestOptions?.abortSignal,
|
|
49
|
+
fetchFn: this._options?.fetch,
|
|
50
|
+
logging: this._options.logging,
|
|
51
|
+
});
|
|
52
|
+
if (_response.ok) {
|
|
53
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
54
|
+
}
|
|
55
|
+
if (_response.error.reason === "status-code") {
|
|
56
|
+
switch (_response.error.statusCode) {
|
|
57
|
+
case 401:
|
|
58
|
+
throw new Ichos.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
59
|
+
case 403:
|
|
60
|
+
throw new Ichos.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
61
|
+
case 500:
|
|
62
|
+
throw new Ichos.InternalServerError(_response.error.body, _response.rawResponse);
|
|
63
|
+
default:
|
|
64
|
+
throw new errors.IchosError({
|
|
65
|
+
statusCode: _response.error.statusCode,
|
|
66
|
+
body: _response.error.body,
|
|
67
|
+
rawResponse: _response.rawResponse,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/webhooks/destination");
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* List all webhook destinations for the organization.
|
|
75
|
+
*
|
|
76
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
77
|
+
*
|
|
78
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
79
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
80
|
+
* @throws {@link Ichos.InternalServerError}
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* await client.webhooks.listWebhookDestinations()
|
|
84
|
+
*/
|
|
85
|
+
listWebhookDestinations(requestOptions) {
|
|
86
|
+
return core.HttpResponsePromise.fromPromise(this.__listWebhookDestinations(requestOptions));
|
|
87
|
+
}
|
|
88
|
+
async __listWebhookDestinations(requestOptions) {
|
|
89
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
90
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, mergeOnlyDefinedHeaders({ "x-virtual-user": requestOptions?.virtualUser ?? this._options?.virtualUser }), requestOptions?.headers);
|
|
91
|
+
const _response = await core.fetcher({
|
|
92
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
93
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
94
|
+
environments.IchosEnvironment.Default, "v1/webhooks/destinations"),
|
|
95
|
+
method: "GET",
|
|
96
|
+
headers: _headers,
|
|
97
|
+
queryParameters: requestOptions?.queryParams,
|
|
98
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
99
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
100
|
+
abortSignal: requestOptions?.abortSignal,
|
|
101
|
+
fetchFn: this._options?.fetch,
|
|
102
|
+
logging: this._options.logging,
|
|
103
|
+
});
|
|
104
|
+
if (_response.ok) {
|
|
105
|
+
return {
|
|
106
|
+
data: _response.body,
|
|
107
|
+
rawResponse: _response.rawResponse,
|
|
108
|
+
};
|
|
109
|
+
}
|
|
110
|
+
if (_response.error.reason === "status-code") {
|
|
111
|
+
switch (_response.error.statusCode) {
|
|
112
|
+
case 401:
|
|
113
|
+
throw new Ichos.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
114
|
+
case 403:
|
|
115
|
+
throw new Ichos.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
116
|
+
case 500:
|
|
117
|
+
throw new Ichos.InternalServerError(_response.error.body, _response.rawResponse);
|
|
118
|
+
default:
|
|
119
|
+
throw new errors.IchosError({
|
|
120
|
+
statusCode: _response.error.statusCode,
|
|
121
|
+
body: _response.error.body,
|
|
122
|
+
rawResponse: _response.rawResponse,
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
}
|
|
126
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/webhooks/destinations");
|
|
127
|
+
}
|
|
128
|
+
/**
|
|
129
|
+
* Delete a registered webhook destination.
|
|
130
|
+
*
|
|
131
|
+
* @param {Ichos.DeleteWebhookDestinationRequest} request
|
|
132
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
133
|
+
*
|
|
134
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
135
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
136
|
+
* @throws {@link Ichos.InternalServerError}
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* await client.webhooks.deleteWebhookDestination({
|
|
140
|
+
* destinationId: "destinationId"
|
|
141
|
+
* })
|
|
142
|
+
*/
|
|
143
|
+
deleteWebhookDestination(request, requestOptions) {
|
|
144
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteWebhookDestination(request, requestOptions));
|
|
145
|
+
}
|
|
146
|
+
async __deleteWebhookDestination(request, requestOptions) {
|
|
147
|
+
const { destinationId } = request;
|
|
148
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
149
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, mergeOnlyDefinedHeaders({ "x-virtual-user": requestOptions?.virtualUser ?? this._options?.virtualUser }), requestOptions?.headers);
|
|
150
|
+
const _response = await core.fetcher({
|
|
151
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
152
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
153
|
+
environments.IchosEnvironment.Default, `v1/webhooks/destinations/${core.url.encodePathParam(destinationId)}`),
|
|
154
|
+
method: "DELETE",
|
|
155
|
+
headers: _headers,
|
|
156
|
+
queryParameters: requestOptions?.queryParams,
|
|
157
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
158
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
159
|
+
abortSignal: requestOptions?.abortSignal,
|
|
160
|
+
fetchFn: this._options?.fetch,
|
|
161
|
+
logging: this._options.logging,
|
|
162
|
+
});
|
|
163
|
+
if (_response.ok) {
|
|
164
|
+
return { data: undefined, rawResponse: _response.rawResponse };
|
|
165
|
+
}
|
|
166
|
+
if (_response.error.reason === "status-code") {
|
|
167
|
+
switch (_response.error.statusCode) {
|
|
168
|
+
case 401:
|
|
169
|
+
throw new Ichos.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
170
|
+
case 403:
|
|
171
|
+
throw new Ichos.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
172
|
+
case 500:
|
|
173
|
+
throw new Ichos.InternalServerError(_response.error.body, _response.rawResponse);
|
|
174
|
+
default:
|
|
175
|
+
throw new errors.IchosError({
|
|
176
|
+
statusCode: _response.error.statusCode,
|
|
177
|
+
body: _response.error.body,
|
|
178
|
+
rawResponse: _response.rawResponse,
|
|
179
|
+
});
|
|
180
|
+
}
|
|
181
|
+
}
|
|
182
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/webhooks/destinations/{destinationId}");
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* List recent webhook events triggered for the organization.
|
|
186
|
+
*
|
|
187
|
+
* @param {WebhooksClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
188
|
+
*
|
|
189
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
190
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
191
|
+
* @throws {@link Ichos.InternalServerError}
|
|
192
|
+
*
|
|
193
|
+
* @example
|
|
194
|
+
* await client.webhooks.listWebhookEvents()
|
|
195
|
+
*/
|
|
196
|
+
listWebhookEvents(requestOptions) {
|
|
197
|
+
return core.HttpResponsePromise.fromPromise(this.__listWebhookEvents(requestOptions));
|
|
198
|
+
}
|
|
199
|
+
async __listWebhookEvents(requestOptions) {
|
|
200
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
201
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, mergeOnlyDefinedHeaders({ "x-virtual-user": requestOptions?.virtualUser ?? this._options?.virtualUser }), requestOptions?.headers);
|
|
202
|
+
const _response = await core.fetcher({
|
|
203
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
204
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
205
|
+
environments.IchosEnvironment.Default, "v1/webhooks/events"),
|
|
206
|
+
method: "GET",
|
|
207
|
+
headers: _headers,
|
|
208
|
+
queryParameters: requestOptions?.queryParams,
|
|
209
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
210
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
211
|
+
abortSignal: requestOptions?.abortSignal,
|
|
212
|
+
fetchFn: this._options?.fetch,
|
|
213
|
+
logging: this._options.logging,
|
|
214
|
+
});
|
|
215
|
+
if (_response.ok) {
|
|
216
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
217
|
+
}
|
|
218
|
+
if (_response.error.reason === "status-code") {
|
|
219
|
+
switch (_response.error.statusCode) {
|
|
220
|
+
case 401:
|
|
221
|
+
throw new Ichos.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
222
|
+
case 403:
|
|
223
|
+
throw new Ichos.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
224
|
+
case 500:
|
|
225
|
+
throw new Ichos.InternalServerError(_response.error.body, _response.rawResponse);
|
|
226
|
+
default:
|
|
227
|
+
throw new errors.IchosError({
|
|
228
|
+
statusCode: _response.error.statusCode,
|
|
229
|
+
body: _response.error.body,
|
|
230
|
+
rawResponse: _response.rawResponse,
|
|
231
|
+
});
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/webhooks/events");
|
|
235
|
+
}
|
|
236
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|