mirror of
				https://github.com/invoiceninja/invoiceninja.git
				synced 2025-11-04 04:07:32 -05:00 
			
		
		
		
	Merge pull request #8277 from turbo124/v5-develop
Minor fixes for BCCs in hosted
This commit is contained in:
		
						commit
						7878cf9e24
					
				
							
								
								
									
										74
									
								
								app/Console/Commands/OpenApiYaml.php
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										74
									
								
								app/Console/Commands/OpenApiYaml.php
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,74 @@
 | 
				
			|||||||
 | 
					<?php
 | 
				
			||||||
 | 
					/**
 | 
				
			||||||
 | 
					 * Invoice Ninja (https://invoiceninja.com).
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @link https://github.com/invoiceninja/invoiceninja source repository
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @copyright Copyright (c) 2023. Invoice Ninja LLC (https://invoiceninja.com)
 | 
				
			||||||
 | 
					 *
 | 
				
			||||||
 | 
					 * @license https://www.elastic.co/licensing/elastic-license
 | 
				
			||||||
 | 
					 */
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					namespace App\Console\Commands;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					use DirectoryIterator;
 | 
				
			||||||
 | 
					use Faker\Factory;
 | 
				
			||||||
 | 
					use Illuminate\Console\Command;
 | 
				
			||||||
 | 
					use Illuminate\Support\Facades\Storage;
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					class OpenApiYaml extends Command
 | 
				
			||||||
 | 
					{
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * The name and signature of the console command.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @var string
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    protected $signature = 'ninja:openapi';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * The console command description.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @var string
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    protected $description = 'Build OpenApi YAML';
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Create a new command instance.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @return void
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function __construct()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $this->faker = Factory::create();
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        parent::__construct();
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					    /**
 | 
				
			||||||
 | 
					     * Execute the console command.
 | 
				
			||||||
 | 
					     *
 | 
				
			||||||
 | 
					     * @return mixed
 | 
				
			||||||
 | 
					     */
 | 
				
			||||||
 | 
					    public function handle()
 | 
				
			||||||
 | 
					    {
 | 
				
			||||||
 | 
					        $path = base_path('openapi');
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $directory = new DirectoryIterator($path);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $this->info($directory);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        foreach ($directory as $file) {
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        $this->info($file);
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        Storage::disk('base')->delete('/openapi/api-docs.yaml');
 | 
				
			||||||
 | 
					        Storage::disk('base')->append('/openapi/api-docs.yaml', file_get_contents($path.'/info.yaml'));
 | 
				
			||||||
 | 
					        Storage::disk('base')->append('/openapi/api-docs.yaml', file_get_contents($path.'/paths/paths.yaml'));
 | 
				
			||||||
 | 
					        Storage::disk('base')->append('/openapi/api-docs.yaml', file_get_contents($path.'/components/components.yaml'));
 | 
				
			||||||
 | 
					        Storage::disk('base')->append('/openapi/api-docs.yaml', file_get_contents($path.'/misc/misc.yaml'));
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        }
 | 
				
			||||||
 | 
					    }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					}
 | 
				
			||||||
@ -236,8 +236,8 @@ class EmailDefaults
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
            if (Ninja::isHosted() && $this->email_service->company->account->isPaid()) {
 | 
					            if (Ninja::isHosted() && $this->email_service->company->account->isPaid()) {
 | 
				
			||||||
                $bccs = array_slice(explode(',', str_replace(' ', '', $this->email_object->settings->bcc_email)), 0, 2);
 | 
					                $bccs = array_slice(explode(',', str_replace(' ', '', $this->email_object->settings->bcc_email)), 0, 2);
 | 
				
			||||||
            } else {
 | 
					            } elseif(Ninja::isSelfHost()) {
 | 
				
			||||||
                $bccs(explode(',', str_replace(' ', '', $this->email_object->settings->bcc_email)));
 | 
					                $bccs = (explode(',', str_replace(' ', '', $this->email_object->settings->bcc_email)));
 | 
				
			||||||
            }
 | 
					            }
 | 
				
			||||||
        }
 | 
					        }
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
				
			|||||||
