@forge/bridge 5.8.0-next.9-experimental-994fcd3 → 5.8.1-next.0
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 +86 -2
- package/out/index.d.ts +0 -1
- package/out/index.d.ts.map +1 -1
- package/out/index.js +0 -1
- package/out/object-store/deleteObjects.d.ts.map +1 -1
- package/out/object-store/deleteObjects.js +5 -0
- package/out/object-store/download.d.ts.map +1 -1
- package/out/object-store/download.js +5 -0
- package/out/object-store/getMetadata.d.ts.map +1 -1
- package/out/object-store/getMetadata.js +7 -2
- package/out/object-store/index.d.ts +1 -0
- package/out/object-store/index.d.ts.map +1 -1
- package/out/object-store/index.js +1 -0
- package/out/object-store/objectStore.d.ts +3 -1
- package/out/object-store/objectStore.d.ts.map +1 -1
- package/out/object-store/objectStore.js +3 -2
- package/out/object-store/types.d.ts +8 -0
- package/out/object-store/types.d.ts.map +1 -1
- package/out/object-store/types.js +2 -0
- package/out/object-store/upload.d.ts +5 -1
- package/out/object-store/upload.d.ts.map +1 -1
- package/out/object-store/upload.js +59 -30
- package/out/object-store/utils.d.ts +2 -0
- package/out/object-store/utils.d.ts.map +1 -0
- package/out/object-store/utils.js +13 -0
- package/package.json +2 -2
- package/out/rovo/index.d.ts +0 -2
- package/out/rovo/index.d.ts.map +0 -1
- package/out/rovo/index.js +0 -4
- package/out/rovo/open.d.ts +0 -4
- package/out/rovo/open.d.ts.map +0 -1
- package/out/rovo/open.js +0 -42
- package/out/rovo/rovo.d.ts +0 -4
- package/out/rovo/rovo.d.ts.map +0 -1
- package/out/rovo/rovo.js +0 -7
- package/out/rovo/types.d.ts +0 -19
- package/out/rovo/types.d.ts.map +0 -1
- package/out/rovo/types.js +0 -2
package/CHANGELOG.md
CHANGED
|
@@ -1,23 +1,107 @@
|
|
|
1
1
|
# @forge/bridge
|
|
2
2
|
|
|
3
|
-
## 5.8.
|
|
3
|
+
## 5.8.1-next.0
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- Updated dependencies [559c541]
|
|
8
|
+
- @forge/manifest@11.0.1-next.0
|
|
9
|
+
|
|
10
|
+
## 5.8.0
|
|
4
11
|
|
|
5
12
|
### Minor Changes
|
|
6
13
|
|
|
7
14
|
- 1d129f0: Allow objects in event payloads. The object must be JSON-serializable.
|
|
8
15
|
- 08fbb0a: Add rovo.open bridge method that opens rovo chat
|
|
9
16
|
- 617c3d9: Add base64 support to upload bridge method
|
|
17
|
+
- f23a84e: Add useObjectStore hook
|
|
10
18
|
- a4bccb7: Export FOS bridge methods and fixing bugs
|
|
11
19
|
|
|
12
20
|
### Patch Changes
|
|
13
21
|
|
|
22
|
+
- bdcb3a4: Optimise OS bridge method metrics
|
|
23
|
+
- 8efef34: track analytics for object store bridge methods
|
|
24
|
+
- fe20eb0: Changing export names
|
|
25
|
+
- 31ea34b: block prod apps from using object store bridge methods
|
|
26
|
+
- 5fe2092: Remove rovo bridge method for now
|
|
27
|
+
- Updated dependencies [0a3f5d5]
|
|
14
28
|
- Updated dependencies [9a6d346]
|
|
15
29
|
- Updated dependencies [260eb24]
|
|
16
30
|
- Updated dependencies [3228cf0]
|
|
31
|
+
- Updated dependencies [88238e7]
|
|
17
32
|
- Updated dependencies [8962080]
|
|
33
|
+
- Updated dependencies [24bd686]
|
|
34
|
+
- Updated dependencies [0c433a0]
|
|
18
35
|
- Updated dependencies [f0a5a03]
|
|
36
|
+
- Updated dependencies [2011ffe]
|
|
37
|
+
- Updated dependencies [d00ef59]
|
|
19
38
|
- Updated dependencies [78efec7]
|
|
20
|
-
- @forge/manifest@11.0.0
|
|
39
|
+
- @forge/manifest@11.0.0
|
|
40
|
+
|
|
41
|
+
## 5.8.0-next.18
|
|
42
|
+
|
|
43
|
+
### Patch Changes
|
|
44
|
+
|
|
45
|
+
- bdcb3a4: Optimise OS bridge method metrics
|
|
46
|
+
|
|
47
|
+
## 5.8.0-next.17
|
|
48
|
+
|
|
49
|
+
### Patch Changes
|
|
50
|
+
|
|
51
|
+
- 8efef34: track analytics for object store bridge methods
|
|
52
|
+
|
|
53
|
+
## 5.8.0-next.16
|
|
54
|
+
|
|
55
|
+
### Patch Changes
|
|
56
|
+
|
|
57
|
+
- Updated dependencies [0c433a0]
|
|
58
|
+
- @forge/manifest@11.0.0-next.10
|
|
59
|
+
|
|
60
|
+
## 5.8.0-next.15
|
|
61
|
+
|
|
62
|
+
### Patch Changes
|
|
63
|
+
|
|
64
|
+
- Updated dependencies [88238e7]
|
|
65
|
+
- @forge/manifest@11.0.0-next.9
|
|
66
|
+
|
|
67
|
+
## 5.8.0-next.14
|
|
68
|
+
|
|
69
|
+
### Patch Changes
|
|
70
|
+
|
|
71
|
+
- 31ea34b: block prod apps from using object store bridge methods
|
|
72
|
+
- 5fe2092: Remove rovo bridge method for now
|
|
73
|
+
|
|
74
|
+
## 5.8.0-next.13
|
|
75
|
+
|
|
76
|
+
### Minor Changes
|
|
77
|
+
|
|
78
|
+
- f23a84e: Add useObjectStore hook
|
|
79
|
+
|
|
80
|
+
### Patch Changes
|
|
81
|
+
|
|
82
|
+
- Updated dependencies [24bd686]
|
|
83
|
+
- Updated dependencies [2011ffe]
|
|
84
|
+
- @forge/manifest@11.0.0-next.8
|
|
85
|
+
|
|
86
|
+
## 5.8.0-next.12
|
|
87
|
+
|
|
88
|
+
### Patch Changes
|
|
89
|
+
|
|
90
|
+
- Updated dependencies [0a3f5d5]
|
|
91
|
+
- @forge/manifest@11.0.0-next.7
|
|
92
|
+
|
|
93
|
+
## 5.8.0-next.11
|
|
94
|
+
|
|
95
|
+
### Patch Changes
|
|
96
|
+
|
|
97
|
+
- fe20eb0: Changing export names
|
|
98
|
+
|
|
99
|
+
## 5.8.0-next.10
|
|
100
|
+
|
|
101
|
+
### Patch Changes
|
|
102
|
+
|
|
103
|
+
- Updated dependencies [d00ef59]
|
|
104
|
+
- @forge/manifest@11.0.0-next.6
|
|
21
105
|
|
|
22
106
|
## 5.8.0-next.9
|
|
23
107
|
|
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,
|
|
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"}
|
package/out/index.js
CHANGED
|
@@ -13,7 +13,6 @@ 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);
|
|
17
16
|
exports.i18n = tslib_1.__importStar(require("./i18n"));
|
|
18
17
|
tslib_1.__exportStar(require("./object-store"), exports);
|
|
19
18
|
tslib_1.__exportStar(require("./featureFlags"), exports);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"deleteObjects.d.ts","sourceRoot":"","sources":["../../src/object-store/deleteObjects.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"deleteObjects.d.ts","sourceRoot":"","sources":["../../src/object-store/deleteObjects.ts"],"names":[],"mappings":"AAeA,eAAO,MAAM,aAAa;iBAAgD,MAAM;UAAQ,MAAM,EAAE;MAAK,QAAQ,IAAI,CAkBhH,CAAC"}
|
|
@@ -3,7 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.deleteObjects = void 0;
|
|
4
4
|
const invoke_1 = require("../invoke");
|
|
5
5
|
const errors_1 = require("../errors");
|
|
6
|
+
const utils_1 = require("./utils");
|
|
7
|
+
const bridge_1 = require("../bridge");
|
|
8
|
+
const callBridge = (0, bridge_1.getCallBridge)();
|
|
6
9
|
const deleteObjects = async ({ functionKey, keys }) => {
|
|
10
|
+
await (0, utils_1.checkRestrictedEnvironment)();
|
|
11
|
+
void callBridge('trackObjectStoreAction', { action: 'delete' });
|
|
7
12
|
if (!functionKey || functionKey.length === 0) {
|
|
8
13
|
throw new errors_1.BridgeAPIError('functionKey is required to delete objects');
|
|
9
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/object-store/download.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAsB,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"download.d.ts","sourceRoot":"","sources":["../../src/object-store/download.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAsB,MAAM,SAAS,CAAC;AAclE,eAAO,MAAM,QAAQ;iBAIN,MAAM;UACb,MAAM,EAAE;MACZ,QAAQ,cAAc,EAAE,CAyD3B,CAAC"}
|
|
@@ -3,7 +3,12 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.download = void 0;
|
|
4
4
|
const invoke_1 = require("../invoke");
|
|
5
5
|
const errors_1 = require("../errors");
|
|
6
|
+
const utils_1 = require("./utils");
|
|
7
|
+
const bridge_1 = require("../bridge");
|
|
8
|
+
const callBridge = (0, bridge_1.getCallBridge)();
|
|
6
9
|
const download = async ({ functionKey, keys }) => {
|
|
10
|
+
await (0, utils_1.checkRestrictedEnvironment)();
|
|
11
|
+
void callBridge('trackObjectStoreAction', { action: 'download' });
|
|
7
12
|
if (!functionKey || functionKey.length === 0) {
|
|
8
13
|
throw new errors_1.BridgeAPIError('functionKey is required to filter and generate download URLs');
|
|
9
14
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"getMetadata.d.ts","sourceRoot":"","sources":["../../src/object-store/getMetadata.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;
|
|
1
|
+
{"version":3,"file":"getMetadata.d.ts","sourceRoot":"","sources":["../../src/object-store/getMetadata.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAcjD,eAAO,MAAM,WAAW;iBAIT,MAAM;UACb,MAAM,EAAE;MACZ,QAAQ,iBAAiB,EAAE,CA6B9B,CAAC"}
|
|
@@ -1,9 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.getMetadata = void 0;
|
|
4
|
-
const
|
|
4
|
+
const index_1 = require("../invoke/index");
|
|
5
5
|
const errors_1 = require("../errors");
|
|
6
|
+
const utils_1 = require("./utils");
|
|
7
|
+
const bridge_1 = require("../bridge");
|
|
8
|
+
const callBridge = (0, bridge_1.getCallBridge)();
|
|
6
9
|
const getMetadata = async ({ functionKey, keys }) => {
|
|
10
|
+
await (0, utils_1.checkRestrictedEnvironment)();
|
|
11
|
+
void callBridge('trackObjectStoreAction', { action: 'getMetadata' });
|
|
7
12
|
if (!functionKey || functionKey.length === 0) {
|
|
8
13
|
throw new errors_1.BridgeAPIError('functionKey is required to filter and generate object metadata');
|
|
9
14
|
}
|
|
@@ -11,7 +16,7 @@ const getMetadata = async ({ functionKey, keys }) => {
|
|
|
11
16
|
throw new errors_1.BridgeAPIError('keys array is required and must not be empty');
|
|
12
17
|
}
|
|
13
18
|
const results = await Promise.all(keys.map(async (key) => {
|
|
14
|
-
const result = (await (0,
|
|
19
|
+
const result = (await (0, index_1.invoke)(functionKey, { key }));
|
|
15
20
|
if (!result || typeof result !== 'object') {
|
|
16
21
|
return {
|
|
17
22
|
key: key,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/object-store/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/object-store/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,SAAS,CAAC"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { createUploadPromises } from './upload';
|
|
1
2
|
export declare const objectStore: {
|
|
2
3
|
upload: ({ functionKey, objects }: {
|
|
3
4
|
functionKey: string;
|
|
@@ -11,9 +12,10 @@ export declare const objectStore: {
|
|
|
11
12
|
functionKey: string;
|
|
12
13
|
keys: string[];
|
|
13
14
|
}) => Promise<import("./types").GetMetadataResult[]>;
|
|
14
|
-
|
|
15
|
+
delete: ({ functionKey, keys }: {
|
|
15
16
|
functionKey: string;
|
|
16
17
|
keys: string[];
|
|
17
18
|
}) => Promise<void>;
|
|
18
19
|
};
|
|
20
|
+
export { createUploadPromises };
|
|
19
21
|
//# sourceMappingURL=objectStore.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"objectStore.d.ts","sourceRoot":"","sources":["../../src/object-store/objectStore.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"objectStore.d.ts","sourceRoot":"","sources":["../../src/object-store/objectStore.ts"],"names":[],"mappings":"AAAA,OAAO,EAAU,oBAAoB,EAAE,MAAM,UAAU,CAAC;AAKxD,eAAO,MAAM,WAAW;;;;;;;;;;;;;;;;;CAKvB,CAAC;AAEF,OAAO,EAAE,oBAAoB,EAAE,CAAC"}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.objectStore = void 0;
|
|
3
|
+
exports.createUploadPromises = exports.objectStore = void 0;
|
|
4
4
|
const upload_1 = require("./upload");
|
|
5
|
+
Object.defineProperty(exports, "createUploadPromises", { enumerable: true, get: function () { return upload_1.createUploadPromises; } });
|
|
5
6
|
const deleteObjects_1 = require("./deleteObjects");
|
|
6
7
|
const download_1 = require("./download");
|
|
7
8
|
const getMetadata_1 = require("./getMetadata");
|
|
@@ -9,5 +10,5 @@ exports.objectStore = {
|
|
|
9
10
|
upload: upload_1.upload,
|
|
10
11
|
download: download_1.download,
|
|
11
12
|
getMetadata: getMetadata_1.getMetadata,
|
|
12
|
-
|
|
13
|
+
delete: deleteObjects_1.deleteObjects
|
|
13
14
|
};
|
|
@@ -6,6 +6,7 @@ export declare type ObjectMetadata = {
|
|
|
6
6
|
export declare type Base64Object = {
|
|
7
7
|
data: string;
|
|
8
8
|
mimeType?: string;
|
|
9
|
+
fileSize?: number;
|
|
9
10
|
};
|
|
10
11
|
export declare type UploadObject = Blob | Base64Object;
|
|
11
12
|
export declare type FileMetadata = ObjectMetadata & {
|
|
@@ -19,6 +20,12 @@ export declare type UploadResult = {
|
|
|
19
20
|
status?: number;
|
|
20
21
|
error?: string;
|
|
21
22
|
};
|
|
23
|
+
export declare type UploadPromiseItem = {
|
|
24
|
+
promise: Promise<UploadResult>;
|
|
25
|
+
index: number;
|
|
26
|
+
objectType?: string;
|
|
27
|
+
objectSize?: number;
|
|
28
|
+
};
|
|
22
29
|
export declare type DownloadResult = {
|
|
23
30
|
success: boolean;
|
|
24
31
|
key: string;
|
|
@@ -40,4 +47,5 @@ export declare type GetMetadataResult = {
|
|
|
40
47
|
currentVersion?: string;
|
|
41
48
|
error?: string;
|
|
42
49
|
};
|
|
50
|
+
export declare const BRIDGE_OBJECT_STORE_RESTRICTED_ENVIRONMENT_ERROR = "Object Store bridge methods are restricted to Forge apps in a non-production environment. For more information please see https://developer.atlassian.com/platform/forge/cli-reference/environments/ for reference on Forge app environments.";
|
|
43
51
|
//# sourceMappingURL=types.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/object-store/types.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,oBAAY,YAAY,GAAG,IAAI,GAAG,YAAY,CAAC;AAE/C,oBAAY,YAAY,GAAG,cAAc,GAAG;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,oBAAY,cAAc,GAAG;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAC;CAC7B,CAAC;AAEF,oBAAY,kBAAkB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAE3D,oBAAY,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC"}
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/object-store/types.ts"],"names":[],"mappings":"AAAA,oBAAY,cAAc,GAAG;IAC3B,MAAM,EAAE,MAAM,CAAC;IACf,QAAQ,EAAE,MAAM,CAAC;IACjB,YAAY,EAAE,MAAM,CAAC;CACtB,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,QAAQ,CAAC,EAAE,MAAM,CAAC;CACnB,CAAC;AAEF,oBAAY,YAAY,GAAG,IAAI,GAAG,YAAY,CAAC;AAE/C,oBAAY,YAAY,GAAG,cAAc,GAAG;IAC1C,GAAG,EAAE,MAAM,CAAC;IACZ,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB,CAAC;AAEF,oBAAY,YAAY,GAAG;IACzB,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,oBAAY,iBAAiB,GAAG;IAC9B,OAAO,EAAE,OAAO,CAAC,YAAY,CAAC,CAAC;IAC/B,KAAK,EAAE,MAAM,CAAC;IACd,UAAU,CAAC,EAAE,MAAM,CAAC;IACpB,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB,CAAC;AAEF,oBAAY,cAAc,GAAG;IAC3B,OAAO,EAAE,OAAO,CAAC;IACjB,GAAG,EAAE,MAAM,CAAC;IACZ,IAAI,CAAC,EAAE,IAAI,CAAC;IACZ,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,oBAAY,mBAAmB,GAAG;IAChC,CAAC,GAAG,EAAE,MAAM,GAAG,YAAY,CAAC;CAC7B,CAAC;AAEF,oBAAY,kBAAkB,GAAG;IAAE,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAAA;CAAE,CAAC;AAE3D,oBAAY,iBAAiB,GAAG;IAC9B,GAAG,EAAE,MAAM,CAAC;IACZ,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,SAAS,CAAC,EAAE,MAAM,CAAC;IACnB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB,CAAC;AAEF,eAAO,MAAM,gDAAgD,kPACoL,CAAC"}
|
|
@@ -1,2 +1,4 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BRIDGE_OBJECT_STORE_RESTRICTED_ENVIRONMENT_ERROR = void 0;
|
|
4
|
+
exports.BRIDGE_OBJECT_STORE_RESTRICTED_ENVIRONMENT_ERROR = 'Object Store bridge methods are restricted to Forge apps in a non-production environment. For more information please see https://developer.atlassian.com/platform/forge/cli-reference/environments/ for reference on Forge app environments.';
|
|
@@ -1,4 +1,8 @@
|
|
|
1
|
-
import type { UploadResult, UploadObject } from './types';
|
|
1
|
+
import type { UploadResult, UploadObject, UploadPromiseItem } from './types';
|
|
2
|
+
export declare const createUploadPromises: ({ functionKey, objects }: {
|
|
3
|
+
functionKey: string;
|
|
4
|
+
objects: UploadObject[];
|
|
5
|
+
}) => Promise<UploadPromiseItem[]>;
|
|
2
6
|
export declare const upload: ({ functionKey, objects }: {
|
|
3
7
|
functionKey: string;
|
|
4
8
|
objects: UploadObject[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"upload.d.ts","sourceRoot":"","sources":["../../src/object-store/upload.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAuC,YAAY,EAAE,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,YAAY,EAAE,iBAAiB,EAAE,MAAM,SAAS,CAAC;AAiDlH,eAAO,MAAM,oBAAoB;iBAIlB,MAAM;aACV,YAAY,EAAE;MACrB,QAAQ,iBAAiB,EAAE,CA0G9B,CAAC;AAUF,eAAO,MAAM,MAAM;iBAIJ,MAAM;aACV,YAAY,EAAE;MACrB,QAAQ,YAAY,EAAE,CASzB,CAAC"}
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.upload = void 0;
|
|
3
|
+
exports.upload = exports.createUploadPromises = void 0;
|
|
4
4
|
const invoke_1 = require("../invoke");
|
|
5
5
|
const errors_1 = require("../errors");
|
|
6
|
+
const utils_1 = require("./utils");
|
|
7
|
+
const bridge_1 = require("../bridge");
|
|
8
|
+
const callBridge = (0, bridge_1.getCallBridge)();
|
|
6
9
|
const base64ToBlob = (base64, mimeType) => {
|
|
7
10
|
const byteCharacters = atob(base64);
|
|
8
11
|
const byteNumbers = new Array(byteCharacters.length);
|
|
@@ -25,7 +28,7 @@ const getObjectMetadata = async (blob) => {
|
|
|
25
28
|
checksumType
|
|
26
29
|
};
|
|
27
30
|
};
|
|
28
|
-
const
|
|
31
|
+
const createUploadPromises = async ({ functionKey, objects }) => {
|
|
29
32
|
if (!functionKey || functionKey.length === 0) {
|
|
30
33
|
throw new errors_1.BridgeAPIError('functionKey is required to filter and generate presigned URLs');
|
|
31
34
|
}
|
|
@@ -55,46 +58,72 @@ const upload = async ({ functionKey, objects }) => {
|
|
|
55
58
|
throw new errors_1.BridgeAPIError('Invalid response from functionKey');
|
|
56
59
|
}
|
|
57
60
|
const checksumToBlobMap = new Map();
|
|
61
|
+
const checksumToIndexMap = new Map();
|
|
58
62
|
blobs.forEach((blob, index) => {
|
|
59
63
|
const metadata = allObjectMetadata[index];
|
|
60
64
|
checksumToBlobMap.set(metadata.checksum, blob);
|
|
65
|
+
checksumToIndexMap.set(metadata.checksum, index);
|
|
61
66
|
});
|
|
62
|
-
const uploadPromises = Object.entries(presignedURLsToObjectMetadata).map(
|
|
63
|
-
const { key,
|
|
67
|
+
const uploadPromises = Object.entries(presignedURLsToObjectMetadata).map(([presignedUrl, metadata]) => {
|
|
68
|
+
const { key, checksum } = metadata;
|
|
64
69
|
const object = checksumToBlobMap.get(checksum);
|
|
65
|
-
|
|
70
|
+
const index = checksumToIndexMap.get(checksum);
|
|
71
|
+
if (index === undefined) {
|
|
66
72
|
return {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
73
|
+
promise: Promise.resolve({
|
|
74
|
+
success: false,
|
|
75
|
+
key: key,
|
|
76
|
+
error: `Index not found for checksum ${checksum}`
|
|
77
|
+
}),
|
|
78
|
+
index: -1
|
|
70
79
|
};
|
|
71
80
|
}
|
|
72
|
-
|
|
73
|
-
const response = await fetch(presignedUrl, {
|
|
74
|
-
method: 'PUT',
|
|
75
|
-
body: object,
|
|
76
|
-
headers: {
|
|
77
|
-
'Content-Type': object.type || 'application/octet-stream',
|
|
78
|
-
'Content-Length': length.toString()
|
|
79
|
-
}
|
|
80
|
-
});
|
|
81
|
-
return {
|
|
82
|
-
success: response.ok,
|
|
83
|
-
key: key,
|
|
84
|
-
status: response.status,
|
|
85
|
-
error: response.ok ? undefined : `Upload failed with status ${response.status}`
|
|
86
|
-
};
|
|
87
|
-
}
|
|
88
|
-
catch (error) {
|
|
81
|
+
if (!object) {
|
|
89
82
|
return {
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
83
|
+
promise: Promise.resolve({
|
|
84
|
+
success: false,
|
|
85
|
+
key: key,
|
|
86
|
+
error: `Blob not found for checksum ${checksum}`
|
|
87
|
+
}),
|
|
88
|
+
index
|
|
94
89
|
};
|
|
95
90
|
}
|
|
91
|
+
const uploadPromise = (async () => {
|
|
92
|
+
try {
|
|
93
|
+
const response = await fetch(presignedUrl, {
|
|
94
|
+
method: 'PUT',
|
|
95
|
+
body: object,
|
|
96
|
+
headers: {
|
|
97
|
+
'Content-Type': object.type || 'application/octet-stream',
|
|
98
|
+
'Content-Length': object.size.toString()
|
|
99
|
+
}
|
|
100
|
+
});
|
|
101
|
+
return {
|
|
102
|
+
success: response.ok,
|
|
103
|
+
key: key,
|
|
104
|
+
status: response.status,
|
|
105
|
+
error: response.ok ? undefined : `Upload failed with status ${response.status}`
|
|
106
|
+
};
|
|
107
|
+
}
|
|
108
|
+
catch (error) {
|
|
109
|
+
return {
|
|
110
|
+
success: false,
|
|
111
|
+
key: key,
|
|
112
|
+
status: 503,
|
|
113
|
+
error: error instanceof Error ? error.message : 'Upload failed'
|
|
114
|
+
};
|
|
115
|
+
}
|
|
116
|
+
})();
|
|
117
|
+
return { promise: uploadPromise, index, objectType: object.type, objectSize: object.size };
|
|
96
118
|
});
|
|
97
|
-
|
|
119
|
+
return uploadPromises;
|
|
120
|
+
};
|
|
121
|
+
exports.createUploadPromises = createUploadPromises;
|
|
122
|
+
const upload = async ({ functionKey, objects }) => {
|
|
123
|
+
await (0, utils_1.checkRestrictedEnvironment)();
|
|
124
|
+
void callBridge('trackObjectStoreAction', { action: 'upload' });
|
|
125
|
+
const uploadPromises = await (0, exports.createUploadPromises)({ functionKey, objects });
|
|
126
|
+
const results = await Promise.all(uploadPromises.map((item) => item.promise));
|
|
98
127
|
return results;
|
|
99
128
|
};
|
|
100
129
|
exports.upload = upload;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../../src/object-store/utils.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,0BAA0B,QAAa,QAAQ,IAAI,CAK/D,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.checkRestrictedEnvironment = void 0;
|
|
4
|
+
const errors_1 = require("../errors");
|
|
5
|
+
const view_1 = require("../view");
|
|
6
|
+
const types_1 = require("./types");
|
|
7
|
+
const checkRestrictedEnvironment = async () => {
|
|
8
|
+
const { environmentType } = await view_1.view.getContext();
|
|
9
|
+
if (environmentType === 'PRODUCTION') {
|
|
10
|
+
throw new errors_1.BridgeAPIError(types_1.BRIDGE_OBJECT_STORE_RESTRICTED_ENVIRONMENT_ERROR);
|
|
11
|
+
}
|
|
12
|
+
};
|
|
13
|
+
exports.checkRestrictedEnvironment = checkRestrictedEnvironment;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@forge/bridge",
|
|
3
|
-
"version": "5.8.
|
|
3
|
+
"version": "5.8.1-next.0",
|
|
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.
|
|
21
|
+
"@forge/manifest": "11.0.1-next.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
24
|
"history": "5.3.0",
|
package/out/rovo/index.d.ts
DELETED
package/out/rovo/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/rovo/index.ts"],"names":[],"mappings":"AAAA,cAAc,QAAQ,CAAC"}
|
package/out/rovo/index.js
DELETED
package/out/rovo/open.d.ts
DELETED
|
@@ -1,4 +0,0 @@
|
|
|
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
|
package/out/rovo/open.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
|
@@ -1,42 +0,0 @@
|
|
|
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;
|
package/out/rovo/rovo.d.ts
DELETED
package/out/rovo/rovo.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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
DELETED
package/out/rovo/types.d.ts
DELETED
|
@@ -1,19 +0,0 @@
|
|
|
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
|
package/out/rovo/types.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
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/out/rovo/types.js
DELETED