clean up deprecations of techdocs-backend plugin
Signed-off-by: Emma Indal <emma.indahl@gmail.com>
This commit is contained in:
Vendored
-24
@@ -46,17 +46,6 @@ export interface Config {
|
||||
pullImage?: boolean;
|
||||
};
|
||||
|
||||
/**
|
||||
* Techdocs generator information
|
||||
* @deprecated Replaced with techdocs.generator
|
||||
*/
|
||||
generators?: {
|
||||
/**
|
||||
* @deprecated Use techdocs.generator.runIn
|
||||
*/
|
||||
techdocs: 'local' | 'docker';
|
||||
};
|
||||
|
||||
/**
|
||||
* Techdocs publisher information
|
||||
*/
|
||||
@@ -252,19 +241,6 @@ export interface Config {
|
||||
readTimeout?: number;
|
||||
};
|
||||
|
||||
/**
|
||||
* @example http://localhost:7007/api/techdocs
|
||||
* @visibility frontend
|
||||
* @deprecated
|
||||
*/
|
||||
requestUrl?: string;
|
||||
|
||||
/**
|
||||
* @example http://localhost:7007/api/techdocs/static/docs
|
||||
* @deprecated
|
||||
*/
|
||||
storageUrl?: string;
|
||||
|
||||
/**
|
||||
* (Optional and not recommended) Prior to version [0.x.y] of TechDocs, docs
|
||||
* sites could only be accessed over paths with case-sensitive entity triplets
|
||||
|
||||
@@ -208,15 +208,7 @@ export async function createRouter(
|
||||
throw new NotFoundError('Entity metadata UID missing');
|
||||
}
|
||||
|
||||
let responseHandler: DocsSynchronizerSyncOpts;
|
||||
if (req.header('accept') !== 'text/event-stream') {
|
||||
console.warn(
|
||||
"The call to /sync/:namespace/:kind/:name wasn't done by an EventSource. This behavior is deprecated and will be removed soon. Make sure to update the @backstage/plugin-techdocs package in the frontend to the latest version.",
|
||||
);
|
||||
responseHandler = createHttpResponse(res);
|
||||
} else {
|
||||
responseHandler = createEventStream(res);
|
||||
}
|
||||
const responseHandler: DocsSynchronizerSyncOpts = createEventStream(res);
|
||||
|
||||
// By default, techdocs-backend will only try to build documentation for an entity if techdocs.builder is set to
|
||||
// 'local'. If set to 'external', it will assume that an external process (e.g. CI/CD pipeline
|
||||
@@ -345,26 +337,3 @@ export function createEventStream(
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
/**
|
||||
* @deprecated use event-stream implementation of the sync endpoint
|
||||
*/
|
||||
export function createHttpResponse(
|
||||
res: Response<any, any>,
|
||||
): DocsSynchronizerSyncOpts {
|
||||
return {
|
||||
log: () => {},
|
||||
error: e => {
|
||||
throw e;
|
||||
},
|
||||
finish: ({ updated }) => {
|
||||
if (!updated) {
|
||||
throw new NotModifiedError();
|
||||
}
|
||||
|
||||
res
|
||||
.status(201)
|
||||
.json({ message: 'Docs updated or did not need updating' });
|
||||
},
|
||||
};
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user