export type GetApiFinancialDatasetsBeneficialOwnershipArgs = {ticker?: string | undefined, filer_cik?: string | undefined, type?: string | undefined, history?: boolean | undefined, filing_date?: string | undefined, filing_date_gte?: string | undefined, filing_date_lte?: string | undefined, filing_date_gt?: string | undefined, filing_date_lt?: string | undefined, limit?: number | undefined, cursor?: string | undefined}; export type GetApiFinancialDatasetsBeneficialOwnershipOptions = {baseUrl?: string | undefined, fetch?: typeof fetch | undefined}; /** * Get beneficial-ownership stakes (SEC Schedules 13D and 13G: holders of more than 5% of a class of shares), one row per reporting person. Query by ticker (who owns this company) or by filer_cik (what stakes does this filer hold); provide exactly one of the two. By default each stake's current state is returned; set history=true for the full amendment chain. Use type=activist for 13D stakes (intent to influence control) or type=passive for 13G stakes. * * GET /financial-datasets/beneficial-ownership */ export const getApiFinancialDatasetsBeneficialOwnership = async (args: GetApiFinancialDatasetsBeneficialOwnershipArgs, options?: GetApiFinancialDatasetsBeneficialOwnershipOptions) => { const {baseUrl = "https://api.orthogonal.com/mpp", fetch: fetchFn = fetch} = options ?? {} const query = new URLSearchParams() const headers = new Headers() if (args.ticker != null) query.append("ticker", String(args.ticker)) if (args.filer_cik != null) query.append("filer_cik", String(args.filer_cik)) if (args.type != null) query.append("type", String(args.type)) if (args.history != null) query.append("history", String(args.history)) if (args.filing_date != null) query.append("filing_date", String(args.filing_date)) if (args.filing_date_gte != null) query.append("filing_date_gte", String(args.filing_date_gte)) if (args.filing_date_lte != null) query.append("filing_date_lte", String(args.filing_date_lte)) if (args.filing_date_gt != null) query.append("filing_date_gt", String(args.filing_date_gt)) if (args.filing_date_lt != null) query.append("filing_date_lt", String(args.filing_date_lt)) if (args.limit != null) query.append("limit", String(args.limit)) if (args.cursor != null) query.append("cursor", String(args.cursor)) const url = `${baseUrl.replace(/\/+$/, '')}/financial-datasets/beneficial-ownership${query.size > 0 ? `?${query}` : ''}` const res = await fetchFn(url, {method: "GET", headers}) if (!res.ok) throw new Error(`Request failed with status ${res.status}`, {cause: {status: res.status, body: await res.text()}}) return undefined };