@solution25/n8n-nodes-shopware 1.4.4 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -1
- package/dist/credentials/ShopwareOAuth2Api.credentials.js +4 -3
- package/dist/credentials/ShopwareOAuth2Api.credentials.js.map +1 -1
- package/dist/nodes/Shopware/Shopware.node.js.map +1 -1
- package/dist/nodes/Shopware/test/v1/helpers/payloadBuilders.test.js +213 -0
- package/dist/nodes/Shopware/test/v1/helpers/payloadBuilders.test.js.map +1 -0
- package/dist/nodes/Shopware/test/v1/helpers/pricing.test.js +75 -0
- package/dist/nodes/Shopware/test/v1/helpers/pricing.test.js.map +1 -0
- package/dist/nodes/Shopware/test/v1/helpers/utils.test.js +153 -0
- package/dist/nodes/Shopware/test/v1/helpers/utils.test.js.map +1 -0
- package/dist/nodes/Shopware/test/v1/helpers/validation.test.d.ts +1 -0
- package/dist/nodes/Shopware/test/v1/helpers/validation.test.js +16 -0
- package/dist/nodes/Shopware/test/v1/helpers/validation.test.js.map +1 -0
- package/dist/nodes/Shopware/v1/actions/category/create.operation.js +17 -39
- package/dist/nodes/Shopware/v1/actions/category/create.operation.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/category/deleteCategory.operation.js +2 -1
- package/dist/nodes/Shopware/v1/actions/category/deleteCategory.operation.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/category/fields.js +3 -1
- package/dist/nodes/Shopware/v1/actions/category/fields.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/category/get.operation.js +4 -0
- package/dist/nodes/Shopware/v1/actions/category/get.operation.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/category/getMany.operation.js +1 -1
- package/dist/nodes/Shopware/v1/actions/category/getMany.operation.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/category/types.d.ts +3 -2
- package/dist/nodes/Shopware/v1/actions/category/update.operation.js +15 -19
- package/dist/nodes/Shopware/v1/actions/category/update.operation.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/customer/create.operation.js +49 -64
- package/dist/nodes/Shopware/v1/actions/customer/create.operation.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/customer/deleteCustomer.operation.js +2 -1
- package/dist/nodes/Shopware/v1/actions/customer/deleteCustomer.operation.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/customer/fields.d.ts +0 -3
- package/dist/nodes/Shopware/v1/actions/customer/fields.js +4 -4
- package/dist/nodes/Shopware/v1/actions/customer/fields.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/customer/get.operation.js +5 -0
- package/dist/nodes/Shopware/v1/actions/customer/get.operation.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/customer/getMany.operation.js +1 -1
- package/dist/nodes/Shopware/v1/actions/customer/getMany.operation.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/customer/types.d.ts +7 -14
- package/dist/nodes/Shopware/v1/actions/customer/update.operation.js +36 -58
- package/dist/nodes/Shopware/v1/actions/customer/update.operation.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/fields.js +4 -1
- package/dist/nodes/Shopware/v1/actions/fields.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/order/create.operation.js +192 -276
- package/dist/nodes/Shopware/v1/actions/order/create.operation.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/order/deleteOrder.operation.js +2 -1
- package/dist/nodes/Shopware/v1/actions/order/deleteOrder.operation.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/order/getMany.operation.js +0 -1
- package/dist/nodes/Shopware/v1/actions/order/getMany.operation.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/order/types.d.ts +30 -7
- package/dist/nodes/Shopware/v1/actions/order/update.operation.js +216 -245
- package/dist/nodes/Shopware/v1/actions/order/update.operation.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/product/create.operation.js +68 -60
- package/dist/nodes/Shopware/v1/actions/product/create.operation.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/product/deleteProduct.operation.js +2 -1
- package/dist/nodes/Shopware/v1/actions/product/deleteProduct.operation.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/product/fields.d.ts +0 -3
- package/dist/nodes/Shopware/v1/actions/product/fields.js +6 -4
- package/dist/nodes/Shopware/v1/actions/product/fields.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/product/get.operation.js +6 -0
- package/dist/nodes/Shopware/v1/actions/product/get.operation.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/product/getMany.operation.js +3 -3
- package/dist/nodes/Shopware/v1/actions/product/getMany.operation.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/product/types.d.ts +12 -14
- package/dist/nodes/Shopware/v1/actions/product/update.operation.js +70 -51
- package/dist/nodes/Shopware/v1/actions/product/update.operation.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/router.js +2 -1
- package/dist/nodes/Shopware/v1/actions/router.js.map +1 -1
- package/dist/nodes/Shopware/v1/actions/types.d.ts +14 -0
- package/dist/nodes/Shopware/v1/actions/versionDescription.js.map +1 -1
- package/dist/nodes/Shopware/v1/helpers/handlers.js +4 -4
- package/dist/nodes/Shopware/v1/helpers/handlers.js.map +1 -1
- package/dist/nodes/Shopware/v1/helpers/media.d.ts +12 -0
- package/dist/nodes/Shopware/v1/helpers/media.js +35 -0
- package/dist/nodes/Shopware/v1/helpers/media.js.map +1 -0
- package/dist/nodes/Shopware/v1/helpers/params.d.ts +90 -0
- package/dist/nodes/Shopware/v1/helpers/params.js +154 -0
- package/dist/nodes/Shopware/v1/helpers/params.js.map +1 -0
- package/dist/nodes/Shopware/v1/helpers/payloadBuilders.d.ts +143 -0
- package/dist/nodes/Shopware/v1/helpers/payloadBuilders.js +441 -0
- package/dist/nodes/Shopware/v1/helpers/payloadBuilders.js.map +1 -0
- package/dist/nodes/Shopware/v1/helpers/pricing.d.ts +29 -0
- package/dist/nodes/Shopware/v1/helpers/pricing.js +108 -0
- package/dist/nodes/Shopware/v1/helpers/pricing.js.map +1 -0
- package/dist/nodes/Shopware/v1/helpers/utils.d.ts +4 -1
- package/dist/nodes/Shopware/v1/helpers/utils.js +260 -21
- package/dist/nodes/Shopware/v1/helpers/utils.js.map +1 -1
- package/dist/nodes/Shopware/v1/helpers/validation.d.ts +3 -0
- package/dist/nodes/Shopware/v1/helpers/validation.js +29 -0
- package/dist/nodes/Shopware/v1/helpers/validation.js.map +1 -0
- package/dist/nodes/Shopware/v1/methods/loadOptions.js +14 -21
- package/dist/nodes/Shopware/v1/methods/loadOptions.js.map +1 -1
- package/dist/nodes/Shopware/v1/transport/index.d.ts +1 -1
- package/dist/nodes/Shopware/v1/transport/index.js +28 -4
- package/dist/nodes/Shopware/v1/transport/index.js.map +1 -1
- package/dist/package.json +2 -2
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +2 -2
- package/dist/nodes/Shopware/test/v1/node/customer/getMany.test.js +0 -98
- package/dist/nodes/Shopware/test/v1/node/customer/getMany.test.js.map +0 -1
- package/dist/nodes/Shopware/test/v1/node/helpers.d.ts +0 -6
- package/dist/nodes/Shopware/test/v1/node/helpers.js +0 -44
- package/dist/nodes/Shopware/test/v1/node/helpers.js.map +0 -1
- package/dist/nodes/Shopware/test/v1/node/order/getMany.test.js +0 -111
- package/dist/nodes/Shopware/test/v1/node/order/getMany.test.js.map +0 -1
- package/dist/nodes/Shopware/test/v1/node/product/getMany.test.js +0 -96
- package/dist/nodes/Shopware/test/v1/node/product/getMany.test.js.map +0 -1
- /package/dist/nodes/Shopware/test/v1/{node/customer/getMany.test.d.ts → helpers/payloadBuilders.test.d.ts} +0 -0
- /package/dist/nodes/Shopware/test/v1/{node/order/getMany.test.d.ts → helpers/pricing.test.d.ts} +0 -0
- /package/dist/nodes/Shopware/test/v1/{node/product/getMany.test.d.ts → helpers/utils.test.d.ts} +0 -0
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@solution25/n8n-nodes-shopware",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "2.0.0",
|
|
4
4
|
"description": "Shopware 6 n8n community node",
|
|
5
5
|
"license": "MIT",
|
|
6
|
-
"homepage": "https://n8n
|
|
6
|
+
"homepage": "https://github.com/solution25com/n8n-nodes-shopware",
|
|
7
7
|
"keywords": [
|
|
8
8
|
"n8n",
|
|
9
9
|
"n8n-node",
|
|
@@ -1,98 +0,0 @@
|
|
|
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
|
-
const fields_1 = require("../../../../v1/actions/customer/fields");
|
|
37
|
-
const getMany = __importStar(require("../../../../v1/actions/customer/getMany.operation"));
|
|
38
|
-
const transport = __importStar(require("../../../../v1/transport"));
|
|
39
|
-
const helpers_1 = require("../helpers");
|
|
40
|
-
jest.mock('../../../../v1/transport', () => {
|
|
41
|
-
const originalModule = jest.requireActual('../../../../v1/transport');
|
|
42
|
-
return {
|
|
43
|
-
...originalModule,
|
|
44
|
-
apiRequest: jest.fn(async function (method) {
|
|
45
|
-
if (method === 'POST') {
|
|
46
|
-
return {
|
|
47
|
-
data: [
|
|
48
|
-
{
|
|
49
|
-
id: 'aksldfjaksljf',
|
|
50
|
-
firstName: 'John',
|
|
51
|
-
lastName: 'Doe',
|
|
52
|
-
email: 'john@example.com',
|
|
53
|
-
customerNumber: 'CN2038409',
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
return undefined;
|
|
59
|
-
}),
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
describe('Test Shopwarev1, getMany operation', () => {
|
|
63
|
-
it('should return all customers', async () => {
|
|
64
|
-
const nodeParameters = {
|
|
65
|
-
operation: 'getMany',
|
|
66
|
-
returnAll: true,
|
|
67
|
-
filters: {
|
|
68
|
-
fields: '',
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
const items = [
|
|
72
|
-
{
|
|
73
|
-
json: {},
|
|
74
|
-
},
|
|
75
|
-
];
|
|
76
|
-
const result = await getMany.execute.call((0, helpers_1.createMockExecuteFunction)(nodeParameters), items);
|
|
77
|
-
expect(transport.apiRequest).toHaveBeenCalledTimes(1);
|
|
78
|
-
expect(transport.apiRequest).toHaveBeenCalledWith('POST', '/search/customer', {
|
|
79
|
-
fields: fields_1.customerFields,
|
|
80
|
-
filter: [],
|
|
81
|
-
includes: { customer: fields_1.customerFields },
|
|
82
|
-
limit: 50,
|
|
83
|
-
page: 1,
|
|
84
|
-
});
|
|
85
|
-
expect(result).toHaveLength(1);
|
|
86
|
-
expect(result[0]).toEqual({
|
|
87
|
-
json: {
|
|
88
|
-
id: 'aksldfjaksljf',
|
|
89
|
-
firstName: 'John',
|
|
90
|
-
lastName: 'Doe',
|
|
91
|
-
email: 'john@example.com',
|
|
92
|
-
customerNumber: 'CN2038409',
|
|
93
|
-
},
|
|
94
|
-
pairedItem: { item: 0 },
|
|
95
|
-
});
|
|
96
|
-
});
|
|
97
|
-
});
|
|
98
|
-
//# sourceMappingURL=getMany.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getMany.test.js","sourceRoot":"","sources":["../../../../../../../nodes/Shopware/test/v1/node/customer/getMany.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,mEAAwE;AACxE,2FAA6E;AAC7E,oEAAsD;AACtD,wCAAuD;AAEvD,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,GAAG,EAAE;IAC1C,MAAM,cAAc,GAAG,IAAI,CAAC,aAAa,CAAC,0BAA0B,CAAC,CAAC;IACtE,OAAO;QACN,GAAG,cAAc;QACjB,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC,KAAK,WAAW,MAAc;YACjD,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;gBACvB,OAAO;oBACN,IAAI,EAAE;wBACL;4BACC,EAAE,EAAE,eAAe;4BACnB,SAAS,EAAE,MAAM;4BACjB,QAAQ,EAAE,KAAK;4BACf,KAAK,EAAE,kBAAkB;4BACzB,cAAc,EAAE,WAAW;yBAC3B;qBACD;iBACD,CAAC;YACH,CAAC;YACD,OAAO,SAAS,CAAC;QAClB,CAAC,CAAC;KACF,C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Data, IPairedItemData, NodeExecutionWithMetadata, IDataObject, IExecuteFunctions, INode } from 'n8n-workflow';
|
|
2
|
-
export declare const node: INode;
|
|
3
|
-
export declare function constructExecutionMetaData(inputData: INodeExecutionData[], options: {
|
|
4
|
-
itemData: IPairedItemData | IPairedItemData[];
|
|
5
|
-
}): NodeExecutionWithMetadata[];
|
|
6
|
-
export declare const createMockExecuteFunction: (nodeParameters: IDataObject) => IExecuteFunctions;
|
|
@@ -1,44 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
3
|
-
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
|
-
};
|
|
5
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.createMockExecuteFunction = exports.node = void 0;
|
|
7
|
-
exports.constructExecutionMetaData = constructExecutionMetaData;
|
|
8
|
-
const get_1 = __importDefault(require("lodash/get"));
|
|
9
|
-
exports.node = {
|
|
10
|
-
id: '11',
|
|
11
|
-
name: 'Shopware node',
|
|
12
|
-
typeVersion: 1,
|
|
13
|
-
type: 'n8n-community-nodes.shopware',
|
|
14
|
-
position: [42, 42],
|
|
15
|
-
parameters: {
|
|
16
|
-
operation: 'getMany',
|
|
17
|
-
},
|
|
18
|
-
};
|
|
19
|
-
function constructExecutionMetaData(inputData, options) {
|
|
20
|
-
const { itemData } = options;
|
|
21
|
-
return inputData.map((data) => {
|
|
22
|
-
const { json, ...rest } = data;
|
|
23
|
-
return { json, pairedItem: itemData, ...rest };
|
|
24
|
-
});
|
|
25
|
-
}
|
|
26
|
-
const createMockExecuteFunction = (nodeParameters) => {
|
|
27
|
-
const fakeExecuteFunction = {
|
|
28
|
-
getInputData: jest.fn(() => {
|
|
29
|
-
return [{ json: {} }];
|
|
30
|
-
}),
|
|
31
|
-
getNodeParameter: jest.fn((parameterName, _itemIndex, fallbackValue, options) => {
|
|
32
|
-
const parameter = (options === null || options === void 0 ? void 0 : options.extractValue) ? `${parameterName}.value` : parameterName;
|
|
33
|
-
return (0, get_1.default)(nodeParameters, parameter, fallbackValue);
|
|
34
|
-
}),
|
|
35
|
-
getNode: jest.fn(() => {
|
|
36
|
-
return exports.node;
|
|
37
|
-
}),
|
|
38
|
-
helpers: { constructExecutionMetaData: jest.fn(constructExecutionMetaData) },
|
|
39
|
-
continueOnFail: jest.fn(() => false),
|
|
40
|
-
};
|
|
41
|
-
return fakeExecuteFunction;
|
|
42
|
-
};
|
|
43
|
-
exports.createMockExecuteFunction = createMockExecuteFunction;
|
|
44
|
-
//# sourceMappingURL=helpers.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../../../../nodes/Shopware/test/v1/node/helpers.ts"],"names":[],"mappings":";;;;;;AA2BA,gEASC;AApCD,qDAA6B;AAWhB,QAAA,IAAI,GAAU;IAC1B,EAAE,EAAE,IAAI;IACR,IAAI,EAAE,eAAe;IACrB,WAAW,EAAE,CAAC;IACd,IAAI,EAAE,8BAA8B;IACpC,QAAQ,EAAE,CAAC,EAAE,EAAE,EAAE,CAAC;IAClB,UAAU,EAAE;QACX,SAAS,EAAE,SAAS;KACpB;CACD,CAAC;AAOF,SAAgB,0BAA0B,CACzC,SAA+B,EAC/B,OAA0D;IAE1D,MAAM,EAAE,QAAQ,EAAE,GAAG,OAAO,CAAC;IAC7B,OAAO,SAAS,CAAC,GAAG,CAAC,CAAC,IAAwB,EAAE,EAAE;QACjD,MAAM,EAAE,IAAI,EAAE,GAAG,IAAI,EAAE,GAAG,IAAI,CAAC;QAC/B,OAAO,EAAE,IAAI,EAAE,UAAU,EAAE,QAAQ,EAAE,GAAG,IAAI,EAA+B,CAAC;IAC7E,CAAC,CAAC,CAAC;AACJ,CAAC;AAEM,MAAM,yBAAyB,GAAG,CAAC,cAA2B,EAAE,EAAE;IACxE,MAAM,mBAAmB,GAAG;QAC3B,YAAY,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE;YAC1B,OAAO,CAAC,EAAE,IAAI,EAAE,EAAE,EAAE,CAAC,CAAC;QACvB,CAAC,CAAC;QACF,gBAAgB,EAAE,IAAI,CAAC,EAAE,CACxB,CACC,aAAqB,EACrB,UAAkB,EAClB,aAA2B,EAC3B,OAAkC,EACjC,EAAE;YACH,MAAM,SAAS,GAAG,CAAA,OAAO,aAAP,OAAO,uBAAP,OAAO,CAAE,YAAY,EAAC,CAAC,CAAC,GAAG,aAAa,QAAQ,CAAC,CAAC,CAAC,aAAa,CAAC;YACnF,OAAO,IAAA,aAAG,EAAC,cAAc,EAAE,SAAS,EAAE,aAAa,CAAC,CAAC;QACtD,CAAC,CACD;QACD,OAAO,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE;YACrB,OAAO,YAAI,CAAC;QACb,CAAC,CAAC;QACF,OAAO,EAAE,EAAE,0BAA0B,EAAE,IAAI,CAAC,EAAE,CAAC,0BAA0B,CAAC,EAAE;QAC5E,cAAc,EAAE,IAAI,CAAC,EAAE,CAAC,GAAG,EAAE,CAAC,KAAK,CAAC;KACJ,CAAC;IAClC,OAAO,mBAAmB,CAAC;AAC5B,CAAC,CAAC;AAvBW,QAAA,yBAAyB,6BAuBpC"}
|
|
@@ -1,111 +0,0 @@
|
|
|
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
|
-
const fields_1 = require("../../../../v1/actions/order/fields");
|
|
37
|
-
const getMany = __importStar(require("../../../../v1/actions/order/getMany.operation"));
|
|
38
|
-
const transport = __importStar(require("../../../../v1/transport"));
|
|
39
|
-
const helpers_1 = require("../helpers");
|
|
40
|
-
jest.mock('../../../../v1/transport', () => {
|
|
41
|
-
const originalModule = jest.requireActual('../../../../v1/transport');
|
|
42
|
-
return {
|
|
43
|
-
...originalModule,
|
|
44
|
-
apiRequest: jest.fn(async function (method) {
|
|
45
|
-
if (method === 'POST') {
|
|
46
|
-
return {
|
|
47
|
-
data: [
|
|
48
|
-
{
|
|
49
|
-
id: 'aksldfjaksljf',
|
|
50
|
-
orderNumber: 'ON389043',
|
|
51
|
-
orderDateTime: '2025/10/01',
|
|
52
|
-
amountTotal: 39.99,
|
|
53
|
-
amountNet: 30.99,
|
|
54
|
-
},
|
|
55
|
-
],
|
|
56
|
-
};
|
|
57
|
-
}
|
|
58
|
-
return undefined;
|
|
59
|
-
}),
|
|
60
|
-
};
|
|
61
|
-
});
|
|
62
|
-
describe('Test Shopwarev1, getMany operation', () => {
|
|
63
|
-
it('should return all orders', async () => {
|
|
64
|
-
const nodeParameters = {
|
|
65
|
-
operation: 'getMany',
|
|
66
|
-
returnAll: true,
|
|
67
|
-
filters: {
|
|
68
|
-
fields: '',
|
|
69
|
-
},
|
|
70
|
-
};
|
|
71
|
-
const items = [
|
|
72
|
-
{
|
|
73
|
-
json: {},
|
|
74
|
-
},
|
|
75
|
-
];
|
|
76
|
-
const result = await getMany.execute.call((0, helpers_1.createMockExecuteFunction)(nodeParameters), items);
|
|
77
|
-
expect(transport.apiRequest).toHaveBeenCalledTimes(1);
|
|
78
|
-
expect(transport.apiRequest).toHaveBeenCalledWith('POST', '/search/order', {
|
|
79
|
-
fields: fields_1.orderFields,
|
|
80
|
-
filter: [],
|
|
81
|
-
includes: { order: fields_1.orderFields },
|
|
82
|
-
limit: 50,
|
|
83
|
-
page: 1,
|
|
84
|
-
associations: {
|
|
85
|
-
currency: {},
|
|
86
|
-
deliveries: {
|
|
87
|
-
associations: {
|
|
88
|
-
stateMachineState: {},
|
|
89
|
-
},
|
|
90
|
-
},
|
|
91
|
-
transactions: {
|
|
92
|
-
associations: {
|
|
93
|
-
stateMachineState: {},
|
|
94
|
-
},
|
|
95
|
-
},
|
|
96
|
-
},
|
|
97
|
-
});
|
|
98
|
-
expect(result).toHaveLength(1);
|
|
99
|
-
expect(result[0]).toEqual({
|
|
100
|
-
json: {
|
|
101
|
-
id: 'aksldfjaksljf',
|
|
102
|
-
orderNumber: 'ON389043',
|
|
103
|
-
orderDateTime: '2025/10/01',
|
|
104
|
-
amountTotal: 39.99,
|
|
105
|
-
amountNet: 30.99,
|
|
106
|
-
},
|
|
107
|
-
pairedItem: { item: 0 },
|
|
108
|
-
});
|
|
109
|
-
});
|
|
110
|
-
});
|
|
111
|
-
//# sourceMappingURL=getMany.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getMany.test.js","sourceRoot":"","sources":["../../../../../../../nodes/Shopware/test/v1/node/order/getMany.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,gEAAkE;AAClE,wFAA0E;AAC1E,oEAAsD;AACtD,wCAAuD;AAEvD,IAAI,CAAC,IAAI,CAAC,0BAA0B,EAAE,GAAG,EAAE;IAC1C,MAAM,cAAc,GAAG,IAAI,CAAC,aAAa,CAAC,0BAA0B,CAAC,CAAC;IACtE,OAAO;QACN,GAAG,cAAc;QACjB,UAAU,EAAE,IAAI,CAAC,EAAE,CAAC,KAAK,WAAW,MAAc;YACjD,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;gBACvB,OAAO;oBACN,IAAI,EAAE;wBACL;4BACC,EAAE,EAAE,eAAe;4BACnB,WAAW,EAAE,UAAU;4BACvB,aAAa,EAAE,YAAY;4BAC3B,WAAW,EAAE,KAAK;4BAClB,SAAS,EAAE,KAAK;yBAChB;qBACD;iBACD,CAAC;YACH,CAAC;YACD,OAAO,SAAS,CAAC;QAClB,CAAC,CAAC;KACF,CAAC;AACH,CAAC,CAAC,CAAC;AAEH,QAAQ,CAAC,oCAAoC,EAAE,GAAG,EAAE;IACnD,EAAE,CAAC,0BAA0B,EAAE,KAAK,IAAI,EAAE;QACzC,MAAM,cAAc,GAAG;YACtB,SAAS,EAAE,SAAS;YACpB,SAAS,EAAE,IAAI;YACf,OAAO,EAAE;gBACR,MAAM,EAAE,EAAE;aACV;SACD,CAAC;QAEF,MAAM,KAAK,GAAG;YACb;gBACC,IAAI,EAAE,EAAE;aACR;SACD,CAAC;QAEF,MAAM,MAAM,GAAG,MAAM,OAAO,CAAC,OAAO,CAAC,IAAI,CAAC,IAAA,mCAAyB,EAAC,cAAc,CAAC,EAAE,KAAK,CAAC,CAAC;QAE5F,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,qBAAqB,CAAC,CAAC,CAAC,CAAC;QACtD,MAAM,CAAC,SAAS,CAAC,UAAU,CAAC,CAAC,oBAAoB,CAAC,MAAM,EAAE,eAAe,EAAE;YAC1E,MAAM,EAAE,oBAAW;YACnB,MAAM,EAAE,EAAE;YACV,QAAQ,EAAE,EAAE,KAAK,EAAE,oBAAW,EAAE;YAChC,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,CAAC;YACP,YAAY,EAAE;gBACb,QAAQ,EAAE,EAAE;gBACZ,UAAU,EAAE;oBACX,YAAY,EAAE;wBACb,iBAAiB,EAAE,EAAE;qBACrB;iBACD;gBACD,YAAY,EAAE;oBACb,YAAY,EAAE;wBACb,iBAAiB,EAAE,EAAE;qBACrB;iBACD;aACD;SACD,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YACzB,IAAI,EAAE;gBACL,EAAE,EAAE,eAAe;gBACnB,WAAW,EAAE,UAAU;gBACvB,aAAa,EAAE,YAAY;gBAC3B,WAAW,EAAE,KAAK;gBAClB,SAAS,EAAE,KAAK;aAChB;YACD,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;SACvB,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
@@ -1,96 +0,0 @@
|
|
|
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
|
-
const fields_1 = require("../../../../v1/actions/product/fields");
|
|
37
|
-
const getMany = __importStar(require("../../../../v1/actions/product/getMany.operation"));
|
|
38
|
-
const transport = __importStar(require("../../../../v1/transport"));
|
|
39
|
-
const helpers_1 = require("../helpers");
|
|
40
|
-
jest.mock('../../../../v1/transport', () => {
|
|
41
|
-
const originalModule = jest.requireActual('../../../../v1/transport');
|
|
42
|
-
return {
|
|
43
|
-
...originalModule,
|
|
44
|
-
apiRequest: jest.fn(async function (method) {
|
|
45
|
-
if (method === 'POST') {
|
|
46
|
-
return {
|
|
47
|
-
data: [
|
|
48
|
-
{
|
|
49
|
-
id: 'aksldfjaksljf',
|
|
50
|
-
name: 'testName',
|
|
51
|
-
productNumber: 'PN389043',
|
|
52
|
-
stock: 3,
|
|
53
|
-
},
|
|
54
|
-
],
|
|
55
|
-
};
|
|
56
|
-
}
|
|
57
|
-
return undefined;
|
|
58
|
-
}),
|
|
59
|
-
};
|
|
60
|
-
});
|
|
61
|
-
describe('Test Shopwarev1, getMany operation', () => {
|
|
62
|
-
it('should return all products', async () => {
|
|
63
|
-
const nodeParameters = {
|
|
64
|
-
operation: 'getMany',
|
|
65
|
-
returnAll: true,
|
|
66
|
-
filters: {
|
|
67
|
-
fields: '',
|
|
68
|
-
},
|
|
69
|
-
};
|
|
70
|
-
const items = [
|
|
71
|
-
{
|
|
72
|
-
json: {},
|
|
73
|
-
},
|
|
74
|
-
];
|
|
75
|
-
const result = await getMany.execute.call((0, helpers_1.createMockExecuteFunction)(nodeParameters), items);
|
|
76
|
-
expect(transport.apiRequest).toHaveBeenCalledTimes(1);
|
|
77
|
-
expect(transport.apiRequest).toHaveBeenCalledWith('POST', '/search/product', {
|
|
78
|
-
fields: fields_1.productFields,
|
|
79
|
-
filter: [],
|
|
80
|
-
includes: { product: fields_1.productFields },
|
|
81
|
-
limit: 50,
|
|
82
|
-
page: 1,
|
|
83
|
-
});
|
|
84
|
-
expect(result).toHaveLength(1);
|
|
85
|
-
expect(result[0]).toEqual({
|
|
86
|
-
json: {
|
|
87
|
-
id: 'aksldfjaksljf',
|
|
88
|
-
name: 'testName',
|
|
89
|
-
productNumber: 'PN389043',
|
|
90
|
-
stock: 3,
|
|
91
|
-
},
|
|
92
|
-
pairedItem: { item: 0 },
|
|
93
|
-
});
|
|
94
|
-
});
|
|
95
|
-
});
|
|
96
|
-
//# sourceMappingURL=getMany.test.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"getMany.test.js","sourceRoot":"","sources":["../../../../../../../nodes/Shopware/test/v1/node/product/getMany.test.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;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E,EAAE,OAAO,EAAE,sBAAa,EAAE;YACpC,KAAK,EAAE,EAAE;YACT,IAAI,EAAE,CAAC;SACP,CAAC,CAAC;QACH,MAAM,CAAC,MAAM,CAAC,CAAC,YAAY,CAAC,CAAC,CAAC,CAAC;QAC/B,MAAM,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC;YACzB,IAAI,EAAE;gBACL,EAAE,EAAE,eAAe;gBACnB,IAAI,EAAE,UAAU;gBAChB,aAAa,EAAE,UAAU;gBACzB,KAAK,EAAE,CAAC;aACR;YACD,UAAU,EAAE,EAAE,IAAI,EAAE,CAAC,EAAE;SACvB,CAAC,CAAC;IACJ,CAAC,CAAC,CAAC;AACJ,CAAC,CAAC,CAAC"}
|
|
File without changes
|
/package/dist/nodes/Shopware/test/v1/{node/order/getMany.test.d.ts → helpers/pricing.test.d.ts}
RENAMED
|
File without changes
|
/package/dist/nodes/Shopware/test/v1/{node/product/getMany.test.d.ts → helpers/utils.test.d.ts}
RENAMED
|
File without changes
|