/** * Signable Templates Resource * * Admin CRUD over the unified signable_templates catalog. Hand-rolled plain * class (does NOT extend BaseResource) per D9 in the capa-3-b spec: * signable_templates are immutable post-create except for archive, so the * standard CRUD shape doesn't fit cleanly. * * Two-step upload flow exposed as separate methods plus a high-level * `upload(file, metadata)` helper that bundles requestUpload → PUT → create. */ import { type CreateSignableTemplateInput, type ListSignableTemplatesQuery, type RequestUploadSignableTemplateInput, type RequestUploadSignableTemplateResponse, type SignableTemplate, type SignableTemplateDownloadUrlResponse, type UpdateSignableTemplatePlacesInput } from "@artu-ai/shared"; import { z } from "zod"; import type { ResourceConfig } from "./base"; /** * Wire-level create input. The shared schema already covers everything except * `id`, which is generated server-side by `requestUpload` and echoed back by * the client at `create` time. */ declare const createSignableTemplateServiceInputSchema: z.ZodObject<{ category: z.ZodEnum<{ readonly PrivacyNotice: "privacy_notice"; readonly Nda: "nda"; readonly Contract: "contract"; readonly Declaration: "declaration"; readonly Other: "other"; }>; scope: z.ZodDefault; name: z.ZodString; description: z.ZodOptional; filename: z.ZodString; storagePath: z.ZodString; sha256: z.ZodString; size: z.ZodNumber; places: z.ZodDefault; page: z.ZodNumber; top: z.ZodNumber; left: z.ZodNumber; width: z.ZodNumber; height: z.ZodNumber; label: z.ZodOptional; }, z.core.$strip>>>; id: z.ZodUUID; }, z.core.$strip>; export type CreateSignableTemplateServiceInput = z.infer; export declare class SignableTemplatesResource { private readonly trpc; constructor(config: ResourceConfig); requestUpload(input: RequestUploadSignableTemplateInput): Promise; create(data: CreateSignableTemplateServiceInput): Promise; archive(id: string): Promise; updatePlaces(input: UpdateSignableTemplatePlacesInput): Promise; list(filters?: ListSignableTemplatesQuery): Promise; /** * Returns `null` only when the row does not exist (server returned * `NOT_FOUND`, mapped by `mapTRPCError` to a `NotFoundError` instance). * Auth, permission, validation, and transport errors still throw. */ retrieve(id: string): Promise; getDownloadUrl(id: string): Promise; /** * High-level helper: requestUpload → PUT → create in one call. Computes * SHA-256 client-side via Web Crypto. Returns the persisted template. * * The wire filename comes from `metadata.filename` and is used for BOTH * the presigned upload request and the catalog row, so requestUpload and * the persisted row stay in lockstep. */ upload(file: Blob | File, metadata: Omit): Promise; private execute; private validate; } export {};