UNPKG

@signalapp/mock-server

Version:
527 lines (526 loc) 15.6 kB
/// <reference types="node" /> import z from 'zod'; import { AciString, DeviceId, PniString, RegistrationId } from '../types'; export declare const PositiveInt: z.ZodNumber; export declare const AciSchema: z.ZodEffects<z.ZodString, AciString, string>; export declare const PniSchema: z.ZodEffects<z.ZodEffects<z.ZodString, string, string>, PniString, string>; export declare const ServiceIdSchema: z.ZodEffects<z.ZodString, AciString | PniString, string>; export declare const RegistrationIdSchema: z.ZodEffects<z.ZodNumber, RegistrationId, number>; export declare const DeviceIdSchema: z.ZodEffects<z.ZodNumber, DeviceId, number>; declare const PreKeySchema: z.ZodObject<{ keyId: z.ZodNumber; publicKey: z.ZodString; }, "strip", z.ZodTypeAny, { keyId: number; publicKey: string; }, { keyId: number; publicKey: string; }>; export type ServerPreKey = z.infer<typeof PreKeySchema>; declare const SignedPreKeySchema: z.ZodObject<{ keyId: z.ZodNumber; publicKey: z.ZodString; signature: z.ZodString; }, "strip", z.ZodTypeAny, { keyId: number; publicKey: string; signature: string; }, { keyId: number; publicKey: string; signature: string; }>; export type ServerSignedPreKey = z.infer<typeof SignedPreKeySchema>; export declare const DeviceKeysSchema: z.ZodObject<{ preKeys: z.ZodArray<z.ZodObject<{ keyId: z.ZodNumber; publicKey: z.ZodString; }, "strip", z.ZodTypeAny, { keyId: number; publicKey: string; }, { keyId: number; publicKey: string; }>, "many">; pqPreKeys: z.ZodOptional<z.ZodArray<z.ZodObject<{ keyId: z.ZodNumber; publicKey: z.ZodString; signature: z.ZodString; }, "strip", z.ZodTypeAny, { keyId: number; publicKey: string; signature: string; }, { keyId: number; publicKey: string; signature: string; }>, "many">>; pqLastResortPreKey: z.ZodOptional<z.ZodObject<{ keyId: z.ZodNumber; publicKey: z.ZodString; signature: z.ZodString; }, "strip", z.ZodTypeAny, { keyId: number; publicKey: string; signature: string; }, { keyId: number; publicKey: string; signature: string; }>>; signedPreKey: z.ZodOptional<z.ZodObject<{ keyId: z.ZodNumber; publicKey: z.ZodString; signature: z.ZodString; }, "strip", z.ZodTypeAny, { keyId: number; publicKey: string; signature: string; }, { keyId: number; publicKey: string; signature: string; }>>; }, "strip", z.ZodTypeAny, { preKeys: { keyId: number; publicKey: string; }[]; pqPreKeys?: { keyId: number; publicKey: string; signature: string; }[] | undefined; pqLastResortPreKey?: { keyId: number; publicKey: string; signature: string; } | undefined; signedPreKey?: { keyId: number; publicKey: string; signature: string; } | undefined; }, { preKeys: { keyId: number; publicKey: string; }[]; pqPreKeys?: { keyId: number; publicKey: string; signature: string; }[] | undefined; pqLastResortPreKey?: { keyId: number; publicKey: string; signature: string; } | undefined; signedPreKey?: { keyId: number; publicKey: string; signature: string; } | undefined; }>; export type DeviceKeys = z.infer<typeof DeviceKeysSchema>; export declare const MessageSchema: z.ZodObject<{ type: z.ZodNumber; destinationDeviceId: z.ZodEffects<z.ZodNumber, DeviceId, number>; destinationRegistrationId: z.ZodEffects<z.ZodNumber, RegistrationId, number>; content: z.ZodString; }, "strip", z.ZodTypeAny, { type: number; destinationDeviceId: number & { __device_id: never; }; destinationRegistrationId: number & { __reg_id: never; }; content: string; }, { type: number; destinationDeviceId: number; destinationRegistrationId: number; content: string; }>; export type Message = z.infer<typeof MessageSchema>; export declare const MessageListSchema: z.ZodObject<{ messages: z.ZodArray<z.ZodObject<{ type: z.ZodNumber; destinationDeviceId: z.ZodEffects<z.ZodNumber, DeviceId, number>; destinationRegistrationId: z.ZodEffects<z.ZodNumber, RegistrationId, number>; content: z.ZodString; }, "strip", z.ZodTypeAny, { type: number; destinationDeviceId: number & { __device_id: never; }; destinationRegistrationId: number & { __reg_id: never; }; content: string; }, { type: number; destinationDeviceId: number; destinationRegistrationId: number; content: string; }>, "many">; timestamp: z.ZodNumber; }, "strip", z.ZodTypeAny, { messages: { type: number; destinationDeviceId: number & { __device_id: never; }; destinationRegistrationId: number & { __reg_id: never; }; content: string; }[]; timestamp: number; }, { messages: { type: number; destinationDeviceId: number; destinationRegistrationId: number; content: string; }[]; timestamp: number; }>; export type MessageList = z.infer<typeof MessageListSchema>; export declare const AtomicLinkingDataSchema: z.ZodObject<{ verificationCode: z.ZodString; accountAttributes: z.ZodObject<{ fetchesMessages: z.ZodBoolean; registrationId: z.ZodEffects<z.ZodNumber, RegistrationId, number>; pniRegistrationId: z.ZodEffects<z.ZodNumber, RegistrationId, number>; name: z.ZodString; }, "strip", z.ZodTypeAny, { registrationId: number & { __reg_id: never; }; pniRegistrationId: number & { __reg_id: never; }; fetchesMessages: boolean; name: string; }, { registrationId: number; pniRegistrationId: number; fetchesMessages: boolean; name: string; }>; aciSignedPreKey: z.ZodObject<{ keyId: z.ZodNumber; publicKey: z.ZodString; signature: z.ZodString; }, "strip", z.ZodTypeAny, { keyId: number; publicKey: string; signature: string; }, { keyId: number; publicKey: string; signature: string; }>; pniSignedPreKey: z.ZodObject<{ keyId: z.ZodNumber; publicKey: z.ZodString; signature: z.ZodString; }, "strip", z.ZodTypeAny, { keyId: number; publicKey: string; signature: string; }, { keyId: number; publicKey: string; signature: string; }>; aciPqLastResortPreKey: z.ZodObject<{ keyId: z.ZodNumber; publicKey: z.ZodString; signature: z.ZodString; }, "strip", z.ZodTypeAny, { keyId: number; publicKey: string; signature: string; }, { keyId: number; publicKey: string; signature: string; }>; pniPqLastResortPreKey: z.ZodObject<{ keyId: z.ZodNumber; publicKey: z.ZodString; signature: z.ZodString; }, "strip", z.ZodTypeAny, { keyId: number; publicKey: string; signature: string; }, { keyId: number; publicKey: string; signature: string; }>; }, "strip", z.ZodTypeAny, { verificationCode: string; accountAttributes: { registrationId: number & { __reg_id: never; }; pniRegistrationId: number & { __reg_id: never; }; fetchesMessages: boolean; name: string; }; aciSignedPreKey: { keyId: number; publicKey: string; signature: string; }; pniSignedPreKey: { keyId: number; publicKey: string; signature: string; }; aciPqLastResortPreKey: { keyId: number; publicKey: string; signature: string; }; pniPqLastResortPreKey: { keyId: number; publicKey: string; signature: string; }; }, { verificationCode: string; accountAttributes: { registrationId: number; pniRegistrationId: number; fetchesMessages: boolean; name: string; }; aciSignedPreKey: { keyId: number; publicKey: string; signature: string; }; pniSignedPreKey: { keyId: number; publicKey: string; signature: string; }; aciPqLastResortPreKey: { keyId: number; publicKey: string; signature: string; }; pniPqLastResortPreKey: { keyId: number; publicKey: string; signature: string; }; }>; export declare const GroupStateSchema: z.ZodObject<{ publicKey: z.ZodType<Uint8Array, z.ZodTypeDef, Uint8Array>; version: z.ZodLiteral<0>; accessControl: z.ZodObject<{ attributes: z.ZodNumber; members: z.ZodNumber; addFromInviteLink: z.ZodNumber; }, "strip", z.ZodTypeAny, { attributes: number; members: number; addFromInviteLink: number; }, { attributes: number; members: number; addFromInviteLink: number; }>; members: z.ZodArray<z.ZodUnknown, "many">; }, "strip", z.ZodTypeAny, { publicKey: Uint8Array; version: 0; accessControl: { attributes: number; members: number; addFromInviteLink: number; }; members: unknown[]; }, { publicKey: Uint8Array; version: 0; accessControl: { attributes: number; members: number; addFromInviteLink: number; }; members: unknown[]; }>; export declare const UsernameReservationSchema: z.ZodObject<{ usernameHashes: z.ZodArray<z.ZodEffects<z.ZodString, Buffer, string>, "many">; }, "strip", z.ZodTypeAny, { usernameHashes: Buffer[]; }, { usernameHashes: string[]; }>; export type UsernameReservation = z.infer<typeof UsernameReservationSchema>; export declare const UsernameConfirmationSchema: z.ZodObject<{ usernameHash: z.ZodEffects<z.ZodString, Buffer, string>; zkProof: z.ZodEffects<z.ZodString, Buffer, string>; encryptedUsername: z.ZodOptional<z.ZodEffects<z.ZodString, Buffer, string>>; }, "strip", z.ZodTypeAny, { usernameHash: Buffer; zkProof: Buffer; encryptedUsername?: Buffer | undefined; }, { usernameHash: string; zkProof: string; encryptedUsername?: string | undefined; }>; export type UsernameConfirmation = z.infer<typeof UsernameConfirmationSchema>; export declare const PutUsernameLinkSchema: z.ZodObject<{ usernameLinkEncryptedValue: z.ZodEffects<z.ZodString, Buffer, string>; }, "strip", z.ZodTypeAny, { usernameLinkEncryptedValue: Buffer; }, { usernameLinkEncryptedValue: string; }>; export type PutUsernameLink = z.infer<typeof PutUsernameLinkSchema>; export declare const CreateCallLinkAuthSchema: z.ZodObject<{ createCallLinkCredentialRequest: z.ZodEffects<z.ZodString, Buffer, string>; }, "strip", z.ZodTypeAny, { createCallLinkCredentialRequest: Buffer; }, { createCallLinkCredentialRequest: string; }>; export type CreateCallLinkAuth = z.infer<typeof CreateCallLinkAuthSchema>; export declare const CreateCallLinkSchema: z.ZodObject<{ adminPasskey: z.ZodEffects<z.ZodString, Buffer, string>; zkparams: z.ZodEffects<z.ZodString, Buffer, string>; }, "strip", z.ZodTypeAny, { adminPasskey: Buffer; zkparams: Buffer; }, { adminPasskey: string; zkparams: string; }>; export type CreateCallLink = z.infer<typeof CreateCallLinkSchema>; export declare const UpdateCallLinkSchema: z.ZodObject<{ adminPasskey: z.ZodEffects<z.ZodString, Buffer, string>; name: z.ZodOptional<z.ZodString>; restrictions: z.ZodOptional<z.ZodEnum<["none", "adminApproval"]>>; revoked: z.ZodOptional<z.ZodBoolean>; }, "strip", z.ZodTypeAny, { adminPasskey: Buffer; name?: string | undefined; restrictions?: "none" | "adminApproval" | undefined; revoked?: boolean | undefined; }, { adminPasskey: string; name?: string | undefined; restrictions?: "none" | "adminApproval" | undefined; revoked?: boolean | undefined; }>; export type UpdateCallLink = z.infer<typeof UpdateCallLinkSchema>; export declare const DeleteCallLinkSchema: z.ZodObject<{ adminPasskey: z.ZodEffects<z.ZodString, Buffer, string>; }, "strip", z.ZodTypeAny, { adminPasskey: Buffer; }, { adminPasskey: string; }>; export type DeleteCallLink = z.infer<typeof DeleteCallLinkSchema>; export declare const SetBackupIdSchema: z.ZodObject<{ messagesBackupAuthCredentialRequest: z.ZodEffects<z.ZodString, Buffer, string>; mediaBackupAuthCredentialRequest: z.ZodEffects<z.ZodString, Buffer, string>; }, "strip", z.ZodTypeAny, { messagesBackupAuthCredentialRequest: Buffer; mediaBackupAuthCredentialRequest: Buffer; }, { messagesBackupAuthCredentialRequest: string; mediaBackupAuthCredentialRequest: string; }>; export type SetBackupId = z.infer<typeof SetBackupIdSchema>; export declare const BackupHeadersSchema: z.ZodObject<{ 'x-signal-zk-auth': z.ZodEffects<z.ZodString, Buffer, string>; 'x-signal-zk-auth-signature': z.ZodEffects<z.ZodString, Buffer, string>; }, "strip", z.ZodTypeAny, { 'x-signal-zk-auth': Buffer; 'x-signal-zk-auth-signature': Buffer; }, { 'x-signal-zk-auth': string; 'x-signal-zk-auth-signature': string; }>; export type BackupHeaders = z.infer<typeof BackupHeadersSchema>; export declare const SetBackupKeySchema: z.ZodObject<{ backupIdPublicKey: z.ZodEffects<z.ZodString, Buffer, string>; }, "strip", z.ZodTypeAny, { backupIdPublicKey: Buffer; }, { backupIdPublicKey: string; }>; export type SetBackupKey = z.infer<typeof SetBackupKeySchema>; export declare const BackupMediaBatchSchema: z.ZodObject<{ items: z.ZodArray<z.ZodObject<{ sourceAttachment: z.ZodObject<{ cdn: z.ZodNumber; key: z.ZodString; }, "strip", z.ZodTypeAny, { key: string; cdn: number; }, { key: string; cdn: number; }>; objectLength: z.ZodNumber; mediaId: z.ZodString; hmacKey: z.ZodEffects<z.ZodString, Buffer, string>; encryptionKey: z.ZodEffects<z.ZodString, Buffer, string>; }, "strip", z.ZodTypeAny, { sourceAttachment: { key: string; cdn: number; }; objectLength: number; mediaId: string; hmacKey: Buffer; encryptionKey: Buffer; }, { sourceAttachment: { key: string; cdn: number; }; objectLength: number; mediaId: string; hmacKey: string; encryptionKey: string; }>, "many">; }, "strip", z.ZodTypeAny, { items: { sourceAttachment: { key: string; cdn: number; }; objectLength: number; mediaId: string; hmacKey: Buffer; encryptionKey: Buffer; }[]; }, { items: { sourceAttachment: { key: string; cdn: number; }; objectLength: number; mediaId: string; hmacKey: string; encryptionKey: string; }[]; }>; export type BackupMediaBatch = z.infer<typeof BackupMediaBatchSchema>; export {};