Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Reanme Config #112

Merged
merged 1 commit into from
Nov 17, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
File renamed without changes.
4 changes: 2 additions & 2 deletions src/Connectors/DocuWareStaticConnector.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ public function __construct()
*/
public function resolveBaseUrl(): string
{
return config('docuware.credentials.url').'/DocuWare/Platform';
return config('laravel-docuware.credentials.url').'/DocuWare/Platform';
}

public function defaultHeaders(): array
Expand All @@ -38,7 +38,7 @@ public function defaultHeaders(): array
public function defaultConfig(): array
{
return [
'timeout' => config('docuware.timeout'),
'timeout' => config('laravel-docuware.timeout'),
'cookies' => $this->cookieJar,
];
}
Expand Down
2 changes: 1 addition & 1 deletion src/DocuWareServiceProvider.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ public function configurePackage(Package $package): void
{
$package
->name('laravel-docuware')
->hasConfigFile()
->hasConfigFile('laravel-docuware')
->hasCommand(ListAuthCookie::class);
}
}
8 changes: 4 additions & 4 deletions src/DocuWareUrl.php
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,8 @@ public function make(): string

$credentials = sprintf(
'User=%s\nPwd=%s',
config('docuware.credentials.username'),
config('docuware.credentials.password'),
config('laravel-docuware.credentials.username'),
config('laravel-docuware.credentials.password'),
);

$lc = URL::formatWithBase64($credentials);
Expand All @@ -79,7 +79,7 @@ public function make(): string
}

// Source: https://support.docuware.com/en-US/forums/help-with-technical-problems/ea9618df-c491-e911-80e7-0003ff59a7c6
$key = utf8_encode(config('docuware.passphrase'));
$key = utf8_encode(config('laravel-docuware.passphrase'));
$passphrase = hash('sha512', $key, true);
$encryption_key = substr($passphrase, 0, 32);
$iv = substr($passphrase, 32, 16);
Expand All @@ -93,7 +93,7 @@ public function make(): string

return sprintf(
'%s/DocuWare/Platform/WebClient/Integration?ep=%s',
config('docuware.credentials.url'),
config('laravel-docuware.credentials.url'),
URL::format($encrypted),
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Exceptions/MethodNotAllowed.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,6 @@ final class MethodNotAllowed extends RuntimeException
{
public static function create(): self
{
return new self('This method is not allowed on connection '.config('docuware.connection').'.');
return new self('This method is not allowed on connection '.config('laravel-docuware.connection').'.');
}
}
2 changes: 1 addition & 1 deletion src/Requests/Auth/GetLogoffRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,6 @@ public function __construct()

public function resolveEndpoint(): string
{
return config('docuware.credentials.url').'/DocuWare/Platform/Account/Logoff';
return config('laravel-docuware.credentials.url').'/DocuWare/Platform/Account/Logoff';
}
}
6 changes: 3 additions & 3 deletions src/Requests/Auth/PostLogonRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,14 @@ class PostLogonRequest extends SoloRequest implements HasBody

public function resolveEndpoint(): string
{
return config('docuware.credentials.url').'/DocuWare/Platform/Account/Logon';
return config('laravel-docuware.credentials.url').'/DocuWare/Platform/Account/Logon';
}

