npm package diff
Package: @forge/jira-bridge
Versions: 0.34.1-next.0 - 0.34.1-next.1
File: 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;