@ndustrial/contxt-sdk 5.7.4 → 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.
Files changed (210) hide show
  1. package/.nvmrc +1 -1
  2. package/esm/bus/channels.js +0 -1
  3. package/esm/bus/channels.js.map +1 -1
  4. package/esm/bus/index.js +0 -1
  5. package/esm/bus/index.js.map +1 -1
  6. package/esm/bus/webSocketConnection.js +403 -405
  7. package/esm/bus/webSocketConnection.js.map +1 -1
  8. package/esm/config/index.js +27 -27
  9. package/esm/config/index.js.map +1 -1
  10. package/esm/coordinator/applications.js +0 -2
  11. package/esm/coordinator/applications.js.map +1 -1
  12. package/esm/coordinator/consent.js +0 -1
  13. package/esm/coordinator/consent.js.map +1 -1
  14. package/esm/coordinator/edgeNodes.js +0 -1
  15. package/esm/coordinator/edgeNodes.js.map +1 -1
  16. package/esm/coordinator/organizations.js +0 -2
  17. package/esm/coordinator/organizations.js.map +1 -1
  18. package/esm/coordinator/permissions.js +0 -1
  19. package/esm/coordinator/permissions.js.map +1 -1
  20. package/esm/coordinator/roles.js +0 -3
  21. package/esm/coordinator/roles.js.map +1 -1
  22. package/esm/coordinator/users.js +0 -2
  23. package/esm/coordinator/users.js.map +1 -1
  24. package/esm/events/index.js +0 -1
  25. package/esm/events/index.js.map +1 -1
  26. package/esm/files/index.js +20 -31
  27. package/esm/files/index.js.map +1 -1
  28. package/esm/index.js +7 -8
  29. package/esm/index.js.map +1 -1
  30. package/esm/iot/feeds.js +0 -1
  31. package/esm/iot/feeds.js.map +1 -1
  32. package/esm/iot/fieldCategories.js +0 -1
  33. package/esm/iot/fieldCategories.js.map +1 -1
  34. package/esm/iot/fieldGroupings.js +0 -1
  35. package/esm/iot/fieldGroupings.js.map +1 -1
  36. package/esm/iot/fields.js +0 -1
  37. package/esm/iot/fields.js.map +1 -1
  38. package/esm/iot/outputs.js +0 -1
  39. package/esm/iot/outputs.js.map +1 -1
  40. package/esm/nionic/index.js +12 -15
  41. package/esm/nionic/index.js.map +1 -1
  42. package/esm/request.js +8 -9
  43. package/esm/request.js.map +1 -1
  44. package/esm/sessionTypes/auth0WebAuth.js +10 -19
  45. package/esm/sessionTypes/auth0WebAuth.js.map +1 -1
  46. package/esm/sessionTypes/index.js +0 -1
  47. package/esm/sessionTypes/index.js.map +1 -1
  48. package/esm/sessionTypes/machineAuth.js +7 -16
  49. package/esm/sessionTypes/machineAuth.js.map +1 -1
  50. package/esm/sessionTypes/passwordGrantAuth.js +3 -6
  51. package/esm/sessionTypes/passwordGrantAuth.js.map +1 -1
  52. package/esm/utils/iot/formatOutputFieldDataFromServer.js +6 -13
  53. package/esm/utils/iot/formatOutputFieldDataFromServer.js.map +1 -1
  54. package/esm/utils/iot/parseOutputFieldNextPageUrlMetadata.js +0 -2
  55. package/esm/utils/iot/parseOutputFieldNextPageUrlMetadata.js.map +1 -1
  56. package/esm/utils/objects/createCaseChangeFn.js +4 -14
  57. package/esm/utils/objects/createCaseChangeFn.js.map +1 -1
  58. package/esm/utils/objects/map.js +5 -29
  59. package/esm/utils/objects/map.js.map +1 -1
  60. package/esm/utils/pagination/formatPaginatedDataFromServer.js +0 -1
  61. package/esm/utils/pagination/formatPaginatedDataFromServer.js.map +1 -1
  62. package/esm/utils/url/index.js +2 -2
  63. package/lib/bus/channels.js +0 -1
  64. package/lib/bus/channels.js.map +1 -1
  65. package/lib/bus/index.js +0 -1
  66. package/lib/bus/index.js.map +1 -1
  67. package/lib/bus/webSocketConnection.js +403 -405
  68. package/lib/bus/webSocketConnection.js.map +1 -1
  69. package/lib/config/index.js +27 -27
  70. package/lib/config/index.js.map +1 -1
  71. package/lib/coordinator/applications.js +0 -2
  72. package/lib/coordinator/applications.js.map +1 -1
  73. package/lib/coordinator/consent.js +0 -1
  74. package/lib/coordinator/consent.js.map +1 -1
  75. package/lib/coordinator/edgeNodes.js +0 -1
  76. package/lib/coordinator/edgeNodes.js.map +1 -1
  77. package/lib/coordinator/organizations.js +0 -2
  78. package/lib/coordinator/organizations.js.map +1 -1
  79. package/lib/coordinator/permissions.js +0 -1
  80. package/lib/coordinator/permissions.js.map +1 -1
  81. package/lib/coordinator/roles.js +0 -3
  82. package/lib/coordinator/roles.js.map +1 -1
  83. package/lib/coordinator/users.js +0 -2
  84. package/lib/coordinator/users.js.map +1 -1
  85. package/lib/events/index.js +0 -1
  86. package/lib/events/index.js.map +1 -1
  87. package/lib/files/index.js +20 -31
  88. package/lib/files/index.js.map +1 -1
  89. package/lib/index.js +7 -8
  90. package/lib/index.js.map +1 -1
  91. package/lib/iot/feeds.js +0 -1
  92. package/lib/iot/feeds.js.map +1 -1
  93. package/lib/iot/fieldCategories.js +0 -1
  94. package/lib/iot/fieldCategories.js.map +1 -1
  95. package/lib/iot/fieldGroupings.js +0 -1
  96. package/lib/iot/fieldGroupings.js.map +1 -1
  97. package/lib/iot/fields.js +0 -1
  98. package/lib/iot/fields.js.map +1 -1
  99. package/lib/iot/outputs.js +0 -1
  100. package/lib/iot/outputs.js.map +1 -1
  101. package/lib/nionic/index.js +12 -15
  102. package/lib/nionic/index.js.map +1 -1
  103. package/lib/request.js +8 -9
  104. package/lib/request.js.map +1 -1
  105. package/lib/sessionTypes/auth0WebAuth.js +10 -19
  106. package/lib/sessionTypes/auth0WebAuth.js.map +1 -1
  107. package/lib/sessionTypes/index.js +0 -1
  108. package/lib/sessionTypes/index.js.map +1 -1
  109. package/lib/sessionTypes/machineAuth.js +7 -16
  110. package/lib/sessionTypes/machineAuth.js.map +1 -1
  111. package/lib/sessionTypes/passwordGrantAuth.js +3 -6
  112. package/lib/sessionTypes/passwordGrantAuth.js.map +1 -1
  113. package/lib/utils/iot/formatOutputFieldDataFromServer.js +6 -13
  114. package/lib/utils/iot/formatOutputFieldDataFromServer.js.map +1 -1
  115. package/lib/utils/iot/parseOutputFieldNextPageUrlMetadata.js +0 -2
  116. package/lib/utils/iot/parseOutputFieldNextPageUrlMetadata.js.map +1 -1
  117. package/lib/utils/objects/createCaseChangeFn.js +4 -14
  118. package/lib/utils/objects/createCaseChangeFn.js.map +1 -1
  119. package/lib/utils/objects/map.js +5 -29
  120. package/lib/utils/objects/map.js.map +1 -1
  121. package/lib/utils/pagination/formatPaginatedDataFromServer.js +0 -1
  122. package/lib/utils/pagination/formatPaginatedDataFromServer.js.map +1 -1
  123. package/lib/utils/url/index.js +2 -2
  124. package/package.json +14 -7
  125. package/src/bus/index.spec.js +1 -1
  126. package/src/bus/webSocketConnection.js +1 -2
  127. package/src/bus/webSocketConnection.spec.js +53 -53
  128. package/src/config/index.spec.js +5 -5
  129. package/src/coordinator/applications.spec.js +7 -7
  130. package/src/coordinator/consent.spec.js +1 -1
  131. package/src/coordinator/edgeNodes.spec.js +2 -2
  132. package/src/coordinator/organizations.spec.js +3 -3
  133. package/src/coordinator/permissions.spec.js +3 -3
  134. package/src/coordinator/roles.spec.js +3 -3
  135. package/src/coordinator/users.spec.js +17 -17
  136. package/src/events/index.spec.js +15 -15
  137. package/src/files/index.spec.js +8 -8
  138. package/src/index.spec.js +8 -8
  139. package/src/iot/feeds.spec.js +3 -3
  140. package/src/iot/fieldCategories.spec.js +3 -3
  141. package/src/iot/fieldGroupings.spec.js +4 -4
  142. package/src/iot/outputs.spec.js +6 -6
  143. package/src/request.spec.js +3 -3
  144. package/src/sessionTypes/auth0WebAuth.spec.js +16 -14
  145. package/src/sessionTypes/index.spec.js +1 -1
  146. package/src/sessionTypes/machineAuth.spec.js +5 -5
  147. package/src/sessionTypes/passwordGrantAuth.spec.js +1 -1
  148. package/src/utils/iot/formatOutputFieldDataFromServer.spec.js +6 -6
  149. package/src/utils/iot/parseOutputFieldNextPageUrlMetadata.spec.js +3 -3
  150. package/src/utils/pagination/formatPaginatedDataFromServer.spec.js +2 -2
  151. package/src/utils/url/stringifyParams.spec.js +3 -3
  152. package/support/fixtures/factories/IOSDevice.js +4 -4
  153. package/support/fixtures/factories/applicationGrouping.js +6 -6
  154. package/support/fixtures/factories/applicationModule.js +3 -3
  155. package/support/fixtures/factories/asset.js +2 -2
  156. package/support/fixtures/factories/assetAttribute.js +4 -4
  157. package/support/fixtures/factories/assetAttributeValue.js +3 -3
  158. package/support/fixtures/factories/assetMetric.js +3 -3
  159. package/support/fixtures/factories/assetMetricValue.js +4 -4
  160. package/support/fixtures/factories/assetMetricValueCompact.js +3 -3
  161. package/support/fixtures/factories/assetType.js +2 -2
  162. package/support/fixtures/factories/audience.js +1 -1
  163. package/support/fixtures/factories/authResults.js +4 -4
  164. package/support/fixtures/factories/channel.js +2 -2
  165. package/support/fixtures/factories/contxtApplication.js +10 -10
  166. package/support/fixtures/factories/contxtOrganization.js +3 -3
  167. package/support/fixtures/factories/contxtOrganizationFeaturedApplication.js +4 -4
  168. package/support/fixtures/factories/contxtProject.js +7 -7
  169. package/support/fixtures/factories/contxtProjectEnvironment.js +7 -7
  170. package/support/fixtures/factories/contxtRole.js +5 -5
  171. package/support/fixtures/factories/contxtRoleApplication.js +2 -2
  172. package/support/fixtures/factories/contxtRoleProjectEnvironment.js +3 -3
  173. package/support/fixtures/factories/contxtUser.js +6 -6
  174. package/support/fixtures/factories/contxtUserApplication.js +2 -2
  175. package/support/fixtures/factories/contxtUserFavoriteApplication.js +3 -3
  176. package/support/fixtures/factories/contxtUserPermissions.js +6 -6
  177. package/support/fixtures/factories/contxtUserProjectEnvironment.js +3 -3
  178. package/support/fixtures/factories/contxtUserRole.js +3 -3
  179. package/support/fixtures/factories/costCenter.js +3 -3
  180. package/support/fixtures/factories/costCenterFacility.js +4 -4
  181. package/support/fixtures/factories/edgeNode.js +2 -2
  182. package/support/fixtures/factories/event.js +7 -7
  183. package/support/fixtures/factories/eventType.js +6 -6
  184. package/support/fixtures/factories/eventUser.js +8 -8
  185. package/support/fixtures/factories/facility.js +12 -12
  186. package/support/fixtures/factories/facilityGrouping.js +5 -5
  187. package/support/fixtures/factories/facilityGroupingFacility.js +4 -4
  188. package/support/fixtures/factories/facilityInfo.js +6 -6
  189. package/support/fixtures/factories/facilityTag.js +2 -2
  190. package/support/fixtures/factories/feedStatus.js +3 -3
  191. package/support/fixtures/factories/feedType.js +2 -2
  192. package/support/fixtures/factories/feeds.js +8 -8
  193. package/support/fixtures/factories/fieldCategory.js +4 -4
  194. package/support/fixtures/factories/fieldGrouping.js +6 -6
  195. package/support/fixtures/factories/fieldGroupingField.js +4 -4
  196. package/support/fixtures/factories/fieldGroupingStatus.js +3 -3
  197. package/support/fixtures/factories/file.js +3 -3
  198. package/support/fixtures/factories/fileToDownload.js +1 -1
  199. package/support/fixtures/factories/fileUploadInfo.js +3 -3
  200. package/support/fixtures/factories/organization.js +3 -3
  201. package/support/fixtures/factories/outputField.js +18 -18
  202. package/support/fixtures/factories/outputFieldData.js +2 -2
  203. package/support/fixtures/factories/owner.js +5 -5
  204. package/support/fixtures/factories/paginationMetadata.js +3 -3
  205. package/support/fixtures/factories/triggeredEvent.js +5 -5
  206. package/support/fixtures/factories/userEventSubscription.js +3 -3
  207. package/support/fixtures/factories/userMobileNumber.js +4 -4
  208. package/support/fixtures/factories/userPermissionsMap.js +3 -3
  209. package/support/fixtures/factories/userProfile.js +3 -3
  210. 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.datatype.number(),
