Skip to content

Commit

Permalink
use privacy-types 4.105.3
Browse files Browse the repository at this point in the history
  • Loading branch information
abrantesarthur committed Jan 21, 2025
1 parent 13e60f7 commit 0c7030f
Show file tree
Hide file tree
Showing 7 changed files with 15 additions and 335 deletions.
10 changes: 5 additions & 5 deletions .pnp.cjs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@
"@transcend-io/handlebars-utils": "^1.1.0",
"@transcend-io/internationalization": "^1.6.0",
"@transcend-io/persisted-state": "^1.0.4",
"@transcend-io/privacy-types": "^4.105.0",
"@transcend-io/privacy-types": "^4.105.3",
"@transcend-io/secret-value": "^1.2.0",
"@transcend-io/type-utils": "^1.8.0",
"bluebird": "^3.7.2",
Expand Down
228 changes: 0 additions & 228 deletions src/oneTrust/codecs.ts

This file was deleted.

94 changes: 1 addition & 93 deletions src/oneTrust/endpoints/getOneTrustUser.ts
Original file line number Diff line number Diff line change
@@ -1,98 +1,6 @@
import * as t from 'io-ts';
import { Got } from 'got';
import { decodeCodec } from '@transcend-io/type-utils';

/**
* FIXME: move to privacy-types
*/
// Nested types first
const OneTrustUserMetadata = t.type({
/** When the user was created */
created: t.string,
/** When the user was modified */
lastModified: t.string,
/** The URI for accessing information about the user */
location: t.string,
/** The resource type */
resourceType: t.literal('User'),
});
/** Type override */
export type OneTrustUserMetadata = t.TypeOf<typeof OneTrustUserMetadata>;

const OneTrustUserName = t.partial({
/** The user's family name */
familyName: t.string,
/** The user's given name */
givenName: t.string,
});
/** Type override */
export type OneTrustUserName = t.TypeOf<typeof OneTrustUserName>;

const OneTrustUserGroup = t.type({
/** The user group's identification */
value: t.string,
/** The user group's display name */
display: t.string,
});
/** Type override */
export type OneTrustUserGroup = t.TypeOf<typeof OneTrustUserGroup>;

const OneTrustUserGroups = t.array(OneTrustUserGroup);
/** Type override */
export type OneTrustUserGroups = t.TypeOf<typeof OneTrustUserGroups>;

const OneTrustUserEmail = t.type({
/** The email value */
value: t.string,
/** The email display name */
display: t.string,
/** Whether this is the primary email */
primary: t.boolean,
/** The email type */
type: t.union([t.string, t.literal('work')]),
});
/** Type override */
export type OneTrustUserEmail = t.TypeOf<typeof OneTrustUserEmail>;

const OneTrustUserEmails = t.array(OneTrustUserEmail);
/** Type override */
export type OneTrustUserEmails = t.TypeOf<typeof OneTrustUserEmails>;

/**
* The response type of the OneTrust GetUser endpoint
* ref: https://developer.onetrust.com/onetrust/reference/getriskusingget
*/
export const OneTrustGetUserResponse = t.type({
/** ID of the user. */
id: t.string,
/** External ID of the user. */
externalId: t.union([t.string, t.null]),
/** Metadata of the user. */
meta: OneTrustUserMetadata,
/** Schemas of the user */
schemas: t.array(t.string),
/** Name or email of the user */
userName: t.string,
/** Full name of the user */
name: OneTrustUserName,
/** Type of the user */
userType: t.union([t.string, t.literal('Internal')]),
/** Flag to check if the user is an active user or not. */
active: t.boolean,
/** The groups that the user belongs to */
groups: OneTrustUserGroups,
/** The emails of the user */
emails: OneTrustUserEmails,
/** The roles of the user */
roles: t.array(t.string),
/** The title of the user */
title: t.union([t.string, t.null]),
});

/** Type override */

/** Type override */
export type OneTrustGetUserResponse = t.TypeOf<typeof OneTrustGetUserResponse>;
import { OneTrustGetUserResponse } from '@transcend-io/privacy-types';

/**
* Retrieve details about a particular user.
Expand Down
4 changes: 2 additions & 2 deletions src/oneTrust/helpers/enrichOneTrustAssessment.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import {
OneTrustAssessment,
OneTrustEnrichedAssessment,
OneTrustGetAssessmentResponse,
OneTrustGetRiskResponse,
OneTrustGetUserResponse,
} from '@transcend-io/privacy-types';
import keyBy from 'lodash/keyBy';
import { OneTrustEnrichedAssessment } from '../codecs';
import { OneTrustGetUserResponse } from '../endpoints';

/**
* Merge the assessment, assessmentDetails, and riskDetails into one object.
Expand Down
2 changes: 1 addition & 1 deletion src/oneTrust/helpers/syncOneTrustAssessments.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import { Got } from 'got/dist/source';
import {
OneTrustGetUserResponse,
getListOfOneTrustAssessments,
getOneTrustAssessment,
getOneTrustRisk,
Expand All @@ -12,6 +11,7 @@ import {
OneTrustAssessmentQuestion,
OneTrustAssessmentSection,
OneTrustGetRiskResponse,
OneTrustGetUserResponse,
} from '@transcend-io/privacy-types';
import uniq from 'lodash/uniq';
import { enrichOneTrustAssessment } from './enrichOneTrustAssessment';
Expand Down
Loading

0 comments on commit 0c7030f

Please sign in to comment.