@fairandsmart/consents-ce 2.0.6 → 2.0.8
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/README.md +5 -0
- package/consents/interfaces.d.ts +3 -0
- package/consents/interfaces.js +3 -2
- package/fairandsmart-consents-ce-2.0.8.tgz +0 -0
- package/forms/consent-collector.js +2 -2
- package/index.d.ts +4 -3
- package/index.js +5 -4
- package/models/interfaces.js +7 -7
- package/package.json +1 -1
- package/records/interfaces.js +6 -4
- package/webhooks/api.d.ts +8 -0
- package/webhooks/api.js +61 -0
- package/webhooks/index.d.ts +2 -0
- package/webhooks/index.js +34 -0
- package/webhooks/interfaces.d.ts +22 -0
- package/webhooks/interfaces.js +10 -0
- package/fairandsmart-consents-ce-2.0.6.tgz +0 -0
package/README.md
CHANGED
|
@@ -2,6 +2,11 @@
|
|
|
2
2
|
|
|
3
3
|
This project implements TypeScript definitions and API helpers for the [Fair&Smart Right Consents API](https://cmback.dev.env.fairandsmart.tech/swagger-ui/). It's meant for use in [Right Consents Front-end](https://github.com/fairandsmart/consent-manager-lib-ce), but should be general enough to use in any project. The code is maintained and based on the [Right Consents Back-end](https://github.com/fairandsmart/consent-manager-back) API resources and models, to be as close as possible to the true representation of the resources.
|
|
4
4
|
|
|
5
|
+
# NPM/Node version
|
|
6
|
+
|
|
7
|
+
Known to work using node v14.21.3 (npm v6.14.18).
|
|
8
|
+
Use NVM to force version if needed.
|
|
9
|
+
|
|
5
10
|
# Install
|
|
6
11
|
|
|
7
12
|
```
|
package/consents/interfaces.d.ts
CHANGED
|
@@ -3,6 +3,7 @@ export declare enum Confirmation {
|
|
|
3
3
|
NONE = "NONE",
|
|
4
4
|
FORM_CODE = "FORM_CODE",
|
|
5
5
|
EMAIL_CODE = "EMAIL_CODE",
|
|
6
|
+
MAGIC_LINK = "MAGIC_LINK",
|
|
6
7
|
SMS_CODE = "SMS_CODE",
|
|
7
8
|
SIGNATURE = "SIGNATURE",
|
|
8
9
|
AUDIO_RECORD = "AUDIO_RECORD",
|
|
@@ -75,6 +76,8 @@ export interface ConsentContext {
|
|
|
75
76
|
notification?: string;
|
|
76
77
|
/** Whether to send an invitation email upon transaction creation */
|
|
77
78
|
sendInvitation?: boolean;
|
|
79
|
+
/** used to tell where consent can be managed if needed */
|
|
80
|
+
managementUrl?: string;
|
|
78
81
|
}
|
|
79
82
|
export interface ConsentTransaction {
|
|
80
83
|
id: string;
|
package/consents/interfaces.js
CHANGED
|
@@ -10,6 +10,7 @@ var Confirmation;
|
|
|
10
10
|
Confirmation["NONE"] = "NONE";
|
|
11
11
|
Confirmation["FORM_CODE"] = "FORM_CODE";
|
|
12
12
|
Confirmation["EMAIL_CODE"] = "EMAIL_CODE";
|
|
13
|
+
Confirmation["MAGIC_LINK"] = "MAGIC_LINK";
|
|
13
14
|
Confirmation["SMS_CODE"] = "SMS_CODE";
|
|
14
15
|
Confirmation["SIGNATURE"] = "SIGNATURE";
|
|
15
16
|
Confirmation["AUDIO_RECORD"] = "AUDIO_RECORD";
|
|
@@ -23,7 +24,7 @@ var SubjectInfosKeys;
|
|
|
23
24
|
SubjectInfosKeys["PHONE_KEY"] = "phoneNumber";
|
|
24
25
|
})(
|
|
25
26
|
(SubjectInfosKeys =
|
|
26
|
-
exports.SubjectInfosKeys || (exports.SubjectInfosKeys = {}))
|
|
27
|
+
exports.SubjectInfosKeys || (exports.SubjectInfosKeys = {})),
|
|
27
28
|
);
|
|
28
29
|
var ConfirmationConfigKeys;
|
|
29
30
|
(function (ConfirmationConfigKeys) {
|
|
@@ -31,5 +32,5 @@ var ConfirmationConfigKeys;
|
|
|
31
32
|
ConfirmationConfigKeys["SENDER_PHONE_KEY"] = "senderPhone";
|
|
32
33
|
})(
|
|
33
34
|
(ConfirmationConfigKeys =
|
|
34
|
-
exports.ConfirmationConfigKeys || (exports.ConfirmationConfigKeys = {}))
|
|
35
|
+
exports.ConfirmationConfigKeys || (exports.ConfirmationConfigKeys = {})),
|
|
35
36
|
);
|
|
Binary file
|
|
@@ -70,7 +70,7 @@ var ConsentCollector = /** @class */ (function () {
|
|
|
70
70
|
var newWindow = window.open(
|
|
71
71
|
location,
|
|
72
72
|
"com_fs_window_consentCollect",
|
|
73
|
-
"menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,width=900px,height=600px"
|
|
73
|
+
"menubar=no,location=no,resizable=yes,scrollbars=yes,status=no,width=900px,height=600px",
|
|
74
74
|
);
|
|
75
75
|
if (!newWindow) {
|
|
76
76
|
throw new Error("Could not open window");
|
|
@@ -107,7 +107,7 @@ var ConsentCollector = /** @class */ (function () {
|
|
|
107
107
|
resolve();
|
|
108
108
|
},
|
|
109
109
|
},
|
|
110
|
-
el
|
|
110
|
+
el,
|
|
111
111
|
);
|
|
112
112
|
});
|
|
113
113
|
};
|
package/index.d.ts
CHANGED
|
@@ -2,9 +2,10 @@ export * from './http';
|
|
|
2
2
|
export * from './common';
|
|
3
3
|
export { RightConsents } from './api';
|
|
4
4
|
export * as ConsentsResource from './consents';
|
|
5
|
-
export * as
|
|
5
|
+
export * as FormResource from './forms';
|
|
6
6
|
export * as KeysResource from './keys';
|
|
7
|
-
export * as
|
|
7
|
+
export * as ModelsResource from './models';
|
|
8
|
+
export * as PeerResources from './peers';
|
|
8
9
|
export * as RecordsResource from './records';
|
|
9
10
|
export * as StatsResource from './statistics';
|
|
10
11
|
export * as SubjectsResource from './subjects';
|
|
@@ -12,4 +13,4 @@ export * as SystemResource from './system';
|
|
|
12
13
|
export * as TokensResource from './tokens';
|
|
13
14
|
export * as UsersResource from './users';
|
|
14
15
|
export { ConsentCollector } from './forms';
|
|
15
|
-
export declare const version = "
|
|
16
|
+
export declare const version = "v2.0.8 (ce)";
|
package/index.js
CHANGED
|
@@ -26,15 +26,16 @@ var __importStar = (this && this.__importStar) || function (mod) {
|
|
|
26
26
|
return result;
|
|
27
27
|
};
|
|
28
28
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
29
|
-
exports.version = exports.ConsentCollector = exports.UsersResource = exports.TokensResource = exports.SystemResource = exports.SubjectsResource = exports.StatsResource = exports.RecordsResource = exports.
|
|
29
|
+
exports.version = exports.ConsentCollector = exports.UsersResource = exports.TokensResource = exports.SystemResource = exports.SubjectsResource = exports.StatsResource = exports.RecordsResource = exports.PeerResources = exports.ModelsResource = exports.KeysResource = exports.FormResource = exports.ConsentsResource = exports.RightConsents = void 0;
|
|
30
30
|
__exportStar(require("./http"), exports);
|
|
31
31
|
__exportStar(require("./common"), exports);
|
|
32
32
|
var api_1 = require("./api");
|
|
33
33
|
Object.defineProperty(exports, "RightConsents", { enumerable: true, get: function () { return api_1.RightConsents; } });
|
|
34
34
|
exports.ConsentsResource = __importStar(require("./consents"));
|
|
35
|
-
exports.
|
|
35
|
+
exports.FormResource = __importStar(require("./forms"));
|
|
36
36
|
exports.KeysResource = __importStar(require("./keys"));
|
|
37
|
-
exports.
|
|
37
|
+
exports.ModelsResource = __importStar(require("./models"));
|
|
38
|
+
exports.PeerResources = __importStar(require("./peers"));
|
|
38
39
|
exports.RecordsResource = __importStar(require("./records"));
|
|
39
40
|
exports.StatsResource = __importStar(require("./statistics"));
|
|
40
41
|
exports.SubjectsResource = __importStar(require("./subjects"));
|
|
@@ -43,4 +44,4 @@ exports.TokensResource = __importStar(require("./tokens"));
|
|
|
43
44
|
exports.UsersResource = __importStar(require("./users"));
|
|
44
45
|
var forms_1 = require("./forms");
|
|
45
46
|
Object.defineProperty(exports, "ConsentCollector", { enumerable: true, get: function () { return forms_1.ConsentCollector; } });
|
|
46
|
-
exports.version = "
|
|
47
|
+
exports.version = "v2.0.8 (ce)";
|
package/models/interfaces.js
CHANGED
|
@@ -32,7 +32,7 @@ var ModelEntryStatus;
|
|
|
32
32
|
ModelEntryStatus["DELETED"] = "DELETED";
|
|
33
33
|
})(
|
|
34
34
|
(ModelEntryStatus =
|
|
35
|
-
exports.ModelEntryStatus || (exports.ModelEntryStatus = {}))
|
|
35
|
+
exports.ModelEntryStatus || (exports.ModelEntryStatus = {})),
|
|
36
36
|
);
|
|
37
37
|
exports.MODEL_ENTRY_STATUSES = Object.keys(ModelEntryStatus);
|
|
38
38
|
var ModelVersionStatus;
|
|
@@ -42,7 +42,7 @@ var ModelVersionStatus;
|
|
|
42
42
|
ModelVersionStatus["ARCHIVED"] = "ARCHIVED";
|
|
43
43
|
})(
|
|
44
44
|
(ModelVersionStatus =
|
|
45
|
-
exports.ModelVersionStatus || (exports.ModelVersionStatus = {}))
|
|
45
|
+
exports.ModelVersionStatus || (exports.ModelVersionStatus = {})),
|
|
46
46
|
);
|
|
47
47
|
var ModelVersionType;
|
|
48
48
|
(function (ModelVersionType) {
|
|
@@ -50,7 +50,7 @@ var ModelVersionType;
|
|
|
50
50
|
ModelVersionType["MINOR"] = "MINOR";
|
|
51
51
|
})(
|
|
52
52
|
(ModelVersionType =
|
|
53
|
-
exports.ModelVersionType || (exports.ModelVersionType = {}))
|
|
53
|
+
exports.ModelVersionType || (exports.ModelVersionType = {})),
|
|
54
54
|
);
|
|
55
55
|
var Visibility;
|
|
56
56
|
(function (Visibility) {
|
|
@@ -83,7 +83,7 @@ var ProcessingPurpose;
|
|
|
83
83
|
ProcessingPurpose["CONSENT_RESEARCH"] = "CONSENT_RESEARCH";
|
|
84
84
|
})(
|
|
85
85
|
(ProcessingPurpose =
|
|
86
|
-
exports.ProcessingPurpose || (exports.ProcessingPurpose = {}))
|
|
86
|
+
exports.ProcessingPurpose || (exports.ProcessingPurpose = {})),
|
|
87
87
|
);
|
|
88
88
|
exports.PROCESSING_PURPOSES = Object.keys(ProcessingPurpose);
|
|
89
89
|
var ProcessingLegalBasis;
|
|
@@ -100,7 +100,7 @@ var ProcessingLegalBasis;
|
|
|
100
100
|
"LEGAL_BASIS_VITAL_INTEREST";
|
|
101
101
|
})(
|
|
102
102
|
(ProcessingLegalBasis =
|
|
103
|
-
exports.ProcessingLegalBasis || (exports.ProcessingLegalBasis = {}))
|
|
103
|
+
exports.ProcessingLegalBasis || (exports.ProcessingLegalBasis = {})),
|
|
104
104
|
);
|
|
105
105
|
exports.PROCESSING_LEGAL_BASES = Object.keys(ProcessingLegalBasis);
|
|
106
106
|
var PreferenceValueType;
|
|
@@ -113,7 +113,7 @@ var PreferenceValueType;
|
|
|
113
113
|
PreferenceValueType["FREE_TEXT"] = "FREE_TEXT";
|
|
114
114
|
})(
|
|
115
115
|
(PreferenceValueType =
|
|
116
|
-
exports.PreferenceValueType || (exports.PreferenceValueType = {}))
|
|
116
|
+
exports.PreferenceValueType || (exports.PreferenceValueType = {})),
|
|
117
117
|
);
|
|
118
118
|
exports.PREFERENCE_VALUE_TYPES = Object.keys(PreferenceValueType);
|
|
119
119
|
var LogoPosition;
|
|
@@ -129,7 +129,7 @@ var FormLayoutOrientation;
|
|
|
129
129
|
FormLayoutOrientation["VERTICAL"] = "VERTICAL";
|
|
130
130
|
})(
|
|
131
131
|
(FormLayoutOrientation =
|
|
132
|
-
exports.FormLayoutOrientation || (exports.FormLayoutOrientation = {}))
|
|
132
|
+
exports.FormLayoutOrientation || (exports.FormLayoutOrientation = {})),
|
|
133
133
|
);
|
|
134
134
|
exports.CONSENT_FORM_ORIENTATIONS = Object.keys(FormLayoutOrientation);
|
|
135
135
|
var ConsentOrigin;
|
package/package.json
CHANGED
package/records/interfaces.js
CHANGED
|
@@ -34,7 +34,7 @@ var RecordStatusExplanation;
|
|
|
34
34
|
RecordStatusExplanation["ENTRY_DELETED"] = "ENTRY_DELETED";
|
|
35
35
|
})(
|
|
36
36
|
(RecordStatusExplanation =
|
|
37
|
-
exports.RecordStatusExplanation || (exports.RecordStatusExplanation = {}))
|
|
37
|
+
exports.RecordStatusExplanation || (exports.RecordStatusExplanation = {})),
|
|
38
38
|
);
|
|
39
39
|
exports.RECORD_IDENTIFIER_DEFAULT = "undefined";
|
|
40
40
|
exports.RECORD_IDENTIFIER_SEPARATOR = "|";
|
|
@@ -44,7 +44,8 @@ var ExtractionConfigOperator;
|
|
|
44
44
|
ExtractionConfigOperator["OR"] = "OR";
|
|
45
45
|
})(
|
|
46
46
|
(ExtractionConfigOperator =
|
|
47
|
-
exports.ExtractionConfigOperator ||
|
|
47
|
+
exports.ExtractionConfigOperator ||
|
|
48
|
+
(exports.ExtractionConfigOperator = {})),
|
|
48
49
|
);
|
|
49
50
|
var NotificationReportStatus;
|
|
50
51
|
(function (NotificationReportStatus) {
|
|
@@ -58,7 +59,8 @@ var NotificationReportStatus;
|
|
|
58
59
|
NotificationReportStatus["NONE"] = "NONE";
|
|
59
60
|
})(
|
|
60
61
|
(NotificationReportStatus =
|
|
61
|
-
exports.NotificationReportStatus ||
|
|
62
|
+
exports.NotificationReportStatus ||
|
|
63
|
+
(exports.NotificationReportStatus = {})),
|
|
62
64
|
);
|
|
63
65
|
var NotificationReportType;
|
|
64
66
|
(function (NotificationReportType) {
|
|
@@ -69,5 +71,5 @@ var NotificationReportType;
|
|
|
69
71
|
NotificationReportType["NONE"] = "NONE";
|
|
70
72
|
})(
|
|
71
73
|
(NotificationReportType =
|
|
72
|
-
exports.NotificationReportType || (exports.NotificationReportType = {}))
|
|
74
|
+
exports.NotificationReportType || (exports.NotificationReportType = {})),
|
|
73
75
|
);
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Observable } from 'rxjs';
|
|
2
|
+
import { WebhookDto } from './interfaces';
|
|
3
|
+
import { RCApiOptions } from '../http';
|
|
4
|
+
export declare function listWebhooks(options?: RCApiOptions): Observable<WebhookDto>;
|
|
5
|
+
export declare function createWebhook(webhook: WebhookDto, options?: RCApiOptions): Observable<WebhookDto>;
|
|
6
|
+
export declare function getWebhook(webhookid: string, options?: RCApiOptions): Observable<WebhookDto>;
|
|
7
|
+
export declare function updateWebhook(webhookid: string, webhook: WebhookDto, options?: RCApiOptions): Observable<WebhookDto>;
|
|
8
|
+
export declare function deleteWebhook(webhookid: string, options?: RCApiOptions): Observable<WebhookDto>;
|
package/webhooks/api.js
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.deleteWebhook =
|
|
4
|
+
exports.updateWebhook =
|
|
5
|
+
exports.getWebhook =
|
|
6
|
+
exports.createWebhook =
|
|
7
|
+
exports.listWebhooks =
|
|
8
|
+
void 0;
|
|
9
|
+
var api_1 = require("../api");
|
|
10
|
+
function listWebhooks(options) {
|
|
11
|
+
return api_1.RightConsents.http({
|
|
12
|
+
method: "GET",
|
|
13
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/webhooks"),
|
|
14
|
+
options: options,
|
|
15
|
+
});
|
|
16
|
+
}
|
|
17
|
+
exports.listWebhooks = listWebhooks;
|
|
18
|
+
function createWebhook(webhook, options) {
|
|
19
|
+
return api_1.RightConsents.http({
|
|
20
|
+
method: "POST",
|
|
21
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/webhooks"),
|
|
22
|
+
body: webhook,
|
|
23
|
+
resolveHeaders: true,
|
|
24
|
+
headers: {
|
|
25
|
+
"Content-Type": "application/json",
|
|
26
|
+
},
|
|
27
|
+
options: options,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
exports.createWebhook = createWebhook;
|
|
31
|
+
function getWebhook(webhookid, options) {
|
|
32
|
+
return api_1.RightConsents.http({
|
|
33
|
+
method: "GET",
|
|
34
|
+
url: ""
|
|
35
|
+
.concat(api_1.RightConsents.config.apiRoot, "/webhooks/")
|
|
36
|
+
.concat(webhookid),
|
|
37
|
+
options: options,
|
|
38
|
+
});
|
|
39
|
+
}
|
|
40
|
+
exports.getWebhook = getWebhook;
|
|
41
|
+
function updateWebhook(webhookid, webhook, options) {
|
|
42
|
+
return api_1.RightConsents.http({
|
|
43
|
+
method: "PUT",
|
|
44
|
+
url: ""
|
|
45
|
+
.concat(api_1.RightConsents.config.apiRoot, "/webhooks/")
|
|
46
|
+
.concat(webhookid),
|
|
47
|
+
body: webhook,
|
|
48
|
+
options: options,
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
exports.updateWebhook = updateWebhook;
|
|
52
|
+
function deleteWebhook(webhookid, options) {
|
|
53
|
+
return api_1.RightConsents.http({
|
|
54
|
+
method: "DELETE",
|
|
55
|
+
url: ""
|
|
56
|
+
.concat(api_1.RightConsents.config.apiRoot, "/webhooks/")
|
|
57
|
+
.concat(webhookid),
|
|
58
|
+
options: options,
|
|
59
|
+
});
|
|
60
|
+
}
|
|
61
|
+
exports.deleteWebhook = deleteWebhook;
|
|
@@ -0,0 +1,34 @@
|
|
|
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
|
+
};
|
|
32
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
33
|
+
__exportStar(require("./interfaces"), exports);
|
|
34
|
+
__exportStar(require("./api"), exports);
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
export interface WebhookDto {
|
|
2
|
+
id?: string;
|
|
3
|
+
name: string;
|
|
4
|
+
targetUrl: string;
|
|
5
|
+
subscribedActions: SubscribedActions[];
|
|
6
|
+
delivery?: WebhookDeliveryDto[];
|
|
7
|
+
}
|
|
8
|
+
export declare enum SubscribedActions {
|
|
9
|
+
CONSENT_COMMIT = "CONSENT_COMMIT"
|
|
10
|
+
}
|
|
11
|
+
export interface WebhookDeliveryDto {
|
|
12
|
+
id?: string;
|
|
13
|
+
sourceId: string;
|
|
14
|
+
webhookId: string;
|
|
15
|
+
redelivery: boolean;
|
|
16
|
+
createdAt: string;
|
|
17
|
+
deliveredAt: string;
|
|
18
|
+
duration: string;
|
|
19
|
+
status: string;
|
|
20
|
+
statusCode: number;
|
|
21
|
+
action: SubscribedActions;
|
|
22
|
+
}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SubscribedActions = void 0;
|
|
4
|
+
var SubscribedActions;
|
|
5
|
+
(function (SubscribedActions) {
|
|
6
|
+
SubscribedActions["CONSENT_COMMIT"] = "CONSENT_COMMIT";
|
|
7
|
+
})(
|
|
8
|
+
(SubscribedActions =
|
|
9
|
+
exports.SubscribedActions || (exports.SubscribedActions = {})),
|
|
10
|
+
);
|
|
Binary file
|