Skip to content

Commit

Permalink
chore: updated metadata types
Browse files Browse the repository at this point in the history
  • Loading branch information
aryanjassal committed Oct 11, 2024
1 parent 77d3f89 commit 5cc0618
Showing 1 changed file with 3 additions and 6 deletions.
9 changes: 3 additions & 6 deletions src/client/handlers/VaultsSecretsMkdir.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import type { DB } from '@matrixai/db';
import type { JSONObject } from '@matrixai/rpc';
import type {
ClientRPCRequestParams,
ClientRPCResponseResult,
SecretDirMessage,
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';
Expand All @@ -25,7 +25,7 @@ class VaultsSecretsMkdir extends DuplexHandler<
): AsyncGenerator<ClientRPCResponseResult<SuccessOrErrorMessage>> {
const { db, vaultManager }: { db: DB; vaultManager: VaultManager } =
this.container;
let metadata: JSONObject;
let metadata: POJO;
yield* db.withTransactionG(
async function* (tran): AsyncGenerator<SuccessOrErrorMessage> {
for await (const secretDirMessage of input) {
Expand All @@ -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,
Expand Down

0 comments on commit 5cc0618

Please sign in to comment.