import { EditorLanguage, FormComponentType, InputDataType, PluginResponseType, PluginType } from '../../types/index.js';
import { PUBLIC_INTEGRATIONS_LOGO_URL } from './constants.js';
const AdlsPluginVersions = {
    V1: '0.0.1'
};
export const AdlsPlugin = {
    id: 'adls',
    name: 'Azure Data Lake Storage',
    moduleName: 'AdlsPlugin',
    modulePath: 'plugins/adls/AdlsPlugin',
    iconLocation: `${PUBLIC_INTEGRATIONS_LOGO_URL}/adls.png`,
    // TODO(docs-v2): no adls page exists in docs-v2; add one or remove this line
    docsUrl: undefined,
    type: PluginType.API,
    responseType: PluginResponseType.JSON,
    hasRawRequest: true,
    hasMetadata: true,
    datasourceTemplate: {
        sections: [
            {
                name: 'main',
                items: [
                    {
                        label: 'Display name',
                        name: 'name',
                        startVersion: AdlsPluginVersions.V1,
                        componentType: FormComponentType.INPUT_TEXT,
                        placeholder: 'ProdDB',
                        rules: [{ required: true, message: 'Display name is required' }]
                    },
                    {
                        label: 'Storage account name',
                        name: 'connection.accountName',
                        startVersion: AdlsPluginVersions.V1,
                        componentType: FormComponentType.DYNAMIC_INPUT_TEXT,
                        placeholder: 'mystrgacct',
                        rules: [{ required: true, message: 'Storage account name is required' }]
                    },
                    {
                        label: 'Tenant ID',
                        name: 'connection.tenant',
                        startVersion: AdlsPluginVersions.V1,
                        componentType: FormComponentType.DYNAMIC_INPUT_TEXT,
                        placeholder: 'c5f384cc-3557-4e96-b073-2d2c32e13d87',
                        rules: [{ required: true, message: 'Tenant ID is required' }]
                    },
                    {
                        label: 'Client ID',
                        name: 'connection.auth.config.value.clientId',
                        placeholder: 'my-client-id',
                        startVersion: AdlsPluginVersions.V1,
                        componentType: FormComponentType.DYNAMIC_INPUT_TEXT
                    },
                    {
                        label: 'Client secret',
                        name: 'connection.auth.config.value.clientSecret',
                        placeholder: 'fTd0u~zS8g-pL.42WUNm3RfCKvORORHLcXFPyxJn',
                        startVersion: AdlsPluginVersions.V1,
                        componentType: FormComponentType.INPUT_TEXT,
                        dataType: InputDataType.PASSWORD
                    },
                    {
                        label: '',
                        name: 'connection.auth.config.case',
                        initialValue: 'clientCredentials',
                        startVersion: AdlsPluginVersions.V1,
                        componentType: FormComponentType.INPUT_TEXT,
                        hidden: true
                    }
                ]
            }
        ]
    },
    actionTemplate: {
        sections: [
            {
                name: 'main',
                items: [
                    {
                        label: 'Action',
                        name: 'adlsAction.case',
                        startVersion: AdlsPluginVersions.V1,
                        componentType: FormComponentType.DROPDOWN,
                        initialValue: 'listDirectoryContents',
                        rules: [{ required: true }],
                        options: [
                            {
                                key: 'createDirectory',
                                value: 'createDirectory',
                                displayName: 'Create directory'
                            },
                            {
                                key: 'renameDirectory',
                                value: 'renameDirectory',
                                displayName: 'Rename directory'
                            },
                            {
                                key: 'listDirectoryContents',
                                value: 'listDirectoryContents',
                                displayName: 'List directory contents'
                            },
                            {
                                key: 'deleteDirectory',
                                value: 'deleteDirectory',
                                displayName: 'Delete directory'
                            },
                            {
                                key: 'uploadFile',
                                value: 'uploadFile',
                                displayName: 'Upload file'
                            },
                            {
                                key: 'downloadFile',
                                value: 'downloadFile',
                                displayName: 'Download file'
                            },
                            {
                                key: 'deleteFile',
                                value: 'deleteFile',
                                displayName: 'Delete file'
                            }
                        ]
                    },
                    {
                        label: 'File system',
                        name: 'adlsAction.value.fileSystem',
                        startVersion: AdlsPluginVersions.V1,
                        componentType: FormComponentType.DYNAMIC_INPUT_TEXT,
                        placeholder: 'my-filesystem'
                    },
                    {
                        label: 'Path',
                        name: 'adlsAction.value.path',
                        startVersion: AdlsPluginVersions.V1,
                        componentType: FormComponentType.DYNAMIC_INPUT_TEXT,
                        placeholder: 'my/path',
                        display: {
                            show: {
                                'adlsAction.case': [
                                    'createDirectory',
                                    'renameDirectory',
                                    'deleteDirectory',
                                    'uploadFile',
                                    'deleteFile',
                                    'downloadFile',
                                    'listDirectoryContents'
                                ]
                            }
                        }
                    },
                    {
                        label: 'New path',
                        name: 'adlsAction.value.newPath',
                        startVersion: AdlsPluginVersions.V1,
                        componentType: FormComponentType.DYNAMIC_INPUT_TEXT,
                        placeholder: 'my-filesystem',
                        display: {
                            show: {
                                'adlsAction.case': ['renameDirectory']
                            }
                        }
                    },
                    {
                        label: 'Content',
                        name: 'adlsAction.value.content',
                        startVersion: AdlsPluginVersions.V1,
                        componentType: FormComponentType.CODE_EDITOR,
                        language: EditorLanguage.TEXT,
                        display: {
                            show: {
                                'adlsAction.case': ['uploadFile']
                            }
                        }
                    }
                ]
            }
        ]
    }
};
//# sourceMappingURL=adls.js.map