UNPKG

@salesforce/core

Version:

Core libraries to interact with SFDX projects, orgs, and APIs.

107 lines 4.76 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ScratchOrgDefSchema = void 0; /* * Copyright 2026, Salesforce, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */ const zod_1 = require("zod"); const features_1 = require("./features"); const settings_1 = require("./settings"); /** * Scratch Org Definition Configuration * The scratch org definition file contains the configuration values that determine the shape of the scratch org. */ exports.ScratchOrgDefSchema = zod_1.z .object({ orgName: zod_1.z.string().optional().describe('The name of the scratch org.').meta({ title: 'Organization Name' }), edition: zod_1.z .string() .optional() .refine((val) => { if (val === undefined) return true; const validOptions = [ 'developer', 'enterprise', 'group', 'partner developer', 'partner enterprise', 'partner group', 'partner professional', 'professional', ]; return validOptions.includes(val.toLowerCase()); }, { message: 'Invalid Salesforce edition. Valid options are: developer, enterprise, group, partner developer, partner enterprise, partner group, partner professional, professional.', }) .meta({ enum: [ 'Developer', 'Enterprise', 'Group', 'Professional', 'Partner Developer', 'Partner Enterprise', 'Partner Group', 'Partner Professional', ], }) .describe('The Salesforce edition of the scratch org.'), country: zod_1.z .string() .max(2) .optional() .describe("Dev Hub's country. If you want to override this value, enter the two-character, upper-case ISO-3166 country code (Alpha-2 code). You can find a full list of these codes at several sites, such as: https://www.iso.org/obp/ui/#search. This value sets the locale of the scratch org."), username: zod_1.z.string().optional().describe('A user name formatted like test-unique_identifier@orgName.net.'), adminEmail: zod_1.z .string() .optional() .describe('Email address of the Dev Hub user making the scratch org creation request.') .meta({ title: 'Administrator Email Address' }), description: zod_1.z .string() .optional() .describe("The description is a good way to document the scratch org's purpose. You can view or edit the description in the Dev Hub. From App Launcher, select Scratch Org Info or Active Scratch Orgs, then click the scratch org number.") .meta({ title: 'Description of the Org' }), hasSampleData: zod_1.z .boolean() .default(false) .optional() .describe('Valid values are true and false. False is the default, which creates an org without sample data.') .meta({ title: 'Include Sample Data' }), language: zod_1.z .string() .max(5) .optional() .describe('Default language for the country. To override the language set by the Dev Hub locale, see Supported Languages (https://help.salesforce.com/articleView?id=faq_getstart_what_languages_does.htm&type=5&language=en_US) for the codes to use in this field.') .meta({ title: 'Default Language' }), features: features_1.FeaturesSchema.optional().describe('Features to enable in the scratch org.'), template: zod_1.z .string() .optional() .describe('The template id for the scratch org shape. (Pilot)') .meta({ title: 'Template ID' }), settings: settings_1.SettingsSchema.optional().describe('Settings for the scratch org.'), release: zod_1.z .enum(['preview', 'previous']) .optional() .describe('Same Salesforce release as the Dev Hub org. Options are preview or previous. Can use only during Salesforce release transition periods.'), }) .catchall(zod_1.z.unknown()) .refine((data) => data.edition !== undefined || 'snapshot' in data, { message: 'edition is required unless creating from a snapshot', path: ['edition'], }); //# sourceMappingURL=scratchOrgDef.js.map