@goatlab/fluent-formio 0.7.0 → 0.7.1

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 +25 -36
  2. package/package.json +3 -3
package/README.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # @goatlab/fluent-formio
2
2
 
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.
3
+ A fluent query interface connector for Form.io that provides a type-safe, consistent API for CRUD operations with Form.io data sources.
4
4
 
5
5
  ## Installation
6
6
 
@@ -17,50 +17,39 @@ pnpm add @goatlab/fluent-formio
17
17
  ```typescript
18
18
  import { FormioConnector } from '@goatlab/fluent-formio'
19
19
 
20
- // Define your entity types
21
- interface User {
22
- id?: string
23
- name: string
24
- email: string
25
- age: number
26
- }
27
-
28
20
  // Create a connector instance
29
- const userConnector = new FormioConnector<User>({
30
- baseEndPoint: 'http://localhost:3001/users',
31
- token: 'your-formio-token' // optional
21
+ const userConnector = new FormioConnector({
22
+ baseEndPoint: 'https://api.form.io/project/users',
23
+ token: 'your-formio-jwt-token'
32
24
  })
33
25
 
34
- // Insert a single record
26
+ // Perform CRUD operations
35
27
  const user = await userConnector.insert({
36
- name: 'John Doe',
37
- email: 'john@example.com',
38
- age: 30
28
+ data: {
29
+ name: 'John Doe',
30
+ email: 'john@example.com'
31
+ }
39
32
  })
40
33
 
41
- // Find records with fluent query syntax
42
- const adults = await userConnector.findMany({
43
- where: { age: { greaterOrEqualThan: 18 } },
44
- orderBy: [{ age: 'desc' }],
34
+ const users = await userConnector.findMany({
35
+ where: { 'data.status': 'active' },
45
36
  limit: 10
46
37
  })
47
-
48
- // Find by ID
49
- const foundUser = await userConnector.findById(user.id)
50
-
51
- // Update a record
52
- await userConnector.updateById(user.id, {
53
- age: 31
54
- })
55
38
  ```
56
39
 
57
40
  ## Key Features
58
41
 
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
42
+ - **Form.io REST API Integration** - Full support for Form.io submission and form APIs
43
+ - **Type-Safe Queries** - TypeScript support with auto-completion
44
+ - **Fluent Query Builder** - Chainable query methods for complex operations
45
+ - **Built-in Mock Storage** - In-memory implementation for testing and development
46
+ - **Form.io Authentication** - JWT token and API key support
47
+ - **Advanced Filtering** - Support for nested properties, date ranges, and complex conditions
48
+
49
+ ## Documentation
50
+
51
+ For comprehensive documentation, see the [Form.io Connector Guide](https://docs.goatlab.io/connectors/formio).
52
+
53
+ ## License
54
+
55
+ MIT
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@goatlab/fluent-formio",
3
- "version": "0.7.0",
3
+ "version": "0.7.1",
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/fluent": "0.8.0",
23
- "@goatlab/js-utils": "0.9.0"
22
+ "@goatlab/js-utils": "0.9.0",
23
+ "@goatlab/fluent": "0.8.1"
24
24
  },
25
25
  "devDependencies": {
26
26
  "@types/node": "^17.0.23",