Skip to content

Commit

Permalink
chore(ci): add lint workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
ThibaultBee committed Aug 17, 2023
1 parent cf9444a commit 8404d68
Show file tree
Hide file tree
Showing 4 changed files with 45 additions and 20 deletions.
16 changes: 16 additions & 0 deletions .github/workflows/lint.yml
@@ -0,0 +1,16 @@
name: Lint

on: [push]

jobs:
lint:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node.js
uses: actions/setup-node@v3
- name: Install dependencies
run: yarn install
- name: Lint
run: yarn lint
22 changes: 13 additions & 9 deletions src/NativeApiVideoUploader.ts
Expand Up @@ -2,16 +2,20 @@ import type { TurboModule } from 'react-native';
import { TurboModuleRegistry } from 'react-native';

export interface Spec extends TurboModule {
readonly getConstants: () => {};
readonly getConstants: () => {};

setApplicationName: (name: string, version: string) => void;
setEnvironment: (environment: string) => void;
setApiKey: (apiKey: string) => void;
setChunkSize: (size: number) => Promise<number>;
setTimeout: (timeout: number) => void;
setApplicationName: (name: string, version: string) => void;
setEnvironment: (environment: string) => void;
setApiKey: (apiKey: string) => void;
setChunkSize: (size: number) => Promise<number>;
setTimeout: (timeout: number) => void;

uploadWithUploadToken: (token: string, filepath: string, videoId?: string) => Promise<String>;
upload: (videoId: string, filepath: string) => Promise<String>;
uploadWithUploadToken: (
token: string,
filepath: string,
videoId?: string
) => Promise<String>;
upload: (videoId: string, filepath: string) => Promise<String>;
}

export default TurboModuleRegistry.getEnforcing<Spec>('ApiVideoUploader');
26 changes: 16 additions & 10 deletions src/index.tsx
Expand Up @@ -45,17 +45,23 @@ export default {
setTimeout: (timeout: number): void => {
return ApiVideoUploader.setTimeout(timeout);
},
uploadWithUploadToken: (token: string, filepath: string, videoId?: string): Promise<Video> => {
return ApiVideoUploader.uploadWithUploadToken(token, filepath, videoId).then(
(value: string) => {
const json = JSON.parse(value);
uploadWithUploadToken: (
token: string,
filepath: string,
videoId?: string
): Promise<Video> => {
return ApiVideoUploader.uploadWithUploadToken(
token,
filepath,
videoId
).then((value: string) => {
const json = JSON.parse(value);

return {
...json,
_public: json.public,
} as Video;
}
);
return {
...json,
_public: json.public,
} as Video;
});
},
upload: (videoId: string, filepath: string): Promise<Video> => {
return ApiVideoUploader.upload(videoId, filepath).then((value: string) => {
Expand Down
1 change: 0 additions & 1 deletion src/types.ts
@@ -1,4 +1,3 @@

export enum Environment {
Sandbox = 'https://sandbox.api.video',
Production = 'https://ws.api.video',
Expand Down

0 comments on commit 8404d68

Please sign in to comment.