Add Event resource and update branding
- Add Event resource with get and getAll operations - Implement event tracking for Strike API events - Update node icon from strike.svg to strike.png - Add comprehensive README.md with disclaimer about AI-assisted development - Update CLAUDE.MD documentation with Event resource details - Build dist files with new Event operations Changes include: - New EventDescription.ts with event operations - Updated Strike.node.ts to handle event resource - Icon changed to PNG format for better compatibility - Production-ready README with usage examples and warnings 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
37
dist/nodes/Strike/Strike.node.js
vendored
37
dist/nodes/Strike/Strike.node.js
vendored
@ -8,7 +8,7 @@ class Strike {
|
||||
this.description = {
|
||||
displayName: 'Strike',
|
||||
name: 'strike',
|
||||
icon: 'file:strike.svg',
|
||||
icon: 'file:strike.png',
|
||||
group: ['transform'],
|
||||
version: 1,
|
||||
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
||||
@ -47,6 +47,10 @@ class Strike {
|
||||
name: 'Deposit',
|
||||
value: 'deposit',
|
||||
},
|
||||
{
|
||||
name: 'Event',
|
||||
value: 'event',
|
||||
},
|
||||
{
|
||||
name: 'Invoice',
|
||||
value: 'invoice',
|
||||
@ -79,6 +83,8 @@ class Strike {
|
||||
...descriptions_1.currencyExchangeFields,
|
||||
...descriptions_1.depositOperations,
|
||||
...descriptions_1.depositFields,
|
||||
...descriptions_1.eventOperations,
|
||||
...descriptions_1.eventFields,
|
||||
...descriptions_1.invoiceOperations,
|
||||
...descriptions_1.invoiceFields,
|
||||
...descriptions_1.paymentOperations,
|
||||
@ -153,6 +159,35 @@ class Strike {
|
||||
}
|
||||
}
|
||||
// ----------------------------------------
|
||||
// event
|
||||
// ----------------------------------------
|
||||
if (resource === 'event') {
|
||||
if (operation === 'get') {
|
||||
const eventId = this.getNodeParameter('eventId', i);
|
||||
responseData = await StrikeApi_1.strikeApiRequest.call(this, 'GET', `/events/${eventId}`);
|
||||
}
|
||||
else if (operation === 'getAll') {
|
||||
const returnAll = this.getNodeParameter('returnAll', i);
|
||||
const filters = this.getNodeParameter('filters', i);
|
||||
const query = {};
|
||||
if (filters.filter) {
|
||||
query.$filter = filters.filter;
|
||||
}
|
||||
if (filters.orderBy) {
|
||||
query.$orderby = filters.orderBy;
|
||||
}
|
||||
if (returnAll) {
|
||||
responseData = await StrikeApi_1.strikeApiRequestAllItems.call(this, 'GET', '/events', {}, query);
|
||||
}
|
||||
else {
|
||||
const limit = this.getNodeParameter('limit', i);
|
||||
query.$top = limit;
|
||||
responseData = await StrikeApi_1.strikeApiRequest.call(this, 'GET', '/events', {}, query);
|
||||
responseData = responseData.items || responseData;
|
||||
}
|
||||
}
|
||||
}
|
||||
// ----------------------------------------
|
||||
// deposit
|
||||
// ----------------------------------------
|
||||
if (resource === 'deposit') {
|
||||
|
||||
3
dist/nodes/Strike/descriptions/EventDescription.d.ts
vendored
Normal file
3
dist/nodes/Strike/descriptions/EventDescription.d.ts
vendored
Normal file
@ -0,0 +1,3 @@
|
||||
import type { INodeProperties } from 'n8n-workflow';
|
||||
export declare const eventOperations: INodeProperties[];
|
||||
export declare const eventFields: INodeProperties[];
|
||||
112
dist/nodes/Strike/descriptions/EventDescription.js
vendored
Normal file
112
dist/nodes/Strike/descriptions/EventDescription.js
vendored
Normal file
@ -0,0 +1,112 @@
|
||||
"use strict";
|
||||
Object.defineProperty(exports, "__esModule", { value: true });
|
||||
exports.eventFields = exports.eventOperations = void 0;
|
||||
exports.eventOperations = [
|
||||
{
|
||||
displayName: 'Operation',
|
||||
name: 'operation',
|
||||
type: 'options',
|
||||
noDataExpression: true,
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['event'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
name: 'Get',
|
||||
value: 'get',
|
||||
description: 'Get an event by ID',
|
||||
action: 'Get an event',
|
||||
},
|
||||
{
|
||||
name: 'Get Many',
|
||||
value: 'getAll',
|
||||
description: 'Get many events',
|
||||
action: 'Get many events',
|
||||
},
|
||||
],
|
||||
default: 'getAll',
|
||||
},
|
||||
];
|
||||
exports.eventFields = [
|
||||
// ----------------------------------
|
||||
// event:get
|
||||
// ----------------------------------
|
||||
{
|
||||
displayName: 'Event ID',
|
||||
name: 'eventId',
|
||||
type: 'string',
|
||||
required: true,
|
||||
default: '',
|
||||
description: 'The ID of the event to retrieve',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['event'],
|
||||
operation: ['get'],
|
||||
},
|
||||
},
|
||||
},
|
||||
// ----------------------------------
|
||||
// event:getAll
|
||||
// ----------------------------------
|
||||
{
|
||||
displayName: 'Return All',
|
||||
name: 'returnAll',
|
||||
type: 'boolean',
|
||||
default: false,
|
||||
description: 'Whether to return all results or only up to a given limit',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['event'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Limit',
|
||||
name: 'limit',
|
||||
type: 'number',
|
||||
typeOptions: {
|
||||
minValue: 1,
|
||||
},
|
||||
default: 50,
|
||||
description: 'Max number of results to return',
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['event'],
|
||||
operation: ['getAll'],
|
||||
returnAll: [false],
|
||||
},
|
||||
},
|
||||
},
|
||||
{
|
||||
displayName: 'Filters',
|
||||
name: 'filters',
|
||||
type: 'collection',
|
||||
placeholder: 'Add Filter',
|
||||
default: {},
|
||||
displayOptions: {
|
||||
show: {
|
||||
resource: ['event'],
|
||||
operation: ['getAll'],
|
||||
},
|
||||
},
|
||||
options: [
|
||||
{
|
||||
displayName: 'Filter (OData)',
|
||||
name: 'filter',
|
||||
type: 'string',
|
||||
default: '',
|
||||
description: 'OData filter expression (e.g., eventType eq \'invoice.created\')',
|
||||
},
|
||||
{
|
||||
displayName: 'Order By',
|
||||
name: 'orderBy',
|
||||
type: 'string',
|
||||
default: 'created desc',
|
||||
description: 'OData orderby expression',
|
||||
},
|
||||
],
|
||||
},
|
||||
];
|
||||
1
dist/nodes/Strike/descriptions/index.d.ts
vendored
1
dist/nodes/Strike/descriptions/index.d.ts
vendored
@ -7,3 +7,4 @@ export * from './CurrencyExchangeDescription';
|
||||
export * from './RatesDescription';
|
||||
export * from './AccountDescription';
|
||||
export * from './PaymentMethodDescription';
|
||||
export * from './EventDescription';
|
||||
|
||||
1
dist/nodes/Strike/descriptions/index.js
vendored
1
dist/nodes/Strike/descriptions/index.js
vendored
@ -23,3 +23,4 @@ __exportStar(require("./CurrencyExchangeDescription"), exports);
|
||||
__exportStar(require("./RatesDescription"), exports);
|
||||
__exportStar(require("./AccountDescription"), exports);
|
||||
__exportStar(require("./PaymentMethodDescription"), exports);
|
||||
__exportStar(require("./EventDescription"), exports);
|
||||
|
||||
Reference in New Issue
Block a user