@disruptive-learning/n8n-nodes-gigstack 1.1.1 → 1.1.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (32) hide show
  1. package/README.md +142 -50
  2. package/dist/credentials/GigstackApi.credentials.d.ts +2 -1
  3. package/dist/credentials/GigstackApi.credentials.js +30 -17
  4. package/dist/nodes/Gigstack/GenericFunctions.d.ts +5 -0
  5. package/dist/nodes/Gigstack/GenericFunctions.js +78 -0
  6. package/dist/nodes/{Gigstack.node.d.ts → Gigstack/Gigstack.node.d.ts} +1 -1
  7. package/dist/nodes/Gigstack/Gigstack.node.js +952 -0
  8. package/dist/nodes/Gigstack/GigstackTrigger.node.d.ts +12 -0
  9. package/dist/nodes/Gigstack/GigstackTrigger.node.js +207 -0
  10. package/dist/nodes/Gigstack/descriptions/ClientDescription.d.ts +3 -0
  11. package/dist/nodes/Gigstack/descriptions/ClientDescription.js +595 -0
  12. package/dist/nodes/Gigstack/descriptions/InvoiceDescription.d.ts +3 -0
  13. package/dist/nodes/Gigstack/descriptions/InvoiceDescription.js +503 -0
  14. package/dist/nodes/Gigstack/descriptions/PaymentDescription.d.ts +3 -0
  15. package/dist/nodes/Gigstack/descriptions/PaymentDescription.js +454 -0
  16. package/dist/nodes/Gigstack/descriptions/ReceiptDescription.d.ts +3 -0
  17. package/dist/nodes/Gigstack/descriptions/ReceiptDescription.js +369 -0
  18. package/dist/nodes/Gigstack/descriptions/ServiceDescription.d.ts +3 -0
  19. package/dist/nodes/Gigstack/descriptions/ServiceDescription.js +381 -0
  20. package/dist/nodes/Gigstack/descriptions/TeamDescription.d.ts +3 -0
  21. package/dist/nodes/Gigstack/descriptions/TeamDescription.js +599 -0
  22. package/dist/nodes/Gigstack/descriptions/UserDescription.d.ts +3 -0
  23. package/dist/nodes/Gigstack/descriptions/UserDescription.js +362 -0
  24. package/dist/nodes/Gigstack/descriptions/WebhookDescription.d.ts +3 -0
  25. package/dist/nodes/Gigstack/descriptions/WebhookDescription.js +293 -0
  26. package/dist/nodes/Gigstack/descriptions/index.d.ts +8 -0
  27. package/dist/nodes/Gigstack/descriptions/index.js +24 -0
  28. package/dist/nodes/Gigstack/gigstack.svg +1 -0
  29. package/package.json +65 -71
  30. package/LICENSE +0 -21
  31. package/dist/nodes/Gigstack.node.js +0 -1207
  32. package/dist/nodes/gigstack.svg +0 -4
package/README.md CHANGED
@@ -1,81 +1,173 @@
1
- # @disruptive-learning/n8n-nodes-gigstack
1
+ # n8n-nodes-gigstack
2
2
 
