@solution25/n8n-nodes-shopware 1.4.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 +80 -0
- package/dist/credentials/ShopwareOAuth2Api.credentials.d.ts +16 -0
- package/dist/credentials/ShopwareOAuth2Api.credentials.js +78 -0
- package/dist/credentials/ShopwareOAuth2Api.credentials.js.map +1 -0
- package/dist/nodes/Shopware/Shopware.node.d.ts +4 -0
- package/dist/nodes/Shopware/Shopware.node.js +23 -0
- package/dist/nodes/Shopware/Shopware.node.js.map +1 -0
- package/dist/nodes/Shopware/Shopware.node.json +18 -0
- package/dist/nodes/Shopware/test/v1/node/customer/getMany.test.d.ts +1 -0
- package/dist/nodes/Shopware/test/v1/node/customer/getMany.test.js +98 -0
- package/dist/nodes/Shopware/test/v1/node/customer/getMany.test.js.map +1 -0
- package/dist/nodes/Shopware/test/v1/node/helpers.d.ts +6 -0
- package/dist/nodes/Shopware/test/v1/node/helpers.js +44 -0
- package/dist/nodes/Shopware/test/v1/node/helpers.js.map +1 -0
- package/dist/nodes/Shopware/test/v1/node/order/getMany.test.d.ts +1 -0
- package/dist/nodes/Shopware/test/v1/node/order/getMany.test.js +111 -0
- package/dist/nodes/Shopware/test/v1/node/order/getMany.test.js.map +1 -0
- package/dist/nodes/Shopware/test/v1/node/product/getMany.test.d.ts +1 -0
- package/dist/nodes/Shopware/test/v1/node/product/getMany.test.js +96 -0
- package/dist/nodes/Shopware/test/v1/node/product/getMany.test.js.map +1 -0
- package/dist/nodes/Shopware/v1/ShopwareV1.node.d.ts +10 -0
- package/dist/nodes/Shopware/v1/ShopwareV1.node.js +23 -0
- package/dist/nodes/Shopware/v1/ShopwareV1.node.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/category/Category.resource.d.ts +8 -0
- package/dist/nodes/Shopware/v1/actions/category/Category.resource.js +98 -0
- package/dist/nodes/Shopware/v1/actions/category/Category.resource.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/category/create.operation.d.ts +27 -0
- package/dist/nodes/Shopware/v1/actions/category/create.operation.js +211 -0
- package/dist/nodes/Shopware/v1/actions/category/create.operation.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/category/deleteCategory.operation.d.ts +27 -0
- package/dist/nodes/Shopware/v1/actions/category/deleteCategory.operation.js +47 -0
- package/dist/nodes/Shopware/v1/actions/category/deleteCategory.operation.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/category/fields.d.ts +1 -0
- package/dist/nodes/Shopware/v1/actions/category/fields.js +21 -0
- package/dist/nodes/Shopware/v1/actions/category/fields.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/category/get.operation.d.ts +27 -0
- package/dist/nodes/Shopware/v1/actions/category/get.operation.js +77 -0
- package/dist/nodes/Shopware/v1/actions/category/get.operation.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/category/getMany.operation.d.ts +27 -0
- package/dist/nodes/Shopware/v1/actions/category/getMany.operation.js +164 -0
- package/dist/nodes/Shopware/v1/actions/category/getMany.operation.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/category/types.d.ts +19 -0
- package/dist/nodes/Shopware/v1/actions/category/types.js +3 -0
- package/dist/nodes/Shopware/v1/actions/category/types.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/category/update.operation.d.ts +27 -0
- package/dist/nodes/Shopware/v1/actions/category/update.operation.js +120 -0
- package/dist/nodes/Shopware/v1/actions/category/update.operation.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/customer/Customer.resource.d.ts +8 -0
- package/dist/nodes/Shopware/v1/actions/customer/Customer.resource.js +98 -0
- package/dist/nodes/Shopware/v1/actions/customer/Customer.resource.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/customer/create.operation.d.ts +27 -0
- package/dist/nodes/Shopware/v1/actions/customer/create.operation.js +301 -0
- package/dist/nodes/Shopware/v1/actions/customer/create.operation.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/customer/deleteCustomer.operation.d.ts +27 -0
- package/dist/nodes/Shopware/v1/actions/customer/deleteCustomer.operation.js +47 -0
- package/dist/nodes/Shopware/v1/actions/customer/deleteCustomer.operation.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/customer/fields.d.ts +4 -0
- package/dist/nodes/Shopware/v1/actions/customer/fields.js +30 -0
- package/dist/nodes/Shopware/v1/actions/customer/fields.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/customer/get.operation.d.ts +27 -0
- package/dist/nodes/Shopware/v1/actions/customer/get.operation.js +77 -0
- package/dist/nodes/Shopware/v1/actions/customer/get.operation.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/customer/getMany.operation.d.ts +27 -0
- package/dist/nodes/Shopware/v1/actions/customer/getMany.operation.js +319 -0
- package/dist/nodes/Shopware/v1/actions/customer/getMany.operation.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/customer/types.d.ts +54 -0
- package/dist/nodes/Shopware/v1/actions/customer/types.js +3 -0
- package/dist/nodes/Shopware/v1/actions/customer/types.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/customer/update.operation.d.ts +27 -0
- package/dist/nodes/Shopware/v1/actions/customer/update.operation.js +287 -0
- package/dist/nodes/Shopware/v1/actions/customer/update.operation.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/fields.d.ts +5 -0
- package/dist/nodes/Shopware/v1/actions/fields.js +26 -0
- package/dist/nodes/Shopware/v1/actions/fields.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/node.type.d.ts +9 -0
- package/dist/nodes/Shopware/v1/actions/node.type.js +3 -0
- package/dist/nodes/Shopware/v1/actions/node.type.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/order/Order.resource.d.ts +8 -0
- package/dist/nodes/Shopware/v1/actions/order/Order.resource.js +98 -0
- package/dist/nodes/Shopware/v1/actions/order/Order.resource.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/order/create.operation.d.ts +27 -0
- package/dist/nodes/Shopware/v1/actions/order/create.operation.js +861 -0
- package/dist/nodes/Shopware/v1/actions/order/create.operation.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/order/deleteOrder.operation.d.ts +27 -0
- package/dist/nodes/Shopware/v1/actions/order/deleteOrder.operation.js +47 -0
- package/dist/nodes/Shopware/v1/actions/order/deleteOrder.operation.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/order/fields.d.ts +2 -0
- package/dist/nodes/Shopware/v1/actions/order/fields.js +25 -0
- package/dist/nodes/Shopware/v1/actions/order/fields.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/order/get.operation.d.ts +27 -0
- package/dist/nodes/Shopware/v1/actions/order/get.operation.js +77 -0
- package/dist/nodes/Shopware/v1/actions/order/get.operation.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/order/getMany.operation.d.ts +27 -0
- package/dist/nodes/Shopware/v1/actions/order/getMany.operation.js +226 -0
- package/dist/nodes/Shopware/v1/actions/order/getMany.operation.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/order/types.d.ts +171 -0
- package/dist/nodes/Shopware/v1/actions/order/types.js +3 -0
- package/dist/nodes/Shopware/v1/actions/order/types.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/order/update.operation.d.ts +27 -0
- package/dist/nodes/Shopware/v1/actions/order/update.operation.js +723 -0
- package/dist/nodes/Shopware/v1/actions/order/update.operation.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/product/Product.resource.d.ts +8 -0
- package/dist/nodes/Shopware/v1/actions/product/Product.resource.js +98 -0
- package/dist/nodes/Shopware/v1/actions/product/Product.resource.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/product/create.operation.d.ts +27 -0
- package/dist/nodes/Shopware/v1/actions/product/create.operation.js +335 -0
- package/dist/nodes/Shopware/v1/actions/product/create.operation.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/product/deleteProduct.operation.d.ts +27 -0
- package/dist/nodes/Shopware/v1/actions/product/deleteProduct.operation.js +47 -0
- package/dist/nodes/Shopware/v1/actions/product/deleteProduct.operation.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/product/fields.d.ts +7 -0
- package/dist/nodes/Shopware/v1/actions/product/fields.js +33 -0
- package/dist/nodes/Shopware/v1/actions/product/fields.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/product/get.operation.d.ts +27 -0
- package/dist/nodes/Shopware/v1/actions/product/get.operation.js +77 -0
- package/dist/nodes/Shopware/v1/actions/product/get.operation.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/product/getMany.operation.d.ts +27 -0
- package/dist/nodes/Shopware/v1/actions/product/getMany.operation.js +319 -0
- package/dist/nodes/Shopware/v1/actions/product/getMany.operation.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/product/types.d.ts +66 -0
- package/dist/nodes/Shopware/v1/actions/product/types.js +3 -0
- package/dist/nodes/Shopware/v1/actions/product/types.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/product/update.operation.d.ts +27 -0
- package/dist/nodes/Shopware/v1/actions/product/update.operation.js +287 -0
- package/dist/nodes/Shopware/v1/actions/product/update.operation.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/router.d.ts +2 -0
- package/dist/nodes/Shopware/v1/actions/router.js +78 -0
- package/dist/nodes/Shopware/v1/actions/router.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/types.d.ts +97 -0
- package/dist/nodes/Shopware/v1/actions/types.js +3 -0
- package/dist/nodes/Shopware/v1/actions/types.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/versionDescription.d.ts +2 -0
- package/dist/nodes/Shopware/v1/actions/versionDescription.js +93 -0
- package/dist/nodes/Shopware/v1/actions/versionDescription.js.map +1 -0
- package/dist/nodes/Shopware/v1/helpers/handlers.d.ts +14 -0
- package/dist/nodes/Shopware/v1/helpers/handlers.js +261 -0
- package/dist/nodes/Shopware/v1/helpers/handlers.js.map +1 -0
- package/dist/nodes/Shopware/v1/helpers/interfaces.d.ts +1 -0
- package/dist/nodes/Shopware/v1/helpers/interfaces.js +3 -0
- package/dist/nodes/Shopware/v1/helpers/interfaces.js.map +1 -0
- package/dist/nodes/Shopware/v1/helpers/utils.d.ts +16 -0
- package/dist/nodes/Shopware/v1/helpers/utils.js +354 -0
- package/dist/nodes/Shopware/v1/helpers/utils.js.map +1 -0
- package/dist/nodes/Shopware/v1/methods/index.d.ts +1 -0
- package/dist/nodes/Shopware/v1/methods/index.js +38 -0
- package/dist/nodes/Shopware/v1/methods/index.js.map +1 -0
- package/dist/nodes/Shopware/v1/methods/loadOptions.d.ts +18 -0
- package/dist/nodes/Shopware/v1/methods/loadOptions.js +143 -0
- package/dist/nodes/Shopware/v1/methods/loadOptions.js.map +1 -0
- package/dist/nodes/Shopware/v1/transport/index.d.ts +2 -0
- package/dist/nodes/Shopware/v1/transport/index.js +25 -0
- package/dist/nodes/Shopware/v1/transport/index.js.map +1 -0
- package/dist/package.json +63 -0
- package/dist/shopware.png +0 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/package.json +63 -0
|
@@ -0,0 +1,287 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.description = void 0;
|
|
4
|
+
exports.execute = execute;
|
|
5
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
6
|
+
const utils_1 = require("../../helpers/utils");
|
|
7
|
+
const fields_1 = require("./fields");
|
|
8
|
+
const transport_1 = require("../../transport");
|
|
9
|
+
const properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Customer ID',
|
|
12
|
+
name: 'id',
|
|
13
|
+
type: 'string',
|
|
14
|
+
default: '',
|
|
15
|
+
placeholder: 'e.g. 2a88d9b59d474...',
|
|
16
|
+
required: true,
|
|
17
|
+
description: 'ID of the customer to update. You can find the ID in the URL when viewing the customer in Shopware Admin (e.g. https://your-domain.com/admin#/sw/customer/detail/<customerId>).',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
displayName: 'Update Fields',
|
|
21
|
+
name: 'updateFields',
|
|
22
|
+
type: 'collection',
|
|
23
|
+
placeholder: 'Add Field',
|
|
24
|
+
default: {},
|
|
25
|
+
options: [
|
|
26
|
+
{
|
|
27
|
+
displayName: 'Addresses',
|
|
28
|
+
name: 'addresses',
|
|
29
|
+
placeholder: 'Add Address',
|
|
30
|
+
type: 'fixedCollection',
|
|
31
|
+
typeOptions: {
|
|
32
|
+
multipleValues: true,
|
|
33
|
+
},
|
|
34
|
+
description: 'Customer addresses',
|
|
35
|
+
default: {},
|
|
36
|
+
options: [
|
|
37
|
+
{
|
|
38
|
+
name: 'address',
|
|
39
|
+
displayName: 'Address',
|
|
40
|
+
values: [
|
|
41
|
+
{
|
|
42
|
+
displayName: 'Country',
|
|
43
|
+
name: 'country',
|
|
44
|
+
type: 'options',
|
|
45
|
+
typeOptions: {
|
|
46
|
+
loadOptionsMethod: 'getCountries',
|
|
47
|
+
},
|
|
48
|
+
required: true,
|
|
49
|
+
default: '',
|
|
50
|
+
description: 'Choose the country from the list',
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
displayName: 'First Name',
|
|
54
|
+
name: 'firstName',
|
|
55
|
+
type: 'string',
|
|
56
|
+
required: true,
|
|
57
|
+
default: '',
|
|
58
|
+
description: 'Customer first name',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
displayName: 'Last Name',
|
|
62
|
+
name: 'lastName',
|
|
63
|
+
type: 'string',
|
|
64
|
+
required: true,
|
|
65
|
+
default: '',
|
|
66
|
+
description: 'Customer last name',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
displayName: 'City',
|
|
70
|
+
name: 'city',
|
|
71
|
+
type: 'string',
|
|
72
|
+
required: true,
|
|
73
|
+
default: '',
|
|
74
|
+
placeholder: 'e.g. München',
|
|
75
|
+
description: "Name of the customer's city",
|
|
76
|
+
},
|
|
77
|
+
{
|
|
78
|
+
displayName: 'Street',
|
|
79
|
+
name: 'street',
|
|
80
|
+
type: 'string',
|
|
81
|
+
required: true,
|
|
82
|
+
default: '',
|
|
83
|
+
placeholder: 'e.g. Schillerstraße',
|
|
84
|
+
description: "Name of the customer's city",
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
displayName: 'Set as Default Shipping Address',
|
|
88
|
+
name: 'defaultShippingAddress',
|
|
89
|
+
type: 'boolean',
|
|
90
|
+
default: false,
|
|
91
|
+
description: 'Whether to set the current address as default shipping address',
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
displayName: 'Set as Default Billing Address',
|
|
95
|
+
name: 'defaultBillingAddress',
|
|
96
|
+
type: 'boolean',
|
|
97
|
+
default: false,
|
|
98
|
+
description: 'Whether to set the current address as default billing address',
|
|
99
|
+
},
|
|
100
|
+
],
|
|
101
|
+
},
|
|
102
|
+
],
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
displayName: 'Customer Number',
|
|
106
|
+
name: 'customerNumber',
|
|
107
|
+
type: 'string',
|
|
108
|
+
default: '',
|
|
109
|
+
placeholder: 'e.g. 2a88d9b59d474...',
|
|
110
|
+
description: 'Unique customer number',
|
|
111
|
+
},
|
|
112
|
+
{
|
|
113
|
+
displayName: 'Email',
|
|
114
|
+
name: 'email',
|
|
115
|
+
type: 'string',
|
|
116
|
+
default: '',
|
|
117
|
+
placeholder: 'e.g. name@email.com',
|
|
118
|
+
description: 'Customer email',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
displayName: 'First Name',
|
|
122
|
+
name: 'firstName',
|
|
123
|
+
type: 'string',
|
|
124
|
+
default: '',
|
|
125
|
+
description: 'Customer first name',
|
|
126
|
+
},
|
|
127
|
+
{
|
|
128
|
+
displayName: 'Group',
|
|
129
|
+
name: 'group',
|
|
130
|
+
type: 'options',
|
|
131
|
+
typeOptions: {
|
|
132
|
+
loadOptionsMethod: 'getCustomerGroups',
|
|
133
|
+
},
|
|
134
|
+
default: '',
|
|
135
|
+
description: 'Select the customer group from the list',
|
|
136
|
+
},
|
|
137
|
+
{
|
|
138
|
+
displayName: 'Language',
|
|
139
|
+
name: 'language',
|
|
140
|
+
type: 'options',
|
|
141
|
+
typeOptions: {
|
|
142
|
+
loadOptionsMethod: 'getLanguages',
|
|
143
|
+
},
|
|
144
|
+
default: '',
|
|
145
|
+
description: 'Select the language from the list',
|
|
146
|
+
},
|
|
147
|
+
{
|
|
148
|
+
displayName: 'Last Name',
|
|
149
|
+
name: 'lastName',
|
|
150
|
+
type: 'string',
|
|
151
|
+
default: '',
|
|
152
|
+
description: 'Customer last name',
|
|
153
|
+
},
|
|
154
|
+
{
|
|
155
|
+
displayName: 'Payment Method',
|
|
156
|
+
name: 'paymentMethod',
|
|
157
|
+
type: 'options',
|
|
158
|
+
typeOptions: {
|
|
159
|
+
loadOptionsMethod: 'getPaymentMethods',
|
|
160
|
+
},
|
|
161
|
+
default: '',
|
|
162
|
+
description: 'Select the payment method from the list',
|
|
163
|
+
},
|
|
164
|
+
{
|
|
165
|
+
displayName: 'Sales Channel',
|
|
166
|
+
name: 'salesChannel',
|
|
167
|
+
type: 'options',
|
|
168
|
+
typeOptions: {
|
|
169
|
+
loadOptionsMethod: 'getSalesChannels',
|
|
170
|
+
},
|
|
171
|
+
default: '',
|
|
172
|
+
description: 'Select the sales channel from the list',
|
|
173
|
+
},
|
|
174
|
+
],
|
|
175
|
+
},
|
|
176
|
+
];
|
|
177
|
+
const displayOptions = {
|
|
178
|
+
show: {
|
|
179
|
+
resource: ['customer'],
|
|
180
|
+
operation: ['update'],
|
|
181
|
+
},
|
|
182
|
+
};
|
|
183
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)(displayOptions, properties);
|
|
184
|
+
async function execute(items) {
|
|
185
|
+
var _a;
|
|
186
|
+
const returnData = [];
|
|
187
|
+
for (let i = 0; i < items.length; i++) {
|
|
188
|
+
try {
|
|
189
|
+
const id = this.getNodeParameter('id', i);
|
|
190
|
+
const searchBody = {
|
|
191
|
+
fields: fields_1.customerFields,
|
|
192
|
+
includes: {
|
|
193
|
+
customer: fields_1.customerFields,
|
|
194
|
+
},
|
|
195
|
+
filter: [{ type: 'equals', field: 'id', value: id }],
|
|
196
|
+
};
|
|
197
|
+
const customer = (await transport_1.apiRequest.call(this, 'POST', `/search/customer`, searchBody)).data[0];
|
|
198
|
+
if (!customer) {
|
|
199
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Customer does not exist', {
|
|
200
|
+
description: 'There is no customer with id ' + id,
|
|
201
|
+
itemIndex: i,
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
const updateFields = this.getNodeParameter('updateFields', i);
|
|
205
|
+
let defaultShippingAddressId = null;
|
|
206
|
+
let defaultBillingAddressId = null;
|
|
207
|
+
if (updateFields.email && updateFields.email.indexOf('@') === -1) {
|
|
208
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Invalid email address', {
|
|
209
|
+
description: `The email address '${updateFields.email}' in the 'email' field isn't valid`,
|
|
210
|
+
itemIndex: i,
|
|
211
|
+
});
|
|
212
|
+
}
|
|
213
|
+
let addresses;
|
|
214
|
+
const nodeAddresses = (_a = updateFields.addresses) === null || _a === void 0 ? void 0 : _a.address;
|
|
215
|
+
if (nodeAddresses && nodeAddresses.length > 0) {
|
|
216
|
+
addresses = nodeAddresses.map((address) => {
|
|
217
|
+
const addressId = (0, utils_1.uuidv7)();
|
|
218
|
+
if (address.defaultShippingAddress) {
|
|
219
|
+
if (defaultShippingAddressId) {
|
|
220
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Duplicate default shipping address', {
|
|
221
|
+
description: 'Only one address can be a default shipping address',
|
|
222
|
+
itemIndex: i,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
defaultShippingAddressId = addressId;
|
|
226
|
+
}
|
|
227
|
+
if (address.defaultBillingAddress) {
|
|
228
|
+
if (defaultBillingAddressId) {
|
|
229
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Duplicate default billing address', {
|
|
230
|
+
description: 'Only one address can be a default billing address',
|
|
231
|
+
itemIndex: i,
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
defaultBillingAddressId = addressId;
|
|
235
|
+
}
|
|
236
|
+
return {
|
|
237
|
+
id: addressId,
|
|
238
|
+
countryId: address.country,
|
|
239
|
+
firstName: address.firstName,
|
|
240
|
+
lastName: address.lastName,
|
|
241
|
+
city: address.city,
|
|
242
|
+
street: address.street,
|
|
243
|
+
salutationId: customer.salutationId
|
|
244
|
+
};
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
const updateBody = {
|
|
248
|
+
firstName: updateFields.firstName,
|
|
249
|
+
lastName: updateFields.lastName,
|
|
250
|
+
email: updateFields.email,
|
|
251
|
+
customerNumber: updateFields.customerNumber,
|
|
252
|
+
defaultPaymentMethodId: updateFields.paymentMethod,
|
|
253
|
+
languageId: updateFields.language,
|
|
254
|
+
salesChannelId: updateFields.salesChannel,
|
|
255
|
+
groupId: updateFields.group,
|
|
256
|
+
defaultShippingAddressId,
|
|
257
|
+
defaultBillingAddressId,
|
|
258
|
+
addresses,
|
|
259
|
+
};
|
|
260
|
+
for (const key in updateBody) {
|
|
261
|
+
const typedKey = key;
|
|
262
|
+
if (Array.isArray(updateBody[typedKey]) &&
|
|
263
|
+
updateBody[typedKey].length === 0) {
|
|
264
|
+
delete updateBody[typedKey];
|
|
265
|
+
}
|
|
266
|
+
else if (updateBody[typedKey] === '' || updateBody[typedKey] === null) {
|
|
267
|
+
delete updateBody[typedKey];
|
|
268
|
+
}
|
|
269
|
+
}
|
|
270
|
+
await transport_1.apiRequest.call(this, 'PATCH', `/customer/${id}`, updateBody);
|
|
271
|
+
const response = await transport_1.apiRequest.call(this, 'POST', `/search/customer`, searchBody);
|
|
272
|
+
const executionData = this.helpers.constructExecutionMetaData((0, utils_1.wrapData)(response.data), {
|
|
273
|
+
itemData: { item: i },
|
|
274
|
+
});
|
|
275
|
+
returnData.push(...executionData);
|
|
276
|
+
}
|
|
277
|
+
catch (error) {
|
|
278
|
+
if (this.continueOnFail()) {
|
|
279
|
+
returnData.push({ json: { error: error.message } });
|
|
280
|
+
continue;
|
|
281
|
+
}
|
|
282
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
283
|
+
}
|
|
284
|
+
}
|
|
285
|
+
return returnData;
|
|
286
|
+
}
|
|
287
|
+
//# sourceMappingURL=update.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"update.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Shopware/v1/actions/customer/update.operation.ts"],"names":[],"mappings":";;;AAqMA,0BA8HC;AA/TD,+CAQsB;AAEtB,+CAAuD;AACvD,qCAA0C;AAC1C,+CAA6C;AAE7C,MAAM,UAAU,GAAsB;IACrC;QACC,WAAW,EAAE,aAAa;QAC1B,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,uBAAuB;QACpC,QAAQ,EAAE,IAAI;QACd,WAAW,EACV,uLAAuL;KACxL;IACD;QACC,WAAW,EAAE,eAAe;QAC5B,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,WAAW;QACxB,OAAO,EAAE,EAAE;QACX,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,WAAW;gBACjB,WAAW,EAAE,aAAa;gBAC1B,IAAI,EAAE,iBAAiB;gBACvB,WAAW,EAAE;oBACZ,cAAc,EAAE,IAAI;iBACpB;gBACD,WAAW,EAAE,oBAAoB;gBACjC,OAAO,EAAE,EAAE;gBACX,OAAO,EAAE;oBACR;wBACC,IAAI,EAAE,SAAS;wBACf,WAAW,EAAE,SAAS;wBACtB,MAAM,EAAE;4BACP;gCACC,WAAW,EAAE,SAAS;gCACtB,IAAI,EAAE,SAAS;gCACf,IAAI,EAAE,SAAS;gCACf,WAAW,EAAE;oCACZ,i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AAO,EAAE,aAAa,EAAE,EAAE,EAAE,UAAU,CAAC,CAAC;YAEpE,MAAM,QAAQ,GAAG,MAAM,sBAAU,CAAC,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,kBAAkB,EAAE,UAAU,CAAC,CAAC;YAErF,MAAM,aAAa,GAAG,IAAI,CAAC,OAAO,CAAC,0BAA0B,CAAC,IAAA,gBAAQ,EAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;gBACtF,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;aACrB,CAAC,CAAC;YAEH,UAAU,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC;QACnC,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YAChB,IAAI,IAAI,CAAC,cAAc,EAAE,EAAE,CAAC;gBAC3B,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,EAAE,KAAK,EAAE,KAAK,CAAC,OAAO,EAAE,EAAE,CAAC,CAAC;gBACpD,SAAS;YACV,CAAC;YAED,MAAM,IAAI,2BAAY,CAAC,IAAI,CAAC,OAAO,EAAE,EAAE,KAAmB,CAAC,CAAC;QAC7D,CAAC;IACF,CAAC;IAED,OAAO,UAAU,CAAC;AACnB,CAAC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.salutationFields = exports.lineItemFields = exports.orderAddressFields = exports.orderCustomerFields = exports.genericFields = void 0;
|
|
4
|
+
exports.genericFields = ['id', 'name'];
|
|
5
|
+
exports.orderCustomerFields = [
|
|
6
|
+
'id',
|
|
7
|
+
'firstName',
|
|
8
|
+
'lastName',
|
|
9
|
+
'email',
|
|
10
|
+
'salutationId',
|
|
11
|
+
'salesChannelId',
|
|
12
|
+
'languageId',
|
|
13
|
+
'defaultBillingAddressId',
|
|
14
|
+
'defaultShippingAddressId',
|
|
15
|
+
];
|
|
16
|
+
exports.orderAddressFields = [
|
|
17
|
+
'id',
|
|
18
|
+
'countryId',
|
|
19
|
+
'firstName',
|
|
20
|
+
'lastName',
|
|
21
|
+
'street',
|
|
22
|
+
'city',
|
|
23
|
+
];
|
|
24
|
+
exports.lineItemFields = ['id', 'name', 'states', 'price', 'taxId'];
|
|
25
|
+
exports.salutationFields = ['id', 'displayName', 'salutationKey'];
|
|
26
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../nodes/Shopware/v1/actions/fields.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;AAE/B,QAAA,mBAAmB,GAAG;IAClC,IAAI;IACJ,WAAW;IACX,UAAU;IACV,OAAO;IACP,cAAc;IACd,gBAAgB;IAChB,YAAY;IACZ,yBAAyB;IACzB,0BAA0B;CAC1B,CAAC;AAEW,QAAA,kBAAkB,GAAG;IACjC,IAAI;IACJ,WAAW;IACX,WAAW;IACX,UAAU;IACV,QAAQ;IACR,MAAM;CACN,CAAC;AAEW,QAAA,cAAc,GAAG,CAAC,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,OAAO,EAAE,OAAO,CAAC,CAAA;AAE3D,QAAA,gBAAgB,GAAG,CAAC,IAAI,EAAE,aAAa,EAAE,eAAe,CAAC,CAAC"}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { AllEntities } from 'n8n-workflow';
|
|
2
|
+
type NodeMap = {
|
|
3
|
+
product: 'create' | 'deleteProduct' | 'get' | 'getMany' | 'update';
|
|
4
|
+
customer: 'create' | 'deleteCustomer' | 'get' | 'getMany' | 'update';
|
|
5
|
+
order: 'create' | 'deleteOrder' | 'get' | 'getMany' | 'update';
|
|
6
|
+
category: 'create' | 'deleteCategory' | 'get' | 'getMany' | 'update';
|
|
7
|
+
};
|
|
8
|
+
export type ShopwareType = AllEntities<NodeMap>;
|
|
9
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"node.type.js","sourceRoot":"","sources":["../../../../../nodes/Shopware/v1/actions/node.type.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
import * as create from './create.operation';
|
|
3
|
+
import * as deleteOrder from './deleteOrder.operation';
|
|
4
|
+
import * as get from './get.operation';
|
|
5
|
+
import * as getMany from './getMany.operation';
|
|
6
|
+
import * as update from './update.operation';
|
|
7
|
+
export { create, deleteOrder, get, getMany, update };
|
|
8
|
+
export declare const description: INodeProperties[];
|
|
@@ -0,0 +1,98 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || (function () {
|
|
19
|
+
var ownKeys = function(o) {
|
|
20
|
+
ownKeys = Object.getOwnPropertyNames || function (o) {
|
|
21
|
+
var ar = [];
|
|
22
|
+
for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
|
|
23
|
+
return ar;
|
|
24
|
+
};
|
|
25
|
+
return ownKeys(o);
|
|
26
|
+
};
|
|
27
|
+
return function (mod) {
|
|
28
|
+
if (mod && mod.__esModule) return mod;
|
|
29
|
+
var result = {};
|
|
30
|
+
if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
|
|
31
|
+
__setModuleDefault(result, mod);
|
|
32
|
+
return result;
|
|
33
|
+
};
|
|
34
|
+
})();
|
|
35
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
36
|
+
exports.description = exports.update = exports.getMany = exports.get = exports.deleteOrder = exports.create = void 0;
|
|
37
|
+
const create = __importStar(require("./create.operation"));
|
|
38
|
+
exports.create = create;
|
|
39
|
+
const deleteOrder = __importStar(require("./deleteOrder.operation"));
|
|
40
|
+
exports.deleteOrder = deleteOrder;
|
|
41
|
+
const get = __importStar(require("./get.operation"));
|
|
42
|
+
exports.get = get;
|
|
43
|
+
const getMany = __importStar(require("./getMany.operation"));
|
|
44
|
+
exports.getMany = getMany;
|
|
45
|
+
const update = __importStar(require("./update.operation"));
|
|
46
|
+
exports.update = update;
|
|
47
|
+
exports.description = [
|
|
48
|
+
{
|
|
49
|
+
displayName: 'Operation',
|
|
50
|
+
name: 'operation',
|
|
51
|
+
type: 'options',
|
|
52
|
+
noDataExpression: true,
|
|
53
|
+
options: [
|
|
54
|
+
{
|
|
55
|
+
name: 'Create',
|
|
56
|
+
value: 'create',
|
|
57
|
+
description: 'Create an order',
|
|
58
|
+
action: "Create an order"
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'Delete',
|
|
62
|
+
value: 'deleteOrder',
|
|
63
|
+
description: 'Delete an order',
|
|
64
|
+
action: 'Delete an order'
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'Get',
|
|
68
|
+
value: 'get',
|
|
69
|
+
description: 'Retrieve an order',
|
|
70
|
+
action: 'Get an order',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'Get Many',
|
|
74
|
+
value: 'getMany',
|
|
75
|
+
description: 'Retrieve many orders',
|
|
76
|
+
action: 'Get many orders',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'Update',
|
|
80
|
+
value: 'update',
|
|
81
|
+
description: 'Update an order',
|
|
82
|
+
action: 'Update an order',
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
default: 'getMany',
|
|
86
|
+
displayOptions: {
|
|
87
|
+
show: {
|
|
88
|
+
resource: ['order'],
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
...create.description,
|
|
93
|
+
...deleteOrder.description,
|
|
94
|
+
...get.description,
|
|
95
|
+
...getMany.description,
|
|
96
|
+
...update.description,
|
|
97
|
+
];
|
|
98
|
+
//# sourceMappingURL=Order.resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Order.resource.js","sourceRoot":"","sources":["../../../../../../nodes/Shopware/v1/actions/order/Order.resource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,2DAA6C;AAMpC,wBAAM;AALf,qEAAuD;AAKtC,kCAAW;AAJ5B,qDAAuC;AAIT,kBAAG;AAHjC,6DAA+C;AAGZ,0BAAO;AAF1C,2DAA6C;AAED,wBAAM;AAErC,QAAA,WAAW,GAAsB;IAC7C;QACC,WAAW,EAAE,WAAW;QACxB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,gBAAgB,EAAE,IAAI;QACtB,OAAO,EAAE;YACR;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,iBAAiB;gBAC9B,MAAM,EAAE,iBAAiB;aACzB;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,aAAa;gBACpB,WAAW,EAAE,iBAAiB;gBAC9B,MAAM,EAAE,iBAAiB;aACzB;YACD;gBACC,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,KAAK;gBACZ,WAAW,EAAE,mBAAmB;gBAChC,MAAM,EAAE,cAAc;aACtB;YACD;gBACC,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,sBAAsB;gBACnC,MAAM,EAAE,iBAAiB;aACzB;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,iBAAiB;gBAC9B,MAAM,EAAE,iBAAiB;aACzB;SACD;QACD,OAAO,EAAE,SAAS;QAClB,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,OAAO,CAAC;aACnB;SACD;KACD;IACD,GAAG,MAAM,CAAC,WAAW;IACrB,GAAG,WAAW,CAAC,WAAW;IAC1B,GAAG,GAAG,CAAC,WAAW;IAClB,GAAG,OAAO,CAAC,WAAW;IACtB,GAAG,MAAM,CAAC,WAAW;CACrB,CAAC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type INodeExecutionData, type INodeProperties, type IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
export declare const description: {
|
|
3
|
+
displayOptions: import("n8n-workflow").IDisplayOptions;
|
|
4
|
+
displayName: string;
|
|
5
|
+
name: string;
|
|
6
|
+
type: import("n8n-workflow").NodePropertyTypes;
|
|
7
|
+
typeOptions?: import("n8n-workflow").INodePropertyTypeOptions;
|
|
8
|
+
default: import("n8n-workflow").NodeParameterValueType;
|
|
9
|
+
description?: string;
|
|
10
|
+
hint?: string;
|
|
11
|
+
disabledOptions?: import("n8n-workflow").IDisplayOptions;
|
|
12
|
+
options?: Array<import("n8n-workflow").INodePropertyOptions | INodeProperties | import("n8n-workflow").INodePropertyCollection>;
|
|
13
|
+
placeholder?: string;
|
|
14
|
+
isNodeSetting?: boolean;
|
|
15
|
+
noDataExpression?: boolean;
|
|
16
|
+
required?: boolean;
|
|
17
|
+
routing?: import("n8n-workflow").INodePropertyRouting;
|
|
18
|
+
credentialTypes?: Array<"extends:oAuth2Api" | "extends:oAuth1Api" | "has:authenticate" | "has:genericAuth">;
|
|
19
|
+
extractValue?: import("n8n-workflow").INodePropertyValueExtractor;
|
|
20
|
+
modes?: import("n8n-workflow").INodePropertyMode[];
|
|
21
|
+
requiresDataPath?: "single" | "multiple";
|
|
22
|
+
doNotInherit?: boolean;
|
|
23
|
+
validateType?: import("n8n-workflow").FieldType;
|
|
24
|
+
ignoreValidationDuringExecution?: boolean;
|
|
25
|
+
allowArbitraryValues?: boolean;
|
|
26
|
+
}[];
|
|
27
|
+
export declare function execute(this: IExecuteFunctions, items: INodeExecutionData[]): Promise<INodeExecutionData[]>;
|