feat(Invoice Ninja Node): Add more query params to getAll requests (#9238)

Co-authored-by: Jonathan Bennetts <jonathan.bennetts@gmail.com>
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
This commit is contained in:
CodeShakingSheep 2024-10-02 04:09:53 -05:00 committed by GitHub
parent 4db82a91b4
commit 50b723836e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 233 additions and 1 deletions

View file

@ -394,6 +394,44 @@ export const clientFields: INodeProperties[] = [
],
default: 'invoices',
},
{
displayName: 'Status',
name: 'status',
type: 'options',
options: [
{
name: 'Active',
value: 'active',
},
{
name: 'Archived',
value: 'archived',
},
{
name: 'Deleted',
value: 'deleted',
},
],
default: 'active',
},
{
displayName: 'Created At',
name: 'createdAt',
type: 'dateTime',
default: '',
},
{
displayName: 'Updated At',
name: 'updatedAt',
type: 'dateTime',
default: '',
},
{
displayName: 'Is Deleted',
name: 'isDeleted',
type: 'boolean',
default: false,
},
],
},
];

View file

@ -441,6 +441,68 @@ export const invoiceFields: INodeProperties[] = [
],
default: 'client',
},
{
displayName: 'Status',
name: 'status',
type: 'options',
options: [
{
name: 'Active',
value: 'active',
},
{
name: 'Archived',
value: 'archived',
},
{
name: 'Deleted',
value: 'deleted',
},
],
default: 'active',
},
{
displayName: 'Created At',
name: 'createdAt',
type: 'dateTime',
default: '',
},
{
displayName: 'Updated At',
name: 'updatedAt',
type: 'dateTime',
default: '',
},
{
displayName: 'Is Deleted',
name: 'isDeleted',
type: 'boolean',
default: false,
},
{
displayName: 'Client Status',
name: 'clientStatus',
type: 'options',
options: [
{
name: 'All',
value: 'all',
},
{
name: 'Paid',
value: 'paid',
},
{
name: 'Unpaid',
value: 'unpaid',
},
{
name: 'Overdue',
value: 'overdue',
},
],
default: 'all',
},
],
},
];

View file

@ -434,6 +434,18 @@ export class InvoiceNinja implements INodeType {
if (options.include) {
qs.include = options.include as string;
}
if (options.status) {
qs.status = options.status as string;
}
if (options.createdAt) {
qs.created_at = options.createdAt as string;
}
if (options.updatedAt) {
qs.updated_at = options.updatedAt as string;
}
if (options.isDeleted) {
qs.is_deleted = options.isDeleted as boolean;
}
if (returnAll) {
responseData = await invoiceNinjaApiRequestAllItems.call(
this,
@ -619,7 +631,27 @@ export class InvoiceNinja implements INodeType {
qs.include = options.include as string;
}
if (options.invoiceNumber) {
qs.invoice_number = options.invoiceNumber as string;
if (apiVersion === 'v4') {
qs.invoice_number = options.invoiceNumber as string;
} else if (apiVersion === 'v5') {
// eslint-disable-next-line id-denylist
qs.number = options.invoiceNumber as string;
}
}
if (options.status) {
qs.status = options.status as string;
}
if (options.createdAt) {
qs.created_at = options.createdAt as string;
}
if (options.updatedAt) {
qs.updated_at = options.updatedAt as string;
}
if (options.isDeleted) {
qs.is_deleted = options.isDeleted as boolean;
}
if (options.clientStatus) {
qs.client_status = options.clientStatus as string;
}
if (returnAll) {
responseData = await invoiceNinjaApiRequestAllItems.call(
@ -799,6 +831,18 @@ export class InvoiceNinja implements INodeType {
if (options.include) {
qs.include = options.include as string;
}
if (options.status) {
qs.status = options.status as string;
}
if (options.createdAt) {
qs.created_at = options.createdAt as string;
}
if (options.updatedAt) {
qs.updated_at = options.updatedAt as string;
}
if (options.isDeleted) {
qs.is_deleted = options.isDeleted as boolean;
}
if (returnAll) {
responseData = await invoiceNinjaApiRequestAllItems.call(
this,
@ -1178,6 +1222,18 @@ export class InvoiceNinja implements INodeType {
if (options.invoiceNumber) {
qs.invoice_number = options.invoiceNumber as string;
}
if (options.status) {
qs.status = options.status as string;
}
if (options.createdAt) {
qs.created_at = options.createdAt as string;
}
if (options.updatedAt) {
qs.updated_at = options.updatedAt as string;
}
if (options.isDeleted) {
qs.is_deleted = options.isDeleted as boolean;
}
if (returnAll) {
responseData = await invoiceNinjaApiRequestAllItems.call(
this,

View file

@ -584,6 +584,44 @@ export const paymentFields: INodeProperties[] = [
],
default: 'client',
},
{
displayName: 'Status',
name: 'status',
type: 'options',
options: [
{
name: 'Active',
value: 'active',
},
{
name: 'Archived',
value: 'archived',
},
{
name: 'Deleted',
value: 'deleted',
},
],
default: 'active',
},
{
displayName: 'Created At',
name: 'createdAt',
type: 'dateTime',
default: '',
},
{
displayName: 'Updated At',
name: 'updatedAt',
type: 'dateTime',
default: '',
},
{
displayName: 'Is Deleted',
name: 'isDeleted',
type: 'boolean',
default: false,
},
],
},
];

View file

@ -435,6 +435,44 @@ export const quoteFields: INodeProperties[] = [
],
default: 'client',
},
{
displayName: 'Status',
name: 'status',
type: 'options',
options: [
{
name: 'Active',
value: 'active',
},
{
name: 'Archived',
value: 'archived',
},
{
name: 'Deleted',
value: 'deleted',
},
],
default: 'active',
},
{
displayName: 'Created At',
name: 'createdAt',
type: 'dateTime',
default: '',
},
{
displayName: 'Updated At',
name: 'updatedAt',
type: 'dateTime',
default: '',
},
{
displayName: 'Is Deleted',
name: 'isDeleted',
type: 'boolean',
default: false,
},
],
},
];