npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2025 – Pkg Stats / Ryan Hefner

hs-ucs-config

v1.0.1

Published

CLI tool to configure UCS rollout settings via API

Downloads

105

Readme

UCS Rollout Config CLI

A command-line tool to configure UCS (Unified Connector Service) rollout settings via API.

Installation

Global Installation

npm install -g ucs-rollout-config

Use with npx (No Installation Required)

npx ucs-rollout-config [options]

Local Development

# Clone or navigate to the project directory
npm link

Usage

Basic Syntax

ucs-config --port <port> --merchant-id <id> --connector-name <name> [--shadow]

Required Parameters

  • -p, --port <port> - Port number where the config service is running
  • -m, --merchant-id <id> - Merchant ID for configuration
  • -c, --connector-name <name> - Connector name (e.g., stripe, adyen, etc.)

Optional Parameters

  • -s, --shadow - Enable shadow mode (posts configs with shadow suffix and complex JSON values)
  • --ucs-http-url <url> - UCS HTTP endpoint URL (default: http://localhost:8081)
  • --ucs-https-url <url> - UCS HTTPS endpoint URL (default: https://localhost:8081)
  • --api-key <key> - API key for authentication (default: test_admin)
  • -h, --help - Display help information

Examples

Normal Mode

Posts 6 configurations with value "1.0":

ucs-config -p 8080 -m merchant_123 -c stripe

Shadow Mode

Posts 6 configurations with _shadow suffix and complex JSON values:

ucs-config -p 8080 -m merchant_123 -c stripe --shadow

With Custom UCS URLs

ucs-config -p 8080 -m merchant_123 -c stripe --shadow \
  --ucs-http-url http://ucs-service:9000 \
  --ucs-https-url https://ucs-service:9443

With Custom API Key

ucs-config -p 8080 -m merchant_123 -c stripe --api-key my_custom_key

What It Does

The CLI posts configurations to http://localhost:<port>/configs/ for the following operations:

  1. Authorize - Authorization operations
  2. PSync - Payment synchronization
  3. Void - Void/cancel operations
  4. Capture - Capture operations
  5. Execute - Execute operations
  6. RSync - Refund synchronization

First, it posts ucs_enabled: "true", then posts the rollout configurations.

Normal Mode Configuration

Each config key follows the pattern: ucs_rollout_config_<merchantId>_<connectorName>_<operation>

Value: "1.0"

Shadow Mode Configuration

Each config key follows the pattern: ucs_rollout_config_<merchantId>_<connectorName>_<operation>_shadow

Value: JSON string containing:

{
  "rollout_percent": 1.0,
  "http_url": "http://localhost:8081",
  "https_url": "https://localhost:8081"
}

Output

The CLI provides real-time feedback:

Configuring UCS rollout for:
  Port: 8080
  Merchant ID: merchant_123
  Connector: stripe
  Mode: Shadow
  UCS HTTP URL: http://localhost:8081
  UCS HTTPS URL: https://localhost:8081

Posting ucs_enabled config...

✓ ucs_enabled

Posting 6 rollout configurations...

✓ ucs_rollout_config_merchant_123_stripe_card_Authorize_shadow
✓ ucs_rollout_config_merchant_123_stripe_card_PSync_shadow
✓ ucs_rollout_config_merchant_123_stripe_card_Void_shadow
✓ ucs_rollout_config_merchant_123_stripe_card_Capture_shadow
✓ ucs_rollout_config_merchant_123_stripe_Execute_shadow
✓ ucs_rollout_config_merchant_123_stripe_RSync_shadow

Completed: 7 successful, 0 failed

Error Handling

  • Missing required parameters will display validation errors
  • Failed HTTP requests will show error details
  • Exit code 1 on failures, 0 on success

Requirements

  • Node.js >= 14.0.0
  • Access to the UCS config service endpoint

Publishing to npm

# Login to npm
npm login

# Publish the package
npm publish

License

ISC