@ndustrial/contxt-sdk 5.5.7 → 5.6.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.nvmrc +1 -1
- package/eslint.config.mjs +44 -0
- package/esm/bus/channels.js +1883 -216
- package/esm/bus/channels.js.map +1 -1
- package/esm/bus/index.browser.js +218 -37
- package/esm/bus/index.browser.js.map +1 -1
- package/esm/bus/index.js +906 -94
- package/esm/bus/index.js.map +1 -1
- package/esm/bus/webSocketConnection.browser.js +86 -12
- package/esm/bus/webSocketConnection.browser.js.map +1 -1
- package/esm/bus/webSocketConnection.js +2464 -332
- package/esm/bus/webSocketConnection.js.map +1 -1
- package/esm/config/audiences.js +37 -1
- package/esm/config/audiences.js.map +1 -1
- package/esm/config/defaults.js +37 -1
- package/esm/config/defaults.js.map +1 -1
- package/esm/config/index.js +1622 -203
- package/esm/config/index.js.map +1 -1
- package/esm/coordinator/applications.js +1019 -172
- package/esm/coordinator/applications.js.map +1 -1
- package/esm/coordinator/consent.js +603 -76
- package/esm/coordinator/consent.js.map +1 -1
- package/esm/coordinator/edgeNodes.js +520 -40
- package/esm/coordinator/edgeNodes.js.map +1 -1
- package/esm/coordinator/index.js +811 -54
- package/esm/coordinator/index.js.map +1 -1
- package/esm/coordinator/organizations.js +533 -60
- package/esm/coordinator/organizations.js.map +1 -1
- package/esm/coordinator/permissions.js +914 -107
- package/esm/coordinator/permissions.js.map +1 -1
- package/esm/coordinator/roles.js +2146 -258
- package/esm/coordinator/roles.js.map +1 -1
- package/esm/coordinator/users.js +3427 -484
- package/esm/coordinator/users.js.map +1 -1
- package/esm/events/index.js +2301 -393
- package/esm/events/index.js.map +1 -1
- package/esm/files/index.js +2053 -410
- package/esm/files/index.js.map +1 -1
- package/esm/index.js +1002 -148
- package/esm/index.js.map +1 -1
- package/esm/iot/feedTypes.js +188 -25
- package/esm/iot/feedTypes.js.map +1 -1
- package/esm/iot/feeds.js +420 -59
- package/esm/iot/feeds.js.map +1 -1
- package/esm/iot/fieldCategories.js +1172 -195
- package/esm/iot/fieldCategories.js.map +1 -1
- package/esm/iot/fieldGroupings.js +1689 -255
- package/esm/iot/fieldGroupings.js.map +1 -1
- package/esm/iot/fields.js +254 -28
- package/esm/iot/fields.js.map +1 -1
- package/esm/iot/index.js +212 -34
- package/esm/iot/index.js.map +1 -1
- package/esm/iot/outputs.js +320 -31
- package/esm/iot/outputs.js.map +1 -1
- package/esm/nionic/index.js +1097 -97
- package/esm/nionic/index.js.map +1 -1
- package/esm/request.js +1313 -219
- package/esm/request.js.map +1 -1
- package/esm/sessionTypes/auth0WebAuth.js +3395 -409
- package/esm/sessionTypes/auth0WebAuth.js.map +1 -1
- package/esm/sessionTypes/index.js +213 -22
- package/esm/sessionTypes/index.js.map +1 -1
- package/esm/sessionTypes/machineAuth.js +1314 -144
- package/esm/sessionTypes/machineAuth.js.map +1 -1
- package/esm/sessionTypes/passwordGrantAuth.js +1060 -145
- package/esm/sessionTypes/passwordGrantAuth.js.map +1 -1
- package/esm/utils/events/formatEventUpdateToServer.js +107 -4
- package/esm/utils/events/formatEventUpdateToServer.js.map +1 -1
- package/esm/utils/events/index.js +54 -2
- package/esm/utils/events/index.js.map +1 -1
- package/esm/utils/iot/formatOutputFieldDataFromServer.js +227 -14
- package/esm/utils/iot/formatOutputFieldDataFromServer.js.map +1 -1
- package/esm/utils/iot/index.js +56 -3
- package/esm/utils/iot/index.js.map +1 -1
- package/esm/utils/iot/parseOutputFieldNextPageUrlMetadata.js +207 -7
- package/esm/utils/iot/parseOutputFieldNextPageUrlMetadata.js.map +1 -1
- package/esm/utils/objects/createCaseChangeFn.js +449 -18
- package/esm/utils/objects/createCaseChangeFn.js.map +1 -1
- package/esm/utils/objects/index.js +56 -3
- package/esm/utils/objects/index.js.map +1 -1
- package/esm/utils/objects/map.js +520 -26
- package/esm/utils/objects/map.js.map +1 -1
- package/esm/utils/objects/toCamelCase.js +39 -3
- package/esm/utils/objects/toCamelCase.js.map +1 -1
- package/esm/utils/objects/toSnakeCase.js +39 -3
- package/esm/utils/objects/toSnakeCase.js.map +1 -1
- package/esm/utils/pagination/formatPaginatedDataFromServer.js +268 -11
- package/esm/utils/pagination/formatPaginatedDataFromServer.js.map +1 -1
- package/esm/utils/pagination/index.js +54 -2
- package/esm/utils/pagination/index.js.map +1 -1
- package/esm/utils/url/index.js +47 -2
- package/esm/utils/url/index.js.map +1 -1
- package/esm/utils/url/stringifyParams.js +176 -10
- package/esm/utils/url/stringifyParams.js.map +1 -1
- package/lib/bus/channels.js +1880 -223
- package/lib/bus/channels.js.map +1 -1
- package/lib/bus/index.browser.js +215 -43
- package/lib/bus/index.browser.js.map +1 -1
- package/lib/bus/index.js +903 -106
- package/lib/bus/index.js.map +1 -1
- package/lib/bus/webSocketConnection.browser.js +83 -15
- package/lib/bus/webSocketConnection.browser.js.map +1 -1
- package/lib/bus/webSocketConnection.js +2461 -339
- package/lib/bus/webSocketConnection.js.map +1 -1
- package/lib/config/audiences.js +33 -2
- package/lib/config/audiences.js.map +1 -1
- package/lib/config/defaults.js +33 -2
- package/lib/config/defaults.js.map +1 -1
- package/lib/config/index.js +1619 -212
- package/lib/config/index.js.map +1 -1
- package/lib/coordinator/applications.js +1016 -174
- package/lib/coordinator/applications.js.map +1 -1
- package/lib/coordinator/consent.js +600 -78
- package/lib/coordinator/consent.js.map +1 -1
- package/lib/coordinator/edgeNodes.js +517 -42
- package/lib/coordinator/edgeNodes.js.map +1 -1
- package/lib/coordinator/index.js +808 -78
- package/lib/coordinator/index.js.map +1 -1
- package/lib/coordinator/organizations.js +530 -62
- package/lib/coordinator/organizations.js.map +1 -1
- package/lib/coordinator/permissions.js +911 -109
- package/lib/coordinator/permissions.js.map +1 -1
- package/lib/coordinator/roles.js +2143 -260
- package/lib/coordinator/roles.js.map +1 -1
- package/lib/coordinator/users.js +3423 -489
- package/lib/coordinator/users.js.map +1 -1
- package/lib/events/index.js +2297 -404
- package/lib/events/index.js.map +1 -1
- package/lib/files/index.js +2050 -418
- package/lib/files/index.js.map +1 -1
- package/lib/index.js +999 -183
- package/lib/index.js.map +1 -1
- package/lib/iot/feedTypes.js +185 -27
- package/lib/iot/feedTypes.js.map +1 -1
- package/lib/iot/feeds.js +417 -61
- package/lib/iot/feeds.js.map +1 -1
- package/lib/iot/fieldCategories.js +1169 -203
- package/lib/iot/fieldCategories.js.map +1 -1
- package/lib/iot/fieldGroupings.js +1686 -263
- package/lib/iot/fieldGroupings.js.map +1 -1
- package/lib/iot/fields.js +251 -30
- package/lib/iot/fields.js.map +1 -1
- package/lib/iot/index.js +209 -55
- package/lib/iot/index.js.map +1 -1
- package/lib/iot/outputs.js +317 -34
- package/lib/iot/outputs.js.map +1 -1
- package/lib/nionic/index.js +1094 -98
- package/lib/nionic/index.js.map +1 -1
- package/lib/request.js +1310 -226
- package/lib/request.js.map +1 -1
- package/lib/sessionTypes/auth0WebAuth.js +3391 -421
- package/lib/sessionTypes/auth0WebAuth.js.map +1 -1
- package/lib/sessionTypes/index.js +209 -26
- package/lib/sessionTypes/index.js.map +1 -1
- package/lib/sessionTypes/machineAuth.js +1311 -151
- package/lib/sessionTypes/machineAuth.js.map +1 -1
- package/lib/sessionTypes/passwordGrantAuth.js +1057 -156
- package/lib/sessionTypes/passwordGrantAuth.js.map +1 -1
- package/lib/utils/events/formatEventUpdateToServer.js +102 -4
- package/lib/utils/events/formatEventUpdateToServer.js.map +1 -1
- package/lib/utils/events/index.js +51 -10
- package/lib/utils/events/index.js.map +1 -1
- package/lib/utils/iot/formatOutputFieldDataFromServer.js +224 -18
- package/lib/utils/iot/formatOutputFieldDataFromServer.js.map +1 -1
- package/lib/utils/iot/index.js +53 -15
- package/lib/utils/iot/index.js.map +1 -1
- package/lib/utils/iot/parseOutputFieldNextPageUrlMetadata.js +203 -13
- package/lib/utils/iot/parseOutputFieldNextPageUrlMetadata.js.map +1 -1
- package/lib/utils/objects/createCaseChangeFn.js +446 -25
- package/lib/utils/objects/createCaseChangeFn.js.map +1 -1
- package/lib/utils/objects/index.js +53 -15
- package/lib/utils/objects/index.js.map +1 -1
- package/lib/utils/objects/map.js +517 -33
- package/lib/utils/objects/map.js.map +1 -1
- package/lib/utils/objects/toCamelCase.js +36 -11
- package/lib/utils/objects/toCamelCase.js.map +1 -1
- package/lib/utils/objects/toSnakeCase.js +36 -11
- package/lib/utils/objects/toSnakeCase.js.map +1 -1
- package/lib/utils/pagination/formatPaginatedDataFromServer.js +265 -14
- package/lib/utils/pagination/formatPaginatedDataFromServer.js.map +1 -1
- package/lib/utils/pagination/index.js +51 -10
- package/lib/utils/pagination/index.js.map +1 -1
- package/lib/utils/url/index.js +44 -7
- package/lib/utils/url/index.js.map +1 -1
- package/lib/utils/url/stringifyParams.js +172 -18
- package/lib/utils/url/stringifyParams.js.map +1 -1
- package/package.json +32 -36
- package/src/bus/channels.js +6 -6
- package/src/bus/channels.spec.js +1 -1
- package/src/coordinator/applications.js +7 -7
- package/src/coordinator/applications.spec.js +1 -1
- package/src/coordinator/consent.js +3 -3
- package/src/coordinator/edgeNodes.js +3 -3
- package/src/coordinator/edgeNodes.spec.js +1 -1
- package/src/coordinator/organizations.js +4 -4
- package/src/coordinator/organizations.spec.js +1 -1
- package/src/coordinator/permissions.js +6 -6
- package/src/coordinator/permissions.spec.js +1 -1
- package/src/coordinator/roles.js +9 -9
- package/src/coordinator/roles.spec.js +1 -1
- package/src/coordinator/users.js +13 -13
- package/src/coordinator/users.spec.js +294 -294
- package/src/events/index.js +18 -18
- package/src/events/index.spec.js +3 -3
- package/src/files/index.js +9 -9
- package/src/files/index.spec.js +2 -2
- package/src/index.js +3 -1
- package/src/iot/feedTypes.js +2 -2
- package/src/iot/feeds.js +4 -4
- package/src/iot/feeds.spec.js +1 -1
- package/src/iot/fieldCategories.js +10 -10
- package/src/iot/fieldCategories.spec.js +2 -2
- package/src/iot/fieldGroupings.js +10 -10
- package/src/iot/fieldGroupings.spec.js +2 -2
- package/src/iot/fields.js +2 -2
- package/src/iot/fields.spec.js +1 -1
- package/src/iot/outputs.js +2 -2
- package/src/iot/outputs.spec.js +1 -1
- package/src/sessionTypes/auth0WebAuth.spec.js +1 -1
- package/src/utils/events/index.js +2 -1
- package/src/utils/iot/formatOutputFieldDataFromServer.js +5 -5
- package/src/utils/iot/formatOutputFieldDataFromServer.spec.js +2 -2
- package/src/utils/iot/index.js +2 -1
- package/src/utils/iot/parseOutputFieldNextPageUrlMetadata.js +3 -1
- package/src/utils/objects/index.js +2 -1
- package/src/utils/pagination/formatPaginatedDataFromServer.js +3 -3
- package/src/utils/pagination/formatPaginatedDataFromServer.spec.js +1 -1
- package/src/utils/pagination/index.js +2 -1
- package/support/mocharc.yml +1 -1
- package/.eslintrc +0 -24
|
@@ -1,9 +1,526 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
4
|
-
|
|
5
|
-
import { toCamelCase } from '../utils/objects';
|
|
1
|
+
"use strict";
|
|
6
2
|
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = void 0;
|
|
7
|
+
require("core-js/modules/es.promise.js");
|
|
8
|
+
var _objects = _interopRequireDefault(require("../utils/objects"));
|
|
9
|
+
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
|
|
10
|
+
function cov_l8otr7ot0() {
|
|
11
|
+
var path = "/home/runner/work/contxt-sdk-js/contxt-sdk-js/src/coordinator/consent.js";
|
|
12
|
+
var hash = "51667afe4718df933582fb85fa433039d7c23c54";
|
|
13
|
+
var global = new Function("return this")();
|
|
14
|
+
var gcv = "__coverage__";
|
|
15
|
+
var coverageData = {
|
|
16
|
+
path: "/home/runner/work/contxt-sdk-js/contxt-sdk-js/src/coordinator/consent.js",
|
|
17
|
+
statementMap: {
|
|
18
|
+
"0": {
|
|
19
|
+
start: {
|
|
20
|
+
line: 62,
|
|
21
|
+
column: 4
|
|
22
|
+
},
|
|
23
|
+
end: {
|
|
24
|
+
line: 62,
|
|
25
|
+
column: 28
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
"1": {
|
|
29
|
+
start: {
|
|
30
|
+
line: 63,
|
|
31
|
+
column: 4
|
|
32
|
+
},
|
|
33
|
+
end: {
|
|
34
|
+
line: 63,
|
|
35
|
+
column: 28
|
|
36
|
+
}
|
|
37
|
+
},
|
|
38
|
+
"2": {
|
|
39
|
+
start: {
|
|
40
|
+
line: 64,
|
|
41
|
+
column: 4
|
|
42
|
+
},
|
|
43
|
+
end: {
|
|
44
|
+
line: 64,
|
|
45
|
+
column: 20
|
|
46
|
+
}
|
|
47
|
+
},
|
|
48
|
+
"3": {
|
|
49
|
+
start: {
|
|
50
|
+
line: 65,
|
|
51
|
+
column: 4
|
|
52
|
+
},
|
|
53
|
+
end: {
|
|
54
|
+
line: 65,
|
|
55
|
+
column: 42
|
|
56
|
+
}
|
|
57
|
+
},
|
|
58
|
+
"4": {
|
|
59
|
+
start: {
|
|
60
|
+
line: 90,
|
|
61
|
+
column: 4
|
|
62
|
+
},
|
|
63
|
+
end: {
|
|
64
|
+
line: 94,
|
|
65
|
+
column: 5
|
|
66
|
+
}
|
|
67
|
+
},
|
|
68
|
+
"5": {
|
|
69
|
+
start: {
|
|
70
|
+
line: 91,
|
|
71
|
+
column: 6
|
|
72
|
+
},
|
|
73
|
+
end: {
|
|
74
|
+
line: 93,
|
|
75
|
+
column: 8
|
|
76
|
+
}
|
|
77
|
+
},
|
|
78
|
+
"6": {
|
|
79
|
+
start: {
|
|
80
|
+
line: 96,
|
|
81
|
+
column: 4
|
|
82
|
+
},
|
|
83
|
+
end: {
|
|
84
|
+
line: 106,
|
|
85
|
+
column: 7
|
|
86
|
+
}
|
|
87
|
+
},
|
|
88
|
+
"7": {
|
|
89
|
+
start: {
|
|
90
|
+
line: 97,
|
|
91
|
+
column: 6
|
|
92
|
+
},
|
|
93
|
+
end: {
|
|
94
|
+
line: 99,
|
|
95
|
+
column: 7
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
"8": {
|
|
99
|
+
start: {
|
|
100
|
+
line: 98,
|
|
101
|
+
column: 8
|
|
102
|
+
},
|
|
103
|
+
end: {
|
|
104
|
+
line: 98,
|
|
105
|
+
column: 74
|
|
106
|
+
}
|
|
107
|
+
},
|
|
108
|
+
"9": {
|
|
109
|
+
start: {
|
|
110
|
+
line: 101,
|
|
111
|
+
column: 6
|
|
112
|
+
},
|
|
113
|
+
end: {
|
|
114
|
+
line: 105,
|
|
115
|
+
column: 71
|
|
116
|
+
}
|
|
117
|
+
},
|
|
118
|
+
"10": {
|
|
119
|
+
start: {
|
|
120
|
+
line: 105,
|
|
121
|
+
column: 32
|
|
122
|
+
},
|
|
123
|
+
end: {
|
|
124
|
+
line: 105,
|
|
125
|
+
column: 69
|
|
126
|
+
}
|
|
127
|
+
},
|
|
128
|
+
"11": {
|
|
129
|
+
start: {
|
|
130
|
+
line: 130,
|
|
131
|
+
column: 4
|
|
132
|
+
},
|
|
133
|
+
end: {
|
|
134
|
+
line: 140,
|
|
135
|
+
column: 7
|
|
136
|
+
}
|
|
137
|
+
},
|
|
138
|
+
"12": {
|
|
139
|
+
start: {
|
|
140
|
+
line: 131,
|
|
141
|
+
column: 6
|
|
142
|
+
},
|
|
143
|
+
end: {
|
|
144
|
+
line: 133,
|
|
145
|
+
column: 7
|
|
146
|
+
}
|
|
147
|
+
},
|
|
148
|
+
"13": {
|
|
149
|
+
start: {
|
|
150
|
+
line: 132,
|
|
151
|
+
column: 8
|
|
152
|
+
},
|
|
153
|
+
end: {
|
|
154
|
+
line: 132,
|
|
155
|
+
column: 74
|
|
156
|
+
}
|
|
157
|
+
},
|
|
158
|
+
"14": {
|
|
159
|
+
start: {
|
|
160
|
+
line: 135,
|
|
161
|
+
column: 6
|
|
162
|
+
},
|
|
163
|
+
end: {
|
|
164
|
+
line: 139,
|
|
165
|
+
column: 83
|
|
166
|
+
}
|
|
167
|
+
},
|
|
168
|
+
"15": {
|
|
169
|
+
start: {
|
|
170
|
+
line: 139,
|
|
171
|
+
column: 38
|
|
172
|
+
},
|
|
173
|
+
end: {
|
|
174
|
+
line: 139,
|
|
175
|
+
column: 81
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
},
|
|
179
|
+
fnMap: {
|
|
180
|
+
"0": {
|
|
181
|
+
name: "(anonymous_0)",
|
|
182
|
+
decl: {
|
|
183
|
+
start: {
|
|
184
|
+
line: 61,
|
|
185
|
+
column: 2
|
|
186
|
+
},
|
|
187
|
+
end: {
|
|
188
|
+
line: 61,
|
|
189
|
+
column: 3
|
|
190
|
+
}
|
|
191
|
+
},
|
|
192
|
+
loc: {
|
|
193
|
+
start: {
|
|
194
|
+
line: 61,
|
|
195
|
+
column: 60
|
|
196
|
+
},
|
|
197
|
+
end: {
|
|
198
|
+
line: 66,
|
|
199
|
+
column: 3
|
|
200
|
+
}
|
|
201
|
+
},
|
|
202
|
+
line: 61
|
|
203
|
+
},
|
|
204
|
+
"1": {
|
|
205
|
+
name: "(anonymous_1)",
|
|
206
|
+
decl: {
|
|
207
|
+
start: {
|
|
208
|
+
line: 89,
|
|
209
|
+
column: 2
|
|
210
|
+
},
|
|
211
|
+
end: {
|
|
212
|
+
line: 89,
|
|
213
|
+
column: 3
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
loc: {
|
|
217
|
+
start: {
|
|
218
|
+
line: 89,
|
|
219
|
+
column: 20
|
|
220
|
+
},
|
|
221
|
+
end: {
|
|
222
|
+
line: 107,
|
|
223
|
+
column: 3
|
|
224
|
+
}
|
|
225
|
+
},
|
|
226
|
+
line: 89
|
|
227
|
+
},
|
|
228
|
+
"2": {
|
|
229
|
+
name: "(anonymous_2)",
|
|
230
|
+
decl: {
|
|
231
|
+
start: {
|
|
232
|
+
line: 96,
|
|
233
|
+
column: 55
|
|
234
|
+
},
|
|
235
|
+
end: {
|
|
236
|
+
line: 96,
|
|
237
|
+
column: 56
|
|
238
|
+
}
|
|
239
|
+
},
|
|
240
|
+
loc: {
|
|
241
|
+
start: {
|
|
242
|
+
line: 96,
|
|
243
|
+
column: 72
|
|
244
|
+
},
|
|
245
|
+
end: {
|
|
246
|
+
line: 106,
|
|
247
|
+
column: 5
|
|
248
|
+
}
|
|
249
|
+
},
|
|
250
|
+
line: 96
|
|
251
|
+
},
|
|
252
|
+
"3": {
|
|
253
|
+
name: "(anonymous_3)",
|
|
254
|
+
decl: {
|
|
255
|
+
start: {
|
|
256
|
+
line: 105,
|
|
257
|
+
column: 14
|
|
258
|
+
},
|
|
259
|
+
end: {
|
|
260
|
+
line: 105,
|
|
261
|
+
column: 15
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
loc: {
|
|
265
|
+
start: {
|
|
266
|
+
line: 105,
|
|
267
|
+
column: 32
|
|
268
|
+
},
|
|
269
|
+
end: {
|
|
270
|
+
line: 105,
|
|
271
|
+
column: 69
|
|
272
|
+
}
|
|
273
|
+
},
|
|
274
|
+
line: 105
|
|
275
|
+
},
|
|
276
|
+
"4": {
|
|
277
|
+
name: "(anonymous_4)",
|
|
278
|
+
decl: {
|
|
279
|
+
start: {
|
|
280
|
+
line: 129,
|
|
281
|
+
column: 2
|
|
282
|
+
},
|
|
283
|
+
end: {
|
|
284
|
+
line: 129,
|
|
285
|
+
column: 3
|
|
286
|
+
}
|
|
287
|
+
},
|
|
288
|
+
loc: {
|
|
289
|
+
start: {
|
|
290
|
+
line: 129,
|
|
291
|
+
column: 29
|
|
292
|
+
},
|
|
293
|
+
end: {
|
|
294
|
+
line: 141,
|
|
295
|
+
column: 3
|
|
296
|
+
}
|
|
297
|
+
},
|
|
298
|
+
line: 129
|
|
299
|
+
},
|
|
300
|
+
"5": {
|
|
301
|
+
name: "(anonymous_5)",
|
|
302
|
+
decl: {
|
|
303
|
+
start: {
|
|
304
|
+
line: 130,
|
|
305
|
+
column: 55
|
|
306
|
+
},
|
|
307
|
+
end: {
|
|
308
|
+
line: 130,
|
|
309
|
+
column: 56
|
|
310
|
+
}
|
|
311
|
+
},
|
|
312
|
+
loc: {
|
|
313
|
+
start: {
|
|
314
|
+
line: 130,
|
|
315
|
+
column: 72
|
|
316
|
+
},
|
|
317
|
+
end: {
|
|
318
|
+
line: 140,
|
|
319
|
+
column: 5
|
|
320
|
+
}
|
|
321
|
+
},
|
|
322
|
+
line: 130
|
|
323
|
+
},
|
|
324
|
+
"6": {
|
|
325
|
+
name: "(anonymous_6)",
|
|
326
|
+
decl: {
|
|
327
|
+
start: {
|
|
328
|
+
line: 139,
|
|
329
|
+
column: 14
|
|
330
|
+
},
|
|
331
|
+
end: {
|
|
332
|
+
line: 139,
|
|
333
|
+
column: 15
|
|
334
|
+
}
|
|
335
|
+
},
|
|
336
|
+
loc: {
|
|
337
|
+
start: {
|
|
338
|
+
line: 139,
|
|
339
|
+
column: 38
|
|
340
|
+
},
|
|
341
|
+
end: {
|
|
342
|
+
line: 139,
|
|
343
|
+
column: 81
|
|
344
|
+
}
|
|
345
|
+
},
|
|
346
|
+
line: 139
|
|
347
|
+
}
|
|
348
|
+
},
|
|
349
|
+
branchMap: {
|
|
350
|
+
"0": {
|
|
351
|
+
loc: {
|
|
352
|
+
start: {
|
|
353
|
+
line: 61,
|
|
354
|
+
column: 37
|
|
355
|
+
},
|
|
356
|
+
end: {
|
|
357
|
+
line: 61,
|
|
358
|
+
column: 58
|
|
359
|
+
}
|
|
360
|
+
},
|
|
361
|
+
type: "default-arg",
|
|
362
|
+
locations: [{
|
|
363
|
+
start: {
|
|
364
|
+
line: 61,
|
|
365
|
+
column: 54
|
|
366
|
+
},
|
|
367
|
+
end: {
|
|
368
|
+
line: 61,
|
|
369
|
+
column: 58
|
|
370
|
+
}
|
|
371
|
+
}],
|
|
372
|
+
line: 61
|
|
373
|
+
},
|
|
374
|
+
"1": {
|
|
375
|
+
loc: {
|
|
376
|
+
start: {
|
|
377
|
+
line: 90,
|
|
378
|
+
column: 4
|
|
379
|
+
},
|
|
380
|
+
end: {
|
|
381
|
+
line: 94,
|
|
382
|
+
column: 5
|
|
383
|
+
}
|
|
384
|
+
},
|
|
385
|
+
type: "if",
|
|
386
|
+
locations: [{
|
|
387
|
+
start: {
|
|
388
|
+
line: 90,
|
|
389
|
+
column: 4
|
|
390
|
+
},
|
|
391
|
+
end: {
|
|
392
|
+
line: 94,
|
|
393
|
+
column: 5
|
|
394
|
+
}
|
|
395
|
+
}, {
|
|
396
|
+
start: {
|
|
397
|
+
line: undefined,
|
|
398
|
+
column: undefined
|
|
399
|
+
},
|
|
400
|
+
end: {
|
|
401
|
+
line: undefined,
|
|
402
|
+
column: undefined
|
|
403
|
+
}
|
|
404
|
+
}],
|
|
405
|
+
line: 90
|
|
406
|
+
},
|
|
407
|
+
"2": {
|
|
408
|
+
loc: {
|
|
409
|
+
start: {
|
|
410
|
+
line: 97,
|
|
411
|
+
column: 6
|
|
412
|
+
},
|
|
413
|
+
end: {
|
|
414
|
+
line: 99,
|
|
415
|
+
column: 7
|
|
416
|
+
}
|
|
417
|
+
},
|
|
418
|
+
type: "if",
|
|
419
|
+
locations: [{
|
|
420
|
+
start: {
|
|
421
|
+
line: 97,
|
|
422
|
+
column: 6
|
|
423
|
+
},
|
|
424
|
+
end: {
|
|
425
|
+
line: 99,
|
|
426
|
+
column: 7
|
|
427
|
+
}
|
|
428
|
+
}, {
|
|
429
|
+
start: {
|
|
430
|
+
line: undefined,
|
|
431
|
+
column: undefined
|
|
432
|
+
},
|
|
433
|
+
end: {
|
|
434
|
+
line: undefined,
|
|
435
|
+
column: undefined
|
|
436
|
+
}
|
|
437
|
+
}],
|
|
438
|
+
line: 97
|
|
439
|
+
},
|
|
440
|
+
"3": {
|
|
441
|
+
loc: {
|
|
442
|
+
start: {
|
|
443
|
+
line: 131,
|
|
444
|
+
column: 6
|
|
445
|
+
},
|
|
446
|
+
end: {
|
|
447
|
+
line: 133,
|
|
448
|
+
column: 7
|
|
449
|
+
}
|
|
450
|
+
},
|
|
451
|
+
type: "if",
|
|
452
|
+
locations: [{
|
|
453
|
+
start: {
|
|
454
|
+
line: 131,
|
|
455
|
+
column: 6
|
|
456
|
+
},
|
|
457
|
+
end: {
|
|
458
|
+
line: 133,
|
|
459
|
+
column: 7
|
|
460
|
+
}
|
|
461
|
+
}, {
|
|
462
|
+
start: {
|
|
463
|
+
line: undefined,
|
|
464
|
+
column: undefined
|
|
465
|
+
},
|
|
466
|
+
end: {
|
|
467
|
+
line: undefined,
|
|
468
|
+
column: undefined
|
|
469
|
+
}
|
|
470
|
+
}],
|
|
471
|
+
line: 131
|
|
472
|
+
}
|
|
473
|
+
},
|
|
474
|
+
s: {
|
|
475
|
+
"0": 0,
|
|
476
|
+
"1": 0,
|
|
477
|
+
"2": 0,
|
|
478
|
+
"3": 0,
|
|
479
|
+
"4": 0,
|
|
480
|
+
"5": 0,
|
|
481
|
+
"6": 0,
|
|
482
|
+
"7": 0,
|
|
483
|
+
"8": 0,
|
|
484
|
+
"9": 0,
|
|
485
|
+
"10": 0,
|
|
486
|
+
"11": 0,
|
|
487
|
+
"12": 0,
|
|
488
|
+
"13": 0,
|
|
489
|
+
"14": 0,
|
|
490
|
+
"15": 0
|
|
491
|
+
},
|
|
492
|
+
f: {
|
|
493
|
+
"0": 0,
|
|
494
|
+
"1": 0,
|
|
495
|
+
"2": 0,
|
|
496
|
+
"3": 0,
|
|
497
|
+
"4": 0,
|
|
498
|
+
"5": 0,
|
|
499
|
+
"6": 0
|
|
500
|
+
},
|
|
501
|
+
b: {
|
|
502
|
+
"0": [0],
|
|
503
|
+
"1": [0, 0],
|
|
504
|
+
"2": [0, 0],
|
|
505
|
+
"3": [0, 0]
|
|
506
|
+
},
|
|
507
|
+
_coverageSchema: "1a1c01bbd47fc00a2c39e90264f33305004495a9",
|
|
508
|
+
hash: "51667afe4718df933582fb85fa433039d7c23c54"
|
|
509
|
+
};
|
|
510
|
+
var coverage = global[gcv] || (global[gcv] = {});
|
|
511
|
+
if (!coverage[path] || coverage[path].hash !== hash) {
|
|
512
|
+
coverage[path] = coverageData;
|
|
513
|
+
}
|
|
514
|
+
var actualCoverage = coverage[path];
|
|
515
|
+
{
|
|
516
|
+
// @ts-ignore
|
|
517
|
+
cov_l8otr7ot0 = function () {
|
|
518
|
+
return actualCoverage;
|
|
519
|
+
};
|
|
520
|
+
}
|
|
521
|
+
return actualCoverage;
|
|
522
|
+
}
|
|
523
|
+
cov_l8otr7ot0();
|
|
7
524
|
/**
|
|
8
525
|
* @typedef {Object} ContxtApplicationConsent
|
|
9
526
|
* @param {string} clientId
|
|
@@ -55,22 +572,23 @@ import { toCamelCase } from '../utils/objects';
|
|
|
55
572
|
*
|
|
56
573
|
* @typicalname contxtSdk.coordinator.consent
|
|
57
574
|
*/
|
|
58
|
-
|
|
59
|
-
var Consent = function () {
|
|
575
|
+
class Consent {
|
|
60
576
|
/**
|
|
61
577
|
* @param {Object} sdk An instance of the SDK so the module can communicate with other modules
|
|
62
578
|
* @param {Object} request An instance of the request module tied to this module's audience.
|
|
63
579
|
* @param {string} baseUrl The base URL provided by the parent module
|
|
64
580
|
* @param {string} [organizationId] The organization ID to be used in tenant url requests
|
|
65
581
|
*/
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
582
|
+
constructor(sdk, request, baseUrl) {
|
|
583
|
+
let organizationId = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : (cov_l8otr7ot0().b[0][0]++, null);
|
|
584
|
+
cov_l8otr7ot0().f[0]++;
|
|
585
|
+
cov_l8otr7ot0().s[0]++;
|
|
71
586
|
this._baseUrl = baseUrl;
|
|
587
|
+
cov_l8otr7ot0().s[1]++;
|
|
72
588
|
this._request = request;
|
|
589
|
+
cov_l8otr7ot0().s[2]++;
|
|
73
590
|
this._sdk = sdk;
|
|
591
|
+
cov_l8otr7ot0().s[3]++;
|
|
74
592
|
this._organizationId = organizationId;
|
|
75
593
|
}
|
|
76
594
|
|
|
@@ -95,72 +613,81 @@ var Consent = function () {
|
|
|
95
613
|
* .then((userApproval) => console.log(userApproval))
|
|
96
614
|
* .catch((err) => console.log(err));
|
|
97
615
|
*/
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
616
|
+
accept(consentId) {
|
|
617
|
+
cov_l8otr7ot0().f[1]++;
|
|
618
|
+
cov_l8otr7ot0().s[4]++;
|
|
619
|
+
if (!consentId) {
|
|
620
|
+
cov_l8otr7ot0().b[1][0]++;
|
|
621
|
+
cov_l8otr7ot0().s[5]++;
|
|
622
|
+
return Promise.reject(new Error('A consent ID is required for accepting consent'));
|
|
623
|
+
} else {
|
|
624
|
+
cov_l8otr7ot0().b[1][1]++;
|
|
625
|
+
}
|
|
626
|
+
cov_l8otr7ot0().s[6]++;
|
|
627
|
+
return this._sdk.auth.getCurrentAccessToken().then(accessToken => {
|
|
628
|
+
cov_l8otr7ot0().f[2]++;
|
|
629
|
+
cov_l8otr7ot0().s[7]++;
|
|
630
|
+
if (!accessToken) {
|
|
631
|
+
cov_l8otr7ot0().b[2][0]++;
|
|
632
|
+
cov_l8otr7ot0().s[8]++;
|
|
633
|
+
return Promise.reject(new Error('A valid JWT token is required'));
|
|
634
|
+
} else {
|
|
635
|
+
cov_l8otr7ot0().b[2][1]++;
|
|
107
636
|
}
|
|
108
|
-
|
|
109
|
-
return this.
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
return
|
|
115
|
-
access_token: accessToken
|
|
116
|
-
}).then(function (userApproval) {
|
|
117
|
-
return toCamelCase(userApproval);
|
|
118
|
-
});
|
|
637
|
+
cov_l8otr7ot0().s[9]++;
|
|
638
|
+
return this._request.post(`${this._baseUrl}/consents/${consentId}/accept`, {
|
|
639
|
+
access_token: accessToken
|
|
640
|
+
}).then(userApproval => {
|
|
641
|
+
cov_l8otr7ot0().f[3]++;
|
|
642
|
+
cov_l8otr7ot0().s[10]++;
|
|
643
|
+
return _objects.default.toCamelCase(userApproval);
|
|
119
644
|
});
|
|
120
|
-
}
|
|
121
|
-
|
|
122
|
-
/**
|
|
123
|
-
* Gets the current application version's consent forms. The current
|
|
124
|
-
* access_token will be used to derive which application is being consented to.
|
|
125
|
-
*
|
|
126
|
-
*
|
|
127
|
-
* API Endpoint: '/applications/consent'
|
|
128
|
-
* Method: POST
|
|
129
|
-
*
|
|
130
|
-
* Note: Only valid for web users using auth0WebAuth session type
|
|
131
|
-
*
|
|
132
|
-
* @returns {Promise}
|
|
133
|
-
* @fulfill {ContxtApplicationConsent}
|
|
134
|
-
* @reject {Error}
|
|
135
|
-
*
|
|
136
|
-
* @example
|
|
137
|
-
* contxtSdk.coordinator.consent
|
|
138
|
-
* .getForCurrentApplication()
|
|
139
|
-
* .then((applicationConsent) => console.log(applicationConsent))
|
|
140
|
-
* .catch((err) => console.log(err));
|
|
141
|
-
*/
|
|
142
|
-
|
|
143
|
-
}, {
|
|
144
|
-
key: 'getForCurrentApplication',
|
|
145
|
-
value: function getForCurrentApplication() {
|
|
146
|
-
var _this2 = this;
|
|
147
|
-
|
|
148
|
-
return this._sdk.auth.getCurrentAccessToken().then(function (accessToken) {
|
|
149
|
-
if (!accessToken) {
|
|
150
|
-
return Promise.reject(new Error('A valid JWT token is required'));
|
|
151
|
-
}
|
|
645
|
+
});
|
|
646
|
+
}
|
|
152
647
|
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
648
|
+
/**
|
|
649
|
+
* Gets the current application version's consent forms. The current
|
|
650
|
+
* access_token will be used to derive which application is being consented to.
|
|
651
|
+
*
|
|
652
|
+
*
|
|
653
|
+
* API Endpoint: '/applications/consent'
|
|
654
|
+
* Method: POST
|
|
655
|
+
*
|
|
656
|
+
* Note: Only valid for web users using auth0WebAuth session type
|
|
657
|
+
*
|
|
658
|
+
* @returns {Promise}
|
|
659
|
+
* @fulfill {ContxtApplicationConsent}
|
|
660
|
+
* @reject {Error}
|
|
661
|
+
*
|
|
662
|
+
* @example
|
|
663
|
+
* contxtSdk.coordinator.consent
|
|
664
|
+
* .getForCurrentApplication()
|
|
665
|
+
* .then((applicationConsent) => console.log(applicationConsent))
|
|
666
|
+
* .catch((err) => console.log(err));
|
|
667
|
+
*/
|
|
668
|
+
getForCurrentApplication() {
|
|
669
|
+
cov_l8otr7ot0().f[4]++;
|
|
670
|
+
cov_l8otr7ot0().s[11]++;
|
|
671
|
+
return this._sdk.auth.getCurrentAccessToken().then(accessToken => {
|
|
672
|
+
cov_l8otr7ot0().f[5]++;
|
|
673
|
+
cov_l8otr7ot0().s[12]++;
|
|
674
|
+
if (!accessToken) {
|
|
675
|
+
cov_l8otr7ot0().b[3][0]++;
|
|
676
|
+
cov_l8otr7ot0().s[13]++;
|
|
677
|
+
return Promise.reject(new Error('A valid JWT token is required'));
|
|
678
|
+
} else {
|
|
679
|
+
cov_l8otr7ot0().b[3][1]++;
|
|
680
|
+
}
|
|
681
|
+
cov_l8otr7ot0().s[14]++;
|
|
682
|
+
return this._request.post(`${this._baseUrl}/applications/consent`, {
|
|
683
|
+
access_token: accessToken
|
|
684
|
+
}).then(applicationConsent => {
|
|
685
|
+
cov_l8otr7ot0().f[6]++;
|
|
686
|
+
cov_l8otr7ot0().s[15]++;
|
|
687
|
+
return _objects.default.toCamelCase(applicationConsent);
|
|
158
688
|
});
|
|
159
|
-
}
|
|
160
|
-
}
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
}();
|
|
164
|
-
|
|
165
|
-
export default Consent;
|
|
689
|
+
});
|
|
690
|
+
}
|
|
691
|
+
}
|
|
692
|
+
var _default = exports.default = Consent;
|
|
166
693
|
//# sourceMappingURL=consent.js.map
|