Skip to content

Commit

Permalink
chore: fixing the export of oca OverlayType and CaptureBaseAttributeT…
Browse files Browse the repository at this point in the history
…ype (#905)

Signed-off-by: Thiago Romano <[email protected]>
  • Loading branch information
thiagoromanos authored Jul 25, 2023
1 parent 23966b9 commit db3f18a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 15 deletions.
26 changes: 13 additions & 13 deletions packages/oca/src/legacy/resolver/oca.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import {
} from '../../interfaces'
import {
BaseOverlay,
BaseOverlayType,
OverlayType,
BrandingOverlay,
CaptureBase,
CharacterEncodingOverlay,
Expand All @@ -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<T> {
Expand Down Expand Up @@ -113,19 +113,19 @@ export class OCABundle implements OCABundleType {
}

public get characterEncodingOverlay(): CharacterEncodingOverlay | undefined {
return this.getOverlay<CharacterEncodingOverlay>(BaseOverlayType.CharacterEncoding10)
return this.getOverlay<CharacterEncodingOverlay>(OverlayType.CharacterEncoding10)
}

public get formatOverlay(): FormatOverlay | undefined {
return this.getOverlay<FormatOverlay>(BaseOverlayType.Format10)
return this.getOverlay<FormatOverlay>(OverlayType.Format10)
}

public get labelOverlay(): LabelOverlay | undefined {
return this.getOverlay<LabelOverlay>(BaseOverlayType.Label10, this.options.language)
return this.getOverlay<LabelOverlay>(OverlayType.Label10, this.options.language)
}

public get metaOverlay(): MetaOverlay | undefined {
return this.getOverlay<MetaOverlay>(BaseOverlayType.Meta10, this.options.language)
return this.getOverlay<MetaOverlay>(OverlayType.Meta10, this.options.language)
}

public get brandingOverlay(): BrandingOverlay | LegacyBrandingOverlay | undefined {
Expand All @@ -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: '',
Expand All @@ -148,7 +148,7 @@ export class OCABundle implements OCABundleType {
}

private getOverlay<T extends BaseOverlay>(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) {
Expand Down Expand Up @@ -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)
Expand All @@ -226,21 +226,21 @@ 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),
}

const bundle: OverlayBundle = new OverlayBundle(params.identifiers?.credentialDefinitionId as string, {
capture_base: {
attributes: {},
classification: '',
type: BaseOverlayType.CaptureBase10,
type: OverlayType.CaptureBase10,
flagged_attributes: [],
},
overlays: [
Expand Down
4 changes: 2 additions & 2 deletions packages/oca/src/types/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down

0 comments on commit db3f18a

Please sign in to comment.