bharosa 0.1.0 → 0.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/CHANGELOG.md CHANGED
@@ -1,5 +1,18 @@
1
+ # 0.3.0 — local keys-only release candidate (unpublished)
2
+
3
+ Adds server-side BharosaMarket for four registered-app monthly snapshot operations, with no investor token/account argument. Requires separately activated API market_key support. Includes lifecycle0.2.0 changes; no unpublished analytics methods. Version0.3.0 was absent from npm at preparation, not reserved there.
4
+
1
5
  # Changelog
2
6
 
7
+ ## 0.2.0 — 30 October 2026
8
+
9
+ - Add `portfolios.update(id, { name, expected_name }, { idempotencyKey })` for account-scoped, name-only updates, with optimistic name comparison and validated response identity. Holdings and snapshots remain unchanged.
10
+ - Accept `positions: []` when creating a saved portfolio. Empty portfolio analysis remains unavailable until holdings exist.
11
+ - Clarify that monthly market reads require authenticated account-read access without a separate market-data approval.
12
+ - Preserve existing methods, exports, authentication, quantity precision, and analytics implementation. Requires a companion API with portfolio lifecycle support; package preparation does not establish production availability.
13
+
14
+ The entries below retain historical preparation notes from the published 0.1.0 package. They are not additional changes in 0.2.0.
15
+
3
16
  ## 0.1.0 — release candidate
4
17
 
5
18
  Prepared for the first npm release; publication is pending registry authentication and verification. API deployment and external consent activation are separate.
package/CONTRACT-SHA256 CHANGED
@@ -1 +1 @@
1
- 5ae700e29c7f54df12d5634f36cad08785240ee5b019d5921bf0792f53b7866c marketing/contracts/openapi.json
1
+ 3b791799bf705fd36a257e27a2520257f135e772d617b03bb22063ccea4d04e2 marketing/contracts/openapi.json
package/README.md CHANGED
@@ -116,10 +116,14 @@ The license covers this SDK. The Bharosa API service, analytics implementation,
116
116
 
117
117
  ### Monthly market history and synthetic samples
118
118
 
119
- `client.marketSnapshots` exposes month-start historical market observations and latest NAV valuation when your application has explicit access. All external credentials, including direct account keys, use monthly historical market dates; investor transaction and position history retains its full dates. See [monthly snapshots](docs/monthly-market-data.md) for actual observation dates, missing data and availability. This local implementation does not activate live access.
119
+ `client.marketSnapshots` exposes month-start historical market observations and latest NAV valuation without a separate market-data approval step, using authenticated credentials with the required account-read scope. All external credentials, including direct account keys, use monthly historical market dates; investor transaction and position history retains its full dates. See [monthly snapshots](docs/monthly-market-data.md) for actual observation dates, missing data and availability. This local implementation does not activate live access.
120
120
 
121
121
  The optional `bharosa/testing` entrypoint supplies fresh, deterministic synthetic portfolios and fictional fund compositions without credentials or network requests. Its seed helper writes only when explicitly called with an authenticated client, confirmed test account, stable run ID and resolved instrument mapping. See [testing samples](docs/testing.md).
122
122
 
123
123
  Unit precision follow-up (local, unreleased): supplied units accept at most four fractional digits; additional digits are rejected, never truncated. Dated amount conversion rounds once to four places using decimal half-even arithmetic; a positive amount rounding to zero returns `units_below_precision`. Currency and NAV precision are unchanged. Exact historical quantities and provenance remain in stored evidence and read responses; the web marks rounded displays with ≈, shows tiny positive values as <0.0001, and makes a rounded edit draft an explicit correction. Existing zero-unit closure remains supported; initial quantities must be positive. No portfolio reset or data rewrite is required. Canonical marketing reconciliation is coordinated through the parent, with deployment pending.
124
124
 
125
125
  After installing the archive, run `node node_modules/bharosa/examples/offline-smoke.mjs` for a credential-free synthetic read. This checks installed imports and the transport path without contacting Bharosa or creating data. It does not prove live access. Source-checkout verification commands require contributor files that are intentionally excluded from the runtime archive.
126
+
127
+ ### Local candidate: registered-app monthly data
128
+
129
+ Not published or activated. Server applications can use `new BharosaMarket({baseUrl, apiKey})` with an owner-issued `market_key` scoped only to `market:read`. `client.schemes.nav(id,{asOf:'2026-08-01'})`, `schemes.expenseRatio`, `funds.portfolio` and `funds.holdings` use account-independent monthly snapshot routes. These keys cannot read private accounts or portfolios and require no investor OAuth token. Keep secrets server-side; never bundle them into browser code. Existing account-key and delegated-user clients remain unchanged. A separately versioned release and explicit API activation are required.
@@ -1,7 +1,7 @@
1
1
  import type { MonthlyMarketClient } from "./monthly-types.cjs";
2
2
  import type { MarketDataClient, CurrentHoldingsInput, CurrentHoldingsResult } from "./market-types.cjs";
3
3
  export type * from "./market-types.cjs";
4
- import type { Holding, HoldingPosition, HistoryCapability, HistoryView, HistoryImport, HistoryImportResult, HoldingsList, AssetMix, SectorMix, IssuerMix, PositionInput, Account, Client, ClientsList, Investor, InvestorsList, InvestorCreate, InvestorUpdate, Portfolio, PortfoliosList, PortfolioCreate, SnapshotCreate, SnapshotView, FundsList, FundReferences } from "./models.cjs";
4
+ import type { Holding, HoldingPosition, HistoryCapability, HistoryView, HistoryImport, HistoryImportResult, HoldingsList, AssetMix, SectorMix, IssuerMix, PositionInput, Account, Client, ClientsList, Investor, InvestorsList, InvestorCreate, InvestorUpdate, Portfolio, PortfoliosList, PortfolioCreate, PortfolioUpdate, SnapshotCreate, SnapshotView, FundsList, FundReferences } from "./models.cjs";
5
5
  export type * from "./models.cjs";
