Skip to content

Commit 1ffc126

Browse files
feat: ♻️ removed old api calls and added new marketplace sdk calls
1 parent 2b80c66 commit 1ffc126

File tree

3 files changed

+9
-2
lines changed

3 files changed

+9
-2
lines changed

src/base-command.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import {
1414
cliux,
1515
isAuthenticated,
1616
} from "@contentstack/cli-utilities";
17+
import { ContentstackClient as MarketplaceContentstackClient } from "@contentstack/marketplace-sdk";
1718

1819
import config from "./config";
1920
import { ConfigType, LogFn } from "./types";
@@ -39,6 +40,7 @@ export abstract class BaseCommand<T extends typeof Command> extends Command {
3940
};
4041
protected managementSdk!: ContentstackClient;
4142
protected managementAppSdk!: ContentstackClient;
43+
protected marketplaceAppSdk!: MarketplaceContentstackClient;
4244

4345
protected flags!: Flags<T>;
4446
protected args!: Args<T>;

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/util/common-utils.ts

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
import { ContentstackClient, FlagInput } from "@contentstack/cli-utilities";
2+
import { ContentstackClient as MarketplaceContentstackClient } from "@contentstack/marketplace-sdk";
23
import { AppLocation, Extension, LogFn } from "../types";
34
import { cliux, Stack } from "@contentstack/cli-utilities";
45
import { apiRequestHandler } from "./api-request-handler";
@@ -7,6 +8,10 @@ export type CommonOptions = {
78
log: LogFn;
89
managementSdk: ContentstackClient;
910
};
11+
export type MarketPlaceOptions = {
12+
log: LogFn;
13+
marketplaceSdk: MarketplaceContentstackClient;
14+
};
1015

1116
async function getOrganizations(
1217
options: CommonOptions,

0 commit comments

Comments
 (0)