npm package diff
Package: @forge/jira-bridge
Versions: 0.34.1-next.0 - 0.34.1-next.1
Modified:package/out/ui-modifications/apiBuilder.js
Index: package/out/ui-modifications/apiBuilder.js
===================================================================
--- package/out/ui-modifications/apiBuilder.js
+++ package/out/ui-modifications/apiBuilder.js
@@ -25,16 +25,20 @@
});
}
};
if ((_a = this.featureFlags) === null || _a === void 0 ? void 0 : _a[featureFlags_1.SCREEN_TABS_SUPPORT]) {
- return Object.assign(Object.assign({}, fieldApi), { getScreenTabById: (screenTabId) => {
+ return {
+ ...fieldApi,
+ getScreenTabById: (screenTabId) => {
const screenTab = this.screenTabsData.find((tab) => tab.id === screenTabId);
if (screenTab) {
return this.buildScreenTab(screenTab, this.screenTabsData, this.buffer);
}
- }, getScreenTabs: () => {
+ },
+ getScreenTabs: () => {
return this.screenTabsData.map((tab) => this.buildScreenTab(tab, this.screenTabsData, this.buffer));
- } });
+ }
+ };
}
return fieldApi;
}
buildField(fieldId, formData, buffer) {
Modified:package/out/ui-modifications/changesBuffer.js
Index: package/out/ui-modifications/changesBuffer.js
===================================================================
--- package/out/ui-modifications/changesBuffer.js
+++ package/out/ui-modifications/changesBuffer.js
@@ -12,9 +12,12 @@
getScreenTabsChanges() {
return this.screenTabsBuffer;
}
updateFieldProperty(fieldId, property, value) {
- this.formBuffer[fieldId] = Object.assign(Object.assign({}, this.formBuffer[fieldId]), { [property]: value });
+ this.formBuffer[fieldId] = {
+ ...this.formBuffer[fieldId],
+ [property]: value
+ };
}
updateScreenTabProperty(screenTabsData, tabId, property, value) {
const currentChanges = this.screenTabsBuffer.find((tab) => tab.id === tabId);
if (currentChanges) {
Modified:package/out/ui-modifications/getInternalAPI.js
Index: package/out/ui-modifications/getInternalAPI.js
===================================================================
--- package/out/ui-modifications/getInternalAPI.js
+++ package/out/ui-modifications/getInternalAPI.js
@@ -1,30 +1,27 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.getInternalAPI = void 0;
-const tslib_1 = require("tslib");
const errors_1 = require("../errors");
const bridge_1 = require("../bridge");
const callBridge = (0, bridge_1.getCallBridge)();
-function getInternalAPI() {
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
- let logError;
- try {
- const internalAPI = yield callBridge('getUiModificationsInternalAPI');
- const { actions: { getOnInitData, submit, registerFields, subscribeToChanges, onBridgeError }, data: { uiModifications, onInitChangeId } } = internalAPI;
- logError = onBridgeError;
- if (!getOnInitData || !submit || !registerFields || !uiModifications || !onInitChangeId) {
- throw new Error('onInit could not be started');
- }
- if (!subscribeToChanges) {
- throw new Error('onChange could not be started');
- }
- return internalAPI;
+async function getInternalAPI() {
+ let logError;
+ try {
+ const internalAPI = await callBridge('getUiModificationsInternalAPI');
+ const { actions: { getOnInitData, submit, registerFields, subscribeToChanges, onBridgeError }, data: { uiModifications, onInitChangeId } } = internalAPI;
+ logError = onBridgeError;
+ if (!getOnInitData || !submit || !registerFields || !uiModifications || !onInitChangeId) {
+ throw new Error('onInit could not be started');
}
- catch (err) {
- if (logError)
- logError({ error: errors_1.GET_API_ERROR });
- throw new errors_1.BridgeAPIError('Unable to initialize UI modifications module: ' + err.message);
+ if (!subscribeToChanges) {
+ throw new Error('onChange could not be started');
}
- });
+ return internalAPI;
+ }
+ catch (err) {
+ if (logError)
+ logError({ error: errors_1.GET_API_ERROR });
+ throw new errors_1.BridgeAPIError('Unable to initialize UI modifications module: ' + err.message);
+ }
}
exports.getInternalAPI = getInternalAPI;
Modified:package/out/modal/issue-create.js
Index: package/out/modal/issue-create.js
===================================================================
--- package/out/modal/issue-create.js
+++ package/out/modal/issue-create.js
@@ -1,8 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.CreateIssueModal = void 0;
-const tslib_1 = require("tslib");
const bridge_1 = require("../bridge");
const errors_1 = require("../errors");
const noop = () => { };
const callBridge = (0, bridge_1.getCallBridge)();
@@ -10,24 +9,22 @@
constructor(opts) {
this.onClose = (opts === null || opts === void 0 ? void 0 : opts.onClose) || noop;
this.context = (opts === null || opts === void 0 ? void 0 : opts.context) || {};
}
- open() {
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
- try {
- const success = yield callBridge('openIssueCreateModal', {
- data: {
- onClose: this.onClose,
- context: this.context
- }
- });
- if (success === false) {
- throw new errors_1.BridgeAPIError('Unable to open issue create modal.');
+ async open() {
+ try {
+ const success = await callBridge('openIssueCreateModal', {
+ data: {
+ onClose: this.onClose,
+ context: this.context
}
- }
- catch (err) {
+ });
+ if (success === false) {
throw new errors_1.BridgeAPIError('Unable to open issue create modal.');
}
- });
+ }
+ catch (err) {
+ throw new errors_1.BridgeAPIError('Unable to open issue create modal.');
+ }
}
}
exports.CreateIssueModal = CreateIssueModal;
Modified:package/out/modal/issue-view.js
Index: package/out/modal/issue-view.js
===================================================================
--- package/out/modal/issue-view.js
+++ package/out/modal/issue-view.js
@@ -1,8 +1,7 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.ViewIssueModal = void 0;
-const tslib_1 = require("tslib");
const bridge_1 = require("../bridge");
const errors_1 = require("../errors");
const noop = () => { };
const callBridge = (0, bridge_1.getCallBridge)();
@@ -14,24 +13,22 @@
}
this.onClose = onClose;
this.context = context;
}
- open() {
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
- try {
- const success = yield callBridge('openIssueViewModal', {
- data: {
- onClose: this.onClose,
- context: this.context
- }
- });
- if (success === false) {
- throw new errors_1.BridgeAPIError('Unable to open issue view modal.');
+ async open() {
+ try {
+ const success = await callBridge('openIssueViewModal', {
+ data: {
+ onClose: this.onClose,
+ context: this.context
}
- }
- catch (err) {
+ });
+ if (success === false) {
throw new errors_1.BridgeAPIError('Unable to open issue view modal.');
}
- });
+ }
+ catch (err) {
+ throw new errors_1.BridgeAPIError('Unable to open issue view modal.');
+ }
}
}
exports.ViewIssueModal = ViewIssueModal;
Modified:package/out/ui-modifications/onChange.js
Index: package/out/ui-modifications/onChange.js
===================================================================
--- package/out/ui-modifications/onChange.js
+++ package/out/ui-modifications/onChange.js
@@ -1,56 +1,53 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.onChange = void 0;
-const tslib_1 = require("tslib");
const apiBuilder_1 = require("./apiBuilder");
const featureFlags_1 = require("./featureFlags");
const getInternalAPI_1 = require("./getInternalAPI");
const errors_1 = require("../errors");
-function onChange(onChangeCallback, registerOnChangeFieldsCallback) {
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
- const { data: { featureFlags }, actions: { submit, registerFields, subscribeToChanges, onBridgeError } } = yield (0, getInternalAPI_1.getInternalAPI)();
- return subscribeToChanges(({ changedFieldId, changeId, currentFormState, currentScreenTabsState = [], uiModifications }) => tslib_1.__awaiter(this, void 0, void 0, function* () {
+async function onChange(onChangeCallback, registerOnChangeFieldsCallback) {
+ const { data: { featureFlags }, actions: { submit, registerFields, subscribeToChanges, onBridgeError } } = await (0, getInternalAPI_1.getInternalAPI)();
+ return subscribeToChanges(async ({ changedFieldId, changeId, currentFormState, currentScreenTabsState = [], uiModifications }) => {
+ try {
+ const builder = new apiBuilder_1.ApiBuilder(currentFormState, currentScreenTabsState, featureFlags);
+ const api = builder.build();
+ const fieldChange = {
+ current: api.getFieldById(changedFieldId)
+ };
+ let fieldsDeclared;
+ const payload = {
+ fieldsChanges: {},
+ screenTabsChanges: [],
+ changeId
+ };
try {
- const builder = new apiBuilder_1.ApiBuilder(currentFormState, currentScreenTabsState, featureFlags);
- const api = builder.build();
- const fieldChange = {
- current: api.getFieldById(changedFieldId)
- };
- let fieldsDeclared;
- const payload = {
- fieldsChanges: {},
- screenTabsChanges: [],
- changeId
- };
- try {
- fieldsDeclared = registerOnChangeFieldsCallback({ uiModifications, change: fieldChange });
- }
- catch (error) {
- void submit(payload);
- throw new errors_1.AppExecutionError(error);
- }
- void registerFields({ fields: fieldsDeclared, changeId: changeId });
- try {
- yield onChangeCallback({ uiModifications, change: fieldChange, api });
- }
- catch (error) {
- void submit(payload);
- throw new errors_1.AppExecutionError(error);
- }
- const buffer = builder.getBuffer();
- return submit({
- fieldsChanges: buffer.getFormChanges(),
- screenTabsChanges: (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags[featureFlags_1.SCREEN_TABS_SUPPORT]) ? buffer.getScreenTabsChanges() : [],
- changeId
- });
+ fieldsDeclared = registerOnChangeFieldsCallback({ uiModifications, change: fieldChange });
}
catch (error) {
- if (onBridgeError && !(error instanceof errors_1.AppExecutionError)) {
- onBridgeError({ error: errors_1.SUBSCRIBE_TO_CHANGES_ERROR, changeId });
- }
- throw error;
+ void submit(payload);
+ throw new errors_1.AppExecutionError(error);
}
- }));
+ void registerFields({ fields: fieldsDeclared, changeId: changeId });
+ try {
+ await onChangeCallback({ uiModifications, change: fieldChange, api });
+ }
+ catch (error) {
+ void submit(payload);
+ throw new errors_1.AppExecutionError(error);
+ }
+ const buffer = builder.getBuffer();
+ return submit({
+ fieldsChanges: buffer.getFormChanges(),
+ screenTabsChanges: (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags[featureFlags_1.SCREEN_TABS_SUPPORT]) ? buffer.getScreenTabsChanges() : [],
+ changeId
+ });
+ }
+ catch (error) {
+ if (onBridgeError && !(error instanceof errors_1.AppExecutionError)) {
+ onBridgeError({ error: errors_1.SUBSCRIBE_TO_CHANGES_ERROR, changeId });
+ }
+ throw error;
+ }
});
}
exports.onChange = onChange;
Modified:package/out/workflow/onConfigure.js
Index: package/out/workflow/onConfigure.js
===================================================================
--- package/out/workflow/onConfigure.js
+++ package/out/workflow/onConfigure.js
@@ -1,25 +1,22 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.onConfigure = void 0;
-const tslib_1 = require("tslib");
const bridge_1 = require("../bridge");
const errors_1 = require("../errors");
const callBridge = (0, bridge_1.getCallBridge)();
-function onConfigure(onConfigureFn) {
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
- try {
- const success = yield callBridge('setWorkflowRuleConfigurationCallback', {
- data: {
- onConfigure: onConfigureFn
- }
- });
- if (success === false) {
- throw new errors_1.BridgeAPIError('Unable to add workflow rule configuration callback.');
+async function onConfigure(onConfigureFn) {
+ try {
+ const success = await callBridge('setWorkflowRuleConfigurationCallback', {
+ data: {
+ onConfigure: onConfigureFn
}
- }
- catch (err) {
+ });
+ if (success === false) {
throw new errors_1.BridgeAPIError('Unable to add workflow rule configuration callback.');
}
- });
+ }
+ catch (err) {
+ throw new errors_1.BridgeAPIError('Unable to add workflow rule configuration callback.');
+ }
}
exports.onConfigure = onConfigure;
Modified:package/out/ui-modifications/onError.js
Index: package/out/ui-modifications/onError.js
===================================================================
--- package/out/ui-modifications/onError.js
+++ package/out/ui-modifications/onError.js
@@ -1,38 +1,35 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.onError = void 0;
-const tslib_1 = require("tslib");
const getInternalAPI_1 = require("./getInternalAPI");
const errors_1 = require("../errors");
-function onError(errorCallback) {
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
- const { actions: { subscribeToErrors, onBridgeError } } = yield (0, getInternalAPI_1.getInternalAPI)();
- try {
- if (!subscribeToErrors)
- return;
- if (!errorCallback) {
- throw new errors_1.AppExecutionError('errorCallback is required');
- }
- if (typeof errorCallback !== 'function') {
- throw new errors_1.AppExecutionError('errorCallback should be a function');
- }
- return subscribeToErrors(({ errors }) => {
- if (errors === null || errors === void 0 ? void 0 : errors.length) {
- try {
- errorCallback({ errors });
- }
- catch (error) {
- throw new errors_1.AppExecutionError(error);
- }
- }
- });
+async function onError(errorCallback) {
+ const { actions: { subscribeToErrors, onBridgeError } } = await (0, getInternalAPI_1.getInternalAPI)();
+ try {
+ if (!subscribeToErrors)
+ return;
+ if (!errorCallback) {
+ throw new errors_1.AppExecutionError('errorCallback is required');
}
- catch (error) {
- if (onBridgeError && !(error instanceof errors_1.AppExecutionError)) {
- onBridgeError({ error: errors_1.ON_ERROR_ERROR });
+ if (typeof errorCallback !== 'function') {
+ throw new errors_1.AppExecutionError('errorCallback should be a function');
+ }
+ return subscribeToErrors(({ errors }) => {
+ if (errors === null || errors === void 0 ? void 0 : errors.length) {
+ try {
+ errorCallback({ errors });
+ }
+ catch (error) {
+ throw new errors_1.AppExecutionError(error);
+ }
}
- throw error;
+ });
+ }
+ catch (error) {
+ if (onBridgeError && !(error instanceof errors_1.AppExecutionError)) {
+ onBridgeError({ error: errors_1.ON_ERROR_ERROR });
}
- });
+ throw error;
+ }
}
exports.onError = onError;
Modified:package/out/ui-modifications/onInit.js
Index: package/out/ui-modifications/onInit.js
===================================================================
--- package/out/ui-modifications/onInit.js
+++ package/out/ui-modifications/onInit.js
@@ -1,55 +1,52 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.onInit = void 0;
-const tslib_1 = require("tslib");
const apiBuilder_1 = require("./apiBuilder");
const featureFlags_1 = require("./featureFlags");
const getInternalAPI_1 = require("./getInternalAPI");
const errors_1 = require("../errors");
-function onInit(onInitCallback, registerOnInitFieldsCallback) {
- return tslib_1.__awaiter(this, void 0, void 0, function* () {
- const { actions: { getOnInitData, submit, registerFields, onBridgeError }, data: { onInitChangeId: changeId, uiModifications, featureFlags } } = yield (0, getInternalAPI_1.getInternalAPI)();
+async function onInit(onInitCallback, registerOnInitFieldsCallback) {
+ const { actions: { getOnInitData, submit, registerFields, onBridgeError }, data: { onInitChangeId: changeId, uiModifications, featureFlags } } = await (0, getInternalAPI_1.getInternalAPI)();
+ try {
+ let fieldsDeclared;
+ const payload = {
+ fieldsChanges: {},
+ screenTabsChanges: [],
+ changeId
+ };
try {
- let fieldsDeclared;
- const payload = {
+ fieldsDeclared = registerOnInitFieldsCallback({ uiModifications });
+ }
+ catch (error) {
+ void submit({
fieldsChanges: {},
screenTabsChanges: [],
changeId
- };
- try {
- fieldsDeclared = registerOnInitFieldsCallback({ uiModifications });
- }
- catch (error) {
- void submit({
- fieldsChanges: {},
- screenTabsChanges: [],
- changeId
- });
- throw new errors_1.AppExecutionError(error);
- }
- void registerFields({ fields: fieldsDeclared, changeId });
- const { currentFormState, currentScreenTabsState = [] } = yield getOnInitData();
- const builder = new apiBuilder_1.ApiBuilder(currentFormState, currentScreenTabsState, featureFlags);
- try {
- yield onInitCallback({ api: builder.build(), uiModifications });
- }
- catch (error) {
- void submit(payload);
- throw new errors_1.AppExecutionError(error);
- }
- const buffer = builder.getBuffer();
- return submit({
- fieldsChanges: buffer.getFormChanges(),
- screenTabsChanges: (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags[featureFlags_1.SCREEN_TABS_SUPPORT]) ? buffer.getScreenTabsChanges() : [],
- changeId
});
+ throw new errors_1.AppExecutionError(error);
}
+ void registerFields({ fields: fieldsDeclared, changeId });
+ const { currentFormState, currentScreenTabsState = [] } = await getOnInitData();
+ const builder = new apiBuilder_1.ApiBuilder(currentFormState, currentScreenTabsState, featureFlags);
+ try {
+ await onInitCallback({ api: builder.build(), uiModifications });
+ }
catch (error) {
- if (onBridgeError && !(error instanceof errors_1.AppExecutionError)) {
- onBridgeError({ error: errors_1.ON_INIT_ERROR, changeId });
- }
- throw error;
+ void submit(payload);
+ throw new errors_1.AppExecutionError(error);
}
- });
+ const buffer = builder.getBuffer();
+ return submit({
+ fieldsChanges: buffer.getFormChanges(),
+ screenTabsChanges: (featureFlags === null || featureFlags === void 0 ? void 0 : featureFlags[featureFlags_1.SCREEN_TABS_SUPPORT]) ? buffer.getScreenTabsChanges() : [],
+ changeId
+ });
+ }
+ catch (error) {
+ if (onBridgeError && !(error instanceof errors_1.AppExecutionError)) {
+ onBridgeError({ error: errors_1.ON_INIT_ERROR, changeId });
+ }
+ throw error;
+ }
}
exports.onInit = onInit;
Modified:package/out/issue-utils/refresh.js
Index: package/out/issue-utils/refresh.js
===================================================================
--- package/out/issue-utils/refresh.js
+++ package/out/issue-utils/refresh.js
@@ -1,19 +1,18 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.refreshIssueView = void 0;
-const tslib_1 = require("tslib");
const bridge_1 = require("../bridge");
const errors_1 = require("../errors");
const callBridge = (0, bridge_1.getCallBridge)();
-const refreshIssueView = () => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
+const refreshIssueView = async () => {
try {
- const success = yield callBridge('refreshIssueView');
+ const success = await callBridge('refreshIssueView');
if (success === false) {
throw new errors_1.BridgeAPIError('Unable to refresh issue view.');
}
}
catch (err) {
throw new errors_1.BridgeAPIError('Unable to refresh issue view.');
}
-});
+};
exports.refreshIssueView = refreshIssueView;
Modified:package/package.json
Index: package/package.json
===================================================================
--- package/package.json
+++ package/package.json
@@ -1,7 +1,7 @@
{
"name": "@forge/jira-bridge",
- "version": "0.34.1-next.0",
+ "version": "0.34.1-next.1",
"description": "Forge Jira bridge API for custom UI apps",
"author": "Atlassian",
"license": "UNLICENSED",
"browser": "out/index.js",
Modified:package/CHANGELOG.md
Index: package/CHANGELOG.md
===================================================================
--- package/CHANGELOG.md
+++ package/CHANGELOG.md
@@ -1,6 +1,12 @@
# @forge/jira-bridge
+## 0.34.1-next.1
+
+### Patch Changes
+
+- 04ef35e: Upgrade target to ES2018
+
## 0.34.1-next.0
### Patch Changes