@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,374 @@
|
|
|
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 SegmentsClient {
|
|
10
|
+
_options;
|
|
11
|
+
constructor(options) {
|
|
12
|
+
this._options = normalizeClientOptionsWithAuth(options);
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* Retrieve all segments for the authenticated context (Virtual User or Organization).
|
|
16
|
+
*
|
|
17
|
+
* @param {SegmentsClient.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.segments.listSegments()
|
|
26
|
+
*/
|
|
27
|
+
listSegments(requestOptions) {
|
|
28
|
+
return core.HttpResponsePromise.fromPromise(this.__listSegments(requestOptions));
|
|
29
|
+
}
|
|
30
|
+
async __listSegments(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/segments"),
|
|
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/segments");
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Create a new segment.
|
|
71
|
+
* Segments can be scoped to a podcast, a virtual user, or an organization.
|
|
72
|
+
*
|
|
73
|
+
* @param {Ichos.SegmentCreate} request
|
|
74
|
+
* @param {SegmentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
75
|
+
*
|
|
76
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
77
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
78
|
+
* @throws {@link Ichos.InternalServerError}
|
|
79
|
+
*
|
|
80
|
+
* @example
|
|
81
|
+
* await client.segments.createSegment({
|
|
82
|
+
* scope: "organization",
|
|
83
|
+
* type: "intro"
|
|
84
|
+
* })
|
|
85
|
+
*/
|
|
86
|
+
createSegment(request, requestOptions) {
|
|
87
|
+
return core.HttpResponsePromise.fromPromise(this.__createSegment(request, requestOptions));
|
|
88
|
+
}
|
|
89
|
+
async __createSegment(request, requestOptions) {
|
|
90
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
91
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, mergeOnlyDefinedHeaders({ "x-virtual-user": requestOptions?.virtualUser ?? this._options?.virtualUser }), requestOptions?.headers);
|
|
92
|
+
const _response = await core.fetcher({
|
|
93
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
94
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
95
|
+
environments.IchosEnvironment.Default, "v1/segments"),
|
|
96
|
+
method: "POST",
|
|
97
|
+
headers: _headers,
|
|
98
|
+
contentType: "application/json",
|
|
99
|
+
queryParameters: requestOptions?.queryParams,
|
|
100
|
+
requestType: "json",
|
|
101
|
+
body: request,
|
|
102
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
103
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
104
|
+
abortSignal: requestOptions?.abortSignal,
|
|
105
|
+
fetchFn: this._options?.fetch,
|
|
106
|
+
logging: this._options.logging,
|
|
107
|
+
});
|
|
108
|
+
if (_response.ok) {
|
|
109
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
110
|
+
}
|
|
111
|
+
if (_response.error.reason === "status-code") {
|
|
112
|
+
switch (_response.error.statusCode) {
|
|
113
|
+
case 401:
|
|
114
|
+
throw new Ichos.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
115
|
+
case 403:
|
|
116
|
+
throw new Ichos.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
117
|
+
case 500:
|
|
118
|
+
throw new Ichos.InternalServerError(_response.error.body, _response.rawResponse);
|
|
119
|
+
default:
|
|
120
|
+
throw new errors.IchosError({
|
|
121
|
+
statusCode: _response.error.statusCode,
|
|
122
|
+
body: _response.error.body,
|
|
123
|
+
rawResponse: _response.rawResponse,
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "POST", "/v1/segments");
|
|
128
|
+
}
|
|
129
|
+
/**
|
|
130
|
+
* Link an audio file to a segment.
|
|
131
|
+
*
|
|
132
|
+
* @param {Ichos.LinkSegmentAudioRequest} request
|
|
133
|
+
* @param {SegmentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
134
|
+
*
|
|
135
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
136
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
137
|
+
* @throws {@link Ichos.InternalServerError}
|
|
138
|
+
*
|
|
139
|
+
* @example
|
|
140
|
+
* await client.segments.linkSegmentAudio({
|
|
141
|
+
* segmentId: "segmentId",
|
|
142
|
+
* audioId: "audioId"
|
|
143
|
+
* })
|
|
144
|
+
*/
|
|
145
|
+
linkSegmentAudio(request, requestOptions) {
|
|
146
|
+
return core.HttpResponsePromise.fromPromise(this.__linkSegmentAudio(request, requestOptions));
|
|
147
|
+
}
|
|
148
|
+
async __linkSegmentAudio(request, requestOptions) {
|
|
149
|
+
const { segmentId, ..._body } = request;
|
|
150
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
151
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, mergeOnlyDefinedHeaders({ "x-virtual-user": requestOptions?.virtualUser ?? this._options?.virtualUser }), requestOptions?.headers);
|
|
152
|
+
const _response = await core.fetcher({
|
|
153
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
154
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
155
|
+
environments.IchosEnvironment.Default, `v1/segments/${core.url.encodePathParam(segmentId)}/link-audio`),
|
|
156
|
+
method: "PUT",
|
|
157
|
+
headers: _headers,
|
|
158
|
+
contentType: "application/json",
|
|
159
|
+
queryParameters: requestOptions?.queryParams,
|
|
160
|
+
requestType: "json",
|
|
161
|
+
body: _body,
|
|
162
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
163
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
164
|
+
abortSignal: requestOptions?.abortSignal,
|
|
165
|
+
fetchFn: this._options?.fetch,
|
|
166
|
+
logging: this._options.logging,
|
|
167
|
+
});
|
|
168
|
+
if (_response.ok) {
|
|
169
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
170
|
+
}
|
|
171
|
+
if (_response.error.reason === "status-code") {
|
|
172
|
+
switch (_response.error.statusCode) {
|
|
173
|
+
case 401:
|
|
174
|
+
throw new Ichos.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
175
|
+
case 403:
|
|
176
|
+
throw new Ichos.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
177
|
+
case 500:
|
|
178
|
+
throw new Ichos.InternalServerError(_response.error.body, _response.rawResponse);
|
|
179
|
+
default:
|
|
180
|
+
throw new errors.IchosError({
|
|
181
|
+
statusCode: _response.error.statusCode,
|
|
182
|
+
body: _response.error.body,
|
|
183
|
+
rawResponse: _response.rawResponse,
|
|
184
|
+
});
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PUT", "/v1/segments/{segmentId}/link-audio");
|
|
188
|
+
}
|
|
189
|
+
/**
|
|
190
|
+
* Retrieve all segments for a specific podcast.
|
|
191
|
+
*
|
|
192
|
+
* @param {Ichos.ListPodcastSegmentsRequest} request
|
|
193
|
+
* @param {SegmentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
194
|
+
*
|
|
195
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
196
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
197
|
+
* @throws {@link Ichos.NotFoundError}
|
|
198
|
+
* @throws {@link Ichos.InternalServerError}
|
|
199
|
+
*
|
|
200
|
+
* @example
|
|
201
|
+
* await client.segments.listPodcastSegments({
|
|
202
|
+
* podcastId: "podcastId"
|
|
203
|
+
* })
|
|
204
|
+
*/
|
|
205
|
+
listPodcastSegments(request, requestOptions) {
|
|
206
|
+
return core.HttpResponsePromise.fromPromise(this.__listPodcastSegments(request, requestOptions));
|
|
207
|
+
}
|
|
208
|
+
async __listPodcastSegments(request, requestOptions) {
|
|
209
|
+
const { podcastId } = request;
|
|
210
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
211
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, mergeOnlyDefinedHeaders({ "x-virtual-user": requestOptions?.virtualUser ?? this._options?.virtualUser }), requestOptions?.headers);
|
|
212
|
+
const _response = await core.fetcher({
|
|
213
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
214
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
215
|
+
environments.IchosEnvironment.Default, `v1/segments/podcast/${core.url.encodePathParam(podcastId)}`),
|
|
216
|
+
method: "GET",
|
|
217
|
+
headers: _headers,
|
|
218
|
+
queryParameters: requestOptions?.queryParams,
|
|
219
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
220
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
221
|
+
abortSignal: requestOptions?.abortSignal,
|
|
222
|
+
fetchFn: this._options?.fetch,
|
|
223
|
+
logging: this._options.logging,
|
|
224
|
+
});
|
|
225
|
+
if (_response.ok) {
|
|
226
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
227
|
+
}
|
|
228
|
+
if (_response.error.reason === "status-code") {
|
|
229
|
+
switch (_response.error.statusCode) {
|
|
230
|
+
case 401:
|
|
231
|
+
throw new Ichos.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
232
|
+
case 403:
|
|
233
|
+
throw new Ichos.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
234
|
+
case 404:
|
|
235
|
+
throw new Ichos.NotFoundError(_response.error.body, _response.rawResponse);
|
|
236
|
+
case 500:
|
|
237
|
+
throw new Ichos.InternalServerError(_response.error.body, _response.rawResponse);
|
|
238
|
+
default:
|
|
239
|
+
throw new errors.IchosError({
|
|
240
|
+
statusCode: _response.error.statusCode,
|
|
241
|
+
body: _response.error.body,
|
|
242
|
+
rawResponse: _response.rawResponse,
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
}
|
|
246
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "GET", "/v1/segments/podcast/{podcastId}");
|
|
247
|
+
}
|
|
248
|
+
/**
|
|
249
|
+
* Delete a segment.
|
|
250
|
+
* Optionally delete the associated audio file.
|
|
251
|
+
*
|
|
252
|
+
* @param {Ichos.DeleteSegmentRequest} request
|
|
253
|
+
* @param {SegmentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
254
|
+
*
|
|
255
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
256
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
257
|
+
* @throws {@link Ichos.NotFoundError}
|
|
258
|
+
* @throws {@link Ichos.InternalServerError}
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* await client.segments.deleteSegment({
|
|
262
|
+
* segmentId: "segmentId"
|
|
263
|
+
* })
|
|
264
|
+
*/
|
|
265
|
+
deleteSegment(request, requestOptions) {
|
|
266
|
+
return core.HttpResponsePromise.fromPromise(this.__deleteSegment(request, requestOptions));
|
|
267
|
+
}
|
|
268
|
+
async __deleteSegment(request, requestOptions) {
|
|
269
|
+
const { segmentId, deleteAudio } = request;
|
|
270
|
+
const _queryParams = {};
|
|
271
|
+
if (deleteAudio != null) {
|
|
272
|
+
_queryParams.deleteAudio = deleteAudio.toString();
|
|
273
|
+
}
|
|
274
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
275
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, mergeOnlyDefinedHeaders({ "x-virtual-user": requestOptions?.virtualUser ?? this._options?.virtualUser }), requestOptions?.headers);
|
|
276
|
+
const _response = await core.fetcher({
|
|
277
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
278
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
279
|
+
environments.IchosEnvironment.Default, `v1/segments/${core.url.encodePathParam(segmentId)}`),
|
|
280
|
+
method: "DELETE",
|
|
281
|
+
headers: _headers,
|
|
282
|
+
queryParameters: { ..._queryParams, ...requestOptions?.queryParams },
|
|
283
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
284
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
285
|
+
abortSignal: requestOptions?.abortSignal,
|
|
286
|
+
fetchFn: this._options?.fetch,
|
|
287
|
+
logging: this._options.logging,
|
|
288
|
+
});
|
|
289
|
+
if (_response.ok) {
|
|
290
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
291
|
+
}
|
|
292
|
+
if (_response.error.reason === "status-code") {
|
|
293
|
+
switch (_response.error.statusCode) {
|
|
294
|
+
case 401:
|
|
295
|
+
throw new Ichos.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
296
|
+
case 403:
|
|
297
|
+
throw new Ichos.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
298
|
+
case 404:
|
|
299
|
+
throw new Ichos.NotFoundError(_response.error.body, _response.rawResponse);
|
|
300
|
+
case 500:
|
|
301
|
+
throw new Ichos.InternalServerError(_response.error.body, _response.rawResponse);
|
|
302
|
+
default:
|
|
303
|
+
throw new errors.IchosError({
|
|
304
|
+
statusCode: _response.error.statusCode,
|
|
305
|
+
body: _response.error.body,
|
|
306
|
+
rawResponse: _response.rawResponse,
|
|
307
|
+
});
|
|
308
|
+
}
|
|
309
|
+
}
|
|
310
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "DELETE", "/v1/segments/{segmentId}");
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Update a segment, specifiying the segment ID.
|
|
314
|
+
*
|
|
315
|
+
* @param {Ichos.SegmentUpdate} request
|
|
316
|
+
* @param {SegmentsClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
317
|
+
*
|
|
318
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
319
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
320
|
+
* @throws {@link Ichos.NotFoundError}
|
|
321
|
+
* @throws {@link Ichos.InternalServerError}
|
|
322
|
+
*
|
|
323
|
+
* @example
|
|
324
|
+
* await client.segments.updateSegment({
|
|
325
|
+
* segmentId: "segmentId"
|
|
326
|
+
* })
|
|
327
|
+
*/
|
|
328
|
+
updateSegment(request, requestOptions) {
|
|
329
|
+
return core.HttpResponsePromise.fromPromise(this.__updateSegment(request, requestOptions));
|
|
330
|
+
}
|
|
331
|
+
async __updateSegment(request, requestOptions) {
|
|
332
|
+
const { segmentId, ..._body } = request;
|
|
333
|
+
const _authRequest = await this._options.authProvider.getAuthRequest();
|
|
334
|
+
const _headers = mergeHeaders(_authRequest.headers, this._options?.headers, mergeOnlyDefinedHeaders({ "x-virtual-user": requestOptions?.virtualUser ?? this._options?.virtualUser }), requestOptions?.headers);
|
|
335
|
+
const _response = await core.fetcher({
|
|
336
|
+
url: core.url.join((await core.Supplier.get(this._options.baseUrl)) ??
|
|
337
|
+
(await core.Supplier.get(this._options.environment)) ??
|
|
338
|
+
environments.IchosEnvironment.Default, `v1/segments/${core.url.encodePathParam(segmentId)}`),
|
|
339
|
+
method: "PATCH",
|
|
340
|
+
headers: _headers,
|
|
341
|
+
contentType: "application/json",
|
|
342
|
+
queryParameters: requestOptions?.queryParams,
|
|
343
|
+
requestType: "json",
|
|
344
|
+
body: _body,
|
|
345
|
+
timeoutMs: (requestOptions?.timeoutInSeconds ?? this._options?.timeoutInSeconds ?? 60) * 1000,
|
|
346
|
+
maxRetries: requestOptions?.maxRetries ?? this._options?.maxRetries,
|
|
347
|
+
abortSignal: requestOptions?.abortSignal,
|
|
348
|
+
fetchFn: this._options?.fetch,
|
|
349
|
+
logging: this._options.logging,
|
|
350
|
+
});
|
|
351
|
+
if (_response.ok) {
|
|
352
|
+
return { data: _response.body, rawResponse: _response.rawResponse };
|
|
353
|
+
}
|
|
354
|
+
if (_response.error.reason === "status-code") {
|
|
355
|
+
switch (_response.error.statusCode) {
|
|
356
|
+
case 401:
|
|
357
|
+
throw new Ichos.UnauthorizedError(_response.error.body, _response.rawResponse);
|
|
358
|
+
case 403:
|
|
359
|
+
throw new Ichos.ForbiddenError(_response.error.body, _response.rawResponse);
|
|
360
|
+
case 404:
|
|
361
|
+
throw new Ichos.NotFoundError(_response.error.body, _response.rawResponse);
|
|
362
|
+
case 500:
|
|
363
|
+
throw new Ichos.InternalServerError(_response.error.body, _response.rawResponse);
|
|
364
|
+
default:
|
|
365
|
+
throw new errors.IchosError({
|
|
366
|
+
statusCode: _response.error.statusCode,
|
|
367
|
+
body: _response.error.body,
|
|
368
|
+
rawResponse: _response.rawResponse,
|
|
369
|
+
});
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
return handleNonStatusCodeError(_response.error, _response.rawResponse, "PATCH", "/v1/segments/{segmentId}");
|
|
373
|
+
}
|
|
374
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./requests/index.js";
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* segmentId: "segmentId"
|
|
5
|
+
* }
|
|
6
|
+
*/
|
|
7
|
+
export interface DeleteSegmentRequest {
|
|
8
|
+
/** - The ID of the segment */
|
|
9
|
+
segmentId: string;
|
|
10
|
+
/** - Whether to also delete the linked audio file (default: false) */
|
|
11
|
+
deleteAudio?: boolean;
|
|
12
|
+
}
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* scope: "organization",
|
|
5
|
+
* type: "intro"
|
|
6
|
+
* }
|
|
7
|
+
*/
|
|
8
|
+
export interface SegmentCreate {
|
|
9
|
+
scope: SegmentCreate.Scope;
|
|
10
|
+
type: SegmentCreate.Type;
|
|
11
|
+
active?: boolean;
|
|
12
|
+
organizationId?: string | null;
|
|
13
|
+
virtualUserId?: string | null;
|
|
14
|
+
podcastId?: string | null;
|
|
15
|
+
audioId?: string | null;
|
|
16
|
+
}
|
|
17
|
+
export declare namespace SegmentCreate {
|
|
18
|
+
const Scope: {
|
|
19
|
+
readonly Organization: "organization";
|
|
20
|
+
readonly VirtualUser: "virtual_user";
|
|
21
|
+
readonly Podcast: "podcast";
|
|
22
|
+
};
|
|
23
|
+
type Scope = (typeof Scope)[keyof typeof Scope];
|
|
24
|
+
const Type: {
|
|
25
|
+
readonly Intro: "intro";
|
|
26
|
+
readonly Outro: "outro";
|
|
27
|
+
};
|
|
28
|
+
type Type = (typeof Type)[keyof typeof Type];
|
|
29
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var SegmentCreate;
|
|
3
|
+
(function (SegmentCreate) {
|
|
4
|
+
SegmentCreate.Scope = {
|
|
5
|
+
Organization: "organization",
|
|
6
|
+
VirtualUser: "virtual_user",
|
|
7
|
+
Podcast: "podcast",
|
|
8
|
+
};
|
|
9
|
+
SegmentCreate.Type = {
|
|
10
|
+
Intro: "intro",
|
|
11
|
+
Outro: "outro",
|
|
12
|
+
};
|
|
13
|
+
})(SegmentCreate || (SegmentCreate = {}));
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @example
|
|
3
|
+
* {
|
|
4
|
+
* segmentId: "segmentId"
|
|
5
|
+
* }
|
|
6
|
+
*/
|
|
7
|
+
export interface SegmentUpdate {
|
|
8
|
+
segmentId: string;
|
|
9
|
+
scope?: SegmentUpdate.Scope;
|
|
10
|
+
type?: SegmentUpdate.Type;
|
|
11
|
+
active?: boolean;
|
|
12
|
+
organizationId?: string;
|
|
13
|
+
virtualUserId?: string;
|
|
14
|
+
podcastId?: string;
|
|
15
|
+
audioId?: string;
|
|
16
|
+
}
|
|
17
|
+
export declare namespace SegmentUpdate {
|
|
18
|
+
const Scope: {
|
|
19
|
+
readonly Organization: "organization";
|
|
20
|
+
readonly VirtualUser: "virtual_user";
|
|
21
|
+
readonly Podcast: "podcast";
|
|
22
|
+
};
|
|
23
|
+
type Scope = (typeof Scope)[keyof typeof Scope];
|
|
24
|
+
const Type: {
|
|
25
|
+
readonly Intro: "intro";
|
|
26
|
+
readonly Outro: "outro";
|
|
27
|
+
};
|
|
28
|
+
type Type = (typeof Type)[keyof typeof Type];
|
|
29
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
// This file was auto-generated by Fern from our API Definition.
|
|
2
|
+
export var SegmentUpdate;
|
|
3
|
+
(function (SegmentUpdate) {
|
|
4
|
+
SegmentUpdate.Scope = {
|
|
5
|
+
Organization: "organization",
|
|
6
|
+
VirtualUser: "virtual_user",
|
|
7
|
+
Podcast: "podcast",
|
|
8
|
+
};
|
|
9
|
+
SegmentUpdate.Type = {
|
|
10
|
+
Intro: "intro",
|
|
11
|
+
Outro: "outro",
|
|
12
|
+
};
|
|
13
|
+
})(SegmentUpdate || (SegmentUpdate = {}));
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
export type { DeleteSegmentRequest } from "./DeleteSegmentRequest.js";
|
|
2
|
+
export type { LinkSegmentAudioRequest } from "./LinkSegmentAudioRequest.js";
|
|
3
|
+
export type { ListPodcastSegmentsRequest } from "./ListPodcastSegmentsRequest.js";
|
|
4
|
+
export type { SegmentCreate } from "./SegmentCreate.js";
|
|
5
|
+
export type { SegmentUpdate } from "./SegmentUpdate.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,89 @@
|
|
|
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 UsersClient {
|
|
6
|
+
type Options = BaseClientOptions;
|
|
7
|
+
interface RequestOptions extends BaseRequestOptions {
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
export declare class UsersClient {
|
|
11
|
+
protected readonly _options: NormalizedClientOptionsWithAuth<UsersClient.Options>;
|
|
12
|
+
constructor(options: UsersClient.Options);
|
|
13
|
+
/**
|
|
14
|
+
* Retrieve the current virtual user based on the header.
|
|
15
|
+
*
|
|
16
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
17
|
+
*
|
|
18
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
19
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
20
|
+
* @throws {@link Ichos.NotFoundError}
|
|
21
|
+
* @throws {@link Ichos.InternalServerError}
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* await client.users.getCurrentVirtualUser()
|
|
25
|
+
*/
|
|
26
|
+
getCurrentVirtualUser(requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Ichos.VirtualUserResponse>;
|
|
27
|
+
private __getCurrentVirtualUser;
|
|
28
|
+
/**
|
|
29
|
+
* Delete the currently authenticated virtual user.
|
|
30
|
+
*
|
|
31
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
32
|
+
*
|
|
33
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
34
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
35
|
+
* @throws {@link Ichos.NotFoundError}
|
|
36
|
+
* @throws {@link Ichos.InternalServerError}
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* await client.users.deleteCurrentVirtualUser()
|
|
40
|
+
*/
|
|
41
|
+
deleteCurrentVirtualUser(requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Ichos.NullResponse>;
|
|
42
|
+
private __deleteCurrentVirtualUser;
|
|
43
|
+
/**
|
|
44
|
+
* Update details of the current virtual user.
|
|
45
|
+
*
|
|
46
|
+
* @param {Ichos.UpdateCurrentVirtualUserRequest} request
|
|
47
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
48
|
+
*
|
|
49
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
50
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
51
|
+
* @throws {@link Ichos.NotFoundError}
|
|
52
|
+
* @throws {@link Ichos.InternalServerError}
|
|
53
|
+
*
|
|
54
|
+
* @example
|
|
55
|
+
* await client.users.updateCurrentVirtualUser()
|
|
56
|
+
*/
|
|
57
|
+
updateCurrentVirtualUser(request?: Ichos.UpdateCurrentVirtualUserRequest, requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Ichos.VirtualUserResponse>;
|
|
58
|
+
private __updateCurrentVirtualUser;
|
|
59
|
+
/**
|
|
60
|
+
* Retrieve all virtual users associated with the authenticated organization.
|
|
61
|
+
*
|
|
62
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
63
|
+
*
|
|
64
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
65
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
66
|
+
* @throws {@link Ichos.NotFoundError}
|
|
67
|
+
* @throws {@link Ichos.InternalServerError}
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* await client.users.listVirtualUsers()
|
|
71
|
+
*/
|
|
72
|
+
listVirtualUsers(requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Ichos.VirtualUserListResponse>;
|
|
73
|
+
private __listVirtualUsers;
|
|
74
|
+
/**
|
|
75
|
+
* Retrieve listener analytics for the current virtual user.
|
|
76
|
+
*
|
|
77
|
+
* @param {UsersClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
78
|
+
*
|
|
79
|
+
* @throws {@link Ichos.UnauthorizedError}
|
|
80
|
+
* @throws {@link Ichos.ForbiddenError}
|
|
81
|
+
* @throws {@link Ichos.NotFoundError}
|
|
82
|
+
* @throws {@link Ichos.InternalServerError}
|
|
83
|
+
*
|
|
84
|
+
* @example
|
|
85
|
+
* await client.users.getVirtualUserListenersReport()
|
|
86
|
+
*/
|
|
87
|
+
getVirtualUserListenersReport(requestOptions?: UsersClient.RequestOptions): core.HttpResponsePromise<Ichos.ListenersReportResponse>;
|
|
88
|
+
private __getVirtualUserListenersReport;
|
|
89
|
+
}
|