@webresto/graphql 1.3.0 → 1.3.1
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +25 -8
- package/src/resolvers/cart.d.ts +4 -2
- package/src/resolvers/cart.ts +9 -4
- package/test/bootstrap.ts +33 -0
- package/test/fixture/.tmp/localDiskDb/archive.db +1 -0
- package/test/fixture/.tmp/localDiskDb/dish.db +1 -0
- package/test/fixture/.tmp/localDiskDb/dish_images__image_dish.db +1 -0
- package/test/fixture/.tmp/localDiskDb/group.db +1 -0
- package/test/fixture/.tmp/localDiskDb/group_images__image_group.db +1 -0
- package/test/fixture/.tmp/localDiskDb/image.db +1 -0
- package/test/fixture/.tmp/localDiskDb/maintenance.db +1 -0
- package/test/fixture/.tmp/localDiskDb/order.db +1 -0
- package/test/fixture/.tmp/localDiskDb/orderdish.db +1 -0
- package/test/fixture/.tmp/localDiskDb/paymentdocument.db +1 -0
- package/test/fixture/.tmp/localDiskDb/paymentmethod.db +2 -0
- package/test/fixture/.tmp/localDiskDb/place.db +1 -0
- package/test/fixture/.tmp/localDiskDb/settings.db +2 -0
- package/test/fixture/.tmp/localDiskDb/street.db +1 -0
- package/test/{fixtures/v0.12-app → fixture}/api/controllers/.gitkeep +0 -0
- package/test/{fixtures/v0.12-app → fixture}/api/models/.gitkeep +0 -0
- package/test/{fixtures/v0.12-app → fixture}/api/services/.gitkeep +0 -0
- package/test/{fixtures/v0.12-app/app.js → fixture/app-export.js} +73 -73
- package/test/fixture/app.js +56 -0
- package/test/fixture/config/adminpanel.js +3 -0
- package/test/fixture/config/connections.js +9 -0
- package/test/fixture/config/env/development.js +10 -0
- package/test/{fixtures/v0.12-app → fixture}/config/env/production.js +16 -16
- package/test/fixture/config/globals.js +16 -0
- package/test/{fixtures/v0.12-app → fixture}/config/hookTimeout.js +8 -8
- package/test/{fixtures/v0.12-app → fixture}/config/http.js +93 -93
- package/test/{fixtures/v0.12-app → fixture}/config/i18n.js +57 -57
- package/test/{fixtures/v0.12-app → fixture}/config/log.js +29 -29
- package/test/fixture/config/models.js +9 -0
- package/test/fixture/config/modulemanager.js +22 -0
- package/test/{fixtures/v0.12-app → fixture}/config/policies.js +51 -51
- package/test/{fixtures/v0.12-app → fixture}/config/routes.js +49 -49
- package/test/{fixtures/v0.12-app → fixture}/config/session.js +100 -100
- package/test/{fixtures/v0.12-app → fixture}/config/sockets.js +141 -141
- package/test/{fixtures/v0.12-app → fixture}/config/views.js +94 -94
- package/test/fixture/package-lock.json +9805 -0
- package/test/fixture/package.json +30 -0
- package/test/{fixtures/v0.12-app → fixture}/views/403.ejs +68 -68
- package/test/{fixtures/v0.12-app → fixture}/views/404.ejs +68 -68
- package/test/{fixtures/v0.12-app → fixture}/views/500.ejs +73 -73
- package/test/{fixtures/v0.12-app → fixture}/views/homepage.ejs +74 -74
- package/test/{fixtures/v0.12-app → fixture}/views/layout.ejs +91 -91
- package/test/unit/first.test.js +6 -8
- package/test/unit/first.test.ts +11 -0
- package/test/unit/sails_not_crash.test.ts +3 -0
- package/test.zip +0 -0
- package/test/fixtures/v0.12-app/.gitignore +0 -11
- package/test/fixtures/v0.12-app/.sailsrc +0 -11
- package/test/fixtures/v0.12-app/api/models/TestModel.js +0 -22
- package/test/fixtures/v0.12-app/api/responses/badRequest.js +0 -76
- package/test/fixtures/v0.12-app/api/responses/created.js +0 -60
- package/test/fixtures/v0.12-app/api/responses/forbidden.js +0 -89
- package/test/fixtures/v0.12-app/api/responses/notFound.js +0 -94
- package/test/fixtures/v0.12-app/api/responses/ok.js +0 -60
- package/test/fixtures/v0.12-app/api/responses/serverError.js +0 -89
- package/test/fixtures/v0.12-app/config/bootstrap.js +0 -6
- package/test/fixtures/v0.12-app/config/connections.js +0 -5
- package/test/fixtures/v0.12-app/config/cors.js +0 -78
- package/test/fixtures/v0.12-app/config/csrf.js +0 -64
- package/test/fixtures/v0.12-app/config/env/development.js +0 -10
- package/test/fixtures/v0.12-app/config/globals.js +0 -63
- package/test/fixtures/v0.12-app/config/models.js +0 -3
- package/test/fixtures/v0.12-app/config/restoapi.js +0 -3
- package/test/fixtures/v0.12-app/config/restocore.js +0 -39
- package/test/fixtures/v0.12-app/config/stateflow.js +0 -4
- package/test/fixtures/v0.12-app/package.json +0 -34
@@ -1,74 +1,74 @@
|
|
1
|
-
<!-- Default home page -->
|
2
|
-
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,600' rel='stylesheet' type='text/css'>
|
3
|
-
<style>
|
4
|
-
/* Styles included inline since you'll probably be deleting this page anyway */
|
5
|
-
html,body{text-align:left;font-size:1em}html,body,img,form,textarea,input,fieldset,div,p,div,ul,li,ol,dl,dt,dd,h1,h2,h3,h4,h5,h6,pre,code{margin:0;padding:0}ul,li{list-style:none}img{display:block}a img{border:0}a{text-decoration:none;font-weight:normal;font-family:inherit}*:active,*:focus{outline:0;-moz-outline-style:none}h1,h2,h3,h4,h5,h6{font-weight:normal}div.clear{clear:both}.clearfix:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden}body{font-family:"Open Sans",Arial,sans-serif;font-weight:300;}.top-bar {width: 100%; background-color: #e4f0f1; padding: 15px 0;}.top-bar .container img {float: left;}.top-bar .container ul {float: right; padding-top: 25px;}.top-bar .container li {float: left; width: 125px; text-align: center; font-size: 15px; color:#000; font-weight: 600;}.top-bar .container a li:hover {color: #118798; -webkit-transition:color 200ms; -moz-transition:color 200ms; -o-transition:color 200ms;transition:color 200ms;}.container{width: 80%; max-width: 1200px; margin: auto;}div.header {-webkit-transition: 6s; -moz-transition: 6s; -o-transition: 6s;transition: 6s; background: rgba(4, 36, 41, 0.89) url(http://sailsjs.org/images/img_sailsShadow.png) no-repeat 42% bottom; padding: 100px 0 65px;}.header h1#main-title{color: #fff; font-weight: 300; font-size: 2.5em;}.header h3{color: #b1eef7; font-style: italic; font-weight: 300;}.header h3 code{font-style: normal!important; background-color: rgba(255,255,255,0.5); font-weight: 300; color:#0e6471; margin: 0px 5px;}div.main.container{padding: 50px 0;}h1 {color: #118798; font-weight: 300;}code {font-size: inherit; font-family: 'Consolas', 'Monaco', monospace; padding:4px 5px 1px; background-color: #f3f5f7}a{color: #118798; font-weight: 300; text-decoration: underline;}a:hover {color: #0e6471; -webkit-transition:color 200ms; -moz-transition:color 200ms; -o-transition:color 200ms;transition:color 200ms;}p{line-height: 1.5em;}blockquote{background-color: #e4f0f1; padding: 25px; line-height: 1.5em; margin: 15px 0;}blockquote span{font-weight: 600; padding-right: 5px;}ul.getting-started{padding: 25px 75px 25px 0; width: 70%; float: left; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;}ul.getting-started li{padding: 25px 0;}ul.getting-started li h3 {padding-bottom: 10px; font-size: 25px; font-weight: 300;}.sprite{background:url(http://sailsjs.org/images/newapp.sprite.png) no-repeat; position: absolute; left: 0; top:0;}.getting-started .sprite{margin-left:10px;padding-left:60px;height:42px;width:0; float: left;}.getting-started .one{background-position:0 0}.getting-started .two{background-position:0 -42px}.getting-started .three{background-position:0 -83px}div.step {position: relative; padding-left: 70px; opacity: 0.9;}div.step:hover{ opacity: 1;}div.links {float: left; width: 30%; max-width: 325px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; background-color: #f3f5f7; border: 1px solid #ebebeb; padding: 25px 45px 35px;}div.links h3 {color: #727272; text-align: center; font-size: 28px; font-weight: 300;}div.links h4 {color: #727272; font-size: 17px; font-weight: 600; padding: 15px 0 10px;}div.links .link-list a {text-decoration: none; font-weight: 400;}div.links .link-list a li {padding: 0px 0px 5px 10px;}div.default-page{min-width: 1200px;}.pocket{display:none;}
|
6
|
-
</style>
|
7
|
-
<script type="text/javascript">
|
8
|
-
setTimeout(function sunrise () {
|
9
|
-
document.getElementsByClassName('header')[0].style.backgroundColor = '#118798';
|
10
|
-
}, 0);
|
11
|
-
</script>
|
12
|
-
|
13
|
-
<div class="default-page">
|
14
|
-
<div class="header">
|
15
|
-
<h1 id="main-title" class="container"><%= __('A brand new app.') %></h1>
|
16
|
-
<h3 class="container">You're looking at: <code><%= view.pathFromApp + '.' +view.ext %></code></h3>
|
17
|
-
</div>
|
18
|
-
<div class="main container clearfix">
|
19
|
-
<!-- <h1>Getting started</h1>
|
20
|
-
<p>Don't worry, we've got your back.</p> -->
|
21
|
-
<ul class="getting-started">
|
22
|
-
<li class="clearfix">
|
23
|
-
<div class="step">
|
24
|
-
<div class="sprite one"></div>
|
25
|
-
<h3>Generate a REST API.</h3>
|
26
|
-
<p>
|
27
|
-
Run <code>sails generate api user</code>. This will create two files: a <a href="http://sailsjs.org/#!/documentation/concepts/ORM/Models.html">model</a> <code class="pocket">api/models/User.js</code> and a <a href="http://sailsjs.org/#!/documentation/concepts/Controllers">controller</a><code class="pocket">api/controllers/UserController.js</code>.
|
28
|
-
</p>
|
29
|
-
</div>
|
30
|
-
</li>
|
31
|
-
<li class="clearfix">
|
32
|
-
<div class="step">
|
33
|
-
<div class="sprite two"></div>
|
34
|
-
<h3>
|
35
|
-
Lift your app.
|
36
|
-
</h3>
|
37
|
-
<p>
|
38
|
-
Run <code>sails lift</code> to start up your app server. If you visit <a target="_blank" href="http://localhost:<%= sails.config.port || 1337%>/user"><code>http://localhost:<%= sails.config.port || 1337%>/user</code></a> in your browser, you'll see a <a href="http://sailsjs.org/#!/documentation/reference/blueprint-api">WebSocket-compatible</a> user API.
|
39
|
-
</p>
|
40
|
-
</div>
|
41
|
-
</li>
|
42
|
-
<li class="clearfix">
|
43
|
-
<div class="step">
|
44
|
-
<div class="sprite three"></div>
|
45
|
-
<h3>
|
46
|
-
Dive in.
|
47
|
-
</h3>
|
48
|
-
<p>Blueprints are just the beginning. You'll probably also want to learn how to customize your app's <a href="http://sailsjs.org/#!/documentation/concepts/Routes">routes</a>, set up <a href="http://sailsjs.org/#!/documentation/concepts/Policies">security policies</a>, configure your <a href="http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.connections.html">data sources</a>, and build custom <a target="_blank" href="http://sailsjs.org/#!/documentation/concepts/Controllers?q=actions">controller actions</a>. For more help getting started, check out the links on this page.</p>
|
49
|
-
|
50
|
-
</div>
|
51
|
-
</li>
|
52
|
-
</ul>
|
53
|
-
<div class="links">
|
54
|
-
<!-- <h3>Links</h3> -->
|
55
|
-
<ul class="link-list">
|
56
|
-
|
57
|
-
<h4>Docs</h4>
|
58
|
-
<a target="_blank" href="http://sailsjs.org/#!/documentation/anatomy/myApp"><li>App Structure</li></a>
|
59
|
-
<a target="_blank" href="http://sailsjs.org/#!/documentation/reference"><li>Reference</li></a>
|
60
|
-
<a target="_blank" href="http://sailsjs.org/#!/documentation/concepts/extending-sails/Adapters/adapterList.html"><li>Supported Databases</li></a>
|
61
|
-
|
62
|
-
<h4>Tutorials</h4>
|
63
|
-
<a target="_blank" href="https://github.com/sails101"><li>Sails 101</li></a>
|
64
|
-
|
65
|
-
<h4>Community</h4>
|
66
|
-
<a target="_blank" href="http://stackoverflow.com/search?q=sails.js"><li>StackOverFlow</li></a>
|
67
|
-
<a target="_blank" href="https://github.com/balderdashy/sails"><li>GitHub</li></a>
|
68
|
-
<a target="_blank" href="https://groups.google.com/forum/#!forum/sailsjs"><li>Google Group</li></a>
|
69
|
-
<a target="_blank" href="http://webchat.freenode.net/"><li>IRC (#sailsjs on freenode)</li></a>
|
70
|
-
|
71
|
-
</ul>
|
72
|
-
</div>
|
73
|
-
</div>
|
74
|
-
</div>
|
1
|
+
<!-- Default home page -->
|
2
|
+
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400italic,600' rel='stylesheet' type='text/css'>
|
3
|
+
<style>
|
4
|
+
/* Styles included inline since you'll probably be deleting this page anyway */
|
5
|
+
html,body{text-align:left;font-size:1em}html,body,img,form,textarea,input,fieldset,div,p,div,ul,li,ol,dl,dt,dd,h1,h2,h3,h4,h5,h6,pre,code{margin:0;padding:0}ul,li{list-style:none}img{display:block}a img{border:0}a{text-decoration:none;font-weight:normal;font-family:inherit}*:active,*:focus{outline:0;-moz-outline-style:none}h1,h2,h3,h4,h5,h6{font-weight:normal}div.clear{clear:both}.clearfix:after{clear:both;content:".";display:block;font-size:0;height:0;line-height:0;visibility:hidden}body{font-family:"Open Sans",Arial,sans-serif;font-weight:300;}.top-bar {width: 100%; background-color: #e4f0f1; padding: 15px 0;}.top-bar .container img {float: left;}.top-bar .container ul {float: right; padding-top: 25px;}.top-bar .container li {float: left; width: 125px; text-align: center; font-size: 15px; color:#000; font-weight: 600;}.top-bar .container a li:hover {color: #118798; -webkit-transition:color 200ms; -moz-transition:color 200ms; -o-transition:color 200ms;transition:color 200ms;}.container{width: 80%; max-width: 1200px; margin: auto;}div.header {-webkit-transition: 6s; -moz-transition: 6s; -o-transition: 6s;transition: 6s; background: rgba(4, 36, 41, 0.89) url(http://sailsjs.org/images/img_sailsShadow.png) no-repeat 42% bottom; padding: 100px 0 65px;}.header h1#main-title{color: #fff; font-weight: 300; font-size: 2.5em;}.header h3{color: #b1eef7; font-style: italic; font-weight: 300;}.header h3 code{font-style: normal!important; background-color: rgba(255,255,255,0.5); font-weight: 300; color:#0e6471; margin: 0px 5px;}div.main.container{padding: 50px 0;}h1 {color: #118798; font-weight: 300;}code {font-size: inherit; font-family: 'Consolas', 'Monaco', monospace; padding:4px 5px 1px; background-color: #f3f5f7}a{color: #118798; font-weight: 300; text-decoration: underline;}a:hover {color: #0e6471; -webkit-transition:color 200ms; -moz-transition:color 200ms; -o-transition:color 200ms;transition:color 200ms;}p{line-height: 1.5em;}blockquote{background-color: #e4f0f1; padding: 25px; line-height: 1.5em; margin: 15px 0;}blockquote span{font-weight: 600; padding-right: 5px;}ul.getting-started{padding: 25px 75px 25px 0; width: 70%; float: left; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box;}ul.getting-started li{padding: 25px 0;}ul.getting-started li h3 {padding-bottom: 10px; font-size: 25px; font-weight: 300;}.sprite{background:url(http://sailsjs.org/images/newapp.sprite.png) no-repeat; position: absolute; left: 0; top:0;}.getting-started .sprite{margin-left:10px;padding-left:60px;height:42px;width:0; float: left;}.getting-started .one{background-position:0 0}.getting-started .two{background-position:0 -42px}.getting-started .three{background-position:0 -83px}div.step {position: relative; padding-left: 70px; opacity: 0.9;}div.step:hover{ opacity: 1;}div.links {float: left; width: 30%; max-width: 325px; -moz-box-sizing: border-box; -webkit-box-sizing: border-box; box-sizing: border-box; background-color: #f3f5f7; border: 1px solid #ebebeb; padding: 25px 45px 35px;}div.links h3 {color: #727272; text-align: center; font-size: 28px; font-weight: 300;}div.links h4 {color: #727272; font-size: 17px; font-weight: 600; padding: 15px 0 10px;}div.links .link-list a {text-decoration: none; font-weight: 400;}div.links .link-list a li {padding: 0px 0px 5px 10px;}div.default-page{min-width: 1200px;}.pocket{display:none;}
|
6
|
+
</style>
|
7
|
+
<script type="text/javascript">
|
8
|
+
setTimeout(function sunrise () {
|
9
|
+
document.getElementsByClassName('header')[0].style.backgroundColor = '#118798';
|
10
|
+
}, 0);
|
11
|
+
</script>
|
12
|
+
|
13
|
+
<div class="default-page">
|
14
|
+
<div class="header">
|
15
|
+
<h1 id="main-title" class="container"><%= __('A brand new app.') %></h1>
|
16
|
+
<h3 class="container">You're looking at: <code><%= view.pathFromApp + '.' +view.ext %></code></h3>
|
17
|
+
</div>
|
18
|
+
<div class="main container clearfix">
|
19
|
+
<!-- <h1>Getting started</h1>
|
20
|
+
<p>Don't worry, we've got your back.</p> -->
|
21
|
+
<ul class="getting-started">
|
22
|
+
<li class="clearfix">
|
23
|
+
<div class="step">
|
24
|
+
<div class="sprite one"></div>
|
25
|
+
<h3>Generate a REST API.</h3>
|
26
|
+
<p>
|
27
|
+
Run <code>sails generate api user</code>. This will create two files: a <a href="http://sailsjs.org/#!/documentation/concepts/ORM/Models.html">model</a> <code class="pocket">api/models/User.js</code> and a <a href="http://sailsjs.org/#!/documentation/concepts/Controllers">controller</a><code class="pocket">api/controllers/UserController.js</code>.
|
28
|
+
</p>
|
29
|
+
</div>
|
30
|
+
</li>
|
31
|
+
<li class="clearfix">
|
32
|
+
<div class="step">
|
33
|
+
<div class="sprite two"></div>
|
34
|
+
<h3>
|
35
|
+
Lift your app.
|
36
|
+
</h3>
|
37
|
+
<p>
|
38
|
+
Run <code>sails lift</code> to start up your app server. If you visit <a target="_blank" href="http://localhost:<%= sails.config.port || 1337%>/user"><code>http://localhost:<%= sails.config.port || 1337%>/user</code></a> in your browser, you'll see a <a href="http://sailsjs.org/#!/documentation/reference/blueprint-api">WebSocket-compatible</a> user API.
|
39
|
+
</p>
|
40
|
+
</div>
|
41
|
+
</li>
|
42
|
+
<li class="clearfix">
|
43
|
+
<div class="step">
|
44
|
+
<div class="sprite three"></div>
|
45
|
+
<h3>
|
46
|
+
Dive in.
|
47
|
+
</h3>
|
48
|
+
<p>Blueprints are just the beginning. You'll probably also want to learn how to customize your app's <a href="http://sailsjs.org/#!/documentation/concepts/Routes">routes</a>, set up <a href="http://sailsjs.org/#!/documentation/concepts/Policies">security policies</a>, configure your <a href="http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.connections.html">data sources</a>, and build custom <a target="_blank" href="http://sailsjs.org/#!/documentation/concepts/Controllers?q=actions">controller actions</a>. For more help getting started, check out the links on this page.</p>
|
49
|
+
|
50
|
+
</div>
|
51
|
+
</li>
|
52
|
+
</ul>
|
53
|
+
<div class="links">
|
54
|
+
<!-- <h3>Links</h3> -->
|
55
|
+
<ul class="link-list">
|
56
|
+
|
57
|
+
<h4>Docs</h4>
|
58
|
+
<a target="_blank" href="http://sailsjs.org/#!/documentation/anatomy/myApp"><li>App Structure</li></a>
|
59
|
+
<a target="_blank" href="http://sailsjs.org/#!/documentation/reference"><li>Reference</li></a>
|
60
|
+
<a target="_blank" href="http://sailsjs.org/#!/documentation/concepts/extending-sails/Adapters/adapterList.html"><li>Supported Databases</li></a>
|
61
|
+
|
62
|
+
<h4>Tutorials</h4>
|
63
|
+
<a target="_blank" href="https://github.com/sails101"><li>Sails 101</li></a>
|
64
|
+
|
65
|
+
<h4>Community</h4>
|
66
|
+
<a target="_blank" href="http://stackoverflow.com/search?q=sails.js"><li>StackOverFlow</li></a>
|
67
|
+
<a target="_blank" href="https://github.com/balderdashy/sails"><li>GitHub</li></a>
|
68
|
+
<a target="_blank" href="https://groups.google.com/forum/#!forum/sailsjs"><li>Google Group</li></a>
|
69
|
+
<a target="_blank" href="http://webchat.freenode.net/"><li>IRC (#sailsjs on freenode)</li></a>
|
70
|
+
|
71
|
+
</ul>
|
72
|
+
</div>
|
73
|
+
</div>
|
74
|
+
</div>
|
@@ -1,91 +1,91 @@
|
|
1
|
-
<!DOCTYPE html>
|
2
|
-
<html>
|
3
|
-
<head>
|
4
|
-
<title><%=typeof title == 'undefined' ? 'New Sails App' : title%></title>
|
5
|
-
|
6
|
-
<!-- Viewport mobile tag for sensible mobile support -->
|
7
|
-
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
8
|
-
|
9
|
-
|
10
|
-
<!--
|
11
|
-
Stylesheets and Preprocessors
|
12
|
-
==============================
|
13
|
-
|
14
|
-
You can always bring in CSS files manually with `<link>` tags, or asynchronously
|
15
|
-
using a solution like AMD (RequireJS). Or, if you like, you can take advantage
|
16
|
-
of Sails' conventional asset pipeline (boilerplate Gruntfile).
|
17
|
-
|
18
|
-
By default, stylesheets from your `assets/styles` folder are included
|
19
|
-
here automatically (between STYLES and STYLES END). Both CSS (.css) and LESS (.less)
|
20
|
-
are supported. In production, your styles will be minified and concatenated into
|
21
|
-
a single file.
|
22
|
-
|
23
|
-
To customize any part of the built-in behavior, just edit `tasks/pipeline.js`.
|
24
|
-
For example, here are a few things you could do:
|
25
|
-
|
26
|
-
+ Change the order of your CSS files
|
27
|
-
+ Import stylesheets from other directories
|
28
|
-
+ Use a different or additional preprocessor, like SASS, SCSS or Stylus
|
29
|
-
-->
|
30
|
-
|
31
|
-
<!--STYLES-->
|
32
|
-
<!--STYLES END-->
|
33
|
-
</head>
|
34
|
-
|
35
|
-
<body>
|
36
|
-
<%- body %>
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
<!--
|
41
|
-
Client-side Templates
|
42
|
-
========================
|
43
|
-
|
44
|
-
HTML templates are important prerequisites of modern, rich client applications.
|
45
|
-
To work their magic, frameworks like Backbone, Angular, Ember, and Knockout require
|
46
|
-
that you load these templates client-side.
|
47
|
-
|
48
|
-
By default, your Gruntfile is configured to automatically load and precompile
|
49
|
-
client-side JST templates in your `assets/templates` folder, then
|
50
|
-
include them here automatically (between TEMPLATES and TEMPLATES END).
|
51
|
-
|
52
|
-
To customize this behavior to fit your needs, just edit `tasks/pipeline.js`.
|
53
|
-
For example, here are a few things you could do:
|
54
|
-
|
55
|
-
+ Import templates from other directories
|
56
|
-
+ Use a different template engine (handlebars, jade, dust, etc.)
|
57
|
-
+ Internationalize your client-side templates using a server-side
|
58
|
-
stringfile before they're served.
|
59
|
-
-->
|
60
|
-
|
61
|
-
<!--TEMPLATES-->
|
62
|
-
<!--TEMPLATES END-->
|
63
|
-
|
64
|
-
|
65
|
-
<!--
|
66
|
-
|
67
|
-
Client-side Javascript
|
68
|
-
========================
|
69
|
-
|
70
|
-
You can always bring in JS files manually with `script` tags, or asynchronously
|
71
|
-
on the client using a solution like AMD (RequireJS). Or, if you like, you can
|
72
|
-
take advantage of Sails' conventional asset pipeline (boilerplate Gruntfile).
|
73
|
-
|
74
|
-
By default, files in your `assets/js` folder are included here
|
75
|
-
automatically (between SCRIPTS and SCRIPTS END). Both JavaScript (.js) and
|
76
|
-
CoffeeScript (.coffee) are supported. In production, your scripts will be minified
|
77
|
-
and concatenated into a single file.
|
78
|
-
|
79
|
-
To customize any part of the built-in behavior, just edit `tasks/pipeline.js`.
|
80
|
-
For example, here are a few things you could do:
|
81
|
-
|
82
|
-
+ Change the order of your scripts
|
83
|
-
+ Import scripts from other directories
|
84
|
-
+ Use a different preprocessor, like TypeScript
|
85
|
-
|
86
|
-
-->
|
87
|
-
|
88
|
-
<!--SCRIPTS-->
|
89
|
-
<!--SCRIPTS END-->
|
90
|
-
</body>
|
91
|
-
</html>
|
1
|
+
<!DOCTYPE html>
|
2
|
+
<html>
|
3
|
+
<head>
|
4
|
+
<title><%=typeof title == 'undefined' ? 'New Sails App' : title%></title>
|
5
|
+
|
6
|
+
<!-- Viewport mobile tag for sensible mobile support -->
|
7
|
+
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
|
8
|
+
|
9
|
+
|
10
|
+
<!--
|
11
|
+
Stylesheets and Preprocessors
|
12
|
+
==============================
|
13
|
+
|
14
|
+
You can always bring in CSS files manually with `<link>` tags, or asynchronously
|
15
|
+
using a solution like AMD (RequireJS). Or, if you like, you can take advantage
|
16
|
+
of Sails' conventional asset pipeline (boilerplate Gruntfile).
|
17
|
+
|
18
|
+
By default, stylesheets from your `assets/styles` folder are included
|
19
|
+
here automatically (between STYLES and STYLES END). Both CSS (.css) and LESS (.less)
|
20
|
+
are supported. In production, your styles will be minified and concatenated into
|
21
|
+
a single file.
|
22
|
+
|
23
|
+
To customize any part of the built-in behavior, just edit `tasks/pipeline.js`.
|
24
|
+
For example, here are a few things you could do:
|
25
|
+
|
26
|
+
+ Change the order of your CSS files
|
27
|
+
+ Import stylesheets from other directories
|
28
|
+
+ Use a different or additional preprocessor, like SASS, SCSS or Stylus
|
29
|
+
-->
|
30
|
+
|
31
|
+
<!--STYLES-->
|
32
|
+
<!--STYLES END-->
|
33
|
+
</head>
|
34
|
+
|
35
|
+
<body>
|
36
|
+
<%- body %>
|
37
|
+
|
38
|
+
|
39
|
+
|
40
|
+
<!--
|
41
|
+
Client-side Templates
|
42
|
+
========================
|
43
|
+
|
44
|
+
HTML templates are important prerequisites of modern, rich client applications.
|
45
|
+
To work their magic, frameworks like Backbone, Angular, Ember, and Knockout require
|
46
|
+
that you load these templates client-side.
|
47
|
+
|
48
|
+
By default, your Gruntfile is configured to automatically load and precompile
|
49
|
+
client-side JST templates in your `assets/templates` folder, then
|
50
|
+
include them here automatically (between TEMPLATES and TEMPLATES END).
|
51
|
+
|
52
|
+
To customize this behavior to fit your needs, just edit `tasks/pipeline.js`.
|
53
|
+
For example, here are a few things you could do:
|
54
|
+
|
55
|
+
+ Import templates from other directories
|
56
|
+
+ Use a different template engine (handlebars, jade, dust, etc.)
|
57
|
+
+ Internationalize your client-side templates using a server-side
|
58
|
+
stringfile before they're served.
|
59
|
+
-->
|
60
|
+
|
61
|
+
<!--TEMPLATES-->
|
62
|
+
<!--TEMPLATES END-->
|
63
|
+
|
64
|
+
|
65
|
+
<!--
|
66
|
+
|
67
|
+
Client-side Javascript
|
68
|
+
========================
|
69
|
+
|
70
|
+
You can always bring in JS files manually with `script` tags, or asynchronously
|
71
|
+
on the client using a solution like AMD (RequireJS). Or, if you like, you can
|
72
|
+
take advantage of Sails' conventional asset pipeline (boilerplate Gruntfile).
|
73
|
+
|
74
|
+
By default, files in your `assets/js` folder are included here
|
75
|
+
automatically (between SCRIPTS and SCRIPTS END). Both JavaScript (.js) and
|
76
|
+
CoffeeScript (.coffee) are supported. In production, your scripts will be minified
|
77
|
+
and concatenated into a single file.
|
78
|
+
|
79
|
+
To customize any part of the built-in behavior, just edit `tasks/pipeline.js`.
|
80
|
+
For example, here are a few things you could do:
|
81
|
+
|
82
|
+
+ Change the order of your scripts
|
83
|
+
+ Import scripts from other directories
|
84
|
+
+ Use a different preprocessor, like TypeScript
|
85
|
+
|
86
|
+
-->
|
87
|
+
|
88
|
+
<!--SCRIPTS-->
|
89
|
+
<!--SCRIPTS END-->
|
90
|
+
</body>
|
91
|
+
</html>
|
package/test/unit/first.test.js
CHANGED
@@ -1,11 +1,9 @@
|
|
1
1
|
const expect = require("chai").expect;
|
2
|
-
|
3
2
|
describe('GraphQl', function () {
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
});
|
3
|
+
it('schema exist', async () => {
|
4
|
+
// const data = await TestModel.find({});
|
5
|
+
// console.log(data);
|
6
|
+
const graphql = require('@webresto/graphql/src/graphql').default;
|
7
|
+
expect(graphql.getServer().schema._typeMap.Dish != undefined);
|
8
|
+
});
|
11
9
|
});
|
@@ -0,0 +1,11 @@
|
|
1
|
+
const expect = require("chai").expect;
|
2
|
+
|
3
|
+
describe('GraphQl', function () {
|
4
|
+
it('schema exist', async () => {
|
5
|
+
// const data = await TestModel.find({});
|
6
|
+
// console.log(data);
|
7
|
+
|
8
|
+
const graphql = require('@webresto/graphql/src/graphql').default;
|
9
|
+
expect(graphql.getServer().schema._typeMap.Dish != undefined);
|
10
|
+
});
|
11
|
+
});
|
package/test.zip
ADDED
Binary file
|
@@ -1,22 +0,0 @@
|
|
1
|
-
|
2
|
-
module.exports = {
|
3
|
-
attributes: {
|
4
|
-
|
5
|
-
order_number : { type: 'string' },
|
6
|
-
|
7
|
-
order_id : { type: 'string' },
|
8
|
-
|
9
|
-
order_id: { type: 'string' },
|
10
|
-
|
11
|
-
phone : { type: 'string' },
|
12
|
-
|
13
|
-
notifyMethod : {
|
14
|
-
type: 'string'
|
15
|
-
},
|
16
|
-
|
17
|
-
delivered : {
|
18
|
-
type: 'json',
|
19
|
-
defaultsTo: {new: false}
|
20
|
-
},
|
21
|
-
},
|
22
|
-
}
|
@@ -1,76 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* 400 (Bad Request) Handler
|
3
|
-
*
|
4
|
-
* Usage:
|
5
|
-
* return res.badRequest();
|
6
|
-
* return res.badRequest(data);
|
7
|
-
* return res.badRequest(data, 'some/specific/badRequest/view');
|
8
|
-
*
|
9
|
-
* e.g.:
|
10
|
-
* ```
|
11
|
-
* return res.badRequest(
|
12
|
-
* 'Please choose a valid `password` (6-12 characters)',
|
13
|
-
* 'trial/signup'
|
14
|
-
* );
|
15
|
-
* ```
|
16
|
-
*/
|
17
|
-
|
18
|
-
module.exports = function badRequest(data, options) {
|
19
|
-
|
20
|
-
// Get access to `req`, `res`, & `sails`
|
21
|
-
var req = this.req;
|
22
|
-
var res = this.res;
|
23
|
-
var sails = req._sails;
|
24
|
-
|
25
|
-
// Set status code
|
26
|
-
res.status(400);
|
27
|
-
|
28
|
-
// Log error to console
|
29
|
-
if (data !== undefined) {
|
30
|
-
sails.log.verbose('Sending 400 ("Bad Request") response: \n',data);
|
31
|
-
}
|
32
|
-
else sails.log.verbose('Sending 400 ("Bad Request") response');
|
33
|
-
|
34
|
-
// Only include errors in response if application environment
|
35
|
-
// is not set to 'production'. In production, we shouldn't
|
36
|
-
// send back any identifying information about errors.
|
37
|
-
if (sails.config.environment === 'production' && sails.config.keepResponseErrors !== true) {
|
38
|
-
data = undefined;
|
39
|
-
}
|
40
|
-
|
41
|
-
// If the user-agent wants JSON, always respond with JSON
|
42
|
-
// If views are disabled, revert to json
|
43
|
-
if (req.wantsJSON || sails.config.hooks.views === false) {
|
44
|
-
return res.jsonx(data);
|
45
|
-
}
|
46
|
-
|
47
|
-
// If second argument is a string, we take that to mean it refers to a view.
|
48
|
-
// If it was omitted, use an empty object (`{}`)
|
49
|
-
options = (typeof options === 'string') ? { view: options } : options || {};
|
50
|
-
|
51
|
-
// Attempt to prettify data for views, if it's a non-error object
|
52
|
-
var viewData = data;
|
53
|
-
if (!(viewData instanceof Error) && 'object' == typeof viewData) {
|
54
|
-
try {
|
55
|
-
viewData = require('util').inspect(data, {depth: null});
|
56
|
-
}
|
57
|
-
catch(e) {
|
58
|
-
viewData = undefined;
|
59
|
-
}
|
60
|
-
}
|
61
|
-
|
62
|
-
// If a view was provided in options, serve it.
|
63
|
-
// Otherwise try to guess an appropriate view, or if that doesn't
|
64
|
-
// work, just send JSON.
|
65
|
-
if (options.view) {
|
66
|
-
return res.view(options.view, { data: viewData, title: 'Bad Request' });
|
67
|
-
}
|
68
|
-
|
69
|
-
// If no second argument provided, try to serve the implied view,
|
70
|
-
// but fall back to sending JSON(P) if no view can be inferred.
|
71
|
-
else return res.guessView({ data: viewData, title: 'Bad Request' }, function couldNotGuessView () {
|
72
|
-
return res.jsonx(data);
|
73
|
-
});
|
74
|
-
|
75
|
-
};
|
76
|
-
|
@@ -1,60 +0,0 @@
|
|
1
|
-
/**
|
2
|
-
* 201 (CREATED) Response
|
3
|
-
*
|
4
|
-
* Usage:
|
5
|
-
* return res.created();
|
6
|
-
* return res.created(data);
|
7
|
-
* return res.created(data, 'auth/login');
|
8
|
-
*
|
9
|
-
* @param {Object} data
|
10
|
-
* @param {String|Object} options
|
11
|
-
* - pass string to render specified view
|
12
|
-
*/
|
13
|
-
|
14
|
-
module.exports = function created (data, options) {
|
15
|
-
|
16
|
-
// Get access to `req`, `res`, & `sails`
|
17
|
-
var req = this.req;
|
18
|
-
var res = this.res;
|
19
|
-
var sails = req._sails;
|
20
|
-
|
21
|
-
sails.log.silly('res.created() :: Sending 201 ("CREATED") response');
|
22
|
-
|
23
|
-
// Set status code
|
24
|
-
res.status(201);
|
25
|
-
|
26
|
-
// If appropriate, serve data as JSON(P)
|
27
|
-
// If views are disabled, revert to json
|
28
|
-
if (req.wantsJSON || sails.config.hooks.views === false) {
|
29
|
-
return res.jsonx(data);
|
30
|
-
}
|
31
|
-
|
32
|
-
// If second argument is a string, we take that to mean it refers to a view.
|
33
|
-
// If it was omitted, use an empty object (`{}`)
|
34
|
-
options = (typeof options === 'string') ? { view: options } : options || {};
|
35
|
-
|
36
|
-
// Attempt to prettify data for views, if it's a non-error object
|
37
|
-
var viewData = data;
|
38
|
-
if (!(viewData instanceof Error) && 'object' == typeof viewData) {
|
39
|
-
try {
|
40
|
-
viewData = require('util').inspect(data, {depth: null});
|
41
|
-
}
|
42
|
-
catch(e) {
|
43
|
-
viewData = undefined;
|
44
|
-
}
|
45
|
-
}
|
46
|
-
|
47
|
-
// If a view was provided in options, serve it.
|
48
|
-
// Otherwise try to guess an appropriate view, or if that doesn't
|
49
|
-
// work, just send JSON.
|
50
|
-
if (options.view) {
|
51
|
-
return res.view(options.view, { data: viewData, title: 'Created' });
|
52
|
-
}
|
53
|
-
|
54
|
-
// If no second argument provided, try to serve the implied view,
|
55
|
-
// but fall back to sending JSON(P) if no view can be inferred.
|
56
|
-
else return res.guessView({ data: viewData, title: 'Created' }, function couldNotGuessView () {
|
57
|
-
return res.jsonx(data);
|
58
|
-
});
|
59
|
-
|
60
|
-
};
|