From 428ccb8b7a44ce60cabb7401a5464cf5fcbd4dba Mon Sep 17 00:00:00 2001 From: Chocobozzz Date: Tue, 11 May 2021 12:04:47 +0200 Subject: Reorganize plugin models --- shared/models/plugins/plugin-index/index.ts | 3 +++ .../plugin-index/peertube-plugin-index-list.model.ts | 10 ++++++++++ .../plugins/plugin-index/peertube-plugin-index.model.ts | 14 ++++++++++++++ .../plugin-index/peertube-plugin-latest-version.model.ts | 10 ++++++++++ 4 files changed, 37 insertions(+) create mode 100644 shared/models/plugins/plugin-index/index.ts create mode 100644 shared/models/plugins/plugin-index/peertube-plugin-index-list.model.ts create mode 100644 shared/models/plugins/plugin-index/peertube-plugin-index.model.ts create mode 100644 shared/models/plugins/plugin-index/peertube-plugin-latest-version.model.ts (limited to 'shared/models/plugins/plugin-index') diff --git a/shared/models/plugins/plugin-index/index.ts b/shared/models/plugins/plugin-index/index.ts new file mode 100644 index 000000000..913846638 --- /dev/null +++ b/shared/models/plugins/plugin-index/index.ts @@ -0,0 +1,3 @@ +export * from './peertube-plugin-index-list.model' +export * from './peertube-plugin-index.model' +export * from './peertube-plugin-latest-version.model' diff --git a/shared/models/plugins/plugin-index/peertube-plugin-index-list.model.ts b/shared/models/plugins/plugin-index/peertube-plugin-index-list.model.ts new file mode 100644 index 000000000..ecb46482e --- /dev/null +++ b/shared/models/plugins/plugin-index/peertube-plugin-index-list.model.ts @@ -0,0 +1,10 @@ +import { PluginType } from '../plugin.type' + +export interface PeertubePluginIndexList { + start: number + count: number + sort: string + pluginType?: PluginType + currentPeerTubeEngine?: string + search?: string +} diff --git a/shared/models/plugins/plugin-index/peertube-plugin-index.model.ts b/shared/models/plugins/plugin-index/peertube-plugin-index.model.ts new file mode 100644 index 000000000..e91c8b4dc --- /dev/null +++ b/shared/models/plugins/plugin-index/peertube-plugin-index.model.ts @@ -0,0 +1,14 @@ +export interface PeerTubePluginIndex { + npmName: string + description: string + homepage: string + createdAt: Date + updatedAt: Date + + popularity: number + + latestVersion: string + + name?: string + installed?: boolean +} diff --git a/shared/models/plugins/plugin-index/peertube-plugin-latest-version.model.ts b/shared/models/plugins/plugin-index/peertube-plugin-latest-version.model.ts new file mode 100644 index 000000000..811a64429 --- /dev/null +++ b/shared/models/plugins/plugin-index/peertube-plugin-latest-version.model.ts @@ -0,0 +1,10 @@ +export interface PeertubePluginLatestVersionRequest { + currentPeerTubeEngine?: string + + npmNames: string[] +} + +export type PeertubePluginLatestVersionResponse = { + npmName: string + latestVersion: string | null +}[] -- cgit v1.2.3