20
- hasMore: faker.datatype.boolean(),
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.datatype.number(),
24
+ limit: faker.number.int(),
25
25
  timeEnd: expectedOutputFieldMetadata.nextRecordTime,
26
26
  timeStart: Math.floor(faker.date.past().getTime() / 1000),
27
- window: faker.random.arrayElement([0, 60, 900, 3600])
27
+ window: faker.helpers.arrayElement([0, 60, 900, 3600])
28
28
  };
29
29
  expectedOutputFieldDataRecords = fixture.buildList(
30
30
  'outputFieldData',
31
- faker.datatype.number({ min: 1, max: 10 })
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.datatype.number() +
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.datatype.number(),
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.random.arrayElement([0, 60, 900, 3600])
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.datatype.number() +
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.datatype.number({ min: 1, max: 10 }), () =>
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.datatype.number({ min: 1, max: 10 })
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.datatype.number() };
21
+ value = { value: faker.number.int() };
22
22
  word = { word: faker.lorem.word() };
23
- uuid = { uuid: faker.datatype.uuid() };
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.datatype.uuid(),
13
- isActive: () => faker.datatype.boolean(),
14
- snsEndpointArn: () => faker.datatype.uuid(),
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.datatype.number(),
10
- id: () => faker.datatype.uuid(),
11
- index: () => faker.datatype.number(),
12
- label: () => faker.random.words()
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.datatype.number({ min: 1, max: 10 }),
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.datatype.uuid(),
13
- index: () => faker.datatype.number(),
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.datatype.uuid(),
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.random.arrayElement(['boolean', 'date', 'number', 'string']),
13
+ faker.helpers.arrayElement(['boolean', 'date', 'number', 'string']),
14
14
  description: () => faker.lorem.sentence(),