@ -32,6 +32,22 @@ return [
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
    'disks' => [
 | 
					    'disks' => [
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					        'base' => [
 | 
				
			||||||
 | 
					            'driver' => 'local',
 | 
				
			||||||
 | 
					            'root' => base_path(),
 | 
				
			||||||
 | 
					            'permissions' => [
 | 
				
			||||||
 | 
					                'file' => [
 | 
				
			||||||
 | 
					                    'public' => 0664,
 | 
				
			||||||
 | 
					                    'private' => 0600,
 | 
				
			||||||
 | 
					                ],
 | 
				
			||||||
 | 
					                'dir' => [
 | 
				
			||||||
 | 
					                    'public' => 0775,
 | 
				
			||||||
 | 
					                    'private' => 0700,
 | 
				
			||||||
 | 
					                ],
 | 
				
			||||||
 | 
					            ],
 | 
				
			||||||
 | 
					            'throw' => false,
 | 
				
			||||||
 | 
					        ],
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        'local' => [
 | 
					        'local' => [
 | 
				
			||||||
            'driver' => 'local',
 | 
					            'driver' => 'local',
 | 
				
			||||||
            'root' => storage_path('app'),
 | 
					            'root' => storage_path('app'),
 | 
				
			||||||
 | 
				
			|||||||
@ -161,7 +161,7 @@ return [
 | 
				
			|||||||
        /*
 | 
					        /*
 | 
				
			||||||
         * Set this to `true` to generate a copy of documentation in yaml format
 | 
					         * Set this to `true` to generate a copy of documentation in yaml format
 | 
				
			||||||
        */
 | 
					        */
 | 
				
			||||||
        'generate_yaml_copy' => env('L5_SWAGGER_GENERATE_YAML_COPY', false),
 | 
					        'generate_yaml_copy' => env('L5_SWAGGER_GENERATE_YAML_COPY', true),
 | 
				
			||||||
 | 
					
 | 
				
			||||||
        /*
 | 
					        /*
 | 
				
			||||||
         * Edit to trust the proxy's ip address - needed for AWS Load Balancer
 | 
					         * Edit to trust the proxy's ip address - needed for AWS Load Balancer
 | 
				
			||||||
 | 
				
			|||||||
							
								
								
									
										19112
									
								
								openapi/api-docs.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										19112
									
								
								openapi/api-docs.yaml
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										4228
									
								
								openapi/components/components.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										4228
									
								
								openapi/components/components.yaml
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
							
								
								
									
										24
									
								
								openapi/info.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										24
									
								
								openapi/info.yaml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,24 @@
 | 
				
			|||||||
 | 
					openapi: 3.0.0
 | 
				
			||||||
 | 
					info:
 | 
				
			||||||
 | 
					  title: 'Invoice Ninja API Reference - Where self host Invoicing lives.'
 | 
				
			||||||
 | 
					  description: |
 | 
				
			||||||
 | 
					        ---
 | 
				
			||||||
 | 
					        <br>
 | 
				
			||||||
 | 
					        <div style="color: white; background-color:SlateBlue; padding: 12px; border-radius:2px">
 | 
				
			||||||
 | 
					          The Invoice Ninja API is organized around REST and returns JSON-encoded responses, and uses standard HTTP response codes, authentication, and verbs.
 | 
				
			||||||
 | 
					        </div>  
 | 
				
			||||||
 | 
					        <br>
 | 
				
			||||||
 | 
					
 | 
				
			||||||
 | 
					  termsOfService: 'https://invoiceninja.github.io/docs/legal/terms_of_service/#page-content'
 | 
				
			||||||
 | 
					  contact:
 | 
				
			||||||
 | 
					    email: contact@invoiceninja.com
 | 
				
			||||||
 | 
					  license:
 | 
				
			||||||
 | 
					    name: 'Elastic License'
 | 
				
			||||||
 | 
					    url: 'https://www.elastic.co/licensing/elastic-license'
 | 
				
			||||||
 | 
					  version: 1.0.30
 | 
				
			||||||
 | 
					servers:
 | 
				
			||||||
 | 
					  -
 | 
				
			||||||
 | 
					    url: 'https://demo.invoiceninja.com'
 | 
				
			||||||
 | 
					    description: |
 | 
				
			||||||
 | 
					          ## Demo API Server InvoiceNinja. 
 | 
				
			||||||
 | 
					          You can use the demo API key `TOKEN` to test the endpoints from within this API spec
 | 
				
			||||||
							
								
								
									
										13
									
								
								openapi/misc/misc.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										13
									
								
								openapi/misc/misc.yaml
									
									
									
									
									
										Normal file
									
								
							@ -0,0 +1,13 @@
 | 
				
			|||||||
 | 
					tags:
 | 
				
			||||||
 | 
					  -
 | 
				
			||||||
 | 
					    name: login
 | 
				
			||||||
 | 
					    description: |
 | 
				
			||||||
 | 
					          Attempts to authenticate with the API using a email/password combination.
 | 
				
			||||||
 | 
					    externalDocs:
 | 
				
			||||||
 | 
					      description: 'Find out more'
 | 
				
			||||||
 | 
					      url: 'https://invoiceninja.github.io'
 | 
				
			||||||
 | 
					externalDocs:
 | 
				
			||||||
 | 
					  description: 'https://invoiceninja.github.io'
 | 
				
			||||||
 | 
					  url: 'https://invoiceninja.github.io'
 | 
				
			||||||
 | 
					security:
 | 
				
			||||||
 | 
					  - ApiKeyAuth: []
 | 
				
			||||||
							
								
								
									
										14847
									
								
								openapi/paths/paths.yaml
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										14847
									
								
								openapi/paths/paths.yaml
									
									
									
									
									
										Normal file
									
								
							
										
											
												File diff suppressed because it is too large
												Load Diff
											
										
									
								
							
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user