forked from Chatbot/v3-api
43 lines
818 B
TypeScript
43 lines
818 B
TypeScript
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
|
|
|
|
@Schema({
|
|
timestamps: { createdAt: 'createdAt', updatedAt: 'updatedAt' },
|
|
versionKey: false,
|
|
collection: 'externalTokens',
|
|
_id: true,
|
|
})
|
|
export class ExternalTokensModel {
|
|
@Prop({ type: String })
|
|
token: string;
|
|
|
|
@Prop({ type: 'string' })
|
|
url: string;
|
|
|
|
@Prop({ type: Boolean })
|
|
isActive: boolean;
|
|
|
|
@Prop({ type: String })
|
|
method: 'access' | 'refresh';
|
|
|
|
@Prop({ type: String })
|
|
tokenType: 'Bearer' | 'Basic';
|
|
|
|
@Prop({ type: String })
|
|
expiresIn: string;
|
|
|
|
@Prop({ type: String })
|
|
scope: string;
|
|
|
|
@Prop({ type: Number })
|
|
timestamps: Number;
|
|
|
|
@Prop({ type: Array })
|
|
createdAt: [];
|
|
|
|
@Prop({ type: Array })
|
|
updatedAt: [];
|
|
}
|
|
|
|
export const ExternalTokenSchema =
|
|
SchemaFactory.createForClass(ExternalTokensModel);
|