diff --git a/CHANGELOG.md b/CHANGELOG.md deleted file mode 100644 index acc8b5c..0000000 --- a/CHANGELOG.md +++ /dev/null @@ -1,163 +0,0 @@ -### Changelog - -All notable changes to this project will be documented in this file. Dates are displayed in UTC. - -Generated by [`auto-changelog`](https://github.com/CookPete/auto-changelog). - -### [v12.0.0](https://github.com/fireblocks/fireblocks-cli/compare/v4.0.0...v12.0.0) - -> 23 September 2026 - -- Generated CLI #2874611366 [`#57`](https://github.com/fireblocks/fireblocks-cli/pull/57) - -### [v4.0.0](https://github.com/fireblocks/fireblocks-cli/compare/v3.0.0...v4.0.0) - -> 23 July 2026 - -- Generated CLI #7149 [`#40`](https://github.com/fireblocks/fireblocks-cli/pull/40) -- dump new version 4.0.0 [`1aa2ca3`](https://github.com/fireblocks/fireblocks-cli/commit/1aa2ca3a8d6ea307c855d63e9f33199326b0c60c) - -### [v3.0.0](https://github.com/fireblocks/fireblocks-cli/compare/v2.0.0...v3.0.0) - -> 1 July 2026 - -- Generated CLI #6819 [`#39`](https://github.com/fireblocks/fireblocks-cli/pull/39) -- dump new version 3.0.0 [`a556639`](https://github.com/fireblocks/fireblocks-cli/commit/a5566392ce612a4268ba8aed4322facba0a31e2a) - -### [v2.0.0](https://github.com/fireblocks/fireblocks-cli/compare/v1.0.10...v2.0.0) - -> 28 June 2026 - -- Generated CLI #2689 [`#38`](https://github.com/fireblocks/fireblocks-cli/pull/38) -- dump new version 2.0.0 [`ecdb26e`](https://github.com/fireblocks/fireblocks-cli/commit/ecdb26e807b4f3b479654e2247592079374ea021) - -#### [v1.0.10](https://github.com/fireblocks/fireblocks-cli/compare/v1.0.9...v1.0.10) - -> 11 June 2026 - -- Generated CLI #6460 [`#37`](https://github.com/fireblocks/fireblocks-cli/pull/37) -- dump new version 1.0.10 [`740a28d`](https://github.com/fireblocks/fireblocks-cli/commit/740a28da987ce3998ad606eda826abe80a53195f) - -#### [v1.0.9](https://github.com/fireblocks/fireblocks-cli/compare/v1.0.8...v1.0.9) - -> 2 June 2026 - -- Generated CLI #3180 [`#36`](https://github.com/fireblocks/fireblocks-cli/pull/36) -- dump new version 1.0.9 [`aa7f393`](https://github.com/fireblocks/fireblocks-cli/commit/aa7f393c314ad9046f06751b3bebc40ff242773b) - -#### [v1.0.8](https://github.com/fireblocks/fireblocks-cli/compare/v1.0.7...v1.0.8) - -> 7 May 2026 - -- Generated CLI #3457 [`#35`](https://github.com/fireblocks/fireblocks-cli/pull/35) -- Update README.md [`#34`](https://github.com/fireblocks/fireblocks-cli/pull/34) -- dump new version 1.0.8 [`e4c99fa`](https://github.com/fireblocks/fireblocks-cli/commit/e4c99fa60cc6e0b9777fd471f4af40dcc4b136bc) - -#### [v1.0.7](https://github.com/fireblocks/fireblocks-cli/compare/v1.0.6...v1.0.7) - -> 28 April 2026 - -- Generated CLI #3601 [`#33`](https://github.com/fireblocks/fireblocks-cli/pull/33) -- dump new version 1.0.7 [`d306029`](https://github.com/fireblocks/fireblocks-cli/commit/d3060292702bc3605cb1243d1fcf7c821ec02fdf) - -#### [v1.0.6](https://github.com/fireblocks/fireblocks-cli/compare/v1.0.5...v1.0.6) - -> 27 April 2026 - -- Generated CLI #628 [`#32`](https://github.com/fireblocks/fireblocks-cli/pull/32) -- dump new version 1.0.6 [`b5dab36`](https://github.com/fireblocks/fireblocks-cli/commit/b5dab369afd7a1b57ee5b411c3b5ee039bf212b7) - -#### [v1.0.5](https://github.com/fireblocks/fireblocks-cli/compare/v1.0.4...v1.0.5) - -> 21 April 2026 - -- Generated CLI #4515 [`#29`](https://github.com/fireblocks/fireblocks-cli/pull/29) -- dump new version 1.0.5 [`f038846`](https://github.com/fireblocks/fireblocks-cli/commit/f0388467198de85fd07ee4af6643f13a4c700777) - -#### [v1.0.4](https://github.com/fireblocks/fireblocks-cli/compare/v1.0.3...v1.0.4) - -> 21 April 2026 - -- Generated CLI #6469 [`#28`](https://github.com/fireblocks/fireblocks-cli/pull/28) -- dump new version 1.0.4 [`445f047`](https://github.com/fireblocks/fireblocks-cli/commit/445f047a26c2b1d62c5d084d9ab74c6dd70ff7a1) - -#### [v1.0.3](https://github.com/fireblocks/fireblocks-cli/compare/v1.0.2...v1.0.3) - -> 21 April 2026 - -- Generated CLI #4147 [`#27`](https://github.com/fireblocks/fireblocks-cli/pull/27) -- Generated CLI #3663 [`#26`](https://github.com/fireblocks/fireblocks-cli/pull/26) -- dump new version 1.0.3 [`3d5771d`](https://github.com/fireblocks/fireblocks-cli/commit/3d5771dfc96d51f18bab1dea20f2f810e84cfc8b) -- dump new version 1.0.3 [`653c2b4`](https://github.com/fireblocks/fireblocks-cli/commit/653c2b47fbed3b3c6e0e3e264c3fd21db048702e) - -#### [v1.0.2](https://github.com/fireblocks/fireblocks-cli/compare/v1.0.1...v1.0.2) - -> 20 April 2026 - -- Generated CLI #4144 [`#25`](https://github.com/fireblocks/fireblocks-cli/pull/25) -- release 1.0.2 [`9416c27`](https://github.com/fireblocks/fireblocks-cli/commit/9416c27d05c71a2894682e94f9b93b3e10a54c80) - -#### [v1.0.1](https://github.com/fireblocks/fireblocks-cli/compare/v1.0.0...v1.0.1) - -> 20 April 2026 - -- Generated CLI #2861 [`#24`](https://github.com/fireblocks/fireblocks-cli/pull/24) -- release 1.0.1 [`1c80a47`](https://github.com/fireblocks/fireblocks-cli/commit/1c80a47fae69a42537915f8db5a9a4e1e7c7883d) - -### [v1.0.0](https://github.com/fireblocks/fireblocks-cli/compare/v0.0.7...v1.0.0) - -> 20 April 2026 - -- Generated CLI #2861 [`#23`](https://github.com/fireblocks/fireblocks-cli/pull/23) -- Update README.md [`#22`](https://github.com/fireblocks/fireblocks-cli/pull/22) -- Generated CLI #6187 [`#21`](https://github.com/fireblocks/fireblocks-cli/pull/21) -- release 1.0.0 [`1ceadf9`](https://github.com/fireblocks/fireblocks-cli/commit/1ceadf9200db313a26d7ded2c2e883a7b5a54ca8) -- release 1.0.0 [`166b754`](https://github.com/fireblocks/fireblocks-cli/commit/166b7548fafd1c4dd1f87fcde2b3764df75c9fe3) - -#### [v0.0.7](https://github.com/fireblocks/fireblocks-cli/compare/v0.0.6...v0.0.7) - -> 20 April 2026 - -- Generated CLI #3643 [`#20`](https://github.com/fireblocks/fireblocks-cli/pull/20) -- release 0.0.7 [`3856d2b`](https://github.com/fireblocks/fireblocks-cli/commit/3856d2bb87dc9cf83c6e6a6bc5af20e000dd86e7) - -#### [v0.0.6](https://github.com/fireblocks/fireblocks-cli/compare/v0.0.5...v0.0.6) - -> 20 April 2026 - -- Generated CLI #2002 [`#18`](https://github.com/fireblocks/fireblocks-cli/pull/18) -- release 0.0.6 [`a9f3754`](https://github.com/fireblocks/fireblocks-cli/commit/a9f375413fdb4c3582cc1e098154fd72e6196b13) - -#### [v0.0.5](https://github.com/fireblocks/fireblocks-cli/compare/v0.0.4...v0.0.5) - -> 20 April 2026 - -- Generated CLI #5855 [`#17`](https://github.com/fireblocks/fireblocks-cli/pull/17) -- release 0.0.5 [`c1cbb86`](https://github.com/fireblocks/fireblocks-cli/commit/c1cbb869c72d5233fc103bdd6117031b215fc2dd) - -#### [v0.0.4](https://github.com/fireblocks/fireblocks-cli/compare/v0.0.3...v0.0.4) - -> 19 April 2026 - -- Generated CLI #9358 [`#15`](https://github.com/fireblocks/fireblocks-cli/pull/15) - -#### [v0.0.3](https://github.com/fireblocks/fireblocks-cli/compare/v0.0.2...v0.0.3) - -> 19 April 2026 - -- Generated CLI #3678 [`#13`](https://github.com/fireblocks/fireblocks-cli/pull/13) - -#### [v0.0.2](https://github.com/fireblocks/fireblocks-cli/compare/v0.0.1...v0.0.2) - -> 19 April 2026 - -- Generated CLI #6127 [`#12`](https://github.com/fireblocks/fireblocks-cli/pull/12) - -#### v0.0.1 - -> 19 April 2026 - -- Generated CLI #212 [`#10`](https://github.com/fireblocks/fireblocks-cli/pull/10) -- Generated CLI #6774 [`#8`](https://github.com/fireblocks/fireblocks-cli/pull/8) -- Generated CLI #5771 [`#7`](https://github.com/fireblocks/fireblocks-cli/pull/7) -- Empty commit [`01a4e60`](https://github.com/fireblocks/fireblocks-cli/commit/01a4e60b38b583644d86f6220bb1751ce3594bb0) diff --git a/package.json b/package.json index add879d..726e80a 100644 --- a/package.json +++ b/package.json @@ -1,7 +1,7 @@ { "name": "@fireblocks/fireblocks-cli", "description": "Agent-first CLI for Fireblocks infrastructure. Execute any Fireblocks API operation from the command line.", - "version": "12.0.0", + "version": "0.1.0", "author": "Fireblocks", "repository": { "type": "git", @@ -40,11 +40,7 @@ "./dist", "./oclif.manifest.json" ], - "keywords": [ - "oclif", - "fireblocks", - "cli" - ], + "keywords": ["oclif", "fireblocks", "cli"], "license": "MIT", "main": "dist/index.js", "type": "module", @@ -58,180 +54,180 @@ "topicSeparator": " ", "topics": { "admin-quorum": { - "description": "Admin Quorum operations" + "description": "Admin Quorum operations" }, "api-user": { - "description": "Api User operations" + "description": "Api User operations" }, "approvals": { - "description": "Approvals operations (Beta)" + "description": "Approvals operations (Beta)" }, "audit-logs": { - "description": "Audit Logs operations" + "description": "Audit Logs operations" }, "blockchain-link": { - "description": "Blockchain link operations (Beta)" + "description": "Blockchain link operations (Beta)" }, "blockchains-assets": { - "description": "Blockchains & assets operations" + "description": "Blockchains & assets operations" }, "canton": { - "description": "Canton operations (Beta)" + "description": "Canton operations (Beta)" }, "compliance": { - "description": "Compliance operations" + "description": "Compliance operations" }, "compliance-screening-configuration": { - "description": "Compliance Screening Configuration operations" + "description": "Compliance Screening Configuration operations" }, "compliance-orchestrator": { - "description": "Compliance Orchestrator operations (Beta)" + "description": "Compliance Orchestrator operations (Beta)" }, "connected-accounts": { - "description": "Connected Accounts operations (Beta)" + "description": "Connected Accounts operations" }, "console-user": { - "description": "Console User operations" + "description": "Console User operations" }, "contacts": { - "description": "Contacts operations" + "description": "Contacts operations" }, "contract-interactions": { - "description": "Contract Interactions operations" + "description": "Contract Interactions operations" }, "contract-templates": { - "description": "Contract Templates operations" + "description": "Contract Templates operations" }, "contracts": { - "description": "Contracts operations" + "description": "Contracts operations" }, "cosigners": { - "description": "Cosigners operations (Beta)" + "description": "Cosigners operations (Beta)" }, "deployed-contracts": { - "description": "Deployed Contracts operations" + "description": "Deployed Contracts operations" }, "earn": { - "description": "Earn operations" + "description": "Earn operations" }, "embedded-wallets": { - "description": "Embedded Wallets operations" + "description": "Embedded Wallets operations" }, "exchange-accounts": { - "description": "Exchange accounts operations" + "description": "Exchange accounts operations" }, "external-wallets": { - "description": "External wallets operations" + "description": "External wallets operations" }, "fiat-accounts": { - "description": "Fiat accounts operations" + "description": "Fiat accounts operations" }, "gas-stations": { - "description": "Gas stations operations" + "description": "Gas stations operations" }, "genie": { - "description": "Genie operations (Beta)" + "description": "Genie operations (Beta)" }, "internal-wallets": { - "description": "Internal wallets operations" + "description": "Internal wallets operations" }, "key-link": { - "description": "Key Link operations (Beta)" + "description": "Key Link operations (Beta)" }, "keys": { - "description": "Keys operations (Beta)" + "description": "Keys operations (Beta)" }, "network-connections": { - "description": "Network connections operations" + "description": "Network connections operations" }, "nfts": { - "description": "NFTs operations" + "description": "NFTs operations" }, "off-exchanges": { - "description": "Off exchanges operations" + "description": "Off exchanges operations" }, "onchain-data": { - "description": "Onchain Data operations" + "description": "Onchain Data operations" }, "ota": { - "description": "OTA operations (Beta)" + "description": "OTA operations (Beta)" }, "payments-flows": { - "description": "Payments - Flows operations" + "description": "Payments - Flows operations" }, "payments-payout": { - "description": "Payments - Payout operations" + "description": "Payments - Payout operations" }, "policy-editor": { - "description": "Policy Editor operations (Beta)" + "description": "Policy Editor operations (Beta)" }, "policy-editor-v2": { - "description": "Policy Editor V2 operations" + "description": "Policy Editor V2 operations" }, "reports": { - "description": "Reports operations (Beta)" + "description": "Reports operations (Beta)" }, "reset-device": { - "description": "Reset device operations" + "description": "Reset device operations" }, "security-posture-management": { - "description": "Security Posture Management operations" + "description": "Security Posture Management operations" }, "smart-transfer": { - "description": "Smart Transfer operations" + "description": "Smart Transfer operations" }, "staking": { - "description": "Staking operations" + "description": "Staking operations" }, "tags": { - "description": "Tags operations" + "description": "Tags operations" }, "tokenization": { - "description": "Tokenization operations" + "description": "Tokenization operations" }, "trading": { - "description": "Trading operations (Beta)" + "description": "Trading operations (Beta)" }, "transactions": { - "description": "Transactions operations" + "description": "Transactions operations" }, "travel-rule": { - "description": "Travel Rule operations" + "description": "Travel Rule operations" }, "trlink": { - "description": "TRLink operations" + "description": "TRLink operations" }, "user-groups": { - "description": "User groups operations (Beta)" + "description": "User groups operations (Beta)" }, "users": { - "description": "Users operations" + "description": "Users operations" }, "utxo-management": { - "description": "UTXO Management operations (Beta)" + "description": "UTXO Management operations (Beta)" }, "vaults": { - "description": "Vaults operations" + "description": "Vaults operations" }, "web3-connections": { - "description": "Web3 connections operations" + "description": "Web3 connections operations" }, "webhooks": { - "description": "Webhooks operations" + "description": "Webhooks operations" }, "webhooks-v2": { - "description": "Webhooks V2 operations" + "description": "Webhooks V2 operations" }, "whitelist-ip-addresses": { - "description": "whitelist ip addresses operations" + "description": "whitelist ip addresses operations" }, "workspace": { - "description": "Workspace operations" + "description": "Workspace operations" }, "workspace-status": { - "description": "Workspace Status operations (Beta)" + "description": "Workspace Status operations (Beta)" } - }, +}, "plugins": [ "@oclif/plugin-help", "@oclif/plugin-autocomplete" @@ -249,7 +245,7 @@ "win32-x64" ], "macos": { - "identifier": "com.fireblocks.mycli" + "identifier": "com.fireblocks.mycli" } }, "scripts": { @@ -260,6 +256,6 @@ "pack:mac": "oclif pack macos", "pack:win": "oclif pack win --targets win32-x64", "pack:deb": "oclif pack deb" - }, +}, "types": "dist/index.d.ts" } diff --git a/src/commands/canton/create-canton-call.ts b/src/commands/canton/create-canton-call.ts index 84930b5..9f4d83a 100644 --- a/src/commands/canton/create-canton-call.ts +++ b/src/commands/canton/create-canton-call.ts @@ -4,7 +4,7 @@ import {FireblocksBaseCommand} from '../../lib/base-command.js' export default class CreateCantonCall extends FireblocksBaseCommand { static summary = 'Make a Canton call' - static description = 'Submits one Canton call. \`type\` names the call and selects the shape of \`payload\`.\nAn unknown or missing \`type\`, or a \`payload\` missing a required field, is a \`400\`. A field that does not belong to the selected \`type\` is ignored rather than rejected.\nFour types are specified but not available in v1 and return \`501\`: \`DTCC_END_INVESTOR_INVITE_CANCEL\`, \`DTCC_END_INVESTOR_OFFBOARD\`, \`DTCC_ALLOW_LIST_ADD\`, \`DTCC_ALLOW_LIST_REMOVE\`. \`TRANSFER_WITHDRAW\` has no owning service at all.\n\nOperation ID: createCantonCall\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Canton/createCantonCall' + static description = 'Submits one Canton call. \`type\` names the call and selects the shape of \`payload\`.\nAn unknown or missing \`type\`, or a \`payload\` missing a required field, is a \`400\`. A field that does not belong to the selected \`type\` is ignored rather than rejected.\nA \`501\` has two different causes, and the distinction is permanent rather than a build-order detail, so it belongs in the published spec:\nNO CANTON CAPABILITY — specified so the contract is complete, but not available in v1: \`DTCC_END_INVESTOR_INVITE_CANCEL\`, \`DTCC_END_INVESTOR_OFFBOARD\`, \`DTCC_ALLOW_LIST_ADD\`, \`DTCC_ALLOW_LIST_REMOVE\`. \`TRANSFER_WITHDRAW\` has no owning service at all. NO HANDLER YET — the capability exists and the type is being wired one slice at a time.\n\`ALLOCATION_WITHDRAW\` is implemented and answers \`201\` / \`400\` / \`404\` / \`409\`.\n\nOperation ID: createCantonCall\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Canton/createCantonCall' static enableJsonFlag = false diff --git a/src/commands/canton/respond-to-canton-offer.ts b/src/commands/canton/respond-to-canton-offer.ts index ed2261a..560cdf5 100644 --- a/src/commands/canton/respond-to-canton-offer.ts +++ b/src/commands/canton/respond-to-canton-offer.ts @@ -4,7 +4,7 @@ import {FireblocksBaseCommand} from '../../lib/base-command.js' export default class RespondToCantonOffer extends FireblocksBaseCommand { static summary = 'Answer an offer' - static description = 'ONE endpoint for every offer domain. Two layers of discrimination, nested: \`domain\` selects \`response\`, and inside \`response\` the \`responseType\` selects the variant. Both layers are closed, so an onboarding response type sent under \`domain: ALLOCATIONS\` is a \`400\`.\n{"domain":"ONBOARDING","response":{"responseType":"DTCC_…_REJECT","reason":"KYC"}}\n\`domain: TRANSFERS\` is declared so the endpoint covers every offer domain. Transfer responses are not available yet — the domain is part of the contract, not of v1\'s behaviour.\n\nOperation ID: respondToCantonOffer\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Canton/respondToCantonOffer' + static description = 'ONE endpoint for every offer domain. Two layers of discrimination, nested: \`domain\` selects \`response\`, and inside \`response\` the \`responseType\` selects the variant. Both layers are closed, so an onboarding response type sent under \`domain: ALLOCATION\` is a \`400\`.\n{"domain":"ONBOARDING","response":{"responseType":"DTCC_…_REJECT","reason":"KYC"}}\n\`domain: TRANSFER\` is declared so the endpoint covers every offer domain. Transfer responses are not available yet — the domain is part of the contract, not of v1\'s behaviour.\n\nOperation ID: respondToCantonOffer\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Canton/respondToCantonOffer' static enableJsonFlag = false diff --git a/src/commands/compliance/create-address-registry-proof-of-ownership.ts b/src/commands/compliance/create-address-registry-proof-of-ownership.ts new file mode 100644 index 0000000..0685384 --- /dev/null +++ b/src/commands/compliance/create-address-registry-proof-of-ownership.ts @@ -0,0 +1,63 @@ +import {Flags} from '@oclif/core' +import {FireblocksBaseCommand} from '../../lib/base-command.js' + +export default class CreateAddressRegistryProofOfOwnership extends FireblocksBaseCommand { + static summary = 'Create a Proof of Ownership PDF for an address' + + static description = 'Creates a Proof of Ownership PDF for a blockchain address owned by the authenticated workspace — for example, to share with a counterparty or bank as compliance evidence. Recipients can confirm it with \`POST /v1/address_registry/proof_of_ownership_exports/verify\`.\n\nCheck \`proofOfOwnershipAvailable\` on \`GET /v1/address_registry/legal_entities/{address}\` first if you want to know whether create is likely to succeed.\n\nOperation ID: createAddressRegistryProofOfOwnership\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Compliance/createAddressRegistryProofOfOwnership' + + static enableJsonFlag = false + + static flags = { + data: Flags.string({ + description: 'JSON request body', + required: true, + }), + 'include-headers': Flags.boolean({ + description: 'Include spec-defined response headers in output', + default: false, + }), + } + + static method = 'POST' + static path = '/v1/address_registry/proof_of_ownership_exports' + static isBeta = false + static responseHeaders: string[] = ["X-Request-ID"] + + async run(): Promise { + const {flags} = await this.parse(CreateAddressRegistryProofOfOwnership) + + let body: Record | undefined + if (flags.data) { + try { + const parsed = JSON.parse(flags.data) + if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) { + this.error('--data must be a JSON object (e.g., \'{"key": "value"}\')') + } + body = parsed as Record + } catch { + this.error('Invalid JSON in --data flag. Ensure the value is valid JSON.') + } + } + + const headers: Record = {} + if (flags['idempotency-key']) { + headers['Idempotency-Key'] = flags['idempotency-key'] + } + + + + await this.confirmOrAbort('POST', '/v1/address_registry/proof_of_ownership_exports') + + const result = await this.makeRequest( + 'POST', + '/v1/address_registry/proof_of_ownership_exports', + { + body, + headers, + }, + ) + + return result + } +} diff --git a/src/commands/compliance/verify-address-registry-proof-of-ownership.ts b/src/commands/compliance/verify-address-registry-proof-of-ownership.ts new file mode 100644 index 0000000..13b8702 --- /dev/null +++ b/src/commands/compliance/verify-address-registry-proof-of-ownership.ts @@ -0,0 +1,63 @@ +import {Flags} from '@oclif/core' +import {FireblocksBaseCommand} from '../../lib/base-command.js' + +export default class VerifyAddressRegistryProofOfOwnership extends FireblocksBaseCommand { + static summary = 'Verify a Proof of Ownership export' + + static description = 'Verifies a Proof of Ownership export against the record Fireblocks stored at creation. Returns \`valid: false\` (not 404) for an unknown, expired, or mismatched export. Available to any authenticated Fireblocks workspace, not just the export\'s original owner.\n\nOperation ID: verifyAddressRegistryProofOfOwnership\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Compliance/verifyAddressRegistryProofOfOwnership' + + static enableJsonFlag = false + + static flags = { + data: Flags.string({ + description: 'JSON request body', + required: true, + }), + 'include-headers': Flags.boolean({ + description: 'Include spec-defined response headers in output', + default: false, + }), + } + + static method = 'POST' + static path = '/v1/address_registry/proof_of_ownership_exports/verify' + static isBeta = false + static responseHeaders: string[] = ["X-Request-ID"] + + async run(): Promise { + const {flags} = await this.parse(VerifyAddressRegistryProofOfOwnership) + + let body: Record | undefined + if (flags.data) { + try { + const parsed = JSON.parse(flags.data) + if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) { + this.error('--data must be a JSON object (e.g., \'{"key": "value"}\')') + } + body = parsed as Record + } catch { + this.error('Invalid JSON in --data flag. Ensure the value is valid JSON.') + } + } + + const headers: Record = {} + if (flags['idempotency-key']) { + headers['Idempotency-Key'] = flags['idempotency-key'] + } + + + + await this.confirmOrAbort('POST', '/v1/address_registry/proof_of_ownership_exports/verify') + + const result = await this.makeRequest( + 'POST', + '/v1/address_registry/proof_of_ownership_exports/verify', + { + body, + headers, + }, + ) + + return result + } +} diff --git a/src/commands/connected-accounts/add-connected-account.ts b/src/commands/connected-accounts/add-connected-account.ts index 19d0031..6c65008 100644 --- a/src/commands/connected-accounts/add-connected-account.ts +++ b/src/commands/connected-accounts/add-connected-account.ts @@ -4,7 +4,7 @@ import {FireblocksBaseCommand} from '../../lib/base-command.js' export default class AddConnectedAccount extends FireblocksBaseCommand { static summary = 'Add a connected account' - static description = 'Creates a new connected account for the authenticated tenant.\n\nThe \`creds\` field must be a Base64-encoded RSA-encrypted credential blob.\nUse \`GET /connected_accounts/credentials/public_key\` to retrieve the public key for encryption.\n\nThe \`providerType\` is derived server-side from the \`providerId\` — callers do not supply it.\n\nEndpoint Permission: Editor, Admin, Non-Signing Admin.\n\n**Note:** This endpoint is currently in beta and might be subject to changes.\n\nOperation ID: addConnectedAccount\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/addConnectedAccount' + static description = 'Creates a new connected account for the authenticated tenant.\n\nThe \`creds\` field must be a Base64-encoded RSA-encrypted credential blob.\nUse \`GET /connected_accounts/credentials/public_key\` to retrieve the public key for encryption.\n\nThe \`providerType\` is derived server-side from the \`providerId\` — callers do not supply it.\n\nEndpoint Permission: Editor, Admin, Non-Signing Admin.\n\nOperation ID: addConnectedAccount\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/addConnectedAccount' static enableJsonFlag = false @@ -21,14 +21,12 @@ export default class AddConnectedAccount extends FireblocksBaseCommand { static method = 'POST' static path = '/v1/connected_accounts' - static isBeta = true + static isBeta = false static responseHeaders: string[] = ["X-Request-ID"] async run(): Promise { const {flags} = await this.parse(AddConnectedAccount) - this.logToStderr('Warning: This command is in beta and may change in future releases.') - let body: Record | undefined if (flags.data) { try { diff --git a/src/commands/connected-accounts/disconnect-connected-account.ts b/src/commands/connected-accounts/disconnect-connected-account.ts index 00b6756..e4f96b6 100644 --- a/src/commands/connected-accounts/disconnect-connected-account.ts +++ b/src/commands/connected-accounts/disconnect-connected-account.ts @@ -4,7 +4,7 @@ import {FireblocksBaseCommand} from '../../lib/base-command.js' export default class DisconnectConnectedAccount extends FireblocksBaseCommand { static summary = 'Disconnect connected account' - static description = 'Disconnect a connected account by ID.\n\n**Note**:\n- This endpoint is currently in beta and might be subject to changes.\n\nOperation ID: disconnectConnectedAccount\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/disconnectConnectedAccount' + static description = 'Disconnect a connected account by ID.\n\nOperation ID: disconnectConnectedAccount\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/disconnectConnectedAccount' static enableJsonFlag = false @@ -21,14 +21,12 @@ export default class DisconnectConnectedAccount extends FireblocksBaseCommand { static method = 'DELETE' static path = '/v1/connected_accounts/{accountId}' - static isBeta = true + static isBeta = false static responseHeaders: string[] = ["X-Request-ID"] async run(): Promise { const {flags} = await this.parse(DisconnectConnectedAccount) - this.logToStderr('Warning: This command is in beta and may change in future releases.') - const headers: Record = {} diff --git a/src/commands/connected-accounts/get-connected-account-allowlist-entry.ts b/src/commands/connected-accounts/get-connected-account-allowlist-entry.ts index 8053be6..b60899d 100644 --- a/src/commands/connected-accounts/get-connected-account-allowlist-entry.ts +++ b/src/commands/connected-accounts/get-connected-account-allowlist-entry.ts @@ -4,7 +4,7 @@ import {FireblocksBaseCommand} from '../../lib/base-command.js' export default class GetConnectedAccountAllowlistEntry extends FireblocksBaseCommand { static summary = 'Get a single allowlist entry for a connected account' - static description = 'Retrieves a single allowlist entry by its Fireblocks identifier for a specified connected account.\n\n**Note:** This endpoint is currently in beta and might be subject to changes. Currently supports CoinbaseExchange/Binance accounts only.\n\nOperation ID: getConnectedAccountAllowlistEntry\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/getConnectedAccountAllowlistEntry' + static description = 'Retrieves a single allowlist entry by its Fireblocks identifier for a specified connected account.\n\n**Note:** Currently supports CoinbaseExchange/Binance accounts only.\n\nOperation ID: getConnectedAccountAllowlistEntry\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/getConnectedAccountAllowlistEntry' static enableJsonFlag = false @@ -25,14 +25,12 @@ export default class GetConnectedAccountAllowlistEntry extends FireblocksBaseCom static method = 'GET' static path = '/v1/connected_accounts/{accountId}/allowlist/{allowlistId}' - static isBeta = true + static isBeta = false static responseHeaders: string[] = ["X-Request-ID"] async run(): Promise { const {flags} = await this.parse(GetConnectedAccountAllowlistEntry) - this.logToStderr('Warning: This command is in beta and may change in future releases.') - const headers: Record = {} diff --git a/src/commands/connected-accounts/get-connected-account-allowlist.ts b/src/commands/connected-accounts/get-connected-account-allowlist.ts index 68dd545..8aa3d1a 100644 --- a/src/commands/connected-accounts/get-connected-account-allowlist.ts +++ b/src/commands/connected-accounts/get-connected-account-allowlist.ts @@ -4,7 +4,7 @@ import {FireblocksBaseCommand} from '../../lib/base-command.js' export default class GetConnectedAccountAllowlist extends FireblocksBaseCommand { static summary = 'Get allowlist for connected account' - static description = 'Retrieves the address allowlist for a specified connected account.\n\n**Note:** This endpoint is currently in beta and might be subject to changes. Currently supports CoinbaseExchange/Binance accounts only.\n\nOperation ID: getConnectedAccountAllowlist\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/getConnectedAccountAllowlist' + static description = 'Retrieves the address allowlist for a specified connected account.\n\n**Note:** Currently supports CoinbaseExchange/Binance accounts only.\n\nOperation ID: getConnectedAccountAllowlist\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/getConnectedAccountAllowlist' static enableJsonFlag = false @@ -44,14 +44,12 @@ export default class GetConnectedAccountAllowlist extends FireblocksBaseCommand static method = 'GET' static path = '/v1/connected_accounts/{accountId}/allowlist' - static isBeta = true + static isBeta = false static responseHeaders: string[] = ["X-Request-ID"] async run(): Promise { const {flags} = await this.parse(GetConnectedAccountAllowlist) - this.logToStderr('Warning: This command is in beta and may change in future releases.') - const headers: Record = {} diff --git a/src/commands/connected-accounts/get-connected-account-balances.ts b/src/commands/connected-accounts/get-connected-account-balances.ts index bfa8984..ea6d6c7 100644 --- a/src/commands/connected-accounts/get-connected-account-balances.ts +++ b/src/commands/connected-accounts/get-connected-account-balances.ts @@ -4,7 +4,7 @@ import {FireblocksBaseCommand} from '../../lib/base-command.js' export default class GetConnectedAccountBalances extends FireblocksBaseCommand { static summary = 'Get balances for an account' - static description = 'Retrieve current asset balances for a specific connected account as a flat list (one row per \`assetId\`, \`balanceType\`).\n\n**Note:** This endpoint is currently in beta and might be subject to changes.\n\nOperation ID: getConnectedAccountBalances\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/getConnectedAccountBalances' + static description = 'Retrieve current asset balances for a specific connected account as a flat list (one row per \`assetId\`, \`balanceType\`).\n\nOperation ID: getConnectedAccountBalances\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/getConnectedAccountBalances' static enableJsonFlag = false @@ -27,14 +27,12 @@ export default class GetConnectedAccountBalances extends FireblocksBaseCommand { static method = 'GET' static path = '/v1/connected_accounts/{accountId}/balances' - static isBeta = true + static isBeta = false static responseHeaders: string[] = ["X-Request-ID"] async run(): Promise { const {flags} = await this.parse(GetConnectedAccountBalances) - this.logToStderr('Warning: This command is in beta and may change in future releases.') - const headers: Record = {} diff --git a/src/commands/connected-accounts/get-connected-account-rates.ts b/src/commands/connected-accounts/get-connected-account-rates.ts index 94b539d..0fc43a8 100644 --- a/src/commands/connected-accounts/get-connected-account-rates.ts +++ b/src/commands/connected-accounts/get-connected-account-rates.ts @@ -4,7 +4,7 @@ import {FireblocksBaseCommand} from '../../lib/base-command.js' export default class GetConnectedAccountRates extends FireblocksBaseCommand { static summary = 'Get exchange rates for an account' - static description = 'Retrieve current exchange rates for converting between specific assets in a connected account.\n\n**Note:** This endpoint is currently in beta and might be subject to changes.\n\nOperation ID: getConnectedAccountRates\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/getConnectedAccountRates' + static description = 'Retrieve current exchange rates for converting between specific assets in a connected account.\n\nOperation ID: getConnectedAccountRates\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/getConnectedAccountRates' static enableJsonFlag = false @@ -29,14 +29,12 @@ export default class GetConnectedAccountRates extends FireblocksBaseCommand { static method = 'GET' static path = '/v1/connected_accounts/{accountId}/rates' - static isBeta = true + static isBeta = false static responseHeaders: string[] = ["X-Request-ID"] async run(): Promise { const {flags} = await this.parse(GetConnectedAccountRates) - this.logToStderr('Warning: This command is in beta and may change in future releases.') - const headers: Record = {} diff --git a/src/commands/connected-accounts/get-connected-account-trading-pairs.ts b/src/commands/connected-accounts/get-connected-account-trading-pairs.ts index bf1a9f7..44b5149 100644 --- a/src/commands/connected-accounts/get-connected-account-trading-pairs.ts +++ b/src/commands/connected-accounts/get-connected-account-trading-pairs.ts @@ -4,7 +4,7 @@ import {FireblocksBaseCommand} from '../../lib/base-command.js' export default class GetConnectedAccountTradingPairs extends FireblocksBaseCommand { static summary = 'Get supported trading pairs for an account' - static description = 'Retrieve all asset trading pairs supported by a specific connected account, including the pair type (\`quote\`, \`market\`, \`onOffRamp\`).\n\n**Note:** This endpoint is currently in beta and might be subject to changes.\n\nOperation ID: getConnectedAccountTradingPairs\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/getConnectedAccountTradingPairs' + static description = 'Retrieve all asset trading pairs supported by a specific connected account, including the pair type (\`quote\`, \`market\`, \`onOffRamp\`).\n\nOperation ID: getConnectedAccountTradingPairs\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/getConnectedAccountTradingPairs' static enableJsonFlag = false @@ -28,14 +28,12 @@ export default class GetConnectedAccountTradingPairs extends FireblocksBaseComma static method = 'GET' static path = '/v1/connected_accounts/{accountId}/manifest/capabilities/trading/pairs' - static isBeta = true + static isBeta = false static responseHeaders: string[] = ["X-Request-ID"] async run(): Promise { const {flags} = await this.parse(GetConnectedAccountTradingPairs) - this.logToStderr('Warning: This command is in beta and may change in future releases.') - const headers: Record = {} diff --git a/src/commands/connected-accounts/get-connected-account.ts b/src/commands/connected-accounts/get-connected-account.ts index 1385e8a..49be06f 100644 --- a/src/commands/connected-accounts/get-connected-account.ts +++ b/src/commands/connected-accounts/get-connected-account.ts @@ -4,7 +4,7 @@ import {FireblocksBaseCommand} from '../../lib/base-command.js' export default class GetConnectedAccount extends FireblocksBaseCommand { static summary = 'Get connected account' - static description = 'Retrieve detailed information about a specific connected account by ID.\n\n**Note:** This endpoint is currently in beta and might be subject to changes.\n\nOperation ID: getConnectedAccount\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/getConnectedAccount' + static description = 'Retrieve detailed information about a specific connected account by ID.\n\nOperation ID: getConnectedAccount\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/getConnectedAccount' static enableJsonFlag = false @@ -21,14 +21,12 @@ export default class GetConnectedAccount extends FireblocksBaseCommand { static method = 'GET' static path = '/v1/connected_accounts/{accountId}' - static isBeta = true + static isBeta = false static responseHeaders: string[] = ["X-Request-ID"] async run(): Promise { const {flags} = await this.parse(GetConnectedAccount) - this.logToStderr('Warning: This command is in beta and may change in future releases.') - const headers: Record = {} diff --git a/src/commands/connected-accounts/get-connected-accounts-credentials-public-key.ts b/src/commands/connected-accounts/get-connected-accounts-credentials-public-key.ts index 3655f39..6d7848c 100644 --- a/src/commands/connected-accounts/get-connected-accounts-credentials-public-key.ts +++ b/src/commands/connected-accounts/get-connected-accounts-credentials-public-key.ts @@ -4,7 +4,7 @@ import {FireblocksBaseCommand} from '../../lib/base-command.js' export default class GetConnectedAccountsCredentialsPublicKey extends FireblocksBaseCommand { static summary = 'Get public key to encrypt connected account credentials' - static description = 'Returns the RSA public key used to encrypt the \`creds\` field before calling \`POST /connected_accounts\`.\n\nThe key is a singleton resource scoped to the connected-accounts credentials domain — there is one per tenant context.\n\n**Note:** This endpoint is currently in beta and might be subject to changes.\n\nOperation ID: getConnectedAccountsCredentialsPublicKey\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/getConnectedAccountsCredentialsPublicKey' + static description = 'Returns the RSA public key used to encrypt the \`creds\` field before calling \`POST /connected_accounts\`.\n\nThe key is a singleton resource scoped to the connected-accounts credentials domain — there is one per tenant context.\n\nOperation ID: getConnectedAccountsCredentialsPublicKey\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/getConnectedAccountsCredentialsPublicKey' static enableJsonFlag = false @@ -17,14 +17,12 @@ export default class GetConnectedAccountsCredentialsPublicKey extends Fireblocks static method = 'GET' static path = '/v1/connected_accounts/credentials/public_key' - static isBeta = true + static isBeta = false static responseHeaders: string[] = ["X-Request-ID"] async run(): Promise { const {flags} = await this.parse(GetConnectedAccountsCredentialsPublicKey) - this.logToStderr('Warning: This command is in beta and may change in future releases.') - const headers: Record = {} diff --git a/src/commands/connected-accounts/get-connected-accounts.ts b/src/commands/connected-accounts/get-connected-accounts.ts index 10bf35a..d82cd97 100644 --- a/src/commands/connected-accounts/get-connected-accounts.ts +++ b/src/commands/connected-accounts/get-connected-accounts.ts @@ -4,7 +4,7 @@ import {FireblocksBaseCommand} from '../../lib/base-command.js' export default class GetConnectedAccounts extends FireblocksBaseCommand { static summary = 'Get connected accounts' - static description = 'Returns all connected accounts.\n\n**Note:** This endpoint is currently in beta and might be subject to changes.\n\nOperation ID: getConnectedAccounts\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/getConnectedAccounts' + static description = 'Returns all connected accounts.\n\nOperation ID: getConnectedAccounts\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/getConnectedAccounts' static enableJsonFlag = false @@ -27,14 +27,12 @@ export default class GetConnectedAccounts extends FireblocksBaseCommand { static method = 'GET' static path = '/v1/connected_accounts' - static isBeta = true + static isBeta = false static responseHeaders: string[] = ["X-Request-ID"] async run(): Promise { const {flags} = await this.parse(GetConnectedAccounts) - this.logToStderr('Warning: This command is in beta and may change in future releases.') - const headers: Record = {} diff --git a/src/commands/connected-accounts/rename-connected-account.ts b/src/commands/connected-accounts/rename-connected-account.ts index c41b99f..914a442 100644 --- a/src/commands/connected-accounts/rename-connected-account.ts +++ b/src/commands/connected-accounts/rename-connected-account.ts @@ -4,7 +4,7 @@ import {FireblocksBaseCommand} from '../../lib/base-command.js' export default class RenameConnectedAccount extends FireblocksBaseCommand { static summary = 'Rename Connected Account' - static description = 'Rename a connected account by account ID.\n\n**Note:** This endpoint is currently in beta and might be subject to changes.\n\nOperation ID: renameConnectedAccount\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/renameConnectedAccount' + static description = 'Rename a connected account by account ID.\n\nOperation ID: renameConnectedAccount\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/renameConnectedAccount' static enableJsonFlag = false @@ -25,14 +25,12 @@ export default class RenameConnectedAccount extends FireblocksBaseCommand { static method = 'POST' static path = '/v1/connected_accounts/{accountId}/rename' - static isBeta = true + static isBeta = false static responseHeaders: string[] = ["X-Request-ID"] async run(): Promise { const {flags} = await this.parse(RenameConnectedAccount) - this.logToStderr('Warning: This command is in beta and may change in future releases.') - let body: Record | undefined if (flags.data) { try { diff --git a/src/commands/connected-accounts/sync-connected-account-allowlist.ts b/src/commands/connected-accounts/sync-connected-account-allowlist.ts index 1f48b97..1e02935 100644 --- a/src/commands/connected-accounts/sync-connected-account-allowlist.ts +++ b/src/commands/connected-accounts/sync-connected-account-allowlist.ts @@ -4,7 +4,7 @@ import {FireblocksBaseCommand} from '../../lib/base-command.js' export default class SyncConnectedAccountAllowlist extends FireblocksBaseCommand { static summary = 'Sync allowlist for connected account' - static description = 'Triggers an on-demand sync from the exchange, bypassing the cache and fetching live data immediately.\n\n**Rate limit:** 1 request per minute per connected account.\n\n**Note:** This endpoint is currently in beta and might be subject to changes. Currently supports CoinbaseExchange/Binance accounts only.\n\nOperation ID: syncConnectedAccountAllowlist\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/syncConnectedAccountAllowlist' + static description = 'Triggers an on-demand sync from the exchange, bypassing the cache and fetching live data immediately.\n\n**Rate limit:** 1 request per minute per connected account.\n\n**Note:** Currently supports CoinbaseExchange/Binance accounts only.\n\nOperation ID: syncConnectedAccountAllowlist\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/syncConnectedAccountAllowlist' static enableJsonFlag = false @@ -21,14 +21,12 @@ export default class SyncConnectedAccountAllowlist extends FireblocksBaseCommand static method = 'POST' static path = '/v1/connected_accounts/{accountId}/allowlist/sync' - static isBeta = true + static isBeta = false static responseHeaders: string[] = ["X-Request-ID"] async run(): Promise { const {flags} = await this.parse(SyncConnectedAccountAllowlist) - this.logToStderr('Warning: This command is in beta and may change in future releases.') - const headers: Record = {} if (flags['idempotency-key']) { diff --git a/src/commands/connected-accounts/update-connected-account-credentials.ts b/src/commands/connected-accounts/update-connected-account-credentials.ts index c28eb56..de106a5 100644 --- a/src/commands/connected-accounts/update-connected-account-credentials.ts +++ b/src/commands/connected-accounts/update-connected-account-credentials.ts @@ -4,7 +4,7 @@ import {FireblocksBaseCommand} from '../../lib/base-command.js' export default class UpdateConnectedAccountCredentials extends FireblocksBaseCommand { static summary = 'Update connected account credentials' - static description = 'Replace the API credentials (secret + API key) of a connected account.\n\nCredentials belong to an API key, which can back a single account or an entire hierarchy.\nUpdating them affects all accounts sharing that key, so the endpoint returns an array of modified accounts.\n\nThe \`creds\` field must be a Base64-encoded RSA-encrypted credential blob; use\n\`GET /connected_accounts/credentials/public_key\` to retrieve the public key for encryption.\nBoth \`creds\` and \`apiKey\` are mandatory.\n\nValidation against the exchange is synchronous, but the update itself is **pending mobile\napproval** — the existing credentials stay live until the change is approved, so none of the\naffected accounts are disconnected in the meantime.\n\nEndpoint Permission: Admin, Non-Signing Admin.\n\n**Note:** This endpoint is currently in beta and might be subject to changes.\n\nOperation ID: updateConnectedAccountCredentials\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/updateConnectedAccountCredentials' + static description = 'Replace the API credentials (secret + API key) of a connected account.\n\nCredentials belong to an API key, which can back a single account or an entire hierarchy.\nUpdating them affects all accounts sharing that key, so the endpoint returns an array of modified accounts.\n\nThe \`creds\` field must be a Base64-encoded RSA-encrypted credential blob; use\n\`GET /connected_accounts/credentials/public_key\` to retrieve the public key for encryption.\nBoth \`creds\` and \`apiKey\` are mandatory.\n\nValidation against the exchange is synchronous, but the update itself is **pending mobile\napproval** — the existing credentials stay live until the change is approved, so none of the\naffected accounts are disconnected in the meantime.\n\nEndpoint Permission: Admin, Non-Signing Admin.\n\nOperation ID: updateConnectedAccountCredentials\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Connected%20Accounts/updateConnectedAccountCredentials' static enableJsonFlag = false @@ -25,14 +25,12 @@ export default class UpdateConnectedAccountCredentials extends FireblocksBaseCom static method = 'POST' static path = '/v1/connected_accounts/{accountId}/credentials' - static isBeta = true + static isBeta = false static responseHeaders: string[] = ["X-Request-ID"] async run(): Promise { const {flags} = await this.parse(UpdateConnectedAccountCredentials) - this.logToStderr('Warning: This command is in beta and may change in future releases.') - let body: Record | undefined if (flags.data) { try { diff --git a/src/commands/console-user/delete-console-user.ts b/src/commands/console-user/delete-console-user.ts new file mode 100644 index 0000000..1e1fc46 --- /dev/null +++ b/src/commands/console-user/delete-console-user.ts @@ -0,0 +1,59 @@ +import {Flags} from '@oclif/core' +import {FireblocksBaseCommand} from '../../lib/base-command.js' + +export default class DeleteConsoleUser extends FireblocksBaseCommand { + static summary = 'Request deletion of a console user' + + static description = 'Requests deletion of a console user. The request is asynchronous: it goes through the workspace\'s configured "Delete users" approval policy (Settings > Quorums), exactly as deleting a user from the console does, and the user is removed only once that approval completes.\n- Track progress by polling GET /management/users; deletion is complete when the user is disabled.\n- Please note that this endpoint is available only for API keys with Admin/Non Signing Admin permissions.\nEndpoint Permission: Admin, Non-Signing Admin.\n**Note:** This endpoint is currently in beta and might be subject to changes.\n\nOperation ID: deleteConsoleUser\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Console%20User/deleteConsoleUser' + + static enableJsonFlag = false + + static flags = { + 'id': Flags.string({ + description: 'The ID of the console user to delete', + required: true, + }), + 'force': Flags.boolean({ + description: 'Acknowledges the impact of removing this user and proceeds anyway. Overrides both USER_REFERENCED_IN_TAP and QUORUM_INTEGRITY, the same way the acknowledgement checkbox does in the console.', + default: false, + }), + 'include-headers': Flags.boolean({ + description: 'Include spec-defined response headers in output', + default: false, + }), + } + + static method = 'DELETE' + static path = '/v1/management/users/{id}' + static isBeta = false + static responseHeaders: string[] = ["X-Request-ID"] + + async run(): Promise { + const {flags} = await this.parse(DeleteConsoleUser) + + + const headers: Record = {} + + const pathParams: Record = {} + pathParams['id'] = String(flags['id']) + + const queryParams: Record = {} + if (flags['force'] !== undefined && flags['force'] !== null) { + queryParams['force'] = String(flags['force']) + } + + await this.confirmOrAbort('DELETE', '/v1/management/users/{id}') + + const result = await this.makeRequest( + 'DELETE', + '/v1/management/users/{id}', + { + headers, + pathParams, + queryParams, + }, + ) + + return result + } +} diff --git a/src/commands/utxo-management/get-utxo-selection-config.ts b/src/commands/utxo-management/get-utxo-selection-config.ts new file mode 100644 index 0000000..29bbfef --- /dev/null +++ b/src/commands/utxo-management/get-utxo-selection-config.ts @@ -0,0 +1,43 @@ +import {Flags} from '@oclif/core' +import {FireblocksBaseCommand} from '../../lib/base-command.js' + +export default class GetUtxoSelectionConfig extends FireblocksBaseCommand { + static summary = 'Get UTXO selection config' + + static description = 'Returns the workspace-level configured selection strategy and the effective strategy after runtime resolution. \`ADAPTIVE\` is the recommended strategy. When no row is stored (source \`DEFAULT\`), \`effective\` is \`ADAPTIVE\` if adaptive selection is serving for this workspace, otherwise \`ASC\`.\n**Note:** These endpoints are currently in beta and might be subject to changes.\nEndpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer.\n\nOperation ID: getUtxoSelectionConfig\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/UTXO%20Management/getUtxoSelectionConfig' + + static enableJsonFlag = false + + static flags = { + 'include-headers': Flags.boolean({ + description: 'Include spec-defined response headers in output', + default: false, + }), + } + + static method = 'GET' + static path = '/v1/utxo_management/selection_config' + static isBeta = true + static responseHeaders: string[] = ["X-Request-ID"] + + async run(): Promise { + const {flags} = await this.parse(GetUtxoSelectionConfig) + + this.logToStderr('Warning: This command is in beta and may change in future releases.') + + + const headers: Record = {} + + + + const result = await this.makeRequest( + 'GET', + '/v1/utxo_management/selection_config', + { + headers, + }, + ) + + return result + } +} diff --git a/src/commands/utxo-management/get-vault-asset-utxo-selection-config.ts b/src/commands/utxo-management/get-vault-asset-utxo-selection-config.ts new file mode 100644 index 0000000..7c4579d --- /dev/null +++ b/src/commands/utxo-management/get-vault-asset-utxo-selection-config.ts @@ -0,0 +1,43 @@ +import {Flags} from '@oclif/core' +import {FireblocksBaseCommand} from '../../lib/base-command.js' + +export default class GetVaultAssetUtxoSelectionConfig extends FireblocksBaseCommand { + static summary = 'Get vault and asset UTXO selection config' + + static description = 'Returns the config stored at this vault-and-asset scope, if any, and the effective strategy after workspace fallback and runtime resolution. \`ADAPTIVE\` is the recommended strategy. When no row is stored at this scope and none is inherited from the workspace (source \`DEFAULT\`), \`effective\` is \`ADAPTIVE\` if adaptive selection is serving for this scope, otherwise \`ASC\`.\n**Note:** These endpoints are currently in beta and might be subject to changes.\nEndpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor, Viewer.\n\nOperation ID: getVaultAssetUtxoSelectionConfig\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/UTXO%20Management/getVaultAssetUtxoSelectionConfig' + + static enableJsonFlag = false + + static flags = { + 'include-headers': Flags.boolean({ + description: 'Include spec-defined response headers in output', + default: false, + }), + } + + static method = 'GET' + static path = '/v1/utxo_management/{vaultAccountId}/{assetId}/selection_config' + static isBeta = true + static responseHeaders: string[] = ["X-Request-ID"] + + async run(): Promise { + const {flags} = await this.parse(GetVaultAssetUtxoSelectionConfig) + + this.logToStderr('Warning: This command is in beta and may change in future releases.') + + + const headers: Record = {} + + + + const result = await this.makeRequest( + 'GET', + '/v1/utxo_management/{vaultAccountId}/{assetId}/selection_config', + { + headers, + }, + ) + + return result + } +} diff --git a/src/commands/utxo-management/update-utxo-labels.ts b/src/commands/utxo-management/update-utxo-labels.ts index 85c96d9..42763eb 100644 --- a/src/commands/utxo-management/update-utxo-labels.ts +++ b/src/commands/utxo-management/update-utxo-labels.ts @@ -4,7 +4,7 @@ import {FireblocksBaseCommand} from '../../lib/base-command.js' export default class UpdateUtxoLabels extends FireblocksBaseCommand { static summary = 'Attach or detach labels to/from UTXOs' - static description = 'Attach or detach labels to/from UTXOs in a vault account. Labels can be used for organizing and filtering UTXOs.\nLabels are applied additively — \`labelsToAttach\` adds to the existing label set and \`labelsToDetach\` removes from it. Neither operation replaces the full set.\n**Note:** These endpoints are currently in beta and might be subject to changes.\nEndpoint Permission: Admin, Non-Signing Admin, Signer, Approver, Editor.\n\nOperation ID: updateUtxoLabels\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/UTXO%20Management/updateUtxoLabels' + static description = 'Attach or detach labels to/from UTXOs in a vault account. Labels can be\nused for organizing and filtering UTXOs.\n\nLabels are applied additively — \`labelsToAttach\` adds to the existing\nlabel set and \`labelsToDetach\` removes from it. Neither operation\nreplaces the full set.\n\nThe request is all-or-nothing: if any identifier cannot be labelled, no\nUTXO is labelled and the request fails with \`400\`. The response lists\nevery failed identifier in \`failures\`, each with its own \`reason\` — use\nit, not the status, to decide what to do:\n- \`NOT_FOUND\` — not found in this vault and asset.\n- \`NOT_LABELLABLE\` — spent, or removed, and can no longer be labelled.\n\nA UTXO removed within the last hour is reported as \`NOT_FOUND\` with\n\`utxoStatus: REMOVED\`; if it does not reappear, it becomes\n\`NOT_LABELLABLE\` after about an hour. A \`400\` without \`failures\` means\nthe request itself is malformed.\n\n**Note:** These endpoints are currently in beta and might be subject to\nchanges.\n\nEndpoint Permission: Admin, Non-Signing Admin, Signer, Approver,\nEditor.\n\nOperation ID: updateUtxoLabels\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/UTXO%20Management/updateUtxoLabels' static enableJsonFlag = false diff --git a/src/commands/utxo-management/upsert-utxo-selection-config.ts b/src/commands/utxo-management/upsert-utxo-selection-config.ts new file mode 100644 index 0000000..7bc5f54 --- /dev/null +++ b/src/commands/utxo-management/upsert-utxo-selection-config.ts @@ -0,0 +1,65 @@ +import {Flags} from '@oclif/core' +import {FireblocksBaseCommand} from '../../lib/base-command.js' + +export default class UpsertUtxoSelectionConfig extends FireblocksBaseCommand { + static summary = 'Upsert UTXO selection config' + + static description = 'Creates or updates the workspace-level UTXO selection strategy. \`ADAPTIVE\` is recommended.\n**Note:** These endpoints are currently in beta and might be subject to changes.\nEndpoint Permission: Admin, Non-Signing Admin.\n\nOperation ID: upsertUtxoSelectionConfig\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/UTXO%20Management/upsertUtxoSelectionConfig' + + static enableJsonFlag = false + + static flags = { + data: Flags.string({ + description: 'JSON request body', + required: true, + }), + 'include-headers': Flags.boolean({ + description: 'Include spec-defined response headers in output', + default: false, + }), + } + + static method = 'PUT' + static path = '/v1/utxo_management/selection_config' + static isBeta = true + static responseHeaders: string[] = ["X-Request-ID"] + + async run(): Promise { + const {flags} = await this.parse(UpsertUtxoSelectionConfig) + + this.logToStderr('Warning: This command is in beta and may change in future releases.') + + let body: Record | undefined + if (flags.data) { + try { + const parsed = JSON.parse(flags.data) + if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) { + this.error('--data must be a JSON object (e.g., \'{"key": "value"}\')') + } + body = parsed as Record + } catch { + this.error('Invalid JSON in --data flag. Ensure the value is valid JSON.') + } + } + + const headers: Record = {} + if (flags['idempotency-key']) { + headers['Idempotency-Key'] = flags['idempotency-key'] + } + + + + await this.confirmOrAbort('PUT', '/v1/utxo_management/selection_config') + + const result = await this.makeRequest( + 'PUT', + '/v1/utxo_management/selection_config', + { + body, + headers, + }, + ) + + return result + } +} diff --git a/src/commands/utxo-management/upsert-vault-asset-utxo-selection-config.ts b/src/commands/utxo-management/upsert-vault-asset-utxo-selection-config.ts new file mode 100644 index 0000000..a2399b8 --- /dev/null +++ b/src/commands/utxo-management/upsert-vault-asset-utxo-selection-config.ts @@ -0,0 +1,65 @@ +import {Flags} from '@oclif/core' +import {FireblocksBaseCommand} from '../../lib/base-command.js' + +export default class UpsertVaultAssetUtxoSelectionConfig extends FireblocksBaseCommand { + static summary = 'Upsert vault and asset UTXO selection config' + + static description = 'Creates or updates the UTXO selection strategy for this vault account and asset. \`ADAPTIVE\` is recommended.\n**Note:** These endpoints are currently in beta and might be subject to changes.\nEndpoint Permission: Admin, Non-Signing Admin.\n\nOperation ID: upsertVaultAssetUtxoSelectionConfig\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/UTXO%20Management/upsertVaultAssetUtxoSelectionConfig' + + static enableJsonFlag = false + + static flags = { + data: Flags.string({ + description: 'JSON request body', + required: true, + }), + 'include-headers': Flags.boolean({ + description: 'Include spec-defined response headers in output', + default: false, + }), + } + + static method = 'PUT' + static path = '/v1/utxo_management/{vaultAccountId}/{assetId}/selection_config' + static isBeta = true + static responseHeaders: string[] = ["X-Request-ID"] + + async run(): Promise { + const {flags} = await this.parse(UpsertVaultAssetUtxoSelectionConfig) + + this.logToStderr('Warning: This command is in beta and may change in future releases.') + + let body: Record | undefined + if (flags.data) { + try { + const parsed = JSON.parse(flags.data) + if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) { + this.error('--data must be a JSON object (e.g., \'{"key": "value"}\')') + } + body = parsed as Record + } catch { + this.error('Invalid JSON in --data flag. Ensure the value is valid JSON.') + } + } + + const headers: Record = {} + if (flags['idempotency-key']) { + headers['Idempotency-Key'] = flags['idempotency-key'] + } + + + + await this.confirmOrAbort('PUT', '/v1/utxo_management/{vaultAccountId}/{assetId}/selection_config') + + const result = await this.makeRequest( + 'PUT', + '/v1/utxo_management/{vaultAccountId}/{assetId}/selection_config', + { + body, + headers, + }, + ) + + return result + } +} diff --git a/src/commands/webhooks-v2/create-webhook-mtls-config.ts b/src/commands/webhooks-v2/create-webhook-mtls-config.ts new file mode 100644 index 0000000..f60a30b --- /dev/null +++ b/src/commands/webhooks-v2/create-webhook-mtls-config.ts @@ -0,0 +1,63 @@ +import {Flags} from '@oclif/core' +import {FireblocksBaseCommand} from '../../lib/base-command.js' + +export default class CreateWebhookMtlsConfig extends FireblocksBaseCommand { + static summary = 'Create an mTLS configuration' + + static description = 'Stores a certificate signed against the CSR from \`GET /v1/webhooks_settings/mtls_csr\` and returns its id, which is then set as \`webhookMtlsId\` on a webhook or on OAuth credentials. The private key the certificate was issued for is derived from the certificate, so it is never named by the caller.\n\nRe-uploading a certificate already stored returns the existing id rather than creating a second configuration, so several webhooks and OAuth credentials can share one certificate.\n\nA certificate that was not issued for a private key this workspace holds is rejected with a \`400\`.\n\n**Endpoint Permissions:** Owner, Admin, Non-Signing Admin.\n\nOperation ID: createWebhookMtlsConfig\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Webhooks%20V2/createWebhookMtlsConfig' + + static enableJsonFlag = false + + static flags = { + data: Flags.string({ + description: 'JSON request body', + required: true, + }), + 'include-headers': Flags.boolean({ + description: 'Include spec-defined response headers in output', + default: false, + }), + } + + static method = 'POST' + static path = '/v1/webhooks_settings/mtls' + static isBeta = false + static responseHeaders: string[] = ["X-Request-ID"] + + async run(): Promise { + const {flags} = await this.parse(CreateWebhookMtlsConfig) + + let body: Record | undefined + if (flags.data) { + try { + const parsed = JSON.parse(flags.data) + if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) { + this.error('--data must be a JSON object (e.g., \'{"key": "value"}\')') + } + body = parsed as Record + } catch { + this.error('Invalid JSON in --data flag. Ensure the value is valid JSON.') + } + } + + const headers: Record = {} + if (flags['idempotency-key']) { + headers['Idempotency-Key'] = flags['idempotency-key'] + } + + + + await this.confirmOrAbort('POST', '/v1/webhooks_settings/mtls') + + const result = await this.makeRequest( + 'POST', + '/v1/webhooks_settings/mtls', + { + body, + headers, + }, + ) + + return result + } +} diff --git a/src/commands/webhooks-v2/delete-webhook-mtls-config.ts b/src/commands/webhooks-v2/delete-webhook-mtls-config.ts new file mode 100644 index 0000000..2cbc05e --- /dev/null +++ b/src/commands/webhooks-v2/delete-webhook-mtls-config.ts @@ -0,0 +1,59 @@ +import {Flags} from '@oclif/core' +import {FireblocksBaseCommand} from '../../lib/base-command.js' + +export default class DeleteWebhookMtlsConfig extends FireblocksBaseCommand { + static summary = 'Delete an mTLS configuration' + + static description = 'Deletes an mTLS configuration. By default the delete is refused while the configuration is still in use: if any webhook or OAuth credentials reference it, nothing is deleted and the request fails with \`409 Conflict\`, naming the reason and listing the ids of what references it. This protects a shared configuration from being removed out from under the webhooks and token requests that depend on it.\n\nPass \`forceDelete=true\` to delete anyway. That detaches everything referencing it — it clears \`webhookMtlsId\` on each webhook and OAuth credentials, it does **not** delete them — then deletes the configuration and returns the deleted resource together with \`detachedWebhookIds\` and \`detachedWebhookOauthIds\`. Detached webhooks keep delivering notifications, and detached OAuth credentials keep requesting tokens, but without a client certificate, so an endpoint that requires mTLS will reject them from that point on.\n\nWhen nothing references the configuration the delete succeeds either way, and both lists come back empty.\n\n**Endpoint Permissions:** Owner, Admin, Non-Signing Admin.\n\nOperation ID: deleteWebhookMtlsConfig\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Webhooks%20V2/deleteWebhookMtlsConfig' + + static enableJsonFlag = false + + static flags = { + 'webhook-mtls-id': Flags.string({ + description: 'The unique identifier of the mTLS configuration', + required: true, + }), + 'force-delete': Flags.boolean({ + description: 'Delete the configuration even while webhooks or OAuth credentials still reference it, detaching them instead of refusing; their ids are returned in \`detachedWebhookIds\` and \`detachedWebhookOauthIds\`. Leave it unset, or \`false\`, to get a \`409 Conflict\` whenever anything still references the configuration.', + default: false, + }), + 'include-headers': Flags.boolean({ + description: 'Include spec-defined response headers in output', + default: false, + }), + } + + static method = 'DELETE' + static path = '/v1/webhooks_settings/mtls/{webhookMtlsId}' + static isBeta = false + static responseHeaders: string[] = ["X-Request-ID"] + + async run(): Promise { + const {flags} = await this.parse(DeleteWebhookMtlsConfig) + + + const headers: Record = {} + + const pathParams: Record = {} + pathParams['webhookMtlsId'] = String(flags['webhook-mtls-id']) + + const queryParams: Record = {} + if (flags['force-delete'] !== undefined && flags['force-delete'] !== null) { + queryParams['forceDelete'] = String(flags['force-delete']) + } + + await this.confirmOrAbort('DELETE', '/v1/webhooks_settings/mtls/{webhookMtlsId}') + + const result = await this.makeRequest( + 'DELETE', + '/v1/webhooks_settings/mtls/{webhookMtlsId}', + { + headers, + pathParams, + queryParams, + }, + ) + + return result + } +} diff --git a/src/commands/webhooks-v2/get-webhook-mtls-config.ts b/src/commands/webhooks-v2/get-webhook-mtls-config.ts new file mode 100644 index 0000000..d1b93d1 --- /dev/null +++ b/src/commands/webhooks-v2/get-webhook-mtls-config.ts @@ -0,0 +1,48 @@ +import {Flags} from '@oclif/core' +import {FireblocksBaseCommand} from '../../lib/base-command.js' + +export default class GetWebhookMtlsConfig extends FireblocksBaseCommand { + static summary = 'Get an mTLS configuration by id' + + static description = 'Retrieve one stored mTLS configuration by its id.\n\nOperation ID: getWebhookMtlsConfig\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Webhooks%20V2/getWebhookMtlsConfig' + + static enableJsonFlag = false + + static flags = { + 'webhook-mtls-id': Flags.string({ + description: 'The unique identifier of the mTLS configuration', + required: true, + }), + 'include-headers': Flags.boolean({ + description: 'Include spec-defined response headers in output', + default: false, + }), + } + + static method = 'GET' + static path = '/v1/webhooks_settings/mtls/{webhookMtlsId}' + static isBeta = false + static responseHeaders: string[] = ["X-Request-ID"] + + async run(): Promise { + const {flags} = await this.parse(GetWebhookMtlsConfig) + + + const headers: Record = {} + + const pathParams: Record = {} + pathParams['webhookMtlsId'] = String(flags['webhook-mtls-id']) + + + const result = await this.makeRequest( + 'GET', + '/v1/webhooks_settings/mtls/{webhookMtlsId}', + { + headers, + pathParams, + }, + ) + + return result + } +} diff --git a/src/commands/webhooks-v2/get-webhook-mtls-configs.ts b/src/commands/webhooks-v2/get-webhook-mtls-configs.ts new file mode 100644 index 0000000..fab3e86 --- /dev/null +++ b/src/commands/webhooks-v2/get-webhook-mtls-configs.ts @@ -0,0 +1,49 @@ +import {Flags} from '@oclif/core' +import {FireblocksBaseCommand} from '../../lib/base-command.js' + +export default class GetWebhookMtlsConfigs extends FireblocksBaseCommand { + static summary = 'List the uploaded mTLS configurations' + + static description = 'Lists the workspace\'s mTLS configurations, newest first. Pass \`ids\` to ask about\nparticular ones instead — useful for resolving the \`webhookMtlsId\` values on a set of\nwebhooks in one call.\n\nOperation ID: getWebhookMtlsConfigs\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Webhooks%20V2/getWebhookMtlsConfigs' + + static enableJsonFlag = false + + static flags = { + 'ids': Flags.string({ + description: 'Return only the configurations with these ids, instead of all of them. Repeat the parameter for each id. An id belonging to another workspace, or to nothing, is left out of the response rather than failing the request.', + }), + 'include-headers': Flags.boolean({ + description: 'Include spec-defined response headers in output', + default: false, + }), + } + + static method = 'GET' + static path = '/v1/webhooks_settings/mtls' + static isBeta = false + static responseHeaders: string[] = ["X-Request-ID"] + + async run(): Promise { + const {flags} = await this.parse(GetWebhookMtlsConfigs) + + + const headers: Record = {} + + + const queryParams: Record = {} + if (flags['ids'] !== undefined && flags['ids'] !== null) { + queryParams['ids'] = String(flags['ids']) + } + + const result = await this.makeRequest( + 'GET', + '/v1/webhooks_settings/mtls', + { + headers, + queryParams, + }, + ) + + return result + } +} diff --git a/src/commands/webhooks-v2/update-webhook-mtls-config.ts b/src/commands/webhooks-v2/update-webhook-mtls-config.ts new file mode 100644 index 0000000..6f6ecfd --- /dev/null +++ b/src/commands/webhooks-v2/update-webhook-mtls-config.ts @@ -0,0 +1,67 @@ +import {Flags} from '@oclif/core' +import {FireblocksBaseCommand} from '../../lib/base-command.js' + +export default class UpdateWebhookMtlsConfig extends FireblocksBaseCommand { + static summary = 'Update an mTLS configuration' + + static description = 'Renames a configuration, replaces its certificate, or both. Only the fields present in the request are changed; anything omitted is left as it is, and a request with neither field is rejected with a \`400\`.\n\nReplacing \`signedCert\` switches every webhook and OAuth credentials set using this configuration over to the new certificate in one write, and the private key it was issued for is re-derived from the certificate. A replacement that was not issued for a private key this workspace holds is rejected with a \`400\`.\n\nSending \`name: null\` removes the label.\n\n**Endpoint Permissions:** Owner, Admin, Non-Signing Admin.\n\nOperation ID: updateWebhookMtlsConfig\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Webhooks%20V2/updateWebhookMtlsConfig' + + static enableJsonFlag = false + + static flags = { + 'webhook-mtls-id': Flags.string({ + description: 'The unique identifier of the mTLS configuration', + required: true, + }), + data: Flags.string({ + description: 'JSON request body', + required: true, + }), + 'include-headers': Flags.boolean({ + description: 'Include spec-defined response headers in output', + default: false, + }), + } + + static method = 'PATCH' + static path = '/v1/webhooks_settings/mtls/{webhookMtlsId}' + static isBeta = false + static responseHeaders: string[] = ["X-Request-ID"] + + async run(): Promise { + const {flags} = await this.parse(UpdateWebhookMtlsConfig) + + let body: Record | undefined + if (flags.data) { + try { + const parsed = JSON.parse(flags.data) + if (typeof parsed !== 'object' || parsed === null || Array.isArray(parsed)) { + this.error('--data must be a JSON object (e.g., \'{"key": "value"}\')') + } + body = parsed as Record + } catch { + this.error('Invalid JSON in --data flag. Ensure the value is valid JSON.') + } + } + + const headers: Record = {} + + const pathParams: Record = {} + pathParams['webhookMtlsId'] = String(flags['webhook-mtls-id']) + + + await this.confirmOrAbort('PATCH', '/v1/webhooks_settings/mtls/{webhookMtlsId}') + + const result = await this.makeRequest( + 'PATCH', + '/v1/webhooks_settings/mtls/{webhookMtlsId}', + { + body, + headers, + pathParams, + }, + ) + + return result + } +} diff --git a/src/commands/webhooks-v2/update-webhook-oauth.ts b/src/commands/webhooks-v2/update-webhook-oauth.ts index 04b9887..b1a333d 100644 --- a/src/commands/webhooks-v2/update-webhook-oauth.ts +++ b/src/commands/webhooks-v2/update-webhook-oauth.ts @@ -4,7 +4,7 @@ import {FireblocksBaseCommand} from '../../lib/base-command.js' export default class UpdateWebhookOauth extends FireblocksBaseCommand { static summary = 'Update OAuth credentials' - static description = 'Updates only the fields present in the request; anything omitted is left as it is. Sending \`clientSecret\` on its own rotates the secret for every webhook using these credentials.\n\n\`customJwtClaims\`, \`customBodyParams\` and \`customHeaders\` are all merged key by key rather than replaced, the same way a webhook\'s own \`customHeaders\` behaves: a key sent with a value is added or overwritten, a key sent with a \`null\` value is deleted, and a key you omit is left alone. Setting one of the three to \`null\` as a whole clears that map, which is the quick way to empty it without naming every key. There is no ambiguity between the two uses of \`null\` — one names an entry to delete, the other names the field. A claim cannot be set to JSON \`null\`, though, on this endpoint or on create, because \`null\` is spent on deletion. \`mtlsClientSignedCert\` is a scalar rather than a map, so \`null\` there does remove it.\n\n**Endpoint Permissions:** Owner, Admin, Non-Signing Admin.\n\nOperation ID: updateWebhookOauth\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Webhooks%20V2/updateWebhookOauth' + static description = 'Updates only the fields present in the request; anything omitted is left as it is. Sending \`clientSecret\` on its own rotates the secret for every webhook using these credentials.\n\n\`customJwtClaims\`, \`customBodyParams\` and \`customHeaders\` are all merged key by key rather than replaced, the same way a webhook\'s own \`customHeaders\` behaves: a key sent with a value is added or overwritten, a key sent with a \`null\` value is deleted, and a key you omit is left alone. Setting one of the three to \`null\` as a whole clears that map, which is the quick way to empty it without naming every key. There is no ambiguity between the two uses of \`null\` — one names an entry to delete, the other names the field. A claim cannot be set to JSON \`null\`, though, on this endpoint or on create, because \`null\` is spent on deletion. \`webhookMtlsId\` is a scalar rather than a map, so \`null\` there does remove it.\n\n**Endpoint Permissions:** Owner, Admin, Non-Signing Admin.\n\nOperation ID: updateWebhookOauth\nDocs: https://docs.fireblocks.com/api/swagger-ui/#/Webhooks%20V2/updateWebhookOauth' static enableJsonFlag = false diff --git a/yarn.lock b/yarn.lock index 7dae819..bcb5eca 100644 --- a/yarn.lock +++ b/yarn.lock @@ -14,9 +14,9 @@ tslib "^2.6.2" "@aws-sdk/client-cloudfront@^3.1079.0": - version "3.1124.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-cloudfront/-/client-cloudfront-3.1124.0.tgz#926a51fc10b921f76910a7953f9276844c9d751a" - integrity sha512-eCTPtU83/AkZK51LnUG4mMTiog6ojkdhQCT7Ilc76rowtREPAZJem2AIUS2r3Qrm2+mhWWvU1kF3j1l1UoDt4A== + version "3.1128.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-cloudfront/-/client-cloudfront-3.1128.0.tgz#85bd25c86ac1be6818915073080b38174caad7e3" + integrity sha512-/4DqkE+dBITlO2ap2NuvjRQmUZKo6ZpNfEmt46O8+WkDXMmPHjU5jvw55X2g+e1DI/hcgikf/SK8m4d9LctKkw== dependencies: "@aws-sdk/core" "^3.977.9" "@aws-sdk/credential-provider-node" "^3.972.82" @@ -28,9 +28,9 @@ tslib "^2.6.2" "@aws-sdk/client-s3@^3.1079.0": - version "3.1124.0" - resolved "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.1124.0.tgz#d502425a2b259ae4511b88794aaf4c03a077f676" - integrity sha512-f20BksgVlXufcf/mijde1LAjwM/iSDdG3mGtN3yRFOUzXtlFEOjxNi1Rf2Kb+rSgoiOSpO0hUOna9Bs+J1gX2A== + version "3.1128.0" + resolved "https://registry.npmjs.org/@aws-sdk/client-s3/-/client-s3-3.1128.0.tgz#44c28522e0d9a350a1470dd167bcfa55a73be237" + integrity sha512-tYEB4058LdhTiSS7sCVVSpqSAdjIc1jTaf1dDPoIRJbR/XI5A2ZOuCiV1Aebo/pria/pUJBOT0WjdZVIwaZtDA== dependencies: "@aws-sdk/checksums" "^3.1000.29" "@aws-sdk/core" "^3.977.9" @@ -1258,21 +1258,21 @@ tslib "^2.6.2" "@smithy/fetch-http-handler@^5.7.2": - version "5.7.2" - resolved "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.7.2.tgz#29e95cd74fe91495225e26a60569617fecae48cc" - integrity sha512-nZyWTmSpJEXl6VtWVMBJve/7x12DZu6sIX1z1a+ZMaHlQQRs9Zpu6NbTe/gmxYXVRpkjxyDYpZ5gx2IM6f/Wkw== + version "5.8.0" + resolved "https://registry.npmjs.org/@smithy/fetch-http-handler/-/fetch-http-handler-5.8.0.tgz#349464e31682d739a74efa42362756be49eb2883" + integrity sha512-ycSJu3tFAQ4v04CBB0agqFMVsSQ1iG3yw+SpgxRqKfaURpQD4CZ8Wn0zPMmSnOuTpTh65Vz+EA0rMrw089wvkA== dependencies: - "@smithy/core" "^3.33.2" - "@smithy/types" "^4.17.2" + "@smithy/core" "^3.33.3" + "@smithy/types" "^4.18.0" tslib "^2.6.2" "@smithy/node-http-handler@^4.11.3": - version "4.12.0" - resolved "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.12.0.tgz#3a45177c595bb832454f44e3c4eadd19f016bcde" - integrity sha512-0mq1pHadfyXCYCqm2cNpbjNIT+fbaUpNxewZb/YNr2L0IrEVMOb8gM/Fl4K6XvHCW3uSNDFwPl/+iKm0bx9jYg== + version "4.12.1" + resolved "https://registry.npmjs.org/@smithy/node-http-handler/-/node-http-handler-4.12.1.tgz#e4da9379d228517ba85845081e4e6758ca315c5d" + integrity sha512-ThMkboGeONWXAelq9FvGsuJC4rOi+qyC4/zhUF58xYpxUg5sQKx2VXZYJmtNjr4dSuBJ1HeJXETQILCz3wOHvw== dependencies: "@smithy/core" "^3.33.3" - "@smithy/types" "^4.17.2" + "@smithy/types" "^4.18.0" tslib "^2.6.2" "@smithy/signature-v4@^5.6.12": @@ -1284,10 +1284,10 @@ "@smithy/types" "^4.17.2" tslib "^2.6.2" -"@smithy/types@^4.17.2": - version "4.17.2" - resolved "https://registry.npmjs.org/@smithy/types/-/types-4.17.2.tgz#ad71f6f62460a6409f0e8efc173e2e0f883ea4e6" - integrity sha512-FOKpVZob9MPTn2znRzGrnsMHv7BOsKVw3XiP/cOyYLDVZ9qKp4nifIiSCuUU/fIj5Vu0UOAxCFr+qRAtG0NUkA== +"@smithy/types@^4.17.2", "@smithy/types@^4.18.0": + version "4.18.0" + resolved "https://registry.npmjs.org/@smithy/types/-/types-4.18.0.tgz#f68aca5b5e39f1f9def3827224e4a1e43d233347" + integrity sha512-CgB6HHWer/vrKps24ulRIbpcpb7K4xAU7SkZ7YHzBPlwHsvsrCJFEXK421s+cJzX+ZrqtA/TuU5w1HzI7k9N8A== dependencies: tslib "^2.6.2" @@ -1403,11 +1403,11 @@ "@types/node" "*" "@types/node@*": - version "26.4.1" - resolved "https://registry.npmjs.org/@types/node/-/node-26.4.1.tgz#3d8dc80515894958448ee266cf5d6bc3e5205bd5" - integrity sha512-k97ENvZWtvA6yqz5/FS6a7duDgOPEeOQOc2iKS/nY6mX6qJUKtLnWzQS+Xj6tXweyj6ZcTAK2Qecetnvi9nCLA== + version "26.5.0" + resolved "https://registry.npmjs.org/@types/node/-/node-26.5.0.tgz#e6547ac7d7229d92d6e7157a6e19332cd16dc8ef" + integrity sha512-dVSGpriSoCgz8WnDNTuSSuSv1PC/ALXihO4ulRZt7Md8k9mlbdin3lGOcDE8SnWOgf513ByWlXd7BK4azmyg/A== dependencies: - undici-types "~8.3.0" + undici-types "~8.9.0" "@types/node@^22", "@types/node@^22.5.5": version "22.20.1" @@ -1589,10 +1589,10 @@ balanced-match@^4.0.2: resolved "https://registry.npmjs.org/balanced-match/-/balanced-match-4.0.4.tgz#bfb10662feed8196a2c62e7c68e17720c274179a" integrity sha512-BLrgEcRTwX2o6gGxGOCNyMvGSp35YofuYzw9h1IMTRmKqttAZZVU67bdb9Pr2vUHA8+j3i2tJfjO6C6+4myGTA== -baseline-browser-mapping@^2.11.12: - version "2.11.20" - resolved "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.20.tgz#26078c7a4b08299656ea7ddceaebec955dc44303" - integrity sha512-H0ulySigv6icDJ1F7SjtdCD6PrhTpdYCmP0CactWy1+ekh0AFd0o1Wn5T8b+hnTmdBx19u9yhL6wvCylXMY7zw== +baseline-browser-mapping@^2.11.20: + version "2.11.21" + resolved "https://registry.npmjs.org/baseline-browser-mapping/-/baseline-browser-mapping-2.11.21.tgz#99af73cb8e54007e4f5345e132278e26c2662f2c" + integrity sha512-uh8vpY/1/YyFkunIDFH/12p7/7VdPKA1hejMVEbdkEaWnUz0Hesvx5EbiU6XxjyHZIOju+ZMbQJkRh+es3/spQ== bowser@^2.11.0: version "2.14.1" @@ -1629,15 +1629,15 @@ braces@^3.0.3: fill-range "^7.1.1" browserslist@^4.24.0: - version "4.28.8" - resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.28.8.tgz#a3c79ceb70028527e5da7dafc887f3200b5168c0" - integrity sha512-V2NpofLblG64mfOtSgDhOJESZEGogzDMBv/q+W6oc4LXWP/q75eOXoOaaOu1EOadB9U4Bwx/e0yzbvwKH8zalA== + version "4.28.9" + resolved "https://registry.npmjs.org/browserslist/-/browserslist-4.28.9.tgz#07ce6b449b90af880eb9bfb7cd39372cc4f71c8c" + integrity sha512-EWazOblFYUvlGZcfGhPUPmYh3nikUxBVb+y9MJun5f3hBi812X+8MSQTujLBtgK3cf51fJWbWfOjyeO954d+Eg== dependencies: - baseline-browser-mapping "^2.11.12" - caniuse-lite "^1.0.30001809" - electron-to-chromium "^1.5.402" - node-releases "^2.0.53" - update-browserslist-db "^1.3.0" + baseline-browser-mapping "^2.11.20" + caniuse-lite "^1.0.30001810" + electron-to-chromium "^1.5.420" + node-releases "^2.0.54" + update-browserslist-db "^1.3.2" bs-logger@^0.2.6: version "0.2.6" @@ -1699,7 +1699,7 @@ camelcase@^6.2.0: resolved "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz#5685b95eb209ac9c0c177467778c9c84df58ba9a" integrity sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA== -caniuse-lite@^1.0.30001809: +caniuse-lite@^1.0.30001810: version "1.0.30001810" resolved "https://registry.npmjs.org/caniuse-lite/-/caniuse-lite-1.0.30001810.tgz#4970b477dea3278374de9bc43aa8f5d39fc3cda2" integrity sha512-TITQPUkaz+aVk5GL6NhOdwk1aEaNTSDPsGFWrTuhKGtjTF70jL/Oht2W4c6rXUe5fu7Ie19VIahAXHIIiWWNeg== @@ -1935,10 +1935,10 @@ ejs@^6: resolved "https://registry.npmjs.org/ejs/-/ejs-6.0.1.tgz#88ea8ce00335c3575d7c3602dd76e84b0bd60f43" integrity sha512-UaaM14yby8U3k02ihS1Bmj5Kz2d7CCQM1scxpgs4Mhkq8F1wR2gl3+Ts4h5Ne4Mnt7M9m4Dw7jsuMr3+xO4vZA== -electron-to-chromium@^1.5.402: - version "1.5.420" - resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.420.tgz#fc66d26a722d6f227e2092acdf38dd55b198cb44" - integrity sha512-2yD6XreGusOfNV+dUcvipJEXc3n/n7fgr7996aszTG+YY5E4mqM4tOq/3uhP129cazL9YHbVWSpc79ePotWtPA== +electron-to-chromium@^1.5.420: + version "1.5.425" + resolved "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.5.425.tgz#7ba6d039fbb547080de3992974f6bf435f0ce705" + integrity sha512-QvPtl41EUOnuT1HBvMKgxXRIaHNcagBPs50u7VULzhZXaGfqTbZyE16LQsctZ/RQHlGu+FOWeDTR4mY6YbeF1g== emittery@^0.13.1: version "0.13.1" @@ -2805,9 +2805,9 @@ jest@^29: jest-cli "^29.7.0" jose@^6.2.1: - version "6.2.10" - resolved "https://registry.npmjs.org/jose/-/jose-6.2.10.tgz#b70436c920c4b3f97314c28a8b8612c15b1d9e7f" - integrity sha512-iiW7J9qRFlGxvCOIBDBDxFePQSn7ZMAnrYGhrrOo6siO/MIqwfyilLR27pkfDgUk+raLuzADS8A3S/KLBisc0g== + version "6.2.12" + resolved "https://registry.npmjs.org/jose/-/jose-6.2.12.tgz#65663e146edd010b98ece83f81737d3aa95fd0d7" + integrity sha512-9NiFmJEex0sy2Dk58j2UGBSHgUs2ypF9eZSu4L6vjOX3Dp96Sw1F3uL+H+D1sx02jZZdzUT0HgvCy59CuvXcWw== js-tokens@^4.0.0: version "4.0.0" @@ -3054,10 +3054,10 @@ node-int64@^0.4.0: resolved "https://registry.npmjs.org/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-releases@^2.0.53: - version "2.0.54" - resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.54.tgz#09af17d5647aa9f221ec5cf2becb95b68a981afe" - integrity sha512-YHs7BmmcsdAI5Ozuf8JZo6PT0mv2GIWC9vMfvUC3dp65M8hn7Ux8CPL+2oBI7juNuj9d0ndhTcznq2ODBps9cQ== +node-releases@^2.0.54: + version "2.0.55" + resolved "https://registry.npmjs.org/node-releases/-/node-releases-2.0.55.tgz#c52faedb68001dcfe77495b5ed1ac5827a1788fc" + integrity sha512-mIrE/Cw9y+9Au6dS5vDKDhQza9YvG6w+ZrS6X+ZzA7yFW/soAeaups4Qzn1bL6g5FVy8WtP79+0j82oPIbqRjQ== normalize-package-data@^6: version "6.0.2" @@ -3682,17 +3682,17 @@ undici-types@~6.21.0: resolved "https://registry.npmjs.org/undici-types/-/undici-types-6.21.0.tgz#691d00af3909be93a7faa13be61b3a5b50ef12cb" integrity sha512-iwDZqg0QAGrg9Rav5H4n0M64c3mkR59cJ6wQp+7C4nI0gsmExaedaYLNO44eT4AtBBwjbTiGPMlt2Md0T9H9JQ== -undici-types@~8.3.0: - version "8.3.0" - resolved "https://registry.npmjs.org/undici-types/-/undici-types-8.3.0.tgz#44e9fc9f3244648cdea35e4f9bb2d681e9410809" - integrity sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ== +undici-types@~8.9.0: + version "8.9.0" + resolved "https://registry.npmjs.org/undici-types/-/undici-types-8.9.0.tgz#e240d97c8b5d85e5347ce73d25865c7906c1ec9f" + integrity sha512-KTDyRTYX8sWmKXAikPHHSyc63CRPETMctyjKFupcC6OBLXT3xsN0e9aF7m+mIXutFWpUXuedtowG7iLOzp0kQg== universalify@^0.1.0: version "0.1.2" resolved "https://registry.npmjs.org/universalify/-/universalify-0.1.2.tgz#b646f69be3942dabcecc9d6639c80dc105efaa66" integrity sha512-rBJeI5CXAlmy1pV+617WB9J63U6XcazHHF2f2dbJix4XzpUF0RS3Zbj0FGIOCAva5P/d/GBOYaACQ1w+0azUkg== -update-browserslist-db@^1.3.0: +update-browserslist-db@^1.3.2: version "1.3.2" resolved "https://registry.npmjs.org/update-browserslist-db/-/update-browserslist-db-1.3.2.tgz#9d99fbff56c50bb11ba5fd35cece5916da595836" integrity sha512-UQ+MSxlhRm1bzjhU+DcuXfjFO1FzNtqhK5+9Yvlp90ItDLk5vT932A0rFu619nf7RVS+Y/VeaUW1jaRDqZ8VJw==