3
- This is a community node for [n8n](https://n8n.io/) that integrates with the [Gigstack API](https://gigstack.com). It allows you to create and manage payments and invoices directly from your n8n workflows.
3
+ ![npm](https://img.shields.io/npm/v/@disruptive-learning/n8n-nodes-gigstack)
4
+ ![license](https://img.shields.io/npm/l/@disruptive-learning/n8n-nodes-gigstack)
5
+ ![n8n](https://img.shields.io/badge/n8n-community--node-orange)
4
6
 
5
- [n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
7
+ **n8n community node for [Gigstack](https://gigstack.io)** - Mexican tax compliance, invoicing (CFDI 4.0), and payment processing.
6
8
 
7
- [Installation](#installation)
8
- [Operations](#operations)
9
- [Credentials](#credentials)
10
- [Compatibility](#compatibility)
11
- [Resources](#resources)
12
- [Version history](#version-history)
13
- [Security](#security)
9
+ Automate your Mexican billing workflows with SAT-compliant invoices, receipts, payments, and more.
10
+
11
+ ---
14
12
 
15
13
  ## Installation
16
14
 
17
- Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
15
+ ### In n8n (Recommended)
16
+
17
+ 1. Go to **Settings** > **Community Nodes**
18
+ 2. Enter `@disruptive-learning/n8n-nodes-gigstack`
19
+ 3. Click **Install**
20
+
21
+ ### Manual Installation
18
22
 
19
- ### Community Node Installation
23
+ ```bash
24
+ cd ~/.n8n/custom
25
+ npm install @disruptive-learning/n8n-nodes-gigstack
26
+ ```
20
27
 
21
- 1. Open your n8n instance
22
- 2. Go to **Settings** > **Community Nodes**
23
- 3. Select **Install**
24
- 4. Enter `@disruptive-learning/n8n-nodes-gigstack` in **Enter npm package name**
25
- 5. Agree to the risks of using community nodes: select **I understand the risks of installing unverified code from a third party**
26
- 6. Select **Install**
28
+ ### Docker
27
29
 
28
- After installing the node, you can use it like any other node. If you're using Docker, you need to restart your n8n container for the node to show up.
30
+ ```dockerfile
31
+ RUN cd /home/node/.n8n/custom && npm install @disruptive-learning/n8n-nodes-gigstack
32
+ ```
29
33
 
30
- ## Operations
34
+ ---
31
35
 
32
- ### Payment Operations
36
+ ## Features
33
37
 
34
- - **Create**: Create a new payment
35
- - **Get**: Get payment details
36
- - **Register**: Register a new payment
38
+ | Resource | Operations |
39
+ |----------|------------|
40
+ | **Clients** | Create, Get, Get All, Update, Delete, Validate (SAT), Customer Portal, Stamp Pending Receipts |
41
+ | **Invoices** | Create Income (CFDI I), Create Egress (CFDI E), Get, Get All, Cancel, Get Files (PDF/XML) |
42
+ | **Payments** | Request, Register, Get, Get All, Cancel, Mark as Paid, Refund |
43
+ | **Receipts** | Create, Get, Get All, Cancel, Stamp (convert to CFDI) |
44
+ | **Services** | Create, Get, Get All, Update, Delete |
45
+ | **Teams** | Create, Get, Get All, Update, Add/Remove Members, Series Management, Settings |
46
+ | **Users** | Create, Get, Get All, Update, Reset Password, Login Link |
47
+ | **Webhooks** | Create, Get, Get All, Update, Delete |
37
48
 
38
- ### Invoice Operations
49
+ ### Trigger Node
39
50
 
40
- - **Create**: Create a new invoice with detailed information
51
+ Listen for real-time events:
52
+ - `invoice.created`, `invoice.cancelled`
53
+ - `payment.completed`, `payment.failed`
54
+ - `receipt.stamped`
55
+ - And more...
56
+
57
+ ---
41
58
 
42
59
  ## Credentials
43
60
 
44
- To use this node, you need to configure your Gigstack API credentials in n8n:
61
+ 1. Get your API key from [Gigstack Dashboard](https://app.gigstack.io/settings/api)
62
+ 2. In n8n, go to **Credentials** > **New Credential**
63
+ 3. Search for **Gigstack API**
64
+ 4. Enter your API key
65
+ 5. Select environment: **Production** or **Sandbox**
45
66
 
46
- 1. Go to **Settings** > **Credentials**
47
- 2. Click on **New Credential**
48
- 3. Select **Gigstack API**
49
- 4. Enter your API Key
50
- 5. Select the environment (Production or Sandbox)
51
- 6. Save the credential
67
+ ---
52
68
 
53
- ## Compatibility
69
+ ## Usage Examples
54
70
 
55
- This node has been tested with n8n version 0.214.0 and Gigstack API v1.
71
+ ### Create a Client
56
72
 
57
- ## Resources
73
+ ```json
74
+ {
75
+ "email": "cliente@empresa.mx",
76
+ "name": "Juan Perez",
77
+ "legal_name": "Juan Perez Garcia",
78
+ "tax_id": "PEGJ850101ABC",
79
+ "tax_system": "612",
80
+ "zip": "06600"
81
+ }
82
+ ```
83
+
84
+ ### Create an Invoice (CFDI)
85
+
86
+ ```json
87
+ {
88
+ "clientId": "client_abc123",
89
+ "items": [
90
+ {
91
+ "description": "Servicio de consultoría",
92
+ "quantity": 1,
93
+ "unit_price": 5000,
94
+ "product_key": "80141503",
95
+ "unit_key": "E48"
96
+ }
97
+ ],
98
+ "payment_method": "PUE",
99
+ "payment_form": "03",
100
+ "use": "G03"
101
+ }
102
+ ```
103
+
104
+ ### Request Payment
105
+
106
+ ```json
107
+ {
108
+ "clientId": "client_abc123",
109
+ "amount": 5800,
110
+ "currency": "MXN",
111
+ "description": "Payment for consulting services"
112
+ }
113
+ ```
114
+
115
+ ---
116
+
117
+ ## SAT Compliance
58
118
 
59
- - [n8n community nodes documentation](https://docs.n8n.io/integrations/community-nodes/)
60
- - [Gigstack API documentation](https://docs.gigstack.com)
119
+ This node supports **CFDI 4.0** Mexican tax requirements:
61
120
 
62
- ## Security
121
+ - **Tax Regimes** (Regimen Fiscal): 601, 603, 605, 606, 612, 616, 621, 625, 626
122
+ - **CFDI Uses** (Uso de CFDI): G01, G02, G03, P01, S01, and more
123
+ - **Payment Methods**: PUE (single payment), PPD (partial/deferred)
124
+ - **Payment Forms**: Cash, Transfer, Credit Card, etc. (01-99)
125
+ - **Cancellation Motives**: 01, 02, 03, 04
63
126
 
64
- > **Note**: This package has some vulnerabilities in its development dependencies. These vulnerabilities are only present during development and do not affect the published package that users install. The production dependencies are kept up-to-date and secure.
127
+ ---
65
128
 
66
- ## Version history
129
+ ## Multi-Team Support (Gigstack Connect)
67
130
 
68
- ### 1.1.1
131
+ For Gigstack Connect users managing multiple teams:
69
132
 
70
- - [Add description of changes in this version]
133
+ 1. Add the **Team ID** field in any operation
134
+ 2. Leave empty to use your default team
135
+ 3. Specify a team ID to operate on behalf of that team
136
+
137
+ ---
138
+
139
+ ## Development
140
+
141
+ ```bash
142
+ # Clone the repository
143
+ git clone https://github.com/disruptive-learning/n8n_v2.git
144
+ cd n8n_v2
145
+
146
+ # Install dependencies
147
+ npm install
148
+
149
+ # Build
150
+ npm run build
151
+
152
+ # Sync with Gigstack API (check for updates)
153
+ npm run sync-swagger
154
+
155
+ # Link for local testing
156
+ npm link
157
+ cd ~/.n8n/custom && npm link @disruptive-learning/n8n-nodes-gigstack
158
+ ```
159
+
160
+ ---
161
+
162
+ ## Resources
71
163
 
72
- ### 1.1.0
164
+ - [Gigstack Website](https://gigstack.io)
165
+ - [Gigstack API Documentation](https://docs.gigstack.io)
166
+ - [n8n Community Nodes](https://docs.n8n.io/integrations/community-nodes/)
167
+ - [Report Issues](https://github.com/disruptive-learning/n8n_v2/issues)
73
168
 
74
- - Added Invoice resource with Create operation
75
- - Fixed Get Payment operation to use correct API endpoint
76
- - Updated node version to 2
169
+ ---
77
170
 
78
- ### 1.0.0
171
+ ## License
79
172
 
80
- - Initial release
81
- - Added Payment resource with Create, Get, and Register operations
173
+ [MIT](LICENSE) - Built with love by [Gigstack](https://gigstack.io) and [Disruptive Learning](https://github.com/disruptive-learning)
@@ -1,8 +1,9 @@
1
- import { IAuthenticateGeneric, ICredentialType, INodeProperties } from "n8n-workflow";
1
+ import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
2
2
  export declare class GigstackApi implements ICredentialType {
3
3
  name: string;
4
4
  displayName: string;
5
5
  documentationUrl: string;
6
6
  properties: INodeProperties[];
7
7
  authenticate: IAuthenticateGeneric;
8
+ test: ICredentialTestRequest;
8
9
  }
@@ -3,41 +3,54 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.GigstackApi = void 0;
4
4
  class GigstackApi {
5
5
  constructor() {
6
- this.name = "gigstackApi";
7
- this.displayName = "Gigstack API";
8
- this.documentationUrl = "https://github.com/disruptive-learning/gigstack_n8n/blob/main/README.md#credentials";
6
+ this.name = 'gigstackApi';
7
+ this.displayName = 'Gigstack API';
8
+ this.documentationUrl = 'https://docs.gigstack.io';
9
9
  this.properties = [
10
10
  {
11
- displayName: "API Key",
12
- name: "apiKey",
13
- type: "string",
11
+ displayName: 'API Token',
12
+ name: 'apiToken',
13
+ type: 'string',
14
14
  typeOptions: {
15
15
  password: true,
16
16
  },
17
- default: "",
17
+ default: '',
18
+ required: true,
19
+ description: 'Your Gigstack API token. Get it from <a href="https://app.gigstack.pro/settings?tab=api" target="_blank">app.gigstack.pro/settings</a>',
18
20
  },
19
21
  {
20
- displayName: "Environment",
21
- name: "environment",
22
- type: "options",
22
+ displayName: 'Environment',
23
+ name: 'environment',
24
+ type: 'options',
23
25
  options: [
24
26
  {
25
- name: "Production",
26
- value: "production",
27
+ name: 'Production',
28
+ value: 'production',
27
29
  },
28
30
  {
29
- name: "Sandbox",
30
- value: "sandbox",
31
+ name: 'Test',
32
+ value: 'test',
31
33
  },
32
34
  ],
33
- default: "production",
35
+ default: 'production',
36
+ description: 'The environment to use. Test mode uses test data and does not create real invoices.',
34
37
  },
35
38
  ];
36
39
  this.authenticate = {
37
- type: "generic",
40
+ type: 'generic',
38
41
  properties: {
39
42
  headers: {
40
- Authorization: "=Bearer {{$credentials.apiKey}}",
43
+ Authorization: '=Bearer {{$credentials.apiToken}}',
44
+ },
45
+ },
46
+ };
47
+ this.test = {
48
+ request: {
49
+ baseURL: 'https://api.gigstack.io/v2',
50
+ url: '/teams',
51
+ method: 'GET',
52
+ qs: {
53
+ limit: 1,
41
54
  },
42
55
  },
43
56
  };
@@ -0,0 +1,5 @@
1
+ import type { IDataObject, IExecuteFunctions, IHookFunctions, IHttpRequestMethods, ILoadOptionsFunctions } from 'n8n-workflow';
2
+ export declare function gigstackApiRequest(this: IExecuteFunctions | ILoadOptionsFunctions | IHookFunctions, method: IHttpRequestMethods, endpoint: string, body?: IDataObject, qs?: IDataObject): Promise<IDataObject>;
3
+ export declare function gigstackApiRequestAllItems(this: IExecuteFunctions | ILoadOptionsFunctions, method: IHttpRequestMethods, endpoint: string, body?: IDataObject, qs?: IDataObject, limit?: number): Promise<IDataObject[]>;
4
+ export declare function simplifyResponse(response: IDataObject): IDataObject;
5
+ export declare function buildFilterQuery(filters: IDataObject): IDataObject;
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.gigstackApiRequest = gigstackApiRequest;
4
+ exports.gigstackApiRequestAllItems = gigstackApiRequestAllItems;
5
+ exports.simplifyResponse = simplifyResponse;
6
+ exports.buildFilterQuery = buildFilterQuery;
7
+ const n8n_workflow_1 = require("n8n-workflow");
8
+ async function gigstackApiRequest(method, endpoint, body = {}, qs = {}) {
9
+ const options = {
10
+ method,
11
+ body,
12
+ qs,
13
+ url: `https://api.gigstack.io/v2${endpoint}`,
14
+ json: true,
15
+ };
16
+ if (Object.keys(body).length === 0) {
17
+ delete options.body;
18
+ }
19
+ if (Object.keys(qs).length === 0) {
20
+ delete options.qs;
21
+ }
22
+ try {
23
+ const response = await this.helpers.httpRequestWithAuthentication.call(this, 'gigstackApi', options);
24
+ return response;
25
+ }
26
+ catch (error) {
27
+ throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
28
+ }
29
+ }
30
+ async function gigstackApiRequestAllItems(method, endpoint, body = {}, qs = {}, limit) {
31
+ const returnData = [];
32
+ let responseData;
33
+ let nextCursor;
34
+ qs.limit = qs.limit || 100;
35
+ do {
36
+ if (nextCursor) {
37
+ qs.next = nextCursor;
38
+ }
39
+ responseData = await gigstackApiRequest.call(this, method, endpoint, body, qs);
40
+ const data = responseData.data;
41
+ if (data) {
42
+ returnData.push(...data);
43
+ }
44
+ nextCursor = responseData.next;
45
+ if (limit && returnData.length >= limit) {
46
+ return returnData.slice(0, limit);
47
+ }
48
+ } while (responseData.has_more === true && nextCursor);
49
+ return returnData;
50
+ }
51
+ function simplifyResponse(response) {
52
+ if (response.data !== undefined) {
53
+ return response.data;
54
+ }
55
+ return response;
56
+ }
57
+ function buildFilterQuery(filters) {
58
+ const qs = {};
59
+ if (filters.limit) {
60
+ qs.limit = filters.limit;
61
+ }
62
+ if (filters.orderBy) {
63
+ qs.order_by = filters.orderBy;
64
+ }
65
+ if (filters.sort) {
66
+ qs.sort = filters.sort;
67
+ }
68
+ if (filters.team) {
69
+ qs.team = filters.team;
70
+ }
71
+ if (filters.createdAfter) {
72
+ qs['created[gte]'] = Math.floor(new Date(filters.createdAfter).getTime() / 1000);
73
+ }
74
+ if (filters.createdBefore) {
75
+ qs['created[lte]'] = Math.floor(new Date(filters.createdBefore).getTime() / 1000);
76
+ }
77
+ return qs;
78
+ }
@@ -1,4 +1,4 @@
1
- import { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from "n8n-workflow";
1
+ import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
2
2
  export declare class Gigstack implements INodeType {
3
3
  description: INodeTypeDescription;
4
4
  execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;