mirror of
https://github.com/stablyai/orca.git
synced 2026-11-16 10:58:10 +00:00
* refactor(cloud): share PostgreSQL schema startup between services * feat(cloud): add durable native push notification gateway * infra(push): define dedicated gateway resources and operational checks * fix(push): bound cross-host admission and simplify gateway configuration * fix(push): validate deploy configuration and preserve topic-error registrations
42 lines
1.3 KiB
TypeScript
42 lines
1.3 KiB
TypeScript
import { z } from 'zod'
|
|
import {
|
|
Base6432ByteSchema,
|
|
Base64Raw24ByteSchema,
|
|
Base64Url32ByteSchema,
|
|
BoundedCiphertextSchema,
|
|
EpochMsSchema,
|
|
OpaqueIdSchema,
|
|
PushHostFingerprintSchema
|
|
} from './wire-scalars.js'
|
|
|
|
export const PushHostChallengeRequestSchema = z
|
|
.object({ v: z.literal(1), hostPublicKeyB64: Base6432ByteSchema })
|
|
.strict()
|
|
|
|
export const PushHostChallengeResponseSchema = z
|
|
.object({
|
|
challengeId: OpaqueIdSchema,
|
|
gatewayEphemeralPublicKeyB64: Base6432ByteSchema,
|
|
nonceB64: Base64Raw24ByteSchema,
|
|
ciphertextB64: BoundedCiphertextSchema,
|
|
expiresAt: EpochMsSchema
|
|
})
|
|
.strict()
|
|
|
|
export const PushHostSessionRequestSchema = z
|
|
.object({ v: z.literal(1), challengeId: OpaqueIdSchema, proofB64: Base6432ByteSchema })
|
|
.strict()
|
|
|
|
export const PushHostSessionResponseSchema = z
|
|
.object({
|
|
sessionToken: Base64Url32ByteSchema,
|
|
expiresAt: EpochMsSchema,
|
|
hostFingerprint: PushHostFingerprintSchema
|
|
})
|
|
.strict()
|
|
|
|
export type PushHostChallengeRequest = z.infer<typeof PushHostChallengeRequestSchema>
|
|
export type PushHostChallengeResponse = z.infer<typeof PushHostChallengeResponseSchema>
|
|
export type PushHostSessionRequest = z.infer<typeof PushHostSessionRequestSchema>
|
|
export type PushHostSessionResponse = z.infer<typeof PushHostSessionResponseSchema>
|