n8n-nodes-tiendanube-alldo 1.0.0
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 +43 -0
- package/credentials/TiendanubeApi.credentials.ts +36 -0
- package/dist/credentials/TiendanubeApi.credentials.js +36 -0
- package/dist/credentials/TiendanubeApi.credentials.js.map +1 -0
- package/dist/nodes/Tiendanube/CustomerDescription.js +149 -0
- package/dist/nodes/Tiendanube/CustomerDescription.js.map +1 -0
- package/dist/nodes/Tiendanube/ExtraDescription.js +162 -0
- package/dist/nodes/Tiendanube/ExtraDescription.js.map +1 -0
- package/dist/nodes/Tiendanube/GenericFunctions.js +34 -0
- package/dist/nodes/Tiendanube/GenericFunctions.js.map +1 -0
- package/dist/nodes/Tiendanube/OrderDescription.js +129 -0
- package/dist/nodes/Tiendanube/OrderDescription.js.map +1 -0
- package/dist/nodes/Tiendanube/ProductDescription.js +138 -0
- package/dist/nodes/Tiendanube/ProductDescription.js.map +1 -0
- package/dist/nodes/Tiendanube/Tiendanube.node.js +244 -0
- package/dist/nodes/Tiendanube/Tiendanube.node.js.map +1 -0
- package/dist/nodes/TiendanubeTrigger/TiendanubeTrigger.node.js +133 -0
- package/dist/nodes/TiendanubeTrigger/TiendanubeTrigger.node.js.map +1 -0
- package/index.ts +4 -0
- package/nodes/Tiendanube/CustomerDescription.ts +150 -0
- package/nodes/Tiendanube/ExtraDescription.ts +163 -0
- package/nodes/Tiendanube/GenericFunctions.ts +53 -0
- package/nodes/Tiendanube/OrderDescription.ts +130 -0
- package/nodes/Tiendanube/ProductDescription.ts +139 -0
- package/nodes/Tiendanube/Tiendanube.node.ts +271 -0
- package/nodes/TiendanubeTrigger/TiendanubeTrigger.node.ts +144 -0
- package/package.json +47 -0
- package/tsconfig.json +34 -0
package/README.md
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
# n8n-nodes-tiendanube
|
|
2
|
+
|
|
3
|
+
This is an n8n community node package for Tiendanube (Nuvemshop). It allows you to automate workflows with your Tiendanube store.
|
|
4
|
+
|
|
5
|
+
[n8n](https://n8n.io/) is a fair-code licensed workflow automation platform.
|
|
6
|
+
|
|
7
|
+
## Installation
|
|
8
|
+
|
|
9
|
+
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n documentation.
|
|
10
|
+
|
|
11
|
+
## Credentials
|
|
12
|
+
|
|
13
|
+
You need an **Access Token** and your **Store ID** from Tiendanube/Nuvemshop.
|
|
14
|
+
1. Create an App in your Tiendanube Partner Portal.
|
|
15
|
+
2. Install the app in your store to get the Access Token.
|
|
16
|
+
3. Enter the Token and Store ID in the n8n credentials.
|
|
17
|
+
|
|
18
|
+
## Operations
|
|
19
|
+
|
|
20
|
+
### Tiendanube Node
|
|
21
|
+
Supports the following resources:
|
|
22
|
+
- **Product**: Create, Update, Delete, Get, Get All
|
|
23
|
+
- **Product Image**: Manage product images
|
|
24
|
+
- **Product Variant**: Manage product variants
|
|
25
|
+
- **Order**: Get, Get All, Update, Operations (Open, Close, Cancel)
|
|
26
|
+
- **Customer**: Create, Update, Delete, Get, Get All
|
|
27
|
+
- **Category**: Manage categories
|
|
28
|
+
- **Coupon**: Manage coupons
|
|
29
|
+
- **Abandoned Checkout**: Manage abandoned checkouts
|
|
30
|
+
- **Location**: Manage locations/shipping carriers
|
|
31
|
+
- **Cart**: Manage carts
|
|
32
|
+
- **Page**: Manage pages
|
|
33
|
+
|
|
34
|
+
### Tiendanube Trigger
|
|
35
|
+
Recieve webhooks from your store for events like:
|
|
36
|
+
- Order Created/Updated
|
|
37
|
+
- Product Created/Updated/Deleted
|
|
38
|
+
- Customer Created/Updated
|
|
39
|
+
- Checkout Created/Updated
|
|
40
|
+
|
|
41
|
+
## License
|
|
42
|
+
|
|
43
|
+
MIT
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ICredentialType,
|
|
3
|
+
INodeProperties,
|
|
4
|
+
} from 'n8n-workflow';
|
|
5
|
+
|
|
6
|
+
export class TiendanubeApi implements ICredentialType {
|
|
7
|
+
name = 'tiendanubeApi';
|
|
8
|
+
displayName = 'Tiendanube API';
|
|
9
|
+
documentationUrl = 'https://tiendanube.github.io/api-documentation/intro';
|
|
10
|
+
properties: INodeProperties[] = [
|
|
11
|
+
{
|
|
12
|
+
displayName: 'Access Token',
|
|
13
|
+
name: 'accessToken',
|
|
14
|
+
type: 'string',
|
|
15
|
+
default: '',
|
|
16
|
+
required: true,
|
|
17
|
+
description: 'The Access Token for the Tiendanube Store API',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
displayName: 'Store ID',
|
|
21
|
+
name: 'storeId',
|
|
22
|
+
type: 'string',
|
|
23
|
+
default: '',
|
|
24
|
+
required: true,
|
|
25
|
+
description: 'The ID of your Tiendanube/Nuvemshop store',
|
|
26
|
+
},
|
|
27
|
+
{
|
|
28
|
+
displayName: 'User Agent',
|
|
29
|
+
name: 'userAgent',
|
|
30
|
+
type: 'string',
|
|
31
|
+
default: 'n8n-node (email@example.com)',
|
|
32
|
+
required: true,
|
|
33
|
+
description: 'User Agent string required by Tiendanube (usually your app name + contact email)',
|
|
34
|
+
},
|
|
35
|
+
];
|
|
36
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.TiendanubeApi = void 0;
|
|
4
|
+
class TiendanubeApi {
|
|
5
|
+
name = 'tiendanubeApi';
|
|
6
|
+
displayName = 'Tiendanube API';
|
|
7
|
+
documentationUrl = 'https://tiendanube.github.io/api-documentation/intro';
|
|
8
|
+
properties = [
|
|
9
|
+
{
|
|
10
|
+
displayName: 'Access Token',
|
|
11
|
+
name: 'accessToken',
|
|
12
|
+
type: 'string',
|
|
13
|
+
default: '',
|
|
14
|
+
required: true,
|
|
15
|
+
description: 'The Access Token for the Tiendanube Store API',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
displayName: 'Store ID',
|
|
19
|
+
name: 'storeId',
|
|
20
|
+
type: 'string',
|
|
21
|
+
default: '',
|
|
22
|
+
required: true,
|
|
23
|
+
description: 'The ID of your Tiendanube/Nuvemshop store',
|
|
24
|
+
},
|
|
25
|
+
{
|
|
26
|
+
displayName: 'User Agent',
|
|
27
|
+
name: 'userAgent',
|
|
28
|
+
type: 'string',
|
|
29
|
+
default: 'n8n-node (email@example.com)',
|
|
30
|
+
required: true,
|
|
31
|
+
description: 'User Agent string required by Tiendanube (usually your app name + contact email)',
|
|
32
|
+
},
|
|
33
|
+
];
|
|
34
|
+
}
|
|
35
|
+
exports.TiendanubeApi = TiendanubeApi;
|
|
36
|
+
//# sourceMappingURL=TiendanubeApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TiendanubeApi.credentials.js","sourceRoot":"","sources":["../../credentials/TiendanubeApi.credentials.ts"],"names":[],"mappings":";;;AAKA,MAAa,aAAa;IACtB,IAAI,GAAG,eAAe,CAAC;IACvB,WAAW,GAAG,gBAAgB,CAAC;IAC/B,gBAAgB,GAAG,sDAAsD,CAAC;IAC1E,UAAU,GAAsB;QAC5B;YACI,WAAW,EAAE,cAAc;YAC3B,IAAI,EAAE,aAAa;YACnB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,+CAA+C;SAC/D;QACD;YACI,WAAW,EAAE,UAAU;YACvB,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,EAAE;YACX,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,2CAA2C;SAC3D;QACD;YACI,WAAW,EAAE,YAAY;YACzB,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,QAAQ;YACd,OAAO,EAAE,8BAA8B;YACvC,QAAQ,EAAE,IAAI;YACd,WAAW,EAAE,kFAAkF;SAClG;KACJ,CAAC;CACL;AA9BD,sCA8BC"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.customerFields = exports.customerOperations = void 0;
|
|
4
|
+
exports.customerOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: {
|
|
12
|
+
resource: [
|
|
13
|
+
'customer',
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
options: [
|
|
18
|
+
{
|
|
19
|
+
name: 'Create',
|
|
20
|
+
value: 'create',
|
|
21
|
+
description: 'Create a customer',
|
|
22
|
+
action: 'Create a customer',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'Delete',
|
|
26
|
+
value: 'delete',
|
|
27
|
+
description: 'Delete a customer',
|
|
28
|
+
action: 'Delete a customer',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'Get',
|
|
32
|
+
value: 'get',
|
|
33
|
+
description: 'Get a customer',
|
|
34
|
+
action: 'Get a customer',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'Get All',
|
|
38
|
+
value: 'getAll',
|
|
39
|
+
description: 'Get all customers',
|
|
40
|
+
action: 'Get all customers',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'Update',
|
|
44
|
+
value: 'update',
|
|
45
|
+
description: 'Update a customer',
|
|
46
|
+
action: 'Update a customer',
|
|
47
|
+
},
|
|
48
|
+
],
|
|
49
|
+
default: 'create',
|
|
50
|
+
},
|
|
51
|
+
];
|
|
52
|
+
exports.customerFields = [
|
|
53
|
+
/* -------------------------------------------------------------------------- */
|
|
54
|
+
/* customer:create */
|
|
55
|
+
/* -------------------------------------------------------------------------- */
|
|
56
|
+
{
|
|
57
|
+
displayName: 'Name',
|
|
58
|
+
name: 'name',
|
|
59
|
+
type: 'string',
|
|
60
|
+
required: true,
|
|
61
|
+
displayOptions: {
|
|
62
|
+
show: {
|
|
63
|
+
resource: [
|
|
64
|
+
'customer',
|
|
65
|
+
],
|
|
66
|
+
operation: [
|
|
67
|
+
'create',
|
|
68
|
+
],
|
|
69
|
+
},
|
|
70
|
+
},
|
|
71
|
+
default: '',
|
|
72
|
+
description: 'The name of the customer',
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
displayName: 'Email',
|
|
76
|
+
name: 'email',
|
|
77
|
+
type: 'string',
|
|
78
|
+
required: true,
|
|
79
|
+
displayOptions: {
|
|
80
|
+
show: {
|
|
81
|
+
resource: [
|
|
82
|
+
'customer',
|
|
83
|
+
],
|
|
84
|
+
operation: [
|
|
85
|
+
'create',
|
|
86
|
+
],
|
|
87
|
+
},
|
|
88
|
+
},
|
|
89
|
+
default: '',
|
|
90
|
+
description: 'The email of the customer',
|
|
91
|
+
},
|
|
92
|
+
{
|
|
93
|
+
displayName: 'Additional Fields',
|
|
94
|
+
name: 'additionalFields',
|
|
95
|
+
type: 'collection',
|
|
96
|
+
placeholder: 'Add Field',
|
|
97
|
+
default: {},
|
|
98
|
+
displayOptions: {
|
|
99
|
+
show: {
|
|
100
|
+
resource: [
|
|
101
|
+
'customer',
|
|
102
|
+
],
|
|
103
|
+
operation: [
|
|
104
|
+
'create',
|
|
105
|
+
'update',
|
|
106
|
+
],
|
|
107
|
+
},
|
|
108
|
+
},
|
|
109
|
+
options: [
|
|
110
|
+
{
|
|
111
|
+
displayName: 'Identification',
|
|
112
|
+
name: 'identification',
|
|
113
|
+
type: 'string',
|
|
114
|
+
default: '',
|
|
115
|
+
description: 'Document number / ID',
|
|
116
|
+
},
|
|
117
|
+
{
|
|
118
|
+
displayName: 'Phone',
|
|
119
|
+
name: 'phone',
|
|
120
|
+
type: 'string',
|
|
121
|
+
default: '',
|
|
122
|
+
},
|
|
123
|
+
],
|
|
124
|
+
},
|
|
125
|
+
/* -------------------------------------------------------------------------- */
|
|
126
|
+
/* customer:get/delete */
|
|
127
|
+
/* -------------------------------------------------------------------------- */
|
|
128
|
+
{
|
|
129
|
+
displayName: 'Customer ID',
|
|
130
|
+
name: 'customerId',
|
|
131
|
+
type: 'string',
|
|
132
|
+
required: true,
|
|
133
|
+
default: '',
|
|
134
|
+
displayOptions: {
|
|
135
|
+
show: {
|
|
136
|
+
resource: [
|
|
137
|
+
'customer',
|
|
138
|
+
],
|
|
139
|
+
operation: [
|
|
140
|
+
'get',
|
|
141
|
+
'delete',
|
|
142
|
+
'update',
|
|
143
|
+
],
|
|
144
|
+
},
|
|
145
|
+
},
|
|
146
|
+
description: 'The ID of the customer',
|
|
147
|
+
},
|
|
148
|
+
];
|
|
149
|
+
//# sourceMappingURL=CustomerDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CustomerDescription.js","sourceRoot":"","sources":["../../../nodes/Tiendanube/CustomerDescription.ts"],"names":[],"mappings":";;;AAIa,QAAA,kBAAkB,GAAsB;IACjD;QACI,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE;oBACN,UAAU;iBACb;aACJ;SACJ;QACD,OAAO,EAAE;YACL;gBACI,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,mBAAmB;gBAChC,MAAM,EAAE,mBAAmB;aAC9B;YACD;gBACI,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,mBAAmB;gBAChC,MAAM,EAAE,mBAAmB;aAC9B;YACD;gBACI,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,KAAK;gBACZ,WAAW,EAAE,gBAAgB;gBAC7B,MAAM,EAAE,gBAAgB;aAC3B;YACD;gBACI,IAAI,EAA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,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE,sBAAsB;aACtC;YACD;gBACI,WAAW,EAAE,OAAO;gBACpB,IAAI,EAAE,OAAO;gBACb,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;aACd;SACJ;KACJ;IACD,gFAAgF;IAChF,gFAAgF;IAChF,gFAAgF;IAChF;QACI,WAAW,EAAE,aAAa;QAC1B,IAAI,EAAE,YAAY;QAClB,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE;oBACN,UAAU;iBACb;gBACD,SAAS,EAAE;oBACP,KAAK;oBACL,QAAQ;oBACR,QAAQ;iBACX;aACJ;SACJ;QACD,WAAW,EAAE,wBAAwB;KACxC;CACJ,CAAC"}
|
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.extraFields = exports.extraOperations = void 0;
|
|
4
|
+
exports.extraOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: {
|
|
12
|
+
resource: [
|
|
13
|
+
'category',
|
|
14
|
+
'coupon',
|
|
15
|
+
'productImage',
|
|
16
|
+
'productVariant',
|
|
17
|
+
'checkout',
|
|
18
|
+
'location',
|
|
19
|
+
'cart',
|
|
20
|
+
'page',
|
|
21
|
+
],
|
|
22
|
+
},
|
|
23
|
+
},
|
|
24
|
+
options: [
|
|
25
|
+
{
|
|
26
|
+
name: 'Get All',
|
|
27
|
+
value: 'getAll',
|
|
28
|
+
description: 'Get all items',
|
|
29
|
+
action: 'Get all items',
|
|
30
|
+
displayOptions: {
|
|
31
|
+
show: {
|
|
32
|
+
resource: ['category', 'coupon', 'productImage', 'productVariant', 'checkout', 'location', 'cart', 'page'],
|
|
33
|
+
},
|
|
34
|
+
},
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'Get',
|
|
38
|
+
value: 'get',
|
|
39
|
+
description: 'Get an item',
|
|
40
|
+
action: 'Get an item',
|
|
41
|
+
displayOptions: {
|
|
42
|
+
show: {
|
|
43
|
+
resource: ['category', 'coupon', 'productImage', 'productVariant', 'checkout', 'location', 'cart', 'page'],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
name: 'Create',
|
|
49
|
+
value: 'create',
|
|
50
|
+
description: 'Create an item',
|
|
51
|
+
action: 'Create an item',
|
|
52
|
+
displayOptions: {
|
|
53
|
+
show: {
|
|
54
|
+
resource: ['category', 'coupon', 'productImage', 'productVariant', 'checkout', 'location', 'cart', 'page'],
|
|
55
|
+
},
|
|
56
|
+
},
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
name: 'Update',
|
|
60
|
+
value: 'update',
|
|
61
|
+
description: 'Update an item',
|
|
62
|
+
action: 'Update an item',
|
|
63
|
+
displayOptions: {
|
|
64
|
+
show: {
|
|
65
|
+
resource: ['category', 'coupon', 'productImage', 'productVariant', 'checkout', 'location', 'cart', 'page'],
|
|
66
|
+
},
|
|
67
|
+
},
|
|
68
|
+
},
|
|
69
|
+
{
|
|
70
|
+
name: 'Delete',
|
|
71
|
+
value: 'delete',
|
|
72
|
+
description: 'Delete an item',
|
|
73
|
+
action: 'Delete an item',
|
|
74
|
+
displayOptions: {
|
|
75
|
+
show: {
|
|
76
|
+
resource: ['category', 'coupon', 'productImage', 'productVariant', 'checkout', 'location', 'cart', 'page'],
|
|
77
|
+
},
|
|
78
|
+
},
|
|
79
|
+
},
|
|
80
|
+
],
|
|
81
|
+
default: 'getAll',
|
|
82
|
+
},
|
|
83
|
+
];
|
|
84
|
+
exports.extraFields = [
|
|
85
|
+
/* -------------------------------------------------------------------------- */
|
|
86
|
+
/* productImage / productVariant */
|
|
87
|
+
/* -------------------------------------------------------------------------- */
|
|
88
|
+
{
|
|
89
|
+
displayName: 'Product ID',
|
|
90
|
+
name: 'productId',
|
|
91
|
+
type: 'string',
|
|
92
|
+
required: true,
|
|
93
|
+
default: '',
|
|
94
|
+
displayOptions: {
|
|
95
|
+
show: {
|
|
96
|
+
resource: [
|
|
97
|
+
'productImage',
|
|
98
|
+
'productVariant',
|
|
99
|
+
],
|
|
100
|
+
},
|
|
101
|
+
},
|
|
102
|
+
description: 'The ID of the product the item belongs to',
|
|
103
|
+
},
|
|
104
|
+
/* -------------------------------------------------------------------------- */
|
|
105
|
+
/* Common ID Field */
|
|
106
|
+
/* -------------------------------------------------------------------------- */
|
|
107
|
+
{
|
|
108
|
+
displayName: 'ID',
|
|
109
|
+
name: 'id',
|
|
110
|
+
type: 'string',
|
|
111
|
+
default: '',
|
|
112
|
+
displayOptions: {
|
|
113
|
+
show: {
|
|
114
|
+
operation: [
|
|
115
|
+
'get',
|
|
116
|
+
'delete',
|
|
117
|
+
'update',
|
|
118
|
+
],
|
|
119
|
+
resource: [
|
|
120
|
+
'category',
|
|
121
|
+
'coupon',
|
|
122
|
+
'productImage',
|
|
123
|
+
'productVariant',
|
|
124
|
+
'checkout',
|
|
125
|
+
'location',
|
|
126
|
+
'cart',
|
|
127
|
+
'page',
|
|
128
|
+
],
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
description: 'The ID of the resource',
|
|
132
|
+
},
|
|
133
|
+
/* -------------------------------------------------------------------------- */
|
|
134
|
+
/* Common Name/JSON Body */
|
|
135
|
+
/* -------------------------------------------------------------------------- */
|
|
136
|
+
{
|
|
137
|
+
displayName: 'JSON Body',
|
|
138
|
+
name: 'jsonBody',
|
|
139
|
+
type: 'json',
|
|
140
|
+
default: '{}',
|
|
141
|
+
displayOptions: {
|
|
142
|
+
show: {
|
|
143
|
+
operation: [
|
|
144
|
+
'create',
|
|
145
|
+
'update',
|
|
146
|
+
],
|
|
147
|
+
resource: [
|
|
148
|
+
'category',
|
|
149
|
+
'coupon',
|
|
150
|
+
'productImage',
|
|
151
|
+
'productVariant',
|
|
152
|
+
'checkout',
|
|
153
|
+
'location',
|
|
154
|
+
'cart',
|
|
155
|
+
'page',
|
|
156
|
+
],
|
|
157
|
+
},
|
|
158
|
+
},
|
|
159
|
+
description: 'The properties to send formatted as JSON',
|
|
160
|
+
},
|
|
161
|
+
];
|
|
162
|
+
//# sourceMappingURL=ExtraDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ExtraDescription.js","sourceRoot":"","sources":["../../../nodes/Tiendanube/ExtraDescription.ts"],"names":[],"mappings":";;;AAIa,QAAA,eAAe,GAAsB;IAC9C;QACI,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE;oBACN,UAAU;oBACV,QAAQ;oBACR,cAAc;oBACd,gBAAgB;oBAChB,UAAU;oBACV,UAAU;oBACV,MAAM;oBACN,MAAM;iBACT;aACJ;SACJ;QACD,OAAO,EAAE;YACL;gBACI,IAAI,EAAE,SAAS;gBACf,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,eAAe;gBAC5B,MAAM,EAAE,eAAe;gBACvB,cAAc,EAAE;oBACZ,IAAI,EAAE;wBACF,QAAQ,EAAE,CAAC,UAAU,EAAE,QAAQ,EAAE,cAAc,EAAE,gBAAgB,EAAE,UAAU,EAAE,UAAU,EAAE,MAAM,EAAE,MAAM,CAAC;qBAC7G;iBACJ;aACJ;YACD;gBACI,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,KAAK;gBACZ,WAAW,EAAE,aAAa;gBAC1B,MAAM,EAAE,aAAa;gBACrB,cAAc,EAAE;oBACZ,IAAI,EAAE;wBACF,QAAQ,EAAE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AAI;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAAQ,EAAE;oBACN,cAAc;oBACd,gBAAgB;iBACnB;aACJ;SACJ;QACD,WAAW,EAAE,2CAA2C;KAC3D;IACD,gFAAgF;IAChF,gFAAgF;IAChF,gFAAgF;IAChF;QACI,WAAW,EAAE,IAAI;QACjB,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,SAAS,EAAE;oBACP,KAAK;oBACL,QAAQ;oBACR,QAAQ;iBACX;gBACD,QAAQ,EAAE;oBACN,UAAU;oBACV,QAAQ;oBACR,cAAc;oBACd,gBAAgB;oBAChB,UAAU;oBACV,UAAU;oBACV,MAAM;oBACN,MAAM;iBACT;aACJ;SACJ;QACD,WAAW,EAAE,wBAAwB;KACxC;IACD,gFAAgF;IAChF,gFAAgF;IAChF,gFAAgF;IAChF;QACI,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,MAAM;QACZ,OAAO,EAAE,IAAI;QACb,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,SAAS,EAAE;oBACP,QAAQ;oBACR,QAAQ;iBACX;gBACD,QAAQ,EAAE;oBACN,UAAU;oBACV,QAAQ;oBACR,cAAc;oBACd,gBAAgB;oBAChB,UAAU;oBACV,UAAU;oBACV,MAAM;oBACN,MAAM;iBACT;aACJ;SACJ;QACD,WAAW,EAAE,0CAA0C;KAC1D;CACJ,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.tiendanubeApiRequest = tiendanubeApiRequest;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
async function tiendanubeApiRequest(method, resource, body = {}, qs = {}, uri, option = {}) {
|
|
6
|
+
const credentials = await this.getCredentials('tiendanubeApi');
|
|
7
|
+
let options = {
|
|
8
|
+
headers: {
|
|
9
|
+
'Content-Type': 'application/json',
|
|
10
|
+
'User-Agent': credentials.userAgent || 'n8n-node',
|
|
11
|
+
'Authentication': `bearer ${credentials.accessToken}`,
|
|
12
|
+
},
|
|
13
|
+
method,
|
|
14
|
+
qs,
|
|
15
|
+
body,
|
|
16
|
+
uri: uri || `https://api.tiendanube.com/v1/${credentials.storeId}/${resource}`,
|
|
17
|
+
json: true,
|
|
18
|
+
};
|
|
19
|
+
options = Object.assign({}, options, option);
|
|
20
|
+
if (Object.keys(options.qs).length === 0) {
|
|
21
|
+
delete options.qs;
|
|
22
|
+
}
|
|
23
|
+
if (Object.keys(options.body).length === 0) {
|
|
24
|
+
delete options.body;
|
|
25
|
+
}
|
|
26
|
+
try {
|
|
27
|
+
// Cast to any because n8n-workflow types might be strict about what request library options are allowed
|
|
28
|
+
return await this.helpers.request(options);
|
|
29
|
+
}
|
|
30
|
+
catch (error) {
|
|
31
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
//# sourceMappingURL=GenericFunctions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"GenericFunctions.js","sourceRoot":"","sources":["../../../nodes/Tiendanube/GenericFunctions.ts"],"names":[],"mappings":";;AAcA,oDAsCC;AAhDD,+CAQsB;AAEf,KAAK,UAAU,oBAAoB,CAEtC,MAAc,EACd,QAAgB,EAChB,OAAY,EAAE,EACd,KAAkB,EAAE,EACpB,GAAY,EACZ,SAAsB,EAAE;IAExB,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,eAAe,CAAC,CAAC;IAE/D,IAAI,OAAO,GAAmB;QAC1B,OAAO,EAAE;YACL,cAAc,EAAE,kBAAkB;YAClC,YAAY,EAAE,WAAW,CAAC,SAAmB,IAAI,UAAU;YAC3D,gBAAgB,EAAE,UAAU,WAAW,CAAC,WAAW,EAAE;SACxD;QACD,MAAM;QACN,EAAE;QACF,IAAI;QACJ,GAAG,EAAE,GAAG,IAAI,iCAAiC,WAAW,CAAC,OAAO,IAAI,QAAQ,EAAE;QAC9E,IAAI,EAAE,IAAI;KACb,CAAC;IAEF,OAAO,GAAG,MAAM,CAAC,MAAM,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;IAC7C,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACvC,OAAO,OAAO,CAAC,EAAE,CAAC;IACtB,CAAC;IACD,IAAI,MAAM,CAAC,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzC,OAAO,OAAO,CAAC,IAAI,CAAC;IACxB,CAAC;IAED,IAAI,CAAC;QACD,wGAAwG;QACxG,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,OAAO,CAAC,OAAc,CAAC,CAAC;IACtD,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACb,MAAM,IAAI,2BAAY,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAmB,CAAC,CAAC;IAChE,CAAC;AACL,CAAC"}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.orderFields = exports.orderOperations = void 0;
|
|
4
|
+
exports.orderOperations = [
|
|
5
|
+
{
|
|
6
|
+
displayName: 'Operation',
|
|
7
|
+
name: 'operation',
|
|
8
|
+
type: 'options',
|
|
9
|
+
noDataExpression: true,
|
|
10
|
+
displayOptions: {
|
|
11
|
+
show: {
|
|
12
|
+
resource: [
|
|
13
|
+
'order',
|
|
14
|
+
],
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
options: [
|
|
18
|
+
{
|
|
19
|
+
name: 'Get',
|
|
20
|
+
value: 'get',
|
|
21
|
+
description: 'Get an order',
|
|
22
|
+
action: 'Get an order',
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
name: 'Get All',
|
|
26
|
+
value: 'getAll',
|
|
27
|
+
description: 'Get all orders',
|
|
28
|
+
action: 'Get all orders',
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
name: 'Update',
|
|
32
|
+
value: 'update',
|
|
33
|
+
description: 'Update an order',
|
|
34
|
+
action: 'Update an order',
|
|
35
|
+
},
|
|
36
|
+
{
|
|
37
|
+
name: 'Open',
|
|
38
|
+
value: 'open',
|
|
39
|
+
description: 'Open an order',
|
|
40
|
+
action: 'Open an order',
|
|
41
|
+
},
|
|
42
|
+
{
|
|
43
|
+
name: 'Close',
|
|
44
|
+
value: 'close',
|
|
45
|
+
description: 'Close an order',
|
|
46
|
+
action: 'Close an order',
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
name: 'Cancel',
|
|
50
|
+
value: 'cancel',
|
|
51
|
+
description: 'Cancel an order',
|
|
52
|
+
action: 'Cancel an order',
|
|
53
|
+
},
|
|
54
|
+
],
|
|
55
|
+
default: 'get',
|
|
56
|
+
},
|
|
57
|
+
];
|
|
58
|
+
exports.orderFields = [
|
|
59
|
+
/* -------------------------------------------------------------------------- */
|
|
60
|
+
/* order:get/update */
|
|
61
|
+
/* -------------------------------------------------------------------------- */
|
|
62
|
+
{
|
|
63
|
+
displayName: 'Order ID',
|
|
64
|
+
name: 'orderId',
|
|
65
|
+
type: 'string',
|
|
66
|
+
required: true,
|
|
67
|
+
default: '',
|
|
68
|
+
displayOptions: {
|
|
69
|
+
show: {
|
|
70
|
+
resource: [
|
|
71
|
+
'order',
|
|
72
|
+
],
|
|
73
|
+
operation: [
|
|
74
|
+
'get',
|
|
75
|
+
'update',
|
|
76
|
+
'open',
|
|
77
|
+
'close',
|
|
78
|
+
'cancel',
|
|
79
|
+
],
|
|
80
|
+
},
|
|
81
|
+
},
|
|
82
|
+
description: 'The ID of the order',
|
|
83
|
+
},
|
|
84
|
+
/* -------------------------------------------------------------------------- */
|
|
85
|
+
/* order:getAll */
|
|
86
|
+
/* -------------------------------------------------------------------------- */
|
|
87
|
+
{
|
|
88
|
+
displayName: 'Return All',
|
|
89
|
+
name: 'returnAll',
|
|
90
|
+
type: 'boolean',
|
|
91
|
+
displayOptions: {
|
|
92
|
+
show: {
|
|
93
|
+
resource: [
|
|
94
|
+
'order',
|
|
95
|
+
],
|
|
96
|
+
operation: [
|
|
97
|
+
'getAll',
|
|
98
|
+
],
|
|
99
|
+
},
|
|
100
|
+
},
|
|
101
|
+
default: false,
|
|
102
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
displayName: 'Limit',
|
|
106
|
+
name: 'limit',
|
|
107
|
+
type: 'number',
|
|
108
|
+
displayOptions: {
|
|
109
|
+
show: {
|
|
110
|
+
resource: [
|
|
111
|
+
'order',
|
|
112
|
+
],
|
|
113
|
+
operation: [
|
|
114
|
+
'getAll',
|
|
115
|
+
],
|
|
116
|
+
returnAll: [
|
|
117
|
+
false,
|
|
118
|
+
],
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
typeOptions: {
|
|
122
|
+
minValue: 1,
|
|
123
|
+
maxValue: 500,
|
|
124
|
+
},
|
|
125
|
+
default: 50,
|
|
126
|
+
description: 'Max number of results to return',
|
|
127
|
+
},
|
|
128
|
+
];
|
|
129
|
+
//# sourceMappingURL=OrderDescription.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"OrderDescription.js","sourceRoot":"","sources":["../../../nodes/Tiendanube/OrderDescription.ts"],"names":[],"mappings":";;;AAIa,QAAA,eAAe,GAAsB;IAC9C;QACI,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,cAAc,EAAE;YACZ,IAAI,EAAE;gBACF,QAA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