@webresto/graphql 1.3.2 → 1.3.3
Sign up to get free protection for your applications and to get access to all the features.
- package/package.json +1 -1
- package/src/additionalResolvers.js +1 -1
- package/src/additionalResolvers.ts +1 -1
- package/src/graphql.js +40 -22
- package/src/graphql.ts +42 -25
- package/src/resolvers/cart.d.ts +225 -7
- package/src/resolvers/cart.js +21 -7
- package/src/resolvers/cart.ts +23 -8
- package/src/resolvers/checkout.ts +1 -0
- package/test/{_bootstrap.js → bootstrap.js} +6 -7
- package/test/bootstrap.ts +3 -0
- package/test/fixture/.sailsrc +14 -0
- package/test/fixture/api/controllers/.gitkeep +0 -0
- package/test/fixture/api/models/.gitkeep +0 -0
- package/test/fixture/api/services/.gitkeep +0 -0
- package/test/fixture/app-export.js +73 -73
- package/test/fixture/app.js +56 -56
- package/test/fixture/config/adminpanel.js +25 -3
- package/test/fixture/config/bootstrap.js +161 -0
- package/test/fixture/config/connections.js +9 -9
- package/test/fixture/config/env/development.js +10 -10
- package/test/fixture/config/env/production.js +16 -16
- package/test/fixture/config/globals.js +16 -16
- package/test/fixture/config/hookTimeout.js +8 -8
- package/test/fixture/config/http.js +93 -93
- package/test/fixture/config/i18n.js +57 -57
- package/test/fixture/config/log.js +29 -29
- package/test/fixture/config/models.js +8 -8
- package/test/fixture/config/modulemanager.js +22 -22
- package/test/fixture/config/policies.js +51 -51
- package/test/fixture/config/routes.js +49 -49
- package/test/fixture/config/session.js +100 -100
- package/test/fixture/config/sockets.js +141 -141
- package/test/fixture/config/views.js +94 -94
- package/test/fixture/hacks/waterline.js +39 -0
- package/test/fixture/package.json +33 -30
- package/test/fixture/seeds/dish.json +37042 -0
- package/test/fixture/seeds/group.json +1418 -0
- package/test/fixture/seeds/iikoDiscount.json +365 -0
- package/test/fixture/views/403.ejs +68 -68
- package/test/fixture/views/404.ejs +68 -68
- package/test/fixture/views/500.ejs +73 -73
- package/test/fixture/views/homepage.ejs +74 -74
- package/test/fixture/views/layout.ejs +91 -91
- package/test/integration/graphql.test.js +11 -0
- package/test/integration/graphql.test.ts +15 -0
- package/test/{unit → integration}/sails_not_crash.test.js +0 -0
- package/test/{unit → integration}/sails_not_crash.test.ts +0 -0
- package/test/unit/first.test.js +1 -1
- package/test/unit/first.test.ts +1 -1
- package/test/fixture/.tmp/localDiskDb/archive.db +0 -1
- package/test/fixture/.tmp/localDiskDb/dish.db +0 -1
- package/test/fixture/.tmp/localDiskDb/dish_images__image_dish.db +0 -1
- package/test/fixture/.tmp/localDiskDb/group.db +0 -1
- package/test/fixture/.tmp/localDiskDb/group_images__image_group.db +0 -1
- package/test/fixture/.tmp/localDiskDb/image.db +0 -1
- package/test/fixture/.tmp/localDiskDb/maintenance.db +0 -1
- package/test/fixture/.tmp/localDiskDb/order.db +0 -1
- package/test/fixture/.tmp/localDiskDb/orderdish.db +0 -1
- package/test/fixture/.tmp/localDiskDb/paymentdocument.db +0 -1
- package/test/fixture/.tmp/localDiskDb/paymentmethod.db +0 -2
- package/test/fixture/.tmp/localDiskDb/place.db +0 -1
- package/test/fixture/.tmp/localDiskDb/settings.db +0 -2
- package/test/fixture/.tmp/localDiskDb/street.db +0 -1
- package/test/fixture/package-lock.json +0 -9805
- package/test.zip +0 -0
@@ -1,95 +1,95 @@
|
|
1
|
-
/**
|
2
|
-
* View Engine Configuration
|
3
|
-
* (sails.config.views)
|
4
|
-
*
|
5
|
-
* Server-sent views are a classic and effective way to get your app up
|
6
|
-
* and running. Views are normally served from controllers. Below, you can
|
7
|
-
* configure your templating language/framework of choice and configure
|
8
|
-
* Sails' layout support.
|
9
|
-
*
|
10
|
-
* For more information on views and layouts, check out:
|
11
|
-
* http://sailsjs.org/#!/documentation/concepts/Views
|
12
|
-
*/
|
13
|
-
|
14
|
-
module.exports.views = {
|
15
|
-
|
16
|
-
/****************************************************************************
|
17
|
-
* *
|
18
|
-
* View engine (aka template language) to use for your app's *server-side* *
|
19
|
-
* views *
|
20
|
-
* *
|
21
|
-
* Sails+Express supports all view engines which implement TJ Holowaychuk's *
|
22
|
-
* `consolidate.js`, including, but not limited to: *
|
23
|
-
* *
|
24
|
-
* ejs, jade, handlebars, mustache underscore, hogan, haml, haml-coffee, *
|
25
|
-
* dust atpl, eco, ect, jazz, jqtpl, JUST, liquor, QEJS, swig, templayed, *
|
26
|
-
* toffee, walrus, & whiskers *
|
27
|
-
* *
|
28
|
-
* For more options, check out the docs: *
|
29
|
-
* https://github.com/balderdashy/sails-wiki/blob/0.9/config.views.md#engine *
|
30
|
-
* *
|
31
|
-
****************************************************************************/
|
32
|
-
|
33
|
-
engine: 'ejs',
|
34
|
-
|
35
|
-
|
36
|
-
/****************************************************************************
|
37
|
-
* *
|
38
|
-
* Layouts are simply top-level HTML templates you can use as wrappers for *
|
39
|
-
* your server-side views. If you're using ejs or jade, you can take *
|
40
|
-
* advantage of Sails' built-in `layout` support. *
|
41
|
-
* *
|
42
|
-
* When using a layout, when one of your views is served, it is injected *
|
43
|
-
* into the `body` partial defined in the layout. This lets you reuse header *
|
44
|
-
* and footer logic between views. *
|
45
|
-
* *
|
46
|
-
* NOTE: Layout support is only implemented for the `ejs` view engine! *
|
47
|
-
* For most other engines, it is not necessary, since they implement *
|
48
|
-
* partials/layouts themselves. In those cases, this config will be *
|
49
|
-
* silently ignored. *
|
50
|
-
* *
|
51
|
-
* The `layout` setting may be set to one of the following: *
|
52
|
-
* *
|
53
|
-
* If `false`, layouts will be disabled. Otherwise, if a string is *
|
54
|
-
* specified, it will be interpreted as the relative path to your layout *
|
55
|
-
* file from `views/` folder. (the file extension, ".ejs", should be *
|
56
|
-
* omitted) *
|
57
|
-
* *
|
58
|
-
****************************************************************************/
|
59
|
-
|
60
|
-
/****************************************************************************
|
61
|
-
* *
|
62
|
-
* Using Multiple Layouts *
|
63
|
-
* *
|
64
|
-
* If you're using the default `ejs` or `handlebars` Sails supports the use *
|
65
|
-
* of multiple `layout` files. To take advantage of this, before rendering a *
|
66
|
-
* view, override the `layout` local in your controller by setting *
|
67
|
-
* `res.locals.layout`. (this is handy if you parts of your app's UI look *
|
68
|
-
* completely different from each other) *
|
69
|
-
* *
|
70
|
-
* e.g. your default might be *
|
71
|
-
* layout: 'layouts/public' *
|
72
|
-
* *
|
73
|
-
* But you might override that in some of your controllers with: *
|
74
|
-
* layout: 'layouts/internal' *
|
75
|
-
* *
|
76
|
-
****************************************************************************/
|
77
|
-
|
78
|
-
layout: 'layout',
|
79
|
-
|
80
|
-
/****************************************************************************
|
81
|
-
* *
|
82
|
-
* Partials are simply top-level snippets you can leverage to reuse template *
|
83
|
-
* for your server-side views. If you're using handlebars, you can take *
|
84
|
-
* advantage of Sails' built-in `partials` support. *
|
85
|
-
* *
|
86
|
-
* If `false` or empty partials will be located in the same folder as views. *
|
87
|
-
* Otherwise, if a string is specified, it will be interpreted as the *
|
88
|
-
* relative path to your partial files from `views/` folder. *
|
89
|
-
* *
|
90
|
-
****************************************************************************/
|
91
|
-
|
92
|
-
partials: false
|
93
|
-
|
94
|
-
|
1
|
+
/**
|
2
|
+
* View Engine Configuration
|
3
|
+
* (sails.config.views)
|
4
|
+
*
|
5
|
+
* Server-sent views are a classic and effective way to get your app up
|
6
|
+
* and running. Views are normally served from controllers. Below, you can
|
7
|
+
* configure your templating language/framework of choice and configure
|
8
|
+
* Sails' layout support.
|
9
|
+
*
|
10
|
+
* For more information on views and layouts, check out:
|
11
|
+
* http://sailsjs.org/#!/documentation/concepts/Views
|
12
|
+
*/
|
13
|
+
|
14
|
+
module.exports.views = {
|
15
|
+
|
16
|
+
/****************************************************************************
|
17
|
+
* *
|
18
|
+
* View engine (aka template language) to use for your app's *server-side* *
|
19
|
+
* views *
|
20
|
+
* *
|
21
|
+
* Sails+Express supports all view engines which implement TJ Holowaychuk's *
|
22
|
+
* `consolidate.js`, including, but not limited to: *
|
23
|
+
* *
|
24
|
+
* ejs, jade, handlebars, mustache underscore, hogan, haml, haml-coffee, *
|
25
|
+
* dust atpl, eco, ect, jazz, jqtpl, JUST, liquor, QEJS, swig, templayed, *
|
26
|
+
* toffee, walrus, & whiskers *
|
27
|
+
* *
|
28
|
+
* For more options, check out the docs: *
|
29
|
+
* https://github.com/balderdashy/sails-wiki/blob/0.9/config.views.md#engine *
|
30
|
+
* *
|
31
|
+
****************************************************************************/
|
32
|
+
|
33
|
+
engine: 'ejs',
|
34
|
+
|
35
|
+
|
36
|
+
/****************************************************************************
|
37
|
+
* *
|
38
|
+
* Layouts are simply top-level HTML templates you can use as wrappers for *
|
39
|
+
* your server-side views. If you're using ejs or jade, you can take *
|
40
|
+
* advantage of Sails' built-in `layout` support. *
|
41
|
+
* *
|
42
|
+
* When using a layout, when one of your views is served, it is injected *
|
43
|
+
* into the `body` partial defined in the layout. This lets you reuse header *
|
44
|
+
* and footer logic between views. *
|
45
|
+
* *
|
46
|
+
* NOTE: Layout support is only implemented for the `ejs` view engine! *
|
47
|
+
* For most other engines, it is not necessary, since they implement *
|
48
|
+
* partials/layouts themselves. In those cases, this config will be *
|
49
|
+
* silently ignored. *
|
50
|
+
* *
|
51
|
+
* The `layout` setting may be set to one of the following: *
|
52
|
+
* *
|
53
|
+
* If `false`, layouts will be disabled. Otherwise, if a string is *
|
54
|
+
* specified, it will be interpreted as the relative path to your layout *
|
55
|
+
* file from `views/` folder. (the file extension, ".ejs", should be *
|
56
|
+
* omitted) *
|
57
|
+
* *
|
58
|
+
****************************************************************************/
|
59
|
+
|
60
|
+
/****************************************************************************
|
61
|
+
* *
|
62
|
+
* Using Multiple Layouts *
|
63
|
+
* *
|
64
|
+
* If you're using the default `ejs` or `handlebars` Sails supports the use *
|
65
|
+
* of multiple `layout` files. To take advantage of this, before rendering a *
|
66
|
+
* view, override the `layout` local in your controller by setting *
|
67
|
+
* `res.locals.layout`. (this is handy if you parts of your app's UI look *
|
68
|
+
* completely different from each other) *
|
69
|
+
* *
|
70
|
+
* e.g. your default might be *
|
71
|
+
* layout: 'layouts/public' *
|
72
|
+
* *
|
73
|
+
* But you might override that in some of your controllers with: *
|
74
|
+
* layout: 'layouts/internal' *
|
75
|
+
* *
|
76
|
+
****************************************************************************/
|
77
|
+
|
78
|
+
layout: 'layout',
|
79
|
+
|
80
|
+
/****************************************************************************
|
81
|
+
* *
|
82
|
+
* Partials are simply top-level snippets you can leverage to reuse template *
|
83
|
+
* for your server-side views. If you're using handlebars, you can take *
|
84
|
+
* advantage of Sails' built-in `partials` support. *
|
85
|
+
* *
|
86
|
+
* If `false` or empty partials will be located in the same folder as views. *
|
87
|
+
* Otherwise, if a string is specified, it will be interpreted as the *
|
88
|
+
* relative path to your partial files from `views/` folder. *
|
89
|
+
* *
|
90
|
+
****************************************************************************/
|
91
|
+
|
92
|
+
partials: false
|
93
|
+
|
94
|
+
|
95
95
|
};
|
@@ -0,0 +1,39 @@
|
|
1
|
+
/**
|
2
|
+
* WRONG SAILS HACK
|
3
|
+
*/
|
4
|
+
|
5
|
+
console.warn("WRONG SAILS HACK v0.2");
|
6
|
+
let PWD = process.cwd()
|
7
|
+
const replace = require("replace-in-file");
|
8
|
+
|
9
|
+
/**
|
10
|
+
* 1.
|
11
|
+
* Patch for allow unknow types
|
12
|
+
* bash equals: find $PWD/node_modules/waterline-schema/ -type f -print0 | xargs -0 sed -i 's|if (_.indexOf(validProperties, propertyName) < 0) {|if (false) {|g'
|
13
|
+
*/
|
14
|
+
console.log(PWD + "/../**/sails-hook-orm/lib/validate-model-def.js",);
|
15
|
+
const results = replace.sync({
|
16
|
+
files: [
|
17
|
+
//for test system
|
18
|
+
PWD + "/../**/sails-hook-orm/lib/validate-model-def.js",
|
19
|
+
PWD + "/../**/waterline-schema/schema.js",
|
20
|
+
PWD + "/../**/sails-disk/index.js",
|
21
|
+
PWD + "/../**/query/private/normalize-value-to-set.js",
|
22
|
+
|
23
|
+
],
|
24
|
+
from: [
|
25
|
+
"(_.isFunction(val.defaultsTo))",
|
26
|
+
"(_.indexOf(validProperties, propertyName) < 0)",
|
27
|
+
"(_.has(attribute, 'defaultsTo') && _.isNull(attribute.defaultsTo))",
|
28
|
+
"(_.has(primaryKeyAttribute, 'defaultsTo') && !_.isUndefined(primaryKeyAttribute, 'defaultsTo'))",
|
29
|
+
"(attribute.required && _.has(attribute, 'defaultsTo') && !_.isUndefined(attribute, 'defaultsTo'))",
|
30
|
+
"(_.has(attribute, 'defaultsTo'))",
|
31
|
+
"(isProvidingNullForIncompatibleOptionalAttr)",
|
32
|
+
"(primaryKeyAttr.required !== true && (!primaryKeyAttr.autoMigrations || primaryKeyAttr.autoMigrations.autoIncrement !== true))"
|
33
|
+
],
|
34
|
+
to: "(false)",
|
35
|
+
});
|
36
|
+
|
37
|
+
console.log(results);
|
38
|
+
|
39
|
+
// Stranger things
|
@@ -1,30 +1,33 @@
|
|
1
|
-
{
|
2
|
-
"name": "test-app",
|
3
|
-
"private": true,
|
4
|
-
"version": "0.0.0",
|
5
|
-
"description": "Sails test application",
|
6
|
-
"keywords": [],
|
7
|
-
|
8
|
-
|
9
|
-
"@webresto/
|
10
|
-
"@webresto/
|
11
|
-
"
|
12
|
-
"
|
13
|
-
"
|
14
|
-
"
|
15
|
-
"sails
|
16
|
-
"sails-hook-
|
17
|
-
"sails-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
}
|
1
|
+
{
|
2
|
+
"name": "test-app",
|
3
|
+
"private": true,
|
4
|
+
"version": "0.0.0",
|
5
|
+
"description": "Sails test application",
|
6
|
+
"keywords": [],
|
7
|
+
"dependencies": {
|
8
|
+
"@webresto/core": "file:../../node_modules/@webresto/core",
|
9
|
+
"@webresto/graphql": "file:../..",
|
10
|
+
"@webresto/worktime": "file:../../node_modules/@webresto/worktime",
|
11
|
+
"replace-in-file": "^6.3.2",
|
12
|
+
"include-all": "^1.0.8",
|
13
|
+
"rc": "^1.0.1",
|
14
|
+
"request": "^2.88.2",
|
15
|
+
"sails": "^1.5.0",
|
16
|
+
"sails-hook-orm": "^2.1.1",
|
17
|
+
"sails-hook-stateflow": "^1.0.6",
|
18
|
+
"connect-flash": "^0.1.1",
|
19
|
+
"sails-memory": "^0.10.7"
|
20
|
+
},
|
21
|
+
"scripts": {
|
22
|
+
"debug": "node debug app.js",
|
23
|
+
"start": "node app.js",
|
24
|
+
"postinstall": "node ./hacks/waterline.js"
|
25
|
+
},
|
26
|
+
"main": "app.js",
|
27
|
+
"repository": {
|
28
|
+
"type": "git",
|
29
|
+
"url": "git://github.com/webresto/app.git"
|
30
|
+
},
|
31
|
+
"author": "webresto",
|
32
|
+
"license": "MIT"
|
33
|
+
}
|