Skip to content

Commit

Permalink
fix pre-commit
Browse files Browse the repository at this point in the history
  • Loading branch information
abrantesarthur committed Jan 13, 2025
1 parent ecf87c4 commit d4d3fde
Show file tree
Hide file tree
Showing 4 changed files with 24 additions and 20 deletions.
27 changes: 12 additions & 15 deletions src/oneTrust/endpoints/getAssessment.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable max-lines */
import * as t from 'io-ts';

/**
Expand Down Expand Up @@ -61,7 +62,6 @@ export type OneTrustAssessmentStatus = t.TypeOf<
typeof OneTrustAssessmentStatus
>;


export const OneTrustPrimaryEntityDetails = t.array(
t.type({
/** Unique ID for the primary record. */
Expand All @@ -83,8 +83,6 @@ export type OneTrustPrimaryEntityDetails = t.TypeOf<
typeof OneTrustPrimaryEntityDetails
>;



export const OneTrustAssessmentSectionSubmittedBy = t.union([
t.intersection([
t.type({
Expand Down Expand Up @@ -145,7 +143,6 @@ export type OneTrustAssessmentQuestionOption = t.TypeOf<
typeof OneTrustAssessmentQuestionOption
>;


export const OneTrustAssessmentNestedQuestion = t.type({
/** ID of the question. */
id: t.string,
Expand Down Expand Up @@ -213,7 +210,6 @@ export type OneTrustAssessmentNestedQuestion = t.TypeOf<
typeof OneTrustAssessmentNestedQuestion
>;


export const OneTrustAssessmentResponses = t.array(
t.intersection([
t.partial({
Expand Down Expand Up @@ -324,20 +320,20 @@ export type OneTrustAssessmentResponses = t.TypeOf<
typeof OneTrustAssessmentResponses
>;


export const OneTrustAssessmentQuestionResponses = t.array(t.type({
/** The responses */
responses: OneTrustAssessmentResponses,
/** Justification comments for the given response. */
justification: t.union([t.string, t.null]),
}));
export const OneTrustAssessmentQuestionResponses = t.array(
t.type({
/** The responses */
responses: OneTrustAssessmentResponses,
/** Justification comments for the given response. */
justification: t.union([t.string, t.null]),
}),
);

/** Type override */
export type OneTrustAssessmentQuestionResponses = t.TypeOf<
typeof OneTrustAssessmentQuestionResponses
>;


export const OneTrustAssessmentQuestionRisk = t.intersection([
t.type({
/** ID of the question for which the risk was flagged. */
Expand Down Expand Up @@ -467,7 +463,6 @@ export type OneTrustAssessmentSectionHeaderRiskStatistics = t.TypeOf<
typeof OneTrustAssessmentSectionHeaderRiskStatistics
>;


export const OneTrustAssessmentSectionHeader = t.intersection([
t.type({
/** ID of the section in the assessment. */
Expand Down Expand Up @@ -678,4 +673,6 @@ export const OneTrustGetAssessmentResponse = t.type({
/** Type override */
export type OneTrustGetAssessmentResponse = t.TypeOf<
typeof OneTrustGetAssessmentResponse
>;
>;

/* eslint-enable max-lines */
2 changes: 1 addition & 1 deletion src/oneTrust/endpoints/getListOfAssessments.ts
Original file line number Diff line number Diff line change
Expand Up @@ -98,4 +98,4 @@ export const OneTrustGetListOfAssessmentsResponse = t.partial({
/** Type override */
export type OneTrustGetListOfAssessmentsResponse = t.TypeOf<
typeof OneTrustGetListOfAssessmentsResponse
>;
>;
4 changes: 1 addition & 3 deletions src/oneTrust/endpoints/getRisk.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@ const OneTrustEntityType = t.type({
translationKey: t.string,
});


const OneTrustRiskLevel = t.type({
/** Risk Impact Level name. */
impactLevel: t.union([t.string, t.null]),
Expand All @@ -43,7 +42,6 @@ const OneTrustRiskLevel = t.type({
riskScore: t.union([t.number, t.null]),
});


export const OneTrustRiskCategories = t.array(
t.intersection([
t.partial({
Expand Down Expand Up @@ -298,4 +296,4 @@ export const OneTrustGetRiskResponse = t.type({
});

/** Type override */
export type OneTrustGetRiskResponse = t.TypeOf<typeof OneTrustGetRiskResponse>;
export type OneTrustGetRiskResponse = t.TypeOf<typeof OneTrustGetRiskResponse>;
11 changes: 10 additions & 1 deletion src/oneTrust/oneTrustAssessmentCsv.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
/* eslint-disable max-lines */
import * as t from 'io-ts';

/**
Expand Down Expand Up @@ -346,8 +347,10 @@ export enum OneTrustAssessmentCsvHeader {
/** The response effectivenessScale */
Sections_Questions_QuestionResponses_EffectivenessScale = 'sections_questions_questionResponses_effectivenessScale',
/** The response parentAssessmentDetailId */
// eslint-disable-next-line max-len
Sections_Questions_QuestionResponses_ParentAssessmentDetailId = 'sections_questions_questionResponses_parentAssessmentDetailId',
/** The response display label */

Sections_Questions_QuestionResponses_DisplayLabel = 'sections_questions_questionResponses_displayLabel',
/** The response type of the parent question */
Sections_Questions_QuestionResponses_ParentQuestionType = 'sections_questions_questionResponses_parentQuestionType',
Expand All @@ -356,12 +359,14 @@ export enum OneTrustAssessmentCsvHeader {
/** Whether it's local version */
Sections_Questions_QuestionResponses_IsLocalVersion = 'sections_questions_questionResponses_isLocalVersion',
/** Whether relationshipDisplayInformation */
// eslint-disable-next-line max-len
Sections_Questions_QuestionResponses_RelationshipDisplayInformation = 'sections_questions_questionResponses_relationshipDisplayInformation',
/** The response lock reason */
Sections_Questions_QuestionResponses_LockReason = 'sections_questions_questionResponses_lockReason',
/** The controlResponse */
Sections_Questions_QuestionResponses_ControlResponse = 'sections_questions_questionResponses_controlResponse',
/** The relationshipResponseDetails */
// eslint-disable-next-line max-len
Sections_Questions_QuestionResponses_RelationshipResponseDetails = 'sections_questions_questionResponses_relationshipResponseDetails',
/** The textRedacted */
Sections_Questions_QuestionResponses_TextRedacted = 'sections_questions_questionResponses_textRedacted',
Expand Down Expand Up @@ -410,6 +415,7 @@ export enum OneTrustAssessmentCsvHeader {
* OneTrust Assessment record has all expected keys before converting to a CSV row.
*/
export const OneTrustAssessmentCsvRecord = t.record(
/** The keys found in the OneTrust CSV header */
t.keyof({
[OneTrustAssessmentCsvHeader.AssessmentId]: null,
[OneTrustAssessmentCsvHeader.CreateDt]: null,
Expand Down Expand Up @@ -668,12 +674,15 @@ export const OneTrustAssessmentCsvRecord = t.record(
[OneTrustAssessmentCsvHeader.Sections_Questions_QuestionResponses_Justification]:
null,
}),
/** The values of the header */
t.union([t.string, t.number]),
);

/**
*
* Type override
*/
export type OneTrustAssessmentCsvRecord = t.TypeOf<
typeof OneTrustAssessmentCsvRecord
>;

/* eslint-enable max-lines */

0 comments on commit d4d3fde

Please sign in to comment.