@fayz-ai/plugin-reports 0.1.1 → 0.1.2

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 +53 -0
  2. package/package.json +4 -4
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.2",
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/ui": "^0.1.7",
30
+ "@fayz-ai/saas": "^0.1.7",
31
+ "@fayz-ai/core": "^0.1.7"
32
32
  },
33
33
  "devDependencies": {
34
34
  "@types/react": "^18.3.0",