master
km0 3 years ago
commit faf4107eee

@ -0,0 +1,16 @@
root = true
[*]
indent_style = space
indent_size = 2
end_of_line = lf
charset = utf-8
trim_trailing_whitespace = true
insert_final_newline = true
[{package.json,*.yml}]
indent_style = space
indent_size = 2
[*.md]
trim_trailing_whitespace = false

@ -0,0 +1,2 @@
HOST=0.0.0.0
PORT=1337

@ -0,0 +1,3 @@
.cache
build
**/node_modules/**

@ -0,0 +1,27 @@
{
"parser": "babel-eslint",
"extends": "eslint:recommended",
"env": {
"commonjs": true,
"es6": true,
"node": true,
"browser": false
},
"parserOptions": {
"ecmaFeatures": {
"experimentalObjectRestSpread": true,
"jsx": false
},
"sourceType": "module"
},
"globals": {
"strapi": true
},
"rules": {
"indent": ["error", 2, { "SwitchCase": 1 }],
"linebreak-style": ["error", "unix"],
"no-console": 0,
"quotes": ["error", "single"],
"semi": ["error", "always"]
}
}

114
.gitignore vendored

@ -0,0 +1,114 @@
############################
# OS X
############################
.DS_Store
.AppleDouble
.LSOverride
Icon
.Spotlight-V100
.Trashes
._*
############################
# Linux
############################
*~
############################
# Windows
############################
Thumbs.db
ehthumbs.db
Desktop.ini
$RECYCLE.BIN/
*.cab
*.msi
*.msm
*.msp
############################
# Packages
############################
*.7z
*.csv
*.dat
*.dmg
*.gz
*.iso
*.jar
*.rar
*.tar
*.zip
*.com
*.class
*.dll
*.exe
*.o
*.seed
*.so
*.swo
*.swp
*.swn
*.swm
*.out
*.pid
############################
# Logs and databases
############################
.tmp
*.log
*.sql
*.sqlite
*.sqlite3
############################
# Misc.
############################
*#
ssl
.idea
nbproject
public/uploads/*
!public/uploads/.gitkeep
############################
# Node.js
############################
lib-cov
lcov.info
pids
logs
results
node_modules
.node_history
############################
# Tests
############################
testApp
coverage
############################
# Strapi
############################
.env
license.txt
exports
*.cache
build
.strapi-updater.json

@ -0,0 +1,3 @@
# Strapi application
A quick description of your strapi application

@ -0,0 +1,52 @@
{
"routes": [
{
"method": "GET",
"path": "/categories",
"handler": "category.find",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/categories/count",
"handler": "category.count",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/categories/:id",
"handler": "category.findOne",
"config": {
"policies": []
}
},
{
"method": "POST",
"path": "/categories",
"handler": "category.create",
"config": {
"policies": []
}
},
{
"method": "PUT",
"path": "/categories/:id",
"handler": "category.update",
"config": {
"policies": []
}
},
{
"method": "DELETE",
"path": "/categories/:id",
"handler": "category.delete",
"config": {
"policies": []
}
}
]
}

@ -0,0 +1,8 @@
'use strict';
/**
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/development/backend-customization.html#core-controllers)
* to customize this controller
*/
module.exports = {};

@ -0,0 +1,8 @@
'use strict';
/**
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/development/backend-customization.html#lifecycle-hooks)
* to customize this model
*/
module.exports = {};

@ -0,0 +1,20 @@
{
"kind": "collectionType",
"collectionName": "categories",
"info": {
"name": "category"
},
"options": {
"increments": true,
"timestamps": true,
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"name": {
"type": "string",
"required": true,
"unique": true
}
}
}

@ -0,0 +1,8 @@
'use strict';
/**
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/development/backend-customization.html#core-services)
* to customize this service
*/
module.exports = {};

@ -0,0 +1,52 @@
{
"routes": [
{
"method": "GET",
"path": "/functions",
"handler": "function.find",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/functions/count",
"handler": "function.count",
"config": {
"policies": []
}
},
{
"method": "GET",
"path": "/functions/:name",
"handler": "function.findOne",
"config": {
"policies": []
}
},
{
"method": "POST",
"path": "/functions",
"handler": "function.create",
"config": {
"policies": []
}
},
{
"method": "PUT",
"path": "/functions/:id",
"handler": "function.update",
"config": {
"policies": []
}
},
{
"method": "DELETE",
"path": "/functions/:id",
"handler": "function.delete",
"config": {
"policies": []
}
}
]
}

@ -0,0 +1,31 @@
"use strict";
let { PythonShell } = require("python-shell");
/**
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/development/backend-customization.html#core-controllers)
* to customize this controller
*/
module.exports = {
async findOne(ctx) {
const { name } = ctx.params;
const entity = await strapi.services.function.findOne({ name });
let script = () => {
return new Promise((resolve, reject) => {
PythonShell.run(
"./public" + entity.script.url,
null,
function (err, results) {
if (err) throw err;
resolve(results);
}
);
});
};
let output = await script();
return entity;
},
};

