@fairandsmart/consents-ce 1.3.18 → 1.3.20
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.d.ts +5 -5
- package/consents/api.js +7 -12
- package/consents/interfaces.d.ts +10 -5
- package/package.json +1 -1
package/consents/api.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { Observable } from 'rxjs';
|
|
2
|
-
import { ConsentContext } from './interfaces';
|
|
2
|
+
import { ConsentContext, ConsentTransaction } from './interfaces';
|
|
3
3
|
import { RCApiOptions } from '../http';
|
|
4
|
-
export declare function createTransactionJson(ctx: ConsentContext, lang: string, options?: RCApiOptions): Observable<
|
|
5
|
-
export declare function getTransactionJson(
|
|
6
|
-
export declare function
|
|
7
|
-
[key: string]: string;
|
|
4
|
+
export declare function createTransactionJson(ctx: ConsentContext, lang: string, options?: RCApiOptions): Observable<ConsentTransaction>;
|
|
5
|
+
export declare function getTransactionJson(txid: string, options?: RCApiOptions): Observable<ConsentTransaction>;
|
|
6
|
+
export declare function postSubmissionValuesJson(txid: string, values: {
|
|
7
|
+
[key: string]: string[];
|
|
8
8
|
}, options?: RCApiOptions): Observable<string>;
|
|
9
9
|
export declare function getSubmitFormPreview(ctx: ConsentContext, lang: string, options?: RCApiOptions): Observable<string>;
|
package/consents/api.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getSubmitFormPreview =
|
|
4
|
-
exports.
|
|
4
|
+
exports.postSubmissionValuesJson =
|
|
5
5
|
exports.getTransactionJson =
|
|
6
6
|
exports.createTransactionJson =
|
|
7
7
|
void 0;
|
|
@@ -11,7 +11,6 @@ function createTransactionJson(ctx, lang, options) {
|
|
|
11
11
|
method: "POST",
|
|
12
12
|
url: "".concat(api_1.RightConsents.config.apiRoot, "/consents"),
|
|
13
13
|
body: ctx,
|
|
14
|
-
responseType: "text",
|
|
15
14
|
resolveHeaders: true,
|
|
16
15
|
headers: {
|
|
17
16
|
"Content-Type": "application/json",
|
|
@@ -21,12 +20,12 @@ function createTransactionJson(ctx, lang, options) {
|
|
|
21
20
|
});
|
|
22
21
|
}
|
|
23
22
|
exports.createTransactionJson = createTransactionJson;
|
|
24
|
-
function getTransactionJson(
|
|
23
|
+
function getTransactionJson(txid, options) {
|
|
25
24
|
return api_1.RightConsents.http({
|
|
26
25
|
method: "GET",
|
|
27
26
|
url: ""
|
|
28
27
|
.concat(api_1.RightConsents.config.apiRoot, "/consents/")
|
|
29
|
-
.concat(
|
|
28
|
+
.concat(txid),
|
|
30
29
|
headers: {
|
|
31
30
|
"Content-Type": "application/json",
|
|
32
31
|
},
|
|
@@ -34,25 +33,21 @@ function getTransactionJson(transactionId, options) {
|
|
|
34
33
|
});
|
|
35
34
|
}
|
|
36
35
|
exports.getTransactionJson = getTransactionJson;
|
|
37
|
-
function
|
|
36
|
+
function postSubmissionValuesJson(txid, values, options) {
|
|
38
37
|
return api_1.RightConsents.http({
|
|
39
38
|
method: "POST",
|
|
40
39
|
url: ""
|
|
41
40
|
.concat(api_1.RightConsents.config.apiRoot, "/consents/")
|
|
42
41
|
.concat(txid, "/submit"),
|
|
43
|
-
body:
|
|
44
|
-
.map(function (key) {
|
|
45
|
-
return "".concat(key, "=").concat(encodeURIComponent(values[key]));
|
|
46
|
-
})
|
|
47
|
-
.join("&"),
|
|
42
|
+
body: values,
|
|
48
43
|
responseType: "text",
|
|
49
44
|
headers: {
|
|
50
|
-
"Content-Type": "application/
|
|
45
|
+
"Content-Type": "application/json",
|
|
51
46
|
},
|
|
52
47
|
options: options,
|
|
53
48
|
});
|
|
54
49
|
}
|
|
55
|
-
exports.
|
|
50
|
+
exports.postSubmissionValuesJson = postSubmissionValuesJson;
|
|
56
51
|
function getSubmitFormPreview(ctx, lang, options) {
|
|
57
52
|
return api_1.RightConsents.http({
|
|
58
53
|
method: "POST",
|
package/consents/interfaces.d.ts
CHANGED
|
@@ -74,13 +74,18 @@ export interface ConsentContext {
|
|
|
74
74
|
/** The reference to the 'email' mode for notification */
|
|
75
75
|
notification?: string;
|
|
76
76
|
}
|
|
77
|
-
/** Used to generate a Receipt from a transaction id */
|
|
78
77
|
export interface ConsentTransaction {
|
|
78
|
+
id: string;
|
|
79
79
|
subject: string;
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
80
|
+
state: string;
|
|
81
|
+
leader: string;
|
|
82
|
+
followers: string[];
|
|
83
|
+
context: ConsentContext;
|
|
84
|
+
token: string;
|
|
85
|
+
task: string;
|
|
86
|
+
receipt: string;
|
|
87
|
+
breed: string;
|
|
88
|
+
cpp: string;
|
|
84
89
|
}
|
|
85
90
|
export interface TransactionIdentifier {
|
|
86
91
|
location: string;
|