From cef346e487f28bb48e82beafd8cda510f5a1faaf Mon Sep 17 00:00:00 2001 From: Matthew Raymer Date: Mon, 10 Jul 2023 18:45:50 +0800 Subject: [PATCH] Move almost all interfaces to endorserServer.ts --- src/libs/endorserServer.ts | 50 ++++++++++++++++++++++++++++++++ src/views/AccountViewView.vue | 15 ---------- src/views/DiscoverView.vue | 22 -------------- src/views/NewEditProjectView.vue | 8 ----- src/views/ProjectsView.vue | 22 -------------- src/views/StatisticsView.vue | 5 ---- 6 files changed, 50 insertions(+), 72 deletions(-) diff --git a/src/libs/endorserServer.ts b/src/libs/endorserServer.ts index 0a8c38cf..fb6e3005 100644 --- a/src/libs/endorserServer.ts +++ b/src/libs/endorserServer.ts @@ -197,3 +197,53 @@ export function isNumeric(str: string): boolean { export function numberOrZero(str: string): number { return isNumeric(str) ? +str : 0; } + +export interface ErrorResponse { + error?: { + message?: string; + }; +} + +export interface RateLimits { + doneClaimsThisWeek: string; + doneRegistrationsThisMonth: string; + maxClaimsPerWeek: string; + maxRegistrationsPerMonth: string; + nextMonthBeginDateTime: string; + nextWeekBeginDateTime: string; +} + +/** + * Represents data about a project + **/ +export interface ProjectData { + /** + * Name of the project + **/ + name: string; + /** + * Description of the project + **/ + description: string; + /** + * URL referencing information about the project + **/ + handleId: string; + /** + * The Identier of the project + **/ + rowid: string; +} + +export interface VerifiableCredential { + "@context": string; + "@type": string; + name: string; + description: string; + identifier?: string; +} + +export interface WorldProperties { + startTime?: string; + endTime?: string; +} diff --git a/src/views/AccountViewView.vue b/src/views/AccountViewView.vue index 2d63d4b8..a60c2af7 100644 --- a/src/views/AccountViewView.vue +++ b/src/views/AccountViewView.vue @@ -303,21 +303,6 @@ import QuickNav from "@/components/QuickNav"; // eslint-disable-next-line @typescript-eslint/no-var-requires const Buffer = require("buffer/").Buffer; -interface RateLimits { - doneClaimsThisWeek: string; - doneRegistrationsThisMonth: string; - maxClaimsPerWeek: string; - maxRegistrationsPerMonth: string; - nextMonthBeginDateTime: string; - nextWeekBeginDateTime: string; -} - -interface ErrorResponse { - error?: { - message?: string; - }; -} - @Component({ components: { AlertMessage, QuickNav } }) export default class AccountViewView extends Vue { Constants = AppString; diff --git a/src/views/DiscoverView.vue b/src/views/DiscoverView.vue index 14428ead..d2fab615 100644 --- a/src/views/DiscoverView.vue +++ b/src/views/DiscoverView.vue @@ -109,28 +109,6 @@ import { accessToken } from "@/libs/crypto"; import AlertMessage from "@/components/AlertMessage"; import QuickNav from "@/components/QuickNav"; -/** - * Represents data about a project - **/ -interface ProjectData { - /** - * Name of the project - **/ - name: string; - /** - * Description of the project - **/ - description: string; - /** - * URL referencing information about the project - **/ - handleId: string; - /** - * The Identier of the project - **/ - rowid: string; -} - @Component({ components: { AlertMessage, QuickNav }, }) diff --git a/src/views/NewEditProjectView.vue b/src/views/NewEditProjectView.vue index 193899b3..3dc6633c 100644 --- a/src/views/NewEditProjectView.vue +++ b/src/views/NewEditProjectView.vue @@ -83,14 +83,6 @@ import { useAppStore } from "@/store/app"; import { IIdentifier } from "@veramo/core"; import AlertMessage from "@/components/AlertMessage"; -interface VerifiableCredential { - "@context": string; - "@type": string; - name: string; - description: string; - identifier?: string; -} - @Component({ components: { AlertMessage }, }) diff --git a/src/views/ProjectsView.vue b/src/views/ProjectsView.vue index cd4a2a26..3c5672ad 100644 --- a/src/views/ProjectsView.vue +++ b/src/views/ProjectsView.vue @@ -83,28 +83,6 @@ import InfiniteScroll from "@/components/InfiniteScroll"; import AlertMessage from "@/components/AlertMessage"; import QuickNav from "@/components/QuickNav"; -/** - * Represents data about a project - **/ -interface ProjectData { - /** - * Name of the project - **/ - name: string; - /** - * Description of the project - **/ - description: string; - /** - * URL referencing information about the project - **/ - handleId: string; - /** - * The Identier of the project - **/ - rowid: string; -} - @Component({ components: { InfiniteScroll, AlertMessage, QuickNav }, }) diff --git a/src/views/StatisticsView.vue b/src/views/StatisticsView.vue index 0dcf2f57..d9875533 100644 --- a/src/views/StatisticsView.vue +++ b/src/views/StatisticsView.vue @@ -47,11 +47,6 @@ import { World } from "@/components/World/World.js"; import AlertMessage from "@/components/AlertMessage"; import QuickNav from "@/components/QuickNav"; -interface WorldProperties { - startTime?: string; - endTime?: string; -} - @Component({ components: { AlertMessage, World, QuickNav } }) export default class StatisticsView extends Vue { world: World;