@contentstack/apps-cli 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +200 -0
- package/bin/dev +17 -0
- package/bin/dev.cmd +3 -0
- package/bin/run +5 -0
- package/bin/run.cmd +3 -0
- package/lib/commands/app/base-command.d.ts +51 -0
- package/lib/commands/app/base-command.js +123 -0
- package/lib/commands/app/create.d.ts +68 -0
- package/lib/commands/app/create.js +288 -0
- package/lib/commands/app/delete.d.ts +10 -0
- package/lib/commands/app/delete.js +72 -0
- package/lib/commands/app/get.d.ts +12 -0
- package/lib/commands/app/get.js +57 -0
- package/lib/commands/app/index.d.ts +7 -0
- package/lib/commands/app/index.js +35 -0
- package/lib/commands/app/install.d.ts +11 -0
- package/lib/commands/app/install.js +77 -0
- package/lib/commands/app/uninstall.d.ts +11 -0
- package/lib/commands/app/uninstall.js +51 -0
- package/lib/commands/app/update.d.ts +34 -0
- package/lib/commands/app/update.js +190 -0
- package/lib/config/index.d.ts +16 -0
- package/lib/config/index.js +20 -0
- package/lib/config/manifest.json +69 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +3 -0
- package/lib/messages/index.d.ts +83 -0
- package/lib/messages/index.js +101 -0
- package/lib/types/app.d.ts +101 -0
- package/lib/types/app.js +29 -0
- package/lib/types/index.d.ts +2 -0
- package/lib/types/index.js +5 -0
- package/lib/types/utils.d.ts +18 -0
- package/lib/types/utils.js +2 -0
- package/lib/util/common-utils.d.ts +18 -0
- package/lib/util/common-utils.js +148 -0
- package/lib/util/fs.d.ts +2 -0
- package/lib/util/fs.js +36 -0
- package/lib/util/index.d.ts +4 -0
- package/lib/util/index.js +9 -0
- package/lib/util/inquirer.d.ts +34 -0
- package/lib/util/inquirer.js +198 -0
- package/lib/util/log.d.ts +41 -0
- package/lib/util/log.js +150 -0
- package/package.json +99 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2023 Contentstack
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,200 @@
|
|
|
1
|
+
<!-- Insert Nodejs CI here -->
|
|
2
|
+
<!-- Insert Apps CLI version here -->
|
|
3
|
+
|
|
4
|
+
# @contentstack/apps-cli
|
|
5
|
+
Contentstack lets you develop apps in your organization using the Developer Hub portal. With the Apps CLI plugin, Contentstack CLI allows you to perform the CRUD operations on your app in Developer Hub and then use the app in your organization or stack by installing or uninstalling your app as required.
|
|
6
|
+
|
|
7
|
+
## How to install this plugin
|
|
8
|
+
|
|
9
|
+
```shell
|
|
10
|
+
$ csdx plugins:install @contentstack/apps-cli
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## How to use this plugin
|
|
14
|
+
|
|
15
|
+
This plugin requires you to be authenticated using [csdx auth:login](https://www.contentstack.com/docs/developers/cli/authenticate-with-the-cli/).
|
|
16
|
+
|
|
17
|
+
<!-- usage -->
|
|
18
|
+
```sh-session
|
|
19
|
+
$ npm install -g @contentstack/apps-cli
|
|
20
|
+
$ csdx COMMAND
|
|
21
|
+
running command...
|
|
22
|
+
$ csdx (--version|-v)
|
|
23
|
+
@contentstack/apps-cli/1.0.0 darwin-arm64 node-v20.3.1
|
|
24
|
+
$ csdx --help [COMMAND]
|
|
25
|
+
USAGE
|
|
26
|
+
$ csdx COMMAND
|
|
27
|
+
...
|
|
28
|
+
```
|
|
29
|
+
<!-- usagestop -->
|
|
30
|
+
|
|
31
|
+
# Commands
|
|
32
|
+
<!-- commands -->
|
|
33
|
+
* [`csdx app:create`](#csdx-appcreate)
|
|
34
|
+
* [`csdx app:delete`](#csdx-appdelete)
|
|
35
|
+
* [`csdx app:get`](#csdx-appget)
|
|
36
|
+
* [`csdx app:install`](#csdx-appinstall)
|
|
37
|
+
* [`csdx app:uninstall`](#csdx-appuninstall)
|
|
38
|
+
* [`csdx app:update`](#csdx-appupdate)
|
|
39
|
+
|
|
40
|
+
## `csdx app:create`
|
|
41
|
+
|
|
42
|
+
Create a new app in Developer Hub and optionally clone a boilerplate locally.
|
|
43
|
+
|
|
44
|
+
```
|
|
45
|
+
USAGE
|
|
46
|
+
$ csdx app:create [--org <value>] [-n <value>] [--app-type stack|organization] [-c <value>] [-d <value>]
|
|
47
|
+
|
|
48
|
+
FLAGS
|
|
49
|
+
-c, --config=<value> Path of the external config
|
|
50
|
+
-d, --data-dir=<value> Current working directory.
|
|
51
|
+
-n, --name=<value> Name of the app to be created
|
|
52
|
+
--app-type=<option> [default: stack] Type of App
|
|
53
|
+
<options: stack|organization>
|
|
54
|
+
--org=<value> Provide the organization UID
|
|
55
|
+
|
|
56
|
+
DESCRIPTION
|
|
57
|
+
Create a new app in Developer Hub and optionally clone a boilerplate locally.
|
|
58
|
+
|
|
59
|
+
EXAMPLES
|
|
60
|
+
$ csdx app:create
|
|
61
|
+
|
|
62
|
+
$ csdx app:create --name App-1 --app-type stack
|
|
63
|
+
|
|
64
|
+
$ csdx app:create --name App-2 --app-type stack -d ./boilerplate
|
|
65
|
+
|
|
66
|
+
$ csdx app:create --name App-3 --app-type organization --org <UID> -d ./boilerplate -c ./external-config.json
|
|
67
|
+
```
|
|
68
|
+
|
|
69
|
+
_See code: [src/commands/app/create.ts](https://github.com/contentstack/apps-cli/blob/v1.0.0/src/commands/app/create.ts)_
|
|
70
|
+
|
|
71
|
+
## `csdx app:delete`
|
|
72
|
+
|
|
73
|
+
Delete app from marketplace
|
|
74
|
+
|
|
75
|
+
```
|
|
76
|
+
USAGE
|
|
77
|
+
$ csdx app:delete [--org <value>] [--app-uid <value>]
|
|
78
|
+
|
|
79
|
+
FLAGS
|
|
80
|
+
--app-uid=<value> Provide the app UID
|
|
81
|
+
--org=<value> Provide the organization UID
|
|
82
|
+
|
|
83
|
+
DESCRIPTION
|
|
84
|
+
Delete app from marketplace
|
|
85
|
+
|
|
86
|
+
EXAMPLES
|
|
87
|
+
$ csdx app:delete
|
|
88
|
+
|
|
89
|
+
$ csdx app:delete --app-uid <value>
|
|
90
|
+
|
|
91
|
+
$ csdx app:delete --app-uid <value> --org <value> -d ./boilerplate
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
_See code: [src/commands/app/delete.ts](https://github.com/contentstack/apps-cli/blob/v1.0.0/src/commands/app/delete.ts)_
|
|
95
|
+
|
|
96
|
+
## `csdx app:get`
|
|
97
|
+
|
|
98
|
+
Get details of an app in developer hub
|
|
99
|
+
|
|
100
|
+
```
|
|
101
|
+
USAGE
|
|
102
|
+
$ csdx app:get [--org <value>] [--app-uid <value>] [--app-type stack|organization] [-d <value>]
|
|
103
|
+
|
|
104
|
+
FLAGS
|
|
105
|
+
-d, --data-dir=<value> Current working directory.
|
|
106
|
+
--app-type=<option> [default: stack] Type of App
|
|
107
|
+
<options: stack|organization>
|
|
108
|
+
--app-uid=<value> Provide the app UID
|
|
109
|
+
--org=<value> Provide the organization UID
|
|
110
|
+
|
|
111
|
+
DESCRIPTION
|
|
112
|
+
Get details of an app in developer hub
|
|
113
|
+
|
|
114
|
+
EXAMPLES
|
|
115
|
+
$ csdx app:get
|
|
116
|
+
|
|
117
|
+
$ csdx app:get --org <value> --app-uid <value>
|
|
118
|
+
|
|
119
|
+
$ csdx app:get --org <value> --app-uid <value> --app-type stack
|
|
120
|
+
|
|
121
|
+
$ csdx app:get --org <value> --app-uid <value> --app-type organization
|
|
122
|
+
```
|
|
123
|
+
|
|
124
|
+
_See code: [src/commands/app/get.ts](https://github.com/contentstack/apps-cli/blob/v1.0.0/src/commands/app/get.ts)_
|
|
125
|
+
|
|
126
|
+
## `csdx app:install`
|
|
127
|
+
|
|
128
|
+
Install an app from the marketplace
|
|
129
|
+
|
|
130
|
+
```
|
|
131
|
+
USAGE
|
|
132
|
+
$ csdx app:install [--org <value>] [--app-uid <value>] [--stack-api-key <value>]
|
|
133
|
+
|
|
134
|
+
FLAGS
|
|
135
|
+
--app-uid=<value> Provide the app UID
|
|
136
|
+
--org=<value> Provide the organization UID
|
|
137
|
+
--stack-api-key=<value> API key of the stack where the app is to be installed.
|
|
138
|
+
|
|
139
|
+
DESCRIPTION
|
|
140
|
+
Install an app from the marketplace
|
|
141
|
+
|
|
142
|
+
EXAMPLES
|
|
143
|
+
$ csdx app:install
|
|
144
|
+
|
|
145
|
+
$ csdx app:install --org <UID> --app-uid <APP-UID-1>
|
|
146
|
+
|
|
147
|
+
$ csdx app:install --org <UID> --app-uid <APP-UID-1> --stack-api-key <STACK-API-KEY-1>
|
|
148
|
+
```
|
|
149
|
+
|
|
150
|
+
_See code: [src/commands/app/install.ts](https://github.com/contentstack/apps-cli/blob/v1.0.0/src/commands/app/install.ts)_
|
|
151
|
+
|
|
152
|
+
## `csdx app:uninstall`
|
|
153
|
+
|
|
154
|
+
Uninstall an app
|
|
155
|
+
|
|
156
|
+
```
|
|
157
|
+
USAGE
|
|
158
|
+
$ csdx app:uninstall [--org <value>] [--app-uid <value>] [--installation-uid <value>]
|
|
159
|
+
|
|
160
|
+
FLAGS
|
|
161
|
+
--app-uid=<value> Provide the app UID
|
|
162
|
+
--installation-uid=<value> Provide the installation ID of the app that needs to be uninstalled.
|
|
163
|
+
--org=<value> Provide the organization UID
|
|
164
|
+
|
|
165
|
+
DESCRIPTION
|
|
166
|
+
Uninstall an app
|
|
167
|
+
|
|
168
|
+
EXAMPLES
|
|
169
|
+
$ csdx app:uninstall
|
|
170
|
+
|
|
171
|
+
$ csdx app:uninstall --org <UID> --app-uid <APP-UID-1>
|
|
172
|
+
|
|
173
|
+
$ csdx app:uninstall --org <UID> --app-uid <APP-UID-1> --installation-uid <INSTALLATION-UID-1>
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
_See code: [src/commands/app/uninstall.ts](https://github.com/contentstack/apps-cli/blob/v1.0.0/src/commands/app/uninstall.ts)_
|
|
177
|
+
|
|
178
|
+
## `csdx app:update`
|
|
179
|
+
|
|
180
|
+
Update the existing app in developer hub
|
|
181
|
+
|
|
182
|
+
```
|
|
183
|
+
USAGE
|
|
184
|
+
$ csdx app:update [--org <value>] [--app-manifest <value>]
|
|
185
|
+
|
|
186
|
+
FLAGS
|
|
187
|
+
--app-manifest=<value> Path to the app manifest.json file:
|
|
188
|
+
--org=<value> Provide the organization UID
|
|
189
|
+
|
|
190
|
+
DESCRIPTION
|
|
191
|
+
Update the existing app in developer hub
|
|
192
|
+
|
|
193
|
+
EXAMPLES
|
|
194
|
+
$ csdx app:update
|
|
195
|
+
|
|
196
|
+
$ csdx app:update --app-manifest ./boilerplate/manifest.json
|
|
197
|
+
```
|
|
198
|
+
|
|
199
|
+
_See code: [src/commands/app/update.ts](https://github.com/contentstack/apps-cli/blob/v1.0.0/src/commands/app/update.ts)_
|
|
200
|
+
<!-- commandsstop -->
|
package/bin/dev
ADDED
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
require("dotenv").config();
|
|
3
|
+
const oclif = require('@oclif/core')
|
|
4
|
+
|
|
5
|
+
const path = require('path')
|
|
6
|
+
const project = path.join(__dirname, '..', 'tsconfig.json')
|
|
7
|
+
|
|
8
|
+
// In dev mode -> use ts-node and dev plugins
|
|
9
|
+
process.env.NODE_ENV = 'development'
|
|
10
|
+
|
|
11
|
+
require("ts-node").register({ project });
|
|
12
|
+
|
|
13
|
+
// In dev mode, always show stack traces
|
|
14
|
+
oclif.settings.debug = true;
|
|
15
|
+
|
|
16
|
+
// Start the CLI
|
|
17
|
+
oclif.run().then(oclif.flush).catch(oclif.Errors.handle)
|
package/bin/dev.cmd
ADDED
package/bin/run
ADDED
package/bin/run.cmd
ADDED
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { Command } from "@contentstack/cli-command";
|
|
2
|
+
import { FlagInput, Interfaces, ContentstackClient, InquirePayload } from "@contentstack/cli-utilities";
|
|
3
|
+
import { ConfigType, LogFn } from "../../types";
|
|
4
|
+
import { Logger } from "../../util";
|
|
5
|
+
import messages from "../../messages";
|
|
6
|
+
export type Flags<T extends typeof Command> = Interfaces.InferredFlags<(typeof BaseCommand)["baseFlags"] & T["flags"]>;
|
|
7
|
+
export type Args<T extends typeof Command> = Interfaces.InferredArgs<T["args"]>;
|
|
8
|
+
export declare abstract class BaseCommand<T extends typeof Command> extends Command {
|
|
9
|
+
log: LogFn;
|
|
10
|
+
logger: Logger;
|
|
11
|
+
readonly $t: (msg: string, args: Record<string, string>) => string;
|
|
12
|
+
developerHubBaseUrl: string;
|
|
13
|
+
protected sharedConfig: ConfigType;
|
|
14
|
+
readonly messages: typeof messages;
|
|
15
|
+
protected managementSdk: ContentstackClient;
|
|
16
|
+
protected managementAppSdk: ContentstackClient;
|
|
17
|
+
protected flags: Flags<T>;
|
|
18
|
+
protected args: Args<T>;
|
|
19
|
+
static hidden: boolean;
|
|
20
|
+
static baseFlags: FlagInput;
|
|
21
|
+
init(): Promise<void>;
|
|
22
|
+
protected catch(err: Error & {
|
|
23
|
+
exitCode?: number;
|
|
24
|
+
}): Promise<any>;
|
|
25
|
+
protected finally(_: Error | undefined): Promise<any>;
|
|
26
|
+
/**
|
|
27
|
+
* @method registerConfig
|
|
28
|
+
*
|
|
29
|
+
* @memberof BaseCommand
|
|
30
|
+
*/
|
|
31
|
+
registerConfig(): void;
|
|
32
|
+
/**
|
|
33
|
+
* @method initCmaSDK
|
|
34
|
+
*
|
|
35
|
+
* @memberof BaseCommand
|
|
36
|
+
*/
|
|
37
|
+
initCmaSDK(): Promise<void>;
|
|
38
|
+
/**
|
|
39
|
+
* @method getValPrompt
|
|
40
|
+
*
|
|
41
|
+
* @param {(Partial<InquirePayload> & Record<string, any>)} [options={
|
|
42
|
+
* validate: (val) => {
|
|
43
|
+
* if (!val) return this.messages.NOT_EMPTY;
|
|
44
|
+
* return true;
|
|
45
|
+
* },
|
|
46
|
+
* }]
|
|
47
|
+
* @return {*} {(Promise<string | boolean>)}
|
|
48
|
+
* @memberof BaseCommand
|
|
49
|
+
*/
|
|
50
|
+
getValPrompt(options?: Partial<InquirePayload> & Record<string, any>): Promise<string | boolean>;
|
|
51
|
+
}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BaseCommand = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const omit_1 = tslib_1.__importDefault(require("lodash/omit"));
|
|
6
|
+
const merge_1 = tslib_1.__importDefault(require("lodash/merge"));
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const cli_command_1 = require("@contentstack/cli-command");
|
|
9
|
+
const cli_utilities_1 = require("@contentstack/cli-utilities");
|
|
10
|
+
const config_1 = tslib_1.__importDefault(require("../../config"));
|
|
11
|
+
const util_1 = require("../../util");
|
|
12
|
+
const messages_1 = tslib_1.__importStar(require("../../messages"));
|
|
13
|
+
class BaseCommand extends cli_command_1.Command {
|
|
14
|
+
constructor() {
|
|
15
|
+
super(...arguments);
|
|
16
|
+
this.$t = messages_1.$t;
|
|
17
|
+
this.sharedConfig = Object.assign(Object.assign({}, config_1.default), { projectBasePath: process.cwd() });
|
|
18
|
+
this.messages = Object.assign({}, messages_1.default);
|
|
19
|
+
}
|
|
20
|
+
async init() {
|
|
21
|
+
await super.init();
|
|
22
|
+
const { args, flags } = await this.parse({
|
|
23
|
+
flags: this.ctor.flags,
|
|
24
|
+
baseFlags: super.ctor.baseFlags,
|
|
25
|
+
args: this.ctor.args,
|
|
26
|
+
strict: this.ctor.strict,
|
|
27
|
+
});
|
|
28
|
+
this.flags = flags;
|
|
29
|
+
this.args = args;
|
|
30
|
+
cli_utilities_1.cliux.registerSearchPlugin();
|
|
31
|
+
this.registerConfig();
|
|
32
|
+
this.developerHubBaseUrl =
|
|
33
|
+
this.sharedConfig.developerHubBaseUrl || (await (0, util_1.getDeveloperHubUrl)());
|
|
34
|
+
await this.initCmaSDK();
|
|
35
|
+
// Init logger
|
|
36
|
+
const logger = new util_1.Logger(this.sharedConfig);
|
|
37
|
+
this.log = logger.log.bind(logger);
|
|
38
|
+
}
|
|
39
|
+
async catch(err) {
|
|
40
|
+
// add any custom logic to handle errors from the command
|
|
41
|
+
// or simply return the parent class error handling
|
|
42
|
+
return super.catch(err);
|
|
43
|
+
}
|
|
44
|
+
async finally(_) {
|
|
45
|
+
// called after run and catch regardless of whether or not the command errored
|
|
46
|
+
return super.finally(_);
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* @method registerConfig
|
|
50
|
+
*
|
|
51
|
+
* @memberof BaseCommand
|
|
52
|
+
*/
|
|
53
|
+
registerConfig() {
|
|
54
|
+
if (this.flags.config && (0, fs_1.existsSync)(this.flags.config)) {
|
|
55
|
+
try {
|
|
56
|
+
const config = JSON.parse((0, fs_1.readFileSync)(this.flags.config, { encoding: "utf-8" }));
|
|
57
|
+
const omitKeys = [
|
|
58
|
+
"manifestPath",
|
|
59
|
+
"boilerplateName",
|
|
60
|
+
"developerHubUrls",
|
|
61
|
+
];
|
|
62
|
+
this.sharedConfig = (0, merge_1.default)(this.sharedConfig, (0, omit_1.default)(config, omitKeys));
|
|
63
|
+
}
|
|
64
|
+
catch (error) { }
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* @method initCmaSDK
|
|
69
|
+
*
|
|
70
|
+
* @memberof BaseCommand
|
|
71
|
+
*/
|
|
72
|
+
async initCmaSDK() {
|
|
73
|
+
cli_utilities_1.managementSDKInitiator.init(this.context);
|
|
74
|
+
this.managementSdk = await (0, cli_utilities_1.managementSDKClient)({
|
|
75
|
+
host: this.cmaHost,
|
|
76
|
+
});
|
|
77
|
+
this.managementAppSdk = await (0, cli_utilities_1.managementSDKClient)({
|
|
78
|
+
host: this.developerHubBaseUrl,
|
|
79
|
+
});
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* @method getValPrompt
|
|
83
|
+
*
|
|
84
|
+
* @param {(Partial<InquirePayload> & Record<string, any>)} [options={
|
|
85
|
+
* validate: (val) => {
|
|
86
|
+
* if (!val) return this.messages.NOT_EMPTY;
|
|
87
|
+
* return true;
|
|
88
|
+
* },
|
|
89
|
+
* }]
|
|
90
|
+
* @return {*} {(Promise<string | boolean>)}
|
|
91
|
+
* @memberof BaseCommand
|
|
92
|
+
*/
|
|
93
|
+
getValPrompt(options = {
|
|
94
|
+
message: "Enter value",
|
|
95
|
+
validate: (val) => {
|
|
96
|
+
if (!val)
|
|
97
|
+
return this.$t(this.messages.NOT_EMPTY, { value: "Value" });
|
|
98
|
+
return true;
|
|
99
|
+
},
|
|
100
|
+
}) {
|
|
101
|
+
const { name = "getVal", message, validate } = options;
|
|
102
|
+
return cli_utilities_1.cliux.inquire({
|
|
103
|
+
validate,
|
|
104
|
+
name,
|
|
105
|
+
type: "input",
|
|
106
|
+
default: options === null || options === void 0 ? void 0 : options.default,
|
|
107
|
+
message: message,
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
}
|
|
111
|
+
exports.BaseCommand = BaseCommand;
|
|
112
|
+
BaseCommand.hidden = true;
|
|
113
|
+
// NOTE define flags that can be inherited by any command that extends BaseCommand
|
|
114
|
+
BaseCommand.baseFlags = {
|
|
115
|
+
org: cli_utilities_1.Flags.string({
|
|
116
|
+
description: messages_1.commonMsg.PROVIDE_ORG_UID,
|
|
117
|
+
}),
|
|
118
|
+
yes: cli_utilities_1.Flags.boolean({
|
|
119
|
+
char: "y",
|
|
120
|
+
hidden: true,
|
|
121
|
+
description: messages_1.commonMsg.SKIP_CONFIRMATION,
|
|
122
|
+
}),
|
|
123
|
+
};
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { BaseCommand } from "./base-command";
|
|
2
|
+
export default class Create extends BaseCommand<typeof Create> {
|
|
3
|
+
private appData;
|
|
4
|
+
static hidden: boolean;
|
|
5
|
+
static description: string;
|
|
6
|
+
static examples: string[];
|
|
7
|
+
static flags: {
|
|
8
|
+
name: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
9
|
+
"app-type": import("@oclif/core/lib/interfaces").OptionFlag<string, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
10
|
+
config: import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
11
|
+
"data-dir": import("@oclif/core/lib/interfaces").OptionFlag<string | undefined, import("@oclif/core/lib/interfaces/parser").CustomOptions>;
|
|
12
|
+
};
|
|
13
|
+
run(): Promise<void>;
|
|
14
|
+
/**
|
|
15
|
+
* @method boilerplateFlow
|
|
16
|
+
*
|
|
17
|
+
* @memberof Create
|
|
18
|
+
*/
|
|
19
|
+
boilerplateFlow(): Promise<void>;
|
|
20
|
+
/**
|
|
21
|
+
* @method promptQueue
|
|
22
|
+
*
|
|
23
|
+
* @memberof Create
|
|
24
|
+
*/
|
|
25
|
+
flagsPromptQueue(): Promise<void>;
|
|
26
|
+
/**
|
|
27
|
+
* @method cloneBoilerplate
|
|
28
|
+
*
|
|
29
|
+
* @return {*} {Promise<string>}
|
|
30
|
+
* @memberof Create
|
|
31
|
+
*/
|
|
32
|
+
cloneBoilerplate(): Promise<string>;
|
|
33
|
+
/**
|
|
34
|
+
* @method unZipBoilerplate
|
|
35
|
+
*
|
|
36
|
+
* @param {string} filepath
|
|
37
|
+
* @memberof Create
|
|
38
|
+
*/
|
|
39
|
+
unZipBoilerplate(filepath: string): Promise<void>;
|
|
40
|
+
/**
|
|
41
|
+
* @method registerTheAppOnDeveloperHub
|
|
42
|
+
*
|
|
43
|
+
* @param {boolean} [saveManifest=true]
|
|
44
|
+
* @memberof Create
|
|
45
|
+
*/
|
|
46
|
+
registerTheAppOnDeveloperHub(saveManifest?: boolean, retry?: number): Promise<void>;
|
|
47
|
+
/**
|
|
48
|
+
* @method rollbackBoilerplate
|
|
49
|
+
*
|
|
50
|
+
* @memberof Create
|
|
51
|
+
*/
|
|
52
|
+
rollbackBoilerplate(): void;
|
|
53
|
+
/**
|
|
54
|
+
* @method manageNameConflict
|
|
55
|
+
*
|
|
56
|
+
* @param {boolean} saveManifest
|
|
57
|
+
* @param {number} retry
|
|
58
|
+
* @return {*} {Promise<void>}
|
|
59
|
+
* @memberof Create
|
|
60
|
+
*/
|
|
61
|
+
manageNameConflict(saveManifest: boolean, retry: number): Promise<void>;
|
|
62
|
+
/**
|
|
63
|
+
* @method installDependencies
|
|
64
|
+
*
|
|
65
|
+
* @memberof Create
|
|
66
|
+
*/
|
|
67
|
+
installDependencies(): Promise<void>;
|
|
68
|
+
}
|