@fairandsmart/consents-ce 1.3.19 → 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 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<string>;
5
- export declare function getTransactionJson(transactionId: string, options?: RCApiOptions): Observable<string>;
6
- export declare function postSubmissionValuesHtml(txid: string, values: {
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.postSubmissionValuesHtml =
4
+ exports.postSubmissionValuesJson =
5
5
  exports.getTransactionJson =
6
6
  exports.createTransactionJson =
7
7
  void 0;
@@ -20,12 +20,12 @@ function createTransactionJson(ctx, lang, options) {
20
20
  });
21
21
  }
22
22
  exports.createTransactionJson = createTransactionJson;
23
- function getTransactionJson(transactionId, options) {
23
+ function getTransactionJson(txid, options) {
24
24
  return api_1.RightConsents.http({
25
25
  method: "GET",
26
26
  url: ""
27
27
  .concat(api_1.RightConsents.config.apiRoot, "/consents/")
28
- .concat(transactionId),
28
+ .concat(txid),
29
29
  headers: {
30
30
  "Content-Type": "application/json",
31
31
  },
@@ -33,25 +33,21 @@ function getTransactionJson(transactionId, options) {
33
33
  });
34
34
  }
35
35
  exports.getTransactionJson = getTransactionJson;
36
- function postSubmissionValuesHtml(txid, values, options) {
36
+ function postSubmissionValuesJson(txid, values, options) {
37
37
  return api_1.RightConsents.http({
38
38
  method: "POST",
39
39
  url: ""
40
40
  .concat(api_1.RightConsents.config.apiRoot, "/consents/")
41
41
  .concat(txid, "/submit"),
42
- body: Object.keys(values)
43
- .map(function (key) {
44
- return "".concat(key, "=").concat(encodeURIComponent(values[key]));
45
- })
46
- .join("&"),
42
+ body: values,
47
43
  responseType: "text",
48
44
  headers: {
49
- "Content-Type": "application/x-www-form-urlencoded; charset=UTF-8",
45
+ "Content-Type": "application/json",
50
46
  },
51
47
  options: options,
52
48
  });
53
49
  }
54
- exports.postSubmissionValuesHtml = postSubmissionValuesHtml;
50
+ exports.postSubmissionValuesJson = postSubmissionValuesJson;
55
51
  function getSubmitFormPreview(ctx, lang, options) {
56
52
  return api_1.RightConsents.http({
57
53
  method: "POST",
@@ -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
- transaction: string;
81
- claims: {
82
- [key: string]: string;
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;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fairandsmart/consents-ce",
3
- "version": "1.3.19",
3
+ "version": "1.3.20",
4
4
  "description": "TypeScript mappings for the Fair&Smart's Right Consents Community features",
5
5
  "sideEffects": false,
6
6
  "scripts": {},