@ndustrial/contxt-sdk 4.3.4 → 5.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/.gitattributes +1 -0
  2. package/.nvmrc +1 -1
  3. package/CHANGELOG.md +8 -0
  4. package/docs/Facilities.md +0 -144
  5. package/docs/FacilityGroupings.md +0 -160
  6. package/docs/Nionic.md +63 -0
  7. package/docs/README.md +3 -29
  8. package/docs/Typedefs.md +0 -101
  9. package/esm/config/audiences.js +13 -13
  10. package/esm/config/audiences.js.map +1 -1
  11. package/esm/index.js +3 -6
  12. package/esm/index.js.map +1 -1
  13. package/esm/nionic/index.js +126 -0
  14. package/esm/nionic/index.js.map +1 -0
  15. package/lib/config/audiences.js +13 -13
  16. package/lib/config/audiences.js.map +1 -1
  17. package/lib/index.js +19 -13
  18. package/lib/index.js.map +1 -1
  19. package/lib/nionic/index.js +130 -0
  20. package/lib/nionic/index.js.map +1 -0
  21. package/meta.yaml +11 -0
  22. package/package.json +9 -10
  23. package/src/bus/index.spec.js +3 -2
  24. package/src/bus/webSocketConnection.spec.js +31 -31
  25. package/src/config/audiences.js +13 -13
  26. package/src/config/index.spec.js +6 -6
  27. package/src/coordinator/applications.spec.js +8 -8
  28. package/src/coordinator/consent.spec.js +1 -1
  29. package/src/coordinator/edgeNodes.spec.js +3 -3
  30. package/src/coordinator/organizations.spec.js +4 -4
  31. package/src/coordinator/permissions.spec.js +4 -4
  32. package/src/coordinator/roles.spec.js +3 -3
  33. package/src/coordinator/users.spec.js +14 -15
  34. package/src/events/index.spec.js +16 -16
  35. package/src/files/index.spec.js +7 -7
  36. package/src/index.js +3 -6
  37. package/src/index.spec.js +8 -22
  38. package/src/iot/feeds.spec.js +4 -4
  39. package/src/iot/fieldCategories.spec.js +4 -4
  40. package/src/iot/fieldGroupings.spec.js +5 -5
  41. package/src/iot/outputs.spec.js +6 -6
  42. package/src/nionic/index.js +151 -0
  43. package/src/request.spec.js +3 -3
  44. package/src/sessionTypes/auth0WebAuth.spec.js +2 -2
  45. package/src/sessionTypes/index.spec.js +3 -3
  46. package/src/sessionTypes/machineAuth.spec.js +3 -3
  47. package/src/sessionTypes/passwordGrantAuth.spec.js +1 -1
  48. package/src/utils/iot/formatOutputFieldDataFromServer.spec.js +6 -6
  49. package/src/utils/iot/parseOutputFieldNextPageUrlMetadata.spec.js +2 -2
  50. package/src/utils/pagination/formatPaginatedDataFromServer.spec.js +2 -2
  51. package/src/utils/url/stringifyParams.spec.js +2 -3
  52. package/support/fixtures/factories/IOSDevice.js +3 -3
  53. package/support/fixtures/factories/applicationGrouping.js +4 -4
  54. package/support/fixtures/factories/applicationModule.js +2 -2
  55. package/support/fixtures/factories/asset.js +1 -1
  56. package/support/fixtures/factories/assetAttribute.js +2 -2
  57. package/support/fixtures/factories/assetAttributeValue.js +2 -2
  58. package/support/fixtures/factories/assetMetric.js +1 -1
  59. package/support/fixtures/factories/assetMetricValue.js +3 -3
  60. package/support/fixtures/factories/assetMetricValueCompact.js +2 -2
  61. package/support/fixtures/factories/assetType.js +1 -1
  62. package/support/fixtures/factories/authResults.js +3 -3
  63. package/support/fixtures/factories/channel.js +1 -1
  64. package/support/fixtures/factories/contxtApplication.js +5 -5
  65. package/support/fixtures/factories/contxtOrganization.js +2 -2
  66. package/support/fixtures/factories/contxtOrganizationFeaturedApplication.js +3 -3
  67. package/support/fixtures/factories/contxtProject.js +2 -2
  68. package/support/fixtures/factories/contxtProjectEnvironment.js +2 -2
  69. package/support/fixtures/factories/contxtRole.js +3 -3
  70. package/support/fixtures/factories/contxtRoleApplication.js +1 -1
  71. package/support/fixtures/factories/contxtRoleProjectEnvironment.js +1 -1
  72. package/support/fixtures/factories/contxtUser.js +2 -2
  73. package/support/fixtures/factories/contxtUserApplication.js +1 -1
  74. package/support/fixtures/factories/contxtUserFavoriteApplication.js +2 -2
  75. package/support/fixtures/factories/contxtUserPermissions.js +5 -5
  76. package/support/fixtures/factories/contxtUserProjectEnvironment.js +1 -1
  77. package/support/fixtures/factories/contxtUserRole.js +2 -2
  78. package/support/fixtures/factories/costCenter.js +2 -2
  79. package/support/fixtures/factories/costCenterFacility.js +3 -3
  80. package/support/fixtures/factories/edgeNode.js +1 -1
  81. package/support/fixtures/factories/event.js +5 -5
  82. package/support/fixtures/factories/eventType.js +4 -4
  83. package/support/fixtures/factories/eventUser.js +5 -5
  84. package/support/fixtures/factories/facility.js +4 -4
  85. package/support/fixtures/factories/facilityGrouping.js +3 -3
  86. package/support/fixtures/factories/facilityGroupingFacility.js +3 -3
  87. package/support/fixtures/factories/facilityInfo.js +2 -2
  88. package/support/fixtures/factories/facilityTag.js +1 -1
  89. package/support/fixtures/factories/feedStatus.js +1 -1
  90. package/support/fixtures/factories/feedType.js +1 -1
  91. package/support/fixtures/factories/feeds.js +5 -5
  92. package/support/fixtures/factories/fieldCategory.js +3 -3
  93. package/support/fixtures/factories/fieldGrouping.js +4 -4
  94. package/support/fixtures/factories/fieldGroupingField.js +3 -3
  95. package/support/fixtures/factories/fieldGroupingStatus.js +1 -1
  96. package/support/fixtures/factories/file.js +1 -1
  97. package/support/fixtures/factories/fileUploadInfo.js +1 -1
  98. package/support/fixtures/factories/organization.js +1 -1
  99. package/support/fixtures/factories/outputField.js +10 -10
  100. package/support/fixtures/factories/outputFieldData.js +1 -1
  101. package/support/fixtures/factories/owner.js +2 -2
  102. package/support/fixtures/factories/paginationMetadata.js +2 -2
  103. package/support/fixtures/factories/triggeredEvent.js +4 -4
  104. package/support/fixtures/factories/userEventSubscription.js +1 -1
  105. package/support/fixtures/factories/userMobileNumber.js +1 -1
  106. package/support/fixtures/factories/userPermissionsMap.js +2 -2
  107. package/.envrc +0 -0
  108. package/.huskyrc.js +0 -11
  109. package/.nycrc +0 -12
  110. package/esm/assets/assetAttributes.js +0 -574
  111. package/esm/assets/assetAttributes.js.map +0 -1
  112. package/esm/assets/assetMetrics.js +0 -690
  113. package/esm/assets/assetMetrics.js.map +0 -1
  114. package/esm/assets/assetTypes.js +0 -273
  115. package/esm/assets/assetTypes.js.map +0 -1
  116. package/esm/assets/index.js +0 -283
  117. package/esm/assets/index.js.map +0 -1
  118. package/esm/facilities/costCenters.js +0 -306
  119. package/esm/facilities/costCenters.js.map +0 -1
  120. package/esm/facilities/groupings.js +0 -323
  121. package/esm/facilities/groupings.js.map +0 -1
  122. package/esm/facilities/index.js +0 -343
  123. package/esm/facilities/index.js.map +0 -1
  124. package/esm/health/index.js +0 -229
  125. package/esm/health/index.js.map +0 -1
  126. package/esm/utils/facilities/formatFacilityWithInfoFromServer.js +0 -65
  127. package/esm/utils/facilities/formatFacilityWithInfoFromServer.js.map +0 -1
  128. package/esm/utils/facilities/index.js +0 -4
  129. package/esm/utils/facilities/index.js.map +0 -1
  130. package/lib/assets/assetAttributes.js +0 -588
  131. package/lib/assets/assetAttributes.js.map +0 -1
  132. package/lib/assets/assetMetrics.js +0 -705
  133. package/lib/assets/assetMetrics.js.map +0 -1
  134. package/lib/assets/assetTypes.js +0 -287
  135. package/lib/assets/assetTypes.js.map +0 -1
  136. package/lib/assets/index.js +0 -302
  137. package/lib/assets/index.js.map +0 -1
  138. package/lib/facilities/costCenters.js +0 -316
  139. package/lib/facilities/costCenters.js.map +0 -1
  140. package/lib/facilities/groupings.js +0 -333
  141. package/lib/facilities/groupings.js.map +0 -1
  142. package/lib/facilities/index.js +0 -360
  143. package/lib/facilities/index.js.map +0 -1
  144. package/lib/health/index.js +0 -232
  145. package/lib/health/index.js.map +0 -1
  146. package/lib/utils/facilities/formatFacilityWithInfoFromServer.js +0 -71
  147. package/lib/utils/facilities/formatFacilityWithInfoFromServer.js.map +0 -1
  148. package/lib/utils/facilities/index.js +0 -15
  149. package/lib/utils/facilities/index.js.map +0 -1
  150. package/src/assets/assetAttributes.js +0 -619
  151. package/src/assets/assetAttributes.spec.js +0 -1143
  152. package/src/assets/assetMetrics.js +0 -736
  153. package/src/assets/assetMetrics.spec.js +0 -1180
  154. package/src/assets/assetTypes.js +0 -260
  155. package/src/assets/assetTypes.spec.js +0 -556
  156. package/src/assets/index.js +0 -271
  157. package/src/assets/index.spec.js +0 -515
  158. package/src/facilities/costCenters.js +0 -295
  159. package/src/facilities/costCenters.spec.js +0 -529
  160. package/src/facilities/groupings.js +0 -320
  161. package/src/facilities/groupings.spec.js +0 -567
  162. package/src/facilities/index.js +0 -343
  163. package/src/facilities/index.spec.js +0 -551
  164. package/src/health/index.js +0 -200
  165. package/src/health/index.spec.js +0 -501
  166. package/src/utils/facilities/formatFacilityWithInfoFromServer.js +0 -62
  167. package/src/utils/facilities/formatFacilityWithInfoFromServer.spec.js +0 -73
  168. package/src/utils/facilities/index.js +0 -3
  169. package/tmp/package.json +0 -11
