n8n-nodes-shortgenius 0.1.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/LICENSE +21 -0
- package/README.md +67 -0
- package/dist/credentials/ShortGeniusApi.credentials.d.ts +20 -0
- package/dist/credentials/ShortGeniusApi.credentials.js +56 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +13 -0
- package/dist/nodes/ShortGenius/ShortGenius.node.d.ts +15 -0
- package/dist/nodes/ShortGenius/ShortGenius.node.js +1071 -0
- package/dist/nodes/ShortGenius/ShortGenius.svg +4 -0
- package/dist/nodes/ShortGeniusTrigger/ShortGeniusTrigger.node.d.ts +25 -0
- package/dist/nodes/ShortGeniusTrigger/ShortGeniusTrigger.node.js +168 -0
- package/dist/nodes/ShortGeniusTrigger/ShortGeniusTrigger.svg +5 -0
- package/dist/src/vendor/client.d.ts +211 -0
- package/dist/src/vendor/client.js +149 -0
- package/dist/src/vendor/error.d.ts +35 -0
- package/dist/src/vendor/error.js +50 -0
- package/dist/src/vendor/index.d.ts +24 -0
- package/dist/src/vendor/index.js +28 -0
- package/dist/src/vendor/webhooks.d.ts +38 -0
- package/dist/src/vendor/webhooks.js +90 -0
- package/package.json +55 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 ShortGenius
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# n8n-nodes-shortgenius
|
|
2
|
+
|
|
3
|
+
n8n community node for [ShortGenius](https://shortgenius.com) — generate AI videos, images, and audio, and manage your ShortGenius account.
|
|
4
|
+
|
|
5
|
+
## Install
|
|
6
|
+
|
|
7
|
+
In your n8n instance:
|
|
8
|
+
|
|
9
|
+
```
|
|
10
|
+
npm install n8n-nodes-shortgenius
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
Restart n8n. The package ships two nodes (`ShortGenius` and `ShortGenius Trigger`) and one credential type (`ShortGenius API`).
|
|
14
|
+
|
|
15
|
+
## Authentication
|
|
16
|
+
|
|
17
|
+
1. Sign in to ShortGenius and open **Developers → API keys** at https://shortgenius.com/developers/keys to create an API key (it starts with `sg-`).
|
|
18
|
+
2. In n8n, **Credentials → New → ShortGenius API** and paste the key, then hit **Test**. The default base URL (`https://api.shortgenius.com/v1`) is correct for production.
|
|
19
|
+
3. ShortGenius is single-user — the API key alone authenticates. There is no organization to configure. The connection test calls `GET /credits`.
|
|
20
|
+
|
|
21
|
+
## Nodes
|
|
22
|
+
|
|
23
|
+
### ShortGenius (action)
|
|
24
|
+
|
|
25
|
+
| Resource | Operations |
|
|
26
|
+
|---|---|
|
|
27
|
+
| Video | List, Get, Create, Draft, Draft From URL, Draft From Script, Draft Quiz, Draft News, Generate Topics |
|
|
28
|
+
| Series | List, Get, Create |
|
|
29
|
+
| Image | List, Get, Create, List Styles |
|
|
30
|
+
| Audio | List, Get, Create Speech |
|
|
31
|
+
| Voice | List, Get |
|
|
32
|
+
| Music | List Genres, List Tracks |
|
|
33
|
+
| Connection | List |
|
|
34
|
+
| Credits | Get Balance |
|
|
35
|
+
| Webhook | List Endpoints, Create Endpoint, Delete Endpoint |
|
|
36
|
+
|
|
37
|
+
Videos are drafted first (write/review a script), then created (rendered). Created videos, generated images, and synthesized audio render asynchronously — poll the corresponding **Get** operation until the state is `completed`, or use the **ShortGenius Trigger** node to react to completion webhooks.
|
|
38
|
+
|
|
39
|
+
### ShortGenius Trigger
|
|
40
|
+
|
|
41
|
+
Subscribes to ShortGenius lifecycle events and emits a workflow run per delivery, with the event's inner `data` payload as the item JSON. Supported events:
|
|
42
|
+
|
|
43
|
+
- `video.created`
|
|
44
|
+
- `video.completed`
|
|
45
|
+
- `video.published`
|
|
46
|
+
- `series.created`
|
|
47
|
+
- `image.completed`
|
|
48
|
+
- `audio.completed`
|
|
49
|
+
- `*` (all events)
|
|
50
|
+
|
|
51
|
+
Activating the trigger registers a webhook endpoint at ShortGenius pointing at the n8n production URL. Deactivating it deletes the endpoint so you do not leak orphan subscriptions. Every delivery is verified per-request (HMAC-SHA256 over `<timestamp>.<rawBody>`, 5-minute timestamp window) using the `ShortGenius-Signature` header.
|
|
52
|
+
|
|
53
|
+
## Use as an AI Agent tool
|
|
54
|
+
|
|
55
|
+
The ShortGenius node is marked `usableAsTool`, so an n8n **AI Agent** can call it directly: add the AI Agent node, click the **Tool** connector, and pick **ShortGenius**. The agent can then draft and render videos, generate images, synthesize speech, and more from natural-language instructions.
|
|
56
|
+
|
|
57
|
+
Self-hosted instances must allow community nodes as tools by setting the environment variable `N8N_COMMUNITY_PACKAGES_ALLOW_TOOL_USAGE=true`.
|
|
58
|
+
|
|
59
|
+
## Links
|
|
60
|
+
|
|
61
|
+
- Integrations landing page: https://shortgenius.com/integrations/n8n
|
|
62
|
+
- API docs: https://shortgenius.com/developers
|
|
63
|
+
- Source: https://github.com/ShortGenius/shorts/tree/main/packages/n8n-node
|
|
64
|
+
|
|
65
|
+
## License
|
|
66
|
+
|
|
67
|
+
MIT.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import type { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
/**
|
|
3
|
+
* Credential type for the ShortGenius n8n nodes.
|
|
4
|
+
*
|
|
5
|
+
* Stores a ShortGenius API key generated at
|
|
6
|
+
* https://shortgenius.com/developers/keys. The key (starts with `sg-`) is sent
|
|
7
|
+
* on every request as `Authorization: Bearer <key>`.
|
|
8
|
+
*
|
|
9
|
+
* ShortGenius is single-user — the API key alone authenticates, so there is no
|
|
10
|
+
* organization concept. The credential test hits GET /credits, which 200s for a
|
|
11
|
+
* valid key and 401s for a bad one.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ShortGeniusApi implements ICredentialType {
|
|
14
|
+
name: string;
|
|
15
|
+
displayName: string;
|
|
16
|
+
documentationUrl: string;
|
|
17
|
+
properties: INodeProperties[];
|
|
18
|
+
authenticate: IAuthenticateGeneric;
|
|
19
|
+
test: ICredentialTestRequest;
|
|
20
|
+
}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ShortGeniusApi = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* Credential type for the ShortGenius n8n nodes.
|
|
6
|
+
*
|
|
7
|
+
* Stores a ShortGenius API key generated at
|
|
8
|
+
* https://shortgenius.com/developers/keys. The key (starts with `sg-`) is sent
|
|
9
|
+
* on every request as `Authorization: Bearer <key>`.
|
|
10
|
+
*
|
|
11
|
+
* ShortGenius is single-user — the API key alone authenticates, so there is no
|
|
12
|
+
* organization concept. The credential test hits GET /credits, which 200s for a
|
|
13
|
+
* valid key and 401s for a bad one.
|
|
14
|
+
*/
|
|
15
|
+
class ShortGeniusApi {
|
|
16
|
+
name = 'shortGeniusApi';
|
|
17
|
+
displayName = 'ShortGenius API';
|
|
18
|
+
documentationUrl = 'https://shortgenius.com/developers';
|
|
19
|
+
properties = [
|
|
20
|
+
{
|
|
21
|
+
displayName: 'API Key',
|
|
22
|
+
name: 'apiKey',
|
|
23
|
+
type: 'string',
|
|
24
|
+
typeOptions: { password: true },
|
|
25
|
+
default: '',
|
|
26
|
+
required: true,
|
|
27
|
+
description: 'Generate one at ShortGenius → Developers → API keys. Starts with sg-.'
|
|
28
|
+
},
|
|
29
|
+
{
|
|
30
|
+
displayName: 'Base URL',
|
|
31
|
+
name: 'baseUrl',
|
|
32
|
+
type: 'string',
|
|
33
|
+
default: 'https://api.shortgenius.com/v1',
|
|
34
|
+
description: 'Override only if you are pointing at a non-production deployment.'
|
|
35
|
+
}
|
|
36
|
+
];
|
|
37
|
+
// Sends the key as `Authorization: Bearer <key>` on credential-test and any
|
|
38
|
+
// declarative request that uses this credential.
|
|
39
|
+
authenticate = {
|
|
40
|
+
type: 'generic',
|
|
41
|
+
properties: {
|
|
42
|
+
headers: {
|
|
43
|
+
Authorization: '=Bearer {{$credentials.apiKey}}'
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
};
|
|
47
|
+
// Powers the "Test" button: a lightweight GET /credits that 200s for a valid
|
|
48
|
+
// key and 401s for a bad one.
|
|
49
|
+
test = {
|
|
50
|
+
request: {
|
|
51
|
+
baseURL: '={{$credentials.baseUrl}}',
|
|
52
|
+
url: '/credits'
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
exports.ShortGeniusApi = ShortGeniusApi;
|
package/dist/index.d.ts
ADDED
package/dist/index.js
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// Re-exports so consumers (and the n8n loader) can import the node and
|
|
3
|
+
// credential classes without reaching into the dist tree directly. The
|
|
4
|
+
// actual `n8n` package.json field still points at compiled dist/*.js so
|
|
5
|
+
// runtime discovery does not depend on this file.
|
|
6
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
7
|
+
exports.ShortGeniusTrigger = exports.ShortGenius = exports.ShortGeniusApi = void 0;
|
|
8
|
+
var ShortGeniusApi_credentials_1 = require("./credentials/ShortGeniusApi.credentials");
|
|
9
|
+
Object.defineProperty(exports, "ShortGeniusApi", { enumerable: true, get: function () { return ShortGeniusApi_credentials_1.ShortGeniusApi; } });
|
|
10
|
+
var ShortGenius_node_1 = require("./nodes/ShortGenius/ShortGenius.node");
|
|
11
|
+
Object.defineProperty(exports, "ShortGenius", { enumerable: true, get: function () { return ShortGenius_node_1.ShortGenius; } });
|
|
12
|
+
var ShortGeniusTrigger_node_1 = require("./nodes/ShortGeniusTrigger/ShortGeniusTrigger.node");
|
|
13
|
+
Object.defineProperty(exports, "ShortGeniusTrigger", { enumerable: true, get: function () { return ShortGeniusTrigger_node_1.ShortGeniusTrigger; } });
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { IExecuteFunctions, INodeExecutionData, INodeType, INodeTypeDescription } from 'n8n-workflow';
|
|
2
|
+
/**
|
|
3
|
+
* Action node for the ShortGenius API.
|
|
4
|
+
*
|
|
5
|
+
* Mirrors the @shortgenius/sdk surface: Videos, Series, Images, Audio, Voices,
|
|
6
|
+
* Music, Connections, Credits, Webhooks. Each operation maps directly to a
|
|
7
|
+
* method on the SDK client so the shape stays in sync when new endpoints land.
|
|
8
|
+
*
|
|
9
|
+
* ShortGenius is single-user — the API key authenticates and there is NO
|
|
10
|
+
* organization parameter anywhere.
|
|
11
|
+
*/
|
|
12
|
+
export declare class ShortGenius implements INodeType {
|
|
13
|
+
description: INodeTypeDescription;
|
|
14
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
15
|
+
}
|