import { ObjectTypeDefinition, CompileTimeMetadata, Osdk, ObjectMetadata, PropertyKeys, OsdkObjectCreatePropertyType, InterfaceDefinition } from '@osdk/client'; type ObjectLocator = { $apiName: Osdk.Instance["$apiName"]; $primaryKey: Osdk.Instance["$primaryKey"]; }; type InterfaceLocator = { $apiName: Osdk.Instance["$apiName"]; $objectType: Osdk.Instance["$objectType"]; $primaryKey: Osdk.Instance["$primaryKey"]; }; declare namespace Edits { type Object = CreateObject | DeleteObject | UpdateObject; type Link["links"]> = AddLink | RemoveLink; type Interface = CreateObjectForInterface | UpdateObjectForInterface | DeleteObjectForInterface; } interface AddLink["links"]> { type: "addLink"; apiName: L; source: ObjectLocator; target: CompileTimeMetadata["links"][L] extends ObjectMetadata.Link ? ObjectLocator : never; } interface RemoveLink["links"]> { type: "removeLink"; apiName: L; source: ObjectLocator; target: CompileTimeMetadata["links"][L] extends ObjectMetadata.Link ? ObjectLocator : never; } type PartialForOptionalProperties = { [K in keyof T as undefined extends T[K] ? K : never]?: NonNullable; } & { [K in keyof T as undefined extends T[K] ? never : K]-?: T[K]; }; interface CreateObject { type: "createObject"; obj: S; properties: PartialForOptionalProperties<{ [P in PropertyKeys]: OsdkObjectCreatePropertyType["properties"][P]>; }>; } interface DeleteObject { type: "deleteObject"; obj: ObjectLocator; } interface DeleteObjectForInterface { type: "deleteObjectForInterface"; obj: InterfaceLocator; } interface UpdateObject { type: "updateObject"; obj: ObjectLocator; properties: Partial<{ [P in Exclude, CompileTimeMetadata["primaryKeyApiName"]>]: OsdkObjectCreatePropertyType["properties"][P]>; }>; } interface CreateObjectForInterface { type: "createObjectForInterface"; int: S; properties: PartialForOptionalProperties<{ [P in PropertyKeys]: OsdkObjectCreatePropertyType["properties"][P]>; } & { $objectType: string; }>; } interface UpdateObjectForInterface { type: "updateObjectForInterface"; obj: InterfaceLocator; properties: Partial<{ [P in PropertyKeys]: OsdkObjectCreatePropertyType["properties"][P]>; }>; } type AnyEdit = AddLink | RemoveLink | CreateObject | DeleteObject | UpdateObject | CreateObjectForInterface | UpdateObjectForInterface | DeleteObjectForInterface; export { type AnyEdit as A, type CreateObject as C, type DeleteObject as D, Edits as E, type InterfaceLocator as I, type ObjectLocator as O, type RemoveLink as R, type UpdateObject as U, type AddLink as a, type CreateObjectForInterface as b, type DeleteObjectForInterface as c, type UpdateObjectForInterface as d };