TechDocs: Separate backend and frontend config schema declarations

Signed-off-by: Himanshu Mishra <himanshu@orkohunter.net>
This commit is contained in:
Himanshu Mishra
2021-03-16 15:48:02 +01:00
parent 6d2a583162
commit e7baa0d2ed
3 changed files with 187 additions and 190 deletions
+6
View File
@@ -0,0 +1,6 @@
---
'@backstage/plugin-techdocs': patch
'@backstage/plugin-techdocs-backend': patch
---
Separate techdocs-backend and frontend config schema declarations
+181 -7
View File
@@ -14,10 +14,6 @@
* 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
@@ -26,15 +22,193 @@ export interface Config {
techdocs: {
/**
* Documentation building process depends on the builder attr
* @visibility frontend
*/
builder: 'local' | 'external';
/**
* Techdocs generator information
*/
generators?: {
techdocs: 'local' | 'docker';
};
/**
* Techdocs publisher information
*/
publisher: {
type: 'local' | 'googleGcs' | 'awsS3' | 'openStackSwift';
};
publisher?:
| {
type: 'local';
}
| {
type: '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.
* @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
* @visibility secret
*/
accessKeyId: string;
/**
* User secret access key
* @visibility secret
*/
secretAccessKey: string;
/**
* ARN of role to be assumed
* @visibility backend
*/
roleArn?: string;
};
/**
* (Required) Cloud Storage Bucket Name
* @visibility backend
*/
bucketName: string;
/**
* (Optional) AWS Region.
* If not set, AWS_REGION environment variable or aws config file will be used.
* @see https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-region.html
* @visibility secret
*/
region?: string;
/**
* (Optional) AWS Endpoint.
* The endpoint URI to send requests to. The default endpoint is built from the configured region.
* @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#constructor-property
* @visibility secret
*/
endpoint?: string;
};
}
| {
type: 'openStackSwift';
/**
* Required when 'type' is set to openStackSwift
*/
openStackSwift?: {
/**
* (Required) Credentials used to access a storage bucket.
* @see https://docs.openstack.org/api-ref/identity/v3/?expanded=password-authentication-with-unscoped-authorization-detail#password-authentication-with-unscoped-authorization
* @visibility secret
*/
credentials: {
/**
* (Required) Root user name
* @visibility secret
*/
username: string;
/**
* (Required) Root user password
* @visibility secret
*/
password: string; // required
};
/**
* (Required) Cloud Storage Container Name
* @visibility backend
*/
containerName: string;
/**
* (Required) Auth url sometimes OpenStack uses different port check your OpenStack apis.
* @visibility backend
*/
authUrl: string;
/**
* (Optional) Auth version
* If not set, 'v2.0' will be used.
* @visibility backend
*/
keystoneAuthVersion: string;
/**
* (Required) Domain Id
* @visibility backend
*/
domainId: string;
/**
* (Required) Domain Name
* @visibility backend
*/
domainName: string;
/**
* (Required) Region
* @visibility backend
*/
region: string;
};
}
| {
type: 'azureBlobStorage';
/**
* Required when 'type' is set to azureBlobStorage
*/
azureBlobStorage?: {
/**
* (Required) Credentials used to access a storage container.
* @visibility secret
*/
credentials: {
/**
* Account access name
* @visibility secret
*/
accountName: string;
/**
* (Optional) Account secret primary key
* If not set, environment variables will be used to authenticate.
* @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
* @visibility backend
*/
containerName: string;
};
}
| {
type: 'googleGcs';
/**
* Required when 'type' is set to googleGcs
*/
googleGcs?: {
/**
* (Required) Cloud Storage Bucket Name
* @visibility backend
*/
bucketName: string;
/**
* (Optional) API key used to write to a storage bucket.
* If not set, environment variables will be used to authenticate.
* @see https://cloud.google.com/docs/authentication/production
* @visibility secret
*/
credentials?: string;
};
};
/**
* @example http://localhost:7000/api/techdocs
* @visibility frontend
* @deprecated
*/
requestUrl?: string;
/**
* @example http://localhost:7000/api/techdocs/static/docs
-183
View File
@@ -26,194 +26,11 @@ export interface Config {
*/
builder: 'local' | 'external';
/**
* Techdocs generator information
*/
generators?: {
techdocs: 'local' | 'docker';
};
/**
* Techdocs publisher information
*/
publisher?:
| {
type: 'local';
}
| {
type: '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.
* @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
* @visibility secret
*/
accessKeyId: string;
/**
* User secret access key
* @visibility secret
*/
secretAccessKey: string;
/**
* ARN of role to be assumed
* @visibility backend
*/
roleArn?: string;
};
/**
* (Required) Cloud Storage Bucket Name
* @visibility backend
*/
bucketName: string;
/**
* (Optional) AWS Region.
* If not set, AWS_REGION environment variable or aws config file will be used.
* @see https://docs.aws.amazon.com/sdk-for-javascript/v3/developer-guide/setting-region.html
* @visibility secret
*/
region?: string;
/**
* (Optional) AWS Endpoint.
* The endpoint URI to send requests to. The default endpoint is built from the configured region.
* @see https://docs.aws.amazon.com/AWSJavaScriptSDK/latest/AWS/S3.html#constructor-property
* @visibility secret
*/
endpoint?: string;
};
}
| {
type: 'openStackSwift';
/**
* Required when 'type' is set to openStackSwift
*/
openStackSwift?: {
/**
* (Required) Credentials used to access a storage bucket.
* @see https://docs.openstack.org/api-ref/identity/v3/?expanded=password-authentication-with-unscoped-authorization-detail#password-authentication-with-unscoped-authorization
* @visibility secret
*/
credentials: {
/**
* (Required) Root user name
* @visibility secret
*/
username: string;
/**
* (Required) Root user password
* @visibility secret
*/
password: string; // required
};
/**
* (Required) Cloud Storage Container Name
* @visibility backend
*/
containerName: string;
/**
* (Required) Auth url sometimes OpenStack uses different port check your OpenStack apis.
* @visibility backend
*/
authUrl: string;
/**
* (Optional) Auth version
* If not set, 'v2.0' will be used.
* @visibility backend
*/
keystoneAuthVersion: string;
/**
* (Required) Domain Id
* @visibility backend
*/
domainId: string;
/**
* (Required) Domain Name
* @visibility backend
*/
domainName: string;
/**
* (Required) Region
* @visibility backend
*/
region: string;
};
}
| {
type: 'azureBlobStorage';
/**
* Required when 'type' is set to azureBlobStorage
*/
azureBlobStorage?: {
/**
* (Required) Credentials used to access a storage container.
* @visibility secret
*/
credentials: {
/**
* Account access name
* @visibility secret
*/
accountName: string;
/**
* (Optional) Account secret primary key
* If not set, environment variables will be used to authenticate.
* @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
* @visibility backend
*/
containerName: string;
};
}
| {
type: 'googleGcs';
/**
* Required when 'type' is set to googleGcs
*/
googleGcs?: {
/**
* (Required) Cloud Storage Bucket Name
* @visibility backend
*/
bucketName: string;
/**
* (Optional) API key used to write to a storage bucket.
* If not set, environment variables will be used to authenticate.
* @see https://cloud.google.com/docs/authentication/production
* @visibility secret
*/
credentials?: string;
};
};
/**
* @example http://localhost:7000/api/techdocs
* @visibility frontend
* @deprecated
*/
requestUrl?: string;
/**
* @example http://localhost:7000/api/techdocs/static/docs
* @deprecated
*/
storageUrl?: string;
};
}