Skip to content

Commit 777e848

Browse files
authored
Merge pull request #249 from contentstack/staging
DX | 11-04-2024 | Release
2 parents 077f111 + 79f8cd9 commit 777e848

File tree

16 files changed

+84
-67
lines changed

16 files changed

+84
-67
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,4 +18,4 @@ dependabot.yml
1818
.editorconfig
1919
oclif.manifest.json
2020
*.env
21-
.vscode/
21+
.vscode/

README.md

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ $ npm install -g @contentstack/apps-cli
2020
$ csdx COMMAND
2121
running command...
2222
$ csdx (--version|-v)
23-
@contentstack/apps-cli/1.1.0 darwin-arm64 node-v18.17.0
23+
@contentstack/apps-cli/1.1.1 darwin-arm64 node-v18.16.0
2424
$ csdx --help [COMMAND]
2525
USAGE
2626
$ csdx COMMAND
@@ -66,7 +66,7 @@ EXAMPLES
6666
$ csdx app:reinstall
6767
```
6868

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

7171
## `csdx app:create`
7272

@@ -82,7 +82,7 @@ FLAGS
8282
-n, --name=<value> [default: app-boilerplate] Name of the app to be created
8383
--app-type=<option> [default: stack] Type of app
8484
<options: stack|organization>
85-
--org=<value> Provide the organization UID to fetch the app details for the desired operation.
85+
--org=<value> Provide the organization UID to fetch the app details for the operation.
8686
8787
DESCRIPTION
8888
Create a new app in Developer Hub and optionally clone a boilerplate locally.
@@ -97,7 +97,7 @@ EXAMPLES
9797
$ csdx app:create --name App-3 --app-type organization --org <UID> -d ./boilerplate -c ./external-config.json
9898
```
9999

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

102102
## `csdx app:delete`
103103

@@ -109,7 +109,7 @@ USAGE
109109
110110
FLAGS
111111
--app-uid=<value> Provide the app UID of an existing app.
112-
--org=<value> Provide the organization UID to fetch the app details for the desired operation.
112+
--org=<value> Provide the organization UID to fetch the app details for the operation.
113113
114114
DESCRIPTION
115115
Delete app from marketplace
@@ -122,7 +122,7 @@ EXAMPLES
122122
$ csdx app:delete --app-uid <value> --org <value> -d ./boilerplate
123123
```
124124

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

127127
## `csdx app:get`
128128

@@ -137,7 +137,7 @@ FLAGS
137137
--app-type=<option> [default: stack] Type of app
138138
<options: stack|organization>
139139
--app-uid=<value> Provide the app UID of an existing app.
140-
--org=<value> Provide the organization UID to fetch the app details for the desired operation.
140+
--org=<value> Provide the organization UID to fetch the app details for the operation.
141141
142142
DESCRIPTION
143143
Get details of an app in developer hub
@@ -152,7 +152,7 @@ EXAMPLES
152152
$ csdx app:get --org <value> --app-uid <value> --app-type organization
153153
```
154154

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

157157
## `csdx app:install`
158158

@@ -164,7 +164,7 @@ USAGE
164164
165165
FLAGS
166166
--app-uid=<value> Provide the app UID of an existing app.
167-
--org=<value> Provide the organization UID to fetch the app details for the desired operation.
167+
--org=<value> Provide the organization UID to fetch the app details for the operation.
168168
--stack-api-key=<value> API key of the stack where the app operation is to be performed.
169169
170170
DESCRIPTION
@@ -178,7 +178,7 @@ EXAMPLES
178178
$ csdx app:install --org <UID> --app-uid <APP-UID-1> --stack-api-key <STACK-API-KEY-1>
179179
```
180180

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

183183
## `csdx app:reinstall`
184184

@@ -190,7 +190,7 @@ USAGE
190190
191191
FLAGS
192192
--app-uid=<value> Provide the app UID of an existing app.
193-
--org=<value> Provide the organization UID to fetch the app details for the desired operation.
193+
--org=<value> Provide the organization UID to fetch the app details for the operation.
194194
--stack-api-key=<value> API key of the stack where the app operation is to be performed.
195195
196196
DESCRIPTION
@@ -204,7 +204,7 @@ EXAMPLES
204204
$ csdx app:reinstall --org <UID> --app-uid <APP-UID-1> --stack-api-key <STACK-API-KEY-1>
205205
```
206206

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

209209
## `csdx app:uninstall`
210210

@@ -217,7 +217,7 @@ USAGE
217217
FLAGS
218218
--app-uid=<value> Provide the app UID of an existing app.
219219
--installation-uid=<value> Provide the installation ID of the app that needs to be uninstalled.
220-
--org=<value> Provide the organization UID to fetch the app details for the desired operation.
220+
--org=<value> Provide the organization UID to fetch the app details for the operation.
221221
--uninstall-all Please select stacks from where the app must be uninstalled.
222222
223223
DESCRIPTION
@@ -231,7 +231,7 @@ EXAMPLES
231231
$ csdx app:uninstall --org <UID> --app-uid <APP-UID-1> --installation-uid <INSTALLATION-UID-1>
232232
```
233233

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

236236
## `csdx app:update`
237237

@@ -243,7 +243,7 @@ USAGE
243243
244244
FLAGS
245245
--app-manifest=<value> Path to the app manifest.json file:
246-
--org=<value> Provide the organization UID to fetch the app details for the desired operation.
246+
--org=<value> Provide the organization UID to fetch the app details for the operation.
247247
248248
DESCRIPTION
249249
Update the existing app in developer hub
@@ -254,5 +254,5 @@ EXAMPLES
254254
$ csdx app:update --app-manifest ./boilerplate/manifest.json
255255
```
256256

