@bluedot-innovation/models 2.0.0-alpha1 → 2.0.0-beta.10
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/.eslintrc.js +6 -0
- package/.gitlab-ci.yml +43 -0
- package/.nyc_output/b3865a46e2cec635045d586cfc79e5c6.json +1 -0
- package/.nyc_output/d9020767349457a911ef2b431e357310.json +1 -0
- package/Models.js +48 -10
- package/README.MD +36 -0
- package/__tests__/account/account.data.json +12 -0
- package/__tests__/account/account.rules.js +8 -0
- package/__tests__/account/account.spec.js +83 -0
- package/__tests__/action/message/messageAction.data.json +5 -0
- package/__tests__/action/message/messageAction.rules.json +3 -0
- package/__tests__/action/message/messageAction.spec.js +61 -0
- package/__tests__/action/url/urlAction.data.json +4 -0
- package/__tests__/action/url/urlAction.rules.json +3 -0
- package/__tests__/action/url/urlAction.spec.js +74 -0
- package/__tests__/dailyStats/checkDailyStats.js +31 -0
- 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__/filter/bearing/bearingFilter.data.json +5 -0
- package/__tests__/filter/bearing/bearingFilter.rules.json +3 -0
- package/__tests__/filter/bearing/bearingFilter.spec.js +95 -0
- package/__tests__/filter/calendarDateRange/calendarDateRangeFilter.data.json +5 -0
- package/__tests__/filter/calendarDateRange/calendarDateRangeFilter.rules.json +3 -0
- package/__tests__/filter/calendarDateRange/calendarDateRangeFilter.spec.js +62 -0
- package/__tests__/filter/percentageCrossed/percentageCrossedFilter.data.json +5 -0
- package/__tests__/filter/percentageCrossed/percentageCrossedFilter.rules.json +3 -0
- package/__tests__/filter/percentageCrossed/percentageCrossedFilter.spec.js +62 -0
- package/__tests__/filter/speed/speedFilter.data.json +5 -0
- package/__tests__/filter/speed/speedFilter.rules.json +3 -0
- package/__tests__/filter/speed/speedFilter.spec.js +73 -0
- package/__tests__/filter/timeOfDayRange/timeOfDayRange.data.json +5 -0
- package/__tests__/filter/timeOfDayRange/timeOfDayRange.rules.json +3 -0
- package/__tests__/filter/timeOfDayRange/timeOfDayRange.spec.js +73 -0
- package/__tests__/geofeature/beacon/beacon.data.json +12 -0
- package/__tests__/geofeature/beacon/beacon.rules.json +13 -0
- package/__tests__/geofeature/beacon/beacon.spec.js +95 -0
- package/__tests__/geofeature/boundingBox/boundingBox.data.json +12 -0
- package/__tests__/geofeature/boundingBox/boundingBox.rules.json +3 -0
- package/__tests__/geofeature/boundingBox/boundingBox.spec.js +62 -0
- package/__tests__/geofeature/circle/circle.data.json +9 -0
- package/__tests__/geofeature/circle/circle.rules.json +3 -0
- package/__tests__/geofeature/circle/circle.spec.js +71 -0
- package/__tests__/geofeature/polygon/polygon.data.json +46 -0
- package/__tests__/geofeature/polygon/polygon.rules.json +3 -0
- package/__tests__/geofeature/polygon/polygon.spec.js +70 -0
- package/__tests__/geofeature/polyline/polyline.data.json +46 -0
- package/__tests__/geofeature/polyline/polyline.rules.json +3 -0
- package/__tests__/geofeature/polyline/polyline.spec.js +70 -0
- package/__tests__/monthlyStats/monthlyStats.data.json +29 -0
- package/__tests__/monthlyStats/monthlyStats.spec.js +68 -0
- package/__tests__/project/project.data.json +14 -0
- package/__tests__/project/project.rules.json +9 -0
- package/__tests__/project/project.spec.js +81 -0
- package/__tests__/ruleRequestAggregation/ruleRequestAggregation.data.json +8 -0
- package/__tests__/ruleRequestAggregation/ruleRequestAggregation.spec.js +69 -0
- package/__tests__/user/user.data.js +13 -0
- package/__tests__/user/user.rules.js +8 -0
- package/__tests__/user/user.spec.js +83 -0
- package/__tests__/zone/zone.action.spec.js +50 -0
- package/__tests__/zone/zone.data.json +156 -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 +107 -0
- package/helpers.js +14 -0
- package/models/Account.js +49 -0
- package/models/AdminPortalUser.js +10 -11
- package/models/Beacon.js +92 -78
- package/models/BeaconFilter.js +28 -12
- package/models/BearingFilter.js +46 -23
- package/models/BoundingBox.js +37 -20
- package/models/CalendarDateRangeFilter.js +34 -19
- package/models/Circle.js +34 -18
- package/models/Contract.js +37 -38
- package/models/CustomerLogin.js +9 -10
- package/models/DBEvent.js +13 -14
- package/models/DailyStats.js +28 -0
- package/models/DeviceRulesRequest.js +27 -28
- package/models/Fence.js +12 -13
- package/models/GeoFence.js +12 -14
- package/models/Geofeature.js +16 -18
- package/models/MessageAction.js +31 -16
- package/models/MonthlyStats.js +44 -0
- package/models/NotificationLogEntry.js +7 -8
- package/models/POILocation.js +6 -7
- package/models/POILookup.js +8 -9
- package/models/POIResult.js +7 -8
- package/models/PartnerCustomer.js +12 -13
- package/models/PartnerPasswordReset.js +8 -9
- package/models/PartnerUser.js +10 -11
- package/models/Partners.js +11 -12
- package/models/PercentageCrossedFilter.js +30 -15
- package/models/Polygon.js +35 -19
- package/models/Polyline.js +35 -19
- package/models/Project.js +54 -0
- package/models/RuleRequestAggregation.js +33 -15
- package/models/SimpleCheckInZone.js +21 -21
- package/models/SingleUseToken.js +7 -8
- package/models/SpeedFilter.js +39 -19
- package/models/TestDevice.js +11 -12
- package/models/TestDeviceCluster.js +9 -10
- package/models/TestInstance.js +9 -10
- package/models/TestScenario.js +9 -10
- package/models/TimeOfDayRange.js +16 -16
- package/models/TimeOfDayRangeFilter.js +36 -18
- package/models/UrlAction.js +54 -0
- package/models/User.js +59 -0
- package/models/Zone.js +85 -273
- package/models/ZoneUIState.js +18 -18
- package/package.json +20 -8
- package/schemas/Point.js +10 -13
- package/schemas/Webhook.js +22 -0
- package/yarn.lock +2796 -0
- package/__tests__/zone/checkActions.js +0 -64
- package/__tests__/zone/checkAppId.js +0 -41
- package/__tests__/zone/checkBeacon.js +0 -46
- package/__tests__/zone/checkBearingFitler.js +0 -48
- package/__tests__/zone/checkBoundingBox.js +0 -44
- package/__tests__/zone/checkCalendarDateRangeFilterFitler.js +0 -48
- package/__tests__/zone/checkCircle.js +0 -41
- package/__tests__/zone/checkMRT.js +0 -46
- package/__tests__/zone/checkPercentageCrossedFitler.js +0 -48
- package/__tests__/zone/checkPolygon.js +0 -78
- package/__tests__/zone/checkPolyline.js +0 -78
- package/__tests__/zone/checkSpeedFitler.js +0 -48
- package/__tests__/zone/checkTimeOfDayRangeFitler.js +0 -48
- package/models/AdminUser.js +0 -10
- package/models/Application.js +0 -38
- package/models/Customer.js +0 -38
- package/models/URLAction.js +0 -34
package/models/AdminUser.js
DELETED
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by Arun on 10/09/2014.
|
|
3
|
-
* Copyright : Bluedot Innovations.
|
|
4
|
-
* Owner :
|
|
5
|
-
*/
|
|
6
|
-
var mongoose = require('mongoose');
|
|
7
|
-
var AdminUser = mongoose.model('AdminUser', new mongoose.Schema({},
|
|
8
|
-
{ collection : 'AdminUser' }
|
|
9
|
-
));
|
|
10
|
-
module.exports = AdminUser;
|
package/models/Application.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by Arun on 10/09/2014.
|
|
3
|
-
* Copyright : Bluedot Innovations.
|
|
4
|
-
* Owner :
|
|
5
|
-
*/
|
|
6
|
-
var mongoose = require('mongoose');
|
|
7
|
-
var Enums = require('@bluedot-innovation/enums');
|
|
8
|
-
Schema = mongoose.Schema;
|
|
9
|
-
|
|
10
|
-
var ApplicationSchema = new mongoose.Schema({
|
|
11
|
-
_id : {type: String},
|
|
12
|
-
_class : {type: String, default:"au.com.bluedot.application.model.client.Application"},
|
|
13
|
-
state : {type: String, default : Enums.StateEnum.active, select: false},
|
|
14
|
-
nextRuleUpdateInterval: {type: Number, select: false},
|
|
15
|
-
nextRuleUpdateIntervalFormatted: {type:String, required: true},
|
|
16
|
-
lastUpdateTime: {type: Date, select: false},
|
|
17
|
-
creationTime: {type: Date, select: false},
|
|
18
|
-
"administrator" : {type: String, select: false},
|
|
19
|
-
enableDataAnonymisation: {type: Boolean, select: false},
|
|
20
|
-
apiKey: String,
|
|
21
|
-
dataSource: {type:String, select: false, default : 'openApi'},
|
|
22
|
-
name: {type: String},
|
|
23
|
-
packageName: {type: String},
|
|
24
|
-
customerId : String,
|
|
25
|
-
firebaseApiKey: String,
|
|
26
|
-
lastPushSync: Date,
|
|
27
|
-
webhook : {
|
|
28
|
-
url: String,
|
|
29
|
-
enabled: Boolean,
|
|
30
|
-
params: {}
|
|
31
|
-
},
|
|
32
|
-
configurationParameters:{type: Schema.Types.Mixed, default: null}
|
|
33
|
-
},
|
|
34
|
-
{ collection : 'application' }
|
|
35
|
-
);
|
|
36
|
-
var Application = mongoose.model('Application', ApplicationSchema);
|
|
37
|
-
|
|
38
|
-
module.exports = Application;
|
package/models/Customer.js
DELETED
|
@@ -1,38 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Created by Arun on 10/09/2014.
|
|
3
|
-
* Copyright : Bluedot Innovations.
|
|
4
|
-
* Owner :
|
|
5
|
-
*/
|
|
6
|
-
var mongoose = require('mongoose');
|
|
7
|
-
var StateEnum = require('@bluedot-innovation/enums').StateEnum;
|
|
8
|
-
|
|
9
|
-
var Customer = mongoose.model('Customer', new mongoose.Schema(
|
|
10
|
-
{
|
|
11
|
-
_id: String,
|
|
12
|
-
customerApiKey: String,
|
|
13
|
-
email: String,
|
|
14
|
-
password: String,
|
|
15
|
-
name: String,
|
|
16
|
-
userName: String,
|
|
17
|
-
state: {type:String, default: StateEnum.active},
|
|
18
|
-
"creationTime" : {type: Date, default: Date.now},
|
|
19
|
-
"lastUpdateTime" : {type: Date, default: Date.now},
|
|
20
|
-
"dataSource" : {type:String, select: false, default : 'openApi'},
|
|
21
|
-
integrations: Schema.Types.Mixed,
|
|
22
|
-
firstName: String,
|
|
23
|
-
lastName: String,
|
|
24
|
-
oldPassword: String,
|
|
25
|
-
organisationWebsite: String,
|
|
26
|
-
organisationName: String,
|
|
27
|
-
phoneNumber: String,
|
|
28
|
-
createdBy: String,
|
|
29
|
-
poiCredits: {type: Number, default: 0},
|
|
30
|
-
address: []
|
|
31
|
-
},
|
|
32
|
-
{
|
|
33
|
-
collection : 'customer'
|
|
34
|
-
}
|
|
35
|
-
)
|
|
36
|
-
);
|
|
37
|
-
|
|
38
|
-
module.exports = Customer;
|
package/models/URLAction.js
DELETED
|
@@ -1,34 +0,0 @@
|
|
|
1
|
-
let mongoose = require('mongoose');
|
|
2
|
-
let StateEnum = require('@bluedot-innovation/enums').StateEnum;
|
|
3
|
-
let uuidv1 = require('uuid/v1');
|
|
4
|
-
|
|
5
|
-
let URLActionSchema = new mongoose.Schema({
|
|
6
|
-
guid : { type: String, default: uuidv1 },
|
|
7
|
-
type : { type: String },
|
|
8
|
-
url : { type: String, required: [true, 'url is required. '],
|
|
9
|
-
validate : {
|
|
10
|
-
validator: validateURL
|
|
11
|
-
}
|
|
12
|
-
},
|
|
13
|
-
description : { type: String, default: '' },
|
|
14
|
-
creationTime : { type: Date, default: Date.now },
|
|
15
|
-
lastUpdateTime : { type: Date, default: Date.now },
|
|
16
|
-
state : { type: String, default : StateEnum.active, select: false }
|
|
17
|
-
},
|
|
18
|
-
{
|
|
19
|
-
_id: false,
|
|
20
|
-
__v: false
|
|
21
|
-
}
|
|
22
|
-
);
|
|
23
|
-
|
|
24
|
-
function validateURL(url){
|
|
25
|
-
let urlRegex = new RegExp("^(http[s]?:\\/\\/(www\\.)?|ftp:\\/\\/(www\\.)?|www\\.){1}([0-9A-Za-z-\\.@:%_\+~#=]+)+((\\.[a-zA-Z]{2,3})+)(/(.)*)?(\\?(.)*)?");
|
|
26
|
-
if(!urlRegex.test(url)) {
|
|
27
|
-
console.log(`{url} is not a valid URL. `);
|
|
28
|
-
throw new Error(url + " is not a valid URL. ");
|
|
29
|
-
}
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
let URLAction = mongoose.model('URLAction', URLActionSchema);
|
|
33
|
-
|
|
34
|
-
module.exports = URLAction;
|