From e30c92af4cd028006ad757c491b09446797297f2 Mon Sep 17 00:00:00 2001 From: Justin Boileau Date: Tue, 3 Jan 2023 13:43:53 -0700 Subject: [PATCH] -wip- possible feat: timeline api function --- localization/translations/fr-CA.xlf | 4 - localization/translations/fr-FR.xlf | 4 - localization/translations/fr.xlf | 4 - .../src/bldn-bridge-demand-list-item.ts | 213 ++++++----- .../bridge/src/generated/locales/fr-CA.ts | 1 - .../bridge/src/generated/locales/fr-FR.ts | 1 - packages/bridge/src/generated/locales/fr.ts | 1 - .../src/generated/locales/fr-CA.ts | 1 - .../src/generated/locales/fr-FR.ts | 1 - .../configuration/src/generated/locales/fr.ts | 1 - .../src/generated/locales/fr-CA.ts | 1 - .../src/generated/locales/fr-FR.ts | 1 - .../src/generated/locales/fr.ts | 1 - .../core-ui/src/generated/locales/fr-CA.ts | 1 - .../core-ui/src/generated/locales/fr-FR.ts | 1 - packages/core-ui/src/generated/locales/fr.ts | 1 - .../core/src/computation/computation-api.ts | 24 ++ .../models/generated-models/core/ApiError.ts | 28 -- .../core/ApiRequestOptions.ts | 23 -- .../models/generated-models/core/ApiResult.ts | 10 - .../core/CancelablePromise.ts | 127 ------- .../models/generated-models/core/OpenAPI.ts | 31 -- .../models/generated-models/core/request.ts | 341 ------------------ .../core/src/models/generated-models/index.ts | 31 +- .../models/ChangeRecommendationPayload.ts | 10 + .../models/CompletedDemandInfoPayload.ts | 4 +- .../models/CompletedDemandPayload.ts | 2 +- .../models/CreateApplicationPayload.ts | 7 + .../models/CreateProvenancePayload.ts | 2 +- .../models/DataCallbackPayload.ts | 1 + .../models/DemandResolutionStrategy.ts | 4 +- .../models/GiveConsentPayload.ts | 4 - .../models/GiveConsentProactive.ts | 9 + .../models/GiveConsentUnsafePayload.ts | 11 + .../models/GivenConsentEvent.ts | 12 + .../generated-models/models/LegalBaseEvent.ts | 35 ++ .../models/PendingDemandDetailsPayload.ts | 4 +- .../models/PendingDemandPayload.ts | 2 +- .../models/PrivacyRequestDemand.ts | 2 +- .../models/PrivacyRequestEvent.ts | 23 ++ .../models/PrivacyRequestEventDemand.ts | 34 ++ .../models/PrivacyResponseEvent.ts | 46 +++ .../models/PrivacyResponsePayload.ts | 4 +- .../generated-models/models/Provenance.ts | 2 +- .../models/RecommendationPayload.ts | 51 +++ .../models/RevokedConsentEvent.ts | 9 + .../generated-models/models/ScopePayload.ts | 76 ++-- .../models/StoreGivenConsentPayload.ts | 11 + .../models/TimelineEventsPayload.ts | 17 + .../services/CallbacksService.ts | 35 -- .../services/ConfigurationService.ts | 336 ----------------- .../services/DataConsumerInterfaceService.ts | 82 ----- .../services/HealthService.ts | 20 - .../services/PrivacyRequestsService.ts | 106 ------ .../services/UserEventsService.ts | 114 ------ .../services/UserInfoService.ts | 31 -- .../src/generated/locales/fr-CA.ts | 1 - .../src/generated/locales/fr-FR.ts | 1 - .../src/generated/locales/fr.ts | 1 - .../action-forms/bldn-other-form.ts | 5 +- .../request-builder/bldn-request-builder.ts | 2 +- .../request-builder/bldn-request-review.ts | 4 +- .../src/request-viewer/bldn-request-status.ts | 4 +- 63 files changed, 501 insertions(+), 1475 deletions(-) delete mode 100644 packages/core/src/models/generated-models/core/ApiError.ts delete mode 100644 packages/core/src/models/generated-models/core/ApiRequestOptions.ts delete mode 100644 packages/core/src/models/generated-models/core/ApiResult.ts delete mode 100644 packages/core/src/models/generated-models/core/CancelablePromise.ts delete mode 100644 packages/core/src/models/generated-models/core/OpenAPI.ts delete mode 100644 packages/core/src/models/generated-models/core/request.ts create mode 100644 packages/core/src/models/generated-models/models/ChangeRecommendationPayload.ts create mode 100644 packages/core/src/models/generated-models/models/CreateApplicationPayload.ts create mode 100644 packages/core/src/models/generated-models/models/GiveConsentProactive.ts create mode 100644 packages/core/src/models/generated-models/models/GiveConsentUnsafePayload.ts create mode 100644 packages/core/src/models/generated-models/models/GivenConsentEvent.ts create mode 100644 packages/core/src/models/generated-models/models/LegalBaseEvent.ts create mode 100644 packages/core/src/models/generated-models/models/PrivacyRequestEvent.ts create mode 100644 packages/core/src/models/generated-models/models/PrivacyRequestEventDemand.ts create mode 100644 packages/core/src/models/generated-models/models/PrivacyResponseEvent.ts create mode 100644 packages/core/src/models/generated-models/models/RecommendationPayload.ts create mode 100644 packages/core/src/models/generated-models/models/RevokedConsentEvent.ts create mode 100644 packages/core/src/models/generated-models/models/StoreGivenConsentPayload.ts create mode 100644 packages/core/src/models/generated-models/models/TimelineEventsPayload.ts delete mode 100644 packages/core/src/models/generated-models/services/CallbacksService.ts delete mode 100644 packages/core/src/models/generated-models/services/ConfigurationService.ts delete mode 100644 packages/core/src/models/generated-models/services/DataConsumerInterfaceService.ts delete mode 100644 packages/core/src/models/generated-models/services/HealthService.ts delete mode 100644 packages/core/src/models/generated-models/services/PrivacyRequestsService.ts delete mode 100644 packages/core/src/models/generated-models/services/UserEventsService.ts delete mode 100644 packages/core/src/models/generated-models/services/UserInfoService.ts diff --git a/localization/translations/fr-CA.xlf b/localization/translations/fr-CA.xlf index 34b94780..24736993 100644 --- a/localization/translations/fr-CA.xlf +++ b/localization/translations/fr-CA.xlf @@ -1050,10 +1050,6 @@ Submit Envoyer - - History view coming soon! - Historique bientôt disponible ! - Response Submmitted Réponse envoyée diff --git a/localization/translations/fr-FR.xlf b/localization/translations/fr-FR.xlf index fff37c33..d6713f66 100644 --- a/localization/translations/fr-FR.xlf +++ b/localization/translations/fr-FR.xlf @@ -1050,10 +1050,6 @@ Submit Envoyer - - History view coming soon! - Historique bientôt disponible ! - Response Submmitted Réponse envoyée diff --git a/localization/translations/fr.xlf b/localization/translations/fr.xlf index 971fb25c..e75f0af7 100644 --- a/localization/translations/fr.xlf +++ b/localization/translations/fr.xlf @@ -1050,10 +1050,6 @@ Submit Envoyer - - History view coming soon! - Historique bientôt disponible ! - Response Submmitted Réponse envoyée diff --git a/packages/bridge/src/bldn-bridge-demand-list-item.ts b/packages/bridge/src/bldn-bridge-demand-list-item.ts index 1eb6e935..932a8d3c 100644 --- a/packages/bridge/src/bldn-bridge-demand-list-item.ts +++ b/packages/bridge/src/bldn-bridge-demand-list-item.ts @@ -12,6 +12,12 @@ import { DataSubjectPayload, CompletedDemandPayload, Recommendation, + TimelineEventsPayload, + PrivacyRequestEvent, + PrivacyResponseEvent, + GivenConsentEvent, + RevokedConsentEvent, + LegalBaseEvent, } from '@blindnet/core'; import { bldnStyles } from '@blindnet/core-ui'; import { ACTION_TITLES } from './language/dictionary.js'; @@ -35,6 +41,8 @@ export class BldnBridgeDemandListItem extends LitElement { @state() _demandDetails: PendingDemandDetailsPayload | undefined; + @state() _demandTimeline: TimelineEventsPayload | undefined; + @state() _open = false; @state() _dropdownUiState: DropdownUIState = DropdownUIState.Respond; @@ -155,6 +163,7 @@ export class BldnBridgeDemandListItem extends LitElement { _changedProperties: PropertyValueMap | Map ): void { if (_changedProperties.has('_open') && this._open && this.demand) { + // Get details about this demand ComputationAPI.getInstance() .getPendingDemandDetails(this.demand.id) .then(details => { @@ -164,10 +173,46 @@ export class BldnBridgeDemandListItem extends LitElement { this._demandDetails!.recommendation?.status; } }); + + // Get timeline info for this demand + if (this.demand.data_subject?.id) { + ComputationAPI.getInstance() + .getDemandTimeline(this.demand.data_subject?.id) + .then(timeline => { + this._demandTimeline = timeline; + console.log(this._demandTimeline); + + let events: Array< + | PrivacyRequestEvent + | PrivacyResponseEvent + | GivenConsentEvent + | RevokedConsentEvent + | LegalBaseEvent + | { date: string; dateObj: Date } + > = []; + + events = events + .concat( + timeline.requests!, + timeline.responses!, + timeline.given_consents!, + timeline.revoked_consents!, + timeline.legal_bases! + ) + .map(e => ({ + ...e, + dateObj: new Date(e.date), + })) + .sort((e1, e2) => e1.dateObj.getTime() - e2.dateObj.getTime()); + + // Now do some kind of while loop to pop from events and get templates + // based on which type of event it is + }); + } } } - render() { + getRespondTemplate() { // List of status, css class, and display message objects for each response option const responseStatusOptions: { respStatus: Recommendation.status; @@ -187,6 +232,85 @@ export class BldnBridgeDemandListItem extends LitElement { }, ]; + return html` + + ${msg('Submit')} + `; + } + + getTimelineTemplate() { + return html``; + } + + render() { return html` ${when( this.demand !== undefined, @@ -222,91 +346,8 @@ export class BldnBridgeDemandListItem extends LitElement { @bldn-toggle-button-change=${this.handleDropdownToggleChange} > ${choose(this._dropdownUiState, [ - [ - DropdownUIState.Respond, - () => html` - - ${msg('Submit')} - `, - ], - [ - DropdownUIState.History, - () => html`${msg('History view coming soon!')}`, - ], + [DropdownUIState.Respond, () => this.getRespondTemplate()], + [DropdownUIState.History, () => this.getTimelineTemplate()], [ DropdownUIState.Responded, () => html`${msg('Response Submmitted')} 📨`, diff --git a/packages/bridge/src/generated/locales/fr-CA.ts b/packages/bridge/src/generated/locales/fr-CA.ts index 8ed3d2ce..e2fdbf3b 100644 --- a/packages/bridge/src/generated/locales/fr-CA.ts +++ b/packages/bridge/src/generated/locales/fr-CA.ts @@ -129,7 +129,6 @@ 's29ec563d56cf6c6b': `Autres Options`, 's2a32ad5ec5fc7e5c': `Il n'y a pas de source de données vous concernant`, 's2a880deefa02ab59': `Profilage`, -'s2b7bb3f9a459d7dd': `Historique bientôt disponible !`, 's2e39367a8c5564b7': `Autres données`, 's2fa47f3acd802112': `Identifiant Unique - Compte Utilisateur`, 's3137e812940ae6b7': `Vos données sont en cours d'obtention, veuillez patienter et ne pas actualiser la page`, diff --git a/packages/bridge/src/generated/locales/fr-FR.ts b/packages/bridge/src/generated/locales/fr-FR.ts index 8ed3d2ce..e2fdbf3b 100644 --- a/packages/bridge/src/generated/locales/fr-FR.ts +++ b/packages/bridge/src/generated/locales/fr-FR.ts @@ -129,7 +129,6 @@ 's29ec563d56cf6c6b': `Autres Options`, 's2a32ad5ec5fc7e5c': `Il n'y a pas de source de données vous concernant`, 's2a880deefa02ab59': `Profilage`, -'s2b7bb3f9a459d7dd': `Historique bientôt disponible !`, 's2e39367a8c5564b7': `Autres données`, 's2fa47f3acd802112': `Identifiant Unique - Compte Utilisateur`, 's3137e812940ae6b7': `Vos données sont en cours d'obtention, veuillez patienter et ne pas actualiser la page`, diff --git a/packages/bridge/src/generated/locales/fr.ts b/packages/bridge/src/generated/locales/fr.ts index 8ed3d2ce..e2fdbf3b 100644 --- a/packages/bridge/src/generated/locales/fr.ts +++ b/packages/bridge/src/generated/locales/fr.ts @@ -129,7 +129,6 @@ 's29ec563d56cf6c6b': `Autres Options`, 's2a32ad5ec5fc7e5c': `Il n'y a pas de source de données vous concernant`, 's2a880deefa02ab59': `Profilage`, -'s2b7bb3f9a459d7dd': `Historique bientôt disponible !`, 's2e39367a8c5564b7': `Autres données`, 's2fa47f3acd802112': `Identifiant Unique - Compte Utilisateur`, 's3137e812940ae6b7': `Vos données sont en cours d'obtention, veuillez patienter et ne pas actualiser la page`, diff --git a/packages/configuration/src/generated/locales/fr-CA.ts b/packages/configuration/src/generated/locales/fr-CA.ts index 8ed3d2ce..e2fdbf3b 100644 --- a/packages/configuration/src/generated/locales/fr-CA.ts +++ b/packages/configuration/src/generated/locales/fr-CA.ts @@ -129,7 +129,6 @@ 's29ec563d56cf6c6b': `Autres Options`, 's2a32ad5ec5fc7e5c': `Il n'y a pas de source de données vous concernant`, 's2a880deefa02ab59': `Profilage`, -'s2b7bb3f9a459d7dd': `Historique bientôt disponible !`, 's2e39367a8c5564b7': `Autres données`, 's2fa47f3acd802112': `Identifiant Unique - Compte Utilisateur`, 's3137e812940ae6b7': `Vos données sont en cours d'obtention, veuillez patienter et ne pas actualiser la page`, diff --git a/packages/configuration/src/generated/locales/fr-FR.ts b/packages/configuration/src/generated/locales/fr-FR.ts index 8ed3d2ce..e2fdbf3b 100644 --- a/packages/configuration/src/generated/locales/fr-FR.ts +++ b/packages/configuration/src/generated/locales/fr-FR.ts @@ -129,7 +129,6 @@ 's29ec563d56cf6c6b': `Autres Options`, 's2a32ad5ec5fc7e5c': `Il n'y a pas de source de données vous concernant`, 's2a880deefa02ab59': `Profilage`, -'s2b7bb3f9a459d7dd': `Historique bientôt disponible !`, 's2e39367a8c5564b7': `Autres données`, 's2fa47f3acd802112': `Identifiant Unique - Compte Utilisateur`, 's3137e812940ae6b7': `Vos données sont en cours d'obtention, veuillez patienter et ne pas actualiser la page`, diff --git a/packages/configuration/src/generated/locales/fr.ts b/packages/configuration/src/generated/locales/fr.ts index 8ed3d2ce..e2fdbf3b 100644 --- a/packages/configuration/src/generated/locales/fr.ts +++ b/packages/configuration/src/generated/locales/fr.ts @@ -129,7 +129,6 @@ 's29ec563d56cf6c6b': `Autres Options`, 's2a32ad5ec5fc7e5c': `Il n'y a pas de source de données vous concernant`, 's2a880deefa02ab59': `Profilage`, -'s2b7bb3f9a459d7dd': `Historique bientôt disponible !`, 's2e39367a8c5564b7': `Autres données`, 's2fa47f3acd802112': `Identifiant Unique - Compte Utilisateur`, 's3137e812940ae6b7': `Vos données sont en cours d'obtention, veuillez patienter et ne pas actualiser la page`, diff --git a/packages/consent-checkbox/src/generated/locales/fr-CA.ts b/packages/consent-checkbox/src/generated/locales/fr-CA.ts index 8ed3d2ce..e2fdbf3b 100644 --- a/packages/consent-checkbox/src/generated/locales/fr-CA.ts +++ b/packages/consent-checkbox/src/generated/locales/fr-CA.ts @@ -129,7 +129,6 @@ 's29ec563d56cf6c6b': `Autres Options`, 's2a32ad5ec5fc7e5c': `Il n'y a pas de source de données vous concernant`, 's2a880deefa02ab59': `Profilage`, -'s2b7bb3f9a459d7dd': `Historique bientôt disponible !`, 's2e39367a8c5564b7': `Autres données`, 's2fa47f3acd802112': `Identifiant Unique - Compte Utilisateur`, 's3137e812940ae6b7': `Vos données sont en cours d'obtention, veuillez patienter et ne pas actualiser la page`, diff --git a/packages/consent-checkbox/src/generated/locales/fr-FR.ts b/packages/consent-checkbox/src/generated/locales/fr-FR.ts index 8ed3d2ce..e2fdbf3b 100644 --- a/packages/consent-checkbox/src/generated/locales/fr-FR.ts +++ b/packages/consent-checkbox/src/generated/locales/fr-FR.ts @@ -129,7 +129,6 @@ 's29ec563d56cf6c6b': `Autres Options`, 's2a32ad5ec5fc7e5c': `Il n'y a pas de source de données vous concernant`, 's2a880deefa02ab59': `Profilage`, -'s2b7bb3f9a459d7dd': `Historique bientôt disponible !`, 's2e39367a8c5564b7': `Autres données`, 's2fa47f3acd802112': `Identifiant Unique - Compte Utilisateur`, 's3137e812940ae6b7': `Vos données sont en cours d'obtention, veuillez patienter et ne pas actualiser la page`, diff --git a/packages/consent-checkbox/src/generated/locales/fr.ts b/packages/consent-checkbox/src/generated/locales/fr.ts index 8ed3d2ce..e2fdbf3b 100644 --- a/packages/consent-checkbox/src/generated/locales/fr.ts +++ b/packages/consent-checkbox/src/generated/locales/fr.ts @@ -129,7 +129,6 @@ 's29ec563d56cf6c6b': `Autres Options`, 's2a32ad5ec5fc7e5c': `Il n'y a pas de source de données vous concernant`, 's2a880deefa02ab59': `Profilage`, -'s2b7bb3f9a459d7dd': `Historique bientôt disponible !`, 's2e39367a8c5564b7': `Autres données`, 's2fa47f3acd802112': `Identifiant Unique - Compte Utilisateur`, 's3137e812940ae6b7': `Vos données sont en cours d'obtention, veuillez patienter et ne pas actualiser la page`, diff --git a/packages/core-ui/src/generated/locales/fr-CA.ts b/packages/core-ui/src/generated/locales/fr-CA.ts index 8ed3d2ce..e2fdbf3b 100644 --- a/packages/core-ui/src/generated/locales/fr-CA.ts +++ b/packages/core-ui/src/generated/locales/fr-CA.ts @@ -129,7 +129,6 @@ 's29ec563d56cf6c6b': `Autres Options`, 's2a32ad5ec5fc7e5c': `Il n'y a pas de source de données vous concernant`, 's2a880deefa02ab59': `Profilage`, -'s2b7bb3f9a459d7dd': `Historique bientôt disponible !`, 's2e39367a8c5564b7': `Autres données`, 's2fa47f3acd802112': `Identifiant Unique - Compte Utilisateur`, 's3137e812940ae6b7': `Vos données sont en cours d'obtention, veuillez patienter et ne pas actualiser la page`, diff --git a/packages/core-ui/src/generated/locales/fr-FR.ts b/packages/core-ui/src/generated/locales/fr-FR.ts index 8ed3d2ce..e2fdbf3b 100644 --- a/packages/core-ui/src/generated/locales/fr-FR.ts +++ b/packages/core-ui/src/generated/locales/fr-FR.ts @@ -129,7 +129,6 @@ 's29ec563d56cf6c6b': `Autres Options`, 's2a32ad5ec5fc7e5c': `Il n'y a pas de source de données vous concernant`, 's2a880deefa02ab59': `Profilage`, -'s2b7bb3f9a459d7dd': `Historique bientôt disponible !`, 's2e39367a8c5564b7': `Autres données`, 's2fa47f3acd802112': `Identifiant Unique - Compte Utilisateur`, 's3137e812940ae6b7': `Vos données sont en cours d'obtention, veuillez patienter et ne pas actualiser la page`, diff --git a/packages/core-ui/src/generated/locales/fr.ts b/packages/core-ui/src/generated/locales/fr.ts index 8ed3d2ce..e2fdbf3b 100644 --- a/packages/core-ui/src/generated/locales/fr.ts +++ b/packages/core-ui/src/generated/locales/fr.ts @@ -129,7 +129,6 @@ 's29ec563d56cf6c6b': `Autres Options`, 's2a32ad5ec5fc7e5c': `Il n'y a pas de source de données vous concernant`, 's2a880deefa02ab59': `Profilage`, -'s2b7bb3f9a459d7dd': `Historique bientôt disponible !`, 's2e39367a8c5564b7': `Autres données`, 's2fa47f3acd802112': `Identifiant Unique - Compte Utilisateur`, 's3137e812940ae6b7': `Vos données sont en cours d'obtention, veuillez patienter et ne pas actualiser la page`, diff --git a/packages/core/src/computation/computation-api.ts b/packages/core/src/computation/computation-api.ts index e2bb9847..49195709 100644 --- a/packages/core/src/computation/computation-api.ts +++ b/packages/core/src/computation/computation-api.ts @@ -12,6 +12,7 @@ import { PendingDemandPayload, PrivacyResponsePayload, RequestHistoryPayload, + TimelineEventsPayload, } from '../models/generated-models/index.js'; export class ComputationAPI { @@ -415,6 +416,29 @@ export class ComputationAPI { }); } + async getDemandTimeline(userId: string): Promise { + if (userId === undefined) { + return Promise.reject( + new Error('userId undefined when fetching timeline') + ); + } + + const endpoint = `/bridge/timeline/${userId}`; + + return fetch(this.fullURL(endpoint), { + method: 'GET', + headers: { + accept: 'application/json', + Authorization: `Bearer ${this._adminToken}`, + }, + }).then(response => { + if (!response.ok) { + throw new Error(response.statusText); + } + return response.json() as Promise; + }); + } + /** * Approve a demand * @param id uuid of the demand to approve diff --git a/packages/core/src/models/generated-models/core/ApiError.ts b/packages/core/src/models/generated-models/core/ApiError.ts deleted file mode 100644 index 8d7bba4a..00000000 --- a/packages/core/src/models/generated-models/core/ApiError.ts +++ /dev/null @@ -1,28 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ApiRequestOptions } from './ApiRequestOptions.js'; -import type { ApiResult } from './ApiResult.js'; - -export class ApiError extends Error { - public readonly url: string; - public readonly status: number; - public readonly statusText: string; - public readonly body: any; - public readonly request: ApiRequestOptions; - - constructor( - request: ApiRequestOptions, - response: ApiResult, - message: string - ) { - super(message); - - this.name = 'ApiError'; - this.url = response.url; - this.status = response.status; - this.statusText = response.statusText; - this.body = response.body; - this.request = request; - } -} diff --git a/packages/core/src/models/generated-models/core/ApiRequestOptions.ts b/packages/core/src/models/generated-models/core/ApiRequestOptions.ts deleted file mode 100644 index 27181836..00000000 --- a/packages/core/src/models/generated-models/core/ApiRequestOptions.ts +++ /dev/null @@ -1,23 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ApiRequestOptions = { - readonly method: - | 'GET' - | 'PUT' - | 'POST' - | 'DELETE' - | 'OPTIONS' - | 'HEAD' - | 'PATCH'; - readonly url: string; - readonly path?: Record; - readonly cookies?: Record; - readonly headers?: Record; - readonly query?: Record; - readonly formData?: Record; - readonly body?: any; - readonly mediaType?: string; - readonly responseHeader?: string; - readonly errors?: Record; -}; diff --git a/packages/core/src/models/generated-models/core/ApiResult.ts b/packages/core/src/models/generated-models/core/ApiResult.ts deleted file mode 100644 index 91f60ae0..00000000 --- a/packages/core/src/models/generated-models/core/ApiResult.ts +++ /dev/null @@ -1,10 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export type ApiResult = { - readonly url: string; - readonly ok: boolean; - readonly status: number; - readonly statusText: string; - readonly body: any; -}; diff --git a/packages/core/src/models/generated-models/core/CancelablePromise.ts b/packages/core/src/models/generated-models/core/CancelablePromise.ts deleted file mode 100644 index f0722633..00000000 --- a/packages/core/src/models/generated-models/core/CancelablePromise.ts +++ /dev/null @@ -1,127 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -export class CancelError extends Error { - constructor(message: string) { - super(message); - this.name = 'CancelError'; - } - - public get isCancelled(): boolean { - return true; - } -} - -export interface OnCancel { - readonly isResolved: boolean; - readonly isRejected: boolean; - readonly isCancelled: boolean; - - (cancelHandler: () => void): void; -} - -export class CancelablePromise implements Promise { - readonly [Symbol.toStringTag]!: string; - - private _isResolved: boolean; - private _isRejected: boolean; - private _isCancelled: boolean; - private readonly _cancelHandlers: (() => void)[]; - private readonly _promise: Promise; - private _resolve?: (value: T | PromiseLike) => void; - private _reject?: (reason?: any) => void; - - constructor( - executor: ( - resolve: (value: T | PromiseLike) => void, - reject: (reason?: any) => void, - onCancel: OnCancel - ) => void - ) { - this._isResolved = false; - this._isRejected = false; - this._isCancelled = false; - this._cancelHandlers = []; - this._promise = new Promise((resolve, reject) => { - this._resolve = resolve; - this._reject = reject; - - const onResolve = (value: T | PromiseLike): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isResolved = true; - this._resolve?.(value); - }; - - const onReject = (reason?: any): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isRejected = true; - this._reject?.(reason); - }; - - const onCancel = (cancelHandler: () => void): void => { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._cancelHandlers.push(cancelHandler); - }; - - Object.defineProperty(onCancel, 'isResolved', { - get: (): boolean => this._isResolved, - }); - - Object.defineProperty(onCancel, 'isRejected', { - get: (): boolean => this._isRejected, - }); - - Object.defineProperty(onCancel, 'isCancelled', { - get: (): boolean => this._isCancelled, - }); - - return executor(onResolve, onReject, onCancel as OnCancel); - }); - } - - public then( - onFulfilled?: ((value: T) => TResult1 | PromiseLike) | null, - onRejected?: ((reason: any) => TResult2 | PromiseLike) | null - ): Promise { - return this._promise.then(onFulfilled, onRejected); - } - - public catch( - onRejected?: ((reason: any) => TResult | PromiseLike) | null - ): Promise { - return this._promise.catch(onRejected); - } - - public finally(onFinally?: (() => void) | null): Promise { - return this._promise.finally(onFinally); - } - - public cancel(): void { - if (this._isResolved || this._isRejected || this._isCancelled) { - return; - } - this._isCancelled = true; - if (this._cancelHandlers.length) { - try { - for (const cancelHandler of this._cancelHandlers) { - cancelHandler(); - } - } catch (error) { - console.warn('Cancellation threw an error', error); - return; - } - } - this._cancelHandlers.length = 0; - this._reject?.(new CancelError('Request aborted')); - } - - public get isCancelled(): boolean { - return this._isCancelled; - } -} diff --git a/packages/core/src/models/generated-models/core/OpenAPI.ts b/packages/core/src/models/generated-models/core/OpenAPI.ts deleted file mode 100644 index 60317174..00000000 --- a/packages/core/src/models/generated-models/core/OpenAPI.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ApiRequestOptions } from './ApiRequestOptions.js'; - -type Resolver = (options: ApiRequestOptions) => Promise; -type Headers = Record; - -export type OpenAPIConfig = { - BASE: string; - VERSION: string; - WITH_CREDENTIALS: boolean; - CREDENTIALS: 'include' | 'omit' | 'same-origin'; - TOKEN?: string | Resolver; - USERNAME?: string | Resolver; - PASSWORD?: string | Resolver; - HEADERS?: Headers | Resolver; - ENCODE_PATH?: (path: string) => string; -}; - -export const OpenAPI: OpenAPIConfig = { - BASE: '', - VERSION: '0.5.0-SNAPSHOT', - WITH_CREDENTIALS: false, - CREDENTIALS: 'include', - TOKEN: undefined, - USERNAME: undefined, - PASSWORD: undefined, - HEADERS: undefined, - ENCODE_PATH: undefined, -}; diff --git a/packages/core/src/models/generated-models/core/request.ts b/packages/core/src/models/generated-models/core/request.ts deleted file mode 100644 index a07d28c6..00000000 --- a/packages/core/src/models/generated-models/core/request.ts +++ /dev/null @@ -1,341 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import { ApiError } from './ApiError.js'; -import type { ApiRequestOptions } from './ApiRequestOptions.js'; -import type { ApiResult } from './ApiResult.js'; -import { CancelablePromise } from './CancelablePromise.js'; -import type { OnCancel } from './CancelablePromise.js'; -import type { OpenAPIConfig } from './OpenAPI.js'; - -const isDefined = ( - value: T | null | undefined -): value is Exclude => { - return value !== undefined && value !== null; -}; - -const isString = (value: any): value is string => { - return typeof value === 'string'; -}; - -const isStringWithValue = (value: any): value is string => { - return isString(value) && value !== ''; -}; - -const isBlob = (value: any): value is Blob => { - return ( - typeof value === 'object' && - typeof value.type === 'string' && - typeof value.stream === 'function' && - typeof value.arrayBuffer === 'function' && - typeof value.constructor === 'function' && - typeof value.constructor.name === 'string' && - /^(Blob|File)$/.test(value.constructor.name) && - /^(Blob|File)$/.test(value[Symbol.toStringTag]) - ); -}; - -const isFormData = (value: any): value is FormData => { - return value instanceof FormData; -}; - -const base64 = (str: string): string => { - try { - return btoa(str); - } catch (err) { - // @ts-ignore - return Buffer.from(str).toString('base64'); - } -}; - -const getQueryString = (params: Record): string => { - const qs: string[] = []; - - const append = (key: string, value: any) => { - qs.push(`${encodeURIComponent(key)}=${encodeURIComponent(String(value))}`); - }; - - const process = (key: string, value: any) => { - if (isDefined(value)) { - if (Array.isArray(value)) { - value.forEach(v => { - process(key, v); - }); - } else if (typeof value === 'object') { - Object.entries(value).forEach(([k, v]) => { - process(`${key}[${k}]`, v); - }); - } else { - append(key, value); - } - } - }; - - Object.entries(params).forEach(([key, value]) => { - process(key, value); - }); - - if (qs.length > 0) { - return `?${qs.join('&')}`; - } - - return ''; -}; - -const getUrl = (config: OpenAPIConfig, options: ApiRequestOptions): string => { - const encoder = config.ENCODE_PATH || encodeURI; - - const path = options.url - .replace('{api-version}', config.VERSION) - .replace(/{(.*?)}/g, (substring: string, group: string) => { - if (options.path?.hasOwnProperty(group)) { - return encoder(String(options.path[group])); - } - return substring; - }); - - const url = `${config.BASE}${path}`; - if (options.query) { - return `${url}${getQueryString(options.query)}`; - } - return url; -}; - -const getFormData = (options: ApiRequestOptions): FormData | undefined => { - if (options.formData) { - const formData = new FormData(); - - const process = (key: string, value: any) => { - if (isString(value) || isBlob(value)) { - formData.append(key, value); - } else { - formData.append(key, JSON.stringify(value)); - } - }; - - Object.entries(options.formData) - .filter(([_, value]) => isDefined(value)) - .forEach(([key, value]) => { - if (Array.isArray(value)) { - value.forEach(v => process(key, v)); - } else { - process(key, value); - } - }); - - return formData; - } - return undefined; -}; - -type Resolver = (options: ApiRequestOptions) => Promise; - -const resolve = async ( - options: ApiRequestOptions, - resolver?: T | Resolver -): Promise => { - if (typeof resolver === 'function') { - return (resolver as Resolver)(options); - } - return resolver; -}; - -const getHeaders = async ( - config: OpenAPIConfig, - options: ApiRequestOptions -): Promise => { - const token = await resolve(options, config.TOKEN); - const username = await resolve(options, config.USERNAME); - const password = await resolve(options, config.PASSWORD); - const additionalHeaders = await resolve(options, config.HEADERS); - - const headers = Object.entries({ - Accept: 'application/json', - ...additionalHeaders, - ...options.headers, - }) - .filter(([_, value]) => isDefined(value)) - .reduce( - (headers, [key, value]) => ({ - ...headers, - [key]: String(value), - }), - {} as Record - ); - - if (isStringWithValue(token)) { - headers['Authorization'] = `Bearer ${token}`; - } - - if (isStringWithValue(username) && isStringWithValue(password)) { - const credentials = base64(`${username}:${password}`); - headers['Authorization'] = `Basic ${credentials}`; - } - - if (options.body) { - if (options.mediaType) { - headers['Content-Type'] = options.mediaType; - } else if (isBlob(options.body)) { - headers['Content-Type'] = options.body.type || 'application/octet-stream'; - } else if (isString(options.body)) { - headers['Content-Type'] = 'text/plain'; - } else if (!isFormData(options.body)) { - headers['Content-Type'] = 'application/json'; - } - } - - return new Headers(headers); -}; - -const getRequestBody = (options: ApiRequestOptions): any => { - if (options.body) { - if (options.mediaType?.includes('/json')) { - return JSON.stringify(options.body); - } else if ( - isString(options.body) || - isBlob(options.body) || - isFormData(options.body) - ) { - return options.body; - } else { - return JSON.stringify(options.body); - } - } - return undefined; -}; - -export const sendRequest = async ( - config: OpenAPIConfig, - options: ApiRequestOptions, - url: string, - body: any, - formData: FormData | undefined, - headers: Headers, - onCancel: OnCancel -): Promise => { - const controller = new AbortController(); - - const request: RequestInit = { - headers, - body: body ?? formData, - method: options.method, - signal: controller.signal, - }; - - if (config.WITH_CREDENTIALS) { - request.credentials = config.CREDENTIALS; - } - - onCancel(() => controller.abort()); - - return await fetch(url, request); -}; - -const getResponseHeader = ( - response: Response, - responseHeader?: string -): string | undefined => { - if (responseHeader) { - const content = response.headers.get(responseHeader); - if (isString(content)) { - return content; - } - } - return undefined; -}; - -const getResponseBody = async (response: Response): Promise => { - if (response.status !== 204) { - try { - const contentType = response.headers.get('Content-Type'); - if (contentType) { - const isJSON = contentType.toLowerCase().startsWith('application/json'); - if (isJSON) { - return await response.json(); - } else { - return await response.text(); - } - } - } catch (error) { - console.error(error); - } - } - return undefined; -}; - -const catchErrorCodes = ( - options: ApiRequestOptions, - result: ApiResult -): void => { - const errors: Record = { - 400: 'Bad Request', - 401: 'Unauthorized', - 403: 'Forbidden', - 404: 'Not Found', - 500: 'Internal Server Error', - 502: 'Bad Gateway', - 503: 'Service Unavailable', - ...options.errors, - }; - - const error = errors[result.status]; - if (error) { - throw new ApiError(options, result, error); - } - - if (!result.ok) { - throw new ApiError(options, result, 'Generic Error'); - } -}; - -/** - * Request method - * @param config The OpenAPI configuration object - * @param options The request options from the service - * @returns CancelablePromise - * @throws ApiError - */ -export const request = ( - config: OpenAPIConfig, - options: ApiRequestOptions -): CancelablePromise => { - return new CancelablePromise(async (resolve, reject, onCancel) => { - try { - const url = getUrl(config, options); - const formData = getFormData(options); - const body = getRequestBody(options); - const headers = await getHeaders(config, options); - - if (!onCancel.isCancelled) { - const response = await sendRequest( - config, - options, - url, - body, - formData, - headers, - onCancel - ); - const responseBody = await getResponseBody(response); - const responseHeader = getResponseHeader( - response, - options.responseHeader - ); - - const result: ApiResult = { - url, - ok: response.ok, - status: response.status, - statusText: response.statusText, - body: responseHeader ?? responseBody, - }; - - catchErrorCodes(options, result); - - resolve(result.body); - } - } catch (error) { - reject(error); - } - }); -}; diff --git a/packages/core/src/models/generated-models/index.ts b/packages/core/src/models/generated-models/index.ts index 9882c6f9..e90bfd0f 100644 --- a/packages/core/src/models/generated-models/index.ts +++ b/packages/core/src/models/generated-models/index.ts @@ -1,17 +1,15 @@ /* istanbul ignore file */ /* tslint:disable */ /* eslint-disable */ -export { ApiError } from './core/ApiError.js'; -export { CancelablePromise, CancelError } from './core/CancelablePromise.js'; -export { OpenAPI } from './core/OpenAPI.js'; -export type { OpenAPIConfig } from './core/OpenAPI.js'; export type { AddRegulationsPayload } from './models/AddRegulationsPayload.js'; export type { ApproveDemandPayload } from './models/ApproveDemandPayload.js'; export type { CancelDemandPayload } from './models/CancelDemandPayload.js'; -export type { ConsentRestriction } from './models/ConsentRestriction.js'; +export type { ChangeRecommendationPayload } from './models/ChangeRecommendationPayload.js'; +export { CompletedDemandInfoPayload } from './models/CompletedDemandInfoPayload.js'; export { CompletedDemandPayload } from './models/CompletedDemandPayload.js'; -export type { CompletedDemandInfoPayload } from './models/CompletedDemandInfoPayload.js'; +export type { ConsentRestriction } from './models/ConsentRestriction.js'; +export type { CreateApplicationPayload } from './models/CreateApplicationPayload.js'; export { CreateLegalBasePayload } from './models/CreateLegalBasePayload.js'; export { CreatePrivacyRequestPayload } from './models/CreatePrivacyRequestPayload.js'; export { CreateProvenancePayload } from './models/CreateProvenancePayload.js'; @@ -29,13 +27,20 @@ export type { EndContractPayload } from './models/EndContractPayload.js'; export type { EndLegitimateInterestPayload } from './models/EndLegitimateInterestPayload.js'; export type { GeneralInformation } from './models/GeneralInformation.js'; export type { GiveConsentPayload } from './models/GiveConsentPayload.js'; +export type { GiveConsentProactive } from './models/GiveConsentProactive.js'; +export type { GiveConsentUnsafePayload } from './models/GiveConsentUnsafePayload.js'; +export type { GivenConsentEvent } from './models/GivenConsentEvent.js'; export type { GivenConsentsPayload } from './models/GivenConsentsPayload.js'; export { LegalBase } from './models/LegalBase.js'; +export { LegalBaseEvent } from './models/LegalBaseEvent.js'; export { PendingDemandDetailsPayload } from './models/PendingDemandDetailsPayload.js'; export { PendingDemandPayload } from './models/PendingDemandPayload.js'; export { PrItem } from './models/PrItem.js'; export type { PrivacyRequestCreatedPayload } from './models/PrivacyRequestCreatedPayload.js'; export { PrivacyRequestDemand } from './models/PrivacyRequestDemand.js'; +export { PrivacyRequestEvent } from './models/PrivacyRequestEvent.js'; +export { PrivacyRequestEventDemand } from './models/PrivacyRequestEventDemand.js'; +export { PrivacyResponseEvent } from './models/PrivacyResponseEvent.js'; export { PrivacyResponsePayload } from './models/PrivacyResponsePayload.js'; export type { PrivacyScope } from './models/PrivacyScope.js'; export type { PrivacyScopeDimensionsPayload } from './models/PrivacyScopeDimensionsPayload.js'; @@ -44,18 +49,14 @@ export { PrivacyScopeTriple } from './models/PrivacyScopeTriple.js'; export { Provenance } from './models/Provenance.js'; export { ProvenanceRestriction } from './models/ProvenanceRestriction.js'; export { Recommendation } from './models/Recommendation.js'; +export { RecommendationPayload } from './models/RecommendationPayload.js'; export type { RegulationResponsePayload } from './models/RegulationResponsePayload.js'; export type { RequestHistoryPayload } from './models/RequestHistoryPayload.js'; export type { Restrictions } from './models/Restrictions.js'; export { RetentionPolicy } from './models/RetentionPolicy.js'; -export { ScopePayload } from './models/ScopePayload.js'; +export type { RevokedConsentEvent } from './models/RevokedConsentEvent.js'; +export type { ScopePayload } from './models/ScopePayload.js'; export type { StartContractPayload } from './models/StartContractPayload.js'; export type { StartLegitimateInterestPayload } from './models/StartLegitimateInterestPayload.js'; - -export { CallbacksService } from './services/CallbacksService.js'; -export { ConfigurationService } from './services/ConfigurationService.js'; -export { DataConsumerInterfaceService } from './services/DataConsumerInterfaceService.js'; -export { HealthService } from './services/HealthService.js'; -export { PrivacyRequestsService } from './services/PrivacyRequestsService.js'; -export { UserEventsService } from './services/UserEventsService.js'; -export { UserInfoService } from './services/UserInfoService.js'; +export type { StoreGivenConsentPayload } from './models/StoreGivenConsentPayload.js'; +export type { TimelineEventsPayload } from './models/TimelineEventsPayload.js'; diff --git a/packages/core/src/models/generated-models/models/ChangeRecommendationPayload.ts b/packages/core/src/models/generated-models/models/ChangeRecommendationPayload.ts new file mode 100644 index 00000000..5a9bab46 --- /dev/null +++ b/packages/core/src/models/generated-models/models/ChangeRecommendationPayload.ts @@ -0,0 +1,10 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { RecommendationPayload } from './RecommendationPayload.js'; + +export type ChangeRecommendationPayload = { + demand_id: string; + recommendation: RecommendationPayload; +}; diff --git a/packages/core/src/models/generated-models/models/CompletedDemandInfoPayload.ts b/packages/core/src/models/generated-models/models/CompletedDemandInfoPayload.ts index c2e3b658..734e7770 100644 --- a/packages/core/src/models/generated-models/models/CompletedDemandInfoPayload.ts +++ b/packages/core/src/models/generated-models/models/CompletedDemandInfoPayload.ts @@ -10,7 +10,7 @@ export type CompletedDemandInfoPayload = { action: CompletedDemandInfoPayload.action; status: CompletedDemandInfoPayload.status; motive?: CompletedDemandInfoPayload.motive; - answer?: any; + answer?: string; request_message?: string; request_lang?: string; response_message?: string; @@ -39,7 +39,7 @@ export namespace CompletedDemandInfoPayload { TRANSPARENCY_RETENTION = 'TRANSPARENCY.RETENTION', TRANSPARENCY_WHERE = 'TRANSPARENCY.WHERE', TRANSPARENCY_WHO = 'TRANSPARENCY.WHO', - OTHER = 'OTHER-DEMAND', + OTHER_DEMAND = 'OTHER-DEMAND', } export enum status { diff --git a/packages/core/src/models/generated-models/models/CompletedDemandPayload.ts b/packages/core/src/models/generated-models/models/CompletedDemandPayload.ts index f449ed60..e338afdf 100644 --- a/packages/core/src/models/generated-models/models/CompletedDemandPayload.ts +++ b/packages/core/src/models/generated-models/models/CompletedDemandPayload.ts @@ -35,7 +35,7 @@ export namespace CompletedDemandPayload { TRANSPARENCY_RETENTION = 'TRANSPARENCY.RETENTION', TRANSPARENCY_WHERE = 'TRANSPARENCY.WHERE', TRANSPARENCY_WHO = 'TRANSPARENCY.WHO', - OTHER = 'OTHER-DEMAND', + OTHER_DEMAND = 'OTHER-DEMAND', } export enum status { diff --git a/packages/core/src/models/generated-models/models/CreateApplicationPayload.ts b/packages/core/src/models/generated-models/models/CreateApplicationPayload.ts new file mode 100644 index 00000000..992cd90b --- /dev/null +++ b/packages/core/src/models/generated-models/models/CreateApplicationPayload.ts @@ -0,0 +1,7 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type CreateApplicationPayload = { + app_id: string; +}; diff --git a/packages/core/src/models/generated-models/models/CreateProvenancePayload.ts b/packages/core/src/models/generated-models/models/CreateProvenancePayload.ts index 31a87eb7..0920cc05 100644 --- a/packages/core/src/models/generated-models/models/CreateProvenancePayload.ts +++ b/packages/core/src/models/generated-models/models/CreateProvenancePayload.ts @@ -17,7 +17,7 @@ export type CreateProvenancePayload = { /** * id of the system data category originated from. null for own system */ - system?: string; + system: string; }; export namespace CreateProvenancePayload { diff --git a/packages/core/src/models/generated-models/models/DataCallbackPayload.ts b/packages/core/src/models/generated-models/models/DataCallbackPayload.ts index f45b1b8c..40822fb4 100644 --- a/packages/core/src/models/generated-models/models/DataCallbackPayload.ts +++ b/packages/core/src/models/generated-models/models/DataCallbackPayload.ts @@ -3,6 +3,7 @@ /* eslint-disable */ export type DataCallbackPayload = { + app_id: string; request_id: string; accepted: boolean; data_url?: string; diff --git a/packages/core/src/models/generated-models/models/DemandResolutionStrategy.ts b/packages/core/src/models/generated-models/models/DemandResolutionStrategy.ts index 6e8a94dd..7cc81df7 100644 --- a/packages/core/src/models/generated-models/models/DemandResolutionStrategy.ts +++ b/packages/core/src/models/generated-models/models/DemandResolutionStrategy.ts @@ -8,5 +8,7 @@ export type DemandResolutionStrategy = { transparency: DemandResolution; access: DemandResolution; delete: DemandResolution; - consents: DemandResolution; + revoke_consent: DemandResolution; + object_scope: DemandResolution; + restrict_scope: DemandResolution; }; diff --git a/packages/core/src/models/generated-models/models/GiveConsentPayload.ts b/packages/core/src/models/generated-models/models/GiveConsentPayload.ts index d39b9ac2..f85ccfb5 100644 --- a/packages/core/src/models/generated-models/models/GiveConsentPayload.ts +++ b/packages/core/src/models/generated-models/models/GiveConsentPayload.ts @@ -2,10 +2,6 @@ /* tslint:disable */ /* eslint-disable */ -import type { DataSubjectPayload } from './DataSubjectPayload.js'; - export type GiveConsentPayload = { - dataSubject: DataSubjectPayload; consentId: string; - date: string; }; diff --git a/packages/core/src/models/generated-models/models/GiveConsentProactive.ts b/packages/core/src/models/generated-models/models/GiveConsentProactive.ts new file mode 100644 index 00000000..1ccc3744 --- /dev/null +++ b/packages/core/src/models/generated-models/models/GiveConsentProactive.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { ScopePayload } from './ScopePayload.js'; + +export type GiveConsentProactive = { + scope?: Array; +}; diff --git a/packages/core/src/models/generated-models/models/GiveConsentUnsafePayload.ts b/packages/core/src/models/generated-models/models/GiveConsentUnsafePayload.ts new file mode 100644 index 00000000..6c9fdc7f --- /dev/null +++ b/packages/core/src/models/generated-models/models/GiveConsentUnsafePayload.ts @@ -0,0 +1,11 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { DataSubjectPayload } from './DataSubjectPayload.js'; + +export type GiveConsentUnsafePayload = { + consent_id: string; + app_id: string; + data_subject: DataSubjectPayload; +}; diff --git a/packages/core/src/models/generated-models/models/GivenConsentEvent.ts b/packages/core/src/models/generated-models/models/GivenConsentEvent.ts new file mode 100644 index 00000000..ed1e6d32 --- /dev/null +++ b/packages/core/src/models/generated-models/models/GivenConsentEvent.ts @@ -0,0 +1,12 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { PrivacyScope } from './PrivacyScope.js'; + +export type GivenConsentEvent = { + id: string; + date: string; + name?: string; + scope: PrivacyScope; +}; diff --git a/packages/core/src/models/generated-models/models/LegalBaseEvent.ts b/packages/core/src/models/generated-models/models/LegalBaseEvent.ts new file mode 100644 index 00000000..56fc4e71 --- /dev/null +++ b/packages/core/src/models/generated-models/models/LegalBaseEvent.ts @@ -0,0 +1,35 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { PrivacyScope } from './PrivacyScope.js'; + +export type LegalBaseEvent = { + id: string; + date: string; + event: LegalBaseEvent.event; + type: LegalBaseEvent.type; + name?: string; + scope: PrivacyScope; +}; + +export namespace LegalBaseEvent { + export enum event { + CAPTURE_DATE = 'CAPTURE-DATE', + RELATIONSHIP_START = 'RELATIONSHIP-START', + RELATIONSHIP_END = 'RELATIONSHIP-END', + SERVICE_START = 'SERVICE-START', + SERVICE_END = 'SERVICE-END', + } + + export enum type { + CONTRACT = 'CONTRACT', + CONSENT = 'CONSENT', + LEGITIMATE_INTEREST = 'LEGITIMATE-INTEREST', + NECESSARY = 'NECESSARY', + NECESSARY_LEGAL_OBLIGATION = 'NECESSARY.LEGAL-OBLIGATION', + NECESSARY_PUBLIC_INTEREST = 'NECESSARY.PUBLIC-INTEREST', + NECESSARY_VITAL_INTEREST = 'NECESSARY.VITAL-INTEREST', + OTHER_LEGAL_BASE = 'OTHER-LEGAL-BASE', + } +} diff --git a/packages/core/src/models/generated-models/models/PendingDemandDetailsPayload.ts b/packages/core/src/models/generated-models/models/PendingDemandDetailsPayload.ts index f4b2d414..abdb3a31 100644 --- a/packages/core/src/models/generated-models/models/PendingDemandDetailsPayload.ts +++ b/packages/core/src/models/generated-models/models/PendingDemandDetailsPayload.ts @@ -9,6 +9,8 @@ export type PendingDemandDetailsPayload = { id: string; date: string; action: PendingDemandDetailsPayload.action; + message?: string; + language?: string; data_subject?: DataSubjectPayload; recommendation?: Recommendation; }; @@ -35,6 +37,6 @@ export namespace PendingDemandDetailsPayload { TRANSPARENCY_RETENTION = 'TRANSPARENCY.RETENTION', TRANSPARENCY_WHERE = 'TRANSPARENCY.WHERE', TRANSPARENCY_WHO = 'TRANSPARENCY.WHO', - OTHER = 'OTHER-DEMAND', + OTHER_DEMAND = 'OTHER-DEMAND', } } diff --git a/packages/core/src/models/generated-models/models/PendingDemandPayload.ts b/packages/core/src/models/generated-models/models/PendingDemandPayload.ts index 29d7fe4c..e61b0e6a 100644 --- a/packages/core/src/models/generated-models/models/PendingDemandPayload.ts +++ b/packages/core/src/models/generated-models/models/PendingDemandPayload.ts @@ -33,6 +33,6 @@ export namespace PendingDemandPayload { TRANSPARENCY_RETENTION = 'TRANSPARENCY.RETENTION', TRANSPARENCY_WHERE = 'TRANSPARENCY.WHERE', TRANSPARENCY_WHO = 'TRANSPARENCY.WHO', - OTHER = 'OTHER-DEMAND', + OTHER_DEMAND = 'OTHER-DEMAND', } } diff --git a/packages/core/src/models/generated-models/models/PrivacyRequestDemand.ts b/packages/core/src/models/generated-models/models/PrivacyRequestDemand.ts index 953fb960..15e5eb34 100644 --- a/packages/core/src/models/generated-models/models/PrivacyRequestDemand.ts +++ b/packages/core/src/models/generated-models/models/PrivacyRequestDemand.ts @@ -35,6 +35,6 @@ export namespace PrivacyRequestDemand { TRANSPARENCY_RETENTION = 'TRANSPARENCY.RETENTION', TRANSPARENCY_WHERE = 'TRANSPARENCY.WHERE', TRANSPARENCY_WHO = 'TRANSPARENCY.WHO', - OTHER = 'OTHER-DEMAND', + OTHER_DEMAND = 'OTHER-DEMAND', } } diff --git a/packages/core/src/models/generated-models/models/PrivacyRequestEvent.ts b/packages/core/src/models/generated-models/models/PrivacyRequestEvent.ts new file mode 100644 index 00000000..b750f328 --- /dev/null +++ b/packages/core/src/models/generated-models/models/PrivacyRequestEvent.ts @@ -0,0 +1,23 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { PrivacyRequestEventDemand } from './PrivacyRequestEventDemand.js'; + +export type PrivacyRequestEvent = { + id: string; + date: string; + target: PrivacyRequestEvent.target; + demands?: Array; +}; + +export namespace PrivacyRequestEvent { + export enum target { + _ = '*', + ORGANIZATION = 'ORGANIZATION', + SYSTEM = 'SYSTEM', + PARTNERS = 'PARTNERS', + PARTNERS_DOWNWARD = 'PARTNERS.DOWNWARD', + PARTNERS_UPWARD = 'PARTNERS.UPWARD', + } +} diff --git a/packages/core/src/models/generated-models/models/PrivacyRequestEventDemand.ts b/packages/core/src/models/generated-models/models/PrivacyRequestEventDemand.ts new file mode 100644 index 00000000..3bd706f5 --- /dev/null +++ b/packages/core/src/models/generated-models/models/PrivacyRequestEventDemand.ts @@ -0,0 +1,34 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type PrivacyRequestEventDemand = { + id: string; + action: PrivacyRequestEventDemand.action; +}; + +export namespace PrivacyRequestEventDemand { + export enum action { + ACCESS = 'ACCESS', + DELETE = 'DELETE', + MODIFY = 'MODIFY', + OBJECT = 'OBJECT', + PORTABILITY = 'PORTABILITY', + RESTRICT = 'RESTRICT', + REVOKE_CONSENT = 'REVOKE-CONSENT', + TRANSPARENCY = 'TRANSPARENCY', + TRANSPARENCY_DATA_CATEGORIES = 'TRANSPARENCY.DATA-CATEGORIES', + TRANSPARENCY_DPO = 'TRANSPARENCY.DPO', + TRANSPARENCY_KNOWN = 'TRANSPARENCY.KNOWN', + TRANSPARENCY_LEGAL_BASES = 'TRANSPARENCY.LEGAL-BASES', + TRANSPARENCY_ORGANIZATION = 'TRANSPARENCY.ORGANIZATION', + TRANSPARENCY_POLICY = 'TRANSPARENCY.POLICY', + TRANSPARENCY_PROCESSING_CATEGORIES = 'TRANSPARENCY.PROCESSING-CATEGORIES', + TRANSPARENCY_PROVENANCE = 'TRANSPARENCY.PROVENANCE', + TRANSPARENCY_PURPOSE = 'TRANSPARENCY.PURPOSE', + TRANSPARENCY_RETENTION = 'TRANSPARENCY.RETENTION', + TRANSPARENCY_WHERE = 'TRANSPARENCY.WHERE', + TRANSPARENCY_WHO = 'TRANSPARENCY.WHO', + OTHER_DEMAND = 'OTHER-DEMAND', + } +} diff --git a/packages/core/src/models/generated-models/models/PrivacyResponseEvent.ts b/packages/core/src/models/generated-models/models/PrivacyResponseEvent.ts new file mode 100644 index 00000000..fd413a2d --- /dev/null +++ b/packages/core/src/models/generated-models/models/PrivacyResponseEvent.ts @@ -0,0 +1,46 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type PrivacyResponseEvent = { + id: string; + demand_id: string; + action: PrivacyResponseEvent.action; + includes?: Array; + date: string; + status: PrivacyResponseEvent.status; +}; + +export namespace PrivacyResponseEvent { + export enum action { + ACCESS = 'ACCESS', + DELETE = 'DELETE', + MODIFY = 'MODIFY', + OBJECT = 'OBJECT', + PORTABILITY = 'PORTABILITY', + RESTRICT = 'RESTRICT', + REVOKE_CONSENT = 'REVOKE-CONSENT', + TRANSPARENCY = 'TRANSPARENCY', + TRANSPARENCY_DATA_CATEGORIES = 'TRANSPARENCY.DATA-CATEGORIES', + TRANSPARENCY_DPO = 'TRANSPARENCY.DPO', + TRANSPARENCY_KNOWN = 'TRANSPARENCY.KNOWN', + TRANSPARENCY_LEGAL_BASES = 'TRANSPARENCY.LEGAL-BASES', + TRANSPARENCY_ORGANIZATION = 'TRANSPARENCY.ORGANIZATION', + TRANSPARENCY_POLICY = 'TRANSPARENCY.POLICY', + TRANSPARENCY_PROCESSING_CATEGORIES = 'TRANSPARENCY.PROCESSING-CATEGORIES', + TRANSPARENCY_PROVENANCE = 'TRANSPARENCY.PROVENANCE', + TRANSPARENCY_PURPOSE = 'TRANSPARENCY.PURPOSE', + TRANSPARENCY_RETENTION = 'TRANSPARENCY.RETENTION', + TRANSPARENCY_WHERE = 'TRANSPARENCY.WHERE', + TRANSPARENCY_WHO = 'TRANSPARENCY.WHO', + OTHER_DEMAND = 'OTHER-DEMAND', + } + + export enum status { + GRANTED = 'GRANTED', + DENIED = 'DENIED', + PARTIALLY_GRANTED = 'PARTIALLY-GRANTED', + UNDER_REVIEW = 'UNDER-REVIEW', + CANCELED = 'CANCELED', + } +} diff --git a/packages/core/src/models/generated-models/models/PrivacyResponsePayload.ts b/packages/core/src/models/generated-models/models/PrivacyResponsePayload.ts index 67211261..c66903ef 100644 --- a/packages/core/src/models/generated-models/models/PrivacyResponsePayload.ts +++ b/packages/core/src/models/generated-models/models/PrivacyResponsePayload.ts @@ -8,7 +8,7 @@ export type PrivacyResponsePayload = { requested_action: PrivacyResponsePayload.requested_action; status: PrivacyResponsePayload.status; motive?: PrivacyResponsePayload.motive; - answer?: any; + answer?: string; message?: string; lang?: string; includes?: Array; @@ -37,7 +37,7 @@ export namespace PrivacyResponsePayload { TRANSPARENCY_RETENTION = 'TRANSPARENCY.RETENTION', TRANSPARENCY_WHERE = 'TRANSPARENCY.WHERE', TRANSPARENCY_WHO = 'TRANSPARENCY.WHO', - OTHER = 'OTHER-DEMAND', + OTHER_DEMAND = 'OTHER-DEMAND', } export enum status { diff --git a/packages/core/src/models/generated-models/models/Provenance.ts b/packages/core/src/models/generated-models/models/Provenance.ts index 09c60492..244d4509 100644 --- a/packages/core/src/models/generated-models/models/Provenance.ts +++ b/packages/core/src/models/generated-models/models/Provenance.ts @@ -5,7 +5,7 @@ export type Provenance = { id: string; provenance: Provenance.provenance; - system?: string; + system: string; }; export namespace Provenance { diff --git a/packages/core/src/models/generated-models/models/RecommendationPayload.ts b/packages/core/src/models/generated-models/models/RecommendationPayload.ts new file mode 100644 index 00000000..acec4953 --- /dev/null +++ b/packages/core/src/models/generated-models/models/RecommendationPayload.ts @@ -0,0 +1,51 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type RecommendationPayload = { + status: RecommendationPayload.status; + motive?: RecommendationPayload.motive; + data_categories?: Array; + date_from?: string; + date_to?: string; + provenance?: RecommendationPayload.provenance; + target?: RecommendationPayload.target; +}; + +export namespace RecommendationPayload { + export enum status { + GRANTED = 'GRANTED', + DENIED = 'DENIED', + PARTIALLY_GRANTED = 'PARTIALLY-GRANTED', + UNDER_REVIEW = 'UNDER-REVIEW', + CANCELED = 'CANCELED', + } + + export enum motive { + IDENTITY_UNCONFIRMED = 'IDENTITY-UNCONFIRMED', + LANGUAGE_UNSUPPORTED = 'LANGUAGE-UNSUPPORTED', + VALID_REASONS = 'VALID-REASONS', + IMPOSSIBLE = 'IMPOSSIBLE', + NO_SUCH_DATA = 'NO-SUCH-DATA', + REQUEST_UNSUPPORTED = 'REQUEST-UNSUPPORTED', + USER_UNKNOWN = 'USER-UNKNOWN', + OTHER_MOTIVE = 'OTHER-MOTIVE', + } + + export enum provenance { + _ = '*', + DERIVED = 'DERIVED', + TRANSFERRED = 'TRANSFERRED', + USER = 'USER', + USER_DATA_SUBJECT = 'USER.DATA-SUBJECT', + } + + export enum target { + _ = '*', + ORGANIZATION = 'ORGANIZATION', + SYSTEM = 'SYSTEM', + PARTNERS = 'PARTNERS', + PARTNERS_DOWNWARD = 'PARTNERS.DOWNWARD', + PARTNERS_UPWARD = 'PARTNERS.UPWARD', + } +} diff --git a/packages/core/src/models/generated-models/models/RevokedConsentEvent.ts b/packages/core/src/models/generated-models/models/RevokedConsentEvent.ts new file mode 100644 index 00000000..f51477c8 --- /dev/null +++ b/packages/core/src/models/generated-models/models/RevokedConsentEvent.ts @@ -0,0 +1,9 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +export type RevokedConsentEvent = { + id: string; + date: string; + name?: string; +}; diff --git a/packages/core/src/models/generated-models/models/ScopePayload.ts b/packages/core/src/models/generated-models/models/ScopePayload.ts index 5900e70f..99b5b6af 100644 --- a/packages/core/src/models/generated-models/models/ScopePayload.ts +++ b/packages/core/src/models/generated-models/models/ScopePayload.ts @@ -3,45 +3,39 @@ /* eslint-disable */ export type ScopePayload = { - dc: string; - pc: ScopePayload.pc; - pp: ScopePayload.pp; + data_categories?: Array; + processing_categories?: Array< + | '*' + | 'ANONYMIZATION' + | 'AUTOMATED-INFERENCE' + | 'AUTOMATED-DECISION-MAKING' + | 'COLLECTION' + | 'GENERATING' + | 'PUBLISHING' + | 'STORING' + | 'SHARING' + | 'USING' + | 'OTHER-PROCESSING' + >; + processing_purposes?: Array< + | '*' + | 'ADVERTISING' + | 'COMPLIANCE' + | 'EMPLOYMENT' + | 'JUSTICE' + | 'MARKETING' + | 'MEDICAL' + | 'PERSONALIZATION' + | 'PUBLIC-INTERESTS' + | 'RESEARCH' + | 'SALE' + | 'SECURITY' + | 'SERVICES' + | 'SERVICES.ADDITIONAL-SERVICES' + | 'SERVICES.BASIC-SERVICE' + | 'SOCIAL-PROTECTION' + | 'TRACKING' + | 'VITAL-INTERESTS' + | 'OTHER-PURPOSE' + >; }; - -export namespace ScopePayload { - export enum pc { - _ = '*', - ANONYMIZATION = 'ANONYMIZATION', - AUTOMATED_INFERENCE = 'AUTOMATED-INFERENCE', - AUTOMATED_DECISION_MAKING = 'AUTOMATED-DECISION-MAKING', - COLLECTION = 'COLLECTION', - GENERATING = 'GENERATING', - PUBLISHING = 'PUBLISHING', - STORING = 'STORING', - SHARING = 'SHARING', - USING = 'USING', - OTHER_PROCESSING = 'OTHER-PROCESSING', - } - - export enum pp { - _ = '*', - ADVERTISING = 'ADVERTISING', - COMPLIANCE = 'COMPLIANCE', - EMPLOYMENT = 'EMPLOYMENT', - JUSTICE = 'JUSTICE', - MARKETING = 'MARKETING', - MEDICAL = 'MEDICAL', - PERSONALIZATION = 'PERSONALIZATION', - PUBLIC_INTERESTS = 'PUBLIC-INTERESTS', - RESEARCH = 'RESEARCH', - SALE = 'SALE', - SECURITY = 'SECURITY', - SERVICES = 'SERVICES', - SERVICES_ADDITIONAL_SERVICES = 'SERVICES.ADDITIONAL-SERVICES', - SERVICES_BASIC_SERVICE = 'SERVICES.BASIC-SERVICE', - SOCIAL_PROTECTION = 'SOCIAL-PROTECTION', - TRACKING = 'TRACKING', - VITAL_INTERESTS = 'VITAL-INTERESTS', - OTHER_PURPOSE = 'OTHER-PURPOSE', - } -} diff --git a/packages/core/src/models/generated-models/models/StoreGivenConsentPayload.ts b/packages/core/src/models/generated-models/models/StoreGivenConsentPayload.ts new file mode 100644 index 00000000..c9445b71 --- /dev/null +++ b/packages/core/src/models/generated-models/models/StoreGivenConsentPayload.ts @@ -0,0 +1,11 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { DataSubjectPayload } from './DataSubjectPayload.js'; + +export type StoreGivenConsentPayload = { + dataSubject: DataSubjectPayload; + consentId: string; + date: string; +}; diff --git a/packages/core/src/models/generated-models/models/TimelineEventsPayload.ts b/packages/core/src/models/generated-models/models/TimelineEventsPayload.ts new file mode 100644 index 00000000..6ee020a4 --- /dev/null +++ b/packages/core/src/models/generated-models/models/TimelineEventsPayload.ts @@ -0,0 +1,17 @@ +/* istanbul ignore file */ +/* tslint:disable */ +/* eslint-disable */ + +import type { GivenConsentEvent } from './GivenConsentEvent.js'; +import type { LegalBaseEvent } from './LegalBaseEvent.js'; +import type { PrivacyRequestEvent } from './PrivacyRequestEvent.js'; +import type { PrivacyResponseEvent } from './PrivacyResponseEvent.js'; +import type { RevokedConsentEvent } from './RevokedConsentEvent.js'; + +export type TimelineEventsPayload = { + requests?: Array; + responses?: Array; + given_consents?: Array; + revoked_consents?: Array; + legal_bases?: Array; +}; diff --git a/packages/core/src/models/generated-models/services/CallbacksService.ts b/packages/core/src/models/generated-models/services/CallbacksService.ts deleted file mode 100644 index 4ffa0167..00000000 --- a/packages/core/src/models/generated-models/services/CallbacksService.ts +++ /dev/null @@ -1,35 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { DataCallbackPayload } from '../models/DataCallbackPayload.js'; - -import type { CancelablePromise } from '../core/CancelablePromise.js'; -import { OpenAPI } from '../core/OpenAPI.js'; -import { request as __request } from '../core/request.js'; - -export class CallbacksService { - /** - * Link to access data in the storage created - * @param callbackId - * @param requestBody - * @returns any - * @throws ApiError - */ - public static postV0CallbackCallbackid( - callbackId: string, - requestBody: DataCallbackPayload - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v0/callback/{callbackId}', - path: { - callbackId: callbackId, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Invalid value for: path parameter callbackId, Invalid value for: body`, - }, - }); - } -} diff --git a/packages/core/src/models/generated-models/services/ConfigurationService.ts b/packages/core/src/models/generated-models/services/ConfigurationService.ts deleted file mode 100644 index b3b487f4..00000000 --- a/packages/core/src/models/generated-models/services/ConfigurationService.ts +++ /dev/null @@ -1,336 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { AddRegulationsPayload } from '../models/AddRegulationsPayload.js'; -import type { CreateLegalBasePayload } from '../models/CreateLegalBasePayload.js'; -import type { CreateProvenancePayload } from '../models/CreateProvenancePayload.js'; -import type { CreateRetentionPolicyPayload } from '../models/CreateRetentionPolicyPayload.js'; -import type { CreateSelectorPayload } from '../models/CreateSelectorPayload.js'; -import type { DataCategoryResponsePayload } from '../models/DataCategoryResponsePayload.js'; -import type { DemandResolutionStrategy } from '../models/DemandResolutionStrategy.js'; -import type { GeneralInformation } from '../models/GeneralInformation.js'; -import type { LegalBase } from '../models/LegalBase.js'; -import type { PrivacyScopeDimensionsPayload } from '../models/PrivacyScopeDimensionsPayload.js'; -import type { RegulationResponsePayload } from '../models/RegulationResponsePayload.js'; - -import type { CancelablePromise } from '../core/CancelablePromise.js'; -import { OpenAPI } from '../core/OpenAPI.js'; -import { request as __request } from '../core/request.js'; - -export class ConfigurationService { - /** - * Get general information about the app - * @returns GeneralInformation - * @throws ApiError - */ - public static getV0ConfigureGeneralInfo(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v0/configure/general-info', - }); - } - - /** - * Update general information about the app - * @param requestBody - * @returns any - * @throws ApiError - */ - public static putV0ConfigureGeneralInfo( - requestBody: GeneralInformation - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v0/configure/general-info', - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Invalid value for: body`, - }, - }); - } - - /** - * Get data categories, processing categories and purposes - * @returns PrivacyScopeDimensionsPayload - * @throws ApiError - */ - public static getV0ConfigurePrivacyScopeDimensions(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v0/configure/privacy-scope-dimensions', - }); - } - - /** - * Add selectors - * @param requestBody - * @returns any - * @throws ApiError - */ - public static putV0ConfigureSelectors( - requestBody?: Array - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v0/configure/selectors', - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Invalid value for: body`, - }, - }); - } - - /** - * Get the list of legal bases - * @returns LegalBase - * @throws ApiError - */ - public static getV0ConfigureLegalBases(): CancelablePromise< - Array - > { - return __request(OpenAPI, { - method: 'GET', - url: '/v0/configure/legal-bases', - }); - } - - /** - * Create new legal bases - * @param requestBody - * @returns string - * @throws ApiError - */ - public static putV0ConfigureLegalBases( - requestBody: CreateLegalBasePayload - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v0/configure/legal-bases', - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Invalid value for: body`, - }, - }); - } - - /** - * Get a legal bases - * @param legalBaseId - * @returns LegalBase - * @throws ApiError - */ - public static getV0ConfigureLegalBasesLegalbaseid( - legalBaseId: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v0/configure/legal-bases/{legalBaseId}', - path: { - legalBaseId: legalBaseId, - }, - errors: { - 400: `Invalid value for: path parameter legalBaseId`, - }, - }); - } - - /** - * Create retention policies for data categories - * @param requestBody - * @returns any - * @throws ApiError - */ - public static putV0ConfigureRetentionPolicies( - requestBody?: Array - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v0/configure/retention-policies', - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Invalid value for: body`, - }, - }); - } - - /** - * Delete retention policy - * @param retentionPolicyId - * @returns any - * @throws ApiError - */ - public static deleteV0ConfigureRetentionPoliciesRetentionpolicyid( - retentionPolicyId: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v0/configure/retention-policies/{retentionPolicyId}', - path: { - retentionPolicyId: retentionPolicyId, - }, - errors: { - 400: `Invalid value for: path parameter retentionPolicyId`, - }, - }); - } - - /** - * Create provenances for data categories - * @param requestBody - * @returns any - * @throws ApiError - */ - public static putV0ConfigureProvenances( - requestBody?: Array - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v0/configure/provenances', - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Invalid value for: body`, - }, - }); - } - - /** - * Delete provenance - * @param provenanceId - * @returns any - * @throws ApiError - */ - public static deleteV0ConfigureProvenancesProvenanceid( - provenanceId: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v0/configure/provenances/{provenanceId}', - path: { - provenanceId: provenanceId, - }, - errors: { - 400: `Invalid value for: path parameter provenanceId`, - }, - }); - } - - /** - * Get data categories with retention policies and provenances - * @returns DataCategoryResponsePayload - * @throws ApiError - */ - public static getV0ConfigureDataCategories(): CancelablePromise< - Array - > { - return __request(OpenAPI, { - method: 'GET', - url: '/v0/configure/data-categories', - }); - } - - /** - * Get all regulations - * @returns RegulationResponsePayload - * @throws ApiError - */ - public static getV0ConfigureRegulations(): CancelablePromise< - Array - > { - return __request(OpenAPI, { - method: 'GET', - url: '/v0/configure/regulations', - }); - } - - /** - * Assign regulation to an app - * @param requestBody - * @returns any - * @throws ApiError - */ - public static putV0ConfigureRegulations( - requestBody: AddRegulationsPayload - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v0/configure/regulations', - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Invalid value for: body`, - }, - }); - } - - /** - * Get regulations applied to the users of the app - * @returns RegulationResponsePayload - * @throws ApiError - */ - public static getV0ConfigureRegulationsApp(): CancelablePromise< - Array - > { - return __request(OpenAPI, { - method: 'GET', - url: '/v0/configure/regulations/app', - }); - } - - /** - * Delete regulation assigned to an app - * @param regulationId - * @returns any - * @throws ApiError - */ - public static deleteV0ConfigureRegulationsRegulationid( - regulationId: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'DELETE', - url: '/v0/configure/regulations/{regulationId}', - path: { - regulationId: regulationId, - }, - errors: { - 400: `Invalid value for: path parameter regulationId`, - }, - }); - } - - /** - * Get information about demand resolution strategies - * @returns DemandResolutionStrategy - * @throws ApiError - */ - public static getV0ConfigureDemandResolutionStrategy(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v0/configure/demand-resolution-strategy', - }); - } - - /** - * Update demand resolution strategies - * @param requestBody - * @returns any - * @throws ApiError - */ - public static putV0ConfigureDemandResolutionStrategy( - requestBody: DemandResolutionStrategy - ): CancelablePromise { - return __request(OpenAPI, { - method: 'PUT', - url: '/v0/configure/demand-resolution-strategy', - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Invalid value for: body`, - }, - }); - } -} diff --git a/packages/core/src/models/generated-models/services/DataConsumerInterfaceService.ts b/packages/core/src/models/generated-models/services/DataConsumerInterfaceService.ts deleted file mode 100644 index 9585d5fa..00000000 --- a/packages/core/src/models/generated-models/services/DataConsumerInterfaceService.ts +++ /dev/null @@ -1,82 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { ApproveDemandPayload } from '../models/ApproveDemandPayload.js'; -import type { DenyDemandPayload } from '../models/DenyDemandPayload.js'; -import type { PendingDemandDetailsPayload } from '../models/PendingDemandDetailsPayload.js'; -import type { PendingDemandPayload } from '../models/PendingDemandPayload.js'; - -import type { CancelablePromise } from '../core/CancelablePromise.js'; -import { OpenAPI } from '../core/OpenAPI.js'; -import { request as __request } from '../core/request.js'; - -export class DataConsumerInterfaceService { - /** - * Get the list of pending privacy request demands - * @returns PendingDemandPayload - * @throws ApiError - */ - public static getV0ConsumerInterfacePendingRequests(): CancelablePromise< - Array - > { - return __request(OpenAPI, { - method: 'GET', - url: '/v0/bridge/pending-requests', - }); - } - - /** - * Get details of a pending privacy request - * @param demandId - * @returns PendingDemandDetailsPayload - * @throws ApiError - */ - public static getV0ConsumerInterfacePendingRequestsDemandid( - demandId: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v0/bridge/pending-requests/{demandId}', - path: { - demandId: demandId, - }, - errors: { - 400: `Invalid value for: path parameter demandId`, - }, - }); - } - - /** - * Approve privacy request - * @param requestBody - * @returns any - * @throws ApiError - */ - public static postV0ConsumerInterfacePendingRequestsApprove( - requestBody: ApproveDemandPayload - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v0/bridge/pending-requests/approve', - body: requestBody, - mediaType: 'application/json', - }); - } - - /** - * Deny privacy request - * @param requestBody - * @returns any - * @throws ApiError - */ - public static postV0ConsumerInterfacePendingRequestsDeny( - requestBody: DenyDemandPayload - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v0/bridge/pending-requests/deny', - body: requestBody, - mediaType: 'application/json', - }); - } -} diff --git a/packages/core/src/models/generated-models/services/HealthService.ts b/packages/core/src/models/generated-models/services/HealthService.ts deleted file mode 100644 index 22963032..00000000 --- a/packages/core/src/models/generated-models/services/HealthService.ts +++ /dev/null @@ -1,20 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { CancelablePromise } from '../core/CancelablePromise.js'; -import { OpenAPI } from '../core/OpenAPI.js'; -import { request as __request } from '../core/request.js'; - -export class HealthService { - /** - * Is the app running? - * @returns any - * @throws ApiError - */ - public static getV0Health(): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v0/health', - }); - } -} diff --git a/packages/core/src/models/generated-models/services/PrivacyRequestsService.ts b/packages/core/src/models/generated-models/services/PrivacyRequestsService.ts deleted file mode 100644 index 627e0218..00000000 --- a/packages/core/src/models/generated-models/services/PrivacyRequestsService.ts +++ /dev/null @@ -1,106 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { CancelDemandPayload } from '../models/CancelDemandPayload.js'; -import type { CreatePrivacyRequestPayload } from '../models/CreatePrivacyRequestPayload.js'; -import type { PrivacyRequestCreatedPayload } from '../models/PrivacyRequestCreatedPayload.js'; -import type { PrivacyResponsePayload } from '../models/PrivacyResponsePayload.js'; -import type { RequestHistoryPayload } from '../models/RequestHistoryPayload.js'; - -import type { CancelablePromise } from '../core/CancelablePromise.js'; -import { OpenAPI } from '../core/OpenAPI.js'; -import { request as __request } from '../core/request.js'; - -export class PrivacyRequestsService { - /** - * Create a privacy request - * @param requestBody - * @returns PrivacyRequestCreatedPayload - * @throws ApiError - */ - public static postV0PrivacyRequest( - requestBody: CreatePrivacyRequestPayload - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v0/privacy-request', - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Invalid value for: body`, - }, - }); - } - - /** - * Get history of privacy requests - * @param authorization - * @returns RequestHistoryPayload - * @throws ApiError - */ - public static getV0PrivacyRequestHistory( - authorization: string - ): CancelablePromise { - return __request(OpenAPI, { - method: 'GET', - url: '/v0/privacy-request/history', - headers: { - Authorization: authorization, - }, - errors: { - 400: `Invalid value for: header Authorization`, - }, - }); - } - - /** - * Get privacy request status - * @param requestId - * @param authorization - * @returns PrivacyResponsePayload - * @throws ApiError - */ - public static getV0PrivacyRequestRequestid( - requestId: string, - authorization: string - ): CancelablePromise> { - return __request(OpenAPI, { - method: 'GET', - url: '/v0/privacy-request/{requestId}', - path: { - requestId: requestId, - }, - headers: { - Authorization: authorization, - }, - errors: { - 400: `Invalid value for: path parameter requestId, Invalid value for: header Authorization`, - }, - }); - } - - /** - * Cancel a pending demand - * @param authorization - * @param requestBody - * @returns any - * @throws ApiError - */ - public static postV0PrivacyRequestCancel( - authorization: string, - requestBody: CancelDemandPayload - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v0/privacy-request/cancel', - headers: { - Authorization: authorization, - }, - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Invalid value for: header Authorization, Invalid value for: body`, - }, - }); - } -} diff --git a/packages/core/src/models/generated-models/services/UserEventsService.ts b/packages/core/src/models/generated-models/services/UserEventsService.ts deleted file mode 100644 index db66b96b..00000000 --- a/packages/core/src/models/generated-models/services/UserEventsService.ts +++ /dev/null @@ -1,114 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { EndContractPayload } from '../models/EndContractPayload.js'; -import type { EndLegitimateInterestPayload } from '../models/EndLegitimateInterestPayload.js'; -import type { GiveConsentPayload } from '../models/GiveConsentPayload.js'; -import type { StartContractPayload } from '../models/StartContractPayload.js'; -import type { StartLegitimateInterestPayload } from '../models/StartLegitimateInterestPayload.js'; - -import type { CancelablePromise } from '../core/CancelablePromise.js'; -import { OpenAPI } from '../core/OpenAPI.js'; -import { request as __request } from '../core/request.js'; - -export class UserEventsService { - /** - * Add consent for a user - * @param requestBody - * @returns any - * @throws ApiError - */ - public static postV0UserEventsConsent( - requestBody: GiveConsentPayload - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v0/user-events/consent', - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Invalid value for: body`, - }, - }); - } - - /** - * Start service contract for a user - * @param requestBody - * @returns any - * @throws ApiError - */ - public static postV0UserEventsContractStart( - requestBody: StartContractPayload - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v0/user-events/contract/start', - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Invalid value for: body`, - }, - }); - } - - /** - * End service contract for a user - * @param requestBody - * @returns any - * @throws ApiError - */ - public static postV0UserEventsContractEnd( - requestBody: EndContractPayload - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v0/user-events/contract/end', - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Invalid value for: body`, - }, - }); - } - - /** - * Start legitimate interest for a user - * @param requestBody - * @returns any - * @throws ApiError - */ - public static postV0UserEventsLegitimateInterestStart( - requestBody: StartLegitimateInterestPayload - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v0/user-events/legitimate-interest/start', - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Invalid value for: body`, - }, - }); - } - - /** - * End legitimate interest for a user - * @param requestBody - * @returns any - * @throws ApiError - */ - public static postV0UserEventsLegitimateInterestEnd( - requestBody: EndLegitimateInterestPayload - ): CancelablePromise { - return __request(OpenAPI, { - method: 'POST', - url: '/v0/user-events/legitimate-interest/end', - body: requestBody, - mediaType: 'application/json', - errors: { - 400: `Invalid value for: body`, - }, - }); - } -} diff --git a/packages/core/src/models/generated-models/services/UserInfoService.ts b/packages/core/src/models/generated-models/services/UserInfoService.ts deleted file mode 100644 index cd3367ca..00000000 --- a/packages/core/src/models/generated-models/services/UserInfoService.ts +++ /dev/null @@ -1,31 +0,0 @@ -/* istanbul ignore file */ -/* tslint:disable */ -/* eslint-disable */ -import type { GivenConsentsPayload } from '../models/GivenConsentsPayload.js'; - -import type { CancelablePromise } from '../core/CancelablePromise.js'; -import { OpenAPI } from '../core/OpenAPI.js'; -import { request as __request } from '../core/request.js'; - -export class UserInfoService { - /** - * Get a list of consents user has given - * @param authorization - * @returns GivenConsentsPayload - * @throws ApiError - */ - public static getV0UserConsents( - authorization: string - ): CancelablePromise> { - return __request(OpenAPI, { - method: 'GET', - url: '/v0/user/consents', - headers: { - Authorization: authorization, - }, - errors: { - 400: `Invalid value for: header Authorization`, - }, - }); - } -} diff --git a/packages/privacy-portal/src/generated/locales/fr-CA.ts b/packages/privacy-portal/src/generated/locales/fr-CA.ts index 8ed3d2ce..e2fdbf3b 100644 --- a/packages/privacy-portal/src/generated/locales/fr-CA.ts +++ b/packages/privacy-portal/src/generated/locales/fr-CA.ts @@ -129,7 +129,6 @@ 's29ec563d56cf6c6b': `Autres Options`, 's2a32ad5ec5fc7e5c': `Il n'y a pas de source de données vous concernant`, 's2a880deefa02ab59': `Profilage`, -'s2b7bb3f9a459d7dd': `Historique bientôt disponible !`, 's2e39367a8c5564b7': `Autres données`, 's2fa47f3acd802112': `Identifiant Unique - Compte Utilisateur`, 's3137e812940ae6b7': `Vos données sont en cours d'obtention, veuillez patienter et ne pas actualiser la page`, diff --git a/packages/privacy-portal/src/generated/locales/fr-FR.ts b/packages/privacy-portal/src/generated/locales/fr-FR.ts index 8ed3d2ce..e2fdbf3b 100644 --- a/packages/privacy-portal/src/generated/locales/fr-FR.ts +++ b/packages/privacy-portal/src/generated/locales/fr-FR.ts @@ -129,7 +129,6 @@ 's29ec563d56cf6c6b': `Autres Options`, 's2a32ad5ec5fc7e5c': `Il n'y a pas de source de données vous concernant`, 's2a880deefa02ab59': `Profilage`, -'s2b7bb3f9a459d7dd': `Historique bientôt disponible !`, 's2e39367a8c5564b7': `Autres données`, 's2fa47f3acd802112': `Identifiant Unique - Compte Utilisateur`, 's3137e812940ae6b7': `Vos données sont en cours d'obtention, veuillez patienter et ne pas actualiser la page`, diff --git a/packages/privacy-portal/src/generated/locales/fr.ts b/packages/privacy-portal/src/generated/locales/fr.ts index 8ed3d2ce..e2fdbf3b 100644 --- a/packages/privacy-portal/src/generated/locales/fr.ts +++ b/packages/privacy-portal/src/generated/locales/fr.ts @@ -129,7 +129,6 @@ 's29ec563d56cf6c6b': `Autres Options`, 's2a32ad5ec5fc7e5c': `Il n'y a pas de source de données vous concernant`, 's2a880deefa02ab59': `Profilage`, -'s2b7bb3f9a459d7dd': `Historique bientôt disponible !`, 's2e39367a8c5564b7': `Autres données`, 's2fa47f3acd802112': `Identifiant Unique - Compte Utilisateur`, 's3137e812940ae6b7': `Vos données sont en cours d'obtention, veuillez patienter et ne pas actualiser la page`, diff --git a/packages/privacy-portal/src/request-builder/action-forms/bldn-other-form.ts b/packages/privacy-portal/src/request-builder/action-forms/bldn-other-form.ts index 2988db15..eaecccc8 100644 --- a/packages/privacy-portal/src/request-builder/action-forms/bldn-other-form.ts +++ b/packages/privacy-portal/src/request-builder/action-forms/bldn-other-form.ts @@ -9,7 +9,8 @@ import { ActionForm } from './bldn-action-form.js'; */ @customElement('bldn-other-form') export class BldnOtherForm extends ActionForm { - action: PrivacyRequestDemand.action = PrivacyRequestDemand.action.OTHER; + action: PrivacyRequestDemand.action = + PrivacyRequestDemand.action.OTHER_DEMAND; // Remove other options dropdown for this form includeOptions: boolean = false; @@ -38,7 +39,7 @@ export class BldnOtherForm extends ActionForm { return [ { id: '', - action: PrivacyRequestDemand.action.OTHER, + action: PrivacyRequestDemand.action.OTHER_DEMAND, }, ]; } diff --git a/packages/privacy-portal/src/request-builder/bldn-request-builder.ts b/packages/privacy-portal/src/request-builder/bldn-request-builder.ts index 9b259f66..358e5789 100644 --- a/packages/privacy-portal/src/request-builder/bldn-request-builder.ts +++ b/packages/privacy-portal/src/request-builder/bldn-request-builder.ts @@ -229,7 +229,7 @@ export class BldnRequestBuilder extends CoreConfigurationMixin(LitElement) { `, ], [ - PrivacyRequestDemand.action.OTHER, + PrivacyRequestDemand.action.OTHER_DEMAND, () => html` html`

${msg('Details of my demand:')}

${demandGroup[0].message} diff --git a/packages/privacy-portal/src/request-viewer/bldn-request-status.ts b/packages/privacy-portal/src/request-viewer/bldn-request-status.ts index 1eba646c..6e23b162 100644 --- a/packages/privacy-portal/src/request-viewer/bldn-request-status.ts +++ b/packages/privacy-portal/src/request-viewer/bldn-request-status.ts @@ -423,7 +423,7 @@ export class BldnRequestStatus extends CoreConfigurationMixin(LitElement) { // NOTE: For now, we assume demand.data is a JSON file getGrantedResponseTemplate(demand: PrivacyResponsePayload) { - const answer = JSON.parse(demand.answer); + const answer = JSON.parse(demand.answer || ''); return html` ${choose(demand.requested_action, [ @@ -466,7 +466,7 @@ export class BldnRequestStatus extends CoreConfigurationMixin(LitElement) { () => html`

${msg('Your object demand has been granted')}

`, ], [ - PrivacyResponsePayload.requested_action.OTHER, + PrivacyResponsePayload.requested_action.OTHER_DEMAND, () => html`

${msg('Your demand has been granted.')}

`, ], [