diff --git a/config/admin.js b/config/admin.js new file mode 100644 index 0000000..060e5e6 --- /dev/null +++ b/config/admin.js @@ -0,0 +1,15 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = ({ env }) => ({ + auth: { + secret: env('ADMIN_JWT_SECRET'), + }, + apiToken: { + salt: env('API_TOKEN_SALT'), + }, + transfer: { + token: { + salt: env('TRANSFER_TOKEN_SALT'), + }, + }, +}); diff --git a/config/api.js b/config/api.js new file mode 100644 index 0000000..da02e0e --- /dev/null +++ b/config/api.js @@ -0,0 +1,9 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = { + rest: { + defaultLimit: 25, + maxLimit: 100, + withCount: true, + }, +}; diff --git a/config/database.js b/config/database.js new file mode 100644 index 0000000..b418aa8 --- /dev/null +++ b/config/database.js @@ -0,0 +1,81 @@ +"use strict"; +var __importDefault = (this && this.__importDefault) || function (mod) { + return (mod && mod.__esModule) ? mod : { "default": mod }; +}; +Object.defineProperty(exports, "__esModule", { value: true }); +const path_1 = __importDefault(require("path")); +exports.default = ({ env }) => { + const client = env('DATABASE_CLIENT', 'sqlite'); + const connections = { + mysql: { + connection: { + connectionString: env('DATABASE_URL'), + host: env('DATABASE_HOST', 'localhost'), + port: env.int('DATABASE_PORT', 3306), + database: env('DATABASE_NAME', 'strapi'), + user: env('DATABASE_USERNAME', 'strapi'), + password: env('DATABASE_PASSWORD', 'strapi'), + ssl: env.bool('DATABASE_SSL', false) && { + key: env('DATABASE_SSL_KEY', undefined), + cert: env('DATABASE_SSL_CERT', undefined), + ca: env('DATABASE_SSL_CA', undefined), + capath: env('DATABASE_SSL_CAPATH', undefined), + cipher: env('DATABASE_SSL_CIPHER', undefined), + rejectUnauthorized: env.bool('DATABASE_SSL_REJECT_UNAUTHORIZED', true), + }, + }, + pool: { min: env.int('DATABASE_POOL_MIN', 2), max: env.int('DATABASE_POOL_MAX', 10) }, + }, + mysql2: { + connection: { + host: env('DATABASE_HOST', 'localhost'), + port: env.int('DATABASE_PORT', 3306), + database: env('DATABASE_NAME', 'strapi'), + user: env('DATABASE_USERNAME', 'strapi'), + password: env('DATABASE_PASSWORD', 'strapi'), + ssl: env.bool('DATABASE_SSL', false) && { + key: env('DATABASE_SSL_KEY', undefined), + cert: env('DATABASE_SSL_CERT', undefined), + ca: env('DATABASE_SSL_CA', undefined), + capath: env('DATABASE_SSL_CAPATH', undefined), + cipher: env('DATABASE_SSL_CIPHER', undefined), + rejectUnauthorized: env.bool('DATABASE_SSL_REJECT_UNAUTHORIZED', true), + }, + }, + pool: { min: env.int('DATABASE_POOL_MIN', 2), max: env.int('DATABASE_POOL_MAX', 10) }, + }, + postgres: { + connection: { + connectionString: env('DATABASE_URL'), + host: env('DATABASE_HOST', 'localhost'), + port: env.int('DATABASE_PORT', 5432), + database: env('DATABASE_NAME', 'strapi'), + user: env('DATABASE_USERNAME', 'strapi'), + password: env('DATABASE_PASSWORD', 'strapi'), + ssl: env.bool('DATABASE_SSL', false) && { + key: env('DATABASE_SSL_KEY', undefined), + cert: env('DATABASE_SSL_CERT', undefined), + ca: env('DATABASE_SSL_CA', undefined), + capath: env('DATABASE_SSL_CAPATH', undefined), + cipher: env('DATABASE_SSL_CIPHER', undefined), + rejectUnauthorized: env.bool('DATABASE_SSL_REJECT_UNAUTHORIZED', true), + }, + schema: env('DATABASE_SCHEMA', 'public'), + }, + pool: { min: env.int('DATABASE_POOL_MIN', 2), max: env.int('DATABASE_POOL_MAX', 10) }, + }, + sqlite: { + connection: { + filename: path_1.default.join(__dirname, '..', '..', env('DATABASE_FILENAME', '.tmp/data.db')), + }, + useNullAsDefault: true, + }, + }; + return { + connection: { + client, + ...connections[client], + acquireConnectionTimeout: env.int('DATABASE_CONNECTION_TIMEOUT', 60000), + }, + }; +}; diff --git a/config/middlewares.js b/config/middlewares.js new file mode 100644 index 0000000..173af45 --- /dev/null +++ b/config/middlewares.js @@ -0,0 +1,14 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = [ + 'strapi::errors', + 'strapi::security', + 'strapi::cors', + 'strapi::poweredBy', + 'strapi::logger', + 'strapi::query', + 'strapi::body', + 'strapi::session', + 'strapi::favicon', + 'strapi::public', +]; diff --git a/config/server.js b/config/server.js new file mode 100644 index 0000000..a818bdb --- /dev/null +++ b/config/server.js @@ -0,0 +1,12 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = ({ env }) => ({ + host: env('HOST', '0.0.0.0'), + port: env.int('PORT', 1337), + app: { + keys: env.array('APP_KEYS'), + }, + webhooks: { + populateRelations: env.bool('WEBHOOKS_POPULATE_RELATIONS', false), + }, +}); diff --git a/src/api/notes-app/content-types/notes-app/schema.json b/src/api/notes-app/content-types/notes-app/schema.json new file mode 100644 index 0000000..2ce64c2 --- /dev/null +++ b/src/api/notes-app/content-types/notes-app/schema.json @@ -0,0 +1,22 @@ +{ + "kind": "collectionType", + "collectionName": "notes_apps", + "info": { + "singularName": "notes-app", + "pluralName": "notes-apps", + "displayName": "NotesApp", + "description": "" + }, + "options": { + "draftAndPublish": true + }, + "pluginOptions": {}, + "attributes": { + "note_title": { + "type": "string" + }, + "note_desc": { + "type": "string" + } + } +} diff --git a/src/api/notes-app/controllers/notes-app.js b/src/api/notes-app/controllers/notes-app.js new file mode 100644 index 0000000..d057d9c --- /dev/null +++ b/src/api/notes-app/controllers/notes-app.js @@ -0,0 +1,7 @@ +"use strict"; +/** + * notes-app controller + */ +Object.defineProperty(exports, "__esModule", { value: true }); +const strapi_1 = require("@strapi/strapi"); +exports.default = strapi_1.factories.createCoreController('api::notes-app.notes-app'); diff --git a/src/api/notes-app/routes/notes-app.js b/src/api/notes-app/routes/notes-app.js new file mode 100644 index 0000000..40a7732 --- /dev/null +++ b/src/api/notes-app/routes/notes-app.js @@ -0,0 +1,8 @@ +"use strict"; +/** + * notes-app router + */ +Object.defineProperty(exports, "__esModule", { value: true }); +const strapi_1 = require("@strapi/strapi"); +// +exports.default = strapi_1.factories.createCoreRouter('api::notes-app.notes-app'); diff --git a/src/api/notes-app/services/notes-app.js b/src/api/notes-app/services/notes-app.js new file mode 100644 index 0000000..cfcb6b0 --- /dev/null +++ b/src/api/notes-app/services/notes-app.js @@ -0,0 +1,7 @@ +"use strict"; +/** + * notes-app service + */ +Object.defineProperty(exports, "__esModule", { value: true }); +const strapi_1 = require("@strapi/strapi"); +exports.default = strapi_1.factories.createCoreService('api::notes-app.notes-app'); diff --git a/src/index.js b/src/index.js new file mode 100644 index 0000000..ca737f1 --- /dev/null +++ b/src/index.js @@ -0,0 +1,19 @@ +"use strict"; +Object.defineProperty(exports, "__esModule", { value: true }); +exports.default = { + /** + * An asynchronous register function that runs before + * your application is initialized. + * + * This gives you an opportunity to extend code. + */ + register( /*{ strapi }*/) { }, + /** + * An asynchronous bootstrap function that runs before + * your application gets started. + * + * This gives you an opportunity to set up your data model, + * run jobs, or perform some special logic. + */ + bootstrap( /*{ strapi }*/) { }, +}; diff --git a/tsconfig.tsbuildinfo b/tsconfig.tsbuildinfo new file mode 100644 index 0000000..7582c35 --- /dev/null +++ b/tsconfig.tsbuildinfo @@ -0,0 +1 @@ +{"version":"5.2.2"} \ No newline at end of file