@fairandsmart/consents-ce 2.0.13 → 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/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 = "11111111-9999-1111-9999-111111111111";
5
+ exports.NEW_VERSION_UUID = '11111111-9999-1111-9999-111111111111';
27
6
  function listEntries(filter, options) {
28
- if (options === void 0) {
29
- options = { noAuth: true };
30
- }
31
- return api_1.RightConsents.http({
32
- method: "GET",
33
- url: "".concat(api_1.RightConsents.config.apiRoot, "/models"),
34
- params: filter,
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
- return api_1.RightConsents.http({
41
- method: "POST",
42
- url: "".concat(api_1.RightConsents.config.apiRoot, "/models"),
43
- body: dto,
44
- options: options,
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
- if (options === void 0) {
50
- options = { noAuth: true };
51
- }
52
- return api_1.RightConsents.http({
53
- method: "GET",
54
- url: "".concat(api_1.RightConsents.config.apiRoot, "/models/").concat(id),
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
- return api_1.RightConsents.http({
61
- method: "PUT",
62
- url: "".concat(api_1.RightConsents.config.apiRoot, "/models/").concat(id),
63
- body: dto,
64
- options: options,
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
- return api_1.RightConsents.http({
70
- method: "PUT",
71
- url: ""
72
- .concat(api_1.RightConsents.config.apiRoot, "/models/")
73
- .concat(id, "/visibility"),
74
- body: dto,
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
- return api_1.RightConsents.http({
81
- method: "DELETE",
82
- url: "".concat(api_1.RightConsents.config.apiRoot, "/models/").concat(id),
83
- options: options,
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
- if (options === void 0) {
89
- options = { noAuth: true };
90
- }
91
- return api_1.RightConsents.http({
92
- method: "GET",
93
- url: ""
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
- return api_1.RightConsents.http({
102
- method: "POST",
103
- url: "".concat(api_1.RightConsents.config.apiRoot, "/models/defaultinfo"),
104
- params: { user: user, operator: operator, form: form },
105
- options: options,
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
- if (options === void 0) {
111
- options = { noAuth: true };
112
- }
113
- return api_1.RightConsents.http({
114
- method: "GET",
115
- url: ""
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
- return api_1.RightConsents.http({
124
- method: "POST",
125
- url: ""
126
- .concat(api_1.RightConsents.config.apiRoot, "/models/")
127
- .concat(id, "/versions"),
128
- body: dto,
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
- if (options === void 0) {
135
- options = { noAuth: true };
136
- }
137
- return api_1.RightConsents.http({
138
- method: "GET",
139
- url: ""
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
- if (options === void 0) {
148
- options = { noAuth: true };
149
- }
150
- return api_1.RightConsents.http({
151
- method: "GET",
152
- url: ""
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
- if (options === void 0) {
161
- options = { noAuth: true };
162
- }
163
- return api_1.RightConsents.http({
164
- method: "GET",
165
- url: ""
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
- return api_1.RightConsents.http({
175
- method: "PUT",
176
- url: ""
177
- .concat(api_1.RightConsents.config.apiRoot, "/models/")
178
- .concat(id, "/versions/")
179
- .concat(versionId),
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
- return api_1.RightConsents.http({
187
- method: "PUT",
188
- url: ""
189
- .concat(api_1.RightConsents.config.apiRoot, "/models/")
190
- .concat(id, "/versions/")
191
- .concat(versionId, "/status"),
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
- return api_1.RightConsents.http({
199
- method: "PUT",
200
- url: ""
201
- .concat(api_1.RightConsents.config.apiRoot, "/models/")
202
- .concat(id, "/versions/")
203
- .concat(versionId, "/type"),
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
- return api_1.RightConsents.http({
211
- method: "POST",
212
- url: ""
213
- .concat(api_1.RightConsents.config.apiRoot, "/models/")
214
- .concat(id, "/versions/")
215
- .concat(vid, "/preview"),
216
- body: dto,
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
- return api_1.RightConsents.http({
224
- method: "DELETE",
225
- url: ""
226
- .concat(api_1.RightConsents.config.apiRoot, "/models/")
227
- .concat(id, "/versions/")
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
- if (options === void 0) {
235
- options = { noAuth: true };
236
- }
237
- return api_1.RightConsents.http({
238
- method: "GET",
239
- url: ""
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
- return api_1.RightConsents.http({
248
- method: "POST",
249
- url: "".concat(api_1.RightConsents.config.apiRoot, "/models/import"),
250
- body: dto,
251
- options: options,
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
- function ModelEntryHelper() {}
7
- ModelEntryHelper.getActiveVersionIdentifier = function (model) {
8
- var activeVersion = ModelEntryHelper.getActiveVersion(model);
9
- return activeVersion != null
10
- ? ""
11
- .concat(model.type, "/")
12
- .concat(model.key, "/")
13
- .concat(activeVersion.serial)
14
- : null;
15
- };
16
- ModelEntryHelper.getActiveVersion = function (model) {
17
- return model.versions.find(function (v) {
18
- return v.status === interfaces_1.ModelVersionStatus.ACTIVE;
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
- (this && this.__createBinding) ||
4
- (Object.create
5
- ? function (o, m, k, k2) {
6
- if (k2 === undefined) k2 = k;
7
- var desc = Object.getOwnPropertyDescriptor(m, k);
8
- if (
9
- !desc ||
10
- ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)
11
- ) {
12
- desc = {
13
- enumerable: true,
14
- get: function () {
15
- return m[k];
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);
@@ -127,6 +127,12 @@ export interface Preference extends ModelData {
127
127
  defaultValues: string[];
128
128
  optional: boolean;
129
129
  }
130
+ export interface Objection extends ModelData {
131
+ type: 'objection';
132
+ title: string;
133
+ description: string;
134
+ objectByDefault: boolean;
135
+ }
130
136
  export interface Conditions extends ModelData {
131
137
  type: 'conditions';
132
138
  title: string;
@@ -200,7 +206,7 @@ export declare enum ConsentOrigin {
200
206
  USER = "USER"
201
207
  }
202
208
  export declare const CONSENT_ORIGIN: ConsentOrigin[];
203
- export declare type ModelDataType = 'information' | 'processing' | 'conditions' | 'theme' | 'email' | 'preference' | 'layout' | 'notice';
209
+ export declare type ModelDataType = 'information' | 'processing' | 'conditions' | 'theme' | 'email' | 'preference' | 'layout' | 'notice' | 'objection';
204
210
  export declare enum PreviewType {
205
211
  FORM = "FORM",
206
212
  RECEIPT = "RECEIPT",