@forge/bridge 5.8.0-next.13 → 5.8.0-next.14
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 +7 -0
- package/out/object-store/deleteObjects.d.ts.map +1 -1
- package/out/object-store/deleteObjects.js +2 -0
- package/out/object-store/download.d.ts.map +1 -1
- package/out/object-store/download.js +2 -0
- package/out/object-store/getMetadata.d.ts.map +1 -1
- package/out/object-store/getMetadata.js +2 -0
- package/out/object-store/types.d.ts +1 -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.map +1 -1
- package/out/object-store/upload.js +2 -0
- 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 +1 -1
package/CHANGELOG.md
CHANGED
|
@@ -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":"AAYA,eAAO,MAAM,aAAa;iBAAgD,MAAM;UAAQ,MAAM,EAAE;MAAK,QAAQ,IAAI,CAgBhH,CAAC"}
|
|
@@ -3,7 +3,9 @@ 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");
|
|
6
7
|
const deleteObjects = async ({ functionKey, keys }) => {
|
|
8
|
+
await (0, utils_1.checkRestrictedEnvironment)();
|
|
7
9
|
if (!functionKey || functionKey.length === 0) {
|
|
8
10
|
throw new errors_1.BridgeAPIError('functionKey is required to delete objects');
|
|
9
11
|
}
|
|
@@ -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;AAWlE,eAAO,MAAM,QAAQ;iBAIN,MAAM;UACb,MAAM,EAAE;MACZ,QAAQ,cAAc,EAAE,CAuD3B,CAAC"}
|
|
@@ -3,7 +3,9 @@ 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");
|
|
6
7
|
const download = async ({ functionKey, keys }) => {
|
|
8
|
+
await (0, utils_1.checkRestrictedEnvironment)();
|
|
7
9
|
if (!functionKey || functionKey.length === 0) {
|
|
8
10
|
throw new errors_1.BridgeAPIError('functionKey is required to filter and generate download URLs');
|
|
9
11
|
}
|
|
@@ -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;AAWjD,eAAO,MAAM,WAAW;iBAIT,MAAM;UACb,MAAM,EAAE;MACZ,QAAQ,iBAAiB,EAAE,CA2B9B,CAAC"}
|
|
@@ -3,7 +3,9 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
3
|
exports.getMetadata = void 0;
|
|
4
4
|
const index_1 = require("../invoke/index");
|
|
5
5
|
const errors_1 = require("../errors");
|
|
6
|
+
const utils_1 = require("./utils");
|
|
6
7
|
const getMetadata = async ({ functionKey, keys }) => {
|
|
8
|
+
await (0, utils_1.checkRestrictedEnvironment)();
|
|
7
9
|
if (!functionKey || functionKey.length === 0) {
|
|
8
10
|
throw new errors_1.BridgeAPIError('functionKey is required to filter and generate object metadata');
|
|
9
11
|
}
|
|
@@ -47,4 +47,5 @@ export declare type GetMetadataResult = {
|
|
|
47
47
|
currentVersion?: string;
|
|
48
48
|
error?: string;
|
|
49
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.";
|
|
50
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;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;I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"}
|
|
@@ -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 +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,iBAAiB,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;AA8ClH,eAAO,MAAM,oBAAoB;iBAIlB,MAAM;aACV,YAAY,EAAE;MACrB,QAAQ,iBAAiB,EAAE,CA4G9B,CAAC;AAUF,eAAO,MAAM,MAAM;iBAIJ,MAAM;aACV,YAAY,EAAE;MACrB,QAAQ,YAAY,EAAE,CAIzB,CAAC"}
|
|
@@ -3,6 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
3
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");
|
|
6
7
|
const base64ToBlob = (base64, mimeType) => {
|
|
7
8
|
const byteCharacters = atob(base64);
|
|
8
9
|
const byteNumbers = new Array(byteCharacters.length);
|
|
@@ -26,6 +27,7 @@ const getObjectMetadata = async (blob) => {
|
|
|
26
27
|
};
|
|
27
28
|
};
|
|
28
29
|
const createUploadPromises = async ({ functionKey, objects }) => {
|
|
30
|
+
await (0, utils_1.checkRestrictedEnvironment)();
|
|
29
31
|
if (!functionKey || functionKey.length === 0) {
|
|
30
32
|
throw new errors_1.BridgeAPIError('functionKey is required to filter and generate presigned URLs');
|
|
31
33
|
}
|
|
@@ -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;
|