@forge/bridge 5.9.0-next.7 → 5.9.0-next.8
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 +6 -0
- package/out/index.d.ts +1 -0
- package/out/index.d.ts.map +1 -1
- package/out/index.js +1 -0
- package/out/rovo/index.d.ts +2 -0
- package/out/rovo/index.d.ts.map +1 -0
- package/out/rovo/index.js +4 -0
- package/out/rovo/open.d.ts +4 -0
- package/out/rovo/open.d.ts.map +1 -0
- package/out/rovo/open.js +41 -0
- package/out/rovo/rovo.d.ts +4 -0
- package/out/rovo/rovo.d.ts.map +1 -0
- package/out/rovo/rovo.js +7 -0
- package/out/rovo/types.d.ts +18 -0
- package/out/rovo/types.d.ts.map +1 -0
- package/out/rovo/types.js +2 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/out/index.d.ts
CHANGED
package/out/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,cAAc,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,gBAAgB,EAAE,MAAM,kBAAkB,CAAC;AAEpD,cAAc,UAAU,CAAC;AACzB,cAAc,mBAAmB,CAAC;AAClC,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,SAAS,CAAC;AACxB,cAAc,SAAS,CAAC;AACxB,cAAc,QAAQ,CAAC;AACvB,cAAc,UAAU,CAAC;AACzB,cAAc,YAAY,CAAC;AAC3B,cAAc,QAAQ,CAAC;AACvB,OAAO,KAAK,IAAI,MAAM,QAAQ,CAAC;AAC/B,cAAc,gBAAgB,CAAC;AAC/B,OAAO,EAAE,KAAK,WAAW,EAAE,MAAM,SAAS,CAAC;AAC3C,cAAc,gBAAgB,CAAC"}
|
package/out/index.js
CHANGED
|
@@ -13,6 +13,7 @@ tslib_1.__exportStar(require("./fetch"), exports);
|
|
|
13
13
|
tslib_1.__exportStar(require("./flag"), exports);
|
|
14
14
|
tslib_1.__exportStar(require("./events"), exports);
|
|
15
15
|
tslib_1.__exportStar(require("./realtime"), exports);
|
|
16
|
+
tslib_1.__exportStar(require("./rovo"), exports);
|
|
16
17
|
exports.i18n = tslib_1.__importStar(require("./i18n"));
|
|
17
18
|
tslib_1.__exportStar(require("./object-store"), exports);
|
|
18
19
|
tslib_1.__exportStar(require("./featureFlags"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rovo/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
|
@@ -0,0 +1,4 @@
|
|
|
1
|
+
import { OpenRovoPayload } from './types';
|
|
2
|
+
export declare const OPEN_ROVO_BRIDGE_ERROR_MESSAGE = "Unable to open Rovo Chat due to usage in an unsupported product. Only Confluence, Jira and some Jira Service Management modules are supported at this point. See https://developer.atlassian.com/platform/forge/apis-reference/ui-api-bridge/rovo/";
|
|
3
|
+
export declare const open: (openRovoPayload: OpenRovoPayload) => Promise<void>;
|
|
4
|
+
//# sourceMappingURL=open.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"open.d.ts","sourceRoot":"","sources":["../../src/rovo/open.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,eAAe,EAAE,MAAM,SAAS,CAAC;AAO1C,eAAO,MAAM,8BAA8B,uPAC2M,CAAC;AA4BvP,eAAO,MAAM,IAAI,oBAA2B,eAAe,kBAiB1D,CAAC"}
|
package/out/rovo/open.js
ADDED
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.open = exports.OPEN_ROVO_BRIDGE_ERROR_MESSAGE = void 0;
|
|
4
|
+
const bridge_1 = require("../bridge");
|
|
5
|
+
const errors_1 = require("../errors");
|
|
6
|
+
const MAX_AGENT_LENGTH = 30;
|
|
7
|
+
const callBridge = (0, bridge_1.getCallBridge)();
|
|
8
|
+
exports.OPEN_ROVO_BRIDGE_ERROR_MESSAGE = 'Unable to open Rovo Chat due to usage in an unsupported product. Only Confluence, Jira and some Jira Service Management modules are supported at this point. See https://developer.atlassian.com/platform/forge/apis-reference/ui-api-bridge/rovo/';
|
|
9
|
+
const transformRovoPayload = (openRovoPayload) => {
|
|
10
|
+
switch (openRovoPayload.type) {
|
|
11
|
+
case 'forge':
|
|
12
|
+
return {
|
|
13
|
+
agentName: openRovoPayload.agentName,
|
|
14
|
+
agentKey: openRovoPayload.agentKey,
|
|
15
|
+
prompt: openRovoPayload.prompt
|
|
16
|
+
};
|
|
17
|
+
case 'atlassian':
|
|
18
|
+
return {
|
|
19
|
+
agentName: openRovoPayload.agentName,
|
|
20
|
+
prompt: openRovoPayload.prompt
|
|
21
|
+
};
|
|
22
|
+
default:
|
|
23
|
+
return { prompt: openRovoPayload.prompt };
|
|
24
|
+
}
|
|
25
|
+
};
|
|
26
|
+
const open = async (openRovoPayload) => {
|
|
27
|
+
if (openRovoPayload.type === 'forge') {
|
|
28
|
+
if (openRovoPayload.agentName.length > MAX_AGENT_LENGTH) {
|
|
29
|
+
throw new Error('rovo agent name too long');
|
|
30
|
+
}
|
|
31
|
+
if (openRovoPayload.agentKey.length > MAX_AGENT_LENGTH) {
|
|
32
|
+
throw new Error('rovo agent key too long');
|
|
33
|
+
}
|
|
34
|
+
}
|
|
35
|
+
const rovoArgs = transformRovoPayload(openRovoPayload);
|
|
36
|
+
const success = await callBridge('openRovo', rovoArgs);
|
|
37
|
+
if (success === false) {
|
|
38
|
+
throw new errors_1.BridgeAPIError(exports.OPEN_ROVO_BRIDGE_ERROR_MESSAGE);
|
|
39
|
+
}
|
|
40
|
+
};
|
|
41
|
+
exports.open = open;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"rovo.d.ts","sourceRoot":"","sources":["../../src/rovo/rovo.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,IAAI;;CAEhB,CAAC"}
|
package/out/rovo/rovo.js
ADDED
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
declare type ForgeAgentPayload = {
|
|
2
|
+
type: 'forge';
|
|
3
|
+
agentKey: string;
|
|
4
|
+
agentName: string;
|
|
5
|
+
prompt?: string;
|
|
6
|
+
};
|
|
7
|
+
declare type AtlassianAgentPayload = {
|
|
8
|
+
type: 'atlassian';
|
|
9
|
+
agentName: string;
|
|
10
|
+
prompt?: string;
|
|
11
|
+
};
|
|
12
|
+
declare type DefaultAgentPayload = {
|
|
13
|
+
type: 'default';
|
|
14
|
+
prompt?: string;
|
|
15
|
+
};
|
|
16
|
+
export declare type OpenRovoPayload = ForgeAgentPayload | AtlassianAgentPayload | DefaultAgentPayload;
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/rovo/types.ts"],"names":[],"mappings":"AAAA,aAAK,iBAAiB,GAAG;IACvB,IAAI,EAAE,OAAO,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,aAAK,qBAAqB,GAAG;IAC3B,IAAI,EAAE,WAAW,CAAC;IAClB,SAAS,EAAE,MAAM,CAAC;IAClB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,aAAK,mBAAmB,GAAG;IACzB,IAAI,EAAE,SAAS,CAAC;IAChB,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB,CAAC;AAEF,oBAAY,eAAe,GAAG,iBAAiB,GAAG,qBAAqB,GAAG,mBAAmB,CAAC"}
|