@fairandsmart/consents-ce 3.1.5 → 3.1.7
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/consumption/api.d.ts +5 -0
- package/consumption/api.js +35 -0
- package/consumption/index.d.ts +1 -0
- package/consumption/index.js +17 -0
- package/index.d.ts +1 -0
- package/index.js +2 -1
- package/package.json +3 -2
- package/subjects/api.d.ts +3 -1
- package/subjects/api.js +10 -1
- package/subjects/interfaces.d.ts +9 -0
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { Observable } from "rxjs";
|
|
2
|
+
import { RCApiOptions } from "../http";
|
|
3
|
+
import { StatsBag } from "../statistics";
|
|
4
|
+
export declare function getConsumption(after: number, before: number, options?: RCApiOptions): Observable<StatsBag>;
|
|
5
|
+
export declare function exportConsumptionCsv(after: number, before: number, options?: RCApiOptions): Observable<string>;
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.exportConsumptionCsv = exports.getConsumption = void 0;
|
|
4
|
+
var api_1 = require("../api");
|
|
5
|
+
function getConsumption(after, before, options) {
|
|
6
|
+
return api_1.RightConsents.http({
|
|
7
|
+
method: 'GET',
|
|
8
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/consumption"),
|
|
9
|
+
params: {
|
|
10
|
+
after: after,
|
|
11
|
+
before: before
|
|
12
|
+
},
|
|
13
|
+
headers: {
|
|
14
|
+
'Content-Type': 'application/json',
|
|
15
|
+
},
|
|
16
|
+
options: options
|
|
17
|
+
});
|
|
18
|
+
}
|
|
19
|
+
exports.getConsumption = getConsumption;
|
|
20
|
+
function exportConsumptionCsv(after, before, options) {
|
|
21
|
+
return api_1.RightConsents.http({
|
|
22
|
+
method: 'GET',
|
|
23
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/consumption/export"),
|
|
24
|
+
params: {
|
|
25
|
+
after: after,
|
|
26
|
+
before: before
|
|
27
|
+
},
|
|
28
|
+
headers: {
|
|
29
|
+
Accept: 'text/csv'
|
|
30
|
+
},
|
|
31
|
+
responseType: 'text',
|
|
32
|
+
options: options
|
|
33
|
+
});
|
|
34
|
+
}
|
|
35
|
+
exports.exportConsumptionCsv = exportConsumptionCsv;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from './api';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
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
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./api"), exports);
|
package/index.d.ts
CHANGED
|
@@ -13,5 +13,6 @@ export * as SystemResource from './system';
|
|
|
13
13
|
export * as TokensResource from './tokens';
|
|
14
14
|
export * as UsersResource from './users';
|
|
15
15
|
export * as TransactionResource from './transactions';
|
|
16
|
+
export * as ConsumptionResource from './consumption';
|
|
16
17
|
export { ConsentCollector } from './forms';
|
|
17
18
|
export declare const version = "v2.0.9 (ce)";
|
package/index.js
CHANGED
|
@@ -26,7 +26,7 @@ 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.TransactionResource = 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;
|
|
29
|
+
exports.version = exports.ConsentCollector = exports.ConsumptionResource = exports.TransactionResource = 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");
|
|
@@ -43,6 +43,7 @@ exports.SystemResource = __importStar(require("./system"));
|
|
|
43
43
|
exports.TokensResource = __importStar(require("./tokens"));
|
|
44
44
|
exports.UsersResource = __importStar(require("./users"));
|
|
45
45
|
exports.TransactionResource = __importStar(require("./transactions"));
|
|
46
|
+
exports.ConsumptionResource = __importStar(require("./consumption"));
|
|
46
47
|
var forms_1 = require("./forms");
|
|
47
48
|
Object.defineProperty(exports, "ConsentCollector", { enumerable: true, get: function () { return forms_1.ConsentCollector; } });
|
|
48
49
|
exports.version = "v2.0.9 (ce)";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fairandsmart/consents-ce",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.7",
|
|
4
4
|
"description": "TypeScript mappings for the Fair&Smart's Right Consents Community features",
|
|
5
5
|
"sideEffects": false,
|
|
6
6
|
"scripts": {},
|
|
@@ -46,6 +46,7 @@
|
|
|
46
46
|
"./system": "./system/index.js",
|
|
47
47
|
"./tokens": "./tokens/index.js",
|
|
48
48
|
"./users": "./users/index.js",
|
|
49
|
-
"./transactions": "./transactions/index.js"
|
|
49
|
+
"./transactions": "./transactions/index.js",
|
|
50
|
+
"./consumption": "./consumption/index.js"
|
|
50
51
|
}
|
|
51
52
|
}
|
package/subjects/api.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { SubjectDto } from './interfaces';
|
|
2
|
+
import { SubjectDto, SubjectFilter } from './interfaces';
|
|
3
3
|
import { RecordsMap } from '../records';
|
|
4
4
|
import { RCApiOptions } from '../http';
|
|
5
|
+
import { CollectionPage } from '../common';
|
|
5
6
|
export declare function listSubjects(name: string, options?: RCApiOptions): Observable<SubjectDto[]>;
|
|
7
|
+
export declare function getSubjects(filter: SubjectFilter, options?: RCApiOptions): Observable<CollectionPage<SubjectDto>>;
|
|
6
8
|
export declare function getSubject(name: string, options?: RCApiOptions): Observable<SubjectDto>;
|
|
7
9
|
export declare function createSubject(subject: SubjectDto, options?: RCApiOptions): Observable<SubjectDto>;
|
|
8
10
|
export declare function updateSubject(subject: SubjectDto, options?: RCApiOptions): Observable<SubjectDto>;
|
package/subjects/api.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.removeAlias = exports.setAlias = exports.getAliases = exports.listSubjectRecords = exports.updateSubject = exports.createSubject = exports.getSubject = exports.listSubjects = void 0;
|
|
3
|
+
exports.removeAlias = exports.setAlias = exports.getAliases = exports.listSubjectRecords = exports.updateSubject = exports.createSubject = exports.getSubject = exports.getSubjects = exports.listSubjects = void 0;
|
|
4
4
|
var api_1 = require("../api");
|
|
5
5
|
function listSubjects(name, options) {
|
|
6
6
|
return api_1.RightConsents.http({
|
|
@@ -11,6 +11,15 @@ function listSubjects(name, options) {
|
|
|
11
11
|
});
|
|
12
12
|
}
|
|
13
13
|
exports.listSubjects = listSubjects;
|
|
14
|
+
function getSubjects(filter, options) {
|
|
15
|
+
return api_1.RightConsents.http({
|
|
16
|
+
method: 'GET',
|
|
17
|
+
url: "".concat(api_1.RightConsents.config.apiRoot, "/subjects/paged"),
|
|
18
|
+
params: filter,
|
|
19
|
+
options: options
|
|
20
|
+
});
|
|
21
|
+
}
|
|
22
|
+
exports.getSubjects = getSubjects;
|
|
14
23
|
function getSubject(name, options) {
|
|
15
24
|
return api_1.RightConsents.http({
|
|
16
25
|
method: 'GET',
|
package/subjects/interfaces.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { SortDirection } from "../common";
|
|
1
2
|
export interface SubjectDto {
|
|
2
3
|
id: string;
|
|
3
4
|
name: string;
|
|
@@ -7,3 +8,11 @@ export interface SubjectDto {
|
|
|
7
8
|
supersededBy: string;
|
|
8
9
|
superseded: string[];
|
|
9
10
|
}
|
|
11
|
+
export interface SubjectFilter {
|
|
12
|
+
name?: string;
|
|
13
|
+
emailAddress?: string;
|
|
14
|
+
page?: number;
|
|
15
|
+
size?: number;
|
|
16
|
+
order?: string;
|
|
17
|
+
direction?: SortDirection;
|
|
18
|
+
}
|