Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion src/client.ts
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ export default class NetsuiteApiClient {
* @returns
*/
public async request(opts: NetsuiteRequestOptions) {
const { path = "*", method = "GET", body = "", heads = {}, restletUrl } = opts;
const { path = "*", method = "GET", body = "", heads = {}, restletUrl, overrides = {} } = opts;
const cleanPath = removeLeadingSlash(path);
// Set up the Request URI

Expand All @@ -91,6 +91,7 @@ export default class NetsuiteApiClient {
headers: this.getAuthorizationHeader(uri, method),
throwHttpErrors: true,
decompress: true,
...overrides,
} as OptionsOfTextResponseBody;

if (Object.keys(heads).length > 0) {
Expand Down
5 changes: 5 additions & 0 deletions src/types.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
import { OptionsOfTextResponseBody } from "got";
import type {Buffer} from "node:buffer";
import type {Readable} from "node:stream";

Expand All @@ -23,6 +24,10 @@ type BaseRequestOptions = {
* Additional headers to send with the request
*/
heads?: any;
/**
* These will override the options that are passed to the request library
*/
overrides?: OptionsOfTextResponseBody
};

export type NetsuiteRequestOptions =
Expand Down
Loading