@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,90 @@
|
|
|
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 { getLogger } from '@oclif/core';
|
|
17
|
+
import { Messages } from '@salesforce/core';
|
|
18
|
+
import { ensureArray } from '@salesforce/kit';
|
|
19
|
+
import { MetadataApiDeploy } from '@salesforce/source-deploy-retrieve';
|
|
20
|
+
import JSZip from 'jszip';
|
|
21
|
+
import { mkdtemp, readFile, rm, writeFile, } from 'node:fs/promises';
|
|
22
|
+
import { tmpdir } from 'node:os';
|
|
23
|
+
import { join } from 'node:path';
|
|
24
|
+
import { resolveComputeApiVersion } from './metadataApiVersion.js';
|
|
25
|
+
import { PLUGIN_NAME } from './plugin-name.js';
|
|
26
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
27
|
+
const messages = Messages.loadMessages(PLUGIN_NAME, 'compute.errors');
|
|
28
|
+
// Gated by DEBUG=sf:compute:metadataDeploy (or DEBUG=*).
|
|
29
|
+
const { debug } = getLogger('sf:compute:metadataDeploy');
|
|
30
|
+
// Deploying <name>.compute-meta.xml is what actually triggers the build server-side (sets
|
|
31
|
+
// CurrentBuild + Status=DEPLOYING and kicks off the async worker) -- source upload alone does
|
|
32
|
+
// not. See deployment/specs/PLATFORMCOMPUTEAPP_ENTITY_SCHEMA.md "POST /source Inserts a
|
|
33
|
+
// PlatformComputeAppBuild Row -- Does NOT Trigger Deploy". Call this AFTER uploadComputeSource.
|
|
34
|
+
//
|
|
35
|
+
// Built on SDR's MetadataApiDeploy -- the same class `sf project deploy start`/`report` use --
|
|
36
|
+
// so the returned job id is checkable with `sf project deploy report --job-id <id>` like any
|
|
37
|
+
// other metadata deploy, not just through this plugin's own commands.
|
|
38
|
+
export async function deployComputeMetadata(connection, appDir, name) {
|
|
39
|
+
const metaXml = await readFile(join(appDir, `${name}.compute-meta.xml`), 'utf8');
|
|
40
|
+
const zip = new JSZip();
|
|
41
|
+
zip.file('package.xml', [
|
|
42
|
+
'<?xml version="1.0" encoding="UTF-8"?>',
|
|
43
|
+
'<Package xmlns="http://soap.sforce.com/2006/04/metadata">',
|
|
44
|
+
' <types>',
|
|
45
|
+
` <members>${name}</members>`,
|
|
46
|
+
' <name>PlatformComputeApp</name>',
|
|
47
|
+
' </types>',
|
|
48
|
+
` <version>${resolveComputeApiVersion(connection)}</version>`,
|
|
49
|
+
'</Package>',
|
|
50
|
+
'',
|
|
51
|
+
].join('\n'));
|
|
52
|
+
// PlatformComputeApp is a standard (non-bundle) metadata type -- flat
|
|
53
|
+
// directoryName/<name>.<suffix>, not a per-component subdirectory like LWC/Aura bundles use.
|
|
54
|
+
// Wire directoryName is "platformComputeApps" per org describeMetadata (expected to become
|
|
55
|
+
// "compute" later); suffix is "compute" with metaFile: false, so there's no separate -meta.xml
|
|
56
|
+
// file on the wire -- that's purely our own on-disk source-format convention.
|
|
57
|
+
zip.file(`platformComputeApps/${name}.compute`, metaXml);
|
|
58
|
+
const zipBuffer = await zip.generateAsync({ type: 'nodebuffer' });
|
|
59
|
+
// MetadataApiDeploy's getZipBuffer() only accepts a ComponentSet, an mdapiPath directory, or a
|
|
60
|
+
// zipPath file -- there's no "hand it a Buffer directly" option, so the in-memory zip built
|
|
61
|
+
// above has to make a round trip through a temp file.
|
|
62
|
+
const tempDir = await mkdtemp(join(tmpdir(), 'sf-compute-deploy-'));
|
|
63
|
+
const zipPath = join(tempDir, `${name}.zip`);
|
|
64
|
+
try {
|
|
65
|
+
await writeFile(zipPath, zipBuffer);
|
|
66
|
+
const deploy = new MetadataApiDeploy({
|
|
67
|
+
usernameOrConnection: connection,
|
|
68
|
+
zipPath,
|
|
69
|
+
apiOptions: { singlePackage: true },
|
|
70
|
+
});
|
|
71
|
+
const { id } = await deploy.start();
|
|
72
|
+
debug('started metadata deploy %s for %s', id, name);
|
|
73
|
+
// MetadataApiDeploy.pollStatus() sizes its own polling frequency from the zip it just
|
|
74
|
+
// built (1s-10s depending on payload size) and defaults its timeout to 60 minutes -- both
|
|
75
|
+
// more generous than the fixed 2s/10min this file used before adopting SDR.
|
|
76
|
+
const result = await deploy.pollStatus();
|
|
77
|
+
if (!result.response.success) {
|
|
78
|
+
const failureDetail = ensureArray(result.response.details.componentFailures)
|
|
79
|
+
.map(f => f.problem)
|
|
80
|
+
.filter(Boolean)
|
|
81
|
+
.join('; ');
|
|
82
|
+
throw messages.createError('error.metadataDeployFailed', [name, failureDetail || 'Unknown error.']);
|
|
83
|
+
}
|
|
84
|
+
return { id };
|
|
85
|
+
}
|
|
86
|
+
finally {
|
|
87
|
+
await rm(tempDir, { recursive: true, force: true });
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
//# sourceMappingURL=metadataDeploy.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"metadataDeploy.js","sourceRoot":"","sources":["../../src/shared/metadataDeploy.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAC,SAAS,EAAC,MAAM,aAAa,CAAC;AACtC,OAAO,EAAkB,QAAQ,EAAC,MAAM,kBAAkB,CAAC;AAC3D,OAAO,EAAC,WAAW,EAAC,MAAM,iBAAiB,CAAC;AAC5C,OAAO,EAAC,iBAAiB,EAAC,MAAM,oCAAoC,CAAC;AACrE,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EACL,OAAO,EACP,QAAQ,EACR,EAAE,EACF,SAAS,GACV,MAAM,kBAAkB,CAAC;AAC1B,OAAO,EAAC,MAAM,EAAC,MAAM,SAAS,CAAC;AAC/B,OAAO,EAAC,IAAI,EAAC,MAAM,WAAW,CAAC;AAE/B,OAAO,EAAC,wBAAwB,EAAC,MAAM,yBAAyB,CAAC;AACjE,OAAO,EAAC,WAAW,EAAC,MAAM,kB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c.
|
|
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 { getLogger } from '@oclif/core';
|
|
17
|
+
import { Messages } from '@salesforce/core';
|
|
18
|
+
import JSZip from 'jszip';
|
|
19
|
+
import { writeFile } from 'node:fs/promises';
|
|
20
|
+
import { join } from 'node:path';
|
|
21
|
+
import { resolveComputeApiVersion } from './metadataApiVersion.js';
|
|
22
|
+
import { PLUGIN_NAME } from './plugin-name.js';
|
|
23
|
+
Messages.importMessagesDirectoryFromMetaUrl(import.meta.url);
|
|
24
|
+
const messages = Messages.loadMessages(PLUGIN_NAME, 'compute.errors');
|
|
25
|
+
// Gated by DEBUG=sf:compute:metadataRetrieve (or DEBUG=*).
|
|
26
|
+
const { debug } = getLogger('sf:compute:metadataRetrieve');
|
|
27
|
+
// Inverse of deployComputeMetadata in metadataDeploy.ts, but NOT built on SDR's
|
|
28
|
+
// ComponentSet/MetadataApiRetrieve the way that function is built on MetadataApiDeploy --
|
|
29
|
+
// PlatformComputeApp has no entry in SDR's metadata registry, and ComponentSet.getObject()
|
|
30
|
+
// (called internally when building a retrieve request) requires resolving every member's type
|
|
31
|
+
// against that registry, so it throws for this type today. This uses jsforce's lower-level
|
|
32
|
+
// retrieve API directly instead. Note the asymmetry with deployComputeMetadata's
|
|
33
|
+
// deployResult.complete(true): RetrieveResultLocator#complete() takes no argument (unlike
|
|
34
|
+
// DeployResultLocator#complete(includeDetails?)), per @jsforce/jsforce-node's metadata.d.ts.
|
|
35
|
+
export async function retrieveComputeMetadata(connection, appDir, name) {
|
|
36
|
+
const version = resolveComputeApiVersion(connection);
|
|
37
|
+
const retrieveResult = connection.metadata.retrieve({
|
|
38
|
+
apiVersion: Number(version),
|
|
39
|
+
singlePackage: true,
|
|
40
|
+
unpackaged: {
|
|
41
|
+
types: [{ members: [name], name: 'PlatformComputeApp' }],
|
|
42
|
+
version,
|
|
43
|
+
// Package requires objectPermissions -- retrieve doesn't use it, but the type isn't
|
|
44
|
+
// Partial<Package> the way the outer RetrieveRequest is Partial<RetrieveRequest>.
|
|
45
|
+
objectPermissions: [],
|
|
46
|
+
},
|
|
47
|
+
});
|
|
48
|
+
debug('started metadata retrieve for %s from %s', name, connection.getUsername() ?? '<org>');
|
|
49
|
+
const result = await retrieveResult.complete();
|
|
50
|
+
debug('metadata retrieve complete for %s: success=%s', name, result.success);
|
|
51
|
+
if (!result.success) {
|
|
52
|
+
throw messages.createError('error.metadataRetrieveFailed', [name, result.errorMessage ?? 'Unknown error.']);
|
|
53
|
+
}
|
|
54
|
+
const zip = await JSZip.loadAsync(result.zipFile, { base64: true });
|
|
55
|
+
// Wire directoryName/suffix -- see the matching comment in metadataDeploy.ts. Our own on-disk
|
|
56
|
+
// source-format filename (<name>.compute-meta.xml) is independent of the wire filename.
|
|
57
|
+
const wireFileName = `${name}.compute`;
|
|
58
|
+
const metaFileName = `${name}.compute-meta.xml`;
|
|
59
|
+
const metaEntry = zip.file(`platformComputeApps/${wireFileName}`);
|
|
60
|
+
if (!metaEntry) {
|
|
61
|
+
throw messages.createError('error.metadataRetrieveFailed', [
|
|
62
|
+
name,
|
|
63
|
+
`the retrieved metadata is missing platformComputeApps/${wireFileName}`,
|
|
64
|
+
]);
|
|
65
|
+
}
|
|
66
|
+
await writeFile(join(appDir, metaFileName), await metaEntry.async('nodebuffer'));
|
|
67
|
+
}
|
|
68
|
+
//# sourceMappingURL=metadataRetrieve.js.map
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NAME, ...)` call across the plugin.
|
|
4
|
+
*
|
|
5
|
+
* This MUST stay in sync with the `name` field in `package.json` (and the
|
|
6
|
+
* `plugin` field in `command-snapshot.json`) — `@salesforce/core` resolves the
|
|
7
|
+
* message directory by this name, so a mismatch throws at runtime.
|
|
8
|
+
*
|
|
9
|
+
* It is `@heroku/plugin-compute` while the plugin is private/pre-GA. When it
|
|
10
|
+
* goes public the name switches to `@salesforce/plugin-compute`; centralizing
|
|
11
|
+
* it here makes that a one-line change. See AGENTS.md ("Package name").
|
|
12
|
+
*/
|
|
13
|
+
export declare const PLUGIN_NAME = "@heroku/plugin-compute";
|
|
@@ -0,0 +1,29 @@
|
|
|
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
|
+
/**
|
|
17
|
+
* The npm package name, used as the message-bundle key in every
|
|
18
|
+
* `Messages.loadMessages(PLUGIN_NAME, ...)` call across the plugin.
|
|
19
|
+
*
|
|
20
|
+
* This MUST stay in sync with the `name` field in `package.json` (and the
|
|
21
|
+
* `plugin` field in `command-snapshot.json`) — `@salesforce/core` resolves the
|
|
22
|
+
* message directory by this name, so a mismatch throws at runtime.
|
|
23
|
+
*
|
|
24
|
+
* It is `@heroku/plugin-compute` while the plugin is private/pre-GA. When it
|
|
25
|
+
* goes public the name switches to `@salesforce/plugin-compute`; centralizing
|
|
26
|
+
* it here makes that a one-line change. See AGENTS.md ("Package name").
|
|
27
|
+
*/
|
|
28
|
+
export const PLUGIN_NAME = '@heroku/plugin-compute';
|
|
29
|
+
//# sourceMappingURL=plugin-name.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin-name.js","sourceRoot":"","sources":["../../src/shared/plugin-name.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH;;;;;;;;;;;GAWG;AACH,MAAM,CAAC,MAAM,WAAW,GAAG,wBAAwB,CAAC"}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Print one or more of a compute app's config var values.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Goes through the target org's Salesforce Connect API, which calls Heroku on
|
|
8
|
+
your behalf. Pass a single key to print its bare value, or more than one to
|
|
9
|
+
print each as key: value. Fails if any requested key isn't currently set.
|
|
10
|
+
|
|
11
|
+
# args.key.summary
|
|
12
|
+
|
|
13
|
+
Config var name to print. Pass more than one to print multiple values in
|
|
14
|
+
one command.
|
|
15
|
+
|
|
16
|
+
# flags.name.summary
|
|
17
|
+
|
|
18
|
+
DeveloperName of the compute app to read config from (or
|
|
19
|
+
<namespace>\_\_<developerName> if it was deployed under a namespace).
|
|
20
|
+
Defaults to the COMPUTE_APP_NAME environment variable, or the current
|
|
21
|
+
directory's app name if that isn't set either.
|
|
22
|
+
|
|
23
|
+
# examples
|
|
24
|
+
|
|
25
|
+
- Print a single config var's value:
|
|
26
|
+
|
|
27
|
+
<%= config.bin %> <%= command.id %> STRIPE_KEY --name CreditRatingScorer --target-org my-org
|
|
28
|
+
|
|
29
|
+
- Print more than one config var:
|
|
30
|
+
|
|
31
|
+
<%= config.bin %> <%= command.id %> STRIPE_KEY LOG_LEVEL --name CreditRatingScorer --target-org my-org
|
|
32
|
+
|
|
33
|
+
# error.configGetNoKeysSpecified
|
|
34
|
+
|
|
35
|
+
Specify at least one config var to get, for example STRIPE_KEY.
|
|
36
|
+
|
|
37
|
+
# error.configGetNoKeysSpecified.actions
|
|
38
|
+
|
|
39
|
+
- Run the command again with at least one config var name.
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
List a compute app's config vars.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Shows every config var (environment variable) currently set for a deployed
|
|
8
|
+
compute app, sorted alphabetically. Goes through the target org's Salesforce
|
|
9
|
+
Connect API, which calls Heroku on your behalf. Use sf compute config get to
|
|
10
|
+
read a single var's value, sf compute config set to add or change vars, or
|
|
11
|
+
sf compute config unset to remove them.
|
|
12
|
+
|
|
13
|
+
# flags.name.summary
|
|
14
|
+
|
|
15
|
+
DeveloperName of the compute app to list config vars for (or
|
|
16
|
+
<namespace>\_\_<developerName> if it was deployed under a namespace).
|
|
17
|
+
Defaults to the COMPUTE_APP_NAME environment variable, or the current
|
|
18
|
+
directory's app name if that isn't set either.
|
|
19
|
+
|
|
20
|
+
# examples
|
|
21
|
+
|
|
22
|
+
- List all config vars for a compute app:
|
|
23
|
+
|
|
24
|
+
<%= config.bin %> <%= command.id %> --name CreditRatingScorer --target-org my-org
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Set one or more of a compute app's config vars.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Goes through the target org's Salesforce Connect API, which calls Heroku on
|
|
8
|
+
your behalf. Setting a config var restarts the app's dynos so the new value
|
|
9
|
+
takes effect. Pass one or more KEY=VALUE pairs; a key that doesn't already
|
|
10
|
+
exist is created.
|
|
11
|
+
|
|
12
|
+
# args.pair.summary
|
|
13
|
+
|
|
14
|
+
Config var assignment in the form KEY=VALUE. Pass more than one to set
|
|
15
|
+
multiple config vars in one command. Only the first = in each pair is
|
|
16
|
+
treated as the separator, so a value can itself contain one.
|
|
17
|
+
|
|
18
|
+
# flags.name.summary
|
|
19
|
+
|
|
20
|
+
DeveloperName of the compute app to change config for (or
|
|
21
|
+
<namespace>\_\_<developerName> if it was deployed under a namespace).
|
|
22
|
+
Defaults to the COMPUTE_APP_NAME environment variable, or the current
|
|
23
|
+
directory's app name if that isn't set either.
|
|
24
|
+
|
|
25
|
+
# examples
|
|
26
|
+
|
|
27
|
+
- Set a single config var:
|
|
28
|
+
|
|
29
|
+
<%= config.bin %> <%= command.id %> STRIPE_KEY=sk_live_xyz789 --name CreditRatingScorer --target-org my-org
|
|
30
|
+
|
|
31
|
+
- Set more than one config var in one command:
|
|
32
|
+
|
|
33
|
+
<%= config.bin %> <%= command.id %> STRIPE_KEY=sk_live_xyz789 LOG_LEVEL=debug --name CreditRatingScorer --target-org my-org
|
|
34
|
+
|
|
35
|
+
# error.configSetNoPairsSpecified
|
|
36
|
+
|
|
37
|
+
Specify at least one config var, for example `STRIPE_KEY=sk_live_...`.
|
|
38
|
+
|
|
39
|
+
# error.configSetNoPairsSpecified.actions
|
|
40
|
+
|
|
41
|
+
- Run the command again with at least one KEY=VALUE pair.
|
|
42
|
+
|
|
43
|
+
# error.configSetInvalidPair
|
|
44
|
+
|
|
45
|
+
"%s" is not a valid KEY=VALUE pair. Use %s=value.
|
|
46
|
+
|
|
47
|
+
# error.configSetInvalidPair.actions
|
|
48
|
+
|
|
49
|
+
- Add an = and a value, for example KEY=value.
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Unset one or more of a compute app's config vars.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Goes through the target org's Salesforce Connect API, which calls Heroku on
|
|
8
|
+
your behalf. Unsetting a config var restarts the app's dynos so the removal
|
|
9
|
+
takes effect. Fails if any requested key isn't currently set.
|
|
10
|
+
|
|
11
|
+
# args.key.summary
|
|
12
|
+
|
|
13
|
+
Config var name to unset. Pass more than one to unset multiple config vars
|
|
14
|
+
in one command.
|
|
15
|
+
|
|
16
|
+
# flags.name.summary
|
|
17
|
+
|
|
18
|
+
DeveloperName of the compute app to change config for (or
|
|
19
|
+
<namespace>\_\_<developerName> if it was deployed under a namespace).
|
|
20
|
+
Defaults to the COMPUTE_APP_NAME environment variable, or the current
|
|
21
|
+
directory's app name if that isn't set either.
|
|
22
|
+
|
|
23
|
+
# examples
|
|
24
|
+
|
|
25
|
+
- Unset a single config var:
|
|
26
|
+
|
|
27
|
+
<%= config.bin %> <%= command.id %> LOG_LEVEL --name CreditRatingScorer --target-org my-org
|
|
28
|
+
|
|
29
|
+
- Unset more than one config var in one command:
|
|
30
|
+
|
|
31
|
+
<%= config.bin %> <%= command.id %> LOG_LEVEL DEBUG_MODE --name CreditRatingScorer --target-org my-org
|
|
32
|
+
|
|
33
|
+
# error.configUnsetNoKeysSpecified
|
|
34
|
+
|
|
35
|
+
Specify at least one config var to unset, for example STRIPE_KEY.
|
|
36
|
+
|
|
37
|
+
# error.configUnsetNoKeysSpecified.actions
|
|
38
|
+
|
|
39
|
+
- Run the command again with at least one config var name.
|
|
@@ -0,0 +1,84 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Deploy a compute app's source and metadata to an org.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Packages the compute app's source (everything under its directory except the
|
|
8
|
+
compute metadata file and .forceignore) together with its api-spec.yaml into
|
|
9
|
+
a deployment bundle, uploads it to the org through the Connect API, then
|
|
10
|
+
deploys the app's <name>.compute-meta.xml through the
|
|
11
|
+
Metadata API to trigger the build. The metadata deploy itself returns a job
|
|
12
|
+
ID that can be checked independently with "sf project deploy report
|
|
13
|
+
--job-id <id>". Deploy is asynchronous: this command returns once the build
|
|
14
|
+
has been enqueued, it doesn't wait for the build to finish.
|
|
15
|
+
|
|
16
|
+
Files matching patterns in a .forceignore are excluded from the source
|
|
17
|
+
bundle. Both the compute app's own .forceignore and the one at the project
|
|
18
|
+
root (next to sfdx-project.json) are applied, if present. api-spec.yaml and
|
|
19
|
+
project.toml are always included, since the build can't succeed without them.
|
|
20
|
+
|
|
21
|
+
# flags.source-dir.summary
|
|
22
|
+
|
|
23
|
+
Directory containing the compute app to deploy. Defaults to the current directory.
|
|
24
|
+
|
|
25
|
+
# examples
|
|
26
|
+
|
|
27
|
+
- Deploy a compute app to an org, from inside the app's own directory:
|
|
28
|
+
|
|
29
|
+
cd force-app/main/default/platformComputeApps/CreditRatingScorer
|
|
30
|
+
|
|
31
|
+
<%= config.bin %> <%= command.id %> --target-org my-org
|
|
32
|
+
|
|
33
|
+
- Deploy a compute app to an org, from anywhere, by pointing --source-dir at it:
|
|
34
|
+
|
|
35
|
+
<%= config.bin %> <%= command.id %> --source-dir force-app/main/default/platformComputeApps/CreditRatingScorer --target-org my-org
|
|
36
|
+
|
|
37
|
+
# error.notAppDir
|
|
38
|
+
|
|
39
|
+
This directory has no %s.compute-meta.xml. Run this command from inside the compute app's own directory (the one "sf compute generate" created).
|
|
40
|
+
|
|
41
|
+
# error.notAppDir.actions
|
|
42
|
+
|
|
43
|
+
- cd into the compute app's directory (e.g. force-app/main/default/platformComputeApps/<AppName>) and run the command again.
|
|
44
|
+
- Run sf compute generate first if the app hasn't been scaffolded yet.
|
|
45
|
+
|
|
46
|
+
# error.noProcfile
|
|
47
|
+
|
|
48
|
+
%s has no Procfile. A compute app needs a Procfile to define how it starts.
|
|
49
|
+
|
|
50
|
+
# error.noProcfile.actions
|
|
51
|
+
|
|
52
|
+
- Add a Procfile to the app directory before deploying.
|
|
53
|
+
|
|
54
|
+
# error.noApiSpec
|
|
55
|
+
|
|
56
|
+
%s has no api-spec.yaml. A compute app needs an OpenAPI spec to describe its external service.
|
|
57
|
+
|
|
58
|
+
# error.noApiSpec.actions
|
|
59
|
+
|
|
60
|
+
- Add an api-spec.yaml to the app directory before deploying.
|
|
61
|
+
|
|
62
|
+
# info.preparing
|
|
63
|
+
|
|
64
|
+
Preparing deployment for %s...
|
|
65
|
+
|
|
66
|
+
# info.packaging
|
|
67
|
+
|
|
68
|
+
packaging source (%s files, %s)... done
|
|
69
|
+
|
|
70
|
+
# info.uploading
|
|
71
|
+
|
|
72
|
+
uploading source... done
|
|
73
|
+
|
|
74
|
+
# info.deployingMetadata
|
|
75
|
+
|
|
76
|
+
Deploying metadata to %s...
|
|
77
|
+
|
|
78
|
+
# info.deployedMetaFile
|
|
79
|
+
|
|
80
|
+
%s... done (%s)
|
|
81
|
+
|
|
82
|
+
# info.buildEnqueued
|
|
83
|
+
|
|
84
|
+
Build enqueued.
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
# summary
|
|
2
|
+
|
|
3
|
+
Show the current org-side status of a deployed compute app.
|
|
4
|
+
|
|
5
|
+
# description
|
|
6
|
+
|
|
7
|
+
Queries the org for the compute app's current deployment status: its master
|
|
8
|
+
label, description, and overall status. With --verbose, also shows whether
|
|
9
|
+
an external service has been registered for it (and whether it's active),
|
|
10
|
+
plus the phase, timestamps, and error detail of its current build.
|
|
11
|
+
|
|
12
|
+
This is a read-only, live lookup by --name (the app's DeveloperName) -- it
|
|
13
|
+
doesn't read from or require a local Salesforce DX project.
|
|
14
|
+
|
|
15
|
+
# flags.name.summary
|
|
16
|
+
|
|
17
|
+
DeveloperName of the compute app to show status for (or
|
|
18
|
+
<namespace>\_\_<developerName> if it was deployed under a namespace).
|
|
19
|
+
Defaults to the COMPUTE_APP_NAME environment variable, or the current
|
|
20
|
+
directory's app name if that isn't set either.
|
|
21
|
+
|
|
22
|
+
# flags.verbose.summary
|
|
23
|
+
|
|
24
|
+
Also show external service registration and current build detail.
|
|
25
|
+
|
|
26
|
+
# warning.herokuAppUnavailable
|
|
27
|
+
|
|
28
|
+
Couldn't fetch app details from Heroku: %s
|
|
29
|
+
|
|
30
|
+
# warning.herokuFormationUnavailable
|
|
31
|
+
|
|
32
|
+
Couldn't fetch dyno formation from Heroku: %s
|
|
33
|
+
|
|
34
|
+
# warning.herokuReleaseUnavailable
|
|
35
|
+
|
|
36
|
+
Couldn't fetch the latest release from Heroku: %s
|
|
37
|
+
|
|
38
|
+
# examples
|
|
39
|
+
|
|
40
|
+
- Show the current status of a compute app:
|
|
41
|
+
|
|
42
|
+
<%= config.bin %> <%= command.id %> --name CreditRatingScorer --target-org my-org
|
|
43
|
+
|
|
44
|
+
- Include external service and current build detail:
|
|
45
|
+
|
|
46
|
+
<%= config.bin %> <%= command.id %> --name CreditRatingScorer --target-org my-org --verbose
|