File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -2,6 +2,7 @@ import { SfCommand, Flags } from '@salesforce/sf-plugins-core';
22import { Messages , Org } from '@salesforce/core' ;
33import { DatacodeBinaryChecker , type DatacodeDeployExecutionResult } from '../utils/datacodeBinaryChecker.js' ;
44import { checkEnvironment } from '../utils/environmentChecker.js' ;
5+ import { type SharedResultProps } from './types.js' ;
56
67Messages . importMessagesDirectoryFromMetaUrl ( import . meta. url ) ;
78const messages = Messages . loadMessages ( 'data-code-extension' , 'deploy' ) ;
@@ -16,27 +17,11 @@ export type BaseDeployFlags = {
1617 network ?: string ;
1718} ;
1819
19- export type DeployResult = {
20- success : boolean ;
21- pythonVersion : {
22- version : string ;
23- command : string ;
24- } ;
25- packageInfo ?: {
26- name : string ;
27- version : string ;
28- } ;
29- binaryInfo ?: {
30- command : string ;
31- version : string ;
32- } ;
33- codeType : 'script' | 'function' ;
34- packageDir : string ;
20+ export type DeployResult = SharedResultProps & {
3521 targetOrg : string ;
3622 deploymentId ?: string ;
3723 endpointUrl ?: string ;
3824 status ?: string ;
39- message : string ;
4025 executionResult ?: DatacodeDeployExecutionResult ;
4126} ;
4227
Original file line number Diff line number Diff line change 11import { SfCommand , Flags } from '@salesforce/sf-plugins-core' ;
22import { Messages } from '@salesforce/core' ;
3- import { type PythonVersionInfo } from '../utils/pythonChecker.js' ;
4- import { type PipPackageInfo } from '../utils/pipChecker.js' ;
5- import {
6- DatacodeBinaryChecker ,
7- type DatacodeBinaryInfo ,
8- type DatacodeInitExecutionResult ,
9- } from '../utils/datacodeBinaryChecker.js' ;
3+ import { DatacodeBinaryChecker , type DatacodeInitExecutionResult } from '../utils/datacodeBinaryChecker.js' ;
104import { checkEnvironment } from '../utils/environmentChecker.js' ;
5+ import { type SharedResultProps } from './types.js' ;
116
127export type BaseInitFlags = {
138 'package-dir' : string ;
149} ;
1510
16- export type InitResult = {
17- success : boolean ;
18- pythonVersion : PythonVersionInfo ;
19- packageInfo ?: PipPackageInfo ;
20- binaryInfo ?: DatacodeBinaryInfo ;
21- codeType : 'script' | 'function' ;
22- packageDir : string ;
23- message : string ;
11+ export type InitResult = SharedResultProps & {
2412 executionResult ?: DatacodeInitExecutionResult ;
2513} ;
2614
Original file line number Diff line number Diff line change 11import { SfCommand , Flags } from '@salesforce/sf-plugins-core' ;
22import { Messages , Org } from '@salesforce/core' ;
3- import { type PythonVersionInfo } from '../utils/pythonChecker.js' ;
4- import { type PipPackageInfo } from '../utils/pipChecker.js' ;
5- import {
6- DatacodeBinaryChecker ,
7- type DatacodeBinaryInfo ,
8- type DatacodeRunExecutionResult ,
9- } from '../utils/datacodeBinaryChecker.js' ;
3+ import { DatacodeBinaryChecker , type DatacodeRunExecutionResult } from '../utils/datacodeBinaryChecker.js' ;
104import { checkEnvironment } from '../utils/environmentChecker.js' ;
5+ import { type SharedResultProps } from './types.js' ;
116
127export type BaseRunFlags = {
138 entrypoint : string ;
@@ -16,17 +11,10 @@ export type BaseRunFlags = {
1611 dependencies ?: string ;
1712} ;
1813
19- export type RunResult = {
20- success : boolean ;
21- pythonVersion : PythonVersionInfo ;
22- packageInfo ?: PipPackageInfo ;
23- binaryInfo ?: DatacodeBinaryInfo ;
24- codeType : 'script' | 'function' ;
25- packageDir : string ;
14+ export type RunResult = SharedResultProps & {
2615 targetOrg : string ;
2716 status ?: string ;
2817 output ?: string ;
29- message : string ;
3018 executionResult ?: DatacodeRunExecutionResult ;
3119} ;
3220
Original file line number Diff line number Diff line change 1+ import { type PythonVersionInfo } from '../utils/pythonChecker.js' ;
2+ import { type PipPackageInfo } from '../utils/pipChecker.js' ;
3+ import { type DatacodeBinaryInfo } from '../utils/datacodeBinaryChecker.js' ;
4+
5+ export type SharedResultProps = {
6+ success : boolean ;
7+ pythonVersion : PythonVersionInfo ;
8+ packageInfo ?: PipPackageInfo ;
9+ binaryInfo ?: DatacodeBinaryInfo ;
10+ codeType : 'script' | 'function' ;
11+ packageDir : string ;
12+ message : string ;
13+ } ;
Original file line number Diff line number Diff line change 11import { existsSync } from 'node:fs' ;
22import { SfCommand , Flags } from '@salesforce/sf-plugins-core' ;
33import { Messages , SfError } from '@salesforce/core' ;
4- import { type PythonVersionInfo } from '../utils/pythonChecker.js' ;
5- import { type PipPackageInfo } from '../utils/pipChecker.js' ;
6- import {
7- DatacodeBinaryChecker ,
8- type DatacodeBinaryInfo ,
9- type DatacodeZipExecutionResult ,
10- } from '../utils/datacodeBinaryChecker.js' ;
4+ import { DatacodeBinaryChecker , type DatacodeZipExecutionResult } from '../utils/datacodeBinaryChecker.js' ;
115import { checkEnvironment } from '../utils/environmentChecker.js' ;
6+ import { type SharedResultProps } from './types.js' ;
127
138export type BaseZipFlags = {
149 'package-dir' : string ;
1510 network ?: string ;
1611} ;
1712
18- export type ZipResult = {
19- success : boolean ;
20- pythonVersion : PythonVersionInfo ;
21- packageInfo ?: PipPackageInfo ;
22- binaryInfo ?: DatacodeBinaryInfo ;
23- codeType : 'script' | 'function' ;
24- packageDir : string ;
13+ export type ZipResult = SharedResultProps & {
2514 archivePath ?: string ;
26- message : string ;
2715 executionResult ?: DatacodeZipExecutionResult ;
2816} ;
2917
You can’t perform that action at this time.
0 commit comments