total5 0.0.4 → 0.0.5

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/builders.js CHANGED
@@ -1169,13 +1169,12 @@ exports.newaction = function(name, obj) {
1169
1169
  }
1170
1170
 
1171
1171
  var url = name;
1172
- var tmp = name.split('/').trim();
1173
- if (tmp.length)
1174
- obj.$url = url.replace(/\//g, '_').toLowerCase();
1175
1172
 
1176
1173
  if (F.actions[name])
1177
1174
  F.actions[name].remove();
1178
1175
 
1176
+ obj.$url = url;
1177
+
1179
1178
  F.actions[name] = obj;
1180
1179
  obj.id = name;
1181
1180
  obj.jsinput = obj.input ? F.TUtils.jsonschema(obj.input, true) : null;
package/changelog.txt CHANGED
@@ -1,3 +1,11 @@
1
+ ========================
2
+ 0.0.5
3
+ ========================
4
+
5
+ - added support for multiple events `ON('event1 + event2 + event3', function() {})`
6
+ - fixed parsing nested schema in inline JSON schemas
7
+ - added support for `|` characters in the routes API endpoints
8
+
1
9
  ========================
2
10
  0.0.4
3
11
  ========================
package/index.js CHANGED
@@ -36,7 +36,7 @@ global.DEF = {};
36
36
 
37
37
  F.id = '';
38
38
  F.clusterid = '';
39
- F.is5 = F.version = 5004;
39
+ F.is5 = F.version = 5005;
40
40
  F.isBundle = false;
41
41
  F.isLoaded = false;
42
42
  F.version_header = '5';
@@ -2785,10 +2785,14 @@ process.on('message', function(msg, h) {
2785
2785
 
2786
2786
  F.on2 = F.on;
2787
2787
  F.on = function(name, fn) {
2788
- if (name === 'ready' && F.isLoaded)
2789
- fn();
2790
- else
2791
- F.on2(name, fn);
2788
+ var arr = name.split('+');
2789
+ for (let e of arr) {
2790
+ e = e.trim();
2791
+ if (e === 'ready' && F.isLoaded)
2792
+ fn();
2793
+ else
2794
+ F.on2(e, fn);
2795
+ }
2792
2796
  };
2793
2797
 
2794
2798
  // Configuration
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "total5",
3
- "version": "0.0.4",
3
+ "version": "0.0.5",
4
4
  "description": "Total.js framework v5",
5
5
  "main": "index.js",
6
6
  "directories": {
package/routing.js CHANGED
@@ -178,7 +178,7 @@ function Route(url, action, size) {
178
178
  t.method = 'POST';
179
179
  isapi = true;
180
180
  t.id = t.id.replace(/^(\+|-)/, '');
181
- url = url.replace(/(\*|\+|-|%)?[a-z0-9-_/{}]+/i, function(text) {
181
+ url = url.replace(/(\*|\+|-|%)?[a-z0-9-_/|{}]+/i, function(text) {
182
182
  let tmp = text.trim();
183
183
  let c = tmp[0];
184
184
  endpoint = c === '%' || c === '+' || c === '*' || c === '-' ? tmp.substring(1) : tmp;
@@ -204,7 +204,7 @@ function Route(url, action, size) {
204
204
 
205
205
  if (index !== -1) {
206
206
  t.actions = [];
207
- url = url.substring(index + 3).replace(/(\+|-|%)?[a-z0-9-_/]+(\s\(response\))?/gi, function(text) {
207
+ url = url.substring(index + 3).replace(/(\+|-|%)?[a-z0-9-|_/]+(\s\(response\))?/gi, function(text) {
208
208
  t.actions.push(text.trim());
209
209
  return '';
210
210
  }).trim();
package/utils.js CHANGED
@@ -6010,7 +6010,7 @@ SP.toJSONSchema = SP.parseSchema = function(name, url) {
6010
6010
  tmp = nestedtypes[+tmp];
6011
6011
 
6012
6012
  // Nested schema
6013
- if (tmp.includes(':')) {
6013
+ if ((/[:,\s]/).test(tmp)) {
6014
6014
  nestedschema = tmp.toJSONSchema();
6015
6015
  type = 'object';
6016
6016
  } else {