@salesforce/core 8.23.7 → 8.24.1-dev.0

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 (34) hide show
  1. package/LICENSE.txt +1 -1
  2. package/README.md +27 -0
  3. package/lib/index.d.ts +6 -1
  4. package/lib/index.js +11 -2
  5. package/lib/org/scratchOrgInfoGenerator.js +12 -1
  6. package/lib/schema/project-scratch-def/features.d.ts +2 -0
  7. package/lib/schema/project-scratch-def/features.js +36 -0
  8. package/lib/schema/project-scratch-def/patternFeaturesList.d.ts +1 -0
  9. package/lib/schema/project-scratch-def/patternFeaturesList.js +69 -0
  10. package/lib/schema/project-scratch-def/scratchOrgDef.d.ts +176 -0
  11. package/lib/schema/project-scratch-def/scratchOrgDef.js +73 -0
  12. package/lib/schema/project-scratch-def/settings.d.ts +150 -0
  13. package/lib/schema/project-scratch-def/settings.js +591 -0
  14. package/lib/schema/project-scratch-def/simpleFeaturesList.d.ts +1 -0
  15. package/lib/schema/project-scratch-def/simpleFeaturesList.js +272 -0
  16. package/lib/schema/sfdx-project/bundleEntry.d.ts +11 -0
  17. package/lib/schema/sfdx-project/bundleEntry.js +28 -0
  18. package/lib/schema/sfdx-project/packageDir.d.ts +84 -0
  19. package/lib/schema/sfdx-project/packageDir.js +146 -0
  20. package/lib/schema/sfdx-project/registryPresets.d.ts +2 -0
  21. package/lib/schema/sfdx-project/registryPresets.js +12 -0
  22. package/lib/schema/sfdx-project/registryVariants.d.ts +104 -0
  23. package/lib/schema/sfdx-project/registryVariants.js +57 -0
  24. package/lib/schema/sfdx-project/replacements.d.ts +70 -0
  25. package/lib/schema/sfdx-project/replacements.js +76 -0
  26. package/lib/schema/sfdx-project/sfdxProjectJson.d.ts +201 -0
  27. package/lib/schema/sfdx-project/sfdxProjectJson.js +89 -0
  28. package/lib/schema/validator.d.ts +8 -0
  29. package/lib/schema/validator.js +8 -0
  30. package/lib/sfProject.d.ts +7 -5
  31. package/lib/sfProject.js +17 -21
  32. package/package.json +62 -9
  33. package/schemas/project-scratch-def.schema.json +1789 -0
  34. package/schemas/sfdx-project.schema.json +909 -0
