Git Product home page Git Product logo

aio-lib-cloudmanager's Introduction

Version Downloads/week Build Status License Codecov Coverage

Adobe I/O Cloud Manager Library

JavaScript SDK wrapping the Adobe Cloud Manager API.

Installing

$ npm install @adobe/aio-lib-cloudmanager

Usage

  1. Initialize the SDK
const sdk = require('@adobe/aio-lib-cloudmanager')

async function sdkTest() {
  //initialize sdk
  const client = await sdk.init('<orgId>', 'x-api-key', '<valid auth token>')
}
  1. Call methods using the initialized SDK
const sdk = require('@adobe/aio-lib-cloudmanager')

async function sdkTest() {
  // initialize sdk
  const client = await sdk.init('<orgId>', 'x-api-key', '<valid auth token>')

  // call methods
  try {
    // get... something
    const result = await client.listPrograms()
    console.log(result)

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

Classes

CloudManagerAPI

This class provides methods to call your Cloud Manager APIs. Before calling any method initialize the instance by calling the init method on it with valid values for orgId, apiKey and accessToken

Functions

getCurrentStep(execution)PipelineExecutionStepState

Find the first non-finished step in a pipeline execution

getWaitingStep(execution)PipelineExecutionStepState

Find the first waiting step in a pipeline execution

init(orgId, apiKey, accessToken, baseUrl)Promise.<CloudManagerAPI>

Returns a Promise that resolves with a new CloudManagerAPI object.

Typedefs

EmbeddedProgram : object

A lightweight representation of a Program

Pipeline : object

A representation of a CI/CD Pipeline

PipelinePhase : object

Describes a phase of a pipeline

PipelineExecution : object

A representation of an execution of a CI/CD Pipeline.

PipelineExecutionStepState : object

Describes the status of a particular pipeline execution step for display purposes

PipelineStepMetrics : object
Metric : object

A representation of a specific metric generated by a CI/CD Pipeline step.

Environment : object

A representation of an Environment known to Cloud Manager.

Variable : object

A named value than can be set on an Environment or Pipeline

ContentSet : object

A representation of a ContentSet custom

ContentFlow : object

The Content Flow Execution

LogOptionRepresentation : object
IPAllowedListBinding : object

Describes an IP Allowed List Binding

IPAllowedList : object

Describes an IP Allowed List

ListPipelineOptions : object

Options to the listPipeline function

DownloadedLog : object
PipelineUpdate : object

CloudManagerAPI

This class provides methods to call your Cloud Manager APIs. Before calling any method initialize the instance by calling the init method on it with valid values for orgId, apiKey and accessToken

Kind: global class

cloudManagerAPI.orgId : string

The organization id

Kind: instance property of CloudManagerAPI

cloudManagerAPI.apiKey : string

The api key from your integration

Kind: instance property of CloudManagerAPI

cloudManagerAPI.accessToken : string

The access token from your integration

Kind: instance property of CloudManagerAPI

cloudManagerAPI.baseUrl : string

The base URL for the API endpoint

Kind: instance property of CloudManagerAPI

cloudManagerAPI.addIpAllowlistBinding(programId, ipAllowlistId, environmentId, service) ⇒ Promise.<object>

Bind an IP Allow List to an environment

Kind: instance method of CloudManagerAPI
Returns: Promise.<object> - a truthy value

Param Type Description
programId string the program id
ipAllowlistId string the allow list id
environmentId string the environment id
service string the service name

cloudManagerAPI.advanceCurrentExecution(programId, pipelineId) ⇒ Promise.<object>

Advance current execution

Kind: instance method of CloudManagerAPI
Returns: Promise.<object> - a truthy value

Param Type Description
programId string the program id
pipelineId string the pipeline id

cloudManagerAPI.cancelContentFlow(programId, contentFlowId) ⇒ Promise.<object>

Cancel a content flow Cancels an in progress flow

Kind: instance method of CloudManagerAPI
Returns: Promise.<object> - a truthy value

Param Type Description
programId string the program id
contentFlowId string the flow id

cloudManagerAPI.cancelCurrentExecution(programId, pipelineId) ⇒ Promise.<object>

Cancel current execution

Kind: instance method of CloudManagerAPI
Returns: Promise.<object> - a truthy value

Param Type Description
programId string the program id
pipelineId string the pipeline id

cloudManagerAPI.createContentFlow(programId, environmentId, contentFlow) ⇒ Promise.<ContentFlow>

Create content Set Flow for environment

Kind: instance method of CloudManagerAPI
Returns: Promise.<ContentFlow> - the created content flow representation

Param Type Description
programId string The program id
environmentId string The environment id
contentFlow ContentFlow The body of the contentFlow

cloudManagerAPI.createContentSet(programId, contentSet) ⇒ Promise.<ContentSet>

Create a Content set

Kind: instance method of CloudManagerAPI
Returns: Promise.<ContentSet> - the created content set

Param Type Description
programId string the program id
contentSet string the body of the content set.

cloudManagerAPI.createExecution(programId, pipelineId, mode) ⇒ Promise.<PipelineExecution>

Create a new execution for a pipeline, returning the execution.

Kind: instance method of CloudManagerAPI
Returns: Promise.<PipelineExecution> - the new execution

Param Type Description
programId string the program id
pipelineId string the pipeline id
mode string the pipeline execution mode

cloudManagerAPI.createIpAllowlist(programId, name, cidrBlocks) ⇒ Promise.<IPAllowedList>

Create IP Allow List

Kind: instance method of CloudManagerAPI
Returns: Promise.<IPAllowedList> - a truthy value

Param Type Description
programId string the program id
name string the name
cidrBlocks Array.<string> the CIDR blocks

cloudManagerAPI.deleteContentSet(programId, contentSetId) ⇒ Promise.<object>

Delete Content Set

Kind: instance method of CloudManagerAPI
Returns: Promise.<object> - a truthy value

Param Type Description
programId string the program id
contentSetId string the content set id

cloudManagerAPI.deleteEnvironment(programId, environmentId) ⇒ Promise.<object>

Delete an environment

Kind: instance method of CloudManagerAPI
Returns: Promise.<object> - a truthy value

Param Type Description
programId string the program id
environmentId string the environment id

cloudManagerAPI.deleteIpAllowlist(programId, ipAllowlistId) ⇒ Promise.<object>

Update the CIDR blocks of an IP Allow List

Kind: instance method of CloudManagerAPI
Returns: Promise.<object> - a truthy value

Param Type Description
programId string the program id
ipAllowlistId string the allow list id

cloudManagerAPI.deletePipeline(programId, pipelineId) ⇒ Promise.<object>

Delete a pipeline

Kind: instance method of CloudManagerAPI
Returns: Promise.<object> - a truthy object

Param Type Description
programId string the program id
pipelineId string the pipeline id

cloudManagerAPI.deleteProgram(programId) ⇒ Promise.<object>

Delete a program

Kind: instance method of CloudManagerAPI
Returns: Promise.<object> - a truthy value

Param Type Description
programId string the program id

cloudManagerAPI.downloadLogs(programId, environmentId, service, name, days, outputDirectory) ⇒ Promise.<Array.<DownloadedLog>>

Download log files from the environment to a specified directory.

Kind: instance method of CloudManagerAPI
Returns: Promise.<Array.<DownloadedLog>> - the list of downloaded logs

Param Type Description
programId string the program id
environmentId string the environment id
service string the service specification
name string the log name
days number the number of days
outputDirectory string the output directory

cloudManagerAPI.getContentFlow(programId, contentFlowId) ⇒ Promise.<ContentFlow>

Get Content Flow

Kind: instance method of CloudManagerAPI
Returns: Promise.<ContentFlow> - the Content Flow

Param Type Description
programId string The program id
contentFlowId string the content flow id

cloudManagerAPI.getContentSet(programId, contentSetId) ⇒ Promise.<ContentSet>

Get Content Set

Kind: instance method of CloudManagerAPI
Returns: Promise.<ContentSet> - the content set

Param Type Description
programId string the program id
contentSetId string the content set id

cloudManagerAPI.getCurrentExecution(programId, pipelineId) ⇒ Promise.<PipelineExecution>

Get the current execution for a pipeline

Kind: instance method of CloudManagerAPI
Returns: Promise.<PipelineExecution> - the execution

Param Type Description
programId string the program id
pipelineId string the pipeline id

cloudManagerAPI.getDeveloperConsoleUrl(programId, environmentId) ⇒ Promise.<string>

Get the link to the developer console

Kind: instance method of CloudManagerAPI
Returns: Promise.<string> - the console url

Param Type Description
programId string the program id
environmentId string the environment id

cloudManagerAPI.getEnvironmentVariables(programId, environmentId) ⇒ Promise.<Array.<Variable>>

Get the list of variables for an environment

Kind: instance method of CloudManagerAPI
Returns: Promise.<Array.<Variable>> - the variables

Param Type Description
programId string the program id
environmentId string the environment id

cloudManagerAPI.getExecution(programId, pipelineId, executionId) ⇒ Promise.<PipelineExecution>

Get an execution for a pipeline

Kind: instance method of CloudManagerAPI
Returns: Promise.<PipelineExecution> - the execution

Param Type Description
programId string the program id
pipelineId string the pipeline id
executionId string the execution id

cloudManagerAPI.getExecutionStepLog(programId, pipelineId, executionId, action, logFile, outputStream) ⇒ Promise.<object>

Write step log to an output stream.

Kind: instance method of CloudManagerAPI
Returns: Promise.<object> - a truthy value

Param Type Description
programId string the program id
pipelineId string the pipeline id
executionId string the execution id
action string the action
logFile string the log file to select a non-default value
outputStream object the output stream to write to

cloudManagerAPI.getPipelineVariables(programId, pipelineId) ⇒ Promise.<Array.<Variable>>

Get the list of variables for a pipeline

Kind: instance method of CloudManagerAPI
Returns: Promise.<Array.<Variable>> - the variables

Param Type Description
programId string the program id
pipelineId string the pipeline id

cloudManagerAPI.getQualityGateResults(programId, pipelineId, executionId, action) ⇒ Promise.<PipelineStepMetrics>

Get the quality gate results for a pipeline step

Kind: instance method of CloudManagerAPI
Returns: Promise.<PipelineStepMetrics> - the execution

Param Type Description
programId string the program id
pipelineId string the pipeline id
executionId string the execution id
action string the action name

cloudManagerAPI.init(orgId, apiKey, accessToken, baseUrl) ⇒ Promise.<CloudManagerAPI>

Initializes a CloudManagerAPI object and returns it.

Kind: instance method of CloudManagerAPI
Returns: Promise.<CloudManagerAPI> - a CloudManagerAPI object

Param Type Description
orgId string the organization id
apiKey string the API key for your integration
accessToken string the access token for your integration
baseUrl string the base URL to access the API (defaults to https://cloudmanager.adobe.io)

cloudManagerAPI.invalidatePipelineCache(programId, pipelineId) ⇒ Promise.<object>

Invalidate the cache for a pipeline

Kind: instance method of CloudManagerAPI
Returns: Promise.<object> - a truthy object

Param Type Description
programId string the program id
pipelineId string the pipeline id

cloudManagerAPI.listAvailableLogOptions(programId, environmentId) ⇒ Promise.<Array.<LogOptionRepresentation>>

List the log options available for an environment

Kind: instance method of CloudManagerAPI
Returns: Promise.<Array.<LogOptionRepresentation>> - the log options for the environment

Param Type Description
programId string the program id
environmentId string the environment id

cloudManagerAPI.listContentFlows(programId) ⇒ Promise.<Array.<ContentFlow>>

List content flows for program

Kind: instance method of CloudManagerAPI
Returns: Promise.<Array.<ContentFlow>> - an array of content flows

Param Type Description
programId string The program id

cloudManagerAPI.listContentSets(programId) ⇒ Promise.<Array.<ContentSet>>

List Content Sets for program

Kind: instance method of CloudManagerAPI
Returns: Promise.<Array.<ContentSet>> - list of the content sets for the program

Param Type Description
programId string the program id

cloudManagerAPI.listEnvironments(programId) ⇒ Promise.<Array.<Environment>>

List environments for a program

Kind: instance method of CloudManagerAPI
Returns: Promise.<Array.<Environment>> - a list of environments

Param Type Description
programId string the program id

cloudManagerAPI.listExecutions(programId, pipelineId, limit) ⇒ Promise.<Array.<PipelineExecution>>

List the most recent executions for a pipeline

Kind: instance method of CloudManagerAPI
Returns: Promise.<Array.<PipelineExecution>> - the list of executions

Param Type Default Description
programId string the program id
pipelineId string the pipeline id
limit number 20 the maximum number of executions to return (defaults to 20)

cloudManagerAPI.listIpAllowlists(programId) ⇒ Promise.<IPAllowedList>

List the program's defined IP Allow Lists

Kind: instance method of CloudManagerAPI
Returns: Promise.<IPAllowedList> - - the IP Allow Lists

Param Type Description
programId string the program id

cloudManagerAPI.listPipelines(programId, options) ⇒ Promise.<Array.<Pipeline>>

Obtain a list of pipelines for the target program.

Kind: instance method of CloudManagerAPI
Returns: Promise.<Array.<Pipeline>> - an array of Pipelines

Param Type Description
programId string the program id
options ListPipelineOptions options

cloudManagerAPI.listPrograms() ⇒ Promise.<Array.<EmbeddedProgram>>

Obtain a list of programs for the target organization.

Kind: instance method of CloudManagerAPI
Returns: Promise.<Array.<EmbeddedProgram>> - an array of Programs

cloudManagerAPI.removeIpAllowlistBinding(programId, ipAllowlistId, environmentId, service) ⇒ Promise.<object>

Unbind an IP Allow List from an environment

Kind: instance method of CloudManagerAPI
Returns: Promise.<object> - a truthy value

Param Type Description
programId string the program id
ipAllowlistId string the allow list id
environmentId string the environment id
service string the service name

cloudManagerAPI.setEnvironmentVariables(programId, environmentId, variables) ⇒ Promise.<object>

Set the variables for an environment

Kind: instance method of CloudManagerAPI
Returns: Promise.<object> - a truthy value

Param Type Description
programId string the program id
environmentId string the environment id
variables Array.<Variable> the variables

cloudManagerAPI.setPipelineVariables(programId, pipelineId, variables) ⇒ Promise.<object>

Set the variables for a pipeline

Kind: instance method of CloudManagerAPI
Returns: Promise.<object> - a truthy value

Param Type Description
programId string the program id
pipelineId string the pipeline id
variables Array.<Variable> the variables

cloudManagerAPI.startExecution(programId, pipelineId, mode) ⇒ Promise.<string>

Deprecated

Start an execution for a pipeline, returning the url of the new execution

Kind: instance method of CloudManagerAPI
Returns: Promise.<string> - the execution url

Param Type Description
programId string the program id
pipelineId string the pipeline id
mode string the pipeline execution mode

cloudManagerAPI.tailExecutionStepLog(programId, pipelineId, action, logFile, outputStream) ⇒ Promise.<PipelineExecutionStepState>

Tail step log to an output stream.

Kind: instance method of CloudManagerAPI
Returns: Promise.<PipelineExecutionStepState> - the completed step state

Param Type Description
programId string the program id
pipelineId string the pipeline id
action string the action
logFile string the log file to select a non-default value
outputStream object the output stream to write to

cloudManagerAPI.updateContentSet(programId, contentSetId, updatedContentSet) ⇒ Promise.<ContentSet>

Update the content set definition.

The operation is a PUT, so the entire body has to be provided.

Kind: instance method of CloudManagerAPI
Returns: Promise.<ContentSet> - the updated content set

Param Type Description
programId string The program id
contentSetId string The content set id
updatedContentSet string the body (JSON format)

cloudManagerAPI.updateIpAllowlist(programId, ipAllowlistId, cidrBlocks) ⇒ Promise.<object>

Update the CIDR blocks of an IP Allow List

Kind: instance method of CloudManagerAPI
Returns: Promise.<object> - a truthy value

Param Type Description
programId string the program id
ipAllowlistId string the allow list id
cidrBlocks Array.<string> the replacement CIDR blocks

cloudManagerAPI.updatePipeline(programId, pipelineId, changes) ⇒ Promise.<Pipeline>

Update a pipeline

Kind: instance method of CloudManagerAPI
Returns: Promise.<Pipeline> - the new pipeline definition

Param Type Description
programId string the program id
pipelineId string the pipeline id
changes PipelineUpdate the changes

getCurrentStep(execution) ⇒ PipelineExecutionStepState

Find the first non-finished step in a pipeline execution

Kind: global function
Returns: PipelineExecutionStepState - the step state or a falsy object if all steps are finished

Param Type Description
execution PipelineExecution the execution

getWaitingStep(execution) ⇒ PipelineExecutionStepState

Find the first waiting step in a pipeline execution

Kind: global function
Returns: PipelineExecutionStepState - the step state or a falsy object if no step is waiting

Param Type Description
execution PipelineExecution the execution

init(orgId, apiKey, accessToken, baseUrl) ⇒ Promise.<CloudManagerAPI>

Returns a Promise that resolves with a new CloudManagerAPI object.

Kind: global function
Returns: Promise.<CloudManagerAPI> - a Promise with a CloudManagerAPI object

Param Type Description
orgId string the organization id
apiKey string the API key for your integration
accessToken string the access token for your integration
baseUrl string the base URL to access the API (defaults to https://cloudmanager.adobe.io)

EmbeddedProgram : object

A lightweight representation of a Program

Kind: global typedef
Properties

Name Type Description
id string Identifier of the program. Unique within the space.
name string Name of the program
enabled boolean Whether this Program has been enabled for Cloud Manager usage
tenantId string Tenant Id
status string Status of the program
createdAt string Created time
updatedAt string Date of last change

Pipeline : object

A representation of a CI/CD Pipeline

Kind: global typedef
Properties

Name Type Description
id string Identifier of the pipeline. Unique within the program.
programId string Identifier of the program. Unique within the space.
name string Name of the pipeline
trigger string How should the execution be triggered. ON_COMMIT: each time one or more commits are pushed and the Pipeline is idle then a execution is triggered. MANUAL: triggerd through UI or API.
status string Pipeline status
createdAt string Create date
updatedAt string Update date
lastStartedAt string Last pipeline execution start
lastFinishedAt string Last pipeline execution end
phases Array.<PipelinePhase> Pipeline phases in execution order
type string Pipeline type

PipelinePhase : object

Describes a phase of a pipeline

Kind: global typedef
Properties

Name Type Description
name string Name of the phase
type string Type of the phase
repositoryId string Identifier of the source repository. The code from this repository will be build at the start of this phase. Mandatory if type=BUILD
branch string Name of the tracked branch or a fully qualified git tag (e.g. refs/tags/v1). Assumed to be master if missing.
environmentId string Identifier of the target environment. Mandatory if type=DEPLOY
environmentType string Type of environment (for example stage or prod, readOnly = true)
steps Array.<PipelineStep> Steps to be included in the phase in execution order. Might be added or not, depending on permissions or configuration

PipelineExecution : object

A representation of an execution of a CI/CD Pipeline.

Kind: global typedef
Properties

Name Type Description
id string Pipeline execution identifier
programId string Identifier of the program. Unique within the space.
pipelineId string Identifier of the pipeline. Unique within the space.
artifactsVersion string Version of the artifacts generated during this execution
user string AdobeID who started the pipeline. Empty for auto triggered builds
status string Status of the execution
trigger string How the execution was triggered.
pipelineExecutionMode string The mode in which the execution occurred. EMERGENCY mode will skip certain steps and is only available to select AMS customers
createdAt string Timestamp at which the execution was created
updatedAt string Timestamp at which the status of the execution last changed
finishedAt string Timestamp at which the execution completed
pipelineType string Pipeline type

PipelineExecutionStepState : object

Describes the status of a particular pipeline execution step for display purposes

Kind: global typedef
Properties

Name Type Description
id string
stepId string
phaseId string
action string Name of the action
repository string Target repository
branch string Target branch
environment string Target environment
environmentId string Target environment id
environmentType string Target environment type
startedAt string Timestamp at which the step state started running
finishedAt string Timestamp at which the step completed
commitId string Target commit id
details object Additional details of the step
status string Action status

PipelineStepMetrics : object

Kind: global typedef
Properties

Name Type Description
metrics Array.<Metric> metrics

Metric : object

A representation of a specific metric generated by a CI/CD Pipeline step.

Kind: global typedef
Properties

Name Type Description
id string KPI result identifier
severity string Severity of the metric
passed boolean Whether metric is considered passed
override boolean Whether user override the failed metric
actualValue string Expected value for the metric
expectedValue string Expected value for the metric
comparator string Comparator used for the metric
kpi string KPI identifier

Environment : object

A representation of an Environment known to Cloud Manager.

Kind: global typedef
Properties

Name Type Description
id string id
programId string Identifier of the program. Unique within the space.
name string Name of the environment
description string Description of the environment
type string Type of the environment
status string Status of the environment
region string Region of the environment
availableLogOptions Array.<LogOptionRepresentation> List of logs available in the environment

Variable : object

A named value than can be set on an Environment or Pipeline

Kind: global typedef
Properties

Name Type Description
name string Name of the variable. Can only consist of a-z, A-Z, _ and 0-9 and cannot begin with a number.
value string Value of the variable. Read-Write for non-secrets, write-only for secrets. The length of secretString values must be less than 500 characters. An empty value causes a variable to be deleted.
type string Type of the variable. Default string if missing. secretString variables are encrypted at rest. The type of a variable be changed after creation; the variable must be deleted and recreated.
service string Service of the variable. When not provided, the variable applies to all services. Currently the values 'author', 'publish', and 'preview' are supported. Note - this value is case-sensitive.
status string Status of the variable

ContentSet : object

A representation of a ContentSet custom

Kind: global typedef
Properties

Name Type Description
id string Identifier of the Content Set
name string The name of the content set
paths Array.<ContentSetPath> Included asset paths
programId string Identifier of the program. Unique within the space.
createdAt string Create date
updatedAt string Update date

ContentFlow : object

The Content Flow Execution

Kind: global typedef
Properties

Name Type Description
contentSetId string The content set id
contentSetName string The content set name
srcEnvironmentId string Source environment id
srcEnvironmentName string Source environment name
destEnvironmentId string Destination environment id
destEnvironmentName string Destination environment name
tier string The tier, for example author
status string Status of the flows
destProgramId string Destination program id
resultDetails undefined Details of this content flow result

LogOptionRepresentation : object

Kind: global typedef
Properties

Name Type Description
service string Name of the service in environment. Example: author
name string Name of the log for service in environment. Example: aemerror

IPAllowedListBinding : object

Describes an IP Allowed List Binding

Kind: global typedef
Properties

Name Type Description
id string Identifier of the IP Allowed List Binding to an Environment
tier string Tier of the environment.
status string Status of the binding.
programId string Identifier of the program.
ipAllowListId string Identifier of the IP allow list.
environmentId string Identifier of the environment.

IPAllowedList : object

Describes an IP Allowed List

Kind: global typedef
Properties

Name Type Description
id string Identifier of the IP Allowed List
name string Name of the IP Allowed List
ipCidrSet Array.<string> IP CIDR Set
programId string Identifier of the program.
bindings Array.<IPAllowedListBinding> IP Allowlist bindings

ListPipelineOptions : object

Options to the listPipeline function

Kind: global typedef
Properties

Name Type Description
busy boolean if true, only busy pipelines will be returned

DownloadedLog : object

Kind: global typedef
Properties

Name Type Description
path string the path where the log was stored
url string the url of the log that was downloaded

PipelineUpdate : object

Kind: global typedef
Properties

Name Type Description
branch string the new branch
repositoryId string the new repository id
devEnvironmentId string the new dev environment id
stageEnvironmentId string the new stage environment id
prodEnvironmentId string the new prod environment id

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.

aio-lib-cloudmanager's People

Contributors

jasonrpoteet avatar justinedelson avatar mbradoschi avatar moritzraho avatar pahupe avatar renovate-bot avatar renovate[bot] avatar rwalter215 avatar semantic-release-bot avatar snyk-bot avatar thoughtassassin avatar zygw avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

aio-lib-cloudmanager's Issues

Support IP Allowlist management

Expected Behaviour

There should be support for IP Allow list management in the SDK.

Actual Behaviour

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version

Sample Code that illustrates the problem

Logs taken while reproducing problem

If command is completed, tailCommerceCommandExecutionLog should pipe full log to output stream

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
If command is completed and nothing has been piped to output stream yet, tailCommerceCommandExecutionLog should pipe full log to output stream instead of erroring out.

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Commit messages with no space prior to the # mark are allowed

Expected Behavior

Valid commit messages which reference a GitHub issue should result in the issue being marked as released when the commit is released.

Actual Behavior

This mostly works, but doesn't if there is not a space between fixes and #. adobe/aio-cli-plugin-cloudmanager#409 shows an example.

This appears to be a bit of an incompatibility in the defaults between commitlint and semantic-release.

I'm not sure this has every happened in this repo, but the same change should be made here as in aio-cli-plugin-cloudmanager (mostly before I forget).

Not all problem types are handled

Anytime the API responds with an application/problem+json response, it may contain useful information. Currently, this information is swallowed except for validation types. The handling of these responses should be made more generic.

Dependency Dashboard

This issue lists Renovate updates and detected dependencies. Read the Dependency Dashboard docs to learn more.

Warning

These dependencies are deprecated:

Datasource Name Replacement PR?
npm codecov Unavailable
npm eslint-plugin-node Available
npm eslint-plugin-standard Unavailable

Rate-Limited

These updates are currently rate-limited. Click on a checkbox below to force their creation now.

  • chore(deps): replace dependency eslint-plugin-node with eslint-plugin-n 14.0.0
  • chore(deps): update dependency jsdoc to v3.6.11
  • chore(deps): update dependency del to v6.1.1
  • chore(deps): update dependency eol to v0.10.0
  • chore(deps): update dependency jscpd to v3.5.10
  • chore(deps): update actions/checkout action to v4
  • chore(deps): update actions/setup-node action to v4
  • chore(deps): update codecov/codecov-action action to v4
  • chore(deps): update commitlint monorepo to v19 (major) (@commitlint/cli, @commitlint/config-conventional)
  • chore(deps): update dependency @adobe/eslint-config-aio-lib-config to v4
  • chore(deps): update dependency del to v7
  • chore(deps): update dependency eslint to v9
  • chore(deps): update dependency eslint-plugin-jest to v28
  • chore(deps): update dependency eslint-plugin-jsdoc to v50
  • chore(deps): update dependency eslint-plugin-promise to v7
  • chore(deps): update dependency eslint-plugin-standard to v5
  • chore(deps): update dependency jest-extended to v4
  • chore(deps): update dependency jest-junit to v16
  • chore(deps): update dependency jscpd to v4
  • chore(deps): update dependency jsdoc to v4
  • chore(deps): update dependency jsdoc-to-markdown to v9
  • chore(deps): update dependency sinon to v19
  • fix(deps): update dependency @adobe/aio-lib-core-errors to v4
  • fix(deps): update dependency @adobe/aio-lib-core-logging to v3
  • fix(deps): update dependency @adobe/aio-lib-core-networking to v5
  • 🔐 Create all rate-limited PRs at once 🔐

Edited/Blocked

These updates have been manually edited so Renovate will no longer make changes. To discard all commits and start over, click on a checkbox.

Open

These updates have all been created already. Click a checkbox below to force a retry/rebase of any.

Detected dependencies

github-actions
.github/workflows/ci.yml
  • actions/checkout v3
  • actions/setup-node v3
  • codecov/codecov-action v2.1.0
.github/workflows/npm-publish.yml
  • mkiki/npm-publish-action c4315ef5790b7bcec2cbb75b34e37681a409d78d
.github/workflows/release.yml
  • actions/checkout v3
  • actions/setup-node v3
  • codecov/codecov-action v2.1.0
npm
package.json
  • @adobe/aio-lib-core-errors ^3.1.1
  • @adobe/aio-lib-core-logging ^2.0.0
  • @adobe/aio-lib-core-networking ^3.0.0
  • halfred ^2.0.0
  • lodash.clone ^4.5.0
  • lodash.clonedeep ^4.5.0
  • lodash.isobject ^3.0.2
  • urijs ^1.19.7
  • uritemplate ^0.3.4
  • @adobe/eslint-config-aio-lib-config 1.4.0
  • @commitlint/cli 16.2.1
  • @commitlint/config-conventional 16.2.1
  • @semantic-release/changelog 5.0.1
  • @semantic-release/git 9.0.1
  • codecov 3.8.3
  • command-line-tool 0.8.0
  • del 6.0.0
  • dotenv 16.0.0
  • eol 0.9.1
  • eslint 7.32.0
  • eslint-config-standard 16.0.3
  • eslint-plugin-import 2.25.4
  • eslint-plugin-jest 23.20.0
  • eslint-plugin-jsdoc 37.9.7
  • eslint-plugin-node 11.1.0
  • eslint-plugin-promise 5.2.0
  • eslint-plugin-standard 4.1.0
  • fetch-mock 9.11.0
  • handlebars 4.7.7
  • husky 5.2.0
  • jest 27.5.1
  • jest-extended 2.0.0
  • jest-junit 13.0.0
  • js-yaml 4.1.0
  • jscpd 3.4.5
  • jsdoc 3.6.10
  • jsdoc-to-markdown 7.1.1
  • lodash.sortby 4.7.0
  • pinst 3.0.0
  • semantic-release 17.4.7
  • sinon 13.0.1
  • stdout-stderr 0.1.13
  • tsd-jsdoc 2.5.0
  • node >=12

  • Check this box to trigger a request for Renovate to run again on this repository

Commerce Tail Logs

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
Commerce customers need to be able to retrieve tail logs for the various commands they run.

Describe the solution you'd like
A clear and concise description of what you want to happen.
We need to implement a function that calls the tail log endpoint and returns the output.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Update swagger link to main

The swagger file should be referenced from the main branch of AdobeDocs/cloudmanager-api-docs rather than the legacy master branch.

Library for Commerce CLI Command needs `getAllCommerceCommandExecutions` to be added

Commerce support for CLI needs to be able to Get All Commands and filter on them

A getAllCommerceCommandExecutions call will be created and will allow for filters to include:

  • type: type of call (i.e. bin/magento)
  • status: status of the call (i.e. FAILED, COMPLETED, etc)
  • command: the command to be passed to the api on the get all command.

Commerce tail log functionality should not error out if 204 is received

Expected Behavior
A 204 from commerce log endpoint means the api recognizes this request as valid, but the content (redirect log url) is not ready yet. In this case we should wait a certain amount of time, and then try again, not error out the function.

A clear and concise description of what the expected behavior was.
As of right now, the function errors out of on a 204
Actual Behavior

A clear and concise description of what the actual behavior was and how it was different.

Reproduction Scenario, Platform, and Version

Any relevant information about the preconditions to reproduce the issue.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

getCurrentStep should be exported

Expected Behaviour

The helper function getCurrentStep is needed by aio-cli-plugin-cloudmanager. During the initial refactoring, this was missed.

Actual Behaviour

It's not exported

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version

Sample Code that illustrates the problem

Logs taken while reproducing problem

Update Adobe dependencies in order to incorporate HTTP proxy fix

Expected Behavior

This library should be up to date, i.e. (transitively) incorporate fixes made in dependencies

Actual Behavior

The library is outdated. It references an old version of @adobe/aio-lib-core-networking and hence the http proxy logic is faulty (see adobe/aio-lib-core-networking#16).

Reproduction Scenario, Platform, and Version

Use the aio cli cloudmanager plugin (https://github.com/adobe/aio-cli-plugin-cloudmanager) with an http proxy. It won't be able to connect with the cloud manager API, since the proxy configuration is wrong (an http-proxy agent will be used where an https-proxy-agent should be used).

Steps to Reproduce

  1. Setup an http proxy (e.g. use squid)
  2. Run the aio cli cloudmanager plugin e2e tests with an HTTP proxy configured
  3. Calls to the Cloud Manager API will error out

Steps to Fix

  1. Create a new version of this library
  2. Bump up this library's dependency @adobe/aio-lib-core-networking to version 3.0.0
  3. Link the newly created version to aio-cli-cloudmanager
  4. And it will work
  5. While at it, fix this library's e2e tests

Create a new method which returns a new execution object upon creation

Expected Behaviour

It would be useful to expose the entire execution object rather than just a URL upon creation of a new execution. The current URL-returning method should be deprecated.

Actual Behaviour

When starting an execution, only the URL is available.

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version

Sample Code that illustrates the problem

Logs taken while reproducing problem

download log doesn't properly use error codes

Expected Behaviour

The function _downloads does not make property use of ErrorCodes -- in one case it simply constructs a new Error object and in the call to _get, it doesn't pass a proper constructor.

This can produce issues like adobe/aio-cli-plugin-cloudmanager#300, although this doesn't appear to be the cause of that specific issue.

Actual Behaviour

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version

Sample Code that illustrates the problem

Logs taken while reproducing problem

Inconsistent error handling in updatePipeline

Expected Behaviour

There is no error code for a failure to update pipeline. This should be made consistent.

Actual Behaviour

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version

Sample Code that illustrates the problem

Logs taken while reproducing problem

get logs does not properly use ErrorCodes

Expected Behaviour

The function _getLogs does not make property use of ErrorCodes -- in one case it simply constructs a new Error object and in the call to _get, it doesn't pass a proper constructor.

This can produce issues like adobe/aio-cli-plugin-cloudmanager#300

Actual Behaviour

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version

Sample Code that illustrates the problem

Logs taken while reproducing problem

API support needed to create emergency mode pipeline executions

Is your feature request related to a problem? Please describe.

Cloud Manager now supports an emergency mode for AMS production pipeline executions. The lib/cli need to support this.

Describe the solution you'd like

createExecution (programId, pipelineId, mode)

If mode is not passed, current behavior should be retained.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Incorrect current step when certain tests are missing

Expected Behavior

Getting the current step for a pipeline execution should return the first step that was not completed yet.

Actual Behavior

Getting the current step for a pipeline execution where tests steps (UI testing or functional testing) are marked as incomplete (as nothing is done during those steps) will return the incomplete step and not the proper current step (which may be approval step)

Reproduction Scenario, Platform, and Version

Have a program that has a Production environment, but no UI or functional tests.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to a program where there are no UI tests
  2. Start the Production CI_CD pipeline
  3. Wait for pipeline to reach approval step
  4. Run aio cloudmanager:current-execution:get <pipelineId> command and get the UI tests step instead of approval step

The new step status incomplete was added in 2023.6.0 release of Cloud Manager: https://experienceleague.adobe.com/en/docs/experience-manager-cloud-service/content/release-notes/cloud-manager/2023/2023-6-0

Commerce commands that accept args are ignoring the first argument passed

Expected Behavior
Command should pass all args to api, currently it ignores the first one
A clear and concise description of what the expected behavior was.

Actual Behavior

A clear and concise description of what the actual behavior was and how it was different.

Reproduction Scenario, Platform, and Version

Any relevant information about the preconditions to reproduce the issue.

Steps to Reproduce

Steps to reproduce the behavior:

  1. Go to '...'
  2. Click on '....'
  3. Scroll down to '....'
  4. See error

Better format for commerce tail logs

When the logs are shown for commerce command executions they are shown unformatted, which is hard to read and includes meta-data that is not necessary to show to the user. This should be cleaned up, so that only the log message is shown to the user.

advanceCurrentExecution doesn't make proper use of error codes

Expected Behaviour

Minor issue -- single case of new Error constructor usage

Actual Behaviour

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version

Sample Code that illustrates the problem

Logs taken while reproducing problem

Action Required: Fix Renovate Configuration

There is an error with this repository's Renovate configuration that needs to be fixed. As a precaution, Renovate will stop PRs until it is resolved.

Error type: Cannot find preset's package (github>whitesource/merge-confidence:beta)

Improve debug information for log tailing [environment]

Is your feature request related to a problem? Please describe.

When tailing a log, there's very limited debug information when something goes wrong.

Describe the solution you'd like

Something useful should be output when LOG_LEVEL is set to debug

ListProgramOptions should be named ListPipelineOptions

Expected Behaviour

The type ListProgramOptions is misnamed -- it should be ListPipelineOptions

Actual Behaviour

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version

Sample Code that illustrates the problem

Logs taken while reproducing problem

Add support for invalidating pipeline cache

Is your feature request related to a problem? Please describe.

The dependency cache for a pipeline can now be invalidated over API. That should be supported in the SDK.

Describe the solution you'd like

invalidatePipelineCache (programId, pipelineId)

Describe alternatives you've considered

Not doing this

Additional context
Add any other context or screenshots about the feature request here.

Should use lodash modules instead of entire library

Expected Behavior

Dependencies should be as small as possible.

Actual Behavior

At present, this library depends upon the full lodash library. This is overkill since there are only a few functions that are actually used.

Identify why fetch-mock 9.10.2 breaks download-log test

Expected Behaviour

Tests should pass with fetch-mock 9.10.2

Actual Behaviour

They fail -- the call to pipelineStream never finishes

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version

Sample Code that illustrates the problem

Logs taken while reproducing problem

[Commerce] commerce command "execution" HAL link is changing to "executions"

Is your feature request related to a problem? Please describe.
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]

Describe the solution you'd like
A clear and concise description of what you want to happen.

Describe alternatives you've considered
A clear and concise description of any alternative solutions or features you've considered.

Additional context
Add any other context or screenshots about the feature request here.

Some error responses are not JSON and result in an UnhandledPromiseRejectionWarning

Expected Behaviour

Error responses should be correctly handled in a consistent fashion.

Actual Behaviour

Certain invalid combinations of api keys and bearer tokens result in a response body of Unauthorized which is not properly handled, resulting in an UnhandledPromiseRejectionWarning.

Reproduce Scenario (including but not limited to)

To reproduce this, you generally will need multiple I/O integrations and use an access token from one with another one. There may be other scenarios though. But both the key and token must be valid (just not in combination with each other).

Steps to Reproduce

Make any SDK call with the bad combination

Platform and Version

Sample Code that illustrates the problem

Logs taken while reproducing problem

Add environmentId to generated pipeline step state type

Expected Behaviour

AdobeDocs/cloudmanager-api-docs@0fc1213#diff-9ab0ca02a4ed15d7f9138602968b77366ea68fed8cbeff4b07ed968bdd0c5293 added a previously undocumented property to the PipelineExecutionStepState type. This should be reflected in the generated documentation.

Actual Behaviour

Reproduce Scenario (including but not limited to)

Steps to Reproduce

Platform and Version

Sample Code that illustrates the problem

Logs taken while reproducing problem

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.