SPB Git

Repository Public

consts.ts 3.0 KB 57 lines typescript

1/**2 * =============================================================================3 *                  SP BOUCHER | INFRASTRUCTURE & AUTOMATION4 *             ARTIFICIAL INTELLIGENCE • FINANCE • ENGINEERING5 * =============================================================================6 *7 * Project          : MacLustr Social Engine & Remote Navigator8 * File             : apps/social-web/src/consts.ts9 * Module           : social-web10 * Repository       : https://git.spboucher.ai/maclustr-social11 * Project Website  : https://social.spboucher.ai12 * Created          : 2026-12-0113 * Last Modified    : 2026-12-0114 *15 * Author           : Simon-Pierre Boucher16 * Position         : Professor of Finance17 * Institution      : Université du Québec en Outaouais (UQO)18 * Organization     : SP Boucher19 * Website          : https://spboucher.ai20 * Git              : https://git.spboucher.ai21 *22 * Preferred Contact: admin@spboucher.ai23 * Technical Contact: dev@spboucher.ai24 * Security/Admin   : admin@spboucher.ai25 *26 * Copyright (c) 202627 * Simon-Pierre Boucher28 * All rights reserved where applicable. This file is governed by the29 * applicable project license, copyright notices and relevant law.30 * Existing third-party rights and notices remain unaffected.31 *32 * License          : None specified (no license file in this repository)33 *34 * Do not embed credentials, private keys, access tokens,35 * certificates or confidential personal information.36 *37 * =============================================================================38 * END OF SP BOUCHER SOURCE HEADER39 * =============================================================================40 */4142// Constant lists mirrored from @mls/contracts. Only *types* are imported from the contracts package so that43// zod stays out of the browser bundle; `satisfies` makes the compiler fail if a list drifts from the contract.44import type { CONTENT_STATES as CS, JOB_MODES as JM, JOB_STATES as JS, ROLES as RO, Role, SESSION_STATES as SS } from '@mls/contracts';4546type Same<A, B> = [A] extends [B] ? ([B] extends [A] ? true : never) : never;47export const ROLES = ['owner', 'admin', 'approver', 'editor', 'viewer'] as const;48export const ROLE_RANK: Record<Role, number> = { viewer: 1, editor: 2, approver: 3, admin: 4, owner: 5 };49export const CONTENT_STATES = ['DRAFT', 'REVIEW', 'APPROVED'] as const;50export const JOB_STATES = ['QUEUED', 'PREPARING', 'AWAITING_CONFIRMATION', 'SUBMITTED', 'VERIFIED', 'UNKNOWN_OUTCOME', 'FAILED', 'CANCELLED'] as const;51/** Ordered from the least to the most automated. */52export const JOB_MODES = ['manual_assisted', 'prepare_only', 'auto_submit'] as const;53export const SESSION_STATES = ['UNINITIALIZED', 'LOGIN_REQUIRED', 'MANUAL_CONTROL', 'READY', 'BUSY', 'SECURITY_CHALLENGE', 'EXPIRED', 'PAUSED', 'FAILED', 'REVOKED'] as const;5455// Compile-time drift checks (no runtime cost).56export const _drift: [Same<typeof ROLES, typeof RO>, Same<typeof CONTENT_STATES, typeof CS>, Same<typeof JOB_STATES, typeof JS>, Same<typeof JOB_MODES, typeof JM>, Same<typeof SESSION_STATES, typeof SS>] = [true, true, true, true, true];57
Files main
Menu

Theme