-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored to have tests for [email protected]
- Loading branch information
Showing
33 changed files
with
12,488 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
#! /bin/bash | ||
TAG=$1 | ||
( | ||
cd package && | ||
npm login && | ||
npm publish | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#! /bin/bash | ||
|
||
( | ||
cd tests/strapi && | ||
yarn test | ||
) |
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
.cache | ||
build | ||
**/node_modules/** |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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"] | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# Strapi application | ||
|
||
A quick description of your strapi application |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"routes": [ | ||
{ | ||
"method": "GET", | ||
"path": "/email", | ||
"handler": "Email.send", | ||
"config": { | ||
} | ||
}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
module.exports = { | ||
send: async (ctx) => { | ||
try { | ||
await strapi.plugins['email'].services.email.send({ | ||
to: '[email protected]', | ||
from: '[email protected]', | ||
cc: '[email protected]', | ||
bcc: '[email protected]', | ||
replyTo: '[email protected]', | ||
subject: 'Use strapi email provider successfully', | ||
text: 'Hello world!', | ||
html: 'Hello world!', | ||
}); | ||
} catch (error) { | ||
strapi.log.error('Error when sending the email.', error); | ||
return ctx.BadRequest('Error when sending the email.'); | ||
} | ||
return 'Email sent.' | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"routes": [ | ||
{ | ||
"method": "GET", | ||
"path": "/ping", | ||
"handler": "System.ping", | ||
"config": { | ||
} | ||
}] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
module.exports = { | ||
ping: async (ctx) => { | ||
return 'pong'; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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, | ||
}, | ||
}, | ||
}, | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 = () => {}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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': () => { | ||
// | ||
// } | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
'use strict'; | ||
|
||
module.exports = async (/* ctx */) => { | ||
// return ctx.notFound('My custom message 404'); | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
module.exports = ({ env }) => ({ | ||
email: { | ||
provider: 'mailtrap', | ||
providerOptions: { | ||
user: env('MAILTRAP_USER', 'default_user'), | ||
password: env('MAILTRAP_PASSWORD', 'default_password') | ||
}, | ||
settings: { | ||
defaultFrom: env('MAILTRAP_DEFAULT_FROM', '[email protected]'), | ||
defaultReplyTo: env('MAILTRAP_DEFAULT_REPLY_TO', '[email protected]'), | ||
}, | ||
} | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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', '592a657c18b495888a7b5363dd3bb054'), | ||
}, | ||
}, | ||
}); |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
module.exports = { | ||
jwtSecret: process.env.JWT_SECRET || '6ed40859-3ca4-4c16-9442-8f9cc9649922' | ||
}; |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
{ | ||
"name": "my-project", | ||
"private": true, | ||
"version": "0.1.0", | ||
"description": "A Strapi application", | ||
"scripts": { | ||
"develop": "strapi develop", | ||
"start": "strapi start", | ||
"build": "strapi build", | ||
"strapi": "strapi", | ||
"test": "jest --forceExit --detectOpenHandles" | ||
}, | ||
"devDependencies": { | ||
"jest": "^26.6.3", | ||
"supertest": "^6.1.3" | ||
}, | ||
"dependencies": { | ||
"knex": "0.21.18", | ||
"sqlite3": "5.0.0", | ||
"strapi": "3.1", | ||
"strapi-admin": "3.1", | ||
"strapi-connector-bookshelf": "3.1", | ||
"strapi-plugin-content-manager": "3.1", | ||
"strapi-plugin-content-type-builder": "3.1", | ||
"strapi-plugin-email": "3.1", | ||
"strapi-plugin-upload": "3.1", | ||
"strapi-plugin-users-permissions": "3.1", | ||
"strapi-provider-email-mailtrap": "file:../../package", | ||
"strapi-utils": "3.1" | ||
}, | ||
"author": { | ||
"name": "A Strapi developer" | ||
}, | ||
"strapi": { | ||
"uuid": "fb03fad9-79ea-4233-b2cb-922d0d51f979" | ||
}, | ||
"engines": { | ||
"node": ">=10.16.0 <=14.x.x", | ||
"npm": "^6.0.0" | ||
}, | ||
"license": "MIT", | ||
"jest": { | ||
"testPathIgnorePatterns": [ | ||
"/node_modules/", | ||
".tmp", | ||
".cache" | ||
], | ||
"testEnvironment": "node" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
# To prevent search engines from seeing the site altogether, uncomment the next two lines: | ||
# User-Agent: * | ||
# Disallow: / |
Empty file.
Oops, something went wrong.