datafire
Version:
[![Travis][travis-image]][travis-link] [![Downloads][downloads-image]][npm-link] [![NPM version][npm-image]][npm-link] [](https://www.npmjs.com/package/datafire) <!--[![Dependency status][deps-i
770 lines (587 loc) • 491 kB
JavaScript
webpackJsonp(["main"],{
/***/ "./node_modules/worker-loader/index.js!./src/app/lunr_worker.js":
/***/ (function(module, exports, __webpack_require__) {
module.exports = function() {
return new Worker(__webpack_require__.p + "575fda744365e513818d.worker.js");
};
/***/ }),
/***/ "./src/$$_lazy_route_resource lazy recursive":
/***/ (function(module, exports) {
function webpackEmptyAsyncContext(req) {
// Here Promise.resolve().then() is used instead of new Promise() to prevent
// uncatched exception popping up in devtools
return Promise.resolve().then(function() {
throw new Error("Cannot find module '" + req + "'.");
});
}
webpackEmptyAsyncContext.keys = function() { return []; };
webpackEmptyAsyncContext.resolve = webpackEmptyAsyncContext;
module.exports = webpackEmptyAsyncContext;
webpackEmptyAsyncContext.id = "./src/$$_lazy_route_resource lazy recursive";
/***/ }),
/***/ "./src/app/app.component.ngfactory.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AppComponentNgFactory = exports.RenderType_AppComponent = undefined;
exports.View_AppComponent_0 = View_AppComponent_0;
exports.View_AppComponent_Host_0 = View_AppComponent_Host_0;
var _core = __webpack_require__("./node_modules/@angular/core/esm5/core.js");
var i0 = _interopRequireWildcard(_core);
var _router = __webpack_require__("./node_modules/@angular/router/esm5/router.js");
var i1 = _interopRequireWildcard(_router);
var _app = __webpack_require__("./src/app/app.component.ts");
var i2 = _interopRequireWildcard(_app);
var _routes = __webpack_require__("./src/app/services/routes.ts");
var i3 = _interopRequireWildcard(_routes);
var _utils = __webpack_require__("./src/app/services/utils.ts");
var i4 = _interopRequireWildcard(_utils);
var _platform = __webpack_require__("./src/app/services/platform.service.ts");
var i5 = _interopRequireWildcard(_platform);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
/**
* @fileoverview This file was generated by the Angular template compiler. Do not edit.
*
* @suppress {suspiciousCode,uselessCode,missingProperties,missingOverride,checkTypes}
* tslint:disable
*/
var styles_AppComponent = [];
var RenderType_AppComponent = i0.ɵcrt({ encapsulation: 2, styles: styles_AppComponent, data: {} });
exports.RenderType_AppComponent = RenderType_AppComponent;
function View_AppComponent_0(_l) {
return i0.ɵvid(0, [(_l()(), i0.ɵted(-1, null, ["\n "])), (_l()(), i0.ɵeld(1, 16777216, null, null, 1, "router-outlet", [], null, null, null, null, null)), i0.ɵdid(2, 212992, null, 0, i1.RouterOutlet, [i1.ChildrenOutletContexts, i0.ViewContainerRef, i0.ComponentFactoryResolver, [8, null], i0.ChangeDetectorRef], null, null), (_l()(), i0.ɵted(-1, null, ["\n "]))], function (_ck, _v) {
_ck(_v, 2, 0);
}, null);
}
function View_AppComponent_Host_0(_l) {
return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 1, "app", [], null, null, null, View_AppComponent_0, RenderType_AppComponent)), i0.ɵdid(1, 4374528, null, 0, i2.AppComponent, [i1.Router, i3.RoutesService, i4.UtilsService, i0.ApplicationRef, i5.PlatformService], null, null)], null, null);
}
var AppComponentNgFactory = i0.ɵccf("app", i2.AppComponent, View_AppComponent_Host_0, {}, {}, []);
exports.AppComponentNgFactory = AppComponentNgFactory;
/***/ }),
/***/ "./src/app/app.component.ts":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AppComponent", function() { return AppComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__("./node_modules/@angular/core/esm5/core.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__angular_core__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_router__ = __webpack_require__("./node_modules/@angular/router/esm5/router.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__angular_router___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_1__angular_router__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_routes__ = __webpack_require__("./src/app/services/routes.ts");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__services_utils__ = __webpack_require__("./src/app/services/utils.ts");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__services_platform_service__ = __webpack_require__("./src/app/services/platform.service.ts");
var MAX_XS_WIDTH = 767;
var AppComponent = /** @class */ (function () {
function AppComponent(router, routes, utils, appref, platformService) {
var _this = this;
this.router = router;
this.routes = routes;
this.utils = utils;
this.appref = appref;
this.platformService = platformService;
this.subscriptions = [];
window.app = this;
var isFirst = true;
this.subscriptions.push(this.router.events.subscribe(function (event) {
if (_this.platformService.isBrowser && event instanceof __WEBPACK_IMPORTED_MODULE_1__angular_router__["NavigationEnd"] && window.innerWidth > MAX_XS_WIDTH) {
if (!isFirst) {
window.scrollTo(0, 0);
}
isFirst = false;
}
}));
}
AppComponent.prototype.ngOnDestroy = function () {
this.subscriptions.forEach(function (s) { return s.unsubscribe(); });
};
AppComponent.prototype.ngAfterViewInit = function () {
if (window.onLucyBotReady)
window.onLucyBotReady();
window.lucyBotReady = true;
var self = this;
if (this.platformService.isBrowser) {
window.jQuery('nav.navbar a').click(function () {
var elem = window.jQuery(this);
var url = elem.attr('href');
if (url !== undefined && url.indexOf('http') !== 0) {
if (url.indexOf(window.config.basePath) === 0) {
url = url.substring(window.config.basePath.length, url.length);
}
if (url) {
self.routes.navigate(self.routes.getPathParts(url), false, { queryParams: {} });
return false;
}
}
});
}
};
return AppComponent;
}());
/***/ }),
/***/ "./src/app/app.module.ngfactory.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AppModuleNgFactory = undefined;
var _core = __webpack_require__("./node_modules/@angular/core/esm5/core.js");
var i0 = _interopRequireWildcard(_core);
var _app = __webpack_require__("./src/app/app.module.ts");
var i1 = _interopRequireWildcard(_app);
var _app2 = __webpack_require__("./src/app/app.component.ts");
var i2 = _interopRequireWildcard(_app2);
var _TooltipContent = __webpack_require__("./node_modules/ngx-tooltip/TooltipContent.ngfactory.js");
var i3 = _interopRequireWildcard(_TooltipContent);
var _ng2DatetimePickerComponent = __webpack_require__("./node_modules/ng2-datetime-picker/dist/ng2-datetime-picker.component.ngfactory.js");
var i4 = _interopRequireWildcard(_ng2DatetimePickerComponent);
var _documentation = __webpack_require__("./src/app/components/documentation.ngfactory.js");
var i5 = _interopRequireWildcard(_documentation);
var _appComponent = __webpack_require__("./src/app/app.component.ngfactory.js");
var i6 = _interopRequireWildcard(_appComponent);
var _http = __webpack_require__("./node_modules/@angular/common/esm5/http.js");
var i7 = _interopRequireWildcard(_http);
var _common = __webpack_require__("./node_modules/@angular/common/esm5/common.js");
var i8 = _interopRequireWildcard(_common);
var _platformBrowser = __webpack_require__("./node_modules/@angular/platform-browser/esm5/platform-browser.js");
var i9 = _interopRequireWildcard(_platformBrowser);
var _common2 = __webpack_require__("./node_modules/@nguniversal/common/esm5/common.es5.js");
var i10 = _interopRequireWildcard(_common2);
var _forms = __webpack_require__("./node_modules/@angular/forms/esm5/forms.js");
var i11 = _interopRequireWildcard(_forms);
var _browser = __webpack_require__("./node_modules/@angular/animations/esm5/browser.js");
var i12 = _interopRequireWildcard(_browser);
var _animations = __webpack_require__("./node_modules/@angular/platform-browser/esm5/animations.js");
var i13 = _interopRequireWildcard(_animations);
var _animations2 = __webpack_require__("./node_modules/@angular/animations/esm5/animations.js");
var i14 = _interopRequireWildcard(_animations2);
var _ng2Datetime = __webpack_require__("./node_modules/ng2-datetime-picker/dist/ng2-datetime.js");
var i15 = _interopRequireWildcard(_ng2Datetime);
var _router = __webpack_require__("./node_modules/@angular/router/esm5/router.js");
var i16 = _interopRequireWildcard(_router);
var _platform = __webpack_require__("./src/app/services/platform.service.ts");
var i17 = _interopRequireWildcard(_platform);
var _tracker = __webpack_require__("./src/app/services/tracker.ts");
var i18 = _interopRequireWildcard(_tracker);
var _routes = __webpack_require__("./src/app/services/routes.ts");
var i19 = _interopRequireWildcard(_routes);
var _secret = __webpack_require__("./src/app/services/secret.ts");
var i20 = _interopRequireWildcard(_secret);
var _utils = __webpack_require__("./src/app/services/utils.ts");
var i21 = _interopRequireWildcard(_utils);
var _openapi = __webpack_require__("./src/app/services/openapi.ts");
var i22 = _interopRequireWildcard(_openapi);
var _github = __webpack_require__("./src/app/services/github.ts");
var i23 = _interopRequireWildcard(_github);
var _search = __webpack_require__("./src/app/services/search.ts");
var i24 = _interopRequireWildcard(_search);
var _menu = __webpack_require__("./src/app/services/menu.ts");
var i25 = _interopRequireWildcard(_menu);
var _tour = __webpack_require__("./src/app/services/tour.ts");
var i26 = _interopRequireWildcard(_tour);
var _documentation2 = __webpack_require__("./src/app/components/documentation.ts");
var i27 = _interopRequireWildcard(_documentation2);
var _index = __webpack_require__("./node_modules/ngx-tooltip/index.js");
var i28 = _interopRequireWildcard(_index);
var _ng2DatetimePicker = __webpack_require__("./node_modules/ng2-datetime-picker/dist/ng2-datetime-picker.module.js");
var i29 = _interopRequireWildcard(_ng2DatetimePicker);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
/**
* @fileoverview This file was generated by the Angular template compiler. Do not edit.
*
* @suppress {suspiciousCode,uselessCode,missingProperties,missingOverride,checkTypes}
* tslint:disable
*/
var AppModuleNgFactory = i0.ɵcmf(i1.AppModule, [i2.AppComponent], function (_l) {
return i0.ɵmod([i0.ɵmpd(512, i0.ComponentFactoryResolver, i0.ɵCodegenComponentFactoryResolver, [[8, [i3.TooltipContentNgFactory, i4.Ng2DatetimePickerComponentNgFactory, i5.DocumentationComponentNgFactory, i6.AppComponentNgFactory]], [3, i0.ComponentFactoryResolver], i0.NgModuleRef]), i0.ɵmpd(4608, i7.HttpXsrfTokenExtractor, i7.ɵh, [i8.DOCUMENT, i0.PLATFORM_ID, i7.ɵf]), i0.ɵmpd(4608, i7.ɵi, i7.ɵi, [i7.HttpXsrfTokenExtractor, i7.ɵg]), i0.ɵmpd(5120, i9.TransferState, i9.ɵc, [i8.DOCUMENT, i0.APP_ID]), i0.ɵmpd(4608, i10.ɵa, i10.ɵa, [i0.ApplicationRef, i9.TransferState]), i0.ɵmpd(5120, i7.HTTP_INTERCEPTORS, function (p0_0, p1_0) {
return [p0_0, p1_0];
}, [i7.ɵi, i10.ɵa]), i0.ɵmpd(4608, i7.ɵe, i7.ɵe, []), i0.ɵmpd(6144, i7.XhrFactory, null, [i7.ɵe]), i0.ɵmpd(4608, i7.HttpXhrBackend, i7.HttpXhrBackend, [i7.XhrFactory]), i0.ɵmpd(6144, i7.HttpBackend, null, [i7.HttpXhrBackend]), i0.ɵmpd(4608, i7.HttpHandler, i7.ɵc, [i7.HttpBackend, i0.Injector]), i0.ɵmpd(4608, i7.HttpClient, i7.HttpClient, [i7.HttpHandler]), i0.ɵmpd(4608, i11.ɵi, i11.ɵi, []), i0.ɵmpd(5120, i0.LOCALE_ID, i0.ɵq, [[3, i0.LOCALE_ID]]), i0.ɵmpd(4608, i8.NgLocalization, i8.NgLocaleLocalization, [i0.LOCALE_ID, [2, i8.ɵa]]), i0.ɵmpd(5120, i0.IterableDiffers, i0.ɵn, []), i0.ɵmpd(5120, i0.KeyValueDiffers, i0.ɵo, []), i0.ɵmpd(4608, i9.DomSanitizer, i9.ɵe, [i8.DOCUMENT]), i0.ɵmpd(6144, i0.Sanitizer, null, [i9.DomSanitizer]), i0.ɵmpd(4608, i9.HAMMER_GESTURE_CONFIG, i9.HammerGestureConfig, []), i0.ɵmpd(5120, i9.EVENT_MANAGER_PLUGINS, function (p0_0, p0_1, p1_0, p2_0, p2_1) {
return [new i9.ɵDomEventsPlugin(p0_0, p0_1), new i9.ɵKeyEventsPlugin(p1_0), new i9.ɵHammerGesturesPlugin(p2_0, p2_1)];
}, [i8.DOCUMENT, i0.NgZone, i8.DOCUMENT, i8.DOCUMENT, i9.HAMMER_GESTURE_CONFIG]), i0.ɵmpd(4608, i9.EventManager, i9.EventManager, [i9.EVENT_MANAGER_PLUGINS, i0.NgZone]), i0.ɵmpd(135680, i9.ɵDomSharedStylesHost, i9.ɵDomSharedStylesHost, [i8.DOCUMENT]), i0.ɵmpd(4608, i9.ɵDomRendererFactory2, i9.ɵDomRendererFactory2, [i9.EventManager, i9.ɵDomSharedStylesHost]), i0.ɵmpd(5120, i12.AnimationDriver, i13.ɵc, []), i0.ɵmpd(5120, i12.ɵAnimationStyleNormalizer, i13.ɵd, []), i0.ɵmpd(4608, i12.ɵAnimationEngine, i13.ɵb, [i12.AnimationDriver, i12.ɵAnimationStyleNormalizer]), i0.ɵmpd(5120, i0.RendererFactory2, i13.ɵe, [i9.ɵDomRendererFactory2, i12.ɵAnimationEngine, i0.NgZone]), i0.ɵmpd(6144, i9.ɵSharedStylesHost, null, [i9.ɵDomSharedStylesHost]), i0.ɵmpd(4608, i0.Testability, i0.Testability, [i0.NgZone]), i0.ɵmpd(4608, i9.Meta, i9.Meta, [i8.DOCUMENT]), i0.ɵmpd(4608, i9.Title, i9.Title, [i8.DOCUMENT]), i0.ɵmpd(4608, i14.AnimationBuilder, i13.ɵBrowserAnimationBuilder, [i0.RendererFactory2, i9.DOCUMENT]), i0.ɵmpd(4608, i15.Ng2Datetime, i15.Ng2Datetime, []), i0.ɵmpd(5120, i16.ActivatedRoute, i16.ɵf, [i16.Router]), i0.ɵmpd(4608, i16.NoPreloading, i16.NoPreloading, []), i0.ɵmpd(6144, i16.PreloadingStrategy, null, [i16.NoPreloading]), i0.ɵmpd(135680, i16.RouterPreloader, i16.RouterPreloader, [i16.Router, i0.NgModuleFactoryLoader, i0.Compiler, i0.Injector, i16.PreloadingStrategy]), i0.ɵmpd(4608, i16.PreloadAllModules, i16.PreloadAllModules, []), i0.ɵmpd(5120, i16.ROUTER_INITIALIZER, i16.ɵi, [i16.ɵg]), i0.ɵmpd(5120, i0.APP_BOOTSTRAP_LISTENER, function (p0_0) {
return [p0_0];
}, [i16.ROUTER_INITIALIZER]), i0.ɵmpd(4608, i17.PlatformService, i17.PlatformService, [i0.PLATFORM_ID]), i0.ɵmpd(4608, i18.TrackerService, i18.TrackerService, [i17.PlatformService]), i0.ɵmpd(135680, i19.RoutesService, i19.RoutesService, [i16.Router, i8.Location, i9.Title, i9.Meta, i18.TrackerService, i0.NgZone]), i0.ɵmpd(4608, i20.SecretService, i20.SecretService, [i0.NgZone, i18.TrackerService]), i0.ɵmpd(4608, i21.UtilsService, i21.UtilsService, [i9.DomSanitizer, i20.SecretService]), i0.ɵmpd(135680, i22.OpenAPIService, i22.OpenAPIService, [i7.HttpClient, i19.RoutesService, i18.TrackerService, i20.SecretService]), i0.ɵmpd(4608, i23.GitHubService, i23.GitHubService, [i7.HttpClient, i0.NgZone, i18.TrackerService, i17.PlatformService, i20.SecretService]), i0.ɵmpd(135680, i24.SearchService, i24.SearchService, [i19.RoutesService, i18.TrackerService, i0.NgZone, i17.PlatformService]), i0.ɵmpd(135680, i25.MenuService, i25.MenuService, [i19.RoutesService, i9.Meta, i9.Title, i22.OpenAPIService, i18.TrackerService, i24.SearchService]), i0.ɵmpd(4608, i26.TourService, i26.TourService, [i18.TrackerService]), i0.ɵmpd(512, i7.HttpClientXsrfModule, i7.HttpClientXsrfModule, []), i0.ɵmpd(512, i7.HttpClientModule, i7.HttpClientModule, []), i0.ɵmpd(512, i11.ɵba, i11.ɵba, []), i0.ɵmpd(512, i11.FormsModule, i11.FormsModule, []), i0.ɵmpd(512, i8.CommonModule, i8.CommonModule, []), i0.ɵmpd(1024, i0.ErrorHandler, i9.ɵa, []), i0.ɵmpd(1024, i0.NgProbeToken, function () {
return [i16.ɵb()];
}, []), i0.ɵmpd(256, i0.APP_ID, "lucybot-doc-app", []), i0.ɵmpd(2048, i9.ɵTRANSITION_ID, null, [i0.APP_ID]), i0.ɵmpd(512, i16.ɵg, i16.ɵg, [i0.Injector]), i0.ɵmpd(1024, i0.APP_INITIALIZER, function (p0_0, p1_0, p1_1, p1_2, p2_0) {
return [i9.ɵh(p0_0), i9.ɵf(p1_0, p1_1, p1_2), i16.ɵh(p2_0)];
}, [[2, i0.NgProbeToken], i9.ɵTRANSITION_ID, i8.DOCUMENT, i0.Injector, i16.ɵg]), i0.ɵmpd(512, i0.ApplicationInitStatus, i0.ApplicationInitStatus, [[2, i0.APP_INITIALIZER]]), i0.ɵmpd(131584, i0.ApplicationRef, i0.ApplicationRef, [i0.NgZone, i0.ɵConsole, i0.Injector, i0.ErrorHandler, i0.ComponentFactoryResolver, i0.ApplicationInitStatus]), i0.ɵmpd(512, i0.ApplicationModule, i0.ApplicationModule, [i0.ApplicationRef]), i0.ɵmpd(512, i9.BrowserModule, i9.BrowserModule, [[3, i9.BrowserModule]]), i0.ɵmpd(512, i9.BrowserTransferStateModule, i9.BrowserTransferStateModule, []), i0.ɵmpd(512, i10.TransferHttpCacheModule, i10.TransferHttpCacheModule, []), i0.ɵmpd(512, i13.BrowserAnimationsModule, i13.BrowserAnimationsModule, []), i0.ɵmpd(1024, i16.ɵa, i16.ɵd, [[3, i16.Router]]), i0.ɵmpd(512, i16.UrlSerializer, i16.DefaultUrlSerializer, []), i0.ɵmpd(512, i16.ChildrenOutletContexts, i16.ChildrenOutletContexts, []), i0.ɵmpd(256, i8.APP_BASE_HREF, i1.ɵ0, []), i0.ɵmpd(256, i16.ROUTER_CONFIGURATION, { useHash: false }, []), i0.ɵmpd(1024, i8.LocationStrategy, i16.ɵc, [i8.PlatformLocation, [2, i8.APP_BASE_HREF], i16.ROUTER_CONFIGURATION]), i0.ɵmpd(512, i8.Location, i8.Location, [i8.LocationStrategy]), i0.ɵmpd(512, i0.Compiler, i0.Compiler, []), i0.ɵmpd(512, i0.NgModuleFactoryLoader, i0.SystemJsNgModuleLoader, [i0.Compiler, [2, i0.SystemJsNgModuleLoaderConfig]]), i0.ɵmpd(1024, i16.ROUTES, function () {
return [[{ path: "", component: i27.DocumentationComponent }, { path: ":item0", component: i27.DocumentationComponent }, { path: ":item0/:item1", component: i27.DocumentationComponent }, { path: ":item0/:item1/:item2", component: i27.DocumentationComponent }, { path: ":item0/:item1/:item2/:item3", component: i27.DocumentationComponent }, { path: ":item0/:item1/:item2/:item3/:item4", component: i27.DocumentationComponent }, { path: "**", redirectTo: "", pathMatch: "full" }]];
}, []), i0.ɵmpd(1024, i16.Router, i16.ɵe, [i0.ApplicationRef, i16.UrlSerializer, i16.ChildrenOutletContexts, i8.Location, i0.Injector, i0.NgModuleFactoryLoader, i0.Compiler, i16.ROUTES, i16.ROUTER_CONFIGURATION, [2, i16.UrlHandlingStrategy], [2, i16.RouteReuseStrategy]]), i0.ɵmpd(512, i16.RouterModule, i16.RouterModule, [[2, i16.ɵa], [2, i16.Router]]), i0.ɵmpd(512, i28.TooltipModule, i28.TooltipModule, []), i0.ɵmpd(512, i29.Ng2DatetimePickerModule, i29.Ng2DatetimePickerModule, []), i0.ɵmpd(512, i1.AppModule, i1.AppModule, []), i0.ɵmpd(256, i7.ɵf, "XSRF-TOKEN", []), i0.ɵmpd(256, i7.ɵg, "X-XSRF-TOKEN", []), i0.ɵmpd(256, "ORIGIN_URL", "", [])]);
});
exports.AppModuleNgFactory = AppModuleNgFactory;
/***/ }),
/***/ "./src/app/app.module.ts":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "AppModule", function() { return AppModule; });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "ɵ0", function() { return ɵ0; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__("./node_modules/@angular/core/esm5/core.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__angular_core__);
__webpack_require__("./src/app/views/oauth_callback.html");
Object(__WEBPACK_IMPORTED_MODULE_0__angular_core__["enableProdMode"])();
window.originalURL = {
path: window.location.pathname,
hash: window.location.hash,
};
window.config = window.config || {};
var ɵ0 = window.config.basePath || '/';
var AppModule = /** @class */ (function () {
function AppModule() {
}
return AppModule;
}());
/***/ }),
/***/ "./src/app/components/api-call.ngfactory.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.APICallComponentNgFactory = exports.RenderType_APICallComponent = undefined;
exports.View_APICallComponent_0 = View_APICallComponent_0;
exports.View_APICallComponent_Host_0 = View_APICallComponent_Host_0;
var _core = __webpack_require__("./node_modules/@angular/core/esm5/core.js");
var i0 = _interopRequireWildcard(_core);
var _apiResponse = __webpack_require__("./src/app/components/api-response.ngfactory.js");
var i1 = _interopRequireWildcard(_apiResponse);
var _apiResponse2 = __webpack_require__("./src/app/components/api-response.ts");
var i2 = _interopRequireWildcard(_apiResponse2);
var _utils = __webpack_require__("./src/app/services/utils.ts");
var i3 = _interopRequireWildcard(_utils);
var _openapi = __webpack_require__("./src/app/services/openapi.ts");
var i4 = _interopRequireWildcard(_openapi);
var _sampleCode = __webpack_require__("./src/app/components/sample-code.ngfactory.js");
var i5 = _interopRequireWildcard(_sampleCode);
var _sampleCode2 = __webpack_require__("./src/app/components/sample-code.ts");
var i6 = _interopRequireWildcard(_sampleCode2);
var _tracker = __webpack_require__("./src/app/services/tracker.ts");
var i7 = _interopRequireWildcard(_tracker);
var _forms = __webpack_require__("./node_modules/@angular/forms/esm5/forms.js");
var i8 = _interopRequireWildcard(_forms);
var _parameter = __webpack_require__("./src/app/components/parameter.ngfactory.js");
var i9 = _interopRequireWildcard(_parameter);
var _parameter2 = __webpack_require__("./src/app/components/parameter.ts");
var i10 = _interopRequireWildcard(_parameter2);
var _common = __webpack_require__("./node_modules/@angular/common/esm5/common.js");
var i11 = _interopRequireWildcard(_common);
var _apiCall = __webpack_require__("./src/app/components/api-call.ts");
var i12 = _interopRequireWildcard(_apiCall);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
var styles_APICallComponent = ["api-response[_ngcontent-%COMP%] {\n display: block;\n }\n .parameters-title[_ngcontent-%COMP%], .parameters-box[_ngcontent-%COMP%] {\n border: 1px solid #d9d9d9;\n padding: 15px;\n background-color: #f5f5f5;\n }\n [_nghost-%COMP%] .parameters-box .well {\n background-color: #f5f5f5 !important;\n }\n .parameters-title[_ngcontent-%COMP%] {\n border-bottom: none;\n margin-bottom: -2px;\n background-color: #f5f5f5;\n }\n .parameters-box[_ngcontent-%COMP%] {\n border: 1px solid #d9d9d9;\n border-top: none;\n border-radius: 4px;\n margin-bottom: 20px;\n padding-top: 0px;\n }"]; /**
* @fileoverview This file was generated by the Angular template compiler. Do not edit.
*
* @suppress {suspiciousCode,uselessCode,missingProperties,missingOverride,checkTypes}
* tslint:disable
*/
var RenderType_APICallComponent = i0.ɵcrt({ encapsulation: 0, styles: styles_APICallComponent, data: { "animation": [{ type: 7, name: "shrinkOut", definitions: [{ type: 0, name: "in", styles: { type: 6, styles: { height: "*" }, offset: null }, options: undefined }, { type: 1, expr: "* => void", animation: [{ type: 6, styles: { height: "*", overflow: "hidden" }, offset: null }, { type: 4, styles: { type: 6, styles: { height: 0 }, offset: null }, timings: 0 }], options: null }, { type: 1, expr: "void => *", animation: [{ type: 6, styles: { height: 0, overflow: "hidden" }, offset: null }, { type: 4, styles: { type: 6, styles: { height: "*" }, offset: null }, timings: 500 }], options: null }], options: {} }] } });
exports.RenderType_APICallComponent = RenderType_APICallComponent;
function View_APICallComponent_1(_l) {
return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 2, "div", [["class", "col-xs-12 col-md-6"]], [[24, "@shrinkOut", 0]], null, null, null, null)), (_l()(), i0.ɵeld(1, 0, null, null, 1, "api-response", [], null, null, null, i1.View_APIResponseComponent_0, i1.RenderType_APIResponseComponent)), i0.ɵdid(2, 573440, [["apiResponse", 4]], 0, i2.APIResponseComponent, [i3.UtilsService, i4.OpenAPIService], { response: [0, "response"], headers: [1, "headers"], statusCode: [2, "statusCode"] }, null)], function (_ck, _v) {
var _co = _v.component;var currVal_1 = _co.response.body;var currVal_2 = _co.response.headers;var currVal_3 = _co.response.statusCode;_ck(_v, 2, 0, currVal_1, currVal_2, currVal_3);
}, function (_ck, _v) {
var _co = _v.component;var currVal_0 = _co.response ? "in" : "out";_ck(_v, 0, 0, currVal_0);
});
}
function View_APICallComponent_2(_l) {
return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 3, "div", [["class", "col-xs-12"]], [[2, "col-md-6", null]], null, null, null, null)), (_l()(), i0.ɵeld(1, 0, null, null, 2, "sample-code", [], null, null, null, i5.View_SampleCodeComponent_0, i5.RenderType_SampleCodeComponent)), i0.ɵdid(2, 4767744, [[1, 4], ["sampleCode", 4]], 0, i6.SampleCodeComponent, [i4.OpenAPIService, i3.UtilsService, i7.TrackerService], { answers: [0, "answers"], apiCall: [1, "apiCall"], templateInput: [2, "templateInput"] }, null), i0.ɵpod(3, { response: 0 })], function (_ck, _v) {
var _co = _v.component;var currVal_1 = _co.answers;var currVal_2 = _co.apiCall;var currVal_3 = _ck(_v, 3, 0, _co.response ? _co.response.body : null);_ck(_v, 2, 0, currVal_1, currVal_2, currVal_3);
}, function (_ck, _v) {
var _co = _v.component;var currVal_0 = !_co.response && !_co.executing;_ck(_v, 0, 0, currVal_0);
});
}
function View_APICallComponent_0(_l) {
return i0.ɵvid(0, [i0.ɵqud(671088640, 1, { sampleCodeComponent: 0 }), (_l()(), i0.ɵeld(1, 0, null, null, 17, "div", [["class", "row"]], null, null, null, null, null)), (_l()(), i0.ɵeld(2, 0, null, null, 12, "div", [["class", "col-xs-12 col-md-6"]], null, null, null, null, null)), (_l()(), i0.ɵeld(3, 0, null, null, 11, "form", [["novalidate", ""]], [[2, "ng-untouched", null], [2, "ng-touched", null], [2, "ng-pristine", null], [2, "ng-dirty", null], [2, "ng-valid", null], [2, "ng-invalid", null], [2, "ng-pending", null]], [[null, "submit"], [null, "reset"]], function (_v, en, $event) {
var ad = true;var _co = _v.component;if ("submit" === en) {
var pd_0 = i0.ɵnov(_v, 5).onSubmit($event) !== false;
ad = pd_0 && ad;
}if ("reset" === en) {
var pd_1 = i0.ɵnov(_v, 5).onReset() !== false;
ad = pd_1 && ad;
}if ("submit" === en) {
var pd_2 = _co.execute() !== false;
ad = pd_2 && ad;
}return ad;
}, null, null)), i0.ɵdid(4, 16384, null, 0, i8.ɵbf, [], null, null), i0.ɵdid(5, 4210688, null, 0, i8.NgForm, [[8, null], [8, null]], null, null), i0.ɵprd(2048, null, i8.ControlContainer, null, [i8.NgForm]), i0.ɵdid(7, 16384, null, 0, i8.NgControlStatusGroup, [i8.ControlContainer], null, null), (_l()(), i0.ɵeld(8, 0, null, null, 0, "input", [["hidden", ""], ["type", "submit"]], null, null, null, null, null)), (_l()(), i0.ɵeld(9, 0, null, null, 2, "div", [["class", "parameters-title"]], null, null, null, null, null)), (_l()(), i0.ɵeld(10, 0, null, null, 1, "h4", [], null, null, null, null, null)), (_l()(), i0.ɵted(-1, null, ["Parameters"])), (_l()(), i0.ɵeld(12, 0, null, null, 2, "div", [["class", "parameters-box"]], null, null, null, null, null)), (_l()(), i0.ɵeld(13, 0, null, null, 1, "parameter-set", [], null, [[null, "valueChange"]], function (_v, en, $event) {
var ad = true;var _co = _v.component;if ("valueChange" === en) {
var pd_0 = _co.onInputChange() !== false;
ad = pd_0 && ad;
}return ad;
}, i9.View_ParameterSetComponent_0, i9.RenderType_ParameterSetComponent)), i0.ɵdid(14, 573440, null, 0, i10.ParameterSetComponent, [i4.OpenAPIService, i3.UtilsService], { parameterSet: [0, "parameterSet"], groups: [1, "groups"], answers: [2, "answers"] }, { valueChange: "valueChange" }), (_l()(), i0.ɵand(16777216, null, null, 1, null, View_APICallComponent_1)), i0.ɵdid(16, 16384, null, 0, i11.NgIf, [i0.ViewContainerRef, i0.TemplateRef], { ngIf: [0, "ngIf"] }, null), (_l()(), i0.ɵand(16777216, null, null, 1, null, View_APICallComponent_2)), i0.ɵdid(18, 16384, null, 0, i11.NgIf, [i0.ViewContainerRef, i0.TemplateRef], { ngIf: [0, "ngIf"] }, null)], function (_ck, _v) {
var _co = _v.component;var currVal_7 = _co.apiCall.operation.parameters;var currVal_8 = _co.apiCall.operation.parameterGroups;var currVal_9 = _co.answers;_ck(_v, 14, 0, currVal_7, currVal_8, currVal_9);var currVal_10 = _co.response;_ck(_v, 16, 0, currVal_10);var currVal_11 = !_co.utils.config.codegen.disabled;_ck(_v, 18, 0, currVal_11);
}, function (_ck, _v) {
var currVal_0 = i0.ɵnov(_v, 7).ngClassUntouched;var currVal_1 = i0.ɵnov(_v, 7).ngClassTouched;var currVal_2 = i0.ɵnov(_v, 7).ngClassPristine;var currVal_3 = i0.ɵnov(_v, 7).ngClassDirty;var currVal_4 = i0.ɵnov(_v, 7).ngClassValid;var currVal_5 = i0.ɵnov(_v, 7).ngClassInvalid;var currVal_6 = i0.ɵnov(_v, 7).ngClassPending;_ck(_v, 3, 0, currVal_0, currVal_1, currVal_2, currVal_3, currVal_4, currVal_5, currVal_6);
});
}
function View_APICallComponent_Host_0(_l) {
return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 1, "api-call", [], null, null, null, View_APICallComponent_0, RenderType_APICallComponent)), i0.ɵdid(1, 638976, null, 0, i12.APICallComponent, [i4.OpenAPIService, i3.UtilsService, i7.TrackerService, i0.ElementRef], null, null)], function (_ck, _v) {
_ck(_v, 1, 0);
}, null);
}
var APICallComponentNgFactory = i0.ɵccf("api-call", i12.APICallComponent, View_APICallComponent_Host_0, { apiCall: "apiCall" }, {}, []);
exports.APICallComponentNgFactory = APICallComponentNgFactory;
/***/ }),
/***/ "./src/app/components/api-call.ts":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APICallComponent", function() { return APICallComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core__ = __webpack_require__("./node_modules/@angular/core/esm5/core.js");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__angular_core___default = __webpack_require__.n(__WEBPACK_IMPORTED_MODULE_0__angular_core__);
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__services_openapi__ = __webpack_require__("./src/app/services/openapi.ts");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__services_utils__ = __webpack_require__("./src/app/services/utils.ts");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__services_tracker__ = __webpack_require__("./src/app/services/tracker.ts");
var APICallComponent = /** @class */ (function () {
function APICallComponent(openapi, utils, tracker, elementRef) {
this.openapi = openapi;
this.utils = utils;
this.tracker = tracker;
this.elementRef = elementRef;
this.answers = {};
this.marked = window.marked;
}
APICallComponent.prototype.ngOnInit = function () {
setTimeout(function () { return window.app.appref.tick(); }); // FIXME: *ngIf="apiCallComponent" in docs view needs this.
};
APICallComponent.prototype.ngOnChanges = function () {
this.answers = {};
this.response = null;
};
APICallComponent.prototype.onInputChange = function () {
if (this.sampleCodeComponent)
this.sampleCodeComponent.refreshSampleCode();
};
APICallComponent.prototype.execute = function () {
var _this = this;
if (!this.openapi.secrets.isAuthenticated(this.apiCall.operation)) {
return this.openapi.secrets.startAuthentication();
}
this.tracker.track('api_call', {
path: this.apiCall.path,
method: this.apiCall.method,
});
this.error = null;
this.executing = true;
this.response = null;
this.openapi.request({
path: this.apiCall.path,
method: this.apiCall.method,
answers: this.answers,
})
.then(function (data, textStatus, xhr) {
_this.response = {
body: data,
statusCode: xhr.status,
headers: xhr.getAllResponseHeaders().split('\r\n'),
};
var type = window.checkResponse ? window.checkResponse(data, xhr.status).type : 'success';
if (type !== 'success')
type = 'failure';
_this.tracker.track('api_call_' + type, {
status: xhr.status,
path: _this.apiCall.path,
method: _this.apiCall.method,
});
})
.fail(function (xhr) {
if (!xhr.status) {
// Probably a CORS issue
_this.response = {
body: "An unknown error occurred, possibly related to CORS. Check your browser's console for details.",
statusCode: 0,
headers: xhr.getAllResponseHeaders().split('\r\n'),
};
}
else {
_this.response = {
body: xhr.responseText,
statusCode: xhr.status,
headers: xhr.getAllResponseHeaders().split('\r\n'),
};
}
_this.tracker.track('api_call_failure', {
status: xhr.status,
path: _this.apiCall.path,
method: _this.apiCall.method,
});
})
.always(function (_) {
_this.executing = false;
setTimeout(function () {
_this.utils.scrollToSelection(window.jQuery(_this.elementRef.nativeElement).find('api-response'));
}, 100);
});
};
return APICallComponent;
}());
/***/ }),
/***/ "./src/app/components/api-response.ngfactory.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.APIResponseComponentNgFactory = exports.RenderType_APIResponseComponent = undefined;
exports.View_APIResponseComponent_0 = View_APIResponseComponent_0;
exports.View_APIResponseComponent_Host_0 = View_APIResponseComponent_Host_0;
var _core = __webpack_require__("./node_modules/@angular/core/esm5/core.js");
var i0 = _interopRequireWildcard(_core);
var _common = __webpack_require__("./node_modules/@angular/common/esm5/common.js");
var i1 = _interopRequireWildcard(_common);
var _apiResponse = __webpack_require__("./src/app/components/api-response.ts");
var i2 = _interopRequireWildcard(_apiResponse);
var _utils = __webpack_require__("./src/app/services/utils.ts");
var i3 = _interopRequireWildcard(_utils);
var _openapi = __webpack_require__("./src/app/services/openapi.ts");
var i4 = _interopRequireWildcard(_openapi);
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
var styles_APIResponseComponent = []; /**
* @fileoverview This file was generated by the Angular template compiler. Do not edit.
*
* @suppress {suspiciousCode,uselessCode,missingProperties,missingOverride,checkTypes}
* tslint:disable
*/
var RenderType_APIResponseComponent = i0.ɵcrt({ encapsulation: 2, styles: styles_APIResponseComponent, data: {} });
exports.RenderType_APIResponseComponent = RenderType_APIResponseComponent;
function View_APIResponseComponent_1(_l) {
return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 5, "div", [["class", "alert alert-warning"]], null, null, null, null, null)), (_l()(), i0.ɵeld(1, 0, null, null, 4, "p", [], null, null, null, null, null)), (_l()(), i0.ɵeld(2, 0, null, null, 1, "span", [], null, null, null, null, null)), (_l()(), i0.ɵted(-1, null, ["Authentication failed - "])), (_l()(), i0.ɵeld(4, 0, null, null, 1, "a", [], null, [[null, "click"]], function (_v, en, $event) {
var ad = true;var _co = _v.component;if ("click" === en) {
var pd_0 = _co.openapi.secrets.startAuthentication() !== false;
ad = pd_0 && ad;
}return ad;
}, null, null)), (_l()(), i0.ɵted(-1, null, ["try updating your credentials"]))], null, null);
}
function View_APIResponseComponent_2(_l) {
return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 0, "div", [], [[8, "className", 0], [8, "innerHTML", 1]], null, null, null, null))], null, function (_ck, _v) {
var _co = _v.component;var currVal_0 = i0.ɵinlineInterpolate(1, "alert status-code-alert alert-", _co.responseAlert.type, "");var currVal_1 = _co.responseAlert.message;_ck(_v, 0, 0, currVal_0, currVal_1);
});
}
function View_APIResponseComponent_0(_l) {
return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 1, "h1", [["class", "text-center"]], [[8, "hidden", 0]], null, null, null, null)), (_l()(), i0.ɵeld(1, 0, null, null, 0, "i", [["class", "fa fa-spin fa-refresh"]], null, null, null, null, null)), (_l()(), i0.ɵeld(2, 0, null, null, 1, "div", [["class", "alert alert-danger"]], [[8, "hidden", 0]], null, null, null, null)), (_l()(), i0.ɵted(3, null, ["", ""])), (_l()(), i0.ɵeld(4, 0, null, null, 14, "div", [], [[8, "hidden", 0]], null, null, null, null)), (_l()(), i0.ɵand(16777216, null, null, 1, null, View_APIResponseComponent_1)), i0.ɵdid(6, 16384, null, 0, i1.NgIf, [i0.ViewContainerRef, i0.TemplateRef], { ngIf: [0, "ngIf"] }, null), (_l()(), i0.ɵand(16777216, null, null, 1, null, View_APIResponseComponent_2)), i0.ɵdid(8, 16384, null, 0, i1.NgIf, [i0.ViewContainerRef, i0.TemplateRef], { ngIf: [0, "ngIf"] }, null), (_l()(), i0.ɵeld(9, 0, null, null, 9, "div", [], [[8, "hidden", 0]], null, null, null, null)), (_l()(), i0.ɵeld(10, 0, null, null, 8, "pre", [], null, null, null, null, null)), (_l()(), i0.ɵeld(11, 0, null, null, 3, "a", [], null, [[null, "click"]], function (_v, en, $event) {
var ad = true;var _co = _v.component;if ("click" === en) {
var pd_0 = (_co.showHeaders = !_co.showHeaders) !== false;
ad = pd_0 && ad;
}return ad;
}, null, null)), (_l()(), i0.ɵeld(12, 0, null, null, 0, "i", [["class", "fa fa-left"]], [[2, "fa-plus-square-o", null], [2, "fa-minus-square-o", null]], null, null, null, null)), (_l()(), i0.ɵeld(13, 0, null, null, 1, "span", [], null, null, null, null, null)), (_l()(), i0.ɵted(-1, null, ["Headers"])), (_l()(), i0.ɵeld(15, 0, null, null, 0, "br", [], null, null, null, null, null)), (_l()(), i0.ɵeld(16, 0, null, null, 0, "code", [], [[8, "hidden", 0], [8, "innerHTML", 1]], null, null, null, null)), (_l()(), i0.ɵeld(17, 0, null, null, 0, "hr", [], [[8, "hidden", 0]], null, null, null, null)), (_l()(), i0.ɵeld(18, 0, null, null, 0, "code", [], [[8, "innerHTML", 1]], null, null, null, null))], function (_ck, _v) {
var _co = _v.component;var currVal_4 = _co.statusCode === 401 && _co.openapi.secrets.hasSecurity;_ck(_v, 6, 0, currVal_4);var currVal_5 = _co.responseAlert;_ck(_v, 8, 0, currVal_5);
}, function (_ck, _v) {
var _co = _v.component;var currVal_0 = !_co.refreshing;_ck(_v, 0, 0, currVal_0);var currVal_1 = !_co.error;_ck(_v, 2, 0, currVal_1);var currVal_2 = _co.error;_ck(_v, 3, 0, currVal_2);var currVal_3 = _co.response === undefined || _co.refreshing;_ck(_v, 4, 0, currVal_3);var currVal_6 = _co.response === undefined;_ck(_v, 9, 0, currVal_6);var currVal_7 = !_co.showHeaders;var currVal_8 = _co.showHeaders;_ck(_v, 12, 0, currVal_7, currVal_8);var currVal_9 = !_co.showHeaders;var currVal_10 = _co.highlightedHeaders;_ck(_v, 16, 0, currVal_9, currVal_10);var currVal_11 = !_co.showHeaders;_ck(_v, 17, 0, currVal_11);var currVal_12 = _co.highlightedResponse;_ck(_v, 18, 0, currVal_12);
});
}
function View_APIResponseComponent_Host_0(_l) {
return i0.ɵvid(0, [(_l()(), i0.ɵeld(0, 0, null, null, 1, "api-response", [], null, null, null, View_APIResponseComponent_0, RenderType_APIResponseComponent)), i0.ɵdid(1, 573440, null, 0, i2.APIResponseComponent, [i3.UtilsService, i4.OpenAPIService], null, null)], null, null);
}
var APIResponseComponentNgFactory = i0.ɵccf("api-response", i2.APIResponseComponent, View_APIResponseComponent_Host_0, { response: "response", headers: "headers", statusCode: "statusCode", isRecipe: "isRecipe" }, {}, []);
exports.APIResponseComponentNgFactory = APIResponseComponentNgFactory;
/***/ }),
/***/ "./src/app/components/api-response.ts":
/***/ (function(module, __webpack_exports__, __webpack_require__) {
"use strict";
Object.defineProperty(__webpack_exports__, "__esModule", { value: true });
/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, "APIResponseComponent", function() { return APIResponseComponent; });
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__services_utils__ = __webpack_require__("./src/app/services/utils.ts");
/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__services_openapi__ = __webpack_require__("./src/app/services/openapi.ts");
var MAX_RESPONSE_LENGTH_FOR_HIGHLIGHT = 100 * 1000;
var APIResponseComponent = /** @class */ (function () {
function APIResponseComponent(utils, openapi) {
this.utils = utils;
this.openapi = openapi;
}
APIResponseComponent.prototype.ngOnChanges = function () {
this.headers = this.headers || [];
this.setAlert();
this.setResponseType();
this.stringifyResponse();
};
APIResponseComponent.prototype.stringifyResponse = function () {
var contentTypeHeader = this.headers.filter(function (s) { return s.toLowerCase().indexOf('content-type') === 0; })[0] || '';
var responseString = '';
if (this.response instanceof Document) {
responseString = window.WebCodeBeauty.xml((new XMLSerializer()).serializeToString(this.response));
}
else {
if (typeof this.response === 'object') {
responseString = JSON.stringify(this.response, null, 2);
}
else {
responseString = this.response || '';
}
if (contentTypeHeader.indexOf('application/json') !== -1) {
try {
responseString = JSON.stringify(JSON.parse(responseString), null, 2);
}
catch (e) {
console.log('invalid JSON:', responseString);
}
}
else if (contentTypeHeader.indexOf('/xml') !== -1) {
responseString = window.WebCodeBeauty.xml(responseString);
}
}
this.highlightedHeaders = window.Prism.highlight(this.headers.join('\r\n'), window.Prism.languages.http);
var highlightLang = '';
if (contentTypeHeader.indexOf('/xml') !== -1) {
highlightLang = 'xml';
}
else if (contentTypeHeader.indexOf('/json') !== -1) {
highlightLang = 'json';
}
if (highlightLang && responseString.length < MAX_RESPONSE_LENGTH_FOR_HIGHLIGHT) {
this.highlightedResponse = window.Prism.highlight(responseString, window.Prism.languages[highlightLang]);
}
else {
responseString = responseString.replace(/</g, '<').replace(/>/g, '>');
this.highlightedResponse = responseString;
}
};
APIResponseComponent.prototype.setAlert = function () {
if (window.checkResponse) {
this.responseAlert = window.checkResponse(this.response, this.statusCode);
}
else {
this.responseAlert = { type: 'danger', message: 'Status Code ' + this.statusCode };
if (this.statusCode >= 200 && this.statusCode < 300)
this.responseAlert.type = 'success';
else if (this.statusCode >= 300 && this.statusCode < 400)
this.responseAlert.type = 'warning';
}
if (this.isRecipe) {
if (this.responseAlert.type === 'success') {
this.responseAlert.message =
"Success! Review the response below and click the <b>next</b> button above when you're ready to continue.";
}
else {
this.responseAlert.message =
"The API returned an error. Please review the response below" +
" and follow the instructions above to execute this step correctly.<br>" +
this.responseAlert.message;
}
}
};
APIResponseComponent.prototype.setResponseType = function () {
var _this = this;
this.responseType = '';
this.headers.forEach(function (header) {
var m = header.match(/content-type:\s*(.*)$/i);
if (!m)
return;
var contentType = m[1];
if (contentType.match(/json/))
_this.responseType = 'JSON';
else if (contentType.match(/xml/))
_this.responseType = 'XML';
// TODO: add more content types
});
};
return APIResponseComponent;
}());
/***/ }),
/***/ "./src/app/components/auth.ngfactory.js":
/***/ (function(module, exports, __webpack_require__) {
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.AuthC