@forge/api
Advanced tools
Comparing version 0.0.0-experimental-146616c to 0.0.0-experimental-788b6d9
# @forge/api | ||
## 0.0.0-experimental-146616c | ||
## 0.0.0-experimental-788b6d9 | ||
## 0.6.0 | ||
### Minor Changes | ||
- 8691270: Expose headers as Web API Headers object | ||
### Patch Changes | ||
- 8ee5500: Fix dependency resolution by adding node-fetch | ||
## 0.6.0-next.1 | ||
### Patch Changes | ||
- 8ee5500: Fix dependency resolution by adding node-fetch | ||
## 0.6.0-next.0 | ||
### Minor Changes | ||
- 8691270: Expose headers as Web API Headers object | ||
## 0.5.5 | ||
@@ -6,0 +28,0 @@ |
import { RequestInit, Response } from 'node-fetch'; | ||
import { QueryApi } from './storage'; | ||
export declare type APIResponse = Pick<Response, 'json' | 'text' | 'arrayBuffer' | 'ok' | 'status' | 'statusText'>; | ||
export declare type APIResponse = Pick<Response, 'json' | 'text' | 'arrayBuffer' | 'ok' | 'status' | 'statusText' | 'headers'>; | ||
export declare type FetchMethod = (url: string, init?: RequestInit) => Promise<APIResponse>; | ||
@@ -29,9 +29,10 @@ export declare type FetchOptions = RequestInit; | ||
} | ||
export interface ForgeAPI extends FetchMethods { | ||
export interface FetchAPI extends FetchMethods { | ||
asUser(): FetchMethods; | ||
asApp(): FetchMethods; | ||
fetch: FetchMethod; | ||
} | ||
export interface ForgeAPI extends FetchAPI { | ||
store: StoreAPI; | ||
} | ||
declare const API: ForgeAPI; | ||
declare const asUser: () => FetchMethods; | ||
@@ -45,2 +46,3 @@ declare const asApp: () => FetchMethods; | ||
declare const properties: PropertiesAPI; | ||
declare const API: ForgeAPI; | ||
export default API; | ||
@@ -47,0 +49,0 @@ export { asUser, asApp, fetch, requestJira, requestConfluence, store, storage, properties }; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.properties = exports.storage = exports.store = exports.requestConfluence = exports.requestJira = exports.fetch = exports.asApp = exports.asUser = void 0; | ||
const api_1 = require("./api"); | ||
const properties_1 = require("./properties"); | ||
@@ -13,12 +14,12 @@ const storage_1 = require("./storage"); | ||
} | ||
const API = global.api; | ||
const asUser = API.asUser; | ||
const FetchAPI = api_1.wrapFetchApiMethods(global.api, api_1.transformResponse); | ||
const asUser = FetchAPI.asUser; | ||
exports.asUser = asUser; | ||
const asApp = API.asApp; | ||
const asApp = FetchAPI.asApp; | ||
exports.asApp = asApp; | ||
const fetch = API.fetch; | ||
const fetch = FetchAPI.fetch; | ||
exports.fetch = fetch; | ||
const requestJira = API.requestJira; | ||
const requestJira = FetchAPI.requestJira; | ||
exports.requestJira = requestJira; | ||
const requestConfluence = API.requestConfluence; | ||
const requestConfluence = FetchAPI.requestConfluence; | ||
exports.requestConfluence = requestConfluence; | ||
@@ -39,5 +40,5 @@ const deprecatedPropertiesApi = Object.entries(properties_1.propertiesApi) | ||
exports.properties = properties; | ||
API.store = Object.assign({}, store); | ||
const API = Object.assign(Object.assign({}, FetchAPI), { store: Object.assign({}, store) }); | ||
exports.default = API; | ||
var conditions_1 = require("./storage/conditions"); | ||
Object.defineProperty(exports, "startsWith", { enumerable: true, get: function () { return conditions_1.startsWith; } }); |
{ | ||
"name": "@forge/api", | ||
"version": "0.0.0-experimental-146616c", | ||
"version": "0.0.0-experimental-788b6d9", | ||
"description": "Forge API methods", | ||
@@ -22,4 +22,5 @@ "author": "Atlassian", | ||
"dependencies": { | ||
"@types/node-fetch": "^2.5.7" | ||
"@types/node-fetch": "^2.5.7", | ||
"node-fetch": "^2.6.1" | ||
} | ||
} |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
81202
93
1537
2
3
+ Addednode-fetch@^2.6.1
+ Addednode-fetch@2.7.0(transitive)
+ Addedtr46@0.0.3(transitive)
+ Addedwebidl-conversions@3.0.1(transitive)
+ Addedwhatwg-url@5.0.0(transitive)