@kassellabs/corellia-api
Advanced tools
Comparing version 0.0.1 to 0.0.2
{ | ||
"name": "@kassellabs/corellia-api", | ||
"version": "0.0.1", | ||
"version": "0.0.2", | ||
"description": "Corellia's External API to render After Effects Videos", | ||
"keywords": [ | ||
"corellia", | ||
"after", | ||
"effects", | ||
"video" | ||
], | ||
"author": "Nihey Takizawa <nihey.takizawa@gmail.com>", | ||
"author": "Kassel Labs Team", | ||
"homepage": "https://kassellabs.io", | ||
"license": "MIT", | ||
"main": "dist/index.js", | ||
"directories": { | ||
"lib": "lib", | ||
"test": "__tests__" | ||
}, | ||
"files": [ | ||
"lib" | ||
], | ||
"publishConfig": { | ||
"access": "public" | ||
}, | ||
"types": "dist/index.d.ts", | ||
"scripts": { | ||
"build": "tsc", | ||
"test": "echo \"Error: run tests from root\" && exit 1" | ||
}, | ||
"bugs": { | ||
"url": "https://kassellabs.io/contact" | ||
}, | ||
"dependencies": { | ||
"axios": "^0.19.2" | ||
"axios": "^0.19.0" | ||
}, | ||
"devDependencies": { | ||
"ts-node": "^8.6.2" | ||
} | ||
} |
126
README.md
@@ -1,11 +0,127 @@ | ||
# `@corellia/api` | ||
# Corellia API | ||
> TODO: description | ||
This module provides easy access to Corellia's API to render videos based on | ||
After Effects Templates. | ||
## Usage | ||
# Installation | ||
```bash | ||
npm i --save @corellia/api | ||
``` | ||
const api = require('@corellia/api'); | ||
// TODO: DEMONSTRATE API | ||
# Usage | ||
First you should get your Corellia API **Client ID** and **Client Secret**, then | ||
you can start using this project by instantiating the main class | ||
```javascript | ||
import CorelliaAPI from '@corellia/api'; | ||
const api = new CorelliaAPI({ | ||
host: 'https://my-own-api', // Defaults to the production server | ||
clientId: '< your corellia client id >', | ||
clientSecret: '< your corellia client secret >', | ||
}); | ||
``` | ||
After that you can start calling the main methods: | ||
## requestNewVideo(customJSON) | ||
Requests a new video to be rendered based on a custom JSON | ||
```javascript | ||
const videoRequest = await api.requestNewVideo(customJSON); | ||
// Example: | ||
// | ||
// { | ||
// "lastModified":"2020-01-24T18:08:13.654Z", | ||
// "userId":"XXXX", | ||
// "actions":[ | ||
// ..., | ||
// ], | ||
// "templateId":"my-template-id", | ||
// "customJSON":{ | ||
// "videoURL":"<my-video-url>", | ||
// "timeToBeContinued":9.731636028610229, | ||
// "videoStartAt":0, | ||
// "videoEndAt":14.731636028610229 | ||
// }, | ||
// "renderJob":{ | ||
// "id":"WWWWWWWWWWW", | ||
// "state":"started", | ||
// "downloadURL":null | ||
// }, | ||
// "id":"IIIIIIIIIIIIII" | ||
// } | ||
``` | ||
## getAllVideoRequests() | ||
Retrieve a list of all requestd videos so far | ||
```javascript | ||
const videoRequests = await api.getAllVideoRequests(customJSON); | ||
// Example: | ||
// | ||
// [{ | ||
// "lastModified":"2020-01-24T18:08:13.654Z", | ||
// "userId":"XXXX", | ||
// "actions":[ | ||
// ..., | ||
// ], | ||
// "templateId":"my-template-id", | ||
// "customJSON":{ | ||
// "videoURL":"<my-video-url>", | ||
// "timeToBeContinued":9.731636028610229, | ||
// "videoStartAt":0, | ||
// "videoEndAt":14.731636028610229 | ||
// }, | ||
// "renderJob":{ | ||
// "id":"WWWWWWWWWWW", | ||
// "state":"started", | ||
// "downloadURL":null | ||
// }, | ||
// "id":"IIIIIIIIIIIIII" | ||
// }, ...] | ||
``` | ||
## getVideoRequest(id) | ||
Retrieve the status of a already created videoRequest | ||
```javascript | ||
const videoRequest = await api.getVideoRequest('<your-video-request-id>'); | ||
// Example: | ||
// | ||
// { | ||
// "lastModified":"2020-01-24T18:08:13.654Z", | ||
// "userId":"XXXX", | ||
// "actions":[ | ||
// ..., | ||
// ], | ||
// "templateId":"my-template-id", | ||
// "customJSON":{ | ||
// "videoURL":"<my-video-url>", | ||
// "timeToBeContinued":9.731636028610229, | ||
// "videoStartAt":0, | ||
// "videoEndAt":14.731636028610229 | ||
// }, | ||
// "renderJob":{ | ||
// "id":"WWWWWWWWWWW", | ||
// "state":"started", | ||
// "downloadURL":null | ||
// }, | ||
// "id":"IIIIIIIIIIIIII" | ||
// } | ||
``` | ||
## deleteVideoRequest(id) | ||
Remove a specific video request | ||
```javascript | ||
const { success } = await api.deleteVideoRequest('<your-video-request-id>'); | ||
// success === true -> deleted | ||
// success === false -> not deleted | ||
``` |
Major refactor
Supply chain riskPackage has recently undergone a major refactor. It may be unstable or indicate significant internal changes. Use caution when updating to versions that include significant changes.
Found 1 instance in 1 package
Trivial Package
Supply chain riskPackages less than 10 lines of code are easily copied into your own project and may not warrant the additional supply chain risk of an external dependency.
Found 1 instance in 1 package
No bug tracker
MaintenancePackage does not have a linked bug tracker in package.json.
Found 1 instance in 1 package
10552
6
231
1
128
1
Updatedaxios@^0.19.0