1 Commits

Author SHA1 Message Date
Sebastian bdd9ee56bb chore: implement js test suites
Build Test / test (pull_request) Successful in 1m16s
JS Unit Tests / test (pull_request) Successful in 1m17s
PHP Integration Tests / Integration Tests (pull_request) Successful in 2m25s
PHP Unit Tests / test (pull_request) Successful in 2m34s
Signed-off-by: Sebastian Krupinski <krupinski01@gmail.com>
2026-07-24 00:13:52 -04:00
5 changed files with 648 additions and 185 deletions
+1 -1
View File
@@ -10,7 +10,7 @@ jobs:
runs-on: ubuntu-latest runs-on: ubuntu-latest
services: services:
mongo: mongo:
image: mongo:8 image: mongo:7
options: >- options: >-
--health-cmd "mongosh --quiet --eval \"db.adminCommand('ping')\"" --health-cmd "mongosh --quiet --eval \"db.adminCommand('ping')\""
--health-interval 5s --health-interval 5s
+1 -1
View File
@@ -97,7 +97,7 @@ class Provider implements IProviderBase, IProviderServiceMutate
} }
// Note: This simplified interface doesn't pass tenantId // Note: This simplified interface doesn't pass tenantId
// Will need to get it from TenantContextInterface in actual implementation // Will need to get it from SessionTenant in actual implementation
throw new \RuntimeException('Use Mail Provider interface for service creation'); throw new \RuntimeException('Use Mail Provider interface for service creation');
} }
+7 -4
View File
@@ -13,7 +13,7 @@ use GuzzleHttp\Client as HttpClient;
use GuzzleHttp\Psr7\HttpFactory; use GuzzleHttp\Psr7\HttpFactory;
use JmapClient\Authentication\Basic; use JmapClient\Authentication\Basic;
use JmapClient\Client as JmapClient; use JmapClient\Client as JmapClient;
use KTXF\Security\Crypto; use KTXC\Server;
use KTXF\Resource\Provider\ResourceServiceIdentityBasic; use KTXF\Resource\Provider\ResourceServiceIdentityBasic;
use KTXF\Resource\Provider\ResourceServiceLocationUri; use KTXF\Resource\Provider\ResourceServiceLocationUri;
use KTXM\ProviderJmapc\Providers\Mail\Service as MailService; use KTXM\ProviderJmapc\Providers\Mail\Service as MailService;
@@ -73,7 +73,8 @@ class RemoteService {
} }
// debugging // debugging
if ($service->getDebug()) { if ($service->getDebug()) {
$logDir = dirname(__DIR__, 5) . '/var/log/jmap/' . $service->identifier() . '.json'; $logDir = Server::getInstance()?->logDir();
$logDir .= '/jmap/' . $service->identifier() . '.json';
$client->configureTransportLogState(true); $client->configureTransportLogState(true);
$client->configureTransportLogLocation($logDir); $client->configureTransportLogLocation($logDir);
} }
@@ -199,7 +200,7 @@ class RemoteService {
return $service; return $service;
} }
public static function cookieStoreRetrieve(mixed $id, Crypto $crypto): ?array { public static function cookieStoreRetrieve(mixed $id): ?array {
$file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . (string)$id . '.jmapc'; $file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . (string)$id . '.jmapc';
@@ -208,6 +209,7 @@ class RemoteService {
} }
$data = file_get_contents($file); $data = file_get_contents($file);
$crypto = Server::getInstance()->container()->get(\KTXF\Security\Crypto::class);
$data = $crypto->decrypt($data); $data = $crypto->decrypt($data);
if (!empty($data)) { if (!empty($data)) {
@@ -218,12 +220,13 @@ class RemoteService {
} }
public static function cookieStoreDeposit(mixed $id, array $value, Crypto $crypto): void { public static function cookieStoreDeposit(mixed $id, array $value): void {
if (empty($value)) { if (empty($value)) {
return; return;
} }
$crypto = Server::getInstance()->container()->get(\KTXF\Security\Crypto::class);
$data = $crypto->encrypt(json_encode($value)); $data = $crypto->encrypt(json_encode($value));
$file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . (string)$id . '.jmapc'; $file = sys_get_temp_dir() . DIRECTORY_SEPARATOR . (string)$id . '.jmapc';
+637 -177
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -18,7 +18,7 @@
"test:coverage": "vitest run --coverage --config tests/js/vitest.config.ts" "test:coverage": "vitest run --coverage --config tests/js/vitest.config.ts"
}, },
"dependencies": { "dependencies": {
"pinia": "^4.0.0", "pinia": "^3.0.0",
"vue": "^3.5.18", "vue": "^3.5.18",
"vue-router": "^5.0.0", "vue-router": "^5.0.0",
"vuetify": "^4.0.0" "vuetify": "^4.0.0"
@@ -29,7 +29,7 @@
"@vitest/ui": "^4.0.18", "@vitest/ui": "^4.0.18",
"@vue/test-utils": "^2.4.10", "@vue/test-utils": "^2.4.10",
"@vue/tsconfig": "^0.9.0", "@vue/tsconfig": "^0.9.0",
"jsdom": "^30.0.0", "jsdom": "^29.1.1",
"typescript": "~6.0.0", "typescript": "~6.0.0",
"vite": "^8.0.0", "vite": "^8.0.0",
"vitest": "^4.0.18", "vitest": "^4.0.18",