Compare commits
20 Commits
33fa932f13
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 6dadd13acf | |||
| 2d1ee97afe | |||
| 8432f5a823 | |||
| 30cfd06594 | |||
| 175981b5b2 | |||
| 0e8c91e82d | |||
| 2fc9cbe033 | |||
| 9deac1682e | |||
| 812a6680a8 | |||
| a7f57aecf7 | |||
| 9a234fb758 | |||
| 87940f8eaf | |||
| 8d716e3c72 | |||
| 4e1d6d65d0 | |||
| a4a87dd82d | |||
| f8fb84dd11 | |||
| b2a1a17acd | |||
| cf10ad0a50 | |||
| 8bb57052cd | |||
| dd105767d4 |
989
package-lock.json
generated
989
package-lock.json
generated
File diff suppressed because it is too large
Load Diff
72
package.json
72
package.json
@@ -21,45 +21,45 @@
|
||||
"test:coverage": "vitest run --coverage --config tests/js/vitest.config.ts"
|
||||
},
|
||||
"dependencies": {
|
||||
"@fontsource/inter": "5.2.8",
|
||||
"@fontsource/poppins": "5.2.7",
|
||||
"@fontsource/public-sans": "5.2.7",
|
||||
"@fontsource/roboto": "5.2.10",
|
||||
"@mdi/font": "7.4.47",
|
||||
"@tsconfig/node24": "24.0.4",
|
||||
"@typescript-eslint/parser": "^8.55.0",
|
||||
"@vue/compiler-sfc": "^3.5.33",
|
||||
"dompurify": "^3.4.1",
|
||||
"pinia": "3.0.4",
|
||||
"@fontsource/inter": "^5.2.8",
|
||||
"@fontsource/poppins": "^5.2.7",
|
||||
"@fontsource/public-sans": "^5.2.7",
|
||||
"@fontsource/roboto": "^5.2.10",
|
||||
"@mdi/font": "^7.4.47",
|
||||
"@tsconfig/node24": "^24.0.4",
|
||||
"@typescript-eslint/parser": "^8.59.3",
|
||||
"@vue/compiler-sfc": "^3.5.34",
|
||||
"dompurify": "^3.4.3",
|
||||
"pinia": "^3.0.4",
|
||||
"vee-validate": "^4.15.1",
|
||||
"vite-plugin-vuetify": "2.1.3",
|
||||
"vue": "3.5.28",
|
||||
"vue-router": "5.0.6",
|
||||
"vue3-perfect-scrollbar": "2.0.0",
|
||||
"vuetify": "4.0.7"
|
||||
"vite-plugin-vuetify": "^2.1.3",
|
||||
"vue": "^3.5.34",
|
||||
"vue-router": "^5.0.7",
|
||||
"vue3-perfect-scrollbar": "^2.0.0",
|
||||
"vuetify": "^4.0.7"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@eslint/js": "^10.0.0",
|
||||
"@eslint/js": "^10.0.1",
|
||||
"@types/dompurify": "^3.2.0",
|
||||
"@types/node": "25.8.0",
|
||||
"@vitejs/plugin-vue": "6.0.6",
|
||||
"@vitest/coverage-v8": "^4.0.18",
|
||||
"@vitest/ui": "^4.0.18",
|
||||
"@vue/eslint-config-prettier": "10.2.0",
|
||||
"@vue/test-utils": "^2.4.8",
|
||||
"@vue/tsconfig": "0.9.1",
|
||||
"eslint": "^10.0.0",
|
||||
"eslint-plugin-vue": "10.9.1",
|
||||
"jsdom": "^29.0.0",
|
||||
"prettier": "3.8.3",
|
||||
"sass": "1.99.0",
|
||||
"sass-loader": "16.0.8",
|
||||
"typescript": "6.0.3",
|
||||
"typescript-eslint": "^8.59.0",
|
||||
"vite": "8.0.13",
|
||||
"vite-plugin-static-copy": "^4.0.0",
|
||||
"vitest": "^4.0.18",
|
||||
"vue-cli-plugin-vuetify": "2.5.8",
|
||||
"vue-tsc": "^3.2.7"
|
||||
"@types/node": "^25.8.0",
|
||||
"@vitejs/plugin-vue": "^6.0.7",
|
||||
"@vitest/coverage-v8": "^4.1.6",
|
||||
"@vitest/ui": "^4.1.6",
|
||||
"@vue/eslint-config-prettier": "^10.2.0",
|
||||
"@vue/test-utils": "^2.4.10",
|
||||
"@vue/tsconfig": "^0.9.1",
|
||||
"eslint": "^10.3.0",
|
||||
"eslint-plugin-vue": "^10.9.1",
|
||||
"jsdom": "^29.1.1",
|
||||
"prettier": "^3.8.3",
|
||||
"sass": "^1.99.0",
|
||||
"sass-loader": "^16.0.8",
|
||||
"typescript": "^6.0.3",
|
||||
"typescript-eslint": "^8.59.3",
|
||||
"vite": "^8.0.13",
|
||||
"vite-plugin-static-copy": "^4.1.0",
|
||||
"vitest": "^4.1.6",
|
||||
"vue-cli-plugin-vuetify": "^2.5.8",
|
||||
"vue-tsc": "^3.2.9"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -28,6 +28,8 @@ use KTXF\Resource\Provider\ResourceServiceLocationInterface;
|
||||
*/
|
||||
interface ProviderServiceDiscoverInterface {
|
||||
|
||||
public const CAPABILITY_SERVICE_DISCOVER = 'ServiceDiscover';
|
||||
|
||||
/**
|
||||
* Attempts to discover service configuration using provider-specific methods.
|
||||
*
|
||||
|
||||
@@ -28,6 +28,8 @@ use KTXF\Mail\Service\ServiceMutableInterface;
|
||||
*/
|
||||
interface ProviderServiceTestInterface {
|
||||
|
||||
public const CAPABILITY_SERVICE_TEST = 'ServiceTest';
|
||||
|
||||
/**
|
||||
* Test a service connection
|
||||
*
|
||||
|
||||
@@ -12,8 +12,10 @@ namespace KTXF\Mail\Service;
|
||||
use Generator;
|
||||
use KTXF\Mail\Collection\CollectionBaseInterface;
|
||||
use KTXF\Mail\Object\AddressInterface;
|
||||
use KTXF\Resource\BinaryResource;
|
||||
use KTXF\Resource\Delta\Delta;
|
||||
use KTXF\Resource\Filter\IFilter;
|
||||
use KTXF\Resource\Identifier\EntityIdentifierInterface;
|
||||
use KTXF\Resource\Provider\ResourceServiceBaseInterface;
|
||||
use KTXF\Resource\Range\IRange;
|
||||
use KTXF\Resource\Range\RangeType;
|
||||
@@ -166,9 +168,9 @@ interface ServiceBaseInterface extends ResourceServiceBaseInterface {
|
||||
* @param IRange|null $range Optional pagination
|
||||
* @param array|null $properties Optional message properties to fetch
|
||||
*
|
||||
* @return array<string|int,EntityBaseInterface> Messages indexed by ID
|
||||
* @return array<string,EntityBaseInterface> Messages indexed by Urn
|
||||
*/
|
||||
public function entityList(string|int $collection, ?IFilter $filter = null, ?ISort $sort = null, ?IRange $range = null, ?array $properties = null): array;
|
||||
public function entityListBulk(string|int $collection, ?IFilter $filter = null, ?ISort $sort = null, ?IRange $range = null, ?array $properties = null): array;
|
||||
|
||||
/**
|
||||
* Lists messages in a collection
|
||||
@@ -244,11 +246,33 @@ interface ServiceBaseInterface extends ResourceServiceBaseInterface {
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @param string|int $collection Collection ID
|
||||
* @param string|int ...$identifiers Message IDs to fetch
|
||||
* @param EntityIdentifierInterface ...$identifiers Message identifiers to fetch
|
||||
*
|
||||
* @return array<string|int,EntityBaseInterface> Messages indexed by ID
|
||||
* @return array<string,EntityBaseInterface> Messages indexed by Urn
|
||||
*/
|
||||
public function entityFetch(string|int $collection, string|int ...$identifiers): array;
|
||||
public function entityFetchBulk(EntityIdentifierInterface ...$identifiers): array;
|
||||
|
||||
/**
|
||||
* Fetches one or more entities
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @param EntityIdentifierInterface ...$identifiers Message identifiers to fetch
|
||||
*
|
||||
* @return Generator<string,EntityBaseInterface> Yields messages one by one
|
||||
*/
|
||||
public function entityFetchStream(EntityIdentifierInterface ...$identifiers): Generator;
|
||||
|
||||
|
||||
/**
|
||||
* Downloads a message or part of a message
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*
|
||||
* @param EntityIdentifierInterface $target Message identifier
|
||||
* @param array|null $part Optional part to download
|
||||
*
|
||||
* @return BinaryResource
|
||||
*/
|
||||
public function entityDownload(EntityIdentifierInterface $target, array|null $part): BinaryResource;
|
||||
}
|
||||
|
||||
37
shared/lib/Resource/BinaryResource.php
Normal file
37
shared/lib/Resource/BinaryResource.php
Normal file
@@ -0,0 +1,37 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
/**
|
||||
* SPDX-FileCopyrightText: Sebastian Krupinski <krupinski01@gmail.com>
|
||||
* SPDX-License-Identifier: AGPL-3.0-or-later
|
||||
*/
|
||||
|
||||
namespace KTXF\Resource;
|
||||
|
||||
/**
|
||||
* Carries file-like binary content metadata and a byte stream.
|
||||
*/
|
||||
final class BinaryResource
|
||||
{
|
||||
public function __construct(
|
||||
private readonly string $filename,
|
||||
private readonly string $mimeType,
|
||||
private readonly \Generator $stream,
|
||||
) {}
|
||||
|
||||
public function filename(): string
|
||||
{
|
||||
return $this->filename;
|
||||
}
|
||||
|
||||
public function mimeType(): string
|
||||
{
|
||||
return $this->mimeType;
|
||||
}
|
||||
|
||||
public function stream(): \Generator
|
||||
{
|
||||
return $this->stream;
|
||||
}
|
||||
}
|
||||
@@ -71,6 +71,13 @@ abstract class NodeBaseAbstract implements NodeBaseInterface {
|
||||
return $this->data[static::PROPERTY_TYPE];
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
public function urn(): string {
|
||||
return (string) $this->nodeIdentifier();
|
||||
}
|
||||
|
||||
/**
|
||||
* @inheritDoc
|
||||
*/
|
||||
|
||||
@@ -35,6 +35,13 @@ interface NodeBaseInterface extends JsonSerializable {
|
||||
* @since 2025.05.01
|
||||
*/
|
||||
public function type(): string;
|
||||
|
||||
/**
|
||||
* Node URN
|
||||
*
|
||||
* @since 2025.05.01
|
||||
*/
|
||||
public function urn(): string;
|
||||
|
||||
/**
|
||||
* Provider identifier
|
||||
|
||||
@@ -14,11 +14,6 @@ interface ResourceProviderBaseInterface extends ProviderInterface, JsonSerializa
|
||||
public const CAPABILITY_SERVICE_LIST = 'ServiceList';
|
||||
public const CAPABILITY_SERVICE_FETCH = 'ServiceFetch';
|
||||
public const CAPABILITY_SERVICE_EXTANT = 'ServiceExtant';
|
||||
public const CAPABILITY_SERVICE_CREATE = 'ServiceCreate';
|
||||
public const CAPABILITY_SERVICE_MODIFY = 'ServiceModify';
|
||||
public const CAPABILITY_SERVICE_DESTROY = 'ServiceDestroy';
|
||||
public const CAPABILITY_SERVICE_DISCOVER = 'ServiceDiscover';
|
||||
public const CAPABILITY_SERVICE_TEST = 'ServiceTest';
|
||||
|
||||
public const JSON_TYPE = 'resource.provider';
|
||||
public const JSON_PROPERTY_TYPE = '@type';
|
||||
|
||||
@@ -12,6 +12,10 @@ namespace KTXF\Resource\Provider;
|
||||
use KTXF\Json\JsonDeserializable;
|
||||
|
||||
interface ResourceProviderServiceMutateInterface extends JsonDeserializable {
|
||||
|
||||
public const CAPABILITY_SERVICE_CREATE = 'ServiceCreate';
|
||||
public const CAPABILITY_SERVICE_MODIFY = 'ServiceModify';
|
||||
public const CAPABILITY_SERVICE_DESTROY = 'ServiceDestroy';
|
||||
|
||||
/**
|
||||
* construct and new blank service instance
|
||||
|
||||
Reference in New Issue
Block a user