import type { RipplingSDK } from "../../../client.js"; import type { CustomObject, CustomObjectCreateParams, CustomObjectUpdateParams } from "../../../resources/custom-objects/custom-objects.js"; import type { CustomObjectField, CustomObjectNameFieldDetails, FieldCreateParams, FieldUpdateParams } from "../../../resources/custom-objects/fields.js"; import type { AnyCustomObjectDefinition, FieldNames } from "./types.js"; import type { CustomObjectCategoryDefinition } from "./category.js"; /** * Provisioned custom-object summary returned by the SDK provisioning helpers. * * @typeParam TDefinition - Typed custom-object definition that was provisioned. */ export interface ProvisionedCustomObject { /** Logical object definition used as the source of truth. */ readonly definition: TDefinition; /** Wire-level api name created on the backend. */ readonly customObjectApiName: TDefinition['apiName']; /** Backend response returned by `client.customObjects.create(...)`. */ readonly createdObject: CustomObject; /** Backend response returned by `client.customObjects.update(...)`. */ readonly updatedObject: CustomObject; /** Optional response returned when the helper updates the platform-managed `name` field. */ readonly updatedNameField?: CustomObjectField; /** Backend responses returned by field creation calls, keyed by logical field name. */ readonly createdFields: Readonly, CustomObjectField>>; /** Backend responses returned by field update calls, keyed by logical field name. */ readonly updatedFields: Readonly, CustomObjectField>>; } /** * Options for provisioning a single typed custom-object definition through the REST SDK. * * Assumptions baked into this helper: * - custom-object `create` derives the immutable `api_name` from the submitted logical name * - field `create` derives the immutable `api_name` from the submitted logical field name * - follow-up `update` calls can safely set human-facing display labels without changing api names */ export interface ProvisionCustomObjectOptions { /** * Optional typed category definition to create or update before provisioning the object. */ readonly categoryDefinition?: CustomObjectCategoryDefinition; /** * Resolved custom-category id or native category id used by the live REST object APIs. * * Supply this when the definition does not embed a typed category definition. */ readonly categoryIdentifier?: string; /** * Whether to issue the follow-up object update that applies the human-facing display name. * * Defaults to `true`. */ readonly updateObjectDisplayMetadata?: boolean; /** * Whether to issue the follow-up field updates that apply human-facing display names. * * Defaults to `true`. */ readonly updateFieldDisplayMetadata?: boolean; /** * Whether to update the platform-managed `name` field when the object definition uses autonumber metadata. * * Defaults to `true`. */ readonly updateNameFieldDetails?: boolean; } /** Options for provisioning multiple custom-object definitions in one batch. */ export interface ProvisionCustomObjectsOptions extends Omit { /** Optional typed categories to ensure before creating the objects in this batch. */ readonly categoryDefinitions?: readonly CustomObjectCategoryDefinition[]; /** * Resolved category ids keyed by object api name for definitions that do not embed a typed category definition. */ readonly categoryIdentifiersByObjectApiName?: Readonly>; } /** * Normalized field payload returned by the field-param builder helpers. */ export interface ProvisionableFieldParams { /** Payload passed to `client.customObjects.fields.create(...)`. */ readonly create: FieldCreateParams; /** Payload passed to `client.customObjects.fields.update(...)`. */ readonly update: FieldUpdateParams; } /** * Builds name-field metadata for REST field updates when the object uses autonumber names. * * @param definition - Typed object definition whose name-field metadata should be compiled. * @returns Name-field metadata payload for the platform-managed `name` field, when needed. * @typeParam TDefinition - Object definition being compiled. */ export declare function buildCustomObjectNameFieldDetails(definition: TDefinition): CustomObjectNameFieldDetails | undefined; /** * Builds the object-creation payload for the low-level REST API using a resolved category id. * * @param definition - Typed object definition to compile. * @param categoryIdentifier - Resolved custom-category id or native category id required by the live API. * @returns REST object-create payload. * @typeParam TDefinition - Object definition being compiled. */ export declare function buildCustomObjectCreateParams(definition: TDefinition, categoryIdentifier: string): CustomObjectCreateParams; /** * Builds the object-update payload used to restore human-facing labels after creation. * * @param definition - Typed object definition to compile. * @param categoryIdentifier - Resolved custom-category id or native category id required by the live API. * @returns REST object-update payload. * @typeParam TDefinition - Object definition being compiled. */ export declare function buildCustomObjectUpdateParams(definition: TDefinition, categoryIdentifier: string): CustomObjectUpdateParams; /** * Builds field create/update payloads for one logical field in a typed object definition. * * @param definition - Typed object definition that owns the field. * @param fieldName - Logical field name to compile. * @returns Frozen create/update payload pair for the field. * @typeParam TDefinition - Object definition being compiled. * @typeParam TFieldName - Logical field name being compiled. */ export declare function buildProvisionableFieldParams>(definition: TDefinition, fieldName: TFieldName): ProvisionableFieldParams; /** * Creates one typed custom object through the REST SDK and returns the backend responses. * * @param client - SDK client used to call the metadata APIs. * @param definition - Typed object definition to provision. * @param options - Provisioning behavior flags for categories, display metadata, and name fields. * @returns Frozen provisioning result describing the created object, fields, and optional name-field update. * @typeParam TDefinition - Object definition being provisioned. */ export declare function provisionCustomObjectDefinition(client: RipplingSDK, definition: TDefinition, options?: ProvisionCustomObjectOptions): Promise>; /** * Provisions multiple typed custom-object definitions through the REST SDK. * * @param client - SDK client used to call the metadata APIs. * @param definitions - Typed object definitions to provision. * @param options - Batch provisioning behavior flags. * @returns Frozen provisioning results in input order. */ export declare function provisionCustomObjectDefinitions(client: RipplingSDK, definitions: readonly AnyCustomObjectDefinition[], options?: ProvisionCustomObjectsOptions): Promise>; //# sourceMappingURL=provisioning.d.ts.map