UNPKG

recall_sdk

Version:

Node js sdk for the recall ai api

40 lines (39 loc) 1.79 kB
"use strict"; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); } return new (P || (P = Promise))(function (resolve, reject) { function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } } function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } } function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.Google = void 0; const recall_axios_1 = require("../../recall-axios"); const try_catch_wrapper_1 = require("../../try-catch-wrapper"); const LOGIN_MODE = ["always", "only_if_required"]; class Google { constructor({ apiKey, loginUrl, }) { this.loginUrl = loginUrl; this.client = recall_axios_1.RecallAxios.getInstance({ apiKey }); } static getInstance({ apiKey, loginUrl, }) { if (!Google.instance) { Google.instance = new Google({ apiKey, loginUrl }); } return Google.instance; } createLoginGroup(params) { return __awaiter(this, void 0, void 0, function* () { const url = `${this.loginUrl}/google-login-groups`; return (0, try_catch_wrapper_1.recallRequestTryCatchWrapper)(() => this.client.post(url, Object.assign({}, params), { headers: { "Content-Type": "application/json", }, })); }); } } exports.Google = Google; Google.instance = null;