@salesforce/core
Version:
Core libraries to interact with SFDX projects, orgs, and APIs.
65 lines (64 loc) • 2.61 kB
TypeScript
import { SfProjectJson } from '../sfProject';
import { Org } from './org';
import { ScratchOrgInfo } from './scratchOrgTypes';
type PartialScratchOrgInfo = Pick<ScratchOrgInfo, 'ConnectedAppConsumerKey' | 'AuthCode' | 'Snapshot' | 'Status' | 'LoginUrl' | 'SignupEmail' | 'SignupUsername' | 'SignupInstance' | 'Username'>;
export type ScratchOrgInfoPayload = {
orgName: string;
package2AncestorIds: string;
features: string | string[];
connectedAppConsumerKey: string;
namespace?: string;
connectedAppCallbackUrl: string;
durationDays: number;
} & PartialScratchOrgInfo;
/**
* Generates the package2AncestorIds scratch org property
*
* @param scratchOrgInfo - the scratchOrgInfo passed in by the user
* @param projectJson - sfProjectJson
* @param hubOrg - the hub org, in case we need to do queries
*/
export declare const getAncestorIds: (scratchOrgInfo: ScratchOrgInfoPayload, projectJson: SfProjectJson, hubOrg: Org) => Promise<string>;
/**
* Takes in a scratchOrgInfo and fills in the missing fields
*
* @param hubOrg the environment hub org
* @param scratchOrgInfoPayload - the scratchOrgInfo passed in by the user
* @param nonamespace create the scratch org with no namespace
* @param ignoreAncestorIds true if the sfdx-project.json ancestorId keys should be ignored
*/
export declare const generateScratchOrgInfo: ({ hubOrg, scratchOrgInfoPayload, nonamespace, ignoreAncestorIds, }: {
hubOrg: Org;
scratchOrgInfoPayload: ScratchOrgInfoPayload;
nonamespace?: boolean;
ignoreAncestorIds?: boolean;
}) => Promise<ScratchOrgInfoPayload>;
/**
* Returns a valid signup json
*
* definitionjson org definition in JSON format
* definitionfile path to an org definition file
* connectedAppConsumerKey The connected app consumer key. May be null for JWT OAuth flow.
* durationdays duration of the scratch org (in days) (default:1, min:1, max:30)
* nonamespace create the scratch org with no namespace
* noancestors do not include second-generation package ancestors in the scratch org
* orgConfig overrides definitionjson
*
* @returns scratchOrgInfoPayload: ScratchOrgInfoPayload;
ignoreAncestorIds: boolean;
warnings: string[];
*/
export declare const getScratchOrgInfoPayload: (options: {
durationDays: number;
definitionjson?: string;
definitionfile?: string;
connectedAppConsumerKey?: string;
nonamespace?: boolean;
noancestors?: boolean;
orgConfig?: Record<string, unknown>;
}) => Promise<{
scratchOrgInfoPayload: ScratchOrgInfoPayload;
ignoreAncestorIds: boolean;
warnings: string[];
}>;
export {};