Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 19 additions & 6 deletions nodes/OnlyFans/OnlyFans.node.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,6 @@ import {
type INodeTypeDescription,
type IExecuteFunctions,
type INodeExecutionData,
type IDataObject,
type INodeProperties,
NodeOperationError
} from 'n8n-workflow';
Expand Down Expand Up @@ -95,9 +94,9 @@ export class OnlyFans implements INodeType {
return properties;
}

async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
async execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]> {
const items = this.getInputData();
const returnData: IDataObject[] = [];
const returnData: INodeExecutionData[] = [];

for (let i = 0; i < items.length; i++) {
try {
Expand All @@ -115,16 +114,30 @@ export class OnlyFans implements INodeType {
}

const results = await executeResourceOperation.call(this, resource, operation, i);
returnData.push(...results);
for (const result of results) {
returnData.push({
json: result,
pairedItem: {
item: i,
},
});
}
} catch (error) {
if (this.continueOnFail()) {
returnData.push({ error: error.message });
returnData.push({
json: {
error: (error as Error).message,
},
pairedItem: {
item: i,
},
});
} else {
throw error;
}
}
}

return [this.helpers.returnJsonArray(returnData)];
return [returnData];
}
}
49 changes: 31 additions & 18 deletions nodes/OnlyFans/resources/account/accounts.ts
Original file line number Diff line number Diff line change
@@ -1,24 +1,37 @@
import type { INodeProperties, IDataObject } from 'n8n-workflow';

export const listAccountsResource: INodeProperties[] = [
{
displayName: 'Optionally, Filter by the OnlyFans ID',
name: 'onlyfans_id',
type: 'string',
default: '1234567890',
},
{
displayName: 'Optionally, Filter by the OnlyFans Username',
name: 'onlyfans_username',
type: 'string',
default: 'username',
},
{
displayName: 'Optionally, Filter by the OnlyFans Email',
name: 'onlyfans_email',
type: 'string',
default: 'creator@example.com',
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
default: {},
description: 'Optional filters to refine the account list',
placeholder: 'Add Field',
options: [
{
displayName: 'OnlyFans ID',
name: 'onlyfans_id',
type: 'string',
default: '',
description: 'Optionally, filter by the OnlyFans ID',
},
{
displayName: 'OnlyFans Username',
name: 'onlyfans_username',
type: 'string',
default: '',
description: 'Optionally, filter by the OnlyFans username',
},
{
displayName: 'OnlyFans Email',
name: 'onlyfans_email',
type: 'string',
default: '',
description: 'Optionally, filter by the OnlyFans email',
},
],
},
];

