Skip to content

Add missing transit commands, export commands object, fix commands TypeScript type#282

Merged
aviadhahami merged 2 commits intomasterfrom
copilot/research-and-implement-solution
Mar 12, 2026
Merged

Add missing transit commands, export commands object, fix commands TypeScript type#282
aviadhahami merged 2 commits intomasterfrom
copilot/research-and-implement-solution

Conversation

Copy link
Contributor

Copilot AI commented Mar 12, 2026

Issue #198 reported missing rewrap and keys transit endpoints, no way to access the built-in commands object for extension, and an incorrect TypeScript type for the commands config option (Array<...> instead of an object map).

New transit commands

  • rewrapDataPOST /transit/rewrap/{{name}}
  • transitCreateKeyPOST /transit/keys/{{name}}
  • transitReadKeyGET /transit/keys/{{name}}
  • transitListKeysLIST /transit/keys
  • transitDeleteKeyDELETE /transit/keys/{{name}}

Export commands for extensibility

client.commands now exposes the commands object, so users can inspect or extend it without importing src/commands.js directly.

Fix TypeScript types

- commands?: Array<{ method: string, path: string, scheme: any }>;
+ commands?: { [name: string]: functionConf };

Added commands property and all new method signatures to the client interface.

Usage

const vault = require('node-vault')();

// Rewrap ciphertext under the latest key version
await vault.rewrapData({ name: 'my-key', ciphertext: 'vault:v1:...' });

// List transit keys
await vault.transitListKeys();

// Extend using the exported commands object
const cmds = vault.commands;
vault.generateFunction('myCustomCmd', { method: 'POST', path: '/custom/path' });

✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

…fix TypeScript types

Addresses issue #198:
- Add rewrapData, transitCreateKey, transitReadKey, transitListKeys, transitDeleteKey commands
- Export commands object on client for extensibility
- Fix TypeScript type for commands option from Array to object
- Add TypeScript declarations for new methods
- Add unit tests for new functionality
- Regenerate features.md

Co-authored-by: aviadhahami <7353632+aviadhahami@users.noreply.github.com>
Copilot AI changed the title [WIP] [NODE-198] Research needs and implement solution Add missing transit commands, export commands object, fix commands TypeScript type Mar 12, 2026
@aviadhahami aviadhahami marked this pull request as ready for review March 12, 2026 14:45
@aviadhahami aviadhahami merged commit 8610b4f into master Mar 12, 2026
8 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants