Begin service token v3

This commit is contained in:
Tuan Dang
2023-09-18 22:15:48 +01:00
parent 4765dd0696
commit 1cdd840485
6 changed files with 62 additions and 1 deletions
+28
View File
@@ -0,0 +1,28 @@
import { Document, Schema, Types, model } from "mongoose";
export interface IServiceTokenV3 extends Document {
_id: Types.ObjectId;
name: string;
workspace: Types.ObjectId;
publicKey: string;
}
const serviceTokenV3Schema = new Schema(
{
name: {
type: String,
required: true
},
workspace: {
type: Schema.Types.ObjectId,
ref: "Workspace",
required: true
},
publicKey: {
type: String,
required: true
}
}
);
export const ServiceTokenV3 = model<IServiceTokenV3>("ServiceTokenV3", serviceTokenV3Schema);