Files
zpan/shared/constants.ts
T
Jasper Van 29102e623d feat: v2.6 Z6 — 6h background entitlement refresh (#345)
- Add server/services/licensing-refresh-runner.ts: shared runner with
  5-min dedup guard, structured INFO logs, and no-op for unbound state
- Add workers/scheduled.ts + export scheduled() in workers/bootstrap.ts
  for CF Workers cron (every 6 hours)
- Add [triggers] crons = ["0 */6 * * *"] to wrangler.toml
- Add setInterval refresh on boot in server/entry-node.ts with
  "licensing.refresh.scheduler.started interval=6h" log
- Add POST /api/licensing/refresh-cron?secret=... public endpoint
  (timing-safe secret comparison) for non-CF platforms
- Extract ZPAN_CLOUD_URL_DEFAULT to shared/constants.ts, replacing
  four duplicated literals
- Document REFRESH_CRON_SECRET + scheduler setup in all 5 non-CF
  deploy guides (vercel, netlify, aws-lambda, azure-functions, cloud-run)

Agent-Profile: https://agent-kanban.dev/agents/a6bb038c4226a87f

Co-authored-by: Bob <aibob@mails.agent-kanban.dev>
2026-04-24 08:22:10 -04:00

56 lines
1.3 KiB
TypeScript

export const StorageMode = {
PRIVATE: 'private',
PUBLIC: 'public',
} as const
export type StorageMode = (typeof StorageMode)[keyof typeof StorageMode]
export const UserRole = {
ADMIN: 'admin',
MEMBER: 'member',
} as const
export type UserRole = (typeof UserRole)[keyof typeof UserRole]
export const DirType = {
FILE: 0,
USER_FOLDER: 1,
SYSTEM_FOLDER: 2,
} as const
export type DirType = (typeof DirType)[keyof typeof DirType]
export const StorageStatus = {
ACTIVE: 'active',
INACTIVE: 'inactive',
} as const
export type StorageStatus = (typeof StorageStatus)[keyof typeof StorageStatus]
export const ObjectStatus = {
DRAFT: 'draft',
ACTIVE: 'active',
TRASHED: 'trashed',
} as const
export type ObjectStatus = (typeof ObjectStatus)[keyof typeof ObjectStatus]
export const SignupMode = {
OPEN: 'open',
INVITE_ONLY: 'invite_only',
CLOSED: 'closed',
} as const
export type SignupMode = (typeof SignupMode)[keyof typeof SignupMode]
export const ProFeatures = {
WHITE_LABEL: 'white_label',
OPEN_REGISTRATION: 'open_registration',
TEAMS_UNLIMITED: 'teams_unlimited',
TEAM_QUOTAS: 'team_quotas',
} as const
export type ProFeatures = (typeof ProFeatures)[keyof typeof ProFeatures]
export const ZPAN_CLOUD_URL_DEFAULT = 'https://cloud.zpan.space'