1.0.12 • Published 8 months ago

@sap-ux/abap-deploy-config-inquirer v1.0.12

Weekly downloads
-
License
Apache-2.0
Repository
github
Last release
8 months ago

@sap-ux/abap-deploy-config-inquirer

Provides Inquirer based end-user prompting to retrieve the ABAP deployment configuration for an application. This involves acquiring a connection to the chosen backend system and retrieving the associated packages and transport requests for the system.

Installation

Npm npm install --save @sap-ux/abap-deploy-config-inquirer

Yarn yarn add @sap-ux/abap-deploy-config-inquirer

Pnpm pnpm add @sap-ux/abap-deploy-config-inquirer

Explainer

Prompts may be retrieved using getPrompts and then executed in another prompting module that supports inquirer type prompts.

getPrompts is provided to allow consumers to access prompts. There may be cases where these can be transformed to support other prompting frameworks. Most prompt configuration is possible via AbapDeployConfigPromptOptions and calling prompt. This is the recommended approach.

Configurability of prompts is entirely controlled using the AbapDeployConfigPromptOptions parameter.

See Inquirer.js for valid default properties.

ABAP Deploy Config Inquirer usage example:

import type { InquirerAdapter } from '@sap-ux/inquirer-common';
import type { AbapDeployConfigAnswers, AbapDeployConfigPromptOptions } from '@sap-ux/abap-deploy-config-inquirer';
import { prompt as abapDeployConfigPrompt } from '@sap-ux/abap-deploy-config-inquirer';
import { generate as generateAbapDeployConfig } from '@sap-ux/odata-service-writer'

const promptOptions = {
    backendTarget: {
        abapTarget: {
            url: 'https://example.com',
            client: '100',
            scp: false
        },
        serviceProvider: serviceProvider, // connected abap service provider
        type: 'application'
    }
};

/**
 * Pass an Inquirer prompt function https://www.npmjs.com/package/inquirer#methods
 */
const inqAdaptor = {
    prompt: this.prompt.bind(this) // the inquirer prompting function, here we use the generators reference
};

const abapDeployConfigAnswers: AbapDeployConfigAnswers = await abapDeployConfigPrompt(
    inqAdaptor as InquirerAdapter,
    promptOpts
);

const projectDir = join(__dirname, 'testapp');
await generateAbapDeployConfig(
        projectDir,
        {
            target: {
                url: abapDeployConfigAnswers.url,
                client: abapDeployConfigAnswers.client,
                scp: abapDeployConfigAnswers.scp,
                destination: abapDeployConfigAnswers.destination
            },
            app: {
                name: abapDeployConfigAnswers.name,
                description: abapDeployConfigAnswers.description,
                package: abapDeployConfigAnswers.package,
                transport: abapDeployConfigAnswers.transport
            },
            index: abapDeployConfigAnswers.index
        },
        {
            baseFile: '/path/to/base/config', // e.g ui5.yaml
            deployFile: '/path/to/deploy/config', // e.g ui5-deploy.yaml
        },
        this.fs
    );

License

Read License.

Keywords

SAP UI5 Application Inquirer Prompting Generator Deployment

1.0.9

8 months ago

1.0.11

8 months ago

1.0.10

8 months ago

1.0.12

8 months ago

1.0.8

8 months ago

1.0.7

8 months ago

1.0.6

8 months ago

1.0.5

8 months ago

1.0.4

8 months ago

1.0.2

8 months ago

1.0.1

8 months ago

1.0.0

8 months ago

1.0.3

8 months ago

0.0.21

9 months ago

0.0.22

9 months ago

0.0.23

8 months ago

0.0.24

8 months ago

0.0.25

8 months ago

0.0.20

9 months ago

0.0.18

9 months ago

0.0.19

9 months ago

0.0.14

9 months ago

0.0.15

9 months ago

0.0.16

9 months ago

0.0.17

9 months ago

0.0.11

9 months ago

0.0.12

9 months ago

0.0.13

9 months ago

0.0.10

9 months ago

0.0.9

10 months ago

0.0.8

10 months ago

0.0.5

10 months ago

0.0.7

10 months ago

0.0.6

10 months ago

0.0.4

10 months ago

0.0.3

10 months ago

0.0.2

10 months ago

0.0.1

10 months ago