Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,10 @@ On first run, the CLI will open your browser for OAuth authorization. Credential
bitrefill search-products --query "Netflix"

# Get product details
bitrefill get_product_details --product_id "steam-usa" --currency USDC
bitrefill get-product-details --product_id "steam-usa" --currency USDC

# Buy a product
bitrefill buy_products --cart_items '{"product_id": "steam-usa", "package_id": 10}' --payment_method usdc_base
bitrefill buy-products --cart_items '{"product_id": "steam-usa", "package_id": 10}' --payment_method usdc_base

# List your orders
bitrefill list-orders
Expand Down
5 changes: 4 additions & 1 deletion src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -253,8 +253,11 @@ function coerceValue(raw: string, prop: JsonSchemaProperty): unknown {
if (['true', '1', 'yes'].includes(raw)) return true;
if (['false', '0', 'no'].includes(raw)) return false;
throw new Error('Must be true/false');
default:
case 'object':
case 'array':
return JSON.parse(raw);
default:
return raw;
}
}

Expand Down
Loading