@fairandsmart/consents-ce 2.0.10 → 2.0.12
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
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
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
|
+
# Preleminary note to developpers
|
|
6
|
+
|
|
7
|
+
Before mergin into master, please ensure you:
|
|
8
|
+
* updated `version` in `package-lib.json`
|
|
9
|
+
* run `npm run pack`
|
|
10
|
+
* embed in your MR what has been changed under lib/, _bundles/, docs/
|
|
11
|
+
|
|
12
|
+
|
|
5
13
|
# NPM/Node version
|
|
6
14
|
|
|
7
15
|
Known to work using node v14.21.3 (npm v6.14.18).
|
|
Binary file
|
package/package.json
CHANGED
package/subjects/api.d.ts
CHANGED
|
@@ -7,3 +7,6 @@ export declare function getSubject(name: string, options?: RCApiOptions): Observ
|
|
|
7
7
|
export declare function createSubject(subject: SubjectDto, options?: RCApiOptions): Observable<SubjectDto>;
|
|
8
8
|
export declare function updateSubject(subject: SubjectDto, options?: RCApiOptions): Observable<SubjectDto>;
|
|
9
9
|
export declare function listSubjectRecords(subject: string, options?: RCApiOptions): Observable<RecordsMap>;
|
|
10
|
+
export declare function getAliases(subject: string, options?: RCApiOptions): Observable<SubjectDto[]>;
|
|
11
|
+
export declare function setAlias(subject: string, supersede: string, options?: RCApiOptions): Observable<SubjectDto>;
|
|
12
|
+
export declare function removeAlias(alias: string, options?: RCApiOptions): Observable<SubjectDto>;
|
package/subjects/api.js
CHANGED
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.removeAlias =
|
|
4
|
+
exports.setAlias =
|
|
5
|
+
exports.getAliases =
|
|
6
|
+
exports.listSubjectRecords =
|
|
4
7
|
exports.updateSubject =
|
|
5
8
|
exports.createSubject =
|
|
6
9
|
exports.getSubject =
|
|
@@ -56,3 +59,34 @@ function listSubjectRecords(subject, options) {
|
|
|
56
59
|
});
|
|
57
60
|
}
|
|
58
61
|
exports.listSubjectRecords = listSubjectRecords;
|
|
62
|
+
function getAliases(subject, options) {
|
|
63
|
+
return api_1.RightConsents.http({
|
|
64
|
+
method: "GET",
|
|
65
|
+
url: ""
|
|
66
|
+
.concat(api_1.RightConsents.config.apiRoot, "/subjects/")
|
|
67
|
+
.concat(subject, "/aliases"),
|
|
68
|
+
options: options,
|
|
69
|
+
});
|
|
70
|
+
}
|
|
71
|
+
exports.getAliases = getAliases;
|
|
72
|
+
function setAlias(subject, supersede, options) {
|
|
73
|
+
return api_1.RightConsents.http({
|
|
74
|
+
method: "PUT",
|
|
75
|
+
url: ""
|
|
76
|
+
.concat(api_1.RightConsents.config.apiRoot, "/subjects/")
|
|
77
|
+
.concat(subject, "/aliases"),
|
|
78
|
+
params: { supersede: supersede },
|
|
79
|
+
options: options,
|
|
80
|
+
});
|
|
81
|
+
}
|
|
82
|
+
exports.setAlias = setAlias;
|
|
83
|
+
function removeAlias(alias, options) {
|
|
84
|
+
return api_1.RightConsents.http({
|
|
85
|
+
method: "DELETE",
|
|
86
|
+
url: ""
|
|
87
|
+
.concat(api_1.RightConsents.config.apiRoot, "/subjects/")
|
|
88
|
+
.concat(alias, "/aliases"),
|
|
89
|
+
options: options,
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
exports.removeAlias = removeAlias;
|
|
Binary file
|