@kassellabs/corellia-api
Advanced tools
Comparing version 0.0.2 to 0.0.3
@@ -1,2 +0,2 @@ | ||
import { AxiosInstance, AxiosRequestConfig, AxiosResponse } from "axios"; | ||
import { AxiosInstance, AxiosRequestConfig } from 'axios'; | ||
declare type CorelliaAPIContructorType = { | ||
@@ -13,5 +13,5 @@ host?: string; | ||
axios: AxiosInstance; | ||
constructor({ host, clientId, clientSecret }: CorelliaAPIContructorType); | ||
constructor({ host, clientId, clientSecret, }: CorelliaAPIContructorType); | ||
renewAccessToken(): Promise<void>; | ||
request(options: AxiosRequestConfig): Promise<AxiosResponse<any>>; | ||
request(options: AxiosRequestConfig): Promise<import("axios").AxiosResponse<any>>; | ||
getRequestData(options: AxiosRequestConfig): Promise<any>; | ||
@@ -21,4 +21,4 @@ getAllVideoRequests(): Promise<any>; | ||
deleteVideoRequest(id: string): Promise<any>; | ||
requestNewVideo(customJSON: any): Promise<any>; | ||
requestNewVideo(videoRequestBody: any): Promise<any>; | ||
} | ||
export {}; |
@@ -17,3 +17,3 @@ "use strict"; | ||
class CorelliaAPI { | ||
constructor({ host = "https://api.corellia.kassellabs.io", clientId, clientSecret }) { | ||
constructor({ host = 'https://api.corellia.kassellabs.io', clientId, clientSecret, }) { | ||
this.host = host; | ||
@@ -26,3 +26,3 @@ this.clientId = clientId; | ||
headers: { | ||
"Content-Type": "application/json" | ||
'Content-Type': 'application/json', | ||
}, | ||
@@ -35,3 +35,3 @@ transformRequest: (data, headers) => { | ||
return JSON.stringify(data); | ||
} | ||
}, | ||
}); | ||
@@ -42,8 +42,8 @@ } | ||
const response = yield this.axios({ | ||
url: "/login", | ||
method: "POST", | ||
url: '/login', | ||
method: 'POST', | ||
data: { | ||
clientId: this.clientId, | ||
clientSecret: this.clientSecret | ||
} | ||
clientSecret: this.clientSecret, | ||
}, | ||
}); | ||
@@ -83,3 +83,3 @@ this.currentAccessToken = response.data.access_token; | ||
return this.getRequestData({ | ||
url: `/video-request` | ||
url: '/video-request', | ||
}); | ||
@@ -91,3 +91,3 @@ }); | ||
return this.getRequestData({ | ||
url: `/video-request/${id}` | ||
url: `/video-request/${id}`, | ||
}); | ||
@@ -100,12 +100,12 @@ }); | ||
url: `/video-request/${id}`, | ||
method: "DELETE" | ||
method: 'DELETE', | ||
}); | ||
}); | ||
} | ||
requestNewVideo(customJSON) { | ||
requestNewVideo(videoRequestBody) { | ||
return __awaiter(this, void 0, void 0, function* () { | ||
return this.getRequestData({ | ||
url: "/video-request", | ||
method: "POST", | ||
data: customJSON | ||
url: '/video-request', | ||
method: 'POST', | ||
data: videoRequestBody, | ||
}); | ||
@@ -112,0 +112,0 @@ }); |
{ | ||
"name": "@kassellabs/corellia-api", | ||
"version": "0.0.2", | ||
"version": "0.0.3", | ||
"description": "Corellia's External API to render After Effects Videos", | ||
@@ -11,4 +11,4 @@ "author": "Kassel Labs Team", | ||
"scripts": { | ||
"build": "tsc", | ||
"test": "echo \"Error: run tests from root\" && exit 1" | ||
"prepublish": "npm run build", | ||
"build": "tsc" | ||
}, | ||
@@ -22,4 +22,5 @@ "bugs": { | ||
"devDependencies": { | ||
"ts-node": "^8.6.2" | ||
"ts-node": "^8.6.2", | ||
"typescript": "^3.7.5" | ||
} | ||
} |
# Corellia API | ||
This module provides easy access to Corellia's API to render videos based on | ||
After Effects Templates. | ||
This module provides easy access to Corellia's API to request and manage video rendering. | ||
@@ -9,3 +8,3 @@ # Installation | ||
```bash | ||
npm i --save @corellia/api | ||
npm i --save @kassellabs/corellia-api | ||
``` | ||
@@ -19,6 +18,5 @@ | ||
```javascript | ||
import CorelliaAPI from '@corellia/api'; | ||
import CorelliaAPI from '@kassellabs/corellia-api'; | ||
const api = new CorelliaAPI({ | ||
host: 'https://my-own-api', // Defaults to the production server | ||
clientId: '< your corellia client id >', | ||
@@ -28,3 +26,3 @@ clientSecret: '< your corellia client secret >', | ||
``` | ||
You can also specify a different API endpoint via `host` param on the constructor. | ||
After that you can start calling the main methods: | ||
@@ -54,3 +52,2 @@ | ||
// "renderJob":{ | ||
// "id":"WWWWWWWWWWW", | ||
// "state":"started", | ||
@@ -85,3 +82,2 @@ // "downloadURL":null | ||
// "renderJob":{ | ||
// "id":"WWWWWWWWWWW", | ||
// "state":"started", | ||
@@ -116,3 +112,2 @@ // "downloadURL":null | ||
// "renderJob":{ | ||
// "id":"WWWWWWWWWWW", | ||
// "state":"started", | ||
@@ -119,0 +114,0 @@ // "downloadURL":null |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
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
15290
8
361
2
123
2