@webresto/graphql 1.3.1 → 1.3.4

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.
Files changed (71) hide show
  1. package/lib/eventHelper.js +1 -0
  2. package/lib/eventHelper.ts +1 -0
  3. package/package.json +1 -1
  4. package/src/additionalResolvers.js +33 -5
  5. package/src/additionalResolvers.ts +38 -5
  6. package/src/graphql.js +35 -22
  7. package/src/graphql.ts +38 -25
  8. package/src/resolvers/cart.d.ts +225 -7
  9. package/src/resolvers/cart.js +27 -7
  10. package/src/resolvers/cart.ts +24 -8
  11. package/src/resolvers/checkout.js +9 -7
  12. package/src/resolvers/checkout.ts +14 -9
  13. package/test/{_bootstrap.js → bootstrap.js} +6 -7
  14. package/test/bootstrap.ts +3 -0
  15. package/test/fixture/.sailsrc +14 -0
  16. package/test/fixture/api/controllers/.gitkeep +0 -0
  17. package/test/fixture/api/models/.gitkeep +0 -0
  18. package/test/fixture/api/services/.gitkeep +0 -0
  19. package/test/fixture/app-export.js +73 -73
  20. package/test/fixture/app.js +56 -56
  21. package/test/fixture/config/adminpanel.js +25 -3
  22. package/test/fixture/config/bootstrap.js +161 -0
  23. package/test/fixture/config/connections.js +9 -9
  24. package/test/fixture/config/env/development.js +10 -10
  25. package/test/fixture/config/env/production.js +16 -16
  26. package/test/fixture/config/globals.js +16 -16
  27. package/test/fixture/config/hookTimeout.js +8 -8
  28. package/test/fixture/config/http.js +93 -93
  29. package/test/fixture/config/i18n.js +57 -57
  30. package/test/fixture/config/log.js +29 -29
  31. package/test/fixture/config/models.js +8 -8
  32. package/test/fixture/config/modulemanager.js +22 -22
  33. package/test/fixture/config/policies.js +51 -51
  34. package/test/fixture/config/routes.js +49 -49
  35. package/test/fixture/config/session.js +100 -100
  36. package/test/fixture/config/sockets.js +141 -141
  37. package/test/fixture/config/views.js +94 -94
  38. package/test/fixture/hacks/waterline.js +39 -0
  39. package/test/fixture/package.json +33 -30
  40. package/test/fixture/seeds/dish.json +37042 -0
  41. package/test/fixture/seeds/group.json +1418 -0
  42. package/test/fixture/seeds/iikoDiscount.json +365 -0
  43. package/test/fixture/views/403.ejs +68 -68
  44. package/test/fixture/views/404.ejs +68 -68
  45. package/test/fixture/views/500.ejs +73 -73
  46. package/test/fixture/views/homepage.ejs +74 -74
  47. package/test/fixture/views/layout.ejs +91 -91
  48. package/test/integration/graphql.test.js +11 -0
  49. package/test/integration/graphql.test.ts +15 -0
  50. package/test/integration/order.test.js +86 -0
  51. package/test/integration/order.test.ts +108 -0
  52. package/test/{unit → integration}/sails_not_crash.test.js +0 -0
  53. package/test/{unit → integration}/sails_not_crash.test.ts +0 -0
  54. package/test/unit/first.test.js +1 -1
  55. package/test/unit/first.test.ts +1 -1
  56. package/test/fixture/.tmp/localDiskDb/archive.db +0 -1
  57. package/test/fixture/.tmp/localDiskDb/dish.db +0 -1
  58. package/test/fixture/.tmp/localDiskDb/dish_images__image_dish.db +0 -1
  59. package/test/fixture/.tmp/localDiskDb/group.db +0 -1
  60. package/test/fixture/.tmp/localDiskDb/group_images__image_group.db +0 -1
  61. package/test/fixture/.tmp/localDiskDb/image.db +0 -1
  62. package/test/fixture/.tmp/localDiskDb/maintenance.db +0 -1
  63. package/test/fixture/.tmp/localDiskDb/order.db +0 -1
  64. package/test/fixture/.tmp/localDiskDb/orderdish.db +0 -1
  65. package/test/fixture/.tmp/localDiskDb/paymentdocument.db +0 -1
  66. package/test/fixture/.tmp/localDiskDb/paymentmethod.db +0 -2
  67. package/test/fixture/.tmp/localDiskDb/place.db +0 -1
  68. package/test/fixture/.tmp/localDiskDb/settings.db +0 -2
  69. package/test/fixture/.tmp/localDiskDb/street.db +0 -1
  70. package/test/fixture/package-lock.json +0 -9805
  71. package/test.zip +0 -0
