npm

@hashicorp/integrations-hcl
TypeScript icon, indicating that this package has built-in type declarations

0.6.0 • Public • Published

@hashicorp/integrations-hcl

This contains reused HCL validation logic for integrations and integration-release-action

Generating the API Client

An IntegrationsAPI TypeScript Client can be generated from our OpenAPI spec.

Example:

# From the web-platform-packages monorepo root
npx -p openapi-typescript-codegen openapi \
  --input ../integrations-api/src/spec/api-docs.json \
  --output ./packages/integrations-hcl/lib/generated \
  --client node \
  --name IntegrationsAPI \
  --request ./packages/integrations-hcl/lib/generated/request.ts.template

# Ensure generated files match out prettier config
npx prettier --write ./packages/integrations-hcl/lib/generated

Usage:

import { IntegrationsAPI } from './lib/generated'

const client = new IntegrationsAPI({
  BASE: process.env.INPUT_INTEGRATIONS_API_BASE_URL,
})

// response is fully typed
// {
//     meta: Meta200;
//     result: EnrichedIntegration;
// }
const response = await client.integrations.getProductsIntegrations1(
  productSlug,
  integrationSlug
)

Readme

Keywords

none

Package Sidebar

Install

npm i @hashicorp/integrations-hcl

Weekly Downloads

11

Version

0.6.0

License

ISC

Unpacked Size

294 kB

Total Files

172

Last publish

Collaborators

  • gstewart-hashi
  • prestonbourne
  • mikegolus
  • leahmariebush
  • kaitlynnefuery
  • abhishek-hashicorp
  • cameronperera
  • alexju
  • consul-ui-services
  • hashicb
  • britt.lindgren
  • paulhcp
  • nandereck
  • tstormk
  • hashibot-hds
  • lackeyjb1
  • jpogran
  • thrashr888
  • melsumner
  • didoo
  • zchsh
  • hcitsec
  • gregone
  • meirish
  • enmod
  • kaxcode
  • anubhavmishra-hashicorp
  • hashibot-web
  • cstitt-hashi
  • mocohen
  • dhaulagiri