package/.gitattributes ADDED
@@ -0,0 +1 @@
1
+ docs/** linguist-generated
package/.nvmrc CHANGED
@@ -1 +1 @@
1
- v14.19.0
1
+ v16.14.0
package/CHANGELOG.md CHANGED
@@ -1,3 +1,11 @@
1
+ ## [v4.3.1](http://github.com/ndustrialio/contxt-sdk-js/tree/v4.3.1) (2022-03-17)
2
+
3
+ **Changed**
4
+
5
+ - updates the auth staging client_id
6
+ - updates the auth staging default url to contxt-auth-service.staging.ndustrial.io
7
+ - updates the contxt api staging default url to contxt.api.staging.ndustrial.io
8
+
1
9
  ## [v4.3.0](http://github.com/ndustrialio/contxt-sdk-js/tree/v4.3.0) (2021-11-01)
2
10
 
3
11
  **Changed**
@@ -8,13 +8,8 @@ of, information about different facilities
8
8
 
9
9
  * [Facilities](#Facilities)
10
10
  * [new Facilities(sdk, request)](#new_Facilities_new)
11
- * [.create(facility)](#Facilities+create) ⇒ <code>Promise</code>
12
- * [.createOrUpdateInfo(facilityId, update)](#Facilities+createOrUpdateInfo) ⇒ <code>Promise</code>
13
- * [.delete(facilityId)](#Facilities+delete) ⇒ <code>Promise</code>
14
11
  * [.get(facilityId)](#Facilities+get) ⇒ <code>Promise</code>
15
- * [.getAll()](#Facilities+getAll) ⇒ <code>Promise</code>
16
12
  * [.getAllByOrganizationId(organizationId, [options])](#Facilities+getAllByOrganizationId) ⇒ <code>Promise</code>
17
- * [.update(facilityId, update)](#Facilities+update) ⇒ <code>Promise</code>
18
13
 
19
14
  <a name="new_Facilities_new"></a>
20
15
 
@@ -25,87 +20,6 @@ of, information about different facilities
25
20
  | sdk | <code>Object</code> | An instance of the SDK so the module can communicate with other modules |
26
21
  | request | <code>Object</code> | An instance of the request module tied to this module's audience. |
27
22
 
28
- <a name="Facilities+create"></a>
29
-
30
- ### contxtSdk.facilities.create(facility) ⇒ <code>Promise</code>
31
- Creates a new facility
32
-
33
- API Endpoint: '/facilities'
34
- Method: POST
35
-
36
- **Kind**: instance method of [<code>Facilities</code>](#Facilities)
37
- **Fulfill**: [<code>Facility</code>](./Typedefs.md#Facility) Information about the new facility
38
- **Reject**: <code>Error</code>
39
-
40
- | Param | Type | Description |
41
- | --- | --- | --- |
42
- | facility | <code>Object</code> | |
43
- | [facility.address1] | <code>string</code> | |
44
- | [facility.address2] | <code>string</code> | |
45
- | [facility.assetId] | <code>string</code> | UUID corresponding with an asset |
46
- | [facility.city] | <code>string</code> | |
47
- | [facility.geometryId] | <code>string</code> | UUID corresponding with a geometry |
48
- | facility.name | <code>string</code> | |
49
- | facility.organizationId | <code>string</code> | UUID corresponding with an organization |
50
- | [facility.state] | <code>string</code> | |
51
- | facility.timezone | <code>string</code> | |
52
- | [facility.weatherLocationId] | <code>number</code> | |
53
- | [facility.zip] | <code>string</code> | |
54
-
55
- **Example**
56
- ```js
57
- contxtSdk.facilities
58
- .create({
59
- address: '221 B Baker St, London, England',
60
- name: 'Sherlock Holmes Museum',
61
- organizationId: 25
62
- })
63
- .then((facilities) => console.log(facilities))
64
- .catch((err) => console.log(err));
65
- ```
66
- <a name="Facilities+createOrUpdateInfo"></a>
67
-
68
- ### contxtSdk.facilities.createOrUpdateInfo(facilityId, update) ⇒ <code>Promise</code>
69
- Creates or updates a facility's info (NOTE: This refers to the facility_info model)
70
-
71
- API Endpoint: '/facilities/:facilityId/info?should_update=true'
72
- Method: POST
73
-
74
- **Kind**: instance method of [<code>Facilities</code>](#Facilities)
75
- **Fulfill**: <code>undefined</code>
76
- **Reject**: <code>Error</code>
77
-
78
- | Param | Type | Description |
79
- | --- | --- | --- |
80
- | facilityId | <code>number</code> | The ID of the facility to update |
81
- | update | <code>Object</code> | An object containing the facility info for the facility |
82
-
83
- **Example**
84
- ```js
85
- contxtSdk.facilities.createOrUpdateInfo(25, {
86
- square_feet: '10000'
87
- });
88
- ```
89
- <a name="Facilities+delete"></a>
90
-
91
- ### contxtSdk.facilities.delete(facilityId) ⇒ <code>Promise</code>
92
- Deletes a facility
93
-
94
- API Endpoint: '/facilities/:facilityId'
95
- Method: DELETE
96
-
97
- **Kind**: instance method of [<code>Facilities</code>](#Facilities)
98
- **Fulfill**: <code>undefined</code>
99
- **Reject**: <code>Error</code>
100
-
101
- | Param | Type | Description |
102
- | --- | --- | --- |
103
- | facilityId | <code>number</code> | The ID of the facility |
104
-
105
- **Example**
106
- ```js
107
- contxtSdk.facilities.delete(25);
108
- ```
109
23
  <a name="Facilities+get"></a>
110
24
 
111
25
  ### contxtSdk.facilities.get(facilityId) ⇒ <code>Promise</code>
@@ -129,32 +43,11 @@ contxtSdk.facilities
129
43
  .then((facility) => console.log(facility))
130
44
  .catch((err) => console.log(err));
131
45
  ```
132
- <a name="Facilities+getAll"></a>
133
-
134
- ### contxtSdk.facilities.getAll() ⇒ <code>Promise</code>
135
- Gets a list of all facilities
136
-
137
- API Endpoint: '/facilities'
138
- Method: GET
139
-
140
- **Kind**: instance method of [<code>Facilities</code>](#Facilities)
141
- **Fulfill**: <code>Facility[]</code> Information about all facilities
142
- **Reject**: <code>Error</code>
143
- **Example**
144
- ```js
145
- contxtSdk.facilities
146
- .getAll()
147
- .then((facilities) => console.log(facilities))
148
- .catch((err) => console.log(err));
149
- ```
150
46
  <a name="Facilities+getAllByOrganizationId"></a>
151
47
 
152
48
  ### contxtSdk.facilities.getAllByOrganizationId(organizationId, [options]) ⇒ <code>Promise</code>
153
49
  Gets a list of all facilities that belong to a particular organization
154
50
 
155
- API Endpoint: '/organizations/:organizationId/facilities'
156
- Method: GET
157
-
158
51
  **Kind**: instance method of [<code>Facilities</code>](#Facilities)
159
52
  **Fulfill**: <code>Facility[]</code> Information about all facilities
160
53
  **Reject**: <code>Error</code>
@@ -172,40 +65,3 @@ contxtSdk.facilities
172
65
  .then((facilities) => console.log(facilities))
173
66
  .catch((err) => console.log(err));
174
67
  ```
175
- <a name="Facilities+update"></a>
176
-
177
- ### contxtSdk.facilities.update(facilityId, update) ⇒ <code>Promise</code>
178
- Updates a facility's specifics
179
-
180
- API Endpoint: '/facilities/:facilityId'
181
- Method: PUT
182
-
183
- **Kind**: instance method of [<code>Facilities</code>](#Facilities)
184
- **Fulfill**: <code>undefined</code>
185
- **Reject**: <code>Error</code>
186
-
187
- | Param | Type | Description |
188
- | --- | --- | --- |
189
- | facilityId | <code>number</code> | The ID of the facility to update |
190
- | update | <code>Object</code> | An object containing the updated data for the facility |
191
- | [update.address1] | <code>string</code> | |
192
- | [update.address2] | <code>string</code> | |
193
- | [update.assetId] | <code>string</code> | UUID corresponding with an asset |
194
- | [update.city] | <code>string</code> | |
195
- | [update.geometryId] | <code>string</code> | UUID corresponding with a geometry |
196
- | [update.info] | <code>Object</code> | User declared information |
197
- | [update.name] | <code>string</code> | |
198
- | [update.organizationId] | <code>string</code> | UUID corresponding with an organization |
199
- | [update.state] | <code>string</code> | |
200
- | [update.timezone] | <code>string</code> | |
201
- | [update.weatherLocationId] | <code>number</code> | |
202
- | [update.zip] | <code>string</code> | |
203
-
204
- **Example**
205
- ```js
206
- contxtSdk.facilities.update(25, {
207
- address: '221 B Baker St, London, England',
208
- name: 'Sherlock Homes Museum',
209
- organizationId: 25
210
- });
211
- ```
@@ -8,13 +8,7 @@ the relationship between those groupings and facilities
8
8
 
9
9
  * [FacilityGroupings](#FacilityGroupings)
10
10
  * [new FacilityGroupings(sdk, request, baseUrl)](#new_FacilityGroupings_new)
11
- * [.addFacility(facilityGroupingId, facilityId)](#FacilityGroupings+addFacility) ⇒ <code>Promise</code>
12
- * [.create(facilityGrouping)](#FacilityGroupings+create) ⇒ <code>Promise</code>
13
- * [.delete(facilityGroupingId)](#FacilityGroupings+delete) ⇒ <code>Promise</code>
14
- * [.getAll()](#FacilityGroupings+getAll) ⇒ <code>Promise</code>
15
11
  * [.getAllByOrganizationId(organizationId)](#FacilityGroupings+getAllByOrganizationId) ⇒ <code>Promise</code>
16
- * [.removeFacility(facilityGroupingId, facilityId)](#FacilityGroupings+removeFacility) ⇒ <code>Promise</code>
17
- * [.update(facilityGroupingId, update)](#FacilityGroupings+update) ⇒ <code>Promise</code>
18
12
 
19
13
  <a name="new_FacilityGroupings_new"></a>
20
14
 
@@ -26,105 +20,6 @@ the relationship between those groupings and facilities
26
20
  | request | <code>Object</code> | An instance of the request module tied to this module's audience. |
27
21
  | baseUrl | <code>string</code> | The base URL provided by the parent module |
28
22
 
29
- <a name="FacilityGroupings+addFacility"></a>
30
-
31
- ### contxtSdk.facilities.groupings.addFacility(facilityGroupingId, facilityId) ⇒ <code>Promise</code>
32
- Adds a facility to a facility grouping
33
-
34
- API Endpoint: '/groupings/:facilityGroupingId/facilities/:facilityId'
35
- Method: POST
36
-
37
- **Kind**: instance method of [<code>FacilityGroupings</code>](#FacilityGroupings)
38
- **Fulfill**: [<code>FacilityGroupingFacility</code>](./Typedefs.md#FacilityGroupingFacility) Information about the new facility/grouping relationship
39
- **Reject**: <code>Error</code>
40
-
41
- | Param | Type | Description |
42
- | --- | --- | --- |
43
- | facilityGroupingId | <code>string</code> | UUID corresponding with a facility grouping |
44
- | facilityId | <code>number</code> | |
45
-
46
- **Example**
47
- ```js
48
- contxtSdk.facilities.groupings
49
- .addFacility('b3dbaae3-25dd-475b-80dc-66296630a8d0', 4)
50
- .then((grouping) => console.log(grouping))
51
- .catch((err) => console.log(err));
52
- ```
53
- <a name="FacilityGroupings+create"></a>
54
-
55
- ### contxtSdk.facilities.groupings.create(facilityGrouping) ⇒ <code>Promise</code>
56
- Creates a new facility grouping
57
-
58
- API Endpoint: '/groupings'
59
- Method: POST
60
-
61
- **Kind**: instance method of [<code>FacilityGroupings</code>](#FacilityGroupings)
62
- **Fulfill**: [<code>FacilityGrouping</code>](./Typedefs.md#FacilityGrouping) Information about the new facility grouping
63
- **Reject**: <code>Error</code>
64
-
65
- | Param | Type | Default | Description |
66
- | --- | --- | --- | --- |
67
- | facilityGrouping | <code>Object</code> | | |
68
- | [facilityGrouping.description] | <code>string</code> | | |
69
- | [facilityGrouping.isPrivate] | <code>boolean</code> | <code>false</code> | |
70
- | facilityGrouping.name | <code>string</code> | | |
71
- | facilityGrouping.organizationId | <code>string</code> | | UUID |
72
- | [facilityGrouping.parentGroupingId] | <code>string</code> | | UUID |
73
-
74
- **Example**
75
- ```js
76
- contxtSdk.facilities.groupings
77
- .create({
78
- description: 'US States of CT, MA, ME, NH, RI, VT',
79
- isPrivate: false,
80
- name: 'New England, USA',
81
- organizationId: '61f5fe1d-d202-4ae7-af76-8f37f5bbeec5',
82
- parentGroupingId: 'e9f8f89c-609c-4c83-8ebc-cea928af661e'
83
- })
84
- .then((grouping) => console.log(grouping))
85
- .catch((err) => console.log(err));
86
- ```
87
- <a name="FacilityGroupings+delete"></a>
88
-
89
- ### contxtSdk.facilities.groupings.delete(facilityGroupingId) ⇒ <code>Promise</code>
90
- Delete a facility groupings
91
-
92
- API Endpoint: '/groupings/:facilityGroupingId'
93
- Method: DELETE
94
-
95
- **Kind**: instance method of [<code>FacilityGroupings</code>](#FacilityGroupings)
96
- **Fulfill**: <code>undefined</code>
97
- **Reject**: <code>Error</code>
98
-
99
- | Param | Type | Description |
100
- | --- | --- | --- |
101
- | facilityGroupingId | <code>string</code> | The id of the facility grouping (formatted as a UUID) |
102
-
103
- **Example**
104
- ```js
105
- contxtSdk.facilities.groupings.delete(
106
- 'e4fec739-56aa-4b50-8dab-e9d6b9c91a5d'
107
- );
108
- ```
109
- <a name="FacilityGroupings+getAll"></a>
110
-
111
- ### contxtSdk.facilities.groupings.getAll() ⇒ <code>Promise</code>
112
- Get a listing of all facility groupings available to a user. Includes public groupings across
113
- any organization the user has access to and the user's private groupings.
114
-
115
- API Endpoint: '/groupings'
116
- Method: GET
117
-
118
- **Kind**: instance method of [<code>FacilityGroupings</code>](#FacilityGroupings)
119
- **Fulfill**: <code>FacilityGrouping[]</code>
120
- **Reject**: <code>Error</code>
121
- **Example**
122
- ```js
123
- contxtSdk.facilites.groupings
124
- .getAll()
125
- .then((groupings) => console.log(groupings))
126
- .catch((err) => console.log(err));
127
- ```
128
23
  <a name="FacilityGroupings+getAllByOrganizationId"></a>
129
24
 
130
25
  ### contxtSdk.facilities.groupings.getAllByOrganizationId(organizationId) ⇒ <code>Promise</code>
@@ -149,58 +44,3 @@ contxtSdk.facilites.groupings
149
44
  .then((groupings) => console.log(groupings))
150
45
  .catch((err) => console.log(err));
151
46
  ```
152
- <a name="FacilityGroupings+removeFacility"></a>
153
-
154
- ### contxtSdk.facilities.groupings.removeFacility(facilityGroupingId, facilityId) ⇒ <code>Promise</code>
155
- Removes a facility from a facility grouping
156
-
157
- API Endpoint: '/groupings/:facilityGroupingId/facilities/:facilityId'
158
- Method: DELETE
159
-
160
- **Kind**: instance method of [<code>FacilityGroupings</code>](#FacilityGroupings)
161
- **Reject**: <code>Error</code>
162
-
163
- | Param | Type | Description |
164
- | --- | --- | --- |
165
- | facilityGroupingId | <code>string</code> | UUID corresponding with a facility grouping |
166
- | facilityId | <code>number</code> | |
167
-
168
- **Example**
169
- ```js
170
- contxtSdk.facilities.groupings
171
- .removeFacility('b3dbaae3-25dd-475b-80dc-66296630a8d0', 4)
172
- .catch((err) => console.log(err));
173
- ```
174
- <a name="FacilityGroupings+update"></a>
175
-
176
- ### contxtSdk.facilities.groupings.update(facilityGroupingId, update) ⇒ <code>Promise</code>
177
- Updates an existing facility grouping
178
-
179
- API Endpoint: '/groupings/:facilityGroupingId'
180
- Method: PUT
181
-
182
- **Kind**: instance method of [<code>FacilityGroupings</code>](#FacilityGroupings)
183
- **Fulfill**: [<code>FacilityGrouping</code>](./Typedefs.md#FacilityGrouping) Information about the updated facility grouping
184
- **Reject**: <code>Error</code>
185
-
186
- | Param | Type | Description |
187
- | --- | --- | --- |
188
- | facilityGroupingId | <code>String</code> | |
189
- | update | <code>Object</code> | |
190
- | [update.description] | <code>string</code> | |
191
- | [update.isPrivate] | <code>boolean</code> | |
192
- | [update.name] | <code>string</code> | |
193
- | [update.parentGroupingId] | <code>string</code> | UUID corresponding with another facility grouping |
194
-
195
- **Example**
196
- ```js
197
- contxtSdk.facilities.groupings
198
- .update('b3dbaae3-25dd-475b-80dc-66296630a8d0', {
199
- description: 'US States of CT, MA, ME, NH, RI, VT',
200
- isPrivate: false,
201
- name: 'New England, USA',
202
- parentGroupingId: 'e9f8f89c-609c-4c83-8ebc-cea928af661e'
203
- })
204
- .then((grouping) => console.log(grouping))
205
- .catch((err) => console.log(err));
206
- ```
package/docs/Nionic.md ADDED
@@ -0,0 +1,63 @@
1
+ <a name="Nionic"></a>
2
+
3
+ ## Nionic
4
+ Module that provides access to, and the manipulation of, information about different assets
5
+
6
+ **Kind**: global class
7
+
8
+ * [Nionic](#Nionic)
9
+ * [new Nionic(sdk, request)](#new_Nionic_new)
10
+ * [.getFacilities(organizationId, [options])](#Nionic+getFacilities) ⇒ <code>Promise</code>
11
+ * [.getFacility(organizationId, facilityId)](#Nionic+getFacility) ⇒ <code>Promise</code>
12
+
13
+ <a name="new_Nionic_new"></a>
14
+
15
+ ### new Nionic(sdk, request)
16
+
17
+ | Param | Type | Description |
18
+ | --- | --- | --- |
19
+ | sdk | <code>Object</code> | An instance of the SDK so the module can communicate with other modules. |
20
+ | request | <code>Object</code> | An instance of the request module tied to this module's audience. |
21
+
22
+ <a name="Nionic+getFacilities"></a>
23
+
24
+ ### contxtSdk.nionic.getFacilities(organizationId, [options]) ⇒ <code>Promise</code>
25
+ Get a list of all assets that belong to a particular organization
26
+
27
+ **Kind**: instance method of [<code>Nionic</code>](#Nionic)
28
+ **Fulfill**: [<code>AssetsFromServer</code>](./Typedefs.md#AssetsFromServer)
29
+ **Reject**: <code>Error</code>
30
+
31
+ | Param | Type | Description |
32
+ | --- | --- | --- |
33
+ | organizationId | <code>string</code> | UUID corresponding with an organization |
34
+ | [options] | <code>Object</code> | Object containing parameters to be called with the request |
35
+
36
+ **Example**
37
+ ```js
38
+ contxtSdk.nionic
39
+ .getAllFacilities('53fba880-70b7-47a2-b4e3-ad9ecfb67d5c')
40
+ .then((facilities) => console.log(facilities))
41
+ .catch((err) => console.log(err));
42
+ ```
43
+ <a name="Nionic+getFacility"></a>
44
+
45
+ ### contxtSdk.nionic.getFacility(organizationId, facilityId) ⇒ <code>Promise</code>
46
+ Gets information about a facility
47
+
48
+ **Kind**: instance method of [<code>Nionic</code>](#Nionic)
49
+ **Fulfill**: [<code>Facility</code>](./Typedefs.md#Facility) Information about a facility
50
+ **Reject**: <code>Error</code>
51
+
52
+ | Param | Type | Description |
53
+ | --- | --- | --- |
54
+ | organizationId | <code>string</code> | UUID corresponding with an organization |
55
+ | facilityId | <code>number</code> | The ID of the facility |
56
+
57
+ **Example**
58
+ ```js
59
+ contxtSdk.facilities
60
+ .get('53fba880-70b7-47a2-b4e3-ad9ecfb67d5c', 25)
61
+ .then((facility) => console.log(facility))
62
+ .catch((err) => console.log(err));
63
+ ```
package/docs/README.md CHANGED
@@ -61,10 +61,6 @@ environments. Documentation for browser environments is found under
61
61
  <dt><a href="./Coordinator.md">Coordinator</a></dt>
62
62
  <dd><p>Module that provides access to information about Contxt</p>
63
63
  </dd>
64
- <dt><a href="./CostCenters.md">CostCenters</a></dt>
65
- <dd><p>Module that provides access to cost centers, and helps manage
66
- the relationship between those cost centers and facilities</p>
67
- </dd>
68
64
  <dt><a href="./EdgeNodes.md">EdgeNodes</a></dt>
69
65
  <dd><p>Module that provides access to contxt edge nodes</p>
70
66
  </dd>
@@ -76,10 +72,6 @@ of, information about different events</p>
76
72
  <dd><p>Module that provides access to, and the manipulation
77
73
  of, information about different facilities</p>
78
74
  </dd>
79
- <dt><a href="./FacilityGroupings.md">FacilityGroupings</a></dt>
80
- <dd><p>Module that provides access to facility groupings, and helps manage
81
- the relationship between those groupings and facilities</p>
82
- </dd>
83
75
  <dt><a href="./FeedTypes.md">FeedTypes</a></dt>
84
76
  <dd><p>Module that provides access to feed type information</p>
85
77
  </dd>
@@ -100,9 +92,6 @@ the relationship between those groupings and facilities</p>
100
92
  More information about the best way to use this module is available at:
101
93
  <a href="https://contxt.readme.io/reference#files-overview">https://contxt.readme.io/reference#files-overview</a></p>
102
94
  </dd>
103
- <dt><a href="./Health.md">Health</a></dt>
104
- <dd><p>Module that provides access to the Contxt Health Service</p>
105
- </dd>
106
95
  <dt><a href="./Iot.md">Iot</a></dt>
107
96
  <dd><p>Module that provides access to real time IOT feeds and fields.</p>
108
97
  </dd>
@@ -111,6 +100,9 @@ More information about the best way to use this module is available at:
111
100
  only be used in Node.js applications. This SessionType requires a client id and a client secret,
112
101
  which are obtained from Auth0.</p>
113
102
  </dd>
103
+ <dt><a href="./Nionic.md">Nionic</a></dt>
104
+ <dd><p>Module that provides access to, and the manipulation of, information about different assets</p>
105
+ </dd>
114
106
  <dt><a href="./Organizations.md">Organizations</a></dt>
115
107
  <dd><p>Module that provides access to contxt organizations</p>
116
108
  </dd>
@@ -225,10 +217,6 @@ More information at <a href="https://github.com/axios/axios#interceptors">axios
225
217
  <dd></dd>
226
218
  <dt><a href="./Typedefs.md#ContxtUserRole">ContxtUserRole</a> : <code>Object</code></dt>
227
219
  <dd></dd>
228
- <dt><a href="./Typedefs.md#CostCenter">CostCenter</a> : <code>Object</code></dt>
229
- <dd></dd>
230
- <dt><a href="./Typedefs.md#CostCenterFacility">CostCenterFacility</a> : <code>Object</code></dt>
231
- <dd></dd>
232
220
  <dt><a href="./Typedefs.md#CustomAudience">CustomAudience</a> : <code>Object</code></dt>
233
221
  <dd><p>A custom audience that will override the configuration of an individual module. Consists of
234
222
  either a reference to an environment that already exists or a clientId and host for a
@@ -258,10 +246,6 @@ for authenticating and communicating with an individual API and the external mod
258
246
  <dd></dd>
259
247
  <dt><a href="./Typedefs.md#FacilityFeedStatus">FacilityFeedStatus</a> : <code>Object</code></dt>
260
248
  <dd></dd>
261
- <dt><a href="./Typedefs.md#FacilityGrouping">FacilityGrouping</a> : <code>Object</code></dt>
262
- <dd></dd>
263
- <dt><a href="./Typedefs.md#FacilityGroupingFacility">FacilityGroupingFacility</a> : <code>Object</code></dt>
264
- <dd></dd>
265
249
  <dt><a href="./Typedefs.md#FacilityGroupingStatus">FacilityGroupingStatus</a> : <code>Object</code></dt>
266
250
  <dd></dd>
267
251
  <dt><a href="./Typedefs.md#FacilityStatusFromServer">FacilityStatusFromServer</a> : <code>Object</code></dt>
@@ -292,14 +276,6 @@ for authenticating and communicating with an individual API and the external mod
292
276
  <dd></dd>
293
277
  <dt><a href="./Typedefs.md#FilesFromServer">FilesFromServer</a> : <code>Object</code></dt>
294
278
  <dd></dd>
295
- <dt><a href="./Typedefs.md#HealthAsset">HealthAsset</a> : <code>Object</code></dt>
296
- <dd></dd>
297
- <dt><a href="./Typedefs.md#HealthAssetPaginatedResponse">HealthAssetPaginatedResponse</a> : <code><a href="#HealthAsset">PaginatedResponse.&lt;HealthAsset&gt;</a></code></dt>
298
- <dd></dd>
299
- <dt><a href="./Typedefs.md#HealthStatus">HealthStatus</a> : <code>Object</code></dt>
300
- <dd></dd>
301
- <dt><a href="./Typedefs.md#HealthStatusPaginatedResponse">HealthStatusPaginatedResponse</a> : <code><a href="#HealthStatus">PaginatedResponse.&lt;HealthStatus&gt;</a></code></dt>
302
- <dd></dd>
303
279
  <dt><a href="./Typedefs.md#MachineAuthSessionInfo">MachineAuthSessionInfo</a> : <code>Object</code></dt>
304
280
  <dd></dd>
305
281
  <dt><a href="./Typedefs.md#MessageBusChannel">MessageBusChannel</a> : <code>Object</code></dt>
@@ -310,8 +286,6 @@ for authenticating and communicating with an individual API and the external mod
310
286
  <dd></dd>
311
287
  <dt><a href="./Typedefs.md#OutputFieldDataResponse">OutputFieldDataResponse</a> : <code>Object</code></dt>
312
288
  <dd></dd>
313
- <dt><a href="./Typedefs.md#PaginatedResponse">PaginatedResponse</a> : <code>Object</code></dt>
314
- <dd></dd>
315
289
  <dt><a href="./Typedefs.md#PaginationMetadata">PaginationMetadata</a> : <code>Object</code></dt>
316
290
  <dd></dd>
317
291
  <dt><a href="./Typedefs.md#PaginationOptions">PaginationOptions</a> : <code>Object</code></dt>
package/docs/Typedefs.md CHANGED
@@ -555,33 +555,6 @@ More information at [axios Interceptors](https://github.com/axios/axios#intercep
555
555
  | roleId | <code>string</code> | |
556
556
  | updatedAt | <code>string</code> | ISO 8601 Extended Format date/time string |
557
557
 
558
- <a name="CostCenter"></a>
559
-
560
- ## CostCenter : <code>Object</code>
561
- **Kind**: global typedef
562
-
563
- | Param | Type | Description |
564
- | --- | --- | --- |
565
- | createdAt | <code>string</code> | ISO 8601 Extended Format date/time string |
566
- | [description] | <code>string</code> | |
567
- | id | <code>string</code> | UUID |
568
- | name | <code>string</code> | |
569
- | organizationId | <code>string</code> | UUID |
570
- | updatedAt | <code>string</code> | ISO 8601 Extended Format date/time string |
571
-
572
- <a name="CostCenterFacility"></a>
573
-
574
- ## CostCenterFacility : <code>Object</code>
575
- **Kind**: global typedef
576
-
577
- | Param | Type | Description |
578
- | --- | --- | --- |
579
- | costCenterId | <code>string</code> | UUID |
580
- | createdAt | <code>string</code> | ISO 8601 Extended Format date/time string |
581
- | facilityId | <code>number</code> | |
582
- | id | <code>string</code> | UUID |
583
- | updatedAt | <code>string</code> | ISO 8601 Extended Format date/time string |
584
-
585
558
  <a name="CustomAudience"></a>
586
559
 
587
560
  ## CustomAudience : <code>Object</code>
@@ -798,37 +771,6 @@ for authenticating and communicating with an individual API and the external mod
798
771
  | statusEventId | <code>String</code> | UUID of the feed status event |
799
772
  | updatedAt | <code>string</code> | ISO 8601 Extended Format date/time string |
800
773
 
801
- <a name="FacilityGrouping"></a>
802
-
803
- ## FacilityGrouping : <code>Object</code>
804
- **Kind**: global typedef
805
-
806
- | Param | Type | Description |
807
- | --- | --- | --- |
808
- | createdAt | <code>string</code> | ISO 8601 Extended Format date/time string |
809
- | [description] | <code>string</code> | |
810
- | [facilities] | [<code>Array.&lt;Facility&gt;</code>](#Facility) | |
811
- | id | <code>string</code> | UUID |
812
- | isPrivate | <code>boolean</code> | |
813
- | name | <code>string</code> | |
814
- | organizationId | <code>string</code> | UUID |
815
- | ownerId | <code>string</code> | Auth0 identifer of the user |
816
- | [parentGroupingId] | <code>string</code> | UUID |
817
- | updatedAt | <code>string</code> | ISO 8601 Extended Format date/time string |
818
-
819
- <a name="FacilityGroupingFacility"></a>
820
-
821
- ## FacilityGroupingFacility : <code>Object</code>
822
- **Kind**: global typedef
823
-
824
- | Param | Type | Description |
825
- | --- | --- | --- |
826
- | createdAt | <code>string</code> | ISO 8601 Extended Format date/time string |
827
- | facilityGroupingId | <code>string</code> | UUID |
828
- | facilityId | <code>number</code> | |
829
- | id | <code>string</code> | UUID |
830
- | updatedAt | <code>string</code> | ISO 8601 Extended Format date/time string |
831
-
832
774
  <a name="FacilityGroupingStatus"></a>
833
775
 
834
776
  ## FacilityGroupingStatus : <code>Object</code>
@@ -1072,36 +1014,6 @@ An error returned while creating and uploading an
1072
1014
  | _metadata.totalRecords | <code>number</code> | Total number of files found |
1073
1015
  | records | [<code>Array.&lt;File&gt;</code>](#File) | |
1074
1016
 
1075
- <a name="HealthAsset"></a>
1076
-
1077
- ## HealthAsset : <code>Object</code>
1078
- **Kind**: global typedef
1079
- **Extends**: [<code>Asset</code>](./Typedefs.md#Asset)
1080
- **Properties**
1081
-
1082
- | Name | Type |
1083
- | --- | --- |
1084
- | health | [<code>HealthStatus</code>](./Typedefs.md#HealthStatus) |
1085
-
1086
- <a name="HealthAssetPaginatedResponse"></a>
1087
-
1088
- ## HealthAssetPaginatedResponse : [<code>PaginatedResponse.&lt;HealthAsset&gt;</code>](#HealthAsset)
1089
- **Kind**: global typedef
1090
- <a name="HealthStatus"></a>
1091
-
1092
- ## HealthStatus : <code>Object</code>
1093
- **Kind**: global typedef
1094
- **Properties**
1095
-
1096
- | Name | Type | Description |
1097
- | --- | --- | --- |
1098
- | status | <code>string</code> | A health status of value 'healthy' or 'unhealthy' |
1099
- | timestamp | <code>string</code> | ISO 8601 Extended Format date/time string |
1100
-
1101
- <a name="HealthStatusPaginatedResponse"></a>
1102
-
1103
- ## HealthStatusPaginatedResponse : [<code>PaginatedResponse.&lt;HealthStatus&gt;</code>](#HealthStatus)
1104
- **Kind**: global typedef
1105
1017
  <a name="MachineAuthSessionInfo"></a>
1106
1018
 
1107
1019
  ## MachineAuthSessionInfo : <code>Object</code>
@@ -1181,19 +1093,6 @@ An error returned while creating and uploading an
1181
1093
  | [meta.window] | <code>Number</code> | The sampling window for records. Required if including a timeEnd or timeStart. Valid options include: `0`, `60`, `900`, and `3600` |
1182
1094
  | records | [<code>Array.&lt;OutputFieldData&gt;</code>](#OutputFieldData) | |
1183
1095
 
1184
- <a name="PaginatedResponse"></a>
1185
-
1186
- ## PaginatedResponse : <code>Object</code>
1187
- **Kind**: global typedef
1188
- **Properties**
1189
-
1190
- | Name | Type | Description |
1191
- | --- | --- | --- |
1192
- | _metadata | <code>Object</code> | Metadata about the pagination settings |
1193
- | _metadata.offset | <code>number</code> | Offset of records in subsequent queries |
1194
- | _metadata.totalRecords | <code>number</code> | Total number of asset types found |
1195
- | records | <code>Array.&lt;RecordType&gt;</code> | |
1196
-
1197
1096
  <a name="PaginationMetadata"></a>
1198
1097
 
1199
1098
  ## PaginationMetadata : <code>Object</code>