@forge/api
Advanced tools
Comparing version 2.9.2-next.0 to 2.10.0-next.1
# @forge/api | ||
## 2.10.0-next.1 | ||
### Minor Changes | ||
- e0e3587a: Add NodeJS runtime support for Storage API | ||
## 2.9.2-next.0 | ||
@@ -4,0 +10,0 @@ |
@@ -8,4 +8,4 @@ /// <reference types="node" /> | ||
export declare function getNodeRuntimeAPI(): FetchAPI; | ||
export declare function getSandboxRuntimeAPI(): FetchAPI | null; | ||
export declare function getSandboxRuntimeAPI(api: any): FetchAPI; | ||
export {}; | ||
//# sourceMappingURL=fetch.d.ts.map |
@@ -54,11 +54,5 @@ "use strict"; | ||
exports.getNodeRuntimeAPI = getNodeRuntimeAPI; | ||
function getSandboxRuntimeAPI() { | ||
const { api: globalAPI } = global; | ||
if (globalAPI && Object.keys(globalAPI).length) { | ||
return (0, _1.wrapFetchApiMethods)(globalAPI, polyfill_response_1.transformResponse); | ||
} | ||
else { | ||
return null; | ||
} | ||
function getSandboxRuntimeAPI(api) { | ||
return (0, _1.wrapFetchApiMethods)(api, polyfill_response_1.transformResponse); | ||
} | ||
exports.getSandboxRuntimeAPI = getSandboxRuntimeAPI; |
@@ -6,2 +6,7 @@ export declare type ForgeRuntime = { | ||
}; | ||
context: { | ||
installContext: { | ||
contextAri: string; | ||
}; | ||
}; | ||
allowedEgress: string[]; | ||
@@ -8,0 +13,0 @@ lambdaContext: { |
@@ -67,3 +67,11 @@ import { RequestInit, Response } from 'node-fetch'; | ||
declare const store: PropertiesAPI; | ||
declare const storage: ForgeStorageAPI; | ||
declare const storage: { | ||
get: (key: string) => Promise<any>; | ||
set: (key: string, value: any) => Promise<void>; | ||
delete: (key: string) => Promise<void>; | ||
getSecret: (key: string) => Promise<any>; | ||
setSecret: (key: string, value: any) => Promise<void>; | ||
deleteSecret: (key: string) => Promise<void>; | ||
query: () => import("packages/forge-storage/out/query-api").DefaultQueryBuilder; | ||
}; | ||
declare const properties: PropertiesAPI; | ||
@@ -70,0 +78,0 @@ declare const API: ForgeAPI; |
"use strict"; | ||
var _a, _b, _c, _d; | ||
var _a; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
@@ -12,3 +12,3 @@ exports.getRuntime = exports.routeFromAbsolute = exports.assumeTrustedRoute = exports.route = exports.startsWith = exports.webTrigger = exports.properties = exports.storage = exports.store = exports.requestBitbucket = exports.requestConfluence = exports.requestJira = exports.fetch = exports.authorize = exports.asApp = exports.asUser = exports.privacy = void 0; | ||
Object.defineProperty(exports, "webTrigger", { enumerable: true, get: function () { return webTrigger_1.webTrigger; } }); | ||
const fetch_1 = require("./api/fetch"); | ||
const fetch_and_storage_1 = require("./runtime/fetch-and-storage"); | ||
function withDeprecatedMessage(method, message) { | ||
@@ -21,3 +21,3 @@ const wrappedMethod = (...args) => { | ||
} | ||
const fetchAPI = (_a = (0, fetch_1.getSandboxRuntimeAPI)()) !== null && _a !== void 0 ? _a : (0, fetch_1.getNodeRuntimeAPI)(); | ||
const fetchAPI = (0, fetch_and_storage_1.getFetchAPI)(); | ||
const asUser = fetchAPI.asUser; | ||
@@ -45,3 +45,3 @@ exports.asUser = asUser; | ||
exports.store = store; | ||
const storage = (0, storage_1.getStorageInstanceWithQuery)(new storage_1.GlobalStorage((_b = global.api) === null || _b === void 0 ? void 0 : _b.__getAppAri, (_c = global.api) === null || _c === void 0 ? void 0 : _c.asApp().__requestAtlassian)); | ||
const storage = (0, storage_1.getStorageInstanceWithQuery)(new storage_1.GlobalStorage(fetch_and_storage_1.getContextAri, (0, fetch_and_storage_1.createRequestStargateAsApp)())); | ||
exports.storage = storage; | ||
@@ -52,3 +52,3 @@ const properties = properties_1.propertiesApi; | ||
exports.privacy = { | ||
reportPersonalData: (0, privacy_1.createReportPersonalData)((_d = global.api) === null || _d === void 0 ? void 0 : _d.asApp().__requestAtlassian) | ||
reportPersonalData: (0, privacy_1.createReportPersonalData)((_a = global.api) === null || _a === void 0 ? void 0 : _a.asApp().__requestAtlassian) | ||
}; | ||
@@ -55,0 +55,0 @@ exports.default = API; |
{ | ||
"name": "@forge/api", | ||
"version": "2.9.2-next.0", | ||
"version": "2.10.0-next.1", | ||
"description": "Forge API methods", | ||
@@ -5,0 +5,0 @@ "author": "Atlassian", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
56184
63
707