@goatlab/fluent-formio 0.6.16 → 0.6.18

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (2) hide show
  1. package/README.md +52 -35
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -1,49 +1,66 @@
1
- <!-- PROJECT SHIELDS -->
1
+ # @goatlab/fluent-formio
2
2
 
3
- [![Stargazers][stars-shield]][stars-url]
4
- [![Issues][issues-shield]][issues-url]
5
- [![MIT License][license-shield]][license-url]
6
- [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
3
+ A fluent query interface connector for Form.io that provides a consistent API for CRUD operations with Form.io data sources. Currently includes a mock in-memory implementation for testing and development.
7
4
 
8
- <!-- PROJECT LOGO -->
9
- <br />
10
- <p align="center">
11
- <a href="https://github.com/github_username/repo">
12
- <img src="https://docs.goatlab.io/logo.png" alt="Logo" width="150" height="150">
13
- </a>
5
+ ## Installation
14
6
 
15
- <h3 align="center">GOAT - FLUENT-FORM.IO</h3>
7
+ ```bash
8
+ npm install @goatlab/fluent-formio
9
+ # or
10
+ yarn add @goatlab/fluent-formio
11
+ # or
12
+ pnpm add @goatlab/fluent-formio
13
+ ```
16
14
 
17
- <p align="center">
18
- Fluent - Time Saving (TS) utils
19
- <br />
20
- <a href="https://docs.goatlab.io/#/0.7.x/fluent/fluent"><strong>Explore the docs »</strong></a>
21
- <br />
22
- <br />
23
- ·
24
- <a href="https://github.com/goat-io/fluent/issues">Report Bug</a>
25
- ·
26
- <a href="https://github.com/goat-io/fluent/issues">Request Feature</a>
27
- </p>
28
- </p>
29
- </p>
15
+ ## Basic Usage
30
16
 
31
- # Goat - Fluent
17
+ ```typescript
18
+ import { FormioConnector } from '@goatlab/fluent-formio'
32
19
 
33
- Fluent query interface for Multiple database types and helpers for fast API generation and general App building.
20
+ // Define your entity types
21
+ interface User {
22
+ id?: string
23
+ name: string
24
+ email: string
25
+ age: number
26
+ }
34
27
 
35
- ## Supported Databases
28
+ // Create a connector instance
29
+ const userConnector = new FormioConnector<User>({
30
+ baseEndPoint: 'http://localhost:3001/users',
31
+ token: 'your-formio-token' // optional
32
+ })
36
33
 
37
- 1. Form.io
34
+ // Insert a single record
35
+ const user = await userConnector.insert({
36
+ name: 'John Doe',
37
+ email: 'john@example.com',
38
+ age: 30
39
+ })
38
40
 
39
- ### Installing
41
+ // Find records with fluent query syntax
42
+ const adults = await userConnector.findMany({
43
+ where: { age: { greaterOrEqualThan: 18 } },
44
+ orderBy: [{ age: 'desc' }],
45
+ limit: 10
46
+ })
40
47
 
41
- To install this package in your project, you can use the following command within your terminal.
48
+ // Find by ID
49
+ const foundUser = await userConnector.findById(user.id)
42
50
 
43
- ```bash
44
- yarn add @goatlab/fluent-formio
51
+ // Update a record
52
+ await userConnector.updateById(user.id, {
53
+ age: 31
54
+ })
45
55
  ```
46
56
 
47
- ### Documentation
57
+ ## Key Features
48
58
 
49
- To learn how to use this visit the [Goat Docs](https://docs.goatlab.io/#/0.7.x/fluent/fluent)
59
+ - **Fluent Query Interface** - Chain methods for complex queries with TypeScript support
60
+ - **Form.io Compatible** - Designed to work with Form.io REST APIs
61
+ - **In-Memory Mock Storage** - Built-in mock implementation for testing
62
+ - **Type-Safe** - Full TypeScript support with generic types
63
+ - **Standard CRUD Operations** - insert, findById, findMany, updateById, deleteById
64
+ - **Advanced Queries** - Support for where clauses, ordering, pagination
65
+ - **Batch Operations** - insertMany for bulk inserts
66
+ - **Utility Methods** - findFirst, requireById, requireFirst, pluck
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goatlab/fluent-formio",
3
- "version": "0.6.16",
3
+ "version": "0.6.18",
4
4
  "description": "Readable query Interface & API generator for TS and Node",
5
5
  "homepage": "https://docs.goatlab.io",
6
6
  "main": "dist/index.js",
@@ -19,8 +19,8 @@
19
19
  "author": "ignacio.cabrera@goatlab.io",
20
20
  "license": "MIT",
21
21
  "dependencies": {
22
- "@goatlab/js-utils": "0.8.41",
23
- "@goatlab/fluent": "0.7.41"
22
+ "@goatlab/js-utils": "0.8.42",
23
+ "@goatlab/fluent": "0.7.43"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/node": "^17.0.23",
@@ -32,7 +32,7 @@
32
32
  "turbo": "^1.1.10",
33
33
  "typescript": "^4.6.3",
34
34
  "vitest": "^2.1.8",
35
- "@goatlab/tsconfig": "0.0.14"
35
+ "@goatlab/tsconfig": "0.0.15"
36
36
  },
37
37
  "engines": {
38
38
  "node": ">=14.16.0"