UNPKG

echofi-client

Version:

A TypeScript/Node.js client library for EchoFi services with Level 3 Ultimate API and gRPC-Web clients for music streaming, user management, activity tracking, and authentication.

153 lines 8.52 kB
"use strict"; /** * @fileoverview gRPC-Web generated client stub for music * @enhanceable * @public */ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { if (k2 === undefined) k2 = k; var desc = Object.getOwnPropertyDescriptor(m, k); if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { desc = { enumerable: true, get: function() { return m[k]; } }; } Object.defineProperty(o, k2, desc); }) : (function(o, m, k, k2) { if (k2 === undefined) k2 = k; o[k2] = m[k]; })); var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { Object.defineProperty(o, "default", { enumerable: true, value: v }); }) : function(o, v) { o["default"] = v; }); var __importStar = (this && this.__importStar) || (function () { var ownKeys = function(o) { ownKeys = Object.getOwnPropertyNames || function (o) { var ar = []; for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k; return ar; }; return ownKeys(o); }; return function (mod) { if (mod && mod.__esModule) return mod; var result = {}; if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]); __setModuleDefault(result, mod); return result; }; })(); Object.defineProperty(exports, "__esModule", { value: true }); exports.MusicServiceClient = void 0; // Code generated by protoc-gen-grpc-web. DO NOT EDIT. // versions: // protoc-gen-grpc-web v1.5.0 // protoc v3.19.1 // source: music/service.proto /* eslint-disable */ // @ts-nocheck const grpcWeb = __importStar(require("grpc-web")); const music_service_pb = __importStar(require("./service_pb")); // proto import: "music/service.proto" class MusicServiceClient { constructor(hostname, credentials, options) { this.methodDescriptorGetArtist = new grpcWeb.MethodDescriptor('/music.MusicService/GetArtist', grpcWeb.MethodType.UNARY, music_service_pb.GetArtistRequest, music_service_pb.GetArtistResponse, (request) => { return request.serializeBinary(); }, music_service_pb.GetArtistResponse.deserializeBinary); this.methodDescriptorListArtists = new grpcWeb.MethodDescriptor('/music.MusicService/ListArtists', grpcWeb.MethodType.UNARY, music_service_pb.ListArtistsRequest, music_service_pb.ListArtistsResponse, (request) => { return request.serializeBinary(); }, music_service_pb.ListArtistsResponse.deserializeBinary); this.methodDescriptorGetAlbum = new grpcWeb.MethodDescriptor('/music.MusicService/GetAlbum', grpcWeb.MethodType.UNARY, music_service_pb.GetAlbumRequest, music_service_pb.GetAlbumResponse, (request) => { return request.serializeBinary(); }, music_service_pb.GetAlbumResponse.deserializeBinary); this.methodDescriptorListAlbums = new grpcWeb.MethodDescriptor('/music.MusicService/ListAlbums', grpcWeb.MethodType.UNARY, music_service_pb.ListAlbumsRequest, music_service_pb.ListAlbumsResponse, (request) => { return request.serializeBinary(); }, music_service_pb.ListAlbumsResponse.deserializeBinary); this.methodDescriptorGetTrack = new grpcWeb.MethodDescriptor('/music.MusicService/GetTrack', grpcWeb.MethodType.UNARY, music_service_pb.GetTrackRequest, music_service_pb.GetTrackResponse, (request) => { return request.serializeBinary(); }, music_service_pb.GetTrackResponse.deserializeBinary); this.methodDescriptorListTracks = new grpcWeb.MethodDescriptor('/music.MusicService/ListTracks', grpcWeb.MethodType.UNARY, music_service_pb.ListTracksRequest, music_service_pb.ListTracksResponse, (request) => { return request.serializeBinary(); }, music_service_pb.ListTracksResponse.deserializeBinary); this.methodDescriptorGetGenre = new grpcWeb.MethodDescriptor('/music.MusicService/GetGenre', grpcWeb.MethodType.UNARY, music_service_pb.GetGenreRequest, music_service_pb.GetGenreResponse, (request) => { return request.serializeBinary(); }, music_service_pb.GetGenreResponse.deserializeBinary); this.methodDescriptorListGenres = new grpcWeb.MethodDescriptor('/music.MusicService/ListGenres', grpcWeb.MethodType.UNARY, music_service_pb.ListGenresRequest, music_service_pb.ListGenresResponse, (request) => { return request.serializeBinary(); }, music_service_pb.ListGenresResponse.deserializeBinary); if (!options) options = {}; if (!credentials) credentials = {}; options['format'] = 'text'; this.client_ = new grpcWeb.GrpcWebClientBase(options); this.hostname_ = hostname.replace(/\/+$/, ''); this.credentials_ = credentials; this.options_ = options; } getArtist(request, metadata, callback) { if (callback !== undefined) { return this.client_.rpcCall(this.hostname_ + '/music.MusicService/GetArtist', request, metadata || {}, this.methodDescriptorGetArtist, callback); } return this.client_.unaryCall(this.hostname_ + '/music.MusicService/GetArtist', request, metadata || {}, this.methodDescriptorGetArtist); } listArtists(request, metadata, callback) { if (callback !== undefined) { return this.client_.rpcCall(this.hostname_ + '/music.MusicService/ListArtists', request, metadata || {}, this.methodDescriptorListArtists, callback); } return this.client_.unaryCall(this.hostname_ + '/music.MusicService/ListArtists', request, metadata || {}, this.methodDescriptorListArtists); } getAlbum(request, metadata, callback) { if (callback !== undefined) { return this.client_.rpcCall(this.hostname_ + '/music.MusicService/GetAlbum', request, metadata || {}, this.methodDescriptorGetAlbum, callback); } return this.client_.unaryCall(this.hostname_ + '/music.MusicService/GetAlbum', request, metadata || {}, this.methodDescriptorGetAlbum); } listAlbums(request, metadata, callback) { if (callback !== undefined) { return this.client_.rpcCall(this.hostname_ + '/music.MusicService/ListAlbums', request, metadata || {}, this.methodDescriptorListAlbums, callback); } return this.client_.unaryCall(this.hostname_ + '/music.MusicService/ListAlbums', request, metadata || {}, this.methodDescriptorListAlbums); } getTrack(request, metadata, callback) { if (callback !== undefined) { return this.client_.rpcCall(this.hostname_ + '/music.MusicService/GetTrack', request, metadata || {}, this.methodDescriptorGetTrack, callback); } return this.client_.unaryCall(this.hostname_ + '/music.MusicService/GetTrack', request, metadata || {}, this.methodDescriptorGetTrack); } listTracks(request, metadata, callback) { if (callback !== undefined) { return this.client_.rpcCall(this.hostname_ + '/music.MusicService/ListTracks', request, metadata || {}, this.methodDescriptorListTracks, callback); } return this.client_.unaryCall(this.hostname_ + '/music.MusicService/ListTracks', request, metadata || {}, this.methodDescriptorListTracks); } getGenre(request, metadata, callback) { if (callback !== undefined) { return this.client_.rpcCall(this.hostname_ + '/music.MusicService/GetGenre', request, metadata || {}, this.methodDescriptorGetGenre, callback); } return this.client_.unaryCall(this.hostname_ + '/music.MusicService/GetGenre', request, metadata || {}, this.methodDescriptorGetGenre); } listGenres(request, metadata, callback) { if (callback !== undefined) { return this.client_.rpcCall(this.hostname_ + '/music.MusicService/ListGenres', request, metadata || {}, this.methodDescriptorListGenres, callback); } return this.client_.unaryCall(this.hostname_ + '/music.MusicService/ListGenres', request, metadata || {}, this.methodDescriptorListGenres); } } exports.MusicServiceClient = MusicServiceClient; //# sourceMappingURL=ServiceServiceClientPb.js.map