257-
_See code: [src/commands/app/update.ts](https://github.com/contentstack/apps-cli/blob/v1.1.0/src/commands/app/update.ts)_
257+
_See code: [src/commands/app/update.ts](https://github.com/contentstack/apps-cli/blob/v1.1.1/src/commands/app/update.ts)_
258258
<!-- commandsstop -->

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@contentstack/apps-cli",
3-
"version": "1.1.0",
3+
"version": "1.1.1",
44
"description": "App ClI",
55
"author": "Contentstack CLI",
66
"homepage": "https://github.com/contentstack/contentstack-apps-cli",

src/base-command.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@ import {
1313
InquirePayload,
1414
cliux,
1515
isAuthenticated,
16+
ContentstackMarketplaceClient,
17+
marketplaceSDKInitiator,
18+
marketplaceSDKClient,
1619
} from "@contentstack/cli-utilities";
1720

1821
import config from "./config";
@@ -39,6 +42,7 @@ export abstract class BaseCommand<T extends typeof Command> extends Command {
3942
};
4043
protected managementSdk!: ContentstackClient;
4144
protected managementAppSdk!: ContentstackClient;
45+
protected marketplaceAppSdk!: ContentstackMarketplaceClient;
4246

4347
protected flags!: Flags<T>;
4448
protected args!: Args<T>;
@@ -72,6 +76,7 @@ export abstract class BaseCommand<T extends typeof Command> extends Command {
7276
this.developerHubBaseUrl =
7377
this.sharedConfig.developerHubBaseUrl || getDeveloperHubUrl();
7478
await this.initCmaSDK();
79+
await this.initMarketplaceSDK();
7580

7681
// Init logger
7782
const logger = new Logger(this.sharedConfig);
@@ -126,6 +131,13 @@ export abstract class BaseCommand<T extends typeof Command> extends Command {
126131
host: this.developerHubBaseUrl,
127132
});
128133
}
134+
135+
async initMarketplaceSDK() {
136+
marketplaceSDKInitiator.init(this.context);
137+
this.marketplaceAppSdk = await marketplaceSDKClient({
138+
host: this.developerHubBaseUrl,
139+
});
140+
}
129141

130142
/**
131143
* @method getValPrompt

src/commands/app/create.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,8 @@ export default class Create extends BaseCommand<typeof Create> {
266266
appName: this.sharedConfig.appName,
267267
})
268268
);
269-
await this.managementAppSdk
270-
.organization(this.sharedConfig.org)
269+
await this.marketplaceAppSdk
270+
.marketplace(this.sharedConfig.org)
271271
.app()
272272
.create(this.appData as AppData)
273273
.then((response) => {

src/commands/app/delete.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ export default class Delete extends AppCLIBaseCommand {
3030

3131
if (!this.flags["app-uid"]) {
3232
app = await getApp(this.flags, this.sharedConfig.org, {
33-
managementSdk: this.managementAppSdk,
33+
marketplaceSdk: this.marketplaceAppSdk,
3434
log: this.log,
3535
});
3636
this.flags["app-uid"] = app?.uid;
@@ -49,7 +49,7 @@ export default class Delete extends AppCLIBaseCommand {
4949

5050
if (userConfirmation) {
5151
await deleteApp(this.flags, this.sharedConfig.org, {
52-
managementSdk: this.managementAppSdk,
52+
marketplaceSdk: this.marketplaceAppSdk,
5353
log: this.log,
5454
});
5555
this.log(

src/commands/app/get.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,12 +41,12 @@ export default class Get extends AppCLIBaseCommand {
4141

4242
if (!this.flags["app-uid"]) {
4343
appData = await getApp(this.flags, this.sharedConfig.org, {
44-
managementSdk: this.managementAppSdk,
44+
marketplaceSdk: this.marketplaceAppSdk,
4545
log: this.log,
4646
});
4747
} else {
4848
appData = await fetchApp(this.flags, this.sharedConfig.org, {
49-
managementSdk: this.managementAppSdk,
49+
marketplaceSdk: this.marketplaceAppSdk,
5050
log: this.log,
5151
});
5252
}

src/commands/app/install.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -55,12 +55,12 @@ export default class Install extends AppCLIBaseCommand {
5555
// fetch app details
5656
if (!this.flags["app-uid"]) {
5757
app = await getApp(this.flags, this.sharedConfig.org, {
58-
managementSdk: this.managementAppSdk,
58+
marketplaceSdk: this.marketplaceAppSdk,
5959
log: this.log,
6060
});
6161
} else {
6262
app = await fetchApp(this.flags, this.sharedConfig.org, {
63-
managementSdk: this.managementAppSdk,
63+
marketplaceSdk: this.marketplaceAppSdk,
6464
log: this.log,
6565
});
6666
}
@@ -108,7 +108,7 @@ export default class Install extends AppCLIBaseCommand {
108108
"info"
109109
);
110110
await installApp(this.flags, this.sharedConfig.org, appType, {
111-
managementSdk: this.managementAppSdk,
111+
marketplaceSdk: this.marketplaceAppSdk,
112112
log: this.log,
113113
});
114114
this.log(

src/commands/app/reinstall.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -50,12 +50,12 @@ export default class Reinstall extends AppCLIBaseCommand {
5050

5151
if (!this.flags["app-uid"]) {
5252
app = await getApp(this.flags, this.sharedConfig.org, {
53-
managementSdk: this.managementAppSdk,
53+
marketplaceSdk: this.marketplaceAppSdk,
5454
log: this.log,
5555
});
5656
} else {
5757
app = await fetchApp(this.flags, this.sharedConfig.org, {
58-
managementSdk: this.managementAppSdk,
58+
marketplaceSdk: this.marketplaceAppSdk,
5959
log: this.log,
6060
});
6161
}

0 commit comments

Comments
 (0)