Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DX | 662 | install command api call #245

Merged
merged 3 commits into from
Jun 6, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -19,5 +19,3 @@ dependabot.yml
oclif.manifest.json
*.env
.vscode/
/app-boilerplate
/app-boilerplate+1
aman19K marked this conversation as resolved.
Show resolved Hide resolved
32 changes: 16 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ $ npm install -g @contentstack/apps-cli
$ csdx COMMAND
running command...
$ csdx (--version|-v)
@contentstack/apps-cli/1.1.0 darwin-arm64 node-v18.17.0
@contentstack/apps-cli/1.2.0 darwin-arm64 node-v18.16.0
$ csdx --help [COMMAND]
USAGE
$ csdx COMMAND
Expand Down Expand Up @@ -66,7 +66,7 @@ EXAMPLES
$ csdx app:reinstall
```

_See code: [src/commands/app/index.ts](https://github.com/contentstack/apps-cli/blob/v1.1.0/src/commands/app/index.ts)_
_See code: [src/commands/app/index.ts](https://github.com/contentstack/apps-cli/blob/v1.2.0/src/commands/app/index.ts)_

## `csdx app:create`

Expand All @@ -82,7 +82,7 @@ FLAGS
-n, --name=<value> [default: app-boilerplate] Name of the app to be created
--app-type=<option> [default: stack] Type of app
<options: stack|organization>
--org=<value> Provide the organization UID to fetch the app details for the desired operation.
--org=<value> Provide the organization UID to fetch the app details for the operation.

DESCRIPTION
Create a new app in Developer Hub and optionally clone a boilerplate locally.
Expand All @@ -97,7 +97,7 @@ EXAMPLES
$ csdx app:create --name App-3 --app-type organization --org <UID> -d ./boilerplate -c ./external-config.json
```

