Skip to content

Commit 9dbc5ab

Browse files
committed
fix(identity-service): resolve framework-boundary type suppressions
Signed-off-by: cynox-66 <devj2311@gmail.com>
1 parent e6f5bb1 commit 9dbc5ab

5 files changed

Lines changed: 42 additions & 10 deletions

File tree

heka-identity-service/src/common/agent/agent-modules.provider.ts

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -112,7 +112,8 @@ function getTenantModulesMap(appConfig: ConfigType<typeof AppConfig>, agencyConf
112112
cache: new InMemoryLruCache({ limit: 100 }),
113113
}),
114114
anoncreds: new AnonCredsModule({
115-
// @ts-ignore
115+
// @ts-expect-error Credo-ts requires a non-empty tuple but registries
116+
// are populated conditionally from agent config at runtime.
116117
registries: anoncredsRegistries,
117118
anoncreds,
118119
tailsFileService: new TailsService(appConfig),

heka-identity-service/src/common/did-registrar/did-registrar.service.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,6 @@ const DID_REGISTRAR_TENANT_LABEL = 'DidRegistrarTenant'
2222
@Injectable()
2323
export class DidRegistrarService implements OnApplicationBootstrap {
2424
private readonly registrars!: Record<string, DidRegistrar>
25-
// @ts-ignore
26-
private tenantId!: string // FIXME: Currently unused but in future we want all DID to be created from separated tenant
2725
private readonly em!: EntityManager
2826

2927
public constructor(
@@ -59,7 +57,9 @@ export class DidRegistrarService implements OnApplicationBootstrap {
5957
}
6058

6159
public async onApplicationBootstrap() {
62-
this.tenantId = await this.initTenant()
60+
// Initialize the DID registrar tenant. The tenant record is not currently
61+
// consumed, but will be used when DID creation moves to a dedicated tenant.
62+
await this.initTenant()
6363
}
6464

6565
public getDidRegistrar(method?: string): DidRegistrar {

heka-identity-service/src/proof/proof.service.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,6 @@ export class ProofService {
6363
const formatData = await tenantAgent.didcomm.proofs.getFormatData(id)
6464

6565
if (formatData.presentation?.anoncreds) {
66-
// @ts-ignore
6766
const revealedAttrs = formatData.presentation.anoncreds.requested_proof.revealed_attrs
6867

6968
if (revealedAttrs) {

heka-identity-service/src/revocation/status-list/status-list.service.ts

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,3 @@
1-
/* eslint @typescript-eslint/no-unsafe-call: 0 */
2-
3-
// No type definitions available for this package
4-
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
5-
// @ts-ignore
61
import { Bitstring } from '@digitalcredentials/bitstring'
72
import { EntityManager } from '@mikro-orm/core'
83
import { BadRequestException, Inject, Injectable } from '@nestjs/common'
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
/**
2+
* Ambient type declarations for @digitalcredentials/bitstring.
3+
*
4+
* This package ships without TypeScript type definitions.
5+
* These declarations cover the API surface used by this project.
6+
*
7+
* @see https://github.com/digitalcredentials/bitstring
8+
*/
9+
declare module '@digitalcredentials/bitstring' {
10+
export class Bitstring {
11+
constructor(options: { length: number } | { buffer: Uint8Array })
12+
13+
/**
14+
* Set the bit at the given position.
15+
* @param position - The zero-based index of the bit.
16+
* @param on - Whether to set (true) or unset (false) the bit.
17+
*/
18+
set(position: number, on: boolean): void
19+
20+
/**
21+
* Get the bit value at the given position.
22+
* @param position - The zero-based index of the bit.
23+
* @returns Whether the bit is set.
24+
*/
25+
get(position: number): boolean
26+
27+
/**
28+
* Encode the bitstring to a compressed base64url string.
29+
*/
30+
encodeBits(): Promise<string>
31+
32+
/**
33+
* Decode a compressed base64url string to a Uint8Array buffer.
34+
*/
35+
static decodeBits(options: { encoded: string }): Promise<Uint8Array>
36+
}
37+
}

0 commit comments

Comments
 (0)