@salesforce/core 8.23.5-qaext.0 → 8.23.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (31) hide show
  1. package/lib/index.d.ts +1 -6
  2. package/lib/index.js +2 -11
  3. package/lib/org/authInfo.js +1 -0
  4. package/lib/org/scratchOrgInfoGenerator.js +1 -12
  5. package/lib/schema/validator.d.ts +0 -8
  6. package/lib/schema/validator.js +0 -8
  7. package/lib/sfProject.d.ts +5 -7
  8. package/lib/sfProject.js +21 -17
  9. package/package.json +7 -53
  10. package/lib/schema/project-scratch-def/features.d.ts +0 -4
  11. package/lib/schema/project-scratch-def/features.js +0 -25
  12. package/lib/schema/project-scratch-def/patternFeaturesList.d.ts +0 -1
  13. package/lib/schema/project-scratch-def/patternFeaturesList.js +0 -69
  14. package/lib/schema/project-scratch-def/scratchOrgDef.d.ts +0 -178
  15. package/lib/schema/project-scratch-def/scratchOrgDef.js +0 -73
  16. package/lib/schema/project-scratch-def/settings.d.ts +0 -150
  17. package/lib/schema/project-scratch-def/settings.js +0 -591
  18. package/lib/schema/project-scratch-def/simpleFeaturesList.d.ts +0 -1
  19. package/lib/schema/project-scratch-def/simpleFeaturesList.js +0 -272
  20. package/lib/schema/sfdx-project/bundleEntry.d.ts +0 -11
  21. package/lib/schema/sfdx-project/bundleEntry.js +0 -28
  22. package/lib/schema/sfdx-project/packageDir.d.ts +0 -103
  23. package/lib/schema/sfdx-project/packageDir.js +0 -165
  24. package/lib/schema/sfdx-project/registryPresets.d.ts +0 -2
  25. package/lib/schema/sfdx-project/registryPresets.js +0 -12
  26. package/lib/schema/sfdx-project/registryVariants.d.ts +0 -104
  27. package/lib/schema/sfdx-project/registryVariants.js +0 -57
  28. package/lib/schema/sfdx-project/replacements.d.ts +0 -70
  29. package/lib/schema/sfdx-project/replacements.js +0 -76
  30. package/lib/schema/sfdx-project/sfdxProjectJson.d.ts +0 -201
  31. package/lib/schema/sfdx-project/sfdxProjectJson.js +0 -89
