UNPKG

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