@fayz-ai/plugin-reports 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.
Files changed (3) hide show
  1. package/LICENSE +21 -0
  2. package/README.md +53 -0
  3. package/package.json +4 -4
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,53 @@
1
+ # @fayz-ai/plugin-reports
2
+
3
+ > Config-driven reports for your SaaS — declare the report, get the page.
4
+
5
+ [![npm](https://img.shields.io/npm/v/@fayz-ai/plugin-reports.svg)](https://www.npmjs.com/package/@fayz-ai/plugin-reports)
6
+ [![license](https://img.shields.io/npm/l/@fayz-ai/plugin-reports.svg)](https://github.com/FayaLabs/fayz-sdk/blob/main/LICENSE)
7
+
8
+ Every business eventually asks the same thing: "show me the numbers." `plugin-reports` answers it without a BI bolt-on. You declare reports as data — columns, filters, date ranges, badges, and a data source — and the plugin renders a searchable report hub plus a filterable, exportable viewer. No per-report UI, no copy-pasted tables.
9
+
10
+ It's the read layer of the SDK: point it at the same data the rest of your app already writes, and any vertical gets analysis and decision-support out of the box. Date presets, currency formatting, and CSV/Excel/PDF export ship by default; the reports themselves are just config, so adding one is an array entry, not a new screen.
11
+
12
+ ## What's inside
13
+ - **Reports page** (`/reports`) — a report hub that lists and searches your declared reports, plus a viewer for a single report.
14
+ - **Declarative report defs** — `ReportDef` with columns, filters, date ranges, badges, and a data source; reports are passed in as options.
15
+ - **Date presets** — today, yesterday, last 7 days, this/last month, this quarter, and custom ranges.
16
+ - **Export** — CSV, Excel, and PDF, with print support.
17
+ - **Configurable** — labels, currency, default page size, and header visibility.
18
+ - Supabase-or-mock data provider, with `createSupabaseReportProvider` / `createMockReportProvider` exported for custom wiring; i18n built in.
19
+
20
+ ## Install
21
+ ```bash
22
+ npm install @fayz-ai/plugin-reports
23
+ ```
24
+ Peer deps: `react`, `react-dom`. Runtime deps include `@fayz-ai/core`, `@fayz-ai/ui`, and `@fayz-ai/saas`.
25
+
26
+ ## Usage
27
+ ```tsx
28
+ import { defineSaas } from '@fayz-ai/saas'
29
+ import { createReportsPlugin } from '@fayz-ai/plugin-reports'
30
+
31
+ export const app = defineSaas({
32
+ // ...
33
+ plugins: [
34
+ createReportsPlugin({
35
+ currency: { code: 'BRL', locale: 'pt-BR', symbol: 'R$' },
36
+ defaultPageSize: 50,
37
+ reports: [
38
+ {
39
+ id: 'revenue-by-day',
40
+ title: 'Revenue by Day',
41
+ // columns, filters, dataSource, ...
42
+ },
43
+ ],
44
+ }),
45
+ ],
46
+ })
47
+ ```
48
+
49
+ ## Part of the Fayz SDK
50
+ `plugin-reports` is the analytics surface of the SDK. It naturally reads from `@fayz-ai/plugin-financial` (revenue, commissions) and `@fayz-ai/plugin-agenda` (bookings, occupancy) to turn operational data into reports.
51
+
52
+ ## Roadmap & contributing
53
+ Built and evolving in the open. See the [Fayz SDK roadmap](../../docs/ROADMAP.md#plugin-reports) 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-reports",
3
- "version": "0.1.1",
3
+ "version": "0.1.3",
4
4
  "description": "Fayz SDK — plugin-reports plugin",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",
@@ -26,9 +26,9 @@
26
26
  "lucide-react": "^0.400.0",
27
27
  "zustand": "^4.5.0",
28
28
  "@tanstack/react-table": "^8.20.0",
29
- "@fayz-ai/core": "^0.1.6",
30
- "@fayz-ai/ui": "^0.1.6",
31
- "@fayz-ai/saas": "^0.1.6"
29
+ "@fayz-ai/core": "^0.2.0",
30
+ "@fayz-ai/saas": "^0.2.0",
31
+ "@fayz-ai/ui": "^0.2.0"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/react": "^18.3.0",