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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@yankeguo/coding-node-client

v202506.11.1

Published

An Axios based Node.js client for CODING.NET OpenAPI

Readme

@yankeguo/coding-node-client

npm version License

An Axios based Node.js client for CODING.NET OpenAPI, generated from the official OpenAPI specification from CODING.NET OpenAPI Documentation.

Features

  • 🚀 Complete API Coverage: Supports all CODING.NET OpenAPI endpoints
  • 📝 TypeScript Support: Full TypeScript definitions included
  • 🔧 Axios-based: Built on the popular Axios HTTP client
  • 🔄 Auto-generated: Generated from official OpenAPI specification
  • 📚 Comprehensive Documentation: Extensive API documentation included

Installation

npm install @yankeguo/coding-node-client

Quick Start

import { Configuration, DefaultApi } from "@yankeguo/coding-node-client";

// Create configuration
const config = new Configuration({
  basePath: "https://e.coding.net/open-api",
  accessToken: "your-access-token",
});

// Create API instance
const api = new DefaultApi(config);

// Example: Get current user info
async function getCurrentUser() {
  try {
    const response = await api.describeCodingCurrentUser(
      "Bearer your-token",
      "DescribeCodingCurrentUser",
    );
    console.log(response.data);
  } catch (error) {
    console.error("Error:", error);
  }
}

Configuration Options

The Configuration class supports the following options:

interface ConfigurationParameters {
  apiKey?:
    | string
    | Promise<string>
    | ((name: string) => string)
    | ((name: string) => Promise<string>);
  username?: string;
  password?: string;
  accessToken?:
    | string
    | Promise<string>
    | ((name?: string, scopes?: string[]) => string)
    | ((name?: string, scopes?: string[]) => Promise<string>);
  basePath?: string;
  serverIndex?: number;
  baseOptions?: any;
  formDataCtor?: new () => any;
}

Authentication

The client supports multiple authentication methods:

  1. Access Token (Recommended):
const config = new Configuration({
  basePath: "https://your-team.coding.net",
  accessToken: "your-access-token",
});
  1. API Key:
const config = new Configuration({
  basePath: "https://your-team.coding.net",
  apiKey: "your-api-key",
});
  1. Username/Password:
const config = new Configuration({
  basePath: "https://your-team.coding.net",
  username: "your-username",
  password: "your-password",
});

Available APIs

This client provides three main API classes:

1. DefaultApi

The main API class containing most CODING.NET functionality:

import { DefaultApi } from "@yankeguo/coding-node-client";

const defaultApi = new DefaultApi(config);

Key features include:

  • Project management
  • Repository operations
  • Issue tracking
  • Continuous Integration/Deployment
  • Artifact management
  • User and team management
  • And much more...

2. ServiceHookApi

For managing webhooks and service hooks:

import { ServiceHookApi } from "@yankeguo/coding-node-client";

const serviceHookApi = new ServiceHookApi(config);

// Example: Create a service hook
const hook = await serviceHookApi.createServiceHook(
  "Bearer your-token",
  "CreateServiceHook",
  {
    ProjectName: "your-project",
    HookUrl: "https://your-webhook-url.com",
    HookEvents: ["push", "merge_request"],
  },
);

3. WikiApi

For wiki operations:

import { WikiApi } from "@yankeguo/coding-node-client";

const wikiApi = new WikiApi(config);

// Example: Get wiki list
const wikis = await wikiApi.describeWikiList(
  "Bearer your-token",
  "DescribeWikiList",
  { ProjectName: "your-project" },
);

Common Use Cases

1. Project Management

// Get all projects
const projects = await api.describeCodingProjects(
  "Bearer your-token",
  "DescribeCodingProjects",
  { PageSize: 20 },
);

// Create a new project
const newProject = await api.createCodingProject(
  "Bearer your-token",
  "CreateCodingProject",
  {
    ProjectName: "my-new-project",
    ProjectDisplayName: "My New Project",
    ProjectDescription: "A sample project",
  },
);

2. Repository Operations

// Get repository information
const repo = await api.describeGitDepot(
  "Bearer your-token",
  "DescribeGitDepot",
  {
    ProjectName: "your-project",
    DepotName: "your-repo",
  },
);

