mirror of
https://github.com/wekan/wekan.git
synced 2026-11-24 09:59:47 -05:00
openapi/generate_openapi.py's header and the models' JSDoc said "Wekan REST API", "extend Wekan", "a production Wekan server" and "in the Wekan board", so every release's API pages on wekan.fi failed its brand-spelling check (v12.95-v12.97 did). The generator, the model comments and public/api/wekan.yml now say WeKan, and tests/openapiBrandSpelling.test.cjs checks the generated file, the generator header and every model JSDoc block. Thanks to xet7 !
104 lines
2.3 KiB
JavaScript
104 lines
2.3 KiB
JavaScript
import { Mongo } from 'meteor/mongo';
|
|
import { ReactiveCache } from '/imports/reactiveCache';
|
|
const { SimpleSchema } = require('/imports/simpleSchema');
|
|
|
|
const Team = new Mongo.Collection('team');
|
|
|
|
/**
|
|
* A Team in WeKan. Organization in Trello.
|
|
*/
|
|
Team.attachSchema(
|
|
new SimpleSchema({
|
|
teamDisplayName: {
|
|
/**
|
|
* the name to display for the team
|
|
*/
|
|
type: String,
|
|
optional: true,
|
|
},
|
|
teamDesc: {
|
|
/**
|
|
* the description the team
|
|
*/
|
|
type: String,
|
|
optional: true,
|
|
max: 190,
|
|
},
|
|
teamShortName: {
|
|
/**
|
|
* short name of the team
|
|
*/
|
|
type: String,
|
|
optional: true,
|
|
max: 255,
|
|
},
|
|
teamWebsite: {
|
|
/**
|
|
* website of the team
|
|
*/
|
|
type: String,
|
|
optional: true,
|
|
max: 255,
|
|
},
|
|
teamIsActive: {
|
|
/**
|
|
* status of the team
|
|
*/
|
|
type: Boolean,
|
|
optional: true,
|
|
},
|
|
teamSharedTemplates: {
|
|
/**
|
|
* #5850: members may drag personal Template Boards onto this team to share
|
|
* (per-team form of "Shared Templates for Teams"). Off by default.
|
|
*/
|
|
type: Boolean,
|
|
optional: true,
|
|
},
|
|
teamPropagateMembersToBoards: {
|
|
/**
|
|
* #4737: add this team's members to the boards that list this team. Off by default.
|
|
*/
|
|
type: Boolean,
|
|
optional: true,
|
|
},
|
|
teamSyncMembersFromAuth: {
|
|
/**
|
|
* #4737: this team's membership is maintained by the authentication
|
|
* provider's group/membership sync (LDAP, OAuth2/OIDC, SAML, etc.). Off by default.
|
|
*/
|
|
type: Boolean,
|
|
optional: true,
|
|
},
|
|
createdAt: {
|
|
/**
|
|
* creation date of the team
|
|
*/
|
|
type: Date,
|
|
// eslint-disable-next-line consistent-return
|
|
autoValue() {
|
|
if (this.isInsert) {
|
|
return new Date();
|
|
} else if (this.isUpsert) {
|
|
return { $setOnInsert: new Date() };
|
|
} else {
|
|
this.unset();
|
|
}
|
|
},
|
|
},
|
|
modifiedAt: {
|
|
type: Date,
|
|
// eslint-disable-next-line consistent-return
|
|
autoValue() {
|
|
if (this.isInsert || this.isUpsert || this.isUpdate) {
|
|
return new Date();
|
|
} else {
|
|
this.unset();
|
|
}
|
|
},
|
|
},
|
|
}),
|
|
);
|
|
|
|
export default Team;
|