How to use the @netlify/open-api.schemes function in @netlify/open-api

To help you get started, we’ve selected a few @netlify/open-api examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github netlify / js-client / src / index.js View on Github external
constructor(accessToken, opts) {
    addMethods(this)

    // variadic arguments
    if (typeof accessToken === 'object') {
      opts = accessToken
      accessToken = null
    }
    // default opts
    opts = Object.assign(
      {
        userAgent: 'netlify/js-client',
        scheme: dfn.schemes[0],
        host: dfn.host,
        pathPrefix: dfn.basePath,
        accessToken,
        globalParams: {}
      },
      opts
    )

    this.defaultHeaders = {
      'User-agent': opts.userAgent,
      accept: 'application/json'
    }

    this.scheme = opts.scheme
    this.host = opts.host
    this.pathPrefix = opts.pathPrefix
github netlify / cli / src / utils / api / index.js View on Github external
constructor(accessToken, opts) {
    if (typeof accessToken === 'object') {
      opts = accessToken
      accessToken = null
    }
    opts = Object.assign(
      {
        userAgent: '@netlify/js-client',
        scheme: dfn.schemes[0],
        host: dfn.host,
        pathPrefix: dfn.basePath
      },
      opts
    )
    this.defaultHeaders = {
      'User-agent': opts.userAgent,
      accept: 'application/json'
    }
    this.scheme = opts.scheme
    this.host = opts.host
    this.pathPrefix = opts.pathPrefix
    this.globalParams = Object.assign({}, opts.globalParams)
    if (accessToken) this.accessToken = accessToken
  }

@netlify/open-api

Netlify's open-api definition as a module

MIT
Latest version published 3 months ago

Package Health Score

83 / 100
Full package analysis