@fairandsmart/consents-ce 2.0.14 → 2.0.15
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/consents/api.js +42 -50
- package/consents/helpers.js +16 -17
- package/consents/index.js +14 -30
- package/consents/interfaces.js +17 -27
- package/forms/consent-collector.js +94 -113
- package/forms/index.js +14 -30
- package/keys/api.js +16 -16
- package/keys/index.js +14 -30
- package/keys/interfaces.js +3 -3
- package/models/api.js +122 -191
- package/models/helpers.js +14 -23
- package/models/index.js +14 -30
- package/models/interfaces.js +59 -109
- package/package.json +1 -1
- package/peers/api.js +28 -33
- package/peers/index.js +14 -30
- package/receipts/api.js +7 -9
- package/receipts/index.js +14 -30
- package/records/api.js +39 -44
- package/records/index.js +14 -30
- package/records/interfaces.js +39 -61
- package/statistics/api.js +5 -5
- package/statistics/index.js +14 -30
- package/statistics/interfaces.js +4 -4
- package/subjects/api.js +45 -65
- package/subjects/index.js +14 -30
- package/system/api.js +15 -15
- package/system/index.js +14 -30
- package/tokens/api.js +7 -7
- package/tokens/index.js +14 -30
- package/users/api.js +15 -15
- package/users/index.js +14 -30
- package/webhooks/api.js +32 -43
- package/webhooks/index.js +14 -30
- package/webhooks/interfaces.js +2 -5
package/models/api.js
CHANGED
|
@@ -1,254 +1,185 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.importEntry =
|
|
4
|
-
exports.exportEntry =
|
|
5
|
-
exports.deleteVersion =
|
|
6
|
-
exports.getVersionPreview =
|
|
7
|
-
exports.updateVersionType =
|
|
8
|
-
exports.updateVersionStatus =
|
|
9
|
-
exports.updateVersion =
|
|
10
|
-
exports.getVersion =
|
|
11
|
-
exports.getActiveVersion =
|
|
12
|
-
exports.getLatestVersion =
|
|
13
|
-
exports.createVersion =
|
|
14
|
-
exports.listVersions =
|
|
15
|
-
exports.setDefaultInfoModel =
|
|
16
|
-
exports.getEntryByRKey =
|
|
17
|
-
exports.deleteEntry =
|
|
18
|
-
exports.updateEntryVisibility =
|
|
19
|
-
exports.updateEntry =
|
|
20
|
-
exports.getEntry =
|
|
21
|
-
exports.createEntry =
|
|
22
|
-
exports.listEntries =
|
|
23
|
-
exports.NEW_VERSION_UUID =
|
|
24
|
-
void 0;
|
|
3
|
+
exports.importEntry = exports.exportEntry = exports.deleteVersion = exports.getVersionPreview = exports.updateVersionType = exports.updateVersionStatus = exports.updateVersion = exports.getVersion = exports.getActiveVersion = exports.getLatestVersion = exports.createVersion = exports.listVersions = exports.setDefaultInfoModel = exports.getEntryByRKey = exports.deleteEntry = exports.updateEntryVisibility = exports.updateEntry = exports.getEntry = exports.createEntry = exports.listEntries = exports.NEW_VERSION_UUID = void 0;
|
|
25
4
|
var api_1 = require("../api");
|
|
26
|
-
exports.NEW_VERSION_UUID =
|
|
5
|
+
exports.NEW_VERSION_UUID = '11111111-9999-1111-9999-111111111111';
|
|
27
6
|
function listEntries(filter, options) {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
options: options,
|
|
36
|
-
});
|
|
7
|
+
if (options === void 0) { options = { noAuth: true }; }
|
|
8
|
+
return api_1.RightConsents.http({
|
|
9
|
+
method: 'GET',
|
|
10
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/models"),
|
|
11
|
+
params: filter,
|
|
12
|
+
options: options
|
|
13
|
+
});
|
|
37
14
|
}
|
|
38
15
|
exports.listEntries = listEntries;
|
|
39
16
|
function createEntry(dto, options) {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
17
|
+
return api_1.RightConsents.http({
|
|
18
|
+
method: 'POST',
|
|
19
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/models"),
|
|
20
|
+
body: dto,
|
|
21
|
+
options: options
|
|
22
|
+
});
|
|
46
23
|
}
|
|
47
24
|
exports.createEntry = createEntry;
|
|
48
25
|
function getEntry(id, options) {
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
options: options,
|
|
56
|
-
});
|
|
26
|
+
if (options === void 0) { options = { noAuth: true }; }
|
|
27
|
+
return api_1.RightConsents.http({
|
|
28
|
+
method: 'GET',
|
|
29
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/models/").concat(id),
|
|
30
|
+
options: options
|
|
31
|
+
});
|
|
57
32
|
}
|
|
58
33
|
exports.getEntry = getEntry;
|
|
59
34
|
function updateEntry(id, dto, options) {
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
35
|
+
return api_1.RightConsents.http({
|
|
36
|
+
method: 'PUT',
|
|
37
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/models/").concat(id),
|
|
38
|
+
body: dto,
|
|
39
|
+
options: options
|
|
40
|
+
});
|
|
66
41
|
}
|
|
67
42
|
exports.updateEntry = updateEntry;
|
|
68
43
|
function updateEntryVisibility(id, dto, options) {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
options: options,
|
|
76
|
-
});
|
|
44
|
+
return api_1.RightConsents.http({
|
|
45
|
+
method: 'PUT',
|
|
46
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/models/").concat(id, "/visibility"),
|
|
47
|
+
body: dto,
|
|
48
|
+
options: options
|
|
49
|
+
});
|
|
77
50
|
}
|
|
78
51
|
exports.updateEntryVisibility = updateEntryVisibility;
|
|
79
52
|
function deleteEntry(id, options) {
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
53
|
+
return api_1.RightConsents.http({
|
|
54
|
+
method: 'DELETE',
|
|
55
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/models/").concat(id),
|
|
56
|
+
options: options
|
|
57
|
+
});
|
|
85
58
|
}
|
|
86
59
|
exports.deleteEntry = deleteEntry;
|
|
87
60
|
function getEntryByRKey(recordKey, options) {
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
.concat(api_1.RightConsents.config.apiRoot, "/models/serials")
|
|
95
|
-
.concat(recordKey),
|
|
96
|
-
options: options,
|
|
97
|
-
});
|
|
61
|
+
if (options === void 0) { options = { noAuth: true }; }
|
|
62
|
+
return api_1.RightConsents.http({
|
|
63
|
+
method: 'GET',
|
|
64
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/models/serials").concat(recordKey),
|
|
65
|
+
options: options
|
|
66
|
+
});
|
|
98
67
|
}
|
|
99
68
|
exports.getEntryByRKey = getEntryByRKey;
|
|
100
69
|
function setDefaultInfoModel(user, operator, form, options) {
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
70
|
+
return api_1.RightConsents.http({
|
|
71
|
+
method: 'POST',
|
|
72
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/models/defaultinfo"),
|
|
73
|
+
params: { user: user, operator: operator, form: form },
|
|
74
|
+
options: options
|
|
75
|
+
});
|
|
107
76
|
}
|
|
108
77
|
exports.setDefaultInfoModel = setDefaultInfoModel;
|
|
109
78
|
function listVersions(id, options) {
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
.concat(api_1.RightConsents.config.apiRoot, "/models/")
|
|
117
|
-
.concat(id, "/versions"),
|
|
118
|
-
options: options,
|
|
119
|
-
});
|
|
79
|
+
if (options === void 0) { options = { noAuth: true }; }
|
|
80
|
+
return api_1.RightConsents.http({
|
|
81
|
+
method: 'GET',
|
|
82
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/models/").concat(id, "/versions"),
|
|
83
|
+
options: options
|
|
84
|
+
});
|
|
120
85
|
}
|
|
121
86
|
exports.listVersions = listVersions;
|
|
122
87
|
function createVersion(id, dto, options) {
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
options: options,
|
|
130
|
-
});
|
|
88
|
+
return api_1.RightConsents.http({
|
|
89
|
+
method: 'POST',
|
|
90
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/models/").concat(id, "/versions"),
|
|
91
|
+
body: dto,
|
|
92
|
+
options: options
|
|
93
|
+
});
|
|
131
94
|
}
|
|
132
95
|
exports.createVersion = createVersion;
|
|
133
96
|
function getLatestVersion(id, options) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
.concat(api_1.RightConsents.config.apiRoot, "/models/")
|
|
141
|
-
.concat(id, "/versions/latest"),
|
|
142
|
-
options: options,
|
|
143
|
-
});
|
|
97
|
+
if (options === void 0) { options = { noAuth: true }; }
|
|
98
|
+
return api_1.RightConsents.http({
|
|
99
|
+
method: 'GET',
|
|
100
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/models/").concat(id, "/versions/latest"),
|
|
101
|
+
options: options
|
|
102
|
+
});
|
|
144
103
|
}
|
|
145
104
|
exports.getLatestVersion = getLatestVersion;
|
|
146
105
|
function getActiveVersion(id, options) {
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
.concat(api_1.RightConsents.config.apiRoot, "/models/")
|
|
154
|
-
.concat(id, "/versions/active"),
|
|
155
|
-
options: options,
|
|
156
|
-
});
|
|
106
|
+
if (options === void 0) { options = { noAuth: true }; }
|
|
107
|
+
return api_1.RightConsents.http({
|
|
108
|
+
method: 'GET',
|
|
109
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/models/").concat(id, "/versions/active"),
|
|
110
|
+
options: options
|
|
111
|
+
});
|
|
157
112
|
}
|
|
158
113
|
exports.getActiveVersion = getActiveVersion;
|
|
159
114
|
function getVersion(id, versionId, options) {
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
.concat(api_1.RightConsents.config.apiRoot, "/models/")
|
|
167
|
-
.concat(id, "/versions/")
|
|
168
|
-
.concat(versionId),
|
|
169
|
-
options: options,
|
|
170
|
-
});
|
|
115
|
+
if (options === void 0) { options = { noAuth: true }; }
|
|
116
|
+
return api_1.RightConsents.http({
|
|
117
|
+
method: 'GET',
|
|
118
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/models/").concat(id, "/versions/").concat(versionId),
|
|
119
|
+
options: options
|
|
120
|
+
});
|
|
171
121
|
}
|
|
172
122
|
exports.getVersion = getVersion;
|
|
173
123
|
function updateVersion(id, versionId, dto, options) {
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
body: dto,
|
|
181
|
-
options: options,
|
|
182
|
-
});
|
|
124
|
+
return api_1.RightConsents.http({
|
|
125
|
+
method: 'PUT',
|
|
126
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/models/").concat(id, "/versions/").concat(versionId),
|
|
127
|
+
body: dto,
|
|
128
|
+
options: options
|
|
129
|
+
});
|
|
183
130
|
}
|
|
184
131
|
exports.updateVersion = updateVersion;
|
|
185
132
|
function updateVersionStatus(id, versionId, status, options) {
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
body: { status: status },
|
|
193
|
-
options: options,
|
|
194
|
-
});
|
|
133
|
+
return api_1.RightConsents.http({
|
|
134
|
+
method: 'PUT',
|
|
135
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/models/").concat(id, "/versions/").concat(versionId, "/status"),
|
|
136
|
+
body: { status: status },
|
|
137
|
+
options: options
|
|
138
|
+
});
|
|
195
139
|
}
|
|
196
140
|
exports.updateVersionStatus = updateVersionStatus;
|
|
197
141
|
function updateVersionType(id, versionId, type, options) {
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
body: { type: type },
|
|
205
|
-
options: options,
|
|
206
|
-
});
|
|
142
|
+
return api_1.RightConsents.http({
|
|
143
|
+
method: 'PUT',
|
|
144
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/models/").concat(id, "/versions/").concat(versionId, "/type"),
|
|
145
|
+
body: { type: type },
|
|
146
|
+
options: options
|
|
147
|
+
});
|
|
207
148
|
}
|
|
208
149
|
exports.updateVersionType = updateVersionType;
|
|
209
150
|
function getVersionPreview(id, vid, dto, options) {
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
responseType: "text",
|
|
218
|
-
options: options,
|
|
219
|
-
});
|
|
151
|
+
return api_1.RightConsents.http({
|
|
152
|
+
method: 'POST',
|
|
153
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/models/").concat(id, "/versions/").concat(vid, "/preview"),
|
|
154
|
+
body: dto,
|
|
155
|
+
responseType: 'text',
|
|
156
|
+
options: options
|
|
157
|
+
});
|
|
220
158
|
}
|
|
221
159
|
exports.getVersionPreview = getVersionPreview;
|
|
222
160
|
function deleteVersion(id, versionId, options) {
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
.concat(versionId),
|
|
229
|
-
options: options,
|
|
230
|
-
});
|
|
161
|
+
return api_1.RightConsents.http({
|
|
162
|
+
method: 'DELETE',
|
|
163
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/models/").concat(id, "/versions/").concat(versionId),
|
|
164
|
+
options: options
|
|
165
|
+
});
|
|
231
166
|
}
|
|
232
167
|
exports.deleteVersion = deleteVersion;
|
|
233
168
|
function exportEntry(id, options) {
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
.concat(api_1.RightConsents.config.apiRoot, "/models/")
|
|
241
|
-
.concat(id, "/export"),
|
|
242
|
-
options: options,
|
|
243
|
-
});
|
|
169
|
+
if (options === void 0) { options = { noAuth: true }; }
|
|
170
|
+
return api_1.RightConsents.http({
|
|
171
|
+
method: 'GET',
|
|
172
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/models/").concat(id, "/export"),
|
|
173
|
+
options: options
|
|
174
|
+
});
|
|
244
175
|
}
|
|
245
176
|
exports.exportEntry = exportEntry;
|
|
246
177
|
function importEntry(dto, options) {
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
178
|
+
return api_1.RightConsents.http({
|
|
179
|
+
method: 'POST',
|
|
180
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/models/import"),
|
|
181
|
+
body: dto,
|
|
182
|
+
options: options
|
|
183
|
+
});
|
|
253
184
|
}
|
|
254
185
|
exports.importEntry = importEntry;
|
package/models/helpers.js
CHANGED
|
@@ -3,27 +3,18 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.ModelEntryHelper = void 0;
|
|
4
4
|
var interfaces_1 = require("./interfaces");
|
|
5
5
|
var ModelEntryHelper = /** @class */ (function () {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
};
|
|
21
|
-
ModelEntryHelper.hasActiveVersion = function (model) {
|
|
22
|
-
return (
|
|
23
|
-
model.status !== interfaces_1.ModelEntryStatus.DELETED &&
|
|
24
|
-
ModelEntryHelper.getActiveVersion(model) != null
|
|
25
|
-
);
|
|
26
|
-
};
|
|
27
|
-
return ModelEntryHelper;
|
|
28
|
-
})();
|
|
6
|
+
function ModelEntryHelper() {
|
|
7
|
+
}
|
|
8
|
+
ModelEntryHelper.getActiveVersionIdentifier = function (model) {
|
|
9
|
+
var activeVersion = ModelEntryHelper.getActiveVersion(model);
|
|
10
|
+
return activeVersion != null ? "".concat(model.type, "/").concat(model.key, "/").concat(activeVersion.serial) : null;
|
|
11
|
+
};
|
|
12
|
+
ModelEntryHelper.getActiveVersion = function (model) {
|
|
13
|
+
return model.versions.find(function (v) { return v.status === interfaces_1.ModelVersionStatus.ACTIVE; });
|
|
14
|
+
};
|
|
15
|
+
ModelEntryHelper.hasActiveVersion = function (model) {
|
|
16
|
+
return model.status !== interfaces_1.ModelEntryStatus.DELETED && ModelEntryHelper.getActiveVersion(model) != null;
|
|
17
|
+
};
|
|
18
|
+
return ModelEntryHelper;
|
|
19
|
+
}());
|
|
29
20
|
exports.ModelEntryHelper = ModelEntryHelper;
|
package/models/index.js
CHANGED
|
@@ -1,34 +1,18 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __createBinding =
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
},
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
Object.defineProperty(o, k2, desc);
|
|
20
|
-
}
|
|
21
|
-
: function (o, m, k, k2) {
|
|
22
|
-
if (k2 === undefined) k2 = k;
|
|
23
|
-
o[k2] = m[k];
|
|
24
|
-
});
|
|
25
|
-
var __exportStar =
|
|
26
|
-
(this && this.__exportStar) ||
|
|
27
|
-
function (m, exports) {
|
|
28
|
-
for (var p in m)
|
|
29
|
-
if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p))
|
|
30
|
-
__createBinding(exports, m, p);
|
|
31
|
-
};
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
32
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
17
|
__exportStar(require("./interfaces"), exports);
|
|
34
18
|
__exportStar(require("./api"), exports);
|