filecoin-pin
Version:
Bridge IPFS content to Filecoin Onchain Cloud using familiar tools
34 lines • 1.73 kB
TypeScript
import { type Command } from 'commander';
export interface MetadataOptionConfig {
includePieceMetadata?: boolean;
includeDataSetMetadata?: boolean;
includeErc8004?: boolean;
}
/**
* Registers metadata-related Commander flags on a CLI command.
* Adds piece-level metadata flags by default, dataset metadata flags (with alias support),
* and optionally ERC-8004 artifact options depending on the provided configuration.
*
* @param command Commander command to augment (mutated in place)
* @param config Controls which categories of metadata flags should be attached
* @returns The same command instance to support fluent configuration
*/
export declare function addMetadataOptions(command: Command, config?: MetadataOptionConfig): Command;
export interface MetadataResolutionConfig {
includeErc8004?: boolean;
}
export interface ResolvedMetadataOptions {
pieceMetadata?: Record<string, string>;
dataSetMetadata?: Record<string, string>;
}
/**
* Converts Commander option values into normalized metadata objects used by upload flows.
* Aggregates `--metadata` and `--data-set-metadata` flags (including aliases), then applies
* `normalizeMetadataConfig` to ensure optional ERC-8004 fields are propagated when requested.
*
* @param options Parsed Commander options, typically the result of `command.opts()`
* @param config Controls whether ERC-8004 parameters should be included in the normalization step
* @returns Metadata maps ready to pass into upload APIs, excluding keys that were not provided
*/
export declare function resolveMetadataOptions(options: Record<string, any>, config?: MetadataResolutionConfig): ResolvedMetadataOptions;
//# sourceMappingURL=cli-options-metadata.d.ts.map