UNPKG

2.64 kBTypeScriptView Raw
1import { SfProjectJson } from '../sfProject';
2import { Org } from './org';
3import { ScratchOrgInfo } from './scratchOrgTypes';
4type PartialScratchOrgInfo = Pick<ScratchOrgInfo, 'ConnectedAppConsumerKey' | 'AuthCode' | 'Snapshot' | 'Status' | 'LoginUrl' | 'SignupEmail' | 'SignupUsername' | 'SignupInstance' | 'Username'>;
5export interface ScratchOrgInfoPayload extends PartialScratchOrgInfo {
6 orgName: string;
7 package2AncestorIds: string;
8 features: string | string[];
9 connectedAppConsumerKey: string;
10 namespace: string;
11 connectedAppCallbackUrl: string;
12 durationDays: number;
13}
14/**
15 * Generates the package2AncestorIds scratch org property
16 *
17 * @param scratchOrgInfo - the scratchOrgInfo passed in by the user
18 * @param projectJson - sfProjectJson
19 * @param hubOrg - the hub org, in case we need to do queries
20 */
21export declare const getAncestorIds: (scratchOrgInfo: ScratchOrgInfoPayload, projectJson: SfProjectJson, hubOrg: Org) => Promise<string>;
22/**
23 * Takes in a scratchOrgInfo and fills in the missing fields
24 *
25 * @param hubOrg the environment hub org
26 * @param scratchOrgInfoPayload - the scratchOrgInfo passed in by the user
27 * @param nonamespace create the scratch org with no namespace
28 * @param ignoreAncestorIds true if the sfdx-project.json ancestorId keys should be ignored
29 */
30export declare const generateScratchOrgInfo: ({ hubOrg, scratchOrgInfoPayload, nonamespace, ignoreAncestorIds, }: {
31 hubOrg: Org;
32 scratchOrgInfoPayload: ScratchOrgInfoPayload;
33 nonamespace?: boolean | undefined;
34 ignoreAncestorIds?: boolean | undefined;
35}) => Promise<ScratchOrgInfoPayload>;
36/**
37 * Returns a valid signup json
38 *
39 * definitionjson org definition in JSON format
40 * definitionfile path to an org definition file
41 * connectedAppConsumerKey The connected app consumer key. May be null for JWT OAuth flow.
42 * durationdays duration of the scratch org (in days) (default:1, min:1, max:30)
43 * nonamespace create the scratch org with no namespace
44 * noancestors do not include second-generation package ancestors in the scratch org
45 * orgConfig overrides definitionjson
46 *
47 * @returns scratchOrgInfoPayload: ScratchOrgInfoPayload;
48 ignoreAncestorIds: boolean;
49 warnings: string[];
50 */
51export declare const getScratchOrgInfoPayload: (options: {
52 durationDays: number;
53 definitionjson?: string;
54 definitionfile?: string;
55 connectedAppConsumerKey?: string;
56 nonamespace?: boolean;
57 noancestors?: boolean;
58 orgConfig?: Record<string, unknown>;
59}) => Promise<{
60 scratchOrgInfoPayload: ScratchOrgInfoPayload;
61 ignoreAncestorIds: boolean;
62 warnings: string[];
63}>;
64export {};