@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 @@
|
|
|
1
|
+
export * as loadOptions from './loadOptions';
|
|
@@ -0,0 +1,38 @@
|
|
|
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.loadOptions = void 0;
|
|
37
|
+
exports.loadOptions = __importStar(require("./loadOptions"));
|
|
38
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Shopware/v1/methods/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,6DAA6C"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { ILoadOptionsFunctions, INodePropertyOptions } from 'n8n-workflow';
|
|
2
|
+
export declare function getProducts(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
3
|
+
export declare function getCurrencies(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
4
|
+
export declare function getOrderCurrencies(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
5
|
+
export declare function getTaxRates(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
6
|
+
export declare function getTaxes(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
7
|
+
export declare function getCategories(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
8
|
+
export declare function getSalesChannels(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
9
|
+
export declare function getLanguages(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
10
|
+
export declare function getCustomerGroups(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
11
|
+
export declare function getPaymentMethods(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
12
|
+
export declare function getCountries(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
13
|
+
export declare function getSalutations(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
14
|
+
export declare function getOrderStates(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
15
|
+
export declare function getTransactionStates(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
16
|
+
export declare function getDeliveryStates(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
17
|
+
export declare function getShippingMethods(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
18
|
+
export declare function getProductManufacturers(this: ILoadOptionsFunctions): Promise<INodePropertyOptions[]>;
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getProducts = getProducts;
|
|
4
|
+
exports.getCurrencies = getCurrencies;
|
|
5
|
+
exports.getOrderCurrencies = getOrderCurrencies;
|
|
6
|
+
exports.getTaxRates = getTaxRates;
|
|
7
|
+
exports.getTaxes = getTaxes;
|
|
8
|
+
exports.getCategories = getCategories;
|
|
9
|
+
exports.getSalesChannels = getSalesChannels;
|
|
10
|
+
exports.getLanguages = getLanguages;
|
|
11
|
+
exports.getCustomerGroups = getCustomerGroups;
|
|
12
|
+
exports.getPaymentMethods = getPaymentMethods;
|
|
13
|
+
exports.getCountries = getCountries;
|
|
14
|
+
exports.getSalutations = getSalutations;
|
|
15
|
+
exports.getOrderStates = getOrderStates;
|
|
16
|
+
exports.getTransactionStates = getTransactionStates;
|
|
17
|
+
exports.getDeliveryStates = getDeliveryStates;
|
|
18
|
+
exports.getShippingMethods = getShippingMethods;
|
|
19
|
+
exports.getProductManufacturers = getProductManufacturers;
|
|
20
|
+
const fields_1 = require("../actions/product/fields");
|
|
21
|
+
const fields_2 = require("../actions/customer/fields");
|
|
22
|
+
const fields_3 = require("../actions/order/fields");
|
|
23
|
+
const fields_4 = require("../actions/fields");
|
|
24
|
+
const transport_1 = require("../transport");
|
|
25
|
+
async function fetchResource(context, resource, fields, mapValue = false) {
|
|
26
|
+
const returnData = [];
|
|
27
|
+
const body = {
|
|
28
|
+
fields,
|
|
29
|
+
includes: {
|
|
30
|
+
[resource]: fields,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
const response = await transport_1.apiRequest.call(context, 'POST', `/search/${resource}`, body);
|
|
34
|
+
for (const item of response.data) {
|
|
35
|
+
const name = item[fields[1]];
|
|
36
|
+
let value = item[fields[0]];
|
|
37
|
+
if (mapValue) {
|
|
38
|
+
value = fields
|
|
39
|
+
.map((field) => {
|
|
40
|
+
if (typeof item[field] === 'object') {
|
|
41
|
+
return JSON.stringify(item[field]);
|
|
42
|
+
}
|
|
43
|
+
return item[field];
|
|
44
|
+
})
|
|
45
|
+
.join('-');
|
|
46
|
+
}
|
|
47
|
+
returnData.push({
|
|
48
|
+
name,
|
|
49
|
+
value,
|
|
50
|
+
});
|
|
51
|
+
}
|
|
52
|
+
returnData.push({ name: 'None', value: '' });
|
|
53
|
+
return returnData;
|
|
54
|
+
}
|
|
55
|
+
async function getProducts() {
|
|
56
|
+
return await fetchResource(this, 'product', fields_1.productOptionFields);
|
|
57
|
+
}
|
|
58
|
+
async function getCurrencies() {
|
|
59
|
+
return await fetchResource(this, 'currency', fields_1.currencyOptionFields);
|
|
60
|
+
}
|
|
61
|
+
async function getOrderCurrencies() {
|
|
62
|
+
return await fetchResource(this, 'currency', fields_1.currencyOptionFields, true);
|
|
63
|
+
}
|
|
64
|
+
async function getTaxRates() {
|
|
65
|
+
return await fetchResource(this, 'tax', fields_1.taxOptionFields, true);
|
|
66
|
+
}
|
|
67
|
+
async function getTaxes() {
|
|
68
|
+
return await fetchResource(this, 'tax', fields_4.genericFields);
|
|
69
|
+
}
|
|
70
|
+
async function getCategories() {
|
|
71
|
+
return await fetchResource(this, 'category', fields_1.categoryOptionFields, true);
|
|
72
|
+
}
|
|
73
|
+
async function getSalesChannels() {
|
|
74
|
+
return await fetchResource(this, 'sales-channel', fields_1.salesChannelOptionFields);
|
|
75
|
+
}
|
|
76
|
+
async function getLanguages() {
|
|
77
|
+
return await fetchResource(this, 'language', fields_2.languageOptionFields);
|
|
78
|
+
}
|
|
79
|
+
async function getCustomerGroups() {
|
|
80
|
+
return await fetchResource(this, 'customer-group', fields_2.customerGroupOptionFields);
|
|
81
|
+
}
|
|
82
|
+
async function getPaymentMethods() {
|
|
83
|
+
const returnData = [];
|
|
84
|
+
const response = await transport_1.apiRequest.call(this, 'GET', `/payment-method`);
|
|
85
|
+
for (const item of response.data) {
|
|
86
|
+
const name = item.name;
|
|
87
|
+
const value = item.id;
|
|
88
|
+
returnData.push({
|
|
89
|
+
name,
|
|
90
|
+
value,
|
|
91
|
+
});
|
|
92
|
+
}
|
|
93
|
+
returnData.push({ name: 'None', value: '' });
|
|
94
|
+
return returnData;
|
|
95
|
+
}
|
|
96
|
+
async function getStatesByType(type) {
|
|
97
|
+
const returnData = [];
|
|
98
|
+
const body = {
|
|
99
|
+
filter: [
|
|
100
|
+
{
|
|
101
|
+
type: 'equals',
|
|
102
|
+
field: 'technicalName',
|
|
103
|
+
value: type,
|
|
104
|
+
},
|
|
105
|
+
],
|
|
106
|
+
associations: {
|
|
107
|
+
states: {},
|
|
108
|
+
},
|
|
109
|
+
};
|
|
110
|
+
const states = (await transport_1.apiRequest.call(this, 'POST', `/search/state-machine`, body)).data[0]
|
|
111
|
+
.states;
|
|
112
|
+
for (const state of states) {
|
|
113
|
+
const name = state.name;
|
|
114
|
+
const value = state.id;
|
|
115
|
+
returnData.push({
|
|
116
|
+
name,
|
|
117
|
+
value,
|
|
118
|
+
});
|
|
119
|
+
}
|
|
120
|
+
return returnData;
|
|
121
|
+
}
|
|
122
|
+
async function getCountries() {
|
|
123
|
+
return await fetchResource(this, 'country', fields_2.countryOptionFields);
|
|
124
|
+
}
|
|
125
|
+
async function getSalutations() {
|
|
126
|
+
return await fetchResource(this, 'salutation', fields_3.salutationOptionFields);
|
|
127
|
+
}
|
|
128
|
+
async function getOrderStates() {
|
|
129
|
+
return await getStatesByType.call(this, 'order.state');
|
|
130
|
+
}
|
|
131
|
+
async function getTransactionStates() {
|
|
132
|
+
return await getStatesByType.call(this, 'order_transaction.state');
|
|
133
|
+
}
|
|
134
|
+
async function getDeliveryStates() {
|
|
135
|
+
return await getStatesByType.call(this, 'order_delivery.state');
|
|
136
|
+
}
|
|
137
|
+
async function getShippingMethods() {
|
|
138
|
+
return await fetchResource(this, 'shipping-method', fields_4.genericFields);
|
|
139
|
+
}
|
|
140
|
+
async function getProductManufacturers() {
|
|
141
|
+
return await fetchResource(this, 'product-manufacturer', fields_4.genericFields);
|
|
142
|
+
}
|
|
143
|
+
//# sourceMappingURL=loadOptions.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"loadOptions.js","sourceRoot":"","sources":["../../../../../nodes/Shopware/v1/methods/loadOptions.ts"],"names":[],"mappings":";;AAqEA,kCAEC;AAED,sCAEC;AAED,gDAIC;AAED,kCAEC;AAED,4BAEC;AAED,sCAEC;AAED,4CAIC;AAED,oCAEC;AAED,8CAQC;AAED,8CAoBC;AAoCD,oCAEC;AAED,wCAEC;AAED,wCAEC;AAED,oDAIC;AAED,8CAIC;A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B,IAAI,EAAE,YAAY,EAAE,+BAAsB,CAAC,CAAC;AAC1F,CAAC;AAEM,KAAK,UAAU,cAAc;IACnC,OAAO,MAAM,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,aAAa,CAAC,CAAC;AACxD,CAAC;AAEM,KAAK,UAAU,oBAAoB;IAGzC,OAAO,MAAM,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,yBAAyB,CAAC,CAAC;AACpE,CAAC;AAEM,KAAK,UAAU,iBAAiB;IAGtC,OAAO,MAAM,eAAe,CAAC,IAAI,CAAC,IAAI,EAAE,sBAAsB,CAAC,CAAC;AACjE,CAAC;AAEM,KAAK,UAAU,kBAAkB;IAGvC,OAAO,MAAM,aAAa,CAAgB,IAAI,EAAE,iBAAiB,EAAE,sBAAa,CAAC,CAAC;AACnF,CAAC;AAEM,KAAK,UAAU,uBAAuB;IAC5C,OAAO,MAAM,aAAa,CAAgB,IAAI,EAAE,sBAAsB,EAAE,sBAAa,CAAC,CAAC;AACxF,CAAC"}
|
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
import type { IDataObject, IExecuteFunctions, IPollFunctions, ILoadOptionsFunctions, IHttpRequestMethods } from 'n8n-workflow';
|
|
2
|
+
export declare function apiRequest(this: IExecuteFunctions | ILoadOptionsFunctions | IPollFunctions, method: IHttpRequestMethods, endpoint: string, body?: IDataObject, query?: IDataObject, option?: IDataObject): Promise<any>;
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.apiRequest = apiRequest;
|
|
4
|
+
async function apiRequest(method, endpoint, body = {}, query, option = {}) {
|
|
5
|
+
const credentials = await this.getCredentials('shopwareOAuth2Api');
|
|
6
|
+
const url = credentials.url;
|
|
7
|
+
query = query || {};
|
|
8
|
+
const options = {
|
|
9
|
+
headers: {},
|
|
10
|
+
method,
|
|
11
|
+
body,
|
|
12
|
+
qs: query,
|
|
13
|
+
uri: `${url}/api${endpoint}`,
|
|
14
|
+
useQuerystring: false,
|
|
15
|
+
json: true,
|
|
16
|
+
};
|
|
17
|
+
if (Object.keys(option).length !== 0) {
|
|
18
|
+
Object.assign(options, option);
|
|
19
|
+
}
|
|
20
|
+
if (Object.keys(body).length === 0) {
|
|
21
|
+
delete options.body;
|
|
22
|
+
}
|
|
23
|
+
return await this.helpers.requestWithAuthentication.call(this, 'shopwareOAuth2Api', options);
|
|
24
|
+
}
|
|
25
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Shopware/v1/transport/index.ts"],"names":[],"mappings":";;AAmBA,gCAgCC;AAhCM,KAAK,UAAU,UAAU,CAE/B,MAA2B,EAC3B,QAAgB,EAChB,OAAoB,EAAE,EACtB,KAAmB,EACnB,SAAsB,EAAE;IAExB,MAAM,WAAW,GAAG,MAAM,IAAI,CAAC,cAAc,CAAC,mBAAmB,CAAC,CAAC;IACnE,MAAM,GAAG,GAAG,WAAW,CAAC,GAAa,CAAC;IAEtC,KAAK,GAAG,KAAK,IAAI,EAAE,CAAC;IAEpB,MAAM,OAAO,GAAoB;QAChC,OAAO,EAAE,EAAE;QACX,MAAM;QACN,IAAI;QACJ,EAAE,EAAE,KAAK;QACT,GAAG,EAAE,GAAG,GAAG,OAAO,QAAQ,EAAE;QAC5B,cAAc,EAAE,KAAK;QACrB,IAAI,EAAE,IAAI;KACV,CAAC;IAEF,IAAI,MAAM,CAAC,IAAI,CAAC,MAAM,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACtC,MAAM,CAAC,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,CAAC;IAChC,CAAC;IAED,IAAI,MAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACpC,OAAO,OAAO,CAAC,IAAI,CAAC;IACrB,CAAC;IAED,OAAO,MAAM,IAAI,CAAC,OAAO,CAAC,yBAAyB,CAAC,IAAI,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,CAAC;AAC9F,CAAC"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@solution25/n8n-nodes-shopware",
|
|
3
|
+
"version": "1.4.0",
|
|
4
|
+
"description": "Shopware 6 n8n community node",
|
|
5
|
+
"license": "MIT",
|
|
6
|
+
"homepage": "https://n8n.io",
|
|
7
|
+
"keywords": [
|
|
8
|
+
"n8n-community-node-package"
|
|
9
|
+
],
|
|
10
|
+
"author": {
|
|
11
|
+
"name": "Fatjon-Gashi1",
|
|
12
|
+
"email": "fatjon.gashi@solution25.com"
|
|
13
|
+
},
|
|
14
|
+
"repository": {
|
|
15
|
+
"type": "git",
|
|
16
|
+
"url": "https://github.com/solution25com/n8n-nodes-shopware"
|
|
17
|
+
},
|
|
18
|
+
"scripts": {
|
|
19
|
+
"build": "n8n-node build",
|
|
20
|
+
"build:watch": "tsc --watch",
|
|
21
|
+
"dev": "n8n-node dev",
|
|
22
|
+
"lint": "n8n-node lint",
|
|
23
|
+
"lint:fix": "n8n-node lint --fix",
|
|
24
|
+
"release": "n8n-node release",
|
|
25
|
+
"prepublishOnly": "n8n-node prerelease",
|
|
26
|
+
"test": "jest --verbose"
|
|
27
|
+
},
|
|
28
|
+
"files": [
|
|
29
|
+
"dist"
|
|
30
|
+
],
|
|
31
|
+
"n8n": {
|
|
32
|
+
"n8nNodesApiVersion": 1,
|
|
33
|
+
"credentials": [],
|
|
34
|
+
"nodes": [
|
|
35
|
+
"dist/nodes/Shopware/Shopware.node.js"
|
|
36
|
+
]
|
|
37
|
+
},
|
|
38
|
+
"release-it": {
|
|
39
|
+
"npm": {
|
|
40
|
+
"publish": true
|
|
41
|
+
},
|
|
42
|
+
"github": {
|
|
43
|
+
"release": true
|
|
44
|
+
}
|
|
45
|
+
},
|
|
46
|
+
"devDependencies": {
|
|
47
|
+
"@n8n/node-cli": "^0.11.0",
|
|
48
|
+
"@types/jest": "^30.0.0",
|
|
49
|
+
"@types/lodash": "^4.17.20",
|
|
50
|
+
"@types/nock": "^11.1.0",
|
|
51
|
+
"eslint": "9.32.0",
|
|
52
|
+
"jest": "^30.2.0",
|
|
53
|
+
"lodash": "^4.17.21",
|
|
54
|
+
"nock": "^14.0.10",
|
|
55
|
+
"prettier": "3.6.2",
|
|
56
|
+
"release-it": "^19.0.5",
|
|
57
|
+
"ts-jest": "^29.4.5",
|
|
58
|
+
"typescript": "5.9.2"
|
|
59
|
+
},
|
|
60
|
+
"peerDependencies": {
|
|
61
|
+
"n8n-workflow": "*"
|
|
62
|
+
}
|
|
63
|
+
}
|
|
Binary file
|