@adobe/aio-lib-console-project-installation

3.0.1 • Public • Published

License

Adobe I/O Lib Console Project Installation

This is an internal helper library to create and configure remote Developer Console resources, like services and credentials, based on a template's install.yaml configuration file.

The following keys are supported in the install.yaml file:

  • categories: (Required) Categories are informational and at least one category must be defined. See a list of supported categories here.
  • workspaces: (Optional) A list of workspace names to create. Runtime namespaces are added by default for each workspace, if the runtime key is set to true. Staging and Production workspaces are created by default if not defined.
  • runtime: (Optional) Defines whether Runtime should be configured for each workspace. If not defined, the default is false.
  • apis: (Optional) A list of Adobe services, identified by their SDK code required by the template to work. By default, all services are attached to all configured workspaces.

A note on apis: Developer Console supports three types of services: AdobeIO, Enterprise and Analytics. Currently, only AdobeIO and Enterprise services are supported for configuration by this library.

Installing

$ npm install @adobe/aio-lib-console-project-installation

Usage

  1. Initialize the template handler
const { getToken } = require('@adobe/aio-lib-ims')
const { CLI } = require('@adobe/aio-lib-ims/src/context')
const templateHandler = require('@adobe/aio-lib-console-project-installation')

// Instantiate Adobe Developer Console SDK
const accessToken = await getToken(CLI)

// Instantiate App Builder Template Manager
const installConfigFile = 'install.yml'
const templateManager = await templateHandler.init(accessToken, installConfigFile)
  1. Call methods using the initialized Template Manager
  // Install the template
  try {
    const orgId = 'org-id'
    const templateId = 'template-id'
    const result = await templateManager.installTemplate(orgId, templateId)
    console.log(result)

  } catch (e) {
    console.error(e)
  }

Template validation

You can use this library to validate the App Builder application install.yaml file.

const templateHandler = require('@adobe/aio-lib-console-project-installation')

const pathToInstallConfigFile = 'install.yml'

// Second parameter is optional. Set it to `true` if you want to get prettified errors.
const { valid, errors } = await templateHandler.validate(path, true)

Functions

init(accessToken, templateConfigurationFile)TemplateInstallManager

Returns a new TemplateInstallManager object.

validate(templateConfigurationFile, pretty)object

init(accessToken, templateConfigurationFile) ⇒ TemplateInstallManager

Returns a new TemplateInstallManager object.

Kind: global function
Returns: TemplateInstallManager - A new TemplateInstallManager object.

Param Type Description
accessToken string The Adobe Console API client.
templateConfigurationFile string The path to the configuration file.

validate(templateConfigurationFile, pretty) ⇒ object

Kind: global function
Returns: object - Object with properties valid, configuration and errors

Param Type Default Description
templateConfigurationFile string The path to the configuration file.
pretty boolean false Prettify errors.

Debug Logs

LOG_LEVEL=debug <your_call_here>

Prepend the LOG_LEVEL environment variable and debug value to the call that invokes your function, on the command line. This should output a lot of debug data for your SDK calls.

Contributing

Contributions are welcome! Read the Contributing Guide for more information.

Licensing

This project is licensed under the Apache V2 License. See LICENSE for more information.

Readme

Keywords

none

Package Sidebar

Install

npm i @adobe/aio-lib-console-project-installation

Weekly Downloads

2,905

Version

3.0.1

License

Apache-2.0

Unpacked Size

109 kB

Total Files

44

Last publish

Collaborators

  • dylandepass
  • djaeggi
  • adobehalls
  • fullcolorcoder
  • marbec
  • tripod
  • garthdb
  • lazd
  • adobe-admin
  • patrickfulton
  • trieloff
  • shazron
  • krisnye
  • dcpfsdk
  • natebaldwin
  • devongovett
  • aspro83
  • symanovi
  • dpfister
  • stefan-guggisberg
  • korra
  • rofe
  • kptdobe