INNER CODE UNIT · TypeScript

cellIdSchema

stablyai/orca · cloud/apps/relay-fence-broker/src/app.ts:47

const cellIdSchema = z.string().regex(/^[a-z][a-z0-9-]{0,127}$/)
const sourceFenceRequestSchema = z
  .object({
    v: z.literal(1),
    operationId: z.string().regex(/^[A-Za-z0-9_-]{8,128}$/),
    fenceCommit: z.string().regex(/^[a-f0-9]{40}$/),
    targetCellIds: z.array(cellIdSchema).min(1).max(16),
    expectedLease: expectedLeaseSchema.optional(),
    confirmation: z.literal('FENCE_SOURCE')
  })
  .strict()
  .refine(
    (value) =>
      new Set(value.targetCellIds).size === value.targetCellIds.length &&
      (!value.expectedLease || value.expectedLease.operationId === value.operationId)
  )

type AppDependencies = {

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…