Skip to content

Commit 2f916f3

Browse files
committed
fix: update credentials usage
1 parent 93754e8 commit 2f916f3

File tree

4 files changed

+16
-9
lines changed

4 files changed

+16
-9
lines changed

Diff for: credentials/ShopwareAdminCredentialsApi.credentials.ts

+5-6
Original file line numberDiff line numberDiff line change
@@ -14,10 +14,10 @@ export class ShopwareAdminCredentialsApi implements ICredentialType {
1414
documentationUrl = 'https://example.com';
1515
properties: INodeProperties[] = [
1616
{
17-
displayName: 'Domain',
18-
name: 'domain',
17+
displayName: 'URL',
18+
name: 'url',
1919
type: 'string',
20-
default: 'https://example.com',
20+
default: 'https://example.com/api',
2121
},
2222
{
2323
displayName: 'Client ID',
@@ -45,7 +45,7 @@ export class ShopwareAdminCredentialsApi implements ICredentialType {
4545
'Content-Type': 'application/json',
4646
},
4747
method: 'POST',
48-
url: credentials.domain + '/api/oauth/token',
48+
url: credentials.url + '/oauth/token',
4949
data: {
5050
grant_type: 'client_credentials',
5151
client_id: credentials.clientId,
@@ -63,15 +63,14 @@ export class ShopwareAdminCredentialsApi implements ICredentialType {
6363
...requestOptions.headers,
6464
Authorization: `Bearer ${access_token}`,
6565
},
66-
baseURL: credentials.domain as string,
6766
};
6867

6968
return requestOptionsWithAuth;
7069
}
7170

7271
test: ICredentialTestRequest = {
7372
request: {
74-
url: '={{$credentials.domain}}/api/_info/version',
73+
url: '={{$credentials.url}}/_info/version',
7574
},
7675
rules: [
7776
{

Diff for: nodes/ShopwareAdminNode/ShopwareAdminNode.node.ts

+8
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ export class ShopwareAdminNode implements INodeType {
1212
name: 'shopwareAdminNode',
1313
group: ['transform'],
1414
version: 1,
15+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
1516
description: 'Shopware Admin Node',
1617
defaults: {
1718
name: 'Shopware Admin Node',
@@ -26,6 +27,13 @@ export class ShopwareAdminNode implements INodeType {
2627
required: true,
2728
},
2829
],
30+
requestDefaults: {
31+
headers: {
32+
Accept: 'application/json',
33+
'Content-Type': 'application/json',
34+
},
35+
baseURL: '={{$credentials.url}}',
36+
},
2937
properties,
3038
};
3139
}

Diff for: package-lock.json

+2-2
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Diff for: package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "@c0d3bl1ck/n8n-nodes-shopware",
3-
"version": "0.1.2",
3+
"version": "0.1.3",
44
"description": "Community nodes to connect Shopware 6 with n8n.",
55
"keywords": [
66
"n8n-community-node-package"

0 commit comments

Comments
 (0)