@@ -0,0 +1,57 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.MetadataRegistrySchema = 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 SuffixIndexSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.string());
12
+ const DirectoryIndexSchema = zod_1.z.record(zod_1.z.string(), zod_1.z.string());
13
+ /**
14
+ * TypeInfoSchema has a circular reference (children.types references TypeIndexSchema,
15
+ * which references TypeInfoSchema). We use z.lazy() to defer schema evaluation until
16
+ * runtime to avoid "Cannot access before initialization" errors. z.ZodType<T> provides
17
+ * an explicit type annotation since TypeScript can't infer recursive types properly.
18
+ */
19
+ const TypeInfoSchema = zod_1.z.lazy(() => zod_1.z.object({
20
+ id: zod_1.z.string(),
21
+ name: zod_1.z.string(),
22
+ directoryName: zod_1.z.string(),
23
+ suffix: zod_1.z.string().optional(),
24
+ strictDirectoryName: zod_1.z.boolean().optional(),
25
+ ignoreParsedFullName: zod_1.z.boolean().optional(),
26
+ folderContentType: zod_1.z.string().optional(),
27
+ folderType: zod_1.z.string().optional(),
28
+ xmlElementName: zod_1.z.string().optional(),
29
+ uniqueIdElement: zod_1.z.string().optional(),
30
+ isAddressable: zod_1.z.boolean().optional(),
31
+ unaddressableWithoutParent: zod_1.z.boolean().optional(),
32
+ supportsWildcardAndName: zod_1.z.boolean().optional(),
33
+ supportsPartialDelete: zod_1.z.boolean().optional(),
34
+ aliasFor: zod_1.z.string().optional(),
35
+ children: zod_1.z
36
+ .object({
37
+ types: TypeIndexSchema,
38
+ suffixes: SuffixIndexSchema,
39
+ directories: DirectoryIndexSchema.optional(),
40
+ })
41
+ .optional(),
42
+ strategies: zod_1.z
43
+ .object({
44
+ adapter: zod_1.z.enum(['mixedContent', 'matchingContentFile', 'decomposed', 'bundle', 'default']),
45
+ transformer: zod_1.z.enum(['decomposed', 'staticResource', 'standard']).optional(),
46
+ decomposition: zod_1.z.enum(['topLevel', 'folderPerType']).optional(),
47
+ })
48
+ .optional(),
49
+ }));
50
+ const TypeIndexSchema = zod_1.z.lazy(() => zod_1.z.record(zod_1.z.string(), TypeInfoSchema));
51
+ exports.MetadataRegistrySchema = zod_1.z.object({
52
+ types: TypeIndexSchema,
53
+ suffixes: SuffixIndexSchema,
54
+ strictDirectoryNames: zod_1.z.record(zod_1.z.string(), zod_1.z.string()),
55
+ childTypes: zod_1.z.record(zod_1.z.string(), zod_1.z.string()),
56
+ });
57
+ //# sourceMappingURL=registryVariants.js.map
@@ -0,0 +1,70 @@
1
+ import { z } from 'zod';
2
+ export declare const ReplacementsSchema: z.ZodUnion<readonly [z.ZodObject<{
3
+ replaceWhenEnv: z.ZodOptional<z.ZodArray<z.ZodObject<{
4
+ env: z.ZodString;
5
+ value: z.ZodString;
6
+ }, z.core.$strict>>>;
7
+ filename: z.ZodString;
8
+ stringToReplace: z.ZodString;
9
+ replaceWithFile: z.ZodString;
10
+ }, z.core.$strict>, z.ZodObject<{
11
+ replaceWhenEnv: z.ZodOptional<z.ZodArray<z.ZodObject<{
12
+ env: z.ZodString;
13
+ value: z.ZodString;
14
+ }, z.core.$strict>>>;
15
+ filename: z.ZodString;
16
+ stringToReplace: z.ZodString;
17
+ replaceWithEnv: z.ZodString;
18
+ allowUnsetEnvVariable: z.ZodOptional<z.ZodBoolean>;
19
+ }, z.core.$strict>, z.ZodObject<{
20
+ replaceWhenEnv: z.ZodOptional<z.ZodArray<z.ZodObject<{
21
+ env: z.ZodString;
22
+ value: z.ZodString;
23
+ }, z.core.$strict>>>;
24
+ filename: z.ZodString;
25
+ regexToReplace: z.ZodString;
26
+ replaceWithFile: z.ZodString;
27
+ }, z.core.$strict>, z.ZodObject<{
28
+ replaceWhenEnv: z.ZodOptional<z.ZodArray<z.ZodObject<{
29
+ env: z.ZodString;
30
+ value: z.ZodString;
31
+ }, z.core.$strict>>>;
32
+ filename: z.ZodString;
33
+ regexToReplace: z.ZodString;
34
+ replaceWithEnv: z.ZodString;
35
+ allowUnsetEnvVariable: z.ZodOptional<z.ZodBoolean>;
36
+ }, z.core.$strict>, z.ZodObject<{
37
+ replaceWhenEnv: z.ZodOptional<z.ZodArray<z.ZodObject<{
38
+ env: z.ZodString;
39
+ value: z.ZodString;
40
+ }, z.core.$strict>>>;
41
+ glob: z.ZodString;
42
+ stringToReplace: z.ZodString;
43
+ replaceWithFile: z.ZodString;
44
+ }, z.core.$strict>, z.ZodObject<{
45
+ replaceWhenEnv: z.ZodOptional<z.ZodArray<z.ZodObject<{
46
+ env: z.ZodString;
47
+ value: z.ZodString;
48
+ }, z.core.$strict>>>;
49
+ glob: z.ZodString;
50
+ stringToReplace: z.ZodString;
51
+ replaceWithEnv: z.ZodString;
52
+ allowUnsetEnvVariable: z.ZodOptional<z.ZodBoolean>;
53
+ }, z.core.$strict>, z.ZodObject<{
54
+ replaceWhenEnv: z.ZodOptional<z.ZodArray<z.ZodObject<{
55
+ env: z.ZodString;
56
+ value: z.ZodString;
57
+ }, z.core.$strict>>>;
58
+ glob: z.ZodString;
59
+ regexToReplace: z.ZodString;
60
+ replaceWithFile: z.ZodString;
61
+ }, z.core.$strict>, z.ZodObject<{
62
+ replaceWhenEnv: z.ZodOptional<z.ZodArray<z.ZodObject<{
63
+ env: z.ZodString;
64
+ value: z.ZodString;
65
+ }, z.core.$strict>>>;
66
+ glob: z.ZodString;
67
+ regexToReplace: z.ZodString;
68
+ replaceWithEnv: z.ZodString;
69
+ allowUnsetEnvVariable: z.ZodOptional<z.ZodBoolean>;
70
+ }, z.core.$strict>]>;
@@ -0,0 +1,76 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ReplacementsSchema = 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 EnvConditionalSchema = zod_1.z
12
+ .object({
13
+ env: zod_1.z.string(),
14
+ value: zod_1.z.string(),
15
+ })
16
+ .strict();
17
+ const BaseReplacementSchema = zod_1.z.object({
18
+ replaceWhenEnv: zod_1.z.array(EnvConditionalSchema).optional(),
19
+ });
20
+ // Create explicit union variants to generate proper JSON Schema with anyOf
21
+ // Each variant has strict required fields and additionalProperties: false
22
+ exports.ReplacementsSchema = zod_1.z.union([
23
+ // filename + stringToReplace + replaceWithFile
24
+ BaseReplacementSchema.extend({
25
+ filename: zod_1.z.string(),
26
+ stringToReplace: zod_1.z.string(),
27
+ replaceWithFile: zod_1.z.string(),
28
+ }).strict(),
29
+ // filename + stringToReplace + replaceWithEnv
30
+ BaseReplacementSchema.extend({
31
+ filename: zod_1.z.string(),
32
+ stringToReplace: zod_1.z.string(),
33
+ replaceWithEnv: zod_1.z.string(),
34
+ allowUnsetEnvVariable: zod_1.z.boolean().optional(),
35
+ }).strict(),
36
+ // filename + regexToReplace + replaceWithFile
37
+ BaseReplacementSchema.extend({
38
+ filename: zod_1.z.string(),
39
+ regexToReplace: zod_1.z.string(),
40
+ replaceWithFile: zod_1.z.string(),
41
+ }).strict(),
42
+ // filename + regexToReplace + replaceWithEnv
43
+ BaseReplacementSchema.extend({
44
+ filename: zod_1.z.string(),
45
+ regexToReplace: zod_1.z.string(),
46
+ replaceWithEnv: zod_1.z.string(),
47
+ allowUnsetEnvVariable: zod_1.z.boolean().optional(),
48
+ }).strict(),
49
+ // glob + stringToReplace + replaceWithFile
50
+ BaseReplacementSchema.extend({
51
+ glob: zod_1.z.string(),
52
+ stringToReplace: zod_1.z.string(),
53
+ replaceWithFile: zod_1.z.string(),
54
+ }).strict(),
55
+ // glob + stringToReplace + replaceWithEnv
56
+ BaseReplacementSchema.extend({
57
+ glob: zod_1.z.string(),
58
+ stringToReplace: zod_1.z.string(),
59
+ replaceWithEnv: zod_1.z.string(),
60
+ allowUnsetEnvVariable: zod_1.z.boolean().optional(),
61
+ }).strict(),
62
+ // glob + regexToReplace + replaceWithFile
63
+ BaseReplacementSchema.extend({
64
+ glob: zod_1.z.string(),
65
+ regexToReplace: zod_1.z.string(),
66
+ replaceWithFile: zod_1.z.string(),
67
+ }).strict(),
68
+ // glob + regexToReplace + replaceWithEnv
69
+ BaseReplacementSchema.extend({
70
+ glob: zod_1.z.string(),
71
+ regexToReplace: zod_1.z.string(),
72
+ replaceWithEnv: zod_1.z.string(),
73
+ allowUnsetEnvVariable: zod_1.z.boolean().optional(),
74
+ }).strict(),
75
+ ]);
76
+ //# sourceMappingURL=replacements.js.map
@@ -0,0 +1,201 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * The properties and shape of the SFDX project
4
+ */
5
+ export declare const ProjectJsonSchema: z.ZodObject<{
6
+ name: z.ZodOptional<z.ZodString>;
7
+ packageDirectories: z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
8
+ default: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
9
+ path: z.ZodString;
10
+ }, z.core.$strict>, z.ZodObject<{
11
+ default: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
12
+ path: z.ZodString;
13
+ ancestorId: z.ZodOptional<z.ZodString>;
14
+ ancestorVersion: z.ZodOptional<z.ZodString>;
15
+ apexTestAccess: z.ZodOptional<z.ZodObject<{
16
+ permissionSets: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodString]>;
17
+ permissionSetLicenses: z.ZodUnion<readonly [z.ZodArray<z.ZodString>, z.ZodString]>;
18
+ }, z.core.$strip>>;
19
+ definitionFile: z.ZodOptional<z.ZodString>;
20
+ dependencies: z.ZodOptional<z.ZodArray<z.ZodObject<{
21
+ package: z.ZodString;
22
+ versionNumber: z.ZodOptional<z.ZodString>;
23
+ branch: z.ZodOptional<z.ZodString>;
24
+ }, z.core.$catchall<z.ZodUnknown>>>>;
25
+ includeProfileUserLicenses: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
26
+ package: z.ZodString;
27
+ packageMetadataAccess: z.ZodOptional<z.ZodObject<{
28
+ permissionSets: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
29
+ permissionSetLicenses: z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>;
30
+ }, z.core.$strip>>;
31
+ postInstallScript: z.ZodOptional<z.ZodString>;
32
+ postInstallUrl: z.ZodOptional<z.ZodString>;
33
+ releaseNotesUrl: z.ZodOptional<z.ZodString>;
34
+ scopeProfiles: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
35
+ uninstallScript: z.ZodOptional<z.ZodString>;
36
+ calculateTransitiveDependencies: z.ZodOptional<z.ZodDefault<z.ZodBoolean>>;
37
+ versionDescription: z.ZodOptional<z.ZodString>;
38
+ versionName: z.ZodOptional<z.ZodString>;
39
+ versionNumber: z.ZodString;
40
+ unpackagedMetadata: z.ZodOptional<z.ZodObject<{
41
+ path: z.ZodString;
42
+ }, z.core.$strip>>;
43
+ seedMetadata: z.ZodOptional<z.ZodObject<{
44
+ path: z.ZodString;
45
+ }, z.core.$strip>>;
46
+ functions: z.ZodOptional<z.ZodArray<z.ZodString>>;
47
+ }, z.core.$strict>]>>;
48
+ namespace: z.ZodOptional<z.ZodString>;
49
+ sourceApiVersion: z.ZodOptional<z.ZodDefault<z.ZodString>>;
50
+ sfdcLoginUrl: z.ZodOptional<z.ZodString>;
51
+ signupTargetLoginUrl: z.ZodOptional<z.ZodString>;
52
+ oauthLocalPort: z.ZodOptional<z.ZodDefault<z.ZodNumber>>;
53
+ plugins: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
54
+ packageAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
55
+ packageBundles: z.ZodOptional<z.ZodArray<z.ZodObject<{
56
+ name: z.ZodString;
57
+ versionName: z.ZodString;
58
+ versionNumber: z.ZodString;
59
+ versionDescription: z.ZodOptional<z.ZodString>;
60
+ }, z.core.$strip>>>;
61
+ packageBundleAliases: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<readonly [z.ZodString, z.ZodArray<z.ZodString>]>>>;
62
+ registryPresets: z.ZodOptional<z.ZodArray<z.ZodString>>;
63
+ sourceBehaviorOptions: z.ZodOptional<z.ZodArray<z.ZodString>>;
64
+ registryCustomizations: z.ZodOptional<z.ZodObject<{
65
+ types: z.ZodType<{
66
+ [typeId: string]: {
67
+ id: string;
68
+ name: string;
69
+ directoryName: string;
70
+ suffix?: string;
71
+ strictDirectoryName?: boolean;
72
+ ignoreParsedFullName?: boolean;
73
+ folderContentType?: string;
74
+ folderType?: string;
75
+ xmlElementName?: string;
76
+ uniqueIdElement?: string;
77
+ isAddressable?: boolean;
78
+ unaddressableWithoutParent?: boolean;
79
+ supportsWildcardAndName?: boolean;
80
+ supportsPartialDelete?: boolean;
81
+ aliasFor?: string;
82
+ children?: {
83
+ types: {
84
+ [typeId: string]: any;
85
+ };
86
+ suffixes: Record<string, string>;
87
+ directories?: Record<string, string>;
88
+ };
89
+ strategies?: {
90
+ adapter: "mixedContent" | "matchingContentFile" | "decomposed" | "bundle" | "default";
91
+ transformer?: "decomposed" | "staticResource" | "standard";
92
+ decomposition?: "topLevel" | "folderPerType";
93
+ };
94
+ };
95
+ }, unknown, z.core.$ZodTypeInternals<{
96
+ [typeId: string]: {
97
+ id: string;
98
+ name: string;
99
+ directoryName: string;
100
+ suffix?: string;
101
+ strictDirectoryName?: boolean;
102
+ ignoreParsedFullName?: boolean;
103
+ folderContentType?: string;
104
+ folderType?: string;
105
+ xmlElementName?: string;
106
+ uniqueIdElement?: string;
107
+ isAddressable?: boolean;
108
+ unaddressableWithoutParent?: boolean;
109
+ supportsWildcardAndName?: boolean;
110
+ supportsPartialDelete?: boolean;
111
+ aliasFor?: string;
112
+ children?: {
113
+ types: {
114
+ [typeId: string]: any;
115
+ };
116
+ suffixes: Record<string, string>;
117
+ directories?: Record<string, string>;
118
+ };
119
+ strategies?: {
120
+ adapter: "mixedContent" | "matchingContentFile" | "decomposed" | "bundle" | "default";
121
+ transformer?: "decomposed" | "staticResource" | "standard";
122
+ decomposition?: "topLevel" | "folderPerType";
123
+ };
124
+ };
125
+ }, unknown>>;
126
+ suffixes: z.ZodRecord<z.ZodString, z.ZodString>;
127
+ strictDirectoryNames: z.ZodRecord<z.ZodString, z.ZodString>;
128
+ childTypes: z.ZodRecord<z.ZodString, z.ZodString>;
129
+ }, z.core.$strip>>;
130
+ replacements: z.ZodOptional<z.ZodArray<z.ZodUnion<readonly [z.ZodObject<{
131
+ replaceWhenEnv: z.ZodOptional<z.ZodArray<z.ZodObject<{
132
+ env: z.ZodString;
133
+ value: z.ZodString;
134
+ }, z.core.$strict>>>;
135
+ filename: z.ZodString;
136
+ stringToReplace: z.ZodString;
137
+ replaceWithFile: z.ZodString;
138
+ }, z.core.$strict>, z.ZodObject<{
139
+ replaceWhenEnv: z.ZodOptional<z.ZodArray<z.ZodObject<{
140
+ env: z.ZodString;
141
+ value: z.ZodString;
142
+ }, z.core.$strict>>>;
143
+ filename: z.ZodString;
144
+ stringToReplace: z.ZodString;
145
+ replaceWithEnv: z.ZodString;
146
+ allowUnsetEnvVariable: z.ZodOptional<z.ZodBoolean>;
147
+ }, z.core.$strict>, z.ZodObject<{
148
+ replaceWhenEnv: z.ZodOptional<z.ZodArray<z.ZodObject<{
149
+ env: z.ZodString;
150
+ value: z.ZodString;
151
+ }, z.core.$strict>>>;
152
+ filename: z.ZodString;
153
+ regexToReplace: z.ZodString;
154
+ replaceWithFile: z.ZodString;
155
+ }, z.core.$strict>, z.ZodObject<{
156
+ replaceWhenEnv: z.ZodOptional<z.ZodArray<z.ZodObject<{
157
+ env: z.ZodString;
158
+ value: z.ZodString;
159
+ }, z.core.$strict>>>;
160
+ filename: z.ZodString;
161
+ regexToReplace: z.ZodString;
162
+ replaceWithEnv: z.ZodString;
163
+ allowUnsetEnvVariable: z.ZodOptional<z.ZodBoolean>;
164
+ }, z.core.$strict>, z.ZodObject<{
165
+ replaceWhenEnv: z.ZodOptional<z.ZodArray<z.ZodObject<{
166
+ env: z.ZodString;
167
+ value: z.ZodString;
168
+ }, z.core.$strict>>>;
169
+ glob: z.ZodString;
170
+ stringToReplace: z.ZodString;
171
+ replaceWithFile: z.ZodString;
172
+ }, z.core.$strict>, z.ZodObject<{
173
+ replaceWhenEnv: z.ZodOptional<z.ZodArray<z.ZodObject<{
174
+ env: z.ZodString;
175
+ value: z.ZodString;
176
+ }, z.core.$strict>>>;
177
+ glob: z.ZodString;
178
+ stringToReplace: z.ZodString;
179
+ replaceWithEnv: z.ZodString;
180
+ allowUnsetEnvVariable: z.ZodOptional<z.ZodBoolean>;
181
+ }, z.core.$strict>, z.ZodObject<{
182
+ replaceWhenEnv: z.ZodOptional<z.ZodArray<z.ZodObject<{
183
+ env: z.ZodString;
184
+ value: z.ZodString;
185
+ }, z.core.$strict>>>;
186
+ glob: z.ZodString;
187
+ regexToReplace: z.ZodString;
188
+ replaceWithFile: z.ZodString;
189
+ }, z.core.$strict>, z.ZodObject<{
190
+ replaceWhenEnv: z.ZodOptional<z.ZodArray<z.ZodObject<{
191
+ env: z.ZodString;
192
+ value: z.ZodString;
193
+ }, z.core.$strict>>>;
194
+ glob: z.ZodString;
195
+ regexToReplace: z.ZodString;
196
+ replaceWithEnv: z.ZodString;
197
+ allowUnsetEnvVariable: z.ZodOptional<z.ZodBoolean>;
198
+ }, z.core.$strict>]>>>;
199
+ pushPackageDirectoriesSequentially: z.ZodOptional<z.ZodBoolean>;
200
+ }, z.core.$strict>;
201
+ export type ProjectJson = z.infer<typeof ProjectJsonSchema>;
@@ -0,0 +1,89 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ProjectJsonSchema = 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 packageDir_1 = require("./packageDir");
12
+ const registryPresets_1 = require("./registryPresets");
13
+ const registryVariants_1 = require("./registryVariants");
14
+ const replacements_1 = require("./replacements");
15
+ const bundleEntry_1 = require("./bundleEntry");
16
+ /**
17
+ * The properties and shape of the SFDX project
18
+ */
19
+ exports.ProjectJsonSchema = zod_1.z.strictObject({
20
+ name: zod_1.z.string().optional().describe('The name of your Salesforce project.'),
21
+ packageDirectories: zod_1.z
22
+ .array(packageDir_1.PackageDirSchema)
23
+ .min(1)
24
+ .meta({ title: 'Package Directories' })
25
+ .describe('Package directories indicate which directories to target when syncing source to and from the scratch org. These directories can contain source from your managed package, unmanaged package, or unpackaged source, for example, ant tool or change set.'),
26
+ namespace: zod_1.z
27
+ .string()
28
+ .optional()
29
+ .describe("A namespace is an alphanumeric identifier that distinguishes your package and its contents from other packages in your customer's org. For steps on how to register a namespace and link it to your Dev Hub org, see Create and Register Your Namespace for Second-Generation Managed Packages on developer.salesforce.com. If you're creating an unlocked package, you can create it without a namespace."),
30
+ sourceApiVersion: zod_1.z
31
+ .string()
32
+ .default('48.0')
33
+ .optional()
34
+ .meta({ title: 'Source API Version' })
35
+ .describe('The API version that the source is compatible with. By default it matches the API version.'),
36
+ sfdcLoginUrl: zod_1.z
37
+ .string()
38
+ .optional()
39
+ .meta({ title: 'SFDC Login URL' })
40
+ .describe('The login URL that the force:auth commands use. If not specified, the default is login.salesforce.com. Override the default value if you want users to authorize to a specific Salesforce instance. For example, if you want to authorize into a sandbox org, set this parameter to test.salesforce.com.'),
41
+ signupTargetLoginUrl: zod_1.z
42
+ .string()
43
+ .optional()
44
+ .describe('The url that is used when creating new scratch orgs. This is typically only used for testing prerelease environments.'),
45
+ oauthLocalPort: zod_1.z
46
+ .number()
47
+ .default(1717)
48
+ .optional()
49
+ .describe('By default, the OAuth port is 1717. However, change this port if this port is already in use, and you plan to create a connected app in your Dev Hub org to support JWT-based authorization.'),
50
+ plugins: zod_1.z
51
+ .record(zod_1.z.string(), zod_1.z.unknown())
52
+ .optional()
53
+ .meta({ title: 'CLI Plugins custom settings' })
54
+ .describe('Salesforce CLI plugin configurations used with this project.'),
55
+ packageAliases: zod_1.z
56
+ .record(zod_1.z.string(), zod_1.z.string())
57
+ .optional()
58
+ .meta({ title: 'Aliases for packaging ids' })
59
+ .describe('The Salesforce CLI updates this file with the aliases when you create a package or package version. You can also manually update this section for existing packages or package versions. You can use the alias instead of the cryptic package ID when running CLI force:package commands.'),
60
+ packageBundles: zod_1.z
61
+ .array(bundleEntry_1.BundleEntrySchema)
62
+ .optional()
63
+ .meta({ title: 'Package Bundles' })
64
+ .describe('Package bundle entries for managing package bundles.'),
65
+ packageBundleAliases: zod_1.z
66
+ .record(zod_1.z.string(), zod_1.z.union([zod_1.z.string(), zod_1.z.array(zod_1.z.string())]))
67
+ .optional()
68
+ .meta({ title: 'Package Bundle Aliases' })
69
+ .describe('Aliases for package bundles.'),
70
+ registryPresets: registryPresets_1.RegistryPresetsSchema.optional()
71
+ .meta({ title: 'Custom predefined presets for decomposing metadata types' })
72
+ .describe('@deprecated use `sourceBehaviorOptions`. Filenames from https://github.com/forcedotcom/source-deploy-retrieve/tree/main/src/registry/presets'),
73
+ sourceBehaviorOptions: registryPresets_1.RegistryPresetsSchema.optional()
74
+ .meta({ title: 'Custom predefined presets for decomposing metadata types' })
75
+ .describe('Filenames from https://github.com/forcedotcom/source-deploy-retrieve/tree/main/src/registry/presets'),
76
+ registryCustomizations: registryVariants_1.MetadataRegistrySchema.optional(),
77
+ replacements: zod_1.z
78
+ .array(replacements_1.ReplacementsSchema)
79
+ .optional()
80
+ .meta({
81
+ title: 'Replacements for metadata that are executed during deployments',
82
+ })
83
+ .describe('The Salesforce CLI will conditionally replace portions of your metadata during a deployment'),
84
+ pushPackageDirectoriesSequentially: zod_1.z
85
+ .boolean()
86
+ .optional()
87
+ .describe('@deprecated only works with deprecated commands. See https://github.com/forcedotcom/cli/discussions/2402'),
88
+ });
89
+ //# sourceMappingURL=sfdxProjectJson.js.map
@@ -2,6 +2,8 @@ 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.
5
7
  */
