@bluedot-innovation/models 2.0.0-alpha.5 → 2.0.0-alpha.7
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/.gitlab-ci.yml +4 -2
- package/.nyc_output/.gitkeep +0 -0
- package/README.MD +10 -6
- package/__tests__/filter/beacon/beaconFilter.data.json +1 -0
- package/__tests__/filter/beacon/beaconFilter.rules.json +3 -0
- package/__tests__/filter/beacon/beaconFilter.spec.js +1 -0
- package/__tests__/{zone → geofeature/beacon}/beacon.spec.js +3 -3
- package/__tests__/{zone → geofeature/boundingBox}/boundingBox.spec.js +3 -3
- package/__tests__/geofeature/circle/circle.data.json +9 -0
- package/__tests__/{zone → geofeature/circle}/circle.spec.js +15 -24
- package/__tests__/{zone → geofeature/polygon}/polygon.spec.js +3 -3
- package/__tests__/{zone → geofeature/polyline}/polyline.spec.js +3 -3
- package/__tests__/zone/zone.action.spec.js +50 -0
- package/__tests__/zone/zone.filter.spec.js +50 -0
- package/__tests__/zone/zone.geofeatures.spec.js +74 -0
- package/__tests__/zone/zone.spec.js +5 -8
- package/models/Beacon.js +9 -13
- package/models/BeaconFilter.js +25 -6
- package/models/BearingFilter.js +14 -7
- package/models/BoundingBox.js +14 -7
- package/models/CalendarDateRangeFilter.js +13 -7
- package/models/Circle.js +14 -7
- package/models/MessageAction.js +13 -7
- package/models/PercentageCrossedFilter.js +13 -7
- package/models/Polygon.js +13 -6
- package/models/Polyline.js +15 -6
- package/models/SpeedFilter.js +13 -6
- package/models/TimeOfDayRangeFilter.js +13 -6
- package/models/UrlAction.js +13 -7
- package/models/Zone.js +45 -160
- package/package.json +8 -5
- package/__tests__/zone/checkAppId.js +0 -39
- package/__tests__/zone/checkBeacon.js +0 -44
- package/__tests__/zone/checkMRT.js +0 -44
- package/__tests__/zone/data/zone-with-invalid-circle.json +0 -34
- /package/__tests__/{zone/data → geofeature/beacon}/beacon.data.json +0 -0
- /package/__tests__/{zone/rules → geofeature/beacon}/beacon.rules.json +0 -0
- /package/__tests__/{zone/data → geofeature/boundingBox}/boundingBox.data.json +0 -0
- /package/__tests__/{zone/rules → geofeature/boundingBox}/boundingBox.rules.json +0 -0
- /package/__tests__/{zone/rules → geofeature/circle}/circle.rules.json +0 -0
- /package/__tests__/{zone/data → geofeature/polygon}/polygon.data.json +0 -0
- /package/__tests__/{zone/rules → geofeature/polygon}/polygon.rules.json +0 -0
- /package/__tests__/{zone/data → geofeature/polyline}/polyline.data.json +0 -0
- /package/__tests__/{zone/rules → geofeature/polyline}/polyline.rules.json +0 -0
- /package/__tests__/zone/{data/zone.data.json → zone.data.json} +0 -0
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
let assert = require('assert');
|
|
2
|
-
let Zone = require('../../models/Zone');
|
|
3
|
-
|
|
4
|
-
let zone = {
|
|
5
|
-
"name": "TDD zone",
|
|
6
|
-
"minimumRetriggerTime": "60",
|
|
7
|
-
"checkout": true,
|
|
8
|
-
"applicationId": 'c7058934-f1e6-4176-8730-a0bd28e8e0a9',
|
|
9
|
-
"actions": [],
|
|
10
|
-
"geofeatures": [{
|
|
11
|
-
"type": "beacon",
|
|
12
|
-
"name": "create beacon",
|
|
13
|
-
"proximityUUID": "23a01af0-232a-4518-9c0e-323fb773f5ef",
|
|
14
|
-
"location": {
|
|
15
|
-
"latitude": -37.8159544565362,
|
|
16
|
-
"longitude": 144.9723565578461
|
|
17
|
-
},
|
|
18
|
-
"beaconType": "both",
|
|
19
|
-
"major": 12321,
|
|
20
|
-
"minor": 56466,
|
|
21
|
-
"txPower": -77,
|
|
22
|
-
"macAddress": "01:17:c5:31:84:19"
|
|
23
|
-
}]
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
describe('Creating Zone ', () => {
|
|
27
|
-
it('validate MRT', (done) => {
|
|
28
|
-
|
|
29
|
-
let createZone = new Zone(zone);
|
|
30
|
-
createZone.validate()
|
|
31
|
-
.then((output) => {
|
|
32
|
-
console.log("validate MRT");
|
|
33
|
-
assert(true);
|
|
34
|
-
done();
|
|
35
|
-
}).catch(err => {
|
|
36
|
-
console.log("Errors found:");
|
|
37
|
-
for( let key of Object.keys(err.errors) ) {
|
|
38
|
-
console.log(err.errors[key].message);
|
|
39
|
-
}
|
|
40
|
-
assert(false);
|
|
41
|
-
done(err);
|
|
42
|
-
});
|
|
43
|
-
});
|
|
44
|
-
});
|
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"name": "TDD zone",
|
|
3
|
-
"minimumRetriggerTime": "60",
|
|
4
|
-
"checkout": true,
|
|
5
|
-
"applicationId": "c7058934-f1e6-4176-8730-a0bd28e8e0a9",
|
|
6
|
-
"customData": [
|
|
7
|
-
{
|
|
8
|
-
"name1": "A Custom action1"
|
|
9
|
-
},
|
|
10
|
-
{
|
|
11
|
-
"name2": "A Custom action2"
|
|
12
|
-
}
|
|
13
|
-
],
|
|
14
|
-
"actions": [
|
|
15
|
-
{
|
|
16
|
-
"type": "message",
|
|
17
|
-
"message": "hello",
|
|
18
|
-
"title": "hello"
|
|
19
|
-
},
|
|
20
|
-
{
|
|
21
|
-
"type": "url",
|
|
22
|
-
"url": "https://www.google.com"
|
|
23
|
-
}
|
|
24
|
-
],
|
|
25
|
-
"geofeatures": [{
|
|
26
|
-
"type": "circle",
|
|
27
|
-
"name": "Test Circle",
|
|
28
|
-
|
|
29
|
-
"center": {
|
|
30
|
-
"latitude": -37.8159544565362,
|
|
31
|
-
"longitude": 144.9723565578461
|
|
32
|
-
}
|
|
33
|
-
}]
|
|
34
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|