/*
  2.4.0.0
*/
{
  //
  // The application name used to set the application name property in connection string by "NpgsqlRest"."SetApplicationNameInConnection" or the "NpgsqlRest"."UseJsonApplicationName" settings.
  // It is the name of the top-level directory set to null.
  //
  "ApplicationName": null,

  //
  // Production or Development
  //
  "EnvironmentName": "Production",

  "Config": {
    //
    // Expose current configuration to the endpoint for debugging and inspection. Note, the password in the connection string is not exposed.
    //
    //"ExposeAsEndpoint": "/config",
    "ExposeAsEndpoint": null,
    //
    // Add the environment variables to configuration first.
    //
    "AddEnvironmentVariables": false
  },

  "ConnectionStrings": {
    //
    // See https://www.npgsql.org/doc/connection-string-parameters.html
    //
    "Default": ""
  },

  "ConnectionSettings": {
    //
    // Use the environment variables to set the connection string parameters. Default environment variables are defined below.
    // Connection parameter will be set from the environment variables this option is enabled and the environment variables are set.
    // Note: When this option is enabled and these environment variables are set, connection string doesn't have to be defined at all and it will be created from the environment variables.
    //
    "UseEnvironmentConnection": false,
    //
    // Use the environment variables to set the connection string parameters when the connection string section is missing.
    // Set to true to use the environment variables to override the connection string parameters.
    //
    "UseEnvironmentConnectionWhenMissing": false,
    //
    // Name of the host environment variable.
    //
    "HostEnvVar": "PGHOST",
    //
    // Name of the port environment variable.
    //
    "PortEnvVar": "PGPORT",
    //
    // Name of the database environment variable.
    //
    "DatabaseEnvVar": "PGDATABASE",
    //
    // The user name to use for the connection string parameters.
    //
    "UserEnvVar": "PGUSER",
    //
    // Name of the password environment variable.
    //
    "PasswordEnvVar": "PGPASSWORD",
    //
    // Sets the ApplicationName connection property in the connection string to the value of the ApplicationName configuration.
    // Note: This option is ignored if the UseJsonApplicationName option is enabled.
    //
    "SetApplicationNameInConnection": true,
    //
    // Sets the ApplicationName connection property dynamically on every request in the following format: 
    // {"app": [Application Name], "uid": [User Id for authenticated users or NULL], "id": [Valud of X-Execution-Id request header or NULL]}
    // Note: ApplicationName connection property is limited to 64 characters.
    //
    "UseJsonApplicationName": false
  },

  //
  // Specify the urls the web host will listen on. See https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.hosting.hostingabstractionswebhostbuilderextensions.useurls?view=aspnetcore-8.0
  //
  "Urls": "http://localhost:5000;http://localhost:5001",

  //
  // Enable to invoke UseKestrelHttpsConfiguration. See https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.hosting.webhostbuilderkestrelextensions.usekestrelhttpsconfiguration?view=aspnetcore-8.0
  //
  "Ssl": {
    "Enabled": false,
    //
    // Adds middleware for redirecting HTTP Requests to HTTPS. See https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.builder.httpspolicybuilderextensions.usehttpsredirection?view=aspnetcore-8.0
    //
    "HttpsRedirection": true,
    //
    // Adds middleware for using HSTS, which adds the Strict-Transport-Security header. See https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.builder.hstsbuilderextensions.usehsts?view=aspnetcore-2.1
    //
    "UseHsts": true
  },

  // //
  // // Uncomment to configure Kestrel web server and to add certificates
  // // See https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel/endpoints?view=aspnetcore-8.0
  // //
  // "Kestrel": {
  //     "Endpoints": {
  //         "Http": {
  //             "Url": "http://localhost:5000"
  //         },
  //         "HttpsInlineCertFile": {
  //             "Url": "https://localhost:5001",
  //             "Certificate": {
  //                 "Path": "<path to .pfx file>",
  //                 "Password": "$CREDENTIAL_PLACEHOLDER$"
  //             }
  //         },
  //         "HttpsInlineCertAndKeyFile": {
  //             "Url": "https://localhost:5002",
  //             "Certificate": {
  //                 "Path": "<path to .pem/.crt file>",
  //                 "KeyPath": "<path to .key file>",
  //                 "Password": "$CREDENTIAL_PLACEHOLDER$"
  //             }
  //         },
  //         "HttpsInlineCertStore": {
  //             "Url": "https://localhost:5003",
  //             "Certificate": {
  //                 "Subject": "<subject; required>",
  //                 "Store": "<certificate store; required>",
  //                 "Location": "<location; defaults to CurrentUser>",
  //                 "AllowInvalid": "<true or false; defaults to false>"
  //             }
  //         },
  //         "HttpsDefaultCert": {
  //             "Url": "https://localhost:5004"
  //         }
  //     },
  //     "Certificates": {
  //         "Default": {
  //             "Path": "<path to .pfx file>",
  //             "Password": "$CREDENTIAL_PLACEHOLDER$"
  //         }
  //     }
  // },

  //
  // Authentication and Authorization settings
  //
  "Auth": {
    //
    // Enable Cookie Auth
    //
    "CookieAuth": false,
    "CookieAuthScheme": null,
    "CookieValidDays": 14,
    "CookieName": null,
    "CookiePath": null,
    "CookieDomain": null,
    "CookieMultiSessions": true,
    "CookieHttpOnly": true,

    //
    // Enable JWT Auth. Can work with Cookie Auth.
    //
    "BearerTokenAuth": false,
    "BearerTokenAuthScheme": null,
    "BearerTokenExpireHours": 1,
    "BearerRefreshTokenExpireDays": 14,

    // 
    // Enable external auth providers
    //
    "External": {
      "Enabled": false,
      //
      // sessionStorage key to store the status of the external auth process returned by the signin page.
      // The value is HTTP status code (200 for success, 401 for unauthorized, 403 for forbidden, etc.)
      //
      "BrowserSessionStatusKey": "__external_status",
      //
      // sessionStorage key to store the message of the external auth process returned by the signin page.
      //
      "BrowserSessionMessageKey": "__external_message",
      //
      // Path to the signin page to handle the external auth process. Redirect to this page to start the external auth process.
      // Format placeholder {0} is the provider name in lowercase (google, linkedin, github, etc.)
      //
      "SigninUrl": "/signin-{0}",
      //
      // Sign in page template. Format placeholders {0} is the provider name, {1} is the script to redirect to the external auth provider.
      //
      "SignInHtmlTemplate": "<!DOCTYPE html><html><head><meta charset=\"utf-8\" /><title>Talking To {0}</title></head><body>Loading...{1}</body></html>",
      //
      // URL to redirect after the external auth process is completed. Usually this is resolved from the request automatically. Except when it's not.
      // 
      "RedirectUrl": null,
      //
      // Path to redirect after the external auth process is completed. 
      // 
      "ReturnToPath": "/",
      //
      // Query string key to store the path to redirect after the external auth process is completed.
      // Use this to set dynamic return path. If this query string key is not found, the ReturnToPath value is used.
      // 
      "ReturnToPathQueryStringKey": "return_to",
      //
      // Login command to execute after the external auth process is completed.
      // The first parameter is the email returned from the provider, the second parameter is the name returned from the provider and third parameter is the collection of the parameters that will include original query string.
      // The command uses the same rules as the login enabled routine. 
      // See: https://vb-consulting.github.io/npgsqlrest/login-endpoints and https://vb-consulting.github.io/npgsqlrest/login-endpoints/#external-logins
      //
      "LoginCommand": "select * from external_login($1,$2,$3)",

      "Google": {
        //
        // visit https://console.cloud.google.com/apis/ to configure your google app and get your client id and client secret
        //
        "Enabled": false,
        "ClientId": "",
        "ClientSecret": "",
        "AuthUrl": "https://accounts.google.com/o/oauth2/v2/auth?response_type=code&client_id={0}&redirect_uri={1}&scope=openid profile email&state={2}",
        "TokenUrl": "https://oauth2.googleapis.com/token",
        "InfoUrl": "https://www.googleapis.com/oauth2/v3/userinfo",
        "EmailUrl": null
      },
      "LinkedIn": {
        //
        // visit https://www.linkedin.com/developers/apps/ to configure your linkedin app and get your client id and client secret
        //
        "Enabled": false,
        "ClientId": "",
        "ClientSecret": "",
        "AuthUrl": "https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id={0}&redirect_uri={1}&state={2}&scope=r_liteprofile%20r_emailaddress",
        "TokenUrl": "https://www.linkedin.com/oauth/v2/accessToken",
        "InfoUrl": "https://api.linkedin.com/v2/me",
        "EmailUrl": "https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements//(handle~))"
      },
      "GitHub": {
        //
        // visit https://github.com/settings/developers/ to configure your github app and get your client id and client secret
        //
        "Enabled": false,
        "ClientId": "",
        "ClientSecret": "",
        "AuthUrl": "https://github.com/login/oauth/authorize?client_id={0}&redirect_uri={1}&state={2}&allow_signup=false",
        "TokenUrl": "https://github.com/login/oauth/access_token",
        "InfoUrl": "https://api.github.com/user",
        "EmailUrl": null
      }
    }
  },

  //
  // Serilog settings
  //
  "Log": {
    //
    // See https://github.com/serilog/serilog/wiki/Configuration-Basics#minimum-level
    //
    "MinimalLevels": {
      "System": "Warning",
      "Microsoft": "Warning"
    },
    "ToConsole": true,
    "ToFile": false,
    "FilePath": "logs/log.txt",
    "FileSizeLimitBytes": 30000000,
    "RetainedFileCountLimit": 30,
    "RollOnFileSizeLimit": true,
    //
    // See https://github.com/serilog/serilog/wiki/Formatting-Output
    //
    "OutputTemplate": "[{Timestamp:HH:mm:ss.fff} {Level:u3}] {Message:lj} [{SourceContext}]{NewLine}{Exception}"
  },

  //
  // Response compression settings
  //
  "ResponseCompression": {
    "Enabled": false,
    "EnableForHttps": false,
    "UseBrotli": true,
    "UseGzipFallback": true,
    "CompressionLevel": "Optimal", // Optimal, Fastest, NoCompression, SmallestSize
    "IncludeMimeTypes": [
      "text/plain",
      "text/css",
      "application/javascript",
      "text/html",
      "application/xml",
      "text/xml",
      "application/json",
      "text/json",
      "image/svg+xml",
      "font/woff",
      "font/woff2",
      "application/font-woff",
      "application/font-woff2"
    ],
    "ExcludeMimeTypes": []
  },

  //
  // Static files settings 
  //
  "StaticFiles": {
    "Enabled": false,
    "RootPath": "wwwroot",
    "AnonymousPaths": [
      "*"
    ],
    "LoginRedirectPath": "/login/"
  },

  //
  // Cross-origin resource sharing 
  //
  "Cors": {
    "Enabled": false,
    "AllowedOrigins": [],
    "AllowedMethods": [
      "*"
    ],
    "AllowedHeaders": [
      "*"
    ]
  },

  //
  // https://vb-consulting.github.io/npgsqlrest/
  //
  "NpgsqlRest": {
    //
    // Connection name to be used from the ConnectionStrings section or NULL to use the first avaialable connection string.
    //
    "ConnectionName": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#schemasimilarto
    //
    "SchemaSimilarTo": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#schemanotsimilarto
    //
    "SchemaNotSimilarTo": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#includeschemas
    //
    "IncludeSchemas": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#excludeschemas
    //
    "ExcludeSchemas": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#namesimilarto
    //
    "NameSimilarTo": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#namenotsimilarto
    //
    "NameNotSimilarTo": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#includenames
    //
    "IncludeNames": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#excludenames
    //
    "ExcludeNames": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#commentsmode
    //
    "CommentsMode": "OnlyWithHttpTag",
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#urlpathprefix
    //
    "UrlPathPrefix": "/api",
    //
    // Convert all URL paths to kebab-case from the original PostgreSQL names.
    //
    "KebabCaseUrls": true,
    //
    // Convert all parameter names to camel case from the original PostgreSQL paramater names.
    //
    "CamelCaseNames": true,
    //
    // Set to true to force all created endpoints to require authorization.
    // See https://vb-consulting.github.io/npgsqlrest/options/#requiresauthorization
    //
    "RequiresAuthorization": true,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#logendpointcreatedinfo
    //
    "LogEndpointCreatedInfo": true,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#logannotationsetinfo
    //
    "LogAnnotationSetInfo": true,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#logconnectionnoticeevents
    //
    "LogConnectionNoticeEvents": true,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#logcommands
    //
    "LogCommands": false,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#logcommandparameters
    //
    "LogCommandParameters": false,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#commandtimeout
    //
    "CommandTimeout": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#defaulthttpmethod
    //
    "DefaultHttpMethod": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#defaultrequestparamtype
    //
    "DefaultRequestParamType": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#requestheadersmode
    //
    "RequestHeadersMode": "Ignore",
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#requestheadersparametername
    //
    "RequestHeadersParameterName": "_headers",
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#returnnpgsqlexceptionmessage
    //
    "ReturnNpgsqlExceptionMessage": true,
    //
    // https://vb-consulting.github.io/npgsqlrest/options/#postgresqlerrorcodetohttpstatuscodemapping
    //
    "PostgreSqlErrorCodeToHttpStatusCodeMapping": {
      "57014": 205
    },
    //
    // Add the unique NpgsqlRest instance id request header with this name to the response or set to null to ignore.
    //
    "InstanceIdRequestHeaderName": null,
    //
    // https://vb-consulting.github.io/npgsqlrest/options/#customrequestheaders
    //
    "CustomRequestHeaders": {
    },

    //
    // Options for handling PostgreSQL routines (functions and procedures)
    //
    "RoutineOptions": {
      //
      // Name separator for parameter names when using custom type parameters. 
      // Parameter names will be in the format: {ParameterName}{CustomTypeParameterSeparator}{CustomTypeFieldName}. When NULL, default underscore is used.
      //
      "CustomTypeParameterSeparator": null,
      //
      // List of PostgreSQL routine language names to include. If NULL, all languages are included. Names are case-insensitive.
      //
      "IncludeLanguagues": null,
      //
      // List of PostgreSQL routine language names to exclude. If NULL, "C" and "INTERNAL" are excluded by default. Names are case-insensitive.
      //
      "ExcludeLanguagues": null
    },

    //
    // Authentication options for NpgsqlRest endpoints
    //
    "AuthenticationOptions": {
      //
      // Url path that will be used for the login endpoint. If NULL, the login endpoint will not be created.
      // See more on login endpoints at https://vb-consulting.github.io/npgsqlrest/login-endpoints
      //
      "LoginPath": null,
      //
      // Url path that will be used for the logout endpoint. If NULL, the logout endpoint will not be created.
      // See more on logout endpoints at https://vb-consulting.github.io/npgsqlrest/annotations/#logout
      //
      "LogoutPath": null,
      //
      // See https://vb-consulting.github.io/npgsqlrest/options/#authenticationoptionsdefaultauthenticationtype
      // (Default value is set from the ApplicationName configuration property)
      //
      "DefaultAuthenticationType": null,
      //
      // Name of the PostgreSQL text parameter that will be used to pass the authenticated user id to the PostgreSQL routine (function  or query) automatically (supplied values are rewritten).
      //
      "UserIdParameterName": null,
      //
      // Name of the PostgreSQL text parameter that will be used to pass the authenticated user name to the PostgreSQL routine (function  or query) automatically (supplied values are rewritten).
      //
      "UserNameParameterName": null,
      //
      // Name of the PostgreSQL text array parameter that will be used to pass the authenticated user roles list to the PostgreSQL routine (function  or query) automatically (supplied values are rewritten).
      //
      "UserRolesParameterName": null,
      //
      // Custom mapping of the parameter names to the claim names. When this parameter name is found in the claim collection by the key, the value of the claim is passed to the PostgreSQL routine.
      //
      "CustomParameterNameToClaimMappings": {}
    },

    //
    // Enable or disable the generation of HTTP files for NpgsqlRest endpoints.
    // See more on HTTP files at: 
    // https://marketplace.visualstudio.com/items?itemName=humao.rest-client or 
    // https://learn.microsoft.com/en-us/aspnet/core/test/http-files?view=aspnetcore-8.0
    //
    "HttpFileOptions": {
      "Enabled": false,
      //
      // Options for HTTP file generation:
      // - File: Generate HTTP files in the file system.
      // - Endpoint: Generate Endpoint(s) with HTTP file(s) content.
      // - Both: Generate HTTP files in the file system and Endpoint(s) with HTTP file(s) content.
      //
      "Option": "File",
      //
      // File name. If not set, the database name will be used if connection string is set. 
      // If neither ConnectionString nor Name is set, the file name will be "npgsqlrest".
      //
      "Name": null,
      //
      // The pattern to use when generating file names. {0} is database name, {1} is schema suffix with underline when FileMode is set to Schema.
      // Use this property to set the custom file name.
      // .http extension will be added automatically.
      //
      "NamePattern": "{0}_{1}",
      //
      // Adds comment header to above request based on PostgreSQL routine.
      // - None: skip.
      // - Simple: Add name, parameters and return values to comment header. This default.
      // - Full: Add the entire routine code as comment header.
      //
      "CommentHeader": "Simple",
      //
      // When CommentHeader is set to Simple or Full, set to true to include routine comments in comment header.
      //
      "CommentHeaderIncludeComments": true,
      //
      // - Database: to create one http file for entire database.
      // - Schema: to create one http file for each schema.
      //
      "FileMode": "Schema",
      //
      // Set to true to overwrite existing files.
      //
      "FileOverwrite": true
    },

    //
    // Enable or disable the generation of TypeScript/Javascript client source code files for NpgsqlRest endpoints.
    //
    "ClientCodeGen": {
      "Enabled": false,
      //
      // File path for the generated code. Set to null to skip the code generation. Use {0} to set schema name when BySchema is true
      //
      "FilePath": null,
      //
      //  Force file overwrite.
      //
      "FileOverwrite": true,
      //
      // Include current host information in the URL prefix.
      //
      "IncludeHost": true,
      //
      // Set the custom host prefix information.
      //
      "CustomHost": null,
      //
      // Adds comment header to above request based on PostgreSQL routine
      // Set None to skip.
      // Set Simple (default) to add name, parameters and return values to comment header.
      // Set Full to add the entire routine code as comment header.
      //
      "CommentHeader": "Simple",
      //
      // When CommentHeader is set to Simple or Full, set to true to include routine comments in comment header.
      //
      "CommentHeaderIncludeComments": true,
      //
      // Create files by PostgreSQL schema. File name will use formatted FilePath where {0} is is the schema name in the pascal case.
      //
      "BySchema": true,
      //
      // Set to true to include status code in response: {status: response.status, response: model}
      //
      "IncludeStatusCode": true,
      //
      // Create separate file with global types {name}Types.d.ts
      //
      "CreateSeparateTypeFile": true,
      //
      // Module name to import "baseUrl" constant, instead of defining it in a module.
      //
      "ImportBaseUrlFrom": null,
      //
      // Module name to import "pasreQuery" function, instead of defining it in a module.
      //
      "ImportParseQueryFrom": null,
      //
      // Include optional parameter `parseUrl: (url: string) => string = url=>url` that will parse constructed url.
      //
      "IncludeParseUrlParam": false,
      //
      // Include optional parameter `parseRequest: (request: RequestInit) => RequestInit = request=>request` that will parse constructed request.
      //
      "IncludeParseRequestParam": false,
      //
      // Header lines on a each auto-generated source file. Default is ["// autogenerated at {0}", "", ""] where {0} is current timestamp.
      //
      "HeaderLines": [
        "// autogenerated at {0}",
        "",
        ""
      ],
      //
      // Array of routine names to skip (without schema)
      //
      "SkipRoutineNames": [],
      //
      // Array of generated function names to skip (without schema)
      //
      "SkipFunctionNames": [],
      //
      // Array of url paths to skip
      //
      "SkipPaths": [],
      //
      // Array of schema names to skip
      //
      "SkipSchemas": [],
      //
      // Default TypeScript type for JSON types
      //
      "DefaultJsonType": "string",
      //
      // Use routine name instead of endpoint name when generating a function name.
      //
      "UseRoutineNameInsteadOfEndpoint": false,
      //
      // Export URLs as constants.
      //
      "ExportUrls": false,
      //
      // Skip generating types and produce pure JavaScript code. Setting this to true will also change .ts extension to .js where applicable.
      //
      "SkipTypes": false,
      //
      // Keep TypeScript models unique, meaning, models will same fields and types will be merged into one model with name of the last model. Significantly reduces number of generated models. 
      //
      "UniqueModels": false
    }
  }
}
/*
  2.4.0.0
*/
{
  //
  // The application name used to set the application name property in connection string by "NpgsqlRest"."SetApplicationNameInConnection" or the "NpgsqlRest"."UseJsonApplicationName" settings.
  // It is the name of the top-level directory set to null.
  //
  "ApplicationName": null,

  //
  // Production or Development
  //
  "EnvironmentName": "Production",

  "Config": {
    //
    // Expose current configuration to the endpoint for debugging and inspection. Note, the password in the connection string is not exposed.
    //
    //"ExposeAsEndpoint": "/config",
    "ExposeAsEndpoint": null,
    //
    // Add the environment variables to configuration first.
    //
    "AddEnvironmentVariables": false
  },

  "ConnectionStrings": {
    //
    // See https://www.npgsql.org/doc/connection-string-parameters.html
    //
    "Default": ""
  },

  "ConnectionSettings": {
    //
    // Use the environment variables to set the connection string parameters. Default environment variables are defined below.
    // Connection parameter will be set from the environment variables this option is enabled and the environment variables are set.
    // Note: When this option is enabled and these environment variables are set, connection string doesn't have to be defined at all and it will be created from the environment variables.
    //
    "UseEnvironmentConnection": false,
    //
    // Use the environment variables to set the connection string parameters when the connection string section is missing.
    // Set to true to use the environment variables to override the connection string parameters.
    //
    "UseEnvironmentConnectionWhenMissing": false,
    //
    // Name of the host environment variable.
    //
    "HostEnvVar": "PGHOST",
    //
    // Name of the port environment variable.
    //
    "PortEnvVar": "PGPORT",
    //
    // Name of the database environment variable.
    //
    "DatabaseEnvVar": "PGDATABASE",
    //
    // The user name to use for the connection string parameters.
    //
    "UserEnvVar": "PGUSER",
    //
    // Name of the password environment variable.
    //
    "PasswordEnvVar": "PGPASSWORD",
    //
    // Sets the ApplicationName connection property in the connection string to the value of the ApplicationName configuration.
    // Note: This option is ignored if the UseJsonApplicationName option is enabled.
    //
    "SetApplicationNameInConnection": true,
    //
    // Sets the ApplicationName connection property dynamically on every request in the following format: 
    // {"app": [Application Name], "uid": [User Id for authenticated users or NULL], "id": [Valud of X-Execution-Id request header or NULL]}
    // Note: ApplicationName connection property is limited to 64 characters.
    //
    "UseJsonApplicationName": false
  },

  //
  // Specify the urls the web host will listen on. See https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.hosting.hostingabstractionswebhostbuilderextensions.useurls?view=aspnetcore-8.0
  //
  "Urls": "http://localhost:5000;http://localhost:5001",

  //
  // Enable to invoke UseKestrelHttpsConfiguration. See https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.hosting.webhostbuilderkestrelextensions.usekestrelhttpsconfiguration?view=aspnetcore-8.0
  //
  "Ssl": {
    "Enabled": false,
    //
    // Adds middleware for redirecting HTTP Requests to HTTPS. See https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.builder.httpspolicybuilderextensions.usehttpsredirection?view=aspnetcore-8.0
    //
    "HttpsRedirection": true,
    //
    // Adds middleware for using HSTS, which adds the Strict-Transport-Security header. See https://learn.microsoft.com/en-us/dotnet/api/microsoft.aspnetcore.builder.hstsbuilderextensions.usehsts?view=aspnetcore-2.1
    //
    "UseHsts": true
  },

  // //
  // // Uncomment to configure Kestrel web server and to add certificates
  // // See https://learn.microsoft.com/en-us/aspnet/core/fundamentals/servers/kestrel/endpoints?view=aspnetcore-8.0
  // //
  // "Kestrel": {
  //     "Endpoints": {
  //         "Http": {
  //             "Url": "http://localhost:5000"
  //         },
  //         "HttpsInlineCertFile": {
  //             "Url": "https://localhost:5001",
  //             "Certificate": {
  //                 "Path": "<path to .pfx file>",
  //                 "Password": "$CREDENTIAL_PLACEHOLDER$"
  //             }
  //         },
  //         "HttpsInlineCertAndKeyFile": {
  //             "Url": "https://localhost:5002",
  //             "Certificate": {
  //                 "Path": "<path to .pem/.crt file>",
  //                 "KeyPath": "<path to .key file>",
  //                 "Password": "$CREDENTIAL_PLACEHOLDER$"
  //             }
  //         },
  //         "HttpsInlineCertStore": {
  //             "Url": "https://localhost:5003",
  //             "Certificate": {
  //                 "Subject": "<subject; required>",
  //                 "Store": "<certificate store; required>",
  //                 "Location": "<location; defaults to CurrentUser>",
  //                 "AllowInvalid": "<true or false; defaults to false>"
  //             }
  //         },
  //         "HttpsDefaultCert": {
  //             "Url": "https://localhost:5004"
  //         }
  //     },
  //     "Certificates": {
  //         "Default": {
  //             "Path": "<path to .pfx file>",
  //             "Password": "$CREDENTIAL_PLACEHOLDER$"
  //         }
  //     }
  // },

  //
  // Authentication and Authorization settings
  //
  "Auth": {
    //
    // Enable Cookie Auth
    //
    "CookieAuth": false,
    "CookieAuthScheme": null,
    "CookieValidDays": 14,
    "CookieName": null,
    "CookiePath": null,
    "CookieDomain": null,
    "CookieMultiSessions": true,
    "CookieHttpOnly": true,

    //
    // Enable JWT Auth. Can work with Cookie Auth.
    //
    "BearerTokenAuth": false,
    "BearerTokenAuthScheme": null,
    "BearerTokenExpireHours": 1,
    "BearerRefreshTokenExpireDays": 14,

    // 
    // Enable external auth providers
    //
    "External": {
      "Enabled": false,
      //
      // sessionStorage key to store the status of the external auth process returned by the signin page.
      // The value is HTTP status code (200 for success, 401 for unauthorized, 403 for forbidden, etc.)
      //
      "BrowserSessionStatusKey": "__external_status",
      //
      // sessionStorage key to store the message of the external auth process returned by the signin page.
      //
      "BrowserSessionMessageKey": "__external_message",
      //
      // Path to the signin page to handle the external auth process. Redirect to this page to start the external auth process.
      // Format placeholder {0} is the provider name in lowercase (google, linkedin, github, etc.)
      //
      "SigninUrl": "/signin-{0}",
      //
      // Sign in page template. Format placeholders {0} is the provider name, {1} is the script to redirect to the external auth provider.
      //
      "SignInHtmlTemplate": "<!DOCTYPE html><html><head><meta charset=\"utf-8\" /><title>Talking To {0}</title></head><body>Loading...{1}</body></html>",
      //
      // URL to redirect after the external auth process is completed. Usually this is resolved from the request automatically. Except when it's not.
      // 
      "RedirectUrl": null,
      //
      // Path to redirect after the external auth process is completed. 
      // 
      "ReturnToPath": "/",
      //
      // Query string key to store the path to redirect after the external auth process is completed.
      // Use this to set dynamic return path. If this query string key is not found, the ReturnToPath value is used.
      // 
      "ReturnToPathQueryStringKey": "return_to",
      //
      // Login command to execute after the external auth process is completed.
      // The first parameter is the email returned from the provider, the second parameter is the name returned from the provider and third parameter is the collection of the parameters that will include original query string.
      // The command uses the same rules as the login enabled routine. 
      // See: https://vb-consulting.github.io/npgsqlrest/login-endpoints and https://vb-consulting.github.io/npgsqlrest/login-endpoints/#external-logins
      //
      "LoginCommand": "select * from external_login($1,$2,$3)",

      "Google": {
        //
        // visit https://console.cloud.google.com/apis/ to configure your google app and get your client id and client secret
        //
        "Enabled": false,
        "ClientId": "",
        "ClientSecret": "",
        "AuthUrl": "https://accounts.google.com/o/oauth2/v2/auth?response_type=code&client_id={0}&redirect_uri={1}&scope=openid profile email&state={2}",
        "TokenUrl": "https://oauth2.googleapis.com/token",
        "InfoUrl": "https://www.googleapis.com/oauth2/v3/userinfo",
        "EmailUrl": null
      },
      "LinkedIn": {
        //
        // visit https://www.linkedin.com/developers/apps/ to configure your linkedin app and get your client id and client secret
        //
        "Enabled": false,
        "ClientId": "",
        "ClientSecret": "",
        "AuthUrl": "https://www.linkedin.com/oauth/v2/authorization?response_type=code&client_id={0}&redirect_uri={1}&state={2}&scope=r_liteprofile%20r_emailaddress",
        "TokenUrl": "https://www.linkedin.com/oauth/v2/accessToken",
        "InfoUrl": "https://api.linkedin.com/v2/me",
        "EmailUrl": "https://api.linkedin.com/v2/emailAddress?q=members&projection=(elements//(handle~))"
      },
      "GitHub": {
        //
        // visit https://github.com/settings/developers/ to configure your github app and get your client id and client secret
        //
        "Enabled": false,
        "ClientId": "",
        "ClientSecret": "",
        "AuthUrl": "https://github.com/login/oauth/authorize?client_id={0}&redirect_uri={1}&state={2}&allow_signup=false",
        "TokenUrl": "https://github.com/login/oauth/access_token",
        "InfoUrl": "https://api.github.com/user",
        "EmailUrl": null
      }
    }
  },

  //
  // Serilog settings
  //
  "Log": {
    //
    // See https://github.com/serilog/serilog/wiki/Configuration-Basics#minimum-level
    //
    "MinimalLevels": {
      "System": "Warning",
      "Microsoft": "Warning"
    },
    "ToConsole": true,
    "ToFile": false,
    "FilePath": "logs/log.txt",
    "FileSizeLimitBytes": 30000000,
    "RetainedFileCountLimit": 30,
    "RollOnFileSizeLimit": true,
    //
    // See https://github.com/serilog/serilog/wiki/Formatting-Output
    //
    "OutputTemplate": "[{Timestamp:HH:mm:ss.fff} {Level:u3}] {Message:lj} [{SourceContext}]{NewLine}{Exception}"
  },

  //
  // Response compression settings
  //
  "ResponseCompression": {
    "Enabled": false,
    "EnableForHttps": false,
    "UseBrotli": true,
    "UseGzipFallback": true,
    "CompressionLevel": "Optimal", // Optimal, Fastest, NoCompression, SmallestSize
    "IncludeMimeTypes": [
      "text/plain",
      "text/css",
      "application/javascript",
      "text/html",
      "application/xml",
      "text/xml",
      "application/json",
      "text/json",
      "image/svg+xml",
      "font/woff",
      "font/woff2",
      "application/font-woff",
      "application/font-woff2"
    ],
    "ExcludeMimeTypes": []
  },

  //
  // Static files settings 
  //
  "StaticFiles": {
    "Enabled": false,
    "RootPath": "wwwroot",
    "AnonymousPaths": [
      "*"
    ],
    "LoginRedirectPath": "/login/"
  },

  //
  // Cross-origin resource sharing 
  //
  "Cors": {
    "Enabled": false,
    "AllowedOrigins": [],
    "AllowedMethods": [
      "*"
    ],
    "AllowedHeaders": [
      "*"
    ]
  },

  //
  // https://vb-consulting.github.io/npgsqlrest/
  //
  "NpgsqlRest": {
    //
    // Connection name to be used from the ConnectionStrings section or NULL to use the first avaialable connection string.
    //
    "ConnectionName": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#schemasimilarto
    //
    "SchemaSimilarTo": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#schemanotsimilarto
    //
    "SchemaNotSimilarTo": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#includeschemas
    //
    "IncludeSchemas": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#excludeschemas
    //
    "ExcludeSchemas": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#namesimilarto
    //
    "NameSimilarTo": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#namenotsimilarto
    //
    "NameNotSimilarTo": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#includenames
    //
    "IncludeNames": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#excludenames
    //
    "ExcludeNames": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#commentsmode
    //
    "CommentsMode": "OnlyWithHttpTag",
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#urlpathprefix
    //
    "UrlPathPrefix": "/api",
    //
    // Convert all URL paths to kebab-case from the original PostgreSQL names.
    //
    "KebabCaseUrls": true,
    //
    // Convert all parameter names to camel case from the original PostgreSQL paramater names.
    //
    "CamelCaseNames": true,
    //
    // Set to true to force all created endpoints to require authorization.
    // See https://vb-consulting.github.io/npgsqlrest/options/#requiresauthorization
    //
    "RequiresAuthorization": true,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#logendpointcreatedinfo
    //
    "LogEndpointCreatedInfo": true,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#logannotationsetinfo
    //
    "LogAnnotationSetInfo": true,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#logconnectionnoticeevents
    //
    "LogConnectionNoticeEvents": true,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#logcommands
    //
    "LogCommands": false,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#logcommandparameters
    //
    "LogCommandParameters": false,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#commandtimeout
    //
    "CommandTimeout": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#defaulthttpmethod
    //
    "DefaultHttpMethod": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#defaultrequestparamtype
    //
    "DefaultRequestParamType": null,
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#requestheadersmode
    //
    "RequestHeadersMode": "Ignore",
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#requestheadersparametername
    //
    "RequestHeadersParameterName": "_headers",
    //
    // See https://vb-consulting.github.io/npgsqlrest/options/#returnnpgsqlexceptionmessage
    //
    "ReturnNpgsqlExceptionMessage": true,
    //
    // https://vb-consulting.github.io/npgsqlrest/options/#postgresqlerrorcodetohttpstatuscodemapping
    //
    "PostgreSqlErrorCodeToHttpStatusCodeMapping": {
      "57014": 205
    },
    //
    // Add the unique NpgsqlRest instance id request header with this name to the response or set to null to ignore.
    //
    "InstanceIdRequestHeaderName": null,
    //
    // https://vb-consulting.github.io/npgsqlrest/options/#customrequestheaders
    //
    "CustomRequestHeaders": {
    },

    //
    // Options for handling PostgreSQL routines (functions and procedures)
    //
    "RoutineOptions": {
      //
      // Name separator for parameter names when using custom type parameters. 
      // Parameter names will be in the format: {ParameterName}{CustomTypeParameterSeparator}{CustomTypeFieldName}. When NULL, default underscore is used.
      //
      "CustomTypeParameterSeparator": null,
      //
      // List of PostgreSQL routine language names to include. If NULL, all languages are included. Names are case-insensitive.
      //
      "IncludeLanguagues": null,
      //
      // List of PostgreSQL routine language names to exclude. If NULL, "C" and "INTERNAL" are excluded by default. Names are case-insensitive.
      //
      "ExcludeLanguagues": null
    },

    //
    // Authentication options for NpgsqlRest endpoints
    //
    "AuthenticationOptions": {
      //
      // Url path that will be used for the login endpoint. If NULL, the login endpoint will not be created.
      // See more on login endpoints at https://vb-consulting.github.io/npgsqlrest/login-endpoints
      //
      "LoginPath": null,
      //
      // Url path that will be used for the logout endpoint. If NULL, the logout endpoint will not be created.
      // See more on logout endpoints at https://vb-consulting.github.io/npgsqlrest/annotations/#logout
      //
      "LogoutPath": null,
      //
      // See https://vb-consulting.github.io/npgsqlrest/options/#authenticationoptionsdefaultauthenticationtype
      // (Default value is set from the ApplicationName configuration property)
      //
      "DefaultAuthenticationType": null,
      //
      // Name of the PostgreSQL text parameter that will be used to pass the authenticated user id to the PostgreSQL routine (function  or query) automatically (supplied values are rewritten).
      //
      "UserIdParameterName": null,
      //
      // Name of the PostgreSQL text parameter that will be used to pass the authenticated user name to the PostgreSQL routine (function  or query) automatically (supplied values are rewritten).
      //
      "UserNameParameterName": null,
      //
      // Name of the PostgreSQL text array parameter that will be used to pass the authenticated user roles list to the PostgreSQL routine (function  or query) automatically (supplied values are rewritten).
      //
      "UserRolesParameterName": null,
      //
      // Custom mapping of the parameter names to the claim names. When this parameter name is found in the claim collection by the key, the value of the claim is passed to the PostgreSQL routine.
      //
      "CustomParameterNameToClaimMappings": {}
    },

    //
    // Enable or disable the generation of HTTP files for NpgsqlRest endpoints.
    // See more on HTTP files at: 
    // https://marketplace.visualstudio.com/items?itemName=humao.rest-client or 
    // https://learn.microsoft.com/en-us/aspnet/core/test/http-files?view=aspnetcore-8.0
    //
    "HttpFileOptions": {
      "Enabled": false,
      //
      // Options for HTTP file generation:
      // - File: Generate HTTP files in the file system.
      // - Endpoint: Generate Endpoint(s) with HTTP file(s) content.
      // - Both: Generate HTTP files in the file system and Endpoint(s) with HTTP file(s) content.
      //
      "Option": "File",
      //
      // File name. If not set, the database name will be used if connection string is set. 
      // If neither ConnectionString nor Name is set, the file name will be "npgsqlrest".
      //
      "Name": null,
      //
      // The pattern to use when generating file names. {0} is database name, {1} is schema suffix with underline when FileMode is set to Schema.
      // Use this property to set the custom file name.
      // .http extension will be added automatically.
      //
      "NamePattern": "{0}_{1}",
      //
      // Adds comment header to above request based on PostgreSQL routine.
      // - None: skip.
      // - Simple: Add name, parameters and return values to comment header. This default.
      // - Full: Add the entire routine code as comment header.
      //
      "CommentHeader": "Simple",
      //
      // When CommentHeader is set to Simple or Full, set to true to include routine comments in comment header.
      //
      "CommentHeaderIncludeComments": true,
      //
      // - Database: to create one http file for entire database.
      // - Schema: to create one http file for each schema.
      //
      "FileMode": "Schema",
      //
      // Set to true to overwrite existing files.
      //
      "FileOverwrite": true
    },

    //
    // Enable or disable the generation of TypeScript/Javascript client source code files for NpgsqlRest endpoints.
    //
    "ClientCodeGen": {
      "Enabled": false,
      //
      // File path for the generated code. Set to null to skip the code generation. Use {0} to set schema name when BySchema is true
      //
      "FilePath": null,
      //
      //  Force file overwrite.
      //
      "FileOverwrite": true,
      //
      // Include current host information in the URL prefix.
      //
      "IncludeHost": true,
      //
      // Set the custom host prefix information.
      //
      "CustomHost": null,
      //
      // Adds comment header to above request based on PostgreSQL routine
      // Set None to skip.
      // Set Simple (default) to add name, parameters and return values to comment header.
      // Set Full to add the entire routine code as comment header.
      //
      "CommentHeader": "Simple",
      //
      // When CommentHeader is set to Simple or Full, set to true to include routine comments in comment header.
      //
      "CommentHeaderIncludeComments": true,
      //
      // Create files by PostgreSQL schema. File name will use formatted FilePath where {0} is is the schema name in the pascal case.
      //
      "BySchema": true,
      //
      // Set to true to include status code in response: {status: response.status, response: model}
      //
      "IncludeStatusCode": true,
      //
      // Create separate file with global types {name}Types.d.ts
      //
      "CreateSeparateTypeFile": true,
      //
      // Module name to import "baseUrl" constant, instead of defining it in a module.
      //
      "ImportBaseUrlFrom": null,
      //
      // Module name to import "pasreQuery" function, instead of defining it in a module.
      //
      "ImportParseQueryFrom": null,
      //
      // Include optional parameter `parseUrl: (url: string) => string = url=>url` that will parse constructed url.
      //
      "IncludeParseUrlParam": false,
      //
      // Include optional parameter `parseRequest: (request: RequestInit) => RequestInit = request=>request` that will parse constructed request.
      //
      "IncludeParseRequestParam": false,
      //
      // Header lines on a each auto-generated source file. Default is ["// autogenerated at {0}", "", ""] where {0} is current timestamp.
      //
      "HeaderLines": [
        "// autogenerated at {0}",
        "",
        ""
      ],
      //
      // Array of routine names to skip (without schema)
      //
      "SkipRoutineNames": [],
      //
      // Array of generated function names to skip (without schema)
      //
      "SkipFunctionNames": [],
      //
      // Array of url paths to skip
      //
      "SkipPaths": [],
      //
      // Array of schema names to skip
      //
      "SkipSchemas": [],
      //
      // Default TypeScript type for JSON types
      //
      "DefaultJsonType": "string",
      //
      // Use routine name instead of endpoint name when generating a function name.
      //
      "UseRoutineNameInsteadOfEndpoint": false,
      //
      // Export URLs as constants.
      //
      "ExportUrls": false,
      //
      // Skip generating types and produce pure JavaScript code. Setting this to true will also change .ts extension to .js where applicable.
      //
      "SkipTypes": false,
      //
      // Keep TypeScript models unique, meaning, models will same fields and types will be merged into one model with name of the last model. Significantly reduces number of generated models. 
      //
      "UniqueModels": false
    }
  }
}
Comments