@meyicloud/meyi-cost-ui 1.2.2 → 1.3.0

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/README.md CHANGED
@@ -1,8 +1,8 @@
1
1
  # Meyi Insight Cost UI
2
2
 
3
3
  Reusable React UI package for AWS cost overview, monthly/yearly trends,
4
- service/account/region breakdowns, standard and comparison reports, CSV/PDF
5
- exports, budgets, and budget status.
4
+ service/account/region breakdowns, standard and comparison reports, scheduled
5
+ AI report history and downloads, CSV/PDF exports, budgets, and budget status.
6
6
 
7
7
  The package is intended to run inside an authenticated host application. It
8
8
  does not contain AWS credentials, query AWS directly, perform login, or decide
@@ -91,7 +91,7 @@ For a local package installation test:
91
91
 
92
92
  ```bash
93
93
  npm pack
94
- npm install /path/to/meyicloud-meyi-cost-ui-1.2.2.tgz
94
+ npm install /path/to/meyicloud-meyi-cost-ui-1.3.0.tgz
95
95
  ```
96
96
 
97
97
  ## Publish to npm
@@ -200,7 +200,7 @@ and dynamic menu visibility remain host responsibilities.
200
200
  | `apiBase` | Yes | None | Base API prefix. `/cost` is appended automatically. |
201
201
  | `basePath` | No | `/cost` | Router base path where the host mounts the UI. |
202
202
  | `token` | No | None | Bearer token added to cost API requests. |
203
- | `userRole` | No | `admin` | Compatibility property for the current host role. The present package does not use it for authorization; the host must enforce access and menu visibility. |
203
+ | `userRole` | No | `user` | Controls visibility of AI report schedule settings. The server independently requires the admin role when saving. |
204
204
 
205
205
  ## Environment variables
206
206
 
@@ -0,0 +1,2 @@
1
+ export declare const CostRoleProvider: import('react').Provider<string>;
2
+ export declare const useCostRole: () => string;
@@ -0,0 +1,10 @@
1
+ import { CostAnalysisSchedule } from '../../../types.js';
2
+ interface Props {
3
+ open: boolean;
4
+ schedule: CostAnalysisSchedule;
5
+ saving: boolean;
6
+ onClose: () => void;
7
+ onSave: (schedule: Omit<CostAnalysisSchedule, "nextRunAt" | "lastRunAt">) => Promise<void>;
8
+ }
9
+ export declare function ScheduleDialog({ open, schedule, saving, onClose, onSave }: Props): import("react").JSX.Element | null;
10
+ export {};
@@ -1,21 +1,13 @@
1
- import { CostAnalysis, CostAnalysisStatus, CurDataStatus } from '../../../types.js';
2
- export type AnalysisRangeKey = "current_month" | "last_month" | "last_3_months";
3
- export declare function resolveAnalysisRange(key: AnalysisRangeKey, now?: Date): {
4
- start: string;
5
- end: string;
6
- };
1
+ import { CostAnalysisReport, CostAnalysisSchedule, CostAnalysisStatus, CurDataStatus } from '../../../types.js';
7
2
  export declare function useCostAnalysis(): {
8
3
  status: CostAnalysisStatus | null;
9
4
  dataStatus: CurDataStatus | null;
10
- analysis: CostAnalysis | null;
11
- rangeKey: AnalysisRangeKey;
12
- setRangeKey: import('react').Dispatch<import('react').SetStateAction<AnalysisRangeKey>>;
13
- range: {
14
- start: string;
15
- end: string;
16
- };
17
- initialLoading: boolean;
18
- generating: boolean;
5
+ schedule: CostAnalysisSchedule | null;
6
+ reports: CostAnalysisReport[];
7
+ loading: boolean;
8
+ saving: boolean;
19
9
  error: string | null;
20
- generate: (force?: boolean) => Promise<void>;
10
+ load: (quiet?: boolean) => Promise<void>;
11
+ saveSchedule: (next: Omit<CostAnalysisSchedule, "nextRunAt" | "lastRunAt">) => Promise<void>;
12
+ download: (report: CostAnalysisReport) => Promise<void>;
21
13
  };
@@ -5,7 +5,7 @@ export declare function useCostReports(): {
5
5
  mode: ReportMode;
6
6
  start: string;
7
7
  end: string;
8
- granularity: "monthly" | "daily";
8
+ granularity: "daily" | "monthly";
9
9
  reportTagKey: string;
10
10
  options: CostFilterOptions;
11
11
  draftFilters: Filters;
@@ -24,7 +24,7 @@ export declare function useCostReports(): {
24
24
  };
25
25
  setStart: import('react').Dispatch<import('react').SetStateAction<string>>;
26
26
  setEnd: import('react').Dispatch<import('react').SetStateAction<string>>;
27
- setGranularity: import('react').Dispatch<import('react').SetStateAction<"monthly" | "daily">>;
27
+ setGranularity: import('react').Dispatch<import('react').SetStateAction<"daily" | "monthly">>;
28
28
  setReportTagKey: import('react').Dispatch<import('react').SetStateAction<string>>;
29
29
  setDraftFilters: import('react').Dispatch<import('react').SetStateAction<Filters>>;
30
30
  changeGroup: (value: ReportGroup) => void;
package/dist/index.d.ts CHANGED
@@ -1,7 +1,7 @@
1
1
  export { CostPage, type CostPageProps } from './CostPage.js';
2
2
  export { configureApi, attachAuthInterceptors, api } from './api.js';
3
3
  export { createRouteTree, createCostRouter } from './router.js';
4
- export type { CostOverview, CostBreakdownItem, CostReport, CostBudget, CostTrend, CostSummary, CostPeriod, CostProvider, CurDataStatus, CostAwsSource, CostAnalysis, CostAnalysisStatus, CostAnalysisFacts, } from './types.js';
4
+ export type { CostOverview, CostBreakdownItem, CostReport, CostBudget, CostTrend, CostSummary, CostPeriod, CostProvider, CurDataStatus, CostAwsSource, CostAnalysis, CostAnalysisStatus, CostAnalysisFacts, CostAnalysisSchedule, CostAnalysisReport, CostAnalysisFrequency, } from './types.js';
5
5
  export declare const costNavItems: {
6
6
  title: string;
7
7
  url: string;