6
6
  export type Auth = {
7
7
  readonly type: "account_key";
@@ -198,6 +198,7 @@ export interface ClientSurface {
198
198
  readonly update: (id: string, body: InvestorUpdate, options?: RequestOptions) => Promise<Investor>;
199
199
  };
200
200
  readonly portfolios: {
201
+ readonly update: (id: string, body: PortfolioUpdate, options: IdempotentOptions) => Promise<PortfolioObject>;
201
202
  readonly build: (input: InMemoryPortfolioInput) => InMemoryPortfolio;
202
203
  readonly fromPositions: (input: InMemoryPortfolioInput) => InMemoryPortfolio;
203
204
  readonly list: (params?: PortfolioListOptions, options?: RequestOptions) => Promise<PortfolioObjectsList>;
@@ -1,7 +1,7 @@
1
1
  import type { MonthlyMarketClient } from "./monthly-types.js";
2
2
  import type { MarketDataClient, CurrentHoldingsInput, CurrentHoldingsResult } from "./market-types.js";
3
3
  export type * from "./market-types.js";
4
- import type { Holding, HoldingPosition, HistoryCapability, HistoryView, HistoryImport, HistoryImportResult, HoldingsList, AssetMix, SectorMix, IssuerMix, PositionInput, Account, Client, ClientsList, Investor, InvestorsList, InvestorCreate, InvestorUpdate, Portfolio, PortfoliosList, PortfolioCreate, SnapshotCreate, SnapshotView, FundsList, FundReferences } from "./models.js";
4
+ import type { Holding, HoldingPosition, HistoryCapability, HistoryView, HistoryImport, HistoryImportResult, HoldingsList, AssetMix, SectorMix, IssuerMix, PositionInput, Account, Client, ClientsList, Investor, InvestorsList, InvestorCreate, InvestorUpdate, Portfolio, PortfoliosList, PortfolioCreate, PortfolioUpdate, SnapshotCreate, SnapshotView, FundsList, FundReferences } from "./models.js";
5
5
  export type * from "./models.js";
6
6
  export type Auth = {
7
7
  readonly type: "account_key";
@@ -198,6 +198,7 @@ export interface ClientSurface {
198
198
  readonly update: (id: string, body: InvestorUpdate, options?: RequestOptions) => Promise<Investor>;
199
199
  };
200
200
  readonly portfolios: {
201
+ readonly update: (id: string, body: PortfolioUpdate, options: IdempotentOptions) => Promise<PortfolioObject>;
201
202
  readonly build: (input: InMemoryPortfolioInput) => InMemoryPortfolio;
202
203
  readonly fromPositions: (input: InMemoryPortfolioInput) => InMemoryPortfolio;
203
204
  readonly list: (params?: PortfolioListOptions, options?: RequestOptions) => Promise<PortfolioObjectsList>;
package/dist/contract.cjs CHANGED
@@ -1,2 +1,2 @@
1
1
  // Generated from frozen OpenAPI; do not edit.
2
- module.exports = {"schemas":{"DecimalInput":{"type":"string","pattern":"^(0|[1-9][0-9]{0,19})(\\.[0-9]{1,18})?$"},"Money":{"type":"object","properties":{"amount":{"type":"string","pattern":"^(0|[1-9][0-9]{0,21})(\\.[0-9]{1,18})?$"},"currency":{"const":"INR"}},"required":["amount","currency"],"additionalProperties":true},"FinancialDate":{"type":"object","properties":{"precision":{"const":"date"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"time_zone":{"const":"Asia/Kolkata"}},"required":["precision","date","time_zone"],"additionalProperties":true},"Account":{"type":"object","properties":{"id":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"object":{"const":"account"},"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"primary_investor":{"anyOf":[{"type":"string","pattern":"^inv_[a-f0-9]{32}$"},{"type":"null"}]},"personal_client_id":{"anyOf":[{"type":"string","pattern":"^clt_[a-f0-9]{32}$"},{"type":"null"}],"description":"Authenticated human user personal household in this account; null for machine account keys or no link. This context grants no access."}},"required":["id","object","created","primary_investor"],"additionalProperties":true},"Client":{"type":"object","properties":{"id":{"type":"string","pattern":"^clt_[a-f0-9]{32}$"},"object":{"const":"client"},"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"}},"required":["id","object","created","account","name"],"additionalProperties":true},"Investor":{"type":"object","properties":{"id":{"type":"string","pattern":"^inv_[a-f0-9]{32}$"},"object":{"const":"investor"},"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"client":{"type":"string","pattern":"^clt_[a-f0-9]{32}$"},"name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"relationship_to_owner":{"type":"string","x-known-values":["self","spouse","child","parent","sibling","other"],"minLength":1}},"required":["id","object","created","account","client","name","relationship_to_owner"],"additionalProperties":true},"Portfolio":{"type":"object","properties":{"id":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"},"object":{"const":"portfolio"},"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"investor":{"type":"string","pattern":"^inv_[a-f0-9]{32}$"},"name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"reporting_currency":{"const":"INR"}},"required":["id","object","created","account","investor","name","reporting_currency"],"additionalProperties":true},"Instrument":{"type":"object","properties":{"id":{"type":"string","pattern":"^ins_[A-Za-z0-9_-]{1,150}$"},"object":{"const":"instrument"},"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"identifiers":{"type":"array","items":{"type":"object","properties":{"namespace":{"type":"string"},"value":{"type":"string"}},"required":["namespace","value"],"additionalProperties":true}},"domicile_country":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"const":"mutual_fund"},"mutual_fund":{"type":"object","properties":{"fund_name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"share_class":{"anyOf":[{"type":"string"},{"type":"null"}]},"class_currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"distribution_policy":{"type":"string","x-known-values":["accumulating","distributing","unknown"],"minLength":1}},"required":["fund_name","share_class","class_currency","distribution_policy"],"additionalProperties":true}},"required":["id","object","created","name","identifiers","domicile_country","type","mutual_fund"],"additionalProperties":true},"Source":{"type":"object","properties":{"kind":{"type":"string","x-known-values":["manual","provider","statement"],"minLength":1},"name":{"type":"string"}},"required":["kind","name"],"additionalProperties":true},"MarketData":{"type":"object","properties":{"mode":{"type":"string","x-known-values":["live","fixture","unavailable"],"minLength":1},"notice":{"type":"string"}},"required":["mode","notice"],"additionalProperties":true},"PositionInput":{"type":"object","properties":{"instrument":{"type":"string","pattern":"^ins_[A-Za-z0-9_-]{1,150}$"},"current_value":{"$ref":"#/components/schemas/DecimalInput"}},"required":["instrument","current_value"],"additionalProperties":false},"InvestorCreate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"relationship_to_owner":{"type":"string","enum":["self","spouse","child","parent","sibling","other"]},"client":{"type":"string","pattern":"^clt_[a-f0-9]{32}$"}},"required":["name","relationship_to_owner"],"additionalProperties":false},"InvestorUpdate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"relationship_to_owner":{"type":"string","enum":["self","spouse","child","parent","sibling","other"]}},"required":[],"additionalProperties":false,"minProperties":1},"PortfolioCreate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"investor":{"type":"string","pattern":"^inv_[a-f0-9]{32}$"},"as_of":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"positions":{"type":"array","items":{"$ref":"#/components/schemas/CreationPositionInput"},"minItems":1,"maxItems":100}},"required":["name","investor","as_of","positions"],"additionalProperties":false},"SnapshotCreate":{"type":"object","properties":{"expected_snapshot":{"type":"string","pattern":"^psn_[a-f0-9]{32}$"},"as_of":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"positions":{"type":"array","items":{"$ref":"#/components/schemas/PositionInput"},"maxItems":100}},"required":["expected_snapshot","as_of","positions"],"additionalProperties":false},"InvestmentAccount":{"type":"object","properties":{"id":{"type":"string","pattern":"^iac_[a-f0-9]{32}$"},"object":{"const":"investment_account"},"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"portfolio":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"},"name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"kind":{"const":"manual"},"institution_name":{"type":"null"},"reference_masked":{"type":"null"},"latest_snapshot":{"type":"string","pattern":"^psn_[a-f0-9]{32}$"}},"required":["id","object","created","account","portfolio","name","kind","institution_name","reference_masked","latest_snapshot"],"additionalProperties":true},"Snapshot":{"type":"object","properties":{"id":{"type":"string","pattern":"^psn_[a-f0-9]{32}$"},"object":{"const":"position_snapshot"},"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"investment_account":{"type":"string","pattern":"^iac_[a-f0-9]{32}$"},"as_of":{"$ref":"#/components/schemas/FinancialDate"},"source":{"$ref":"#/components/schemas/Source"},"position_count":{"type":"integer","minimum":0,"maximum":100}},"required":["id","object","created","account","investment_account","as_of","source","position_count"],"additionalProperties":true},"Position":{"type":"object","properties":{"id":{"type":"string","pattern":"^pos_[a-f0-9]{32}$"},"object":{"const":"position"},"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"snapshot":{"type":"string","pattern":"^psn_[a-f0-9]{32}$"},"instrument":{"type":"string","pattern":"^ins_[A-Za-z0-9_-]{1,150}$"},"listing":{"type":"null"},"quantity":{"anyOf":[{"$ref":"#/components/schemas/DecimalInput"},{"type":"null"}]},"cost_basis":{"type":"null"},"valuation":{"anyOf":[{"type":"object","properties":{"method":{"const":"reported"},"market_value":{"$ref":"#/components/schemas/Money"},"as_of":{"$ref":"#/components/schemas/FinancialDate"},"source":{"$ref":"#/components/schemas/Source"},"unit_price":{"type":"null"}},"required":["method","market_value","as_of","source","unit_price"],"additionalProperties":true},{"type":"null"}]}},"required":["id","object","created","account","snapshot","instrument","listing","quantity","cost_basis","valuation"],"additionalProperties":true},"SnapshotView":{"type":"object","properties":{"portfolio":{"$ref":"#/components/schemas/Portfolio"},"investment_account":{"$ref":"#/components/schemas/InvestmentAccount"},"snapshot":{"$ref":"#/components/schemas/Snapshot"},"positions":{"type":"array","items":{"$ref":"#/components/schemas/Position"},"maxItems":100},"instruments":{"type":"array","items":{"$ref":"#/components/schemas/Instrument"},"maxItems":100},"total_current_value":{"anyOf":[{"$ref":"#/components/schemas/Money"},{"type":"null"}],"description":"Null if any snapshot position has only supplied units; unavailable value is not zero."},"valuation_basis":{"enum":["manual_current_value","supplied_quantity"]},"market_data":{"$ref":"#/components/schemas/MarketData"}},"required":["portfolio","investment_account","snapshot","positions","instruments","total_current_value","valuation_basis","market_data"],"additionalProperties":true},"FundReference":{"type":"object","properties":{"instrument":{"$ref":"#/components/schemas/Instrument"},"market":{"const":"IN"},"currency":{"const":"INR"},"scheme_id":{"type":"string","minLength":1,"description":"Opaque catalogue identifier; production bridge accepts validated positive decimal scheme IDs, fixture IDs are not DB IDs."},"plan_label":{"type":"string"},"option_label":{"type":"string"},"amfi_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"isin":{"anyOf":[{"type":"string"},{"type":"null"}]},"identity_status":{"type":"string","x-known-values":["resolved","conflict"],"minLength":1},"latest_nav":{"anyOf":[{"type":"object","properties":{"amount":{"type":"string","pattern":"^(0|[1-9][0-9]{0,19})(\\.[0-9]{1,18})?$"},"currency":{"const":"INR"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."}},"required":["amount","currency","date"],"additionalProperties":true},{"type":"null"}]},"data_mode":{"type":"string","x-known-values":["live","fixture"],"minLength":1},"source":{"type":"string"},"freshness":{"type":"object","properties":{"status":{"type":"string","x-known-values":["recent","stale","missing","invalid","fixture"],"minLength":1},"checked_at":{"type":"string","format":"date-time"},"as_of":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"time_zone":{"const":"Asia/Kolkata"},"age_days":{"anyOf":[{"type":"integer"},{"type":"null"}]},"recent_within_days":{"const":3}},"required":["status","checked_at","as_of","time_zone","age_days","recent_within_days"],"additionalProperties":true}},"required":["instrument","market","currency","scheme_id","plan_label","option_label","amfi_code","isin","identity_status","latest_nav","data_mode","source","freshness"],"additionalProperties":true},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","x-known-values":["authentication_error","permission_error","idempotency_error","rate_limit_error","api_error","invalid_request_error"],"minLength":1},"code":{"type":"string","minLength":1},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]},"request_id":{"type":"string","minLength":1}},"required":["type","code","message","param","request_id"],"additionalProperties":true}},"required":["error"],"additionalProperties":true},"ClientsList":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Client"}},"has_more":{"type":"boolean"},"url":{"type":"string"}},"required":["object","data","has_more","url"],"additionalProperties":true},"InvestorsList":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Investor"}},"has_more":{"type":"boolean"},"url":{"type":"string"}},"required":["object","data","has_more","url"],"additionalProperties":true},"PortfoliosList":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Portfolio"}},"has_more":{"type":"boolean"},"url":{"type":"string"}},"required":["object","data","has_more","url"],"additionalProperties":true},"FundsList":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/FundReference"}},"has_more":{"type":"boolean"},"url":{"type":"string"},"market_data":{"$ref":"#/components/schemas/MarketData"}},"required":["object","data","has_more","url","market_data"],"additionalProperties":true},"FundReferences":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/FundReference"}},"has_more":{"const":false},"url":{"type":"string"},"market_data":{"$ref":"#/components/schemas/MarketData"},"missing":{"type":"array","items":{"type":"string","pattern":"^ins_[A-Za-z0-9_-]{1,150}$"}}},"required":["object","data","has_more","url","market_data","missing"],"additionalProperties":true},"PortfolioMixRequest":{"type":"object","properties":{"portfolio":{"anyOf":[{"type":"object","properties":{"type":{"const":"saved"},"id":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}},"required":["type","id"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"in_memory"},"valuation_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"currency":{"const":"INR"},"positions":{"type":"array","items":{"$ref":"#/components/schemas/PositionInput"},"minItems":1,"maxItems":100}},"required":["type","valuation_date","currency","positions"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"mutual_fund"},"mutual_fund_id":{"type":"string","pattern":"^[1-9][0-9]{0,18}$","description":"Portfolio-owning MutualFund ID (positive int64), never AMC or investible scheme ID."}},"required":["type","mutual_fund_id"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"fund_instrument"},"instrument":{"type":"string","pattern":"^ins_[A-Za-z0-9_-]{1,150}$"}},"required":["type","instrument"],"additionalProperties":false}]},"as_of":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"position_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"valuation_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."}},"required":["portfolio"],"additionalProperties":false},"AssetMix":{"type":"object","properties":{"object":{"const":"portfolio_mix"},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"portfolio":{"anyOf":[{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"},{"type":"null"}]},"mix_type":{"const":"asset"},"engine_version":{"type":"string","minLength":1},"as_of_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"valuation_date":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},{"type":"null"}]},"input_total":{"anyOf":[{"type":"object","properties":{"amount":{"type":"string","pattern":"^(0|[1-9][0-9]{0,21})(\\.[0-9]{1,18})?$"},"currency":{"const":"INR"}},"required":["amount","currency"],"additionalProperties":false},{"type":"null"}]},"calculation_precision":{"const":"float64"},"source_roots":{"type":"array","items":{"type":"object","properties":{"mutual_fund_id":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"portfolio_id":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"date":{"type":"string","format":"date","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}$"}},"required":["mutual_fund_id","portfolio_id","date"],"additionalProperties":false},"minItems":1,"maxItems":100},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","x-known-values":["float64_precision","threshold_contribution_skipped","nested_holdings_unavailable","missing_issuer_identity","cycle_detected","classifications_not_historical"],"minLength":1},"message":{"type":"string"},"mutual_fund_id":{"anyOf":[{"type":"string","pattern":"^[1-9][0-9]{0,17}$"},{"type":"null"}]},"path":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","mutual_fund_id","path"],"additionalProperties":false}},"mix":{"type":"object","properties":{"status":{"type":"string","x-known-values":["available","unavailable"],"minLength":1},"denominator":{"const":"total_supplied_value_or_root_value"},"unavailable_reason":{"anyOf":[{"type":"string","x-known-values":["no_eligible_contributions"],"minLength":1},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","x-known-values":["cash","debt","equity","gold","other","unknown"],"minLength":1},"percentage":{"type":"string","pattern":"^-?(1000000000000(\\.0{1,10})?|[0-9]{1,12}(\\.[0-9]{1,10})?)$"}},"required":["code","percentage"],"additionalProperties":false}}},"required":["status","denominator","unavailable_reason","items"],"additionalProperties":false},"position_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."}},"required":["object","account","portfolio","mix_type","engine_version","as_of_date","valuation_date","input_total","calculation_precision","source_roots","warnings","mix"],"additionalProperties":true},"SectorMix":{"type":"object","properties":{"object":{"const":"portfolio_mix"},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"portfolio":{"anyOf":[{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"},{"type":"null"}]},"mix_type":{"const":"sector"},"engine_version":{"type":"string","minLength":1},"as_of_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"valuation_date":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},{"type":"null"}]},"input_total":{"anyOf":[{"type":"object","properties":{"amount":{"type":"string","pattern":"^(0|[1-9][0-9]{0,21})(\\.[0-9]{1,18})?$"},"currency":{"const":"INR"}},"required":["amount","currency"],"additionalProperties":false},{"type":"null"}]},"calculation_precision":{"const":"float64"},"source_roots":{"type":"array","items":{"type":"object","properties":{"mutual_fund_id":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"portfolio_id":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"date":{"type":"string","format":"date","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}$"}},"required":["mutual_fund_id","portfolio_id","date"],"additionalProperties":false},"minItems":1,"maxItems":100},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","x-known-values":["float64_precision","threshold_contribution_skipped","nested_holdings_unavailable","missing_issuer_identity","cycle_detected","classifications_not_historical"],"minLength":1},"message":{"type":"string"},"mutual_fund_id":{"anyOf":[{"type":"string","pattern":"^[1-9][0-9]{0,17}$"},{"type":"null"}]},"path":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","mutual_fund_id","path"],"additionalProperties":false}},"mix":{"type":"object","properties":{"status":{"type":"string","x-known-values":["available","unavailable"],"minLength":1},"denominator":{"const":"recursively_normalized_eligible_equity_sector_contributions"},"unavailable_reason":{"anyOf":[{"type":"string","x-known-values":["no_eligible_contributions"],"minLength":1},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","x-known-values":["not_set","agriculture","auto","cash_equivalents","chemicals","construction","consumer_discretionary","consumer_staples","defence","diversified","education","electronics","etf","energy_production","finance","furniture","government","healthcare","industrial_equipment","infrastructure","it_technology","logistics","media","outsourcing","packaging","paper_products","photographic_films","plastic_products","raw_materials","real_estate","restaurants","retail","shipping","telecom","textile","tobacco","trading","travel_lodging","utilities","other","not_applicable"],"minLength":1},"label":{"type":"string"},"percentage":{"type":"string","pattern":"^(100(\\.0{1,10})?|[0-9]{1,2}(\\.[0-9]{1,10})?)$"}},"required":["code","label","percentage"],"additionalProperties":false}}},"required":["status","denominator","unavailable_reason","items"],"additionalProperties":false},"position_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."}},"required":["object","account","portfolio","mix_type","engine_version","as_of_date","valuation_date","input_total","calculation_precision","source_roots","warnings","mix"],"additionalProperties":true},"IssuerMix":{"type":"object","properties":{"object":{"const":"portfolio_mix"},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"portfolio":{"anyOf":[{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"},{"type":"null"}]},"mix_type":{"const":"issuer"},"engine_version":{"type":"string","minLength":1},"as_of_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"valuation_date":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},{"type":"null"}]},"input_total":{"anyOf":[{"type":"object","properties":{"amount":{"type":"string","pattern":"^(0|[1-9][0-9]{0,21})(\\.[0-9]{1,18})?$"},"currency":{"const":"INR"}},"required":["amount","currency"],"additionalProperties":false},{"type":"null"}]},"calculation_precision":{"const":"float64"},"source_roots":{"type":"array","items":{"type":"object","properties":{"mutual_fund_id":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"portfolio_id":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"date":{"type":"string","format":"date","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}$"}},"required":["mutual_fund_id","portfolio_id","date"],"additionalProperties":false},"minItems":1,"maxItems":100},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","x-known-values":["float64_precision","threshold_contribution_skipped","nested_holdings_unavailable","missing_issuer_identity","cycle_detected","classifications_not_historical"],"minLength":1},"message":{"type":"string"},"mutual_fund_id":{"anyOf":[{"type":"string","pattern":"^[1-9][0-9]{0,17}$"},{"type":"null"}]},"path":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","mutual_fund_id","path"],"additionalProperties":false}},"mix":{"type":"object","properties":{"status":{"type":"string","x-known-values":["available","unavailable"],"minLength":1},"denominator":{"const":"recursively_normalized_eligible_equity_issuer_contributions"},"unavailable_reason":{"anyOf":[{"type":"string","x-known-values":["no_eligible_contributions"],"minLength":1},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"issuer_type":{"type":"string","minLength":1},"issuer_id":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"type":"string","pattern":"^(100(\\.0{1,10})?|[0-9]{1,2}(\\.[0-9]{1,10})?)$"}},"required":["issuer_type","issuer_id","name","percentage"],"additionalProperties":false}}},"required":["status","denominator","unavailable_reason","items"],"additionalProperties":false},"position_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."}},"required":["object","account","portfolio","mix_type","engine_version","as_of_date","valuation_date","input_total","calculation_precision","source_roots","warnings","mix"],"additionalProperties":true},"HistorySource":{"type":"object","properties":{"kind":{"type":"string","enum":["user","statement"]},"reference":{"type":"string","minLength":1,"maxLength":255}},"required":["kind","reference"],"additionalProperties":false},"HistoryRange":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"through":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."}},"required":["from","through"],"additionalProperties":false},"HistoryOpening":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"quantity":{"$ref":"#/components/schemas/UnitInput"}},"required":["date","quantity"],"additionalProperties":false},"HistoryTransaction":{"type":"object","properties":{"external_id":{"type":"string","minLength":1,"maxLength":255},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"sequence":{"type":"integer","minimum":0,"maximum":9007199254740991},"kind":{"type":"string","enum":["buy","sell"]},"quantity":{"$ref":"#/components/schemas/UnitInput"}},"required":["external_id","date","sequence","kind","quantity"],"additionalProperties":false},"HistoryObservation":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"quantity":{"anyOf":[{"$ref":"#/components/schemas/UnitInput"},{"type":"null"}]},"current_value":{"$ref":"#/components/schemas/Money"}},"required":["date"],"additionalProperties":false},"HistoryHoldingInput":{"type":"object","properties":{"external_id":{"type":"string","minLength":1,"maxLength":255},"investment_account":{"type":"string","pattern":"^iac_[a-f0-9]{32}$"},"instrument":{"type":"string","pattern":"^ins_[A-Za-z0-9_-]{1,150}$"},"opening":{"$ref":"#/components/schemas/HistoryOpening"},"complete_range":{"$ref":"#/components/schemas/HistoryRange"},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/HistoryTransaction"},"maxItems":5000},"observed_position":{"$ref":"#/components/schemas/HistoryObservation"}},"required":["external_id","investment_account","instrument"],"additionalProperties":false},"HistoryImport":{"type":"object","properties":{"source":{"$ref":"#/components/schemas/HistorySource"},"holdings":{"type":"array","items":{"$ref":"#/components/schemas/HistoryHoldingInput"},"minItems":1,"maxItems":100},"complete_range":{"$ref":"#/components/schemas/HistoryRange"}},"required":["source","holdings"],"additionalProperties":false},"Holding":{"type":"object","properties":{"id":{"type":"string","pattern":"^hld_[a-f0-9]{32}$"},"object":{"const":"holding"},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"portfolio":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"},"investment_account":{"type":"string","pattern":"^iac_[a-f0-9]{32}$"},"instrument":{"type":"string","pattern":"^ins_[A-Za-z0-9_-]{1,150}$"},"position_backing":{"type":"string","x-known-values":["snapshot","ledger","mixed"],"minLength":1}},"required":["id","object","account","portfolio","investment_account","instrument","position_backing"],"additionalProperties":true},"HoldingPosition":{"type":"object","properties":{"object":{"const":"holding_position"},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"portfolio":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"},"holding":{"type":"string","pattern":"^hld_[a-f0-9]{32}$"},"position_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"quantity":{"anyOf":[{"type":"string","pattern":"^(0|[1-9][0-9]{0,19})(\\.[0-9]{1,18})?$"},{"type":"null"}]},"valuation":{"anyOf":[{"type":"object","properties":{"market_value":{"$ref":"#/components/schemas/Money"},"as_of":{"$ref":"#/components/schemas/FinancialDate"}},"required":["market_value","as_of"],"additionalProperties":true},{"type":"null"}]},"position_backing":{"type":"string","x-known-values":["snapshot","ledger","mixed"],"minLength":1},"history_complete":{"type":"boolean"}},"required":["object","account","portfolio","holding","position_date","quantity","valuation","position_backing","history_complete"],"additionalProperties":true},"HistoryCapability":{"type":"object","properties":{"object":{"const":"history_capability"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"basis":{"const":"declared"},"can_reconstruct":{"type":"boolean"},"history_complete":{"type":"boolean"},"position_backing":{"type":"string","x-known-values":["snapshot","ledger","mixed"],"minLength":1},"reasons":{"type":"array","items":{"type":"string"}}},"required":["object","date","basis","can_reconstruct","history_complete","position_backing","reasons"],"additionalProperties":true},"HoldingsList":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Holding"}},"has_more":{"type":"boolean"},"url":{"type":"string"}},"required":["object","data","has_more","url"],"additionalProperties":true},"HistoryImportResult":{"type":"object","properties":{"object":{"const":"history_import"},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"portfolio":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"},"holdings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^hld_[a-f0-9]{32}$"}},"required":["id"],"additionalProperties":true}}},"required":["object","account","portfolio","holdings"],"additionalProperties":true},"HistoryView":{"type":"object","properties":{"object":{"const":"portfolio_history"},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"portfolio":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"},"source":{"anyOf":[{"$ref":"#/components/schemas/HistorySource"},{"type":"null"}]},"complete_range":{"anyOf":[{"$ref":"#/components/schemas/HistoryRange"},{"type":"null"}]},"holdings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^hld_[a-f0-9]{32}$"},"object":{"const":"holding"},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"portfolio":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"},"investment_account":{"type":"string","pattern":"^iac_[a-f0-9]{32}$"},"instrument":{"type":"string","pattern":"^ins_[A-Za-z0-9_-]{1,150}$"},"position_backing":{"type":"string","x-known-values":["snapshot","ledger","mixed"],"minLength":1},"external_id":{"type":"string"},"opening":{"anyOf":[{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"quantity":{"type":"string","pattern":"^(0|[1-9][0-9]{0,19})(\\.[0-9]{1,18})?$"},"source":{"$ref":"#/components/schemas/HistorySource"}},"required":["date","quantity","source"],"additionalProperties":true},{"type":"null"}]},"complete_range":{"anyOf":[{"$ref":"#/components/schemas/HistoryRange"},{"type":"null"}]},"complete_range_source":{"anyOf":[{"$ref":"#/components/schemas/HistorySource"},{"type":"null"}]},"transactions":{"type":"array","items":{"type":"object","properties":{"external_id":{"type":"string","minLength":1,"maxLength":255},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"sequence":{"type":"integer","minimum":0,"maximum":9007199254740991},"kind":{"type":"string","x-known-values":["buy","sell"],"minLength":1},"quantity":{"type":"string","pattern":"^(0|[1-9][0-9]{0,19})(\\.[0-9]{1,18})?$"},"source":{"$ref":"#/components/schemas/HistorySource"}},"required":["external_id","date","sequence","kind","quantity","source"],"additionalProperties":true}},"observed_position":{"anyOf":[{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"quantity":{"anyOf":[{"type":"string","pattern":"^(0|[1-9][0-9]{0,19})(\\.[0-9]{1,18})?$"},{"type":"null"}]},"current_value":{"$ref":"#/components/schemas/Money"},"source":{"$ref":"#/components/schemas/HistorySource"}},"required":["date","quantity","source"],"additionalProperties":true},{"type":"null"}]}},"required":["id","object","account","portfolio","investment_account","instrument","position_backing","external_id","opening","complete_range","complete_range_source","transactions","observed_position"],"additionalProperties":true}}},"required":["object","account","portfolio","source","complete_range","holdings"],"additionalProperties":true},"CreationPositionInput":{"anyOf":[{"$ref":"#/components/schemas/PositionInput"},{"type":"object","properties":{"instrument":{"type":"string","pattern":"^ins_[A-Za-z0-9_-]{1,150}$"},"quantity":{"type":"string","pattern":"^(?=[0-9.]*[1-9])(0|[1-9][0-9]{0,19})(\\.[0-9]{1,4})?$"}},"required":["instrument","quantity"],"additionalProperties":false}],"description":"Exactly one reported current_value or positive supplied quantity per position. Quantity creation stores dated units atomically; no reported amount is inferred."},"UnitInput":{"type":"string","pattern":"^(0|[1-9][0-9]{0,19})(\\.[0-9]{1,4})?$","description":"Supplied units: maximum four fractional digits; no rounding on input."}},"operations":{"retrieve_account":{"path":"/v1/accounts/{account}","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}}],"status":200,"response":{"$ref":"#/components/schemas/Account"}},"list_clients":{"path":"/v1/accounts/{account}/clients","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"limit","in":"query","required":false,"description":"1–100; default 10.","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"starting_after","in":"query","required":false,"description":"Last resource ID from the previous page. Omit on the first page. Keep filters unchanged.","schema":{"type":"string","pattern":"^clt_[a-f0-9]{32}$"}}],"status":200,"response":{"$ref":"#/components/schemas/ClientsList"}},"retrieve_client":{"path":"/v1/accounts/{account}/clients/{client}","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"client","in":"path","required":true,"description":"ID returned by the clients list or creation response.","schema":{"type":"string","pattern":"^clt_[a-f0-9]{32}$"}}],"status":200,"response":{"$ref":"#/components/schemas/Client"}},"list_investors":{"path":"/v1/accounts/{account}/investors","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"limit","in":"query","required":false,"description":"1–100; default 10.","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"starting_after","in":"query","required":false,"description":"Last resource ID from the previous page. Omit on the first page. Keep filters unchanged.","schema":{"type":"string","pattern":"^inv_[a-f0-9]{32}$"}},{"name":"client","in":"query","required":false,"description":"Limit to investors in this same-account Client, or their portfolios. Does not expand access.","schema":{"type":"string","pattern":"^clt_[a-f0-9]{32}$"}}],"status":200,"response":{"$ref":"#/components/schemas/InvestorsList"}},"create_investor":{"path":"/v1/accounts/{account}/investors","readOnly":false,"method":"POST","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[!-~]{1,255}$"},"description":"Successful responses retained for 24 hours from server recording time; response record and mutation commit atomically. Retries do not extend retention; current authorization always required before replay."}],"request":{"$ref":"#/components/schemas/InvestorCreate"},"status":201,"response":{"$ref":"#/components/schemas/Investor"}},"retrieve_investor":{"path":"/v1/accounts/{account}/investors/{investor}","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"investor","in":"path","required":true,"description":"ID returned by the investors list or creation response.","schema":{"type":"string","pattern":"^inv_[a-f0-9]{32}$"}}],"status":200,"response":{"$ref":"#/components/schemas/Investor"}},"update_investor":{"path":"/v1/accounts/{account}/investors/{investor}","readOnly":false,"method":"POST","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"investor","in":"path","required":true,"description":"Investor being edited.","schema":{"type":"string","pattern":"^inv_[a-f0-9]{32}$"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","pattern":"^[!-~]{1,255}$"},"description":"Successful responses retained for 24 hours from server recording time; response record and mutation commit atomically. Retries do not extend retention; current authorization always required before replay."}],"request":{"$ref":"#/components/schemas/InvestorUpdate"},"status":200,"response":{"$ref":"#/components/schemas/Investor"}},"list_portfolios":{"path":"/v1/accounts/{account}/portfolios","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"limit","in":"query","required":false,"description":"1–100; default 10.","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"starting_after","in":"query","required":false,"description":"Last resource ID from the previous page. Omit on the first page. Keep filters unchanged.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}},{"name":"client","in":"query","required":false,"description":"Limit to investors in this same-account Client, or their portfolios. Does not expand access.","schema":{"type":"string","pattern":"^clt_[a-f0-9]{32}$"}},{"name":"client_ids","in":"query","required":false,"style":"form","explode":true,"schema":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","pattern":"^clt_[a-f0-9]{32}$"}},"description":"OR within list. Mutually exclusive with other filter types and legacy client. Repeated query keys; duplicate IDs are deduplicated."},{"name":"investor_ids","in":"query","required":false,"style":"form","explode":true,"schema":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","pattern":"^inv_[a-f0-9]{32}$"}},"description":"OR within list. Mutually exclusive with other filter types and legacy client. Repeated query keys; duplicate IDs are deduplicated."}],"status":200,"response":{"$ref":"#/components/schemas/PortfoliosList"}},"create_portfolio":{"path":"/v1/accounts/{account}/portfolios","readOnly":false,"method":"POST","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[!-~]{1,255}$"},"description":"Successful responses retained for 24 hours from server recording time; response record and mutation commit atomically. Retries do not extend retention; current authorization always required before replay."}],"request":{"$ref":"#/components/schemas/PortfolioCreate"},"status":201,"response":{"$ref":"#/components/schemas/SnapshotView"}},"retrieve_portfolio":{"path":"/v1/accounts/{account}/portfolios/{portfolio}","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"portfolio","in":"path","required":true,"description":"ID returned by the portfolios list or creation response.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}}],"status":200,"response":{"$ref":"#/components/schemas/Portfolio"}},"search_funds":{"path":"/v1/accounts/{account}/mutual_funds","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"query","in":"query","required":true,"description":"2–100 characters. Case-insensitive label and identifier search; percent and underscore are literal.","schema":{"type":"string","minLength":2,"maxLength":100}},{"name":"limit","in":"query","required":false,"description":"1–20; default 10. Search is a bounded result set, not cursor pagination.","schema":{"type":"integer","minimum":1,"maximum":20,"default":10}}],"status":200,"response":{"$ref":"#/components/schemas/FundsList"}},"fund_references":{"path":"/v1/accounts/{account}/mutual_funds/references","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"instruments","in":"query","required":true,"description":"1–100 distinct instrument IDs in one query parameter. Unknown, inactive or unsupported IDs appear in missing.","schema":{"type":"string","minLength":1,"description":"1–100 distinct IDs separated by commas, singleton query parameter."}}],"status":200,"response":{"$ref":"#/components/schemas/FundReferences"}},"current_snapshot":{"path":"/v1/accounts/{account}/portfolios/{portfolio}/current_snapshot","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"portfolio","in":"path","required":true,"description":"Same-account portfolio.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}}],"status":200,"response":{"$ref":"#/components/schemas/SnapshotView"}},"replace_snapshot":{"path":"/v1/accounts/{account}/portfolios/{portfolio}/snapshots","readOnly":false,"method":"POST","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"portfolio","in":"path","required":true,"description":"Portfolio being edited.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[!-~]{1,255}$"},"description":"Successful responses retained for 24 hours from server recording time; response record and mutation commit atomically. Retries do not extend retention; current authorization always required before replay."}],"request":{"$ref":"#/components/schemas/SnapshotCreate"},"status":201,"response":{"$ref":"#/components/schemas/SnapshotView"}},"asset_mix":{"path":"/v1/accounts/{account}/portfolios/asset_mix","readOnly":true,"method":"POST","parameters":[{"name":"account","in":"path","required":true,"description":"Account ID or me.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}}],"request":{"$ref":"#/components/schemas/PortfolioMixRequest"},"status":200,"response":{"$ref":"#/components/schemas/AssetMix"}},"sector_mix":{"path":"/v1/accounts/{account}/portfolios/sector_mix","readOnly":true,"method":"POST","parameters":[{"name":"account","in":"path","required":true,"description":"Account ID or me.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}}],"request":{"$ref":"#/components/schemas/PortfolioMixRequest"},"status":200,"response":{"$ref":"#/components/schemas/SectorMix"}},"issuer_mix":{"path":"/v1/accounts/{account}/portfolios/issuer_mix","readOnly":true,"method":"POST","parameters":[{"name":"account","in":"path","required":true,"description":"Account ID or me.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}}],"request":{"$ref":"#/components/schemas/PortfolioMixRequest"},"status":200,"response":{"$ref":"#/components/schemas/IssuerMix"}},"import_history":{"path":"/v1/accounts/{account}/portfolios/{portfolio}/history/imports","readOnly":false,"method":"POST","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account or me.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"portfolio","in":"path","required":true,"description":"Saved portfolio ID.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[!-~]{1,255}$"},"description":"Successful responses retained for 24 hours from server recording time; response record and mutation commit atomically. Retries do not extend retention; current authorization always required before replay."}],"request":{"$ref":"#/components/schemas/HistoryImport"},"status":201,"response":{"$ref":"#/components/schemas/HistoryImportResult"}},"retrieve_history":{"path":"/v1/accounts/{account}/portfolios/{portfolio}/history","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account or me.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"portfolio","in":"path","required":true,"description":"Saved portfolio ID.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}}],"status":200,"response":{"$ref":"#/components/schemas/HistoryView"}},"history_capabilities":{"path":"/v1/accounts/{account}/portfolios/{portfolio}/history/capabilities","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account or me.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"portfolio","in":"path","required":true,"description":"Saved portfolio ID.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}},{"name":"date","in":"query","required":true,"description":"Investor position date; daily close in the investment account timezone.","schema":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."}}],"status":200,"response":{"$ref":"#/components/schemas/HistoryCapability"}},"list_holdings":{"path":"/v1/accounts/{account}/portfolios/{portfolio}/holdings","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account or me.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"portfolio","in":"path","required":true,"description":"Saved portfolio ID.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}},{"name":"date","in":"query","required":false,"description":"Optional historical date; closed holdings remain available.","schema":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."}}],"status":200,"response":{"$ref":"#/components/schemas/HoldingsList"}},"retrieve_holding":{"path":"/v1/accounts/{account}/portfolios/{portfolio}/holdings/{holding}","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account or me.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"portfolio","in":"path","required":true,"description":"Saved portfolio ID.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}},{"name":"holding","in":"path","required":true,"description":"Holding scoped to this portfolio.","schema":{"type":"string","pattern":"^hld_[a-f0-9]{32}$"}}],"status":200,"response":{"$ref":"#/components/schemas/Holding"}},"holding_position":{"path":"/v1/accounts/{account}/portfolios/{portfolio}/holdings/{holding}/position","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account or me.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"portfolio","in":"path","required":true,"description":"Saved portfolio ID.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}},{"name":"holding","in":"path","required":true,"description":"Holding scoped to this portfolio.","schema":{"type":"string","pattern":"^hld_[a-f0-9]{32}$"}},{"name":"date","in":"query","required":true,"description":"Investor position date.","schema":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."}}],"status":200,"response":{"$ref":"#/components/schemas/HoldingPosition"}}}};
2
+ module.exports = {"schemas":{"DecimalInput":{"type":"string","pattern":"^(0|[1-9][0-9]{0,19})(\\.[0-9]{1,18})?$"},"Money":{"type":"object","properties":{"amount":{"type":"string","pattern":"^(0|[1-9][0-9]{0,21})(\\.[0-9]{1,18})?$"},"currency":{"const":"INR"}},"required":["amount","currency"],"additionalProperties":true},"FinancialDate":{"type":"object","properties":{"precision":{"const":"date"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"time_zone":{"const":"Asia/Kolkata"}},"required":["precision","date","time_zone"],"additionalProperties":true},"Account":{"type":"object","properties":{"id":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"object":{"const":"account"},"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"primary_investor":{"anyOf":[{"type":"string","pattern":"^inv_[a-f0-9]{32}$"},{"type":"null"}]},"personal_client_id":{"anyOf":[{"type":"string","pattern":"^clt_[a-f0-9]{32}$"},{"type":"null"}],"description":"Authenticated human user personal household in this account; null for machine account keys or no link. This context grants no access."}},"required":["id","object","created","primary_investor"],"additionalProperties":true},"Client":{"type":"object","properties":{"id":{"type":"string","pattern":"^clt_[a-f0-9]{32}$"},"object":{"const":"client"},"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"}},"required":["id","object","created","account","name"],"additionalProperties":true},"Investor":{"type":"object","properties":{"id":{"type":"string","pattern":"^inv_[a-f0-9]{32}$"},"object":{"const":"investor"},"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"client":{"type":"string","pattern":"^clt_[a-f0-9]{32}$"},"name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"relationship_to_owner":{"type":"string","x-known-values":["self","spouse","child","parent","sibling","other"],"minLength":1}},"required":["id","object","created","account","client","name","relationship_to_owner"],"additionalProperties":true},"Portfolio":{"type":"object","properties":{"id":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"},"object":{"const":"portfolio"},"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"investor":{"type":"string","pattern":"^inv_[a-f0-9]{32}$"},"name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"reporting_currency":{"const":"INR"}},"required":["id","object","created","account","investor","name","reporting_currency"],"additionalProperties":true},"Instrument":{"type":"object","properties":{"id":{"type":"string","pattern":"^ins_[A-Za-z0-9_-]{1,150}$"},"object":{"const":"instrument"},"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"identifiers":{"type":"array","items":{"type":"object","properties":{"namespace":{"type":"string"},"value":{"type":"string"}},"required":["namespace","value"],"additionalProperties":true}},"domicile_country":{"anyOf":[{"type":"string"},{"type":"null"}]},"type":{"const":"mutual_fund"},"mutual_fund":{"type":"object","properties":{"fund_name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"share_class":{"anyOf":[{"type":"string"},{"type":"null"}]},"class_currency":{"anyOf":[{"type":"string"},{"type":"null"}]},"distribution_policy":{"type":"string","x-known-values":["accumulating","distributing","unknown"],"minLength":1}},"required":["fund_name","share_class","class_currency","distribution_policy"],"additionalProperties":true}},"required":["id","object","created","name","identifiers","domicile_country","type","mutual_fund"],"additionalProperties":true},"Source":{"type":"object","properties":{"kind":{"type":"string","x-known-values":["manual","provider","statement"],"minLength":1},"name":{"type":"string"}},"required":["kind","name"],"additionalProperties":true},"MarketData":{"type":"object","properties":{"mode":{"type":"string","x-known-values":["live","fixture","unavailable"],"minLength":1},"notice":{"type":"string"}},"required":["mode","notice"],"additionalProperties":true},"PositionInput":{"type":"object","properties":{"instrument":{"type":"string","pattern":"^ins_[A-Za-z0-9_-]{1,150}$"},"current_value":{"$ref":"#/components/schemas/DecimalInput"}},"required":["instrument","current_value"],"additionalProperties":false},"InvestorCreate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"relationship_to_owner":{"type":"string","enum":["self","spouse","child","parent","sibling","other"]},"client":{"type":"string","pattern":"^clt_[a-f0-9]{32}$"}},"required":["name","relationship_to_owner"],"additionalProperties":false},"InvestorUpdate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"relationship_to_owner":{"type":"string","enum":["self","spouse","child","parent","sibling","other"]}},"required":[],"additionalProperties":false,"minProperties":1},"PortfolioUpdate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"expected_name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"}},"required":["name","expected_name"],"additionalProperties":false},"PortfolioCreate":{"type":"object","properties":{"name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"investor":{"type":"string","pattern":"^inv_[a-f0-9]{32}$"},"as_of":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"positions":{"type":"array","items":{"$ref":"#/components/schemas/CreationPositionInput"},"minItems":0,"maxItems":100}},"required":["name","investor","as_of","positions"],"additionalProperties":false},"SnapshotCreate":{"type":"object","properties":{"expected_snapshot":{"type":"string","pattern":"^psn_[a-f0-9]{32}$"},"as_of":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"positions":{"type":"array","items":{"$ref":"#/components/schemas/PositionInput"},"maxItems":100}},"required":["expected_snapshot","as_of","positions"],"additionalProperties":false},"InvestmentAccount":{"type":"object","properties":{"id":{"type":"string","pattern":"^iac_[a-f0-9]{32}$"},"object":{"const":"investment_account"},"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"portfolio":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"},"name":{"type":"string","minLength":1,"maxLength":200,"pattern":"\\S"},"kind":{"const":"manual"},"institution_name":{"type":"null"},"reference_masked":{"type":"null"},"latest_snapshot":{"type":"string","pattern":"^psn_[a-f0-9]{32}$"}},"required":["id","object","created","account","portfolio","name","kind","institution_name","reference_masked","latest_snapshot"],"additionalProperties":true},"Snapshot":{"type":"object","properties":{"id":{"type":"string","pattern":"^psn_[a-f0-9]{32}$"},"object":{"const":"position_snapshot"},"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"investment_account":{"type":"string","pattern":"^iac_[a-f0-9]{32}$"},"as_of":{"$ref":"#/components/schemas/FinancialDate"},"source":{"$ref":"#/components/schemas/Source"},"position_count":{"type":"integer","minimum":0,"maximum":100}},"required":["id","object","created","account","investment_account","as_of","source","position_count"],"additionalProperties":true},"Position":{"type":"object","properties":{"id":{"type":"string","pattern":"^pos_[a-f0-9]{32}$"},"object":{"const":"position"},"created":{"type":"integer","minimum":0,"maximum":9007199254740991},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"snapshot":{"type":"string","pattern":"^psn_[a-f0-9]{32}$"},"instrument":{"type":"string","pattern":"^ins_[A-Za-z0-9_-]{1,150}$"},"listing":{"type":"null"},"quantity":{"anyOf":[{"$ref":"#/components/schemas/DecimalInput"},{"type":"null"}]},"cost_basis":{"type":"null"},"valuation":{"anyOf":[{"type":"object","properties":{"method":{"const":"reported"},"market_value":{"$ref":"#/components/schemas/Money"},"as_of":{"$ref":"#/components/schemas/FinancialDate"},"source":{"$ref":"#/components/schemas/Source"},"unit_price":{"type":"null"}},"required":["method","market_value","as_of","source","unit_price"],"additionalProperties":true},{"type":"null"}]}},"required":["id","object","created","account","snapshot","instrument","listing","quantity","cost_basis","valuation"],"additionalProperties":true},"SnapshotView":{"type":"object","properties":{"portfolio":{"$ref":"#/components/schemas/Portfolio"},"investment_account":{"$ref":"#/components/schemas/InvestmentAccount"},"snapshot":{"$ref":"#/components/schemas/Snapshot"},"positions":{"type":"array","items":{"$ref":"#/components/schemas/Position"},"maxItems":100},"instruments":{"type":"array","items":{"$ref":"#/components/schemas/Instrument"},"maxItems":100},"total_current_value":{"anyOf":[{"$ref":"#/components/schemas/Money"},{"type":"null"}],"description":"Null if any snapshot position has only supplied units; unavailable value is not zero."},"valuation_basis":{"enum":["manual_current_value","supplied_quantity"]},"market_data":{"$ref":"#/components/schemas/MarketData"}},"required":["portfolio","investment_account","snapshot","positions","instruments","total_current_value","valuation_basis","market_data"],"additionalProperties":true},"FundReference":{"type":"object","properties":{"instrument":{"$ref":"#/components/schemas/Instrument"},"market":{"const":"IN"},"currency":{"const":"INR"},"scheme_id":{"type":"string","minLength":1,"description":"Opaque catalogue identifier; production bridge accepts validated positive decimal scheme IDs, fixture IDs are not DB IDs."},"plan_label":{"type":"string"},"option_label":{"type":"string"},"amfi_code":{"anyOf":[{"type":"string"},{"type":"null"}]},"isin":{"anyOf":[{"type":"string"},{"type":"null"}]},"identity_status":{"type":"string","x-known-values":["resolved","conflict"],"minLength":1},"latest_nav":{"anyOf":[{"type":"object","properties":{"amount":{"type":"string","pattern":"^(0|[1-9][0-9]{0,19})(\\.[0-9]{1,18})?$"},"currency":{"const":"INR"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."}},"required":["amount","currency","date"],"additionalProperties":true},{"type":"null"}]},"data_mode":{"type":"string","x-known-values":["live","fixture"],"minLength":1},"source":{"type":"string"},"freshness":{"type":"object","properties":{"status":{"type":"string","x-known-values":["recent","stale","missing","invalid","fixture"],"minLength":1},"checked_at":{"type":"string","format":"date-time"},"as_of":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"time_zone":{"const":"Asia/Kolkata"},"age_days":{"anyOf":[{"type":"integer"},{"type":"null"}]},"recent_within_days":{"const":3}},"required":["status","checked_at","as_of","time_zone","age_days","recent_within_days"],"additionalProperties":true}},"required":["instrument","market","currency","scheme_id","plan_label","option_label","amfi_code","isin","identity_status","latest_nav","data_mode","source","freshness"],"additionalProperties":true},"Error":{"type":"object","properties":{"error":{"type":"object","properties":{"type":{"type":"string","x-known-values":["authentication_error","permission_error","idempotency_error","rate_limit_error","api_error","invalid_request_error"],"minLength":1},"code":{"type":"string","minLength":1},"message":{"type":"string"},"param":{"anyOf":[{"type":"string"},{"type":"null"}]},"request_id":{"type":"string","minLength":1}},"required":["type","code","message","param","request_id"],"additionalProperties":true}},"required":["error"],"additionalProperties":true},"ClientsList":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Client"}},"has_more":{"type":"boolean"},"url":{"type":"string"}},"required":["object","data","has_more","url"],"additionalProperties":true},"InvestorsList":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Investor"}},"has_more":{"type":"boolean"},"url":{"type":"string"}},"required":["object","data","has_more","url"],"additionalProperties":true},"PortfoliosList":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Portfolio"}},"has_more":{"type":"boolean"},"url":{"type":"string"}},"required":["object","data","has_more","url"],"additionalProperties":true},"FundsList":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/FundReference"}},"has_more":{"type":"boolean"},"url":{"type":"string"},"market_data":{"$ref":"#/components/schemas/MarketData"}},"required":["object","data","has_more","url","market_data"],"additionalProperties":true},"FundReferences":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/FundReference"}},"has_more":{"const":false},"url":{"type":"string"},"market_data":{"$ref":"#/components/schemas/MarketData"},"missing":{"type":"array","items":{"type":"string","pattern":"^ins_[A-Za-z0-9_-]{1,150}$"}}},"required":["object","data","has_more","url","market_data","missing"],"additionalProperties":true},"PortfolioMixRequest":{"type":"object","properties":{"portfolio":{"anyOf":[{"type":"object","properties":{"type":{"const":"saved"},"id":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}},"required":["type","id"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"in_memory"},"valuation_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"currency":{"const":"INR"},"positions":{"type":"array","items":{"$ref":"#/components/schemas/PositionInput"},"minItems":1,"maxItems":100}},"required":["type","valuation_date","currency","positions"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"mutual_fund"},"mutual_fund_id":{"type":"string","pattern":"^[1-9][0-9]{0,18}$","description":"Portfolio-owning MutualFund ID (positive int64), never AMC or investible scheme ID."}},"required":["type","mutual_fund_id"],"additionalProperties":false},{"type":"object","properties":{"type":{"const":"fund_instrument"},"instrument":{"type":"string","pattern":"^ins_[A-Za-z0-9_-]{1,150}$"}},"required":["type","instrument"],"additionalProperties":false}]},"as_of":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"position_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"valuation_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."}},"required":["portfolio"],"additionalProperties":false},"AssetMix":{"type":"object","properties":{"object":{"const":"portfolio_mix"},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"portfolio":{"anyOf":[{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"},{"type":"null"}]},"mix_type":{"const":"asset"},"engine_version":{"type":"string","minLength":1},"as_of_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"valuation_date":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},{"type":"null"}]},"input_total":{"anyOf":[{"type":"object","properties":{"amount":{"type":"string","pattern":"^(0|[1-9][0-9]{0,21})(\\.[0-9]{1,18})?$"},"currency":{"const":"INR"}},"required":["amount","currency"],"additionalProperties":false},{"type":"null"}]},"calculation_precision":{"const":"float64"},"source_roots":{"type":"array","items":{"type":"object","properties":{"mutual_fund_id":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"portfolio_id":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"date":{"type":"string","format":"date","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}$"}},"required":["mutual_fund_id","portfolio_id","date"],"additionalProperties":false},"minItems":1,"maxItems":100},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","x-known-values":["float64_precision","threshold_contribution_skipped","nested_holdings_unavailable","missing_issuer_identity","cycle_detected","classifications_not_historical"],"minLength":1},"message":{"type":"string"},"mutual_fund_id":{"anyOf":[{"type":"string","pattern":"^[1-9][0-9]{0,17}$"},{"type":"null"}]},"path":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","mutual_fund_id","path"],"additionalProperties":false}},"mix":{"type":"object","properties":{"status":{"type":"string","x-known-values":["available","unavailable"],"minLength":1},"denominator":{"const":"total_supplied_value_or_root_value"},"unavailable_reason":{"anyOf":[{"type":"string","x-known-values":["no_eligible_contributions"],"minLength":1},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","x-known-values":["cash","debt","equity","gold","other","unknown"],"minLength":1},"percentage":{"type":"string","pattern":"^-?(1000000000000(\\.0{1,10})?|[0-9]{1,12}(\\.[0-9]{1,10})?)$"}},"required":["code","percentage"],"additionalProperties":false}}},"required":["status","denominator","unavailable_reason","items"],"additionalProperties":false},"position_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."}},"required":["object","account","portfolio","mix_type","engine_version","as_of_date","valuation_date","input_total","calculation_precision","source_roots","warnings","mix"],"additionalProperties":true},"SectorMix":{"type":"object","properties":{"object":{"const":"portfolio_mix"},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"portfolio":{"anyOf":[{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"},{"type":"null"}]},"mix_type":{"const":"sector"},"engine_version":{"type":"string","minLength":1},"as_of_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"valuation_date":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},{"type":"null"}]},"input_total":{"anyOf":[{"type":"object","properties":{"amount":{"type":"string","pattern":"^(0|[1-9][0-9]{0,21})(\\.[0-9]{1,18})?$"},"currency":{"const":"INR"}},"required":["amount","currency"],"additionalProperties":false},{"type":"null"}]},"calculation_precision":{"const":"float64"},"source_roots":{"type":"array","items":{"type":"object","properties":{"mutual_fund_id":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"portfolio_id":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"date":{"type":"string","format":"date","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}$"}},"required":["mutual_fund_id","portfolio_id","date"],"additionalProperties":false},"minItems":1,"maxItems":100},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","x-known-values":["float64_precision","threshold_contribution_skipped","nested_holdings_unavailable","missing_issuer_identity","cycle_detected","classifications_not_historical"],"minLength":1},"message":{"type":"string"},"mutual_fund_id":{"anyOf":[{"type":"string","pattern":"^[1-9][0-9]{0,17}$"},{"type":"null"}]},"path":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","mutual_fund_id","path"],"additionalProperties":false}},"mix":{"type":"object","properties":{"status":{"type":"string","x-known-values":["available","unavailable"],"minLength":1},"denominator":{"const":"recursively_normalized_eligible_equity_sector_contributions"},"unavailable_reason":{"anyOf":[{"type":"string","x-known-values":["no_eligible_contributions"],"minLength":1},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","x-known-values":["not_set","agriculture","auto","cash_equivalents","chemicals","construction","consumer_discretionary","consumer_staples","defence","diversified","education","electronics","etf","energy_production","finance","furniture","government","healthcare","industrial_equipment","infrastructure","it_technology","logistics","media","outsourcing","packaging","paper_products","photographic_films","plastic_products","raw_materials","real_estate","restaurants","retail","shipping","telecom","textile","tobacco","trading","travel_lodging","utilities","other","not_applicable"],"minLength":1},"label":{"type":"string"},"percentage":{"type":"string","pattern":"^(100(\\.0{1,10})?|[0-9]{1,2}(\\.[0-9]{1,10})?)$"}},"required":["code","label","percentage"],"additionalProperties":false}}},"required":["status","denominator","unavailable_reason","items"],"additionalProperties":false},"position_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."}},"required":["object","account","portfolio","mix_type","engine_version","as_of_date","valuation_date","input_total","calculation_precision","source_roots","warnings","mix"],"additionalProperties":true},"IssuerMix":{"type":"object","properties":{"object":{"const":"portfolio_mix"},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"portfolio":{"anyOf":[{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"},{"type":"null"}]},"mix_type":{"const":"issuer"},"engine_version":{"type":"string","minLength":1},"as_of_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"valuation_date":{"anyOf":[{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},{"type":"null"}]},"input_total":{"anyOf":[{"type":"object","properties":{"amount":{"type":"string","pattern":"^(0|[1-9][0-9]{0,21})(\\.[0-9]{1,18})?$"},"currency":{"const":"INR"}},"required":["amount","currency"],"additionalProperties":false},{"type":"null"}]},"calculation_precision":{"const":"float64"},"source_roots":{"type":"array","items":{"type":"object","properties":{"mutual_fund_id":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"portfolio_id":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"date":{"type":"string","format":"date","pattern":"^[0-9]{4}-[0-9]{2}-[0-9]{2}$"}},"required":["mutual_fund_id","portfolio_id","date"],"additionalProperties":false},"minItems":1,"maxItems":100},"warnings":{"type":"array","items":{"type":"object","properties":{"code":{"type":"string","x-known-values":["float64_precision","threshold_contribution_skipped","nested_holdings_unavailable","missing_issuer_identity","cycle_detected","classifications_not_historical"],"minLength":1},"message":{"type":"string"},"mutual_fund_id":{"anyOf":[{"type":"string","pattern":"^[1-9][0-9]{0,17}$"},{"type":"null"}]},"path":{"anyOf":[{"type":"string"},{"type":"null"}]}},"required":["code","message","mutual_fund_id","path"],"additionalProperties":false}},"mix":{"type":"object","properties":{"status":{"type":"string","x-known-values":["available","unavailable"],"minLength":1},"denominator":{"const":"recursively_normalized_eligible_equity_issuer_contributions"},"unavailable_reason":{"anyOf":[{"type":"string","x-known-values":["no_eligible_contributions"],"minLength":1},{"type":"null"}]},"items":{"type":"array","items":{"type":"object","properties":{"issuer_type":{"type":"string","minLength":1},"issuer_id":{"type":"string","pattern":"^[1-9][0-9]{0,18}$"},"name":{"anyOf":[{"type":"string"},{"type":"null"}]},"percentage":{"type":"string","pattern":"^(100(\\.0{1,10})?|[0-9]{1,2}(\\.[0-9]{1,10})?)$"}},"required":["issuer_type","issuer_id","name","percentage"],"additionalProperties":false}}},"required":["status","denominator","unavailable_reason","items"],"additionalProperties":false},"position_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."}},"required":["object","account","portfolio","mix_type","engine_version","as_of_date","valuation_date","input_total","calculation_precision","source_roots","warnings","mix"],"additionalProperties":true},"HistorySource":{"type":"object","properties":{"kind":{"type":"string","enum":["user","statement"]},"reference":{"type":"string","minLength":1,"maxLength":255}},"required":["kind","reference"],"additionalProperties":false},"HistoryRange":{"type":"object","properties":{"from":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"through":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."}},"required":["from","through"],"additionalProperties":false},"HistoryOpening":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"quantity":{"$ref":"#/components/schemas/UnitInput"}},"required":["date","quantity"],"additionalProperties":false},"HistoryTransaction":{"type":"object","properties":{"external_id":{"type":"string","minLength":1,"maxLength":255},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"sequence":{"type":"integer","minimum":0,"maximum":9007199254740991},"kind":{"type":"string","enum":["buy","sell"]},"quantity":{"$ref":"#/components/schemas/UnitInput"}},"required":["external_id","date","sequence","kind","quantity"],"additionalProperties":false},"HistoryObservation":{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"quantity":{"anyOf":[{"$ref":"#/components/schemas/UnitInput"},{"type":"null"}]},"current_value":{"$ref":"#/components/schemas/Money"}},"required":["date"],"additionalProperties":false},"HistoryHoldingInput":{"type":"object","properties":{"external_id":{"type":"string","minLength":1,"maxLength":255},"investment_account":{"type":"string","pattern":"^iac_[a-f0-9]{32}$"},"instrument":{"type":"string","pattern":"^ins_[A-Za-z0-9_-]{1,150}$"},"opening":{"$ref":"#/components/schemas/HistoryOpening"},"complete_range":{"$ref":"#/components/schemas/HistoryRange"},"transactions":{"type":"array","items":{"$ref":"#/components/schemas/HistoryTransaction"},"maxItems":5000},"observed_position":{"$ref":"#/components/schemas/HistoryObservation"}},"required":["external_id","investment_account","instrument"],"additionalProperties":false},"HistoryImport":{"type":"object","properties":{"source":{"$ref":"#/components/schemas/HistorySource"},"holdings":{"type":"array","items":{"$ref":"#/components/schemas/HistoryHoldingInput"},"minItems":1,"maxItems":100},"complete_range":{"$ref":"#/components/schemas/HistoryRange"}},"required":["source","holdings"],"additionalProperties":false},"Holding":{"type":"object","properties":{"id":{"type":"string","pattern":"^hld_[a-f0-9]{32}$"},"object":{"const":"holding"},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"portfolio":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"},"investment_account":{"type":"string","pattern":"^iac_[a-f0-9]{32}$"},"instrument":{"type":"string","pattern":"^ins_[A-Za-z0-9_-]{1,150}$"},"position_backing":{"type":"string","x-known-values":["snapshot","ledger","mixed"],"minLength":1}},"required":["id","object","account","portfolio","investment_account","instrument","position_backing"],"additionalProperties":true},"HoldingPosition":{"type":"object","properties":{"object":{"const":"holding_position"},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"portfolio":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"},"holding":{"type":"string","pattern":"^hld_[a-f0-9]{32}$"},"position_date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"quantity":{"anyOf":[{"type":"string","pattern":"^(0|[1-9][0-9]{0,19})(\\.[0-9]{1,18})?$"},{"type":"null"}]},"valuation":{"anyOf":[{"type":"object","properties":{"market_value":{"$ref":"#/components/schemas/Money"},"as_of":{"$ref":"#/components/schemas/FinancialDate"}},"required":["market_value","as_of"],"additionalProperties":true},{"type":"null"}]},"position_backing":{"type":"string","x-known-values":["snapshot","ledger","mixed"],"minLength":1},"history_complete":{"type":"boolean"}},"required":["object","account","portfolio","holding","position_date","quantity","valuation","position_backing","history_complete"],"additionalProperties":true},"HistoryCapability":{"type":"object","properties":{"object":{"const":"history_capability"},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"basis":{"const":"declared"},"can_reconstruct":{"type":"boolean"},"history_complete":{"type":"boolean"},"position_backing":{"type":"string","x-known-values":["snapshot","ledger","mixed"],"minLength":1},"reasons":{"type":"array","items":{"type":"string"}}},"required":["object","date","basis","can_reconstruct","history_complete","position_backing","reasons"],"additionalProperties":true},"HoldingsList":{"type":"object","properties":{"object":{"const":"list"},"data":{"type":"array","items":{"$ref":"#/components/schemas/Holding"}},"has_more":{"type":"boolean"},"url":{"type":"string"}},"required":["object","data","has_more","url"],"additionalProperties":true},"HistoryImportResult":{"type":"object","properties":{"object":{"const":"history_import"},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"portfolio":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"},"holdings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^hld_[a-f0-9]{32}$"}},"required":["id"],"additionalProperties":true}}},"required":["object","account","portfolio","holdings"],"additionalProperties":true},"HistoryView":{"type":"object","properties":{"object":{"const":"portfolio_history"},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"portfolio":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"},"source":{"anyOf":[{"$ref":"#/components/schemas/HistorySource"},{"type":"null"}]},"complete_range":{"anyOf":[{"$ref":"#/components/schemas/HistoryRange"},{"type":"null"}]},"holdings":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string","pattern":"^hld_[a-f0-9]{32}$"},"object":{"const":"holding"},"account":{"type":"string","pattern":"^acct_[a-f0-9]{32}$"},"portfolio":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"},"investment_account":{"type":"string","pattern":"^iac_[a-f0-9]{32}$"},"instrument":{"type":"string","pattern":"^ins_[A-Za-z0-9_-]{1,150}$"},"position_backing":{"type":"string","x-known-values":["snapshot","ledger","mixed"],"minLength":1},"external_id":{"type":"string"},"opening":{"anyOf":[{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"quantity":{"type":"string","pattern":"^(0|[1-9][0-9]{0,19})(\\.[0-9]{1,18})?$"},"source":{"$ref":"#/components/schemas/HistorySource"}},"required":["date","quantity","source"],"additionalProperties":true},{"type":"null"}]},"complete_range":{"anyOf":[{"$ref":"#/components/schemas/HistoryRange"},{"type":"null"}]},"complete_range_source":{"anyOf":[{"$ref":"#/components/schemas/HistorySource"},{"type":"null"}]},"transactions":{"type":"array","items":{"type":"object","properties":{"external_id":{"type":"string","minLength":1,"maxLength":255},"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"sequence":{"type":"integer","minimum":0,"maximum":9007199254740991},"kind":{"type":"string","x-known-values":["buy","sell"],"minLength":1},"quantity":{"type":"string","pattern":"^(0|[1-9][0-9]{0,19})(\\.[0-9]{1,18})?$"},"source":{"$ref":"#/components/schemas/HistorySource"}},"required":["external_id","date","sequence","kind","quantity","source"],"additionalProperties":true}},"observed_position":{"anyOf":[{"type":"object","properties":{"date":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."},"quantity":{"anyOf":[{"type":"string","pattern":"^(0|[1-9][0-9]{0,19})(\\.[0-9]{1,18})?$"},{"type":"null"}]},"current_value":{"$ref":"#/components/schemas/Money"},"source":{"$ref":"#/components/schemas/HistorySource"}},"required":["date","quantity","source"],"additionalProperties":true},{"type":"null"}]}},"required":["id","object","account","portfolio","investment_account","instrument","position_backing","external_id","opening","complete_range","complete_range_source","transactions","observed_position"],"additionalProperties":true}}},"required":["object","account","portfolio","source","complete_range","holdings"],"additionalProperties":true},"CreationPositionInput":{"anyOf":[{"$ref":"#/components/schemas/PositionInput"},{"type":"object","properties":{"instrument":{"type":"string","pattern":"^ins_[A-Za-z0-9_-]{1,150}$"},"quantity":{"type":"string","pattern":"^(?=[0-9.]*[1-9])(0|[1-9][0-9]{0,19})(\\.[0-9]{1,4})?$"}},"required":["instrument","quantity"],"additionalProperties":false}],"description":"Exactly one reported current_value or positive supplied quantity per position. Quantity creation stores dated units atomically; no reported amount is inferred."},"UnitInput":{"type":"string","pattern":"^(0|[1-9][0-9]{0,19})(\\.[0-9]{1,4})?$","description":"Supplied units: maximum four fractional digits; no rounding on input."}},"operations":{"retrieve_account":{"path":"/v1/accounts/{account}","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}}],"status":200,"response":{"$ref":"#/components/schemas/Account"}},"list_clients":{"path":"/v1/accounts/{account}/clients","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"limit","in":"query","required":false,"description":"1–100; default 10.","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"starting_after","in":"query","required":false,"description":"Last resource ID from the previous page. Omit on the first page. Keep filters unchanged.","schema":{"type":"string","pattern":"^clt_[a-f0-9]{32}$"}}],"status":200,"response":{"$ref":"#/components/schemas/ClientsList"}},"retrieve_client":{"path":"/v1/accounts/{account}/clients/{client}","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"client","in":"path","required":true,"description":"ID returned by the clients list or creation response.","schema":{"type":"string","pattern":"^clt_[a-f0-9]{32}$"}}],"status":200,"response":{"$ref":"#/components/schemas/Client"}},"list_investors":{"path":"/v1/accounts/{account}/investors","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"limit","in":"query","required":false,"description":"1–100; default 10.","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"starting_after","in":"query","required":false,"description":"Last resource ID from the previous page. Omit on the first page. Keep filters unchanged.","schema":{"type":"string","pattern":"^inv_[a-f0-9]{32}$"}},{"name":"client","in":"query","required":false,"description":"Limit to investors in this same-account Client, or their portfolios. Does not expand access.","schema":{"type":"string","pattern":"^clt_[a-f0-9]{32}$"}}],"status":200,"response":{"$ref":"#/components/schemas/InvestorsList"}},"create_investor":{"path":"/v1/accounts/{account}/investors","readOnly":false,"method":"POST","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[!-~]{1,255}$"},"description":"Successful responses retained for 24 hours from server recording time; response record and mutation commit atomically. Retries do not extend retention; current authorization always required before replay."}],"request":{"$ref":"#/components/schemas/InvestorCreate"},"status":201,"response":{"$ref":"#/components/schemas/Investor"}},"retrieve_investor":{"path":"/v1/accounts/{account}/investors/{investor}","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"investor","in":"path","required":true,"description":"ID returned by the investors list or creation response.","schema":{"type":"string","pattern":"^inv_[a-f0-9]{32}$"}}],"status":200,"response":{"$ref":"#/components/schemas/Investor"}},"update_investor":{"path":"/v1/accounts/{account}/investors/{investor}","readOnly":false,"method":"POST","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"investor","in":"path","required":true,"description":"Investor being edited.","schema":{"type":"string","pattern":"^inv_[a-f0-9]{32}$"}},{"name":"Idempotency-Key","in":"header","required":false,"schema":{"type":"string","pattern":"^[!-~]{1,255}$"},"description":"Successful responses retained for 24 hours from server recording time; response record and mutation commit atomically. Retries do not extend retention; current authorization always required before replay."}],"request":{"$ref":"#/components/schemas/InvestorUpdate"},"status":200,"response":{"$ref":"#/components/schemas/Investor"}},"list_portfolios":{"path":"/v1/accounts/{account}/portfolios","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"limit","in":"query","required":false,"description":"1–100; default 10.","schema":{"type":"integer","minimum":1,"maximum":100,"default":10}},{"name":"starting_after","in":"query","required":false,"description":"Last resource ID from the previous page. Omit on the first page. Keep filters unchanged.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}},{"name":"client","in":"query","required":false,"description":"Limit to investors in this same-account Client, or their portfolios. Does not expand access.","schema":{"type":"string","pattern":"^clt_[a-f0-9]{32}$"}},{"name":"client_ids","in":"query","required":false,"style":"form","explode":true,"schema":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","pattern":"^clt_[a-f0-9]{32}$"}},"description":"OR within list. Mutually exclusive with other filter types and legacy client. Repeated query keys; duplicate IDs are deduplicated."},{"name":"investor_ids","in":"query","required":false,"style":"form","explode":true,"schema":{"type":"array","minItems":1,"maxItems":100,"items":{"type":"string","pattern":"^inv_[a-f0-9]{32}$"}},"description":"OR within list. Mutually exclusive with other filter types and legacy client. Repeated query keys; duplicate IDs are deduplicated."}],"status":200,"response":{"$ref":"#/components/schemas/PortfoliosList"}},"create_portfolio":{"path":"/v1/accounts/{account}/portfolios","readOnly":false,"method":"POST","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[!-~]{1,255}$"},"description":"Successful responses retained for 24 hours from server recording time; response record and mutation commit atomically. Retries do not extend retention; current authorization always required before replay."}],"request":{"$ref":"#/components/schemas/PortfolioCreate"},"status":201,"response":{"$ref":"#/components/schemas/SnapshotView"}},"retrieve_portfolio":{"path":"/v1/accounts/{account}/portfolios/{portfolio}","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"portfolio","in":"path","required":true,"description":"ID returned by the portfolios list or creation response.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}}],"status":200,"response":{"$ref":"#/components/schemas/Portfolio"}},"update_portfolio":{"path":"/v1/accounts/{account}/portfolios/{portfolio}","readOnly":false,"method":"POST","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"portfolio","in":"path","required":true,"description":"ID returned by the portfolios list or creation response.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[!-~]{1,255}$"},"description":"Successful responses retained for 24 hours from server recording time; response record and mutation commit atomically. Retries do not extend retention; current authorization always required before replay."}],"request":{"$ref":"#/components/schemas/PortfolioUpdate"},"status":200,"response":{"$ref":"#/components/schemas/Portfolio"}},"search_funds":{"path":"/v1/accounts/{account}/mutual_funds","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"query","in":"query","required":true,"description":"2–100 characters. Case-insensitive label and identifier search; percent and underscore are literal.","schema":{"type":"string","minLength":2,"maxLength":100}},{"name":"limit","in":"query","required":false,"description":"1–20; default 10. Search is a bounded result set, not cursor pagination.","schema":{"type":"integer","minimum":1,"maximum":20,"default":10}}],"status":200,"response":{"$ref":"#/components/schemas/FundsList"}},"fund_references":{"path":"/v1/accounts/{account}/mutual_funds/references","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"instruments","in":"query","required":true,"description":"1–100 distinct instrument IDs in one query parameter. Unknown, inactive or unsupported IDs appear in missing.","schema":{"type":"string","minLength":1,"description":"1–100 distinct IDs separated by commas, singleton query parameter."}}],"status":200,"response":{"$ref":"#/components/schemas/FundReferences"}},"current_snapshot":{"path":"/v1/accounts/{account}/portfolios/{portfolio}/current_snapshot","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"portfolio","in":"path","required":true,"description":"Same-account portfolio.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}}],"status":200,"response":{"$ref":"#/components/schemas/SnapshotView"}},"replace_snapshot":{"path":"/v1/accounts/{account}/portfolios/{portfolio}/snapshots","readOnly":false,"method":"POST","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account. me resolves the account bound to the account-owned key or delegated grant, never an arbitrary user account.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"portfolio","in":"path","required":true,"description":"Portfolio being edited.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[!-~]{1,255}$"},"description":"Successful responses retained for 24 hours from server recording time; response record and mutation commit atomically. Retries do not extend retention; current authorization always required before replay."}],"request":{"$ref":"#/components/schemas/SnapshotCreate"},"status":201,"response":{"$ref":"#/components/schemas/SnapshotView"}},"asset_mix":{"path":"/v1/accounts/{account}/portfolios/asset_mix","readOnly":true,"method":"POST","parameters":[{"name":"account","in":"path","required":true,"description":"Account ID or me.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}}],"request":{"$ref":"#/components/schemas/PortfolioMixRequest"},"status":200,"response":{"$ref":"#/components/schemas/AssetMix"}},"sector_mix":{"path":"/v1/accounts/{account}/portfolios/sector_mix","readOnly":true,"method":"POST","parameters":[{"name":"account","in":"path","required":true,"description":"Account ID or me.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}}],"request":{"$ref":"#/components/schemas/PortfolioMixRequest"},"status":200,"response":{"$ref":"#/components/schemas/SectorMix"}},"issuer_mix":{"path":"/v1/accounts/{account}/portfolios/issuer_mix","readOnly":true,"method":"POST","parameters":[{"name":"account","in":"path","required":true,"description":"Account ID or me.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}}],"request":{"$ref":"#/components/schemas/PortfolioMixRequest"},"status":200,"response":{"$ref":"#/components/schemas/IssuerMix"}},"import_history":{"path":"/v1/accounts/{account}/portfolios/{portfolio}/history/imports","readOnly":false,"method":"POST","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account or me.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"portfolio","in":"path","required":true,"description":"Saved portfolio ID.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}},{"name":"Idempotency-Key","in":"header","required":true,"schema":{"type":"string","pattern":"^[!-~]{1,255}$"},"description":"Successful responses retained for 24 hours from server recording time; response record and mutation commit atomically. Retries do not extend retention; current authorization always required before replay."}],"request":{"$ref":"#/components/schemas/HistoryImport"},"status":201,"response":{"$ref":"#/components/schemas/HistoryImportResult"}},"retrieve_history":{"path":"/v1/accounts/{account}/portfolios/{portfolio}/history","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account or me.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"portfolio","in":"path","required":true,"description":"Saved portfolio ID.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}}],"status":200,"response":{"$ref":"#/components/schemas/HistoryView"}},"history_capabilities":{"path":"/v1/accounts/{account}/portfolios/{portfolio}/history/capabilities","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account or me.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"portfolio","in":"path","required":true,"description":"Saved portfolio ID.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}},{"name":"date","in":"query","required":true,"description":"Investor position date; daily close in the investment account timezone.","schema":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."}}],"status":200,"response":{"$ref":"#/components/schemas/HistoryCapability"}},"list_holdings":{"path":"/v1/accounts/{account}/portfolios/{portfolio}/holdings","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account or me.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"portfolio","in":"path","required":true,"description":"Saved portfolio ID.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}},{"name":"date","in":"query","required":false,"description":"Optional historical date; closed holdings remain available.","schema":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."}}],"status":200,"response":{"$ref":"#/components/schemas/HoldingsList"}},"retrieve_holding":{"path":"/v1/accounts/{account}/portfolios/{portfolio}/holdings/{holding}","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account or me.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"portfolio","in":"path","required":true,"description":"Saved portfolio ID.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}},{"name":"holding","in":"path","required":true,"description":"Holding scoped to this portfolio.","schema":{"type":"string","pattern":"^hld_[a-f0-9]{32}$"}}],"status":200,"response":{"$ref":"#/components/schemas/Holding"}},"holding_position":{"path":"/v1/accounts/{account}/portfolios/{portfolio}/holdings/{holding}/position","readOnly":false,"method":"GET","parameters":[{"name":"account","in":"path","required":true,"description":"Authorized account or me.","schema":{"anyOf":[{"const":"me"},{"type":"string","pattern":"^acct_[a-f0-9]{32}$"}]}},{"name":"portfolio","in":"path","required":true,"description":"Saved portfolio ID.","schema":{"type":"string","pattern":"^ptf_[a-f0-9]{32}$"}},{"name":"holding","in":"path","required":true,"description":"Holding scoped to this portfolio.","schema":{"type":"string","pattern":"^hld_[a-f0-9]{32}$"}},{"name":"date","in":"query","required":true,"description":"Investor position date.","schema":{"type":"string","format":"date","pattern":"^\\d{4}-\\d{2}-\\d{2}$","description":"Real calendar date, 1900-01-01 through today Asia/Kolkata; replacement cannot move backwards."}}],"status":200,"response":{"$ref":"#/components/schemas/HoldingPosition"}}}};
package/dist/index.cjs CHANGED
@@ -14,7 +14,7 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.Bharosa = void 0;
17
+ exports.BharosaMarket = exports.Bharosa = void 0;
18
18
  const transport_cjs_1 = require("./transport.cjs");
19
19
  const contract_cjs_1 = require("./contract.cjs");
20
20
  const validate_cjs_1 = require("./validate.cjs");
@@ -172,6 +172,7 @@ class Bharosa {
172
172
  return methods({}, { ...mixMethods(copied), positions: copied.positions });
173
173
  };
174
174
  this.portfolios = Object.freeze({
175
+ update: async (portfolio, b, o) => savedPortfolio(await call("update_portfolio", { portfolio }, b, o)),
175
176
  build,
176
177
  fromPositions: build,
177
178
  list: async (p = {}, o) => {
@@ -352,3 +353,38 @@ class Bharosa {
352
353
  }
353
354
  }
354
355
  exports.Bharosa = Bharosa;
356
+ /** Server-only registered-app monthly market access. No account or user token. */
357
+ class BharosaMarket {
358
+ schemes;
359
+ funds;
360
+ constructor(config) {
361
+ (0, transport_cjs_1.keys)(config, [
362
+ "baseUrl",
363
+ "apiKey",
364
+ "allowLocalhostHttp",
365
+ "maxResponseBytes",
366
+ "fetch",
367
+ ]);
368
+ const { apiKey, ...rest } = config;
369
+ const call = (0, transport_cjs_1.createTransport)({ ...rest, account: "me", auth: { type: "account_key", apiKey } }, true);
370
+ const query = (q, paging = false) => {
371
+ (0, transport_cjs_1.keys)(q, paging ? ["asOf", "limit", "startingAfter"] : ["asOf"]);
372
+ return {
373
+ as_of: q.asOf,
374
+ ...(q.limit === undefined ? {} : { limit: q.limit }),
375
+ ...(q.startingAfter === undefined
376
+ ? {}
377
+ : { starting_after: q.startingAfter }),
378
+ };
379
+ };
380
+ this.schemes = {
381
+ nav: (id, q, o) => call("monthly_nav", { id, ...query(q) }, undefined, o),
382
+ expenseRatio: (id, q, o) => call("monthly_expense", { id, ...query(q) }, undefined, o),
383
+ };
384
+ this.funds = {
385
+ portfolio: (id, q, o) => call("monthly_portfolio", { id, ...query(q) }, undefined, o),
386
+ holdings: (id, q, o) => call("monthly_holdings", { id, ...query(q, true) }, undefined, o),
387
+ };
388
+ }
389
+ }
390
+ exports.BharosaMarket = BharosaMarket;
package/dist/index.d.cts CHANGED
@@ -15,3 +15,16 @@ export declare class Bharosa implements T.ClientSurface {
15
15
  readonly marketData: D.MarketDataClient;
16
16
  constructor(config: T.BharosaConfig);
17
17
  }
18
+ export interface BharosaMarketConfig {
19
+ baseUrl: string;
20
+ apiKey: string;
21
+ allowLocalhostHttp?: boolean;
22
+ maxResponseBytes?: number;
23
+ fetch?: typeof globalThis.fetch;
24
+ }
25
+ /** Server-only registered-app monthly market access. No account or user token. */
26
+ export declare class BharosaMarket {
27
+ readonly schemes: Pick<MonthlyMarketClient["schemes"], "nav" | "expenseRatio">;
28
+ readonly funds: MonthlyMarketClient["funds"];
29
+ constructor(config: BharosaMarketConfig);
30
+ }
package/dist/index.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export { Bharosa, BharosaError, ValidationError, APIError, TransportError, TimeoutError, AbortError, InvalidResponseError, } from "./index.cjs";
1
+ export { Bharosa, BharosaMarket, BharosaError, ValidationError, APIError, TransportError, TimeoutError, AbortError, InvalidResponseError, } from "./index.cjs";
2
2
  export type * from "./index.cjs";
package/dist/index.d.ts CHANGED
@@ -15,3 +15,16 @@ export declare class Bharosa implements T.ClientSurface {
15
15
  readonly marketData: D.MarketDataClient;
16
16
  constructor(config: T.BharosaConfig);
17
17
  }
18
+ export interface BharosaMarketConfig {
19
+ baseUrl: string;
20
+ apiKey: string;
21
+ allowLocalhostHttp?: boolean;
22
+ maxResponseBytes?: number;
23
+ fetch?: typeof globalThis.fetch;
24
+ }
25
+ /** Server-only registered-app monthly market access. No account or user token. */
26
+ export declare class BharosaMarket {
27
+ readonly schemes: Pick<MonthlyMarketClient["schemes"], "nav" | "expenseRatio">;
28
+ readonly funds: MonthlyMarketClient["funds"];
29
+ constructor(config: BharosaMarketConfig);
30
+ }
package/dist/index.mjs CHANGED
@@ -1 +1 @@
1
- export { Bharosa, BharosaError, ValidationError, APIError, TransportError, TimeoutError, AbortError, InvalidResponseError, } from "./index.cjs";
1
+ export { Bharosa, BharosaMarket, BharosaError, ValidationError, APIError, TransportError, TimeoutError, AbortError, InvalidResponseError, } from "./index.cjs";
package/dist/models.d.cts CHANGED
@@ -91,6 +91,10 @@ export type InvestorUpdate = {
91
91
  "name"?: string;
92
92
  "relationship_to_owner"?: "self" | "spouse" | "child" | "parent" | "sibling" | "other";
93
93
  };
94
+ export type PortfolioUpdate = {
95
+ "name": string;
96
+ "expected_name": string;
97
+ };
94
98
  export type PortfolioCreate = {
95
99
  "name": string;
96
100
  "investor": string;
package/dist/models.d.ts CHANGED
@@ -91,6 +91,10 @@ export type InvestorUpdate = {
91
91
  "name"?: string;
92
92
  "relationship_to_owner"?: "self" | "spouse" | "child" | "parent" | "sibling" | "other";
93
93
  };
94
+ export type PortfolioUpdate = {
95
+ "name": string;
96
+ "expected_name": string;
97
+ };
94
98
  export type PortfolioCreate = {
95
99
  "name": string;
96
100
  "investor": string;
@@ -17,6 +17,7 @@ export interface OperationResults {
17
17
  create_investor: M.Investor;
18
18
  update_investor: M.Investor;
19
19
  list_portfolios: M.PortfoliosList;
20
+ update_portfolio: M.Portfolio;
20
21
  retrieve_portfolio: M.Portfolio;
21
22
  create_portfolio: M.SnapshotView;
22
23
  current_snapshot: M.SnapshotView;
@@ -17,6 +17,7 @@ export interface OperationResults {
17
17
  create_investor: M.Investor;
18
18
  update_investor: M.Investor;
19
19
  list_portfolios: M.PortfoliosList;
20
+ update_portfolio: M.Portfolio;
20
21
  retrieve_portfolio: M.Portfolio;
21
22
  create_portfolio: M.SnapshotView;
22
23
  current_snapshot: M.SnapshotView;
@@ -26,6 +26,10 @@ function decimal(v) {
26
26
  function responseMatches(id, op, data, params, body, account) {
27
27
  if (!(0, validate_cjs_1.valid)(op.response, data) || !(0, validate_cjs_1.consistent)(data, account))
28
28
  return false;
29
+ if (id === "update_portfolio" &&
30
+ (field(data, "id") !== params.portfolio ||
31
+ field(data, "name") !== String(field(body, "name")).trim()))
32
+ return false;
29
33
  const d = (...p) => field(data, ...p), b = (...p) => field(body, ...p);
30
34
  if (id.startsWith("current_") &&
31
35
  id.endsWith("_mix") &&
@@ -141,7 +141,7 @@ async function read(response, max, signal) {
141
141
  reader.releaseLock();
142
142
  }
143
143
  }
144
- function createTransport(config) {
144
+ function createTransport(config, marketOnly = false) {
145
145
  const customTransport = config?.transport !== undefined;
146
146
  if (!customTransport)
147
147
  assertServer();
@@ -196,12 +196,21 @@ function createTransport(config) {
196
196
  check(Number.isInteger(max) && max >= 1 && max <= 16777216);
197
197
  const call = async (id, params = {}, body, opts = {}) => {
198
198
  const op = operations[id];
199
+ if (marketOnly)
200
+ check([
201
+ "monthly_nav",
202
+ "monthly_expense",
203
+ "monthly_portfolio",
204
+ "monthly_holdings",
205
+ ].includes(id));
199
206
  let o, serialized, url;
200
207
  try {
201
208
  o = options(opts);
202
209
  const supplied = { account, ...params };
203
210
  const query = new URLSearchParams();
204
- let path = op.path;
211
+ let path = marketOnly
212
+ ? op.path.replace("/v1/accounts/{account}/market-data", "/v1/market-data")
213
+ : op.path;
205
214
  keys(params, op.parameters
206
215
  .filter((p) => p.in === "path" || p.in === "query")
207
216
  .map((p) => p.name)
@@ -2,4 +2,4 @@ import type { OperationResults } from "./operation-types.cjs";
2
2
  import type { BharosaConfig, RequestOptions } from "./client-types.cjs";
3
3
  export declare function check(v: unknown): asserts v;
4
4
  export declare function keys(v: unknown, allowed: readonly string[]): void;
5
- export declare function createTransport(config: BharosaConfig): <K extends keyof OperationResults>(id: K, params?: Record<string, unknown>, body?: unknown, opts?: RequestOptions) => Promise<OperationResults[K]>;
5
+ export declare function createTransport(config: BharosaConfig, marketOnly?: boolean): <K extends keyof OperationResults>(id: K, params?: Record<string, unknown>, body?: unknown, opts?: RequestOptions) => Promise<OperationResults[K]>;
@@ -2,4 +2,4 @@ import type { OperationResults } from "./operation-types.js";
2
2
  import type { BharosaConfig, RequestOptions } from "./client-types.js";
3
3
  export declare function check(v: unknown): asserts v;
4
4
  export declare function keys(v: unknown, allowed: readonly string[]): void;
5
- export declare function createTransport(config: BharosaConfig): <K extends keyof OperationResults>(id: K, params?: Record<string, unknown>, body?: unknown, opts?: RequestOptions) => Promise<OperationResults[K]>;
5
+ export declare function createTransport(config: BharosaConfig, marketOnly?: boolean): <K extends keyof OperationResults>(id: K, params?: Record<string, unknown>, body?: unknown, opts?: RequestOptions) => Promise<OperationResults[K]>;
@@ -1,6 +1,6 @@
1
1
  # Monthly market snapshots
2
2
 
3
- `client.mutualFundSchemes` and `client.mutualFunds.portfolios` provide month-start market history and current NAV valuation. These methods are implemented locally; availability depends on your service deployment and explicit market-data access. API keys alone do not grant this capability. Request access from your service operator. No application is automatically enrolled by installing the SDK.
3
+ `client.mutualFundSchemes` and `client.mutualFunds.portfolios` provide month-start market history and current NAV valuation. Monthly market data requires no separate application approval. Use authenticated credentials with the required account-read scope; installing the SDK does not authenticate you or grant private account access. Availability still depends on the deployed service and source data.
4
4
 
5
5
  Resolve an investible scheme through `client.mutualFunds.search()` and its returned `scheme_id`. Fund-owner IDs and scheme IDs are distinct: NAV and expense ratios belong to schemes; portfolio snapshots and holdings belong to fund owners. Do not use an AMC ID as a fund-owner ID.
6
6
 
@@ -88,3 +88,19 @@ The earlier singular `client` option remains supported, but cannot be combined w
88
88
  `await client.accounts.retrieve()` uses the account configured on the SDK; no repeated account ID is needed. Its nullable `personal_client_id` identifies the authenticated human's linked household, not a new family resource or an access grant. Machine account keys receive null because they do not identify a signed-in person. A null link must not be replaced by guessing from a client name or account owner. The prelaunch public account response no longer exposes the internal `owner` user ID; ownership remains enforced on the server.
89
89
 
90
90
  Units-first portfolio creation (local, unreleased): `portfolios.create` accepts an initial position with either `current_value` or positive `quantity`, never both, using the supplied `as_of` date. Existing amount requests and amount-only responses remain unchanged. Supplied units are stored atomically without requiring a NAV. Snapshot `quantity` can now be a decimal string and `valuation` can be null; `total_current_value` is null when any snapshot position lacks a reported amount, and `valuation_basis` is `supplied_quantity`. Consumers of general snapshot reads must handle these new nullable values; this is an intentional prelaunch type widening. Older SDKs cannot read units-only snapshots. Snapshot replacement and in-memory analytics remain amount-only. No public package release or availability change is implied.
91
+
92
+ ## Empty creation and name updates (SDK 0.2.0)
93
+
94
+ The companion API accepts `positions: []` in `portfolios.create`. It persists a portfolio, investment account and zero-position snapshot immediately. Add the first holding afterward through the returned portfolio's `holdings.setCurrent` method. Cancellation before creation sends no request.
95
+
96
+ ```ts
97
+ const renamed = await bharosa.portfolios.update(
98
+ portfolio.id,
99
+ { name: 'Family goals', expected_name: portfolio.name },
100
+ { idempotencyKey: renameAttemptKey },
101
+ );
102
+ ```
103
+
104
+ Use a fresh key for a new operation and the same key for an unchanged retry. Names must contain non-whitespace text and be at most 200 characters; the API trims the new name. `expected_name` must equal the stored name exactly. A concurrent rename returns `portfolio_name_conflict`; reload before deliberately retrying with the latest name. This compares names, not a general resource revision. Replaying a completed key returns its original receipt even if a later rename occurred. The operation returns a Portfolio and changes no holdings or snapshots. Existing account authorization and write-scope restrictions still apply; caller-owned transport does not grant access. These methods require an API deployment with portfolio lifecycle support.
105
+
106
+ An empty saved portfolio is valid. Mix calculations return HTTP 422 `portfolio_empty` until the selected snapshot/current view contains holdings. Treat this as an unavailable analysis state: “Your portfolio is saved. Add a holding to see its analysis.” Do not retry creation. An empty in-memory calculation remains invalid input. Current holdings added later do not rewrite the original empty snapshot; use the supported current view or save a nonempty snapshot for snapshot-based analysis.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "bharosa",
3
- "version": "0.1.0",
3
+ "version": "0.3.0",
4
4
  "private": false,
5
5
  "description": "Typed Bharosa resource SDK with server credentials or caller-owned transport.",
6
6
  "license": "MIT",