mirror of
https://github.com/n8n-io/n8n.git
synced 2024-12-25 04:34:06 -08:00
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:
parent
4db82a91b4
commit
50b723836e
|
@ -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,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
|
|
@ -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',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
|
|
@ -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) {
|
||||
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,
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
|
|
@ -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,
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
|
|
Loading…
Reference in a new issue