@incanta/node-paddle-sdk
Advanced tools
Comparing version 1.0.1 to 1.0.2
@@ -52,9 +52,12 @@ "use strict"; | ||
const url = `${this.server}${path}`; | ||
const res = yield (0, got_1.default)(url, { | ||
const options = { | ||
method, | ||
headers: { | ||
'Authorization': `Bearer ${this.vendorAuthCode}}`, | ||
Authorization: `Bearer ${this.vendorAuthCode}}`, | ||
}, | ||
form: Object.assign({}, (body || {})), | ||
}).json(); | ||
}; | ||
if (body) { | ||
options.form = Object.assign({}, (body || {})); | ||
} | ||
const res = yield (0, got_1.default)(url, options).json(); | ||
if (res.success === true) { | ||
@@ -61,0 +64,0 @@ return res.response; |
@@ -32,9 +32,12 @@ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) { | ||
const url = `${this.server}${path}`; | ||
const res = yield got(url, { | ||
const options = { | ||
method, | ||
headers: { | ||
'Authorization': `Bearer ${this.vendorAuthCode}}`, | ||
Authorization: `Bearer ${this.vendorAuthCode}}`, | ||
}, | ||
form: Object.assign({}, (body || {})), | ||
}).json(); | ||
}; | ||
if (body) { | ||
options.form = Object.assign({}, (body || {})); | ||
} | ||
const res = yield got(url, options).json(); | ||
if (res.success === true) { | ||
@@ -41,0 +44,0 @@ return res.response; |
{ | ||
"name": "@incanta/node-paddle-sdk", | ||
"private": false, | ||
"version": "1.0.1", | ||
"version": "1.0.2", | ||
"description": "A fully typed NodeJS library for integration with Paddle.", | ||
@@ -6,0 +6,0 @@ "exports": { |
@@ -1,2 +0,2 @@ | ||
import got from 'got'; | ||
import got, { OptionsOfTextResponseBody } from 'got'; | ||
import { createHmac } from 'crypto'; | ||
@@ -48,11 +48,14 @@ import { GetCustomerResponse } from './types'; | ||
const url = `${this.server}${path}`; | ||
const res = await got(url, { | ||
const options: OptionsOfTextResponseBody = { | ||
method, | ||
headers: { | ||
'Authorization': `Bearer ${this.vendorAuthCode}}`, | ||
Authorization: `Bearer ${this.vendorAuthCode}}`, | ||
}, | ||
form: { | ||
}; | ||
if (body) { | ||
options.form = { | ||
...(body || {}), | ||
}, | ||
}).json<PaddleApiResult<T>>(); | ||
}; | ||
} | ||
const res = await got(url, options).json<PaddleApiResult<T>>(); | ||
@@ -59,0 +62,0 @@ if (res.success === true) { |
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
198960
5625