@meyicloud/meyi-cost-ui 1.7.2 → 1.7.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/README.md +22 -22
- package/dist/index.js +13 -13
- package/dist/index.mjs +399 -403
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
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, scheduled
|
|
5
|
-
AI report history and downloads plus standard CSV/PDF cost exports.
|
|
4
|
+
service/account/region breakdowns, standard and comparison reports, scheduled
|
|
5
|
+
AI report history and downloads plus standard CSV/PDF cost exports.
|
|
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
|
|
9
9
|
whether a plugin is enabled for a tenant. Those responsibilities remain with
|
|
10
|
-
the host and `@meyicloud/meyi-cost-server`.
|
|
10
|
+
the host and `@meyicloud/meyi-cost-server`.
|
|
11
11
|
|
|
12
12
|
## Package contract
|
|
13
13
|
|
|
14
|
-
- Package name: `@meyicloud/meyi-cost-ui`
|
|
14
|
+
- Package name: `@meyicloud/meyi-cost-ui`
|
|
15
15
|
- Runtime: React 19 and React DOM 19, supplied by the consuming application
|
|
16
16
|
- Module outputs: ESM, CommonJS, TypeScript declarations, and CSS
|
|
17
17
|
- Default UI route: `/cost`
|
|
@@ -24,7 +24,7 @@ flowchart LR
|
|
|
24
24
|
Host[External React application] --> Route[Authenticated /cost/* route]
|
|
25
25
|
Route --> Page[CostPage]
|
|
26
26
|
Page --> Router[Package router]
|
|
27
|
-
Router --> Features[Overview / AI Analysis / Reports / Sources]
|
|
27
|
+
Router --> Features[Overview / AI Analysis / Reports / Sources]
|
|
28
28
|
Features --> Hooks[Feature hooks]
|
|
29
29
|
Hooks --> Service[costService]
|
|
30
30
|
Service --> API[Configured Axios client]
|
|
@@ -90,7 +90,7 @@ For a local package installation test:
|
|
|
90
90
|
|
|
91
91
|
```bash
|
|
92
92
|
npm pack
|
|
93
|
-
npm install /path/to/meyicloud-meyi-cost-ui-1.4.0.tgz
|
|
93
|
+
npm install /path/to/meyicloud-meyi-cost-ui-1.4.0.tgz
|
|
94
94
|
```
|
|
95
95
|
|
|
96
96
|
## Publish to npm
|
|
@@ -113,8 +113,8 @@ that semantic-version change. The `prepublishOnly` script automatically runs
|
|
|
113
113
|
After publishing, verify from a clean consumer project:
|
|
114
114
|
|
|
115
115
|
```bash
|
|
116
|
-
npm view @meyicloud/meyi-cost-ui version
|
|
117
|
-
npm install @meyicloud/meyi-cost-ui@<published-version>
|
|
116
|
+
npm view @meyicloud/meyi-cost-ui version
|
|
117
|
+
npm install @meyicloud/meyi-cost-ui@<published-version>
|
|
118
118
|
```
|
|
119
119
|
|
|
120
120
|
## Integrate with an external React application
|
|
@@ -122,7 +122,7 @@ npm install @meyicloud/meyi-cost-ui@<published-version>
|
|
|
122
122
|
Install the published package:
|
|
123
123
|
|
|
124
124
|
```bash
|
|
125
|
-
npm install @meyicloud/meyi-cost-ui
|
|
125
|
+
npm install @meyicloud/meyi-cost-ui
|
|
126
126
|
```
|
|
127
127
|
|
|
128
128
|
For local development before publishing, add a file dependency:
|
|
@@ -130,7 +130,7 @@ For local development before publishing, add a file dependency:
|
|
|
130
130
|
```json
|
|
131
131
|
{
|
|
132
132
|
"dependencies": {
|
|
133
|
-
"@meyicloud/meyi-cost-ui": "file:../../meyi-market-places/insight-cost-ui"
|
|
133
|
+
"@meyicloud/meyi-cost-ui": "file:../../meyi-market-places/insight-cost-ui"
|
|
134
134
|
}
|
|
135
135
|
}
|
|
136
136
|
```
|
|
@@ -139,12 +139,12 @@ Build the UI package before building the host when using a file dependency.
|
|
|
139
139
|
|
|
140
140
|
### 1. Add an authenticated wildcard route
|
|
141
141
|
|
|
142
|
-
The route must accept child paths such as `/cost/reports` and `/cost/analysis`.
|
|
142
|
+
The route must accept child paths such as `/cost/reports` and `/cost/analysis`.
|
|
143
143
|
The exact wildcard syntax depends on the host router.
|
|
144
144
|
|
|
145
145
|
```tsx
|
|
146
|
-
import { CostPage } from "@meyicloud/meyi-cost-ui";
|
|
147
|
-
import "@meyicloud/meyi-cost-ui/style.css";
|
|
146
|
+
import { CostPage } from "@meyicloud/meyi-cost-ui";
|
|
147
|
+
import "@meyicloud/meyi-cost-ui/style.css";
|
|
148
148
|
|
|
149
149
|
export function CostPluginRoute() {
|
|
150
150
|
const token = getCurrentAccessToken();
|
|
@@ -171,7 +171,7 @@ or use the included local-storage helper:
|
|
|
171
171
|
import {
|
|
172
172
|
api as costApi,
|
|
173
173
|
attachAuthInterceptors,
|
|
174
|
-
} from "@meyicloud/meyi-cost-ui";
|
|
174
|
+
} from "@meyicloud/meyi-cost-ui";
|
|
175
175
|
|
|
176
176
|
attachAuthInterceptors(costApi);
|
|
177
177
|
```
|
|
@@ -188,8 +188,8 @@ apply authentication and tenant resolution before the cost endpoints.
|
|
|
188
188
|
|
|
189
189
|
### 4. Add navigation and plugin enablement
|
|
190
190
|
|
|
191
|
-
The package exports `costNavItems` for Overview, AI Analysis, Reports, Sources,
|
|
192
|
-
and CUR Discovery. The host
|
|
191
|
+
The package exports `costNavItems` for Overview, AI Analysis, Reports, Sources,
|
|
192
|
+
and CUR Discovery. The host
|
|
193
193
|
may map these entries into its sidebar. Tenant-level installation, role checks,
|
|
194
194
|
and dynamic menu visibility remain host responsibilities.
|
|
195
195
|
|
|
@@ -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 | `user` | Controls visibility of AI report schedule settings. The server independently requires the admin role when saving. |
|
|
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
|
|
|
@@ -220,7 +220,7 @@ VITE_API_BASE=/api/v1
|
|
|
220
220
|
```
|
|
221
221
|
|
|
222
222
|
`VITE_API_BASE` is only an example host variable; it is not consumed by
|
|
223
|
-
`@meyicloud/meyi-cost-ui` itself. Never define `AWS_ACCESS_KEY_ID`,
|
|
223
|
+
`@meyicloud/meyi-cost-ui` itself. Never define `AWS_ACCESS_KEY_ID`,
|
|
224
224
|
`AWS_SECRET_ACCESS_KEY`, `AWS_SESSION_TOKEN`, database credentials, or other
|
|
225
225
|
secrets in the frontend environment because browser build variables are
|
|
226
226
|
visible to users.
|
|
@@ -234,8 +234,8 @@ The UI consumes these routes below `${apiBase}/cost`:
|
|
|
234
234
|
- `GET /data-status`
|
|
235
235
|
- `GET /filter-options`
|
|
236
236
|
- `GET /reports`
|
|
237
|
-
- `GET /tags`
|
|
238
|
-
- `GET /analysis/status`, `GET /analysis/latest`, and `POST /analysis`
|
|
237
|
+
- `GET /tags`
|
|
238
|
+
- `GET /analysis/status`, `GET /analysis/latest`, and `POST /analysis`
|
|
239
239
|
- `GET /budget-alert-dismissals` and `POST /budget-alert-dismissals`
|
|
240
240
|
|
|
241
241
|
Use the matching cost server version whenever API response contracts change.
|
|
@@ -248,11 +248,11 @@ Use the matching cost server version whenever API response contracts change.
|
|
|
248
248
|
|
|
249
249
|
## Consumer validation checklist
|
|
250
250
|
|
|
251
|
-
1. Build `@meyicloud/meyi-cost-ui`.
|
|
251
|
+
1. Build `@meyicloud/meyi-cost-ui`.
|
|
252
252
|
2. Install or refresh the package in the host.
|
|
253
253
|
3. Build the host frontend.
|
|
254
254
|
4. Verify direct navigation and refresh for `/cost`, `/cost/reports`, and
|
|
255
|
-
`/cost/analysis`.
|
|
255
|
+
`/cost/analysis`.
|
|
256
256
|
5. Verify authenticated requests reach `/api/v1/cost` with the correct tenant.
|
|
257
257
|
6. Test loading, empty, error, monthly/yearly, graph/list, report filters,
|
|
258
258
|
compare mode, pagination, and PDF/CSV export states.
|