@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,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: 'Product ID',
|
|
12
|
+
name: 'id',
|
|
13
|
+
type: 'string',
|
|
14
|
+
default: '',
|
|
15
|
+
placeholder: 'e.g. 2a88d9b59d474...',
|
|
16
|
+
required: true,
|
|
17
|
+
description: 'ID of the product to get. You can find the ID in the URL when viewing the product in Shopware Admin (e.g. https://your-domain.com/admin#/sw/product/detail/<productId>).',
|
|
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 product 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: ['product'],
|
|
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.productFields;
|
|
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
|
+
product: fields,
|
|
58
|
+
},
|
|
59
|
+
filter: [{ type: 'equals', field: 'id', value: id }],
|
|
60
|
+
};
|
|
61
|
+
const response = await transport_1.apiRequest.call(this, 'POST', `/search/product`, 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/product/get.operation.ts"],"names":[],"mappings":";;;AAmDA,0BA6CC;AAhGD,+CAOsB;AACtB,+CAA6C;AAC7C,qCAAyC;AACzC,+CAA+C;AAE/C,MAAM,UAAU,GAAsB;IACrC;QACC,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,IAAI;QACV,IAAI,EAAE,QAAQ;QACd,OAAO,EAAE,EAAE;QACX,WAAW,EAAE,uBAAuB;QACpC,QAAQ,EAAE,IAAI;QACd,WAAW,EACV,gLAAgL;KACjL;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,0HAA0H;aAC3H;SACD;KACD;CACD,CAAC;AAEF,MAAM,cAAc,GAAG;IACtB,IAAI,EAAE;QACL,QAAQ,EAAE,CAAC,SAAS,CAAC;QACrB,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,CAAC,EAAE,EAAE,CAAC;QACvC,IAAI,CAAC;YACJ,IAAI,MAAM,GAAG,sBAAa,CAAC;YAE3B,MAAM,EAAE,GAAG,IAAI,CAAC,gBAAgB,CAAC,IAAI,EAAE,CAAC,CAAW,CAAC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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,319 @@
|
|
|
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: 'Return All',
|
|
12
|
+
name: 'returnAll',
|
|
13
|
+
type: 'boolean',
|
|
14
|
+
default: true,
|
|
15
|
+
description: 'Whether to return all results or only up to a given limit',
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
displayName: 'Limit',
|
|
19
|
+
name: 'limit',
|
|
20
|
+
type: 'number',
|
|
21
|
+
displayOptions: {
|
|
22
|
+
show: {
|
|
23
|
+
returnAll: [false],
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
typeOptions: {
|
|
27
|
+
minValue: 1,
|
|
28
|
+
maxValue: 500,
|
|
29
|
+
},
|
|
30
|
+
default: 50,
|
|
31
|
+
description: 'Max number of results to return',
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
displayName: 'Filters',
|
|
35
|
+
name: 'filters',
|
|
36
|
+
type: 'collection',
|
|
37
|
+
placeholder: 'Add Filter',
|
|
38
|
+
default: {},
|
|
39
|
+
options: [
|
|
40
|
+
{
|
|
41
|
+
displayName: 'Active',
|
|
42
|
+
name: 'active',
|
|
43
|
+
type: 'boolean',
|
|
44
|
+
default: true,
|
|
45
|
+
description: 'Whether to filter only active products',
|
|
46
|
+
},
|
|
47
|
+
{
|
|
48
|
+
displayName: 'Available',
|
|
49
|
+
name: 'available',
|
|
50
|
+
type: 'boolean',
|
|
51
|
+
default: true,
|
|
52
|
+
description: 'Whether to filter only available products',
|
|
53
|
+
},
|
|
54
|
+
{
|
|
55
|
+
displayName: 'Created At Max',
|
|
56
|
+
name: 'createdAtMax',
|
|
57
|
+
type: 'dateTime',
|
|
58
|
+
default: '',
|
|
59
|
+
description: 'Shows products that were created at or before date',
|
|
60
|
+
},
|
|
61
|
+
{
|
|
62
|
+
displayName: 'Created At Min',
|
|
63
|
+
name: 'createdAtMin',
|
|
64
|
+
type: 'dateTime',
|
|
65
|
+
default: '',
|
|
66
|
+
description: 'Shows products that were created at or after date',
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
displayName: 'Ean',
|
|
70
|
+
name: 'ean',
|
|
71
|
+
type: 'string',
|
|
72
|
+
default: '',
|
|
73
|
+
description: 'Filter products by their ean',
|
|
74
|
+
},
|
|
75
|
+
{
|
|
76
|
+
displayName: 'Fields',
|
|
77
|
+
name: 'fields',
|
|
78
|
+
type: 'string',
|
|
79
|
+
default: '',
|
|
80
|
+
description: 'Fields the products will return, formatted as a string of comma-separated values. By default all the fields are returned.',
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
displayName: 'IDs',
|
|
84
|
+
name: 'ids',
|
|
85
|
+
type: 'string',
|
|
86
|
+
default: '',
|
|
87
|
+
description: 'Retrieve only products specified by a comma-separated list of product IDs',
|
|
88
|
+
},
|
|
89
|
+
{
|
|
90
|
+
displayName: 'Manufacturer',
|
|
91
|
+
name: 'manufacturer',
|
|
92
|
+
type: 'options',
|
|
93
|
+
typeOptions: {
|
|
94
|
+
loadOptionsMethod: 'getManufacturers',
|
|
95
|
+
},
|
|
96
|
+
default: '',
|
|
97
|
+
description: 'Filter products by their manufacturer',
|
|
98
|
+
},
|
|
99
|
+
{
|
|
100
|
+
displayName: 'Max Price',
|
|
101
|
+
name: 'maxPriceUi',
|
|
102
|
+
placeholder: 'Set Max Price',
|
|
103
|
+
type: 'fixedCollection',
|
|
104
|
+
typeOptions: {
|
|
105
|
+
multipleValues: false,
|
|
106
|
+
},
|
|
107
|
+
default: {},
|
|
108
|
+
options: [
|
|
109
|
+
{
|
|
110
|
+
name: 'price',
|
|
111
|
+
displayName: 'Price',
|
|
112
|
+
values: [
|
|
113
|
+
{
|
|
114
|
+
displayName: 'Max Price',
|
|
115
|
+
name: 'maxPrice',
|
|
116
|
+
type: 'number',
|
|
117
|
+
typeOptions: {
|
|
118
|
+
maxValue: 999000000,
|
|
119
|
+
minValue: 0,
|
|
120
|
+
numberPrecision: 2,
|
|
121
|
+
},
|
|
122
|
+
default: 0,
|
|
123
|
+
description: 'Shows products that have the same price or less',
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
displayName: 'Currency',
|
|
127
|
+
name: 'currency',
|
|
128
|
+
type: 'options',
|
|
129
|
+
typeOptions: {
|
|
130
|
+
loadOptionsMethod: 'getCurrencies',
|
|
131
|
+
},
|
|
132
|
+
default: '',
|
|
133
|
+
description: 'Select the price currency from the list',
|
|
134
|
+
},
|
|
135
|
+
],
|
|
136
|
+
},
|
|
137
|
+
],
|
|
138
|
+
},
|
|
139
|
+
{
|
|
140
|
+
displayName: 'Max Sales',
|
|
141
|
+
name: 'maxSales',
|
|
142
|
+
type: 'number',
|
|
143
|
+
typeOptions: {
|
|
144
|
+
maxValue: 999000000,
|
|
145
|
+
minValue: 0,
|
|
146
|
+
},
|
|
147
|
+
default: 0,
|
|
148
|
+
description: 'Shows products that have the same sales or less',
|
|
149
|
+
},
|
|
150
|
+
{
|
|
151
|
+
displayName: 'Max Stock',
|
|
152
|
+
name: 'maxStock',
|
|
153
|
+
type: 'number',
|
|
154
|
+
typeOptions: {
|
|
155
|
+
maxValue: 999000000,
|
|
156
|
+
minValue: 0,
|
|
157
|
+
},
|
|
158
|
+
default: 0,
|
|
159
|
+
description: 'Shows products that have the same stock or less',
|
|
160
|
+
},
|
|
161
|
+
{
|
|
162
|
+
displayName: 'Min Price',
|
|
163
|
+
name: 'minPriceUi',
|
|
164
|
+
placeholder: 'Set Min Price',
|
|
165
|
+
type: 'fixedCollection',
|
|
166
|
+
typeOptions: {
|
|
167
|
+
multipleValues: false,
|
|
168
|
+
},
|
|
169
|
+
default: {},
|
|
170
|
+
options: [
|
|
171
|
+
{
|
|
172
|
+
name: 'price',
|
|
173
|
+
displayName: 'Price',
|
|
174
|
+
values: [
|
|
175
|
+
{
|
|
176
|
+
displayName: 'Min Price',
|
|
177
|
+
name: 'minPrice',
|
|
178
|
+
type: 'number',
|
|
179
|
+
typeOptions: {
|
|
180
|
+
maxValue: 999000000,
|
|
181
|
+
minValue: 0,
|
|
182
|
+
numberPrecision: 2,
|
|
183
|
+
},
|
|
184
|
+
default: 0,
|
|
185
|
+
description: 'Shows products that have the same price or more',
|
|
186
|
+
},
|
|
187
|
+
{
|
|
188
|
+
displayName: 'Currency',
|
|
189
|
+
name: 'currency',
|
|
190
|
+
type: 'options',
|
|
191
|
+
typeOptions: {
|
|
192
|
+
loadOptionsMethod: 'getCurrencies',
|
|
193
|
+
},
|
|
194
|
+
default: '',
|
|
195
|
+
description: 'Select the price currency from the list',
|
|
196
|
+
},
|
|
197
|
+
],
|
|
198
|
+
},
|
|
199
|
+
],
|
|
200
|
+
},
|
|
201
|
+
{
|
|
202
|
+
displayName: 'Min Sales',
|
|
203
|
+
name: 'minSales',
|
|
204
|
+
type: 'number',
|
|
205
|
+
typeOptions: {
|
|
206
|
+
maxValue: 999000000,
|
|
207
|
+
minValue: 0,
|
|
208
|
+
},
|
|
209
|
+
default: 0,
|
|
210
|
+
description: 'Shows products that have the same sales or more',
|
|
211
|
+
},
|
|
212
|
+
{
|
|
213
|
+
displayName: 'Min Stock',
|
|
214
|
+
name: 'minStock',
|
|
215
|
+
type: 'number',
|
|
216
|
+
typeOptions: {
|
|
217
|
+
maxValue: 999000000,
|
|
218
|
+
minValue: 0,
|
|
219
|
+
},
|
|
220
|
+
default: 0,
|
|
221
|
+
description: 'Shows products that have the same stock or more',
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
displayName: 'Name',
|
|
225
|
+
name: 'name',
|
|
226
|
+
type: 'string',
|
|
227
|
+
default: '',
|
|
228
|
+
description: 'Filter products by their name',
|
|
229
|
+
},
|
|
230
|
+
{
|
|
231
|
+
displayName: 'Parent ID',
|
|
232
|
+
name: 'parentId',
|
|
233
|
+
type: 'string',
|
|
234
|
+
default: '',
|
|
235
|
+
placeholder: 'e.g. 2a88d9b59d474...',
|
|
236
|
+
description: 'Filter products by their parent ID',
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
displayName: 'Product Number',
|
|
240
|
+
name: 'productNumber',
|
|
241
|
+
type: 'string',
|
|
242
|
+
default: '',
|
|
243
|
+
placeholder: 'e.g. P3284...',
|
|
244
|
+
description: 'Filter products by their number',
|
|
245
|
+
},
|
|
246
|
+
{
|
|
247
|
+
displayName: 'Purchase Steps',
|
|
248
|
+
name: 'purchaseSteps',
|
|
249
|
+
type: 'number',
|
|
250
|
+
typeOptions: {
|
|
251
|
+
maxValue: 999000000,
|
|
252
|
+
minValue: 0,
|
|
253
|
+
},
|
|
254
|
+
default: 0,
|
|
255
|
+
description: 'Shows products that have the same purchase steps',
|
|
256
|
+
},
|
|
257
|
+
{
|
|
258
|
+
displayName: 'Tax',
|
|
259
|
+
name: 'tax',
|
|
260
|
+
type: 'options',
|
|
261
|
+
typeOptions: {
|
|
262
|
+
loadOptionsMethod: 'getTaxes',
|
|
263
|
+
},
|
|
264
|
+
default: '',
|
|
265
|
+
description: 'Filter products by their tax',
|
|
266
|
+
},
|
|
267
|
+
],
|
|
268
|
+
},
|
|
269
|
+
];
|
|
270
|
+
const displayOptions = {
|
|
271
|
+
show: {
|
|
272
|
+
resource: ['product'],
|
|
273
|
+
operation: ['getMany'],
|
|
274
|
+
},
|
|
275
|
+
};
|
|
276
|
+
exports.description = (0, n8n_workflow_1.updateDisplayOptions)(displayOptions, properties);
|
|
277
|
+
async function execute(items) {
|
|
278
|
+
const returnData = [];
|
|
279
|
+
for (let i = 0; i < items.length; i++) {
|
|
280
|
+
try {
|
|
281
|
+
let page = 1;
|
|
282
|
+
let pageSize = 50;
|
|
283
|
+
let iterate = true;
|
|
284
|
+
let fields = fields_1.productFields;
|
|
285
|
+
const filters = this.getNodeParameter('filters', i);
|
|
286
|
+
const shrinkedFields = filters.fields;
|
|
287
|
+
if (shrinkedFields) {
|
|
288
|
+
fields = shrinkedFields.split(',').map((field) => field.trim());
|
|
289
|
+
}
|
|
290
|
+
const returnAll = this.getNodeParameter('returnAll', i);
|
|
291
|
+
if (!returnAll) {
|
|
292
|
+
pageSize = this.getNodeParameter('limit', i);
|
|
293
|
+
}
|
|
294
|
+
while (iterate) {
|
|
295
|
+
const body = utils_1.constructSearchBody.call(this, { page, limit: pageSize }, fields, 'product', filters);
|
|
296
|
+
const response = await transport_1.apiRequest.call(this, 'POST', `/search/product`, body);
|
|
297
|
+
const executionData = this.helpers.constructExecutionMetaData((0, utils_1.wrapData)(response.data), {
|
|
298
|
+
itemData: { item: i },
|
|
299
|
+
});
|
|
300
|
+
returnData.push(...executionData);
|
|
301
|
+
if (returnAll && response.data.length === pageSize) {
|
|
302
|
+
page++;
|
|
303
|
+
}
|
|
304
|
+
else {
|
|
305
|
+
iterate = false;
|
|
306
|
+
}
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
catch (error) {
|
|
310
|
+
if (this.continueOnFail()) {
|
|
311
|
+
returnData.push({ json: { error: error.message } });
|
|
312
|
+
continue;
|
|
313
|
+
}
|
|
314
|
+
throw new n8n_workflow_1.NodeApiError(this.getNode(), error);
|
|
315
|
+
}
|
|
316
|
+
}
|
|
317
|
+
return returnData;
|
|
318
|
+
}
|
|
319
|
+
//# sourceMappingURL=getMany.operation.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getMany.operation.js","sourceRoot":"","sources":["../../../../../../nodes/Shopware/v1/actions/product/getMany.operation.ts"],"names":[],"mappings":";;;AA8RA,0BA2DC;AAvVD,+CAOsB;AACtB,+CAA6C;AAC7C,qCAAyC;AACzC,+CAAoE;AAEpE,MAAM,UAAU,GAAsB;IACrC;QACC,WAAW,EAAE,YAAY;QACzB,IAAI,EAAE,WAAW;QACjB,IAAI,EAAE,SAAS;QACf,OAAO,EAAE,IAAI;QACb,WAAW,EAAE,2DAA2D;KACxE;IACD;QACC,WAAW,EAAE,OAAO;QACpB,IAAI,EAAE,OAAO;QACb,IAAI,E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,0BAA0B,CAAC,IAAA,gBAAQ,EAAC,QAAQ,CAAC,IAAI,CAAC,EAAE;oBACtF,QAAQ,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;iBACrB,CAAC,CAAC;gBAEH,UAAU,CAAC,IAAI,CAAC,GAAG,aAAa,CAAC,CAAC;gBAElC,IAAI,SAAS,IAAI,QAAQ,CAAC,IAAI,CAAC,MAAM,KAAK,QAAQ,EAAE,CAAC;oBACpD,IAAI,EAAE,CAAC;gBACR,CAAC;qBAAM,CAAC;oBACP,OAAO,GAAG,KAAK,CAAC;gBACjB,CAAC;YACF,CAAC;QACF,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,66 @@
|
|
|
1
|
+
import type { IDataObject } from 'n8n-workflow';
|
|
2
|
+
export interface ProductCreatePayload extends IDataObject {
|
|
3
|
+
id?: string;
|
|
4
|
+
parentId?: string;
|
|
5
|
+
manufacturer?: {
|
|
6
|
+
name: string;
|
|
7
|
+
};
|
|
8
|
+
active?: boolean;
|
|
9
|
+
displayGroup?: string;
|
|
10
|
+
ratingAverage?: number;
|
|
11
|
+
weight?: number;
|
|
12
|
+
width?: number;
|
|
13
|
+
height?: number;
|
|
14
|
+
length?: number;
|
|
15
|
+
productNumber: string;
|
|
16
|
+
name: string;
|
|
17
|
+
description?: string;
|
|
18
|
+
availableStock?: number;
|
|
19
|
+
stock: number;
|
|
20
|
+
price: Array<{
|
|
21
|
+
currencyId: string;
|
|
22
|
+
gross: number;
|
|
23
|
+
net: number;
|
|
24
|
+
linked: boolean;
|
|
25
|
+
}>;
|
|
26
|
+
taxId: string;
|
|
27
|
+
categories?: Array<{
|
|
28
|
+
id: string;
|
|
29
|
+
name: string;
|
|
30
|
+
}>;
|
|
31
|
+
visibilities?: Array<{
|
|
32
|
+
salesChannelId: string;
|
|
33
|
+
visibility: number;
|
|
34
|
+
}>;
|
|
35
|
+
ean?: string;
|
|
36
|
+
createdAt?: string;
|
|
37
|
+
updatedAt?: string;
|
|
38
|
+
}
|
|
39
|
+
export type ProductUpdatePayload = Partial<ProductCreatePayload>;
|
|
40
|
+
export type ProductOption = {
|
|
41
|
+
id: string;
|
|
42
|
+
name: string;
|
|
43
|
+
};
|
|
44
|
+
export type CurrencyOption = {
|
|
45
|
+
id: string;
|
|
46
|
+
name: string;
|
|
47
|
+
};
|
|
48
|
+
export type TaxOption = {
|
|
49
|
+
id: string;
|
|
50
|
+
name: string;
|
|
51
|
+
taxRate: number;
|
|
52
|
+
};
|
|
53
|
+
export type CategoryOption = {
|
|
54
|
+
id: string;
|
|
55
|
+
name: string;
|
|
56
|
+
};
|
|
57
|
+
export type SalesChannelOption = {
|
|
58
|
+
id: string;
|
|
59
|
+
name: string;
|
|
60
|
+
};
|
|
61
|
+
export type NodePrice = {
|
|
62
|
+
currency: string;
|
|
63
|
+
grossPrice: number;
|
|
64
|
+
autoCalculateNet: boolean;
|
|
65
|
+
netPrice: number;
|
|
66
|
+
};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../nodes/Shopware/v1/actions/product/types.ts"],"names":[],"mappings":""}
|
|
@@ -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[]>;
|