@fairandsmart/consents-ce 1.3.14 → 1.3.18

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.
@@ -11,6 +11,7 @@ var ConsentHelper = /** @class */ (function () {
11
11
  return {
12
12
  language: lang,
13
13
  subject: record.subject,
14
+ object: record.object,
14
15
  origin: models_1.ConsentOrigin.USER,
15
16
  layoutData: {
16
17
  info: "",
@@ -10,7 +10,7 @@ export declare enum Confirmation {
10
10
  DIGITAL_SIGNATURE = "DIGITAL_SIGNATURE"
11
11
  }
12
12
  export declare const CONFIRMATION_TYPES: Confirmation[];
13
- export declare enum UserInfosKeys {
13
+ export declare enum SubjectInfosKeys {
14
14
  EMAIL_KEY = "emailAddress",
15
15
  PHONE_KEY = "phoneNumber"
16
16
  }
@@ -26,6 +26,8 @@ export declare enum ConfirmationConfigKeys {
26
26
  export interface ConsentContext {
27
27
  /** The identifier of the profile the processing will be linked to */
28
28
  subject: string;
29
+ /** The identifier of the object the processing will be linked to */
30
+ object?: string;
29
31
  /** If the form is not in iframe mode, the user will be redirected to this callback once the process is over */
30
32
  callback?: string;
31
33
  /** If the IFrame mode is set, set the allowed origin for the parent window domain */
@@ -53,6 +55,8 @@ export interface ConsentContext {
53
55
  };
54
56
  /** (readonly) A transaction identifier for that consent. */
55
57
  transaction?: string;
58
+ /** A transaction identifier for the leading transaction. */
59
+ leadingTransaction?: TransactionIdentifier;
56
60
  /** The identifier of the user who used the form */
57
61
  author?: string;
58
62
  /** The FormLayout Data to use ; if layout key is provided, layoutData will be ignored.*/
@@ -78,3 +82,7 @@ export interface ConsentTransaction {
78
82
  [key: string]: string;
79
83
  };
80
84
  }
85
+ export interface TransactionIdentifier {
86
+ location: string;
87
+ id: string;
88
+ }
@@ -1,7 +1,7 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ConfirmationConfigKeys =
4
- exports.UserInfosKeys =
4
+ exports.SubjectInfosKeys =
5
5
  exports.CONFIRMATION_TYPES =
6
6
  exports.Confirmation =
7
7
  void 0;
@@ -17,11 +17,14 @@ var Confirmation;
17
17
  Confirmation["DIGITAL_SIGNATURE"] = "DIGITAL_SIGNATURE";
18
18
  })((Confirmation = exports.Confirmation || (exports.Confirmation = {})));
19
19
  exports.CONFIRMATION_TYPES = Object.keys(Confirmation);
20
- var UserInfosKeys;
21
- (function (UserInfosKeys) {
22
- UserInfosKeys["EMAIL_KEY"] = "emailAddress";
23
- UserInfosKeys["PHONE_KEY"] = "phoneNumber";
24
- })((UserInfosKeys = exports.UserInfosKeys || (exports.UserInfosKeys = {})));
20
+ var SubjectInfosKeys;
21
+ (function (SubjectInfosKeys) {
22
+ SubjectInfosKeys["EMAIL_KEY"] = "emailAddress";
23
+ SubjectInfosKeys["PHONE_KEY"] = "phoneNumber";
24
+ })(
25
+ (SubjectInfosKeys =
26
+ exports.SubjectInfosKeys || (exports.SubjectInfosKeys = {}))
27
+ );
25
28
  var ConfirmationConfigKeys;
26
29
  (function (ConfirmationConfigKeys) {
27
30
  ConfirmationConfigKeys["SENDER_EMAIL_KEY"] = "senderEmail";
@@ -1,7 +1,9 @@
1
1
  import { ConsentCollectorCallback, ConsentCollectorConfig } from './interfaces';
2
+ import { ConsentContext } from '../consents';
2
3
  export declare class ConsentCollector {
3
4
  private config;
4
5
  constructor(config: ConsentCollectorConfig);
6
+ getContext(): ConsentContext;
5
7
  overrideSubject(newSubject: string): void;
6
8
  collect(callback?: ConsentCollectorCallback): Promise<void>;
7
9
  private getTokenFromBroker;
@@ -7,6 +7,9 @@ var ConsentCollector = /** @class */ (function () {
7
7
  function ConsentCollector(config) {
8
8
  this.config = config;
9
9
  }
10
+ ConsentCollector.prototype.getContext = function () {
11
+ return this.config.consentContext;
12
+ };
10
13
  ConsentCollector.prototype.overrideSubject = function (newSubject) {
11
14
  this.config.consentContext.subject = newSubject;
12
15
  this.config.consentContext.author = newSubject;
package/keys/api.d.ts CHANGED
@@ -2,5 +2,5 @@ import { Observable } from 'rxjs';
2
2
  import { Key } from './interfaces';
3
3
  import { RCApiOptions } from '../http';
4
4
  export declare function listKeys(options?: RCApiOptions): Observable<Key[]>;
5
- export declare function createKey(name: string, options?: RCApiOptions): Observable<Key>;
5
+ export declare function createKey(key: Key, options?: RCApiOptions): Observable<Key>;
6
6
  export declare function deleteKey(id: string, options?: RCApiOptions): Observable<void>;
package/keys/api.js CHANGED
@@ -10,11 +10,11 @@ function listKeys(options) {
10
10
  });
11
11
  }
12
12
  exports.listKeys = listKeys;
13
- function createKey(name, options) {
13
+ function createKey(key, options) {
14
14
  return api_1.RightConsents.http({
15
15
  method: "POST",
16
16
  url: "".concat(api_1.RightConsents.config.apiRoot, "/keys"),
17
- body: { name: name },
17
+ body: key,
18
18
  options: options,
19
19
  });
20
20
  }
@@ -1,3 +1,7 @@
1
+ export declare enum KeyScope {
2
+ OWNER = "OWNER",
3
+ PEER = "PEER"
4
+ }
1
5
  /**
2
6
  * An API Key, used for identification. The content of the key is only visible right after generating it.
3
7
  */
@@ -12,4 +16,6 @@ export interface Key {
12
16
  creationDate?: number;
13
17
  /** The last time the key was used */
14
18
  lastAccessDate?: number;
19
+ /** The key scope **/
20
+ scope: KeyScope;
15
21
  }
@@ -1,2 +1,8 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.KeyScope = void 0;
4
+ var KeyScope;
5
+ (function (KeyScope) {
6
+ KeyScope["OWNER"] = "OWNER";
7
+ KeyScope["PEER"] = "PEER";
8
+ })((KeyScope = exports.KeyScope || (exports.KeyScope = {})));
package/models/api.d.ts CHANGED
@@ -7,6 +7,7 @@ export declare function listEntries(filter: ModelFilter, options?: RCApiOptions)
7
7
  export declare function createEntry(dto: CreateModelDto, options?: RCApiOptions): Observable<ModelEntryDto>;
8
8
  export declare function getEntry(id: string, options?: RCApiOptions): Observable<ModelEntryDto>;
9
9
  export declare function updateEntry(id: string, dto: UpdateModelDto, options?: RCApiOptions): Observable<ModelEntryDto>;
10
+ export declare function updateEntryVisibility(id: string, dto: UpdateModelDto, options?: RCApiOptions): Observable<ModelEntryDto>;
10
11
  export declare function deleteEntry(id: string, options?: RCApiOptions): Observable<void>;
11
12
  export declare function setDefaultInfoModel(user: string, operator: string, form: string, options?: RCApiOptions): Observable<void>;
12
13
  export declare function listVersions<T extends ModelData = ModelData>(id: string, options?: RCApiOptions): Observable<ModelVersionDtoLight<T>[]>;
package/models/api.js CHANGED
@@ -14,6 +14,7 @@ exports.importEntry =
14
14
  exports.listVersions =
15
15
  exports.setDefaultInfoModel =
16
16
  exports.deleteEntry =
17
+ exports.updateEntryVisibility =
17
18
  exports.updateEntry =
18
19
  exports.getEntry =
19
20
  exports.createEntry =
@@ -63,6 +64,17 @@ function updateEntry(id, dto, options) {
63
64
  });
64
65
  }
65
66
  exports.updateEntry = updateEntry;
67
+ function updateEntryVisibility(id, dto, options) {
68
+ return api_1.RightConsents.http({
69
+ method: "PUT",
70
+ url: ""
71
+ .concat(api_1.RightConsents.config.apiRoot, "/models/")
72
+ .concat(id, "/visibility"),
73
+ body: dto,
74
+ options: options,
75
+ });
76
+ }
77
+ exports.updateEntryVisibility = updateEntryVisibility;
66
78
  function deleteEntry(id, options) {
67
79
  return api_1.RightConsents.http({
68
80
  method: "DELETE",
@@ -144,10 +144,18 @@ export interface Email extends ModelData {
144
144
  footer: string;
145
145
  signature: string;
146
146
  }
147
+ export interface PeerElements {
148
+ peer: string;
149
+ info: string;
150
+ elements: string[];
151
+ notification: string;
152
+ connectionId?: string;
153
+ }
147
154
  export interface FormLayout extends ModelData {
148
155
  type: 'layout';
149
156
  info: string;
150
157
  elements: string[];
158
+ peerElements?: PeerElements[];
151
159
  orientation?: FormLayoutOrientation;
152
160
  existingElementsVisible?: boolean;
153
161
  validityVisible?: boolean;
@@ -188,6 +196,7 @@ export interface ModelFilter {
188
196
  order?: string;
189
197
  direction?: SortDirection;
190
198
  tags?: string[];
199
+ shared?: boolean;
191
200
  }
192
201
  export interface PreviewDto {
193
202
  language: string;
@@ -236,6 +245,7 @@ export interface ModelEntryDtoPartial {
236
245
  defaultLanguage: string;
237
246
  availableLanguages: string[];
238
247
  tags?: string[];
248
+ shared: boolean;
239
249
  }
240
250
  export interface ModelEntryDto extends ModelEntryDtoPartial {
241
251
  versions: ModelVersionDtoLight[];
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@fairandsmart/consents-ce",
3
- "version": "1.3.14",
3
+ "version": "1.3.18",
4
4
  "description": "TypeScript mappings for the Fair&Smart's Right Consents Community features",
5
5
  "sideEffects": false,
6
6
  "scripts": {},
package/peers/api.d.ts ADDED
@@ -0,0 +1,8 @@
1
+ import { RCApiOptions } from '../http';
2
+ import { Observable } from 'rxjs';
3
+ import { Peer } from './interfaces';
4
+ export declare function listPeers(options?: RCApiOptions): Observable<Peer[]>;
5
+ export declare function createPeer(peer: Peer, options?: RCApiOptions): Observable<Peer>;
6
+ export declare function getPeer(id: string, options?: RCApiOptions): Observable<void>;
7
+ export declare function updatePeer(id: string, peer: Peer, options?: RCApiOptions): Observable<Peer>;
8
+ export declare function deletePeer(id: string, options?: RCApiOptions): Observable<void>;
package/peers/api.js ADDED
@@ -0,0 +1,51 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.deletePeer =
4
+ exports.updatePeer =
5
+ exports.getPeer =
6
+ exports.createPeer =
7
+ exports.listPeers =
8
+ void 0;
9
+ var api_1 = require("../api");
10
+ function listPeers(options) {
11
+ return api_1.RightConsents.http({
12
+ method: "GET",
13
+ url: "".concat(api_1.RightConsents.config.apiRoot, "/peers"),
14
+ options: options,
15
+ });
16
+ }
17
+ exports.listPeers = listPeers;
18
+ function createPeer(peer, options) {
19
+ return api_1.RightConsents.http({
20
+ method: "POST",
21
+ url: "".concat(api_1.RightConsents.config.apiRoot, "/peers"),
22
+ body: peer,
23
+ options: options,
24
+ });
25
+ }
26
+ exports.createPeer = createPeer;
27
+ function getPeer(id, options) {
28
+ return api_1.RightConsents.http({
29
+ method: "GET",
30
+ url: "".concat(api_1.RightConsents.config.apiRoot, "/peers/").concat(id),
31
+ options: options,
32
+ });
33
+ }
34
+ exports.getPeer = getPeer;
35
+ function updatePeer(id, peer, options) {
36
+ return api_1.RightConsents.http({
37
+ method: "PUT",
38
+ url: "".concat(api_1.RightConsents.config.apiRoot, "/peers/").concat(id),
39
+ body: peer,
40
+ options: options,
41
+ });
42
+ }
43
+ exports.updatePeer = updatePeer;
44
+ function deletePeer(id, options) {
45
+ return api_1.RightConsents.http({
46
+ method: "DELETE",
47
+ url: "".concat(api_1.RightConsents.config.apiRoot, "/peers/").concat(id),
48
+ options: options,
49
+ });
50
+ }
51
+ exports.deletePeer = deletePeer;
@@ -0,0 +1,2 @@
1
+ export * from './interfaces';
2
+ export * from './api';
package/peers/index.js ADDED
@@ -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,6 @@
1
+ export interface Peer {
2
+ id?: string;
3
+ name?: string;
4
+ url: string;
5
+ apiKey: string;
6
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -20,10 +20,13 @@ export declare enum RecordStatusExplanation {
20
20
  STILL_PENDING = "STILL_PENDING",
21
21
  ENTRY_DELETED = "ENTRY_DELETED"
22
22
  }
23
+ export declare const RECORD_IDENTIFIER_DEFAULT: string;
24
+ export declare const RECORD_IDENTIFIER_SEPARATOR: string;
23
25
  export interface RecordFilter {
24
26
  page?: number;
25
27
  size?: number;
26
28
  subject?: string;
29
+ object?: string;
27
30
  states?: RecordStates[];
28
31
  infos?: string[];
29
32
  elements?: string[];
@@ -37,6 +40,9 @@ export interface RecordFilter {
37
40
  export interface EntryRecord {
38
41
  id: string;
39
42
  key: string;
43
+ subject: string;
44
+ object?: string;
45
+ recordIdentifier: string;
40
46
  type: string;
41
47
  name: string;
42
48
  identifier: string;
@@ -74,6 +80,7 @@ export interface ExtractionResultRecord {
74
80
  recordKey: string;
75
81
  recordSerial: string;
76
82
  recordValue: string;
83
+ recordObject: string;
77
84
  }
78
85
  export interface ExtractionResultDto {
79
86
  subjectId: string;
@@ -86,6 +93,7 @@ export interface RecordDto {
86
93
  infoKey?: string;
87
94
  bodyKey: string;
88
95
  subject: string;
96
+ object?: string;
89
97
  creationTimestamp: number;
90
98
  expirationTimestamp: number;
91
99
  type: string;
@@ -3,6 +3,8 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.NotificationReportType =
4
4
  exports.NotificationReportStatus =
5
5
  exports.ExtractionConfigOperator =
6
+ exports.RECORD_IDENTIFIER_SEPARATOR =
7
+ exports.RECORD_IDENTIFIER_DEFAULT =
6
8
  exports.RecordStatusExplanation =
7
9
  exports.RecordStatus =
8
10
  exports.RecordStates =
@@ -34,6 +36,8 @@ var RecordStatusExplanation;
34
36
  (RecordStatusExplanation =
35
37
  exports.RecordStatusExplanation || (exports.RecordStatusExplanation = {}))
36
38
  );
39
+ exports.RECORD_IDENTIFIER_DEFAULT = "undefined";
40
+ exports.RECORD_IDENTIFIER_SEPARATOR = "|";
37
41
  var ExtractionConfigOperator;
38
42
  (function (ExtractionConfigOperator) {
39
43
  ExtractionConfigOperator["AND"] = "AND";
package/system/api.d.ts CHANGED
@@ -1,5 +1,6 @@
1
1
  import { Observable } from 'rxjs';
2
2
  import { ClientConfigDto, SupportInfoDto } from './interfaces';
3
3
  import { RCApiOptions } from '../http';
4
+ export declare function getInstance(options?: RCApiOptions): Observable<SupportInfoDto>;
4
5
  export declare function getSupportInfo(options?: RCApiOptions): Observable<SupportInfoDto>;
5
6
  export declare function getClientConfig(options?: RCApiOptions): Observable<ClientConfigDto>;
package/system/api.js CHANGED
@@ -1,7 +1,15 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getClientConfig = exports.getSupportInfo = void 0;
3
+ exports.getClientConfig = exports.getSupportInfo = exports.getInstance = void 0;
4
4
  var api_1 = require("../api");
5
+ function getInstance(options) {
6
+ return api_1.RightConsents.http({
7
+ method: "GET",
8
+ url: "".concat(api_1.RightConsents.config.apiRoot, "/system"),
9
+ options: options,
10
+ });
11
+ }
12
+ exports.getInstance = getInstance;
5
13
  function getSupportInfo(options) {
6
14
  return api_1.RightConsents.http({
7
15
  method: "GET",
@@ -1,3 +1,8 @@
1
+ export interface Instance {
2
+ id: string;
3
+ name: string;
4
+ language: string;
5
+ }
1
6
  export interface UserDto {
2
7
  username: string;
3
8
  admin: boolean;