import { Api as ApiPb, Signature } from "./common"; export type SignatureResponse = { signature: Signature; }; export type ApiResource = { api: ApiPb; }; export type GenericResource = { literal: { data: any; signature?: Signature; }; }; interface PageHash { /** The version of the page DSL. */ version: number; /** The SHA-256 hash of the page DSL (i.e. `page.layouts[0].dsl`), in base64. */ hash: string; } export interface ApplicationSettingsHashes { /** The SHA-256 hash of all custom components related properties from settings, in base64. */ components: string; /** The SHA-256 hash of settings without the custom components related properties, in base64. */ rest: string; } export interface ApplicationSignatureTree { /** The version of the signature tree. */ v: 1; settings: ApplicationSettingsHashes; page: PageHash; } export interface ApplicationSignatureTreeSigned { /** The SHA-256 hash of `root`, in base64. */ signature: Signature; root: ApplicationSignatureTree; } export type AppToSign = { rootHash: string; }; export type AppToVerify = { rootHash: string; signature?: Signature; }; export type ApiToSign = { apiPb: ApiPb; }; export type ApiToVerify = { apiPb: ApiPb; signature?: Signature; };