@qooxdoo/framework 7.0.0-beta.2 → 7.0.0-beta.6

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 (143) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/Manifest.json +2 -3
  3. package/README.md +7 -3
  4. package/bin/deploy/qx +0 -0
  5. package/lib/compiler/compile-info.json +44 -45
  6. package/lib/compiler/index.js +1971 -8371
  7. package/lib/resource/qx/tool/cli/templates/loader/loader-node.tmpl.js +3 -1
  8. package/lib/resource/qx/tool/cli/templates/skeleton/mobile/source/theme/custom/css/custom.css +1 -1
  9. package/lib/resource/qx/tool/cli/templates/skeleton/mobile/source/theme/custom/css/custom.css.map +1 -1
  10. package/lib/resource/qx/tool/cli/templates/template_vars.js +1 -1
  11. package/lib/resource/qx/tool/loadsass.js +6 -12
  12. package/lib/resource/qx/tool/schema/Manifest-1-0-0.json +1 -2
  13. package/lib/resource/qx/tool/schema/Manifest-2-0-0.json +1 -2
  14. package/lib/resource/qx/tool/schema/compile-1-0-0.json +3 -7
  15. package/package.json +25 -12
  16. package/source/class/qx/io/__init__.js +5 -3
  17. package/source/class/qx/io/exception/Cancel.js +34 -0
  18. package/source/class/qx/io/exception/Exception.js +38 -0
  19. package/source/class/qx/{tool/compiler/Version.js → io/exception/Protocol.js} +13 -7
  20. package/source/class/qx/io/exception/Transport.js +39 -0
  21. package/source/class/qx/io/exception/__init__.js +4 -0
  22. package/source/class/qx/io/graphql/Client.js +112 -0
  23. package/source/class/qx/io/graphql/__init__.js +9 -0
  24. package/source/class/qx/io/graphql/protocol/Message.js +65 -0
  25. package/source/class/qx/io/graphql/protocol/Request.js +95 -0
  26. package/source/class/qx/io/graphql/protocol/Response.js +61 -0
  27. package/source/class/qx/io/graphql/protocol/__init__.js +6 -0
  28. package/source/class/qx/io/jsonrpc/Client.js +323 -0
  29. package/source/class/qx/io/jsonrpc/__init__.js +15 -0
  30. package/source/class/qx/io/jsonrpc/protocol/Batch.js +97 -0
  31. package/source/class/qx/io/jsonrpc/protocol/Error.js +63 -0
  32. package/source/class/qx/io/jsonrpc/protocol/Message.js +48 -0
  33. package/source/class/qx/io/jsonrpc/protocol/Notification.js +45 -0
  34. package/source/class/qx/io/jsonrpc/protocol/Parser.js +81 -0
  35. package/source/class/qx/io/jsonrpc/protocol/Request.js +93 -0
  36. package/source/class/qx/io/jsonrpc/protocol/Result.js +48 -0
  37. package/source/class/qx/io/jsonrpc/protocol/__init__.js +5 -0
  38. package/source/class/qx/io/request/authentication/Bearer.js +52 -0
  39. package/source/class/qx/io/transport/AbstractClient.js +100 -0
  40. package/source/class/qx/io/transport/AbstractTransport.js +41 -0
  41. package/source/class/qx/io/transport/Fetch.js +95 -0
  42. package/source/class/qx/io/transport/ITransport.js +40 -0
  43. package/source/class/qx/io/transport/PostMessage.js +55 -0
  44. package/source/class/qx/io/transport/Websocket.js +97 -0
  45. package/source/class/qx/io/transport/Xhr.js +139 -0
  46. package/source/class/qx/io/transport/__init__.js +18 -0
  47. package/source/class/qx/test/io/MAssert.js +46 -0
  48. package/source/class/qx/test/io/graphql/Client.js +169 -0
  49. package/source/class/qx/test/io/graphql/ClientFetch.js +34 -0
  50. package/source/class/qx/test/io/graphql/Request.js +42 -0
  51. package/source/class/qx/test/io/jsonrpc/Client.js +267 -0
  52. package/source/class/qx/test/io/jsonrpc/Protocol.js +80 -0
  53. package/source/class/qx/test/io/transport/PostMessage.js +56 -0
  54. package/source/class/qx/test/io/transport/Websocket.js +63 -0
  55. package/source/class/qx/test/ui/embed/Iframe.js +1 -0
  56. package/source/class/qx/test/ui/form/ComboBox.js +0 -42
  57. package/source/class/qx/test/util/DateFormat.js +45 -6
  58. package/source/class/qx/theme/manager/Decoration.js +0 -0
  59. package/source/class/qx/theme/tangible/ColorDark.js +0 -0
  60. package/source/class/qx/tool/cli/Cli.js +5 -3
  61. package/source/class/qx/tool/cli/api/CompilerApi.js +15 -5
  62. package/source/class/qx/tool/cli/commands/Command.js +7 -0
  63. package/source/class/qx/tool/cli/commands/Compile.js +4 -4
  64. package/source/class/qx/tool/cli/commands/Lint.js +30 -11
  65. package/source/class/qx/tool/cli/commands/Package.js +1 -2
  66. package/source/class/qx/tool/cli/commands/package/Publish.js +33 -10
  67. package/source/class/qx/tool/compiler/Analyser.js +21 -22
  68. package/source/class/qx/tool/compiler/app/WebFont.js +1 -1
  69. package/source/class/qx/tool/compiler/makers/AppMaker.js +15 -14
  70. package/source/class/qx/tool/compiler/targets/Target.js +2 -1
  71. package/source/class/qx/tool/compiler/targets/TypeScriptWriter.js +1 -2
  72. package/source/class/qx/tool/compiler/targets/meta/PolyfillJs.js +17 -9
  73. package/source/class/qx/tool/config/Abstract.js +3 -3
  74. package/source/class/qx/tool/config/Utils.js +10 -1
  75. package/source/class/qx/tool/utils/Json.js +1 -1
  76. package/source/class/qx/ui/container/SlideBar.js +3 -0
  77. package/source/class/qx/ui/core/Widget.js +70 -0
  78. package/source/class/qx/ui/core/scroll/NativeScrollBar.js +3 -0
  79. package/source/class/qx/ui/core/scroll/ScrollBar.js +3 -0
  80. package/source/class/qx/ui/form/AbstractSelectBox.js +38 -6
  81. package/source/class/qx/ui/form/Button.js +3 -0
  82. package/source/class/qx/ui/form/CheckBox.js +25 -1
  83. package/source/class/qx/ui/form/ComboBox.js +41 -27
  84. package/source/class/qx/ui/form/DateField.js +16 -1
  85. package/source/class/qx/ui/form/List.js +3 -0
  86. package/source/class/qx/ui/form/MenuButton.js +28 -2
  87. package/source/class/qx/ui/form/RadioButton.js +7 -0
  88. package/source/class/qx/ui/form/RadioButtonGroup.js +3 -0
  89. package/source/class/qx/ui/form/RadioGroup.js +19 -0
  90. package/source/class/qx/ui/form/SelectBox.js +28 -1
  91. package/source/class/qx/ui/form/Slider.js +15 -0
  92. package/source/class/qx/ui/form/SplitButton.js +3 -0
  93. package/source/class/qx/ui/form/ToggleButton.js +8 -0
  94. package/source/class/qx/ui/menu/AbstractButton.js +28 -0
  95. package/source/class/qx/ui/menu/Button.js +3 -0
  96. package/source/class/qx/ui/menu/CheckBox.js +8 -0
  97. package/source/class/qx/ui/menu/Manager.js +2 -0
  98. package/source/class/qx/ui/menu/Menu.js +74 -2
  99. package/source/class/qx/ui/menu/RadioButton.js +10 -1
  100. package/source/class/qx/ui/menubar/Button.js +0 -27
  101. package/source/class/qx/ui/menubar/MenuBar.js +12 -0
  102. package/source/class/qx/ui/splitpane/Blocker.js +3 -0
  103. package/source/class/qx/ui/splitpane/Pane.js +3 -0
  104. package/source/class/qx/ui/table/Table.js +24 -2
  105. package/source/class/qx/ui/table/cellrenderer/Abstract.js +3 -1
  106. package/source/class/qx/ui/table/cellrenderer/AbstractImage.js +7 -3
  107. package/source/class/qx/ui/table/headerrenderer/HeaderCell.js +3 -0
  108. package/source/class/qx/ui/table/pane/Header.js +3 -0
  109. package/source/class/qx/ui/table/pane/Model.js +10 -4
  110. package/source/class/qx/ui/table/pane/Scroller.js +3 -7
  111. package/source/class/qx/ui/table/rowrenderer/Default.js +1 -1
  112. package/source/class/qx/ui/tabview/Page.js +26 -0
  113. package/source/class/qx/ui/tabview/TabView.js +3 -0
  114. package/source/class/qx/ui/toolbar/Button.js +2 -27
  115. package/source/class/qx/ui/toolbar/CheckBox.js +0 -27
  116. package/source/class/qx/ui/toolbar/RadioButton.js +21 -0
  117. package/source/class/qx/ui/toolbar/SplitButton.js +0 -28
  118. package/source/class/qx/ui/toolbar/ToolBar.js +3 -0
  119. package/source/class/qx/ui/window/Window.js +8 -0
  120. package/source/class/qx/util/format/DateFormat.js +44 -17
  121. package/source/class/qxWeb.js +2 -0
  122. package/source/resource/qx/decoration/Indigo/font/JosefinSlab-SemiBold.ttf +0 -0
  123. package/source/resource/qx/decoration/Indigo/font/SIL Open Font License 1.1.txt +0 -0
  124. package/source/resource/qx/iconfont/MaterialIcons/fetch-fonts.sh +0 -0
  125. package/source/resource/qx/tool/bin/build-devtools +0 -0
  126. package/source/resource/qx/tool/bin/build-website +0 -0
  127. package/source/resource/qx/tool/bin/download-assets +0 -0
  128. package/source/resource/qx/tool/cli/templates/loader/loader-node.tmpl.js +3 -1
  129. package/source/resource/qx/tool/cli/templates/template_vars.js +1 -1
  130. package/source/resource/qx/tool/loadsass.js +6 -12
  131. package/source/resource/qx/tool/schema/Manifest-1-0-0.json +1 -2
  132. package/source/resource/qx/tool/schema/Manifest-2-0-0.json +1 -2
  133. package/source/resource/qx/tool/schema/compile-1-0-0.json +3 -7
  134. package/source/translation/hr.po +297 -0
  135. package/lib/resource/qx/tool/website/.gitignore +0 -2
  136. package/source/class/qx/io/request/auth/.gitignore +0 -0
  137. package/source/class/qx/test/bom/client/.gitignore +0 -0
  138. package/source/class/qx/test/ui/control/.gitignore +0 -0
  139. package/source/resource/qx/decoration/Modern/treevirtual/.gitignore +0 -0
  140. package/source/resource/qx/mobile/css/.gitignore +0 -3
  141. package/source/resource/qx/tool/website/.gitignore +0 -2
  142. package/source/resource/qx/website/.gitignore +0 -1
  143. package/source/resource/qx/website/scss/.gitignore +0 -1
