"use strict";
/**
* @module @adminjs/sequelize
* @subcategory Adapters
* @section modules
*
* @description
* ### A Sequelize database adapter for AdminJS.
*
* #### Installation
*
* To install the adapter run
*
* ```
* yarn add @adminjs/sequelize
* ```
*
* ### Usage
*
* In order to use it in your project register the adapter first:
*
* ```javascript
* const AdminJS = require('adminjs')
* const AdminJSSequelize = require('@adminjs/sequelize')
*
* AdminJS.registerAdapter(AdminJSSequelize)
* ```
*
* ### Passing an entire database
*
* Sequelize generates folder in your app called `./models` and there is an `index.js` file.
* You can require it and pass to {@link AdminJSOptions} like this:
*
* ```javascript
* const db = require('../models');
* const AdminJS = new AdminJS({
* databases: [db],
* //... other AdminJSOptions
* })
* //...
* ```
*
* ### Passing each resource
*
* Also you can pass a single resource and adjust it to your needs via {@link ResourceOptions}.
*
* So let say you have a model called `vendor` and there is a `vendor.js` file in your `./models`.
* Within this file there is
*
* ```javascript
* //...
* sequelize.define('vendor', //...
* //...
* ```
*
* In order to pass it directly, run this code:
*
* ```javascript
* const db = require('../models');
* const AdminJS = new AdminJS({
* databases: [db], // you can still load an entire database and adjust just one resource
* resources: [{
* resource: db.vendor,
* options: {
* //...
* }
* }]
* })
* //...
* ```
*
*
*/
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.Database = exports.Resource = void 0;
/**
* Implementation of {@link BaseDatabase} for Sequelize Adapter
*
* @memberof module:@adminjs/sequelize
* @type {typeof BaseDatabase}
* @static
*/
const database_1 = __importDefault(require("./src/database"));
/**
* Implementation of {@link BaseResource} for Sequelize Adapter
*
* @memberof module:@adminjs/sequelize
* @type {typeof BaseResource}
* @static
*/
const resource_1 = __importDefault(require("./src/resource"));
var resource_2 = require("./src/resource");
Object.defineProperty(exports, "Resource", { enumerable: true, get: function () { return __importDefault(resource_2).default; } });
var database_2 = require("./src/database");
Object.defineProperty(exports, "Database", { enumerable: true, get: function () { return __importDefault(database_2).default; } });
module.exports = { Database: database_1.default, Resource: resource_1.default };
exports.default = { Database: database_1.default, Resource: resource_1.default };
//# sourceMappingURL=index.js.map
Source