@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
@@ -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.datatype.number({ min: 0, max: 15 })
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.datatype.number({ min: 0, max: 15 })
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.datatype.number({ min: 0, max: 15 }))
27
+ .buildList('contxtRole', faker.number.int({ min: 0, max: 15 }))
28
28
  .map(({ id }) => ({ id })),
29
29
  projectsExplicit: () =>
30
- times(faker.datatype.number({ min: 0, max: 15 }), () => {
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.datatype.number({ min: 0, max: 15 }), () => {
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.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
  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.datatype.uuid(),
12
- mappedFromExternalGroup: () => faker.datatype.boolean(),
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.datatype.uuid(),
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.datatype.number({
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.datatype.uuid(),
11
- facilityId: () => faker.datatype.number(),
12
- id: () => faker.datatype.uuid()
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.datatype.uuid(),
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: () => faker.datatype.boolean(),
10
+ allowOthersToTrigger: () => fakerBoolean(),
11
11
  createdAt: () => faker.date.past().toISOString(),
12
12
  deletedAt: () => faker.date.recent().toISOString(),
13
- facilityId: () => faker.datatype.number(),
14
- id: () => faker.datatype.uuid(),
15
- isPublic: () => faker.datatype.boolean(),
16
- name: () => faker.company.companyName(),
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.datatype.uuid(),
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.datatype.uuid(),
14
- isOngoingEvent: () => faker.datatype.boolean(),
15
- isRealtimeEnabled: () => faker.datatype.boolean(),
16
- level: () => faker.datatype.number(),
17
- name: () => faker.company.companyName(),
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.name.firstName(),
14
- id: () => `auth0|${faker.datatype.number()}`,
15
- isMachineUser: () => faker.datatype.boolean(),
16
- lastName: () => faker.name.lastName(),
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.datatype.number({
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.datatype.number({
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.datatype.number({
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.address.streetAddress(),
13
- address2: () => faker.address.secondaryAddress(),
14
- assetId: () => faker.datatype.uuid(),
15
- city: () => faker.address.city(),
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.datatype.uuid(),
17
+ geometryId: () => faker.string.uuid(),
18
18
  info: () => factory.build('facilityInfo'),
19
- state: () => faker.address.state(),
19
+ state: () => faker.location.state(),
20
20
  timezone: () => {
21
- return faker.random.arrayElement([
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.address.zipCode()
29
+ zip: () => faker.location.zipCode()
30
30
  })
31
31
  .attr('facilityGroupings', ['id', 'fromServer'], (id, fromServer) => {
32
32
  return times(
33
- faker.datatype.number({
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.address.cityPrefix()} ${city}`)
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.datatype.number({
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.datatype.uuid(),
13
- isPrivate: () => faker.datatype.boolean(),
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.userName(),
17
- parentGroupingId: () => faker.datatype.uuid(),
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.datatype.uuid(),
12
- facilityId: () => faker.datatype.number(),
13
- id: () => faker.datatype.uuid(),
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.name.findName(),
8
- latitude: () => faker.address.latitude(),
9
- longitude: () => faker.address.longitude(),
10
- rail_access: () => `${faker.datatype.boolean()}`,
11
- square_feet: () => `${faker.datatype.number()}`
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.datatype.number(),
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.datatype.number(),
11
+ feedId: () => faker.number.int(),
12
12
  feedStatusId: () => null,
13
- status: () => faker.random.arrayElement(['Active', 'Degraded', 'Critical']),
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.datatype.number({ min: 1000, max: 9999 }),
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.datatype.number({ min: 0, max: 5 }),
13
- degradedThreshold: () => faker.datatype.number({ min: 0, max: 5 }),
14
- downAfter: () => faker.datatype.number({ min: 1000, max: 9999 }),
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: () => faker.datatype.boolean(),
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.random.arrayElement(['Active', 'Degraded', 'Critical']),
22
- statusEventId: () => faker.datatype.uuid(),
21
+ status: () => faker.helpers.arrayElement(['Active', 'Degraded', 'Critical']),
22
+ statusEventId: () => faker.string.uuid(),
23
23
  timezone: () => {
24
- return faker.random.arrayElement([
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.datatype.uuid(),
12
+ id: () => faker.string.uuid(),
13
13
  name: () => faker.commerce.productName(),
14
- organizationId: () => faker.datatype.uuid(),
15
- parentCategoryId: () => faker.datatype.uuid(),
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.datatype.uuid(),
13
- facilityId: () => faker.datatype.number(),
14
- id: () => faker.datatype.uuid(),
15
- isPublic: () => faker.datatype.boolean(),
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.userName(),
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.datatype.uuid(),
12
- outputFieldId: () => faker.datatype.number(),
13
- id: () => faker.datatype.uuid(),
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.datatype.uuid(),
10
+ id: () => faker.string.uuid(),
11
11
  label: () => faker.commerce.productName(),
12
- status: () => faker.random.arrayElement(['Active', 'Out-of-Date']),
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.datatype.uuid(),
14
+ id: () => faker.string.uuid(),
15
15
  organizationId: () => factory.build('organization').id,
16
- status: () => faker.random.arrayElement(['ACTIVE', 'UPLOADING']),
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
 
6
6
  factory
7
7
  .define('fileToDownload')
@@ -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.datatype.number({ min: 1, max: 5 })).reduce((memo) => {
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.internet.avatar()
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.datatype.uuid(),
11
- name: () => faker.company.companyName(),
10
+ id: () => faker.string.uuid(),
11
+ name: () => faker.company.name(),
12
12
  updatedAt: () => faker.date.recent().toISOString()
13
13
  })
14
14
  .after((organization, options) => {