UNPKG

shyft

Version:

Model driven GraphQL API framework

100 lines (99 loc) 4.99 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.isStorageConfiguration = exports.StorageConfiguration = void 0; var util_1 = require("../util"); var StorageConfiguration = /** @class */ (function () { function StorageConfiguration(setup) { if (setup === void 0) { setup = {}; } var name = setup.name, storageInstance = setup.storageInstance, storageModels = setup.storageModels, connectionConfig = setup.connectionConfig; if (name) { this.name = name; } if (storageInstance) { this.setStorageInstance(storageInstance); } if (storageModels) { this.setStorageModels(storageModels); } if (connectionConfig) { this.setConnectionConfig(connectionConfig); } } StorageConfiguration.prototype.setStorageInstance = function (storageInstance) { this.storageInstance = storageInstance; }; StorageConfiguration.prototype.getStorageInstance = function () { var _this = this; util_1.passOrThrow(this.storageInstance, function () { return "Storage instance not set for storage type '" + _this.name + "'"; }); return this.storageInstance; }; StorageConfiguration.prototype.setStorageModels = function (storageModels) { this.storageModels = storageModels; }; StorageConfiguration.prototype.getStorageModels = function () { var _this = this; util_1.passOrThrow(this.storageModels, function () { return "Storage models not set for storage type '" + _this.name + "'"; }); return this.storageModels; }; StorageConfiguration.prototype.setConnectionConfig = function (connectionConfig) { this.connectionConfig = connectionConfig; }; StorageConfiguration.prototype.getConnectionConfig = function () { var _this = this; util_1.passOrThrow(this.connectionConfig, function () { return "Connection config not set for storage type '" + _this.name + "'"; }); return this.connectionConfig; }; StorageConfiguration.prototype.generateGetStateIdFunction = function ( // eslint-disable-next-line @typescript-eslint/no-unused-vars _configuration) { throw new Error("generateGetStateIdFunction() not implemented for storage type '" + this.name + "'"); }; StorageConfiguration.prototype.generateGetStateIdsFunction = function ( // eslint-disable-next-line @typescript-eslint/no-unused-vars _configuration) { throw new Error("generateGetStateIdsFunction() not implemented for storage type '" + this.name + "'"); }; StorageConfiguration.prototype.generateGetStateMapFunction = function ( // eslint-disable-next-line @typescript-eslint/no-unused-vars _configuration) { throw new Error("generateGetStateMapFunction() not implemented for storage type '" + this.name + "'"); }; StorageConfiguration.prototype.generateGetStateNameFunction = function ( // eslint-disable-next-line @typescript-eslint/no-unused-vars _configuration) { throw new Error("generateGetStateNameFunction() not implemented for storage type '" + this.name + "'"); }; StorageConfiguration.prototype.generateGetAttributeTranslationFunction = function ( // eslint-disable-next-line @typescript-eslint/no-unused-vars _configuration) { throw new Error("generateGetAttributeTranslationFunction() not implemented for storage type '" + this.name + "'"); }; StorageConfiguration.prototype.generateGetAttributeTranslationsFunction = function ( // eslint-disable-next-line @typescript-eslint/no-unused-vars _configuration) { throw new Error("generateGetAttributeTranslationsFunction() not implemented for storage type '" + this.name + "'"); }; StorageConfiguration.prototype.generateMergeTranslationsFunction = function ( // eslint-disable-next-line @typescript-eslint/no-unused-vars _configuration) { throw new Error("generateMergeTranslationsFunction() not implemented for storage type '" + this.name + "'"); }; StorageConfiguration.prototype.createI18nIndices = function ( // eslint-disable-next-line @typescript-eslint/no-unused-vars _configuration) { throw new Error("createI18nIndices() not implemented for storage type '" + this.name + "'"); }; StorageConfiguration.prototype.generateI18nIndicesMigration = function ( // eslint-disable-next-line @typescript-eslint/no-unused-vars _configuration, // eslint-disable-next-line @typescript-eslint/no-unused-vars _manager) { throw new Error("generateI18nIndicesMigration() not implemented for storage type '" + this.name + "'"); }; return StorageConfiguration; }()); exports.StorageConfiguration = StorageConfiguration; var isStorageConfiguration = function (obj) { return obj instanceof StorageConfiguration; }; exports.isStorageConfiguration = isStorageConfiguration;