// Create a new branch
await api.createGitBranch("Bearer your-token", "CreateGitBranch", {
  ProjectName: "your-project",
  DepotName: "your-repo",
  BranchName: "feature/new-feature",
  LastCommitSha: "base-commit-sha",
});

3. Issue Management

// List issues
const issues = await api.describeIssueList(
  "Bearer your-token",
  "DescribeIssueList",
  {
    ProjectName: "your-project",
    PageSize: 20,
  },
);

// Create a new issue
const issue = await api.createIssue("Bearer your-token", "CreateIssue", {
  ProjectName: "your-project",
  Type: "DEFECT",
  Name: "Bug Report",
  Description: "Description of the bug",
});

4. CI/CD Operations

// Trigger a build
const build = await api.triggerCodingCIBuild(
  "Bearer your-token",
  "TriggerCodingCIBuild",
  {
    ProjectName: "your-project",
    JobName: "your-job",
    Ref: "master",
  },
);

// Get build status
const buildInfo = await api.describeCodingCIBuild(
  "Bearer your-token",
  "DescribeCodingCIBuild",
  {
    ProjectName: "your-project",
    BuildId: build.data.Response.Data.BuildId,
  },
);

Error Handling

import { AxiosError } from "axios";

try {
  const response = await api.someMethod(/* parameters */);
  console.log(response.data);
} catch (error) {
  if (error instanceof AxiosError) {
    console.error("HTTP Error:", error.response?.status);
    console.error("Error Data:", error.response?.data);
  } else {
    console.error("Unknown Error:", error);
  }
}

TypeScript Support

This package includes comprehensive TypeScript definitions. All request/response types are fully typed:

import type {
  CreateIssueRequest,
  CreateIssue200Response,
  Configuration,
} from "@yankeguo/coding-node-client";

const issueRequest: CreateIssueRequest = {
  ProjectName: "my-project",
  Type: "DEFECT",
  Name: "Bug title",
};

const response: CreateIssue200Response = await api.createIssue(
  "Bearer token",
  "CreateIssue",
  issueRequest,
);

API Documentation

Detailed API documentation is available in the docs/ directory:

Rate Limiting

CODING.NET API has rate limiting. Make sure to handle rate limit responses appropriately:

import { setTimeout } from "timers/promises";

async function apiCallWithRetry(apiCall: () => Promise<any>, maxRetries = 3) {
  for (let i = 0; i < maxRetries; i++) {
    try {
      return await apiCall();
    } catch (error) {
      if (error instanceof AxiosError && error.response?.status === 429) {
        const retryAfter = error.response.headers["retry-after"] || 60;
        console.log(`Rate limited. Retrying after ${retryAfter} seconds...`);
        await setTimeout(retryAfter * 1000);
      } else {
        throw error;
      }
    }
  }
  throw new Error("Max retries exceeded");
}

OpenAPI Specification Patch

This package is auto-generated from the official CODING.NET OpenAPI specification with a necessary patch applied.

Required Patch

The official OpenAPI specification contains issues that need to be corrected before code generation:

  1. Replace all "type": "uint64" with "type": "integer":
    - "type": "uint64"
    + "type": "integer"
  2. Remove Authorization header and Action query parameters from all endpoint parameters.
  3. Clear all required arrays in requestBody.content["application/json"].schema to make request body fields optional.
  4. Add authentication support to all endpoints by:
    • Adding securitySchemes to the components section with BasicAuth, BearerAuth, and ApiKeyAuth schemes
    • Adding security arrays to all path operations to support multiple authentication methods

Contributing

This package is auto-generated from the official CODING.NET OpenAPI specification with the above patch applied.

If you find issues with the API client:

  1. Check if it's an issue with the OpenAPI specification
  2. Report issues to the CODING.NET team if it's a specification problem
  3. Report issues to this repository if it's a client generation problem

License

MIT License - see LICENSE file for details.

Links

Changelog

See package.json for version information.

Current version: 202506.11.0


Note: This client is generated from the official CODING.NET OpenAPI specification. For the most up-to-date API information, please refer to the official documentation.