@webresto/graphql 1.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.editorconfig +10 -0
- package/index.d.ts +3 -0
- package/index.js +22 -0
- package/index.ts +14 -0
- package/lib/afterHook.d.ts +1 -0
- package/lib/afterHook.js +24 -0
- package/lib/afterHook.ts +26 -0
- package/lib/afterHook.ts___graphql-transport-ws +138 -0
- package/lib/afterHook.ts___graphql-ws +133 -0
- package/lib/defaults.js +12 -0
- package/lib/errorWrapper.d.ts +4 -0
- package/lib/errorWrapper.js +13 -0
- package/lib/errorWrapper.ts +12 -0
- package/lib/eventHelper.d.ts +21 -0
- package/lib/eventHelper.js +32 -0
- package/lib/eventHelper.ts +35 -0
- package/lib/graphqlHelper.d.ts +115 -0
- package/lib/graphqlHelper.js +596 -0
- package/lib/graphqlHelper.ts +692 -0
- package/lib/initialize.d.ts +1 -0
- package/lib/initialize.js +22 -0
- package/lib/initialize.ts +21 -0
- package/notes.md +1976 -0
- package/package.json +47 -0
- package/readme.md +258 -0
- package/restApi.http +11 -0
- package/src/additionalResolvers.d.ts +19 -0
- package/src/additionalResolvers.js +114 -0
- package/src/additionalResolvers.ts +111 -0
- package/src/graphql.d.ts +7 -0
- package/src/graphql.js +144 -0
- package/src/graphql.ts +160 -0
- package/src/resolvers/cart.d.ts +123 -0
- package/src/resolvers/cart.js +176 -0
- package/src/resolvers/cart.ts +256 -0
- package/src/resolvers/checkout.d.ts +30 -0
- package/src/resolvers/checkout.js +226 -0
- package/src/resolvers/checkout.ts +242 -0
- package/src/resolvers/dishAndModifier.d.ts +2 -0
- package/src/resolvers/dishAndModifier.js +35 -0
- package/src/resolvers/dishAndModifier.ts +38 -0
- package/src/resolvers/maintenance.d.ts +9 -0
- package/src/resolvers/maintenance.js +12 -0
- package/src/resolvers/maintenance.ts +11 -0
- package/src/resolvers/paymentMethod.d.ts +9 -0
- package/src/resolvers/paymentMethod.js +22 -0
- package/src/resolvers/paymentMethod.ts +20 -0
- package/src/resolvers/restrictions.d.ts +9 -0
- package/src/resolvers/restrictions.js +24 -0
- package/src/resolvers/restrictions.ts +22 -0
- package/src/resolvers/streets.d.ts +9 -0
- package/src/resolvers/streets.js +16 -0
- package/src/resolvers/streets.ts +13 -0
- package/src/resolvers/subscriptions.d.ts +33 -0
- package/src/resolvers/subscriptions.js +52 -0
- package/src/resolvers/subscriptions.ts +63 -0
- package/test/.eslintrc +8 -0
- package/test/_bootstrap.js +29 -0
- package/test/fixtures/v0.12-app/.gitignore +11 -0
- package/test/fixtures/v0.12-app/.sailsrc +11 -0
- package/test/fixtures/v0.12-app/api/controllers/.gitkeep +0 -0
- package/test/fixtures/v0.12-app/api/models/.gitkeep +0 -0
- package/test/fixtures/v0.12-app/api/models/TestModel.js +22 -0
- package/test/fixtures/v0.12-app/api/responses/badRequest.js +76 -0
- package/test/fixtures/v0.12-app/api/responses/created.js +60 -0
- package/test/fixtures/v0.12-app/api/responses/forbidden.js +89 -0
- package/test/fixtures/v0.12-app/api/responses/notFound.js +94 -0
- package/test/fixtures/v0.12-app/api/responses/ok.js +60 -0
- package/test/fixtures/v0.12-app/api/responses/serverError.js +89 -0
- package/test/fixtures/v0.12-app/api/services/.gitkeep +0 -0
- package/test/fixtures/v0.12-app/app.js +73 -0
- package/test/fixtures/v0.12-app/config/bootstrap.js +6 -0
- package/test/fixtures/v0.12-app/config/connections.js +5 -0
- package/test/fixtures/v0.12-app/config/cors.js +78 -0
- package/test/fixtures/v0.12-app/config/csrf.js +64 -0
- package/test/fixtures/v0.12-app/config/env/development.js +10 -0
- package/test/fixtures/v0.12-app/config/env/production.js +16 -0
- package/test/fixtures/v0.12-app/config/globals.js +63 -0
- package/test/fixtures/v0.12-app/config/hookTimeout.js +8 -0
- package/test/fixtures/v0.12-app/config/http.js +93 -0
- package/test/fixtures/v0.12-app/config/i18n.js +57 -0
- package/test/fixtures/v0.12-app/config/log.js +29 -0
- package/test/fixtures/v0.12-app/config/models.js +3 -0
- package/test/fixtures/v0.12-app/config/policies.js +51 -0
- package/test/fixtures/v0.12-app/config/restoapi.js +3 -0
- package/test/fixtures/v0.12-app/config/restocore.js +39 -0
- package/test/fixtures/v0.12-app/config/routes.js +49 -0
- package/test/fixtures/v0.12-app/config/session.js +100 -0
- package/test/fixtures/v0.12-app/config/sockets.js +141 -0
- package/test/fixtures/v0.12-app/config/stateflow.js +4 -0
- package/test/fixtures/v0.12-app/config/views.js +95 -0
- package/test/fixtures/v0.12-app/package.json +34 -0
- package/test/fixtures/v0.12-app/views/403.ejs +68 -0
- package/test/fixtures/v0.12-app/views/404.ejs +68 -0
- package/test/fixtures/v0.12-app/views/500.ejs +73 -0
- package/test/fixtures/v0.12-app/views/homepage.ejs +74 -0
- package/test/fixtures/v0.12-app/views/layout.ejs +91 -0
- package/test/mocha.opts +2 -0
- package/test/readme.md +0 -0
- package/test/todo +0 -0
- package/test/tslint.json +18 -0
- package/test/unit/first.test.js +11 -0
- package/test/unit/sails_not_crash.test.js +3 -0
- package/todo.md +1 -0
- package/tsconfig.json +10 -0
|
@@ -0,0 +1,78 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-Origin Resource Sharing (CORS) Settings
|
|
3
|
+
* (sails.config.cors)
|
|
4
|
+
*
|
|
5
|
+
* CORS is like a more modern version of JSONP-- it allows your server/API
|
|
6
|
+
* to successfully respond to requests from client-side JavaScript code
|
|
7
|
+
* running on some other domain (e.g. google.com)
|
|
8
|
+
* Unlike JSONP, it works with POST, PUT, and DELETE requests
|
|
9
|
+
*
|
|
10
|
+
* For more information on CORS, check out:
|
|
11
|
+
* http://en.wikipedia.org/wiki/Cross-origin_resource_sharing
|
|
12
|
+
*
|
|
13
|
+
* Note that any of these settings (besides 'allRoutes') can be changed on a per-route basis
|
|
14
|
+
* by adding a "cors" object to the route configuration:
|
|
15
|
+
*
|
|
16
|
+
* '/get foo': {
|
|
17
|
+
* controller: 'foo',
|
|
18
|
+
* action: 'bar',
|
|
19
|
+
* cors: {
|
|
20
|
+
* origin: 'http://foobar.com,https://owlhoot.com'
|
|
21
|
+
* }
|
|
22
|
+
* }
|
|
23
|
+
*
|
|
24
|
+
* For more information on this configuration file, see:
|
|
25
|
+
* http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.cors.html
|
|
26
|
+
*
|
|
27
|
+
*/
|
|
28
|
+
|
|
29
|
+
module.exports.cors = {
|
|
30
|
+
|
|
31
|
+
/***************************************************************************
|
|
32
|
+
* *
|
|
33
|
+
* Allow CORS on all routes by default? If not, you must enable CORS on a *
|
|
34
|
+
* per-route basis by either adding a "cors" configuration object to the *
|
|
35
|
+
* route config, or setting "cors:true" in the route config to use the *
|
|
36
|
+
* default settings below. *
|
|
37
|
+
* *
|
|
38
|
+
***************************************************************************/
|
|
39
|
+
|
|
40
|
+
// allRoutes: false,
|
|
41
|
+
|
|
42
|
+
/***************************************************************************
|
|
43
|
+
* *
|
|
44
|
+
* Which domains which are allowed CORS access? This can be a *
|
|
45
|
+
* comma-delimited list of hosts (beginning with http:// or https://) or *
|
|
46
|
+
* "*" to allow all domains CORS access. *
|
|
47
|
+
* *
|
|
48
|
+
***************************************************************************/
|
|
49
|
+
|
|
50
|
+
// origin: '*',
|
|
51
|
+
|
|
52
|
+
/***************************************************************************
|
|
53
|
+
* *
|
|
54
|
+
* Allow cookies to be shared for CORS requests? *
|
|
55
|
+
* *
|
|
56
|
+
***************************************************************************/
|
|
57
|
+
|
|
58
|
+
// credentials: true,
|
|
59
|
+
|
|
60
|
+
/***************************************************************************
|
|
61
|
+
* *
|
|
62
|
+
* Which methods should be allowed for CORS requests? This is only used in *
|
|
63
|
+
* response to preflight requests (see article linked above for more info) *
|
|
64
|
+
* *
|
|
65
|
+
***************************************************************************/
|
|
66
|
+
|
|
67
|
+
// methods: 'GET, POST, PUT, DELETE, OPTIONS, HEAD',
|
|
68
|
+
|
|
69
|
+
/***************************************************************************
|
|
70
|
+
* *
|
|
71
|
+
* Which headers should be allowed for CORS requests? This is only used in *
|
|
72
|
+
* response to preflight requests. *
|
|
73
|
+
* *
|
|
74
|
+
***************************************************************************/
|
|
75
|
+
|
|
76
|
+
// headers: 'content-type'
|
|
77
|
+
|
|
78
|
+
};
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Cross-Site Request Forgery Protection Settings
|
|
3
|
+
* (sails.config.csrf)
|
|
4
|
+
*
|
|
5
|
+
* CSRF tokens are like a tracking chip. While a session tells the server that a user
|
|
6
|
+
* "is who they say they are", a csrf token tells the server "you are where you say you are".
|
|
7
|
+
*
|
|
8
|
+
* When enabled, all non-GET requests to the Sails server must be accompanied by
|
|
9
|
+
* a special token, identified as the '_csrf' parameter.
|
|
10
|
+
*
|
|
11
|
+
* This option protects your Sails app against cross-site request forgery (or CSRF) attacks.
|
|
12
|
+
* A would-be attacker needs not only a user's session cookie, but also this timestamped,
|
|
13
|
+
* secret CSRF token, which is refreshed/granted when the user visits a URL on your app's domain.
|
|
14
|
+
*
|
|
15
|
+
* This allows us to have certainty that our users' requests haven't been hijacked,
|
|
16
|
+
* and that the requests they're making are intentional and legitimate.
|
|
17
|
+
*
|
|
18
|
+
* This token has a short-lived expiration timeline, and must be acquired by either:
|
|
19
|
+
*
|
|
20
|
+
* (a) For traditional view-driven web apps:
|
|
21
|
+
* Fetching it from one of your views, where it may be accessed as
|
|
22
|
+
* a local variable, e.g.:
|
|
23
|
+
* <form>
|
|
24
|
+
* <input type="hidden" name="_csrf" value="<%= _csrf %>" />
|
|
25
|
+
* </form>
|
|
26
|
+
*
|
|
27
|
+
* or (b) For AJAX/Socket-heavy and/or single-page apps:
|
|
28
|
+
* Sending a GET request to the `/csrfToken` route, where it will be returned
|
|
29
|
+
* as JSON, e.g.:
|
|
30
|
+
* { _csrf: 'ajg4JD(JGdajhLJALHDa' }
|
|
31
|
+
*
|
|
32
|
+
*
|
|
33
|
+
* Enabling this option requires managing the token in your front-end app.
|
|
34
|
+
* For traditional web apps, it's as easy as passing the data from a view into a form action.
|
|
35
|
+
* In AJAX/Socket-heavy apps, just send a GET request to the /csrfToken route to get a valid token.
|
|
36
|
+
*
|
|
37
|
+
* For more information on CSRF, check out:
|
|
38
|
+
* http://en.wikipedia.org/wiki/Cross-site_request_forgery
|
|
39
|
+
*
|
|
40
|
+
* For more information on this configuration file, including info on CSRF + CORS, see:
|
|
41
|
+
* http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.csrf.html
|
|
42
|
+
*
|
|
43
|
+
*/
|
|
44
|
+
|
|
45
|
+
/****************************************************************************
|
|
46
|
+
* *
|
|
47
|
+
* Enabled CSRF protection for your site? *
|
|
48
|
+
* *
|
|
49
|
+
****************************************************************************/
|
|
50
|
+
|
|
51
|
+
// module.exports.csrf = false;
|
|
52
|
+
|
|
53
|
+
/****************************************************************************
|
|
54
|
+
* *
|
|
55
|
+
* You may also specify more fine-grained settings for CSRF, including the *
|
|
56
|
+
* domains which are allowed to request the CSRF token via AJAX. These *
|
|
57
|
+
* settings override the general CORS settings in your config/cors.js file. *
|
|
58
|
+
* *
|
|
59
|
+
****************************************************************************/
|
|
60
|
+
|
|
61
|
+
// module.exports.csrf = {
|
|
62
|
+
// grantTokenViaAjax: true,
|
|
63
|
+
// origin: ''
|
|
64
|
+
// }
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
module.exports = {
|
|
2
|
+
models: {
|
|
3
|
+
connection: 'memory',
|
|
4
|
+
migrate: 'safe'
|
|
5
|
+
},
|
|
6
|
+
adminpanel:{
|
|
7
|
+
auth: true
|
|
8
|
+
},
|
|
9
|
+
log: {
|
|
10
|
+
level: 'info'
|
|
11
|
+
},
|
|
12
|
+
port: process.env.PORT === undefined ? 42772 : process.env.PORT,
|
|
13
|
+
log: {
|
|
14
|
+
level: "silent"
|
|
15
|
+
}
|
|
16
|
+
};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Global Variable Configuration
|
|
3
|
+
* (sails.config.globals)
|
|
4
|
+
*
|
|
5
|
+
* Configure which global variables which will be exposed
|
|
6
|
+
* automatically by Sails.
|
|
7
|
+
*
|
|
8
|
+
* For more information on configuration, check out:
|
|
9
|
+
* http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.globals.html
|
|
10
|
+
*/
|
|
11
|
+
module.exports.globals = {
|
|
12
|
+
|
|
13
|
+
/****************************************************************************
|
|
14
|
+
* *
|
|
15
|
+
* Expose the lodash installed in Sails core as a global variable. If this *
|
|
16
|
+
* is disabled, like any other node module you can always run npm install *
|
|
17
|
+
* lodash --save, then var _ = require('lodash') at the top of any file. *
|
|
18
|
+
* *
|
|
19
|
+
****************************************************************************/
|
|
20
|
+
|
|
21
|
+
// _: true,
|
|
22
|
+
|
|
23
|
+
/****************************************************************************
|
|
24
|
+
* *
|
|
25
|
+
* Expose the async installed in Sails core as a global variable. If this is *
|
|
26
|
+
* disabled, like any other node module you can always run npm install async *
|
|
27
|
+
* --save, then var async = require('async') at the top of any file. *
|
|
28
|
+
* *
|
|
29
|
+
****************************************************************************/
|
|
30
|
+
|
|
31
|
+
// async: true,
|
|
32
|
+
|
|
33
|
+
/****************************************************************************
|
|
34
|
+
* *
|
|
35
|
+
* Expose the sails instance representing your app. If this is disabled, you *
|
|
36
|
+
* can still get access via req._sails. *
|
|
37
|
+
* *
|
|
38
|
+
****************************************************************************/
|
|
39
|
+
|
|
40
|
+
// sails: true,
|
|
41
|
+
|
|
42
|
+
/****************************************************************************
|
|
43
|
+
* *
|
|
44
|
+
* Expose each of your app's services as global variables (using their *
|
|
45
|
+
* "globalId"). E.g. a service defined in api/models/NaturalLanguage.js *
|
|
46
|
+
* would have a globalId of NaturalLanguage by default. If this is disabled, *
|
|
47
|
+
* you can still access your services via sails.services.* *
|
|
48
|
+
* *
|
|
49
|
+
****************************************************************************/
|
|
50
|
+
|
|
51
|
+
// services: true,
|
|
52
|
+
|
|
53
|
+
/****************************************************************************
|
|
54
|
+
* *
|
|
55
|
+
* Expose each of your app's models as global variables (using their *
|
|
56
|
+
* "globalId"). E.g. a model defined in api/models/User.js would have a *
|
|
57
|
+
* globalId of User by default. If this is disabled, you can still access *
|
|
58
|
+
* your models via sails.models.*. *
|
|
59
|
+
* *
|
|
60
|
+
****************************************************************************/
|
|
61
|
+
|
|
62
|
+
models: true
|
|
63
|
+
};
|
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* HTTP Server Settings
|
|
3
|
+
* (sails.config.http)
|
|
4
|
+
*
|
|
5
|
+
* Configuration for the underlying HTTP server in Sails.
|
|
6
|
+
* Only applies to HTTP requests (not WebSockets)
|
|
7
|
+
*
|
|
8
|
+
* For more information on configuration, check out:
|
|
9
|
+
* http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.http.html
|
|
10
|
+
*/
|
|
11
|
+
|
|
12
|
+
module.exports.http = {
|
|
13
|
+
|
|
14
|
+
/****************************************************************************
|
|
15
|
+
* *
|
|
16
|
+
* Express middleware to use for every Sails request. To add custom *
|
|
17
|
+
* middleware to the mix, add a function to the middleware config object and *
|
|
18
|
+
* add its key to the "order" array. The $custom key is reserved for *
|
|
19
|
+
* backwards-compatibility with Sails v0.9.x apps that use the *
|
|
20
|
+
* `customMiddleware` config option. *
|
|
21
|
+
* *
|
|
22
|
+
****************************************************************************/
|
|
23
|
+
|
|
24
|
+
middleware: {
|
|
25
|
+
|
|
26
|
+
/***************************************************************************
|
|
27
|
+
* *
|
|
28
|
+
* The order in which middleware should be run for HTTP request. (the Sails *
|
|
29
|
+
* router is invoked by the "router" middleware below.) *
|
|
30
|
+
* *
|
|
31
|
+
***************************************************************************/
|
|
32
|
+
|
|
33
|
+
// order: [
|
|
34
|
+
// 'startRequestTimer',
|
|
35
|
+
// 'cookieParser',
|
|
36
|
+
// 'session',
|
|
37
|
+
// 'myRequestLogger',
|
|
38
|
+
// 'bodyParser',
|
|
39
|
+
// 'handleBodyParserError',
|
|
40
|
+
// 'compress',
|
|
41
|
+
// 'methodOverride',
|
|
42
|
+
// 'poweredBy',
|
|
43
|
+
// '$custom',
|
|
44
|
+
// 'router',
|
|
45
|
+
// 'www',
|
|
46
|
+
// 'favicon',
|
|
47
|
+
// '404',
|
|
48
|
+
// '500'
|
|
49
|
+
// ],
|
|
50
|
+
|
|
51
|
+
/****************************************************************************
|
|
52
|
+
* *
|
|
53
|
+
* Example custom middleware; logs each request to the console. *
|
|
54
|
+
* *
|
|
55
|
+
****************************************************************************/
|
|
56
|
+
|
|
57
|
+
// myRequestLogger: function (req, res, next) {
|
|
58
|
+
// console.log("Requested :: ", req.method, req.url);
|
|
59
|
+
// return next();
|
|
60
|
+
// }
|
|
61
|
+
|
|
62
|
+
|
|
63
|
+
/***************************************************************************
|
|
64
|
+
* *
|
|
65
|
+
* The body parser that will handle incoming multipart HTTP requests. By *
|
|
66
|
+
* default as of v0.10, Sails uses *
|
|
67
|
+
* [skipper](http://github.com/balderdashy/skipper). See *
|
|
68
|
+
* http://www.senchalabs.org/connect/multipart.html for other options. *
|
|
69
|
+
* *
|
|
70
|
+
* Note that Sails uses an internal instance of Skipper by default; to *
|
|
71
|
+
* override it and specify more options, make sure to "npm install skipper" *
|
|
72
|
+
* in your project first. You can also specify a different body parser or *
|
|
73
|
+
* a custom function with req, res and next parameters (just like any other *
|
|
74
|
+
* middleware function). *
|
|
75
|
+
* *
|
|
76
|
+
***************************************************************************/
|
|
77
|
+
|
|
78
|
+
// bodyParser: require('skipper')({strict: true})
|
|
79
|
+
|
|
80
|
+
},
|
|
81
|
+
|
|
82
|
+
/***************************************************************************
|
|
83
|
+
* *
|
|
84
|
+
* The number of seconds to cache flat files on disk being served by *
|
|
85
|
+
* Express static middleware (by default, these files are in `.tmp/public`) *
|
|
86
|
+
* *
|
|
87
|
+
* The HTTP static cache is only active in a 'production' environment, *
|
|
88
|
+
* since that's the only time Express will cache flat-files. *
|
|
89
|
+
* *
|
|
90
|
+
***************************************************************************/
|
|
91
|
+
|
|
92
|
+
// cache: 31557600000
|
|
93
|
+
};
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Internationalization / Localization Settings
|
|
3
|
+
* (sails.config.i18n)
|
|
4
|
+
*
|
|
5
|
+
* If your app will touch people from all over the world, i18n (or internationalization)
|
|
6
|
+
* may be an important part of your international strategy.
|
|
7
|
+
*
|
|
8
|
+
*
|
|
9
|
+
* For more informationom i18n in Sails, check out:
|
|
10
|
+
* http://sailsjs.org/#!/documentation/concepts/Internationalization
|
|
11
|
+
*
|
|
12
|
+
* For a complete list of i18n options, see:
|
|
13
|
+
* https://github.com/mashpie/i18n-node#list-of-configuration-options
|
|
14
|
+
*
|
|
15
|
+
*
|
|
16
|
+
*/
|
|
17
|
+
|
|
18
|
+
module.exports.i18n = {
|
|
19
|
+
|
|
20
|
+
/***************************************************************************
|
|
21
|
+
* *
|
|
22
|
+
* Which locales are supported? *
|
|
23
|
+
* *
|
|
24
|
+
***************************************************************************/
|
|
25
|
+
|
|
26
|
+
// locales: ['en', 'es', 'fr', 'de'],
|
|
27
|
+
|
|
28
|
+
/****************************************************************************
|
|
29
|
+
* *
|
|
30
|
+
* What is the default locale for the site? Note that this setting will be *
|
|
31
|
+
* overridden for any request that sends an "Accept-Language" header (i.e. *
|
|
32
|
+
* most browsers), but it's still useful if you need to localize the *
|
|
33
|
+
* response for requests made by non-browser clients (e.g. cURL). *
|
|
34
|
+
* *
|
|
35
|
+
****************************************************************************/
|
|
36
|
+
|
|
37
|
+
// defaultLocale: 'en',
|
|
38
|
+
|
|
39
|
+
/****************************************************************************
|
|
40
|
+
* *
|
|
41
|
+
* Automatically add new keys to locale (translation) files when they are *
|
|
42
|
+
* encountered during a request? *
|
|
43
|
+
* *
|
|
44
|
+
****************************************************************************/
|
|
45
|
+
|
|
46
|
+
// updateFiles: false,
|
|
47
|
+
|
|
48
|
+
/****************************************************************************
|
|
49
|
+
* *
|
|
50
|
+
* Path (relative to app root) of directory to store locale (translation) *
|
|
51
|
+
* files in. *
|
|
52
|
+
* *
|
|
53
|
+
****************************************************************************/
|
|
54
|
+
|
|
55
|
+
// localesDirectory: '/config/locales'
|
|
56
|
+
|
|
57
|
+
};
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Built-in Log Configuration
|
|
3
|
+
* (sails.config.log)
|
|
4
|
+
*
|
|
5
|
+
* Configure the log level for your app, as well as the transport
|
|
6
|
+
* (Underneath the covers, Sails uses Winston for logging, which
|
|
7
|
+
* allows for some pretty neat custom transports/adapters for log messages)
|
|
8
|
+
*
|
|
9
|
+
* For more information on the Sails logger, check out:
|
|
10
|
+
* http://sailsjs.org/#!/documentation/concepts/Logging
|
|
11
|
+
*/
|
|
12
|
+
|
|
13
|
+
module.exports.log = {
|
|
14
|
+
|
|
15
|
+
/***************************************************************************
|
|
16
|
+
* *
|
|
17
|
+
* Valid `level` configs: i.e. the minimum log level to capture with *
|
|
18
|
+
* sails.log.*() *
|
|
19
|
+
* *
|
|
20
|
+
* The order of precedence for log levels from lowest to highest is: *
|
|
21
|
+
* silly, verbose, info, debug, warn, error *
|
|
22
|
+
* *
|
|
23
|
+
* You may also set the level to "silent" to suppress all logs. *
|
|
24
|
+
* *
|
|
25
|
+
***************************************************************************/
|
|
26
|
+
|
|
27
|
+
level: 'verbose'
|
|
28
|
+
|
|
29
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Policy Mappings
|
|
3
|
+
* (sails.config.policies)
|
|
4
|
+
*
|
|
5
|
+
* Policies are simple functions which run **before** your controllers.
|
|
6
|
+
* You can apply one or more policies to a given controller, or protect
|
|
7
|
+
* its actions individually.
|
|
8
|
+
*
|
|
9
|
+
* Any policy file (e.g. `api/policies/authenticated.js`) can be accessed
|
|
10
|
+
* below by its filename, minus the extension, (e.g. "authenticated")
|
|
11
|
+
*
|
|
12
|
+
* For more information on how policies work, see:
|
|
13
|
+
* http://sailsjs.org/#!/documentation/concepts/Policies
|
|
14
|
+
*
|
|
15
|
+
* For more information on configuring policies, check out:
|
|
16
|
+
* http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.policies.html
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
module.exports.policies = {
|
|
21
|
+
|
|
22
|
+
/***************************************************************************
|
|
23
|
+
* *
|
|
24
|
+
* Default policy for all controllers and actions (`true` allows public *
|
|
25
|
+
* access) *
|
|
26
|
+
* *
|
|
27
|
+
***************************************************************************/
|
|
28
|
+
|
|
29
|
+
// '*': true,
|
|
30
|
+
|
|
31
|
+
/***************************************************************************
|
|
32
|
+
* *
|
|
33
|
+
* Here's an example of mapping some policies to run before a controller *
|
|
34
|
+
* and its actions *
|
|
35
|
+
* *
|
|
36
|
+
***************************************************************************/
|
|
37
|
+
// RabbitController: {
|
|
38
|
+
|
|
39
|
+
// Apply the `false` policy as the default for all of RabbitController's actions
|
|
40
|
+
// (`false` prevents all access, which ensures that nothing bad happens to our rabbits)
|
|
41
|
+
// '*': false,
|
|
42
|
+
|
|
43
|
+
// For the action `nurture`, apply the 'isRabbitMother' policy
|
|
44
|
+
// (this overrides `false` above)
|
|
45
|
+
// nurture : 'isRabbitMother',
|
|
46
|
+
|
|
47
|
+
// Apply the `isNiceToAnimals` AND `hasRabbitFood` policies
|
|
48
|
+
// before letting any users feed our rabbits
|
|
49
|
+
// feed : ['isNiceToAnimals', 'hasRabbitFood']
|
|
50
|
+
// }
|
|
51
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
module.exports.restocore = {
|
|
2
|
+
project: "Test",
|
|
3
|
+
project_slug: "test",
|
|
4
|
+
timeSyncBalance: 30, // seconds
|
|
5
|
+
timeSyncMenu: 5 * 60 , // seconds
|
|
6
|
+
timeSyncStreets: 12, // hours
|
|
7
|
+
images: {
|
|
8
|
+
adapter: 'imagemagick-local',
|
|
9
|
+
dish: {
|
|
10
|
+
format: 'png',
|
|
11
|
+
path: '/images',
|
|
12
|
+
resize: {
|
|
13
|
+
small: {
|
|
14
|
+
width: 200,
|
|
15
|
+
height: 200
|
|
16
|
+
},
|
|
17
|
+
large: {
|
|
18
|
+
width: 600
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
},
|
|
22
|
+
group: {
|
|
23
|
+
format: 'png',
|
|
24
|
+
path: '/imagesG',
|
|
25
|
+
}
|
|
26
|
+
},
|
|
27
|
+
development: true,
|
|
28
|
+
masterKey: 'test',
|
|
29
|
+
city: 'Xlan',
|
|
30
|
+
defaultName: "name",
|
|
31
|
+
defaultNumber: "77777777777",
|
|
32
|
+
timezone: 'Asia/Yekaterinburg',
|
|
33
|
+
timeSyncMap: 15 * 60, //seconds
|
|
34
|
+
checkType: 'native', //'rms',
|
|
35
|
+
groupShift: '',
|
|
36
|
+
rmsAdapter: '',
|
|
37
|
+
prefix: '/api/0.5/'
|
|
38
|
+
|
|
39
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Route Mappings
|
|
3
|
+
* (sails.config.routes)
|
|
4
|
+
*
|
|
5
|
+
* Your routes map URLs to views and controllers.
|
|
6
|
+
*
|
|
7
|
+
* If Sails receives a URL that doesn't match any of the routes below,
|
|
8
|
+
* it will check for matching files (images, scripts, stylesheets, etc.)
|
|
9
|
+
* in your assets directory. e.g. `http://localhost:1337/images/foo.jpg`
|
|
10
|
+
* might match an image file: `/assets/images/foo.jpg`
|
|
11
|
+
*
|
|
12
|
+
* Finally, if those don't match either, the default 404 handler is triggered.
|
|
13
|
+
* See `api/responses/notFound.js` to adjust your app's 404 logic.
|
|
14
|
+
*
|
|
15
|
+
* Note: Sails doesn't ACTUALLY serve stuff from `assets`-- the default Gruntfile in Sails copies
|
|
16
|
+
* flat files from `assets` to `.tmp/public`. This allows you to do things like compile LESS or
|
|
17
|
+
* CoffeeScript for the front-end.
|
|
18
|
+
*
|
|
19
|
+
* For more information on configuring custom routes, check out:
|
|
20
|
+
* http://sailsjs.org/#!/documentation/concepts/Routes/RouteTargetSyntax.html
|
|
21
|
+
*/
|
|
22
|
+
|
|
23
|
+
module.exports.routes = {
|
|
24
|
+
|
|
25
|
+
/***************************************************************************
|
|
26
|
+
* *
|
|
27
|
+
* Make the view located at `views/homepage.ejs` (or `views/homepage.jade`, *
|
|
28
|
+
* etc. depending on your default view engine) your home page. *
|
|
29
|
+
* *
|
|
30
|
+
* (Alternatively, remove this and add an `index.html` file in your *
|
|
31
|
+
* `assets` directory) *
|
|
32
|
+
* *
|
|
33
|
+
***************************************************************************/
|
|
34
|
+
|
|
35
|
+
'/': {
|
|
36
|
+
view: 'homepage'
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
/***************************************************************************
|
|
40
|
+
* *
|
|
41
|
+
* Custom routes here... *
|
|
42
|
+
* *
|
|
43
|
+
* If a request to a URL doesn't match any of the custom routes above, it *
|
|
44
|
+
* is matched against Sails route blueprints. See `config/blueprints.js` *
|
|
45
|
+
* for configuration options and examples. *
|
|
46
|
+
* *
|
|
47
|
+
***************************************************************************/
|
|
48
|
+
|
|
49
|
+
};
|