@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.
- package/README.md +142 -50
- package/dist/credentials/GigstackApi.credentials.d.ts +2 -1
- package/dist/credentials/GigstackApi.credentials.js +30 -17
- package/dist/nodes/Gigstack/GenericFunctions.d.ts +5 -0
- package/dist/nodes/Gigstack/GenericFunctions.js +78 -0
- package/dist/nodes/{Gigstack.node.d.ts → Gigstack/Gigstack.node.d.ts} +1 -1
- package/dist/nodes/Gigstack/Gigstack.node.js +952 -0
- package/dist/nodes/Gigstack/GigstackTrigger.node.d.ts +12 -0
- package/dist/nodes/Gigstack/GigstackTrigger.node.js +207 -0
- package/dist/nodes/Gigstack/descriptions/ClientDescription.d.ts +3 -0
- package/dist/nodes/Gigstack/descriptions/ClientDescription.js +595 -0
- package/dist/nodes/Gigstack/descriptions/InvoiceDescription.d.ts +3 -0
- package/dist/nodes/Gigstack/descriptions/InvoiceDescription.js +503 -0
- package/dist/nodes/Gigstack/descriptions/PaymentDescription.d.ts +3 -0
- package/dist/nodes/Gigstack/descriptions/PaymentDescription.js +454 -0
- package/dist/nodes/Gigstack/descriptions/ReceiptDescription.d.ts +3 -0
- package/dist/nodes/Gigstack/descriptions/ReceiptDescription.js +369 -0
- package/dist/nodes/Gigstack/descriptions/ServiceDescription.d.ts +3 -0
- package/dist/nodes/Gigstack/descriptions/ServiceDescription.js +381 -0
- package/dist/nodes/Gigstack/descriptions/TeamDescription.d.ts +3 -0
- package/dist/nodes/Gigstack/descriptions/TeamDescription.js +599 -0
- package/dist/nodes/Gigstack/descriptions/UserDescription.d.ts +3 -0
- package/dist/nodes/Gigstack/descriptions/UserDescription.js +362 -0
- package/dist/nodes/Gigstack/descriptions/WebhookDescription.d.ts +3 -0
- package/dist/nodes/Gigstack/descriptions/WebhookDescription.js +293 -0
- package/dist/nodes/Gigstack/descriptions/index.d.ts +8 -0
- package/dist/nodes/Gigstack/descriptions/index.js +24 -0
- package/dist/nodes/Gigstack/gigstack.svg +1 -0
- package/package.json +65 -71
- package/LICENSE +0 -21
- package/dist/nodes/Gigstack.node.js +0 -1207
- package/dist/nodes/gigstack.svg +0 -4
package/README.md
CHANGED
|
@@ -1,81 +1,173 @@
|
|
|
1
|
-
#
|
|
1
|
+
# n8n-nodes-gigstack
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+

|
|
4
|
+

|
|
5
|
+

|
|
4
6
|
|
|
5
|
-
[
|
|
7
|
+
**n8n community node for [Gigstack](https://gigstack.io)** - Mexican tax compliance, invoicing (CFDI 4.0), and payment processing.
|
|
6
8
|
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
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
|
-
|
|
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
|
-
|
|
23
|
+
```bash
|
|
24
|
+
cd ~/.n8n/custom
|
|
25
|
+
npm install @disruptive-learning/n8n-nodes-gigstack
|
|
26
|
+
```
|
|
20
27
|
|
|
21
|
-
|
|
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
|
-
|
|
30
|
+
```dockerfile
|
|
31
|
+
RUN cd /home/node/.n8n/custom && npm install @disruptive-learning/n8n-nodes-gigstack
|
|
32
|
+
```
|
|
29
33
|
|
|
30
|
-
|
|
34
|
+
---
|
|
31
35
|
|
|
32
|
-
|
|
36
|
+
## Features
|
|
33
37
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
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
|
-
###
|
|
49
|
+
### Trigger Node
|
|
39
50
|
|
|
40
|
-
|
|
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
|
-
|
|
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
|
-
|
|
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
|
-
##
|
|
69
|
+
## Usage Examples
|
|
54
70
|
|
|
55
|
-
|
|
71
|
+
### Create a Client
|
|
56
72
|
|
|
57
|
-
|
|
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
|
-
|
|
60
|
-
- [Gigstack API documentation](https://docs.gigstack.com)
|
|
119
|
+
This node supports **CFDI 4.0** Mexican tax requirements:
|
|
61
120
|
|
|
62
|
-
|
|
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
|
-
|
|
127
|
+
---
|
|
65
128
|
|
|
66
|
-
##
|
|
129
|
+
## Multi-Team Support (Gigstack Connect)
|
|
67
130
|
|
|
68
|
-
|
|
131
|
+
For Gigstack Connect users managing multiple teams:
|
|
69
132
|
|
|
70
|
-
|
|
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
|
-
|
|
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
|
-
|
|
75
|
-
- Fixed Get Payment operation to use correct API endpoint
|
|
76
|
-
- Updated node version to 2
|
|
169
|
+
---
|
|
77
170
|
|
|
78
|
-
|
|
171
|
+
## License
|
|
79
172
|
|
|
80
|
-
-
|
|
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
|
|
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 =
|
|
7
|
-
this.displayName =
|
|
8
|
-
this.documentationUrl =
|
|
6
|
+
this.name = 'gigstackApi';
|
|
7
|
+
this.displayName = 'Gigstack API';
|
|
8
|
+
this.documentationUrl = 'https://docs.gigstack.io';
|
|
9
9
|
this.properties = [
|
|
10
10
|
{
|
|
11
|
-
displayName:
|
|
12
|
-
name:
|
|
13
|
-
type:
|
|
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:
|
|
21
|
-
name:
|
|
22
|
-
type:
|
|
22
|
+
displayName: 'Environment',
|
|
23
|
+
name: 'environment',
|
|
24
|
+
type: 'options',
|
|
23
25
|
options: [
|
|
24
26
|
{
|
|
25
|
-
name:
|
|
26
|
-
value:
|
|
27
|
+
name: 'Production',
|
|
28
|
+
value: 'production',
|
|
27
29
|
},
|
|
28
30
|
{
|
|
29
|
-
name:
|
|
30
|
-
value:
|
|
31
|
+
name: 'Test',
|
|
32
|
+
value: 'test',
|
|
31
33
|
},
|
|
32
34
|
],
|
|
33
|
-
default:
|
|
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:
|
|
40
|
+
type: 'generic',
|
|
38
41
|
properties: {
|
|
39
42
|
headers: {
|
|
40
|
-
Authorization:
|
|
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
|
|
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[][]>;
|