@avst-api/jira7-server
Advanced tools
Comparing version 0.1.11 to 0.1.12
{ | ||
"name": "@avst-api/jira7-server", | ||
"version": "0.1.11", | ||
"version": "0.1.12", | ||
"description": "Adaptavist Managed API for Jira Server 7.13.9", | ||
@@ -5,0 +5,0 @@ "main": "index.js", |
@@ -15,11 +15,2 @@ import { HeadersType as Headers } from '@avst-api/commons'; | ||
} | ||
export interface CustomFieldIdentifier { | ||
id?: string; | ||
name?: string; | ||
} | ||
export interface CustomFieldSelectOption { | ||
self?: string; | ||
value?: string; | ||
id?: string; | ||
} | ||
export declare function httpGet<Ok, Err>(connection: string, urlPath: string, headers?: Headers, skipBodyParsing?: boolean): Promise<import("@avst-api/commons").Response<Ok | Err>>; | ||
@@ -29,3 +20,2 @@ export declare function httpPost<Ok, Err>(connection: string, urlPath: string, request: any, headers?: Headers, skipBodyParsing?: boolean): Promise<import("@avst-api/commons").Response<Ok | Err>>; | ||
export declare function httpDelete<Ok, Err>(connection: string, urlPath: string, headers?: Headers, skipBodyParsing?: boolean): Promise<import("@avst-api/commons").Response<Ok | Err>>; | ||
export declare function getFields<T extends CustomFieldIdentifier>(fields: T[], customFieldIdOrName: number | string): T[]; | ||
//# sourceMappingURL=common.d.ts.map |
@@ -1,2 +0,2 @@ | ||
import { looksLikeNumber, performHttpCall } from '@avst-api/commons'; | ||
import { performHttpCall } from '@avst-api/commons'; | ||
; | ||
@@ -6,25 +6,19 @@ ; | ||
; | ||
const addSpecialHeaders = (headers) => { | ||
return { | ||
...headers, | ||
'X-Atlassian-Token': 'no-check' | ||
}; | ||
}; | ||
export function httpGet(connection, urlPath, headers, skipBodyParsing = false) { | ||
return performHttpCall(connection, urlPath, 'GET', undefined, headers, skipBodyParsing); | ||
return performHttpCall(connection, urlPath, 'GET', undefined, addSpecialHeaders(headers), skipBodyParsing); | ||
} | ||
export function httpPost(connection, urlPath, request, headers, skipBodyParsing = false) { | ||
return performHttpCall(connection, urlPath, 'POST', request, headers, skipBodyParsing); | ||
return performHttpCall(connection, urlPath, 'POST', request, addSpecialHeaders(headers), skipBodyParsing); | ||
} | ||
export function httpPut(connection, urlPath, request, headers, skipBodyParsing = false) { | ||
return performHttpCall(connection, urlPath, 'PUT', request, headers, skipBodyParsing); | ||
return performHttpCall(connection, urlPath, 'PUT', request, addSpecialHeaders(headers), skipBodyParsing); | ||
} | ||
export function httpDelete(connection, urlPath, headers, skipBodyParsing = false) { | ||
return performHttpCall(connection, urlPath, 'DELETE', undefined, headers, skipBodyParsing); | ||
return performHttpCall(connection, urlPath, 'DELETE', undefined, addSpecialHeaders(headers), skipBodyParsing); | ||
} | ||
export function getFields(fields, customFieldIdOrName) { | ||
customFieldIdOrName = customFieldIdOrName.toString().trim(); | ||
if (looksLikeNumber(customFieldIdOrName)) { | ||
return fields.filter(field => field.id === `customfield_${customFieldIdOrName}`); | ||
} | ||
else if (customFieldIdOrName.match(/^customfield_\d+$/)) { | ||
return fields.filter(field => field.id === customFieldIdOrName); | ||
} | ||
else { | ||
return fields.filter(field => field.name.toLowerCase() === customFieldIdOrName.toString().trim().toLowerCase()); | ||
} | ||
} |
@@ -0,1 +1,5 @@ | ||
# 0.1.12 | ||
- Added `X-Atlassian-Token: no-check` header for adding attachments to issues request. | ||
# 0.1.11 | ||
@@ -2,0 +6,0 @@ |
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
32
820176
12352