n8n-nodes-yescale 1.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 ADDED
@@ -0,0 +1,65 @@
1
+ # YEScale n8n node
2
+
3
+ Community node package for YEScale.
4
+
5
+ ## Included
6
+
7
+ - OpenAI Chat Completions
8
+ - OpenAI Responses
9
+ - OpenAI Embeddings
10
+ - OpenAI Text to Speech
11
+ - OpenAI Speech to Text
12
+ - Claude Messages
13
+ - Gemini Native v1beta
14
+ - Gemini Native TTS
15
+ - CDN Media Task submit and poll result
16
+
17
+ ## Credentials
18
+
19
+ Create a `YEScale API` credential with:
20
+
21
+ - Account Access Key: YEScale account access key
22
+
23
+ On first execution in a workflow, the node automatically creates and caches:
24
+
25
+ - `n8n-yescale-auto`: full auto API key for model calls
26
+ - `n8n-yescale-task`: task-only API key for CDN/media task submission
27
+
28
+ If those keys already exist and YEScale returns their secret in `/apikeylist`, setup reuses them. The setup output also includes current account quota, used quota, request count, and USD credit conversion using `quota / 500000`.
29
+
30
+ ## Usage
31
+
32
+ Choose the `YEScale` node, then pick:
33
+
34
+ - `Chat -> OpenAI Chat`
35
+ - `Chat -> OpenAI Response`
36
+ - `Chat -> Gemini Native`
37
+ - `Chat -> Claude Message`
38
+ - `Audio -> Text to Speech`
39
+ - `Audio -> Speech to Text`
40
+ - `Embedding`
41
+ - `Task -> Submit & Poll Result`
42
+
43
+ Chat, Audio, and Embedding model options are loaded from `GET https://api.yescale.io/v1/models` with the auto key.
44
+ Task model options are loaded from the same endpoint with the task key.
45
+
46
+ Chat and Embedding support `General Payload` fields or `Raw Payload` JSON.
47
+ Task supports API-driven `General Payload` fields or `Raw Payload` JSON. Task payloads are validated at execution time against `GET https://web-api.yescale.vip/yescale/task-model-config`.
48
+ Speech to Text expects an n8n binary audio property.
49
+
50
+ ## Local build
51
+
52
+ ```bash
53
+ npm install
54
+ npm run build
55
+ npm pack --dry-run
56
+ ```
57
+
58
+ ## Publish
59
+
60
+ ```bash
61
+ npm login
62
+ npm publish
63
+ ```
64
+
65
+ Package name: `n8n-nodes-yescale`
@@ -0,0 +1,47 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.YEScaleApi = void 0;
4
+ exports.normalizeYescaleCredentials = normalizeYescaleCredentials;
5
+ class YEScaleApi {
6
+ name = 'yescaleApi';
7
+ displayName = 'YEScale API';
8
+ documentationUrl = 'https://docs.yescale.vip';
9
+ properties = [
10
+ {
11
+ displayName: 'Account Access Key',
12
+ name: 'accessKey',
13
+ type: 'string',
14
+ typeOptions: {
15
+ password: true,
16
+ },
17
+ default: '',
18
+ required: true,
19
+ placeholder: 'YEScale account access key',
20
+ description: 'YEScale account access key. The node uses it to create one auto API key and one task API key automatically.',
21
+ },
22
+ ];
23
+ authenticate = {
24
+ type: 'generic',
25
+ properties: {
26
+ headers: {
27
+ Authorization: '={{"Bearer " + $credentials.accessKey.replace(/^Bearer\\s+/i, "")}}',
28
+ Accept: 'application/json',
29
+ },
30
+ },
31
+ };
32
+ test = {
33
+ request: {
34
+ baseURL: 'https://web-api.yescale.vip/yescale',
35
+ url: '/user',
36
+ method: 'GET',
37
+ },
38
+ };
39
+ }
40
+ exports.YEScaleApi = YEScaleApi;
41
+ function normalizeYescaleCredentials(credentials) {
42
+ const accessKey = String(credentials.accessKey || '').trim().replace(/^Bearer\s+/i, '');
43
+ const modelBaseUrl = 'https://api.yescale.io';
44
+ const taskBaseUrl = 'https://api.yescale.io';
45
+ const managementBaseUrl = 'https://web-api.yescale.vip/yescale';
46
+ return { accessKey, modelBaseUrl, managementBaseUrl, taskBaseUrl };
47
+ }