@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
|
+
{"version":3,"file":"ShopwareV1.node.js","sourceRoot":"","sources":["../../../../nodes/Shopware/v1/ShopwareV1.node.ts"],"names":[],"mappings":";;;AAOA,6CAA0C;AAC1C,qEAAkE;AAClE,uCAAwC;AAExC,MAAa,UAAU;IAGtB,YAAY,eAAyC;QAQrD,YAAO,GAAG;YACT,WAAW,EAAX,qBAAW;SACX,CAAC;QATD,IAAI,CAAC,WAAW,GAAG;YAClB,GAAG,eAAe;YAClB,GAAG,uCAAkB;YACrB,YAAY,EAAE,IAAI;SAClB,CAAC;IACH,CAAC;IAMD,KAAK,CAAC,OAAO;QACZ,OAAO,MAAM,eAAM,CAAC,IAAI,CAAC,IAAI,CAAC,CAAC;IAChC,CAAC;CACD;AAlBD,gCAkBC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import type { INodeProperties } from 'n8n-workflow';
|
|
2
|
+
import * as create from './create.operation';
|
|
3
|
+
import * as deleteCategory from './deleteCategory.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, deleteCategory, 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.deleteCategory = exports.create = void 0;
|
|
37
|
+
const create = __importStar(require("./create.operation"));
|
|
38
|
+
exports.create = create;
|
|
39
|
+
const deleteCategory = __importStar(require("./deleteCategory.operation"));
|
|
40
|
+
exports.deleteCategory = deleteCategory;
|
|
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 a category',
|
|
58
|
+
action: 'Create a category',
|
|
59
|
+
},
|
|
60
|
+
{
|
|
61
|
+
name: 'Delete',
|
|
62
|
+
value: 'deleteCategory',
|
|
63
|
+
description: 'Delete a category',
|
|
64
|
+
action: 'Delete a category',
|
|
65
|
+
},
|
|
66
|
+
{
|
|
67
|
+
name: 'Get',
|
|
68
|
+
value: 'get',
|
|
69
|
+
description: 'Retrieve a category',
|
|
70
|
+
action: 'Get a category',
|
|
71
|
+
},
|
|
72
|
+
{
|
|
73
|
+
name: 'Get Many',
|
|
74
|
+
value: 'getMany',
|
|
75
|
+
description: 'Retrieve many categories',
|
|
76
|
+
action: 'Get many categories',
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
name: 'Update',
|
|
80
|
+
value: 'update',
|
|
81
|
+
description: 'Update a category',
|
|
82
|
+
action: 'Update a category',
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
default: 'get',
|
|
86
|
+
displayOptions: {
|
|
87
|
+
show: {
|
|
88
|
+
resource: ['category'],
|
|
89
|
+
},
|
|
90
|
+
},
|
|
91
|
+
},
|
|
92
|
+
...create.description,
|
|
93
|
+
...deleteCategory.description,
|
|
94
|
+
...get.description,
|
|
95
|
+
...getMany.description,
|
|
96
|
+
...update.description,
|
|
97
|
+
];
|
|
98
|
+
//# sourceMappingURL=Category.resource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Category.resource.js","sourceRoot":"","sources":["../../../../../../nodes/Shopware/v1/actions/category/Category.resource.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAEA,2DAA6C;AAMpC,wBAAM;AALf,2EAA6D;AAK5C,wCAAc;AAJ/B,qDAAuC;AAIN,kBAAG;AAHpC,6DAA+C;AAGT,0BAAO;AAF7C,2DAA6C;AAEE,wBAAM;AAExC,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,mBAAmB;gBAChC,MAAM,EAAE,mBAAmB;aAC3B;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,gBAAgB;gBACvB,WAAW,EAAE,mBAAmB;gBAChC,MAAM,EAAE,mBAAmB;aAC3B;YACD;gBACC,IAAI,EAAE,KAAK;gBACX,KAAK,EAAE,KAAK;gBACZ,WAAW,EAAE,qBAAqB;gBAClC,MAAM,EAAE,gBAAgB;aACxB;YACD;gBACC,IAAI,EAAE,UAAU;gBAChB,KAAK,EAAE,SAAS;gBAChB,WAAW,EAAE,0BAA0B;gBACvC,MAAM,EAAE,qBAAqB;aAC7B;YACD;gBACC,IAAI,EAAE,QAAQ;gBACd,KAAK,EAAE,QAAQ;gBACf,WAAW,EAAE,mBAAmB;gBAChC,MAAM,EAAE,mBAAmB;aAC3B;SACD;QACD,OAAO,EAAE,KAAK;QACd,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,QAAQ,EAAE,CAAC,UAAU,CAAC;aACtB;SACD;KACD;IACD,GAAG,MAAM,CAAC,WAAW;IACrB,GAAG,cAAc,CAAC,WAAW;IAC7B,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[]>;
|
|
@@ -0,0 +1,211 @@
|
|
|
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 transport_1 = require("../../transport");
|
|
7
|
+
const fields_1 = require("./fields");
|
|
8
|
+
const utils_1 = require("../../helpers/utils");
|
|
9
|
+
const properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Parent Category',
|
|
12
|
+
name: 'parent',
|
|
13
|
+
type: 'boolean',
|
|
14
|
+
default: true,
|
|
15
|
+
description: 'Whether to create a parent category or a child',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
displayName: 'Create Parent',
|
|
19
|
+
name: 'createParent',
|
|
20
|
+
type: 'boolean',
|
|
21
|
+
default: true,
|
|
22
|
+
description: 'Whether to create a parent category for the child category',
|
|
23
|
+
displayOptions: {
|
|
24
|
+
show: {
|
|
25
|
+
parent: [false],
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Parent Category',
|
|
31
|
+
name: 'parentId',
|
|
32
|
+
type: 'options',
|
|
33
|
+
typeOptions: {
|
|
34
|
+
loadOptionsMethod: 'getCategories'
|
|
35
|
+
},
|
|
36
|
+
required: true,
|
|
37
|
+
default: '',
|
|
38
|
+
placeholder: 'e.g. 2a88d9b59d474...',
|
|
39
|
+
description: 'Select the parent category from the list',
|
|
40
|
+
displayOptions: {
|
|
41
|
+
show: {
|
|
42
|
+
createParent: [false],
|
|
43
|
+
parent: [false],
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
displayName: 'Parent Category Name',
|
|
49
|
+
name: 'parentCategoryName',
|
|
50
|
+
type: 'string',
|
|
51
|
+
required: true,
|
|
52
|
+
default: '',
|
|
53
|
+
description: 'Name of the parent category',
|
|
54
|
+
displayOptions: {
|
|
55
|
+
show: {
|
|
56
|
+
createParent: [true],
|
|
57
|
+
parent: [false],
|
|
58
|
+
},
|
|
59
|
+
},
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
displayName: 'Parent Category Description',
|
|
63
|
+
name: 'parentCategoryDescription',
|
|
64
|
+
type: 'string',
|
|
65
|
+
typeOptions: {
|
|
66
|
+
rows: 4,
|
|
67
|
+
},
|
|
68
|
+
required: true,
|
|
69
|
+
default: '',
|
|
70
|
+
description: 'Description of parent category',
|
|
71
|
+
displayOptions: {
|
|
72
|
+
show: {
|
|
73
|
+
createParent: [true],
|
|
74
|
+
parent: [false],
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
displayName: 'Category Name',
|
|
80
|
+
name: 'categoryName',
|
|
81
|
+
type: 'string',
|
|
82
|
+
required: true,
|
|
83
|
+
default: '',
|
|
84
|
+
description: 'Name of the category',
|
|
85
|
+
},
|
|
86
|
+
{
|
|
87
|
+
displayName: 'Category Description',
|
|
88
|
+
name: 'categoryDescription',
|
|
89
|
+
type: 'string',
|
|
90
|
+
typeOptions: {
|
|
91
|
+
rows: 4,
|
|
92
|
+
},
|
|
93
|
+
required: true,
|
|
94
|
+
default: '',
|
|
95
|
+
description: 'Description of category',
|
|
96
|
+
},
|
|
97
|
+
{
|
|
98
|
+
displayName: 'Children',
|
|
99
|
+
name: 'children',
|
|
100
|
+
placeholder: 'Add Child Category',
|
|
101
|
+
type: 'fixedCollection',
|
|
102
|
+
typeOptions: {
|
|
103
|
+
multipleValues: true,
|
|
104
|
+
},
|
|
105
|
+
description: 'Child categories for category',
|
|
106
|
+
default: {},
|
|
107
|
+
options: [
|
|
108
|
+
{
|
|
109
|
+
name: 'category',
|
|
110
|
+
displayName: 'Category',
|
|
111
|
+
values: [
|
|
112
|
+
{
|
|
113
|
+
displayName: 'Category Name',
|
|
114
|
+
name: 'categoryName',
|
|
115
|
+
type: 'string',
|
|
116
|
+
required: true,
|
|
117
|
+
default: '',
|
|
118
|
+
description: 'Name of the category',
|
|
119
|
+
},
|
|
120
|
+
{
|
|
121
|
+
displayName: 'Category Description',
|
|
122
|
+
name: 'categoryDescription',
|
|
123
|
+
type: 'string',
|
|
124
|
+
typeOptions: {
|
|
125
|
+
rows: 4,
|
|
126
|
+
},
|
|
127
|
+
required: true,
|
|
128
|
+
default: '',
|
|
129
|
+
description: 'Description of category',
|
|
130
|
+
},
|
|
131
|
+
],
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
];
|
|
136
|
+
const displayOptions = {
|
|
137
|
+
show: {
|
|
138
|
+
resource: ['category'],
|
|
139
|
+
operation: ['create'],
|
|
140
|
+
},
|
|
141
|
+
};
|
|
142
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)(displayOptions, properties);
|
|
143
|
+
async function execute(items) {
|
|
144
|
+
var _a;
|
|
145
|
+
const returnData = [];
|
|
146
|
+
for (let i = 0; i < items.length; i++) {
|
|
147
|
+
try {
|
|
148
|
+
const id = (0, utils_1.uuidv7)();
|
|
149
|
+
let parent = null;
|
|
150
|
+
let parentId = null;
|
|
151
|
+
let children = null;
|
|
152
|
+
if (!this.getNodeParameter('parent', i)) {
|
|
153
|
+
if (this.getNodeParameter('createParent', i)) {
|
|
154
|
+
parent = {
|
|
155
|
+
name: this.getNodeParameter('parentCategoryName', i),
|
|
156
|
+
description: this.getNodeParameter('parentCategoryDescription', i),
|
|
157
|
+
};
|
|
158
|
+
}
|
|
159
|
+
else {
|
|
160
|
+
parentId = this.getNodeParameter('parentId', i).split('-')[0];
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
const nodeChildCategories = (_a = this.getNodeParameter('children', i)) === null || _a === void 0 ? void 0 : _a.category;
|
|
164
|
+
if (nodeChildCategories && nodeChildCategories.length > 0) {
|
|
165
|
+
children = nodeChildCategories.map((category) => ({
|
|
166
|
+
name: category.categoryName,
|
|
167
|
+
description: category.categoryDescription,
|
|
168
|
+
}));
|
|
169
|
+
}
|
|
170
|
+
const createBody = {
|
|
171
|
+
id,
|
|
172
|
+
name: this.getNodeParameter('categoryName', i),
|
|
173
|
+
description: this.getNodeParameter('categoryDescription', i),
|
|
174
|
+
parentId,
|
|
175
|
+
parent,
|
|
176
|
+
children,
|
|
177
|
+
};
|
|
178
|
+
const searchBody = {
|
|
179
|
+
fields: fields_1.categoryFields,
|
|
180
|
+
includes: {
|
|
181
|
+
category: fields_1.categoryFields,
|
|
182
|
+
},
|
|
183
|
+
filter: [{ type: 'equals', field: 'id', value: id }],
|
|
184
|
+
};
|
|
185
|
+
for (const key in createBody) {
|
|
186
|
+
const typedKey = key;
|
|
187
|
+
if (createBody[typedKey] === null) {
|
|
188
|
+
delete createBody[typedKey];
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
await transport_1.apiRequest.call(this, 'POST', `/category`, createBody);
|
|
192
|
+
const response = await transport_1.apiRequest.call(this, 'POST', `/search/category`, searchBody);
|
|
193
|
+
const executionData = this.helpers.constructExecutionMetaData((0, utils_1.wrapData)(response.data), {
|
|
194
|
+
itemData: { item: i },
|
|
195
|
+
});
|
|
196
|
+
returnData.push(...executionData);
|
|
197
|
+
}
|
|
198
|
+
catch (error) {
|
|
199
|
+
if (this.continueOnFail()) {
|
|
200
|
+
returnData.push({ json: { error: error.message } });
|
|
201
|
+
continue;
|
|
202
|
+
}
|
|
203
|
+
if (error instanceof n8n_workflow_1.NodeOperationError) {
|
|
204
|
+
throw error;
|
|
205
|
+
}
|
|
206
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
return returnData;
|
|
210
|
+
}
|
|
211
|
+
//# sourceMappingURL=create.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"create.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Shopware/v1/actions/category/create.operation.ts"],"names":[],"mappings":";;;AAyJA,0BAsFC;AA/OD,+CAQsB;AAEtB,+CAA6C;AAC7C,qCAA0C;AAC1C,+CAAuD;AAEvD,MAAM,UAAU,GAAsB;IACrC;QACC,WAAW,EAAE,iBAAiB;QAC9B,IAAI,EAAE,QAAQ;QACd,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,gDAAgD;KAC7D;IACD;QACC,WAAW,EAAE,eAAe;QAC5B,IAAI,EAAE,cAAc;QACpB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,4DAA4D;QACzE,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,MAAM,EAAE,CAAC,KAAK,CAAC;aACf;SACD;KACD;IACD;QAEC,WAAW,EAAE,iBAAiB;QAC9B,IAAI,EAAE,UAAU;QAChB,IAAI,EAAE,SAAS;QACT,WAAW,EAAE;YACT,iBAAiB,EAAE,eAAe;SACrC;QACP,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,uBAAuB;QAEpC,WAAW,EAAE,0CAA0C;QACvD,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,YAAY,EAAE,CAAC,KAAK,CAAC;gBACrB,MAAM,EAAE,CAAC,KAAK,CAAC;aACf;SACD;KACD;IACD;QACC,WAAW,EAAE,sBAAsB;QACnC,IAAI,EAAE,oBAAoB;QAC1B,IAAI,EAAE,QAAQ;QACd,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,6BAA6B;QAC1C,cAAc,EAAE;YACf,IAAI,EAAE;gBACL,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U,CAAC,CAAC;YAE7D,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,IAAI,KAAK,YAAY,iCAAkB,EAAE,CAAC;gBACzC,MAAM,KAAK,CAAC;YACb,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,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[]>;
|
|
@@ -0,0 +1,47 @@
|
|
|
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 transport_1 = require("../../transport");
|
|
7
|
+
const utils_1 = require("../../helpers/utils");
|
|
8
|
+
const properties = [
|
|
9
|
+
{
|
|
10
|
+
displayName: 'Category ID',
|
|
11
|
+
name: 'id',
|
|
12
|
+
type: 'string',
|
|
13
|
+
default: '',
|
|
14
|
+
placeholder: 'e.g. 2a88d9b59d474...',
|
|
15
|
+
required: true,
|
|
16
|
+
description: 'ID of the category to delete. You can find the ID in the URL when viewing the category in Shopware Admin (e.g. https://your-domain.com/admin#/sw/category/detail/<categoryId>).',
|
|
17
|
+
},
|
|
18
|
+
];
|
|
19
|
+
const displayOptions = {
|
|
20
|
+
show: {
|
|
21
|
+
resource: ['category'],
|
|
22
|
+
operation: ['deleteCategory'],
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)(displayOptions, properties);
|
|
26
|
+
async function execute(items) {
|
|
27
|
+
const returnData = [];
|
|
28
|
+
for (let i = 0; i < items.length; i++) {
|
|
29
|
+
try {
|
|
30
|
+
const id = this.getNodeParameter('id', i);
|
|
31
|
+
await transport_1.apiRequest.call(this, 'DELETE', `/category/${id}`);
|
|
32
|
+
const executionData = this.helpers.constructExecutionMetaData((0, utils_1.wrapData)({ success: true, id, message: `Category ${id} deleted successfully` }), {
|
|
33
|
+
itemData: { item: i },
|
|
34
|
+
});
|
|
35
|
+
returnData.push(...executionData);
|
|
36
|
+
}
|
|
37
|
+
catch (error) {
|
|
38
|
+
if (this.continueOnFail()) {
|
|
39
|
+
returnData.push({ json: { error: error.message } });
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
return returnData;
|
|
46
|
+
}
|
|
47
|
+
//# sourceMappingURL=deleteCategory.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deleteCategory.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Shopware/v1/actions/category/deleteCategory.operation.ts"],"names":[],"mappings":";;;AAiCA,0BA+BC;AAhED,+CAOsB;AACtB,+CAA6C;AAC7C,+CAA+C;AAE/C,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;CACD,CAAC;AAEF,MAAM,cAAc,GAAG;IACtB,IAAI,EAAE;QACL,QAAQ,EAAE,CAAC,UAAU,CA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@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.categoryFields = void 0;
|
|
4
|
+
exports.categoryFields = [
|
|
5
|
+
'id',
|
|
6
|
+
'parentId',
|
|
7
|
+
'mediaId',
|
|
8
|
+
'breadcrumb',
|
|
9
|
+
'level',
|
|
10
|
+
'path',
|
|
11
|
+
'childCount',
|
|
12
|
+
'type',
|
|
13
|
+
'visible',
|
|
14
|
+
'active',
|
|
15
|
+
'visibleChildCount',
|
|
16
|
+
'name',
|
|
17
|
+
'description',
|
|
18
|
+
'keywords',
|
|
19
|
+
'createdAt'
|
|
20
|
+
];
|
|
21
|
+
//# sourceMappingURL=fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.js","sourceRoot":"","sources":["../../../../../../nodes/Shopware/v1/actions/category/fields.ts"],"names":[],"mappings":";;;AAAa,QAAA,cAAc,GAAG;IAC7B,IAAI;IACD,UAAU;IACV,SAAS;IACT,YAAY;IACZ,OAAO;IACP,MAAM;IACN,YAAY;IACZ,MAAM;IACN,SAAS;IACT,QAAQ;IACR,mBAAmB;IACnB,MAAM;IACN,aAAa;IACb,UAAU;IACV,WAAW;CACd,CAAA"}
|
|
@@ -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[]>;
|
|
@@ -0,0 +1,77 @@
|
|
|
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 transport_1 = require("../../transport");
|
|
7
|
+
const fields_1 = require("./fields");
|
|
8
|
+
const utils_1 = require("../../helpers/utils");
|
|
9
|
+
const properties = [
|
|
10
|
+
{
|
|
11
|
+
displayName: 'Category ID',
|
|
12
|
+
name: 'id',
|
|
13
|
+
type: 'string',
|
|
14
|
+
default: '',
|
|
15
|
+
placeholder: 'e.g. 2a88d9b59d474...',
|
|
16
|
+
required: true,
|
|
17
|
+
description: 'ID of the category to get. You can find the ID in the URL when viewing the category in Shopware Admin (e.g. https://your-domain.com/admin#/sw/category/detail/<categoryId>).',
|
|
18
|
+
},
|
|
19
|
+
{
|
|
20
|
+
displayName: 'Filters',
|
|
21
|
+
name: 'filters',
|
|
22
|
+
type: 'collection',
|
|
23
|
+
placeholder: 'Add Filter',
|
|
24
|
+
default: {},
|
|
25
|
+
options: [
|
|
26
|
+
{
|
|
27
|
+
displayName: 'Fields',
|
|
28
|
+
name: 'fields',
|
|
29
|
+
type: 'string',
|
|
30
|
+
default: '',
|
|
31
|
+
description: 'Fields the category will return, formatted as a string of comma-separated values. By default all the fields are returned.',
|
|
32
|
+
},
|
|
33
|
+
]
|
|
34
|
+
}
|
|
35
|
+
];
|
|
36
|
+
const displayOptions = {
|
|
37
|
+
show: {
|
|
38
|
+
resource: ['category'],
|
|
39
|
+
operation: ['get'],
|
|
40
|
+
},
|
|
41
|
+
};
|
|
42
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)(displayOptions, properties);
|
|
43
|
+
async function execute(items) {
|
|
44
|
+
const returnData = [];
|
|
45
|
+
for (let i = 0; i < items.length; i++) {
|
|
46
|
+
try {
|
|
47
|
+
let fields = fields_1.categoryFields;
|
|
48
|
+
const id = this.getNodeParameter('id', i);
|
|
49
|
+
const filters = this.getNodeParameter('filters', i);
|
|
50
|
+
const shrinkedFields = filters.fields;
|
|
51
|
+
if (shrinkedFields) {
|
|
52
|
+
fields = shrinkedFields.split(',').map((field) => field.trim());
|
|
53
|
+
}
|
|
54
|
+
const body = {
|
|
55
|
+
fields,
|
|
56
|
+
includes: {
|
|
57
|
+
category: fields,
|
|
58
|
+
},
|
|
59
|
+
filter: [{ type: 'equals', field: 'id', value: id }],
|
|
60
|
+
};
|
|
61
|
+
const response = await transport_1.apiRequest.call(this, 'POST', `/search/category`, body);
|
|
62
|
+
const executionData = this.helpers.constructExecutionMetaData((0, utils_1.wrapData)(response.data), {
|
|
63
|
+
itemData: { item: i },
|
|
64
|
+
});
|
|
65
|
+
returnData.push(...executionData);
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
if (this.continueOnFail()) {
|
|
69
|
+
returnData.push({ json: { error: error.message } });
|
|
70
|
+
continue;
|
|
71
|
+
}
|
|
72
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
return returnData;
|
|
76
|
+
}
|
|
77
|
+
//# sourceMappingURL=get.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"get.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Shopware/v1/actions/category/get.operation.ts"],"names":[],"mappings":";;;AAmDA,0BA6CC;AAhGD,+CAOsB;AACtB,+CAA6C;AAC7C,qCAA0C;AAC1C,+CAA+C;AAE/C,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,oLAAoL;KACrL;IACD;QACC,WAAW,EAAE,SAAS;QACtB,IAAI,EAAE,SAAS;QACf,IAAI,EAAE,YAAY;QAClB,WAAW,EAAE,YAAY;QACzB,OAAO,EAAE,EAAE;QACX,OAAO,EAAE;YACR;gBACC,WAAW,EAAE,QAAQ;gBACrB,IAAI,EAAE,QAAQ;gBACd,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EACV,2HAA2H;aAC5H;SACD;KACD;CACD,CAAC;AAEF,MAAM,cAAc,GAAG;IACtB,IAAI,EAAE;QACL,QAAQ,EAAE,CAAC,UAAU,CAAC;QACtB,SAAS,EAAE,CAAC,KAAK,CAAC;KAClB;CACD,CAAC;AAEW,QAAA,WAAW,GAAG,IAAA,mCAAoB,EAAC,cAAc,EAAE,UAAU,CAAC,CAAC;AAErE,KAAK,UAAU,OAAO,CAE5B,KAA2B;IAE3B,MAAM,UAAU,GAAyB,EAAE,CAAC;IAE5C,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CA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AC;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,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[]>;
|