15
- id: () => faker.datatype.uuid(),
16
- isRequired: () => faker.datatype.boolean(),
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.datatype.uuid(),
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.datatype.number()}`
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.datatype.uuid(),
13
+ id: () => faker.string.uuid(),
14
14
  label: () => faker.hacker.phrase(),
15
15
  organizationId: () => factory.build('organization').id,
16
16
  timeInterval: () =>
17
- faker.random.arrayElement([
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.datatype.uuid(),
15
+ id: () => faker.string.uuid(),
16
16
  notes: () => faker.lorem.sentence(),
17
17
  updatedAt: () => faker.date.recent().toISOString(),
18
- value: () => `${faker.datatype.number()}`,
19
- isEstimated: () => faker.datatype.boolean()
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.datatype.uuid(),
9
- value: faker.datatype.number(),
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.datatype.uuid(),
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,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.define('audience').attrs({
7
7
  clientId: () => faker.internet.password(),
@@ -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.datatype.uuid(),
7
+ accessToken: () => faker.string.uuid(),
8
8
  expiresAt: () => sometimeSoon(2, 24)
9
9
  });
10
10
 
11
11
  factory.define('MachineAuthSessionInfo').attrs({
12
- apiToken: () => faker.datatype.uuid(),
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.datatype.number(range);
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.datatype.uuid(),
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.datatype.uuid(),
11
- clientSecret: () => faker.datatype.uuid(),
10
+ clientId: () => faker.string.uuid(),
11
+ clientSecret: () => faker.string.uuid(),
12
12
  createdAt: () => faker.date.past().toISOString(),
13
- currentVersionId: () => faker.datatype.uuid(),
14
- description: () => faker.random.words(),
15
- iconUrl: () => faker.image.imageUrl(),
16
- id: () => faker.datatype.number(),
17
- name: () => faker.name.title(),
18
- serviceId: () => faker.datatype.number(),
19
- type: () => faker.random.word(),
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.datatype.uuid(),
12
- name: () => faker.name.title(),
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.datatype.number(),
10
+ applicationId: () => faker.number.int(),
11
11
  createdAt: () => faker.date.past().toISOString(),
12
- id: () => faker.datatype.uuid(),
13
- organizationId: () => faker.datatype.uuid(),
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.random.words(),
13
- id: () => faker.datatype.number(),
14
- name: () => faker.name.title(),
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.datatype.uuid(),
17
- slug: () => faker.random.word(),
18
- type: () => faker.random.word(),
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.datatype.uuid(),
12
+ id: () => faker.string.uuid(),
13
13
  organizationId: () => factory.build('contxtOrganization').id,
14
14
  projectId: () => factory.build('contxtProject').id,
15
- clusterId: () => faker.datatype.uuid(),
16
- slug: () => `${faker.random.word()}-${faker.random.word()}`,
17
- name: () => faker.name.title(),
18
- type: () => faker.random.word(),
19
- description: () => faker.random.words()
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.datatype.number({ min: 0, max: 10 })
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.datatype.uuid(),
18
- name: () => faker.name.title(),
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.datatype.number({ min: 0, max: 10 })
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.datatype.uuid(),
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.random.arrayElement(['reader', 'admin']),
10
+ accessType: () => faker.helpers.arrayElement(['reader', 'admin']),
11
11
  createdAt: () => faker.date.past().toISOString(),
12
- id: () => faker.datatype.uuid(),
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.name.firstName(),
12
+ firstName: () => faker.person.firstName(),
13
13
  id: () => `auth0|${faker.internet.password()}`,
14
- isActivated: () => faker.datatype.boolean(),
15
- isSuperuser: () => faker.datatype.boolean(),
16
- lastName: () => faker.name.lastName(),
17
- phoneNumber: () => faker.phone.phoneNumber(),
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.datatype.uuid(),
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.datatype.number(),
10
+ applicationId: () => faker.number.int(),
11
11
  createdAt: () => faker.date.past().toISOString(),
12
- id: () => faker.datatype.uuid(),
12
+ id: () => faker.string.uuid(),
13
13
  updatedAt: () => faker.date.recent().toISOString(),
14
14
  userId: () => `auth0|${faker.internet.password()}`
15
15
  })