@salesforce/source-deploy-retrieve 13.12.1 → 13.14.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 (106) hide show
  1. package/lib/src/client/index.d.ts +1 -0
  2. package/lib/src/client/index.js.map +1 -1
  3. package/lib/src/client/metadataApiDeploy.d.ts +7 -0
  4. package/lib/src/client/metadataApiDeploy.js +25 -8
  5. package/lib/src/client/metadataApiDeploy.js.map +1 -1
  6. package/lib/src/client/metadataApiRetrieve.d.ts +7 -0
  7. package/lib/src/client/metadataApiRetrieve.js +24 -7
  8. package/lib/src/client/metadataApiRetrieve.js.map +1 -1
  9. package/lib/src/client/metadataTransfer.d.ts +3 -0
  10. package/lib/src/client/metadataTransfer.js +12 -2
  11. package/lib/src/client/metadataTransfer.js.map +1 -1
  12. package/lib/src/client/transports/computeAppTransport.d.ts +14 -0
  13. package/lib/src/client/transports/computeAppTransport.js +219 -0
  14. package/lib/src/client/transports/computeAppTransport.js.map +1 -0
  15. package/lib/src/client/transports/computeSourceBundle.d.ts +10 -0
  16. package/lib/src/client/transports/computeSourceBundle.js +331 -0
  17. package/lib/src/client/transports/computeSourceBundle.js.map +1 -0
  18. package/lib/src/client/transports/index.d.ts +2 -0
  19. package/lib/src/client/transports/index.js +18 -0
  20. package/lib/src/client/transports/index.js.map +1 -0
  21. package/lib/src/client/transports/transportCoordinator.d.ts +21 -0
  22. package/lib/src/client/transports/transportCoordinator.js +117 -0
  23. package/lib/src/client/transports/transportCoordinator.js.map +1 -0
  24. package/lib/src/client/transports/transportPipeline.d.ts +55 -0
  25. package/lib/src/client/transports/transportPipeline.js +191 -0
  26. package/lib/src/client/transports/transportPipeline.js.map +1 -0
  27. package/lib/src/client/transports/types.d.ts +47 -0
  28. package/lib/src/client/transports/types.js +18 -0
  29. package/lib/src/client/transports/types.js.map +1 -0
  30. package/lib/src/client/types.d.ts +8 -0
  31. package/lib/src/collections/componentSet.d.ts +9 -0
  32. package/lib/src/collections/componentSet.js +132 -2
  33. package/lib/src/collections/componentSet.js.map +1 -1
  34. package/lib/src/collections/componentSetBuilder.js +1 -1
  35. package/lib/src/collections/componentSetBuilder.js.map +1 -1
  36. package/lib/src/convert/convertContext/convertContext.js.map +1 -1
  37. package/lib/src/convert/convertContext/profileMetadataFinalizer.js +1 -1
  38. package/lib/src/convert/convertContext/profileMetadataFinalizer.js.map +1 -1
  39. package/lib/src/convert/convertContext/recompositionFinalizer.js +1 -1
  40. package/lib/src/convert/convertContext/recompositionFinalizer.js.map +1 -1
  41. package/lib/src/convert/metadataConverter.js +1 -1
  42. package/lib/src/convert/metadataConverter.js.map +1 -1
  43. package/lib/src/convert/replacements.js +1 -1
  44. package/lib/src/convert/replacements.js.map +1 -1
  45. package/lib/src/convert/streams.js +1 -1
  46. package/lib/src/convert/streams.js.map +1 -1
  47. package/lib/src/convert/transformers/computeAppMetadataTransformer.d.ts +18 -0
  48. package/lib/src/convert/transformers/computeAppMetadataTransformer.js +67 -0
  49. package/lib/src/convert/transformers/computeAppMetadataTransformer.js.map +1 -0
  50. package/lib/src/convert/transformers/decomposedMetadataTransformer.js +1 -1
  51. package/lib/src/convert/transformers/decomposedMetadataTransformer.js.map +1 -1
  52. package/lib/src/convert/transformers/defaultMetadataTransformer.js +1 -1
  53. package/lib/src/convert/transformers/defaultMetadataTransformer.js.map +1 -1
  54. package/lib/src/convert/transformers/metadataTransformerFactory.js +4 -1
  55. package/lib/src/convert/transformers/metadataTransformerFactory.js.map +1 -1
  56. package/lib/src/convert/transformers/nonDecomposedMetadataTransformer.js +1 -1
  57. package/lib/src/convert/transformers/nonDecomposedMetadataTransformer.js.map +1 -1
  58. package/lib/src/convert/transformers/staticResourceMetadataTransformer.js +1 -1
  59. package/lib/src/convert/transformers/staticResourceMetadataTransformer.js.map +1 -1
  60. package/lib/src/index.d.ts +1 -1
  61. package/lib/src/index.js.map +1 -1
  62. package/lib/src/registry/levenshtein.js +1 -1
  63. package/lib/src/registry/levenshtein.js.map +1 -1
  64. package/lib/src/registry/metadataRegistry.json +25 -1
  65. package/lib/src/registry/registryAccess.js +1 -1
  66. package/lib/src/registry/registryAccess.js.map +1 -1
  67. package/lib/src/registry/types.d.ts +5 -2
  68. package/lib/src/registry/types.js +2 -0
  69. package/lib/src/registry/types.js.map +1 -1
  70. package/lib/src/registry/variants.js +1 -1
  71. package/lib/src/registry/variants.js.map +1 -1
  72. package/lib/src/resolve/adapters/baseSourceAdapter.js +1 -1
  73. package/lib/src/resolve/adapters/baseSourceAdapter.js.map +1 -1
  74. package/lib/src/resolve/adapters/computeAppSourceAdapter.d.ts +28 -0
  75. package/lib/src/resolve/adapters/computeAppSourceAdapter.js +75 -0
  76. package/lib/src/resolve/adapters/computeAppSourceAdapter.js.map +1 -0
  77. package/lib/src/resolve/adapters/decomposedSourceAdapter.js +1 -1
  78. package/lib/src/resolve/adapters/decomposedSourceAdapter.js.map +1 -1
  79. package/lib/src/resolve/adapters/digitalExperienceSourceAdapter.js +1 -1
  80. package/lib/src/resolve/adapters/digitalExperienceSourceAdapter.js.map +1 -1
  81. package/lib/src/resolve/adapters/index.d.ts +1 -0
  82. package/lib/src/resolve/adapters/index.js +3 -1
  83. package/lib/src/resolve/adapters/index.js.map +1 -1
  84. package/lib/src/resolve/adapters/matchingContentSourceAdapter.js +1 -1
  85. package/lib/src/resolve/adapters/matchingContentSourceAdapter.js.map +1 -1
  86. package/lib/src/resolve/adapters/mixedContentSourceAdapter.js +1 -1
  87. package/lib/src/resolve/adapters/mixedContentSourceAdapter.js.map +1 -1
  88. package/lib/src/resolve/adapters/sourceAdapterFactory.js +4 -1
  89. package/lib/src/resolve/adapters/sourceAdapterFactory.js.map +1 -1
  90. package/lib/src/resolve/adapters/uiBundlesSourceAdapter.js +1 -1
  91. package/lib/src/resolve/adapters/uiBundlesSourceAdapter.js.map +1 -1
  92. package/lib/src/resolve/connectionResolver.js +1 -1
  93. package/lib/src/resolve/connectionResolver.js.map +1 -1
  94. package/lib/src/resolve/metadataResolver.js +2 -2
  95. package/lib/src/resolve/metadataResolver.js.map +1 -1
  96. package/lib/src/resolve/sourceComponent.js +1 -1
  97. package/lib/src/resolve/sourceComponent.js.map +1 -1
  98. package/lib/src/resolve/treeContainers.js +1 -1
  99. package/lib/src/resolve/treeContainers.js.map +1 -1
  100. package/lib/src/utils/filePathGenerator.js +5 -6
  101. package/lib/src/utils/filePathGenerator.js.map +1 -1
  102. package/lib/src/utils/path.js +1 -1
  103. package/lib/src/utils/path.js.map +1 -1
  104. package/messages/computeApp.md +107 -0
  105. package/messages/sdr.md +4 -0
  106. package/package.json +5 -2
