UNPKG

vulcain-corejs

Version:
53 lines 3.14 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { 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) : new P(function (resolve) { resolve(result.value); }).then(fulfilled, rejected); } step((generator = generator.apply(thisArg, _arguments || [])).next()); }); }; Object.defineProperty(exports, "__esModule", { value: true }); const annotations_property_1 = require("../../schemas/builder/annotations.property"); const annotations_model_1 = require("../../schemas/builder/annotations.model"); const commandFactory_1 = require("../../commands/commandFactory"); const abstractServiceCommand_1 = require("../../commands/abstractServiceCommand"); const reflector_1 = require("../../utils/reflector"); let VerifyTokenParameter = class VerifyTokenParameter { }; __decorate([ annotations_property_1.Property({ type: "string", required: true }), __metadata("design:type", String) ], VerifyTokenParameter.prototype, "token", void 0); __decorate([ annotations_property_1.Property({ type: "string" }), __metadata("design:type", String) ], VerifyTokenParameter.prototype, "tenant", void 0); VerifyTokenParameter = __decorate([ annotations_model_1.InputModel(), reflector_1.Metadata("system", true) ], VerifyTokenParameter); exports.VerifyTokenParameter = VerifyTokenParameter; let ApiKeyVerifyCommand = class ApiKeyVerifyCommand extends abstractServiceCommand_1.AbstractServiceCommand { run(apiKeyServiceName, apiKeyServiceVersion, data) { return __awaiter(this, void 0, void 0, function* () { let resp = yield this.execAction(apiKeyServiceName, apiKeyServiceVersion, this.context, "apikey.verifyToken", data); return resp && resp.value; }); } }; ApiKeyVerifyCommand.commandName = "ApiKeyVerifyCommand"; ApiKeyVerifyCommand = __decorate([ commandFactory_1.Command({ executionTimeoutInMilliseconds: 500 }) ], ApiKeyVerifyCommand); exports.ApiKeyVerifyCommand = ApiKeyVerifyCommand; //# sourceMappingURL=apiKeyCommand.js.map