@forge/api
Advanced tools
Comparing version 0.0.0-experimental-63c13fb to 0.0.0-experimental-64caa5a
223
CHANGELOG.md
# @forge/api | ||
## 0.0.0-experimental-63c13fb | ||
## 0.0.0-experimental-64caa5a | ||
### Minor Changes | ||
- 8571c05: Add support for multiple accounts in external authentication | ||
## 2.6.0-next.0 | ||
### Minor Changes | ||
- 8571c05: Add support for multiple accounts in external authentication | ||
## 2.5.0 | ||
### Minor Changes | ||
- 70e9c8c: Enable auth providers api | ||
### Patch Changes | ||
- 32d11d1: Fix types on external auth APIs | ||
## 2.5.0-next.1 | ||
### Patch Changes | ||
- 32d11d1: Fix types on external auth APIs | ||
## 2.5.0-next.0 | ||
### Minor Changes | ||
- df2cd2f: Enable auth providers api | ||
## 2.4.0 | ||
## 2.4.0-next.0 | ||
### Minor Changes | ||
- de02d45: Enable auth providers api | ||
## 2.3.0 | ||
### Minor Changes | ||
- 0d7fe27: Support secret storage API | ||
### Patch Changes | ||
- df58629: Allow custom headers in requestGraph | ||
- Updated dependencies [0d7fe27] | ||
- @forge/storage@1.1.0 | ||
## 2.3.0-next.1 | ||
### Patch Changes | ||
- df58629: Allow custom headers in requestGraph | ||
## 2.3.0-next.0 | ||
### Minor Changes | ||
- 0d7fe27: Support secret storage API | ||
### Patch Changes | ||
- Updated dependencies [0d7fe27] | ||
- @forge/storage@1.1.0-next.0 | ||
## 2.2.1 | ||
### Patch Changes | ||
- Updated dependencies [0700578] | ||
- @forge/storage@1.0.5 | ||
## 2.2.1-next.0 | ||
### Patch Changes | ||
- Updated dependencies [0700578] | ||
- @forge/storage@1.0.5-next.0 | ||
## 2.2.0 | ||
### Minor Changes | ||
- 5dcb9bd: Routes can be passed to api.fetch. Routes can be partially-constructed using other Routes. | ||
## 2.2.0-next.0 | ||
### Minor Changes | ||
- 5dcb9bd: Routes can be passed to api.fetch. Routes can be partially-constructed using other Routes. | ||
## 2.1.0 | ||
### Minor Changes | ||
- 339a8ad: Export StorageAPI interface | ||
- 390e3d0: Add authorize API | ||
### Patch Changes | ||
- fef6d3a: Export Route as type for @forge/api | ||
- 85ce23a: Update error message and build config | ||
- Updated dependencies [5ff60ec] | ||
- Updated dependencies [4eda18e] | ||
- Updated dependencies [85ce23a] | ||
- Updated dependencies [2d3bec6] | ||
- @forge/storage@1.0.4 | ||
- @forge/auth@0.0.1 | ||
## 2.1.0-next.4 | ||
### Patch Changes | ||
- 85ce23a: Update error message and build config | ||
- Updated dependencies [85ce23a] | ||
- @forge/auth@0.0.1-next.2 | ||
## 2.1.0-next.3 | ||
### Minor Changes | ||
- 390e3d0: Add authorize API | ||
### Patch Changes | ||
- Updated dependencies [4eda18e] | ||
- @forge/auth@0.0.1-next.0 | ||
## 2.1.0-next.2 | ||
### Patch Changes | ||
- fef6d3a: Export Route as type for @forge/api | ||
## 2.1.0-next.1 | ||
### Minor Changes | ||
- 339a8ad: Export StorageAPI interface | ||
## 2.0.2-next.0 | ||
### Patch Changes | ||
- Updated dependencies [5ff60ec] | ||
- @forge/storage@1.0.4-next.0 | ||
## 2.0.1 | ||
### Patch Changes | ||
- d3d180e: Remove engines limitation | ||
## 2.0.1-next.0 | ||
### Patch Changes | ||
- d3d180e: Remove engines limitation | ||
## 2.0.0 | ||
### Major Changes | ||
- 4ae62248a: `@forge/api` requires usage of a new route helper when calling requestJira/requestConfluence | ||
## 1.2.0 | ||
### Minor Changes | ||
- 2ede277: Add new getWebTriggerUrl runtime API method | ||
### Patch Changes | ||
- b0ae6aa: Fix properties onConfluenceSpace for personal spaces | ||
- Updated dependencies [9b496aa] | ||
- @forge/storage@1.0.3 | ||
## 1.2.0-next.2 | ||
### Patch Changes | ||
- Updated dependencies [9b496aa] | ||
- @forge/storage@1.0.3-next.0 | ||
## 1.2.0-next.1 | ||
### Minor Changes | ||
- 2ede277: Add new getWebTriggerUrl runtime API method | ||
## 1.1.1-next.0 | ||
### Patch Changes | ||
- b0ae6aa: Fix properties onConfluenceSpace for personal spaces | ||
## 1.1.0 | ||
### Minor Changes | ||
- 2136fd7: Adds reportPersonalData method to forge help apps comply with GDPR | ||
- ba442a3: Add requestGraph method to fetch api. | ||
### Patch Changes | ||
- Updated dependencies [c7c6de2] | ||
- @forge/storage@1.0.2 | ||
## 1.1.0-next.2 | ||
### Patch Changes | ||
- Updated dependencies [c7c6de2] | ||
- @forge/storage@1.0.2-next.0 | ||
## 1.1.0-next.1 | ||
### Minor Changes | ||
- ba442a3: Add requestGraph method to fetch api. | ||
## 1.1.0-next.0 | ||
@@ -10,0 +231,0 @@ |
@@ -6,16 +6,42 @@ "use strict"; | ||
Object.defineProperty(exports, "transformResponse", { enumerable: true, get: function () { return polyfill_response_1.transformResponse; } }); | ||
const safeUrl_1 = require("../safeUrl"); | ||
const wrapRequestGraph = (requestGraphApi) => (query, variables, headers = {}) => requestGraphApi('/graphql', { | ||
method: 'POST', | ||
headers: Object.assign(Object.assign({}, headers), { 'Content-Type': 'application/json' }), | ||
body: JSON.stringify(Object.assign({ query }, (variables ? { variables } : {}))) | ||
}); | ||
const wrapRequestProduct = (requestProduct) => (path, init) => { | ||
const safeUrl = safeUrl_1.requireSafeUrl(path); | ||
return requestProduct(safeUrl.value, init); | ||
}; | ||
const wrapWithRouteUnwrapper = (fetch) => (path, init) => { | ||
const stringPath = safeUrl_1.isRoute(path) ? path.value : path; | ||
return fetch(stringPath, init); | ||
}; | ||
exports.wrapFetchApiMethods = (api, wrapFetch) => { | ||
return { | ||
fetch: wrapFetch(api.fetch), | ||
requestJira: wrapFetch(api.requestJira), | ||
requestConfluence: wrapFetch(api.requestConfluence), | ||
fetch: wrapWithRouteUnwrapper(wrapFetch(api.fetch)), | ||
requestJira: wrapRequestProduct(wrapFetch(api.requestJira)), | ||
requestConfluence: wrapRequestProduct(wrapFetch(api.requestConfluence)), | ||
asUser: () => ({ | ||
requestJira: wrapFetch(api.asUser().requestJira), | ||
requestConfluence: wrapFetch(api.asUser().requestConfluence) | ||
requestJira: wrapRequestProduct(wrapFetch(api.asUser().requestJira)), | ||
requestConfluence: wrapRequestProduct(wrapFetch(api.asUser().requestConfluence)), | ||
requestGraph: wrapRequestGraph(wrapFetch(api.asUser().requestGraph)), | ||
withProvider: (provider, remoteName, tokenId) => { | ||
const { hasCredentials, requestCredentials, listCredentials, fetch: withProviderFetch } = api.asUser().withProvider(provider, remoteName, tokenId); | ||
const wrappedRequestRemote = wrapWithRouteUnwrapper(wrapFetch(withProviderFetch)); | ||
return { | ||
hasCredentials, | ||
requestCredentials, | ||
listCredentials, | ||
fetch: wrappedRequestRemote | ||
}; | ||
} | ||
}), | ||
asApp: () => ({ | ||
requestJira: wrapFetch(api.asApp().requestJira), | ||
requestConfluence: wrapFetch(api.asApp().requestConfluence) | ||
requestJira: wrapRequestProduct(wrapFetch(api.asApp().requestJira)), | ||
requestConfluence: wrapRequestProduct(wrapFetch(api.asApp().requestConfluence)), | ||
requestGraph: wrapRequestGraph(wrapFetch(api.asApp().requestGraph)) | ||
}) | ||
}; | ||
}; |
import { RequestInit, Response } from 'node-fetch'; | ||
import { QueryApi } from '@forge/storage'; | ||
import { authorize } from './authorization'; | ||
import { Route } from './safeUrl'; | ||
import { webTrigger } from './webTrigger'; | ||
export declare type APIResponse = Pick<Response, 'json' | 'text' | 'arrayBuffer' | 'ok' | 'status' | 'statusText' | 'headers'>; | ||
export declare type FetchMethod = (url: string, init?: RequestInit) => Promise<APIResponse>; | ||
export declare type FetchMethodAllowingRoute = (url: string | Route, init?: RequestInit) => Promise<APIResponse>; | ||
export declare type RequestProductMethod = (url: Route, init?: RequestInit) => Promise<APIResponse>; | ||
export declare type FetchOptions = RequestInit; | ||
export interface FetchMethods { | ||
requestJira: FetchMethod; | ||
requestConfluence: FetchMethod; | ||
export interface RequestProductMethods { | ||
requestJira: RequestProductMethod; | ||
requestConfluence: RequestProductMethod; | ||
} | ||
export interface GraphQLFetchMethods { | ||
requestGraph: (query: string, variables?: any, headers?: Record<string, any>) => Promise<APIResponse>; | ||
} | ||
export interface ExternalAuthFetchMethods { | ||
hasCredentials: () => Promise<boolean>; | ||
requestCredentials: () => Promise<boolean>; | ||
listCredentials: () => Promise<string[]>; | ||
fetch: FetchMethodAllowingRoute; | ||
} | ||
export interface ExternalAuthFetchMethodsProvider { | ||
withProvider: (provider: string, remoteName?: string, tokenId?: string) => ExternalAuthFetchMethods; | ||
} | ||
export interface StorageMethods { | ||
@@ -21,4 +38,9 @@ get: (key: string) => Promise<any>; | ||
} | ||
interface StorageAPI extends StorageMethods, QueryApi { | ||
export interface StorageAPI extends StorageMethods, QueryApi { | ||
} | ||
export interface ForgeStorageAPI extends StorageAPI { | ||
getSecret: (key: string) => Promise<any>; | ||
setSecret: (key: string, value: any) => Promise<void>; | ||
deleteSecret: (key: string) => Promise<void>; | ||
} | ||
export interface StoreAPI extends PropertiesAPI { | ||
@@ -30,6 +52,6 @@ onJiraProject: (context: string) => StorageMethods; | ||
} | ||
export interface FetchAPI extends FetchMethods { | ||
asUser(): FetchMethods; | ||
asApp(): FetchMethods; | ||
fetch: FetchMethod; | ||
export interface FetchAPI extends RequestProductMethods { | ||
asUser(): RequestProductMethods & GraphQLFetchMethods & ExternalAuthFetchMethodsProvider; | ||
asApp(): RequestProductMethods & GraphQLFetchMethods; | ||
fetch: FetchMethodAllowingRoute; | ||
} | ||
@@ -39,9 +61,9 @@ export interface ForgeAPI extends FetchAPI { | ||
} | ||
declare const asUser: () => FetchMethods; | ||
declare const asApp: () => FetchMethods; | ||
declare const fetch: FetchMethod; | ||
declare const requestJira: FetchMethod; | ||
declare const requestConfluence: FetchMethod; | ||
declare const asUser: () => RequestProductMethods & GraphQLFetchMethods & ExternalAuthFetchMethodsProvider; | ||
declare const asApp: () => RequestProductMethods & GraphQLFetchMethods; | ||
declare const fetch: FetchMethodAllowingRoute; | ||
declare const requestJira: RequestProductMethod; | ||
declare const requestConfluence: RequestProductMethod; | ||
declare const store: PropertiesAPI; | ||
declare const storage: StorageAPI; | ||
declare const storage: ForgeStorageAPI; | ||
declare const properties: PropertiesAPI; | ||
@@ -53,5 +75,6 @@ declare const API: ForgeAPI; | ||
export default API; | ||
export { asUser, asApp, fetch, requestJira, requestConfluence, store, storage, properties }; | ||
export { asUser, asApp, authorize, fetch, requestJira, requestConfluence, store, storage, properties, webTrigger }; | ||
export { QueryBuilder, QueryApi, Condition, ListResult, Predicate, Result, Value } from '@forge/storage'; | ||
export { startsWith } from '@forge/storage'; | ||
export { route, assumeTrustedRoute, Route } from './safeUrl'; | ||
//# sourceMappingURL=index.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.properties = exports.storage = exports.store = exports.requestConfluence = exports.requestJira = exports.fetch = exports.asApp = exports.asUser = exports.privacy = void 0; | ||
exports.webTrigger = exports.properties = exports.storage = exports.store = exports.requestConfluence = exports.requestJira = exports.fetch = exports.authorize = exports.asApp = exports.asUser = exports.privacy = void 0; | ||
const storage_1 = require("@forge/storage"); | ||
const api_1 = require("./api"); | ||
const authorization_1 = require("./authorization"); | ||
Object.defineProperty(exports, "authorize", { enumerable: true, get: function () { return authorization_1.authorize; } }); | ||
const properties_1 = require("./properties"); | ||
const privacy_1 = require("./privacy"); | ||
const storage_1 = require("@forge/storage"); | ||
const webTrigger_1 = require("./webTrigger"); | ||
Object.defineProperty(exports, "webTrigger", { enumerable: true, get: function () { return webTrigger_1.webTrigger; } }); | ||
function withDeprecatedMessage(method, message) { | ||
@@ -47,1 +51,4 @@ const wrappedMethod = (...args) => { | ||
Object.defineProperty(exports, "startsWith", { enumerable: true, get: function () { return storage_2.startsWith; } }); | ||
var safeUrl_1 = require("./safeUrl"); | ||
Object.defineProperty(exports, "route", { enumerable: true, get: function () { return safeUrl_1.route; } }); | ||
Object.defineProperty(exports, "assumeTrustedRoute", { enumerable: true, get: function () { return safeUrl_1.assumeTrustedRoute; } }); |
@@ -1,8 +0,7 @@ | ||
import { FetchMethod } from '../index'; | ||
import { RequestProductMethod } from '../index'; | ||
import { ConfluenceVersionedStorage } from './confluence-versioned-storage'; | ||
export declare class ConfluencePageStorage extends ConfluenceVersionedStorage { | ||
private static readonly API_PATH; | ||
constructor(pageId: string, apiClient: FetchMethod); | ||
constructor(pageId: string, apiClient: RequestProductMethod); | ||
set(key: string, value: any): Promise<void>; | ||
} | ||
//# sourceMappingURL=confluence-page.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ConfluencePageStorage = void 0; | ||
const safeUrl_1 = require("../safeUrl"); | ||
const confluence_versioned_storage_1 = require("./confluence-versioned-storage"); | ||
class ConfluencePageStorage extends confluence_versioned_storage_1.ConfluenceVersionedStorage { | ||
constructor(pageId, apiClient) { | ||
const storageApiPath = `${ConfluencePageStorage.API_PATH}${pageId}/property`; | ||
const storageApiPath = (key) => safeUrl_1.route `/wiki/rest/api/content/${pageId}/property/${key}`; | ||
super(storageApiPath, apiClient); | ||
@@ -15,2 +16,1 @@ } | ||
exports.ConfluencePageStorage = ConfluencePageStorage; | ||
ConfluencePageStorage.API_PATH = '/wiki/rest/api/content/'; |
@@ -1,8 +0,7 @@ | ||
import { FetchMethod } from '../index'; | ||
import { RequestProductMethod } from '../index'; | ||
import { ConfluenceVersionedStorage } from './confluence-versioned-storage'; | ||
export declare class ConfluenceSpaceStorage extends ConfluenceVersionedStorage { | ||
private static readonly API_PATH; | ||
constructor(spaceId: string, apiClient: FetchMethod); | ||
constructor(spaceId: string, apiClient: RequestProductMethod); | ||
set(key: string, value: any): Promise<void>; | ||
} | ||
//# sourceMappingURL=confluence-space.d.ts.map |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
exports.ConfluenceSpaceStorage = void 0; | ||
const safeUrl_1 = require("../safeUrl"); | ||
const confluence_versioned_storage_1 = require("./confluence-versioned-storage"); | ||
class ConfluenceSpaceStorage extends confluence_versioned_storage_1.ConfluenceVersionedStorage { | ||
constructor(spaceId, apiClient) { | ||
const storageApiPath = `${ConfluenceSpaceStorage.API_PATH}${spaceId}/property`; | ||
const storageApiPath = (key) => safeUrl_1.route `/wiki/rest/api/space/${spaceId}/property/${key}`; | ||
super(storageApiPath, apiClient); | ||
@@ -15,2 +16,1 @@ } | ||
exports.ConfluenceSpaceStorage = ConfluenceSpaceStorage; | ||
ConfluenceSpaceStorage.API_PATH = '/wiki/rest/api/space/'; |
@@ -8,3 +8,3 @@ "use strict"; | ||
async versionedSet(key, value) { | ||
const versionResponse = await this.apiClient(`${this.storageApiPath}/${key}`); | ||
const versionResponse = await this.apiClient(this.storageApiPath(key)); | ||
if (!versionResponse.ok && versionResponse.status !== 404) { | ||
@@ -21,3 +21,3 @@ throw storage_1.APIError.forStatus(versionResponse.status); | ||
}; | ||
await this.apiClient(`${this.storageApiPath}/${key}`, this.buildSetRequestOptions(requestBody, requestMethod)); | ||
await this.apiClient(this.storageApiPath(key), this.buildSetRequestOptions(requestBody, requestMethod)); | ||
} | ||
@@ -24,0 +24,0 @@ async getUpdatedVersion(versionResponse) { |
@@ -9,14 +9,8 @@ "use strict"; | ||
const confluence_space_1 = require("./confluence-space"); | ||
const sanitizedKey = (input) => { | ||
const regex = /^[A-Za-z0-9_\-]+$/; | ||
if (!regex.test(input)) { | ||
throw new Error('Invalid context/property key'); | ||
} | ||
return input; | ||
}; | ||
const sanitized_key_1 = require("./sanitized-key"); | ||
const getPropertiesInstance = (adapter) => { | ||
const storage = { | ||
get: (key) => adapter.get(sanitizedKey(key)), | ||
set: (key, value) => adapter.set(sanitizedKey(key), value), | ||
delete: (key) => adapter.delete(sanitizedKey(key)) | ||
get: (key) => adapter.get(sanitized_key_1.sanitizedKey(key)), | ||
set: (key, value) => adapter.set(sanitized_key_1.sanitizedKey(key), value), | ||
delete: (key) => adapter.delete(sanitized_key_1.sanitizedKey(key)) | ||
}; | ||
@@ -26,6 +20,6 @@ return storage; | ||
exports.propertiesApi = { | ||
onJiraIssue: (issueKey) => getPropertiesInstance(new jira_issue_1.JiraIssueStorage(sanitizedKey(issueKey), index_1.asApp().requestJira)), | ||
onJiraProject: (projectKey) => getPropertiesInstance(new jira_project_1.JiraProjectStorage(sanitizedKey(projectKey), index_1.asApp().requestJira)), | ||
onConfluencePage: (pageId) => getPropertiesInstance(new confluence_page_1.ConfluencePageStorage(sanitizedKey(pageId), index_1.asApp().requestConfluence)), | ||
onConfluenceSpace: (spaceId) => getPropertiesInstance(new confluence_space_1.ConfluenceSpaceStorage(sanitizedKey(spaceId), index_1.asApp().requestConfluence)) | ||
onJiraIssue: (issueKey) => getPropertiesInstance(new jira_issue_1.JiraIssueStorage(sanitized_key_1.sanitizedKey(issueKey), index_1.asApp().requestJira)), | ||
onJiraProject: (projectKey) => getPropertiesInstance(new jira_project_1.JiraProjectStorage(sanitized_key_1.sanitizedKey(projectKey), index_1.asApp().requestJira)), | ||
onConfluencePage: (pageId) => getPropertiesInstance(new confluence_page_1.ConfluencePageStorage(sanitized_key_1.sanitizedKey(pageId), index_1.asApp().requestConfluence)), | ||
onConfluenceSpace: (spaceId) => getPropertiesInstance(new confluence_space_1.ConfluenceSpaceStorage(sanitized_key_1.sanitizedKey(spaceId), index_1.asApp().requestConfluence)) | ||
}; |
import { ProductScopedStorage } from './product-scoped-storage'; | ||
import { FetchMethod } from '../index'; | ||
import { RequestProductMethod } from '../index'; | ||
export declare class JiraIssueStorage extends ProductScopedStorage { | ||
private static readonly API_PATH; | ||
constructor(issueKey: string, apiClient: FetchMethod); | ||
constructor(issueKey: string, apiClient: RequestProductMethod); | ||
} | ||
//# sourceMappingURL=jira-issue.d.ts.map |
@@ -5,5 +5,6 @@ "use strict"; | ||
const product_scoped_storage_1 = require("./product-scoped-storage"); | ||
const safeUrl_1 = require("../safeUrl"); | ||
class JiraIssueStorage extends product_scoped_storage_1.ProductScopedStorage { | ||
constructor(issueKey, apiClient) { | ||
const storageApiPath = `${JiraIssueStorage.API_PATH}${issueKey}/properties`; | ||
const storageApiPath = (key) => safeUrl_1.route `/rest/api/3/issue/${issueKey}/properties/${key}`; | ||
super(storageApiPath, apiClient); | ||
@@ -13,2 +14,1 @@ } | ||
exports.JiraIssueStorage = JiraIssueStorage; | ||
JiraIssueStorage.API_PATH = '/rest/api/3/issue/'; |
import { ProductScopedStorage } from './product-scoped-storage'; | ||
import { FetchMethod } from '../index'; | ||
import { RequestProductMethod } from '../index'; | ||
export declare class JiraProjectStorage extends ProductScopedStorage { | ||
private static readonly API_PATH; | ||
constructor(projectKey: string, apiClient: FetchMethod); | ||
constructor(projectKey: string, apiClient: RequestProductMethod); | ||
} | ||
//# sourceMappingURL=jira-project.d.ts.map |
@@ -5,5 +5,6 @@ "use strict"; | ||
const product_scoped_storage_1 = require("./product-scoped-storage"); | ||
const safeUrl_1 = require("../safeUrl"); | ||
class JiraProjectStorage extends product_scoped_storage_1.ProductScopedStorage { | ||
constructor(projectKey, apiClient) { | ||
const storageApiPath = `${JiraProjectStorage.API_PATH}${projectKey}/properties`; | ||
const storageApiPath = (key) => safeUrl_1.route `/rest/api/3/project/${projectKey}/properties/${key}`; | ||
super(storageApiPath, apiClient); | ||
@@ -13,2 +14,1 @@ } | ||
exports.JiraProjectStorage = JiraProjectStorage; | ||
JiraProjectStorage.API_PATH = '/rest/api/3/project/'; |
import { StorageAdapter } from './storage-adapter'; | ||
import { FetchMethod } from '../index'; | ||
import { RequestProductMethod } from '../index'; | ||
import { Route } from '../safeUrl'; | ||
export declare class ProductScopedStorage implements StorageAdapter { | ||
protected storageApiPath: string; | ||
protected apiClient: FetchMethod; | ||
constructor(storageApiPath: string, apiClient: FetchMethod); | ||
protected storageApiPath: (key: string) => Route; | ||
protected apiClient: RequestProductMethod; | ||
constructor(storageApiPath: (key: string) => Route, apiClient: RequestProductMethod); | ||
get(key: string): Promise<any>; | ||
@@ -11,3 +12,3 @@ set(key: string, value: any): Promise<void>; | ||
protected buildSetRequestOptions(requestBody: any, requestMethod: 'PUT' | 'POST'): { | ||
method: "PUT" | "POST"; | ||
method: "POST" | "PUT"; | ||
body: string; | ||
@@ -14,0 +15,0 @@ headers: { |
@@ -11,3 +11,3 @@ "use strict"; | ||
async get(key) { | ||
const response = await this.apiClient(`${this.storageApiPath}/${key}`); | ||
const response = await this.apiClient(this.storageApiPath(key)); | ||
if (!response.ok) { | ||
@@ -23,3 +23,3 @@ if (/400|401|403|404/.test(response.status.toString())) { | ||
async set(key, value) { | ||
const response = await this.apiClient(`${this.storageApiPath}/${key}`, this.buildSetRequestOptions(value, 'PUT')); | ||
const response = await this.apiClient(this.storageApiPath(key), this.buildSetRequestOptions(value, 'PUT')); | ||
if (!response.ok) { | ||
@@ -30,3 +30,3 @@ throw storage_1.APIError.forStatus(response.status); | ||
async delete(key) { | ||
const response = await this.apiClient(`${this.storageApiPath}/${key}`, { method: 'DELETE' }); | ||
const response = await this.apiClient(this.storageApiPath(key), { method: 'DELETE' }); | ||
if (!response.ok) { | ||
@@ -33,0 +33,0 @@ throw storage_1.APIError.forStatus(response.status); |
{ | ||
"name": "@forge/api", | ||
"version": "0.0.0-experimental-63c13fb", | ||
"version": "0.0.0-experimental-64caa5a", | ||
"description": "Forge API methods", | ||
@@ -14,5 +14,2 @@ "author": "Atlassian", | ||
}, | ||
"engines": { | ||
"node": "^12" | ||
}, | ||
"devDependencies": { | ||
@@ -22,3 +19,4 @@ "@types/node": "^12.12.63" | ||
"dependencies": { | ||
"@forge/storage": "^1.0.1", | ||
"@forge/auth": "^0.0.1", | ||
"@forge/storage": "^1.1.0", | ||
"@types/node-fetch": "^2.5.7", | ||
@@ -25,0 +23,0 @@ "node-fetch": "^2.6.1" |
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
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Environment variable access
Supply chain riskPackage accesses environment variables, which may be a sign of credential stuffing or data theft.
Found 1 instance in 1 package
44193
51
546
4
3
2
+ Added@forge/auth@^0.0.1
+ Added@forge/auth@0.0.1(transitive)
+ Added@types/node@22.12.0(transitive)
+ Addedtslib@1.14.1(transitive)
- Removed@types/node@22.10.10(transitive)
Updated@forge/storage@^1.1.0