This package has been deprecated

Author message:

Refactr is now Sophos Factory! Please update to @sophos-factory/api-client

@refactr/api-client
TypeScript icon, indicating that this package has built-in type declarations

1.0.0 • Public • Published

Sophos Factory API Client Library for JavaScript

This is the official Sophos Factory API client library for JavaScript.

Usage

Generate an API Token by logging into Sophos Factory and visiting the API Tokens page.

The API client is hosted on npm and can be installed like any other npm package. For example, to list projects:

const { ProjectsApi, Configuration } = require('@refactr/api-client');

const accessToken = '<your api token here>';

const config = new Configuration({
    accessToken: accessToken
});
const client = new ProjectsApi(config);

(async () => {
    const res = await client.listProjects();
    console.info(res.data);
})().catch(e => {
    console.error(`Request failed with status code: ${e.response.status}. Response body:`);
    console.error(e.response.data);
});

All methods can be viewed by browsing the specification: https://api.refactr.it/v1/

Generating the Library

The library is generated from the OpenAPI schema at: https://api.refactr.it/v1

The GitHub Action workflow Codegen runs on a schedule and can also be dispatched manually. It compares the last updated schema stored at spec/schema.json with the current schema downloaded from https://api.refactr.it/v1/spec. If there is a difference, the workflow regenerates the client library, then opens a pull request with the changes.

Terms of Use

Please see Sophos Services Agreement and Sophos Privacy Notice.

Package Sidebar

Install

npm i @refactr/api-client

Weekly Downloads

2

Version

1.0.0

License

MIT

Unpacked Size

1.61 MB

Total Files

13

Last publish

Collaborators

  • sophosbruce
  • marc-fieser-sophos
  • sophos_rick
  • refactr_anthony