{{#if isTs }}import{{ else }}const{{/if}} {
    dummyPaymentHandler,
    DefaultJobQueuePlugin,
    DefaultSearchPlugin,{{#if isTs}}
    VendureConfig,{{/if}}
} {{#if isTs}}from '@vendure/core'; {{ else }}= require('@vendure/core');{{/if}}
{{#if isTs }}
import { defaultEmailHandlers, EmailPlugin } from '@vendure/email-plugin';
{{ else }}
const { defaultEmailHandlers, EmailPlugin } = require('@vendure/email-plugin');
{{/if}}
{{#if isTs }}
import { AssetServerPlugin } from '@vendure/asset-server-plugin';
{{ else }}
const { AssetServerPlugin } = require('@vendure/asset-server-plugin');
{{/if}}
{{#if isTs }}
import { AdminUiPlugin } from '@vendure/admin-ui-plugin';
{{ else }}
const { AdminUiPlugin } = require('@vendure/admin-ui-plugin');
{{/if}}
{{#if isTs }}
import path from 'path';
{{ else }}
const path = require('path');
{{/if}}

{{#if isTs}}export {{/if}}const config{{#if isTs}}: VendureConfig{{/if}} = {
    apiOptions: {
        port: 3000,
        adminApiPath: 'admin-api',
        adminApiPlayground: {
            settings: {
                'request.credentials': 'include',
            }{{#if isTs}} as any{{/if}},
        },// turn this off for production
        adminApiDebug: true, // turn this off for production
        shopApiPath: 'shop-api',
        shopApiPlayground: {
            settings: {
                'request.credentials': 'include',
            }{{#if isTs}} as any{{/if}},
        },// turn this off for production
        shopApiDebug: true,// turn this off for production
    },
    authOptions: {
        superadminCredentials: {
            identifier: '{{{ escapeSingle superadminIdentifier }}}',
            password: '{{{ escapeSingle superadminPassword }}}',
        },
        cookieOptions: {
          secret: process.env.COOKIE_SECRET || 'cookie-secret',
        },
    },
    dbConnectionOptions: {
        type: '{{ dbType }}',
        synchronize: true, // turn this off for production
        logging: false,
        database: {{#if isSQLjs}}new Uint8Array([]){{else if isSQLite}}path.join(__dirname, '../vendure.sqlite'){{else}}'{{{ escapeSingle dbName }}}'{{/if}},
        {{#if isSQLjs}}
        location: path.join(__dirname, 'vendure.sqlite'),
        autoSave: true,
        {{/if}}
        {{#if requiresConnection}}
        host: '{{ dbHost }}',
        port: {{ dbPort }},
        username: '{{{ escapeSingle dbUserName }}}',
        password: '{{{ escapeSingle dbPassword }}}',
        {{/if}}
        migrations: [path.join(__dirname, '../migrations/*.ts')],
    },
    paymentOptions: {
        paymentMethodHandlers: [dummyPaymentHandler],
    },
    customFields: {},
    plugins: [
        AssetServerPlugin.init({
            route: 'assets',
            assetUploadDir: path.join(__dirname, '../static/assets'),
        }),
        DefaultJobQueuePlugin.init({ useDatabaseForBuffer: true }),
        DefaultSearchPlugin.init({ bufferUpdates: false, indexStockStatus: true }),
        EmailPlugin.init({
            devMode: true,
            outputPath: path.join(__dirname, '../static/email/test-emails'),
            route: 'mailbox',
            handlers: defaultEmailHandlers,
            templatePath: path.join(__dirname, '../static/email/templates'),
            globalTemplateVars: {
                // The following variables will change depending on your storefront implementation
                fromAddress: '"example" <noreply@example.com>',
                verifyEmailAddressUrl: 'http://localhost:8080/verify',
                passwordResetUrl: 'http://localhost:8080/password-reset',
                changeEmailAddressUrl: 'http://localhost:8080/verify-email-address-change'
            },
        }),
        AdminUiPlugin.init({
            route: 'admin',
            port: 3002,
        }),
    ],
};
{{#if isTs}}
{{else}}

module.exports = { config };
{{/if}}