_See code: [src/commands/app/create.ts](https://github.com/contentstack/apps-cli/blob/v1.1.0/src/commands/app/create.ts)_
_See code: [src/commands/app/create.ts](https://github.com/contentstack/apps-cli/blob/v1.2.0/src/commands/app/create.ts)_

## `csdx app:delete`

Expand All @@ -109,7 +109,7 @@ USAGE

FLAGS
--app-uid=<value> Provide the app UID of an existing app.
--org=<value> Provide the organization UID to fetch the app details for the desired operation.
--org=<value> Provide the organization UID to fetch the app details for the operation.

DESCRIPTION
Delete app from marketplace
Expand All @@ -122,7 +122,7 @@ EXAMPLES
$ csdx app:delete --app-uid <value> --org <value> -d ./boilerplate
```

_See code: [src/commands/app/delete.ts](https://github.com/contentstack/apps-cli/blob/v1.1.0/src/commands/app/delete.ts)_
_See code: [src/commands/app/delete.ts](https://github.com/contentstack/apps-cli/blob/v1.2.0/src/commands/app/delete.ts)_

## `csdx app:get`

Expand All @@ -137,7 +137,7 @@ FLAGS
--app-type=<option> [default: stack] Type of app
<options: stack|organization>
--app-uid=<value> Provide the app UID of an existing app.
--org=<value> Provide the organization UID to fetch the app details for the desired operation.
--org=<value> Provide the organization UID to fetch the app details for the operation.

DESCRIPTION
Get details of an app in developer hub
Expand All @@ -152,7 +152,7 @@ EXAMPLES
$ csdx app:get --org <value> --app-uid <value> --app-type organization
```

_See code: [src/commands/app/get.ts](https://github.com/contentstack/apps-cli/blob/v1.1.0/src/commands/app/get.ts)_
_See code: [src/commands/app/get.ts](https://github.com/contentstack/apps-cli/blob/v1.2.0/src/commands/app/get.ts)_

## `csdx app:install`

Expand All @@ -164,7 +164,7 @@ USAGE

FLAGS
--app-uid=<value> Provide the app UID of an existing app.
--org=<value> Provide the organization UID to fetch the app details for the desired operation.
--org=<value> Provide the organization UID to fetch the app details for the operation.
--stack-api-key=<value> API key of the stack where the app operation is to be performed.

DESCRIPTION
Expand All @@ -178,7 +178,7 @@ EXAMPLES
$ csdx app:install --org <UID> --app-uid <APP-UID-1> --stack-api-key <STACK-API-KEY-1>
```

_See code: [src/commands/app/install.ts](https://github.com/contentstack/apps-cli/blob/v1.1.0/src/commands/app/install.ts)_
_See code: [src/commands/app/install.ts](https://github.com/contentstack/apps-cli/blob/v1.2.0/src/commands/app/install.ts)_

## `csdx app:reinstall`

Expand All @@ -190,7 +190,7 @@ USAGE

FLAGS
--app-uid=<value> Provide the app UID of an existing app.
--org=<value> Provide the organization UID to fetch the app details for the desired operation.
--org=<value> Provide the organization UID to fetch the app details for the operation.
--stack-api-key=<value> API key of the stack where the app operation is to be performed.

DESCRIPTION
Expand All @@ -204,7 +204,7 @@ EXAMPLES
$ csdx app:reinstall --org <UID> --app-uid <APP-UID-1> --stack-api-key <STACK-API-KEY-1>
```

_See code: [src/commands/app/reinstall.ts](https://github.com/contentstack/apps-cli/blob/v1.1.0/src/commands/app/reinstall.ts)_
_See code: [src/commands/app/reinstall.ts](https://github.com/contentstack/apps-cli/blob/v1.2.0/src/commands/app/reinstall.ts)_

## `csdx app:uninstall`

Expand All @@ -217,7 +217,7 @@ USAGE
FLAGS
--app-uid=<value> Provide the app UID of an existing app.
--installation-uid=<value> Provide the installation ID of the app that needs to be uninstalled.
--org=<value> Provide the organization UID to fetch the app details for the desired operation.
--org=<value> Provide the organization UID to fetch the app details for the operation.
--uninstall-all Please select stacks from where the app must be uninstalled.

DESCRIPTION
Expand All @@ -231,7 +231,7 @@ EXAMPLES
$ csdx app:uninstall --org <UID> --app-uid <APP-UID-1> --installation-uid <INSTALLATION-UID-1>
```

_See code: [src/commands/app/uninstall.ts](https://github.com/contentstack/apps-cli/blob/v1.1.0/src/commands/app/uninstall.ts)_
_See code: [src/commands/app/uninstall.ts](https://github.com/contentstack/apps-cli/blob/v1.2.0/src/commands/app/uninstall.ts)_

## `csdx app:update`

Expand All @@ -243,7 +243,7 @@ USAGE

FLAGS
--app-manifest=<value> Path to the app manifest.json file:
--org=<value> Provide the organization UID to fetch the app details for the desired operation.
--org=<value> Provide the organization UID to fetch the app details for the operation.

DESCRIPTION
Update the existing app in developer hub
Expand All @@ -254,5 +254,5 @@ EXAMPLES
$ csdx app:update --app-manifest ./boilerplate/manifest.json
```

_See code: [src/commands/app/update.ts](https://github.com/contentstack/apps-cli/blob/v1.1.0/src/commands/app/update.ts)_
_See code: [src/commands/app/update.ts](https://github.com/contentstack/apps-cli/blob/v1.2.0/src/commands/app/update.ts)_
<!-- commandsstop -->
4 changes: 2 additions & 2 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@contentstack/apps-cli",
"version": "1.1.0",
"version": "1.2.0",
"description": "App ClI",
"author": "Contentstack CLI",
"homepage": "https://github.com/contentstack/contentstack-apps-cli",
Expand Down
2 changes: 1 addition & 1 deletion src/commands/app/install.ts
Original file line number Diff line number Diff line change
Expand Up @@ -108,7 +108,7 @@ export default class Install extends AppCLIBaseCommand {
"info"
);
await installApp(this.flags, this.sharedConfig.org, appType, {
managementSdk: this.managementAppSdk,
marketplaceSdk: this.marketplaceAppSdk,
log: this.log,
});
this.log(
Expand Down
2 changes: 1 addition & 1 deletion src/messages/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ const errors = {
const commonMsg = {
CONFIG: "Path of the external config",
MAX_RETRY_LIMIT: "Maximum retry limit reached.",
PROVIDE_ORG_UID: "Provide the organization UID to fetch the app details for the desired operation.",
PROVIDE_ORG_UID: "Provide the organization UID to fetch the app details for the operation.",
CURRENT_WORKING_DIR: "Current working directory.",
SKIP_CONFIRMATION: "Use this flag to skip the confirmation.",
DEVELOPER_HUB_URL_PROMPT:
Expand Down
8 changes: 4 additions & 4 deletions src/util/common-utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -127,11 +127,11 @@ function installApp(
flags: FlagInput,
orgUid: string,
type: string,
options: CommonOptions
options: MarketPlaceOptions
) {
const { managementSdk } = options;
return managementSdk
.organization(orgUid)
const { marketplaceSdk } = options;
return marketplaceSdk
.marketplace(orgUid)
.app(flags["app-uid"] as any)
.install({
targetUid: (flags["stack-api-key"] as any) || orgUid,
Expand Down
Loading