@ndustrial/contxt-sdk 5.8.0 → 5.8.1
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/.nvmrc +1 -1
- package/esm/bus/channels.js +0 -1
- package/esm/bus/channels.js.map +1 -1
- package/esm/bus/index.js +0 -1
- package/esm/bus/index.js.map +1 -1
- package/esm/bus/webSocketConnection.js +46 -47
- package/esm/bus/webSocketConnection.js.map +1 -1
- package/esm/config/index.js +27 -27
- package/esm/config/index.js.map +1 -1
- package/esm/coordinator/applications.js +0 -2
- package/esm/coordinator/applications.js.map +1 -1
- package/esm/coordinator/consent.js +0 -1
- package/esm/coordinator/consent.js.map +1 -1
- package/esm/coordinator/edgeNodes.js +0 -1
- package/esm/coordinator/edgeNodes.js.map +1 -1
- package/esm/coordinator/organizations.js +0 -2
- package/esm/coordinator/organizations.js.map +1 -1
- package/esm/coordinator/permissions.js +0 -1
- package/esm/coordinator/permissions.js.map +1 -1
- package/esm/coordinator/roles.js +0 -3
- package/esm/coordinator/roles.js.map +1 -1
- package/esm/coordinator/users.js +0 -2
- package/esm/coordinator/users.js.map +1 -1
- package/esm/events/index.js +0 -1
- package/esm/events/index.js.map +1 -1
- package/esm/files/index.js +20 -31
- package/esm/files/index.js.map +1 -1
- package/esm/index.js +7 -8
- package/esm/index.js.map +1 -1
- package/esm/iot/feeds.js +0 -1
- package/esm/iot/feeds.js.map +1 -1
- package/esm/iot/fieldCategories.js +0 -1
- package/esm/iot/fieldCategories.js.map +1 -1
- package/esm/iot/fieldGroupings.js +0 -1
- package/esm/iot/fieldGroupings.js.map +1 -1
- package/esm/iot/fields.js +0 -1
- package/esm/iot/fields.js.map +1 -1
- package/esm/iot/outputs.js +0 -1
- package/esm/iot/outputs.js.map +1 -1
- package/esm/nionic/index.js +12 -15
- package/esm/nionic/index.js.map +1 -1
- package/esm/request.js +8 -9
- package/esm/request.js.map +1 -1
- package/esm/sessionTypes/auth0WebAuth.js +10 -19
- package/esm/sessionTypes/auth0WebAuth.js.map +1 -1
- package/esm/sessionTypes/index.js +0 -1
- package/esm/sessionTypes/index.js.map +1 -1
- package/esm/sessionTypes/machineAuth.js +7 -16
- package/esm/sessionTypes/machineAuth.js.map +1 -1
- package/esm/sessionTypes/passwordGrantAuth.js +3 -6
- package/esm/sessionTypes/passwordGrantAuth.js.map +1 -1
- package/esm/utils/iot/formatOutputFieldDataFromServer.js +6 -13
- package/esm/utils/iot/formatOutputFieldDataFromServer.js.map +1 -1
- package/esm/utils/iot/parseOutputFieldNextPageUrlMetadata.js +0 -2
- package/esm/utils/iot/parseOutputFieldNextPageUrlMetadata.js.map +1 -1
- package/esm/utils/objects/createCaseChangeFn.js +4 -14
- package/esm/utils/objects/createCaseChangeFn.js.map +1 -1
- package/esm/utils/objects/map.js +5 -29
- package/esm/utils/objects/map.js.map +1 -1
- package/esm/utils/pagination/formatPaginatedDataFromServer.js +0 -1
- package/esm/utils/pagination/formatPaginatedDataFromServer.js.map +1 -1
- package/esm/utils/url/index.js +2 -2
- package/lib/bus/channels.js +0 -1
- package/lib/bus/channels.js.map +1 -1
- package/lib/bus/index.js +0 -1
- package/lib/bus/index.js.map +1 -1
- package/lib/bus/webSocketConnection.js +46 -47
- package/lib/bus/webSocketConnection.js.map +1 -1
- package/lib/config/index.js +27 -27
- package/lib/config/index.js.map +1 -1
- package/lib/coordinator/applications.js +0 -2
- package/lib/coordinator/applications.js.map +1 -1
- package/lib/coordinator/consent.js +0 -1
- package/lib/coordinator/consent.js.map +1 -1
- package/lib/coordinator/edgeNodes.js +0 -1
- package/lib/coordinator/edgeNodes.js.map +1 -1
- package/lib/coordinator/organizations.js +0 -2
- package/lib/coordinator/organizations.js.map +1 -1
- package/lib/coordinator/permissions.js +0 -1
- package/lib/coordinator/permissions.js.map +1 -1
- package/lib/coordinator/roles.js +0 -3
- package/lib/coordinator/roles.js.map +1 -1
- package/lib/coordinator/users.js +0 -2
- package/lib/coordinator/users.js.map +1 -1
- package/lib/events/index.js +0 -1
- package/lib/events/index.js.map +1 -1
- package/lib/files/index.js +20 -31
- package/lib/files/index.js.map +1 -1
- package/lib/index.js +7 -8
- package/lib/index.js.map +1 -1
- package/lib/iot/feeds.js +0 -1
- package/lib/iot/feeds.js.map +1 -1
- package/lib/iot/fieldCategories.js +0 -1
- package/lib/iot/fieldCategories.js.map +1 -1
- package/lib/iot/fieldGroupings.js +0 -1
- package/lib/iot/fieldGroupings.js.map +1 -1
- package/lib/iot/fields.js +0 -1
- package/lib/iot/fields.js.map +1 -1
- package/lib/iot/outputs.js +0 -1
- package/lib/iot/outputs.js.map +1 -1
- package/lib/nionic/index.js +12 -15
- package/lib/nionic/index.js.map +1 -1
- package/lib/request.js +8 -9
- package/lib/request.js.map +1 -1
- package/lib/sessionTypes/auth0WebAuth.js +10 -19
- package/lib/sessionTypes/auth0WebAuth.js.map +1 -1
- package/lib/sessionTypes/index.js +0 -1
- package/lib/sessionTypes/index.js.map +1 -1
- package/lib/sessionTypes/machineAuth.js +7 -16
- package/lib/sessionTypes/machineAuth.js.map +1 -1
- package/lib/sessionTypes/passwordGrantAuth.js +3 -6
- package/lib/sessionTypes/passwordGrantAuth.js.map +1 -1
- package/lib/utils/iot/formatOutputFieldDataFromServer.js +6 -13
- package/lib/utils/iot/formatOutputFieldDataFromServer.js.map +1 -1
- package/lib/utils/iot/parseOutputFieldNextPageUrlMetadata.js +0 -2
- package/lib/utils/iot/parseOutputFieldNextPageUrlMetadata.js.map +1 -1
- package/lib/utils/objects/createCaseChangeFn.js +4 -14
- package/lib/utils/objects/createCaseChangeFn.js.map +1 -1
- package/lib/utils/objects/map.js +5 -29
- package/lib/utils/objects/map.js.map +1 -1
- package/lib/utils/pagination/formatPaginatedDataFromServer.js +0 -1
- package/lib/utils/pagination/formatPaginatedDataFromServer.js.map +1 -1
- package/lib/utils/url/index.js +2 -2
- package/package.json +6 -3
- package/src/bus/index.spec.js +1 -1
- package/src/bus/webSocketConnection.spec.js +53 -53
- package/src/config/index.spec.js +5 -5
- package/src/coordinator/applications.spec.js +7 -7
- package/src/coordinator/consent.spec.js +1 -1
- package/src/coordinator/edgeNodes.spec.js +2 -2
- package/src/coordinator/organizations.spec.js +3 -3
- package/src/coordinator/permissions.spec.js +3 -3
- package/src/coordinator/roles.spec.js +3 -3
- package/src/coordinator/users.spec.js +17 -17
- package/src/events/index.spec.js +15 -15
- package/src/files/index.spec.js +8 -8
- package/src/index.spec.js +8 -8
- package/src/iot/feeds.spec.js +3 -3
- package/src/iot/fieldCategories.spec.js +3 -3
- package/src/iot/fieldGroupings.spec.js +4 -4
- package/src/iot/outputs.spec.js +6 -6
- package/src/request.spec.js +3 -3
- package/src/sessionTypes/auth0WebAuth.spec.js +16 -14
- package/src/sessionTypes/index.spec.js +1 -1
- package/src/sessionTypes/machineAuth.spec.js +5 -5
- package/src/sessionTypes/passwordGrantAuth.spec.js +1 -1
- package/src/utils/iot/formatOutputFieldDataFromServer.spec.js +6 -6
- package/src/utils/iot/parseOutputFieldNextPageUrlMetadata.spec.js +3 -3
- package/src/utils/pagination/formatPaginatedDataFromServer.spec.js +2 -2
- package/src/utils/url/stringifyParams.spec.js +3 -3
- package/support/fixtures/factories/IOSDevice.js +4 -4
- package/support/fixtures/factories/applicationGrouping.js +6 -6
- package/support/fixtures/factories/applicationModule.js +3 -3
- package/support/fixtures/factories/asset.js +2 -2
- package/support/fixtures/factories/assetAttribute.js +4 -4
- package/support/fixtures/factories/assetAttributeValue.js +3 -3
- package/support/fixtures/factories/assetMetric.js +3 -3
- package/support/fixtures/factories/assetMetricValue.js +4 -4
- package/support/fixtures/factories/assetMetricValueCompact.js +3 -3
- package/support/fixtures/factories/assetType.js +2 -2
- package/support/fixtures/factories/audience.js +1 -1
- package/support/fixtures/factories/authResults.js +4 -4
- package/support/fixtures/factories/channel.js +2 -2
- package/support/fixtures/factories/contxtApplication.js +10 -10
- package/support/fixtures/factories/contxtOrganization.js +3 -3
- package/support/fixtures/factories/contxtOrganizationFeaturedApplication.js +4 -4
- package/support/fixtures/factories/contxtProject.js +7 -7
- package/support/fixtures/factories/contxtProjectEnvironment.js +7 -7
- package/support/fixtures/factories/contxtRole.js +5 -5
- package/support/fixtures/factories/contxtRoleApplication.js +2 -2
- package/support/fixtures/factories/contxtRoleProjectEnvironment.js +3 -3
- package/support/fixtures/factories/contxtUser.js +6 -6
- package/support/fixtures/factories/contxtUserApplication.js +2 -2
- package/support/fixtures/factories/contxtUserFavoriteApplication.js +3 -3
- package/support/fixtures/factories/contxtUserPermissions.js +6 -6
- package/support/fixtures/factories/contxtUserProjectEnvironment.js +3 -3
- package/support/fixtures/factories/contxtUserRole.js +3 -3
- package/support/fixtures/factories/costCenter.js +3 -3
- package/support/fixtures/factories/costCenterFacility.js +4 -4
- package/support/fixtures/factories/edgeNode.js +2 -2
- package/support/fixtures/factories/event.js +7 -7
- package/support/fixtures/factories/eventType.js +6 -6
- package/support/fixtures/factories/eventUser.js +8 -8
- package/support/fixtures/factories/facility.js +12 -12
- package/support/fixtures/factories/facilityGrouping.js +5 -5
- package/support/fixtures/factories/facilityGroupingFacility.js +4 -4
- package/support/fixtures/factories/facilityInfo.js +6 -6
- package/support/fixtures/factories/facilityTag.js +2 -2
- package/support/fixtures/factories/feedStatus.js +3 -3
- package/support/fixtures/factories/feedType.js +2 -2
- package/support/fixtures/factories/feeds.js +8 -8
- package/support/fixtures/factories/fieldCategory.js +4 -4
- package/support/fixtures/factories/fieldGrouping.js +6 -6
- package/support/fixtures/factories/fieldGroupingField.js +4 -4
- package/support/fixtures/factories/fieldGroupingStatus.js +3 -3
- package/support/fixtures/factories/file.js +3 -3
- package/support/fixtures/factories/fileToDownload.js +1 -1
- package/support/fixtures/factories/fileUploadInfo.js +3 -3
- package/support/fixtures/factories/organization.js +3 -3
- package/support/fixtures/factories/outputField.js +18 -18
- package/support/fixtures/factories/outputFieldData.js +2 -2
- package/support/fixtures/factories/owner.js +5 -5
- package/support/fixtures/factories/paginationMetadata.js +3 -3
- package/support/fixtures/factories/triggeredEvent.js +5 -5
- package/support/fixtures/factories/userEventSubscription.js +3 -3
- package/support/fixtures/factories/userMobileNumber.js +4 -4
- package/support/fixtures/factories/userPermissionsMap.js +3 -3
- package/support/fixtures/factories/userProfile.js +3 -3
- package/support/globals.js +11 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
const times = require('lodash.times');
|
|
6
6
|
|
|
7
7
|
factory
|
|
@@ -12,29 +12,29 @@ factory
|
|
|
12
12
|
factory
|
|
13
13
|
.buildList(
|
|
14
14
|
'contxtApplication',
|
|
15
|
-
faker.
|
|
15
|
+
faker.number.int({ 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.number.int({ 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.number.int({ min: 0, max: 15 }))
|
|
28
28
|
.map(({ id }) => ({ id })),
|
|
29
29
|
projectsExplicit: () =>
|
|
30
|
-
times(faker.
|
|
30
|
+
times(faker.number.int({ 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.number.int({ min: 0, max: 15 }), () => {
|
|
38
38
|
return {
|
|
39
39
|
id: factory.build('contxtProject').id,
|
|
40
40
|
accessType: factory.build('contxtUserProjectEnvironment').accessType
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
|
|
6
6
|
factory
|
|
7
7
|
.define('contxtUserProjectEnvironment')
|
|
8
8
|
.option('fromServer', false)
|
|
9
9
|
.attrs({
|
|
10
|
-
accessType: () => faker.
|
|
10
|
+
accessType: () => faker.helpers.arrayElement(['reader', 'admin']),
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
|
-
id: () => faker.
|
|
12
|
+
id: () => faker.string.uuid(),
|
|
13
13
|
projectEnvironmentId: () => factory.build('contxtProjectEnvironment').id,
|
|
14
14
|
updatedAt: () => faker.date.recent().toISOString(),
|
|
15
15
|
userId: () => factory.build('contxtUser').id
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
|
|
6
6
|
factory
|
|
7
7
|
.define('contxtUserRole')
|
|
8
8
|
.option('fromServer', false)
|
|
9
9
|
.attrs({
|
|
10
10
|
createdAt: () => faker.date.past().toISOString(),
|
|
11
|
-
id: () => faker.
|
|
12
|
-
mappedFromExternalGroup: () =>
|
|
11
|
+
id: () => faker.string.uuid(),
|
|
12
|
+
mappedFromExternalGroup: () => fakerBoolean(),
|
|
13
13
|
roleId: () => factory.build('contxtRole').id,
|
|
14
14
|
updatedAt: () => faker.date.recent().toISOString(),
|
|
15
15
|
userId: () => factory.build('contxtUser').id
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
const times = require('lodash.times');
|
|
6
6
|
|
|
7
7
|
factory
|
|
@@ -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.string.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.number.int({
|
|
21
21
|
min: 0,
|
|
22
22
|
max: 5
|
|
23
23
|
}),
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
|
|
6
6
|
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.string.uuid(),
|
|
11
|
+
facilityId: () => faker.number.int(),
|
|
12
|
+
id: () => faker.string.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
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
|
|
6
6
|
factory
|
|
7
7
|
.define('edgeNode')
|
|
@@ -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.string.uuid(),
|
|
14
14
|
name: () => faker.commerce.productMaterial(),
|
|
15
15
|
organizationId: () => factory.build('organization').id,
|
|
16
16
|
updatedAt: () => faker.date.recent().toISOString()
|
|
@@ -1,21 +1,21 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
|
|
6
6
|
factory
|
|
7
7
|
.define('event')
|
|
8
8
|
.option('fromServer', false)
|
|
9
9
|
.attrs({
|
|
10
|
-
allowOthersToTrigger: () =>
|
|
10
|
+
allowOthersToTrigger: () => fakerBoolean(),
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
12
|
deletedAt: () => faker.date.recent().toISOString(),
|
|
13
|
-
facilityId: () => faker.
|
|
14
|
-
id: () => faker.
|
|
15
|
-
isPublic: () =>
|
|
16
|
-
name: () => faker.company.
|
|
13
|
+
facilityId: () => faker.number.int(),
|
|
14
|
+
id: () => faker.string.uuid(),
|
|
15
|
+
isPublic: () => fakerBoolean(),
|
|
16
|
+
name: () => faker.company.name(),
|
|
17
17
|
organizationId: () => factory.build('organization').id,
|
|
18
|
-
topicArn: () => faker.
|
|
18
|
+
topicArn: () => faker.string.uuid(),
|
|
19
19
|
updatedAt: () => faker.date.recent().toISOString()
|
|
20
20
|
})
|
|
21
21
|
.attr('eventType', ['fromServer'], (fromServer) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
|
|
6
6
|
factory
|
|
7
7
|
.define('eventType')
|
|
@@ -10,11 +10,11 @@ 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: () =>
|
|
15
|
-
isRealtimeEnabled: () =>
|
|
16
|
-
level: () => faker.
|
|
17
|
-
name: () => faker.company.
|
|
13
|
+
id: () => faker.string.uuid(),
|
|
14
|
+
isOngoingEvent: () => fakerBoolean(),
|
|
15
|
+
isRealtimeEnabled: () => fakerBoolean(),
|
|
16
|
+
level: () => faker.number.int(),
|
|
17
|
+
name: () => faker.company.name(),
|
|
18
18
|
slug: () => faker.lorem.slug(),
|
|
19
19
|
updatedAt: () => faker.date.recent().toISOString()
|
|
20
20
|
})
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
const times = require('lodash.times');
|
|
6
6
|
|
|
7
7
|
factory
|
|
@@ -10,16 +10,16 @@ factory
|
|
|
10
10
|
.attrs({
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
12
|
email: () => faker.internet.email(),
|
|
13
|
-
firstName: () => faker.
|
|
14
|
-
id: () => `auth0|${faker.
|
|
15
|
-
isMachineUser: () =>
|
|
16
|
-
lastName: () => faker.
|
|
13
|
+
firstName: () => faker.person.firstName(),
|
|
14
|
+
id: () => `auth0|${faker.number.int()}`,
|
|
15
|
+
isMachineUser: () => fakerBoolean(),
|
|
16
|
+
lastName: () => faker.person.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.number.int({
|
|
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.number.int({
|
|
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.number.int({
|
|
64
64
|
min: 0,
|
|
65
65
|
max: 5
|
|
66
66
|
}),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
const times = require('lodash.times');
|
|
6
6
|
|
|
7
7
|
factory
|
|
@@ -9,16 +9,16 @@ factory
|
|
|
9
9
|
.option('fromServer', false)
|
|
10
10
|
.sequence('id')
|
|
11
11
|
.attrs({
|
|
12
|
-
address1: () => faker.
|
|
13
|
-
address2: () => faker.
|
|
14
|
-
assetId: () => faker.
|
|
15
|
-
city: () => faker.
|
|
12
|
+
address1: () => faker.location.streetAddress(),
|
|
13
|
+
address2: () => faker.location.secondaryAddress(),
|
|
14
|
+
assetId: () => faker.string.uuid(),
|
|
15
|
+
city: () => faker.location.city(),
|
|
16
16
|
createdAt: () => faker.date.past().toISOString(),
|
|
17
|
-
geometryId: () => faker.
|
|
17
|
+
geometryId: () => faker.string.uuid(),
|
|
18
18
|
info: () => factory.build('facilityInfo'),
|
|
19
|
-
state: () => faker.
|
|
19
|
+
state: () => faker.location.state(),
|
|
20
20
|
timezone: () => {
|
|
21
|
-
return faker.
|
|
21
|
+
return faker.helpers.arrayElement([
|
|
22
22
|
'America/New_York',
|
|
23
23
|
'America/Chicago',
|
|
24
24
|
'America/Denver',
|
|
@@ -26,11 +26,11 @@ factory
|
|
|
26
26
|
]);
|
|
27
27
|
},
|
|
28
28
|
weatherLocationId: () => null,
|
|
29
|
-
zip: () => faker.
|
|
29
|
+
zip: () => faker.location.zipCode()
|
|
30
30
|
})
|
|
31
31
|
.attr('facilityGroupings', ['id', 'fromServer'], (id, fromServer) => {
|
|
32
32
|
return times(
|
|
33
|
-
faker.
|
|
33
|
+
faker.number.int({
|
|
34
34
|
min: 0,
|
|
35
35
|
max: 5
|
|
36
36
|
}),
|
|
@@ -47,7 +47,7 @@ factory
|
|
|
47
47
|
}
|
|
48
48
|
);
|
|
49
49
|
})
|
|
50
|
-
.attr('name', ['city'], (city) => `${faker.
|
|
50
|
+
.attr('name', ['city'], (city) => `${faker.location.cardinalDirection()} ${city}`)
|
|
51
51
|
.attr('organization', ['fromServer'], (fromServer) => {
|
|
52
52
|
return factory.build('organization', null, {
|
|
53
53
|
fromServer
|
|
@@ -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.number.int({
|
|
60
60
|
min: 0,
|
|
61
61
|
max: 5
|
|
62
62
|
}),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
|
|
6
6
|
factory
|
|
7
7
|
.define('facilityGrouping')
|
|
@@ -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: () =>
|
|
12
|
+
id: () => faker.string.uuid(),
|
|
13
|
+
isPrivate: () => fakerBoolean(),
|
|
14
14
|
name: () => faker.commerce.productName(),
|
|
15
15
|
organizationId: () => factory.build('organization').id,
|
|
16
|
-
ownerId: () => faker.internet.
|
|
17
|
-
parentGroupingId: () => faker.
|
|
16
|
+
ownerId: () => faker.internet.username(),
|
|
17
|
+
parentGroupingId: () => faker.string.uuid(),
|
|
18
18
|
updatedAt: () => faker.date.recent().toISOString()
|
|
19
19
|
})
|
|
20
20
|
.after((facilityGrouping, options) => {
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
|
|
6
6
|
factory
|
|
7
7
|
.define('facilityGroupingFacility')
|
|
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.string.uuid(),
|
|
12
|
+
facilityId: () => faker.number.int(),
|
|
13
|
+
id: () => faker.string.uuid(),
|
|
14
14
|
updatedAt: () => faker.date.recent().toISOString()
|
|
15
15
|
})
|
|
16
16
|
.after((facilityGroupingFacility, options) => {
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
|
|
6
6
|
factory.define('facilityInfo').attrs({
|
|
7
|
-
'General Manager': () => faker.
|
|
8
|
-
latitude: () => faker.
|
|
9
|
-
longitude: () => faker.
|
|
10
|
-
rail_access: () => `${
|
|
11
|
-
square_feet: () => `${faker.
|
|
7
|
+
'General Manager': () => faker.person.fullName(),
|
|
8
|
+
latitude: () => faker.location.latitude(),
|
|
9
|
+
longitude: () => faker.location.longitude(),
|
|
10
|
+
rail_access: () => `${fakerBoolean()}`,
|
|
11
|
+
square_feet: () => `${faker.number.int()}`
|
|
12
12
|
});
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
|
|
6
6
|
factory
|
|
7
7
|
.define('facilityTag')
|
|
@@ -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.number.int(),
|
|
13
13
|
name: () => faker.commerce.productMaterial(),
|
|
14
14
|
updatedAt: () => faker.date.recent().toISOString()
|
|
15
15
|
})
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
|
|
6
6
|
factory
|
|
7
7
|
.define('feedStatus')
|
|
8
8
|
.option('fromServer', false)
|
|
9
9
|
.sequence('id')
|
|
10
10
|
.attrs({
|
|
11
|
-
feedId: () => faker.
|
|
11
|
+
feedId: () => faker.number.int(),
|
|
12
12
|
feedStatusId: () => null,
|
|
13
|
-
status: () => faker.
|
|
13
|
+
status: () => faker.helpers.arrayElement(['Active', 'Degraded', 'Critical']),
|
|
14
14
|
updatedAt: () => faker.date.recent().toISOString()
|
|
15
15
|
})
|
|
16
16
|
.after((feedType, options) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
|
|
6
6
|
factory
|
|
7
7
|
.define('feedType')
|
|
@@ -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.number.int({ min: 1000, max: 9999 }),
|
|
13
13
|
troubleshootingUrl: () => faker.internet.url(),
|
|
14
14
|
type: () => faker.hacker.noun(),
|
|
15
15
|
updatedAt: () => faker.date.recent().toISOString()
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
|
|
6
6
|
factory
|
|
7
7
|
.define('feed')
|
|
@@ -9,19 +9,19 @@ 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.number.int({ min: 0, max: 5 }),
|
|
13
|
+
degradedThreshold: () => faker.number.int({ min: 0, max: 5 }),
|
|
14
|
+
downAfter: () => faker.number.int({ min: 1000, max: 9999 }),
|
|
15
15
|
facilityId: () => factory.build('facility').id,
|
|
16
16
|
feedTypeId: () => factory.build('feedType').id,
|
|
17
|
-
isPaused: () =>
|
|
17
|
+
isPaused: () => fakerBoolean(),
|
|
18
18
|
key: () => faker.hacker.noun(),
|
|
19
19
|
ownerId: () => factory.build('owner').id,
|
|
20
20
|
routingKeys: () => `[${faker.hacker.noun()}]`,
|
|
21
|
-
status: () => faker.
|
|
22
|
-
statusEventId: () => faker.
|
|
21
|
+
status: () => faker.helpers.arrayElement(['Active', 'Degraded', 'Critical']),
|
|
22
|
+
statusEventId: () => faker.string.uuid(),
|
|
23
23
|
timezone: () => {
|
|
24
|
-
return faker.
|
|
24
|
+
return faker.helpers.arrayElement([
|
|
25
25
|
'America/New_York',
|
|
26
26
|
'America/Chicago',
|
|
27
27
|
'America/Denver',
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
|
|
6
6
|
factory
|
|
7
7
|
.define('fieldCategory')
|
|
@@ -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.string.uuid(),
|
|
13
13
|
name: () => faker.commerce.productName(),
|
|
14
|
-
organizationId: () => faker.
|
|
15
|
-
parentCategoryId: () => faker.
|
|
14
|
+
organizationId: () => faker.string.uuid(),
|
|
15
|
+
parentCategoryId: () => faker.string.uuid(),
|
|
16
16
|
updatedAt: () => faker.date.recent().toISOString()
|
|
17
17
|
})
|
|
18
18
|
.after((fieldCategory, options) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
|
|
6
6
|
factory
|
|
7
7
|
.define('fieldGrouping')
|
|
@@ -9,12 +9,12 @@ 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: () =>
|
|
12
|
+
fieldCategoryId: () => faker.string.uuid(),
|
|
13
|
+
facilityId: () => faker.number.int(),
|
|
14
|
+
id: () => faker.string.uuid(),
|
|
15
|
+
isPublic: () => fakerBoolean(),
|
|
16
16
|
label: () => faker.commerce.productName(),
|
|
17
|
-
ownerId: () => faker.internet.
|
|
17
|
+
ownerId: () => faker.internet.username(),
|
|
18
18
|
slug: () => faker.lorem.slug(),
|
|
19
19
|
updatedAt: () => faker.date.recent().toISOString()
|
|
20
20
|
})
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
|
|
6
6
|
factory
|
|
7
7
|
.define('fieldGroupingField')
|
|
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.string.uuid(),
|
|
12
|
+
outputFieldId: () => faker.number.int(),
|
|
13
|
+
id: () => faker.string.uuid(),
|
|
14
14
|
updatedAt: () => faker.date.recent().toISOString()
|
|
15
15
|
})
|
|
16
16
|
.after((fieldGroupingField, options) => {
|
|
@@ -1,15 +1,15 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
|
|
6
6
|
factory
|
|
7
7
|
.define('fieldGroupingStatus')
|
|
8
8
|
.option('fromServer', false)
|
|
9
9
|
.attrs({
|
|
10
|
-
id: () => faker.
|
|
10
|
+
id: () => faker.string.uuid(),
|
|
11
11
|
label: () => faker.commerce.productName(),
|
|
12
|
-
status: () => faker.
|
|
12
|
+
status: () => faker.helpers.arrayElement(['Active', 'Out-of-Date']),
|
|
13
13
|
updatedAt: () => faker.date.recent().toISOString()
|
|
14
14
|
})
|
|
15
15
|
.after((fieldGroupingStatus, options) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
|
|
6
6
|
factory
|
|
7
7
|
.define('file')
|
|
@@ -11,9 +11,9 @@ 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.string.uuid(),
|
|
15
15
|
organizationId: () => factory.build('organization').id,
|
|
16
|
-
status: () => faker.
|
|
16
|
+
status: () => faker.helpers.arrayElement(['ACTIVE', 'UPLOADING']),
|
|
17
17
|
updatedAt: () => faker.date.recent().toISOString()
|
|
18
18
|
})
|
|
19
19
|
.attr('uploadInfo', ['fromServer'], (fromServer, uploadInfo) => {
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
const times = require('lodash.times');
|
|
6
6
|
|
|
7
7
|
factory
|
|
@@ -9,14 +9,14 @@ factory
|
|
|
9
9
|
.option('fromServer', false)
|
|
10
10
|
.attrs({
|
|
11
11
|
headers: () =>
|
|
12
|
-
times(faker.
|
|
12
|
+
times(faker.number.int({ min: 1, max: 5 })).reduce((memo) => {
|
|
13
13
|
memo[faker.lorem.word()] = faker.hacker.phrase();
|
|
14
14
|
|
|
15
15
|
return memo;
|
|
16
16
|
}, {}),
|
|
17
17
|
expiresAt: () => faker.date.future().toISOString(),
|
|
18
18
|
method: 'PUT',
|
|
19
|
-
url: () => faker.
|
|
19
|
+
url: () => faker.image.avatar()
|
|
20
20
|
})
|
|
21
21
|
.after((uploadInfo, options) => {
|
|
22
22
|
// If building a file object that comes from the server, transform it to have camel
|
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
const factory = require('rosie').Factory;
|
|
4
|
-
const faker = require('faker');
|
|
4
|
+
const { faker } = require('@faker-js/faker');
|
|
5
5
|
|
|
6
6
|
factory
|
|
7
7
|
.define('organization')
|
|
8
8
|
.attrs({
|
|
9
9
|
createdAt: () => faker.date.past().toISOString(),
|
|
10
|
-
id: () => faker.
|
|
11
|
-
name: () => faker.company.
|
|
10
|
+
id: () => faker.string.uuid(),
|
|
11
|
+
name: () => faker.company.name(),
|
|
12
12
|
updatedAt: () => faker.date.recent().toISOString()
|
|
13
13
|
})
|
|
14
14
|
.after((organization, options) => {
|