Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@forge/api

Package Overview
Dependencies
Maintainers
8
Versions
360
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@forge/api - npm Package Compare versions

Comparing version 1.1.0-next.0 to 1.1.0-next.1

6

CHANGELOG.md
# @forge/api
## 1.1.0-next.1
### Minor Changes
- ba442a3: Add requestGraph method to fetch api.
## 1.1.0-next.0

@@ -4,0 +10,0 @@

11

out/api/index.js

@@ -6,2 +6,7 @@ "use strict";

Object.defineProperty(exports, "transformResponse", { enumerable: true, get: function () { return polyfill_response_1.transformResponse; } });
const wrapRequestGraph = (requestGraphApi) => (query, variables) => requestGraphApi('/graphql', {
method: 'POST',
headers: { 'Content-Type': 'application/json' },
body: JSON.stringify(Object.assign({ query }, (variables ? { variables } : {})))
});
exports.wrapFetchApiMethods = (api, wrapFetch) => {

@@ -14,9 +19,11 @@ return {

requestJira: wrapFetch(api.asUser().requestJira),
requestConfluence: wrapFetch(api.asUser().requestConfluence)
requestConfluence: wrapFetch(api.asUser().requestConfluence),
requestGraph: wrapRequestGraph(wrapFetch(api.asUser().requestGraph))
}),
asApp: () => ({
requestJira: wrapFetch(api.asApp().requestJira),
requestConfluence: wrapFetch(api.asApp().requestConfluence)
requestConfluence: wrapFetch(api.asApp().requestConfluence),
requestGraph: wrapRequestGraph(wrapFetch(api.asApp().requestGraph))
})
};
};

11

out/index.d.ts

@@ -10,2 +10,5 @@ import { RequestInit, Response } from 'node-fetch';

}
export interface GraphQLFetchMethods {
requestGraph: (query: string, variables?: any) => Promise<APIResponse>;
}
export interface StorageMethods {

@@ -31,4 +34,4 @@ get: (key: string) => Promise<any>;

export interface FetchAPI extends FetchMethods {
asUser(): FetchMethods;
asApp(): FetchMethods;
asUser(): FetchMethods & GraphQLFetchMethods;
asApp(): FetchMethods & GraphQLFetchMethods;
fetch: FetchMethod;

@@ -39,4 +42,4 @@ }

}
declare const asUser: () => FetchMethods;
declare const asApp: () => FetchMethods;
declare const asUser: () => FetchMethods & GraphQLFetchMethods;
declare const asApp: () => FetchMethods & GraphQLFetchMethods;
declare const fetch: FetchMethod;

@@ -43,0 +46,0 @@ declare const requestJira: FetchMethod;

@@ -11,3 +11,3 @@ import { StorageAdapter } from './storage-adapter';

protected buildSetRequestOptions(requestBody: any, requestMethod: 'PUT' | 'POST'): {
method: "PUT" | "POST";
method: "POST" | "PUT";
body: string;

@@ -14,0 +14,0 @@ headers: {

{
"name": "@forge/api",
"version": "1.1.0-next.0",
"version": "1.1.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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc