@fayz-ai/plugin-forms 0.1.1 → 0.1.3
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.
- package/LICENSE +21 -0
- package/README.md +47 -0
- package/package.json +3 -3
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Faya Labs
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,47 @@
|
|
|
1
|
+
# @fayz-ai/plugin-forms
|
|
2
|
+
|
|
3
|
+
> Templates, documents, and signatures — the paperwork layer for any vertical.
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@fayz-ai/plugin-forms)
|
|
6
|
+
[](https://github.com/FayaLabs/fayz-sdk/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
Every real business runs on forms it never wanted to build: anamnesis sheets, evolution notes, consent contracts, intake docs. plugin-forms kills that busywork. Define a template once, attach a filled document to a person, and the data lives in your tenant — not in a PDF nobody can query.
|
|
9
|
+
|
|
10
|
+
It snaps into a `defineSaas` app as the document engine. A clinic fills health anamnesis, a salon collects consent forms, a studio signs contracts — same plugin, same `frm_*` tables, different templates. Documents surface right inside the person record via a detail-tab widget, and the AI assistant can list templates and a client's documents on demand.
|
|
11
|
+
|
|
12
|
+
## What's inside
|
|
13
|
+
- **Template + document model** backed by Supabase (`frm_*` tables) with a mock provider fallback via `createSafeDataProvider`
|
|
14
|
+
- **Form categories registry** (`frm_categories`, tenant-scoped) seeded with Anamnese, Evolução, Laudo, Contrato, Geral
|
|
15
|
+
- **Person detail widget** — a `person.detail.documents` zone tab that lists and attaches documents to a contact
|
|
16
|
+
- **Settings tab** for managing templates, documents, and categories
|
|
17
|
+
- **Document-type provider API** — `registerDocumentTypeProvider` lets other plugins contribute selectable document/file types
|
|
18
|
+
- **AI tools** — `listFormTemplates` and `listDocuments` (read-only, permission-gated)
|
|
19
|
+
- **Pluggable data layer** — pass your own `dataProvider`, or let it auto-resolve Supabase → mock
|
|
20
|
+
|
|
21
|
+
## Install
|
|
22
|
+
```bash
|
|
23
|
+
npm install @fayz-ai/plugin-forms
|
|
24
|
+
```
|
|
25
|
+
Peer deps: `react`, `react-dom`. Runtime deps: `@fayz-ai/core`, `@fayz-ai/ui`.
|
|
26
|
+
|
|
27
|
+
## Usage
|
|
28
|
+
```tsx
|
|
29
|
+
import { defineSaas } from '@fayz-ai/saas'
|
|
30
|
+
import { createCustomFormsPlugin } from '@fayz-ai/plugin-forms'
|
|
31
|
+
|
|
32
|
+
export const app = defineSaas({
|
|
33
|
+
// ...
|
|
34
|
+
plugins: [
|
|
35
|
+
createCustomFormsPlugin({
|
|
36
|
+
labels: { pageTitle: 'Documents' },
|
|
37
|
+
// dataProvider: myProvider, // optional — defaults to Supabase → mock
|
|
38
|
+
}),
|
|
39
|
+
],
|
|
40
|
+
})
|
|
41
|
+
```
|
|
42
|
+
|
|
43
|
+
## Part of the Fayz SDK
|
|
44
|
+
One of the composable plugins that turn `@fayz-ai/saas` into a real, vertical-specific SaaS — this one owns documents and signatures.
|
|
45
|
+
|
|
46
|
+
## Roadmap & contributing
|
|
47
|
+
Built and evolving in the open. See the [Fayz SDK roadmap](../../docs/ROADMAP.md#plugin-forms) for current gaps, missing features, and good first issues.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@fayz-ai/plugin-forms",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.3",
|
|
4
4
|
"description": "Fayz SDK — plugin-forms plugin",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|
|
@@ -29,8 +29,8 @@
|
|
|
29
29
|
"@dnd-kit/sortable": "^10.0.0",
|
|
30
30
|
"@dnd-kit/modifiers": "^9.0.0",
|
|
31
31
|
"@dnd-kit/utilities": "^3.2.2",
|
|
32
|
-
"@fayz-ai/
|
|
33
|
-
"@fayz-ai/
|
|
32
|
+
"@fayz-ai/core": "^0.2.0",
|
|
33
|
+
"@fayz-ai/ui": "^0.2.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/react": "^18.3.0",
|