From 495a935f1fe8403ed4ef77f3529c8055aa59be0e Mon Sep 17 00:00:00 2001 From: Eric Peterson Date: Thu, 8 Jul 2021 19:17:55 +0200 Subject: [PATCH] Define migration interface. Signed-off-by: Eric Peterson --- .../src/stages/publish/types.ts | 23 +++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/packages/techdocs-common/src/stages/publish/types.ts b/packages/techdocs-common/src/stages/publish/types.ts index a7f6ff7a45..229c853427 100644 --- a/packages/techdocs-common/src/stages/publish/types.ts +++ b/packages/techdocs-common/src/stages/publish/types.ts @@ -55,6 +55,19 @@ export type TechDocsMetadata = { etag: string; }; +export type MigrateRequest = { + /** + * Whether or not to remove the source file. Defaults to false (acting like a + * copy instead of a move). + */ + removeOriginal?: boolean; + + /** + * Maximum number of files/objects to migrate at once. Defaults to 25. + */ + concurrency?: number; +}; + /** * Base class for a TechDocs publisher (e.g. Local, Google GCS Bucket, AWS S3, etc.) * The publisher handles publishing of the generated static files after the prepare and generate steps of TechDocs. @@ -92,4 +105,14 @@ export interface PublisherBase { * Check if the index.html is present for the Entity at the Storage location. */ hasDocsBeenGenerated(entityName: Entity): Promise; + + /** + * Migrates documentation objects with case sensitive entity triplets to + * lowercase entity triplets. This was (will be) a change introduced in + * techdocs-cli v{0.x.y} and techdocs-backend v{0.x.y}. + * + * Implementation of this method is unnecessary in publishers introduced + * after v{0.x.y} of techdocs-common. + */ + migrateDocsCase?(migrateRequest: MigrateRequest): Promise; }