1 | "use strict";
|
2 | var __importDefault = (this && this.__importDefault) || function (mod) {
|
3 | return (mod && mod.__esModule) ? mod : { "default": mod };
|
4 | };
|
5 | Object.defineProperty(exports, "__esModule", { value: true });
|
6 |
|
7 | var cloneDeep_1 = __importDefault(require("lodash/cloneDeep"));
|
8 | var xhr_1 = require("./xhr");
|
9 | var user_1 = require("./user");
|
10 | var metadata_1 = require("./metadata");
|
11 | var execution_1 = require("./execution");
|
12 | var project_1 = require("./project");
|
13 | var report_1 = require("./report/report");
|
14 | var dashboard_1 = require("./dashboard/dashboard");
|
15 | var config_1 = require("./config");
|
16 | var catalogue_1 = require("./catalogue");
|
17 | var ldm_1 = require("./ldm");
|
18 | var attributesMapLoader_1 = require("./utils/attributesMapLoader");
|
19 | var visualizationObjectHelper_1 = require("./utils/visualizationObjectHelper");
|
20 | var referenceHandling_1 = require("./referenceHandling");
|
21 | var metadataExt_1 = require("./metadataExt");
|
22 | var bootstrap_1 = require("./bootstrap");
|
23 |
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 |
|
35 |
|
36 |
|
37 |
|
38 |
|
39 |
|
40 | var SDK = (function () {
|
41 | function SDK(fetchMethod, config) {
|
42 | if (config === void 0) { config = {}; }
|
43 | this.fetchMethod = fetchMethod;
|
44 | this.configStorage = config_1.sanitizeConfig(config);
|
45 | this.config = new config_1.ConfigModule(this.configStorage);
|
46 | this.xhr = new xhr_1.XhrModule(fetchMethod, this.configStorage);
|
47 | this.user = new user_1.UserModule(this.xhr);
|
48 | this.md = new metadata_1.MetadataModule(this.xhr);
|
49 | this.mdExt = new metadataExt_1.MetadataModuleExt(this.xhr);
|
50 | this.execution = new execution_1.ExecutionModule(this.xhr, this.md);
|
51 | this.project = new project_1.ProjectModule(this.xhr);
|
52 | this.report = new report_1.ReportModule(this.xhr);
|
53 | this.dashboard = new dashboard_1.DashboardModule(this.xhr);
|
54 | this.catalogue = new catalogue_1.CatalogueModule(this.xhr, this.execution);
|
55 | this.bootstrap = new bootstrap_1.BootstrapModule(this.xhr);
|
56 | this.ldm = new ldm_1.LdmModule(this.xhr);
|
57 | var attributesMapLoaderModule = new attributesMapLoader_1.AttributesMapLoaderModule(this.md);
|
58 | this.utils = {
|
59 | loadAttributesMap: attributesMapLoaderModule.loadAttributesMap.bind(attributesMapLoaderModule),
|
60 | getAttributesDisplayForms: visualizationObjectHelper_1.getAttributesDisplayForms,
|
61 | convertReferencesToUris: referenceHandling_1.convertReferencesToUris,
|
62 | convertUrisToReferences: referenceHandling_1.convertUrisToReferences,
|
63 | };
|
64 | }
|
65 | SDK.prototype.clone = function () {
|
66 | return new SDK(this.fetchMethod, cloneDeep_1.default(this.configStorage));
|
67 | };
|
68 | return SDK;
|
69 | }());
|
70 | exports.SDK = SDK;
|
71 |
|
72 |
|
73 |
|
74 |
|
75 |
|
76 |
|
77 | exports.factory = function (fetchMethod) { return function (config) {
|
78 | if (config === void 0) { config = {}; }
|
79 | return new SDK(fetchMethod, config);
|
80 | }; };
|