@forge/bridge 5.8.0-next.4-experimental-4cf7fd3 → 5.8.0-next.6
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 -8
- package/out/index.d.ts +2 -0
- package/out/index.d.ts.map +1 -1
- package/out/index.js +2 -0
- package/out/object-store/{delete.d.ts → deleteObjects.d.ts} +1 -1
- package/out/object-store/deleteObjects.d.ts.map +1 -0
- package/out/object-store/index.d.ts +2 -0
- package/out/object-store/index.d.ts.map +1 -0
- package/out/object-store/index.js +4 -0
- package/out/object-store/objectStore.d.ts +19 -0
- package/out/object-store/objectStore.d.ts.map +1 -0
- package/out/object-store/objectStore.js +13 -0
- package/out/object-store/upload.d.ts.map +1 -1
- package/out/object-store/upload.js +3 -3
- 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 +42 -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 +19 -0
- package/out/rovo/types.d.ts.map +1 -0
- package/out/rovo/types.js +2 -0
- package/package.json +2 -2
- package/out/object-store/delete.d.ts.map +0 -1
- /package/out/object-store/{delete.js → deleteObjects.js} +0 -0
package/CHANGELOG.md
CHANGED
|
@@ -1,18 +1,16 @@
|
|
|
1
1
|
# @forge/bridge
|
|
2
2
|
|
|
3
|
-
## 5.8.0-next.
|
|
3
|
+
## 5.8.0-next.6
|
|
4
4
|
|
|
5
5
|
### Minor Changes
|
|
6
6
|
|
|
7
|
-
-
|
|
7
|
+
- a4bccb7: Export FOS bridge methods and fixing bugs
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
## 5.8.0-next.5
|
|
10
10
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
-
|
|
14
|
-
- Updated dependencies [78efec7]
|
|
15
|
-
- @forge/manifest@11.0.0-next.3-experimental-4cf7fd3
|
|
11
|
+
### Minor Changes
|
|
12
|
+
|
|
13
|
+
- 08fbb0a: Add rovo.open bridge method that opens rovo chat
|
|
16
14
|
|
|
17
15
|
## 5.8.0-next.4
|
|
18
16
|
|
package/out/index.d.ts
CHANGED
|
@@ -8,7 +8,9 @@ export * from './fetch';
|
|
|
8
8
|
export * from './flag';
|
|
9
9
|
export * from './events';
|
|
10
10
|
export * from './realtime';
|
|
11
|
+
export * from './rovo';
|
|
11
12
|
export * as i18n from './i18n';
|
|
13
|
+
export * from './object-store';
|
|
12
14
|
export { type FullContext } from './types';
|
|
13
15
|
export * from './featureFlags';
|
|
14
16
|
//# sourceMappingURL=index.d.ts.map
|
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,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,5 +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"));
|
|
18
|
+
tslib_1.__exportStar(require("./object-store"), exports);
|
|
17
19
|
tslib_1.__exportStar(require("./featureFlags"), exports);
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteObjects.d.ts","sourceRoot":"","sources":["../../src/object-store/deleteObjects.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,aAAa;iBAAgD,MAAM;UAAQ,MAAM,EAAE;MAAK,QAAQ,IAAI,CAchH,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/object-store/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
export declare const objectStore: {
|
|
2
|
+
upload: ({ functionKey, objects }: {
|
|
3
|
+
functionKey: string;
|
|
4
|
+
objects: Blob[];
|
|
5
|
+
}) => Promise<import("./types").UploadResult[]>;
|
|
6
|
+
download: ({ functionKey, keys }: {
|
|
7
|
+
functionKey: string;
|
|
8
|
+
keys: string[];
|
|
9
|
+
}) => Promise<import("./types").DownloadResult[]>;
|
|
10
|
+
getMetadata: ({ functionKey, keys }: {
|
|
11
|
+
functionKey: string;
|
|
12
|
+
keys: string[];
|
|
13
|
+
}) => Promise<import("./types").GetMetadataResult[]>;
|
|
14
|
+
deleteObjects: ({ functionKey, keys }: {
|
|
15
|
+
functionKey: string;
|
|
16
|
+
keys: string[];
|
|
17
|
+
}) => Promise<void>;
|
|
18
|
+
};
|
|
19
|
+
//# sourceMappingURL=objectStore.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"objectStore.d.ts","sourceRoot":"","sources":["../../src/object-store/objectStore.ts"],"names":[],"mappings":"AAKA,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;CAKvB,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.objectStore = void 0;
|
|
4
|
+
const upload_1 = require("./upload");
|
|
5
|
+
const deleteObjects_1 = require("./deleteObjects");
|
|
6
|
+
const download_1 = require("./download");
|
|
7
|
+
const getMetadata_1 = require("./getMetadata");
|
|
8
|
+
exports.objectStore = {
|
|
9
|
+
upload: upload_1.upload,
|
|
10
|
+
download: download_1.download,
|
|
11
|
+
getMetadata: getMetadata_1.getMetadata,
|
|
12
|
+
deleteObjects: deleteObjects_1.deleteObjects
|
|
13
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/object-store/upload.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAuC,YAAY,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/object-store/upload.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAuC,YAAY,EAAE,MAAM,SAAS,CAAC;AA+BjF,eAAO,MAAM,MAAM;iBAIJ,MAAM;aACV,IAAI,EAAE;MACb,QAAQ,YAAY,EAAE,CAkEzB,CAAC"}
|
|
@@ -7,9 +7,9 @@ const getObjectMetadata = async (blob) => {
|
|
|
7
7
|
const length = blob.size;
|
|
8
8
|
const arrayBuffer = await blob.arrayBuffer();
|
|
9
9
|
const hashBuffer = await crypto.subtle.digest('SHA-256', arrayBuffer);
|
|
10
|
-
const hashArray =
|
|
11
|
-
const checksum =
|
|
12
|
-
const checksumType = '
|
|
10
|
+
const hashArray = new Uint8Array(hashBuffer);
|
|
11
|
+
const checksum = btoa(String.fromCharCode(...hashArray));
|
|
12
|
+
const checksumType = 'SHA256';
|
|
13
13
|
return {
|
|
14
14
|
length,
|
|
15
15
|
checksum,
|
|
@@ -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;AA6BvP,eAAO,MAAM,IAAI,oBAA2B,eAAe,kBAiB1D,CAAC"}
|
package/out/rovo/open.js
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
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
|
+
agentAppId: openRovoPayload.agentAppId,
|
|
16
|
+
prompt: openRovoPayload.prompt
|
|
17
|
+
};
|
|
18
|
+
case 'atlassian':
|
|
19
|
+
return {
|
|
20
|
+
agentName: openRovoPayload.agentName,
|
|
21
|
+
prompt: openRovoPayload.prompt
|
|
22
|
+
};
|
|
23
|
+
default:
|
|
24
|
+
return { prompt: openRovoPayload.prompt };
|
|
25
|
+
}
|
|
26
|
+
};
|
|
27
|
+
const open = async (openRovoPayload) => {
|
|
28
|
+
if (openRovoPayload.type === 'forge') {
|
|
29
|
+
if (openRovoPayload.agentName.length > MAX_AGENT_LENGTH) {
|
|
30
|
+
throw new Error('rovo agent name too long');
|
|
31
|
+
}
|
|
32
|
+
if (openRovoPayload.agentKey.length > MAX_AGENT_LENGTH) {
|
|
33
|
+
throw new Error('rovo agent key too long');
|
|
34
|
+
}
|
|
35
|
+
}
|
|
36
|
+
const rovoArgs = transformRovoPayload(openRovoPayload);
|
|
37
|
+
const success = await callBridge('openRovo', rovoArgs);
|
|
38
|
+
if (success === false) {
|
|
39
|
+
throw new errors_1.BridgeAPIError(exports.OPEN_ROVO_BRIDGE_ERROR_MESSAGE);
|
|
40
|
+
}
|
|
41
|
+
};
|
|
42
|
+
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,19 @@
|
|
|
1
|
+
declare type ForgeAgentPayload = {
|
|
2
|
+
type: 'forge';
|
|
3
|
+
agentAppId: string;
|
|
4
|
+
agentKey: string;
|
|
5
|
+
agentName: string;
|
|
6
|
+
prompt?: string;
|
|
7
|
+
};
|
|
8
|
+
declare type AtlassianAgentPayload = {
|
|
9
|
+
type: 'atlassian';
|
|
10
|
+
agentName: string;
|
|
11
|
+
prompt?: string;
|
|
12
|
+
};
|
|
13
|
+
declare type DefaultAgentPayload = {
|
|
14
|
+
type: 'default';
|
|
15
|
+
prompt?: string;
|
|
16
|
+
};
|
|
17
|
+
export declare type OpenRovoPayload = ForgeAgentPayload | AtlassianAgentPayload | DefaultAgentPayload;
|
|
18
|
+
export {};
|
|
19
|
+
//# 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,UAAU,EAAE,MAAM,CAAC;IACnB,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"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/bridge",
|
|
3
|
-
"version": "5.8.0-next.
|
|
3
|
+
"version": "5.8.0-next.6",
|
|
4
4
|
"description": "Forge bridge API for custom UI apps",
|
|
5
5
|
"author": "Atlassian",
|
|
6
6
|
"license": "SEE LICENSE IN LICENSE.txt",
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
"@forge/resolver": "1.7.1",
|
|
19
19
|
"@statsig/js-client": "3.18.2",
|
|
20
20
|
"@types/history": "^4.7.11",
|
|
21
|
-
"@forge/manifest": "11.0.0-next.3
|
|
21
|
+
"@forge/manifest": "11.0.0-next.3"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"history": "5.3.0",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"delete.d.ts","sourceRoot":"","sources":["../../src/object-store/delete.ts"],"names":[],"mappings":"AAWA,eAAO,MAAM,aAAa;iBAAgD,MAAM;UAAQ,MAAM,EAAE;MAAK,QAAQ,IAAI,CAchH,CAAC"}
|
|
File without changes
|