mirror of
https://github.com/outline/outline.git
synced 2026-06-13 11:25:03 +03:00
5610df5a26
* chore: Reduce no-explicit-any warnings in server directory Tightens types across test response bodies, decorator signatures, the TestServer wrapper, base class generics, and presenter Record types. Where any is genuinely load-bearing (Sequelize model generics, PropertyDescriptor decorator returns, plugin-registered template classes, Fix mixin), keeps any with a targeted eslint-disable plus reason rather than masking the constraint. Cuts server-only no-explicit-any warnings from 162 to 70. * fix: groups test asserts on first response instead of second Caught by Copilot review on the no-explicit-any cleanup. Also fixes the pre-existing getChangsetSkipped → getChangesetSkipped typo surfaced while reviewing nearby decorator code.
26 lines
784 B
TypeScript
26 lines
784 B
TypeScript
import { AllowNull, Column, IsDate } from "sequelize-typescript";
|
|
import ParanoidModel from "./ParanoidModel";
|
|
|
|
class ArchivableModel<
|
|
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- mirrors Model base; tightening to object resolves Attributes<M> to never inside Sequelize helpers.
|
|
TModelAttributes extends object = any,
|
|
TCreationAttributes extends object = TModelAttributes,
|
|
> extends ParanoidModel<TModelAttributes, TCreationAttributes> {
|
|
/** Whether the document is archived, and if so when. */
|
|
@AllowNull
|
|
@IsDate
|
|
@Column
|
|
archivedAt: Date | null;
|
|
|
|
/**
|
|
* Whether the model has been archived.
|
|
*
|
|
* @returns True if the model has been archived
|
|
*/
|
|
get isArchived() {
|
|
return !!this.archivedAt;
|
|
}
|
|
}
|
|
|
|
export default ArchivableModel;
|