From e53d4a2ca823efd3eccbd91e0c962e5ee7ec94cc Mon Sep 17 00:00:00 2001 From: keshan Date: Mon, 21 Dec 2020 16:25:49 +0530 Subject: [PATCH] updated based on the feedbacks provided --- plugins/techdocs-backend/config.d.ts | 9 ++-- plugins/techdocs/config.d.ts | 76 ++++++++++++++++------------ 2 files changed, 49 insertions(+), 36 deletions(-) diff --git a/plugins/techdocs-backend/config.d.ts b/plugins/techdocs-backend/config.d.ts index f3237c669a..bb76b21eae 100644 --- a/plugins/techdocs-backend/config.d.ts +++ b/plugins/techdocs-backend/config.d.ts @@ -13,7 +13,10 @@ * See the License for the specific language governing permissions and * limitations under the License. */ - +/** + * techdocs schema below is an abstract of what's used within techdocs-backend and for its visisbility + * to view the complete techdoc schema please refer: plugins/techdocs/config.d.ts + * */ export interface Config { /** Configuration options for the techdocs-backend plugin */ techdocs: { @@ -29,7 +32,7 @@ export interface Config { * alternative: 'external' etc. * @see http://backstage.io/docs/features/techdocs/configuration */ - builder: string; + builder: 'local' | 'external'; /** * techdocs publisher information */ @@ -40,7 +43,7 @@ export interface Config { * aleternatives: 'googleGcs' etc. * @see http://backstage.io/docs/features/techdocs/configuration */ - type: string; + type: 'local' | 'googleGcs' | 'awsS3'; }; }; } diff --git a/plugins/techdocs/config.d.ts b/plugins/techdocs/config.d.ts index a60fbed1b4..10adcb9fbd 100644 --- a/plugins/techdocs/config.d.ts +++ b/plugins/techdocs/config.d.ts @@ -36,7 +36,7 @@ export interface Config { * @see http://backstage.io/docs/features/techdocs/configuration * @visibility frontend */ - builder: string; + builder: 'local' | 'external'; /** * techdocs publisher information @@ -54,38 +54,48 @@ export interface Config { /** * techdocs publisher information */ - publisher?: { - /** - * attr: 'type' - accepts a string value - * e.g. type: 'local' - * aleternatives: 'googleGcs' etc. - * @see http://backstage.io/docs/features/techdocs/configuration - */ - type: string; + publisher?: + | { + /** + * attr: 'type' - accepts a string value + * e.g. type: 'local' + * aleternatives: 'googleGcs' etc. + * @see http://backstage.io/docs/features/techdocs/configuration + */ + type: 'local' | 'awsS3'; + } + | { + /** + * attr: 'type' - accepts a string value + * e.g. type: 'googleGcs' + * aleternatives: 'googleGcs' etc. + * @see http://backstage.io/docs/features/techdocs/configuration + */ + type: 'googleGcs'; - /** - * googleGcs required when 'type' is set to googleGcs, skip otherwise - */ - googleGcs?: { - /** - * API key used to write to a storage bucket. - * attr: 'credentials' - accepts a string value - * @visibility secret - */ - credentials: string; - /** - * GCP Project ID where the Cloud Storage Bucket is hosted. - * attr: 'projectId' - accepts a string value - * @visibility secret - */ - projectId: string; - /** - * Cloud Storage Bucket Name - * attr: 'bucketName' - accepts a string value - * @visibility secret - */ - bucketName: string; - }; - }; + /** + * googleGcs required when 'type' is set to googleGcs + */ + googleGcs?: { + /** + * API key used to write to a storage bucket. + * attr: 'credentials' - accepts a string value + * @visibility secret + */ + credentials: string; + /** + * GCP Project ID where the Cloud Storage Bucket is hosted. + * attr: 'projectId' - accepts a string value + * @visibility secret + */ + projectId: string; + /** + * Cloud Storage Bucket Name + * attr: 'bucketName' - accepts a string value + * @visibility secret + */ + bucketName: string; + }; + }; }; }