@heroku/plugin-compute 0.1.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.
- package/LICENSE.txt +207 -0
- package/README.md +93 -0
- package/lib/commands/compute/config/get.d.ts +19 -0
- package/lib/commands/compute/config/get.js +76 -0
- package/lib/commands/compute/config/get.js.map +1 -0
- package/lib/commands/compute/config/list.d.ts +16 -0
- package/lib/commands/compute/config/list.js +57 -0
- package/lib/commands/compute/config/list.js.map +1 -0
- package/lib/commands/compute/config/set.d.ts +20 -0
- package/lib/commands/compute/config/set.js +99 -0
- package/lib/commands/compute/config/set.js.map +1 -0
- package/lib/commands/compute/config/unset.d.ts +20 -0
- package/lib/commands/compute/config/unset.js +93 -0
- package/lib/commands/compute/config/unset.js.map +1 -0
- package/lib/commands/compute/deploy.d.ts +18 -0
- package/lib/commands/compute/deploy.js +95 -0
- package/lib/commands/compute/deploy.js.map +1 -0
- package/lib/commands/compute/display.d.ts +26 -0
- package/lib/commands/compute/display.js +188 -0
- package/lib/commands/compute/display.js.map +1 -0
- package/lib/commands/compute/generate.d.ts +21 -0
- package/lib/commands/compute/generate.js +174 -0
- package/lib/commands/compute/generate.js.map +1 -0
- package/lib/commands/compute/get/build-log.d.ts +17 -0
- package/lib/commands/compute/get/build-log.js +62 -0
- package/lib/commands/compute/get/build-log.js.map +1 -0
- package/lib/commands/compute/get/runtime-log.d.ts +17 -0
- package/lib/commands/compute/get/runtime-log.js +79 -0
- package/lib/commands/compute/get/runtime-log.js.map +1 -0
- package/lib/commands/compute/list.d.ts +13 -0
- package/lib/commands/compute/list.js +55 -0
- package/lib/commands/compute/list.js.map +1 -0
- package/lib/commands/compute/scale.d.ts +23 -0
- package/lib/commands/compute/scale.js +112 -0
- package/lib/commands/compute/scale.js.map +1 -0
- package/lib/commands/compute/source/retrieve.d.ts +18 -0
- package/lib/commands/compute/source/retrieve.js +71 -0
- package/lib/commands/compute/source/retrieve.js.map +1 -0
- package/lib/commands/compute/tail/runtime-log.d.ts +17 -0
- package/lib/commands/compute/tail/runtime-log.js +82 -0
- package/lib/commands/compute/tail/runtime-log.js.map +1 -0
- package/lib/index.d.ts +2 -0
- package/lib/index.js +20 -0
- package/lib/index.js.map +1 -0
- package/lib/shared/computeApp.d.ts +10 -0
- package/lib/shared/computeApp.js +82 -0
- package/lib/shared/computeApp.js.map +1 -0
- package/lib/shared/computeBundle.d.ts +9 -0
- package/lib/shared/computeBundle.js +202 -0
- package/lib/shared/computeBundle.js.map +1 -0
- package/lib/shared/computeConfig.d.ts +2 -0
- package/lib/shared/computeConfig.js +37 -0
- package/lib/shared/computeConfig.js.map +1 -0
- package/lib/shared/computeConnectApi.d.ts +16 -0
- package/lib/shared/computeConnectApi.js +59 -0
- package/lib/shared/computeConnectApi.js.map +1 -0
- package/lib/shared/computeGenerateSkeletons.d.ts +2 -0
- package/lib/shared/computeGenerateSkeletons.js +262 -0
- package/lib/shared/computeGenerateSkeletons.js.map +1 -0
- package/lib/shared/computeGenerateSource.d.ts +8 -0
- package/lib/shared/computeGenerateSource.js +120 -0
- package/lib/shared/computeGenerateSource.js.map +1 -0
- package/lib/shared/computeLogStream.d.ts +4 -0
- package/lib/shared/computeLogStream.js +108 -0
- package/lib/shared/computeLogStream.js.map +1 -0
- package/lib/shared/computeQuery.d.ts +52 -0
- package/lib/shared/computeQuery.js +168 -0
- package/lib/shared/computeQuery.js.map +1 -0
- package/lib/shared/computeTelemetryDrain.d.ts +11 -0
- package/lib/shared/computeTelemetryDrain.js +78 -0
- package/lib/shared/computeTelemetryDrain.js.map +1 -0
- package/lib/shared/herokuProxyApi.d.ts +62 -0
- package/lib/shared/herokuProxyApi.js +243 -0
- package/lib/shared/herokuProxyApi.js.map +1 -0
- package/lib/shared/metadataApiVersion.d.ts +2 -0
- package/lib/shared/metadataApiVersion.js +25 -0
- package/lib/shared/metadataApiVersion.js.map +1 -0
- package/lib/shared/metadataDeploy.d.ts +5 -0
- package/lib/shared/metadataDeploy.js +90 -0
- package/lib/shared/metadataDeploy.js.map +1 -0
- package/lib/shared/metadataRetrieve.d.ts +2 -0
- package/lib/shared/metadataRetrieve.js +68 -0
- package/lib/shared/metadataRetrieve.js.map +1 -0
- package/lib/shared/plugin-name.d.ts +13 -0
- package/lib/shared/plugin-name.js +29 -0
- package/lib/shared/plugin-name.js.map +1 -0
- package/messages/compute.config.get.md +39 -0
- package/messages/compute.config.list.md +24 -0
- package/messages/compute.config.set.md +49 -0
- package/messages/compute.config.unset.md +39 -0
- package/messages/compute.deploy.md +84 -0
- package/messages/compute.display.md +46 -0
- package/messages/compute.errors.md +182 -0
- package/messages/compute.generate.md +74 -0
- package/messages/compute.get.build-log.md +36 -0
- package/messages/compute.get.runtime-log.md +46 -0
- package/messages/compute.list.md +23 -0
- package/messages/compute.scale.md +67 -0
- package/messages/compute.source.retrieve.md +59 -0
- package/messages/compute.tail.runtime-log.md +55 -0
- package/npm-shrinkwrap.json +16162 -0
- package/oclif.manifest.json +982 -0
- package/package.json +117 -0
- package/schemas/compute-config-get.json +25 -0
- package/schemas/compute-config-list.json +25 -0
- package/schemas/compute-config-set.json +28 -0
- package/schemas/compute-config-unset.json +28 -0
- package/schemas/compute-deploy.json +30 -0
- package/schemas/compute-display.json +138 -0
- package/schemas/compute-generate.json +40 -0
- package/schemas/compute-get-build__log.json +30 -0
- package/schemas/compute-get-runtime__log.json +24 -0
- package/schemas/compute-list.json +94 -0
- package/schemas/compute-scale.json +41 -0
- package/schemas/compute-source-retrieve.json +26 -0
- package/schemas/compute-tail-runtime__log.json +18 -0
|
@@ -0,0 +1,93 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Args } from '@oclif/core';
|
|
17
|
+
import { Messages } from '@salesforce/core';
|
|
18
|
+
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
19
|
+
import { requireAppName, resolveComputeAppNameFromDir, validateName } from '../../../shared/computeApp.js';
|
|
20
|
+
import { requireConfigVar } from '../../../shared/computeConfig.js';
|
|
21
|
+
import { resolveHerokuAppId } from '../../../shared/computeQuery.js';
|
|
22
|
+
import { fetchComputeConfigVarsViaProxy, fetchLatestReleaseVersionViaProxy, updateComputeConfigVarsViaProxy, } from '../../../shared/herokuProxyApi.js';
|
|
23
|
+
import { PLUGIN_NAME } from '../../../shared/plugin-name.js';
|
|
24
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
25
|
+
const messages = Messages.loadMessages(PLUGIN_NAME, 'compute.config.unset');
|
|
26
|
+
export default class ConfigUnset extends SfCommand {
|
|
27
|
+
static args = {
|
|
28
|
+
key: Args.string({
|
|
29
|
+
multiple: true,
|
|
30
|
+
summary: messages.getMessage('args.key.summary'),
|
|
31
|
+
}),
|
|
32
|
+
};
|
|
33
|
+
static description = messages.getMessage('description');
|
|
34
|
+
static examples = messages.getMessages('examples');
|
|
35
|
+
static flags = {
|
|
36
|
+
name: Flags.string({
|
|
37
|
+
char: 'n',
|
|
38
|
+
env: 'COMPUTE_APP_NAME',
|
|
39
|
+
summary: messages.getMessage('flags.name.summary'),
|
|
40
|
+
}),
|
|
41
|
+
'target-org': Flags.requiredOrg({ char: 'o' }),
|
|
42
|
+
};
|
|
43
|
+
// Org-mediated lookup by --name -- no local project files are read.
|
|
44
|
+
static requiresProject = false;
|
|
45
|
+
static summary = messages.getMessage('summary');
|
|
46
|
+
async run() {
|
|
47
|
+
const { args, flags } = await this.parse(ConfigUnset);
|
|
48
|
+
const name = requireAppName(flags.name ?? (await resolveComputeAppNameFromDir(process.cwd())));
|
|
49
|
+
validateName(name);
|
|
50
|
+
// A declarative `required: true`/minimum-count arg would enforce this earlier, during
|
|
51
|
+
// this.parse() -- deliberately not used so the error can carry
|
|
52
|
+
// error.configUnsetNoKeysSpecified's exact wording instead of oclif's generic missing-arg text.
|
|
53
|
+
const tokens = args.key ?? [];
|
|
54
|
+
if (tokens.length === 0) {
|
|
55
|
+
throw messages.createError('error.configUnsetNoKeysSpecified');
|
|
56
|
+
}
|
|
57
|
+
const keys = [...new Set(tokens)];
|
|
58
|
+
const connection = flags['target-org'].getConnection();
|
|
59
|
+
const appId = await resolveHerokuAppId(connection, name);
|
|
60
|
+
// Heroku's own PATCH is idempotent about unsetting a key that's already absent -- it
|
|
61
|
+
// wouldn't error -- but the CLI UX wants a hard error for that case, so it's checked
|
|
62
|
+
// client-side against a fresh fetch rather than relying on the PATCH to catch it.
|
|
63
|
+
const configVars = await fetchComputeConfigVarsViaProxy(connection, { name, appId });
|
|
64
|
+
for (const key of keys) {
|
|
65
|
+
requireConfigVar(configVars, name, key);
|
|
66
|
+
}
|
|
67
|
+
const updates = {};
|
|
68
|
+
for (const key of keys) {
|
|
69
|
+
updates[key] = null;
|
|
70
|
+
}
|
|
71
|
+
this.spinner.start(`Unsetting ${keys.join(', ')} and restarting ${name}`);
|
|
72
|
+
try {
|
|
73
|
+
await updateComputeConfigVarsViaProxy(connection, { name, appId, updates });
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
this.spinner.stop('failed');
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
// Heroku's own PATCH response carries no release number, so this is a second, independent
|
|
80
|
+
// call -- its failure is a best-effort miss (like display.ts's formation/release fetches),
|
|
81
|
+
// not fatal to the config-unset operation the spinner already reported as done.
|
|
82
|
+
let release;
|
|
83
|
+
try {
|
|
84
|
+
release = await fetchLatestReleaseVersionViaProxy(connection, { name, appId });
|
|
85
|
+
}
|
|
86
|
+
catch {
|
|
87
|
+
// Best-effort -- the config vars were already updated successfully above.
|
|
88
|
+
}
|
|
89
|
+
this.spinner.stop(release === undefined ? 'done' : `done, v${release}`);
|
|
90
|
+
return release === undefined ? { name, unset: keys } : { name, unset: keys, release };
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
//# sourceMappingURL=unset.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"unset.js","sourceRoot":"","sources":["../../../../src/commands/compute/config/unset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAC,IAAI,EAAC,MAAM,aAAa,CAAC;AACjC,OAAO,EAAC,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAE,SAAS,EAAC,MAAM,6BAA6B,CAAC;AAE7D,OAAO,EAAC,cAAc,EAAE,4BAA4B,EAAE,YAAY,EAAC,MAAM,+BAA+B,CAAC;AACzG,OAAO,EAAC,gBAAgB,EAAC,MAAM,kCAAkC,CAAC;AAClE,OAAO,EAAC,kBAAkB,EAAC,MAAM,iCAAiC,CAAC;AACnE,OAAO,EACL,8BAA8B,EAC9B,iCAAiC,EACjC,+BAA+B,GAChC,MAAM,mCAAmC,CAAC;AAC3C,OAAO,EAAC,WAAW,EAAC,MAAM,gCAAgC,CAAC;AAE3D,QAAQ,CAAC,kCAAkC,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;AAC7D,MAAM,QAAQ,GAAG,QAAQ,CAAC,YAAY,CAAC,WAAW,EAAE,sBAAsB,CAAC,CAAC;AAQ5E,MAAM,CAAC,OAAO,OAAO,WAAY,SAAQ,SAAmC;IACnE,MAAM,CAAU,IAAI,GAAG;QAC5B,GAAG,EAAE,IAAI,CAAC,MAAM,CAAC;YACf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,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,UAAU,OAAO,EAAE,CAAC,CAAC;QAExE,OAAO,OAAO,KAAK,SAAS,CAAC,CAAC,CAAC,EAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAC,CAAC,CAAC,CAAC,EAAC,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,OAAO,EAAC,CAAC;IACpF,CAAC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
export type ComputeDeployResult = {
|
|
3
|
+
buildId: string;
|
|
4
|
+
deployId: string;
|
|
5
|
+
name: string;
|
|
6
|
+
platformComputeId: string;
|
|
7
|
+
};
|
|
8
|
+
export default class Deploy extends SfCommand<ComputeDeployResult> {
|
|
9
|
+
static readonly description: string;
|
|
10
|
+
static readonly examples: string[];
|
|
11
|
+
static readonly flags: {
|
|
12
|
+
'source-dir': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
13
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
14
|
+
};
|
|
15
|
+
static readonly requiresProject = true;
|
|
16
|
+
static readonly summary: string;
|
|
17
|
+
run(): Promise<ComputeDeployResult>;
|
|
18
|
+
}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Messages } from '@salesforce/core';
|
|
17
|
+
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
18
|
+
import { basename, resolve } from 'node:path';
|
|
19
|
+
import { pathExists, resolveComputeAppNameFromDir, validateName } from '../../shared/computeApp.js';
|
|
20
|
+
import { packageComputeBundle } from '../../shared/computeBundle.js';
|
|
21
|
+
import { uploadComputeSource } from '../../shared/computeConnectApi.js';
|
|
22
|
+
import { deployComputeMetadata } from '../../shared/metadataDeploy.js';
|
|
23
|
+
import { PLUGIN_NAME } from '../../shared/plugin-name.js';
|
|
24
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
25
|
+
const messages = Messages.loadMessages(PLUGIN_NAME, 'compute.deploy');
|
|
26
|
+
export default class Deploy extends SfCommand {
|
|
27
|
+
static description = messages.getMessage('description');
|
|
28
|
+
static examples = messages.getMessages('examples');
|
|
29
|
+
static flags = {
|
|
30
|
+
'source-dir': Flags.directory({
|
|
31
|
+
char: 'd',
|
|
32
|
+
exists: true,
|
|
33
|
+
// A plain `process.cwd()` value would be captured once, at class-definition time --
|
|
34
|
+
// this must stay a function so each run() picks up the actual cwd at parse time.
|
|
35
|
+
default: async () => process.cwd(),
|
|
36
|
+
// Without this, oclif's help/readme generation evaluates `default` itself to display
|
|
37
|
+
// it, baking whatever machine-specific cwd happened to run `oclif readme` into the
|
|
38
|
+
// published README and --help output. defaultHelp overrides just the displayed text.
|
|
39
|
+
defaultHelp: async () => 'current directory',
|
|
40
|
+
summary: messages.getMessage('flags.source-dir.summary'),
|
|
41
|
+
}),
|
|
42
|
+
'target-org': Flags.requiredOrg({ char: 'o' }),
|
|
43
|
+
};
|
|
44
|
+
static requiresProject = true;
|
|
45
|
+
static summary = messages.getMessage('summary');
|
|
46
|
+
async run() {
|
|
47
|
+
const { flags } = await this.parse(Deploy);
|
|
48
|
+
// No --name flag -- run this from inside the compute app's own directory, or point
|
|
49
|
+
// --source-dir at it. The directory's name doubles as the app's DeveloperName and the
|
|
50
|
+
// <name>.compute-meta.xml filename.
|
|
51
|
+
const appDir = resolve(flags['source-dir']);
|
|
52
|
+
// Check this looks like an app directory before validating the name -- otherwise
|
|
53
|
+
// running from the wrong place (e.g. the project root) surfaces a confusing "name
|
|
54
|
+
// isn't valid" error instead of guidance to cd into the app's own directory.
|
|
55
|
+
const name = await resolveComputeAppNameFromDir(appDir);
|
|
56
|
+
if (!name) {
|
|
57
|
+
throw messages.createError('error.notAppDir', [basename(appDir)]);
|
|
58
|
+
}
|
|
59
|
+
validateName(name);
|
|
60
|
+
if (!(await pathExists(`${appDir}/Procfile`))) {
|
|
61
|
+
throw messages.createError('error.noProcfile', [appDir]);
|
|
62
|
+
}
|
|
63
|
+
if (!(await pathExists(`${appDir}/api-spec.yaml`))) {
|
|
64
|
+
throw messages.createError('error.noApiSpec', [appDir]);
|
|
65
|
+
}
|
|
66
|
+
this.debug('resolved app %s from %s', name, appDir);
|
|
67
|
+
const connection = flags['target-org'].getConnection();
|
|
68
|
+
this.log(messages.getMessage('info.preparing', [name]));
|
|
69
|
+
// requiresProject = true guarantees the framework has already resolved and assigned
|
|
70
|
+
// this.project before run() is called.
|
|
71
|
+
const projectRoot = this.project.getPath();
|
|
72
|
+
this.debug('packaging bundle from %s (project root %s)', appDir, projectRoot);
|
|
73
|
+
const { buffer, fileCount } = await packageComputeBundle(appDir, name, projectRoot);
|
|
74
|
+
this.debug('packaged %d files, %d bytes', fileCount, buffer.length);
|
|
75
|
+
this.log(messages.getMessage('info.packaging', [fileCount, `${Math.round(buffer.length / 1024)}kb`]));
|
|
76
|
+
// Source upload only inserts a pending PlatformComputeAppBuild row -- it does not
|
|
77
|
+
// start a build. The metadata deploy below is what actually triggers it.
|
|
78
|
+
this.debug('uploading %d-byte bundle for %s', buffer.length, name);
|
|
79
|
+
const upload = await uploadComputeSource(connection, { name, bundle: buffer });
|
|
80
|
+
this.debug('uploaded: platformComputeId=%s buildId=%s', upload.platformComputeId, upload.buildId);
|
|
81
|
+
this.log(messages.getMessage('info.uploading'));
|
|
82
|
+
this.log(messages.getMessage('info.deployingMetadata', [
|
|
83
|
+
connection.getUsername() ?? flags['target-org'].getUsername() ?? '<org>',
|
|
84
|
+
]));
|
|
85
|
+
this.debug('deploying metadata for %s to %s', name, connection.getUsername() ?? '<org>');
|
|
86
|
+
const { id: deployId } = await deployComputeMetadata(connection, appDir, name);
|
|
87
|
+
this.debug('metadata deploy %s complete for %s', deployId, name);
|
|
88
|
+
this.log(messages.getMessage('info.deployedMetaFile', [`${name}.compute-meta.xml`, deployId]));
|
|
89
|
+
this.logSuccess(messages.getMessage('info.buildEnqueued'));
|
|
90
|
+
return {
|
|
91
|
+
name, platformComputeId: upload.platformComputeId, buildId: upload.buildId, deployId,
|
|
92
|
+
};
|
|
93
|
+
}
|
|
94
|
+
}
|
|
95
|
+
//# sourceMappingURL=deploy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deploy.js","sourceRoot":"","sources":["../../../src/commands/compute/deploy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAC,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAE,SAAS,EAAC,MAAM,6BAA6B,CAAC;AAC7D,OAAO,EAAC,QAAQ,EAAE,OAAO,EAAC,MAAM,WAAW,CAAC;AAE5C,OAAO,EAAC,UAAU,EAAE,4BAA4B,EAAE,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAClG,OAAO,EAAC,oBAAoB,EAAC,MAAM,+BAA+B,CAAC;AACnE,OAAO,EAAC,mBAAmB,EAAC,MAAM,mCAAmC,CAAC;AACtE,OAAO,EAAC,qBAAqB,EAAC,MAAM,gCAAgC,CAAC;AACrE,OAAO,EAAC,WAAW,EAAC,MA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U,CAAC,QAAQ,CAAC,UAAU,CAAC,oBAAoB,CAAC,CAAC,CAAC;QAE3D,OAAO;YACL,IAAI,EAAE,iBAAiB,EAAE,MAAM,CAAC,iBAAiB,EAAE,OAAO,EAAE,MAAM,CAAC,OAAO,EAAE,QAAQ;SACrF,CAAC;IACJ,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { type ComputeAppSummary } from '../../shared/computeQuery.js';
|
|
3
|
+
import { type HerokuAppSummary, type HerokuFormationSummary } from '../../shared/herokuProxyApi.js';
|
|
4
|
+
export type ComputeDisplayResult = ComputeAppSummary & {
|
|
5
|
+
formation?: HerokuFormationSummary;
|
|
6
|
+
herokuApp?: HerokuAppSummary;
|
|
7
|
+
orgId: string;
|
|
8
|
+
release?: number;
|
|
9
|
+
};
|
|
10
|
+
export default class Display extends SfCommand<ComputeDisplayResult> {
|
|
11
|
+
static readonly description: string;
|
|
12
|
+
static readonly examples: string[];
|
|
13
|
+
static readonly flags: {
|
|
14
|
+
name: import("@oclif/core/interfaces").OptionFlag<string | undefined, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'target-org': import("@oclif/core/interfaces").OptionFlag<import("@salesforce/core").Org, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
verbose: import("@oclif/core/interfaces").BooleanFlag<boolean>;
|
|
17
|
+
};
|
|
18
|
+
static readonly requiresProject = false;
|
|
19
|
+
static readonly summary: string;
|
|
20
|
+
run(): Promise<ComputeDisplayResult>;
|
|
21
|
+
private renderComputeAppTable;
|
|
22
|
+
private renderCurrentBuildTable;
|
|
23
|
+
private renderExternalServiceTable;
|
|
24
|
+
private renderHerokuAppTable;
|
|
25
|
+
private renderLatestDeploymentTable;
|
|
26
|
+
}
|
|
@@ -0,0 +1,188 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Copyright 2026, Salesforce, Inc.
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
import { Messages } from '@salesforce/core';
|
|
17
|
+
import { Flags, SfCommand } from '@salesforce/sf-plugins-core';
|
|
18
|
+
import { requireAppName, resolveComputeAppNameFromDir, validateName } from '../../shared/computeApp.js';
|
|
19
|
+
import { pickHerokuAppId, queryComputeApp, toComputeAppSummary, } from '../../shared/computeQuery.js';
|
|
20
|
+
import { fetchComputeAppViaProxy, fetchComputeFormationViaProxy, fetchLatestReleaseVersionViaProxy, } from '../../shared/herokuProxyApi.js';
|
|
21
|
+
import { PLUGIN_NAME } from '../../shared/plugin-name.js';
|
|
22
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
23
|
+
const messages = Messages.loadMessages(PLUGIN_NAME, 'compute.display');
|
|
24
|
+
// Heroku's own TYPE=COUNT[:SIZE] scale-target shape (see `sf compute scale`), reused here to
|
|
25
|
+
// render the Formation row -- e.g. "web=1:eco", or "web=2, worker=1:standard-1x" for multiple.
|
|
26
|
+
function formatFormation(formation) {
|
|
27
|
+
if (!formation || formation.length === 0) {
|
|
28
|
+
return '-';
|
|
29
|
+
}
|
|
30
|
+
return formation.map(f => `${f.type}=${f.quantity}${f.dynoSize ? `:${f.dynoSize}` : ''}`).join(', ');
|
|
31
|
+
}
|
|
32
|
+
function formatBuildDuration(startedAt, completedAt) {
|
|
33
|
+
if (!startedAt || !completedAt) {
|
|
34
|
+
return '-';
|
|
35
|
+
}
|
|
36
|
+
const totalSeconds = Math.round((new Date(completedAt).getTime() - new Date(startedAt).getTime()) / 1000);
|
|
37
|
+
if (!Number.isFinite(totalSeconds) || totalSeconds < 0) {
|
|
38
|
+
return '-';
|
|
39
|
+
}
|
|
40
|
+
const minutes = Math.floor(totalSeconds / 60);
|
|
41
|
+
const seconds = totalSeconds % 60;
|
|
42
|
+
return minutes > 0 ? `${minutes}m ${seconds}s` : `${seconds}s`;
|
|
43
|
+
}
|
|
44
|
+
export default class Display extends SfCommand {
|
|
45
|
+
static description = messages.getMessage('description');
|
|
46
|
+
static examples = messages.getMessages('examples');
|
|
47
|
+
static flags = {
|
|
48
|
+
name: Flags.string({
|
|
49
|
+
char: 'n',
|
|
50
|
+
env: 'COMPUTE_APP_NAME',
|
|
51
|
+
summary: messages.getMessage('flags.name.summary'),
|
|
52
|
+
}),
|
|
53
|
+
'target-org': Flags.requiredOrg({ char: 'o' }),
|
|
54
|
+
verbose: Flags.boolean({
|
|
55
|
+
char: 'v',
|
|
56
|
+
summary: messages.getMessage('flags.verbose.summary'),
|
|
57
|
+
}),
|
|
58
|
+
};
|
|
59
|
+
// Pure org-side lookup by --name (DeveloperName) -- no local project files are read.
|
|
60
|
+
static requiresProject = false;
|
|
61
|
+
static summary = messages.getMessage('summary');
|
|
62
|
+
async run() {
|
|
63
|
+
const { flags } = await this.parse(Display);
|
|
64
|
+
const name = requireAppName(flags.name ?? (await resolveComputeAppNameFromDir(process.cwd())));
|
|
65
|
+
validateName(name);
|
|
66
|
+
const connection = flags['target-org'].getConnection();
|
|
67
|
+
const record = await queryComputeApp(connection, name);
|
|
68
|
+
const result = toComputeAppSummary(record);
|
|
69
|
+
const orgId = flags['target-org'].getOrgId();
|
|
70
|
+
const appId = pickHerokuAppId(record);
|
|
71
|
+
// No Heroku app id yet (the deploy hasn't created the Heroku app) -- skip every proxy call
|
|
72
|
+
// entirely and let the Heroku App table render its placeholder dashes below. Not a
|
|
73
|
+
// warning-worthy condition: it's the expected state for a brand-new app.
|
|
74
|
+
let herokuApp;
|
|
75
|
+
let formation;
|
|
76
|
+
let release;
|
|
77
|
+
if (appId) {
|
|
78
|
+
// Fetched concurrently, they are independent of each other.
|
|
79
|
+
const [appResult, formationResult, releaseResult] = await Promise.allSettled([
|
|
80
|
+
fetchComputeAppViaProxy(connection, { name, appId }),
|
|
81
|
+
fetchComputeFormationViaProxy(connection, { name, appId }),
|
|
82
|
+
fetchLatestReleaseVersionViaProxy(connection, { name, appId }),
|
|
83
|
+
]);
|
|
84
|
+
if (appResult.status === 'fulfilled') {
|
|
85
|
+
herokuApp = appResult.value;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
this.warn(messages.getMessage('warning.herokuAppUnavailable', [appResult.reason.message]));
|
|
89
|
+
}
|
|
90
|
+
if (formationResult.status === 'fulfilled') {
|
|
91
|
+
formation = formationResult.value;
|
|
92
|
+
}
|
|
93
|
+
else {
|
|
94
|
+
this.warn(messages.getMessage('warning.herokuFormationUnavailable', [formationResult.reason.message]));
|
|
95
|
+
}
|
|
96
|
+
if (releaseResult.status === 'fulfilled') {
|
|
97
|
+
release = releaseResult.value;
|
|
98
|
+
}
|
|
99
|
+
else {
|
|
100
|
+
this.warn(messages.getMessage('warning.herokuReleaseUnavailable', [releaseResult.reason.message]));
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
this.renderComputeAppTable(result, name, orgId);
|
|
104
|
+
this.renderHerokuAppTable(herokuApp, formation, release);
|
|
105
|
+
if (flags.verbose) {
|
|
106
|
+
this.renderExternalServiceTable(result);
|
|
107
|
+
this.renderCurrentBuildTable(result);
|
|
108
|
+
this.renderLatestDeploymentTable(result);
|
|
109
|
+
}
|
|
110
|
+
return {
|
|
111
|
+
...result, name, orgId, herokuApp, formation, release,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
// Renders the --name value the caller passed in (e.g. myns__CreditRatingScorer), not
|
|
115
|
+
// result.name (record.DeveloperName, which has the namespace stripped) -- every sibling
|
|
116
|
+
// migrated command (scale, logs, config*, build/output) echoes the raw --name the same way.
|
|
117
|
+
renderComputeAppTable(result, name, orgId) {
|
|
118
|
+
this.styledHeader('Compute App');
|
|
119
|
+
this.table({
|
|
120
|
+
data: [
|
|
121
|
+
{ key: 'Compute App ID', value: result.id },
|
|
122
|
+
{ key: 'Compute App Name', value: name },
|
|
123
|
+
{ key: 'Master Label', value: result.masterLabel },
|
|
124
|
+
{ key: 'Status', value: result.status },
|
|
125
|
+
{ key: 'Org ID', value: orgId },
|
|
126
|
+
{ key: 'Description', value: result.description ?? '-' },
|
|
127
|
+
{ key: 'Status Reason', value: result.statusReason ?? '-' },
|
|
128
|
+
],
|
|
129
|
+
columns: ['key', 'value'],
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
// Build Duration is computed client-side from the two timestamps we do have, rather than
|
|
133
|
+
// sourced from anywhere new.
|
|
134
|
+
renderCurrentBuildTable(result) {
|
|
135
|
+
this.styledHeader('Current Build');
|
|
136
|
+
this.table({
|
|
137
|
+
data: [
|
|
138
|
+
{ key: 'Build ID', value: result.currentBuild?.id ?? '-' },
|
|
139
|
+
{ key: 'Build Status', value: result.currentBuild?.buildStatus ?? '-' },
|
|
140
|
+
{ key: 'Build Started', value: result.currentBuild?.buildStartedAt ?? '-' },
|
|
141
|
+
{ key: 'Build Completed', value: result.currentBuild?.buildCompletedAt ?? '-' },
|
|
142
|
+
{
|
|
143
|
+
key: 'Build Duration',
|
|
144
|
+
value: formatBuildDuration(result.currentBuild?.buildStartedAt, result.currentBuild?.buildCompletedAt),
|
|
145
|
+
},
|
|
146
|
+
],
|
|
147
|
+
columns: ['key', 'value'],
|
|
148
|
+
});
|
|
149
|
+
}
|
|
150
|
+
// API Spec Published has no source yet -- placeholder dash. AppLink Add-on was removed --
|
|
151
|
+
// it's redundant with External Service ID (both are set together by deploy's first-time
|
|
152
|
+
// provisioning flow; there's no state where one exists without the other).
|
|
153
|
+
renderExternalServiceTable(result) {
|
|
154
|
+
this.styledHeader('External Service');
|
|
155
|
+
this.table({
|
|
156
|
+
data: [
|
|
157
|
+
{ key: 'External Service ID', value: result.externalServiceId ?? '-' },
|
|
158
|
+
{ key: 'API Spec Published', value: '-' },
|
|
159
|
+
],
|
|
160
|
+
columns: ['key', 'value'],
|
|
161
|
+
});
|
|
162
|
+
}
|
|
163
|
+
// Every row is fetched from Heroku via the Salesforce proxy above.
|
|
164
|
+
renderHerokuAppTable(herokuApp, formation, release) {
|
|
165
|
+
this.styledHeader('Heroku App');
|
|
166
|
+
this.table({
|
|
167
|
+
data: [
|
|
168
|
+
{ key: 'App Name', value: herokuApp?.name ?? '-' },
|
|
169
|
+
{ key: 'Region', value: herokuApp?.region ?? '-' },
|
|
170
|
+
{ key: 'Generation', value: herokuApp?.generation ?? '-' },
|
|
171
|
+
{ key: 'Release', value: release === undefined ? '-' : String(release) },
|
|
172
|
+
{ key: 'Formation', value: formatFormation(formation) },
|
|
173
|
+
],
|
|
174
|
+
columns: ['key', 'value'],
|
|
175
|
+
});
|
|
176
|
+
}
|
|
177
|
+
renderLatestDeploymentTable(result) {
|
|
178
|
+
this.styledHeader('Latest Deployment');
|
|
179
|
+
this.table({
|
|
180
|
+
data: [
|
|
181
|
+
{ key: 'Deployed At', value: result.currentBuild?.deployedAt ?? '-' },
|
|
182
|
+
{ key: 'Deployed By', value: result.currentBuild?.deployedBy ?? '-' },
|
|
183
|
+
],
|
|
184
|
+
columns: ['key', 'value'],
|
|
185
|
+
});
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
//# sourceMappingURL=display.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"display.js","sourceRoot":"","sources":["../../../src/commands/compute/display.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAC,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAC1C,OAAO,EAAC,KAAK,EAAE,SAAS,EAAC,MAAM,6BAA6B,CAAC;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SAC1B,CAAC,CAAC;IACL,CAAC;IAEO,2BAA2B,CAAC,MAAyB;QAC3D,IAAI,CAAC,YAAY,CAAC,mBAAmB,CAAC,CAAC;QACvC,IAAI,CAAC,KAAK,CAAC;YACT,IAAI,EAAE;gBACJ,EAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,UAAU,IAAI,GAAG,EAAC;gBACnE,EAAC,GAAG,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,CAAC,YAAY,EAAE,UAAU,IAAI,GAAG,EAAC;aACpE;YACD,OAAO,EAAE,CAAC,KAAK,EAAE,OAAO,CAAC;SAC1B,CAAC,CAAC;IACL,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { SfCommand } from '@salesforce/sf-plugins-core';
|
|
2
|
+
import { type FetchTemplateSource, type Language } from '../../shared/computeGenerateSource.js';
|
|
3
|
+
export type ComputeGenerateResult = {
|
|
4
|
+
files: string[];
|
|
5
|
+
language: Language;
|
|
6
|
+
name: string;
|
|
7
|
+
path: string;
|
|
8
|
+
};
|
|
9
|
+
export default class Generate extends SfCommand<ComputeGenerateResult> {
|
|
10
|
+
static readonly description: string;
|
|
11
|
+
static readonly examples: string[];
|
|
12
|
+
static fetchTemplateSource: FetchTemplateSource;
|
|
13
|
+
static readonly flags: {
|
|
14
|
+
name: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
15
|
+
'output-dir': import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
16
|
+
language: import("@oclif/core/interfaces").OptionFlag<string, import("@oclif/core/interfaces").CustomOptions>;
|
|
17
|
+
};
|
|
18
|
+
static readonly requiresProject = true;
|
|
19
|
+
static readonly summary: string;
|
|
20
|
+
run(): Promise<ComputeGenerateResult>;
|
|
21
|
+
}
|