Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@devfile/api

Package Overview
Dependencies
Maintainers
0
Versions
103
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@devfile/api

Typescript types for devfile api

  • 2.3.0-1720455021
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
747
decreased by-30.64%
Maintainers
0
Weekly downloads
 
Created
Source

kubernetes-client-typescript@false

This generator creates TypeScript/JavaScript client that utilizes fetch-api.

Building

To build and compile the typescript sources to javascript use:

npm install
npm run build

Publishing

First build the package then run npm publish

Consuming

Navigate to the folder of your consuming project and run one of the following commands.

published:

npm install kubernetes-client-typescript@false --save

unPublished (not recommended):

npm install PATH_TO_GENERATED_PACKAGE --save

### Usage

Below code snippet shows exemplary usage of the configuration and the API based 
on the typical `PetStore` example used for OpenAPI. 

import * as your_api from 'your_api_package'

// Covers all auth methods included in your OpenAPI yaml definition const authConfig: your_api.AuthMethodsConfiguration = { "api_key": "YOUR_API_KEY" }

// Implements a simple middleware to modify requests before (pre) they are sent // and after (post) they have been received class Test implements your_api.Middleware { pre(context: your_api.RequestContext): Promise<your_api.RequestContext> { // Modify context here and return return Promise.resolve(context); }

post(context: your_api.ResponseContext): Promise<your_api.ResponseContext> {
    return Promise.resolve(context);
}

}

// Create configuration parameter object const configurationParameters = { httpApi: new your_api.JQueryHttpLibrary(), // Can also be ignored - default is usually fine baseServer: your_api.servers[0], // First server is default authMethods: authConfig, // No auth is default promiseMiddleware: [new Test()], }

// Convert to actual configuration const config = your_api.createConfiguration(configurationParameters);

// Use configuration with your_api const api = new your_api.PetApi(config); your_api.Pet p = new your_api.Pet(); p.name = "My new pet"; p.photoUrls = []; p.tags = []; p.status = "available"; Promise<your_api.Pet> createdPet = api.addPet(p);

Keywords

FAQs

Package last updated on 08 Jul 2024

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc