terrac
Version:
A minimal private module registry for Terraform and OpenTofu
42 lines (41 loc) • 1.25 kB
TypeScript
import { IBackend, IModuleListItem } from './shared';
import { IModuleMeta } from '../types/module';
import { ContainerClient } from '@azure/storage-blob';
import * as Joi from 'joi';
export declare const configSchemaAzure: Joi.ObjectSchema<any>;
export interface IBackendConfigAzure {
/**
* Backend type
*/
type: 'azure';
/**
* Account name
*/
account: string;
/**
* Container name
*/
container: string;
/**
* File name prefix
*/
fileNamePrefix?: string;
}
export declare class BackendAzure implements IBackend {
config: IBackendConfigAzure;
containerClient: ContainerClient;
serviceUrl: string;
constructor(config: IBackendConfigAzure);
upload(name: string, version: string, packagePath: string): Promise<void>;
getSourceUrl(name: string, version?: string): Promise<string>;
list(name?: string): Promise<IModuleListItem[]>;
exists(name: string, version?: string): Promise<boolean>;
getMeta(name: string): Promise<IModuleMeta>;
saveMeta(meta: IModuleMeta): Promise<void>;
private uploadFile;
private uploadObject;
private fileNameExists;
private listFileNames;
private getMetaFileName;
private getPackageFileName;
}