0.0.1-beta.5 • Published 10 months ago

finite-state-sdk v0.0.1-beta.5

Weekly downloads
-
License
MIT
Repository
github
Last release
10 months ago

Finite State

Finite State manages risk across your software supply chain so that you can minimize risk, ship confidently, and reduce attack surface. Finite State reduces software supply chain risk with end-to-end SBOM solutions for the connected world.

The cloud-based SaaS platform for SBOM and Product Security management enables you to:

  • Generate and manage SBOMs in any format to create software transparency
  • Orchestrate and correlate scan findings from over 120 top scanning tools
  • Monitor AppSec and Product Security risk across product portfolios to visualize risk scoring and prioritize critical findings
  • Leverage world-class binary SCA to generate the most thorough and accurate SBOMs available

Finite State SDK

Finite State's powerful GraphQL API gives you and your teams access to the incredibly rich data you have in the platform. These SDKs, tools, and examples help your team to connect to Finite State APIs quickly and easily.

This is a translation of the Python SDK to Typescript.

Installing the SDK

View the API Docs here.

npm install finite-state-sdk

Use the SDK:

Ensure your import statement is correct. If your package uses ES module syntax, this should work:

import {FiniteStateSDK} from 'finite-state-sdk';

However, if you're using CommonJS in your package, you may need:

import * as FiniteStateSDK from 'finite-state-sdk';

or

const FiniteStateSDK = require('finite-state-sdk');

Finite State API

For more information about Finite State's APIs, see: https://docs.finitestate.io.

Our teams are working to add additional programming language and package manager support for Finite State SDKs.

Usage example

import { FiniteStateSDK } from "finite-state-sdk";
import { join } from "path";

const clientId = "PUT_HERE_CLIENT_ID";
const clientSecret = "PUT_HERE_CLIENT_SECRET";
const organizationContext = "PUT_HERE_ORGANIZATION_CONTEXT";
const client = new FiniteStateSDK({
  clientId,
  clientSecret,
  organizationContext,
});

const runCreateNewAssetVersionAndUploadBinary = async () => {
  const filePath = join(process.cwd(), "dist", "yourBinaryFile.bin");

  const response = await client.createNewAssetVersionAndUploadBinary({
    assetId: "2720805123",
    version: "1",
    filePath: filePath,
  });
  console.info(response);
};

const runCreateNewAssetVersionAndTestUploadResult = async () => {
  const filePath = join(process.cwd(), "dist", "cyclonedx.sbom.json");

  const response = await client.createNewAssetVersionAndUploadTestResults({
    assetId: "2720805124",
    version: "3",
    filePath: filePath,
    testType: "cyclonedx",
  });
  console.info(response);
};

const main = async () => {
  await runCreateNewAssetVersionAndUploadBinary();
  await runCreateNewAssetVersionAndTestUploadResult();
};

main();

Contributing

Refer to our contribution guidelines

LICENSE

Licensed under MIT, see LICENSE

Developers Guide

Please follow the steps described here

0.0.1-beta.5

10 months ago

0.0.1-beta.4

10 months ago

0.0.1-beta.3

10 months ago

0.0.1-beta.2

10 months ago

0.0.1-beta.1

10 months ago