Comparar commits
1 Commits
| Autor | SHA1 | Data | |
|---|---|---|---|
| 827cb84392 |
gerado
+253
-132
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
@@ -53,6 +53,7 @@
|
||||
"redux": "^4.0.1",
|
||||
"redux-thunk": "^2.3.0",
|
||||
"rimraf": "^2.6.2",
|
||||
"semver": "^6.3.0",
|
||||
"shortid": "^2.2.14",
|
||||
"video-react": "^0.13.2",
|
||||
"vott-ct": "2.1.24",
|
||||
|
||||
@@ -0,0 +1,3 @@
|
||||
export interface CliCommand {
|
||||
execute(args: string[]);
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { CliCommand } from "../command"
|
||||
|
||||
export class HelpCommand implements CliCommand {
|
||||
public execute(args: string[]) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,7 @@
|
||||
import { CliCommand } from "../command"
|
||||
|
||||
export class ProjectCommand implements CliCommand {
|
||||
public execute(args: string[]) {
|
||||
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,3 @@
|
||||
export function cli() {
|
||||
console.log("Hello from VoTT");
|
||||
}
|
||||
@@ -618,7 +618,7 @@ export default class MockFactory {
|
||||
public static createAssetProvider(): IAssetProvider {
|
||||
return {
|
||||
initialize: jest.fn(() => Promise.resolve()),
|
||||
getAssets(containerName?: string): Promise<IAsset[]> {
|
||||
getAssets(project?: IProject): Promise<IAsset[]> {
|
||||
throw new Error("Method not implemented.");
|
||||
},
|
||||
};
|
||||
|
||||
@@ -3,9 +3,10 @@ import fs from "fs";
|
||||
import path from "path";
|
||||
import rimraf from "rimraf";
|
||||
import { IStorageProvider } from "../../../providers/storage/storageProviderFactory";
|
||||
import { IAsset, AssetType, StorageType } from "../../../models/applicationState";
|
||||
import { IAsset, AssetType, StorageType, IProject } from "../../../models/applicationState";
|
||||
import { AssetService } from "../../../services/assetService";
|
||||
import { strings } from "../../../common/strings";
|
||||
import semver from "semver"
|
||||
|
||||
export default class LocalFileSystem implements IStorageProvider {
|
||||
public storageType: StorageType.Local;
|
||||
@@ -92,7 +93,7 @@ export default class LocalFileSystem implements IStorageProvider {
|
||||
});
|
||||
}
|
||||
|
||||
public listFiles(folderPath: string): Promise<string[]> {
|
||||
public listFiles(folderPath?: string): Promise<string[]> {
|
||||
return this.listItems(path.normalize(folderPath), (stats) => !stats.isDirectory());
|
||||
}
|
||||
|
||||
@@ -136,9 +137,14 @@ export default class LocalFileSystem implements IStorageProvider {
|
||||
});
|
||||
}
|
||||
|
||||
public async getAssets(folderPath?: string): Promise<IAsset[]> {
|
||||
return (await this.listFiles(path.normalize(folderPath)))
|
||||
.map((filePath) => AssetService.createAssetFromFilePath(filePath))
|
||||
public async getAssets(project?: IProject): Promise<IAsset[]> {
|
||||
alert("Hello");
|
||||
let files = await this.listFiles();
|
||||
const schemaVersion = (project) ? project.schemaVersion : undefined;
|
||||
if (semver.valid(schemaVersion) && semver.satisfies(schemaVersion, ">=2.0.0")) {
|
||||
files = files.map((filePath) => path.relative("", filePath))
|
||||
}
|
||||
return files.map((filePath) => AssetService.createAssetFromFilePath(filePath))
|
||||
.filter((asset) => asset.type !== AssetType.Unknown);
|
||||
}
|
||||
|
||||
|
||||
@@ -94,6 +94,8 @@ export interface IAppSettings {
|
||||
* @description - Defines the structure of a VoTT project
|
||||
* @member id - Unique identifier
|
||||
* @member name - User defined name
|
||||
* @member version - Application Version
|
||||
* @member projectSchemaVersion
|
||||
* @member securityToken - The Base64 encoded token used to encrypt sensitive project data
|
||||
* @member description - User defined description
|
||||
* @member tags - User defined list of tags
|
||||
@@ -105,8 +107,11 @@ export interface IAppSettings {
|
||||
*/
|
||||
export interface IProject {
|
||||
id: string;
|
||||
/** This is my name */
|
||||
name: string;
|
||||
version: string;
|
||||
/** Version for the Project JSON schema */
|
||||
schemaVersion?: string;
|
||||
securityToken: string;
|
||||
description?: string;
|
||||
tags: ITag[];
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { AssetProviderFactory, IAssetProvider } from "./assetProviderFactory";
|
||||
import { IAsset } from "../../models/applicationState";
|
||||
import { IAsset, IProject } from "../../models/applicationState";
|
||||
|
||||
describe("Asset Provider Factory", () => {
|
||||
it("registers new storage providers", () => {
|
||||
@@ -25,7 +25,7 @@ class TestAssetProvider implements IAssetProvider {
|
||||
public initialize(): Promise<void> {
|
||||
throw new Error("Method not implemented");
|
||||
}
|
||||
public getAssets(containerName?: string): Promise<IAsset[]> {
|
||||
public getAssets(project?: IProject): Promise<IAsset[]> {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IAsset, IConnection } from "../../models/applicationState";
|
||||
import { IAsset, IConnection, IProject } from "../../models/applicationState";
|
||||
import Guard from "../../common/guard";
|
||||
import getHostProcess, { HostProcessType } from "../../common/hostProcess";
|
||||
|
||||
@@ -9,7 +9,7 @@ import getHostProcess, { HostProcessType } from "../../common/hostProcess";
|
||||
*/
|
||||
export interface IAssetProvider {
|
||||
initialize?(): Promise<void>;
|
||||
getAssets(containerName?: string): Promise<IAsset[]>;
|
||||
getAssets(project?: IProject): Promise<IAsset[]>;
|
||||
}
|
||||
|
||||
/**
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { IStorageProvider } from "./storageProviderFactory";
|
||||
import { IAsset, AssetType, StorageType } from "../../models/applicationState";
|
||||
import { IAsset, AssetType, StorageType, IProject } from "../../models/applicationState";
|
||||
import { AssetService } from "../../services/assetService";
|
||||
import {
|
||||
TokenCredential, AnonymousCredential, ContainerURL,
|
||||
@@ -191,9 +191,8 @@ export class AzureBlobStorage implements IStorageProvider {
|
||||
* @param containerName - Container from which to retrieve assets. Defaults to
|
||||
* container specified in Azure Cloud Storage options
|
||||
*/
|
||||
public async getAssets(containerName?: string): Promise<IAsset[]> {
|
||||
containerName = (containerName) ? containerName : this.options.containerName;
|
||||
const files = await this.listFiles(containerName);
|
||||
public async getAssets(project?: IProject): Promise<IAsset[]> {
|
||||
const files = await this.listFiles(this.options.containerName);
|
||||
const result: IAsset[] = [];
|
||||
for (const file of files) {
|
||||
const url = this.getUrl(file);
|
||||
|
||||
@@ -125,8 +125,7 @@ export class LocalFileSystemProxy implements IStorageProvider, IAssetProvider {
|
||||
* Retrieve assets from directory
|
||||
* @param folderName - Directory containing assets
|
||||
*/
|
||||
public getAssets(folderName?: string): Promise<IAsset[]> {
|
||||
const folderPath = [this.options.folderPath, folderName].join("/");
|
||||
return IpcRendererProxy.send(`${PROXY_NAME}:getAssets`, [folderPath]);
|
||||
public getAssets(): Promise<IAsset[]> {
|
||||
return IpcRendererProxy.send(`${PROXY_NAME}:getAssets`, [this.options.folderPath]);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import { StorageProviderFactory, IStorageProvider } from "./storageProviderFactory";
|
||||
import { IAsset, StorageType } from "../../models/applicationState";
|
||||
import { IAsset, StorageType, IProject } from "../../models/applicationState";
|
||||
|
||||
describe("Storage Provider Factory", () => {
|
||||
it("registers new storage providers", () => {
|
||||
@@ -51,7 +51,7 @@ class TestStorageProvider implements IStorageProvider {
|
||||
public deleteContainer(folderPath: string): Promise<void> {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
public getAssets(containerName?: string): Promise<IAsset[]> {
|
||||
public getAssets(project?: IProject): Promise<IAsset[]> {
|
||||
throw new Error("Method not implemented.");
|
||||
}
|
||||
}
|
||||
|
||||
@@ -13,6 +13,11 @@ import packageJson from "../../package.json";
|
||||
import { ExportAssetState } from "../providers/export/exportProvider";
|
||||
import { IExportFormat } from "vott-react";
|
||||
|
||||
export const ProjectFileVersions = {
|
||||
latest: "1.0.0",
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Functions required for a project service
|
||||
* @member save - Save a project
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário