api-ref: use opaque metadata for owner lookup
Read ApiRef plugin ownership through the internal opaque type helper and gracefully fall back to legacy ID inference for unsupported ref shapes. Signed-off-by: Patrik Oldsberg <poldsberg@gmail.com> Made-with: Cursor
This commit is contained in:
@@ -31,12 +31,14 @@ type ApiRefBuilderConfig<TId extends string> = {
|
||||
pluginId?: string;
|
||||
};
|
||||
|
||||
const OpaqueApiRef = OpaqueType.create<{
|
||||
/** @internal */
|
||||
export const OpaqueApiRef = OpaqueType.create<{
|
||||
public: ApiRef<unknown> & {
|
||||
readonly $$type: '@backstage/ApiRef';
|
||||
};
|
||||
versions: {
|
||||
readonly version: 'v1';
|
||||
readonly pluginId?: string;
|
||||
};
|
||||
}>({
|
||||
type: '@backstage/ApiRef',
|
||||
|
||||
Reference in New Issue
Block a user