import type { Contract, ContractClause, ContractRenewalAlert } from "../_internal/types.gen"; import type { RequestOptions } from "../base-client"; import { RequestBuilder } from "../request-builder"; /** Attributes accepted when creating a manual Contract (admin surface). */ export type CreateContractAttributes = { source_system: "salesforce" | "hubspot" | "manual"; source_id: string; title: string; status?: "draft" | "active" | "expired" | "terminated" | "renewed"; counterparty_name?: string | null; start_date?: string | null; end_date?: string | null; renewal_date?: string | null; auto_renewal?: boolean; renewal_notice_days?: number | null; total_value_amount?: string | null; total_value_currency?: string | null; body_text?: string | null; custom_fields?: Record; external_url?: string | null; }; /** Attributes accepted when updating a Contract (admin surface, all optional). */ export type UpdateContractAttributes = { title?: string; status?: "draft" | "active" | "expired" | "terminated" | "renewed"; counterparty_name?: string | null; start_date?: string | null; end_date?: string | null; renewal_date?: string | null; auto_renewal?: boolean; renewal_notice_days?: number | null; total_value_amount?: string | null; total_value_currency?: string | null; body_text?: string | null; custom_fields?: Record; external_url?: string | null; }; /** * Admin surface for the Contracts domain — full CRUD across Contract, * ContractClause, and ContractRenewalAlert. Capability-gated on * `:contract_tracking`. ISV-admin keys (`sk_srv_`) authorize via * `contracts:read` and `contracts:write` scopes. * * @example * ```typescript * const admin = new GptAdmin({ apiKey: "sk_srv_..." }); * const list = await admin.contracts.contracts.list(); * const c = await admin.contracts.contracts.create({ * source_system: "manual", * source_id: "msa-2026-001", * title: "Vendor MSA", * auto_renewal: false, * }); * ``` */ export declare function createContractsNamespace(rb: RequestBuilder): { /** * Contract aggregates — admin surface (full CRUD). */ contracts: { /** * List Contracts across the workspace (admin scope). * * @param options - Optional pagination and request settings. * @returns A promise resolving to Contract records. */ list: (options?: { page?: number; pageSize?: number; } & RequestOptions) => Promise; /** * Fetch a Contract by id (admin scope). * * @param id - Contract id. * @param options - Optional request settings. * @returns A promise resolving to the Contract. */ get: (id: string, options?: RequestOptions) => Promise; /** * Create a manual Contract (admin scope). Salesforce/HubSpot rows * arrive via the connector sync pipeline; admin-initiated creates * should set `source_system: "manual"`. * * Body shape: `{ data: { type: "contract", attributes: {...} } }`. * * @param attributes - Accepted Contract create attributes. * @param options - Optional request settings. * @returns A promise resolving to the created Contract. * @example * ```typescript * await admin.contracts.contracts.create({ * source_system: "manual", * source_id: "msa-2026-001", * title: "Vendor MSA", * auto_renewal: false, * }); * ``` */ create: (attributes: CreateContractAttributes, options?: RequestOptions) => Promise; /** * Update mutable Contract fields (admin scope). * * Body shape: `{ data: { type: "contract", id, attributes: {...} } }`. * * @param id - Contract id. * @param attributes - Accepted Contract update attributes. * @param options - Optional request settings. * @returns A promise resolving to the updated Contract. * @example * ```typescript * await admin.contracts.contracts.update("contract-uuid", { * status: "renewed", * renewal_date: "2027-01-01", * }); * ``` */ update: (id: string, attributes: UpdateContractAttributes, options?: RequestOptions) => Promise; /** * Delete a Contract (admin scope). Cascades to ContractClause and * ContractRenewalAlert via Postgres `on_delete: :delete`. * * @param id - Contract id. * @param options - Optional request settings. * @returns A promise resolving to `true` on success. */ delete: (id: string, options?: RequestOptions) => Promise; }; /** * ContractClause records — admin read surface. */ clauses: { /** * List ContractClause records for a specific Contract (admin scope). * * @param contractId - Contract id to scope the listing. * @param options - Optional pagination and request settings. * @returns A promise resolving to ContractClause records. */ listForContract: (contractId: string, options?: { page?: number; pageSize?: number; } & RequestOptions) => Promise; /** * Fetch a single ContractClause by id (admin scope). * * @param id - ContractClause id. * @param options - Optional request settings. * @returns A promise resolving to the ContractClause. */ get: (id: string, options?: RequestOptions) => Promise; }; /** * ContractRenewalAlert ledger entries — admin read surface. */ renewalAlerts: { /** * List ContractRenewalAlert ledger entries (admin scope). * * @param options - Optional pagination and request settings. * @returns A promise resolving to ContractRenewalAlert records. */ list: (options?: { page?: number; pageSize?: number; } & RequestOptions) => Promise; /** * Fetch a single ContractRenewalAlert by id (admin scope). * * @param id - ContractRenewalAlert id. * @param options - Optional request settings. * @returns A promise resolving to the ContractRenewalAlert. */ get: (id: string, options?: RequestOptions) => Promise; }; }; //# sourceMappingURL=contracts.d.ts.map