export const listAccountsOperation = {
Expand Down
79 changes: 45 additions & 34 deletions nodes/OnlyFans/resources/chargebacks/chargebacks.ts
Original file line number Diff line number Diff line change
@@ -1,40 +1,51 @@
import type { INodeProperties, IDataObject } from 'n8n-workflow';

export const listChargebacksResource: INodeProperties[] = [
{
displayName: 'Account ID',
name: 'account',
type: 'string',
default: '',
required: true,
},
{
displayName: 'The Start Date for the Chargebacks',
name: 'start_date',
type: 'string',
default: '2025-01-01 00:00:00',
description: 'The start date for the chargebacks. Keep empty to get all.',
},
{
displayName: 'The End Date for the Chargebacks',
name: 'end_date',
type: 'string',
default: '2025-03-31 23:59:59',
description: 'The end date for the chargebacks. Keep empty to get all.',
},
{
displayName: 'Number of Chargebacks to Return (1-100)',
name: 'limit',
type: 'string',
default: '50',
description: 'Number of chargebacks to return (1-100). Default = 10.',
},
{
displayName: 'Number of Chargebacks to Skip, Used for Pagination',
name: 'offset',
type: 'string',
default: '',
},
{
displayName: 'Account ID',
name: 'account',
type: 'string',
default: '',
required: true,
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
default: {},
description: 'Optional filters for listing chargebacks',
placeholder: 'Add Field',
options: [
{
displayName: 'Start Date',
name: 'start_date',
type: 'string',
default: '2025-01-01 00:00:00',
description: 'The start date for the chargebacks. Keep empty to get all.',
},
{
displayName: 'End Date',
name: 'end_date',
type: 'string',
default: '2025-03-31 23:59:59',
description: 'The end date for the chargebacks. Keep empty to get all.',
},
{
displayName: 'Limit',
name: 'limit',
type: 'string',
default: '50',
description: 'Number of chargebacks to return (1-100). Default = 10.',
},
{
displayName: 'Offset',
name: 'offset',
type: 'string',
default: '',
description: 'Number of chargebacks to skip, used for pagination',
},
],
},
];

export const listChargebacksOperation = {
Expand Down
52 changes: 31 additions & 21 deletions nodes/OnlyFans/resources/chargebacks/ratio.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
import type { INodeProperties, IDataObject } from 'n8n-workflow';

export const calculateChargebackRatioResource: INodeProperties[] = [
{
displayName: 'Account ID',
name: 'account',
type: 'string',
default: '',
required: true,
},
{
displayName: 'The Start Date for the Chargeback Ratio',
name: 'start_date',
type: 'string',
default: '2025-01-01 00:00:00',
description: 'The start date for the chargeback ratio. Keep empty to get all.',
},
{
displayName: 'The End Date for the Chargeback Ratio',
name: 'end_date',
type: 'string',
default: '2025-03-31 23:59:59',
description: 'The end date for the chargeback ratio. Keep empty to get all.',
},
{
displayName: 'Account ID',
name: 'account',
type: 'string',
default: '',
required: true,
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
default: {},
description: 'Optional filters for calculating chargeback ratio',
placeholder: 'Add Field',
options: [
{
displayName: 'Start Date',
name: 'start_date',
type: 'string',
default: '2025-01-01 00:00:00',
description: 'The start date for the chargeback ratio. Keep empty to get all.',
},
{
displayName: 'End Date',
name: 'end_date',
type: 'string',
default: '2025-03-31 23:59:59',
description: 'The end date for the chargeback ratio. Keep empty to get all.',
},
],
},
];

export const calculateChargebackRatioOperation = {
Expand Down
52 changes: 31 additions & 21 deletions nodes/OnlyFans/resources/chargebacks/statistics.ts
Original file line number Diff line number Diff line change
@@ -1,27 +1,37 @@
import type { INodeProperties, IDataObject } from 'n8n-workflow';

export const listChargebackStatisticsResource: INodeProperties[] = [
{
displayName: 'Account ID',
name: 'account',
type: 'string',
default: '',
required: true,
},
{
displayName: 'The Start Date for the Chargebacks',
name: 'start_date',
type: 'string',
default: '2025-01-01 00:00:00',
description: 'The start date for the chargebacks. Keep empty to get all.',
},
{
displayName: 'The End Date for the Chargebacks',
name: 'end_date',
type: 'string',
default: '2025-03-31 23:59:59',
description: 'The end date for the chargebacks. Keep empty to get all.',
},
{
displayName: 'Account ID',
name: 'account',
type: 'string',
default: '',
required: true,
},
{
displayName: 'Additional Fields',
name: 'additionalFields',
type: 'collection',
default: {},
description: 'Optional filters for listing chargeback statistics',
placeholder: 'Add Field',
options: [
{
displayName: 'Start Date',
name: 'start_date',
type: 'string',
default: '2025-01-01 00:00:00',
description: 'The start date for the chargebacks. Keep empty to get all.',
},
{
displayName: 'End Date',
name: 'end_date',
type: 'string',
default: '2025-03-31 23:59:59',
description: 'The end date for the chargebacks. Keep empty to get all.',
},
],
},
];

export const listChargebackStatisticsOperation = {
Expand Down
Loading