@@ -0,0 +1,38 @@
1
+ /* ************************************************************************
2
+
3
+ qooxdoo - the new era of web development
4
+
5
+ http://qooxdoo.org
6
+
7
+ Copyright:
8
+ 2020 Christian Boulanger
9
+
10
+ License:
11
+ MIT: https://opensource.org/licenses/MIT
12
+ See the LICENSE file in the project's top-level directory for details.
13
+
14
+ Authors:
15
+ * Christian Boulanger (cboulanger)
16
+
17
+ ************************************************************************ */
18
+
19
+ /**
20
+ * A generic class for representing exceptions that occur during io operations.
21
+ */
22
+ qx.Class.define("qx.io.exception.Exception",
23
+ {
24
+ extend : qx.type.BaseError,
25
+
26
+ /**
27
+ * Constructor
28
+ * @param message {String}
29
+ * @param code {Number}
30
+ * @param data {*|null}
31
+ */
32
+ construct: function(message, code, data) {
33
+ this.base(arguments, "", message);
34
+ this.code = code;
35
+ this.data = data;
36
+ this.name = this.classname;
37
+ }
38
+ });
@@ -4,17 +4,23 @@
4
4
 
5
5
  http://qooxdoo.org
6
6
 
7
+ Copyright:
8
+ 2020 Christian Boulanger
9
+
7
10
  License:
