@fairandsmart/consents-ce 1.3.15 → 1.3.19

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.js CHANGED
@@ -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",
@@ -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: "",
@@ -55,6 +55,8 @@ export interface ConsentContext {
55
55
  };
56
56
  /** (readonly) A transaction identifier for that consent. */
57
57
  transaction?: string;
58
+ /** A transaction identifier for the leading transaction. */
59
+ leadingTransaction?: TransactionIdentifier;
58
60
  /** The identifier of the user who used the form */
59
61
  author?: string;
60
62
  /** The FormLayout Data to use ; if layout key is provided, layoutData will be ignored.*/
@@ -80,3 +82,7 @@ export interface ConsentTransaction {
80
82
  [key: string]: string;
81
83
  };
82
84
  }
85
+ export interface TransactionIdentifier {
86
+ location: string;
87
+ id: string;
88
+ }
@@ -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.15",
3
+ "version": "1.3.19",
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 });
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;