Skip to content

Commit

Permalink
feat(Invoice Ninja Node): Add more query params to getAll requests (#…
Browse files Browse the repository at this point in the history
…9238)

Co-authored-by: Jonathan Bennetts <jonathan.bennetts@gmail.com>
Co-authored-by: कारतोफ्फेलस्क्रिप्ट™ <aditya@netroy.in>
  • Loading branch information
3 people authored Oct 2, 2024
1 parent 4db82a9 commit 50b7238
Show file tree
Hide file tree
Showing 5 changed files with 233 additions and 1 deletion.
38 changes: 38 additions & 0 deletions packages/nodes-base/nodes/InvoiceNinja/ClientDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
],
},
];
62 changes: 62 additions & 0 deletions packages/nodes-base/nodes/InvoiceNinja/InvoiceDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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',
},
],
},
];
58 changes: 57 additions & 1 deletion packages/nodes-base/nodes/InvoiceNinja/InvoiceNinja.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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(
Expand Down Expand Up @@ -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,
Expand Down Expand Up @@ -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,
Expand Down
38 changes: 38 additions & 0 deletions packages/nodes-base/nodes/InvoiceNinja/PaymentDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
],
},
];
38 changes: 38 additions & 0 deletions packages/nodes-base/nodes/InvoiceNinja/QuoteDescription.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
},
],
},
];

0 comments on commit 50b7238

Please sign in to comment.