From 5cc06181163621dbe1a18d6e87ef81be43f01af0 Mon Sep 17 00:00:00 2001 From: Aryan Jassal Date: Fri, 11 Oct 2024 19:19:18 +1100 Subject: [PATCH] chore: updated metadata types --- src/client/handlers/VaultsSecretsMkdir.ts | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/client/handlers/VaultsSecretsMkdir.ts b/src/client/handlers/VaultsSecretsMkdir.ts index daf8c8401..0249db33f 100644 --- a/src/client/handlers/VaultsSecretsMkdir.ts +++ b/src/client/handlers/VaultsSecretsMkdir.ts @@ -1,5 +1,4 @@ import type { DB } from '@matrixai/db'; -import type { JSONObject } from '@matrixai/rpc'; import type { ClientRPCRequestParams, ClientRPCResponseResult, @@ -7,6 +6,7 @@ import type { SuccessOrErrorMessage, } from '../types'; import type VaultManager from '../../vaults/VaultManager'; +import type { POJO } from '../../types'; import { DuplexHandler } from '@matrixai/rpc'; import * as vaultsUtils from '../../vaults/utils'; import * as vaultsErrors from '../../vaults/errors'; @@ -25,7 +25,7 @@ class VaultsSecretsMkdir extends DuplexHandler< ): AsyncGenerator> { const { db, vaultManager }: { db: DB; vaultManager: VaultManager } = this.container; - let metadata: JSONObject; + let metadata: POJO; yield* db.withTransactionG( async function* (tran): AsyncGenerator { for await (const secretDirMessage of input) { @@ -48,11 +48,8 @@ class VaultsSecretsMkdir extends DuplexHandler< yield await vaultManager.withVaults( [vaultId], async (vault) => { - const options = metadata?.options as - | { recursive?: boolean } - | undefined; return await vaultOps.mkdir(vault, dirName, { - recursive: options?.recursive, + recursive: metadata?.options?.recursive, }); }, tran,