From 5d757207c87d5a6c6c11ee1fa295072c7c636dc9 Mon Sep 17 00:00:00 2001 From: Juergen Kunz Date: Mon, 18 Aug 2025 19:38:44 +0000 Subject: [PATCH] fix(docs): Add local Claude settings and remove outdated codex.md --- changelog.md | 7 ++++ codex.md | 77 ---------------------------------------- ts/00_commitinfo_data.ts | 2 +- 3 files changed, 8 insertions(+), 78 deletions(-) delete mode 100644 codex.md diff --git a/changelog.md b/changelog.md index 61f8d72..cd7cf4c 100644 --- a/changelog.md +++ b/changelog.md @@ -1,5 +1,12 @@ # Changelog +## 2025-08-18 - 5.16.3 - fix(docs) +Add local Claude settings and remove outdated codex.md + +- Added .claude/settings.local.json to store local Claude/assistant permissions and configuration. +- Removed codex.md (project overview) — documentation file deleted. +- No runtime/library code changes; documentation/configuration-only update, bump patch version. + ## 2025-08-18 - 5.16.2 - fix(readme) Update README: clarify examples, expand search/cursor/docs and add local Claude settings diff --git a/codex.md b/codex.md deleted file mode 100644 index c95454b..0000000 --- a/codex.md +++ /dev/null @@ -1,77 +0,0 @@ -# SmartData Project Overview - -This document provides a high-level overview of the SmartData library (`@push.rocks/smartdata`), its architecture, core components, and key features—including recent enhancements to the search API. - -## 1. Project Purpose -- A TypeScript‑first wrapper around MongoDB that supplies: - - Strongly‑typed document & collection classes - - Decorator‑based schema definition (no external schema files) - - Advanced search capabilities with Lucene‑style queries - - Built‑in support for real‑time data sync, distributed coordination, and key‑value EasyStore - -## 2. Core Concepts & Components -- **SmartDataDb**: Manages the MongoDB connection, pooling, and initialization of collections. -- **SmartDataDbDoc**: Base class for all document models; provides CRUD, upsert, and cursor APIs. -- **Decorators**: - - `@Collection`: Associates a class with a MongoDB collection - - `@svDb()`: Marks a field as persisted to the DB - - `@unI()`: Marks a field as a unique index - - `@index()`: Adds a regular index - - `@searchable()`: Marks a field for inclusion in text searches or regex queries -- **SmartdataCollection**: Wraps a MongoDB collection; auto‑creates indexes based on decorators. -- **Lucene Adapter**: Parses a Lucene query string into an AST and transforms it to a MongoDB filter object. -- **EasyStore**: A simple, schema‑less key‑value store built on top of MongoDB for sharing ephemeral data. -- **Distributed Coordinator**: Leader election and task‑distribution API for building resilient, multi‑instance systems. -- **Watcher**: Listens to change streams for real‑time updates and integrates with RxJS. - -## 3. Search API -SmartData provides a unified `.search(query[, opts])` method on all models with `@searchable()` fields: - -- **Supported Syntax**: - 1. Exact field:value (e.g. `field:Value`) - 2. Quoted phrases (e.g. `"exact phrase"` or `'exact phrase'`) - 3. Wildcards: `*` (zero or more chars) and `?` (single char) - 4. Boolean operators: `AND`, `OR`, `NOT` - 5. Grouping: parenthesis `(A OR B) AND C` - 6. Range queries: `[num TO num]`, `{num TO num}` - 7. Multi‑term unquoted: terms AND’d across all searchable fields - 8. Empty query returns all documents - -- **Fallback Mechanisms**: - 1. Text index based `$text` search (if supported) - 2. Field‑scoped and multi‑field regex queries - 3. In‑memory filtering for complex or unsupported cases - -### New Security & Extensibility Hooks -The `.search(query, opts?)` signature now accepts a `SearchOptions` object: -```ts -interface SearchOptions { - filter?: Record; // Additional MongoDB filter AND‑merged - validate?: (doc: T) => boolean; // Post‑fetch hook to drop results -} -``` -- **filter**: Enforces mandatory constraints (e.g. multi‑tenant isolation) directly in the Mongo query. -- **validate**: An async function that runs after fetching; return `false` to exclude a document. - -## 4. Testing Strategy -- Unit tests in `test/test.search.ts` cover basic search functionality and new options: - - Exact, wildcard, phrase, boolean and grouping cases - - Implicit AND and mixed free‑term + field searches - - Edge cases (non‑searchable fields, quoted wildcards, no matches) - - `filter` and `validate` tests ensure security hooks work as intended -- Advanced search scenarios are covered in `test/test.search.advanced.ts`. - -## 5. Usage Example -```ts -// Basic search -const prods = await Product.search('wireless earbuds'); - -// Scoped search (only your organization’s items) -const myItems = await Product.search('book', { filter: { ownerId } }); - -// Post‑search validation (only cheap items) -const cheapItems = await Product.search('', { validate: p => p.price < 50 }); -``` - ---- -Last updated: 2025-04-22 \ No newline at end of file diff --git a/ts/00_commitinfo_data.ts b/ts/00_commitinfo_data.ts index 1230bd1..8a1380c 100644 --- a/ts/00_commitinfo_data.ts +++ b/ts/00_commitinfo_data.ts @@ -3,6 +3,6 @@ */ export const commitinfo = { name: '@push.rocks/smartdata', - version: '5.16.2', + version: '5.16.3', description: 'An advanced library for NoSQL data organization and manipulation using TypeScript with support for MongoDB, data validation, collections, and custom data types.' }