@forge/cli 0.0.0-experimental-deeb8f6 → 0.0.0-experimental-c8e9749
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/CHANGELOG.md +1110 -2
- package/npm-shrinkwrap.json +13212 -223
- package/out/analytics-client/analytics-client.d.ts +36 -0
- package/out/analytics-client/analytics-client.d.ts.map +1 -0
- package/out/analytics-client/analytics-client.js +140 -0
- package/out/analytics-client/analytics-message-handler.d.ts +21 -0
- package/out/analytics-client/analytics-message-handler.d.ts.map +1 -0
- package/out/analytics-client/analytics-message-handler.js +43 -0
- package/out/autocomplete/autocomplete-config.json +243 -0
- package/out/autocomplete/index.d.ts +5 -0
- package/out/autocomplete/index.d.ts.map +1 -0
- package/out/autocomplete/index.js +41 -0
- package/out/autocomplete/isSupportedShell.d.ts +2 -0
- package/out/autocomplete/isSupportedShell.d.ts.map +1 -0
- package/out/autocomplete/isSupportedShell.js +11 -0
- package/out/autocomplete/types.d.ts +14 -0
- package/out/autocomplete/types.d.ts.map +1 -0
- package/out/autocomplete/types.js +2 -0
- package/out/autocomplete/util.d.ts +6 -0
- package/out/autocomplete/util.d.ts.map +1 -0
- package/out/autocomplete/util.js +15 -0
- package/out/bin/cli.d.ts +1 -0
- package/out/bin/cli.d.ts.map +1 -1
- package/out/bin/cli.js +4 -1
- package/out/bin/postinstall.d.ts +2 -0
- package/out/bin/postinstall.d.ts.map +1 -0
- package/out/bin/postinstall.js +23 -0
- package/out/command-line/anon-user-id.d.ts +3 -0
- package/out/command-line/anon-user-id.d.ts.map +1 -0
- package/out/command-line/anon-user-id.js +17 -0
- package/out/command-line/command.d.ts +80 -0
- package/out/command-line/command.d.ts.map +1 -0
- package/out/command-line/command.js +408 -0
- package/out/command-line/controller/assertUnreachable.d.ts +2 -0
- package/out/command-line/controller/assertUnreachable.d.ts.map +1 -0
- package/out/command-line/controller/assertUnreachable.js +7 -0
- package/out/command-line/controller/autocomplete-controller.d.ts +12 -0
- package/out/command-line/controller/autocomplete-controller.d.ts.map +1 -0
- package/out/command-line/controller/autocomplete-controller.js +54 -0
- package/out/command-line/controller/deploy-controller.d.ts +42 -0
- package/out/command-line/controller/deploy-controller.d.ts.map +1 -0
- package/out/command-line/controller/deploy-controller.js +139 -0
- package/out/command-line/controller/feedback-controller.d.ts +9 -0
- package/out/command-line/controller/feedback-controller.d.ts.map +1 -0
- package/out/command-line/controller/feedback-controller.js +19 -0
- package/out/command-line/controller/getNodeVersion.d.ts +2 -0
- package/out/command-line/controller/getNodeVersion.d.ts.map +1 -0
- package/out/command-line/controller/getNodeVersion.js +7 -0
- package/out/command-line/controller/install-controller.d.ts +35 -0
- package/out/command-line/controller/install-controller.d.ts.map +1 -0
- package/out/command-line/controller/install-controller.js +157 -0
- package/out/command-line/controller/lint-controller.d.ts +9 -0
- package/out/command-line/controller/lint-controller.d.ts.map +1 -0
- package/out/command-line/controller/lint-controller.js +20 -0
- package/out/command-line/controller/pre-command-controller.d.ts +25 -0
- package/out/command-line/controller/pre-command-controller.d.ts.map +1 -0
- package/out/command-line/controller/pre-command-controller.js +57 -0
- package/out/command-line/controller/prerequisites-controller.d.ts +15 -0
- package/out/command-line/controller/prerequisites-controller.d.ts.map +1 -0
- package/out/command-line/controller/prerequisites-controller.js +41 -0
- package/out/command-line/controller/settings-controller.d.ts +19 -0
- package/out/command-line/controller/settings-controller.d.ts.map +1 -0
- package/out/command-line/controller/settings-controller.js +48 -0
- package/out/command-line/controller/stubController.d.ts +9 -0
- package/out/command-line/controller/stubController.d.ts.map +1 -0
- package/out/command-line/controller/stubController.js +15 -0
- package/out/command-line/controller/tunnel-controller.d.ts +14 -0
- package/out/command-line/controller/tunnel-controller.d.ts.map +1 -0
- package/out/command-line/controller/tunnel-controller.js +43 -0
- package/out/command-line/dependency-injection.d.ts +76 -0
- package/out/command-line/dependency-injection.d.ts.map +1 -0
- package/out/command-line/dependency-injection.js +211 -0
- package/out/command-line/environment.d.ts +2 -0
- package/out/command-line/environment.d.ts.map +1 -0
- package/out/command-line/environment.js +16 -0
- package/out/command-line/errors.d.ts +6 -0
- package/out/command-line/errors.d.ts.map +1 -0
- package/out/command-line/errors.js +12 -0
- package/out/command-line/index.d.ts +5 -0
- package/out/command-line/index.d.ts.map +1 -0
- package/out/command-line/index.js +73 -0
- package/out/command-line/register-app-commands.d.ts +10 -0
- package/out/command-line/register-app-commands.d.ts.map +1 -0
- package/out/command-line/register-app-commands.js +128 -0
- package/out/command-line/register-authentication-command.d.ts +16 -0
- package/out/command-line/register-authentication-command.d.ts.map +1 -0
- package/out/command-line/register-authentication-command.js +94 -0
- package/out/command-line/register-autocomplete-commands.d.ts +3 -0
- package/out/command-line/register-autocomplete-commands.d.ts.map +1 -0
- package/out/command-line/register-autocomplete-commands.js +14 -0
- package/out/command-line/register-contributors-commands.d.ts +3 -0
- package/out/command-line/register-contributors-commands.d.ts.map +1 -0
- package/out/command-line/register-contributors-commands.js +134 -0
- package/out/command-line/register-deployment-commands.d.ts +22 -0
- package/out/command-line/register-deployment-commands.d.ts.map +1 -0
- package/out/command-line/register-deployment-commands.js +16 -0
- package/out/command-line/register-environment-variables-commands.d.ts +3 -0
- package/out/command-line/register-environment-variables-commands.d.ts.map +1 -0
- package/out/command-line/register-environment-variables-commands.js +103 -0
- package/out/command-line/register-feedback-commands.d.ts +3 -0
- package/out/command-line/register-feedback-commands.d.ts.map +1 -0
- package/out/command-line/register-feedback-commands.js +32 -0
- package/out/command-line/register-installation-commands.d.ts +6 -0
- package/out/command-line/register-installation-commands.d.ts.map +1 -0
- package/out/command-line/register-installation-commands.js +143 -0
- package/out/command-line/register-lint-command.d.ts +8 -0
- package/out/command-line/register-lint-command.d.ts.map +1 -0
- package/out/command-line/register-lint-command.js +16 -0
- package/out/command-line/register-log-commands.d.ts +4 -0
- package/out/command-line/register-log-commands.d.ts.map +1 -0
- package/out/command-line/register-log-commands.js +139 -0
- package/out/command-line/register-providers-commands.d.ts +3 -0
- package/out/command-line/register-providers-commands.d.ts.map +1 -0
- package/out/command-line/register-providers-commands.js +44 -0
- package/out/command-line/register-settings-commands.d.ts +3 -0
- package/out/command-line/register-settings-commands.d.ts.map +1 -0
- package/out/command-line/register-settings-commands.js +39 -0
- package/out/command-line/register-tunnel-commands.d.ts +3 -0
- package/out/command-line/register-tunnel-commands.d.ts.map +1 -0
- package/out/command-line/register-tunnel-commands.js +15 -0
- package/out/command-line/register-webtrigger-commands.d.ts +3 -0
- package/out/command-line/register-webtrigger-commands.d.ts.map +1 -0
- package/out/command-line/register-webtrigger-commands.js +56 -0
- package/out/command-line/sentry.d.ts +4 -0
- package/out/command-line/sentry.d.ts.map +1 -0
- package/out/command-line/sentry.js +16 -0
- package/out/command-line/unique-machine-id.d.ts +3 -0
- package/out/command-line/unique-machine-id.d.ts.map +1 -0
- package/out/command-line/unique-machine-id.js +19 -0
- package/out/command-line/version-info.d.ts +9 -0
- package/out/command-line/version-info.d.ts.map +1 -0
- package/out/command-line/version-info.js +42 -0
- package/out/command-line/view/analytics-settings-view.d.ts +7 -0
- package/out/command-line/view/analytics-settings-view.d.ts.map +1 -0
- package/out/command-line/view/analytics-settings-view.js +18 -0
- package/out/command-line/view/deploy-view.d.ts +21 -0
- package/out/command-line/view/deploy-view.d.ts.map +1 -0
- package/out/command-line/view/deploy-view.js +58 -0
- package/out/command-line/view/install-view.d.ts +18 -0
- package/out/command-line/view/install-view.d.ts.map +1 -0
- package/out/command-line/view/install-view.js +56 -0
- package/out/command-line/view/lint-view.d.ts +12 -0
- package/out/command-line/view/lint-view.d.ts.map +1 -0
- package/out/command-line/view/lint-view.js +31 -0
- package/out/command-line/view/lite-lint-view.d.ts +10 -0
- package/out/command-line/view/lite-lint-view.d.ts.map +1 -0
- package/out/command-line/view/lite-lint-view.js +18 -0
- package/out/command-line/view/settings-view.d.ts +10 -0
- package/out/command-line/view/settings-view.d.ts.map +1 -0
- package/out/command-line/view/settings-view.js +26 -0
- package/out/command-line/view/tunnel-view.d.ts +20 -0
- package/out/command-line/view/tunnel-view.d.ts.map +1 -0
- package/out/command-line/view/tunnel-view.js +92 -0
- package/out/contributors/add-contributor.d.ts +17 -0
- package/out/contributors/add-contributor.d.ts.map +1 -0
- package/out/contributors/add-contributor.js +14 -0
- package/out/contributors/graphql-client.d.ts +14 -0
- package/out/contributors/graphql-client.d.ts.map +1 -0
- package/out/contributors/graphql-client.js +113 -0
- package/out/contributors/list-contributors.d.ts +18 -0
- package/out/contributors/list-contributors.d.ts.map +1 -0
- package/out/contributors/list-contributors.js +14 -0
- package/out/contributors/remove-contributors.d.ts +18 -0
- package/out/contributors/remove-contributors.d.ts.map +1 -0
- package/out/contributors/remove-contributors.js +14 -0
- package/out/deploy/deployer/deploy-monitor-graphql-client.d.ts +24 -0
- package/out/deploy/deployer/deploy-monitor-graphql-client.d.ts.map +1 -0
- package/out/deploy/deployer/deploy-monitor-graphql-client.js +57 -0
- package/out/deploy/deployer/deployer.d.ts +40 -0
- package/out/deploy/deployer/deployer.d.ts.map +1 -0
- package/out/deploy/deployer/deployer.js +187 -0
- package/out/deploy/deployer/index.d.ts +4 -0
- package/out/deploy/deployer/index.d.ts.map +1 -0
- package/out/deploy/deployer/index.js +6 -0
- package/out/deploy/deployer/trigger-deploy-graphql-client.d.ts +19 -0
- package/out/deploy/deployer/trigger-deploy-graphql-client.d.ts.map +1 -0
- package/out/deploy/deployer/trigger-deploy-graphql-client.js +49 -0
- package/out/deploy/index.d.ts +5 -0
- package/out/deploy/index.d.ts.map +1 -0
- package/out/deploy/index.js +7 -0
- package/out/deploy/package-upload-deploy.d.ts +20 -0
- package/out/deploy/package-upload-deploy.d.ts.map +1 -0
- package/out/deploy/package-upload-deploy.js +37 -0
- package/out/deploy/packager/archiver.d.ts +27 -0
- package/out/deploy/packager/archiver.d.ts.map +1 -0
- package/out/deploy/packager/archiver.js +76 -0
- package/out/deploy/packager/index.d.ts +3 -0
- package/out/deploy/packager/index.d.ts.map +1 -0
- package/out/deploy/packager/index.js +5 -0
- package/out/deploy/packager/nativeui-bundler.d.ts +12 -0
- package/out/deploy/packager/nativeui-bundler.d.ts.map +1 -0
- package/out/deploy/packager/nativeui-bundler.js +34 -0
- package/out/deploy/packager/packager.d.ts +32 -0
- package/out/deploy/packager/packager.d.ts.map +1 -0
- package/out/deploy/packager/packager.js +21 -0
- package/out/deploy/packager/runtime-bundler.d.ts +15 -0
- package/out/deploy/packager/runtime-bundler.d.ts.map +1 -0
- package/out/deploy/packager/runtime-bundler.js +53 -0
- package/out/deploy/uploader/artifact-graphql-client.d.ts +26 -0
- package/out/deploy/uploader/artifact-graphql-client.d.ts.map +1 -0
- package/out/deploy/uploader/artifact-graphql-client.js +100 -0
- package/out/deploy/uploader/index.d.ts +3 -0
- package/out/deploy/uploader/index.d.ts.map +1 -0
- package/out/deploy/uploader/index.js +5 -0
- package/out/deploy/uploader/uploader.d.ts +19 -0
- package/out/deploy/uploader/uploader.d.ts.map +1 -0
- package/out/deploy/uploader/uploader.js +43 -0
- package/out/environment-variables/delete-environment-variable.d.ts +18 -0
- package/out/environment-variables/delete-environment-variable.d.ts.map +1 -0
- package/out/environment-variables/delete-environment-variable.js +14 -0
- package/out/environment-variables/graphql-client.d.ts +16 -0
- package/out/environment-variables/graphql-client.d.ts.map +1 -0
- package/out/environment-variables/graphql-client.js +113 -0
- package/out/environment-variables/list-environment-variables.d.ts +22 -0
- package/out/environment-variables/list-environment-variables.d.ts.map +1 -0
- package/out/environment-variables/list-environment-variables.js +14 -0
- package/out/environment-variables/set-environment-variable.d.ts +20 -0
- package/out/environment-variables/set-environment-variable.d.ts.map +1 -0
- package/out/environment-variables/set-environment-variable.js +14 -0
- package/out/installations/graphql-client.d.ts +75 -0
- package/out/installations/graphql-client.d.ts.map +1 -0
- package/out/installations/graphql-client.js +423 -0
- package/out/installations/install-app-site.d.ts +21 -0
- package/out/installations/install-app-site.d.ts.map +1 -0
- package/out/installations/install-app-site.js +19 -0
- package/out/installations/shared.d.ts +5 -0
- package/out/installations/shared.d.ts.map +1 -0
- package/out/installations/shared.js +20 -0
- package/out/installations/site-translation/bitbucket.d.ts +24 -0
- package/out/installations/site-translation/bitbucket.d.ts.map +1 -0
- package/out/installations/site-translation/bitbucket.js +113 -0
- package/out/installations/site-translation/cloudid-products.d.ts +17 -0
- package/out/installations/site-translation/cloudid-products.d.ts.map +1 -0
- package/out/installations/site-translation/cloudid-products.js +89 -0
- package/out/installations/site-translation/index.d.ts +4 -0
- package/out/installations/site-translation/index.d.ts.map +1 -0
- package/out/installations/site-translation/index.js +6 -0
- package/out/installations/site-translation/site-translation.d.ts +12 -0
- package/out/installations/site-translation/site-translation.d.ts.map +1 -0
- package/out/installations/site-translation/site-translation.js +2 -0
- package/out/installations/uninstall-app.d.ts +25 -0
- package/out/installations/uninstall-app.d.ts.map +1 -0
- package/out/installations/uninstall-app.js +43 -0
- package/out/migration-keys/graphql-client.d.ts +8 -0
- package/out/migration-keys/graphql-client.d.ts.map +1 -0
- package/out/migration-keys/graphql-client.js +55 -0
- package/out/providers/configure-provider.d.ts +19 -0
- package/out/providers/configure-provider.d.ts.map +1 -0
- package/out/providers/configure-provider.js +14 -0
- package/out/providers/graphql-client.d.ts +8 -0
- package/out/providers/graphql-client.d.ts.map +1 -0
- package/out/providers/graphql-client.js +45 -0
- package/out/service/cached-config-service.d.ts +8 -0
- package/out/service/cached-config-service.d.ts.map +1 -0
- package/out/service/cached-config-service.js +16 -0
- package/out/service/command-suggestion-service.d.ts +4 -0
- package/out/service/command-suggestion-service.d.ts.map +1 -0
- package/out/service/command-suggestion-service.js +17 -0
- package/out/service/docker-service.d.ts +24 -0
- package/out/service/docker-service.d.ts.map +1 -0
- package/out/service/docker-service.js +71 -0
- package/out/service/installation-service.d.ts +51 -0
- package/out/service/installation-service.d.ts.map +1 -0
- package/out/service/installation-service.js +91 -0
- package/out/service/lint-service.d.ts +23 -0
- package/out/service/lint-service.d.ts.map +1 -0
- package/out/service/lint-service.js +39 -0
- package/out/service/lite-lint-service.d.ts +10 -0
- package/out/service/lite-lint-service.d.ts.map +1 -0
- package/out/service/lite-lint-service.js +27 -0
- package/out/service/migration-keys-service.d.ts +19 -0
- package/out/service/migration-keys-service.d.ts.map +1 -0
- package/out/service/migration-keys-service.js +14 -0
- package/out/service/port-finding-service.d.ts +12 -0
- package/out/service/port-finding-service.d.ts.map +1 -0
- package/out/service/port-finding-service.js +34 -0
- package/out/service/resource-packaging-service.d.ts +46 -0
- package/out/service/resource-packaging-service.d.ts.map +1 -0
- package/out/service/resource-packaging-service.js +132 -0
- package/out/service/resources-uploader-service.d.ts +16 -0
- package/out/service/resources-uploader-service.d.ts.map +1 -0
- package/out/service/resources-uploader-service.js +39 -0
- package/out/service/tunnel-analytics-service.d.ts +11 -0
- package/out/service/tunnel-analytics-service.d.ts.map +1 -0
- package/out/service/tunnel-analytics-service.js +24 -0
- package/out/service/tunnel-service.d.ts +41 -0
- package/out/service/tunnel-service.d.ts.map +1 -0
- package/out/service/tunnel-service.js +196 -0
- package/out/storage/local-file-storage.d.ts +17 -0
- package/out/storage/local-file-storage.d.ts.map +1 -0
- package/out/storage/local-file-storage.js +53 -0
- package/out/webtrigger/get-webtrigger-url.d.ts +27 -0
- package/out/webtrigger/get-webtrigger-url.d.ts.map +1 -0
- package/out/webtrigger/get-webtrigger-url.js +26 -0
- package/out/webtrigger/graphql-client.d.ts +14 -0
- package/out/webtrigger/graphql-client.d.ts.map +1 -0
- package/out/webtrigger/graphql-client.js +52 -0
- package/out/workers/analytics-message-worker.d.ts +12 -0
- package/out/workers/analytics-message-worker.d.ts.map +1 -0
- package/out/workers/analytics-message-worker.js +29 -0
- package/out/workers/forge-cli-workers.d.ts +2 -0
- package/out/workers/forge-cli-workers.d.ts.map +1 -0
- package/out/workers/forge-cli-workers.js +21 -0
- package/out/workers/tunnel-clean-up-worker.d.ts +8 -0
- package/out/workers/tunnel-clean-up-worker.d.ts.map +1 -0
- package/out/workers/tunnel-clean-up-worker.js +31 -0
- package/out/workers/version-check-worker.d.ts +8 -0
- package/out/workers/version-check-worker.d.ts.map +1 -0
- package/out/workers/version-check-worker.js +20 -0
- package/out/workers/worker-info.d.ts +8 -0
- package/out/workers/worker-info.d.ts.map +1 -0
- package/out/workers/worker-info.js +15 -0
- package/out/workers/worker.d.ts +6 -0
- package/out/workers/worker.d.ts.map +1 -0
- package/out/workers/worker.js +9 -0
- package/out/workers/workers-starter.d.ts +5 -0
- package/out/workers/workers-starter.d.ts.map +1 -0
- package/out/workers/workers-starter.js +22 -0
- package/package.json +60 -5
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { InDiskBundler } from '@forge/bundler';
|
|
2
|
+
import { Logger, ResourceDetails } from '@forge/cli-shared';
|
|
3
|
+
export interface NativeUIBundleResult {
|
|
4
|
+
nativeUiBundlesDetails: ResourceDetails[];
|
|
5
|
+
}
|
|
6
|
+
export declare class NativeUIBundler {
|
|
7
|
+
private readonly logger;
|
|
8
|
+
private readonly bundler;
|
|
9
|
+
constructor(logger: Logger, bundler: InDiskBundler);
|
|
10
|
+
bundle(resources: ResourceDetails[]): Promise<NativeUIBundleResult>;
|
|
11
|
+
}
|
|
12
|
+
//# sourceMappingURL=nativeui-bundler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"nativeui-bundler.d.ts","sourceRoot":"","sources":["../../../src/deploy/packager/nativeui-bundler.ts"],"names":[],"mappings":"AAAA,OAAO,EAAc,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAC3D,OAAO,EAAE,MAAM,EAAE,eAAe,EAAE,MAAM,mBAAmB,CAAC;AAG5D,MAAM,WAAW,oBAAoB;IACnC,sBAAsB,EAAE,eAAe,EAAE,CAAC;CAC3C;AAED,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,MAAM;IAAU,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAAxC,MAAM,EAAE,MAAM,EAAmB,OAAO,EAAE,aAAa;IAEvE,MAAM,CAAC,SAAS,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,oBAAoB,CAAC;CA8BjF"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.NativeUIBundler = void 0;
|
|
4
|
+
const packager_1 = require("./packager");
|
|
5
|
+
class NativeUIBundler {
|
|
6
|
+
constructor(logger, bundler) {
|
|
7
|
+
this.logger = logger;
|
|
8
|
+
this.bundler = bundler;
|
|
9
|
+
}
|
|
10
|
+
async bundle(resources) {
|
|
11
|
+
const entryPoints = resources.map(({ key, path }) => ({
|
|
12
|
+
name: key,
|
|
13
|
+
path
|
|
14
|
+
}));
|
|
15
|
+
const nativeUiBundlesDetails = [];
|
|
16
|
+
if (entryPoints.length > 0) {
|
|
17
|
+
let bundlerOutputs;
|
|
18
|
+
try {
|
|
19
|
+
bundlerOutputs = await Promise.all(entryPoints.map((entrypoint) => this.bundler([entrypoint])));
|
|
20
|
+
}
|
|
21
|
+
catch (e) {
|
|
22
|
+
throw new packager_1.BundlerError(e.message);
|
|
23
|
+
}
|
|
24
|
+
bundlerOutputs.forEach(({ outputDir }, index) => {
|
|
25
|
+
this.logger.debug(`NativeUI bundle created: ${outputDir}`);
|
|
26
|
+
nativeUiBundlesDetails.push(Object.assign(Object.assign({}, resources[index]), { path: outputDir }));
|
|
27
|
+
});
|
|
28
|
+
}
|
|
29
|
+
return {
|
|
30
|
+
nativeUiBundlesDetails
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
exports.NativeUIBundler = NativeUIBundler;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { Handler, Logger, ResourceDetails, UserError } from '@forge/cli-shared';
|
|
2
|
+
import { NativeUIBundler } from './nativeui-bundler';
|
|
3
|
+
import { RuntimeBundler } from './runtime-bundler';
|
|
4
|
+
export interface PackagerBundlerOutput {
|
|
5
|
+
output: {
|
|
6
|
+
[filename: string]: string;
|
|
7
|
+
};
|
|
8
|
+
sourceMap?: {
|
|
9
|
+
[filename: string]: string;
|
|
10
|
+
};
|
|
11
|
+
metadata?: {
|
|
12
|
+
[key: string]: any;
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
export interface PackageResult {
|
|
16
|
+
runtimeArchivePath: string;
|
|
17
|
+
nativeUiBundlesDetails: ResourceDetails[];
|
|
18
|
+
moduleList?: string[];
|
|
19
|
+
}
|
|
20
|
+
export interface Packager {
|
|
21
|
+
package(handlers: Handler[], resources: ResourceDetails[]): Promise<PackageResult>;
|
|
22
|
+
}
|
|
23
|
+
export declare class BundlerError extends UserError {
|
|
24
|
+
}
|
|
25
|
+
export declare class AppPackager implements Packager {
|
|
26
|
+
private readonly runtimeBundler;
|
|
27
|
+
private readonly nativeUiBundler;
|
|
28
|
+
private readonly logger;
|
|
29
|
+
constructor(runtimeBundler: RuntimeBundler, nativeUiBundler: NativeUIBundler, logger: Logger);
|
|
30
|
+
package(handlers: Handler[], resources: ResourceDetails[]): Promise<PackageResult>;
|
|
31
|
+
}
|
|
32
|
+
//# sourceMappingURL=packager.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"packager.d.ts","sourceRoot":"","sources":["../../../src/deploy/packager/packager.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,EAAE,eAAe,EAAQ,SAAS,EAAE,MAAM,mBAAmB,CAAC;AACtF,OAAO,EAAE,eAAe,EAAE,MAAM,oBAAoB,CAAC;AACrD,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAC;AAEnD,MAAM,WAAW,qBAAqB;IACpC,MAAM,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IACvC,SAAS,CAAC,EAAE;QAAE,CAAC,QAAQ,EAAE,MAAM,GAAG,MAAM,CAAA;KAAE,CAAC;IAC3C,QAAQ,CAAC,EAAE;QACT,CAAC,GAAG,EAAE,MAAM,GAAG,GAAG,CAAC;KACpB,CAAC;CACH;AAED,MAAM,WAAW,aAAa;IAC5B,kBAAkB,EAAE,MAAM,CAAC;IAC3B,sBAAsB,EAAE,eAAe,EAAE,CAAC;IAC1C,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,MAAM,WAAW,QAAQ;IACvB,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC,CAAC;CACpF;AAED,qBAAa,YAAa,SAAQ,SAAS;CAAG;AAE9C,qBAAa,WAAY,YAAW,QAAQ;IAExC,OAAO,CAAC,QAAQ,CAAC,cAAc;IAC/B,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAFN,cAAc,EAAE,cAAc,EAC9B,eAAe,EAAE,eAAe,EAChC,MAAM,EAAE,MAAM;IAGpB,OAAO,CAAC,QAAQ,EAAE,OAAO,EAAE,EAAE,SAAS,EAAE,eAAe,EAAE,GAAG,OAAO,CAAC,aAAa,CAAC;CAWhG"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppPackager = exports.BundlerError = void 0;
|
|
4
|
+
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
+
class BundlerError extends cli_shared_1.UserError {
|
|
6
|
+
}
|
|
7
|
+
exports.BundlerError = BundlerError;
|
|
8
|
+
class AppPackager {
|
|
9
|
+
constructor(runtimeBundler, nativeUiBundler, logger) {
|
|
10
|
+
this.runtimeBundler = runtimeBundler;
|
|
11
|
+
this.nativeUiBundler = nativeUiBundler;
|
|
12
|
+
this.logger = logger;
|
|
13
|
+
}
|
|
14
|
+
async package(handlers, resources) {
|
|
15
|
+
this.logger.info(cli_shared_1.Text.deploy.taskPackage.title);
|
|
16
|
+
const runtimeBundle = await this.runtimeBundler.bundle(handlers);
|
|
17
|
+
const nativeUiBundle = await this.nativeUiBundler.bundle(resources);
|
|
18
|
+
return Object.assign(Object.assign({}, runtimeBundle), nativeUiBundle);
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
exports.AppPackager = AppPackager;
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Bundler, FunctionsEntryPoint } from '@forge/bundler';
|
|
2
|
+
import { Handler, Logger } from '@forge/cli-shared';
|
|
3
|
+
import { Archiver } from './archiver';
|
|
4
|
+
export interface RuntimeBundleResult {
|
|
5
|
+
runtimeArchivePath: string;
|
|
6
|
+
moduleList?: string[];
|
|
7
|
+
}
|
|
8
|
+
export declare class RuntimeBundler {
|
|
9
|
+
private readonly archiverFactory;
|
|
10
|
+
private readonly logger;
|
|
11
|
+
private readonly bundler;
|
|
12
|
+
constructor(archiverFactory: () => Archiver, logger: Logger, bundler: Bundler<FunctionsEntryPoint>);
|
|
13
|
+
bundle(handlers: Handler[]): Promise<RuntimeBundleResult>;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=runtime-bundler.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"runtime-bundler.d.ts","sourceRoot":"","sources":["../../../src/deploy/packager/runtime-bundler.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,OAAO,EAAE,mBAAmB,EAAkB,MAAM,gBAAgB,CAAC;AAC9E,OAAO,EAAuB,OAAO,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAC/E,OAAO,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAGtC,MAAM,WAAW,mBAAmB;IAClC,kBAAkB,EAAE,MAAM,CAAC;IAC3B,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;CACvB;AAED,qBAAa,cAAc;IAEvB,OAAO,CAAC,QAAQ,CAAC,eAAe;IAChC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,OAAO;gBAFP,eAAe,EAAE,MAAM,QAAQ,EAC/B,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,OAAO,CAAC,mBAAmB,CAAC;IAG3C,MAAM,CAAC,QAAQ,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,mBAAmB,CAAC;CAgDvE"}
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.RuntimeBundler = void 0;
|
|
4
|
+
const fs_1 = require("fs");
|
|
5
|
+
const bundler_1 = require("@forge/bundler");
|
|
6
|
+
const cli_shared_1 = require("@forge/cli-shared");
|
|
7
|
+
const packager_1 = require("./packager");
|
|
8
|
+
class RuntimeBundler {
|
|
9
|
+
constructor(archiverFactory, logger, bundler) {
|
|
10
|
+
this.archiverFactory = archiverFactory;
|
|
11
|
+
this.logger = logger;
|
|
12
|
+
this.bundler = bundler;
|
|
13
|
+
}
|
|
14
|
+
async bundle(handlers) {
|
|
15
|
+
const archiver = this.archiverFactory();
|
|
16
|
+
archiver.onWarning((err) => {
|
|
17
|
+
this.logger.warn(cli_shared_1.Text.deploy.taskPackage.archiverWarning(err));
|
|
18
|
+
});
|
|
19
|
+
const entryPoints = (0, bundler_1.getEntryPoints)(handlers);
|
|
20
|
+
const moduleList = [];
|
|
21
|
+
if (entryPoints.length > 0) {
|
|
22
|
+
let bundlerResponse;
|
|
23
|
+
try {
|
|
24
|
+
bundlerResponse = await this.bundler(process.cwd(), entryPoints);
|
|
25
|
+
}
|
|
26
|
+
catch (e) {
|
|
27
|
+
throw new packager_1.BundlerError(e.message);
|
|
28
|
+
}
|
|
29
|
+
const { output, sourceMap, metadata } = bundlerResponse;
|
|
30
|
+
if (metadata) {
|
|
31
|
+
moduleList.push(...metadata.modules);
|
|
32
|
+
}
|
|
33
|
+
this.logger.debug(cli_shared_1.Text.deploy.taskPackage.packageBundledFiles);
|
|
34
|
+
for (const name in output) {
|
|
35
|
+
archiver.addFile(`${name}.js`, Buffer.from(output[name]));
|
|
36
|
+
}
|
|
37
|
+
if (sourceMap) {
|
|
38
|
+
for (const name in sourceMap) {
|
|
39
|
+
archiver.addFile(`${name}.js.map`, Buffer.from(sourceMap[name]));
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
for (const fileName of cli_shared_1.dependencyFileNames) {
|
|
44
|
+
if ((0, fs_1.existsSync)(fileName)) {
|
|
45
|
+
archiver.addFileFrom(fileName, fileName);
|
|
46
|
+
}
|
|
47
|
+
}
|
|
48
|
+
const archivePath = await archiver.finalise();
|
|
49
|
+
this.logger.debug(cli_shared_1.Text.deploy.taskPackage.archiveCreated(archivePath));
|
|
50
|
+
return { runtimeArchivePath: archivePath, moduleList };
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
exports.RuntimeBundler = RuntimeBundler;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { AppDetails, GraphQLClient, HostedResourcePreSignedUrl } from '@forge/cli-shared';
|
|
2
|
+
interface HostedResourceUploadResponse {
|
|
3
|
+
preSignedUrls: HostedResourcePreSignedUrl[];
|
|
4
|
+
uploadId: string;
|
|
5
|
+
}
|
|
6
|
+
export interface ArtifactClient {
|
|
7
|
+
getUploadUrl(appDetails: AppDetails): Promise<string>;
|
|
8
|
+
getHostedResourcesUploadUrls(appDetails: AppDetails, environmentKey: string, resourceKeys: string[]): Promise<HostedResourceUploadResponse>;
|
|
9
|
+
}
|
|
10
|
+
export declare class NoDeploymentURLError extends Error {
|
|
11
|
+
constructor();
|
|
12
|
+
}
|
|
13
|
+
export declare class NoPresignedUrlsError extends Error {
|
|
14
|
+
constructor();
|
|
15
|
+
}
|
|
16
|
+
export declare class NoUploadIdError extends Error {
|
|
17
|
+
constructor();
|
|
18
|
+
}
|
|
19
|
+
export declare class ArtifactGraphQLClient implements ArtifactClient {
|
|
20
|
+
private readonly graphqlClient;
|
|
21
|
+
constructor(graphqlClient: GraphQLClient);
|
|
22
|
+
getUploadUrl(appDetails: AppDetails): Promise<string>;
|
|
23
|
+
getHostedResourcesUploadUrls(appDetails: AppDetails, environmentKey: string, resourceKeys: string[]): Promise<HostedResourceUploadResponse>;
|
|
24
|
+
}
|
|
25
|
+
export {};
|
|
26
|
+
//# sourceMappingURL=artifact-graphql-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"artifact-graphql-client.d.ts","sourceRoot":"","sources":["../../../src/deploy/uploader/artifact-graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,UAAU,EACV,aAAa,EAIb,0BAA0B,EAG3B,MAAM,mBAAmB,CAAC;AAE3B,UAAU,4BAA4B;IACpC,aAAa,EAAE,0BAA0B,EAAE,CAAC;IAC5C,QAAQ,EAAE,MAAM,CAAC;CAClB;AAED,MAAM,WAAW,cAAc;IAC7B,YAAY,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACtD,4BAA4B,CAC1B,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,EAAE,GACrB,OAAO,CAAC,4BAA4B,CAAC,CAAC;CAC1C;AAED,qBAAa,oBAAqB,SAAQ,KAAK;;CAI9C;AAED,qBAAa,oBAAqB,SAAQ,KAAK;;CAI9C;AAED,qBAAa,eAAgB,SAAQ,KAAK;;CAIzC;AAED,qBAAa,qBAAsB,YAAW,cAAc;IAC9C,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,YAAY,CAAC,UAAU,EAAE,UAAU,GAAG,OAAO,CAAC,MAAM,CAAC;IA4CrD,4BAA4B,CACvC,UAAU,EAAE,UAAU,EACtB,cAAc,EAAE,MAAM,EACtB,YAAY,EAAE,MAAM,EAAE,GACrB,OAAO,CAAC,4BAA4B,CAAC;CAmDzC"}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ArtifactGraphQLClient = exports.NoUploadIdError = exports.NoPresignedUrlsError = exports.NoDeploymentURLError = void 0;
|
|
4
|
+
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
+
class NoDeploymentURLError extends Error {
|
|
6
|
+
constructor() {
|
|
7
|
+
super(cli_shared_1.Text.artifact.error.noDeployUrl);
|
|
8
|
+
}
|
|
9
|
+
}
|
|
10
|
+
exports.NoDeploymentURLError = NoDeploymentURLError;
|
|
11
|
+
class NoPresignedUrlsError extends Error {
|
|
12
|
+
constructor() {
|
|
13
|
+
super(cli_shared_1.Text.artifact.error.noPresignedUrls);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
exports.NoPresignedUrlsError = NoPresignedUrlsError;
|
|
17
|
+
class NoUploadIdError extends Error {
|
|
18
|
+
constructor() {
|
|
19
|
+
super(cli_shared_1.Text.artifact.error.noUploadId);
|
|
20
|
+
}
|
|
21
|
+
}
|
|
22
|
+
exports.NoUploadIdError = NoUploadIdError;
|
|
23
|
+
class ArtifactGraphQLClient {
|
|
24
|
+
constructor(graphqlClient) {
|
|
25
|
+
this.graphqlClient = graphqlClient;
|
|
26
|
+
}
|
|
27
|
+
async getUploadUrl(appDetails) {
|
|
28
|
+
const artifactQuery = `
|
|
29
|
+
mutation forge_cli_getDeploymentUrl($input: CreateAppDeploymentUrlInput!) {
|
|
30
|
+
createAppDeploymentUrl(input: $input) {
|
|
31
|
+
success
|
|
32
|
+
errors {
|
|
33
|
+
message
|
|
34
|
+
extensions {
|
|
35
|
+
errorType
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
deploymentUrl
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
`;
|
|
42
|
+
const { response: { createAppDeploymentUrl: { deploymentUrl, success, errors } }, requestId } = await this.graphqlClient.mutate(artifactQuery, {
|
|
43
|
+
input: {
|
|
44
|
+
appId: appDetails.id
|
|
45
|
+
}
|
|
46
|
+
});
|
|
47
|
+
const error = (0, cli_shared_1.getError)(errors);
|
|
48
|
+
if (!success) {
|
|
49
|
+
throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, {
|
|
50
|
+
requestId,
|
|
51
|
+
code: error.code,
|
|
52
|
+
statusCode: error.statusCode
|
|
53
|
+
});
|
|
54
|
+
}
|
|
55
|
+
if (!deploymentUrl) {
|
|
56
|
+
throw new NoDeploymentURLError();
|
|
57
|
+
}
|
|
58
|
+
return deploymentUrl;
|
|
59
|
+
}
|
|
60
|
+
async getHostedResourcesUploadUrls(appDetails, environmentKey, resourceKeys) {
|
|
61
|
+
const artifactQuery = `
|
|
62
|
+
mutation forge_cli_getHostedResourcesUploadUrls($input: CreateHostedResourceUploadUrlInput!) {
|
|
63
|
+
createHostedResourceUploadUrl(input: $input) {
|
|
64
|
+
success
|
|
65
|
+
errors {
|
|
66
|
+
message
|
|
67
|
+
extensions {
|
|
68
|
+
errorType
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
preSignedUrls {
|
|
72
|
+
uploadUrl
|
|
73
|
+
uploadFormData
|
|
74
|
+
}
|
|
75
|
+
uploadId
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
`;
|
|
79
|
+
const { response: { createHostedResourceUploadUrl: { preSignedUrls, success, errors, uploadId } }, requestId } = await this.graphqlClient.mutate(artifactQuery, {
|
|
80
|
+
input: {
|
|
81
|
+
appId: appDetails.id,
|
|
82
|
+
environmentKey,
|
|
83
|
+
resourceKeys
|
|
84
|
+
}
|
|
85
|
+
});
|
|
86
|
+
const error = (0, cli_shared_1.getError)(errors);
|
|
87
|
+
if (!success) {
|
|
88
|
+
throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, {
|
|
89
|
+
requestId,
|
|
90
|
+
code: error.code,
|
|
91
|
+
statusCode: error.statusCode
|
|
92
|
+
});
|
|
93
|
+
}
|
|
94
|
+
if (!preSignedUrls) {
|
|
95
|
+
throw new NoPresignedUrlsError();
|
|
96
|
+
}
|
|
97
|
+
return { preSignedUrls, uploadId };
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
exports.ArtifactGraphQLClient = ArtifactGraphQLClient;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/deploy/uploader/index.ts"],"names":[],"mappings":"AAEA,cAAc,2BAA2B,CAAC;AAC1C,cAAc,YAAY,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { AppConfigProvider, FileUploader, Logger } from '@forge/cli-shared';
|
|
2
|
+
import { ArtifactClient } from './artifact-graphql-client';
|
|
3
|
+
import { ResourceArchives } from '../../service/resource-packaging-service';
|
|
4
|
+
import { UploaderService } from '../../service/resources-uploader-service';
|
|
5
|
+
export interface ArchiveUploader {
|
|
6
|
+
uploadArchive(archivePath: string): Promise<string>;
|
|
7
|
+
uploadHostedResources(environmentKey: string, resourceArchives: ResourceArchives): Promise<string | undefined>;
|
|
8
|
+
}
|
|
9
|
+
export declare class AppArchiveUploader implements ArchiveUploader {
|
|
10
|
+
private readonly getConfiguredApp;
|
|
11
|
+
private readonly artifact;
|
|
12
|
+
private readonly uploader;
|
|
13
|
+
private readonly logger;
|
|
14
|
+
private readonly uploaderService;
|
|
15
|
+
constructor(getConfiguredApp: AppConfigProvider, artifact: ArtifactClient, uploader: FileUploader, logger: Logger, uploaderService: UploaderService);
|
|
16
|
+
uploadArchive(archivePath: string): Promise<string>;
|
|
17
|
+
uploadHostedResources(environmentKey: string, resourceArchives: ResourceArchives): Promise<string | undefined>;
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=uploader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"uploader.d.ts","sourceRoot":"","sources":["../../../src/deploy/uploader/uploader.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,YAAY,EAAE,MAAM,EAAQ,MAAM,mBAAmB,CAAC;AAClF,OAAO,EAAE,cAAc,EAAE,MAAM,2BAA2B,CAAC;AAE3D,OAAO,EAAE,gBAAgB,EAAE,MAAM,0CAA0C,CAAC;AAC5E,OAAO,EAAE,eAAe,EAAE,MAAM,0CAA0C,CAAC;AAE3E,MAAM,WAAW,eAAe;IAC9B,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC,CAAC;IACpD,qBAAqB,CAAC,cAAc,EAAE,MAAM,EAAE,gBAAgB,EAAE,gBAAgB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC,CAAC;CAChH;AAED,qBAAa,kBAAmB,YAAW,eAAe;IAEtD,OAAO,CAAC,QAAQ,CAAC,gBAAgB;IACjC,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,QAAQ;IACzB,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,eAAe;gBAJf,gBAAgB,EAAE,iBAAiB,EACnC,QAAQ,EAAE,cAAc,EACxB,QAAQ,EAAE,YAAY,EACtB,MAAM,EAAE,MAAM,EACd,eAAe,EAAE,eAAe;IAGtC,aAAa,CAAC,WAAW,EAAE,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;IAYnD,qBAAqB,CAChC,cAAc,EAAE,MAAM,EACtB,gBAAgB,EAAE,gBAAgB,GACjC,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;CAiC/B"}
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AppArchiveUploader = void 0;
|
|
4
|
+
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
+
class AppArchiveUploader {
|
|
6
|
+
constructor(getConfiguredApp, artifact, uploader, logger, uploaderService) {
|
|
7
|
+
this.getConfiguredApp = getConfiguredApp;
|
|
8
|
+
this.artifact = artifact;
|
|
9
|
+
this.uploader = uploader;
|
|
10
|
+
this.logger = logger;
|
|
11
|
+
this.uploaderService = uploaderService;
|
|
12
|
+
}
|
|
13
|
+
async uploadArchive(archivePath) {
|
|
14
|
+
this.logger.info(cli_shared_1.Text.deploy.taskUpload.title);
|
|
15
|
+
const appDetails = await this.getConfiguredApp();
|
|
16
|
+
const uploadUrl = await this.artifact.getUploadUrl(appDetails);
|
|
17
|
+
this.logger.debug(cli_shared_1.Text.deploy.taskUpload.uploadingArchive(uploadUrl));
|
|
18
|
+
await this.uploader.uploadFromPath(uploadUrl, archivePath);
|
|
19
|
+
return uploadUrl;
|
|
20
|
+
}
|
|
21
|
+
async uploadHostedResources(environmentKey, resourceArchives) {
|
|
22
|
+
const appDetails = await this.getConfiguredApp();
|
|
23
|
+
const resourceKeys = Object.keys(resourceArchives);
|
|
24
|
+
if (resourceKeys.length === 0) {
|
|
25
|
+
return undefined;
|
|
26
|
+
}
|
|
27
|
+
const { preSignedUrls, uploadId } = await this.artifact.getHostedResourcesUploadUrls(appDetails, environmentKey, Object.keys(resourceArchives));
|
|
28
|
+
const uploadDetails = resourceKeys.map((resourceKey, i) => {
|
|
29
|
+
const preSignedUrl = preSignedUrls[i];
|
|
30
|
+
const archive = resourceArchives[resourceKey].zipPath;
|
|
31
|
+
return {
|
|
32
|
+
archive,
|
|
33
|
+
preSignedUrl
|
|
34
|
+
};
|
|
35
|
+
});
|
|
36
|
+
this.logger.debug(cli_shared_1.Text.deploy.taskUpload.uploadingResources());
|
|
37
|
+
await Promise.all(uploadDetails.map((uploadDetails) => {
|
|
38
|
+
return this.uploaderService.upload(uploadDetails);
|
|
39
|
+
}));
|
|
40
|
+
return uploadId;
|
|
41
|
+
}
|
|
42
|
+
}
|
|
43
|
+
exports.AppArchiveUploader = AppArchiveUploader;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { AppConfigProvider } from '@forge/cli-shared';
|
|
2
|
+
export interface EnvironmentVariableDetails {
|
|
3
|
+
environment: string;
|
|
4
|
+
key: string;
|
|
5
|
+
}
|
|
6
|
+
export interface AppEnvironmentVariableDetails extends EnvironmentVariableDetails {
|
|
7
|
+
appId: string;
|
|
8
|
+
}
|
|
9
|
+
export interface DeleteEnvironmentVariableClient {
|
|
10
|
+
deleteEnvironmentVariable(details: AppEnvironmentVariableDetails): Promise<void>;
|
|
11
|
+
}
|
|
12
|
+
export declare class DeleteEnvironmentVariableCommand {
|
|
13
|
+
private readonly client;
|
|
14
|
+
private readonly getAppConfig;
|
|
15
|
+
constructor(client: DeleteEnvironmentVariableClient, getAppConfig: AppConfigProvider);
|
|
16
|
+
execute(details: EnvironmentVariableDetails): Promise<void>;
|
|
17
|
+
}
|
|
18
|
+
//# sourceMappingURL=delete-environment-variable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"delete-environment-variable.d.ts","sourceRoot":"","sources":["../../src/environment-variables/delete-environment-variable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,GAAG,EAAE,MAAM,CAAC;CACb;AAED,MAAM,WAAW,6BAA8B,SAAQ,0BAA0B;IAC/E,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,+BAA+B;IAC9C,yBAAyB,CAAC,OAAO,EAAE,6BAA6B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAClF;AAED,qBAAa,gCAAgC;IAEzC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,MAAM,EAAE,+BAA+B,EACvC,YAAY,EAAE,iBAAiB;IAGrC,OAAO,CAAC,OAAO,EAAE,0BAA0B;CAOzD"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DeleteEnvironmentVariableCommand = void 0;
|
|
4
|
+
class DeleteEnvironmentVariableCommand {
|
|
5
|
+
constructor(client, getAppConfig) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
this.getAppConfig = getAppConfig;
|
|
8
|
+
}
|
|
9
|
+
async execute(details) {
|
|
10
|
+
const { id: appId } = await this.getAppConfig();
|
|
11
|
+
await this.client.deleteEnvironmentVariable(Object.assign(Object.assign({}, details), { appId }));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.DeleteEnvironmentVariableCommand = DeleteEnvironmentVariableCommand;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { AppEnvironmentVariable, GraphQLClient, Maybe, UserError } from '@forge/cli-shared';
|
|
2
|
+
import { AppEnvironmentVariableDetails as DeleteAppEnvironmentVariableDetails, DeleteEnvironmentVariableClient } from './delete-environment-variable';
|
|
3
|
+
import { AppEnvironmentVariablesDetails as ListAppEnvironmentVariablesDetails, ListEnvironmentVariablesClient } from './list-environment-variables';
|
|
4
|
+
import { AppEnvironmentVariableDetails as SetAppEnvironmentVariableDetails, SetEnvironmentVariableClient } from './set-environment-variable';
|
|
5
|
+
export declare class MissingAppError extends UserError {
|
|
6
|
+
}
|
|
7
|
+
export declare class MissingAppEnvironmentError extends Error {
|
|
8
|
+
}
|
|
9
|
+
export declare class GraphqlClient implements SetEnvironmentVariableClient, DeleteEnvironmentVariableClient, ListEnvironmentVariablesClient {
|
|
10
|
+
private readonly graphqlClient;
|
|
11
|
+
constructor(graphqlClient: GraphQLClient);
|
|
12
|
+
listEnvironmentVariables(details: ListAppEnvironmentVariablesDetails): Promise<Maybe<AppEnvironmentVariable[]> | undefined>;
|
|
13
|
+
setEnvironmentVariable(details: SetAppEnvironmentVariableDetails): Promise<void>;
|
|
14
|
+
deleteEnvironmentVariable(details: DeleteAppEnvironmentVariableDetails): Promise<void>;
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=graphql-client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql-client.d.ts","sourceRoot":"","sources":["../../src/environment-variables/graphql-client.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,sBAAsB,EAEtB,aAAa,EAEb,KAAK,EACL,SAAS,EACV,MAAM,mBAAmB,CAAC;AAE3B,OAAO,EACL,6BAA6B,IAAI,mCAAmC,EACpE,+BAA+B,EAChC,MAAM,+BAA+B,CAAC;AACvC,OAAO,EACL,8BAA8B,IAAI,kCAAkC,EACpE,8BAA8B,EAC/B,MAAM,8BAA8B,CAAC;AACtC,OAAO,EACL,6BAA6B,IAAI,gCAAgC,EACjE,4BAA4B,EAC7B,MAAM,4BAA4B,CAAC;AAEpC,qBAAa,eAAgB,SAAQ,SAAS;CAAG;AACjD,qBAAa,0BAA2B,SAAQ,KAAK;CAAG;AAExD,qBAAa,aACX,YAAW,4BAA4B,EAAE,+BAA+B,EAAE,8BAA8B;IAC5F,OAAO,CAAC,QAAQ,CAAC,aAAa;gBAAb,aAAa,EAAE,aAAa;IAE5C,wBAAwB,CACnC,OAAO,EAAE,kCAAkC,GAC1C,OAAO,CAAC,KAAK,CAAC,sBAAsB,EAAE,CAAC,GAAG,SAAS,CAAC;IAkC1C,sBAAsB,CAAC,OAAO,EAAE,gCAAgC;IA6ChE,yBAAyB,CAAC,OAAO,EAAE,mCAAmC;CA2CpF"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.GraphqlClient = exports.MissingAppEnvironmentError = exports.MissingAppError = void 0;
|
|
4
|
+
const cli_shared_1 = require("@forge/cli-shared");
|
|
5
|
+
class MissingAppError extends cli_shared_1.UserError {
|
|
6
|
+
}
|
|
7
|
+
exports.MissingAppError = MissingAppError;
|
|
8
|
+
class MissingAppEnvironmentError extends Error {
|
|
9
|
+
}
|
|
10
|
+
exports.MissingAppEnvironmentError = MissingAppEnvironmentError;
|
|
11
|
+
class GraphqlClient {
|
|
12
|
+
constructor(graphqlClient) {
|
|
13
|
+
this.graphqlClient = graphqlClient;
|
|
14
|
+
}
|
|
15
|
+
async listEnvironmentVariables(details) {
|
|
16
|
+
const query = `
|
|
17
|
+
query forge_cli_getAppEnvironmentVariables($appId: ID!, $key: String!) {
|
|
18
|
+
app(id: $appId) {
|
|
19
|
+
name
|
|
20
|
+
description
|
|
21
|
+
environmentByKey(key: $key) {
|
|
22
|
+
id
|
|
23
|
+
variables {
|
|
24
|
+
key
|
|
25
|
+
value
|
|
26
|
+
encrypt
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
const result = await this.graphqlClient.query(query, {
|
|
33
|
+
appId: details.appId,
|
|
34
|
+
key: details.environment
|
|
35
|
+
});
|
|
36
|
+
if (!result.app) {
|
|
37
|
+
throw new MissingAppError();
|
|
38
|
+
}
|
|
39
|
+
if (!result.app.environmentByKey) {
|
|
40
|
+
throw new MissingAppEnvironmentError();
|
|
41
|
+
}
|
|
42
|
+
return result.app.environmentByKey.variables;
|
|
43
|
+
}
|
|
44
|
+
async setEnvironmentVariable(details) {
|
|
45
|
+
const mutation = `
|
|
46
|
+
mutation forge_cli_setAppEnvironmentVariable($input: SetAppEnvironmentVariableInput!) {
|
|
47
|
+
setAppEnvironmentVariable(input: $input) {
|
|
48
|
+
success
|
|
49
|
+
errors {
|
|
50
|
+
message
|
|
51
|
+
extensions {
|
|
52
|
+
errorType
|
|
53
|
+
}
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
`;
|
|
58
|
+
const { response: { setAppEnvironmentVariable: { success, errors } }, requestId } = await this.graphqlClient.mutate(mutation, {
|
|
59
|
+
input: {
|
|
60
|
+
environment: {
|
|
61
|
+
appId: details.appId,
|
|
62
|
+
key: details.environment
|
|
63
|
+
},
|
|
64
|
+
environmentVariable: {
|
|
65
|
+
key: details.key,
|
|
66
|
+
value: details.value,
|
|
67
|
+
encrypt: details.encrypt
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
});
|
|
71
|
+
const error = (0, cli_shared_1.getError)(errors);
|
|
72
|
+
if (!success) {
|
|
73
|
+
throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, {
|
|
74
|
+
requestId,
|
|
75
|
+
code: error.code,
|
|
76
|
+
statusCode: error.statusCode
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
async deleteEnvironmentVariable(details) {
|
|
81
|
+
const mutation = `
|
|
82
|
+
mutation forge_cli_deleteAppEnvironmentVariable($input: DeleteAppEnvironmentVariableInput!) {
|
|
83
|
+
deleteAppEnvironmentVariable(input: $input) {
|
|
84
|
+
success
|
|
85
|
+
errors {
|
|
86
|
+
message
|
|
87
|
+
extensions {
|
|
88
|
+
errorType
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
}
|
|
93
|
+
`;
|
|
94
|
+
const { response: { deleteAppEnvironmentVariable: { success, errors } }, requestId } = await this.graphqlClient.mutate(mutation, {
|
|
95
|
+
input: {
|
|
96
|
+
environment: {
|
|
97
|
+
appId: details.appId,
|
|
98
|
+
key: details.environment
|
|
99
|
+
},
|
|
100
|
+
key: details.key
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
const error = (0, cli_shared_1.getError)(errors);
|
|
104
|
+
if (!success) {
|
|
105
|
+
throw new cli_shared_1.GraphQlMutationError(`${error.message} (requestId: ${requestId || 'unknown'})`, {
|
|
106
|
+
requestId,
|
|
107
|
+
code: error.code,
|
|
108
|
+
statusCode: error.statusCode
|
|
109
|
+
});
|
|
110
|
+
}
|
|
111
|
+
}
|
|
112
|
+
}
|
|
113
|
+
exports.GraphqlClient = GraphqlClient;
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { AppConfigProvider } from '@forge/cli-shared';
|
|
2
|
+
export interface EnvironmentVariablesDetails {
|
|
3
|
+
environment: string;
|
|
4
|
+
}
|
|
5
|
+
export interface AppEnvironmentVariablesDetails extends EnvironmentVariablesDetails {
|
|
6
|
+
appId: string;
|
|
7
|
+
}
|
|
8
|
+
export interface AppEnvironmentVariable {
|
|
9
|
+
key: string;
|
|
10
|
+
value?: string | null;
|
|
11
|
+
encrypt: boolean;
|
|
12
|
+
}
|
|
13
|
+
export interface ListEnvironmentVariablesClient {
|
|
14
|
+
listEnvironmentVariables(details: AppEnvironmentVariablesDetails): Promise<AppEnvironmentVariable[] | null | undefined>;
|
|
15
|
+
}
|
|
16
|
+
export declare class ListEnvironmentVariablesCommand {
|
|
17
|
+
private readonly client;
|
|
18
|
+
private readonly getAppConfig;
|
|
19
|
+
constructor(client: ListEnvironmentVariablesClient, getAppConfig: AppConfigProvider);
|
|
20
|
+
execute(details: EnvironmentVariablesDetails): Promise<AppEnvironmentVariable[] | null | undefined>;
|
|
21
|
+
}
|
|
22
|
+
//# sourceMappingURL=list-environment-variables.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"list-environment-variables.d.ts","sourceRoot":"","sources":["../../src/environment-variables/list-environment-variables.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,2BAA2B;IAC1C,WAAW,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,8BAA+B,SAAQ,2BAA2B;IACjF,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,sBAAsB;IACrC,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;IACtB,OAAO,EAAE,OAAO,CAAC;CAClB;AAED,MAAM,WAAW,8BAA8B;IAC7C,wBAAwB,CACtB,OAAO,EAAE,8BAA8B,GACtC,OAAO,CAAC,sBAAsB,EAAE,GAAG,IAAI,GAAG,SAAS,CAAC,CAAC;CACzD;AAED,qBAAa,+BAA+B;IAExC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,MAAM,EAAE,8BAA8B,EACtC,YAAY,EAAE,iBAAiB;IAGrC,OAAO,CAAC,OAAO,EAAE,2BAA2B;CAO1D"}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ListEnvironmentVariablesCommand = void 0;
|
|
4
|
+
class ListEnvironmentVariablesCommand {
|
|
5
|
+
constructor(client, getAppConfig) {
|
|
6
|
+
this.client = client;
|
|
7
|
+
this.getAppConfig = getAppConfig;
|
|
8
|
+
}
|
|
9
|
+
async execute(details) {
|
|
10
|
+
const { id: appId } = await this.getAppConfig();
|
|
11
|
+
return await this.client.listEnvironmentVariables(Object.assign(Object.assign({}, details), { appId }));
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
exports.ListEnvironmentVariablesCommand = ListEnvironmentVariablesCommand;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { AppConfigProvider } from '@forge/cli-shared';
|
|
2
|
+
export interface EnvironmentVariableDetails {
|
|
3
|
+
environment: string;
|
|
4
|
+
encrypt: boolean;
|
|
5
|
+
key: string;
|
|
6
|
+
value: string;
|
|
7
|
+
}
|
|
8
|
+
export interface AppEnvironmentVariableDetails extends EnvironmentVariableDetails {
|
|
9
|
+
appId: string;
|
|
10
|
+
}
|
|
11
|
+
export interface SetEnvironmentVariableClient {
|
|
12
|
+
setEnvironmentVariable(details: AppEnvironmentVariableDetails): Promise<void>;
|
|
13
|
+
}
|
|
14
|
+
export declare class SetEnvironmentVariableCommand {
|
|
15
|
+
private readonly client;
|
|
16
|
+
private readonly getAppConfig;
|
|
17
|
+
constructor(client: SetEnvironmentVariableClient, getAppConfig: AppConfigProvider);
|
|
18
|
+
execute(details: EnvironmentVariableDetails): Promise<void>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=set-environment-variable.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"set-environment-variable.d.ts","sourceRoot":"","sources":["../../src/environment-variables/set-environment-variable.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,iBAAiB,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,WAAW,0BAA0B;IACzC,WAAW,EAAE,MAAM,CAAC;IACpB,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,6BAA8B,SAAQ,0BAA0B;IAC/E,KAAK,EAAE,MAAM,CAAC;CACf;AAED,MAAM,WAAW,4BAA4B;IAC3C,sBAAsB,CAAC,OAAO,EAAE,6BAA6B,GAAG,OAAO,CAAC,IAAI,CAAC,CAAC;CAC/E;AAED,qBAAa,6BAA6B;IAEtC,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,OAAO,CAAC,QAAQ,CAAC,YAAY;gBADZ,MAAM,EAAE,4BAA4B,EACpC,YAAY,EAAE,iBAAiB;IAGrC,OAAO,CAAC,OAAO,EAAE,0BAA0B;CAOzD"}
|