@ndustrial/contxt-sdk 4.3.6 → 5.2.0
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/.gitattributes +1 -0
- package/CHANGELOG.md +8 -0
- package/CODEOWNERS +1 -0
- package/docs/Facilities.md +0 -144
- package/docs/FacilityGroupings.md +0 -160
- package/docs/Nionic.md +63 -0
- package/docs/README.md +3 -29
- package/docs/Typedefs.md +0 -101
- package/esm/config/audiences.js +13 -13
- package/esm/config/audiences.js.map +1 -1
- package/esm/index.js +4 -6
- package/esm/index.js.map +1 -1
- package/esm/nionic/index.js +126 -0
- package/esm/nionic/index.js.map +1 -0
- package/lib/config/audiences.js +13 -13
- package/lib/config/audiences.js.map +1 -1
- package/lib/index.js +10 -15
- package/lib/index.js.map +1 -1
- package/lib/nionic/index.js +130 -0
- package/lib/nionic/index.js.map +1 -0
- package/meta.yaml +11 -0
- package/package.json +9 -10
- package/src/bus/index.spec.js +3 -2
- package/src/bus/webSocketConnection.spec.js +31 -31
- package/src/config/audiences.js +13 -13
- package/src/config/index.spec.js +6 -6
- package/src/coordinator/applications.spec.js +8 -8
- package/src/coordinator/consent.spec.js +1 -1
- package/src/coordinator/edgeNodes.spec.js +3 -3
- package/src/coordinator/organizations.spec.js +4 -4
- package/src/coordinator/permissions.spec.js +4 -4
- package/src/coordinator/roles.spec.js +3 -3
- package/src/coordinator/users.spec.js +14 -15
- package/src/events/index.spec.js +16 -16
- package/src/files/index.spec.js +7 -7
- package/src/index.js +4 -6
- package/src/index.spec.js +8 -22
- package/src/iot/feeds.spec.js +4 -4
- package/src/iot/fieldCategories.spec.js +4 -4
- package/src/iot/fieldGroupings.spec.js +5 -5
- package/src/iot/outputs.spec.js +6 -6
- package/src/nionic/index.js +151 -0
- package/src/request.spec.js +3 -3
- package/src/sessionTypes/auth0WebAuth.spec.js +2 -2
- package/src/sessionTypes/index.spec.js +3 -3
- package/src/sessionTypes/machineAuth.spec.js +3 -3
- package/src/sessionTypes/passwordGrantAuth.spec.js +1 -1
- package/src/utils/iot/formatOutputFieldDataFromServer.spec.js +6 -6
- package/src/utils/iot/parseOutputFieldNextPageUrlMetadata.spec.js +2 -2
- package/src/utils/pagination/formatPaginatedDataFromServer.spec.js +2 -2
- package/src/utils/url/stringifyParams.spec.js +2 -3
- package/support/fixtures/factories/IOSDevice.js +3 -3
- package/support/fixtures/factories/applicationGrouping.js +4 -4
- package/support/fixtures/factories/applicationModule.js +2 -2
- package/support/fixtures/factories/asset.js +1 -1
- package/support/fixtures/factories/assetAttribute.js +2 -2
- package/support/fixtures/factories/assetAttributeValue.js +2 -2
- package/support/fixtures/factories/assetMetric.js +1 -1
- package/support/fixtures/factories/assetMetricValue.js +3 -3
- package/support/fixtures/factories/assetMetricValueCompact.js +2 -2
- package/support/fixtures/factories/assetType.js +1 -1
- package/support/fixtures/factories/authResults.js +3 -3
- package/support/fixtures/factories/channel.js +1 -1
- package/support/fixtures/factories/contxtApplication.js +5 -5
- package/support/fixtures/factories/contxtOrganization.js +2 -2
- package/support/fixtures/factories/contxtOrganizationFeaturedApplication.js +3 -3
- package/support/fixtures/factories/contxtProject.js +2 -2
- package/support/fixtures/factories/contxtProjectEnvironment.js +2 -2
- package/support/fixtures/factories/contxtRole.js +3 -3
- package/support/fixtures/factories/contxtRoleApplication.js +1 -1
- package/support/fixtures/factories/contxtRoleProjectEnvironment.js +1 -1
- package/support/fixtures/factories/contxtUser.js +2 -2
- package/support/fixtures/factories/contxtUserApplication.js +1 -1
- package/support/fixtures/factories/contxtUserFavoriteApplication.js +2 -2
- package/support/fixtures/factories/contxtUserPermissions.js +5 -5
- package/support/fixtures/factories/contxtUserProjectEnvironment.js +1 -1
- package/support/fixtures/factories/contxtUserRole.js +2 -2
- package/support/fixtures/factories/costCenter.js +2 -2
- package/support/fixtures/factories/costCenterFacility.js +3 -3
- package/support/fixtures/factories/edgeNode.js +1 -1
- package/support/fixtures/factories/event.js +5 -5
- package/support/fixtures/factories/eventType.js +4 -4
- package/support/fixtures/factories/eventUser.js +5 -5
- package/support/fixtures/factories/facility.js +4 -4
- package/support/fixtures/factories/facilityGrouping.js +3 -3
- package/support/fixtures/factories/facilityGroupingFacility.js +3 -3
- package/support/fixtures/factories/facilityInfo.js +2 -2
- package/support/fixtures/factories/facilityTag.js +1 -1
- package/support/fixtures/factories/feedStatus.js +1 -1
- package/support/fixtures/factories/feedType.js +1 -1
- package/support/fixtures/factories/feeds.js +5 -5
- package/support/fixtures/factories/fieldCategory.js +3 -3
- package/support/fixtures/factories/fieldGrouping.js +4 -4
- package/support/fixtures/factories/fieldGroupingField.js +3 -3
- package/support/fixtures/factories/fieldGroupingStatus.js +1 -1
- package/support/fixtures/factories/file.js +1 -1
- package/support/fixtures/factories/fileUploadInfo.js +1 -1
- package/support/fixtures/factories/organization.js +1 -1
- package/support/fixtures/factories/outputField.js +10 -10
- package/support/fixtures/factories/outputFieldData.js +1 -1
- package/support/fixtures/factories/owner.js +2 -2
- package/support/fixtures/factories/paginationMetadata.js +2 -2
- package/support/fixtures/factories/triggeredEvent.js +4 -4
- package/support/fixtures/factories/userEventSubscription.js +1 -1
- package/support/fixtures/factories/userMobileNumber.js +1 -1
- package/support/fixtures/factories/userPermissionsMap.js +2 -2
- package/.huskyrc.js +0 -11
- package/.nycrc +0 -12
- package/esm/assets/assetAttributes.js +0 -574
- package/esm/assets/assetAttributes.js.map +0 -1
- package/esm/assets/assetMetrics.js +0 -690
- package/esm/assets/assetMetrics.js.map +0 -1
- package/esm/assets/assetTypes.js +0 -273
- package/esm/assets/assetTypes.js.map +0 -1
- package/esm/assets/index.js +0 -283
- package/esm/assets/index.js.map +0 -1
- package/esm/facilities/costCenters.js +0 -306
- package/esm/facilities/costCenters.js.map +0 -1
- package/esm/facilities/groupings.js +0 -323
- package/esm/facilities/groupings.js.map +0 -1
- package/esm/facilities/index.js +0 -343
- package/esm/facilities/index.js.map +0 -1
- package/esm/health/index.js +0 -229
- package/esm/health/index.js.map +0 -1
- package/esm/utils/facilities/formatFacilityWithInfoFromServer.js +0 -65
- package/esm/utils/facilities/formatFacilityWithInfoFromServer.js.map +0 -1
- package/esm/utils/facilities/index.js +0 -4
- package/esm/utils/facilities/index.js.map +0 -1
- package/lib/assets/assetAttributes.js +0 -588
- package/lib/assets/assetAttributes.js.map +0 -1
- package/lib/assets/assetMetrics.js +0 -705
- package/lib/assets/assetMetrics.js.map +0 -1
- package/lib/assets/assetTypes.js +0 -287
- package/lib/assets/assetTypes.js.map +0 -1
- package/lib/assets/index.js +0 -302
- package/lib/assets/index.js.map +0 -1
- package/lib/facilities/costCenters.js +0 -316
- package/lib/facilities/costCenters.js.map +0 -1
- package/lib/facilities/groupings.js +0 -333
- package/lib/facilities/groupings.js.map +0 -1
- package/lib/facilities/index.js +0 -360
- package/lib/facilities/index.js.map +0 -1
- package/lib/health/index.js +0 -232
- package/lib/health/index.js.map +0 -1
- package/lib/utils/facilities/formatFacilityWithInfoFromServer.js +0 -71
- package/lib/utils/facilities/formatFacilityWithInfoFromServer.js.map +0 -1
- package/lib/utils/facilities/index.js +0 -15
- package/lib/utils/facilities/index.js.map +0 -1
- package/src/assets/assetAttributes.js +0 -619
- package/src/assets/assetAttributes.spec.js +0 -1143
- package/src/assets/assetMetrics.js +0 -736
- package/src/assets/assetMetrics.spec.js +0 -1180
- package/src/assets/assetTypes.js +0 -260
- package/src/assets/assetTypes.spec.js +0 -556
- package/src/assets/index.js +0 -271
- package/src/assets/index.spec.js +0 -515
- package/src/facilities/costCenters.js +0 -295
- package/src/facilities/costCenters.spec.js +0 -529
- package/src/facilities/groupings.js +0 -320
- package/src/facilities/groupings.spec.js +0 -567
- package/src/facilities/index.js +0 -343
- package/src/facilities/index.spec.js +0 -551
- package/src/health/index.js +0 -200
- package/src/health/index.spec.js +0 -501
- package/src/utils/facilities/formatFacilityWithInfoFromServer.js +0 -62
- package/src/utils/facilities/formatFacilityWithInfoFromServer.spec.js +0 -73
- package/src/utils/facilities/index.js +0 -3
|
@@ -9,7 +9,7 @@ factory
|
|
|
9
9
|
.attrs({
|
|
10
10
|
applicationId: () => factory.build('contxtApplication').id,
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
|
-
id: () => faker.
|
|
12
|
+
id: () => faker.datatype.uuid(),
|
|
13
13
|
updatedAt: () => faker.date.recent().toISOString(),
|
|
14
14
|
userId: () => factory.build('contxtUser').id
|
|
15
15
|
})
|
|
@@ -7,9 +7,9 @@ factory
|
|
|
7
7
|
.define('contxtUserFavoriteApplication')
|
|
8
8
|
.option('fromServer', false)
|
|
9
9
|
.attrs({
|
|
10
|
-
applicationId: () => faker.
|
|
10
|
+
applicationId: () => faker.datatype.number(),
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
|
-
id: () => faker.
|
|
12
|
+
id: () => faker.datatype.uuid(),
|
|
13
13
|
updatedAt: () => faker.date.recent().toISOString(),
|
|
14
14
|
userId: () => `auth0|${faker.internet.password()}`
|
|
15
15
|
})
|
|
@@ -12,29 +12,29 @@ factory
|
|
|
12
12
|
factory
|
|
13
13
|
.buildList(
|
|
14
14
|
'contxtApplication',
|
|
15
|
-
faker.
|
|
15
|
+
faker.datatype.number({ min: 0, max: 15 })
|
|
16
16
|
)
|
|
17
17
|
.map(({ id }) => ({ id })),
|
|
18
18
|
applicationsImplicit: () =>
|
|
19
19
|
factory
|
|
20
20
|
.buildList(
|
|
21
21
|
'contxtApplication',
|
|
22
|
-
faker.
|
|
22
|
+
faker.datatype.number({ min: 0, max: 15 })
|
|
23
23
|
)
|
|
24
24
|
.map(({ id }) => ({ id })),
|
|
25
25
|
roles: () =>
|
|
26
26
|
factory
|
|
27
|
-
.buildList('contxtRole', faker.
|
|
27
|
+
.buildList('contxtRole', faker.datatype.number({ min: 0, max: 15 }))
|
|
28
28
|
.map(({ id }) => ({ id })),
|
|
29
29
|
projectsExplicit: () =>
|
|
30
|
-
times(faker.
|
|
30
|
+
times(faker.datatype.number({ min: 0, max: 15 }), () => {
|
|
31
31
|
return {
|
|
32
32
|
id: factory.build('contxtProject').id,
|
|
33
33
|
accessType: factory.build('contxtUserProjectEnvironment').accessType
|
|
34
34
|
};
|
|
35
35
|
}),
|
|
36
36
|
projectsImplicit: () =>
|
|
37
|
-
times(faker.
|
|
37
|
+
times(faker.datatype.number({ min: 0, max: 15 }), () => {
|
|
38
38
|
return {
|
|
39
39
|
id: factory.build('contxtProject').id,
|
|
40
40
|
accessType: factory.build('contxtUserProjectEnvironment').accessType
|
|
@@ -9,7 +9,7 @@ factory
|
|
|
9
9
|
.attrs({
|
|
10
10
|
accessType: () => faker.random.arrayElement(['reader', 'admin']),
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
|
-
id: () => faker.
|
|
12
|
+
id: () => faker.datatype.uuid(),
|
|
13
13
|
projectEnvironmentId: () => factory.build('contxtProjectEnvironment').id,
|
|
14
14
|
updatedAt: () => faker.date.recent().toISOString(),
|
|
15
15
|
userId: () => factory.build('contxtUser').id
|
|
@@ -8,8 +8,8 @@ factory
|
|
|
8
8
|
.option('fromServer', false)
|
|
9
9
|
.attrs({
|
|
10
10
|
createdAt: () => faker.date.past().toISOString(),
|
|
11
|
-
id: () => faker.
|
|
12
|
-
mappedFromExternalGroup: () => faker.
|
|
11
|
+
id: () => faker.datatype.uuid(),
|
|
12
|
+
mappedFromExternalGroup: () => faker.datatype.boolean(),
|
|
13
13
|
roleId: () => factory.build('contxtRole').id,
|
|
14
14
|
updatedAt: () => faker.date.recent().toISOString(),
|
|
15
15
|
userId: () => factory.build('contxtUser').id
|
|
@@ -10,14 +10,14 @@ factory
|
|
|
10
10
|
.attrs({
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
12
|
description: () => faker.hacker.phrase(),
|
|
13
|
-
id: () => faker.
|
|
13
|
+
id: () => faker.datatype.uuid(),
|
|
14
14
|
name: () => faker.commerce.productName(),
|
|
15
15
|
organizationId: () => factory.build('organization').id,
|
|
16
16
|
updatedAt: () => faker.date.recent().toISOString()
|
|
17
17
|
})
|
|
18
18
|
.attr('facilities', ['id', 'fromServer'], (id, fromServer) => {
|
|
19
19
|
return times(
|
|
20
|
-
faker.
|
|
20
|
+
faker.datatype.number({
|
|
21
21
|
min: 0,
|
|
22
22
|
max: 5
|
|
23
23
|
}),
|
|
@@ -7,9 +7,9 @@ factory
|
|
|
7
7
|
.define('costCenterFacility')
|
|
8
8
|
.option('fromServer', false)
|
|
9
9
|
.attrs({
|
|
10
|
-
costCenterId: () => faker.
|
|
11
|
-
facilityId: () => faker.
|
|
12
|
-
id: () => faker.
|
|
10
|
+
costCenterId: () => faker.datatype.uuid(),
|
|
11
|
+
facilityId: () => faker.datatype.number(),
|
|
12
|
+
id: () => faker.datatype.uuid()
|
|
13
13
|
})
|
|
14
14
|
.after((costCenterFacility, options) => {
|
|
15
15
|
// If building a cost center facility object that comes from the server, transform it to
|
|
@@ -10,7 +10,7 @@ factory
|
|
|
10
10
|
clientId: () => faker.internet.password(),
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
12
|
description: () => faker.lorem.sentence(),
|
|
13
|
-
id: () => faker.
|
|
13
|
+
id: () => faker.datatype.uuid(),
|
|
14
14
|
name: () => faker.commerce.productMaterial(),
|
|
15
15
|
organizationId: () => factory.build('organization').id,
|
|
16
16
|
updatedAt: () => faker.date.recent().toISOString()
|
|
@@ -7,15 +7,15 @@ factory
|
|
|
7
7
|
.define('event')
|
|
8
8
|
.option('fromServer', false)
|
|
9
9
|
.attrs({
|
|
10
|
-
allowOthersToTrigger: () => faker.
|
|
10
|
+
allowOthersToTrigger: () => faker.datatype.boolean(),
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
12
|
deletedAt: () => faker.date.recent().toISOString(),
|
|
13
|
-
facilityId: () => faker.
|
|
14
|
-
id: () => faker.
|
|
15
|
-
isPublic: () => faker.
|
|
13
|
+
facilityId: () => faker.datatype.number(),
|
|
14
|
+
id: () => faker.datatype.uuid(),
|
|
15
|
+
isPublic: () => faker.datatype.boolean(),
|
|
16
16
|
name: () => faker.company.companyName(),
|
|
17
17
|
organizationId: () => factory.build('organization').id,
|
|
18
|
-
topicArn: () => faker.
|
|
18
|
+
topicArn: () => faker.datatype.uuid(),
|
|
19
19
|
updatedAt: () => faker.date.recent().toISOString()
|
|
20
20
|
})
|
|
21
21
|
.attr('eventType', ['fromServer'], (fromServer) => {
|
|
@@ -10,10 +10,10 @@ factory
|
|
|
10
10
|
clientId: () => faker.internet.password(),
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
12
|
description: () => faker.hacker.phrase(),
|
|
13
|
-
id: () => faker.
|
|
14
|
-
isOngoingEvent: () => faker.
|
|
15
|
-
isRealtimeEnabled: () => faker.
|
|
16
|
-
level: () => faker.
|
|
13
|
+
id: () => faker.datatype.uuid(),
|
|
14
|
+
isOngoingEvent: () => faker.datatype.boolean(),
|
|
15
|
+
isRealtimeEnabled: () => faker.datatype.boolean(),
|
|
16
|
+
level: () => faker.datatype.number(),
|
|
17
17
|
name: () => faker.company.companyName(),
|
|
18
18
|
slug: () => faker.lorem.slug(),
|
|
19
19
|
updatedAt: () => faker.date.recent().toISOString()
|
|
@@ -11,15 +11,15 @@ factory
|
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
12
|
email: () => faker.internet.email(),
|
|
13
13
|
firstName: () => faker.name.firstName(),
|
|
14
|
-
id: () => `auth0|${faker.
|
|
15
|
-
isMachineUser: () => faker.
|
|
14
|
+
id: () => `auth0|${faker.datatype.number()}`,
|
|
15
|
+
isMachineUser: () => faker.datatype.boolean(),
|
|
16
16
|
lastName: () => faker.name.lastName(),
|
|
17
17
|
userMobileNumbers: () => [],
|
|
18
18
|
updatedAt: () => faker.date.recent().toISOString()
|
|
19
19
|
})
|
|
20
20
|
.attr('IOSDevice', ['id', 'fromServer'], (id, fromServer) => {
|
|
21
21
|
return times(
|
|
22
|
-
faker.
|
|
22
|
+
faker.datatype.number({
|
|
23
23
|
min: 0,
|
|
24
24
|
max: 5
|
|
25
25
|
}),
|
|
@@ -38,7 +38,7 @@ factory
|
|
|
38
38
|
})
|
|
39
39
|
.attr('userEventSubscription', ['id', 'fromServer'], (id, fromServer) => {
|
|
40
40
|
return times(
|
|
41
|
-
faker.
|
|
41
|
+
faker.datatype.number({
|
|
42
42
|
min: 0,
|
|
43
43
|
max: 5
|
|
44
44
|
}),
|
|
@@ -60,7 +60,7 @@ factory
|
|
|
60
60
|
['id', 'firstName', 'lastName', 'fromServer'],
|
|
61
61
|
(id, firstName, lastName, fromServer) => {
|
|
62
62
|
return times(
|
|
63
|
-
faker.
|
|
63
|
+
faker.datatype.number({
|
|
64
64
|
min: 0,
|
|
65
65
|
max: 5
|
|
66
66
|
}),
|
|
@@ -11,10 +11,10 @@ factory
|
|
|
11
11
|
.attrs({
|
|
12
12
|
address1: () => faker.address.streetAddress(),
|
|
13
13
|
address2: () => faker.address.secondaryAddress(),
|
|
14
|
-
assetId: () => faker.
|
|
14
|
+
assetId: () => faker.datatype.uuid(),
|
|
15
15
|
city: () => faker.address.city(),
|
|
16
16
|
createdAt: () => faker.date.past().toISOString(),
|
|
17
|
-
geometryId: () => faker.
|
|
17
|
+
geometryId: () => faker.datatype.uuid(),
|
|
18
18
|
info: () => factory.build('facilityInfo'),
|
|
19
19
|
state: () => faker.address.state(),
|
|
20
20
|
timezone: () => {
|
|
@@ -30,7 +30,7 @@ factory
|
|
|
30
30
|
})
|
|
31
31
|
.attr('facilityGroupings', ['id', 'fromServer'], (id, fromServer) => {
|
|
32
32
|
return times(
|
|
33
|
-
faker.
|
|
33
|
+
faker.datatype.number({
|
|
34
34
|
min: 0,
|
|
35
35
|
max: 5
|
|
36
36
|
}),
|
|
@@ -56,7 +56,7 @@ factory
|
|
|
56
56
|
.attr('organizationId', ['organization'], (organization) => organization.id)
|
|
57
57
|
.attr('tags', ['id', 'fromServer'], (id, fromServer) => {
|
|
58
58
|
return times(
|
|
59
|
-
faker.
|
|
59
|
+
faker.datatype.number({
|
|
60
60
|
min: 0,
|
|
61
61
|
max: 5
|
|
62
62
|
}),
|
|
@@ -9,12 +9,12 @@ factory
|
|
|
9
9
|
.attrs({
|
|
10
10
|
createdAt: () => faker.date.past().toISOString(),
|
|
11
11
|
description: () => faker.hacker.phrase(),
|
|
12
|
-
id: () => faker.
|
|
13
|
-
isPrivate: () => faker.
|
|
12
|
+
id: () => faker.datatype.uuid(),
|
|
13
|
+
isPrivate: () => faker.datatype.boolean(),
|
|
14
14
|
name: () => faker.commerce.productName(),
|
|
15
15
|
organizationId: () => factory.build('organization').id,
|
|
16
16
|
ownerId: () => faker.internet.userName(),
|
|
17
|
-
parentGroupingId: () => faker.
|
|
17
|
+
parentGroupingId: () => faker.datatype.uuid(),
|
|
18
18
|
updatedAt: () => faker.date.recent().toISOString()
|
|
19
19
|
})
|
|
20
20
|
.after((facilityGrouping, options) => {
|
|
@@ -8,9 +8,9 @@ factory
|
|
|
8
8
|
.option('fromServer', false)
|
|
9
9
|
.attrs({
|
|
10
10
|
createdAt: () => faker.date.past().toISOString(),
|
|
11
|
-
facilityGroupingId: () => faker.
|
|
12
|
-
facilityId: () => faker.
|
|
13
|
-
id: () => faker.
|
|
11
|
+
facilityGroupingId: () => faker.datatype.uuid(),
|
|
12
|
+
facilityId: () => faker.datatype.number(),
|
|
13
|
+
id: () => faker.datatype.uuid(),
|
|
14
14
|
updatedAt: () => faker.date.recent().toISOString()
|
|
15
15
|
})
|
|
16
16
|
.after((facilityGroupingFacility, options) => {
|
|
@@ -7,6 +7,6 @@ factory.define('facilityInfo').attrs({
|
|
|
7
7
|
'General Manager': () => faker.name.findName(),
|
|
8
8
|
latitude: () => faker.address.latitude(),
|
|
9
9
|
longitude: () => faker.address.longitude(),
|
|
10
|
-
rail_access: () => `${faker.
|
|
11
|
-
square_feet: () => `${faker.
|
|
10
|
+
rail_access: () => `${faker.datatype.boolean()}`,
|
|
11
|
+
square_feet: () => `${faker.datatype.number()}`
|
|
12
12
|
});
|
|
@@ -9,7 +9,7 @@ factory
|
|
|
9
9
|
.sequence('id')
|
|
10
10
|
.attrs({
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
|
-
facilityId: () => faker.
|
|
12
|
+
facilityId: () => faker.datatype.number(),
|
|
13
13
|
name: () => faker.commerce.productMaterial(),
|
|
14
14
|
updatedAt: () => faker.date.recent().toISOString()
|
|
15
15
|
})
|
|
@@ -8,7 +8,7 @@ factory
|
|
|
8
8
|
.option('fromServer', false)
|
|
9
9
|
.sequence('id')
|
|
10
10
|
.attrs({
|
|
11
|
-
feedId: () => faker.
|
|
11
|
+
feedId: () => faker.datatype.number(),
|
|
12
12
|
feedStatusId: () => null,
|
|
13
13
|
status: () => faker.random.arrayElement(['Active', 'Degraded', 'Critical']),
|
|
14
14
|
updatedAt: () => faker.date.recent().toISOString()
|
|
@@ -9,7 +9,7 @@ factory
|
|
|
9
9
|
.sequence('id')
|
|
10
10
|
.attrs({
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
|
-
downAfter: () => faker.
|
|
12
|
+
downAfter: () => faker.datatype.number({ min: 1000, max: 9999 }),
|
|
13
13
|
troubleshootingUrl: () => faker.internet.url(),
|
|
14
14
|
type: () => faker.hacker.noun(),
|
|
15
15
|
updatedAt: () => faker.date.recent().toISOString()
|
|
@@ -9,17 +9,17 @@ factory
|
|
|
9
9
|
.sequence('id')
|
|
10
10
|
.attrs({
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
|
-
criticalThreshold: () => faker.
|
|
13
|
-
degradedThreshold: () => faker.
|
|
14
|
-
downAfter: () => faker.
|
|
12
|
+
criticalThreshold: () => faker.datatype.number({ min: 0, max: 5 }),
|
|
13
|
+
degradedThreshold: () => faker.datatype.number({ min: 0, max: 5 }),
|
|
14
|
+
downAfter: () => faker.datatype.number({ min: 1000, max: 9999 }),
|
|
15
15
|
facilityId: () => factory.build('facility').id,
|
|
16
16
|
feedTypeId: () => factory.build('feedType').id,
|
|
17
|
-
isPaused: () => faker.
|
|
17
|
+
isPaused: () => faker.datatype.boolean(),
|
|
18
18
|
key: () => faker.hacker.noun(),
|
|
19
19
|
ownerId: () => factory.build('owner').id,
|
|
20
20
|
routingKeys: () => `[${faker.hacker.noun()}]`,
|
|
21
21
|
status: () => faker.random.arrayElement(['Active', 'Degraded', 'Critical']),
|
|
22
|
-
statusEventId: () => faker.
|
|
22
|
+
statusEventId: () => faker.datatype.uuid(),
|
|
23
23
|
timezone: () => {
|
|
24
24
|
return faker.random.arrayElement([
|
|
25
25
|
'America/New_York',
|
|
@@ -9,10 +9,10 @@ factory
|
|
|
9
9
|
.attrs({
|
|
10
10
|
createdAt: () => faker.date.past().toISOString(),
|
|
11
11
|
description: () => faker.hacker.phrase(),
|
|
12
|
-
id: () => faker.
|
|
12
|
+
id: () => faker.datatype.uuid(),
|
|
13
13
|
name: () => faker.commerce.productName(),
|
|
14
|
-
organizationId: () => faker.
|
|
15
|
-
parentCategoryId: () => faker.
|
|
14
|
+
organizationId: () => faker.datatype.uuid(),
|
|
15
|
+
parentCategoryId: () => faker.datatype.uuid(),
|
|
16
16
|
updatedAt: () => faker.date.recent().toISOString()
|
|
17
17
|
})
|
|
18
18
|
.after((fieldCategory, options) => {
|
|
@@ -9,10 +9,10 @@ factory
|
|
|
9
9
|
.attrs({
|
|
10
10
|
createdAt: () => faker.date.past().toISOString(),
|
|
11
11
|
description: () => faker.hacker.phrase(),
|
|
12
|
-
fieldCategoryId: () => faker.
|
|
13
|
-
facilityId: () => faker.
|
|
14
|
-
id: () => faker.
|
|
15
|
-
isPublic: () => faker.
|
|
12
|
+
fieldCategoryId: () => faker.datatype.uuid(),
|
|
13
|
+
facilityId: () => faker.datatype.number(),
|
|
14
|
+
id: () => faker.datatype.uuid(),
|
|
15
|
+
isPublic: () => faker.datatype.boolean(),
|
|
16
16
|
label: () => faker.commerce.productName(),
|
|
17
17
|
ownerId: () => faker.internet.userName(),
|
|
18
18
|
slug: () => faker.lorem.slug(),
|
|
@@ -8,9 +8,9 @@ factory
|
|
|
8
8
|
.option('fromServer', false)
|
|
9
9
|
.attrs({
|
|
10
10
|
createdAt: () => faker.date.past().toISOString(),
|
|
11
|
-
fieldGroupingId: () => faker.
|
|
12
|
-
outputFieldId: () => faker.
|
|
13
|
-
id: () => faker.
|
|
11
|
+
fieldGroupingId: () => faker.datatype.uuid(),
|
|
12
|
+
outputFieldId: () => faker.datatype.number(),
|
|
13
|
+
id: () => faker.datatype.uuid(),
|
|
14
14
|
updatedAt: () => faker.date.recent().toISOString()
|
|
15
15
|
})
|
|
16
16
|
.after((fieldGroupingField, options) => {
|
|
@@ -7,7 +7,7 @@ factory
|
|
|
7
7
|
.define('fieldGroupingStatus')
|
|
8
8
|
.option('fromServer', false)
|
|
9
9
|
.attrs({
|
|
10
|
-
id: () => faker.
|
|
10
|
+
id: () => faker.datatype.uuid(),
|
|
11
11
|
label: () => faker.commerce.productName(),
|
|
12
12
|
status: () => faker.random.arrayElement(['Active', 'Out-of-Date']),
|
|
13
13
|
updatedAt: () => faker.date.recent().toISOString()
|
|
@@ -11,7 +11,7 @@ factory
|
|
|
11
11
|
contentType: () => faker.system.mimeType(),
|
|
12
12
|
description: () => faker.hacker.phrase(),
|
|
13
13
|
filename: () => faker.system.commonFileName(),
|
|
14
|
-
id: () => faker.
|
|
14
|
+
id: () => faker.datatype.uuid(),
|
|
15
15
|
organizationId: () => factory.build('organization').id,
|
|
16
16
|
status: () => faker.random.arrayElement(['ACTIVE', 'UPLOADING']),
|
|
17
17
|
updatedAt: () => faker.date.recent().toISOString()
|
|
@@ -9,7 +9,7 @@ factory
|
|
|
9
9
|
.option('fromServer', false)
|
|
10
10
|
.attrs({
|
|
11
11
|
headers: () =>
|
|
12
|
-
times(faker.
|
|
12
|
+
times(faker.datatype.number({ min: 1, max: 5 })).reduce((memo) => {
|
|
13
13
|
memo[faker.lorem.word()] = faker.hacker.phrase();
|
|
14
14
|
|
|
15
15
|
return memo;
|
|
@@ -7,7 +7,7 @@ factory
|
|
|
7
7
|
.define('organization')
|
|
8
8
|
.attrs({
|
|
9
9
|
createdAt: () => faker.date.past().toISOString(),
|
|
10
|
-
id: () => faker.
|
|
10
|
+
id: () => faker.datatype.uuid(),
|
|
11
11
|
name: () => faker.company.companyName(),
|
|
12
12
|
updatedAt: () => faker.date.recent().toISOString()
|
|
13
13
|
})
|
|
@@ -8,7 +8,7 @@ factory
|
|
|
8
8
|
.option('fromServer', false)
|
|
9
9
|
.sequence('id')
|
|
10
10
|
.attrs({
|
|
11
|
-
_sourceDescriptor: () => faker.
|
|
11
|
+
_sourceDescriptor: () => faker.datatype.number(),
|
|
12
12
|
_sourceType: () =>
|
|
13
13
|
faker.random.arrayElement([
|
|
14
14
|
'compressor',
|
|
@@ -24,15 +24,15 @@ factory
|
|
|
24
24
|
'outdoor_sump_pump',
|
|
25
25
|
'transfer_pump'
|
|
26
26
|
]),
|
|
27
|
-
canAggregate: () => faker.
|
|
28
|
-
divisor: () => faker.
|
|
27
|
+
canAggregate: () => faker.datatype.boolean(),
|
|
28
|
+
divisor: () => faker.datatype.number(),
|
|
29
29
|
fieldName: () => faker.random.arrayElement(['power', 'temperature']),
|
|
30
|
-
isDefault: () => faker.
|
|
31
|
-
isHidden: () => faker.
|
|
32
|
-
isTotalizer: () => faker.
|
|
33
|
-
isWindowed: () => faker.
|
|
34
|
-
outputId: () => faker.
|
|
35
|
-
scalar: () => faker.
|
|
30
|
+
isDefault: () => faker.datatype.boolean(),
|
|
31
|
+
isHidden: () => faker.datatype.boolean(),
|
|
32
|
+
isTotalizer: () => faker.datatype.boolean(),
|
|
33
|
+
isWindowed: () => faker.datatype.boolean(),
|
|
34
|
+
outputId: () => faker.datatype.number(),
|
|
35
|
+
scalar: () => faker.datatype.number(),
|
|
36
36
|
status: () => faker.random.arrayElement(['Active', 'Out-of-Date']),
|
|
37
37
|
valueType: () => faker.random.arrayElement(['boolean', 'numeric', 'string'])
|
|
38
38
|
})
|
|
@@ -51,7 +51,7 @@ factory
|
|
|
51
51
|
(descriptor, measurement, type) => {
|
|
52
52
|
const baseFieldDescriptor = `${type}_${descriptor}`;
|
|
53
53
|
|
|
54
|
-
return faker.
|
|
54
|
+
return faker.datatype.boolean()
|
|
55
55
|
? baseFieldDescriptor
|
|
56
56
|
: `${baseFieldDescriptor}.${measurement}`;
|
|
57
57
|
}
|
|
@@ -8,7 +8,7 @@ factory
|
|
|
8
8
|
.option('fromServer', false)
|
|
9
9
|
.attrs({
|
|
10
10
|
eventTime: () => faker.date.past(),
|
|
11
|
-
value: () => `${faker.
|
|
11
|
+
value: () => `${faker.datatype.number()}`
|
|
12
12
|
})
|
|
13
13
|
.after((outputFieldData, options) => {
|
|
14
14
|
// If building an output field data object that comes from the server,
|
|
@@ -10,8 +10,8 @@ factory
|
|
|
10
10
|
createdAt: () => faker.date.past().toISOString(),
|
|
11
11
|
email: () => faker.internet.email(),
|
|
12
12
|
firstName: () => faker.name.firstName(),
|
|
13
|
-
id: () => `auth0|${faker.
|
|
14
|
-
isMachineUser: () => faker.
|
|
13
|
+
id: () => `auth0|${faker.datatype.number()}`,
|
|
14
|
+
isMachineUser: () => faker.datatype.boolean(),
|
|
15
15
|
lastName: () => faker.name.lastName(),
|
|
16
16
|
updatedAt: () => faker.date.recent().toISOString()
|
|
17
17
|
})
|
|
@@ -4,6 +4,6 @@ const factory = require('rosie').Factory;
|
|
|
4
4
|
const faker = require('faker');
|
|
5
5
|
|
|
6
6
|
factory.define('paginationMetadata').attrs({
|
|
7
|
-
offset: () => faker.
|
|
8
|
-
totalRecords: () => faker.
|
|
7
|
+
offset: () => faker.datatype.number({ max: 100 }),
|
|
8
|
+
totalRecords: () => faker.datatype.number({ min: 1, max: 1000 })
|
|
9
9
|
});
|
|
@@ -10,10 +10,10 @@ factory
|
|
|
10
10
|
createdAt: () => faker.date.past().toISOString(),
|
|
11
11
|
data: () => faker.hacker.phrase(),
|
|
12
12
|
deletedAt: () => faker.date.recent().toISOString(),
|
|
13
|
-
eventId: () => faker.
|
|
14
|
-
id: () => faker.
|
|
15
|
-
isPublic: () => faker.
|
|
16
|
-
ownerId: () => faker.
|
|
13
|
+
eventId: () => faker.datatype.uuid(),
|
|
14
|
+
id: () => faker.datatype.uuid(),
|
|
15
|
+
isPublic: () => faker.datatype.boolean(),
|
|
16
|
+
ownerId: () => faker.datatype.uuid(),
|
|
17
17
|
triggerEndAt: () => faker.date.recent().toISOString(),
|
|
18
18
|
triggerStartAt: () => faker.date.recent().toISOString(),
|
|
19
19
|
updatedAt: () => faker.date.recent().toISOString()
|
|
@@ -10,7 +10,7 @@ factory
|
|
|
10
10
|
createdAt: () => faker.date.past().toISOString(),
|
|
11
11
|
endpointArn: () => null,
|
|
12
12
|
eventId: () => factory.build('event').id,
|
|
13
|
-
id: () => faker.
|
|
13
|
+
id: () => faker.datatype.uuid(),
|
|
14
14
|
mediumType: () => faker.random.arrayElement(['email', 'sms']),
|
|
15
15
|
updatedAt: () => faker.date.recent().toISOString(),
|
|
16
16
|
userId: () => factory.build('contxtUser').id
|
|
@@ -10,7 +10,7 @@ factory
|
|
|
10
10
|
.attrs({
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
12
|
name: () => faker.name.firstName(),
|
|
13
|
-
isActive: () => faker.
|
|
13
|
+
isActive: () => faker.datatype.boolean(),
|
|
14
14
|
phoneNumber: () => faker.phone.phoneNumber(),
|
|
15
15
|
updatedAt: () => faker.date.recent().toISOString(),
|
|
16
16
|
userId: () => factory.build('eventUser').id
|
|
@@ -6,10 +6,10 @@ const times = require('lodash.times');
|
|
|
6
6
|
|
|
7
7
|
factory.define('userPermissionsMap').after((userPermissionsMap) => {
|
|
8
8
|
const newPermissionsMap = times(
|
|
9
|
-
faker.
|
|
9
|
+
faker.datatype.number({ min: 1, max: 5 })
|
|
10
10
|
).reduce((memo) => {
|
|
11
11
|
memo[faker.internet.password()] = times(
|
|
12
|
-
faker.
|
|
12
|
+
faker.datatype.number({ min: 1, max: 5 })
|
|
13
13
|
).reduce((existingScopes) => {
|
|
14
14
|
const scopeLabel = `${faker.lorem.word()}_${faker.lorem.word()}`;
|
|
15
15
|
|
package/.huskyrc.js
DELETED