bharosa 0.3.3 → 0.5.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/ANALYTICS-CONTRACT-SHA256 +1 -0
- package/CHANGELOG.md +2 -2
- package/MONTHLY-MARKET-CONTRACT-SHA256 +1 -1
- package/README.md +18 -7
- package/dist/analytics-contract.cjs +665 -0
- package/dist/analytics-contract.d.cts +2 -0
- package/dist/analytics-contract.d.ts +2 -0
- package/dist/analytics-types.cjs +2 -0
- package/dist/analytics-types.d.cts +103 -0
- package/dist/analytics-types.d.ts +103 -0
- package/dist/client-types.d.cts +17 -1
- package/dist/client-types.d.ts +17 -1
- package/dist/index.cjs +74 -19
- package/dist/index.d.cts +13 -1
- package/dist/index.d.ts +13 -1
- package/dist/monthly-market-data.cjs +3 -2
- package/dist/monthly-types.d.cts +1 -1
- package/dist/monthly-types.d.ts +1 -1
- package/dist/operation-types.d.cts +3 -0
- package/dist/operation-types.d.ts +3 -0
- package/dist/response-checks.cjs +68 -1
- package/dist/transport.cjs +18 -9
- package/dist/transport.d.cts +1 -1
- package/dist/transport.d.ts +1 -1
- package/dist/validate.cjs +3 -1
- package/docs/analytics.md +26 -0
- package/docs/getting-started.md +2 -2
- package/package.json +6 -3
|
@@ -0,0 +1 @@
|
|
|
1
|
+
1d2d37edf6ea65cdd3bac707119c6815ee73c89770a791d7dfdfadc9630b6f2b
|
package/CHANGELOG.md
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
# 0.
|
|
1
|
+
# 0.4.0 — unpublished release candidate
|
|
2
2
|
|
|
3
|
-
|
|
3
|
+
Add account-scoped Growth scheme performance and category return statistics. Change the default origin from published 0.3.2’s app.bharosa.finance to api.bharosa.finance, preserving explicit overrides. The reviewed host-default delta is included directly; no intermediate 0.3.3 publication is required. No investor monetary-performance, fund-AUM or stated-TER methods. API deployment and SDK publication are separate.
|
|
4
4
|
|
|
5
5
|
# Changelog
|
|
6
6
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
ef53094920c324ab9d9fd31d8846b6f37da13b757301c6742461ee33b8fe49c4
|
package/README.md
CHANGED
|
@@ -2,19 +2,19 @@
|
|
|
2
2
|
|
|
3
3
|
A TypeScript client for Bharosa accounts, investors, portfolios, and mutual funds. Use one resource interface from TypeScript, ESM, or CommonJS, with no runtime dependencies.
|
|
4
4
|
|
|
5
|
-
**
|
|
5
|
+
**Local release candidate (unpublished):** `bharosa@0.5.0`. Both clients use the production API at `https://api.bharosa.finance` by default. Account access and credentials are still required; installing the SDK does not grant access.
|
|
6
6
|
|
|
7
7
|
## Start here
|
|
8
8
|
|
|
9
|
-
Use Node.js 22.12+ in a supported LTS release. Install the
|
|
9
|
+
Use Node.js 22.12+ in a supported LTS release. Install the reviewed local candidate in your backend application:
|
|
10
10
|
|
|
11
11
|
```sh
|
|
12
|
-
npm install bharosa
|
|
12
|
+
npm install /absolute/path/to/bharosa-0.5.0.tgz --ignore-scripts
|
|
13
13
|
```
|
|
14
14
|
|
|
15
15
|
Source contributors can build and pack a local archive using the commands in CONTRIBUTING.md.
|
|
16
16
|
|
|
17
|
-
Configure your
|
|
17
|
+
Configure your API key through your backend secret manager. In the local unified-key API candidate, every active key has baseline market access; private account calls require the optional account permissions. Then:
|
|
18
18
|
|
|
19
19
|
```ts
|
|
20
20
|
import { Bharosa } from "bharosa";
|
|
@@ -25,10 +25,11 @@ function required(name: string): string {
|
|
|
25
25
|
return value;
|
|
26
26
|
}
|
|
27
27
|
const bharosa = new Bharosa({
|
|
28
|
-
|
|
29
|
-
auth: { type: "account_key", apiKey: required("BHAROSA_SECRET_KEY") },
|
|
28
|
+
apiKey: required("BHAROSA_SECRET_KEY"),
|
|
30
29
|
});
|
|
31
|
-
const
|
|
30
|
+
const latestNav = await bharosa.markets.schemes.nav("45139");
|
|
31
|
+
// Optional own-account permission is required for this call:
|
|
32
|
+
// const account = await bharosa.accounts.retrieve();
|
|
32
33
|
```
|
|
33
34
|
|
|
34
35
|
The startup check names missing environment variables without printing their values. See the [complete setup guide](docs/getting-started.md) for explicit checks and delegated authentication. CommonJS uses `const { Bharosa } = require("bharosa")`.
|
|
@@ -124,3 +125,13 @@ Available in SDK 0.3.0 and activated at `https://api.bharosa.finance`. Server ap
|
|
|
124
125
|
### Optional API origin override
|
|
125
126
|
|
|
126
127
|
Set `baseUrl` only for another deployment or tests. Omitted or `undefined` uses `https://api.bharosa.finance`; invalid explicit values fail validation and never fall back. Overrides must be HTTPS origins without credentials, paths, queries or fragments. Local HTTP also requires `allowLocalhostHttp: true`. The SDK does not read `BHAROSA_API_BASE_URL` automatically.
|
|
128
|
+
|
|
129
|
+
## Growth performance and category returns
|
|
130
|
+
|
|
131
|
+
Adds `mutualFundSchemes.performance.retrieve` and `fundCategories.statistics.retrieve` for authenticated account access. See [analytics methods, coverage and limitations](docs/analytics.md). These API routes and the SDK 0.4.0 methods are published; this unified-key SDK candidate is not yet published. `BharosaMarket` retains its four monthly operations and cannot call account analytics.
|
|
132
|
+
|
|
133
|
+
## Unified-key candidate
|
|
134
|
+
|
|
135
|
+
This local 0.5.0 candidate adds `new Bharosa({ apiKey })` and `client.markets`, using the existing account-independent market routes. Omit the NAV selection for latest NAV, or pass `{ asOf: "2026-10-01" }` for a monthly snapshot. Missing observations return `status: "missing"` and `data: null`. Explicit dates must be month starts. The account-scoped NAV method also accepts omission, while keeping account authorization.
|
|
136
|
+
|
|
137
|
+
Existing `auth` configurations and `BharosaMarket` remain supported. Baseline calls use only the API key; delegated private calls still require user consent and a valid user token. The production origin remains `https://api.bharosa.finance`. Unified-key server changes are locally tested and pending coordinated activation; this archive alone does not activate permissions.
|