npm package diff
Package: @forge/cli
Versions: 11.3.0-next.4-experimental-e92a337 - 11.3.0-next.5
Modified: package/out/command-line/view/version-view.js
Index: package/out/command-line/view/version-view.js
===================================================================
--- package/out/command-line/view/version-view.js
+++ package/out/command-line/view/version-view.js
@@ -1,10 +1,121 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
-exports.VersionView = void 0;
+exports.VersionView = exports.getDetailsTable = void 0;
const tslib_1 = require("tslib");
const cli_shared_1 = require("@forge/cli-shared");
const chalk_1 = tslib_1.__importDefault(require("chalk"));
+const getDetailsTable = ({ formatKeyValueList, formatYamlProperties }, details) => {
+ const deploymentDate = (date) => `${date.toISOString()}`;
+ const scopes = (scopes) => `${(0, cli_shared_1.itemList)(scopes, '')}`;
+ const egress = (egresses) => {
+ const egressItems = egresses.map((egress) => ({
+ key: egress.type,
+ value: (0, cli_shared_1.itemList)(egress.addresses, ' ')
+ }));
+ return formatKeyValueList(egressItems, '', true);
+ };
+ const securityPolicies = (policies) => {
+ const policyItems = policies.map((policy) => ({
+ key: policy.type,
+ value: policy.policies.join(', ')
+ }));
+ return formatKeyValueList(policyItems);
+ };
+ const connectKeys = (keys) => {
+ const keyItems = keys.map((key) => ({
+ key: key.product,
+ value: key.key
+ }));
+ return formatKeyValueList(keyItems, '');
+ };
+ const functions = (functions) => {
+ const functionItems = functions.map((func) => {
+ const properties = {
+ runtime: func.runtimeName,
+ handler: func.handler
+ };
+ return formatYamlProperties(properties, func.key);
+ });
+ return (0, cli_shared_1.itemList)(functionItems, '');
+ };
+ const modules = (modules) => {
+ return modules
+ .map((mod) => {
+ const items = mod.items.map((item) => formatYamlProperties(item.properties, item.key));
+ return `${chalk_1.default.bold(mod.type)}\n${(0, cli_shared_1.itemList)(items, '')}`;
+ })
+ .join('\n');
+ };
+ const remotes = (remotes) => {
+ const remoteItems = remotes.map((remote) => {
+ const properties = {
+ baseUrl: remote.baseUrl,
+ operations: remote.operations
+ };
+ return formatYamlProperties(properties, remote.key);
+ });
+ return (0, cli_shared_1.itemList)(remoteItems, '');
+ };
+ const tableData = [
+ {
+ entry: 'deployment date',
+ detailsFn: deploymentDate,
+ property: 'deploymentDateTime'
+ },
+ {
+ entry: 'functions',
+ detailsFn: functions,
+ property: 'functions'
+ },
+ {
+ entry: 'modules',
+ detailsFn: modules,
+ property: 'modules'
+ },
+ {
+ entry: 'license',
+ detailsFn: cli_shared_1.Text.version.check.details.license,
+ property: 'requiresLicense'
+ },
+ {
+ entry: 'scopes',
+ detailsFn: scopes,
+ property: 'scopes'
+ },
+ {
+ entry: 'egress',
+ detailsFn: egress,
+ property: 'egresses'
+ },
+ {
+ entry: 'policies',
+ detailsFn: securityPolicies,
+ property: 'policies'
+ },
+ {
+ entry: 'connect keys',
+ detailsFn: connectKeys,
+ property: 'connectKeys'
+ },
+ {
+ entry: 'remotes',
+ detailsFn: remotes,
+ property: 'remotes'
+ }
+ ];
+ return tableData
+ .filter(({ property }) => details[property] !== undefined)
+ .map(({ entry, detailsFn, property }) => ({
+ entry,
+ details: detailsFn(details[property]),
+ property
+ }));
+};
+exports.getDetailsTable = getDetailsTable;
+const getPropertySummary = (property) => {
+ return property.map((item) => `${item.type}: ${item.count}`).join('\n');
+};
class VersionView {
ui;
constructor(ui) {
this.ui = ui;
@@ -66,67 +177,13 @@
this.ui.info(cli_shared_1.Text.version.check.details.banner(envKey, envType, appVersion));
this.ui.emptyLine();
}
displayDetailsAsTable(details) {
- const tableData = [
- {
- entry: 'deployment date',
- detailsFn: cli_shared_1.Text.version.check.details.deploymentDate,
- property: 'deploymentDateTime'
- },
- {
- entry: 'functions',
- detailsFn: cli_shared_1.Text.version.check.details.functions,
- property: 'functions'
- },
- {
- entry: 'modules',
- detailsFn: cli_shared_1.Text.version.check.details.modules,
- property: 'modules'
- },
- {
- entry: 'license',
- detailsFn: cli_shared_1.Text.version.check.details.license,
- property: 'requiresLicense'
- },
- {
- entry: 'scopes',
- detailsFn: cli_shared_1.Text.version.check.details.scopes,
- property: 'scopes'
- },
- {
- entry: 'egress',
- detailsFn: cli_shared_1.Text.version.check.details.egress,
- property: 'egresses'
- },
- {
- entry: 'policies',
- detailsFn: cli_shared_1.Text.version.check.details.securityPolicies,
- property: 'policies'
- },
- {
- entry: 'connect keys',
- detailsFn: cli_shared_1.Text.version.check.details.connectKeys,
- property: 'connectKeys'
- },
- {
- entry: 'remotes',
- detailsFn: cli_shared_1.Text.version.check.details.remotes,
- property: 'remotes'
- }
- ];
- const filteredData = [...tableData]
- .sort((a, b) => a.entry.localeCompare(b.entry))
- .filter(({ property }) => details[property] !== undefined)
- .map(({ entry, detailsFn, property }) => ({
- entry,
- details: detailsFn(details[property]),
- property
- }));
+ const tableData = [...(0, exports.getDetailsTable)(this.ui, details)].sort((a, b) => a.entry.localeCompare(b.entry));
this.ui.table([
['entry', 'Property'],
['details', 'Details']
- ], filteredData);
+ ], tableData);
}
displayDataInJson(data) {
this.ui.info(JSON.stringify(data, null, 2));
}
@@ -187,12 +244,12 @@
['requiresLicense', 'License']
], data.map(({ version, egresses, modules, policies, deploymentDateTime, ...rest }) => ({
...rest,
version: version.toString(),
- deploymentDate: cli_shared_1.Text.version.list.details.deploymentDate(deploymentDateTime),
- egresses: cli_shared_1.Text.version.list.details.egresses(egresses),
- policies: cli_shared_1.Text.version.list.details.policies(policies),
- modules: cli_shared_1.Text.version.list.details.modules(modules)
+ deploymentDate: deploymentDateTime.toISOString(),
+ egresses: getPropertySummary(egresses),
+ policies: getPropertySummary(policies),
+ modules: getPropertySummary(modules)
})));
}
}
exports.VersionView = VersionView;
Modified: package/npm-shrinkwrap.json
Large diffs are not rendered by default.
Modified: package/package.json
Index: package/package.json
===================================================================
--- package/package.json
+++ package/package.json
@@ -1,7 +1,7 @@
{
"name": "@forge/cli",
- "version": "11.3.0-next.4-experimental-e92a337",
+ "version": "11.3.0-next.5",
"description": "A command line interface for managing Atlassian-hosted apps",
"author": "Atlassian",
"license": "SEE LICENSE IN LICENSE.txt",
"bin": {
@@ -17,15 +17,15 @@
"postbuild": "chmod +x out/bin/*.js && ts-node scripts/configureAutocomplete.ts",
"postinstall": "node -e \"fs.existsSync('./out/bin/postinstall.js') && require('./out/bin/postinstall.js')\""
},
"dependencies": {
- "@forge/bundler": "4.21.1-next.4-experimental-e92a337",
- "@forge/cli-shared": "6.8.0-next.4-experimental-e92a337",
+ "@forge/bundler": "4.21.1-next.5",
+ "@forge/cli-shared": "6.8.0-next.5",
"@forge/egress": "1.4.0",
- "@forge/lint": "5.7.3-next.4-experimental-e92a337",
- "@forge/manifest": "8.9.0-next.1-experimental-e92a337",
+ "@forge/lint": "5.7.3-next.5",
+ "@forge/manifest": "8.9.0-next.1",
"@forge/runtime": "5.10.7",
- "@forge/tunnel": "5.10.1-next.4-experimental-e92a337",
+ "@forge/tunnel": "5.10.1-next.5",
"@forge/util": "1.4.8",
"@sentry/node": "7.106.0",
"@forge/i18n": "0.0.4",
"ajv": "^8.12.0",
Modified: package/out/command-line/view/version-view.d.ts.map
Index: package/out/command-line/view/version-view.d.ts.map
===================================================================
--- package/out/command-line/view/version-view.d.ts.map
+++ package/out/command-line/view/version-view.d.ts.map
@@ -1,1 +1,1 @@
-{"version":3,"file":"version-view.d.ts","sourceRoot":"","sources":["../../../src/command-line/view/version-view.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAQ,EAAE,EAAE,MAAM,mBAAmB,CAAC;AACjE,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,+BAA+B,CAAC;AAChF,OAAO,EAAE,MAAM,EAAE,MAAM,MAAM,CAAC;AAG9B,qBAAa,WAAW;IACV,OAAO,CAAC,QAAQ,CAAC,EAAE;gBAAF,EAAE,EAAE,EAAE;IAEtB,sBAAsB,CAAC,QAAQ,EAAE,MAAM,OAAO,CAAC,cAAc,CAAC,GAAG,OAAO,CAAC,cAAc,CAAC;IAIxF,mBAAmB,CAAC,QAAQ,EAAE,MAAM,OAAO,CAAC,cAAc,EAAE,CAAC,GAAG,OAAO,CAAC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AMtF,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,IAAI;IAIzC,kBAAkB,CAAC,IAAI,EAAE,eAAe,EAAE,GAAG,IAAI;CAwBzD"}
\ No newline at end of file
Modified: package/CHANGELOG.md
Large diffs are not rendered by default.
Modified: package/out/command-line/view/version-view.d.ts
Index: package/out/command-line/view/version-view.d.ts
===================================================================
--- package/out/command-line/view/version-view.d.ts
+++ package/out/command-line/view/version-view.d.ts
@@ -1,7 +1,12 @@
import { AppEnvironmentType, UI } from '@forge/cli-shared';
import { VersionDetails, VersionOverview } from '../../service/version-service';
import { Change } from 'diff';
+export declare const getDetailsTable: ({ formatKeyValueList, formatYamlProperties }: UI, details: Partial<VersionDetails>) => {
+ entry: string;
+ details: string;
+ property: keyof VersionDetails;
+}[];
export declare class VersionView {
private readonly ui;
constructor(ui: UI);
displayDetailsProgress(progress: () => Promise<VersionDetails>): Promise<VersionDetails>;