Skip to main content
Glama
plans.schema.ts1.43 kB
import { Schema } from 'mongoose'; import type { PlanSchema } from '@/types/plan.types'; export const planSchema = new Schema<PlanSchema>( { type: { type: String, required: true, enum: ['PREMIUM', 'ENTERPRISE'], }, period: { type: String, required: true, enum: ['MONTHLY', 'YEARLY'], default: 'MONTHLY', }, creatorId: { type: Schema.Types.ObjectId, ref: 'User', required: true, }, subscriptionId: { type: String, required: true, }, customerId: { type: String, required: true, }, priceId: { type: String, required: true, }, status: { type: String, required: true, enum: [ 'active', 'canceled', 'past_due', 'unpaid', 'incomplete', 'incomplete_expired', 'paused', 'trialing', ], }, }, { timestamps: true, toJSON: { virtuals: true, // keep the automatic `id` getter versionKey: false, // drop __v transform(_doc, ret: any) { const { _id, ...rest } = ret; return { ...rest, id: _id.toString(), }; }, }, toObject: { virtuals: true, transform(_doc, ret: any) { const { _id, ...rest } = ret; return { ...rest, id: _id, }; }, }, } );

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/aymericzip/intlayer'

If you have feedback or need assistance with the MCP directory API, please join our Discord server