JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 22
  • Score
    100M100P100Q68612F
  • License MIT

Official Sophos Factory API client library for JavaScript.

Package Exports

  • @sophos-factory/api-client
  • @sophos-factory/api-client/dist/index.mjs
  • @sophos-factory/api-client/dist/index.node.js

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@sophos-factory/api-client) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

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('@sophos-factory/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.