8
11
  MIT: https://opensource.org/licenses/MIT
9
12
  See the LICENSE file in the project's top-level directory for details.
10
13
 
14
+ Authors:
15
+ * Christian Boulanger (cboulanger)
16
+
11
17
  ************************************************************************ */
18
+
12
19
  /**
13
- * NOTE: This is automatically generated by bootstrap-compiler.js
14
- */
15
- qx.Class.define("qx.tool.compiler.Version", {
16
- extend: qx.core.Object,
17
- statics: {
18
- VERSION: "7.0.0-beta.2"
19
- }
20
+ * A class for representing errors that occurred on server and are handled
21
+ * according to the service protocol (JSON-RPC, GraphQL, etc.)
22
+ */
23
+ qx.Class.define("qx.io.exception.Protocol",
24
+ {
25
+ extend : qx.io.exception.Exception
20
26
  });
@@ -0,0 +1,39 @@
1
+ /* ************************************************************************
2
+
3
+ qooxdoo - the new era of web development
4
+
5
+ http://qooxdoo.org
6
+
7
+ Copyright:
8
+ 2020 Christian Boulanger
9
+
10
+ License:
11
+ MIT: https://opensource.org/licenses/MIT
12
+ See the LICENSE file in the project's top-level directory for details.
13
+
14
+ Authors:
15
+ * Christian Boulanger (cboulanger)
16
+
17
+ ************************************************************************ */
18
+
19
+ /**
20
+ * A class for representing errors that occurred during the request transport.
21
+ * In the context of HTTP requests, the error code is the HTTP error code.
22
+ */
23
+ qx.Class.define("qx.io.exception.Transport",
24
+ {
25
+ extend : qx.io.exception.Exception,
26
+ statics: {
27
+ TIMEOUT : 1,
28
+ ABORTED : 2,
29
+ NO_DATA : 3,
30
+ INVALID_MSG_DATA : 4,
31
+ CANCELLED : 5,
32
+ INVALID_URI : 6,
33
+ FAILED : 7,
34
+ INVALID_ID : 8, // JSON-RPC
35
+ INVALID_JSON : 9, // JSON-RPC
36
+ DUPLICATE_ID : 10, // JSON-RPC
37
+ UNKNOWN_ID : 11 // JSON-RPC
38
+ }
39
+ });
@@ -0,0 +1,4 @@
1
+ /**
2
+ * This namespace contains exceptions that can be used by the various
3
+ * communication protocols in the `qx.io` namespace
4
+ */
@@ -0,0 +1,112 @@
1
+ /* ************************************************************************
2
+
3
+ qooxdoo - the new era of web development
4
+
5
+ http://qooxdoo.org
6
+
7
+ Copyright:
8
+ 2020 Christian Boulanger
9
+
10
+ License:
11
+ MIT: https://opensource.org/licenses/MIT
12
+ See the LICENSE file in the project's top-level directory for details.
13
+
14
+ Authors:
15
+ * Christian Boulanger (cboulanger)
16
+
17
+ ************************************************************************ */
18
+
19
+ /**
20
+ * This class provides a simple GraphQl client (https://graphql.org/).
21
+ * For transport, it is based on internally on the fetch API
22
+ * (https://developer.mozilla.org/en-US/docs/Web/API/WindowOrWorkerGlobalScope/fetch)
23
+ * which, if needed, must be directly configured via the `init` parameter of the
24
+ * constructor, until a more generalized qx.io API has been developed.
25
+ * @experimental The API might change. Feedback is appreciated.
26
+ */
27
+ qx.Class.define("qx.io.graphql.Client", {
28
+
29
+ extend: qx.io.transport.AbstractClient,
30
+
31
+ statics: {
32
+ registerTransport : qx.io.transport.AbstractClient.registerTransport
33
+ },
34
+
35
+ events: {
36
+ /**
37
+ * Event fired when a request results in an error. Event data is an instance of
38
+ * {@link qx.io.exception.Transport}, {@link qx.io.exception.Protocol},
39
+ * or {@link qx.io.exception.Cancel}.
40
+ */
41
+ "error" : "qx.event.type.Data"
42
+ },
43
+
44
+ /**
45
+ * @param {qx.io.transport.ITransport|String} transportOrUri
46
+ * Transport object, which must implement {@link qx.io.transport.ITransport}
47
+ * or a string URI, which will trigger auto-detection of transport, as long as an
48
+ * appropriate transport has been registered with the static `registerTransport()` function.
49
+ */
50
+ construct: function (transportOrUri) {
51
+ this.base(arguments);
52
+ this.selectTransport(transportOrUri);
53
+ },
54
+
55
+ members: {
56
+
57
+ /**
58
+ * Send the given GraphQl query. See https://graphql.org/learn/queries/
59
+ *
60
+ * @param {qx.io.graphql.protocol.Request} request The GraphQl request object.
61
+ * @return {qx.Promise} Promise that resolves with the data
62
+ */
63
+ async send(request) {
64
+ let transport = this.getTransport();
65
+ return new qx.Promise((resolve, reject) => {
66
+ transport.addListenerOnce("message", evt => {
67
+ try{
68
+ if (qx.core.Environment.get("qx.io.graphql.debug")) {
69
+ this.debug( "<<< Received: " + evt.getData());
70
+ }
71
+ let responseData = qx.lang.Json.parse(evt.getData());
72
+ let graphQlResponse = new qx.io.graphql.protocol.Response(responseData);
73
+ if (graphQlResponse.getErrors()) {
74
+ return reject(this._handleErrors(graphQlResponse));
75
+ }
76
+ return resolve(graphQlResponse.getData());
77
+ } catch (e) {
78
+ this.error(e);
79
+ return reject(new qx.io.exception.Transport(e.message));
80
+ }
81
+ });
82
+ if (qx.core.Environment.get("qx.io.graphql.debug")) {
83
+ this.debug(">>>> Sending " + request.toString());
84
+ }
85
+ transport.send(request.toString()).catch(reject);
86
+ });
87
+ },
88
+
89
+ /**
90
+ * Handle the errors reported by the GraphQL endpoint. The response
91
+ * can contain several errors, but we can only throw one of them.
92
+ * However, we can fire an event for each error, which might be useful
93
+ * if they are to be logged. The errors that are thrown or fired as
94
+ * event data contain the original response object in the `data` property
95
+ *
96
+ * @param {qx.io.graphql.protocol.Response} response The response object
97
+ * @return {qx.io.exception.Protocol}
98
+ */
99
+ _handleErrors(response) {
100
+ let errors = response.getErrors();
101
+ errors.forEach(error => {
102
+ let exception = new qx.io.exception.Protocol(error.message, null, response.toObject());
103
+ this.fireDataEvent("error", exception);
104
+ });
105
+ return new qx.io.exception.Protocol(errors[0].message, null, response.toObject());
106
+ }
107
+ },
108
+
109
+ environment: {
110
+ "qx.io.graphql.debug" : false
111
+ }
112
+ });
@@ -0,0 +1,9 @@
1
+ /**
2
+ * This namespace provides a simple GraphQL client.
3
+ *
4
+ * Not implemented:
5
+ * - batched requests (https://www.apollographql.com/blog/batching-client-graphql-queries-a685f5bcd41b/)
6
+ * - subscriptions (http://spec.graphql.org/draft/#sec-Subscription)
7
+ *
8
+ * @experimental The API might change. Feedback is appreciated.
9
+ */
@@ -0,0 +1,65 @@
1
+ /* ************************************************************************
2
+
3
+ qooxdoo - the new era of web development
4
+
5
+ http://qooxdoo.org
6
+
7
+ Copyright:
8
+ 2020 Christian Boulanger
9
+
10
+ License:
11
+ MIT: https://opensource.org/licenses/MIT
12
+ See the LICENSE file in the project's top-level directory for details.
13
+
14
+ Authors:
15
+ * Christian Boulanger (cboulanger)
16
+
17
+ ************************************************************************ */
18
+
19
+ /**
20
+ * Abstract parent class for GraphQL messages and responses
21
+ * @experimental The API might change. Feedback is appreciated.
22
+ */
23
+ qx.Class.define("qx.io.graphql.protocol.Message", {
24
+ extend: qx.core.Object,
25
+
26
+ /**
27
+ * Constructor
28
+ * @param {Object} data
29
+ */
30
+ construct: function(data) {
31
+ this.base(arguments);
32
+ qx.core.Assert.assertObject(data);
33
+ this.set(data);
34
+ },
35
+
36
+ members : {
37
+ /**
38
+ * Return the message data in a spec-conformant native object
39
+ */
40
+ toNormalizedObject() {
41
+ let data = this.toObject();
42
+ if (!data.errors) {
43
+ delete data.errors;
44
+ }
45
+ return data;
46
+ },
47
+
48
+ /**
49
+ * Serialize to a spec-conformant JSON string
50
+ * @return {String}
51
+ */
52
+ toString() {
53
+ return qx.lang.Json.stringify(this.toNormalizedObject());
54
+ },
55
+
56
+ /**
57
+ * Serialize to a native javascript object. If you need a normalized object
58
+ * that conforms to the spec, use {@link #toNormalizedObject}
59
+ * @return {Object}
60
+ */
61
+ toObject() {
62
+ return qx.util.Serializer.toNativeObject(this);
63
+ }
64
+ }
65
+ });
@@ -0,0 +1,95 @@
1
+ /* ************************************************************************
2
+
3
+ qooxdoo - the new era of web development
4
+
5
+ http://qooxdoo.org
6
+
7
+ Copyright:
8
+ 2020 Christian Boulanger
9
+
10
+ License:
11
+ MIT: https://opensource.org/licenses/MIT
12
+ See the LICENSE file in the project's top-level directory for details.
13
+
14
+ Authors:
15
+ * Christian Boulanger (cboulanger)
16
+
17
+ ************************************************************************ */
18
+
19
+ /**
20
+ * An Object modelling a GraphQL request based on the GraphQL language
21
+ * (see http://spec.graphql.org/draft/#sec-Language) usually sent as JSON via
22
+ * a HTTP request (https://graphql.org/learn/serving-over-http)
23
+ * @experimental The API might change. Feedback is appreciated.
24
+ */
25
+ qx.Class.define("qx.io.graphql.protocol.Request",{
26
+ extend: qx.io.graphql.protocol.Message,
27
+ properties: {
28
+
29
+ /**
30
+ * An optional field that only needs to be provided if multiple operations are present in the query
31
+ */
32
+ operationName: {
33
+ check:"String",
34
+ nullable: true,
35
+ event: "changeOperationName"
36
+ },
37
+
38
+ /**
39
+ * The query as a string which will be parsed and executed on the server
40
+ */
41
+ query : {
42
+ check: "String",
43
+ nullable: false,
44
+ init: "",
45
+ event: "changeQuery"
46
+ },
47
+
48
+ /**
49
+ * A qooxdoo object that maps variable names to variable values
50
+ */
51
+ variables : {
52
+ check: "qx.core.Object",
53
+ nullable: true,
54
+ event: "changeVariables",
55
+ transform: "_transformVariables",
56
+ validate: "_validateVariables"
57
+ }
58
+ },
59
+
60
+ members: {
61
+ // overriden
62
+ toString() {
63
+ return qx.lang.Json.stringify(this.toObject(), this._jsonReplacer);
64
+ },
65
+
66
+ _jsonReplacer: function(key, value) {
67
+ if (key === "variables" || key === "operationName") {
68
+ return value !== null ? value : undefined;
69
+ }
70
+ // everything else is returned as it is
71
+ return value;
72
+ },
73
+
74
+
75
+ /**
76
+ * Transforms the variables object to a qooxdoo model. Called automaticaly
77
+ * when the variables property is set.
78
+ */
79
+ _transformVariables: function(val) {
80
+ let model = null;
81
+ if (![null, undefined].includes(val)) {
82
+ model = qx.data.marshal.Json.createModel(val);
83
+ }
84
+ return model;
85
+ },
86
+
87
+ _validateVariables: function(val) {
88
+ if (!qx.lang.Type.isObject(val) && (val !== null)) {
89
+ throw new qx.core.ValidationError(
90
+ "Validation Error: " + val + " is not an object or null."
91
+ );
92
+ }
93
+ }
94
+ }
95
+ });
@@ -0,0 +1,61 @@
1
+ /* ************************************************************************
2
+
3
+ qooxdoo - the new era of web development
4
+
5
+ http://qooxdoo.org
6
+
7
+ Copyright:
8
+ 2020 Christian Boulanger
9
+
10
+ License:
11
+ MIT: https://opensource.org/licenses/MIT
12
+ See the LICENSE file in the project's top-level directory for details.
13
+
14
+ Authors:
15
+ * Christian Boulanger (cboulanger)
16
+
17
+ ************************************************************************ */
18
+
19
+ /**
20
+ * An Object modelling a GraphQL response (see http://spec.graphql.org/draft/#sec-Response-Format)
21
+ * @experimental The API might change. Feedback is appreciated.
22
+ */
23
+ qx.Class.define("qx.io.graphql.protocol.Response",{
24
+ extend: qx.io.graphql.protocol.Message,
25
+
26
+ properties: {
27
+
28
+ /**
29
+ * "The data entry in the response will be the result of the execution
30
+ * of the requested operation. If the operation was a query, this
31
+ * output will be an object of the schema’s query root type; if the
32
+ * operation was a mutation, this output will be an object of the
33
+ * schema’s mutation root type. If an error was encountered before
34
+ * execution begins, the data entry should not be present in the result.
35
+ * If an error was encountered during the execution that prevented
36
+ * a valid response, the data entry in the response should be null"
37
+ */
38
+ data : {
39
+ check: "Object",
40
+ nullable: true,
41
+ init: null
42
+ },
43
+
44
+ /**
45
+ * "The errors entry in the response is a non‐empty list of errors,
46
+ * where each error is a map. If no errors were encountered during
47
+ * the requested operation, the errors entry should not be present in
48
+ * the result. If the data entry in the response is not present, the
49
+ * errors entry in the response must not be empty. It must contain
50
+ * at least one error. The errors it contains should indicate why no
51
+ * data was able to be returned. If the data entry in the response is
52
+ * present (including if it is the value null), the errors entry in the
53
+ * response may contain any errors that occurred during execution. If
54
+ * errors occurred during execution, it should contain those errors."
55
+ */
56
+ errors : {
57
+ check: value => qx.lang.Type.isArray(value) && value.length && value.every(item => Boolean(item.message)),
58
+ nullable: true
59
+ }
60
+ }
61
+ });
@@ -0,0 +1,6 @@
1
+ /**
2
+ * This namespace contains objects implementing message objects that model
3
+ * the GraphQL specification (http://spec.graphql.org/draft/)
4
+ *
5
+ * @experimental The API might change. Feedback is appreciated.
6
+ */