Skip to content

Commit

Permalink
Sm/no zip in json (#514)
Browse files Browse the repository at this point in the history
* chore: updates from devScripts

* fix(deps): bump deps

* test: more jobs on smaller boxes

* chore: bump cmd-ref

* chore: bump more dev-deps

* chore: bump testkit and source-testkit

* fix: no zip contents in json

* chore: regen schema

---------

Co-authored-by: svc-cli-bot <[email protected]>
  • Loading branch information
mshanemc and svc-cli-bot authored Feb 27, 2023
1 parent 2bb51e3 commit 62e4836
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
3 changes: 3 additions & 0 deletions .eslintrc.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,4 +6,7 @@
*/
module.exports = {
extends: ['eslint-config-salesforce-typescript', 'eslint-config-salesforce-license', 'plugin:sf-plugin/recommended'],
rules: {
'@typescript-eslint/no-unused-vars': ['error', { ignoreRestSiblings: true }],
},
};
6 changes: 1 addition & 5 deletions schemas/retrieve-metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,9 @@
"$ref": "#/definitions/RetrieveMessage"
}
]
},
"zipFile": {
"type": "string",
"description": "`base64` encoded string"
}
},
"required": ["done", "fileProperties", "files", "id", "status", "success", "zipFile"]
"required": ["done", "fileProperties", "files", "id", "status", "success"]
},
{
"$ref": "#/definitions/MetadataRetrieveResultJson"
Expand Down
3 changes: 2 additions & 1 deletion src/utils/output.ts
Original file line number Diff line number Diff line change
Expand Up @@ -420,7 +420,8 @@ export class RetrieveResultFormatter implements Formatter<RetrieveResultJson> {
}

public getJson(): RetrieveResultJson {
return { ...this.result.response, files: this.files };
const { zipFile, ...responseWithoutZip } = this.result.response;
return { ...responseWithoutZip, files: this.files };
}

public async display(): Promise<void> {
Expand Down
4 changes: 3 additions & 1 deletion src/utils/types.ts
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,9 @@ export type MetadataRetrieveResultJson = Omit<MetadataApiRetrieveStatus, 'zipFil
files: FileResponse[];
};

export type RetrieveResultJson = (MetadataApiRetrieveStatus & { files: FileResponse[] }) | MetadataRetrieveResultJson;
export type RetrieveResultJson =
| (Omit<MetadataApiRetrieveStatus, 'zipFile'> & { files: FileResponse[] })
| MetadataRetrieveResultJson;

/** validates source component with fullname, type, and xml props */
export const isSourceComponent = (sc: unknown): sc is SourceComponent & { xml: string } =>
Expand Down

0 comments on commit 62e4836

Please sign in to comment.