import { ClientCapabilityData } from './ClientCapabilityData'; import { CreateClientPayload, RegisteredClient, UpdateClientPayload } from '../client/'; import { HttpClient } from '../http/'; export type ClaimedKeyPackages = { key_packages: { client: string; domain: string; key_package: string; key_package_ref: string; user: string; }[]; }; export declare enum MLSPublicKeyAlgorithmKeys { ECDSA_SECP256R1_SHA256 = "ecdsa_secp256r1_sha256", ECDSA_SECP384R1_SHA384 = "ecdsa_secp384r1_sha384", ECDSA_SECP521R1_SHA512 = "ecdsa_secp521r1_sha512", ED448 = "ed448", ED25519 = "ed25519" } export type MLSPublicKeyRecord = Partial>; export type GetMLSPublicKeysResponseData = { removal: MLSPublicKeyRecord; }; export declare class ClientAPI { private readonly client; constructor(client: HttpClient); static readonly URL: { readonly CLIENTS: "/clients"; readonly MLS_CLIENTS: "mls"; readonly MLS_KEY_PACKAGES: "key-packages"; readonly CAPABILITIES: "capabilities"; readonly PREKEYS: "prekeys"; readonly PUBLIC_KEYS: "public-keys"; readonly NONCE: "nonce"; readonly ACCESS_TOKEN: "access-token"; }; postClient(newClient: CreateClientPayload): Promise; putClient(clientId: string, updatedClient: UpdateClientPayload): Promise; getClientCapabilities(clientId: string): Promise; /** * Deletes a client on the backend * @param clientId * @param password? password can be omitted if the client is a temporary client */ deleteClient(clientId: string, password?: string): Promise; getClient(clientId: string): Promise; getClients(): Promise; getClientPreKeys(clientId: string): Promise; /** * Will replace all keypackages on backend by the keypackages provided * @see https://staging-nginz-https.zinfra.io/v5/api/swagger-ui/#/default/put_mls_key_packages_self__client_ * @param {string} clientId The client to upload the key packages for * @param {string[]} keyPackages The key packages to upload */ replaceMLSKeyPackages(clientId: string, keyPackages: string[], ciphersuites: string): Promise; /** * Will upload keypackages for an MLS capable client * @see https://staging-nginz-https.zinfra.io/api/swagger-ui/#/default/post_mls_key_packages_self__client_ * @param {string} clientId The client to upload the key packages for * @param {string[]} keyPackages The key packages to upload */ uploadMLSKeyPackages(clientId: string, keyPackages: string[]): Promise; /** * Will delete keypackages for an MLS capable client * @see https://nginz-https.elna.wire.link/v4/api/swagger-ui/#/default/delete_mls_key_packages_self__client_ * @param {string} clientId The client to delete the key packages for * @param {string[]} keyPackageRefs The key package references to delete */ deleteMLSKeyPackages(clientId: string, keyPackageRefs: string[]): Promise; /** * Claim one key package for each client of the given user * @param {string} userId The user to claim the key packages for * @param {string} userDomain The domain of the user * @param {string} ciphersuite Ciphersuite in hex format (e.g. 0xf031) * @param {string} skipOwn Do not claim a key package for the given own client id * @see https://staging-nginz-https.zinfra.io/api/swagger-ui/#/default/post_mls_key_packages_claim__user_domain___user_ */ claimMLSKeyPackages(userId: string, userDomain: string, ciphersuite: string, skipOwn?: string): Promise; /** * Get the number of unused key packages for the given client * @param {string} clientId * @param {string} ciphersuite Ciphersuite in hex format (e.g. 0xf031) * @see https://staging-nginz-https.zinfra.io/api/swagger-ui/#/default/get_mls_key_packages_self__client__count */ getMLSKeyPackageCount(clientId: string, ciphersuite: string): Promise; /** * Get the public keys from the backend, used for removing users from groups. * In the future this may be used for other purposes as well. * @see https://staging-nginz-https.zinfra.io/api/swagger-ui/#/default/get_mls_public_keys */ private publicKeys; private publicKeysFetchedAt; private readonly CACHE_DURATION_MS; getPublicKeys(): Promise; getNonce(clientId: string): Promise; getAccessToken(clientId: string, dpopToken: Uint8Array): Promise<{ type: "DPoP"; expires_in: number; token: string; }>; } //# sourceMappingURL=ClientAPI.d.ts.map