/** * TypeScript interfaces matching the C# bridge Models. * These are the JSON shapes returned by the D365MetadataBridge process. */ export type AxDbMethod = 'axdbStatus' | 'axdbSchema' | 'axdbQuery'; export interface BridgeRequest { id: string; method: string; params: Record; } export interface BridgeResponse { id: string; result?: T; error?: BridgeError; } export interface BridgeError { code: number; message: string; } export interface BridgeReadyPayload { axdbSqlAvailable?: boolean; version: string; status: 'ready'; packagesPath: string; referencePackagesPath?: string; metadataAvailable: boolean; xrefAvailable: boolean; } export interface BridgeInfoPayload { version: string; metadataAvailable: boolean; xrefAvailable: boolean; capabilities: string[]; } export interface BridgeTableInfo { name: string; label?: string; developerDocumentation?: string; tableGroup?: string; tabletype?: string; cacheLookup?: string; clusteredIndex?: string; primaryIndex?: string; saveDataPerCompany?: string; /** "Read=Allow, Create=Deny" — the permissions the AccessGrant sets; absent when none are. */ subscriberAccessLevel?: string; /** "Yes" when set; absent from bridges built before it was read. */ allowRowVersionChangeTracking?: string; extends?: string; supportInheritance?: string; instanceRelationType?: string; model?: string; fields: BridgeFieldInfo[]; indexes: BridgeIndexInfo[]; relations: BridgeRelationInfo[]; methods: BridgeMethodInfo[]; } export interface BridgeFieldInfo { name: string; fieldType: string; extendedDataType?: string; label?: string; helpText?: string; mandatory: boolean; allowEdit?: string; stringSize?: number; enumType?: string; } export interface BridgeIndexInfo { name: string; allowDuplicates: boolean; fields: string[]; } export interface BridgeRelationInfo { name: string; relatedTable: string; cardinality?: string; relatedTableCardinality?: string; constraints: BridgeRelationConstraint[]; } export interface BridgeRelationConstraint { field?: string; relatedField?: string; value?: string; } export interface BridgeClassInfo { name: string; extends?: string; isAbstract: boolean; isFinal: boolean; isStatic: boolean; model?: string; declaration?: string; methods: BridgeMethodInfo[]; } export interface BridgeMethodInfo { name: string; returnType?: string; source?: string; isStatic?: boolean; /** * ⚠️ Never sent by the bridge. The C# MethodInfoModel behind readClass carries * only name/source/isStatic, so this is always undefined on bridge-sourced * methods — it is populated exclusively by the XML parser path * (xmlParser.parseClassFile). Reading it off a readClass result silently * yields nothing; for a bridge-sourced modifier parse the declaration line out * of getCompletionMembers().members[].signature instead. */ visibility?: string; } export interface BridgeEnumInfo { name: string; label?: string; helpText?: string; isExtensible: boolean; model?: string; values: BridgeEnumValueInfo[]; } export interface BridgeEnumValueInfo { name: string; value: number; label?: string; } export interface BridgeEdtInfo { name: string; baseType?: string; extends?: string; /** Root of the Extends chain, for orientation in a multi-level hierarchy. */ rootEdt?: string; label?: string; helpText?: string; stringSize?: number; /** * Ancestor the reported `stringSize` came from. Absent when the number is what this EDT's * own XML declares. Present both when the EDT declares nothing (the common case) and when * an ancestor's value overrode one the EDT did declare. */ stringSizeInheritedFrom?: string; enumType?: string; referenceTable?: string; model?: string; /** True when the base EDT is marked IsExtensible = Yes — required for AxEdtExtension. */ isExtensible?: boolean; formHelp?: string; configurationKey?: string; alignment?: string; displayLength?: number; relationType?: string; noOfDecimals?: number; decimalSeparator?: string; signDisplay?: string; } export interface BridgeFormInfo { name: string; model?: string; formPattern?: string; dataSources: BridgeFormDataSource[]; controls: BridgeFormControl[]; methods?: BridgeMethodInfo[]; } export interface BridgeFormDataSource { name: string; table: string; joinSource?: string; linkType?: string; allowEdit?: string; allowCreate?: string; allowDelete?: string; } export interface BridgeFormControl { name: string; controlType: string; dataSource?: string; dataField?: string; children?: BridgeFormControl[]; caption?: string; label?: string; helpText?: string; visible?: string; enabled?: string; dataMethod?: string; autoDeclaration?: string; } export interface BridgeQueryInfo { name: string; model?: string; description?: string; dataSources: BridgeQueryDataSource[]; } export interface BridgeQueryDataSource { name: string; table: string; joinMode?: string; fetchMode?: string; childDataSources?: BridgeQueryDataSource[]; ranges?: BridgeQueryRange[]; fields?: string[]; } export interface BridgeQueryRange { field: string; value?: string; status?: string; } export interface BridgeViewInfo { name: string; label?: string; model?: string; query?: string; isPublic?: boolean; isReadOnly?: boolean; primaryKey?: string; fields: BridgeViewField[]; relations?: BridgeRelationInfo[]; methods?: BridgeMethodInfo[]; dataSources?: BridgeDataEntityDataSource[]; } export interface BridgeViewField { name: string; fieldType: string; dataSource?: string; dataField?: string; dataMethod?: string; label?: string; isComputed?: boolean; } export interface BridgeDataEntityInfo { name: string; label?: string; publicEntityName?: string; publicCollectionName?: string; isPublic: boolean; model?: string; dataSources: BridgeDataEntityDataSource[]; fields: BridgeFieldInfo[]; isReadOnly?: boolean; entityCategory?: string; dataManagementEnabled?: boolean; stagingTable?: string; keys?: BridgeDataEntityKey[]; fieldMappings?: BridgeDataEntityFieldMapping[]; computedColumns?: string[]; } export interface BridgeDataEntityDataSource { name: string; table: string; } export interface BridgeDataEntityKey { name: string; fields: string[]; } export interface BridgeDataEntityFieldMapping { fieldName: string; dataSource?: string; dataField?: string; } export interface BridgeReportInfo { name: string; model?: string; dataSets: BridgeReportDataSet[]; designs?: BridgeReportDesign[]; } export interface BridgeReportDataSet { name: string; dataSourceType?: string; query?: string; fields?: BridgeReportDataSetField[]; } export interface BridgeReportDataSetField { name: string; dataField?: string; dataType?: string; } export interface BridgeReportDesign { name: string; caption?: string; style?: string; hasRdl?: boolean; } export interface BridgeReferenceResult { objectPath: string; /** Rows returned — capped per target shape (X++ code, declarative metadata). */ count: number; /** Every matching reference, and how many of them are declarative metadata. Absent from older bridges. */ total?: number; metadataTotal?: number; references: BridgeReferenceInfo[]; /** Set by the C# bridge when the xref query failed in-band (e.g. SQL error) — count is 0 but this is NOT an authoritative "no references". */ error?: string; } export interface BridgeReferenceInfo { sourcePath: string; sourceModule?: string; kind?: string; line: number; column: number; /** Categorized reference type: call, extends, field-access, type-reference, reference */ referenceType?: string; /** Source class name parsed from SourcePath */ callerClass?: string; /** Source method name parsed from SourcePath */ callerMethod?: string; } export interface BridgeSearchResult { results: BridgeSearchItem[]; } export interface BridgeSearchItem { name: string; type: string; model?: string; } export interface BridgeMethodSource { className: string; methodName: string; found: boolean; source?: string; } export interface BridgeListResult { type: string; count: number; names: string[]; } export interface BridgeValidateResult { valid: boolean; reason?: string; objectType?: string; objectName?: string; fieldCount?: number; methodCount?: number; indexCount?: number; valueCount?: number; } export interface BridgeResolveResult { exists: boolean; objectType: string; objectName: string; model?: string; } export interface BridgeRefreshResult { refreshed: boolean; elapsedMs: number; } /** Result from createObject / addMethod / addField / setProperty / replaceCode */ export interface BridgeWriteResult { success: boolean; objectType?: string; objectName?: string; modelName?: string; filePath?: string; operation?: string; methodName?: string; fieldName?: string; fieldType?: string; propertyPath?: string; propertyValue?: string; /** * Properties the caller asked for that the bridge could NOT write — an EDT stringSize * on a non-string base type, a DataSource on a control that has none. Present on the * create ops and on add-control; the write itself still succeeded. */ unsupportedProperties?: string[]; /** * The bridge declined the operation and changed NOTHING — an element with that * name is already there. `success` stays true because nothing failed, so a * caller that reads only `success` reports a write that did not happen. Render * it with skippedMessage() (bridgeAdapter.ts) rather than the success branch. * * Returned today by add-field (data-entity-extension), add-field-to-field-group, * add-menu-item-to-menu and add-data-source. It was absent from this interface * for as long as the bridge has been sending it, which is precisely why four * wrappers could ignore it without so much as a type error. */ skipped?: boolean; /** Why the bridge skipped, in its own words. Only set alongside `skipped`. */ reason?: string; api?: string; } /** Result from createSmartTable — includes BP defaults summary */ export interface BridgeSmartTableResult extends BridgeWriteResult { bpDefaults?: { cacheLookup?: string; saveDataPerCompany?: string; titleField1?: string; titleField2?: string; primaryIndex?: string; clusteredIndex?: string; fieldGroupCount?: number; deleteActionCount?: number; }; } /** Method parameter for createObject */ export interface BridgeMethodParam { name: string; source?: string; } /** Field parameter for createObject (table) */ export interface BridgeFieldParam { name: string; fieldType?: string; edt?: string; enumType?: string; mandatory?: boolean; label?: string; helpText?: string; stringSize?: number; } /** Field group parameter for createObject (table) */ export interface BridgeFieldGroupParam { name: string; label?: string; fields?: string[]; } /** Index parameter for createObject (table) */ export interface BridgeIndexParam { name: string; allowDuplicates?: boolean; alternateKey?: boolean; fields?: string[]; } /** Relation parameter for createObject (table) */ export interface BridgeRelationParam { name: string; relatedTable?: string; constraints?: { field?: string; relatedField?: string; }[]; } /** Enum value parameter for createObject (enum) */ export interface BridgeEnumValueParam { name: string; value: number; label?: string; } export interface BridgeBatchOperationRequest { operation: string; params?: Record; } export interface BridgeBatchOperationItemResult { operation: string; success: boolean; error?: string; elapsedMs: number; } export interface BridgeBatchOperationResult { objectType: string; objectName: string; totalOperations: number; successCount: number; failureCount: number; operations: BridgeBatchOperationItemResult[]; } export interface BridgeCapabilities { objectTypes: Record; version: string; } export interface BridgeFormPattern { name: string; version?: string; description?: string; } export interface BridgeFormPatternDiscoveryResult { patterns: BridgeFormPattern[]; count: number; source: string; } export interface BridgeSecurityEntryPoint { objectType?: string; objectName?: string; accessLevel?: string; } export interface BridgeSecurityPrivilegeResult { artifactType: 'privilege'; name: string; label?: string; description?: string; model?: string; entryPoints: BridgeSecurityEntryPoint[]; parentDuties: Array<{ name: string; }>; /** * False when the duty scan could not finish. An empty `parentDuties` then * means "unknown", not "none" — and "none" is the claim * BPErrorPrivilegeNotCoveredByDuty is about, so the two must not render alike. */ parentDutiesComplete?: boolean; _source: string; } export interface BridgeSecurityDutyResult { artifactType: 'duty'; name: string; label?: string; description?: string; model?: string; childPrivileges: Array<{ name: string; }>; subDuties: Array<{ name: string; }>; parentRoles: Array<{ name: string; }>; _source: string; } export interface BridgeSecurityRoleResult { artifactType: 'role'; name: string; label?: string; description?: string; model?: string; childDuties: Array<{ name: string; }>; childPrivileges: Array<{ name: string; }>; subRoles: Array<{ name: string; }>; _source: string; } export interface BridgeMenuItemResult { name: string; menuItemType: string; label?: string; helpText?: string; objectType?: string; object?: string; openMode?: string; linkedPermissionType?: string; linkedPermissionObject?: string; model?: string; _source: string; } export interface BridgeTableExtensionEntry { extensionName: string; model?: string; addedFields: string[]; addedIndexes: string[]; addedFieldGroups: string[]; addedRelations: string[]; } export interface BridgeTableExtensionListResult { baseTable: string; extensionCount: number; extensions: BridgeTableExtensionEntry[]; _source: string; } export interface BridgeCompletionMember { name: string; signature?: string; kind: string; /** * Set by the caller (not the bridge) when the member was picked up from a * base class rather than declared on the requested one. IMetadataProvider * returns declared members only, so inherited members are merged in on the * TypeScript side and tagged here. */ inheritedFrom?: string; } export interface BridgeCompletionResult { symbolName: string; symbolType: string; model?: string; members: BridgeCompletionMember[]; _source: string; } export interface BridgeExtensionClassEntry { className: string; path?: string; module?: string; /** * AOT path this class actually extends, read from its [ExtensionOf] declaration — * "/Tables/SalesTable", "/Forms/SalesTable/DataSources/SalesLine", etc. Needed because a * name can belong to several objects at once: "SalesTable" is both a table and a form, * and the form's data sources, controls and data fields are extended separately again. */ extendedElement?: string; /** Methods that the extension class wraps via CoC */ wrappedMethods?: string[]; } export interface BridgeExtensionClassResult { baseClassName: string; count: number; extensions: BridgeExtensionClassEntry[]; _source: string; } export interface BridgeEventSubscriberEntry { className: string; module?: string; methods?: string[]; /** Individual method name */ methodName?: string; /** Event name (e.g. "onInserted") */ eventName?: string; /** Handler type: "dataEvent", "delegate", "pre", "post", "static" */ handlerType?: string; } export interface BridgeEventSubscriberResult { targetName: string; count: number; handlers: BridgeEventSubscriberEntry[]; _source: string; } export interface BridgeApiUsageCallerEntry { callerClass: string; callerMethod?: string; module?: string; kind?: string; line: number; } export interface BridgeApiUsageCallersByClass { callerClass: string; module?: string; methods: string[]; callCount: number; } export interface BridgeApiUsageCallersResult { apiName: string; totalCallers: number; uniqueClasses: number; callersByClass: BridgeApiUsageCallersByClass[]; callers: BridgeApiUsageCallerEntry[]; _source: string; } //# sourceMappingURL=bridgeTypes.d.ts.map