Skip to content

Commit 0f8f796

Browse files
committed
typed result
1 parent 6fdc9c4 commit 0f8f796

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

src/commands/crud-mdapi/read.ts

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,13 @@
11
import { Flags, SfCommand } from "@salesforce/sf-plugins-core";
22
import { ComponentSetBuilder } from "@salesforce/source-deploy-retrieve";
3-
import { readFromOrg } from "../../component-set.js";
4-
import { writeComponentSetToDisk } from "../../component-set.js";
3+
import { readFromOrg, writeComponentSetToDisk } from "../../component-set.js";
54

6-
export class CrudMdapiRead extends SfCommand<unknown> {
5+
type CrudMdapiReadResult = {
6+
success: boolean;
7+
files: Awaited<ReturnType<typeof writeComponentSetToDisk>>;
8+
};
9+
10+
export class CrudMdapiRead extends SfCommand<CrudMdapiReadResult> {
711
public static readonly summary = "Read Metadata using the CRUD Metadata API";
812
public static readonly description =
913
"Read Metadata e.g. full Profiles using the CRUD Metadata API, convert the JSON result to XML and write as source format to disk.";
@@ -53,7 +57,7 @@ export class CrudMdapiRead extends SfCommand<unknown> {
5357

5458
public static readonly requiresProject = true;
5559

56-
public async run(): Promise<unknown> {
60+
public async run(): Promise<CrudMdapiReadResult> {
5761
const { flags } = await this.parse(CrudMdapiRead);
5862

5963
// 1/4 build a ComponentSet from the flags

0 commit comments

Comments
 (0)