New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

@vc-shell/api-client-generator

Package Overview
Dependencies
Maintainers
0
Versions
314
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@vc-shell/api-client-generator

Tool for API clients generation

  • 1.0.340
  • latest
  • npm
  • Socket score

Version published
Weekly downloads
34
decreased by-88.47%
Maintainers
0
Weekly downloads
 
Created
Source

Platform Manager REST Client

Generate API client

This guide describes the process of generating an API client to access the VC Platform API from your custom application.

!!! note Platform Manager REST Client offers generated REST API methods that make it easy to interact with the existing VirtoCommerce Platform API.

Prerequisites

  • .NET Core 6.0, particularly if you are using MacOS or Linux.

Generate TypeScript API clients

To enable TypeScript API client generation in your project:

  1. Add dependencies to your project:

Using command

yarn add @vc-shell/api-client-generator cross-env

cross-env runs scripts that set and use environment variables across platforms.

Manually

Add the dependencies to your project's package.json:

{
    ...
    "devDependencies": {
        ...
        "@vc-shell/api-client-generator": "latest",
        "cross-env": "latest",
        ...
    }
}
  1. Configure client generation in your project. Inside your project's package.json file, add a "generate-api-client" command to the list of scripts:

    {
        "scripts": {
        ...
        "generate-api-client": cross-env api-client-generator --APP_PLATFORM_MODULES='[MarketplaceVendor,Catalog,Orders]' --APP_API_CLIENT_DIRECTORY=./src/api_client/
        }
    }
    

    The options are listed in the table below:

    OptionsDescriptionExample
    --APP_PLATFORM_MODULESPlatform modules to generate API client.
    {==string[]==}
    Customize the --APP_PLATFORM_MODULES list
    to match your project's requirements.
    --APP_PLATFORM_MODULES='[MarketplaceVendor,Orders,Catalog]'
    --APP_API_CLIENT_DIRECTORYOutput directory for generated API clients.
    {==string==}
    --APP_API_CLIENT_DIRECTORY=./src/api_client/
    --APP_PLATFORM_URLPlatform URL to obtain client API configs.
    {==string==}
    --APP_PLATFORM_URL=https://vcmp-dev.govirto.com/
    --APP_PACKAGE_NAMEPackage name for generated API clients.
    {==string==}
    --APP_PACKAGE_NAME=vc-app-extend
    --APP_PACKAGE_VERSIONPackage version for generated API clients.
    {==string==}
    --APP_PACKAGE_VERSION=1.0.0
    --APP_OUT_DIROutput directory for generated API clients.
    {==string==}
    --APP_OUT_DIR=./src/api_client/
    --SKIP_BUILDSkip build step.
    {==boolean==}
    --SKIP_BUILD=true
  2. Configure Platform URL to ensure your project can access the platform's API configurations. Add the platform URL to your project's .env file:

    APP_PLATFORM_URL=https://vcmp-dev.govirto.com/
    

    !!! note Alternatively, you can specify the Platform URL as a command option in the previous step when running the "generate-api-client" command.

  3. Generate the API clients using the following command:

    yarn generate-api-client
    

This command generates the required API clients for your custom application. Now you can effortlessly access the VC Platform API from your custom application using the generated API client.

FAQs

Package last updated on 06 Feb 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc