@forge/api
Advanced tools
Comparing version 2.4.0 to 2.5.0-next.0
# @forge/api | ||
## 2.5.0-next.0 | ||
### Minor Changes | ||
- df2cd2f: Enable auth providers api | ||
## 2.4.0 | ||
@@ -4,0 +10,0 @@ |
@@ -28,3 +28,14 @@ "use strict"; | ||
requestConfluence: wrapRequestProduct(wrapFetch(api.asUser().requestConfluence)), | ||
requestGraph: wrapRequestGraph(wrapFetch(api.asUser().requestGraph)) | ||
requestGraph: wrapRequestGraph(wrapFetch(api.asUser().requestGraph)), | ||
withProvider: (provider, remoteName) => { | ||
const { hasCredentials, requestCredentials, fetch: withProviderFetch } = api | ||
.asUser() | ||
.withProvider(provider, remoteName); | ||
const wrappedRequestRemote = wrapWithRouteUnwrapper(wrapFetch(withProviderFetch)); | ||
return { | ||
hasCredentials, | ||
requestCredentials, | ||
fetch: wrappedRequestRemote | ||
}; | ||
} | ||
}), | ||
@@ -31,0 +42,0 @@ asApp: () => ({ |
@@ -18,2 +18,10 @@ import { RequestInit, Response } from 'node-fetch'; | ||
} | ||
export interface ExternalAuthFetchMethods { | ||
hasCredentials: () => boolean; | ||
requestCredentials: () => boolean; | ||
fetch: FetchMethodAllowingRoute; | ||
} | ||
export interface ExternalAuthFetchMethodsProvider { | ||
withProvider: (provider: string, remoteName?: string) => ExternalAuthFetchMethods; | ||
} | ||
export interface StorageMethods { | ||
@@ -44,3 +52,3 @@ get: (key: string) => Promise<any>; | ||
export interface FetchAPI extends RequestProductMethods { | ||
asUser(): RequestProductMethods & GraphQLFetchMethods; | ||
asUser(): RequestProductMethods & GraphQLFetchMethods & ExternalAuthFetchMethodsProvider; | ||
asApp(): RequestProductMethods & GraphQLFetchMethods; | ||
@@ -52,3 +60,3 @@ fetch: FetchMethodAllowingRoute; | ||
} | ||
declare const asUser: () => RequestProductMethods & GraphQLFetchMethods; | ||
declare const asUser: () => RequestProductMethods & GraphQLFetchMethods & ExternalAuthFetchMethodsProvider; | ||
declare const asApp: () => RequestProductMethods & GraphQLFetchMethods; | ||
@@ -55,0 +63,0 @@ declare const fetch: FetchMethodAllowingRoute; |
{ | ||
"name": "@forge/api", | ||
"version": "2.4.0", | ||
"version": "2.5.0-next.0", | ||
"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
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
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
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
43519
546
2