From db3f18af25f554cd5d616e977e08551b77791c09 Mon Sep 17 00:00:00 2001 From: Thiago Romano <112953503+thiagoromanos@users.noreply.github.com> Date: Tue, 25 Jul 2023 11:53:06 -0300 Subject: [PATCH] chore: fixing the export of oca OverlayType and CaptureBaseAttributeType (#905) Signed-off-by: Thiago Romano --- packages/oca/src/legacy/resolver/oca.ts | 26 ++++++++++++------------- packages/oca/src/types/index.ts | 4 ++-- 2 files changed, 15 insertions(+), 15 deletions(-) diff --git a/packages/oca/src/legacy/resolver/oca.ts b/packages/oca/src/legacy/resolver/oca.ts index bfc90e1cff..fb0cb9661e 100644 --- a/packages/oca/src/legacy/resolver/oca.ts +++ b/packages/oca/src/legacy/resolver/oca.ts @@ -9,7 +9,7 @@ import { } from '../../interfaces' import { BaseOverlay, - BaseOverlayType, + OverlayType, BrandingOverlay, CaptureBase, CharacterEncodingOverlay, @@ -25,8 +25,8 @@ import { parseCredDefFromId } from '../../utils/credential-definition' import { Field } from './record' export enum BrandingOverlayType { - Branding01 = BaseOverlayType.Branding01, - Branding10 = BaseOverlayType.Branding10, + Branding01 = OverlayType.Branding01, + Branding10 = OverlayType.Branding10, } export interface CredentialOverlay { @@ -113,19 +113,19 @@ export class OCABundle implements OCABundleType { } public get characterEncodingOverlay(): CharacterEncodingOverlay | undefined { - return this.getOverlay(BaseOverlayType.CharacterEncoding10) + return this.getOverlay(OverlayType.CharacterEncoding10) } public get formatOverlay(): FormatOverlay | undefined { - return this.getOverlay(BaseOverlayType.Format10) + return this.getOverlay(OverlayType.Format10) } public get labelOverlay(): LabelOverlay | undefined { - return this.getOverlay(BaseOverlayType.Label10, this.options.language) + return this.getOverlay(OverlayType.Label10, this.options.language) } public get metaOverlay(): MetaOverlay | undefined { - return this.getOverlay(BaseOverlayType.Meta10, this.options.language) + return this.getOverlay(OverlayType.Meta10, this.options.language) } public get brandingOverlay(): BrandingOverlay | LegacyBrandingOverlay | undefined { @@ -135,7 +135,7 @@ export class OCABundle implements OCABundleType { public buildOverlay(name: string, language: string): MetaOverlay { return new MetaOverlay({ capture_base: '', - type: BaseOverlayType.Meta10, + type: OverlayType.Meta10, name, language, description: '', @@ -148,7 +148,7 @@ export class OCABundle implements OCABundleType { } private getOverlay(type: string, language?: string): T | undefined { - if (type === BaseOverlayType.CaptureBase10) { + if (type === OverlayType.CaptureBase10) { return this.bundle.captureBase as unknown as T } if (language !== undefined) { @@ -203,7 +203,7 @@ export class DefaultOCABundleResolver implements OCABundleResolverType { const metaOverlay: IMetaOverlayData = { capture_base: '', - type: BaseOverlayType.Meta10, + type: OverlayType.Meta10, name: startCase( params.meta?.credName ?? parseCredDefFromId(params.identifiers?.credentialDefinitionId, params.identifiers?.schemaId) @@ -226,13 +226,13 @@ export class DefaultOCABundleResolver implements OCABundleResolverType { const brandingoOverlay01: ILegacyBrandingOverlayData = { capture_base: '', - type: BaseOverlayType.Branding01, + type: OverlayType.Branding01, background_color: generateColor(colorHash), } const brandingoOverlay10: IBrandingOverlayData = { capture_base: '', - type: BaseOverlayType.Branding10, + type: OverlayType.Branding10, primary_background_color: generateColor(colorHash), } @@ -240,7 +240,7 @@ export class DefaultOCABundleResolver implements OCABundleResolverType { capture_base: { attributes: {}, classification: '', - type: BaseOverlayType.CaptureBase10, + type: OverlayType.CaptureBase10, flagged_attributes: [], }, overlays: [ diff --git a/packages/oca/src/types/index.ts b/packages/oca/src/types/index.ts index c1959feac5..1be47a3d1f 100644 --- a/packages/oca/src/types/index.ts +++ b/packages/oca/src/types/index.ts @@ -13,8 +13,8 @@ import MetaOverlay from './semantic/MetaOverlay' import StandardOverlay from './semantic/StandardOverlay' export { - OverlayType as BaseOverlayType, - CaptureBaseAttributeType as BaseType, + OverlayType, + CaptureBaseAttributeType, BaseOverlay, CaptureBase, OverlayBundle,