import { faker } from '@faker-js/faker';
import { InvitationKind } from '../../models/kinds.js';
import { nanoid } from '../../nanoid.js';
export class Invitation {
    /**
     * Generates a random invitation object.
     * @param init Optional values to be present in the object.
     * @returns Random invitation
     */
    invitation(init = {}) {
        const { key = nanoid(), uid = nanoid(), oid = nanoid(), name = faker.person.fullName(), email = faker.internet.email(), createdAt = faker.date.past().getTime(), updatedAt = faker.date.recent().getTime(), token = nanoid(32), expiresAt = faker.date.future().getTime(), status = 'pending', grantType = faker.helpers.arrayElement(['owner', 'manager', 'editor', 'viewer']), resent = 0, lastSentAt = createdAt, } = init;
        return {
            kind: InvitationKind,
            key,
            uid,
            oid,
            name,
            email,
            createdAt,
            updatedAt,
            token,
            expiresAt,
            status,
            grantType,
            resent,
            lastSentAt,
        };
    }
    /**
     * Generates a list of random invitation objects.
     * @param size Number of invitations to generate. Default is 25.
     * @returns List of random invitations
     */
    invitations(size = 25) {
        const result = [];
        for (let i = 0; i < size; i++) {
            result.push(this.invitation());
        }
        return result;
    }
}
//# sourceMappingURL=Invitation.js.map