@@ -0,0 +1,219 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright 2026, Salesforce, Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ var __importDefault = (this && this.__importDefault) || function (mod) {
18
+ return (mod && mod.__esModule) ? mod : { "default": mod };
19
+ };
20
+ Object.defineProperty(exports, "__esModule", { value: true });
21
+ exports.ComputeAppTransport = void 0;
22
+ const node_fs_1 = require("node:fs");
23
+ const node_path_1 = require("node:path");
24
+ const form_data_1 = __importDefault(require("form-data"));
25
+ const core_1 = require("@salesforce/core");
26
+ const constants_1 = require("../../common/constants");
27
+ const types_1 = require("../types");
28
+ const computeSourceBundle_1 = require("./computeSourceBundle");
29
+ ;
30
+ const messages = new core_1.Messages('@salesforce/source-deploy-retrieve', 'computeApp', new Map([["missingApiSpec", "ComputeApp '%s' is missing required api-spec.yaml in %s"], ["missingProcfile", "ComputeApp '%s' has no Procfile in %s. A compute app needs a Procfile to define how it starts. Add a Procfile to the app directory before deploying."], ["missingComponentContent", "ComputeAppTransport requires a content path for '%s'"], ["missingComponentXml", "ComputeApp '%s' is missing %s.computeApp-meta.xml in %s"], ["missingPackageOption", "No package option found for '%s' (component '%s')"], ["transportOperationFailed", "Elastic Compute %s failed for %s"], ["unknownError", "unknown error"], ["checkOnlyResult", "Packaged and checked only. The org validates against the last uploaded source, not your local files."], ["bundleApiSpecSizeLimit", "Compute source bundle: api-spec.yaml entry size limit (%s bytes) exceeded"], ["bundleFileSizeLimit", "Compute source bundle: entry size limit (%s bytes) exceeded for %s"], ["bundleEntrySizeLimit", "Compute source bundle: entry size limit (%s bytes) exceeded"], ["bundleTotalSizeLimit", "Compute source bundle: total size limit (%s bytes) exceeded"], ["bundleSourceArchiveSizeLimit", "Compute source bundle: source.tar.gz entry size limit (%s bytes) exceeded"], ["bundleOuterTotalSizeLimit", "Compute source bundle: outer total size limit (%s bytes) exceeded"], ["bundleCompressedSizeLimit", "Compute source bundle: compressed size limit (%s bytes) exceeded"], ["bundleEntryCountLimit", "Compute source bundle: entry count limit (%s) exceeded"], ["malformedBundleEmpty", "Malformed compute source bundle: archive contains no files"], ["malformedBundleUnsafePath", "Malformed compute source bundle: unsafe entry path \"%s\""], ["malformedBundleSymlink", "Malformed compute source bundle: symlink in output path \"%s\""], ["malformedBundleCompressedSizeLimit", "Malformed compute source bundle: compressed size limit (%s bytes) exceeded"], ["malformedBundleDecompressedSizeLimit", "Malformed compute source bundle: decompressed size limit (%s bytes) exceeded"], ["malformedBundleInvalidGzip", "Malformed compute source bundle: not a valid gzip archive"], ["malformedBundleUnsupportedEntry", "Malformed compute source bundle: unsupported %s entry \"%s\""], ["malformedBundleEntryCountLimit", "Malformed compute source bundle: entry count limit (%s) exceeded"], ["malformedBundleEntrySizeLimit", "Malformed compute source bundle: entry size limit (%s bytes) or total size limit (%s bytes) exceeded"], ["malformedBundleTotalSizeLimit", "Malformed compute source bundle: total size limit (%s bytes) exceeded"], ["malformedBundleInvalidTar", "Malformed compute source bundle: not a valid tar archive"]]));
31
+ const ENDPOINT = '/connect/compute/source';
32
+ // follow the package's existing layout: `<pkg>/main/default/...` when it has that root, otherwise `<pkg>/...`
33
+ function resolveContentPath(component, packageDir) {
34
+ const sourceRoot = (0, node_fs_1.existsSync)((0, node_path_1.join)(packageDir, constants_1.DEFAULT_PACKAGE_ROOT_SFDX))
35
+ ? (0, node_path_1.join)(packageDir, constants_1.DEFAULT_PACKAGE_ROOT_SFDX)
36
+ : packageDir;
37
+ return (0, node_path_1.join)(sourceRoot, component.type.directoryName, component.fullName);
38
+ }
39
+ async function uploadSource(connection, name, bundle) {
40
+ const form = new form_data_1.default();
41
+ form.append('name', name);
42
+ form.append('bundle', bundle, {
43
+ filename: 'deployment-bundle.tar.gz',
44
+ contentType: 'application/gzip',
45
+ });
46
+ return connection.request({
47
+ method: 'POST',
48
+ url: ENDPOINT,
49
+ body: form.getBuffer(),
50
+ headers: form.getHeaders(),
51
+ });
52
+ }
53
+ // jsforce decodes to UTF-8 by default — lossy for gzip bytes.
54
+ // encoding: 'binary' (latin1) preserves byte values 1:1. Connection.request
55
+ // buffers the complete response; this guard prevents a second oversized Buffer
56
+ // allocation, while unpackComputeBundle limits the archive after download.
57
+ async function downloadSource(connection, appIdOrName) {
58
+ const body = await connection.request({ method: 'GET', url: `/connect/compute/${encodeURIComponent(appIdOrName)}/builds/latest/source` }, { encoding: 'binary' });
59
+ if (body.length > computeSourceBundle_1.MAX_COMPRESSED_BYTES) {
60
+ throw messages.createError('bundleCompressedSizeLimit', [computeSourceBundle_1.MAX_COMPRESSED_BYTES]);
61
+ }
62
+ return Buffer.from(body, 'binary');
63
+ }
64
+ class ComputeAppTransport {
65
+ name = 'computeApp';
66
+ logger = core_1.Logger.childFromRoot('ComputeAppTransport');
67
+ // eslint-disable-next-line class-methods-use-this
68
+ describe() {
69
+ return { label: 'Elastic Compute', endpoint: ENDPOINT };
70
+ }
71
+ handles(component) {
72
+ return component.type.strategies?.transport === this.name;
73
+ }
74
+ async beforeDeploy(context) {
75
+ const operationResults = [];
76
+ void core_1.Lifecycle.getInstance().emitTelemetry({
77
+ eventName: 'elastic_compute_pre_deploy',
78
+ library: 'SDR',
79
+ checkOnly: Boolean(context.checkOnly),
80
+ });
81
+ const operation = context.checkOnly ? 'check' : 'upload';
82
+ // Package and check every app before uploading any, so one bad app cannot
83
+ // leave another app's source live without its metadata deploy.
84
+ const packaged = [];
85
+ const failedResponses = [];
86
+ for (const component of context.components) {
87
+ try {
88
+ this.assertComputeComponent(component);
89
+ this.logger.debug('packaging compute source for %s from %s', component.fullName, component.content);
90
+ // eslint-disable-next-line no-await-in-loop
91
+ const bundle = await (0, computeSourceBundle_1.packageComputeBundle)(component.content, component.fullName, context.project.getPath());
92
+ this.logger.debug('packaged %s: %d bytes, %d files', component.fullName, bundle.buffer.length, bundle.fileCount);
93
+ packaged.push({ component, buffer: bundle.buffer });
94
+ }
95
+ catch (err) {
96
+ failedResponses.push(this.failedResponse(component, err));
97
+ }
98
+ }
99
+ if (failedResponses.length > 0) {
100
+ throw this.failureError(failedResponses, operation);
101
+ }
102
+ const fileResponses = [];
103
+ for (const { component, buffer } of packaged) {
104
+ try {
105
+ if (context.checkOnly) {
106
+ this.logger.debug('check only: skipping upload of %s', component.fullName);
107
+ }
108
+ else {
109
+ // eslint-disable-next-line no-await-in-loop
110
+ const result = await uploadSource(context.connection, component.fullName, buffer);
111
+ this.logger.debug('uploaded %s: buildId=%s', component.fullName, result.buildId);
112
+ }
113
+ fileResponses.push({
114
+ fullName: component.fullName,
115
+ type: component.type.name,
116
+ state: types_1.ComponentStatus.Changed,
117
+ filePath: component.content,
118
+ });
119
+ operationResults.push({
120
+ transportLabel: this.describe().label,
121
+ operation: `${context.checkOnly ? 'Validate' : 'Upload'} ${component.fullName}`,
122
+ status: 'Succeeded',
123
+ ...(context.checkOnly ? { message: messages.getMessage('checkOnlyResult') } : {}),
124
+ });
125
+ }
126
+ catch (err) {
127
+ fileResponses.push(this.failedResponse(component, err));
128
+ }
129
+ }
130
+ return { ...this.checkForFailures(fileResponses, operation), operationResults };
131
+ }
132
+ async afterRetrieve(context) {
133
+ const fileResponses = [];
134
+ void core_1.Lifecycle.getInstance().emitTelemetry({
135
+ eventName: 'elastic_compute_post_retrieve',
136
+ library: 'SDR',
137
+ });
138
+ for (const component of context.components) {
139
+ try {
140
+ const packageName = context.transportPackageNames?.[`${component.type.name}#${component.fullName}`];
141
+ const packageOutput = packageName
142
+ ? context.packageOptions
143
+ ?.map((option) => (typeof option === 'string' ? { name: option, outputDir: option } : option))
144
+ .find((option) => option.name === packageName)
145
+ : undefined;
146
+ if (!component.content && packageName && !packageOutput) {
147
+ throw messages.createError('missingPackageOption', [packageName, component.fullName]);
148
+ }
149
+ const contentPath = component.content ??
150
+ resolveContentPath(component, packageOutput?.outputDir ??
151
+ packageOutput?.name ??
152
+ context.output ??
153
+ context.project.getDefaultPackage().fullPath);
154
+ this.logger.debug('retrieving compute source for %s into %s', component.fullName, contentPath);
155
+ // eslint-disable-next-line no-await-in-loop
156
+ const buffer = await downloadSource(context.connection, component.fullName);
157
+ // eslint-disable-next-line no-await-in-loop
158
+ const unpacked = await (0, computeSourceBundle_1.unpackComputeBundle)(buffer, contentPath);
159
+ this.logger.debug('unpacked %s: %d files into %s', component.fullName, unpacked.fileCount, contentPath);
160
+ fileResponses.push({
161
+ fullName: component.fullName,
162
+ type: component.type.name,
163
+ state: types_1.ComponentStatus.Changed,
164
+ filePath: contentPath,
165
+ });
166
+ }
167
+ catch (err) {
168
+ fileResponses.push({
169
+ fullName: component.fullName,
170
+ type: component.type.name,
171
+ state: types_1.ComponentStatus.Failed,
172
+ filePath: component.content ?? component.xml ?? '',
173
+ error: err.message,
174
+ problemType: 'Error',
175
+ });
176
+ }
177
+ }
178
+ return this.checkForFailures(fileResponses, 'download');
179
+ }
180
+ // eslint-disable-next-line class-methods-use-this
181
+ assertComputeComponent(component) {
182
+ if (!component.content) {
183
+ throw new core_1.SfError(messages.getMessage('missingComponentContent', [component.fullName]), 'MissingComponentContent');
184
+ }
185
+ // check before uploading, otherwise the app source goes live with no metadata deploy
186
+ if (!component.xml) {
187
+ throw new core_1.SfError(messages.getMessage('missingComponentXml', [component.fullName, component.fullName, component.content]), 'MissingComponentXml');
188
+ }
189
+ }
190
+ // eslint-disable-next-line class-methods-use-this
191
+ failedResponse(component, err) {
192
+ return {
193
+ fullName: component.fullName,
194
+ type: component.type.name,
195
+ state: types_1.ComponentStatus.Failed,
196
+ filePath: component.content ?? component.xml ?? '',
197
+ error: err.message,
198
+ problemType: 'Error',
199
+ };
200
+ }
201
+ // eslint-disable-next-line class-methods-use-this
202
+ failureError(fileResponses, operation) {
203
+ const failures = fileResponses.filter((r) => r.state === types_1.ComponentStatus.Failed);
204
+ const details = failures
205
+ .map((f) => `'${f.fullName}': ${f.error ?? messages.getMessage('unknownError')}`)
206
+ .join('; ');
207
+ const error = new core_1.SfError(messages.getMessage('transportOperationFailed', [operation, details]), `ComputeApp${operation.charAt(0).toUpperCase() + operation.slice(1)}Error`);
208
+ error.data = fileResponses;
209
+ return error;
210
+ }
211
+ checkForFailures(fileResponses, operation) {
212
+ if (fileResponses.some((r) => r.state === types_1.ComponentStatus.Failed)) {
213
+ throw this.failureError(fileResponses, operation);
214
+ }
215
+ return { fileResponses };
216
+ }
217
+ }
218
+ exports.ComputeAppTransport = ComputeAppTransport;
219
+ //# sourceMappingURL=computeAppTransport.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeAppTransport.js","sourceRoot":"","sources":["../../../../src/client/transports/computeAppTransport.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;AAEH,qCAAqC;AACrC,yCAAiC;AACjC,0DAAiC;AACjC,2CAAwE;AAExE,sDAAmE;AAEnE,oCAAyD;AAQzD,+DAAwG;;AAUxG,MAAM,QAAQ,OAAG,eAAQ,CAAc,oCAAoC,EAAE,YAAY,qmFAAC,CAAC;AAE3F,MAAM,QAAQ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AE,EAAE,CAAC,CAAC,CAAC,KAAK,KAAK,uBAAe,CAAC,MAAM,CAAC,EAAE,CAAC;YAClE,MAAM,IAAI,CAAC,YAAY,CAAC,aAAa,EAAE,SAAS,CAAC,CAAC;QACpD,CAAC;QAED,OAAO,EAAE,aAAa,EAAE,CAAC;IAC3B,CAAC;CACF;AA1LD,kDA0LC"}
@@ -0,0 +1,10 @@
1
+ export declare const MAX_COMPRESSED_BYTES: number;
2
+ export type PackagedBundle = {
3
+ buffer: Buffer;
4
+ fileCount: number;
5
+ };
6
+ export type UnpackedBundle = {
7
+ fileCount: number;
8
+ };
9
+ export declare function packageComputeBundle(appDir: string, name: string, projectRoot?: string): Promise<PackagedBundle>;
10
+ export declare function unpackComputeBundle(buffer: Buffer, appDir: string): Promise<UnpackedBundle>;
@@ -0,0 +1,331 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright 2026, Salesforce, Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
18
+ if (k2 === undefined) k2 = k;
19
+ var desc = Object.getOwnPropertyDescriptor(m, k);
20
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
21
+ desc = { enumerable: true, get: function() { return m[k]; } };
22
+ }
23
+ Object.defineProperty(o, k2, desc);
24
+ }) : (function(o, m, k, k2) {
25
+ if (k2 === undefined) k2 = k;
26
+ o[k2] = m[k];
27
+ }));
28
+ var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
29
+ Object.defineProperty(o, "default", { enumerable: true, value: v });
30
+ }) : function(o, v) {
31
+ o["default"] = v;
32
+ });
33
+ var __importStar = (this && this.__importStar) || (function () {
34
+ var ownKeys = function(o) {
35
+ ownKeys = Object.getOwnPropertyNames || function (o) {
36
+ var ar = [];
37
+ for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
38
+ return ar;
39
+ };
40
+ return ownKeys(o);
41
+ };
42
+ return function (mod) {
43
+ if (mod && mod.__esModule) return mod;
44
+ var result = {};
45
+ if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
46
+ __setModuleDefault(result, mod);
47
+ return result;
48
+ };
49
+ })();
50
+ Object.defineProperty(exports, "__esModule", { value: true });
51
+ exports.MAX_COMPRESSED_BYTES = void 0;
52
+ exports.packageComputeBundle = packageComputeBundle;
53
+ exports.unpackComputeBundle = unpackComputeBundle;
54
+ const node_fs_1 = require("node:fs");
55
+ const promises_1 = require("node:fs/promises");
56
+ const node_path_1 = require("node:path");
57
+ const node_zlib_1 = require("node:zlib");
58
+ const consumers_1 = require("node:stream/consumers");
59
+ const tarStream = __importStar(require("tar-stream"));
60
+ const core_1 = require("@salesforce/core");
61
+ const forceIgnore_1 = require("../../resolve/forceIgnore");
62
+ ;
63
+ const messages = new core_1.Messages('@salesforce/source-deploy-retrieve', 'computeApp', new Map([["missingApiSpec", "ComputeApp '%s' is missing required api-spec.yaml in %s"], ["missingProcfile", "ComputeApp '%s' has no Procfile in %s. A compute app needs a Procfile to define how it starts. Add a Procfile to the app directory before deploying."], ["missingComponentContent", "ComputeAppTransport requires a content path for '%s'"], ["missingComponentXml", "ComputeApp '%s' is missing %s.computeApp-meta.xml in %s"], ["missingPackageOption", "No package option found for '%s' (component '%s')"], ["transportOperationFailed", "Elastic Compute %s failed for %s"], ["unknownError", "unknown error"], ["checkOnlyResult", "Packaged and checked only. The org validates against the last uploaded source, not your local files."], ["bundleApiSpecSizeLimit", "Compute source bundle: api-spec.yaml entry size limit (%s bytes) exceeded"], ["bundleFileSizeLimit", "Compute source bundle: entry size limit (%s bytes) exceeded for %s"], ["bundleEntrySizeLimit", "Compute source bundle: entry size limit (%s bytes) exceeded"], ["bundleTotalSizeLimit", "Compute source bundle: total size limit (%s bytes) exceeded"], ["bundleSourceArchiveSizeLimit", "Compute source bundle: source.tar.gz entry size limit (%s bytes) exceeded"], ["bundleOuterTotalSizeLimit", "Compute source bundle: outer total size limit (%s bytes) exceeded"], ["bundleCompressedSizeLimit", "Compute source bundle: compressed size limit (%s bytes) exceeded"], ["bundleEntryCountLimit", "Compute source bundle: entry count limit (%s) exceeded"], ["malformedBundleEmpty", "Malformed compute source bundle: archive contains no files"], ["malformedBundleUnsafePath", "Malformed compute source bundle: unsafe entry path \"%s\""], ["malformedBundleSymlink", "Malformed compute source bundle: symlink in output path \"%s\""], ["malformedBundleCompressedSizeLimit", "Malformed compute source bundle: compressed size limit (%s bytes) exceeded"], ["malformedBundleDecompressedSizeLimit", "Malformed compute source bundle: decompressed size limit (%s bytes) exceeded"], ["malformedBundleInvalidGzip", "Malformed compute source bundle: not a valid gzip archive"], ["malformedBundleUnsupportedEntry", "Malformed compute source bundle: unsupported %s entry \"%s\""], ["malformedBundleEntryCountLimit", "Malformed compute source bundle: entry count limit (%s) exceeded"], ["malformedBundleEntrySizeLimit", "Malformed compute source bundle: entry size limit (%s bytes) or total size limit (%s bytes) exceeded"], ["malformedBundleTotalSizeLimit", "Malformed compute source bundle: total size limit (%s bytes) exceeded"], ["malformedBundleInvalidTar", "Malformed compute source bundle: not a valid tar archive"]]));
64
+ const logger = core_1.Logger.childFromRoot('computeSourceBundle');
65
+ // Compute source bundles are app source, not dependency caches or compiled artifacts.
66
+ // Cap the gzip layer and the tar entries retained in memory when unpacking.
67
+ exports.MAX_COMPRESSED_BYTES = 40 * 1024 * 1024;
68
+ const MAX_TAR_BYTES = 64 * 1024 * 1024;
69
+ const MAX_ENTRY_BYTES = 16 * 1024 * 1024;
70
+ const MAX_TOTAL_ENTRY_BYTES = 40 * 1024 * 1024;
71
+ const MAX_ENTRIES = 1000;
72
+ // Upload shape: deployment-bundle.tar.gz containing api-spec.yaml plus a
73
+ // nested source.tar.gz with the app's source files. Downloads return only that
74
+ // source.tar.gz (see unpackComputeBundle).
75
+ async function packageComputeBundle(appDir, name, projectRoot) {
76
+ const apiSpecPath = (0, node_path_1.join)(appDir, 'api-spec.yaml');
77
+ try {
78
+ await (0, promises_1.access)(apiSpecPath);
79
+ }
80
+ catch {
81
+ throw new core_1.SfError(messages.getMessage('missingApiSpec', [name, appDir]), 'MissingApiSpec');
82
+ }
83
+ let hasProcfile = false;
84
+ try {
85
+ // a directory named Procfile, or a differently-cased file on a case-insensitive disk, must not pass
86
+ hasProcfile = (await (0, promises_1.stat)((0, node_path_1.join)(appDir, 'Procfile'))).isFile() && (await (0, promises_1.readdir)(appDir)).includes('Procfile');
87
+ }
88
+ catch {
89
+ // a missing Procfile is reported below
90
+ }
91
+ if (!hasProcfile) {
92
+ throw new core_1.SfError(messages.getMessage('missingProcfile', [name, appDir]), 'MissingProcfile');
93
+ }
94
+ const metaFileName = `${name}.computeApp-meta.xml`;
95
+ const excluded = new Set([metaFileName, '.forceignore']);
96
+ // These files are consumed at build/runtime (and Procfile is checked above), so a broad
97
+ // .forceignore must not remove them from the nested source archive.
98
+ const alwaysIncluded = new Set(['api-spec.yaml', 'project.toml', 'Procfile']);
99
+ // The app's nearest .forceignore and the project-root .forceignore each match paths
100
+ // relative to their own directory, so keep one instance per directory. Neither search
101
+ // goes above the project root, so a stray file in a parent folder or home directory
102
+ // cannot apply.
103
+ const forceIgnores = [nearestForceIgnore(appDir, projectRoot)];
104
+ if (projectRoot && (0, node_path_1.resolve)(projectRoot) !== (0, node_path_1.resolve)(appDir)) {
105
+ forceIgnores.push(new forceIgnore_1.ForceIgnore((0, node_path_1.join)(projectRoot, '.forceignore')));
106
+ }
107
+ const sourceRelativePaths = await listFilesRecursive(appDir, (file) => !excluded.has(file) &&
108
+ (alwaysIncluded.has(file) || forceIgnores.every((ignore) => ignore.accepts((0, node_path_1.join)(appDir, file)))));
109
+ logger.debug('packaging %s: %d files after exclusions/.forceignore', appDir, sourceRelativePaths.length);
110
+ const apiSpec = await (0, promises_1.readFile)(apiSpecPath);
111
+ if (apiSpec.length > MAX_ENTRY_BYTES) {
112
+ throw messages.createError('bundleApiSpecSizeLimit', [MAX_ENTRY_BYTES]);
113
+ }
114
+ let sourceBytes = 0;
115
+ for (const relativePath of sourceRelativePaths) {
116
+ // eslint-disable-next-line no-await-in-loop
117
+ const { size } = await (0, promises_1.lstat)((0, node_path_1.join)(appDir, relativePath));
118
+ if (size > MAX_ENTRY_BYTES) {
119
+ throw messages.createError('bundleFileSizeLimit', [MAX_ENTRY_BYTES, relativePath]);
120
+ }
121
+ sourceBytes += size;
122
+ if (sourceBytes > MAX_TOTAL_ENTRY_BYTES) {
123
+ throw messages.createError('bundleTotalSizeLimit', [MAX_TOTAL_ENTRY_BYTES]);
124
+ }
125
+ }
126
+ const sourceEntries = await Promise.all(sourceRelativePaths.map(async (relativePath) => ({
127
+ name: relativePath,
128
+ data: await (0, promises_1.readFile)((0, node_path_1.join)(appDir, relativePath)),
129
+ })));
130
+ // The source may change between stat and read; check actual bytes before assembling.
131
+ if (sourceEntries.some(({ data }) => data.length > MAX_ENTRY_BYTES)) {
132
+ throw messages.createError('bundleEntrySizeLimit', [MAX_ENTRY_BYTES]);
133
+ }
134
+ if (sourceEntries.reduce((total, { data }) => total + data.length, 0) > MAX_TOTAL_ENTRY_BYTES) {
135
+ throw messages.createError('bundleTotalSizeLimit', [MAX_TOTAL_ENTRY_BYTES]);
136
+ }
137
+ const sourceTarGz = await tarGzip(sourceEntries);
138
+ if (sourceTarGz.length > exports.MAX_COMPRESSED_BYTES) {
139
+ throw messages.createError('bundleSourceArchiveSizeLimit', [exports.MAX_COMPRESSED_BYTES]);
140
+ }
141
+ if (apiSpec.length + sourceTarGz.length > MAX_TOTAL_ENTRY_BYTES) {
142
+ throw messages.createError('bundleOuterTotalSizeLimit', [MAX_TOTAL_ENTRY_BYTES]);
143
+ }
144
+ const buffer = await tarGzip([
145
+ { name: 'api-spec.yaml', data: apiSpec },
146
+ { name: 'source.tar.gz', data: sourceTarGz },
147
+ ]);
148
+ if (buffer.length > exports.MAX_COMPRESSED_BYTES) {
149
+ throw messages.createError('bundleCompressedSizeLimit', [exports.MAX_COMPRESSED_BYTES]);
150
+ }
151
+ logger.debug('packaged %s into %d bytes (%d files)', appDir, buffer.length, sourceEntries.length);
152
+ return { buffer, fileCount: sourceEntries.length };
153
+ }
154
+ // Download shape: a flat source.tar.gz of the latest build's source files,
155
+ // which already include api-spec.yaml and project.toml.
156
+ async function unpackComputeBundle(buffer, appDir) {
157
+ const entries = await untarGzip(buffer);
158
+ const names = Object.keys(entries);
159
+ if (names.length === 0) {
160
+ throw messages.createError('malformedBundleEmpty');
161
+ }
162
+ const resolvedAppDir = (0, node_path_1.resolve)(appDir);
163
+ const files = Object.entries(entries).map(([relativePath, data]) => {
164
+ const filePath = (0, node_path_1.resolve)(appDir, relativePath);
165
+ // tar-slip guard: reject entries that escape appDir
166
+ if (!filePath.startsWith(resolvedAppDir + node_path_1.sep)) {
167
+ throw messages.createError('malformedBundleUnsafePath', [relativePath]);
168
+ }
169
+ return { filePath, data };
170
+ });
171
+ // Check every output path before writing so a rejected entry leaves the app directory untouched.
172
+ await rejectSymlinks(resolvedAppDir);
173
+ await Promise.all(files.map(({ filePath }) => rejectSymlinks(filePath)));
174
+ await (0, promises_1.mkdir)(appDir, { recursive: true });
175
+ // Settle every write before reporting a failure so no write is still in flight when the caller sees the error.
176
+ const writes = await Promise.allSettled(files.map(async ({ filePath, data }) => {
177
+ await (0, promises_1.mkdir)((0, node_path_1.dirname)(filePath), { recursive: true });
178
+ await rejectSymlinks(filePath);
179
+ await (0, promises_1.writeFile)(filePath, data);
180
+ }));
181
+ const failed = writes.find((write) => write.status === 'rejected');
182
+ if (failed)
183
+ throw failed.reason;
184
+ return { fileCount: names.length };
185
+ }
186
+ async function rejectSymlinks(filePath) {
187
+ let current = (0, node_path_1.resolve)(filePath);
188
+ const root = (0, node_path_1.parse)(current).root;
189
+ // The filesystem root is trusted; inspect every component beneath it, including
190
+ // ancestors of an already-existing app or output file.
191
+ while (current !== root) {
192
+ try {
193
+ // eslint-disable-next-line no-await-in-loop
194
+ const entryStat = await (0, promises_1.lstat)(current);
195
+ if (entryStat.isSymbolicLink()) {
196
+ // macOS exposes /var as a system alias for /private/var. Do not reject
197
+ // ordinary output paths in its temporary directory for that alias.
198
+ // eslint-disable-next-line no-await-in-loop
199
+ if (!(process.platform === 'darwin' && current === '/var' && (await (0, promises_1.realpath)(current)) === '/private/var')) {
200
+ throw messages.createError('malformedBundleSymlink', [current]);
201
+ }
202
+ }
203
+ }
204
+ catch (err) {
205
+ if (err.code !== 'ENOENT')
206
+ throw err;
207
+ }
208
+ current = (0, node_path_1.dirname)(current);
209
+ }
210
+ }
211
+ function untarGzip(buffer) {
212
+ return new Promise((resolveEntries, reject) => {
213
+ if (buffer.length > exports.MAX_COMPRESSED_BYTES) {
214
+ reject(messages.createError('malformedBundleCompressedSizeLimit', [exports.MAX_COMPRESSED_BYTES]));
215
+ return;
216
+ }
217
+ let decompressed;
218
+ try {
219
+ decompressed = (0, node_zlib_1.gunzipSync)(buffer, { maxOutputLength: MAX_TAR_BYTES });
220
+ }
221
+ catch (err) {
222
+ reject(err.code === 'ERR_BUFFER_TOO_LARGE'
223
+ ? messages.createError('malformedBundleDecompressedSizeLimit', [MAX_TAR_BYTES])
224
+ : messages.createError('malformedBundleInvalidGzip'));
225
+ return;
226
+ }
227
+ const entries = {};
228
+ const extract = tarStream.extract();
229
+ let entryCount = 0;
230
+ let totalBytes = 0;
231
+ extract.on('entry', (header, stream, next) => {
232
+ // Archives made by system tar list directories; files below them create those paths when written.
233
+ if (header.type === 'directory') {
234
+ stream.on('end', next);
235
+ stream.resume();
236
+ return;
237
+ }
238
+ if (header.type && header.type !== 'file' && header.type !== 'contiguous-file') {
239
+ reject(messages.createError('malformedBundleUnsupportedEntry', [header.type, header.name]));
240
+ extract.destroy();
241
+ return;
242
+ }
243
+ entryCount++;
244
+ if (entryCount > MAX_ENTRIES) {
245
+ reject(messages.createError('malformedBundleEntryCountLimit', [MAX_ENTRIES]));
246
+ extract.destroy();
247
+ return;
248
+ }
249
+ if ((header.size && header.size > MAX_ENTRY_BYTES) ||
250
+ (header.size && totalBytes + header.size > MAX_TOTAL_ENTRY_BYTES)) {
251
+ reject(messages.createError('malformedBundleEntrySizeLimit', [MAX_ENTRY_BYTES, MAX_TOTAL_ENTRY_BYTES]));
252
+ extract.destroy();
253
+ return;
254
+ }
255
+ const chunks = [];
256
+ stream.on('data', (chunk) => {
257
+ totalBytes += chunk.length;
258
+ if (totalBytes > MAX_TOTAL_ENTRY_BYTES) {
259
+ reject(messages.createError('malformedBundleTotalSizeLimit', [MAX_TOTAL_ENTRY_BYTES]));
260
+ extract.destroy();
261
+ return;
262
+ }
263
+ chunks.push(chunk);
264
+ });
265
+ stream.on('end', () => {
266
+ entries[header.name] = Buffer.concat(chunks);
267
+ next();
268
+ });
269
+ stream.on('error', reject);
270
+ stream.resume();
271
+ });
272
+ extract.on('finish', () => resolveEntries(entries));
273
+ extract.on('error', () => reject(messages.createError('malformedBundleInvalidTar')));
274
+ extract.end(decompressed);
275
+ });
276
+ }
277
+ async function tarGzip(entries) {
278
+ const pack = tarStream.pack();
279
+ // Pipe BEFORE writing entries to avoid deadlock: pack is a Readable with
280
+ // a 16KB highWaterMark — without a consumer attached, backpressure stalls
281
+ // the entry callbacks once buffered bytes exceed the threshold.
282
+ const gzippedBufferPromise = (0, consumers_1.buffer)(pack.pipe((0, node_zlib_1.createGzip)()));
283
+ await entries.reduce((previous, { name, data }) => previous.then(async () => new Promise((resolveEntry, reject) => {
284
+ pack.entry({ name, size: data.length }, data, (err) => (err ? reject(err) : resolveEntry()));
285
+ })), Promise.resolve());
286
+ pack.finalize();
287
+ return gzippedBufferPromise;
288
+ }
289
+ function nearestForceIgnore(appDir, projectRoot) {
290
+ if (!projectRoot)
291
+ return forceIgnore_1.ForceIgnore.findAndCreate(appDir);
292
+ const root = (0, node_path_1.resolve)(projectRoot);
293
+ let dir = (0, node_path_1.resolve)(appDir);
294
+ // Only search upward when the app is inside the project.
295
+ while (dir === root || dir.startsWith(root + node_path_1.sep)) {
296
+ const candidate = (0, node_path_1.join)(dir, '.forceignore');
297
+ if ((0, node_fs_1.existsSync)(candidate))
298
+ return new forceIgnore_1.ForceIgnore(candidate);
299
+ if (dir === root)
300
+ break;
301
+ dir = (0, node_path_1.dirname)(dir);
302
+ }
303
+ return new forceIgnore_1.ForceIgnore();
304
+ }
305
+ async function listFilesRecursive(base, accepts) {
306
+ const files = [];
307
+ async function walk(dir) {
308
+ const entries = await (0, promises_1.readdir)(dir, { withFileTypes: true });
309
+ for (const entry of entries) {
310
+ if (entry.name.startsWith('.'))
311
+ continue;
312
+ const full = (0, node_path_1.join)(dir, entry.name);
313
+ if (entry.isDirectory()) {
314
+ // eslint-disable-next-line no-await-in-loop
315
+ await walk(full);
316
+ }
317
+ else if (entry.isFile()) {
318
+ const file = (0, node_path_1.relative)(base, full).split(node_path_1.sep).join('/');
319
+ if (accepts(file)) {
320
+ if (files.length === MAX_ENTRIES) {
321
+ throw messages.createError('bundleEntryCountLimit', [MAX_ENTRIES]);
322
+ }
323
+ files.push(file);
324
+ }
325
+ }
326
+ }
327
+ }
328
+ await walk(base);
329
+ return files;
330
+ }
331
+ //# sourceMappingURL=computeSourceBundle.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"computeSourceBundle.js","sourceRoot":"","sources":["../../../../src/client/transports/computeSourceBundle.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAmCH,oDA4FC;AAID,kDAiCC;AAlKD,qCAAqC;AACr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AAkC;IAChF,MAAM,KAAK,GAAa,EAAE,CAAC;IAC3B,KAAK,UAAU,IAAI,CAAC,GAAW;QAC7B,MAAM,OAAO,GAAG,MAAM,IAAA,kBAAO,EAAC,GAAG,EAAE,EAAE,aAAa,EAAE,IAAI,EAAE,CAAC,CAAC;QAC5D,KAAK,MAAM,KAAK,IAAI,OAAO,EAAE,CAAC;YAC5B,IAAI,KAAK,CAAC,IAAI,CAAC,UAAU,CAAC,GAAG,CAAC;gBAAE,SAAS;YACzC,MAAM,IAAI,GAAG,IAAA,gBAAI,EAAC,GAAG,EAAE,KAAK,CAAC,IAAI,CAAC,CAAC;YACnC,IAAI,KAAK,CAAC,WAAW,EAAE,EAAE,CAAC;gBACxB,4CAA4C;gBAC5C,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;YACnB,CAAC;iBAAM,IAAI,KAAK,CAAC,MAAM,EAAE,EAAE,CAAC;gBAC1B,MAAM,IAAI,GAAG,IAAA,oBAAQ,EAAC,IAAI,EAAE,IAAI,CAAC,CAAC,KAAK,CAAC,eAAG,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;gBACvD,IAAI,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;oBAClB,IAAI,KAAK,CAAC,MAAM,KAAK,WAAW,EAAE,CAAC;wBACjC,MAAM,QAAQ,CAAC,WAAW,CAAC,uBAAuB,EAAE,CAAC,WAAW,CAAC,CAAC,CAAC;oBACrE,CAAC;oBACD,KAAK,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;gBACnB,CAAC;YACH,CAAC;QACH,CAAC;IACH,CAAC;IACD,MAAM,IAAI,CAAC,IAAI,CAAC,CAAC;IACjB,OAAO,KAAK,CAAC;AACf,CAAC"}
@@ -0,0 +1,2 @@
1
+ export type { TransportPlan, TransportPlanComponent, TransportPlanPhase, TransportStageEvent, } from './transportPipeline';
2
+ export type { TransportOperationResult } from './types';
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ /*
3
+ * Copyright 2026, Salesforce, Inc.
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ Object.defineProperty(exports, "__esModule", { value: true });
18
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/client/transports/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG"}