Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
function getId(app) {
return tslib.__awaiter(this, void 0, void 0, function () {
var appConfig, _a, installationEntry, registrationPromise;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
appConfig = extractAppConfig(app);
return [4 /*yield*/, getInstallationEntry(appConfig)];
case 1:
_a = _b.sent(), installationEntry = _a.installationEntry, registrationPromise = _a.registrationPromise;
if (registrationPromise) {
registrationPromise.catch(console.error);
}
else {
// If the installation is already registered, update the authentication
// token if needed.
refreshAuthToken(appConfig).catch(console.error);
}
Reference.prototype.listAllHelper = function (accumulator, pageToken) {
return __awaiter(this, void 0, void 0, function () {
var opt, nextPage;
var _a, _b;
return __generator(this, function (_c) {
switch (_c.label) {
case 0:
opt = {
// maxResults is 1000 by default.
pageToken: pageToken
};
return [4 /*yield*/, this.list(opt)];
case 1:
nextPage = _c.sent();
(_a = accumulator.prefixes).push.apply(_a, nextPage.prefixes);
(_b = accumulator.items).push.apply(_b, nextPage.items);
if (!(nextPage.nextPageToken != null)) return [3 /*break*/, 3];
return [4 /*yield*/, this.listAllHelper(accumulator, nextPage.nextPageToken)];
function run(options, logger) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var error_2;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0:
_a.trys.push([0, 2, , 3]);
return [4 /*yield*/, runWorker(options, logger)];
case 1: return [2 /*return*/, _a.sent()];
case 2:
error_2 = _a.sent();
if (error_2 instanceof error_1.FatalError) {
logger.error(error_2.message + "\n");
return [2 /*return*/, 1 /* FatalError */];
}
throw error_2;
case 3: return [2 /*return*/];
}
function createInstallation(appConfig, _a) {
var fid = _a.fid;
return tslib.__awaiter(this, void 0, void 0, function () {
var endpoint, headers, body, request, response, responseValue, registeredInstallationEntry;
return tslib.__generator(this, function (_b) {
switch (_b.label) {
case 0:
endpoint = getInstallationsEndpoint(appConfig);
headers = getHeaders(appConfig);
body = {
fid: fid,
authVersion: INTERNAL_AUTH_VERSION,
appId: appConfig.appId,
sdkVersion: PACKAGE_VERSION
};
request = {
method: 'POST',
headers: headers,
body: JSON.stringify(body)
function handleOpenByPathRequest(ws, payload) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, openInIde(payload.pathToOpen, payload.editor || ide_user_input, '')];
case 1:
_a.sent();
sendData(ws, { type: EWSTypes.openByPath, error: 200 });
return [2 /*return*/];
}
});
});
}
function handleGetFileByPathRequest(ws, payload) {
Config.prototype.getControllers = function () {
return tslib_1.__awaiter(this, void 0, void 0, function () {
var _this = this;
var controllers;
return tslib_1.__generator(this, function (_a) {
controllers = this.config
.map(function (config) { return tslib_1.__awaiter(_this, void 0, void 0, function () {
var pkg, ctrl;
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4, Promise.resolve().then(function () { return require(config.name); }).catch(function (e) { throw new convector_core_1.ControllerImportError(e, config.name); })];
case 1:
pkg = _a.sent();
ctrl = pkg[config.controller];
if (!ctrl) {
throw new convector_core_1.ControllerMissingError(config.name, config.controller);
}
return [2, ctrl];
export function allFacesMtcnn(input, forwardParams) {
if (forwardParams === void 0) { forwardParams = {}; }
return __awaiter(this, void 0, void 0, function () {
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, detectAllFaces(input, new MtcnnOptions(forwardParams))
.withFaceLandmarks()
.withFaceDescriptors()];
case 1: return [2 /*return*/, _a.sent()];
}
});
});
}
export var allFaces = allFacesSsdMobilenetv1;
function () { return tslib_1.__awaiter(_this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, this.router.navigateByUrl(this.router.url).catch(noop)];
case 1:
_a.sent();
this.setRouteReuse(shouldReuseRoute);
return [2 /*return*/];
}
});
}); }));
}));
FaceExpressionNet.prototype.predictExpressions = function (input) {
return __awaiter(this, void 0, void 0, function () {
var netInput, out, probabilitesByBatch, predictionsByBatch;
var _this = this;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, toNetInput(input)];
case 1:
netInput = _a.sent();
return [4 /*yield*/, this.forwardInput(netInput)];
case 2:
out = _a.sent();
return [4 /*yield*/, Promise.all(tf.unstack(out).map(function (t) { return __awaiter(_this, void 0, void 0, function () {
var data;
return __generator(this, function (_a) {
switch (_a.label) {
case 0: return [4 /*yield*/, t.data()];
case 1:
function cli(args) {
return tslib_1.__awaiter(this, void 0, void 0, function () {
return tslib_1.__generator(this, function (_a) {
methods_1.activateQuestions();
return [2 /*return*/];
});
});
}
exports.cli = cli;