@aptly-as/types
Version:
Aptly types and enums
132 lines (131 loc) • 4.69 kB
TypeScript
import { AptlyEmailType, AptlyProjectStatus } from '../enums/index.js';
import { AptlyAddress } from './address.js';
import { AptlyAlgorithm, AptlyAlgorithmPipeline, AptlyAlgorithmPipelineSchema, AptlyAlgorithmSchema } from './algorithm.js';
import { AptlyAppSchema } from './app.js';
import { AptlyOrganizationSchema } from './organization.js';
import { AptlyModules } from '../core/index.js';
import { AptlyPageSchema } from './page.js';
import { AptlyPeriod, AptlyPeriodSchema } from './period.js';
import { AptlyUserSchema } from './user.js';
import { AptlyBaseSchema, AptlyHistorySchema } from './extends.js';
import { AptlyDocumentSchema } from './document.js';
import { AptlyUnitOptionExtraItemSchema } from './unit.js';
import { AptlyMediaSrc } from './media.js';
export type AptlyProjectContent = AptlyProjectContentSchema<string, string>;
export type AptlyProjectContentSchema<ID, DATE> = Pick<AptlyProjectSchema<ID, DATE>, '_id' | 'name' | 'theme'>;
export type AptlyProject = AptlyProjectSchema<string, string>;
export interface AptlyProjectSchema<ID, DATE> extends AptlyBaseSchema<ID, DATE>, AptlyHistorySchema<ID, DATE> {
organization: AptlyOrganizationSchema<ID, DATE> | ID;
template?: ID | null;
customers: ID[];
periods: AptlyPeriodSchema<ID, DATE>[];
algorithms: AptlyAlgorithmSchema<ID>[];
documents: AptlyDocumentSchema<ID, DATE>[];
pages: (ID | AptlyPageSchema<ID, DATE>)[];
myPageText?: string;
inviteText?: string;
notify: AptlyProjectNotifySchema<ID, DATE>[];
theme: AptlyProjectTheme;
integrations: AptlyProjectIntegrationSchema<ID>[];
disabledModules?: AptlyModules[];
extraOptions?: AptlyUnitOptionExtraItemSchema<ID, DATE>[];
gdprActive?: boolean;
userFavorites?: ID[];
status?: AptlyProjectStatus;
number?: string;
developer?: string;
field?: string;
address?: AptlyAddress;
invoiceEmail?: string;
paymentApp?: ID | AptlyAppSchema<ID, DATE> | null;
invites?: AptlyProjectInviteSchema<ID, DATE>[];
signApp?: ID | AptlyAppSchema<ID, DATE> | null;
signMembers?: (ID | AptlyUserSchema<ID, DATE>)[];
created: DATE;
}
export type AptlyProjectPeriod = AptlyPeriod;
export type AptlyProjectPeriodSchema<ID, DATE> = AptlyPeriodSchema<ID, DATE>;
export type AptlyProjectAlgorithm = AptlyAlgorithm;
export type AptlyProjectAlgorithmSchema<ID> = AptlyAlgorithmSchema<ID>;
export type AptlyProjectAlgorithmPipeline = AptlyAlgorithmPipeline;
export type AptlyProjectAlgorithmPipelineSchema<ID> = AptlyAlgorithmPipelineSchema<ID>;
export interface AptlyProjectTheme {
palette?: {
type?: 'dark' | 'light';
primary?: AptlyProjectThemePalette;
secondary?: AptlyProjectThemePalette;
error?: AptlyProjectThemePalette;
font?: string;
background?: string;
confirm?: string;
green?: string;
yellow?: string;
red?: string;
cardBackground?: string;
cardContrast?: string;
border?: string;
};
fonts?: {
primary?: string;
secondary?: string;
tertiary?: string;
links?: [string];
};
images: {
logo?: string | null;
logoMedia?: AptlyMediaSrc | null;
largeLogo?: string | null;
hero?: string | null;
heroMedia?: AptlyMediaSrc | null;
fallback?: string | null;
fallbackMedia?: AptlyMediaSrc | null;
};
contact: {
name?: string;
phone?: string;
mail?: string;
complaintEmail?: string;
};
}
export interface AptlyProjectThemePalette {
dark?: string;
main?: string;
mainContrast?: string;
light?: string;
disabled?: string;
lightContrast?: string;
}
export type AptlyProjectIntegration = AptlyProjectIntegrationSchema<string>;
export interface AptlyProjectIntegrationSchema<ID> {
_id: ID;
integration: ID;
integrationName: string;
project: string;
failures: {
_id: string;
error: string;
name: string;
}[];
}
export type AptlyProjectNotify = AptlyProjectNotifySchema<string, string>;
export interface AptlyProjectNotifySchema<ID, DATE> {
_id: ID;
user: AptlyUserSchema<ID, DATE> | ID;
types?: AptlyEmailType[];
inquiry: boolean;
booking: boolean;
complaint: boolean;
order?: boolean;
'order-created'?: boolean;
'order-signed'?: boolean;
'order-fileReceived'?: boolean;
'unit-note-reminder'?: boolean;
}
export type AptlyProjectInvite = AptlyProjectInviteSchema<string, string>;
export interface AptlyProjectInviteSchema<ID, DATE> {
_id: ID;
unit: ID;
code: string;
createdAt: DATE;
createdBy: ID;
}