got rid of some attr and cleaned up a bit in techdocs schema

This commit is contained in:
Fredrik Adelöw
2021-02-18 11:14:03 +01:00
parent 644a05e3a2
commit f37992797a
3 changed files with 36 additions and 75 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-techdocs': patch
'@backstage/plugin-techdocs-backend': patch
---
Got rid of some `attr` and cleaned up a bit in the TechDocs config schema.
+11 -16
View File
@@ -13,36 +13,31 @@
* 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 visibility
* to view the complete TechDocs schema please refer: plugins/techdocs/config.d.ts
* */
*/
export interface Config {
/** Configuration options for the techdocs-backend plugin */
/**
* Configuration options for the techdocs-backend plugin
* @see http://backstage.io/docs/features/techdocs/configuration
*/
techdocs: {
/**
* documentation building process depends on the builder attr
* attr: 'builder' - accepts a string value
* e.g. builder: 'local'
* alternative: 'external' etc.
* @see http://backstage.io/docs/features/techdocs/configuration
* Documentation building process depends on the builder attr
*/
builder: 'local' | 'external';
/**
* techdocs publisher information
* 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: 'local' | 'googleGcs' | 'awsS3';
};
/**
* attr: 'storageUrl' - accepts a string value
* e.g. storageUrl: http://localhost:7000/api/techdocs/static/docs
* @example http://localhost:7000/api/techdocs/static/docs
* @deprecated
*/
storageUrl?: string;
+19 -59
View File
@@ -15,105 +15,76 @@
*/
export interface Config {
/** Configuration options for the techdocs plugin */
/**
* Configuration options for the techdocs plugin
* @see http://backstage.io/docs/features/techdocs/configuration
*/
techdocs: {
/**
* documentation building process depends on the builder attr
* attr: 'builder' - accepts a string value
* e.g. builder: 'local'
* alternative: 'external' etc.
* @see http://backstage.io/docs/features/techdocs/configuration
* Documentation building process depends on the builder attr
* @visibility frontend
*/
builder: 'local' | 'external';
/**
* techdocs publisher information
* Techdocs generator information
*/
generators?: {
/**
* attr: 'techdocs' - accepts a string value
* e.g. type: 'docker'
* alternatives: 'local' etc.
* @see http://backstage.io/docs/features/techdocs/configuration
*/
techdocs: 'local' | 'docker';
};
/**
* techdocs publisher information
* Techdocs publisher information
*/
publisher?:
| {
/**
* attr: 'type' - accepts a string value
* e.g. type: 'local'
* alternatives: 'googleGcs' etc.
* @see http://backstage.io/docs/features/techdocs/configuration
*/
type: 'local';
}
| {
/**
* attr: 'type' - accepts a string value
* e.g. type: 'awsS3'
* alternatives: 'googleGcs' etc.
* @see http://backstage.io/docs/features/techdocs/configuration
*/
type: 'awsS3';
/**
* awsS3 required when 'type' is set to awsS3
* Required when 'type' is set to awsS3
*/
awsS3?: {
/**
* (Optional) Credentials used to access a storage bucket.
* If not set, environment variables or aws config file will be used to authenticate.
* https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-node-credentials-environment.html
* https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-node-credentials-shared.html
* @see https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-node-credentials-environment.html
* @see https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/loading-node-credentials-shared.html
* @visibility secret
*/
credentials?: {
/**
* User access key id
* attr: 'accessKeyId' - accepts a string value
* @visibility secret
*/
accessKeyId: string;
/**
* User secret access key
* attr: 'secretAccessKey' - accepts a string value
* @visibility secret
*/
secretAccessKey: string;
};
/**
* (Required) Cloud Storage Bucket Name
* attr: 'bucketName' - accepts a string value
* @visibility backend
*/
bucketName: string;
/**
* (Optional) AWS Region.
* If not set, AWS_REGION environment variable or aws config file will be used.
* https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-region.html
* attr: 'region' - accepts a string value
* @see https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-region.html
* @visibility secret
*/
region?: string;
};
}
| {
/**
* attr: 'type' - accepts a string value
* e.g. type: 'azureBlobStorage'
* alternatives: 'azureBlobStorage' etc.
* @see http://backstage.io/docs/features/techdocs/configuration
*/
type: 'azureBlobStorage';
/**
* azureBlobStorage required when 'type' is set to azureBlobStorage
* Required when 'type' is set to azureBlobStorage
*/
azureBlobStorage?: {
/**
@@ -123,66 +94,55 @@ export interface Config {
credentials: {
/**
* Account access name
* attr: 'account' - accepts a string value
* @visibility secret
*/
accountName: string;
/**
* (Optional) Account secret primary key
* If not set, environment variables will be used to authenticate.
* https://docs.microsoft.com/en-us/azure/storage/common/storage-auth?toc=/azure/storage/blobs/toc.json
* attr: 'accountKey' - accepts a string value
* @see https://docs.microsoft.com/en-us/azure/storage/common/storage-auth?toc=/azure/storage/blobs/toc.json
* @visibility secret
*/
accountKey?: string;
};
/**
* (Required) Cloud Storage Container Name
* attr: 'containerName' - accepts a string value
* @visibility backend
*/
containerName: string;
};
}
| {
/**
* attr: 'type' - accepts a string value
* e.g. type: 'googleGcs'
* alternatives: 'googleGcs' etc.
* @see http://backstage.io/docs/features/techdocs/configuration
*/
type: 'googleGcs';
/**
* googleGcs required when 'type' is set to googleGcs
* Required when 'type' is set to googleGcs
*/
googleGcs?: {
/**
* (Required) Cloud Storage Bucket Name
* attr: 'bucketName' - accepts a string value
* @visibility backend
*/
bucketName: string;
/**
* (Optional) API key used to write to a storage bucket.
* If not set, environment variables will be used to authenticate.
* Read more: https://cloud.google.com/docs/authentication/production
* attr: 'credentials' - accepts a string value
* @see https://cloud.google.com/docs/authentication/production
* @visibility secret
*/
credentials?: string;
};
};
/**
* attr: 'requestUrl' - accepts a string value
* e.g. requestUrl: http://localhost:7000/api/techdocs
* @example http://localhost:7000/api/techdocs
* @visibility frontend
* @deprecated
*/
requestUrl?: string;
/**
* attr: 'storageUrl' - accepts a string value
* e.g. storageUrl: http://localhost:7000/api/techdocs/static/docs
* @example http://localhost:7000/api/techdocs/static/docs
* @deprecated
*/
storageUrl?: string;