@live-change/framework 0.5.21 → 0.5.25
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/index.js +1 -0
- package/lib/definition/ServiceDefinition.js +5 -0
- package/lib/utils.js +9 -1
- package/package.json +3 -3
package/index.js
CHANGED
|
@@ -12,6 +12,7 @@ module.exports.app = () => {
|
|
|
12
12
|
module.exports.utils = require('./lib/utils.js')
|
|
13
13
|
module.exports.validation = require('./lib/utils/validation.js')
|
|
14
14
|
module.exports.rangeProperties = module.exports.utils.rangeProperties
|
|
15
|
+
module.exports.encodeIdentifier = module.exports.utils.encodeIdentifier
|
|
15
16
|
|
|
16
17
|
|
|
17
18
|
module.exports.ActionDefinition = require('./lib/definition/ActionDefinition.js')
|
|
@@ -85,6 +85,7 @@ class ServiceDefinition {
|
|
|
85
85
|
this.processors = []
|
|
86
86
|
this.authenticators = []
|
|
87
87
|
this.beforeStartCallbacks = []
|
|
88
|
+
this.endpoints = []
|
|
88
89
|
this.validators = defaultValidators
|
|
89
90
|
for(let key in definition) this[key] = definition[key]
|
|
90
91
|
}
|
|
@@ -149,6 +150,10 @@ class ServiceDefinition {
|
|
|
149
150
|
this.beforeStartCallbacks.push(callback)
|
|
150
151
|
}
|
|
151
152
|
|
|
153
|
+
endpoint(endpoint) {
|
|
154
|
+
this.endpoints.push(endpoint)
|
|
155
|
+
}
|
|
156
|
+
|
|
152
157
|
toJSON() {
|
|
153
158
|
let models = {}
|
|
154
159
|
for(let key in this.models) models[key] = this.models[key].toJSON()
|
package/lib/utils.js
CHANGED
|
@@ -246,8 +246,16 @@ function fieldListToFieldsObject(fieldList) {
|
|
|
246
246
|
return fields
|
|
247
247
|
}
|
|
248
248
|
|
|
249
|
+
function encodeIdentifier(parts) {
|
|
250
|
+
if(!Array.isArray(parts)) {
|
|
251
|
+
return parts
|
|
252
|
+
}
|
|
253
|
+
return parts.map(p => JSON.stringify(p)).join(':')
|
|
254
|
+
}
|
|
255
|
+
|
|
249
256
|
module.exports = {
|
|
250
257
|
typeName, toJSON, setDifference, mapDifference, crudChanges,
|
|
251
258
|
getProperty, setProperty, getField, setField, isObject, mergeDeep, generateDefault,
|
|
252
|
-
prefixRange, rangeProperties, fieldListToFieldsObject
|
|
259
|
+
prefixRange, rangeProperties, fieldListToFieldsObject,
|
|
260
|
+
encodeIdentifier
|
|
253
261
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@live-change/framework",
|
|
3
|
-
"version": "0.5.
|
|
3
|
+
"version": "0.5.25",
|
|
4
4
|
"description": "Live Change Framework - ultimate solution for real time mobile/web apps",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
},
|
|
22
22
|
"homepage": "https://github.com/live-change/live-change-framework",
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"@live-change/dao": "0.4.
|
|
24
|
+
"@live-change/dao": "0.4.2",
|
|
25
25
|
"@live-change/dao-websocket": "0.4.1",
|
|
26
26
|
"@live-change/db": "0.5.4",
|
|
27
27
|
"@live-change/db-store-level": "0.5.4",
|
|
@@ -35,5 +35,5 @@
|
|
|
35
35
|
"tape": "^5.3.2",
|
|
36
36
|
"websocket": "^1.0.34"
|
|
37
37
|
},
|
|
38
|
-
"gitHead": "
|
|
38
|
+
"gitHead": "014a45f0a666820dc25eb728be2fe92834cb89ee"
|
|
39
39
|
}
|