n8n-nodes-supermachine 0.4.6 → 0.4.7

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.
@@ -7,70 +7,43 @@ class SupermachineApi {
7
7
  documentationUrl = 'https://supermachine.art';
8
8
  properties = [
9
9
  {
10
- displayName: 'Authentication Type',
11
- name: 'authenticationType',
12
- type: 'options',
13
- options: [
14
- {
15
- name: 'API Key (v1)',
16
- value: 'apiKey',
17
- description: 'Use API Key for v1 endpoints',
18
- },
19
- {
20
- name: 'Auth Token (v3)',
21
- value: 'authToken',
22
- description: 'Use Auth Token for v3 endpoints (from Get Token operation)',
23
- },
24
- ],
25
- default: 'apiKey',
26
- },
27
- {
28
- displayName: 'API Key',
10
+ displayName: 'API Key (v1)',
29
11
  name: 'apiKey',
30
12
  type: 'string',
31
13
  typeOptions: {
32
14
  password: true,
33
15
  },
34
- displayOptions: {
35
- show: {
36
- authenticationType: ['apiKey'],
37
- },
38
- },
39
16
  default: '',
40
- required: true,
41
17
  placeholder: 'sk-xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx',
42
- description: 'API Key from Supermachine account settings',
18
+ description: 'API Key for v1 endpoints. Get from Supermachine account settings. Required for most operations.',
43
19
  },
44
20
  {
45
- displayName: 'Auth Token',
21
+ displayName: 'Auth Token (v3)',
46
22
  name: 'authToken',
47
23
  type: 'string',
48
24
  typeOptions: {
49
25
  password: true,
50
26
  },
51
- displayOptions: {
52
- show: {
53
- authenticationType: ['authToken'],
54
- },
55
- },
56
27
  default: '',
57
- required: true,
58
28
  placeholder: 'eyJhbGciOiJBMjU2S1ciLCJlbmMiOiJBMjU2Q0JDLUhTNTEyIi...',
59
- description: 'Auth Token from Get Token operation (Account → Get Token)',
29
+ description: 'Auth Token from Get Token operation (Account → Get Token). Required for Generate Image v3 operation only.',
60
30
  },
61
31
  ];
32
+ // Auto-select credential based on availability
33
+ // Priority: API Key > Auth Token
62
34
  authenticate = {
63
35
  type: 'generic',
64
36
  properties: {
65
37
  headers: {
66
- 'Authorization': '={{$credentials.authenticationType === "apiKey" ? "Bearer " + $credentials.apiKey : "Bearer " + $credentials.authToken}}',
38
+ 'Authorization': '={{$credentials.apiKey ? "Bearer " + $credentials.apiKey : ($credentials.authToken ? "Bearer " + $credentials.authToken : "")}}',
67
39
  },
68
40
  },
69
41
  };
42
+ // Test with API Key if available, otherwise Auth Token
70
43
  test = {
71
44
  request: {
72
- baseURL: '={{$credentials.authenticationType === "apiKey" ? "https://dev.supermachine.art/v1" : "https://x21u-twbn-azx4.n7c.xano.io/api:0dlVn2Lk"}}',
73
- url: '={{$credentials.authenticationType === "apiKey" ? "/user" : "/auth/me"}}',
45
+ baseURL: '={{$credentials.apiKey ? "https://dev.supermachine.art/v1" : "https://x21u-twbn-azx4.n7c.xano.io/api:0dlVn2Lk"}}',
46
+ url: '={{$credentials.apiKey ? "/user" : "/auth/me"}}',
74
47
  method: 'GET',
75
48
  },
76
49
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "n8n-nodes-supermachine",
3
- "version": "0.4.6",
3
+ "version": "0.4.7",
4
4
  "description": "n8n community node for Supermachine AI Image API — Generate images, manage models, LoRAs, and characters",
5
5
  "keywords": [
6
6
  "n8n-community-node-package",