6
8
  export declare class SchemaValidator {
7
9
  private schemaPath;
@@ -17,10 +19,14 @@ export declare class SchemaValidator {
17
19
  constructor(logger: Logger, schemaPath: string);
18
20
  /**
19
21
  * 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.
20
24
  */
21
25
  load(): Promise<JsonMap>;
22
26
  /**
23
27
  * 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.
24
30
  */
25
31
  loadSync(): JsonMap;
26
32
  /**
@@ -32,6 +38,7 @@ export declare class SchemaValidator {
32
38
  *
33
39
  * @param json A JSON value to validate against this instance's target schema.
34
40
  * @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.
35
42
  */
36
43
  validate(json: AnyJson): Promise<AnyJson>;
37
44
  /**
@@ -43,6 +50,7 @@ export declare class SchemaValidator {
43
50
  *
44
51
  * @param json A JSON value to validate against this instance's target schema.
45
52
  * @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.
46
54
  */
47
55
  validateSync<T extends AnyJson>(json: T): T;
48
56
  /**
@@ -40,6 +40,8 @@ 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.
43
45
  */
44
46
  class SchemaValidator {
45
47
  schemaPath;
@@ -59,6 +61,8 @@ class SchemaValidator {
59
61
  }
60
62
  /**
61
63
  * 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.
62
66
  */
63
67
  async load() {
64
68
  if (!this.schema) {
@@ -69,6 +73,8 @@ class SchemaValidator {
69
73
  }
70
74
  /**
71
75
  * 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.
72
78
  */
73
79
  loadSync() {
74
80
  if (!this.schema) {
@@ -86,6 +92,7 @@ class SchemaValidator {
86
92
  *
87
93
  * @param json A JSON value to validate against this instance's target schema.
88
94
  * @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.
89
96
  */
90
97
  // eslint-disable-next-line @typescript-eslint/require-await
91
98
  async validate(json) {
@@ -100,6 +107,7 @@ class SchemaValidator {
100
107
  *
101
108
  * @param json A JSON value to validate against this instance's target schema.
102
109
  * @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.
103
111
  */
104
112
  validateSync(json) {
105
113
  const schema = this.loadSync();
@@ -1,5 +1,7 @@
1
1
  import { Dictionary, JsonMap, Nullable, Optional } from '@salesforce/ts-types';
2
- import { PackageDir, ProjectJson as ProjectJsonSchema, PackagePackageDir, BundleEntry } from '@salesforce/schemas';
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';
3
5
  import { ConfigFile } from './config/configFile';
4
6
  import { ConfigContents } from './config/configStackTypes';
5
7
  type NameAndFullPath = {
@@ -14,8 +16,7 @@ type NameAndFullPath = {
14
16
  };
15
17
  export type NamedPackagingDir = PackagePackageDir & NameAndFullPath;
16
18
  export type NamedPackageDir = PackageDir & NameAndFullPath;
17
- export type { BundleEntry };
18
- export type ProjectJson = ConfigContents & ProjectJsonSchema;
19
+ export type ProjectJson = ConfigContents & ProjectJsonType;
19
20
  /**
20
21
  * The sfdx-project.json config object. This file determines if a folder is a valid sfdx project.
21
22
  *
@@ -56,7 +57,7 @@ export declare class SfProjectJson extends ConfigFile<ConfigFile.Options, Projec
56
57
  * Validates sfdx-project.json against the schema.
57
58
  *
58
59
  * Set the `SFDX_PROJECT_JSON_VALIDATION` environment variable to `true` to throw an error when schema validation fails.
59
- * A warning is logged by default when the file is invalid.
60
+ * A warning is emitted by default when the file is invalid.
60
61
  *
61
62
  * ***See*** [sfdx-project.schema.json] ((https://github.com/forcedotcom/schemas/blob/main/sfdx-project.schema.json)
62
63
  */
@@ -70,7 +71,7 @@ export declare class SfProjectJson extends ConfigFile<ConfigFile.Options, Projec
70
71
  * Validates sfdx-project.json against the schema.
71
72
  *
72
73
  * Set the `SFDX_PROJECT_JSON_VALIDATION` environment variable to `true` to throw an error when schema validation fails.
73
- * A warning is logged by default when the file is invalid.
74
+ * A warning is emitted by default when the file is invalid.
74
75
  *
75
76
  * ***See*** [sfdx-project.schema.json] ((https://github.com/forcedotcom/schemas/blob/main/sfdx-project.schema.json)
76
77
  */
@@ -400,3 +401,4 @@ export declare class SfProject {
400
401
  export declare const isPackagingDirectory: (packageDir: PackageDir) => packageDir is PackagePackageDir;
401
402
  /** 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 */
402
403
  export declare const isNamedPackagingDirectory: (packageDir: NamedPackageDir) => packageDir is NamedPackagingDir;
404
+ export {};