n8n-nodes-bookoly 1.0.4
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.md +21 -0
- package/README.md +94 -0
- package/dist/credentials/BookolyApi.credentials.d.ts +9 -0
- package/dist/credentials/BookolyApi.credentials.js +47 -0
- package/dist/credentials/BookolyApi.credentials.js.map +1 -0
- package/dist/nodes/Bookoly/Bookoly.node.d.ts +7 -0
- package/dist/nodes/Bookoly/Bookoly.node.js +82 -0
- package/dist/nodes/Bookoly/Bookoly.node.js.map +1 -0
- package/dist/nodes/Bookoly/Bookoly.node.json +18 -0
- package/dist/nodes/Bookoly/bookoly.svg +40 -0
- package/dist/nodes/Bookoly/handlers/file/generateSubtitleFile.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/file/generateSubtitleFile.js +42 -0
- package/dist/nodes/Bookoly/handlers/file/generateSubtitleFile.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/file/index.d.ts +6 -0
- package/dist/nodes/Bookoly/handlers/file/index.js +10 -0
- package/dist/nodes/Bookoly/handlers/file/index.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/getResource.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/getResource.js +92 -0
- package/dist/nodes/Bookoly/handlers/getResource.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/index.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/index.js +17 -0
- package/dist/nodes/Bookoly/handlers/index.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/sound/combineSounds.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/sound/combineSounds.js +20 -0
- package/dist/nodes/Bookoly/handlers/sound/combineSounds.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/sound/createSoundEffect.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/sound/createSoundEffect.js +19 -0
- package/dist/nodes/Bookoly/handlers/sound/createSoundEffect.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/sound/index.d.ts +8 -0
- package/dist/nodes/Bookoly/handlers/sound/index.js +12 -0
- package/dist/nodes/Bookoly/handlers/sound/index.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/speech/createSpeech.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/speech/createSpeech.js +24 -0
- package/dist/nodes/Bookoly/handlers/speech/createSpeech.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/speech/index.d.ts +6 -0
- package/dist/nodes/Bookoly/handlers/speech/index.js +10 -0
- package/dist/nodes/Bookoly/handlers/speech/index.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/transcript/createTranscript.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/transcript/createTranscript.js +24 -0
- package/dist/nodes/Bookoly/handlers/transcript/createTranscript.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/transcript/index.d.ts +6 -0
- package/dist/nodes/Bookoly/handlers/transcript/index.js +10 -0
- package/dist/nodes/Bookoly/handlers/transcript/index.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/video/addAudioToVideo.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/video/addAudioToVideo.js +30 -0
- package/dist/nodes/Bookoly/handlers/video/addAudioToVideo.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/video/addAudioWithSubtitlesToVideo.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/video/addAudioWithSubtitlesToVideo.js +52 -0
- package/dist/nodes/Bookoly/handlers/video/addAudioWithSubtitlesToVideo.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/video/addSubtitlesToVideo.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/video/addSubtitlesToVideo.js +42 -0
- package/dist/nodes/Bookoly/handlers/video/addSubtitlesToVideo.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/video/addSubtitlesToVideoFromFile.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/video/addSubtitlesToVideoFromFile.js +26 -0
- package/dist/nodes/Bookoly/handlers/video/addSubtitlesToVideoFromFile.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/video/addWatermarkToVideo.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/video/addWatermarkToVideo.js +32 -0
- package/dist/nodes/Bookoly/handlers/video/addWatermarkToVideo.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/video/blurVideo.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/video/blurVideo.js +36 -0
- package/dist/nodes/Bookoly/handlers/video/blurVideo.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/video/clipVideo.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/video/clipVideo.js +28 -0
- package/dist/nodes/Bookoly/handlers/video/clipVideo.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/video/createSlideshow.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/video/createSlideshow.js +24 -0
- package/dist/nodes/Bookoly/handlers/video/createSlideshow.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/video/cropVideo.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/video/cropVideo.js +34 -0
- package/dist/nodes/Bookoly/handlers/video/cropVideo.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/video/extractAudioFromVideo.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/video/extractAudioFromVideo.js +20 -0
- package/dist/nodes/Bookoly/handlers/video/extractAudioFromVideo.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/video/frameVideo.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/video/frameVideo.js +24 -0
- package/dist/nodes/Bookoly/handlers/video/frameVideo.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/video/generateVideo.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/video/generateVideo.js +62 -0
- package/dist/nodes/Bookoly/handlers/video/generateVideo.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/video/getScenes.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/video/getScenes.js +24 -0
- package/dist/nodes/Bookoly/handlers/video/getScenes.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/video/index.d.ts +34 -0
- package/dist/nodes/Bookoly/handlers/video/index.js +38 -0
- package/dist/nodes/Bookoly/handlers/video/index.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/video/muteVideo.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/video/muteVideo.js +20 -0
- package/dist/nodes/Bookoly/handlers/video/muteVideo.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/video/rotateVideo.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/video/rotateVideo.js +24 -0
- package/dist/nodes/Bookoly/handlers/video/rotateVideo.js.map +1 -0
- package/dist/nodes/Bookoly/handlers/video/splitVideoIntoScenes.d.ts +2 -0
- package/dist/nodes/Bookoly/handlers/video/splitVideoIntoScenes.js +34 -0
- package/dist/nodes/Bookoly/handlers/video/splitVideoIntoScenes.js.map +1 -0
- package/dist/nodes/Bookoly/helpers/apiClient.d.ts +3 -0
- package/dist/nodes/Bookoly/helpers/apiClient.js +36 -0
- package/dist/nodes/Bookoly/helpers/apiClient.js.map +1 -0
- package/dist/nodes/Bookoly/resources/commonParams.d.ts +195 -0
- package/dist/nodes/Bookoly/resources/commonParams.js +210 -0
- package/dist/nodes/Bookoly/resources/commonParams.js.map +1 -0
- package/dist/nodes/Bookoly/resources/file.d.ts +2 -0
- package/dist/nodes/Bookoly/resources/file.js +49 -0
- package/dist/nodes/Bookoly/resources/file.js.map +1 -0
- package/dist/nodes/Bookoly/resources/index.d.ts +9 -0
- package/dist/nodes/Bookoly/resources/index.js +36 -0
- package/dist/nodes/Bookoly/resources/index.js.map +1 -0
- package/dist/nodes/Bookoly/resources/sound.d.ts +2 -0
- package/dist/nodes/Bookoly/resources/sound.js +179 -0
- package/dist/nodes/Bookoly/resources/sound.js.map +1 -0
- package/dist/nodes/Bookoly/resources/speech.d.ts +2 -0
- package/dist/nodes/Bookoly/resources/speech.js +47 -0
- package/dist/nodes/Bookoly/resources/speech.js.map +1 -0
- package/dist/nodes/Bookoly/resources/static.d.ts +8 -0
- package/dist/nodes/Bookoly/resources/static.js +196 -0
- package/dist/nodes/Bookoly/resources/static.js.map +1 -0
- package/dist/nodes/Bookoly/resources/subtitleParams.d.ts +2 -0
- package/dist/nodes/Bookoly/resources/subtitleParams.js +167 -0
- package/dist/nodes/Bookoly/resources/subtitleParams.js.map +1 -0
- package/dist/nodes/Bookoly/resources/transcription.d.ts +2 -0
- package/dist/nodes/Bookoly/resources/transcription.js +138 -0
- package/dist/nodes/Bookoly/resources/transcription.js.map +1 -0
- package/dist/nodes/Bookoly/resources/video.d.ts +2 -0
- package/dist/nodes/Bookoly/resources/video.js +135 -0
- package/dist/nodes/Bookoly/resources/video.js.map +1 -0
- package/dist/nodes/Bookoly/resources/videoParams/audio.d.ts +44 -0
- package/dist/nodes/Bookoly/resources/videoParams/audio.js +59 -0
- package/dist/nodes/Bookoly/resources/videoParams/audio.js.map +1 -0
- package/dist/nodes/Bookoly/resources/videoParams/blur.d.ts +2 -0
- package/dist/nodes/Bookoly/resources/videoParams/blur.js +93 -0
- package/dist/nodes/Bookoly/resources/videoParams/blur.js.map +1 -0
- package/dist/nodes/Bookoly/resources/videoParams/clip.d.ts +2 -0
- package/dist/nodes/Bookoly/resources/videoParams/clip.js +40 -0
- package/dist/nodes/Bookoly/resources/videoParams/clip.js.map +1 -0
- package/dist/nodes/Bookoly/resources/videoParams/crop.d.ts +2 -0
- package/dist/nodes/Bookoly/resources/videoParams/crop.js +75 -0
- package/dist/nodes/Bookoly/resources/videoParams/crop.js.map +1 -0
- package/dist/nodes/Bookoly/resources/videoParams/operations.d.ts +7 -0
- package/dist/nodes/Bookoly/resources/videoParams/operations.js +103 -0
- package/dist/nodes/Bookoly/resources/videoParams/operations.js.map +1 -0
- package/dist/nodes/Bookoly/resources/videoParams/scenes.d.ts +90 -0
- package/dist/nodes/Bookoly/resources/videoParams/scenes.js +84 -0
- package/dist/nodes/Bookoly/resources/videoParams/scenes.js.map +1 -0
- package/dist/nodes/Bookoly/resources/videoParams/split.d.ts +2 -0
- package/dist/nodes/Bookoly/resources/videoParams/split.js +116 -0
- package/dist/nodes/Bookoly/resources/videoParams/split.js.map +1 -0
- package/dist/nodes/Bookoly/resources/videoParams/watermark.d.ts +2 -0
- package/dist/nodes/Bookoly/resources/videoParams/watermark.js +54 -0
- package/dist/nodes/Bookoly/resources/videoParams/watermark.js.map +1 -0
- package/dist/nodes/Bookoly/types/index.d.ts +295 -0
- package/dist/nodes/Bookoly/types/index.js +287 -0
- package/dist/nodes/Bookoly/types/index.js.map +1 -0
- package/dist/package.json +54 -0
- package/dist/tsconfig.tsbuildinfo +1 -0
- package/index.js +0 -0
- package/package.json +54 -0
package/LICENSE.md
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2024 Alexander Baumtrog
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy of
|
|
6
|
+
this software and associated documentation files (the "Software"), to deal in
|
|
7
|
+
the Software without restriction, including without limitation the rights to
|
|
8
|
+
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies
|
|
9
|
+
of the Software, and to permit persons to whom the Software is furnished to do
|
|
10
|
+
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,94 @@
|
|
|
1
|
+
# n8n-nodes-bookoly
|
|
2
|
+
|
|
3
|
+
This is an n8n community node. It lets you use bookoly in your n8n workflows.
|
|
4
|
+
|
|
5
|
+
bookoly is a service that makes it easy to create, edit, and process your content automatically.
|
|
6
|
+
With bookoly, you can generate slideshows, add subtitles, create voice-overs, split videos into multiple scenes, and
|
|
7
|
+
a lot more — all through a simple API.
|
|
8
|
+
|
|
9
|
+
[n8n](https://n8n.io/) is a [fair-code licensed](https://docs.n8n.io/reference/license/) workflow automation platform.
|
|
10
|
+
|
|
11
|
+
[Installation](#installation)
|
|
12
|
+
[Operations](#operations)
|
|
13
|
+
[Credentials](#credentials)
|
|
14
|
+
[Compatibility](#compatibility)
|
|
15
|
+
[Usage](#usage)
|
|
16
|
+
[Resources](#resources)
|
|
17
|
+
[Version history](#version-history)
|
|
18
|
+
|
|
19
|
+
## Installation
|
|
20
|
+
|
|
21
|
+
Follow the [installation guide](https://docs.n8n.io/integrations/community-nodes/installation/) in the n8n community nodes documentation.
|
|
22
|
+
|
|
23
|
+
## Operations
|
|
24
|
+
|
|
25
|
+
### 🎞️ Video
|
|
26
|
+
|
|
27
|
+
* **Add Audio to a Video** – Add background music or a voice-over to a video.
|
|
28
|
+
* **Add Audio with Subtitles to a Video** – Add a voice-over and automatically generate and add subtitles from the audio.
|
|
29
|
+
* **Add Subtitles to a Video** – Automatically generate subtitles from the video’s audio and insert them into the file.
|
|
30
|
+
* **Add Subtitles to a Video from a File** – Import and embed an external subtitle file (e.g. `.srt`, `.ass`) into a video.
|
|
31
|
+
* **Add Watermark to a Video** – Overlay an image or text watermark onto a video.
|
|
32
|
+
* **Blur a Video** – Apply a blur effect to the entire video or selected regions.
|
|
33
|
+
* **Clip a Video** – Extract a specific section of a video by start time and duration.
|
|
34
|
+
* **Create a Slideshow** – Generate a slideshow video from multiple images and video clips.
|
|
35
|
+
* **Crop a Video** – Trim away unwanted edges of a video by defining crop dimensions.
|
|
36
|
+
* **Extract Audio from a Video** – Save the audio track of a video as a separate sound file.
|
|
37
|
+
* **Frame a Video** – Capture a single image from a video at the desired timestamp.
|
|
38
|
+
* **Generate a Video** – Create a video from images and video clips with a voice-over and subtitles.
|
|
39
|
+
* **Mute a Video** – Set the volume of a video to 0%.
|
|
40
|
+
* **Rotate a Video** – Rotate a video by 90, 180, or 270 degrees.
|
|
41
|
+
* **Split a Video into Scenes** – Split a video by automatic scene detection, fixed time intervals, or equal segments.
|
|
42
|
+
|
|
43
|
+
### 🗣️ Speech
|
|
44
|
+
|
|
45
|
+
* **Create a Speech Synthesis** – Convert text into a natural-sounding speech with AI.
|
|
46
|
+
|
|
47
|
+
### 📜 Transcript
|
|
48
|
+
|
|
49
|
+
* **Transcribe Media** – Automatically transcribe the audio from a video or audio file.
|
|
50
|
+
|
|
51
|
+
### 🎼 Sound
|
|
52
|
+
|
|
53
|
+
* **Combine Sounds** – Merge two or more audio files into a single track.
|
|
54
|
+
* **Create a Sound Effect** – Generate a custom sound effect with AI.
|
|
55
|
+
|
|
56
|
+
### 📂 File
|
|
57
|
+
|
|
58
|
+
* **Generate a Subtitle File** – Create a subtitle file (e.g. `.srt`, `.vtt`) from a video or audio file.
|
|
59
|
+
|
|
60
|
+
## Credentials
|
|
61
|
+
|
|
62
|
+
To use the bookoly node, you need an API token:
|
|
63
|
+
|
|
64
|
+
1. Sign up for an account at [bookoly](https://bookoly.com).
|
|
65
|
+
2. Open your profile from the left menu and scroll down to the API Tokens section.
|
|
66
|
+
3. Create a new API token.
|
|
67
|
+
* Enable all permissions.
|
|
68
|
+
* (Optional) Set an expiration date.
|
|
69
|
+
4. Copy the token and store it in a safe place.
|
|
70
|
+
5. In n8n, create new credentials for bookoly and paste your token.
|
|
71
|
+
|
|
72
|
+
## Compatibility
|
|
73
|
+
|
|
74
|
+
* Minimum n8n version: 1.106.3
|
|
75
|
+
* Tested with: n8n 1.106.3+
|
|
76
|
+
* Known issues: None at this time.
|
|
77
|
+
|
|
78
|
+
## Usage
|
|
79
|
+
|
|
80
|
+
Once installed, you can add the bookoly node to your workflow to automate content generation and processing.
|
|
81
|
+
|
|
82
|
+
📺 To see all examples in action check out the full bookoly YouTube tutorial [playlist](https://www.youtube.com/playlist?list=PLaZXufV_18nEe7EG_HNwwbd7f6lCbNL_g)
|
|
83
|
+
|
|
84
|
+
If you’re new to n8n, check the [Try it out](https://docs.n8n.io/try-it-out/) guide
|
|
85
|
+
|
|
86
|
+
## Resources
|
|
87
|
+
|
|
88
|
+
* [bookoly api docs](https://bookoly.com/app/docs/v1/api#/)
|
|
89
|
+
* [n8n community nodes documentation](https://docs.n8n.io/integrations/#community-nodes)
|
|
90
|
+
|
|
91
|
+
## Version history
|
|
92
|
+
|
|
93
|
+
1.0.4
|
|
94
|
+
* Initial release with support for all bookoly operations.
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { IAuthenticateGeneric, ICredentialTestRequest, ICredentialType, INodeProperties } from 'n8n-workflow';
|
|
2
|
+
export declare class BookolyApi implements ICredentialType {
|
|
3
|
+
name: string;
|
|
4
|
+
displayName: string;
|
|
5
|
+
documentationUrl: string;
|
|
6
|
+
properties: INodeProperties[];
|
|
7
|
+
authenticate: IAuthenticateGeneric;
|
|
8
|
+
test: ICredentialTestRequest;
|
|
9
|
+
}
|
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.BookolyApi = void 0;
|
|
4
|
+
const Bookoly_node_1 = require("../nodes/Bookoly/Bookoly.node");
|
|
5
|
+
const types_1 = require("../nodes/Bookoly/types");
|
|
6
|
+
class BookolyApi {
|
|
7
|
+
constructor() {
|
|
8
|
+
this.name = 'bookolyApi';
|
|
9
|
+
this.displayName = 'Bookoly API';
|
|
10
|
+
this.documentationUrl = 'https://bookoly.com/app/docs/v1/api#/';
|
|
11
|
+
this.properties = [
|
|
12
|
+
{
|
|
13
|
+
displayName: 'API Token',
|
|
14
|
+
name: 'apiToken',
|
|
15
|
+
type: 'string',
|
|
16
|
+
default: '',
|
|
17
|
+
typeOptions: {
|
|
18
|
+
password: true,
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
];
|
|
22
|
+
this.authenticate = {
|
|
23
|
+
type: 'generic',
|
|
24
|
+
properties: {
|
|
25
|
+
headers: {
|
|
26
|
+
Authorization: '=Bearer {{$credentials.apiToken}}',
|
|
27
|
+
'Content-Type': 'application/json',
|
|
28
|
+
Accept: 'application/json',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
this.test = {
|
|
33
|
+
request: {
|
|
34
|
+
baseURL: Bookoly_node_1.API_V1_BASE_URL,
|
|
35
|
+
url: types_1.ApiEndpoints.AUTH_CHECK,
|
|
36
|
+
method: types_1.HttpMethod.POST,
|
|
37
|
+
headers: {
|
|
38
|
+
Authorization: '=Bearer {{$credentials.apiToken}}',
|
|
39
|
+
'Content-Type': 'application/json',
|
|
40
|
+
Accept: 'application/json',
|
|
41
|
+
},
|
|
42
|
+
},
|
|
43
|
+
};
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
exports.BookolyApi = BookolyApi;
|
|
47
|
+
//# sourceMappingURL=BookolyApi.credentials.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"BookolyApi.credentials.js","sourceRoot":"","sources":["../../credentials/BookolyApi.credentials.ts"],"names":[],"mappings":";;;AAMA,gEAAgE;AAChE,kDAAkE;AAElE,MAAa,UAAU;IAAvB;QACC,SAAI,GAAW,YAAY,CAAC;QAC5B,gBAAW,GAAW,aAAa,CAAC;QACpC,qBAAgB,GAAW,uCAAuC,CAAC;QACnE,eAAU,GAAsB;YAC/B;gBACC,WAAW,EAAE,WAAW;gBACxB,IAAI,EAAE,UAAU;gBAChB,IAAI,EAAE,QAAQ;gBACd,OAAO,EAAE,EAAE;gBACX,WAAW,EAAE;oBACZ,QAAQ,EAAE,IAAI;iBACd;aACD;SACD,CAAC;QACF,iBAAY,GAAyB;YACpC,IAAI,EAAE,SAAS;YACf,UAAU,EAAE;gBACX,OAAO,EAAE;oBACR,aAAa,EAAE,mCAAmC;oBAClD,cAAc,EAAE,kBAAkB;oBAClC,MAAM,EAAE,kBAAkB;iBAC1B;aACD;SACD,CAAC;QACF,SAAI,GAA2B;YAC9B,OAAO,EAAE;gBACR,OAAO,EAAE,8BAAe;gBACxB,GAAG,EAAE,oBAAY,CAAC,UAAU;gBAC5B,MAAM,EAAE,kBAAU,CAAC,IAAI;gBACvB,OAAO,EAAE;oBACR,aAAa,EAAE,mCAAmC;oBAClD,cAAc,EAAE,kBAAkB;oBAClC,MAAM,EAAE,kBAAkB;iBAC1B;aACD;SACD,CAAC;IACH,CAAC;CAAA;AArCD,gCAqCC"}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { INodeExecutionData, INodeType, INodeTypeDescription, IExecuteFunctions } from 'n8n-workflow';
|
|
2
|
+
export declare const APP_BASE_URL = "https://bookoly.com/app";
|
|
3
|
+
export declare const API_V1_BASE_URL = "https://bookoly.com/api/v1";
|
|
4
|
+
export declare class Bookoly implements INodeType {
|
|
5
|
+
description: INodeTypeDescription;
|
|
6
|
+
execute(this: IExecuteFunctions): Promise<INodeExecutionData[][]>;
|
|
7
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.Bookoly = exports.API_V1_BASE_URL = exports.APP_BASE_URL = void 0;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const resources_1 = require("./resources");
|
|
6
|
+
const handlers_1 = require("./handlers");
|
|
7
|
+
exports.APP_BASE_URL = 'https://bookoly.com/app';
|
|
8
|
+
exports.API_V1_BASE_URL = 'https://bookoly.com/api/v1';
|
|
9
|
+
class Bookoly {
|
|
10
|
+
constructor() {
|
|
11
|
+
this.description = {
|
|
12
|
+
displayName: 'bookoly',
|
|
13
|
+
name: 'bookoly',
|
|
14
|
+
icon: 'file:bookoly.svg',
|
|
15
|
+
group: ['transform'],
|
|
16
|
+
version: 1,
|
|
17
|
+
subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}',
|
|
18
|
+
description: 'Interact with the bookoly API',
|
|
19
|
+
defaults: {
|
|
20
|
+
name: 'bookoly',
|
|
21
|
+
},
|
|
22
|
+
inputs: ["main"],
|
|
23
|
+
outputs: ["main"],
|
|
24
|
+
requestDefaults: {
|
|
25
|
+
baseURL: exports.API_V1_BASE_URL,
|
|
26
|
+
headers: {
|
|
27
|
+
Accept: 'application/json',
|
|
28
|
+
'Content-Type': 'application/json',
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
credentials: [
|
|
32
|
+
{
|
|
33
|
+
name: 'bookolyApi',
|
|
34
|
+
required: true,
|
|
35
|
+
},
|
|
36
|
+
],
|
|
37
|
+
properties: [
|
|
38
|
+
{
|
|
39
|
+
displayName: 'Resource',
|
|
40
|
+
name: 'resource',
|
|
41
|
+
type: 'options',
|
|
42
|
+
noDataExpression: true,
|
|
43
|
+
options: Object.values(resources_1.RESOURCE_DEFINITIONS).map(({ displayName, value }) => ({
|
|
44
|
+
name: displayName,
|
|
45
|
+
value: value,
|
|
46
|
+
})),
|
|
47
|
+
default: Object.values(resources_1.RESOURCE_DEFINITIONS)[0].value,
|
|
48
|
+
},
|
|
49
|
+
...Object.values(resources_1.RESOURCE_DEFINITIONS).flatMap((resource) => [
|
|
50
|
+
...resource.operations,
|
|
51
|
+
...resource.parameters,
|
|
52
|
+
]),
|
|
53
|
+
],
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
async execute() {
|
|
57
|
+
var _a;
|
|
58
|
+
const returnData = [];
|
|
59
|
+
const items = this.getInputData();
|
|
60
|
+
for (let i = 0; i < items.length; i++) {
|
|
61
|
+
const resource = this.getNodeParameter('resource', i);
|
|
62
|
+
const operation = this.getNodeParameter('operation', i);
|
|
63
|
+
const handler = (_a = handlers_1.HANDLERS[resource]) === null || _a === void 0 ? void 0 : _a[operation];
|
|
64
|
+
if (!handler) {
|
|
65
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `No handler found for ${resource}.${operation}`);
|
|
66
|
+
}
|
|
67
|
+
try {
|
|
68
|
+
const result = await handler(this, i);
|
|
69
|
+
returnData.push({ json: result });
|
|
70
|
+
}
|
|
71
|
+
catch (error) {
|
|
72
|
+
if (error.name === 'NodeOperationError') {
|
|
73
|
+
throw error;
|
|
74
|
+
}
|
|
75
|
+
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Failed to execute ${operation}: ${error.message}`);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
return [returnData];
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
exports.Bookoly = Bookoly;
|
|
82
|
+
//# sourceMappingURL=Bookoly.node.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bookoly.node.js","sourceRoot":"","sources":["../../../nodes/Bookoly/Bookoly.node.ts"],"names":[],"mappings":";;;AAAA,+CAQsB;AAEtB,2CAAmD;AACnD,yCAAsC;AAGzB,QAAA,YAAY,GAAG,yBAAyB,CAAC;AACzC,QAAA,eAAe,GAAG,4BAA4B,CAAC;AAE5D,MAAa,OAAO;IAApB;QACC,gBAAW,GAAyB;YACnC,WAAW,EAAE,SAAS;YACtB,IAAI,EAAE,SAAS;YACf,IAAI,EAAE,kBAAkB;YACxB,KAAK,EAAE,CAAC,WAAW,CAAC;YACpB,OAAO,EAAE,CAAC;YACV,QAAQ,EAAE,8DAA8D;YACxE,WAAW,EAAE,+BAA+B;YAC5C,QAAQ,EAAE;gBACT,IAAI,EAAE,SAAS;aACf;YACD,MAAM,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,gBAAgB,CAAC,WAAW,EAAE,CAAC,CAAW,CAAC;YAElE,MAAM,OAAO,GAAa,MAAA,mBAAQ,CAAC,QAAQ,CAAC,0CAAG,SAAS,CAAC,CAAC;YAC1D,IAAI,CAAC,OAAO,EAAE,CAAC;gBACd,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,wBAAwB,QAAQ,IAAI,SAAS,EAAE,CAC/C,CAAC;YACH,CAAC;YAED,IAAI,CAAC;gBACJ,MAAM,MAAM,GAAQ,MAAM,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,CAAC;gBAC3C,UAAU,CAAC,IAAI,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,CAAC,CAAC;YACnC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBAChB,IAAI,KAAK,CAAC,IAAI,KAAK,oBAAoB,EAAE,CAAC;oBACzC,MAAM,KAAK,CAAC;gBACb,CAAC;gBACD,MAAM,IAAI,iCAAkB,CAC3B,IAAI,CAAC,OAAO,EAAE,EACd,qBAAqB,SAAS,KAAK,KAAK,CAAC,OAAO,EAAE,CAClD,CAAC;YACH,CAAC;QACF,CAAC;QAED,OAAO,CAAC,UAAU,CAAC,CAAC;IACrB,CAAC;CACD;AA9ED,0BA8EC"}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
{
|
|
2
|
+
"node": "n8n-nodes-base.Bookoly",
|
|
3
|
+
"nodeVersion": "1.0",
|
|
4
|
+
"codexVersion": "1.0",
|
|
5
|
+
"categories": ["Data & Storage"],
|
|
6
|
+
"resources": {
|
|
7
|
+
"credentialDocumentation": [
|
|
8
|
+
{
|
|
9
|
+
"url": "https://bookoly.com/app/docs/v1/api#/operations/authCheckApi"
|
|
10
|
+
}
|
|
11
|
+
],
|
|
12
|
+
"primaryDocumentation": [
|
|
13
|
+
{
|
|
14
|
+
"url": "https://bookoly.com/app/docs/v1/api#"
|
|
15
|
+
}
|
|
16
|
+
]
|
|
17
|
+
}
|
|
18
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
<?xml version="1.0" standalone="no"?>
|
|
2
|
+
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 20010904//EN"
|
|
3
|
+
"http://www.w3.org/TR/2001/REC-SVG-20010904/DTD/svg10.dtd">
|
|
4
|
+
<svg version="1.0" xmlns="http://www.w3.org/2000/svg"
|
|
5
|
+
width="900.000000pt" height="900.000000pt" viewBox="0 0 900.000000 900.000000"
|
|
6
|
+
preserveAspectRatio="xMidYMid meet">
|
|
7
|
+
<metadata>
|
|
8
|
+
Created by potrace 1.10, written by Peter Selinger 2001-2011
|
|
9
|
+
</metadata>
|
|
10
|
+
<g transform="translate(0.000000,900.000000) scale(0.100000,-0.100000)"
|
|
11
|
+
fill="#535884" stroke="none">
|
|
12
|
+
<path d="M1538 8563 c-2 -5 -2 -1800 0 -3991 l2 -3982 632 2 632 3 2 350 c0
|
|
13
|
+
193 1 356 2 363 3 23 27 12 51 -23 29 -43 225 -232 283 -274 152 -108 265
|
|
14
|
+
-177 382 -235 74 -36 141 -66 150 -66 9 0 27 -6 39 -14 65 -41 320 -107 582
|
|
15
|
+
-152 143 -24 745 -24 885 0 52 9 136 24 185 32 50 9 110 22 135 29 45 13 105
|
|
16
|
+
29 170 44 127 31 441 165 605 259 223 128 464 325 643 525 59 65 109 124 112
|
|
17
|
+
131 3 7 11 19 18 27 59 67 171 241 244 379 118 222 234 536 258 695 4 28 12
|
|
18
|
+
64 18 80 6 17 23 111 38 210 22 148 27 227 31 442 3 166 1 301 -6 365 -22 192
|
|
19
|
+
-51 383 -66 427 -8 25 -15 56 -15 70 0 14 -7 46 -15 71 -8 25 -31 97 -50 160
|
|
20
|
+
-20 63 -41 119 -46 125 -5 5 -9 17 -9 26 0 26 -103 246 -176 378 -25 43 -153
|
|
21
|
+
237 -190 287 -96 129 -214 258 -329 360 -27 24 -68 60 -90 80 -52 46 -241 180
|
|
22
|
+
-330 234 -94 57 -303 160 -326 160 -10 0 -21 4 -24 10 -9 14 -94 50 -121 50
|
|
23
|
+
-12 0 -25 4 -28 9 -6 10 -159 61 -182 61 -8 0 -22 4 -32 9 -17 9 -96 29 -207
|
|
24
|
+
51 -124 26 -247 40 -456 55 -191 13 -238 13 -410 0 -211 -16 -378 -38 -408
|
|
25
|
+
-55 -11 -5 -34 -10 -51 -10 -17 0 -47 -7 -67 -15 -19 -8 -46 -15 -59 -15 -12
|
|
26
|
+
0 -25 -4 -28 -9 -3 -5 -22 -12 -42 -16 -20 -3 -50 -12 -68 -19 -17 -8 -67 -28
|
|
27
|
+
-111 -46 -112 -45 -164 -70 -171 -81 -3 -5 -11 -9 -19 -9 -7 0 -41 -17 -75
|
|
28
|
+
-37 -33 -21 -69 -43 -78 -48 -118 -71 -260 -183 -375 -296 -53 -52 -99 -93
|
|
29
|
+
-102 -91 -3 3 -5 664 -5 1469 l0 1463 -664 0 c-366 0 -666 -3 -668 -7z m3330
|
|
30
|
+
-3312 c28 -6 76 -16 105 -22 28 -6 70 -15 92 -19 149 -29 392 -153 585 -298
|
|
31
|
+
50 -38 203 -191 266 -268 48 -58 169 -257 201 -329 92 -213 131 -361 155 -580
|
|
32
|
+
24 -220 10 -585 -27 -735 -52 -213 -120 -396 -190 -510 -19 -32 -35 -61 -35
|
|
33
|
+
-64 0 -20 -154 -207 -242 -295 -96 -96 -247 -221 -267 -221 -4 0 -26 -12 -47
|
|
34
|
+
-28 -50 -35 -196 -102 -299 -136 -44 -15 -89 -31 -100 -35 -45 -19 -352 -61
|
|
35
|
+
-465 -64 -77 -2 -325 24 -415 43 -189 42 -399 126 -555 223 -126 78 -308 247
|
|
36
|
+
-416 387 -232 300 -357 679 -371 1123 -8 255 46 559 142 796 118 292 308 542
|
|
37
|
+
547 722 80 60 288 179 313 179 8 0 16 4 20 9 3 5 42 22 88 36 45 15 86 31 92
|
|
38
|
+
36 5 5 21 9 36 9 15 0 40 5 55 10 27 10 118 26 229 41 83 10 439 3 503 -10z"/>
|
|
39
|
+
</g>
|
|
40
|
+
</svg>
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.generateSubtitleFile = generateSubtitleFile;
|
|
4
|
+
const apiClient_1 = require("../../helpers/apiClient");
|
|
5
|
+
const types_1 = require("../../types");
|
|
6
|
+
async function generateSubtitleFile(ctx, itemIndex) {
|
|
7
|
+
const name = ctx.getNodeParameter('name', itemIndex, '');
|
|
8
|
+
const type = ctx.getNodeParameter('type', itemIndex, types_1.SubtitleFileType.ASS);
|
|
9
|
+
const url = ctx.getNodeParameter('url', itemIndex);
|
|
10
|
+
const style = ctx.getNodeParameter('style', itemIndex);
|
|
11
|
+
const language = ctx.getNodeParameter('language', itemIndex);
|
|
12
|
+
const font_family = ctx.getNodeParameter('font_family', itemIndex);
|
|
13
|
+
const font_size = ctx.getNodeParameter('font_size', itemIndex);
|
|
14
|
+
const word_color = ctx.getNodeParameter('word_color', itemIndex, '');
|
|
15
|
+
const line_color = ctx.getNodeParameter('line_color', itemIndex, '');
|
|
16
|
+
const line_words = ctx.getNodeParameter('line_words', itemIndex);
|
|
17
|
+
const outline_width = ctx.getNodeParameter('outline_width', itemIndex);
|
|
18
|
+
const position = ctx.getNodeParameter('position', itemIndex);
|
|
19
|
+
const ltr = ctx.getNodeParameter('ltr', itemIndex);
|
|
20
|
+
const wait = ctx.getNodeParameter('wait', itemIndex, false);
|
|
21
|
+
const webhook_url = ctx.getNodeParameter('webhook_url', itemIndex, '');
|
|
22
|
+
const requestBody = {
|
|
23
|
+
subtitle: {
|
|
24
|
+
name,
|
|
25
|
+
type,
|
|
26
|
+
url,
|
|
27
|
+
webhook_url,
|
|
28
|
+
style,
|
|
29
|
+
language,
|
|
30
|
+
font_family,
|
|
31
|
+
font_size,
|
|
32
|
+
word_color,
|
|
33
|
+
line_color,
|
|
34
|
+
line_words,
|
|
35
|
+
outline_width,
|
|
36
|
+
position,
|
|
37
|
+
ltr,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
return await (0, apiClient_1.bookolyApiRequest)(ctx, types_1.HttpMethod.POST, types_1.ApiEndpoints.GENERATE_SUBTITLE_FILE, requestBody, wait);
|
|
41
|
+
}
|
|
42
|
+
//# sourceMappingURL=generateSubtitleFile.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"generateSubtitleFile.js","sourceRoot":"","sources":["../../../../../nodes/Bookoly/handlers/file/generateSubtitleFile.ts"],"names":[],"mappings":";;AAIA,oDA8CC;AAjDD,uDAA4D;AAC5D,uCAAyE;AAElE,KAAK,UAAU,oBAAoB,CACzC,GAAsB,EACtB,SAAiB;IAEjB,MAAM,IAAI,GAAG,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,EAAE,CAAW,CAAC;IACnE,MAAM,IAAI,GAAG,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,wBAAgB,CAAC,GAAG,CAAW,CAAC;IACrF,MAAM,GAAG,GAAG,GAAG,CAAC,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAW,CAAC;IAC7D,MAAM,KAAK,GAAG,GAAG,CAAC,gBAAgB,CAAC,OAAO,EAAE,SAAS,CAAW,CAAC;IACjE,MAAM,QAAQ,GAAG,GAAG,CAAC,gBAAgB,CAAC,UAAU,EAAE,SAAS,CAAW,CAAC;IACvE,MAAM,WAAW,GAAG,GAAG,CAAC,gBAAgB,CAAC,aAAa,EAAE,SAAS,CAAW,CAAC;IAC7E,MAAM,SAAS,GAAG,GAAG,CAAC,gBAAgB,CAAC,WAAW,EAAE,SAAS,CAAW,CAAC;IACzE,MAAM,UAAU,GAAG,GAAG,CAAC,gBAAgB,CAAC,YAAY,EAAE,SAAS,EAAE,EAAE,CAAW,CAAC;IAC/E,MAAM,UAAU,GAAG,GAAG,CAAC,gBAAgB,CAAC,YAAY,EAAE,SAAS,EAAE,EAAE,CAAW,CAAC;IAC/E,MAAM,UAAU,GAAG,GAAG,CAAC,gBAAgB,CAAC,YAAY,EAAE,SAAS,CAAW,CAAC;IAC3E,MAAM,aAAa,GAAG,GAAG,CAAC,gBAAgB,CAAC,eAAe,EAAE,SAAS,CAAW,CAAC;IACjF,MAAM,QAAQ,GAAG,GAAG,CAAC,gBAAgB,CAAC,UAAU,EAAE,SAAS,CAAW,CAAC;IACvE,MAAM,GAAG,GAAG,GAAG,CAAC,gBAAgB,CAAC,KAAK,EAAE,SAAS,CAAY,CAAC;IAC9D,MAAM,IAAI,GAAG,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAY,CAAC;IACvE,MAAM,WAAW,GAAG,GAAG,CAAC,gBAAgB,CAAC,aAAa,EAAE,SAAS,EAAE,EAAE,CAAW,CAAC;IAEjF,MAAM,WAAW,GAAG;QACnB,QAAQ,EAAE;YACT,IAAI;YACJ,IAAI;YACJ,GAAG;YACH,WAAW;YACX,KAAK;YACL,QAAQ;YACR,WAAW;YACX,SAAS;YACT,UAAU;YACV,UAAU;YACV,UAAU;YACV,aAAa;YACb,QAAQ;YACR,GAAG;SACH;KACD,CAAC;IAEF,OAAO,MAAM,IAAA,6BAAiB,EAC7B,GAAG,EACH,kBAAU,CAAC,IAAI,EACf,oBAAY,CAAC,sBAAsB,EACnC,WAAW,EACX,IAAI,CACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.fileHandlers = void 0;
|
|
4
|
+
const generateSubtitleFile_1 = require("./generateSubtitleFile");
|
|
5
|
+
const getResource_1 = require("../getResource");
|
|
6
|
+
exports.fileHandlers = {
|
|
7
|
+
generateSubtitleFile: generateSubtitleFile_1.generateSubtitleFile,
|
|
8
|
+
getSubtitleFile: getResource_1.getResource,
|
|
9
|
+
};
|
|
10
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Bookoly/handlers/file/index.ts"],"names":[],"mappings":";;;AAAA,iEAA8D;AAC9D,gDAAgE;AAEnD,QAAA,YAAY,GAAG;IAC3B,oBAAoB,EAApB,2CAAoB;IACpB,eAAe,EAAf,yBAAe;CACf,CAAC"}
|
|
@@ -0,0 +1,92 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getResource = getResource;
|
|
4
|
+
const n8n_workflow_1 = require("n8n-workflow");
|
|
5
|
+
const apiClient_1 = require("../helpers/apiClient");
|
|
6
|
+
const types_1 = require("../types");
|
|
7
|
+
const Bookoly_node_1 = require("../Bookoly.node");
|
|
8
|
+
async function getResource(ctx, itemIndex, resourceId) {
|
|
9
|
+
const maxAttempts = 60;
|
|
10
|
+
const delay = 5000;
|
|
11
|
+
const resourceType = ctx.getNodeParameter('resource', itemIndex);
|
|
12
|
+
if (!resourceId) {
|
|
13
|
+
resourceId = getResourceId(ctx, itemIndex, resourceType);
|
|
14
|
+
}
|
|
15
|
+
for (let attempt = 0; attempt < maxAttempts; attempt++) {
|
|
16
|
+
const response = await (0, apiClient_1.bookolyApiRequest)(ctx, types_1.HttpMethod.GET, getEndpoint(resourceId, resourceType));
|
|
17
|
+
const responseState = response === null || response === void 0 ? void 0 : response.state;
|
|
18
|
+
if (responseState === types_1.ResourceState.COMPLETED) {
|
|
19
|
+
return response;
|
|
20
|
+
}
|
|
21
|
+
else if (responseState === types_1.ResourceState.FAILED) {
|
|
22
|
+
const url = getResourceUrl(resourceId, resourceType);
|
|
23
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), `Resource creation failed. For more details, please check the bookoly activities at: ${url}`);
|
|
24
|
+
}
|
|
25
|
+
await (0, n8n_workflow_1.sleep)(delay);
|
|
26
|
+
}
|
|
27
|
+
throw new n8n_workflow_1.NodeOperationError(ctx.getNode(), 'Timeout while waiting for resource generation to finish');
|
|
28
|
+
}
|
|
29
|
+
function getResourceId(ctx, itemIndex, resourceType) {
|
|
30
|
+
let parameterName = null;
|
|
31
|
+
switch (resourceType) {
|
|
32
|
+
case types_1.ResourceType.VIDEO:
|
|
33
|
+
parameterName = 'videoId';
|
|
34
|
+
break;
|
|
35
|
+
case types_1.ResourceType.SPEECH:
|
|
36
|
+
parameterName = 'speechId';
|
|
37
|
+
break;
|
|
38
|
+
case types_1.ResourceType.TRANSCRIPT:
|
|
39
|
+
parameterName = 'transcriptId';
|
|
40
|
+
break;
|
|
41
|
+
case types_1.ResourceType.SOUND:
|
|
42
|
+
parameterName = 'soundId';
|
|
43
|
+
break;
|
|
44
|
+
case types_1.ResourceType.FILE:
|
|
45
|
+
parameterName = 'subtitleFileId';
|
|
46
|
+
break;
|
|
47
|
+
}
|
|
48
|
+
return ctx.getNodeParameter(parameterName, itemIndex);
|
|
49
|
+
}
|
|
50
|
+
function getEndpoint(resourceId, resourceType) {
|
|
51
|
+
let endpoint = null;
|
|
52
|
+
switch (resourceType) {
|
|
53
|
+
case types_1.ResourceType.VIDEO:
|
|
54
|
+
endpoint = types_1.ApiEndpoints.VIDEOS;
|
|
55
|
+
break;
|
|
56
|
+
case types_1.ResourceType.SPEECH:
|
|
57
|
+
endpoint = types_1.ApiEndpoints.SPEECHES;
|
|
58
|
+
break;
|
|
59
|
+
case types_1.ResourceType.TRANSCRIPT:
|
|
60
|
+
endpoint = types_1.ApiEndpoints.TRANSCRIPTS;
|
|
61
|
+
break;
|
|
62
|
+
case types_1.ResourceType.SOUND:
|
|
63
|
+
endpoint = types_1.ApiEndpoints.SOUNDS;
|
|
64
|
+
break;
|
|
65
|
+
case types_1.ResourceType.FILE:
|
|
66
|
+
endpoint = types_1.ApiEndpoints.SUBTITLE_FILES;
|
|
67
|
+
break;
|
|
68
|
+
}
|
|
69
|
+
return `${endpoint}/${resourceId}`;
|
|
70
|
+
}
|
|
71
|
+
function getResourceUrl(resourceId, resourceType) {
|
|
72
|
+
let endpoint = null;
|
|
73
|
+
switch (resourceType) {
|
|
74
|
+
case types_1.ResourceType.VIDEO:
|
|
75
|
+
endpoint = types_1.ApiEndpoints.VIDEOS;
|
|
76
|
+
break;
|
|
77
|
+
case types_1.ResourceType.SPEECH:
|
|
78
|
+
endpoint = types_1.ApiEndpoints.SPEECHES;
|
|
79
|
+
break;
|
|
80
|
+
case types_1.ResourceType.TRANSCRIPT:
|
|
81
|
+
endpoint = types_1.ApiEndpoints.TRANSCRIPTS;
|
|
82
|
+
break;
|
|
83
|
+
case types_1.ResourceType.SOUND:
|
|
84
|
+
endpoint = types_1.ApiEndpoints.SOUNDS;
|
|
85
|
+
break;
|
|
86
|
+
case types_1.ResourceType.FILE:
|
|
87
|
+
endpoint = types_1.ApiEndpoints.SUBTITLE_FILES;
|
|
88
|
+
break;
|
|
89
|
+
}
|
|
90
|
+
return `${Bookoly_node_1.APP_BASE_URL}/${endpoint}/${resourceId}`;
|
|
91
|
+
}
|
|
92
|
+
//# sourceMappingURL=getResource.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"getResource.js","sourceRoot":"","sources":["../../../../nodes/Bookoly/handlers/getResource.ts"],"names":[],"mappings":";;AAKA,kCA0CC;AA/CD,+CAA4E;AAC5E,oDAAyD;AACzD,oCAAiF;AACjF,kDAA+C;AAExC,KAAK,UAAU,WAAW,CAChC,GAAsB,EACtB,SAAiB,EACjB,UAAkB;IAElB,MAAM,WAAW,GAAG,EAAE,CAAC;IACvB,MAAM,KAAK,GAAG,IAAI,CAAC;IAEnB,MAAM,YAAY,GAAG,GAAG,CAAC,gBAAgB,CAAC,UAAU,EAAE,SAAS,CAAiB,CAAC;IAEjF,IAAI,CAAC,UAAU,EAAE,CAAC;QAEjB,UAAU,GAAG,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,YAAY,CAAC,CAAC;IAC1D,CAAC;IAED,KAAK,IAAI,OAAO,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ACrB,QAAQ,GAAG,oBAAY,CAAC,cAAc,CAAC;YACvC,MAAM;IACR,CAAC;IAED,OAAO,GAAG,2BAAY,IAAI,QAAQ,IAAI,UAAU,EAAE,CAAC;AACpD,CAAC"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.HANDLERS = void 0;
|
|
4
|
+
const types_1 = require("../types");
|
|
5
|
+
const sound_1 = require("./sound");
|
|
6
|
+
const speech_1 = require("./speech");
|
|
7
|
+
const transcript_1 = require("./transcript");
|
|
8
|
+
const file_1 = require("./file");
|
|
9
|
+
const video_1 = require("./video");
|
|
10
|
+
exports.HANDLERS = {
|
|
11
|
+
[types_1.ResourceType.SOUND]: sound_1.soundHandlers,
|
|
12
|
+
[types_1.ResourceType.SPEECH]: speech_1.speechHandlers,
|
|
13
|
+
[types_1.ResourceType.TRANSCRIPT]: transcript_1.transcriptionHandlers,
|
|
14
|
+
[types_1.ResourceType.FILE]: file_1.fileHandlers,
|
|
15
|
+
[types_1.ResourceType.VIDEO]: video_1.videoHandlers,
|
|
16
|
+
};
|
|
17
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../nodes/Bookoly/handlers/index.ts"],"names":[],"mappings":";;;AAAA,oCAAwC;AACxC,mCAAwC;AACxC,qCAA0C;AAC1C,6CAAqD;AACrD,iCAAsC;AACtC,mCAAwC;AAE3B,QAAA,QAAQ,GAAmD;IACvE,CAAC,oBAAY,CAAC,KAAK,CAAC,EAAE,qBAAa;IACnC,CAAC,oBAAY,CAAC,MAAM,CAAC,EAAE,uBAAc;IACrC,CAAC,oBAAY,CAAC,UAAU,CAAC,EAAE,kCAAqB;IAChD,CAAC,oBAAY,CAAC,IAAI,CAAC,EAAE,mBAAY;IACjC,CAAC,oBAAY,CAAC,KAAK,CAAC,EAAE,qBAAa;CACnC,CAAC"}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.combineSounds = combineSounds;
|
|
4
|
+
const apiClient_1 = require("../../helpers/apiClient");
|
|
5
|
+
const types_1 = require("../../types");
|
|
6
|
+
async function combineSounds(ctx, itemIndex) {
|
|
7
|
+
const name = ctx.getNodeParameter('name', itemIndex);
|
|
8
|
+
const urls = (ctx.getNodeParameter('audioList', itemIndex).urls || []);
|
|
9
|
+
const wait = ctx.getNodeParameter('wait', itemIndex, false);
|
|
10
|
+
const webhook_url = ctx.getNodeParameter('webhook_url', itemIndex, '');
|
|
11
|
+
const requestBody = {
|
|
12
|
+
sound: {
|
|
13
|
+
name,
|
|
14
|
+
webhook_url,
|
|
15
|
+
segments: urls.map((s) => ({ src: s.src })),
|
|
16
|
+
},
|
|
17
|
+
};
|
|
18
|
+
return await (0, apiClient_1.bookolyApiRequest)(ctx, types_1.HttpMethod.POST, types_1.ApiEndpoints.COMBINE_SOUNDS, requestBody, wait);
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=combineSounds.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"combineSounds.js","sourceRoot":"","sources":["../../../../../nodes/Bookoly/handlers/sound/combineSounds.ts"],"names":[],"mappings":";;AAIA,sCAuBC;AA1BD,uDAA4D;AAC5D,uCAAuD;AAEhD,KAAK,UAAU,aAAa,CAAC,GAAsB,EAAE,SAAiB;IAC5E,MAAM,IAAI,GAAG,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAW,CAAC;IAC/D,MAAM,IAAI,GAAG,CAAE,GAAG,CAAC,gBAAgB,CAAC,WAAW,EAAE,SAAS,CAAS,CAAC,IAAI,IAAI,EAAE,CAE5E,CAAC;IACH,MAAM,IAAI,GAAG,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAY,CAAC;IACvE,MAAM,WAAW,GAAG,GAAG,CAAC,gBAAgB,CAAC,aAAa,EAAE,SAAS,EAAE,EAAE,CAAW,CAAC;IAEjF,MAAM,WAAW,GAAG;QACnB,KAAK,EAAE;YACN,IAAI;YACJ,WAAW;YACX,QAAQ,EAAE,IAAI,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,EAAE,GAAG,EAAE,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC;SAC3C;KACD,CAAC;IAEF,OAAO,MAAM,IAAA,6BAAiB,EAC7B,GAAG,EACH,kBAAU,CAAC,IAAI,EACf,oBAAY,CAAC,cAAc,EAC3B,WAAW,EACX,IAAI,CACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.createSoundEffect = createSoundEffect;
|
|
4
|
+
const apiClient_1 = require("../../helpers/apiClient");
|
|
5
|
+
const types_1 = require("../../types");
|
|
6
|
+
async function createSoundEffect(ctx, itemIndex) {
|
|
7
|
+
const name = ctx.getNodeParameter('name', itemIndex);
|
|
8
|
+
const wait = ctx.getNodeParameter('wait', itemIndex, false);
|
|
9
|
+
const requestBody = {
|
|
10
|
+
sound: {
|
|
11
|
+
name,
|
|
12
|
+
webhook_url: ctx.getNodeParameter('webhook_url', itemIndex, ''),
|
|
13
|
+
effect_text: ctx.getNodeParameter('effect_text', itemIndex),
|
|
14
|
+
effect_duration: ctx.getNodeParameter('effect_duration', itemIndex, 1),
|
|
15
|
+
},
|
|
16
|
+
};
|
|
17
|
+
return await (0, apiClient_1.bookolyApiRequest)(ctx, types_1.HttpMethod.POST, types_1.ApiEndpoints.CREATE_SOUND_EFFECT, requestBody, wait);
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=createSoundEffect.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"createSoundEffect.js","sourceRoot":"","sources":["../../../../../nodes/Bookoly/handlers/sound/createSoundEffect.ts"],"names":[],"mappings":";;AAIA,8CAoBC;AAvBD,uDAA4D;AAC5D,uCAAuD;AAEhD,KAAK,UAAU,iBAAiB,CAAC,GAAsB,EAAE,SAAiB;IAChF,MAAM,IAAI,GAAG,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,CAAW,CAAC;IAC/D,MAAM,IAAI,GAAG,GAAG,CAAC,gBAAgB,CAAC,MAAM,EAAE,SAAS,EAAE,KAAK,CAAY,CAAC;IAEvE,MAAM,WAAW,GAAG;QACnB,KAAK,EAAE;YACN,IAAI;YACJ,WAAW,EAAE,GAAG,CAAC,gBAAgB,CAAC,aAAa,EAAE,SAAS,EAAE,EAAE,CAAW;YACzE,WAAW,EAAE,GAAG,CAAC,gBAAgB,CAAC,aAAa,EAAE,SAAS,CAAW;YACrE,eAAe,EAAE,GAAG,CAAC,gBAAgB,CAAC,iBAAiB,EAAE,SAAS,EAAE,CAAC,CAAW;SAChF;KACD,CAAC;IAEF,OAAO,MAAM,IAAA,6BAAiB,EAC7B,GAAG,EACH,kBAAU,CAAC,IAAI,EACf,oBAAY,CAAC,mBAAmB,EAChC,WAAW,EACX,IAAI,CACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { createSoundEffect } from './createSoundEffect';
|
|
2
|
+
import { combineSounds } from './combineSounds';
|
|
3
|
+
import { getResource as getSound } from '../getResource';
|
|
4
|
+
export declare const soundHandlers: {
|
|
5
|
+
createSoundEffect: typeof createSoundEffect;
|
|
6
|
+
combineSounds: typeof combineSounds;
|
|
7
|
+
getSound: typeof getSound;
|
|
8
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.soundHandlers = void 0;
|
|
4
|
+
const createSoundEffect_1 = require("./createSoundEffect");
|
|
5
|
+
const combineSounds_1 = require("./combineSounds");
|
|
6
|
+
const getResource_1 = require("../getResource");
|
|
7
|
+
exports.soundHandlers = {
|
|
8
|
+
createSoundEffect: createSoundEffect_1.createSoundEffect,
|
|
9
|
+
combineSounds: combineSounds_1.combineSounds,
|
|
10
|
+
getSound: getResource_1.getResource,
|
|
11
|
+
};
|
|
12
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../nodes/Bookoly/handlers/sound/index.ts"],"names":[],"mappings":";;;AAAA,2DAAwD;AACxD,mDAAgD;AAChD,gDAAyD;AAE5C,QAAA,aAAa,GAAG;IAC5B,iBAAiB,EAAjB,qCAAiB;IACjB,aAAa,EAAb,6BAAa;IACb,QAAQ,EAAR,yBAAQ;CACR,CAAC"}
|