{"id":29138611,"url":"https://github.com/nextcloud-libraries/search","last_synced_at":"2026-02-03T02:02:12.477Z","repository":{"id":260540312,"uuid":"834806578","full_name":"nextcloud-libraries/search","owner":"nextcloud-libraries","description":"Unified search helpers for Nextcloud apps and libraries","archived":false,"fork":false,"pushed_at":"2024-07-28T12:24:06.000Z","size":14,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2024-10-31T22:52:06.824Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":null,"has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nextcloud-libraries.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-07-28T12:24:05.000Z","updated_at":"2024-07-28T12:24:13.000Z","dependencies_parsed_at":"2024-10-31T22:52:08.446Z","dependency_job_id":"62ca740a-d7bf-49fd-b216-0c1fb1149853","html_url":"https://github.com/nextcloud-libraries/search","commit_stats":null,"previous_names":["nextcloud-libraries/search"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/nextcloud-libraries/search","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fsearch","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fsearch/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fsearch/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fsearch/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nextcloud-libraries","download_url":"https://codeload.github.com/nextcloud-libraries/search/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nextcloud-libraries%2Fsearch/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262788745,"owners_count":23364399,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-06-30T14:10:25.668Z","updated_at":"2026-02-03T02:02:12.472Z","avatar_url":"https://github.com/nextcloud-libraries.png","language":null,"readme":"# @nextcloud/search\n\nUnified search helpers for Nextcloud apps and libraries.\n\n## Installation\n\n```bash\nnpm install @nextcloud/search\n```\n\n## Usage\n\n### FilterBuilder\n\nBuild search filters with a fluent API:\n\n```typescript\nimport { FilterBuilder } from '@nextcloud/search'\n\nconst filters = new FilterBuilder()\n  .term('quarterly report')\n  .thisMonth()\n  .user('admin')\n  .build()\n\n// Serialize for API requests\nconst params = filters.toQueryParams()\n// { term: 'quarterly report', since: '2025-01-01T...', until: '2025-01-31T...', person: 'user:admin' }\n```\n\n### Date Range Helpers\n\n```typescript\nconst filters = new FilterBuilder()\n  .term('meeting notes')\n  .today()           // From start of today\n  // .thisWeek()     // From start of current week (Monday)\n  // .thisMonth()    // From start of current month\n  // .thisYear()     // From start of current year\n  // .lastDays(7)    // Last 7 days\n  // .dateRange({ since: new Date('2025-01-01'), until: new Date('2025-06-30') })\n  .build()\n```\n\n### FilterCollection\n\nWork with immutable filter collections:\n\n```typescript\nimport { FilterCollection } from '@nextcloud/search'\n\n// Parse from URL query parameters\nconst definitions = new Map([\n  ['term', { type: 'string' }],\n  ['since', { type: 'datetime' }],\n  ['person', { type: 'person' }],\n])\n\nconst collection = FilterCollection.fromQueryParams(\n  { term: 'report', since: '2025-01-01T00:00:00.000Z' },\n  definitions\n)\n\n// Access typed values\nconst term = collection.getTerm()           // 'report'\nconst dateRange = collection.getDateRange() // { since: Date, until?: Date }\nconst person = collection.getPerson()       // { type: 'user', id: 'admin' } | null\n\n// Immutable updates\nconst updated = collection\n  .with('person', { name: 'person', type: 'person', value: { type: 'user', id: 'alice' } })\n  .without('since')\n```\n\n### Types\n\n```typescript\nimport type {\n  Filter,\n  FilterDefinition,\n  DateRange,\n  PersonValue,\n  SearchQuery,\n  SearchResultEntry,\n  ProviderInfo,\n} from '@nextcloud/search'\n```\n\n## Development\n\n```bash\nnpm install\nnpm test\nnpm run build\n```\n\n## License\n\nAGPL-3.0-or-later\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextcloud-libraries%2Fsearch","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnextcloud-libraries%2Fsearch","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnextcloud-libraries%2Fsearch/lists"}