@ -0,0 +1,8 @@
'use strict';
/**
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/development/backend-customization.html#lifecycle-hooks)
* to customize this model
*/
module.exports = {};

@ -0,0 +1,49 @@
{
"kind": "collectionType",
"collectionName": "functions",
"info": {
"name": "function",
"description": ""
},
"options": {
"increments": true,
"timestamps": true,
"draftAndPublish": true
},
"pluginOptions": {},
"attributes": {
"name": {
"type": "string",
"unique": true,
"required": true
},
"script": {
"model": "file",
"via": "related",
"allowedTypes": [
"files",
"images",
"videos"
],
"plugin": "upload",
"required": true,
"pluginOptions": {}
},
"input": {
"type": "dynamiczone",
"components": [
"argument.input"
],
"required": true,
"min": 1
},
"output": {
"type": "dynamiczone",
"components": [
"argument.input"
],
"required": true,
"min": 1
}
}
}

@ -0,0 +1,8 @@
'use strict';
/**
* Read the documentation (https://strapi.io/documentation/developer-docs/latest/development/backend-customization.html#core-services)
* to customize this service
*/
module.exports = {};

@ -0,0 +1,17 @@
{
"collectionName": "components_argument_inputs",
"info": {
"name": "argument",
"icon": "sleigh",
"description": ""
},
"options": {},
"attributes": {
"name": {
"type": "string"
},
"category": {
"model": "category"
}
}
}

@ -0,0 +1,15 @@
module.exports = ({ env }) => ({
defaultConnection: 'default',
connections: {
default: {
connector: 'bookshelf',
settings: {
client: 'sqlite',
filename: env('DATABASE_FILENAME', '.tmp/data.db'),
},
options: {
useNullAsDefault: true,
},
},
},
});

@ -0,0 +1,13 @@
'use strict';
/**
* 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.
*
* See more details here: https://strapi.io/documentation/developer-docs/latest/setup-deployment-guides/configurations.html#bootstrap
*/
module.exports = () => {};

@ -0,0 +1,21 @@
'use strict';
/**
* Cron config that gives you an opportunity
* to run scheduled jobs.
*
* The cron format consists of:
* [SECOND (optional)] [MINUTE] [HOUR] [DAY OF MONTH] [MONTH OF YEAR] [DAY OF WEEK]
*
* See more details here: https://strapi.io/documentation/developer-docs/latest/setup-deployment-guides/configurations.html#cron-tasks
*/
module.exports = {
/**
* Simple example.
* Every monday at 1am.
*/
// '0 1 * * 1': () => {
//
// }
};

@ -0,0 +1,5 @@
'use strict';
module.exports = async (/* ctx */) => {
// return ctx.notFound('My custom message 404');
};

@ -0,0 +1,9 @@
module.exports = ({ env }) => ({
host: env('HOST', '0.0.0.0'),
port: env.int('PORT', 1337),
admin: {
auth: {
secret: env('ADMIN_JWT_SECRET', '46406f8e1e52dc3ae4c6ce7a7fc5e71d'),
},
},
});

@ -0,0 +1,3 @@
module.exports = {
jwtSecret: process.env.JWT_SECRET || '81b1b352-8856-4012-9188-51f15c022a85'
};

Binary file not shown.

After

Width:  |  Height:  |  Size: 3.6 KiB

13610
package-lock.json generated

File diff suppressed because it is too large Load Diff

@ -0,0 +1,39 @@
{
"name": "test-strapi",
"private": true,
"version": "0.1.0",
"description": "A Strapi application",
"scripts": {
"develop": "strapi develop",
"start": "strapi start",
"build": "strapi build",
"strapi": "strapi"
},
"devDependencies": {},
"dependencies": {
"knex": "0.21.18",
"python-shell": "^3.0.1",
"sqlite3": "5.0.0",
"strapi": "3.6.8",
"strapi-admin": "3.6.8",
"strapi-connector-bookshelf": "3.6.8",
"strapi-plugin-content-manager": "3.6.8",
"strapi-plugin-content-type-builder": "3.6.8",
"strapi-plugin-email": "3.6.8",
"strapi-plugin-i18n": "3.6.8",
"strapi-plugin-upload": "3.6.8",
"strapi-plugin-users-permissions": "3.6.8",
"strapi-utils": "3.6.8"
},
"author": {
"name": "A Strapi developer"
},
"strapi": {
"uuid": "accc26b6-d552-40f8-8354-d10c47ff0f70"
},
"engines": {
"node": ">=10.16.0 <=14.x.x",
"npm": "^6.0.0"
},
"license": "MIT"
}

@ -0,0 +1,3 @@
# To prevent search engines from seeing the site altogether, uncomment the next two lines:
# User-Agent: *
# Disallow: /
Loading…
Cancel
Save