404

[ Avaa Bypassed ]




Upload:

Command:

botdev@18.117.11.129: ~ $
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.AddCommand = void 0;
const color_1 = require("../../lib/color");
const errors_1 = require("../../lib/errors");
const executor_1 = require("../../lib/executor");
const core_1 = require("./core");
class AddCommand extends core_1.DeployConfCommand {
    async getMetadata() {
        return {
            name: 'add',
            type: 'project',
            groups: ["paid" /* PAID */],
            summary: 'Adds Appflow Deploy to the project',
            description: `
This command adds the Appflow Deploy plugin (${color_1.input('cordova-plugin-ionic')}) for both Capacitor and Cordova projects.

For Capacitor projects it runs all the steps necessary to install the plugin, sync with the native projects and add the configuration to the proper iOS and Android configuration files.

For Cordova projects it just takes care of running the proper Cordova CLI command with the submitted parameters.
      `,
            exampleCommands: [
                '',
                '--app-id=abcd1234 --channel-name="Master" --update-method=background',
                '--max-store=2 --min-background-duration=30',
                '--app-id=abcd1234 --channel-name="Master" --update-method=background --max-store=2 --min-background-duration=30',
            ],
            options: [
                {
                    name: 'app-id',
                    summary: 'Your Appflow app ID',
                    type: String,
                    spec: { value: 'id' },
                },
                {
                    name: 'channel-name',
                    summary: 'The channel to check for updates from',
                    type: String,
                    spec: { value: 'name' },
                },
                {
                    name: 'update-method',
                    summary: 'The update method that dictates the behavior of the plugin',
                    type: String,
                    spec: { value: 'name' },
                },
                {
                    name: 'max-store',
                    summary: 'The maximum number of downloaded versions to store on the device',
                    type: String,
                    groups: ["advanced" /* ADVANCED */],
                    spec: { value: 'quantity' },
                    default: '2',
                },
                {
                    name: 'min-background-duration',
                    summary: 'The minimum duration after which the app checks for an update in the background',
                    type: String,
                    groups: ["advanced" /* ADVANCED */],
                    spec: { value: 'seconds' },
                    default: '30',
                },
                {
                    name: 'update-api',
                    summary: 'The location of the Appflow API',
                    type: String,
                    groups: ["hidden" /* HIDDEN */],
                    spec: { value: 'url' },
                    default: 'https://api.ionicjs.com',
                },
            ],
        };
    }
    buildCordovaDeployOptions(options) {
        const optionsToCordova = {
            'app-id': 'APP_ID',
            'channel-name': 'CHANNEL_NAME',
            'update-method': 'UPDATE_METHOD',
            'max-store': 'MAX_STORE',
            'min-background-duration': 'MIN_BACKGROUND_DURATION',
            'update-api': 'UPDATE_API',
        };
        const outputOptions = [];
        for (const [optionKey, cordovaKey] of Object.entries(optionsToCordova)) {
            if (options[optionKey]) {
                outputOptions.push(`--variable`);
                outputOptions.push(`${cordovaKey}=${options[optionKey]}`);
            }
        }
        return outputOptions;
    }
    async preRun(inputs, options) {
        // check if it is already installed
        const alreadyAdded = await this.checkDeployInstalled();
        if (alreadyAdded) {
            throw new errors_1.FatalException(`Appflow Deploy plugin is already installed.`);
        }
        // check if there are native integration installed
        await this.requireNativeIntegration();
        await this.preRunCheckInputs(options);
    }
    async run(inputs, options, runinfo) {
        const integration = await this.getAppIntegration();
        if (integration === 'cordova') {
            let deployCommand = ['cordova', 'plugin', 'add', 'cordova-plugin-ionic'];
            const userOptions = this.buildCordovaDeployOptions(options);
            if (userOptions) {
                deployCommand = deployCommand.concat(userOptions);
            }
            await executor_1.runCommand(runinfo, deployCommand);
        }
        if (integration === 'capacitor') {
            const { pkgManagerArgs } = await Promise.resolve().then(() => require('../../lib/utils/npm'));
            const [installer, ...installerArgs] = await pkgManagerArgs(this.env.config.get('npmClient'), { command: 'install', pkg: 'cordova-plugin-ionic' });
            // install the plugin with npm
            await this.env.shell.run(installer, installerArgs, { stdio: 'inherit' });
            // generate the manifest
            await executor_1.runCommand(runinfo, ['deploy', 'manifest']);
            // run capacitor sync
            await executor_1.runCommand(runinfo, ['capacitor', 'sync']);
            // update the ios project if present
            await this.addConfToIosPlist(options);
            // update the android project if present
            await this.addConfToAndroidString(options);
        }
        this.env.log.ok(`Appflow Deploy plugin added to the project!\n`);
    }
}
exports.AddCommand = AddCommand;

Filemanager

Name Type Size Permission Actions
add.d.ts File 537 B 0644
add.js File 5.6 KB 0644
build.d.ts File 1012 B 0644
build.js File 7.81 KB 0644
configure.d.ts File 502 B 0644
configure.js File 5.14 KB 0644
core.d.ts File 1.44 KB 0644
core.js File 17.08 KB 0644
index.d.ts File 360 B 0644
index.js File 1.43 KB 0644
manifest.d.ts File 384 B 0644
manifest.js File 2.87 KB 0644