Compare commits
11 Commits
0b01cd0a1a
...
93872b601c
| Author | SHA1 | Date | |
|---|---|---|---|
| 93872b601c | |||
| 439eaabce3 | |||
| 16df84cb28 | |||
| e7ba07bf03 | |||
| 69bbbb6c86 | |||
| fdfaf562a0 | |||
| 4cbde63865 | |||
| 808ed192af | |||
| 511a94a0fa | |||
| 52fdb17b09 | |||
| 9dc7a90f42 |
@@ -25,11 +25,17 @@ jobs:
|
|||||||
tools: composer:v2
|
tools: composer:v2
|
||||||
|
|
||||||
- name: Install Renovate
|
- name: Install Renovate
|
||||||
run: npm install -g renovate
|
run: |
|
||||||
|
npm install --global --no-audit --fund=false \
|
||||||
|
--prefix "${{ runner.temp }}/renovate-npm" \
|
||||||
|
--cache "${{ runner.temp }}/renovate-npm-cache" \
|
||||||
|
renovate
|
||||||
|
"${{ runner.temp }}/renovate-npm/bin/renovate" --version
|
||||||
|
|
||||||
- name: Run Renovate
|
- name: Run Renovate
|
||||||
env:
|
env:
|
||||||
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
|
RENOVATE_TOKEN: ${{ secrets.RENOVATE_TOKEN }}
|
||||||
RENOVATE_PLATFORM: gitea
|
RENOVATE_PLATFORM: gitea
|
||||||
RENOVATE_ENDPOINT: https://git.ktrix.dev/api/v1
|
RENOVATE_ENDPOINT: https://git.ktrix.dev/api/v1
|
||||||
run: renovate ${{ gitea.repository }}
|
run: |
|
||||||
|
"${{ runner.temp }}/renovate-npm/bin/renovate" ${{ gitea.repository }}
|
||||||
|
|||||||
+1
-1
@@ -31,7 +31,7 @@
|
|||||||
"sebastiankrupinski/jmap-client-php": "dev-main"
|
"sebastiankrupinski/jmap-client-php": "dev-main"
|
||||||
},
|
},
|
||||||
"require-dev": {
|
"require-dev": {
|
||||||
"phpunit/phpunit": "^11.0"
|
"phpunit/phpunit": "^13.0"
|
||||||
},
|
},
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|||||||
Generated
+22
-38
@@ -8,16 +8,16 @@
|
|||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "guzzlehttp/guzzle",
|
"name": "guzzlehttp/guzzle",
|
||||||
"version": "7.13.0",
|
"version": "7.13.1",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/guzzle/guzzle.git",
|
"url": "https://github.com/guzzle/guzzle.git",
|
||||||
"reference": "a4decaa9745dc567467970e43f183e260cfa51fd"
|
"reference": "55901a76dfd2006a0cc012b9e3c5b487f796478d"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/a4decaa9745dc567467970e43f183e260cfa51fd",
|
"url": "https://api.github.com/repos/guzzle/guzzle/zipball/55901a76dfd2006a0cc012b9e3c5b487f796478d",
|
||||||
"reference": "a4decaa9745dc567467970e43f183e260cfa51fd",
|
"reference": "55901a76dfd2006a0cc012b9e3c5b487f796478d",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -116,7 +116,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/guzzle/guzzle/issues",
|
"issues": "https://github.com/guzzle/guzzle/issues",
|
||||||
"source": "https://github.com/guzzle/guzzle/tree/7.13.0"
|
"source": "https://github.com/guzzle/guzzle/tree/7.13.1"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -132,7 +132,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2026-06-29T13:31:06+00:00"
|
"time": "2026-06-29T20:14:18+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "guzzlehttp/promises",
|
"name": "guzzlehttp/promises",
|
||||||
@@ -220,16 +220,16 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "guzzlehttp/psr7",
|
"name": "guzzlehttp/psr7",
|
||||||
"version": "2.12.3",
|
"version": "2.12.4",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/guzzle/psr7.git",
|
"url": "https://github.com/guzzle/psr7.git",
|
||||||
"reference": "7ec62dc3f44aa218487dbed81a9bf9bc647be55d"
|
"reference": "51e27f9e2b332ab3e72f4520d5ff4f3c68c3577c"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/guzzle/psr7/zipball/7ec62dc3f44aa218487dbed81a9bf9bc647be55d",
|
"url": "https://api.github.com/repos/guzzle/psr7/zipball/51e27f9e2b332ab3e72f4520d5ff4f3c68c3577c",
|
||||||
"reference": "7ec62dc3f44aa218487dbed81a9bf9bc647be55d",
|
"reference": "51e27f9e2b332ab3e72f4520d5ff4f3c68c3577c",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
@@ -319,7 +319,7 @@
|
|||||||
],
|
],
|
||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/guzzle/psr7/issues",
|
"issues": "https://github.com/guzzle/psr7/issues",
|
||||||
"source": "https://github.com/guzzle/psr7/tree/2.12.3"
|
"source": "https://github.com/guzzle/psr7/tree/2.12.4"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
@@ -335,7 +335,7 @@
|
|||||||
"type": "tidelift"
|
"type": "tidelift"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2026-06-23T15:21:08+00:00"
|
"time": "2026-07-08T15:56:20+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "php-http/discovery",
|
"name": "php-http/discovery",
|
||||||
@@ -1445,24 +1445,24 @@
|
|||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "phpunit/phpunit",
|
"name": "phpunit/phpunit",
|
||||||
"version": "11.5.55",
|
"version": "11.5.56",
|
||||||
"source": {
|
"source": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
"url": "https://github.com/sebastianbergmann/phpunit.git",
|
||||||
"reference": "adc7262fccc12de2b30f12a8aa0b33775d814f00"
|
"reference": "5f83edffa6967c3db468d48a695ec7bcb02e9256"
|
||||||
},
|
},
|
||||||
"dist": {
|
"dist": {
|
||||||
"type": "zip",
|
"type": "zip",
|
||||||
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/adc7262fccc12de2b30f12a8aa0b33775d814f00",
|
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/5f83edffa6967c3db468d48a695ec7bcb02e9256",
|
||||||
"reference": "adc7262fccc12de2b30f12a8aa0b33775d814f00",
|
"reference": "5f83edffa6967c3db468d48a695ec7bcb02e9256",
|
||||||
"shasum": ""
|
"shasum": ""
|
||||||
},
|
},
|
||||||
"require": {
|
"require": {
|
||||||
"ext-dom": "*",
|
"ext-dom": "*",
|
||||||
|
"ext-filter": "*",
|
||||||
"ext-json": "*",
|
"ext-json": "*",
|
||||||
"ext-libxml": "*",
|
"ext-libxml": "*",
|
||||||
"ext-mbstring": "*",
|
"ext-mbstring": "*",
|
||||||
"ext-xml": "*",
|
|
||||||
"ext-xmlwriter": "*",
|
"ext-xmlwriter": "*",
|
||||||
"myclabs/deep-copy": "^1.13.4",
|
"myclabs/deep-copy": "^1.13.4",
|
||||||
"phar-io/manifest": "^2.0.4",
|
"phar-io/manifest": "^2.0.4",
|
||||||
@@ -1527,31 +1527,15 @@
|
|||||||
"support": {
|
"support": {
|
||||||
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
"issues": "https://github.com/sebastianbergmann/phpunit/issues",
|
||||||
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
|
"security": "https://github.com/sebastianbergmann/phpunit/security/policy",
|
||||||
"source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.55"
|
"source": "https://github.com/sebastianbergmann/phpunit/tree/11.5.56"
|
||||||
},
|
},
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"url": "https://phpunit.de/sponsors.html",
|
"url": "https://phpunit.de/sponsoring.html",
|
||||||
"type": "custom"
|
"type": "other"
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://github.com/sebastianbergmann",
|
|
||||||
"type": "github"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://liberapay.com/sebastianbergmann",
|
|
||||||
"type": "liberapay"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://thanks.dev/u/gh/sebastianbergmann",
|
|
||||||
"type": "thanks_dev"
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"url": "https://tidelift.com/funding/github/packagist/phpunit/phpunit",
|
|
||||||
"type": "tidelift"
|
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"time": "2026-02-18T12:37:06+00:00"
|
"time": "2026-07-06T14:52:39+00:00"
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"name": "sebastian/cli-parser",
|
"name": "sebastian/cli-parser",
|
||||||
@@ -2656,5 +2640,5 @@
|
|||||||
"platform-overrides": {
|
"platform-overrides": {
|
||||||
"php": "8.2"
|
"php": "8.2"
|
||||||
},
|
},
|
||||||
"plugin-api-version": "2.6.0"
|
"plugin-api-version": "2.9.0"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace KTXM\ProviderJmapc\Providers\Document;
|
namespace KTXM\ProviderJmapc\Providers\Document;
|
||||||
|
|
||||||
use KTXF\Resource\Documents\Collection\CollectionPropertiesMutableAbstract;
|
use KTXF\Documents\Collection\CollectionPropertiesMutableAbstract;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Document Collection Properties Implementation
|
* Document Collection Properties Implementation
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace KTXM\ProviderJmapc\Providers\Document;
|
namespace KTXM\ProviderJmapc\Providers\Document;
|
||||||
|
|
||||||
use KTXF\Resource\Documents\Collection\CollectionMutableAbstract;
|
use KTXF\Documents\Collection\CollectionMutableAbstract;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Document Collection Resource Implementation
|
* Document Collection Resource Implementation
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace KTXM\ProviderJmapc\Providers\Document;
|
namespace KTXM\ProviderJmapc\Providers\Document;
|
||||||
|
|
||||||
use KTXF\Resource\Documents\Entity\EntityPropertiesMutableAbstract;
|
use KTXF\Documents\Entity\EntityPropertiesMutableAbstract;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Document Collection Properties Implementation
|
* Document Collection Properties Implementation
|
||||||
|
|||||||
@@ -9,7 +9,7 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace KTXM\ProviderJmapc\Providers\Document;
|
namespace KTXM\ProviderJmapc\Providers\Document;
|
||||||
|
|
||||||
use KTXF\Resource\Documents\Entity\EntityMutableAbstract;
|
use KTXF\Documents\Entity\EntityMutableAbstract;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mail Entity Resource Implementation
|
* Mail Entity Resource Implementation
|
||||||
|
|||||||
@@ -9,11 +9,11 @@ declare(strict_types=1);
|
|||||||
|
|
||||||
namespace KTXM\ProviderJmapc\Providers\Document;
|
namespace KTXM\ProviderJmapc\Providers\Document;
|
||||||
|
|
||||||
use KTXF\Resource\Documents\Provider\ProviderBaseInterface;
|
use KTXF\Documents\Provider\ProviderBaseInterface;
|
||||||
use KTXF\Resource\Documents\Provider\ProviderServiceMutateInterface;
|
use KTXF\Documents\Provider\ProviderServiceMutateInterface;
|
||||||
use KTXF\Resource\Documents\Provider\ProviderServiceTestInterface;
|
use KTXF\Documents\Provider\ProviderServiceTestInterface;
|
||||||
use KTXF\Resource\Documents\Service\ServiceBaseInterface;
|
use KTXF\Documents\Service\ServiceBaseInterface;
|
||||||
use KTXF\Resource\Documents\Service\ServiceMutableInterface;
|
use KTXF\Documents\Service\ServiceMutableInterface;
|
||||||
use KTXF\Resource\Provider\ResourceServiceLocationInterface;
|
use KTXF\Resource\Provider\ResourceServiceLocationInterface;
|
||||||
use KTXF\Resource\Provider\ResourceServiceMutateInterface;
|
use KTXF\Resource\Provider\ResourceServiceMutateInterface;
|
||||||
use KTXM\ProviderJmapc\Service\Discovery;
|
use KTXM\ProviderJmapc\Service\Discovery;
|
||||||
@@ -21,9 +21,9 @@ use KTXM\ProviderJmapc\Service\Remote\RemoteService;
|
|||||||
use KTXM\ProviderJmapc\Stores\ServiceStore;
|
use KTXM\ProviderJmapc\Stores\ServiceStore;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* JMAP Mail Provider
|
* JMAP Documents Provider
|
||||||
*/
|
*/
|
||||||
class Provider implements ProviderServiceMutateInterface, ProviderServiceTestInterface
|
class Provider implements ProviderBaseInterface, ProviderServiceMutateInterface, ProviderServiceTestInterface
|
||||||
{
|
{
|
||||||
|
|
||||||
public const JSON_TYPE = ProviderBaseInterface::JSON_TYPE;
|
public const JSON_TYPE = ProviderBaseInterface::JSON_TYPE;
|
||||||
@@ -63,7 +63,7 @@ class Provider implements ProviderServiceMutateInterface, ProviderServiceTestInt
|
|||||||
|
|
||||||
public function type(): string
|
public function type(): string
|
||||||
{
|
{
|
||||||
return self::TYPE_MAIL;
|
return self::TYPE_DOCUMENT;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function identifier(): string
|
public function identifier(): string
|
||||||
@@ -170,7 +170,7 @@ class Provider implements ProviderServiceMutateInterface, ProviderServiceTestInt
|
|||||||
return $discovery->discover($identity, $location, $secret, $verifySSL);
|
return $discovery->discover($identity, $location, $secret, $verifySSL);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function serviceTest(ServiceBaseInterface $service, array $options = []): array {
|
public function serviceTest(ServiceBaseInterface|ServiceMutableInterface $service, array $options = []): array {
|
||||||
$startTime = microtime(true);
|
$startTime = microtime(true);
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
|||||||
@@ -10,17 +10,20 @@ declare(strict_types=1);
|
|||||||
namespace KTXM\ProviderJmapc\Providers\Document;
|
namespace KTXM\ProviderJmapc\Providers\Document;
|
||||||
|
|
||||||
use Generator;
|
use Generator;
|
||||||
use KTXF\Resource\Provider\ResourceServiceIdentityInterface;
|
use KTXF\Documents\Collection\CollectionBaseInterface;
|
||||||
use KTXF\Resource\Provider\ResourceServiceLocationInterface;
|
use KTXF\Documents\Collection\CollectionMutableInterface;
|
||||||
|
use KTXF\Documents\Collection\CollectionPropertiesBaseInterface;
|
||||||
|
use KTXF\Documents\Service\ServiceBaseInterface;
|
||||||
|
use KTXF\Documents\Service\ServiceCollectionMutableInterface;
|
||||||
|
use KTXF\Documents\Service\ServiceConfigurableInterface;
|
||||||
|
use KTXF\Documents\Service\ServiceMutableInterface;
|
||||||
use KTXF\Resource\Delta\Delta;
|
use KTXF\Resource\Delta\Delta;
|
||||||
use KTXF\Resource\Documents\Collection\CollectionBaseInterface;
|
|
||||||
use KTXF\Resource\Documents\Collection\CollectionMutableInterface;
|
|
||||||
use KTXF\Resource\Documents\Service\ServiceBaseInterface;
|
|
||||||
use KTXF\Resource\Documents\Service\ServiceCollectionMutableInterface;
|
|
||||||
use KTXF\Resource\Documents\Service\ServiceConfigurableInterface;
|
|
||||||
use KTXF\Resource\Documents\Service\ServiceMutableInterface;
|
|
||||||
use KTXF\Resource\Filter\Filter;
|
use KTXF\Resource\Filter\Filter;
|
||||||
use KTXF\Resource\Filter\IFilter;
|
use KTXF\Resource\Filter\IFilter;
|
||||||
|
use KTXF\Resource\Identifier\CollectionIdentifierInterface;
|
||||||
|
use KTXF\Resource\Identifier\EntityIdentifierInterface;
|
||||||
|
use KTXF\Resource\Provider\ResourceServiceIdentityInterface;
|
||||||
|
use KTXF\Resource\Provider\ResourceServiceLocationInterface;
|
||||||
use KTXF\Resource\Range\IRange;
|
use KTXF\Resource\Range\IRange;
|
||||||
use KTXF\Resource\Range\Range;
|
use KTXF\Resource\Range\Range;
|
||||||
use KTXF\Resource\Range\RangeType;
|
use KTXF\Resource\Range\RangeType;
|
||||||
@@ -316,18 +319,30 @@ class Service implements ServiceBaseInterface, ServiceMutableInterface, ServiceC
|
|||||||
return new CollectionResource(provider: $this->provider(), service: $this->identifier());
|
return new CollectionResource(provider: $this->provider(), service: $this->identifier());
|
||||||
}
|
}
|
||||||
|
|
||||||
public function collectionCreate(string|int|null $location, CollectionMutableInterface $collection, array $options = []): CollectionBaseInterface
|
/**
|
||||||
|
* Convert incoming collection properties into a native CollectionResource
|
||||||
|
*/
|
||||||
|
private function collectionNative(CollectionPropertiesBaseInterface $properties, string|int|null $identifier = null): CollectionResource
|
||||||
|
{
|
||||||
|
if ($properties instanceof CollectionResource) {
|
||||||
|
return clone $properties;
|
||||||
|
}
|
||||||
|
$object = new CollectionResource(provider: $this->provider(), service: $this->identifier());
|
||||||
|
$object->jsonDeserialize(array_filter([
|
||||||
|
CollectionResource::PROPERTY_IDENTIFIER => $identifier,
|
||||||
|
CollectionResource::PROPERTY_PROPERTIES => $properties->jsonSerialize(),
|
||||||
|
], fn($v) => $v !== null));
|
||||||
|
return $object;
|
||||||
|
}
|
||||||
|
|
||||||
|
public function collectionCreate(CollectionIdentifierInterface|null $target, CollectionPropertiesBaseInterface $properties, array $options = []): CollectionBaseInterface
|
||||||
{
|
{
|
||||||
$this->initialize();
|
$this->initialize();
|
||||||
|
|
||||||
if ($collection instanceof CollectionResource === false) {
|
$collection = $this->collectionNative($properties);
|
||||||
$object = new CollectionResource(provider: $this->provider(), service: $this->identifier());
|
|
||||||
$object->jsonDeserialize($collection->jsonSerialize());
|
|
||||||
$collection = $object;
|
|
||||||
}
|
|
||||||
|
|
||||||
$collection = $collection->toJmap();
|
$collection = $collection->toJmap();
|
||||||
$collection = $this->remoteService->collectionCreate($location, $collection, $options);
|
$collection = $this->remoteService->collectionCreate($target?->collection(), $collection, $options);
|
||||||
|
|
||||||
$object = new CollectionResource(provider: $this->provider(), service: $this->identifier());
|
$object = new CollectionResource(provider: $this->provider(), service: $this->identifier());
|
||||||
$object->fromJmap($collection);
|
$object->fromJmap($collection);
|
||||||
@@ -335,15 +350,12 @@ class Service implements ServiceBaseInterface, ServiceMutableInterface, ServiceC
|
|||||||
return $object;
|
return $object;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function collectionUpdate(string|int $identifier, CollectionMutableInterface $collection): CollectionBaseInterface
|
public function collectionUpdate(CollectionIdentifierInterface $target, CollectionPropertiesBaseInterface $properties): CollectionBaseInterface
|
||||||
{
|
{
|
||||||
$this->initialize();
|
$this->initialize();
|
||||||
|
|
||||||
if ($collection instanceof CollectionResource === false) {
|
$identifier = $target->collection();
|
||||||
$object = new CollectionResource(provider: $this->provider(), service: $this->identifier());
|
$collection = $this->collectionNative($properties, $identifier);
|
||||||
$object->jsonDeserialize($collection->jsonSerialize());
|
|
||||||
$collection = $object;
|
|
||||||
}
|
|
||||||
|
|
||||||
$collection = $collection->toJmap();
|
$collection = $collection->toJmap();
|
||||||
$collection = $this->remoteService->collectionModify($identifier, $collection);
|
$collection = $this->remoteService->collectionModify($identifier, $collection);
|
||||||
@@ -354,14 +366,17 @@ class Service implements ServiceBaseInterface, ServiceMutableInterface, ServiceC
|
|||||||
return $object;
|
return $object;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function collectionDelete(string|int $identifier, bool $force = false, bool $recursive = false): bool
|
public function collectionDelete(CollectionIdentifierInterface $target, bool $force = false): CollectionBaseInterface | true
|
||||||
{
|
{
|
||||||
$this->initialize();
|
$this->initialize();
|
||||||
|
|
||||||
return $this->remoteService->collectionDestroy($identifier, $force, $recursive) !== null;
|
if ($this->remoteService->collectionDestroy($target->collection(), $force, $force) === null) {
|
||||||
|
throw new \RuntimeException("Failed to delete collection: {$target->collection()}");
|
||||||
|
}
|
||||||
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function collectionMove(string|int $identifier, string|int|null $targetLocation): CollectionBaseInterface
|
public function collectionMove(CollectionIdentifierInterface|null $target, CollectionIdentifierInterface $source): CollectionBaseInterface
|
||||||
{
|
{
|
||||||
// TODO: Implement collection move
|
// TODO: Implement collection move
|
||||||
$this->initialize();
|
$this->initialize();
|
||||||
@@ -369,12 +384,20 @@ class Service implements ServiceBaseInterface, ServiceMutableInterface, ServiceC
|
|||||||
return $collection;
|
return $collection;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function collectionCopy(CollectionIdentifierInterface|null $target, CollectionIdentifierInterface $source): CollectionBaseInterface
|
||||||
|
{
|
||||||
|
// TODO: Implement collection copy
|
||||||
|
$this->initialize();
|
||||||
|
$collection = new CollectionResource(provider: $this->provider(), service: $this->identifier());
|
||||||
|
return $collection;
|
||||||
|
}
|
||||||
|
|
||||||
// Entity operations
|
// Entity operations
|
||||||
|
|
||||||
public function entityList(string|int|null $collection, ?IFilter $filter = null, ?ISort $sort = null, ?IRange $range = null, ?array $properties = null): array
|
public function entityListBulk(string|int|null $collection, ?IFilter $filter = null, ?ISort $sort = null, ?IRange $range = null, ?array $properties = null): array
|
||||||
{
|
{
|
||||||
$this->initialize();
|
$this->initialize();
|
||||||
|
|
||||||
$result = $this->remoteService->entityList($collection, $filter, $sort, $range, $properties);
|
$result = $this->remoteService->entityList($collection, $filter, $sort, $range, $properties);
|
||||||
|
|
||||||
$list = [];
|
$list = [];
|
||||||
@@ -390,7 +413,7 @@ class Service implements ServiceBaseInterface, ServiceMutableInterface, ServiceC
|
|||||||
return $list;
|
return $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function entityListStream(string|int $collection, ?IFilter $filter = null, ?ISort $sort = null, ?IRange $range = null, ?array $properties = null): Generator
|
public function entityListStream(string|int|null $collection, ?IFilter $filter = null, ?ISort $sort = null, ?IRange $range = null, ?array $properties = null): Generator
|
||||||
{
|
{
|
||||||
$this->initialize();
|
$this->initialize();
|
||||||
|
|
||||||
@@ -421,11 +444,11 @@ class Service implements ServiceBaseInterface, ServiceMutableInterface, ServiceC
|
|||||||
return new Range();
|
return new Range();
|
||||||
}
|
}
|
||||||
|
|
||||||
public function entityDelta(string|int|null $collection, string $signature, string $detail = 'ids'): Delta
|
public function entityDelta(string|int|null $collection, string $signature): Delta
|
||||||
{
|
{
|
||||||
$this->initialize();
|
$this->initialize();
|
||||||
|
|
||||||
return $this->remoteService->entityDelta($collection, $signature, $detail);
|
return $this->remoteService->entityDelta($collection, $signature, 'ids');
|
||||||
}
|
}
|
||||||
|
|
||||||
public function entityExtant(string|int|null $collection, string|int ...$identifiers): array
|
public function entityExtant(string|int|null $collection, string|int ...$identifiers): array
|
||||||
@@ -435,48 +458,45 @@ class Service implements ServiceBaseInterface, ServiceMutableInterface, ServiceC
|
|||||||
return $this->remoteService->entityExtant(...$identifiers);
|
return $this->remoteService->entityExtant(...$identifiers);
|
||||||
}
|
}
|
||||||
|
|
||||||
public function entityFetch(string|int|null $collection, string|int ...$identifiers): array
|
public function entityFetchBulk(EntityIdentifierInterface ...$identifiers): array
|
||||||
{
|
{
|
||||||
$this->initialize();
|
$this->initialize();
|
||||||
|
|
||||||
$entities = $this->remoteService->entityFetch(...$identifiers);
|
$entityIds = array_map(fn($identifier) => $identifier->entity(), $identifiers);
|
||||||
|
$entities = $this->remoteService->entityFetch(...$entityIds);
|
||||||
foreach ($entities as &$entity) {
|
|
||||||
|
$list = [];
|
||||||
|
foreach ($entities as $key => $entity) {
|
||||||
if (is_array($entity) && isset($entity['id'])) {
|
if (is_array($entity) && isset($entity['id'])) {
|
||||||
$object = new EntityResource(provider: $this->provider(), service: $this->identifier());
|
$object = new EntityResource(provider: $this->provider(), service: $this->identifier());
|
||||||
$object->fromJmap($entity);
|
$object->fromJmap($entity);
|
||||||
$entity = $object;
|
$list[$object->identifier()] = $object;
|
||||||
|
} else {
|
||||||
|
$list[$key] = $entity;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return $entities;
|
return $list;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function entityRead(string|int|null $collection, string|int $identifier): ?string
|
public function entityFetchStream(EntityIdentifierInterface ...$identifiers): Generator
|
||||||
|
{
|
||||||
|
yield from $this->entityFetchBulk(...$identifiers);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function entityRead(EntityIdentifierInterface $target): ?string
|
||||||
{
|
{
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Node operations
|
public function entityReadStream(EntityIdentifierInterface $target)
|
||||||
|
|
||||||
public function nodeList(string|int|null $collection, bool $recursive = false, ?IFilter $filter = null, ?ISort $sort = null, ?IRange $range = null, ?array $properties = null): array
|
|
||||||
{
|
{
|
||||||
return [];
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function nodeListFilter(): IFilter
|
public function entityReadChunk(EntityIdentifierInterface $target, int $offset, int $length): ?string
|
||||||
{
|
{
|
||||||
return new Filter(['']);
|
return null;
|
||||||
}
|
|
||||||
|
|
||||||
public function nodeListSort(): ISort
|
|
||||||
{
|
|
||||||
return new Sort(['']);
|
|
||||||
}
|
|
||||||
|
|
||||||
public function nodeDelta(string|int|null $collection, string $signature, string $detail = 'ids'): Delta
|
|
||||||
{
|
|
||||||
return new Delta();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Generated
+8
-8
@@ -1836,9 +1836,9 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/postcss": {
|
"node_modules/postcss": {
|
||||||
"version": "8.5.15",
|
"version": "8.5.16",
|
||||||
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.15.tgz",
|
"resolved": "https://registry.npmjs.org/postcss/-/postcss-8.5.16.tgz",
|
||||||
"integrity": "sha512-FfR8sjd4em2T6fb3I2MwAJU7HWVMr9zba+enmQeeWFfCbm+UOC/0X4DS8XtpUTMwWMGbjKYP7xjfNekzyGmB3A==",
|
"integrity": "sha512-vuwillviilfKZsg0VGj5R/YwwcHx4SLsIOI/7K6mQkWx+l5cUHTjj5g0AasTBcyXsbfTgrwsUNmVUb5xVwyPwg==",
|
||||||
"funding": [
|
"funding": [
|
||||||
{
|
{
|
||||||
"type": "opencollective",
|
"type": "opencollective",
|
||||||
@@ -2145,16 +2145,16 @@
|
|||||||
}
|
}
|
||||||
},
|
},
|
||||||
"node_modules/vite": {
|
"node_modules/vite": {
|
||||||
"version": "8.1.0",
|
"version": "8.1.3",
|
||||||
"resolved": "https://registry.npmjs.org/vite/-/vite-8.1.0.tgz",
|
"resolved": "https://registry.npmjs.org/vite/-/vite-8.1.3.tgz",
|
||||||
"integrity": "sha512-BuJcQK/56NQTWDGn4ABea3q4SSBdNPWwNZKTkkUpcMPnLoquSYH8llRtSUIgoL1KSCpHt5eghLShn50mH36y7Q==",
|
"integrity": "sha512-Ds+gBRbj0lwRO2Y5hwnUBdxSwlAve9LeRyU4sNnAr0ewW0gWF0n5bgXgUzbgZ49MV9BVUAQUFYVcDUcilUExMA==",
|
||||||
"devOptional": true,
|
"devOptional": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"lightningcss": "^1.32.0",
|
"lightningcss": "^1.32.0",
|
||||||
"picomatch": "^4.0.4",
|
"picomatch": "^4.0.4",
|
||||||
"postcss": "^8.5.15",
|
"postcss": "^8.5.16",
|
||||||
"rolldown": "~1.1.2",
|
"rolldown": "~1.1.3",
|
||||||
"tinyglobby": "^0.2.17"
|
"tinyglobby": "^0.2.17"
|
||||||
},
|
},
|
||||||
"bin": {
|
"bin": {
|
||||||
|
|||||||
Reference in New Issue
Block a user