@@ -1,9 +1,9 @@
1
- module.exports.models = {
2
- migrate: 'drop',
3
- attributes: {
4
- id: { type: 'number', autoIncrement: true, },
5
- createdAt: { type: 'number', autoCreatedAt: true, },
6
- updatedAt: { type: 'number', autoUpdatedAt: true, }
7
- },
8
-
1
+ module.exports.models = {
2
+ migrate: 'drop',
3
+ attributes: {
4
+ id: { type: 'number', autoIncrement: true, },
5
+ createdAt: { type: 'number', autoCreatedAt: true, },
6
+ updatedAt: { type: 'number', autoUpdatedAt: true, }
7
+ },
8
+
9
9
  };
@@ -1,22 +1,22 @@
1
- module.exports.modulemanager = {
2
- navbar: [
3
- {
4
- id: "1",
5
- name: "Мои модули",
6
- link: `/admin/modules/my`,
7
- icon: "home"
8
- },
9
- {
10
- id: "2",
11
- name: "Обновления",
12
- link: `/admin/modules/updates`,
13
- icon: "cloud-download-alt"
14
- },
15
- {
16
- id: "3",
17
- name: "Маркетплейс",
18
- link: `/admin/modules/market`,
19
- icon: "shopping-cart"
20
- }
21
- ]
22
- }
1
+ module.exports.modulemanager = {
2
+ navbar: [
3
+ {
4
+ id: "1",
5
+ name: "Мои модули",
6
+ link: `/admin/modules/my`,
7
+ icon: "home"
8
+ },
9
+ {
10
+ id: "2",
11
+ name: "Обновления",
12
+ link: `/admin/modules/updates`,
13
+ icon: "cloud-download-alt"
14
+ },
15
+ {
16
+ id: "3",
17
+ name: "Маркетплейс",
18
+ link: `/admin/modules/market`,
19
+ icon: "shopping-order"
20
+ }
21
+ ]
22
+ }
@@ -1,51 +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
- };
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
+ };
@@ -1,49 +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
- };
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
+ };
@@ -1,100 +1,100 @@
1
- /**
2
- * Session Configuration
3
- * (sails.config.session)
4
- *
5
- * Sails session integration leans heavily on the great work already done by
6
- * Express, but also unifies Socket.io with the Connect session store. It uses
7
- * Connect's cookie parser to normalize configuration differences between Express
8
- * and Socket.io and hooks into Sails' middleware interpreter to allow you to access
9
- * and auto-save to `req.session` with Socket.io the same way you would with Express.
10
- *
11
- * For more information on configuring the session, check out:
12
- * http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.session.html
13
- */
14
-
15
- module.exports.session = {
16
-
17
- /***************************************************************************
18
- * *
19
- * Session secret is automatically generated when your new app is created *
20
- * Replace at your own risk in production-- you will invalidate the cookies *
21
- * of your users, forcing them to log in again. *
22
- * *
23
- ***************************************************************************/
24
- secret: 'ffbef9b6711dc3130e47e22d46fee23c',
25
-
26
-
27
- /***************************************************************************
28
- * *
29
- * Set the session cookie expire time The maxAge is set by milliseconds, *
30
- * the example below is for 24 hours *
31
- * *
32
- ***************************************************************************/
33
-
34
- // cookie: {
35
- // maxAge: 24 * 60 * 60 * 1000
36
- // },
37
-
38
- /***************************************************************************
39
- * *
40
- * Uncomment the following lines to set up a Redis session store that can *
41
- * be shared across multiple Sails.js servers. *
42
- * *
43
- * Requires connect-redis (https://www.npmjs.com/package/connect-redis) *
44
- * *
45
- ***************************************************************************/
46
-
47
- // adapter: 'redis',
48
-
49
- /***************************************************************************
50
- * *
51
- * The following values are optional, if no options are set a redis *
52
- * instance running on localhost is expected. Read more about options at: *
53
- * *
54
- * https://github.com/visionmedia/connect-redis *
55
- * *
56
- ***************************************************************************/
57
-
58
- // host: 'localhost',
59
- // port: 6379,
60
- // ttl: <redis session TTL in seconds>,
61
- // db: 0,
62
- // pass: <redis auth password>,
63
- // prefix: 'sess:',
64
-
65
-
66
- /***************************************************************************
67
- * *
68
- * Uncomment the following lines to set up a MongoDB session store that can *
69
- * be shared across multiple Sails.js servers. *
70
- * *
71
- * Requires connect-mongo (https://www.npmjs.com/package/connect-mongo) *
72
- * Use version 0.8.2 with Node version <= 0.12 *
73
- * Use the latest version with Node >= 4.0 *
74
- * *
75
- ***************************************************************************/
76
-
77
- // adapter: 'mongo',
78
- // url: 'mongodb://user:password@localhost:27017/dbname', // user, password and port optional
79
-
80
- /***************************************************************************
81
- * *
82
- * Optional Values: *
83
- * *
84
- * See https://github.com/kcbanner/connect-mongo for more *
85
- * information about connect-mongo options. *
86
- * *
87
- * See http://bit.ly/mongooptions for more information about options *
88
- * available in `mongoOptions` *
89
- * *
90
- ***************************************************************************/
91
-
92
- // collection: 'sessions',
93
- // stringify: true,
94
- // mongoOptions: {
95
- // server: {
96
- // ssl: true
97
- // }
98
- // }
99
-
100
- };
1
+ /**
2
+ * Session Configuration
3
+ * (sails.config.session)
4
+ *
5
+ * Sails session integration leans heavily on the great work already done by
6
+ * Express, but also unifies Socket.io with the Connect session store. It uses
7
+ * Connect's cookie parser to normalize configuration differences between Express
8
+ * and Socket.io and hooks into Sails' middleware interpreter to allow you to access
9
+ * and auto-save to `req.session` with Socket.io the same way you would with Express.
10
+ *
11
+ * For more information on configuring the session, check out:
12
+ * http://sailsjs.org/#!/documentation/reference/sails.config/sails.config.session.html
13
+ */
14
+
15
+ module.exports.session = {
16
+
17
+ /***************************************************************************
18
+ * *
19
+ * Session secret is automatically generated when your new app is created *
20
+ * Replace at your own risk in production-- you will invalidate the cookies *
21
+ * of your users, forcing them to log in again. *
22
+ * *
23
+ ***************************************************************************/
24
+ secret: 'ffbef9b6711dc3130e47e22d46fee23c',
25
+
26
+
27
+ /***************************************************************************
28
+ * *
29
+ * Set the session cookie expire time The maxAge is set by milliseconds, *
30
+ * the example below is for 24 hours *
31
+ * *
32
+ ***************************************************************************/
33
+
34
+ // cookie: {
35
+ // maxAge: 24 * 60 * 60 * 1000
36
+ // },
37
+
38
+ /***************************************************************************
39
+ * *
40
+ * Uncomment the following lines to set up a Redis session store that can *
41
+ * be shared across multiple Sails.js servers. *
42
+ * *
43
+ * Requires connect-redis (https://www.npmjs.com/package/connect-redis) *
44
+ * *
45
+ ***************************************************************************/
46
+
47
+ // adapter: 'redis',
48
+
49
+ /***************************************************************************
50
+ * *
51
+ * The following values are optional, if no options are set a redis *
52
+ * instance running on localhost is expected. Read more about options at: *
53
+ * *
54
+ * https://github.com/visionmedia/connect-redis *
55
+ * *
56
+ ***************************************************************************/
57
+
58
+ // host: 'localhost',
59
+ // port: 6379,
60
+ // ttl: <redis session TTL in seconds>,
61
+ // db: 0,
62
+ // pass: <redis auth password>,
63
+ // prefix: 'sess:',
64
+
65
+
66
+ /***************************************************************************
67
+ * *
68
+ * Uncomment the following lines to set up a MongoDB session store that can *
69
+ * be shared across multiple Sails.js servers. *
70
+ * *
71
+ * Requires connect-mongo (https://www.npmjs.com/package/connect-mongo) *
72
+ * Use version 0.8.2 with Node version <= 0.12 *
73
+ * Use the latest version with Node >= 4.0 *
74
+ * *
75
+ ***************************************************************************/
76
+
77
+ // adapter: 'mongo',
78
+ // url: 'mongodb://user:password@localhost:27017/dbname', // user, password and port optional
79
+
80
+ /***************************************************************************
81
+ * *
82
+ * Optional Values: *
83
+ * *
84
+ * See https://github.com/kcbanner/connect-mongo for more *
85
+ * information about connect-mongo options. *
86
+ * *
87
+ * See http://bit.ly/mongooptions for more information about options *
88
+ * available in `mongoOptions` *
89
+ * *
90
+ ***************************************************************************/
91
+
92
+ // collection: 'sessions',
93
+ // stringify: true,
94
+ // mongoOptions: {
95
+ // server: {
96
+ // ssl: true
97
+ // }
98
+ // }
99
+
100
+ };