package/lib/index.d.ts CHANGED
@@ -24,10 +24,7 @@ export { Fields, FieldValue, LoggerLevel, LoggerLevelValue, LogLine, LoggerOptio
24
24
  export { Messages, StructuredMessage } from './messages';
25
25
  export { Org, SandboxProcessObject, StatusEvent, SandboxInfo, SandboxEvents, SandboxUserAuthResponse, SandboxUserAuthRequest, SandboxRequest, ResumeSandboxRequest, OrgTypes, ResultEvent, ScratchOrgRequest, } from './org/org';
26
26
  export { OrgConfigProperties, ORG_CONFIG_ALLOWED_PROPERTIES } from './org/orgConfigProperties';
27
- export { NamedPackageDir, SfProject, SfProjectJson, isPackagingDirectory, isNamedPackagingDirectory, } from './sfProject';
28
- /**
29
- * @deprecated For sfdx-project.json and scratch org definitions, use the exported zod schemas (ProjectJsonSchema, ScratchOrgDefSchema) from '@salesforce/core'. For custom schemas, use a schema validator library like zod directly.
30
- */
27
+ export { NamedPackageDir, SfProject, SfProjectJson } from './sfProject';
31
28
  export { SchemaValidator } from './schema/validator';
32
29
  export { SfError } from './sfError';
33
30
  export { PollingClient } from './status/pollingClient';
@@ -38,8 +35,6 @@ export { PermissionSetAssignment, PermissionSetAssignmentFields } from './org/pe
38
35
  export { lockInit } from './util/fileLocking';
39
36
  export { ScratchOrgCreateOptions, ScratchOrgCreateResult, scratchOrgCreate, scratchOrgResume, } from './org/scratchOrgCreate';
40
37
  export { ScratchOrgInfo } from './org/scratchOrgTypes';
41
- export { ProjectJson, ProjectJsonSchema } from './schema/sfdx-project/sfdxProjectJson';
42
- export { ScratchOrgDef, ScratchOrgDefSchema } from './schema/project-scratch-def/scratchOrgDef';
43
38
  export { ScratchOrgLifecycleEvent, scratchOrgLifecycleEventName, scratchOrgLifecycleStages, } from './org/scratchOrgLifecycleEvents';
44
39
  export { ScratchOrgCache } from './org/scratchOrgCache';
45
40
  export { default as ScratchOrgSettingsGenerator } from './org/scratchOrgSettingsGenerator';
package/lib/index.js CHANGED
@@ -23,8 +23,8 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
23
23
  return (mod && mod.__esModule) ? mod : { "default": mod };
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.lockInit = exports.PermissionSetAssignment = exports.User = exports.REQUIRED_FIELDS = exports.DefaultUserFields = exports.MyDomainResolver = exports.StreamingClient = exports.CometClient = exports.PollingClient = exports.SfError = exports.SchemaValidator = exports.isNamedPackagingDirectory = exports.isPackagingDirectory = exports.SfProjectJson = exports.SfProject = exports.ORG_CONFIG_ALLOWED_PROPERTIES = exports.OrgConfigProperties = exports.OrgTypes = exports.SandboxEvents = exports.Org = exports.Messages = exports.Logger = exports.LoggerLevel = exports.generateApiName = exports.getJwtAudienceUrl = exports.SfdcUrl = exports.WebOAuthServer = exports.Lifecycle = exports.Global = exports.Mode = exports.SFDX_HTTP_HEADERS = exports.Connection = exports.AuthRemover = exports.AuthInfo = exports.ConfigAggregator = exports.SandboxRequestCache = exports.SF_ALLOWED_PROPERTIES = exports.SFDX_ALLOWED_PROPERTIES = exports.SfConfigProperties = exports.SfdxPropertyKeys = exports.Config = exports.OrgUsersConfig = exports.DeviceOauthService = exports.StateAggregator = exports.EnvVars = exports.SUPPORTED_ENV_VARS = exports.EnvironmentVariable = exports.envVars = exports.TTLConfig = exports.ConfigFile = void 0;
27
- exports.fs = exports.ScratchOrgSettingsGenerator = exports.ScratchOrgCache = exports.scratchOrgLifecycleStages = exports.scratchOrgLifecycleEventName = exports.ScratchOrgDefSchema = exports.ProjectJsonSchema = exports.scratchOrgResume = exports.scratchOrgCreate = void 0;
26
+ exports.scratchOrgResume = exports.scratchOrgCreate = exports.lockInit = exports.PermissionSetAssignment = exports.User = exports.REQUIRED_FIELDS = exports.DefaultUserFields = exports.MyDomainResolver = exports.StreamingClient = exports.CometClient = exports.PollingClient = exports.SfError = exports.SchemaValidator = exports.SfProjectJson = exports.SfProject = exports.ORG_CONFIG_ALLOWED_PROPERTIES = exports.OrgConfigProperties = exports.OrgTypes = exports.SandboxEvents = exports.Org = exports.Messages = exports.Logger = exports.LoggerLevel = exports.generateApiName = exports.getJwtAudienceUrl = exports.SfdcUrl = exports.WebOAuthServer = exports.Lifecycle = exports.Global = exports.Mode = exports.SFDX_HTTP_HEADERS = exports.Connection = exports.AuthRemover = exports.AuthInfo = exports.ConfigAggregator = exports.SandboxRequestCache = exports.SF_ALLOWED_PROPERTIES = exports.SFDX_ALLOWED_PROPERTIES = exports.SfConfigProperties = exports.SfdxPropertyKeys = exports.Config = exports.OrgUsersConfig = exports.DeviceOauthService = exports.StateAggregator = exports.EnvVars = exports.SUPPORTED_ENV_VARS = exports.EnvironmentVariable = exports.envVars = exports.TTLConfig = exports.ConfigFile = void 0;
27
+ exports.fs = exports.ScratchOrgSettingsGenerator = exports.ScratchOrgCache = exports.scratchOrgLifecycleStages = exports.scratchOrgLifecycleEventName = void 0;
28
28
  const messages_1 = require("./messages");
29
29
  ;
30
30
  var configFile_1 = require("./config/configFile");
@@ -87,11 +87,6 @@ Object.defineProperty(exports, "ORG_CONFIG_ALLOWED_PROPERTIES", { enumerable: tr
87
87
  var sfProject_1 = require("./sfProject");
88
88
  Object.defineProperty(exports, "SfProject", { enumerable: true, get: function () { return sfProject_1.SfProject; } });
89
89
  Object.defineProperty(exports, "SfProjectJson", { enumerable: true, get: function () { return sfProject_1.SfProjectJson; } });
90
- Object.defineProperty(exports, "isPackagingDirectory", { enumerable: true, get: function () { return sfProject_1.isPackagingDirectory; } });
91
- Object.defineProperty(exports, "isNamedPackagingDirectory", { enumerable: true, get: function () { return sfProject_1.isNamedPackagingDirectory; } });
92
- /**
93
- * @deprecated For sfdx-project.json and scratch org definitions, use the exported zod schemas (ProjectJsonSchema, ScratchOrgDefSchema) from '@salesforce/core'. For custom schemas, use a schema validator library like zod directly.
94
- */
95
90
  var validator_1 = require("./schema/validator");
96
91
  Object.defineProperty(exports, "SchemaValidator", { enumerable: true, get: function () { return validator_1.SchemaValidator; } });
97
92
  var sfError_1 = require("./sfError");
@@ -114,10 +109,6 @@ Object.defineProperty(exports, "lockInit", { enumerable: true, get: function ()
114
109
  var scratchOrgCreate_1 = require("./org/scratchOrgCreate");
115
110
  Object.defineProperty(exports, "scratchOrgCreate", { enumerable: true, get: function () { return scratchOrgCreate_1.scratchOrgCreate; } });
116
111
  Object.defineProperty(exports, "scratchOrgResume", { enumerable: true, get: function () { return scratchOrgCreate_1.scratchOrgResume; } });
117
- var sfdxProjectJson_1 = require("./schema/sfdx-project/sfdxProjectJson");
118
- Object.defineProperty(exports, "ProjectJsonSchema", { enumerable: true, get: function () { return sfdxProjectJson_1.ProjectJsonSchema; } });
119
- var scratchOrgDef_1 = require("./schema/project-scratch-def/scratchOrgDef");
120
- Object.defineProperty(exports, "ScratchOrgDefSchema", { enumerable: true, get: function () { return scratchOrgDef_1.ScratchOrgDefSchema; } });
121
112
  var scratchOrgLifecycleEvents_1 = require("./org/scratchOrgLifecycleEvents");
122
113
  Object.defineProperty(exports, "scratchOrgLifecycleEventName", { enumerable: true, get: function () { return scratchOrgLifecycleEvents_1.scratchOrgLifecycleEventName; } });
123
114
  Object.defineProperty(exports, "scratchOrgLifecycleStages", { enumerable: true, get: function () { return scratchOrgLifecycleEvents_1.scratchOrgLifecycleStages; } });
@@ -939,6 +939,7 @@ class AuthInfo extends kit_1.AsyncOptionalCreatable {
939
939
  try {
940
940
  this.logger.debug(`Exchanging auth code for access token using loginUrl: ${options.loginUrl ?? '<undefined>'}`);
941
941
  authFields = await oauth2.requestToken((0, ts_types_1.ensure)(options.authCode));
942
+ this.logger.debug(`Successfully requested an access token with scopes: "${authFields.scope}".`);
942
943
  }
943
944
  catch (err) {
944
945
  const msg = err instanceof Error ? `${err.name}::${err.message}` : typeof err === 'string' ? err : 'UNKNOWN';
@@ -14,8 +14,6 @@ const sfProject_1 = require("../sfProject");
14
14
  const webOAuthServer_1 = require("../webOAuthServer");
15
15
  const messages_1 = require("../messages");
16
16
  const sfError_1 = require("../sfError");
17
- const scratchOrgDef_1 = require("../schema/project-scratch-def/scratchOrgDef");
18
- const lifecycleEvents_1 = require("../lifecycleEvents");
19
17
  const scratchOrgFeatureDeprecation_1 = require("./scratchOrgFeatureDeprecation");
20
18
  const authInfo_1 = require("./authInfo");
21
19
  ;
@@ -229,16 +227,7 @@ const parseDefinitionFile = async (definitionFile) => {
229
227
  const defFileContents = (0, kit_1.parseJson)(fileData);
230
228
  // remove key '$schema' from the definition file
231
229
  delete defFileContents['$schema'];
232
- // Validate with zod schema and emit warnings if there are issues
233
- const result = scratchOrgDef_1.ScratchOrgDefSchema.safeParse(defFileContents);
234
- if (!result.success) {
235
- const errorMessages = result.error.issues.map((err) => `${err.path.join('.')}: ${err.message}`).join('\n');
236
- await lifecycleEvents_1.Lifecycle.getInstance().emitWarning(`Scratch org definition validation issues in ${definitionFile}:\n${errorMessages}`);
237
- return defFileContents;
238
- }
239
- else {
240
- return result.data;
241
- }
230
+ return defFileContents;
242
231
  }
243
232
  catch (err) {
244
233
  const error = err;
@@ -2,8 +2,6 @@ import { AnyJson, JsonMap } from '@salesforce/ts-types';
2
2
  import { Logger } from '../logger/logger';
3
3
  /**
4
4
  * Loads a JSON schema and performs validations against JSON objects.
5
- *
6
- * @deprecated For sfdx-project.json and scratch org definitions, use the exported zod schemas (ProjectJsonSchema, ScratchOrgDefSchema) from '@salesforce/core'. For custom schemas, use a schema validator library like zod directly.
7
5
  */
8
6
  export declare class SchemaValidator {
9
7
  private schemaPath;
@@ -19,14 +17,10 @@ export declare class SchemaValidator {
19
17
  constructor(logger: Logger, schemaPath: string);
20
18
  /**
21
19
  * Loads a JSON schema from the `schemaPath` parameter provided at instantiation.
22
- *
23
- * @deprecated For sfdx-project.json and scratch org definitions, use the exported zod schemas (ProjectJsonSchema, ScratchOrgDefSchema) from '@salesforce/core'. For custom schemas, use a schema validator library like zod directly.
24
20
  */
25
21
  load(): Promise<JsonMap>;
26
22
  /**
27
23
  * Loads a JSON schema from the `schemaPath` parameter provided at instantiation.
28
- *
29
- * @deprecated For sfdx-project.json and scratch org definitions, use the exported zod schemas (ProjectJsonSchema, ScratchOrgDefSchema) from '@salesforce/core'. For custom schemas, use a schema validator library like zod directly.
30
24
  */
31
25
  loadSync(): JsonMap;
32
26
  /**
@@ -38,7 +32,6 @@ export declare class SchemaValidator {
38
32
  *
39
33
  * @param json A JSON value to validate against this instance's target schema.
40
34
  * @returns The validated JSON data.
41
- * @deprecated For sfdx-project.json and scratch org definitions, use the exported zod schemas (ProjectJsonSchema, ScratchOrgDefSchema) from '@salesforce/core'. For custom schemas, use a schema validator library like zod directly.
42
35
  */
43
36
  validate(json: AnyJson): Promise<AnyJson>;
44
37
  /**
@@ -50,7 +43,6 @@ export declare class SchemaValidator {
50
43
  *
51
44
  * @param json A JSON value to validate against this instance's target schema.
52
45
  * @returns The validated JSON data.
53
- * @deprecated For sfdx-project.json and scratch org definitions, use the exported zod schemas (ProjectJsonSchema, ScratchOrgDefSchema) from '@salesforce/core'. For custom schemas, use a schema validator library like zod directly.
54
46
  */
55
47
  validateSync<T extends AnyJson>(json: T): T;
56
48
  /**
@@ -40,8 +40,6 @@ const fs_1 = require("../fs/fs");
40
40
  const sfError_1 = require("../sfError");
41
41
  /**
42
42
  * Loads a JSON schema and performs validations against JSON objects.
43
- *
44
- * @deprecated For sfdx-project.json and scratch org definitions, use the exported zod schemas (ProjectJsonSchema, ScratchOrgDefSchema) from '@salesforce/core'. For custom schemas, use a schema validator library like zod directly.
45
43
  */
46
44
  class SchemaValidator {
47
45
  schemaPath;
@@ -61,8 +59,6 @@ class SchemaValidator {
61
59
  }
62
60
  /**
63
61
  * Loads a JSON schema from the `schemaPath` parameter provided at instantiation.
64
- *
65
- * @deprecated For sfdx-project.json and scratch org definitions, use the exported zod schemas (ProjectJsonSchema, ScratchOrgDefSchema) from '@salesforce/core'. For custom schemas, use a schema validator library like zod directly.
66
62
  */
67
63
  async load() {
68
64
  if (!this.schema) {
@@ -73,8 +69,6 @@ class SchemaValidator {
73
69
  }
74
70
  /**
75
71
  * Loads a JSON schema from the `schemaPath` parameter provided at instantiation.
76
- *
77
- * @deprecated For sfdx-project.json and scratch org definitions, use the exported zod schemas (ProjectJsonSchema, ScratchOrgDefSchema) from '@salesforce/core'. For custom schemas, use a schema validator library like zod directly.
78
72
  */
79
73
  loadSync() {
80
74
  if (!this.schema) {
@@ -92,7 +86,6 @@ class SchemaValidator {
92
86
  *
93
87
  * @param json A JSON value to validate against this instance's target schema.
94
88
  * @returns The validated JSON data.
95
- * @deprecated For sfdx-project.json and scratch org definitions, use the exported zod schemas (ProjectJsonSchema, ScratchOrgDefSchema) from '@salesforce/core'. For custom schemas, use a schema validator library like zod directly.
96
89
  */
97
90
  // eslint-disable-next-line @typescript-eslint/require-await
98
91
  async validate(json) {
@@ -107,7 +100,6 @@ class SchemaValidator {
107
100
  *
108
101
  * @param json A JSON value to validate against this instance's target schema.
109
102
  * @returns The validated JSON data.
110
- * @deprecated For sfdx-project.json and scratch org definitions, use the exported zod schemas (ProjectJsonSchema, ScratchOrgDefSchema) from '@salesforce/core'. For custom schemas, use a schema validator library like zod directly.
111
103
  */
112
104
  validateSync(json) {
113
105
  const schema = this.loadSync();
@@ -1,7 +1,5 @@
1
1
  import { Dictionary, JsonMap, Nullable, Optional } from '@salesforce/ts-types';
2
- import { PackageDir, PackagePackageDir } from './schema/sfdx-project/packageDir';
3
- import { BundleEntry } from './schema/sfdx-project/bundleEntry';
4
- import { type ProjectJson as ProjectJsonType } from './schema/sfdx-project/sfdxProjectJson';
2
+ import { PackageDir, ProjectJson as ProjectJsonSchema, PackagePackageDir, BundleEntry } from '@salesforce/schemas';
5
3
  import { ConfigFile } from './config/configFile';
6
4
  import { ConfigContents } from './config/configStackTypes';
7
5
  type NameAndFullPath = {
@@ -16,7 +14,8 @@ type NameAndFullPath = {
16
14
  };
17
15
  export type NamedPackagingDir = PackagePackageDir & NameAndFullPath;
18
16
  export type NamedPackageDir = PackageDir & NameAndFullPath;
19
- export type ProjectJson = ConfigContents & ProjectJsonType;
17
+ export type { BundleEntry };
18
+ export type ProjectJson = ConfigContents & ProjectJsonSchema;
20
19
  /**
21
20
  * The sfdx-project.json config object. This file determines if a folder is a valid sfdx project.
22
21
  *
@@ -57,7 +56,7 @@ export declare class SfProjectJson extends ConfigFile<ConfigFile.Options, Projec
57
56
  * Validates sfdx-project.json against the schema.
58
57
  *
59
58
  * Set the `SFDX_PROJECT_JSON_VALIDATION` environment variable to `true` to throw an error when schema validation fails.
60
- * A warning is emitted by default when the file is invalid.
59
+ * A warning is logged by default when the file is invalid.
61
60
  *
62
61
  * ***See*** [sfdx-project.schema.json] ((https://github.com/forcedotcom/schemas/blob/main/sfdx-project.schema.json)
63
62
  */
@@ -71,7 +70,7 @@ export declare class SfProjectJson extends ConfigFile<ConfigFile.Options, Projec
71
70
  * Validates sfdx-project.json against the schema.
72
71
  *
73
72
  * Set the `SFDX_PROJECT_JSON_VALIDATION` environment variable to `true` to throw an error when schema validation fails.
74
- * A warning is emitted by default when the file is invalid.
73
+ * A warning is logged by default when the file is invalid.
75
74
  *
76
75
  * ***See*** [sfdx-project.schema.json] ((https://github.com/forcedotcom/schemas/blob/main/sfdx-project.schema.json)
77
76
  */
@@ -401,4 +400,3 @@ export declare class SfProject {
401
400
  export declare const isPackagingDirectory: (packageDir: PackageDir) => packageDir is PackagePackageDir;
402
401
  /** differentiate between the Base PackageDir (path, maybe default) and the Packaging version (package and maybe a LOT of other fields) by whether is has the `package` property */
403
402
  export declare const isNamedPackagingDirectory: (packageDir: NamedPackageDir) => packageDir is NamedPackagingDir;
404
- export {};
package/lib/sfProject.js CHANGED
@@ -10,16 +10,15 @@ exports.isNamedPackagingDirectory = exports.isPackagingDirectory = exports.SfPro
10
10
  const node_path_1 = require("node:path");
11
11
  const kit_1 = require("@salesforce/kit");
12
12
  const ts_types_1 = require("@salesforce/ts-types");
13
- const sfdxProjectJson_1 = require("./schema/sfdx-project/sfdxProjectJson");
14
13
  const fs_1 = require("./fs/fs");
15
14
  const sfdcUrl_1 = require("./util/sfdcUrl");
16
15
  const configAggregator_1 = require("./config/configAggregator");
17
16
  const configFile_1 = require("./config/configFile");
17
+ const validator_1 = require("./schema/validator");
18
18
  const internal_1 = require("./util/internal");
19
19
  const sfError_1 = require("./sfError");
20
20
  const messages_1 = require("./messages");
21
21
  const findUppercaseKeys_1 = require("./util/findUppercaseKeys");
22
- const lifecycleEvents_1 = require("./lifecycleEvents");
23
22
  ;
24
23
  const messages = new messages_1.Messages('@salesforce/core', 'config', new Map([["unknownConfigKey", "Unknown config name: %s."], ["deprecatedConfigKey", "Deprecated config name: %s. Please use %s instead."], ["invalidWrite", "The writeSync method is not allowed on SfdxConfig. Use the async write method instead."], ["invalidConfigValue", "Invalid config value: %s."], ["invalidInstanceUrl", "Specify a valid Salesforce instance URL."], ["invalidApiVersion", "Specify a valid Salesforce API version, for example, 42.0."], ["invalidCustomOrgMetadataTemplates", "Specify a valid repository URL or directory for the custom org metadata templates."], ["invalidIsvDebuggerSid", "Specify a valid Debugger SID."], ["invalidIsvDebuggerUrl", "Specify a valid Debugger URL."], ["invalidNumberConfigValue", "Specify a valid positive integer, for example, 150000."], ["invalidBooleanConfigValue", "The config value can only be set to true or false."], ["invalidProjectWorkspace", "%s does not contain a valid Salesforce DX project."], ["schemaValidationError", "The config file \"%s\" is not schema valid.\nDue to: %s"], ["schemaValidationError.actions", ["Fix the invalid entries at %s."]], ["missingDefaultPath", "In sfdx-project.json, be sure to specify which package directory (path) is the default. Example: `[{ \"path\": \"packageDirectory1\", \"default\": true }, { \"path\": \"packageDirectory2\" }]`"], ["missingPackageDirectory", "The path \"%s\", specified in sfdx-project.json, does not exist. Be sure this directory is included in your project root."], ["invalidPackageDirectory", "The path \"%s\", specified in sfdx-project.json, must be indicated as a relative path to the project root."], ["multipleDefaultPaths", "In sfdx-project.json, indicate only one package directory (path) as the default."], ["singleNonDefaultPackage", "The sfdx-project.json file must include one, and only one, default package directory (path). Because your sfdx-project.json file contains only one package directory, it must be the default. Remove the `\"default\": false` key and try again."], ["target-org", "Username or alias of the org that all commands run against by default. (sf only)"], ["target-dev-hub", "Username or alias of your default Dev Hub org. (sf only)"], ["defaultUsername", "Username or alias of the org that all commands run against by default. (sfdx only)"], ["defaultDevHubUsername", "Username or alias of your default Dev Hub org. (sfdx only)"], ["isvDebuggerSid", "ISV debugger SID (sfdx only)"], ["isvDebuggerUrl", "ISV debugger URL (sfdx only)"], ["org-isv-debugger-sid", "ISV debugger SID."], ["org-isv-debugger-url", "ISV debugger URL."], ["apiVersion", "API version of your project. Default: API version of your Dev Hub org. (sfdx only)"], ["org-api-version", "API version of your project. Default: API version of your Dev Hub org."], ["disableTelemetry", "Disables the collection of usage and user environment information, etc. Default: false. (sfdx only)"], ["disable-telemetry", "Disables the collection of usage and user environment information, etc. Default: false."], ["maxQueryLimit", "Maximum number of Salesforce records returned by a CLI command. Default: 10,000. (sfdx only)"], ["org-max-query-limit", "Maximum number of Salesforce records returned by a CLI command. Default: 10,000."], ["restDeploy", "Whether deployments use the Metadata REST API (true) or SOAP API (false, default value). (sfdx only)"], ["instanceUrl", "URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com. (sfdx only)"], ["org-instance-url", "URL of the Salesforce instance hosting your org. Default: https://login.salesforce.com."], ["customOrgMetadataTemplates", "A valid repository URL or directory for the custom org metadata templates."], ["org-custom-metadata-templates", "A valid repository URL or directory for the custom org metadata templates."], ["org-capitalize-record-types", "Whether record types are capitalized on scratch org creation."], ["invalidId", "The given id %s is not a valid 15 or 18 character Salesforce ID."]]));
25
24
  /**
@@ -88,7 +87,7 @@ class SfProjectJson extends configFile_1.ConfigFile {
88
87
  * Validates sfdx-project.json against the schema.
89
88
  *
90
89
  * Set the `SFDX_PROJECT_JSON_VALIDATION` environment variable to `true` to throw an error when schema validation fails.
91
- * A warning is emitted by default when the file is invalid.
90
+ * A warning is logged by default when the file is invalid.
92
91
  *
93
92
  * ***See*** [sfdx-project.schema.json] ((https://github.com/forcedotcom/schemas/blob/main/sfdx-project.schema.json)
94
93
  */
@@ -97,16 +96,19 @@ class SfProjectJson extends configFile_1.ConfigFile {
97
96
  // read calls back into this method after necessarily setting this.hasRead=true
98
97
  await this.read();
99
98
  }
100
- const result = sfdxProjectJson_1.ProjectJsonSchema.safeParse(this.getContents());
101
- if (!result.success) {
102
- const errorMessages = result.error.issues.map((err) => `${err.path.join('.')}: ${err.message}`).join('\n');
103
- const fullMessage = messages.getMessage('schemaValidationError', [this.getPath(), errorMessages]);
99
+ try {
100
+ const projectJsonSchemaPath = require.resolve('@salesforce/schemas/sfdx-project.schema.json');
101
+ const validator = new validator_1.SchemaValidator(this.logger, projectJsonSchemaPath);
102
+ await validator.validate(this.getContents());
103
+ }
104
+ catch (err) {
105
+ const error = err;
104
106
  // Don't throw errors if the global isn't valid, but still warn the user.
105
107
  if (kit_1.env.getBoolean('SFDX_PROJECT_JSON_VALIDATION', false) && !this.options.isGlobal) {
106
- throw messages.createError('schemaValidationError', [this.getPath(), errorMessages], [this.getPath()]);
108
+ throw messages.createError('schemaValidationError', [this.getPath(), error.message], [this.getPath()], error);
107
109
  }
108
110
  else {
109
- await lifecycleEvents_1.Lifecycle.getInstance().emitWarning(fullMessage);
111
+ this.logger.warn(messages.getMessage('schemaValidationError', [this.getPath(), error.message]));
110
112
  }
111
113
  }
112
114
  }
@@ -122,7 +124,7 @@ class SfProjectJson extends configFile_1.ConfigFile {
122
124
  * Validates sfdx-project.json against the schema.
123
125
  *
124
126
  * Set the `SFDX_PROJECT_JSON_VALIDATION` environment variable to `true` to throw an error when schema validation fails.
125
- * A warning is emitted by default when the file is invalid.
127
+ * A warning is logged by default when the file is invalid.
126
128
  *
127
129
  * ***See*** [sfdx-project.schema.json] ((https://github.com/forcedotcom/schemas/blob/main/sfdx-project.schema.json)
128
130
  */
@@ -131,17 +133,19 @@ class SfProjectJson extends configFile_1.ConfigFile {
131
133
  // read calls back into this method after necessarily setting this.hasRead=true
132
134
  this.readSync();
133
135
  }
134
- const result = sfdxProjectJson_1.ProjectJsonSchema.safeParse(this.getContents());
135
- if (!result.success) {
136
- const errorMessages = result.error.issues.map((err) => `${err.path.join('.')}: ${err.message}`).join('\n');
137
- const fullMessage = messages.getMessage('schemaValidationError', [this.getPath(), errorMessages]);
136
+ try {
137
+ const projectJsonSchemaPath = require.resolve('@salesforce/schemas/sfdx-project.schema.json');
138
+ const validator = new validator_1.SchemaValidator(this.logger, projectJsonSchemaPath);
139
+ validator.validateSync(this.getContents());
140
+ }
141
+ catch (err) {
142
+ const error = err;
138
143
  // Don't throw errors if the global isn't valid, but still warn the user.
139
144
  if (kit_1.env.getBoolean('SFDX_PROJECT_JSON_VALIDATION', false) && !this.options.isGlobal) {
140
- throw messages.createError('schemaValidationError', [this.getPath(), errorMessages], [this.getPath()]);
145
+ throw messages.createError('schemaValidationError', [this.getPath(), error.message], [this.getPath()], error);
141
146
  }
142
147
  else {
143
- // For sync method, we can't await emitWarning, so we use void to fire and forget
144
- void lifecycleEvents_1.Lifecycle.getInstance().emitWarning(fullMessage);
148
+ this.logger.warn(messages.getMessage('schemaValidationError', [this.getPath(), error.message]));
145
149
  }
146
150
  }
147
151
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@salesforce/core",
3
- "version": "8.23.5-qaext.0",
3
+ "version": "8.23.5",
4
4
  "description": "Core libraries to interact with SFDX projects, orgs, and APIs.",
5
5
  "main": "lib/index",
6
6
  "types": "lib/index.d.ts",
@@ -22,13 +22,10 @@
22
22
  "./project": "./lib/sfProject.js",
23
23
  "./sfError": "./lib/sfError.js",
24
24
  "./stateAggregator": "./lib/stateAggregator/stateAggregator.js",
25
- "./testSetup": "./lib/testSetup.js",
26
- "./sfdx-project.schema.json": "./lib/sfdx-project.schema.json",
27
- "./project-scratch-def.schema.json": "./lib/project-scratch-def.schema.json"
25
+ "./testSetup": "./lib/testSetup.js"
28
26
  },
29
27
  "scripts": {
30
28
  "build": "wireit",
31
- "bundle-check": "wireit",
32
29
  "clean": "sf-clean",
33
30
  "clean-all": "sf-clean all",
34
31
  "compile": "wireit",
@@ -40,11 +37,9 @@
40
37
  "prepack": "sf-prepack",
41
38
  "prepare": "sf-install",
42
39
  "test": "wireit",
43
- "test:nuts": "wireit",
40
+ "test:nuts": "mocha \"test/**/*.nut.ts\" --timeout 500000",
44
41
  "test:only": "wireit",
45
- "test:perf": "ts-node test/perf/logger/main.test.ts",
46
- "update:features": "ts-node scripts/schemas/update-features.ts",
47
- "update:settings": "ts-node scripts/schemas/update-settings.ts"
42
+ "test:perf": "ts-node test/perf/logger/main.test.ts"
48
43
  },
49
44
  "keywords": [
50
45
  "force",
@@ -60,8 +55,9 @@
60
55
  "messageTransformer/messageTransformer.ts"
61
56
  ],
62
57
  "dependencies": {
63
- "@jsforce/jsforce-node": "^3.10.8",
58
+ "@jsforce/jsforce-node": "^3.10.10",
64
59
  "@salesforce/kit": "^3.2.4",
60
+ "@salesforce/schemas": "^1.10.3",
65
61
  "@salesforce/ts-types": "^2.0.12",
66
62
  "ajv": "^8.17.1",
67
63
  "change-case": "^4.1.2",
@@ -77,8 +73,7 @@
77
73
  "pino-pretty": "^11.3.0",
78
74
  "proper-lockfile": "^4.1.2",
79
75
  "semver": "^7.7.3",
80
- "ts-retry-promise": "^0.8.1",
81
- "zod": "^4.1.12"
76
+ "ts-retry-promise": "^0.8.1"
82
77
  },
83
78
  "devDependencies": {
84
79
  "@salesforce/dev-scripts": "^10.1.1",
@@ -177,19 +172,6 @@
177
172
  "link-check"
178
173
  ]
179
174
  },
180
- "test:nuts": {
181
- "command": "mocha \"test/**/*.nut.ts\" --timeout 500000",
182
- "dependencies": [
183
- "compile"
184
- ],
185
- "files": [
186
- "test/nut/**/*",
187
- "src/**/*.ts",
188
- "**/tsconfig.json",
189
- ".mocha*"
190
- ],
191
- "output": []
192
- },
193
175
  "bundle-check": {
194
176
  "command": "node scripts/build.mjs",
195
177
  "dependencies": [
@@ -215,34 +197,6 @@
215
197
  },
216
198
  "compile-typedoc": {
217
199
  "command": "tsc -p typedocExamples"
218
- },
219
- "build:schema:project": {
220
- "command": "ts-node scripts/schemas/build-schema-project.ts",
221
- "dependencies": [
222
- "compile"
223
- ],
224
- "files": [
225
- "src/schema/sfdx-project/**/*.ts",
226
- "scripts/schemas/build-schema-project.ts",
227
- "scripts/schemas/consts.ts"
228
- ],
229
- "output": [
230
- "lib/sfdx-project.schema.json"
231
- ]
232
- },
233
- "build:schema:scratch": {
234
- "command": "ts-node scripts/schemas/build-schema-scratch.ts",
235
- "dependencies": [
236
- "compile"
237
- ],
238
- "files": [
239
- "src/schema/project-scratch-def/**/*.ts",
240
- "scripts/schemas/build-schema-scratch.ts",
241
- "scripts/schemas/consts.ts"
242
- ],
243
- "output": [
244
- "lib/project-scratch-def.schema.json"
245
- ]
246
200
  }
247
201
  }
248
202
  }
@@ -1,4 +0,0 @@
1
- import { z } from 'zod';
2
- export declare const FeaturesSchema: z.ZodArray<z.ZodUnion<readonly [z.ZodUnion<z.ZodString[]>, z.ZodEnum<{
3
- [x: string]: string;
4
- }>]>>;
@@ -1,25 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FeaturesSchema = void 0;
4
- /*
5
- * Copyright (c) 2023, salesforce.com, inc.
6
- * All rights reserved.
7
- * Licensed under the BSD 3-Clause license.
8
- * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
9
- */
10
- const zod_1 = require("zod");
11
- const simpleFeaturesList_1 = require("./simpleFeaturesList");
12
- const patternFeaturesList_1 = require("./patternFeaturesList");
13
- // Helper to create a feature pattern with title
14
- const featurePattern = (name) => zod_1.z
15
- .string()
16
- .regex(new RegExp(`^${name}:[0-9]+$`))
17
- .meta({ title: `${name}:<value>` });
18
- // Combined features schema
19
- exports.FeaturesSchema = zod_1.z.array(zod_1.z.union([
20
- // Feature patterns - parametrized features with numeric values
21
- zod_1.z.union(patternFeaturesList_1.patternFeaturesList.map(featurePattern)),
22
- // Feature enum - boolean/named features
23
- zod_1.z.enum(simpleFeaturesList_1.simpleFeaturesList),
24
- ]));
25
- //# sourceMappingURL=features.js.map
@@ -1 +0,0 @@
1
- export declare const patternFeaturesList: string[];
@@ -1,69 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.patternFeaturesList = void 0;
4
- /*
5
- * Copyright (c) 2023, salesforce.com, inc.
6
- * All rights reserved.
7
- * Licensed under the BSD 3-Clause license.
8
- * For full license text, see LICENSE.txt file in the repo root or https://opensource.org/licenses/BSD-3-Clause
9
- */
10
- exports.patternFeaturesList = [
11
- 'AddCustomApps',
12
- 'AddCustomObjects',
13
- 'AddCustomRelationships',
14
- 'AddCustomTabs',
15
- 'AddDataComCRMRecordCredit',
16
- 'AddInsightsQueryLimit',
17
- 'AdditionalFieldHistory',
18
- 'AssetScheduling',
19
- 'CalloutSizeMB',
20
- 'ConcStreamingClients',
21
- 'ConsolePersistenceInterval',
22
- 'EducationCloud',
23
- 'EmpPublishRateLimit',
24
- 'EncryptionStatisticsInterval',
25
- 'EncryptionSyncInterval',
26
- 'FieldService',
27
- 'FieldServiceAppointmentAssistantUser',
28
- 'FieldServiceDispatcherUser',
29
- 'FieldServiceLastMileUser',
30
- 'FieldServiceMobileUser',
31
- 'FieldServiceSchedulingUser',
32
- 'FinancialServicesCommunityUser',
33
- 'FinancialServicesUser',
34
- 'GenStreamingEventsPerDay',
35
- 'HoursBetweenCoverageJob',
36
- 'LoyaltyMaxOrderLinePerHour',
37
- 'LoyaltyMaxProcExecPerHour',
38
- 'LoyaltyMaxTransactions',
39
- 'LoyaltyMaxTrxnJournals',
40
- 'LoyaltyMaximumPartners',
41
- 'LoyaltyMaximumPrograms',
42
- 'MaxActiveDPEDefs',
43
- 'MaxApexCodeSize',
44
- 'MaxCustomLabels',
45
- 'MaxDataSourcesPerDPE',
46
- 'MaxDatasetLinksPerDT',
47
- 'MaxDecisionTableAllowed',
48
- 'MaxFavoritesAllowed',
49
- 'MaxFieldsPerNode',
50
- 'MaxInputColumnsPerDT',
51
- 'MaxLoyaltyProcessRules',
52
- 'MaxNoOfLexThemesAllowed',
53
- 'MaxNodesPerDPE',
54
- 'MaxOutputColumnsPerDT',
55
- 'MaxSourceObjectPerDSL',
56
- 'MaxStreamingTopics',
57
- 'MaxUserNavItemsAllowed',
58
- 'MaxUserStreamingChannels',
59
- 'MaxWritebacksPerDPE',
60
- 'MedVisDescriptorLimit',
61
- 'MobileExtMaxFileSizeMB',
62
- 'NumPlatformEvents',
63
- 'PlatformConnect',
64
- 'PlatformEventsPerDay',
65
- 'StreamingEventsPerDay',
66
- 'SubPerStreamingChannel',
67
- 'SubPerStreamingTopic',
68
- ];
69
- //# sourceMappingURL=patternFeaturesList.js.map