UNPKG

echofi-client

Version:

A comprehensive TypeScript/JavaScript client library for EchoFi services with automatic gRPC-Web code generation, unified service access, and real-time WebSocket communication.

98 lines 4.76 kB
"use strict"; /** * @fileoverview gRPC-Web generated client stub for auth * @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.AuthServiceClient = 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: auth/service.proto /* eslint-disable */ // @ts-nocheck const grpcWeb = __importStar(require("grpc-web")); const auth_service_pb = __importStar(require("./service_pb")); // proto import: "auth/service.proto" class AuthServiceClient { constructor(hostname, credentials, options) { this.methodDescriptorGetSession = new grpcWeb.MethodDescriptor('/auth.AuthService/GetSession', grpcWeb.MethodType.UNARY, auth_service_pb.GetSessionRequest, auth_service_pb.GetSessionResponse, (request) => { return request.serializeBinary(); }, auth_service_pb.GetSessionResponse.deserializeBinary); this.methodDescriptorCreateSession = new grpcWeb.MethodDescriptor('/auth.AuthService/CreateSession', grpcWeb.MethodType.UNARY, auth_service_pb.CreateSessionRequest, auth_service_pb.CreateSessionResponse, (request) => { return request.serializeBinary(); }, auth_service_pb.CreateSessionResponse.deserializeBinary); this.methodDescriptorDeleteSession = new grpcWeb.MethodDescriptor('/auth.AuthService/DeleteSession', grpcWeb.MethodType.UNARY, auth_service_pb.DeleteSessionRequest, auth_service_pb.DeleteSessionResponse, (request) => { return request.serializeBinary(); }, auth_service_pb.DeleteSessionResponse.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; } getSession(request, metadata, callback) { if (callback !== undefined) { return this.client_.rpcCall(this.hostname_ + '/auth.AuthService/GetSession', request, metadata || {}, this.methodDescriptorGetSession, callback); } return this.client_.unaryCall(this.hostname_ + '/auth.AuthService/GetSession', request, metadata || {}, this.methodDescriptorGetSession); } createSession(request, metadata, callback) { if (callback !== undefined) { return this.client_.rpcCall(this.hostname_ + '/auth.AuthService/CreateSession', request, metadata || {}, this.methodDescriptorCreateSession, callback); } return this.client_.unaryCall(this.hostname_ + '/auth.AuthService/CreateSession', request, metadata || {}, this.methodDescriptorCreateSession); } deleteSession(request, metadata, callback) { if (callback !== undefined) { return this.client_.rpcCall(this.hostname_ + '/auth.AuthService/DeleteSession', request, metadata || {}, this.methodDescriptorDeleteSession, callback); } return this.client_.unaryCall(this.hostname_ + '/auth.AuthService/DeleteSession', request, metadata || {}, this.methodDescriptorDeleteSession); } } exports.AuthServiceClient = AuthServiceClient; //# sourceMappingURL=ServiceServiceClientPb.js.map