waaseyaa / northcloud
North Cloud client, content sync, and search provider for Waaseyaa applications
v0.1.0-alpha.148
2026-04-18 14:27 UTC
Requires
- php: >=8.4
- symfony/console: ^7.0
- waaseyaa/config: ^0.1
- waaseyaa/entity: ^0.1
- waaseyaa/foundation: ^0.1
- waaseyaa/http-client: ^0.1
- waaseyaa/search: ^0.1
Requires (Dev)
- phpunit/phpunit: ^10.5
This package is auto-updated.
Last update: 2026-04-19 18:56:38 UTC
README
North Cloud client, content sync, and search provider for Waaseyaa applications.
What this package gives you
NorthCloudClient— HTTP client for the North Cloud REST API (search, people, band office, dictionary, crawl jobs).NorthCloudCache— SQLite-backed response cache.NorthCloudSearchProvider— ImplementsWaaseyaa\Search\SearchProviderInterfaceso NC becomes a drop-in search backend.NcSyncService+NcSyncWorker+northcloud:synccommand — Generic content ingestion orchestrator that pulls NC search hits and persists them as Waaseyaa entities.NcHitToEntityMapperInterface— The extension seam. Implement one of these per target entity type in your app; the package handles everything else.
Installation
composer require waaseyaa/northcloud
Publish the config (optional):
./bin/waaseyaa config:publish northcloud
Set env vars:
NORTHCLOUD_BASE_URL=https://api.northcloud.one NORTHCLOUD_API_TOKEN= # only needed for authenticated endpoints
Usage: hooking up content sync in your app
Implement one mapper per entity type you want to populate from North Cloud:
use Waaseyaa\NorthCloud\Sync\NcHitToEntityMapperInterface; final class NcHitToKnowledgeItemMapper implements NcHitToEntityMapperInterface { public function entityType(): string { return 'knowledge_item'; } public function dedupField(): string { return 'source_url'; } public function supports(array $hit): bool { $topics = $hit['topics'] ?? []; return is_array($topics) && in_array('indigenous', $topics, true); } public function map(array $hit): array { return [ 'title' => (string) ($hit['title'] ?? ''), 'body' => (string) ($hit['snippet'] ?? $hit['body'] ?? ''), 'source_url' => (string) ($hit['url'] ?? ''), // ...app-specific fields ]; } }
Register the mapper in your AppServiceProvider:
$mapperRegistry = $container->get(MapperRegistry::class); $mapperRegistry->register(new NcHitToKnowledgeItemMapper(/* deps */));
Run a sync:
./bin/waaseyaa northcloud:sync --limit=20 ./bin/waaseyaa northcloud:sync --dry-run ./bin/waaseyaa northcloud:sync --since=2026-01-01
Architecture
NC API
↓
NorthCloudClient ──► NorthCloudCache (SQLite)
↓
NcSyncService ──► MapperRegistry ──► your NcHitToEntityMapperInterface
↓
EntityTypeManager ──► persisted entities
One NC hit may produce multiple entities — every registered mapper whose supports() returns true gets to create one.
Status
v0.1.0-alpha — API surface not yet stable. See waaseyaa/framework#TBD for rollout plan.