diff options
Diffstat (limited to 'src/models')
| -rw-r--r-- | src/models/Event.ts | 586 | ||||
| -rwxr-xr-x | src/models/EventGroup.ts | 120 | ||||
| -rwxr-xr-x | src/models/Log.ts | 48 | 
3 files changed, 377 insertions, 377 deletions
diff --git a/src/models/Event.ts b/src/models/Event.ts index 416379a..94be087 100644 --- a/src/models/Event.ts +++ b/src/models/Event.ts @@ -1,333 +1,333 @@  import mongoose from "mongoose";  export interface IAttendee { -  name: string; -  status?: string; -  email?: string; -  removalPassword?: string; -  id?: string; -  number?: number; -  created?: Date; -  _id: string; +    name: string; +    status?: string; +    email?: string; +    removalPassword?: string; +    id?: string; +    number?: number; +    created?: Date; +    _id: string;  }  export interface IReply { -  id: string; -  author: string; -  content: string; -  timestamp: Date; +    id: string; +    author: string; +    content: string; +    timestamp: Date;  }  export interface IComment { -  id: string; -  author: string; -  content: string; -  timestamp: Date; -  activityJson?: string; -  actorJson?: string; -  activityId?: string; -  actorId?: string; -  replies?: IReply[]; +    id: string; +    author: string; +    content: string; +    timestamp: Date; +    activityJson?: string; +    actorJson?: string; +    activityId?: string; +    actorId?: string; +    replies?: IReply[];  }  export interface IFollower { -  followId?: string; -  actorId?: string; -  actorJson?: string; -  name?: string; +    followId?: string; +    actorId?: string; +    actorJson?: string; +    name?: string;  }  export interface IActivityPubMessage { -  id?: string; -  content?: string; +    id?: string; +    content?: string;  }  export interface IEvent extends mongoose.Document { -  id: string; -  type: string; -  name: string; -  location: string; -  start: Date; -  end: Date; -  timezone: string; -  description: string; -  image?: string; -  url?: string; -  creatorEmail?: string; -  hostName?: string; -  viewPassword?: string; -  editPassword?: string; -  editToken?: string; -  eventGroup?: mongoose.Types.ObjectId; -  usersCanAttend?: boolean; -  showUsersList?: boolean; -  usersCanComment?: boolean; -  firstLoad?: boolean; -  attendees?: IAttendee[]; -  maxAttendees?: number; -  comments?: IComment[]; -  activityPubActor?: string; -  activityPubEvent?: string; -  publicKey?: string; -  privateKey?: string; -  followers?: IFollower[]; -  activityPubMessages?: IActivityPubMessage[]; +    id: string; +    type: string; +    name: string; +    location: string; +    start: Date; +    end: Date; +    timezone: string; +    description: string; +    image?: string; +    url?: string; +    creatorEmail?: string; +    hostName?: string; +    viewPassword?: string; +    editPassword?: string; +    editToken?: string; +    eventGroup?: mongoose.Types.ObjectId; +    usersCanAttend?: boolean; +    showUsersList?: boolean; +    usersCanComment?: boolean; +    firstLoad?: boolean; +    attendees?: IAttendee[]; +    maxAttendees?: number; +    comments?: IComment[]; +    activityPubActor?: string; +    activityPubEvent?: string; +    publicKey?: string; +    privateKey?: string; +    followers?: IFollower[]; +    activityPubMessages?: IActivityPubMessage[];  }  const Attendees = new mongoose.Schema({ -  name: { -    type: String, -    trim: true, -  }, -  status: { -    type: String, -    trim: true, -  }, -  email: { -    type: String, -    trim: true, -  }, -  removalPassword: { -    type: String, -    trim: true, -    unique: true, -    sparse: true, -  }, -  id: { -    type: String, -    trim: true, -    unique: true, -    sparse: true, -  }, -  // The number of people that are attending under one 'attendee' object -  number: { -    type: Number, -    trim: true, -    default: 1, -  }, -  created: Date, -}); - -const Followers = new mongoose.Schema( -  { -    // this is the id of the original follow *request*, which we use to validate Undo events -    followId: { -      type: String, -      trim: true, +    name: { +        type: String, +        trim: true,      }, -    // this is the actual remote user profile id -    actorId: { -      type: String, -      trim: true, +    status: { +        type: String, +        trim: true,      }, -    // this is the stringified JSON of the entire user profile -    actorJson: { -      type: String, -      trim: true, +    email: { +        type: String, +        trim: true,      }, -    name: { -      type: String, -      trim: true, +    removalPassword: { +        type: String, +        trim: true, +        unique: true, +        sparse: true,      }, -  }, -  { _id: false } +    id: { +        type: String, +        trim: true, +        unique: true, +        sparse: true, +    }, +    // The number of people that are attending under one 'attendee' object +    number: { +        type: Number, +        trim: true, +        default: 1, +    }, +    created: Date, +}); + +const Followers = new mongoose.Schema( +    { +        // this is the id of the original follow *request*, which we use to validate Undo events +        followId: { +            type: String, +            trim: true, +        }, +        // this is the actual remote user profile id +        actorId: { +            type: String, +            trim: true, +        }, +        // this is the stringified JSON of the entire user profile +        actorJson: { +            type: String, +            trim: true, +        }, +        name: { +            type: String, +            trim: true, +        }, +    }, +    { _id: false },  );  const ReplySchema = new mongoose.Schema({ -  id: { -    type: String, -    required: true, -    unique: true, -    sparse: true, -  }, -  author: { -    type: String, -    trim: true, -    required: true, -  }, -  content: { -    type: String, -    trim: true, -    required: true, -  }, -  timestamp: { -    type: Date, -    trim: true, -    required: true, -  }, +    id: { +        type: String, +        required: true, +        unique: true, +        sparse: true, +    }, +    author: { +        type: String, +        trim: true, +        required: true, +    }, +    content: { +        type: String, +        trim: true, +        required: true, +    }, +    timestamp: { +        type: Date, +        trim: true, +        required: true, +    },  });  const ActivityPubMessages = new mongoose.Schema({ -  id: { -    type: String, -    required: true, -    unique: true, -    sparse: true, -  }, -  content: { -    type: String, -    trim: true, -    required: true, -  }, +    id: { +        type: String, +        required: true, +        unique: true, +        sparse: true, +    }, +    content: { +        type: String, +        trim: true, +        required: true, +    },  });  const CommentSchema = new mongoose.Schema({ -  id: { -    type: String, -    required: true, -    unique: true, -    sparse: true, -  }, -  author: { -    type: String, -    trim: true, -    required: true, -  }, -  content: { -    type: String, -    trim: true, -    required: true, -  }, -  timestamp: { -    type: Date, -    trim: true, -    required: true, -  }, -  activityJson: { -    type: String, -    trim: true, -  }, -  actorJson: { -    type: String, -    trim: true, -  }, -  activityId: { -    type: String, -    trim: true, -  }, -  actorId: { -    type: String, -    trim: true, -  }, -  replies: [ReplySchema], +    id: { +        type: String, +        required: true, +        unique: true, +        sparse: true, +    }, +    author: { +        type: String, +        trim: true, +        required: true, +    }, +    content: { +        type: String, +        trim: true, +        required: true, +    }, +    timestamp: { +        type: Date, +        trim: true, +        required: true, +    }, +    activityJson: { +        type: String, +        trim: true, +    }, +    actorJson: { +        type: String, +        trim: true, +    }, +    activityId: { +        type: String, +        trim: true, +    }, +    actorId: { +        type: String, +        trim: true, +    }, +    replies: [ReplySchema],  });  const EventSchema = new mongoose.Schema({ -  id: { -    type: String, -    required: true, -    unique: true, -  }, -  type: { -    type: String, -    trim: true, -    required: true, -  }, -  name: { -    type: String, -    trim: true, -    required: true, -  }, -  location: { -    type: String, -    trim: true, -    required: true, -  }, -  start: { -    // Stored as a UTC timestamp -    type: Date, -    trim: true, -    required: true, -  }, -  end: { -    // Stored as a UTC timestamp -    type: Date, -    trim: true, -    required: true, -  }, -  timezone: { -    type: String, -    default: "Etc/UTC", -  }, -  description: { -    type: String, -    trim: true, -    required: true, -  }, -  image: { -    type: String, -    trim: true, -  }, -  url: { -    type: String, -    trim: true, -  }, -  creatorEmail: { -    type: String, -    trim: true, -  }, -  hostName: { -    type: String, -    trim: true, -  }, -  viewPassword: { -    type: String, -    trim: true, -  }, -  editPassword: { -    type: String, -    trim: true, -  }, -  editToken: { -    type: String, -    trim: true, -    minlength: 32, -    maxlength: 32, -  }, -  eventGroup: { type: mongoose.Schema.Types.ObjectId, ref: "EventGroup" }, -  usersCanAttend: { -    type: Boolean, -    trim: true, -    default: false, -  }, -  showUsersList: { -    type: Boolean, -    trim: true, -    default: false, -  }, -  usersCanComment: { -    type: Boolean, -    trim: true, -    default: false, -  }, -  firstLoad: { -    type: Boolean, -    trim: true, -    default: true, -  }, -  attendees: [Attendees], -  maxAttendees: { -    type: Number, -  }, -  comments: [CommentSchema], -  activityPubActor: { -    type: String, -    trim: true, -  }, -  activityPubEvent: { -    type: String, -    trim: true, -  }, -  publicKey: { -    type: String, -    trim: true, -  }, -  privateKey: { -    type: String, -    trim: true, -  }, -  followers: [Followers], -  activityPubMessages: [ActivityPubMessages], +    id: { +        type: String, +        required: true, +        unique: true, +    }, +    type: { +        type: String, +        trim: true, +        required: true, +    }, +    name: { +        type: String, +        trim: true, +        required: true, +    }, +    location: { +        type: String, +        trim: true, +        required: true, +    }, +    start: { +        // Stored as a UTC timestamp +        type: Date, +        trim: true, +        required: true, +    }, +    end: { +        // Stored as a UTC timestamp +        type: Date, +        trim: true, +        required: true, +    }, +    timezone: { +        type: String, +        default: "Etc/UTC", +    }, +    description: { +        type: String, +        trim: true, +        required: true, +    }, +    image: { +        type: String, +        trim: true, +    }, +    url: { +        type: String, +        trim: true, +    }, +    creatorEmail: { +        type: String, +        trim: true, +    }, +    hostName: { +        type: String, +        trim: true, +    }, +    viewPassword: { +        type: String, +        trim: true, +    }, +    editPassword: { +        type: String, +        trim: true, +    }, +    editToken: { +        type: String, +        trim: true, +        minlength: 32, +        maxlength: 32, +    }, +    eventGroup: { type: mongoose.Schema.Types.ObjectId, ref: "EventGroup" }, +    usersCanAttend: { +        type: Boolean, +        trim: true, +        default: false, +    }, +    showUsersList: { +        type: Boolean, +        trim: true, +        default: false, +    }, +    usersCanComment: { +        type: Boolean, +        trim: true, +        default: false, +    }, +    firstLoad: { +        type: Boolean, +        trim: true, +        default: true, +    }, +    attendees: [Attendees], +    maxAttendees: { +        type: Number, +    }, +    comments: [CommentSchema], +    activityPubActor: { +        type: String, +        trim: true, +    }, +    activityPubEvent: { +        type: String, +        trim: true, +    }, +    publicKey: { +        type: String, +        trim: true, +    }, +    privateKey: { +        type: String, +        trim: true, +    }, +    followers: [Followers], +    activityPubMessages: [ActivityPubMessages],  });  export default mongoose.model<IEvent>("Event", EventSchema); diff --git a/src/models/EventGroup.ts b/src/models/EventGroup.ts index f097843..2b5c2aa 100755 --- a/src/models/EventGroup.ts +++ b/src/models/EventGroup.ts @@ -1,75 +1,75 @@  import mongoose from "mongoose";  export interface ISubscriber { -  email?: string; +    email?: string;  }  export interface IEventGroup extends mongoose.Document { -  id: string; -  name: string; -  description: string; -  image?: string; -  url?: string; -  creatorEmail?: string; -  hostName?: string; -  editToken?: string; -  firstLoad?: boolean; -  events?: mongoose.Types.ObjectId[]; -  subscribers?: ISubscriber[]; +    id: string; +    name: string; +    description: string; +    image?: string; +    url?: string; +    creatorEmail?: string; +    hostName?: string; +    editToken?: string; +    firstLoad?: boolean; +    events?: mongoose.Types.ObjectId[]; +    subscribers?: ISubscriber[];  }  const Subscriber = new mongoose.Schema({ -  email: { -    type: String, -    trim: true, -  }, +    email: { +        type: String, +        trim: true, +    },  });  const EventGroupSchema = new mongoose.Schema({ -  id: { -    type: String, -    required: true, -    unique: true, -  }, -  name: { -    type: String, -    trim: true, -    required: true, -  }, -  description: { -    type: String, -    trim: true, -    required: true, -  }, -  image: { -    type: String, -    trim: true, -  }, -  url: { -    type: String, -    trim: true, -  }, -  creatorEmail: { -    type: String, -    trim: true, -  }, -  hostName: { -    type: String, -    trim: true, -  }, -  editToken: { -    type: String, -    trim: true, -    minlength: 32, -    maxlength: 32, -  }, -  firstLoad: { -    type: Boolean, -    trim: true, -    default: true, -  }, -  events: [{ type: mongoose.Schema.Types.ObjectId, ref: "Event" }], -  subscribers: [Subscriber], +    id: { +        type: String, +        required: true, +        unique: true, +    }, +    name: { +        type: String, +        trim: true, +        required: true, +    }, +    description: { +        type: String, +        trim: true, +        required: true, +    }, +    image: { +        type: String, +        trim: true, +    }, +    url: { +        type: String, +        trim: true, +    }, +    creatorEmail: { +        type: String, +        trim: true, +    }, +    hostName: { +        type: String, +        trim: true, +    }, +    editToken: { +        type: String, +        trim: true, +        minlength: 32, +        maxlength: 32, +    }, +    firstLoad: { +        type: Boolean, +        trim: true, +        default: true, +    }, +    events: [{ type: mongoose.Schema.Types.ObjectId, ref: "Event" }], +    subscribers: [Subscriber],  });  export default mongoose.model<IEventGroup>("EventGroup", EventGroupSchema); diff --git a/src/models/Log.ts b/src/models/Log.ts index 8f905fd..24991d4 100755 --- a/src/models/Log.ts +++ b/src/models/Log.ts @@ -1,33 +1,33 @@  import mongoose from "mongoose";  export interface ILog extends mongoose.Document { -  status: string; -  process: string; -  message: string; -  timestamp: Date; +    status: string; +    process: string; +    message: string; +    timestamp: Date;  }  const LogSchema = new mongoose.Schema({ -  status: { -    type: String, -    trim: true, -    required: true, -  }, -  process: { -    type: String, -    trim: true, -    required: true, -  }, -  message: { -    type: String, -    trim: true, -    required: true, -  }, -  timestamp: { -    type: Date, -    trim: true, -    required: true, -  }, +    status: { +        type: String, +        trim: true, +        required: true, +    }, +    process: { +        type: String, +        trim: true, +        required: true, +    }, +    message: { +        type: String, +        trim: true, +        required: true, +    }, +    timestamp: { +        type: Date, +        trim: true, +        required: true, +    },  });  export default mongoose.model<ILog>("Log", LogSchema);  | 
