xero-node
Advanced tools
Comparing version 3.0.3 to 3.0.4
@@ -0,0 +0,0 @@ const path = require('path'); |
@@ -0,0 +0,0 @@ export interface Attachment { |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -0,0 +0,0 @@ import { ExpenseClaim, User, CreditNote, BrandingTheme, Journal, Item, OnlineInvoice, Organisation, OrgCISSetting, Overpayment, Payment, Prepayment, TaxRate, TrackingCategory, BankTransfer, LinkedTransaction, Employee, Currency, Contact, ContactGroup, InvoiceReminder, Invoice, Allocation, BankTransaction, Attachment, Receipt, RepeatingInvoice, ManualJournal, PurchaseOrder } from './AccountingAPI-models'; |
"use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); |
@@ -346,3 +346,3 @@ import { XeroClientConfiguration, BaseAPIClient } from './internals/BaseAPIClient'; | ||
PurchaseOrderID?: string; | ||
PurchasOrderNumber?: string; | ||
PurchaseOrderNumber?: string; | ||
Status?: string; | ||
@@ -352,2 +352,7 @@ DateFrom?: string; | ||
} & QueryArgs & HeaderArgs) => Promise<PurchaseOrdersResponse>; | ||
savePDF: (args?: { | ||
PurchaseOrderID?: string; | ||
PurchaseOrderNumber?: string; | ||
savePath: string; | ||
}) => Promise<void>; | ||
create: (purchaseOrders?: PurchaseOrder | { | ||
@@ -354,0 +359,0 @@ PurchaseOrders: PurchaseOrder[]; |
@@ -771,5 +771,5 @@ "use strict"; | ||
} | ||
else if (args && args.PurchasOrderNumber) { | ||
endpoint = endpoint + '/' + args.PurchasOrderNumber; | ||
delete args.PurchasOrderNumber; | ||
else if (args && args.PurchaseOrderNumber) { | ||
endpoint = endpoint + '/' + args.PurchaseOrderNumber; | ||
delete args.PurchaseOrderNumber; | ||
} | ||
@@ -781,2 +781,19 @@ headers = this.generateHeader(args); | ||
}); }, | ||
savePDF: function (args) { return __awaiter(_this, void 0, void 0, function () { | ||
var endpoint, writeStream; | ||
return __generator(this, function (_a) { | ||
endpoint = 'purchaseorders'; | ||
if (args && args.PurchaseOrderID) { | ||
endpoint = endpoint + '/' + args.PurchaseOrderID; | ||
delete args.PurchaseOrderID; | ||
} | ||
else if (args && args.PurchaseOrderNumber) { | ||
endpoint = endpoint + '/' + args.PurchaseOrderNumber; | ||
delete args.PurchaseOrderNumber; | ||
} | ||
endpoint += utils_1.generateQueryString(args); | ||
writeStream = fs.createWriteStream(args.savePath); | ||
return [2 /*return*/, this.oauth1Client.writeUTF8ResponseToStream(endpoint, 'application/pdf', writeStream)]; | ||
}); | ||
}); }, | ||
create: function (purchaseOrders, args) { return __awaiter(_this, void 0, void 0, function () { | ||
@@ -983,3 +1000,3 @@ var endpoint; | ||
case 0: | ||
endpoint = path + "/" + args.entityId + "/attachments/" + args.fileName; | ||
endpoint = path + "/" + args.entityId + "/attachments/" + utils_1.escapeString(args.fileName); | ||
writeStream = fs.createWriteStream(args.pathToSave); | ||
@@ -996,3 +1013,3 @@ return [4 /*yield*/, this.oauth1Client.writeBinaryResponseToStream(endpoint, args.mimeType, writeStream)]; | ||
return __generator(this, function (_a) { | ||
endpoint = path + "/" + args.entityId + "/attachments/" + args.fileName + utils_1.generateQueryString({ IncludeOnline: args.includeOnline }); | ||
endpoint = path + "/" + args.entityId + "/attachments/" + utils_1.escapeString(args.fileName) + utils_1.generateQueryString({ IncludeOnline: args.includeOnline }); | ||
readStream = fs.createReadStream(args.pathToUpload); | ||
@@ -999,0 +1016,0 @@ fileSize = fs.statSync(args.pathToUpload).size; |
export { AccountingAPIClient } from './AccountingAPIClient'; | ||
export * from './XeroError'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { OAuth1Configuration } from '../../OAuth1HttpClient'; |
@@ -0,0 +0,0 @@ "use strict"; |
export declare const validTestCertPath: () => string; | ||
export declare function testCertString(): string; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ import { BaseAPIClient, XeroClientConfiguration } from '../../BaseAPIClient'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ "use strict"; |
export {}; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /// <reference types="node" /> |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /** @internalapi */ |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ /// <reference types="node" /> |
@@ -0,0 +0,0 @@ "use strict"; |
/** @private */ | ||
export declare function getStringFromFile(location: string): string; | ||
/** @private */ | ||
export declare function escapeString(string: string): string; | ||
/** @private */ | ||
export declare function generateQueryString(args: { | ||
[key: string]: any; | ||
}, addSummarizeErrorsParam?: boolean): string; |
@@ -24,2 +24,7 @@ "use strict"; | ||
/** @private */ | ||
function escapeString(string) { | ||
return querystring.escape(querystring.unescape(string)); | ||
} | ||
exports.escapeString = escapeString; | ||
/** @private */ | ||
function generateQueryString(args, addSummarizeErrorsParam) { | ||
@@ -26,0 +31,0 @@ if (addSummarizeErrorsParam === void 0) { addSummarizeErrorsParam = false; } |
@@ -0,0 +0,0 @@ import { XeroClientConfiguration, BaseAPIClient } from './internals/BaseAPIClient'; |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ export declare class XeroError extends Error { |
@@ -0,0 +0,0 @@ "use strict"; |
@@ -0,0 +0,0 @@ Copyright (c) 2017 Xero Limited |
{ | ||
"name": "xero-node", | ||
"version": "3.0.3", | ||
"version": "3.0.4", | ||
"description": "NodeJS Client for the Xero API, supporting Public, Private and Partner Apps", | ||
@@ -5,0 +5,0 @@ "main": "lib/index.js", |
@@ -21,2 +21,9 @@ [![npm version](https://badge.fury.io/js/xero-node.svg)](https://badge.fury.io/js/xero-node) | ||
- v3.0.4 | ||
- Thanks nickngsr #203 | ||
- escape filename to ensure it is url safe for attachments | ||
- add ability to save purchase order pdf | ||
- fix typo on purchase order number in get request | ||
- v3.0.3 | ||
- Thanks gslisrael. Enable getting creditNotes by CreditNoteNumber #199 | ||
- v3.0.2 | ||
@@ -23,0 +30,0 @@ - Removes some unused deps |
@@ -0,0 +0,0 @@ module.exports = { |
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
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
3944
221
191265