protected function defaultBody(): array
{
return [
'UserName' => config('docuware.credentials.username'),
'Password' => config('docuware.credentials.password'),
'UserName' => config('laravel-docuware.credentials.username'),
'Password' => config('laravel-docuware.credentials.password'),
'RememberMe' => false,
'RedirectToMyselfInCaseOfError' => false,
'LicenseType' => null,
Expand Down
4 changes: 2 additions & 2 deletions src/Requests/Dialogs/GetDialogRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public function resolveEndpoint(): string

public function resolveCacheDriver(): LaravelCacheDriver
{
return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver')));
return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
}

public function cacheExpiryInSeconds(): int
{
return config('docuware.configurations.cache.lifetime_in_seconds', 3600);
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function createDtoFromResponse(Response $response): mixed
Expand Down
4 changes: 2 additions & 2 deletions src/Requests/Dialogs/GetDialogsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ public function resolveEndpoint(): string

public function resolveCacheDriver(): LaravelCacheDriver
{
return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver')));
return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
}

public function cacheExpiryInSeconds(): int
{
return config('docuware.configurations.cache.lifetime_in_seconds', 3600);
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function createDtoFromResponse(Response $response): mixed
Expand Down
4 changes: 2 additions & 2 deletions src/Requests/Document/GetDocumentCountRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public function resolveEndpoint(): string

public function resolveCacheDriver(): LaravelCacheDriver
{
return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver')));
return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
}

public function cacheExpiryInSeconds(): int
{
return config('docuware.configurations.cache.lifetime_in_seconds', 3600);
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function defaultQuery(): array
Expand Down
4 changes: 2 additions & 2 deletions src/Requests/Document/GetDocumentDownloadRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public function resolveEndpoint(): string

public function resolveCacheDriver(): LaravelCacheDriver
{
return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver')));
return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
}

public function cacheExpiryInSeconds(): int
{
return config('docuware.configurations.cache.lifetime_in_seconds', 3600);
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function defaultQuery(): array
Expand Down
4 changes: 2 additions & 2 deletions src/Requests/Document/GetDocumentPreviewRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public function resolveEndpoint(): string

public function resolveCacheDriver(): LaravelCacheDriver
{
return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver')));
return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
}

public function cacheExpiryInSeconds(): int
{
return config('docuware.configurations.cache.lifetime_in_seconds', 3600);
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function createDtoFromResponse(Response $response): mixed
Expand Down
4 changes: 2 additions & 2 deletions src/Requests/Document/GetDocumentRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,12 @@ public function resolveEndpoint(): string

public function resolveCacheDriver(): LaravelCacheDriver
{
return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver')));
return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
}

public function cacheExpiryInSeconds(): int
{
return config('docuware.configurations.cache.lifetime_in_seconds', 3600);
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function createDtoFromResponse(Response $response): mixed
Expand Down
4 changes: 2 additions & 2 deletions src/Requests/Document/GetDocumentsDownloadRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -41,12 +41,12 @@ public function resolveEndpoint(): string

public function resolveCacheDriver(): LaravelCacheDriver
{
return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver')));
return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
}

public function cacheExpiryInSeconds(): int
{
return config('docuware.configurations.cache.lifetime_in_seconds', 3600);
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function defaultQuery(): array
Expand Down
4 changes: 2 additions & 2 deletions src/Requests/Document/GetDocumentsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ public function resolveEndpoint(): string

public function resolveCacheDriver(): LaravelCacheDriver
{
return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver')));
return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
}

public function cacheExpiryInSeconds(): int
{
return config('docuware.configurations.cache.lifetime_in_seconds', 3600);
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function createDtoFromResponse(Response $response): mixed
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,12 +32,12 @@ public function resolveEndpoint(): string

public function resolveCacheDriver(): LaravelCacheDriver
{
return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver')));
return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
}

public function cacheExpiryInSeconds(): int
{
return config('docuware.configurations.cache.lifetime_in_seconds', 3600);
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function defaultQuery(): array
Expand Down
4 changes: 2 additions & 2 deletions src/Requests/Fields/GetFieldsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ public function resolveEndpoint(): string

public function resolveCacheDriver(): LaravelCacheDriver
{
return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver')));
return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
}

public function cacheExpiryInSeconds(): int
{
return config('docuware.configurations.cache.lifetime_in_seconds', 3600);
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function createDtoFromResponse(Response $response): mixed
Expand Down
4 changes: 2 additions & 2 deletions src/Requests/FileCabinets/GetFileCabinetsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ public function resolveEndpoint(): string

public function resolveCacheDriver(): LaravelCacheDriver
{
return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver')));
return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
}

public function cacheExpiryInSeconds(): int
{
return config('docuware.configurations.cache.lifetime_in_seconds', 3600);
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function createDtoFromResponse(Response $response): mixed
Expand Down
4 changes: 2 additions & 2 deletions src/Requests/Organization/GetOrganizationRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,12 +29,12 @@ public function resolveEndpoint(): string

public function resolveCacheDriver(): LaravelCacheDriver
{
return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver')));
return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
}

public function cacheExpiryInSeconds(): int
{
return config('docuware.configurations.cache.lifetime_in_seconds', 3600);
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function createDtoFromResponse(Response $response): mixed
Expand Down
4 changes: 2 additions & 2 deletions src/Requests/Organization/GetOrganizationsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,12 +24,12 @@ public function resolveEndpoint(): string

public function resolveCacheDriver(): LaravelCacheDriver
{
return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver')));
return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
}

public function cacheExpiryInSeconds(): int
{
return config('docuware.configurations.cache.lifetime_in_seconds', 3600);
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function createDtoFromResponse(Response $response): mixed
Expand Down
12 changes: 6 additions & 6 deletions src/Requests/Search/GetSearchRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,12 +40,12 @@ public function resolveEndpoint(): string

public function resolveCacheDriver(): LaravelCacheDriver
{
return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver')));
return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
}

public function cacheExpiryInSeconds(): int
{
return config('docuware.configurations.cache.lifetime_in_seconds', 3600);
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function defaultQuery(): array
Expand All @@ -72,10 +72,10 @@ public function defaultBody(): array
'Direction' => $this->orderDirection,
],
],
'Operation' => config('docuware.configurations.search.operation', 'And'),
'ForceRefresh' => config('docuware.configurations.search.force_refresh', true),
'IncludeSuggestions' => config('docuware.configurations.search.include_suggestions', false),
'AdditionalResultFields' => config('docuware.configurations.search.additional_result_fields', []),
'Operation' => config('laravel-docuware.configurations.search.operation', 'And'),
'ForceRefresh' => config('laravel-docuware.configurations.search.force_refresh', true),
'IncludeSuggestions' => config('laravel-docuware.configurations.search.include_suggestions', false),
'AdditionalResultFields' => config('laravel-docuware.configurations.search.additional_result_fields', []),
];
}

Expand Down
4 changes: 2 additions & 2 deletions src/Requests/Sections/GetSectionsRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -37,12 +37,12 @@ public function defaultQuery(): array

public function resolveCacheDriver(): LaravelCacheDriver
{
return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver')));
return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
}

public function cacheExpiryInSeconds(): int
{
return config('docuware.configurations.cache.lifetime_in_seconds', 3600);
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function createDtoFromResponse(Response $response): mixed
Expand Down
4 changes: 2 additions & 2 deletions src/Requests/SelectList/GetSelectListRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -31,12 +31,12 @@ public function resolveEndpoint(): string

public function resolveCacheDriver(): LaravelCacheDriver
{
return new LaravelCacheDriver(Cache::store(config('docuware.configurations.cache.driver')));
return new LaravelCacheDriver(Cache::store(config('laravel-docuware.configurations.cache.driver')));
}

public function cacheExpiryInSeconds(): int
{
return config('docuware.configurations.cache.lifetime_in_seconds', 3600);
return config('laravel-docuware.configurations.cache.lifetime_in_seconds', 3600);
}

public function defaultQuery(): array
Expand Down
8 changes: 4 additions & 4 deletions src/Support/Auth.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public static function store(CookieJar $cookies): void
Arr::get($cookie, 'Name') => Arr::get($cookie, 'Value'),
'CreatedAt' => now()->toDateTimeString(),
],
now()->addMinutes(config('docuware.cookie_lifetime')),
now()->addMinutes(config('laravel-docuware.cookie_lifetime')),
);
}

Expand Down Expand Up @@ -60,11 +60,11 @@ public static function forget(): void
public static function domain(): string
{
throw_if(
empty(config('docuware.credentials.url')),
empty(config('laravel-docuware.credentials.url')),
UnableToFindUrlCredential::create(),
);

return Str::of(config('docuware.credentials.url'))
return Str::of(config('laravel-docuware.credentials.url'))
->after('//')
->beforeLast('/')
->__toString();
Expand All @@ -77,6 +77,6 @@ public static function check(): bool

protected static function cacheDriver(): string
{
return config('docuware.cache_driver', self::FALLBACK_CACHE_DRIVER);
return config('laravel-docuware.cache_driver', self::FALLBACK_CACHE_DRIVER);
}
}
6 changes: 3 additions & 3 deletions src/Support/EnsureValidCredentials.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,17 +11,17 @@ class EnsureValidCredentials
public static function check(): void
{
throw_if(
empty(config('docuware.credentials.url')),
empty(config('laravel-docuware.credentials.url')),
UnableToFindUrlCredential::create(),
);

throw_if(
empty(config('docuware.credentials.username')),
empty(config('laravel-docuware.credentials.username')),
UnableToFindUserCredential::create(),
);

throw_if(
empty(config('docuware.credentials.password')),
empty(config('laravel-docuware.credentials.password')),
UnableToFindPasswordCredential::create(),
);

Expand Down
Loading