import { Shape } from '@servicenow/sdk-build-core'; import type { Record, Database, Logger, ObjectShape, Factory, ShapeTransform } from '@servicenow/sdk-build-core'; /** * Shared relationship definitions for both CatalogItem and CatalogItemRecordProducer * These relationships are identical since CatalogItemRecordProducer extends CatalogItem */ export declare const CatalogItemBaseRelationships: { readonly sc_cat_item_user_criteria_mtom: { readonly via: "sc_cat_item"; readonly descendant: true; readonly relationships: { readonly user_criteria: { readonly via: "user_criteria"; readonly inverse: true; }; }; }; readonly sc_cat_item_user_criteria_no_mtom: { readonly via: "sc_cat_item"; readonly descendant: true; readonly relationships: { readonly user_criteria: { readonly via: "user_criteria"; readonly inverse: true; }; }; }; readonly io_set_item: { readonly via: "sc_cat_item"; readonly descendant: true; readonly relationships: { readonly item_option_new_set: { readonly via: "variable_set"; readonly inverse: true; readonly descendant: true; readonly relationships: { readonly item_option_new: { readonly via: "variable_set"; readonly descendant: true; }; }; }; }; }; readonly sc_cat_item_catalog: { readonly via: "sc_cat_item"; readonly descendant: true; readonly relationships: { readonly sc_catalog: { readonly via: "sc_catalog"; readonly inverse: true; }; }; }; readonly sc_cat_item_category: { readonly via: "sc_cat_item"; readonly descendant: true; readonly relationships: { readonly sc_category: { readonly via: "sc_category"; readonly inverse: true; }; }; }; readonly m2m_connected_content: { readonly via: "catalog_item"; readonly descendant: true; readonly relationships: { readonly topic: { readonly via: "topic"; readonly inverse: true; }; }; }; readonly fx_price: { readonly via: "id"; readonly descendant: true; }; readonly item_option_new: { readonly via: "cat_item"; readonly descendant: true; readonly relationships: { readonly question_choice: { readonly via: "question"; readonly descendant: true; readonly relationships: { readonly fx_price: { readonly via: "id"; readonly descendant: true; }; }; }; readonly fx_price: { readonly via: "id"; readonly descendant: true; }; }; }; }; /** * Shared coalesce definitions for both CatalogItem and CatalogItemRecordProducer * These define unique key combinations for M2M and related records */ export declare const CatalogItemBaseCoalesce: { sc_cat_item_user_criteria_mtom: { coalesce: [string, string]; }; sc_cat_item_user_criteria_no_mtom: { coalesce: [string, string]; }; io_set_item: { coalesce: [string, string]; }; sc_cat_item_catalog: { coalesce: [string, string]; }; sc_cat_item_category: { coalesce: [string, string]; }; m2m_connected_content: { coalesce: [string, string]; }; fx_price: { coalesce: [string, string]; }; item_option_new: { coalesce: [string, string, string]; }; question_choice: { coalesce: [string, string]; }; }; /** * Builds variables schema from item_option_new descendants. * Shared by CatalogItem, CatalogItemRecordProducer, and VariableSet. * * ownerRecordId identifies which record this schema is being built for: * - Omitted (CatalogItem/RecordProducer): only variables with no variable_set are "direct" — * variables belonging to an attached VariableSet are excluded, since that set owns them. * - Provided (VariableSet's own sys_id): variables pointing back at this VariableSet also count * as direct, since descendants here is scoped to this set's own children. * * Variables are sorted by order field (defaulting to 0 if empty) and empty names are skipped. */ export declare function buildVariablesSchema(descendants: Database, logger: Logger, ownerRecordId?: string): globalThis.Record; /** * Common field data extraction - fields with HIGH usage in BOTH CatalogItem AND CatalogItemRecordProducer * These fields appear on both forms and are frequently used */ export declare function buildCommonCatalogFields(descendants: Database): { categories: Shape[]; availableFor: Shape[]; notAvailableFor: Shape[]; variableSets: { variableSet: Shape; order: number; }[]; assignedTopics: Shape[]; }; /** * Transforms common catalog fields from record to shape (record → fluent) * These fields have HIGH usage in both CatalogItem and CatalogItemRecordProducer forms */ export declare function transformCatalogBaseFieldsToShape(record: Record, $: ShapeTransform, descendants: Database): { $id: ShapeTransform; name: ShapeTransform; active: ShapeTransform; accessType: ShapeTransform; assignedTopics: ShapeTransform; availability: ShapeTransform; availableFor: ShapeTransform; catalogs: ShapeTransform; categories: ShapeTransform; checkedOut: ShapeTransform; description: ShapeTransform; hideAttachment: ShapeTransform; hideSaveAsDraft: ShapeTransform; icon: ShapeTransform; mandatoryAttachment: ShapeTransform; meta: ShapeTransform; mobilePicture: ShapeTransform; notAvailableFor: ShapeTransform; order: ShapeTransform; owner: ShapeTransform; picture: ShapeTransform; roles: ShapeTransform; shortDescription: ShapeTransform; showVariableHelpOnLoad: ShapeTransform; startClosed: ShapeTransform; state: ShapeTransform; type: ShapeTransform; useScLayout: ShapeTransform; variableSets: ShapeTransform; version: ShapeTransform; view: ShapeTransform; visibleBundle: ShapeTransform; visibleGuide: ShapeTransform; visibleStandalone: ShapeTransform; hideAddToCart: ShapeTransform; hideAddToWishList: ShapeTransform; hideDeliveryTime: ShapeTransform; hideQuantitySelector: ShapeTransform; hideSP: ShapeTransform; image: ShapeTransform; model: ShapeTransform; mobilePictureType: ShapeTransform; makeItemNonConversational: ShapeTransform; noSearch: ShapeTransform; }; /** * Transforms common catalog fields from shape to record (fluent → platform) * These fields have HIGH usage in both CatalogItem and CatalogItemRecordProducer forms */ export declare function transformCatalogItemBaseFieldsToRecord($: ShapeTransform): { name: ShapeTransform; active: ShapeTransform; access_type: ShapeTransform; availability: ShapeTransform; category: ShapeTransform; checked_out: ShapeTransform; description: ShapeTransform; icon: ShapeTransform; mandatory_attachment: ShapeTransform; meta: ShapeTransform; mobile_picture: ShapeTransform; no_attachment_v2: ShapeTransform; no_save_as_draft: ShapeTransform; order: ShapeTransform; owner: ShapeTransform; picture: ShapeTransform; roles: ShapeTransform; sc_catalogs: ShapeTransform; short_description: ShapeTransform; show_variable_help_on_load: ShapeTransform; state: ShapeTransform; start_closed: ShapeTransform; taxonomy_topic: ShapeTransform; type: ShapeTransform; use_sc_layout: ShapeTransform; version: ShapeTransform; view: ShapeTransform; visible_bundle: ShapeTransform; visible_guide: ShapeTransform; visible_standalone: ShapeTransform; no_cart_v2: ShapeTransform; no_wishlist_v2: ShapeTransform; no_delivery_time_v2: ShapeTransform; no_quantity_v2: ShapeTransform; hide_sp: ShapeTransform; image: ShapeTransform; model: ShapeTransform; mobile_picture_type: ShapeTransform; make_item_non_conversational: ShapeTransform; no_search: ShapeTransform; }; /** * CatalogItem-ONLY field transformations (LOW/RARE usage in CatalogItemRecordProducer) * These fields are not commonly shown on CatalogItemRecordProducer forms */ export declare function transformCatalogItemSpecificFieldsToShape(record: Record, $: ShapeTransform, descendants: Database): { billable: ShapeTransform; cost: ShapeTransform; ignorePrice: ShapeTransform; omitPrice: ShapeTransform; pricingDetails: ShapeTransform; mobileHidePrice: ShapeTransform; executionPlan: ShapeTransform; flow: ShapeTransform; fulfillmentAutomationLevel: ShapeTransform; fulfillmentGroup: ShapeTransform; workflow: ShapeTransform; deliveryTime: ShapeTransform; displayPriceProperty: ShapeTransform; requestMethod: ShapeTransform; customCart: ShapeTransform; recurringFrequency: ShapeTransform; noCart: ShapeTransform; noOrder: ShapeTransform; noOrderNow: ShapeTransform; noProceedCheckout: ShapeTransform; noQuantity: ShapeTransform; vendor: ShapeTransform; location: ShapeTransform; }; /** * CatalogItem-ONLY field transformations for toRecord (fluent → platform) */ export declare function transformCatalogItemSpecificFieldsToRecord(arg: ObjectShape, $: ShapeTransform): { billable: ShapeTransform; cost: ShapeTransform; ignore_price: ShapeTransform; omit_price: ShapeTransform; mobile_hide_price: ShapeTransform; delivery_plan: ShapeTransform; flow_designer_flow: ShapeTransform; fulfillment_automation_level: ShapeTransform; group: ShapeTransform; workflow: ShapeTransform; delivery_time: ShapeTransform; delivery_plan_script: ShapeTransform; display_price_property: ShapeTransform; entitlement_script: ShapeTransform; request_method: ShapeTransform; custom_cart: ShapeTransform; recurring_frequency: ShapeTransform; no_cart: ShapeTransform; no_order: ShapeTransform; no_order_now: ShapeTransform; no_proceed_checkout: ShapeTransform; no_quantity: ShapeTransform; vendor: ShapeTransform; location: ShapeTransform; }; /** * Creates M2M records for catalogs, categories, variable sets, etc. * This logic is shared between CatalogItem and CatalogItemRecordProducer */ export declare function createSharedM2MRecords(callExpression: Shape, arg: ObjectShape, parentRecord: Record, factory: Factory): Promise<{ catalogsRecords: Record[]; categoriesRecords: Record[]; variableSetRecords: Record[]; availableForRecords: Record[]; notAvailableForRecords: Record[]; assignedTopicsRecords: Record[]; }>;