@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
|
@@ -16,19 +16,19 @@ describe('utils/iot/formatOutputFieldDataFromServer', function() {
|
|
|
16
16
|
|
|
17
17
|
beforeEach(function() {
|
|
18
18
|
expectedOutputFieldMetadata = {
|
|
19
|
-
count: faker.
|
|
20
|
-
hasMore:
|
|
19
|
+
count: faker.number.int(),
|
|
20
|
+
hasMore: fakerBoolean(),
|
|
21
21
|
nextRecordTime: Math.floor(faker.date.recent().getTime() / 1000)
|
|
22
22
|
};
|
|
23
23
|
expectedOutputFieldParsedMetadata = {
|
|
24
|
-
limit: faker.
|
|
24
|
+
limit: faker.number.int(),
|
|
25
25
|
timeEnd: expectedOutputFieldMetadata.nextRecordTime,
|
|
26
26
|
timeStart: Math.floor(faker.date.past().getTime() / 1000),
|
|
27
|
-
window: faker.
|
|
27
|
+
window: faker.helpers.arrayElement([0, 60, 900, 3600])
|
|
28
28
|
};
|
|
29
29
|
expectedOutputFieldDataRecords = fixture.buildList(
|
|
30
30
|
'outputFieldData',
|
|
31
|
-
faker.
|
|
31
|
+
faker.number.int({ min: 1, max: 10 })
|
|
32
32
|
);
|
|
33
33
|
initialOutputFieldMetadata = omit(
|
|
34
34
|
{
|
|
@@ -37,7 +37,7 @@ describe('utils/iot/formatOutputFieldDataFromServer', function() {
|
|
|
37
37
|
next_page_url:
|
|
38
38
|
faker.internet.url() +
|
|
39
39
|
'/outputs/' +
|
|
40
|
-
faker.
|
|
40
|
+
faker.number.int() +
|
|
41
41
|
'/fields/' +
|
|
42
42
|
faker.hacker.noun() +
|
|
43
43
|
'/data' +
|
|
@@ -7,16 +7,16 @@ describe('utils/iot/parseOutputFieldNextPageUrlMetadata', function() {
|
|
|
7
7
|
|
|
8
8
|
beforeEach(function() {
|
|
9
9
|
expectedMetadata = {
|
|
10
|
-
limit: faker.
|
|
10
|
+
limit: faker.number.int(),
|
|
11
11
|
timeEnd: Math.floor(faker.date.recent().getTime() / 1000),
|
|
12
12
|
timeStart: Math.floor(faker.date.past().getTime() / 1000),
|
|
13
|
-
window: faker.
|
|
13
|
+
window: faker.helpers.arrayElement([0, 60, 900, 3600])
|
|
14
14
|
};
|
|
15
15
|
|
|
16
16
|
const url =
|
|
17
17
|
faker.internet.url() +
|
|
18
18
|
'/outputs/' +
|
|
19
|
-
faker.
|
|
19
|
+
faker.number.int() +
|
|
20
20
|
'/fields/' +
|
|
21
21
|
faker.hacker.noun() +
|
|
22
22
|
'/data' +
|
|
@@ -18,7 +18,7 @@ describe('utils/pagination/formatPaginatedDataFromServer', function() {
|
|
|
18
18
|
|
|
19
19
|
beforeEach(function() {
|
|
20
20
|
expectedMetadata = fixture.build('paginationMetadata');
|
|
21
|
-
expectedRecords = times(faker.
|
|
21
|
+
expectedRecords = times(faker.number.int({ min: 1, max: 10 }), () =>
|
|
22
22
|
faker.helpers.createTransaction()
|
|
23
23
|
);
|
|
24
24
|
initialMetadata = fixture.build('paginationMetadata');
|
|
@@ -70,7 +70,7 @@ describe('utils/pagination/formatPaginatedDataFromServer', function() {
|
|
|
70
70
|
beforeEach(function() {
|
|
71
71
|
expectedRecords = fixture.buildList(
|
|
72
72
|
'organization',
|
|
73
|
-
faker.
|
|
73
|
+
faker.number.int({ min: 1, max: 10 })
|
|
74
74
|
);
|
|
75
75
|
initialRecords = expectedRecords.map((record) =>
|
|
76
76
|
fixture.build('organization', record, { fromServer: true })
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { expect } from 'chai';
|
|
2
|
-
import faker from 'faker';
|
|
2
|
+
import { faker } from '@faker-js/faker';
|
|
3
3
|
import { stringifyParamsWithCommaSeparatedArrays } from './stringifyParams';
|
|
4
4
|
|
|
5
5
|
const URL_ENCODED_COLON = '%3A';
|
|
@@ -18,9 +18,9 @@ describe('src/utils/url/stringifyParams.js', function() {
|
|
|
18
18
|
let allParams;
|
|
19
19
|
|
|
20
20
|
beforeEach(function() {
|
|
21
|
-
value = { value: faker.
|
|
21
|
+
value = { value: faker.number.int() };
|
|
22
22
|
word = { word: faker.lorem.word() };
|
|
23
|
-
uuid = { uuid: faker.
|
|
23
|
+
uuid = { uuid: faker.string.uuid() };
|
|
24
24
|
date = { date: faker.date.past().toISOString() };
|
|
25
25
|
|
|
26
26
|
listValue1 = faker.lorem.word();
|
|
@@ -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('IOSDevice')
|
|
@@ -9,9 +9,9 @@ factory
|
|
|
9
9
|
.sequence('id')
|
|
10
10
|
.attrs({
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
|
-
deviceToken: () => faker.
|
|
13
|
-
isActive: () =>
|
|
14
|
-
snsEndpointArn: () => faker.
|
|
12
|
+
deviceToken: () => faker.string.uuid(),
|
|
13
|
+
isActive: () => fakerBoolean(),
|
|
14
|
+
snsEndpointArn: () => faker.string.uuid(),
|
|
15
15
|
updatedAt: () => faker.date.recent().toISOString(),
|
|
16
16
|
userId: () => factory.build('eventUser').id
|
|
17
17
|
})
|
|
@@ -1,20 +1,20 @@
|
|
|
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('applicationGrouping')
|
|
8
8
|
.attrs({
|
|
9
|
-
applicationId: () => faker.
|
|
10
|
-
id: () => faker.
|
|
11
|
-
index: () => faker.
|
|
12
|
-
label: () => faker.
|
|
9
|
+
applicationId: () => faker.number.int(),
|
|
10
|
+
id: () => faker.string.uuid(),
|
|
11
|
+
index: () => faker.number.int(),
|
|
12
|
+
label: () => faker.lorem.words()
|
|
13
13
|
})
|
|
14
14
|
.attr('applicationModules', ['id'], (id) => {
|
|
15
15
|
return factory.buildList(
|
|
16
16
|
'applicationModule',
|
|
17
|
-
faker.
|
|
17
|
+
faker.number.int({ min: 1, max: 10 }),
|
|
18
18
|
{ applicationGroupingId: id }
|
|
19
19
|
);
|
|
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
|
|
|
6
6
|
factory
|
|
7
7
|
.define('applicationModule')
|
|
@@ -9,8 +9,8 @@ factory
|
|
|
9
9
|
applicationGroupingId: () => factory.build('applicationGrouping').id,
|
|
10
10
|
externalLink: () => faker.internet.url(),
|
|
11
11
|
iconUrl: () => faker.internet.url(),
|
|
12
|
-
id: () => faker.
|
|
13
|
-
index: () => faker.
|
|
12
|
+
id: () => faker.string.uuid(),
|
|
13
|
+
index: () => faker.number.int(),
|
|
14
14
|
label: () => faker.commerce.productName(),
|
|
15
15
|
slug: () => `nsight-${faker.internet.domainWord()}`
|
|
16
16
|
})
|
|
@@ -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('asset')
|
|
@@ -10,7 +10,7 @@ factory
|
|
|
10
10
|
assetTypeId: () => factory.build('assetType').id,
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
12
|
description: () => faker.hacker.phrase(),
|
|
13
|
-
id: () => faker.
|
|
13
|
+
id: () => faker.string.uuid(),
|
|
14
14
|
label: () => faker.lorem.sentence(),
|
|
15
15
|
organizationId: () => factory.build('organization').id,
|
|
16
16
|
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('assetAttribute')
|
|
@@ -10,10 +10,10 @@ factory
|
|
|
10
10
|
assetTypeId: () => factory.build('assetType').id,
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
12
|
dataType: () =>
|
|
13
|
-
faker.
|
|
13
|
+
faker.helpers.arrayElement(['boolean', 'date', 'number', 'string']),
|
|
14
14
|
description: () => faker.lorem.sentence(),
|
|
15
|
-
id: () => faker.
|
|
16
|
-
isRequired: () =>
|
|
15
|
+
id: () => faker.string.uuid(),
|
|
16
|
+
isRequired: () => fakerBoolean(),
|
|
17
17
|
label: () => faker.hacker.phrase(),
|
|
18
18
|
organizationId: () => factory.build('organization').id,
|
|
19
19
|
units: () => faker.lorem.sentence(),
|
|
@@ -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('assetAttributeValue')
|
|
@@ -12,11 +12,11 @@ factory
|
|
|
12
12
|
assetLabel: () => faker.lorem.word(),
|
|
13
13
|
createdAt: () => faker.date.past().toISOString(),
|
|
14
14
|
effectiveDate: () => faker.date.recent().toISOString(),
|
|
15
|
-
id: () => faker.
|
|
15
|
+
id: () => faker.string.uuid(),
|
|
16
16
|
label: () => faker.lorem.word(),
|
|
17
17
|
notes: () => faker.lorem.sentence(),
|
|
18
18
|
updatedAt: () => faker.date.recent().toISOString(),
|
|
19
|
-
value: () => `${faker.
|
|
19
|
+
value: () => `${faker.number.int()}`
|
|
20
20
|
})
|
|
21
21
|
.after((assetAttributeValue, options) => {
|
|
22
22
|
// If building an asset attribute value object that comes from the server,
|
|
@@ -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('assetMetric')
|
|
@@ -10,11 +10,11 @@ factory
|
|
|
10
10
|
assetTypeId: () => factory.build('assetType').id,
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
12
|
description: () => faker.lorem.sentence(),
|
|
13
|
-
id: () => faker.
|
|
13
|
+
id: () => faker.string.uuid(),
|
|
14
14
|
label: () => faker.hacker.phrase(),
|
|
15
15
|
organizationId: () => factory.build('organization').id,
|
|
16
16
|
timeInterval: () =>
|
|
17
|
-
faker.
|
|
17
|
+
faker.helpers.arrayElement([
|
|
18
18
|
'hourly',
|
|
19
19
|
'daily',
|
|
20
20
|
'weekly',
|
|
@@ -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('assetMetricValue')
|
|
@@ -12,11 +12,11 @@ factory
|
|
|
12
12
|
createdAt: () => faker.date.past().toISOString(),
|
|
13
13
|
effectiveEndDate: () => faker.date.recent().toISOString(),
|
|
14
14
|
effectiveStartDate: () => faker.date.past().toISOString(),
|
|
15
|
-
id: () => faker.
|
|
15
|
+
id: () => faker.string.uuid(),
|
|
16
16
|
notes: () => faker.lorem.sentence(),
|
|
17
17
|
updatedAt: () => faker.date.recent().toISOString(),
|
|
18
|
-
value: () => `${faker.
|
|
19
|
-
isEstimated: () =>
|
|
18
|
+
value: () => `${faker.number.int()}`,
|
|
19
|
+
isEstimated: () => fakerBoolean()
|
|
20
20
|
})
|
|
21
21
|
.after((assetMetricValue, options) => {
|
|
22
22
|
// If building an asset metric value object that comes from the server,
|
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
const faker = require('faker');
|
|
1
|
+
const { faker } = require('@faker-js/faker');
|
|
2
2
|
const factory = require('rosie').Factory;
|
|
3
3
|
|
|
4
4
|
factory
|
|
5
5
|
.define('assetMetricValueCompact')
|
|
6
6
|
.option('fromServer', false)
|
|
7
7
|
.attrs({
|
|
8
|
-
id: faker.
|
|
9
|
-
value: faker.
|
|
8
|
+
id: faker.string.uuid(),
|
|
9
|
+
value: faker.number.int(),
|
|
10
10
|
isEstimated: false,
|
|
11
11
|
effectiveStartDate: faker.date.past().toISOString(),
|
|
12
12
|
effectiveEndDate: 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('assetType')
|
|
@@ -9,7 +9,7 @@ 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
|
label: () => faker.lorem.sentence(),
|
|
14
14
|
organizationId: () => factory.build('organization').id,
|
|
15
15
|
updatedAt: () => faker.date.recent().toISOString()
|
|
@@ -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.define('Auth0WebAuthSessionInfo').attrs({
|
|
7
|
-
accessToken: () => faker.
|
|
7
|
+
accessToken: () => faker.string.uuid(),
|
|
8
8
|
expiresAt: () => sometimeSoon(2, 24)
|
|
9
9
|
});
|
|
10
10
|
|
|
11
11
|
factory.define('MachineAuthSessionInfo').attrs({
|
|
12
|
-
apiToken: () => faker.
|
|
12
|
+
apiToken: () => faker.string.uuid(),
|
|
13
13
|
expiresAt: () => sometimeSoon(2, 24)
|
|
14
14
|
});
|
|
15
15
|
|
|
@@ -24,7 +24,7 @@ const sometimeSoon = (minHours, maxHours) => {
|
|
|
24
24
|
const date = new Date();
|
|
25
25
|
|
|
26
26
|
let future = date.getTime();
|
|
27
|
-
future += faker.
|
|
27
|
+
future += faker.number.int(range);
|
|
28
28
|
date.setTime(future);
|
|
29
29
|
|
|
30
30
|
return date;
|
|
@@ -1,13 +1,13 @@
|
|
|
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('channel')
|
|
8
8
|
.option('fromServer', false)
|
|
9
9
|
.attrs({
|
|
10
|
-
id: () => faker.
|
|
10
|
+
id: () => faker.string.uuid(),
|
|
11
11
|
name: () => faker.hacker.noun(),
|
|
12
12
|
organizationId: () => factory.build('organization').id,
|
|
13
13
|
serviceId: () => faker.internet.password()
|
|
@@ -1,22 +1,22 @@
|
|
|
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('contxtApplication')
|
|
8
8
|
.option('fromServer', false)
|
|
9
9
|
.attrs({
|
|
10
|
-
clientId: () => faker.
|
|
11
|
-
clientSecret: () => faker.
|
|
10
|
+
clientId: () => faker.string.uuid(),
|
|
11
|
+
clientSecret: () => faker.string.uuid(),
|
|
12
12
|
createdAt: () => faker.date.past().toISOString(),
|
|
13
|
-
currentVersionId: () => faker.
|
|
14
|
-
description: () => faker.
|
|
15
|
-
iconUrl: () => faker.image.
|
|
16
|
-
id: () => faker.
|
|
17
|
-
name: () => faker.
|
|
18
|
-
serviceId: () => faker.
|
|
19
|
-
type: () => faker.
|
|
13
|
+
currentVersionId: () => faker.string.uuid(),
|
|
14
|
+
description: () => faker.lorem.words(),
|
|
15
|
+
iconUrl: () => faker.image.url(),
|
|
16
|
+
id: () => faker.number.int(),
|
|
17
|
+
name: () => faker.person.jobTitle(),
|
|
18
|
+
serviceId: () => faker.number.int(),
|
|
19
|
+
type: () => faker.lorem.word(),
|
|
20
20
|
updatedAt: () => faker.date.recent().toISOString()
|
|
21
21
|
})
|
|
22
22
|
.after((org, 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('contxtOrganization')
|
|
8
8
|
.option('fromServer', false)
|
|
9
9
|
.attrs({
|
|
10
10
|
createdAt: () => faker.date.past().toISOString(),
|
|
11
|
-
id: () => faker.
|
|
12
|
-
name: () => faker.
|
|
11
|
+
id: () => faker.string.uuid(),
|
|
12
|
+
name: () => faker.person.jobTitle(),
|
|
13
13
|
updatedAt: () => faker.date.recent().toISOString(),
|
|
14
14
|
})
|
|
15
15
|
.after((org, 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('contxtOrganizationFeaturedApplication')
|
|
8
8
|
.option('fromServer', false)
|
|
9
9
|
.attrs({
|
|
10
|
-
applicationId: () => faker.
|
|
10
|
+
applicationId: () => faker.number.int(),
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
|
-
id: () => faker.
|
|
13
|
-
organizationId: () => faker.
|
|
12
|
+
id: () => faker.string.uuid(),
|
|
13
|
+
organizationId: () => faker.string.uuid(),
|
|
14
14
|
updatedAt: () => faker.date.recent().toISOString()
|
|
15
15
|
})
|
|
16
16
|
.after((featuredApp, 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('contxtProject')
|
|
@@ -9,13 +9,13 @@ factory
|
|
|
9
9
|
.attrs({
|
|
10
10
|
createdAt: () => faker.date.past().toISOString(),
|
|
11
11
|
createdBy: () => factory.build('contxtUser').id,
|
|
12
|
-
description: () => faker.
|
|
13
|
-
id: () => faker.
|
|
14
|
-
name: () => faker.
|
|
12
|
+
description: () => faker.lorem.words(),
|
|
13
|
+
id: () => faker.number.int(),
|
|
14
|
+
name: () => faker.person.jobTitle(),
|
|
15
15
|
organizationId: () => factory.build('contxtOrganization').id,
|
|
16
|
-
ownerRoleId: () => faker.
|
|
17
|
-
slug: () => faker.
|
|
18
|
-
type: () => faker.
|
|
16
|
+
ownerRoleId: () => faker.string.uuid(),
|
|
17
|
+
slug: () => faker.lorem.word(),
|
|
18
|
+
type: () => faker.lorem.word(),
|
|
19
19
|
updatedAt: () => faker.date.recent().toISOString()
|
|
20
20
|
})
|
|
21
21
|
.after((project, 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('contxtProjectEnvironment')
|
|
@@ -9,14 +9,14 @@ factory
|
|
|
9
9
|
.attrs({
|
|
10
10
|
createdAt: () => faker.date.past().toISOString(),
|
|
11
11
|
updatedAt: () => faker.date.recent().toISOString(),
|
|
12
|
-
id: () => faker.
|
|
12
|
+
id: () => faker.string.uuid(),
|
|
13
13
|
organizationId: () => factory.build('contxtOrganization').id,
|
|
14
14
|
projectId: () => factory.build('contxtProject').id,
|
|
15
|
-
clusterId: () => faker.
|
|
16
|
-
slug: () => `${faker.
|
|
17
|
-
name: () => faker.
|
|
18
|
-
type: () => faker.
|
|
19
|
-
description: () => faker.
|
|
15
|
+
clusterId: () => faker.string.uuid(),
|
|
16
|
+
slug: () => `${faker.lorem.word()}-${faker.lorem.word()}`,
|
|
17
|
+
name: () => faker.person.jobTitle(),
|
|
18
|
+
type: () => faker.lorem.word(),
|
|
19
|
+
description: () => faker.lorem.words()
|
|
20
20
|
})
|
|
21
21
|
.after((projectEnvironment, options) => {
|
|
22
22
|
// If building an application object that comes from the server, transform it to have camel
|
|
@@ -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('contxtRole')
|
|
@@ -10,17 +10,17 @@ factory
|
|
|
10
10
|
applications: () =>
|
|
11
11
|
factory.buildList(
|
|
12
12
|
'contxtApplication',
|
|
13
|
-
faker.
|
|
13
|
+
faker.number.int({ min: 0, max: 10 })
|
|
14
14
|
),
|
|
15
15
|
createdAt: () => faker.date.past().toISOString(),
|
|
16
16
|
description: () => faker.hacker.phrase(),
|
|
17
|
-
id: () => faker.
|
|
18
|
-
name: () => faker.
|
|
17
|
+
id: () => faker.string.uuid(),
|
|
18
|
+
name: () => faker.person.jobTitle(),
|
|
19
19
|
organizationId: () => factory.build('contxtOrganization').id,
|
|
20
20
|
projects: () =>
|
|
21
21
|
factory.buildList(
|
|
22
22
|
'contxtProject',
|
|
23
|
-
faker.
|
|
23
|
+
faker.number.int({ min: 0, max: 10 })
|
|
24
24
|
),
|
|
25
25
|
updatedAt: () => faker.date.recent().toISOString()
|
|
26
26
|
})
|
|
@@ -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('contxtRoleApplication')
|
|
@@ -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.string.uuid(),
|
|
13
13
|
updatedAt: () => faker.date.recent().toISOString(),
|
|
14
14
|
roleId: () => factory.build('contxtRole').id
|
|
15
15
|
})
|
|
@@ -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('contxtRoleProjectEnvironment')
|
|
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
|
environmentId: () => factory.build('contxtProjectEnvironment').id,
|
|
14
14
|
updatedAt: () => faker.date.recent().toISOString(),
|
|
15
15
|
roleId: () => factory.build('contxtRole').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
|
|
|
6
6
|
factory
|
|
7
7
|
.define('contxtUser')
|
|
@@ -9,12 +9,12 @@ factory
|
|
|
9
9
|
.attrs({
|
|
10
10
|
createdAt: () => faker.date.past().toISOString(),
|
|
11
11
|
email: () => faker.internet.email(),
|
|
12
|
-
firstName: () => faker.
|
|
12
|
+
firstName: () => faker.person.firstName(),
|
|
13
13
|
id: () => `auth0|${faker.internet.password()}`,
|
|
14
|
-
isActivated: () =>
|
|
15
|
-
isSuperuser: () =>
|
|
16
|
-
lastName: () => faker.
|
|
17
|
-
phoneNumber: () => faker.phone.
|
|
14
|
+
isActivated: () => fakerBoolean(),
|
|
15
|
+
isSuperuser: () => fakerBoolean(),
|
|
16
|
+
lastName: () => faker.person.lastName(),
|
|
17
|
+
phoneNumber: () => faker.phone.number(),
|
|
18
18
|
updatedAt: () => faker.date.recent().toISOString()
|
|
19
19
|
})
|
|
20
20
|
.after((user, 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('contxtUserApplication')
|
|
@@ -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.string.uuid(),
|
|
13
13
|
updatedAt: () => faker.date.recent().toISOString(),
|
|
14
14
|
userId: () => factory.build('contxtUser').id
|
|
15
15
|
})
|
|
@@ -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('contxtUserFavoriteApplication')
|
|
8
8
|
.option('fromServer', false)
|
|
9
9
|
.attrs({
|
|
10
|
-
applicationId: () => faker.
|
|
10
|
+
applicationId: () => faker.number.int(),
|
|
11
11
|
createdAt: () => faker.date.past().toISOString(),
|
|
12
|
-
id: () => faker.
|
|
12
|
+
id: () => faker.string.uuid(),
|
|
13
13
|
updatedAt: () => faker.date.recent().toISOString(),
|
|
14
14
|
userId: () => `auth0|${faker.internet.password()}`
|
|
15
15
|
})
|