financial-graph-shared 1.0.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.
Files changed (43) hide show
  1. package/README.md +75 -0
  2. package/dist/db/index.d.ts +11 -0
  3. package/dist/db/index.d.ts.map +1 -0
  4. package/dist/db/index.js +11 -0
  5. package/dist/db/queries/cik-lookup.d.ts +49 -0
  6. package/dist/db/queries/cik-lookup.d.ts.map +1 -0
  7. package/dist/db/queries/cik-lookup.js +78 -0
  8. package/dist/db/queries/company-lookup.d.ts +43 -0
  9. package/dist/db/queries/company-lookup.d.ts.map +1 -0
  10. package/dist/db/queries/company-lookup.js +65 -0
  11. package/dist/db/queries/index.d.ts +8 -0
  12. package/dist/db/queries/index.d.ts.map +1 -0
  13. package/dist/db/queries/index.js +7 -0
  14. package/dist/index.d.ts +14 -0
  15. package/dist/index.d.ts.map +1 -0
  16. package/dist/index.js +18 -0
  17. package/dist/instant.schema.d.ts +170 -0
  18. package/dist/instant.schema.d.ts.map +1 -0
  19. package/dist/instant.schema.js +222 -0
  20. package/dist/types/ids.d.ts +135 -0
  21. package/dist/types/ids.d.ts.map +1 -0
  22. package/dist/types/ids.js +188 -0
  23. package/dist/types/instant.schema.future.d.ts +39 -0
  24. package/dist/types/instant.schema.future.d.ts.map +1 -0
  25. package/dist/types/instant.schema.future.js +52 -0
  26. package/dist/types/types.d.ts +321 -0
  27. package/dist/types/types.d.ts.map +1 -0
  28. package/dist/types/types.js +180 -0
  29. package/dist/types/validation.d.ts +7 -0
  30. package/dist/types/validation.d.ts.map +1 -0
  31. package/dist/types/validation.js +14 -0
  32. package/dist/utils/index.d.ts +5 -0
  33. package/dist/utils/index.d.ts.map +1 -0
  34. package/dist/utils/index.js +4 -0
  35. package/dist/utils/logger-interface.d.ts +57 -0
  36. package/dist/utils/logger-interface.d.ts.map +1 -0
  37. package/dist/utils/logger-interface.js +38 -0
  38. package/package.json +54 -0
  39. package/types/ids.ts +249 -0
  40. package/types/instant.schema.future.js +55 -0
  41. package/types/instant.schema.future.ts +59 -0
  42. package/types/types.ts +292 -0
  43. package/types/validation.ts +32 -0
package/README.md ADDED
@@ -0,0 +1,75 @@
1
+ # @financial-graph/shared
2
+
3
+ Shared types, schema, and utilities for financial-graph backend and frontend.
4
+
5
+ ## What's Included
6
+
7
+ - **Schema**: InstantDB schema definition
8
+ - **Types**: Schema-derived TypeScript types
9
+ - **Enums**: CompanyType, ParentOfSource, etc.
10
+ - **Type Guards**: isPublicCompany, isPrivateCompany, etc.
11
+ - **Validation**: assertDefined, assertNonEmpty, etc.
12
+ - **Composite Keys**: Key generation and parsing
13
+
14
+ ## Installation
15
+
16
+ ### Local Development (Workspace)
17
+
18
+ ```json
19
+ {
20
+ "dependencies": {
21
+ "@financial-graph/shared": "workspace:*"
22
+ }
23
+ }
24
+ ```
25
+
26
+ ### Production (Published Package)
27
+
28
+ ```bash
29
+ bun add @financial-graph/shared@latest
30
+ ```
31
+
32
+ ## Usage
33
+
34
+ ```typescript
35
+ import { Company, CompanyType, isPublicCompany } from "@financial-graph/shared";
36
+ import { assertDefined } from "@financial-graph/shared";
37
+ import { generateCompanyCompositeKey } from "@financial-graph/shared";
38
+ ```
39
+
40
+ ## Testing
41
+
42
+ ```bash
43
+ bun test # Run tests once
44
+ bun test --watch # Watch mode
45
+ ```
46
+
47
+ ## Building
48
+
49
+ ```bash
50
+ bun install
51
+ bun run build # Compile TypeScript to dist/
52
+ bun run watch # Watch mode for development
53
+ bun run clean # Clean dist/
54
+ ```
55
+
56
+ ## Publishing
57
+
58
+ For separate deployments:
59
+
60
+ ```bash
61
+ cd shared
62
+ npm version patch
63
+ npm publish
64
+ ```
65
+
66
+ Then update backend/frontend:
67
+
68
+ ```bash
69
+ cd backend && bun add @financial-graph/shared@latest
70
+ cd frontend && bun add @financial-graph/shared@latest
71
+ ```
72
+
73
+ ## Examples
74
+
75
+ See `types/composite-keys.test.ts` for comprehensive examples of all functionality.
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Shared Database Module
3
+ *
4
+ * Exports query definitions and helper functions that work with both:
5
+ * - Frontend: db.query() from @instantdb/core
6
+ * - Backend: db.queryOnce() from @instantdb/admin
7
+ *
8
+ * This module does NOT export a db client - each environment provides its own.
9
+ */
10
+ export * from "./queries";
11
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../db/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAGH,cAAc,WAAW,CAAC"}
@@ -0,0 +1,11 @@
1
+ /**
2
+ * Shared Database Module
3
+ *
4
+ * Exports query definitions and helper functions that work with both:
5
+ * - Frontend: db.query() from @instantdb/core
6
+ * - Backend: db.queryOnce() from @instantdb/admin
7
+ *
8
+ * This module does NOT export a db client - each environment provides its own.
9
+ */
10
+ // Query definitions and helpers
11
+ export * from "./queries";
@@ -0,0 +1,49 @@
1
+ /**
2
+ * CIK Lookup Query Definitions
3
+ *
4
+ * In-memory cache of CIK -> Company ID mappings for fast lookups.
5
+ * Shared between frontend and backend.
6
+ */
7
+ /**
8
+ * Query definition: Get public companies with identity for CIK lookup
9
+ */
10
+ export declare const cikLookupQuery: {
11
+ company: {
12
+ $: {
13
+ where: {
14
+ type: 1;
15
+ };
16
+ fields: ("identity" | "id")[];
17
+ };
18
+ };
19
+ };
20
+ /**
21
+ * Helper: Build CIK lookup cache from query result
22
+ */
23
+ export declare function buildCikCacheFromResult(result: any): Map<string, string>;
24
+ /**
25
+ * Set the global CIK lookup cache
26
+ */
27
+ export declare function setCikLookupCache(cache: Map<string, string>): void;
28
+ /**
29
+ * Get the CIK lookup cache (returns null if not initialized)
30
+ */
31
+ export declare function getCikLookupCache(): Map<string, string> | null;
32
+ /**
33
+ * Lookup company ID by CIK from cache
34
+ * Returns null if CIK not found or cache not initialized
35
+ */
36
+ export declare function lookupCompanyIdByCik(cik: string): string | null;
37
+ /**
38
+ * Check if cache is initialized
39
+ */
40
+ export declare function isCikLookupCacheInitialized(): boolean;
41
+ /**
42
+ * Get cache size
43
+ */
44
+ export declare function getCikLookupCacheSize(): number;
45
+ /**
46
+ * Clear the cache (useful for testing)
47
+ */
48
+ export declare function clearCikLookupCache(): void;
49
+ //# sourceMappingURL=cik-lookup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cik-lookup.d.ts","sourceRoot":"","sources":["../../../db/queries/cik-lookup.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AASH;;GAEG;AACH,eAAO,MAAM,cAAc;;;;;;;;;CAOS,CAAC;AAErC;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,EAAE,GAAG,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAexE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAElE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,IAAI,CAE9D;AAED;;;GAGG;AACH,wBAAgB,oBAAoB,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,GAAG,IAAI,CAQ/D;AAED;;GAEG;AACH,wBAAgB,2BAA2B,IAAI,OAAO,CAErD;AAED;;GAEG;AACH,wBAAgB,qBAAqB,IAAI,MAAM,CAE9C;AAED;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAE1C"}
@@ -0,0 +1,78 @@
1
+ /**
2
+ * CIK Lookup Query Definitions
3
+ *
4
+ * In-memory cache of CIK -> Company ID mappings for fast lookups.
5
+ * Shared between frontend and backend.
6
+ */
7
+ import { CompanyType } from "../../types/types";
8
+ // In-memory cache: CIK -> Company ID
9
+ let cikToCompanyIdCache = null;
10
+ /**
11
+ * Query definition: Get public companies with identity for CIK lookup
12
+ */
13
+ export const cikLookupQuery = {
14
+ company: {
15
+ $: {
16
+ where: { type: CompanyType.PUBLIC },
17
+ fields: ["id", "identity"],
18
+ },
19
+ },
20
+ };
21
+ /**
22
+ * Helper: Build CIK lookup cache from query result
23
+ */
24
+ export function buildCikCacheFromResult(result) {
25
+ const cache = new Map();
26
+ const companies = (result.company || []);
27
+ for (const comp of companies) {
28
+ if (comp.identity) {
29
+ const identity = comp.identity;
30
+ if (identity.primaryCIK) {
31
+ cache.set(identity.primaryCIK, comp.id);
32
+ }
33
+ }
34
+ }
35
+ return cache;
36
+ }
37
+ /**
38
+ * Set the global CIK lookup cache
39
+ */
40
+ export function setCikLookupCache(cache) {
41
+ cikToCompanyIdCache = cache;
42
+ }
43
+ /**
44
+ * Get the CIK lookup cache (returns null if not initialized)
45
+ */
46
+ export function getCikLookupCache() {
47
+ return cikToCompanyIdCache;
48
+ }
49
+ /**
50
+ * Lookup company ID by CIK from cache
51
+ * Returns null if CIK not found or cache not initialized
52
+ */
53
+ export function lookupCompanyIdByCik(cik) {
54
+ if (!cikToCompanyIdCache) {
55
+ return null;
56
+ }
57
+ // Normalize CIK to 10 digits
58
+ const normalizedCik = cik.padStart(10, "0");
59
+ return cikToCompanyIdCache.get(normalizedCik) || null;
60
+ }
61
+ /**
62
+ * Check if cache is initialized
63
+ */
64
+ export function isCikLookupCacheInitialized() {
65
+ return cikToCompanyIdCache !== null;
66
+ }
67
+ /**
68
+ * Get cache size
69
+ */
70
+ export function getCikLookupCacheSize() {
71
+ return cikToCompanyIdCache?.size || 0;
72
+ }
73
+ /**
74
+ * Clear the cache (useful for testing)
75
+ */
76
+ export function clearCikLookupCache() {
77
+ cikToCompanyIdCache = null;
78
+ }
@@ -0,0 +1,43 @@
1
+ /**
2
+ * Company Lookup Query Definitions
3
+ *
4
+ * Reusable query definitions for company lookups.
5
+ * Can be used with db.query() (frontend) or db.queryOnce() (backend).
6
+ */
7
+ export interface CompanyLookupResult {
8
+ id: string;
9
+ name: string;
10
+ cik: string;
11
+ sp500?: boolean;
12
+ }
13
+ export interface CompanyLookupOptions {
14
+ sp500Only?: boolean;
15
+ }
16
+ /**
17
+ * Query definition: Get all public companies
18
+ */
19
+ export declare const publicCompaniesQuery: {
20
+ readonly company: {
21
+ readonly $: {
22
+ readonly where: {
23
+ readonly type: 1;
24
+ };
25
+ };
26
+ };
27
+ };
28
+ /**
29
+ * Helper: Extract CIK -> Company lookup from query result
30
+ */
31
+ export declare function extractPublicCompaniesLookup(result: any, options?: CompanyLookupOptions): Map<string, {
32
+ id: string;
33
+ name: string;
34
+ }>;
35
+ /**
36
+ * Helper: Extract CIK -> Company ID lookup from query result
37
+ */
38
+ export declare function extractCikToCompanyIdLookup(result: any, options?: CompanyLookupOptions): Map<string, string>;
39
+ /**
40
+ * Helper: Find company by CIK from query result
41
+ */
42
+ export declare function findCompanyByCik(result: any, cik: string): CompanyLookupResult | null;
43
+ //# sourceMappingURL=company-lookup.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"company-lookup.d.ts","sourceRoot":"","sources":["../../../db/queries/company-lookup.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAIH,MAAM,WAAW,mBAAmB;IAClC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,GAAG,EAAE,MAAM,CAAC;IACZ,KAAK,CAAC,EAAE,OAAO,CAAC;CACjB;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,CAAC,EAAE,OAAO,CAAC;CACrB;AAED;;GAEG;AACH,eAAO,MAAM,oBAAoB;;;;;;;;CAMvB,CAAC;AAEX;;GAEG;AACH,wBAAgB,4BAA4B,CAC1C,MAAM,EAAE,GAAG,EACX,OAAO,GAAE,oBAA2C,GACnD,GAAG,CAAC,MAAM,EAAE;IAAE,EAAE,EAAE,MAAM,CAAC;IAAC,IAAI,EAAE,MAAM,CAAA;CAAE,CAAC,CAqB3C;AAED;;GAEG;AACH,wBAAgB,2BAA2B,CACzC,MAAM,EAAE,GAAG,EACX,OAAO,GAAE,oBAA2C,GACnD,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CASrB;AAED;;GAEG;AACH,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,GAAG,EACX,GAAG,EAAE,MAAM,GACV,mBAAmB,GAAG,IAAI,CAgB5B"}
@@ -0,0 +1,65 @@
1
+ /**
2
+ * Company Lookup Query Definitions
3
+ *
4
+ * Reusable query definitions for company lookups.
5
+ * Can be used with db.query() (frontend) or db.queryOnce() (backend).
6
+ */
7
+ import { CompanyType } from "../../types/types";
8
+ /**
9
+ * Query definition: Get all public companies
10
+ */
11
+ export const publicCompaniesQuery = {
12
+ company: {
13
+ $: {
14
+ where: { type: CompanyType.PUBLIC },
15
+ },
16
+ },
17
+ };
18
+ /**
19
+ * Helper: Extract CIK -> Company lookup from query result
20
+ */
21
+ export function extractPublicCompaniesLookup(result, options = { sp500Only: false }) {
22
+ const { sp500Only = false } = options;
23
+ const companies = (result.company || []);
24
+ const lookup = new Map();
25
+ for (const company of companies) {
26
+ const cik = company.identity?.primaryCIK;
27
+ if (!cik)
28
+ continue;
29
+ if (sp500Only && company.identity?.sp500 !== true) {
30
+ continue;
31
+ }
32
+ lookup.set(cik, {
33
+ id: company.id,
34
+ name: company.name,
35
+ });
36
+ }
37
+ return lookup;
38
+ }
39
+ /**
40
+ * Helper: Extract CIK -> Company ID lookup from query result
41
+ */
42
+ export function extractCikToCompanyIdLookup(result, options = { sp500Only: false }) {
43
+ const lookup = extractPublicCompaniesLookup(result, options);
44
+ const cikLookup = new Map();
45
+ for (const [cik, company] of lookup) {
46
+ cikLookup.set(cik, company.id);
47
+ }
48
+ return cikLookup;
49
+ }
50
+ /**
51
+ * Helper: Find company by CIK from query result
52
+ */
53
+ export function findCompanyByCik(result, cik) {
54
+ const normalizedCik = cik.padStart(10, "0");
55
+ const companies = (result.company || []);
56
+ const company = companies.find((c) => c.identity?.primaryCIK === normalizedCik);
57
+ if (!company)
58
+ return null;
59
+ return {
60
+ id: company.id,
61
+ name: company.name,
62
+ cik: normalizedCik,
63
+ sp500: company.identity?.sp500,
64
+ };
65
+ }
@@ -0,0 +1,8 @@
1
+ /**
2
+ * Shared Query Functions
3
+ *
4
+ * Read-only database queries that can be used by both frontend and backend.
5
+ */
6
+ export * from "./cik-lookup";
7
+ export * from "./company-lookup";
8
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../db/queries/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,cAAc,cAAc,CAAC;AAC7B,cAAc,kBAAkB,CAAC"}
@@ -0,0 +1,7 @@
1
+ /**
2
+ * Shared Query Functions
3
+ *
4
+ * Read-only database queries that can be used by both frontend and backend.
5
+ */
6
+ export * from "./cik-lookup";
7
+ export * from "./company-lookup";
@@ -0,0 +1,14 @@
1
+ /**
2
+ * @financial-graph/shared
3
+ *
4
+ * Shared types, schema, and utilities for financial-graph
5
+ * Used by both backend and frontend for type safety
6
+ */
7
+ export { default as schema } from "./instant.schema";
8
+ export type { AppSchema } from "./instant.schema";
9
+ export * from "./types/types";
10
+ export * from "./types/validation";
11
+ export * from "./types/ids";
12
+ export * from "./utils";
13
+ export * from "./db";
14
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../index.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,OAAO,IAAI,MAAM,EAAE,MAAM,kBAAkB,CAAC;AACrD,YAAY,EAAE,SAAS,EAAE,MAAM,kBAAkB,CAAC;AAGlD,cAAc,eAAe,CAAC;AAG9B,cAAc,oBAAoB,CAAC;AAGnC,cAAc,aAAa,CAAC;AAG5B,cAAc,SAAS,CAAC;AAGxB,cAAc,MAAM,CAAC"}
package/dist/index.js ADDED
@@ -0,0 +1,18 @@
1
+ /**
2
+ * @financial-graph/shared
3
+ *
4
+ * Shared types, schema, and utilities for financial-graph
5
+ * Used by both backend and frontend for type safety
6
+ */
7
+ // Export schema
8
+ export { default as schema } from "./instant.schema";
9
+ // Export all types
10
+ export * from "./types/types";
11
+ // Export validation utilities
12
+ export * from "./types/validation";
13
+ // Export ID generation utilities (namespaces)
14
+ export * from "./types/ids";
15
+ // Export shared utilities
16
+ export * from "./utils";
17
+ // Export database client and queries
18
+ export * from "./db";
@@ -0,0 +1,170 @@
1
+ declare const _schema: import("@instantdb/core").InstantSchemaDef<import("@instantdb/core").EntitiesWithLinks<{
2
+ $files: import("@instantdb/core").EntityDef<{
3
+ path: import("@instantdb/core").DataAttrDef<string, true, true>;
4
+ url: import("@instantdb/core").DataAttrDef<string, true, false>;
5
+ }, {}, void>;
6
+ $users: import("@instantdb/core").EntityDef<{
7
+ email: import("@instantdb/core").DataAttrDef<string, false, true>;
8
+ imageURL: import("@instantdb/core").DataAttrDef<string, false, false>;
9
+ type: import("@instantdb/core").DataAttrDef<string, false, false>;
10
+ }, {}, void>;
11
+ company: import("@instantdb/core").EntityDef<{
12
+ name: import("@instantdb/core").DataAttrDef<string, true, true>;
13
+ type: import("@instantdb/core").DataAttrDef<number, true, true>;
14
+ jurisdiction_raw: import("@instantdb/core").DataAttrDef<string, false, false>;
15
+ jurisdiction_iso: import("@instantdb/core").DataAttrDef<string, false, false>;
16
+ aliases: import("@instantdb/core").DataAttrDef<any, false, false>;
17
+ identity: import("@instantdb/core").DataAttrDef<any, false, false>;
18
+ updated_at: import("@instantdb/core").DataAttrDef<string, true, false>;
19
+ }, {}, void>;
20
+ filing: import("@instantdb/core").EntityDef<{
21
+ accession_number: import("@instantdb/core").DataAttrDef<string, true, false>;
22
+ accession_number_nodashes: import("@instantdb/core").DataAttrDef<string, true, true>;
23
+ file_url: import("@instantdb/core").DataAttrDef<string, true, false>;
24
+ form_type: import("@instantdb/core").DataAttrDef<string, true, true>;
25
+ source_quarter: import("@instantdb/core").DataAttrDef<number, true, true>;
26
+ source_year: import("@instantdb/core").DataAttrDef<number, true, true>;
27
+ filing_date: import("@instantdb/core").DataAttrDef<string, true, true>;
28
+ period_of_report: import("@instantdb/core").DataAttrDef<string, false, false>;
29
+ attachments: import("@instantdb/core").DataAttrDef<any, false, false>;
30
+ file_name: import("@instantdb/core").DataAttrDef<string, false, false>;
31
+ updated_at: import("@instantdb/core").DataAttrDef<string, true, false>;
32
+ }, {}, void>;
33
+ parent_of: import("@instantdb/core").EntityDef<{
34
+ source: import("@instantdb/core").DataAttrDef<number, true, true>;
35
+ ownership_percent: import("@instantdb/core").DataAttrDef<number, false, false>;
36
+ established_date: import("@instantdb/core").DataAttrDef<string, false, false>;
37
+ ended_date: import("@instantdb/core").DataAttrDef<string, false, false>;
38
+ updated_at: import("@instantdb/core").DataAttrDef<string, true, false>;
39
+ }, {}, void>;
40
+ subsidiary_enrichment: import("@instantdb/core").EntityDef<{
41
+ footnoteRefs: import("@instantdb/core").DataAttrDef<any, true, false>;
42
+ footnotesHtml: import("@instantdb/core").DataAttrDef<string, false, false>;
43
+ llmEnriched: import("@instantdb/core").DataAttrDef<boolean, true, true>;
44
+ llmEnrichedAt: import("@instantdb/core").DataAttrDef<string, false, false>;
45
+ updated_at: import("@instantdb/core").DataAttrDef<string, true, false>;
46
+ }, {}, void>;
47
+ company_info: import("@instantdb/core").EntityDef<{
48
+ fiscal_year_end: import("@instantdb/core").DataAttrDef<string, false, false>;
49
+ addresses: import("@instantdb/core").DataAttrDef<any, false, false>;
50
+ phone: import("@instantdb/core").DataAttrDef<string, false, false>;
51
+ former_names: import("@instantdb/core").DataAttrDef<any, false, false>;
52
+ updated_at: import("@instantdb/core").DataAttrDef<string, true, false>;
53
+ }, {}, void>;
54
+ brand: import("@instantdb/core").EntityDef<{
55
+ category: import("@instantdb/core").DataAttrDef<string, false, true>;
56
+ created_at: import("@instantdb/core").DataAttrDef<string, true, false>;
57
+ launch_date: import("@instantdb/core").DataAttrDef<string, false, false>;
58
+ name: import("@instantdb/core").DataAttrDef<string, true, true>;
59
+ status: import("@instantdb/core").DataAttrDef<string, true, true>;
60
+ updated_at: import("@instantdb/core").DataAttrDef<string, true, false>;
61
+ }, {}, void>;
62
+ owns: import("@instantdb/core").EntityDef<{
63
+ acquired_date: import("@instantdb/core").DataAttrDef<string, false, false>;
64
+ created_at: import("@instantdb/core").DataAttrDef<string, true, false>;
65
+ divested_date: import("@instantdb/core").DataAttrDef<string, false, true>;
66
+ updated_at: import("@instantdb/core").DataAttrDef<string, true, false>;
67
+ }, {}, void>;
68
+ audit: import("@instantdb/core").EntityDef<{
69
+ changed_at: import("@instantdb/core").DataAttrDef<string, true, true>;
70
+ changed_by: import("@instantdb/core").DataAttrDef<string, true, true>;
71
+ entity_id: import("@instantdb/core").DataAttrDef<string, true, true>;
72
+ entity_type: import("@instantdb/core").DataAttrDef<string, true, true>;
73
+ expires_at: import("@instantdb/core").DataAttrDef<string, true, true>;
74
+ fields_changed: import("@instantdb/core").DataAttrDef<any, true, false>;
75
+ operation: import("@instantdb/core").DataAttrDef<string, true, true>;
76
+ source_id: import("@instantdb/core").DataAttrDef<string, false, true>;
77
+ }, {}, void>;
78
+ }, {
79
+ readonly filing: {
80
+ readonly forward: {
81
+ readonly on: "company";
82
+ readonly has: "many";
83
+ readonly label: "filings";
84
+ };
85
+ readonly reverse: {
86
+ readonly on: "filing";
87
+ readonly has: "many";
88
+ readonly label: "companies";
89
+ };
90
+ };
91
+ readonly parentCompany: {
92
+ readonly forward: {
93
+ readonly on: "parent_of";
94
+ readonly has: "one";
95
+ readonly label: "parentCompany";
96
+ };
97
+ readonly reverse: {
98
+ readonly on: "company";
99
+ readonly has: "many";
100
+ readonly label: "subsidiaries";
101
+ };
102
+ };
103
+ readonly subsidiaryCompany: {
104
+ readonly forward: {
105
+ readonly on: "parent_of";
106
+ readonly has: "one";
107
+ readonly label: "subsidiaryCompany";
108
+ };
109
+ readonly reverse: {
110
+ readonly on: "company";
111
+ readonly has: "many";
112
+ readonly label: "parents";
113
+ };
114
+ };
115
+ readonly sourceFiling: {
116
+ readonly forward: {
117
+ readonly on: "parent_of";
118
+ readonly has: "one";
119
+ readonly label: "sourceFiling";
120
+ };
121
+ readonly reverse: {
122
+ readonly on: "filing";
123
+ readonly has: "many";
124
+ readonly label: "parentOfEdges";
125
+ };
126
+ };
127
+ readonly subsidiaryEnrichment: {
128
+ readonly forward: {
129
+ readonly on: "company";
130
+ readonly has: "many";
131
+ readonly label: "subsidiaryEnrichments";
132
+ };
133
+ readonly reverse: {
134
+ readonly on: "subsidiary_enrichment";
135
+ readonly has: "one";
136
+ readonly label: "company";
137
+ };
138
+ };
139
+ readonly filingEnrichment: {
140
+ readonly forward: {
141
+ readonly on: "filing";
142
+ readonly has: "many";
143
+ readonly label: "subsidiaryEnrichments";
144
+ };
145
+ readonly reverse: {
146
+ readonly on: "subsidiary_enrichment";
147
+ readonly has: "one";
148
+ readonly label: "filing";
149
+ };
150
+ };
151
+ readonly companyInfo: {
152
+ readonly forward: {
153
+ readonly on: "company";
154
+ readonly has: "one";
155
+ readonly label: "companyInfo";
156
+ };
157
+ readonly reverse: {
158
+ readonly on: "company_info";
159
+ readonly has: "one";
160
+ readonly label: "company";
161
+ };
162
+ };
163
+ }>, import("@instantdb/core").LinksDef<any>, {}>;
164
+ type _AppSchema = typeof _schema;
165
+ interface AppSchema extends _AppSchema {
166
+ }
167
+ declare const schema: AppSchema;
168
+ export type { AppSchema };
169
+ export default schema;
170
+ //# sourceMappingURL=instant.schema.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"instant.schema.d.ts","sourceRoot":"","sources":["../instant.schema.ts"],"names":[],"mappings":"AAMA,QAAA,MAAM,OAAO;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gDAyNX,CAAC;AAGH,KAAK,UAAU,GAAG,OAAO,OAAO,CAAC;AACjC,UAAU,SAAU,SAAQ,UAAU;CAAG;AACzC,QAAA,MAAM,MAAM,EAAE,SAAmB,CAAC;AAElC,YAAY,EAAE,SAAS,EAAE,CAAC;AAC1B,eAAe,MAAM,CAAC"}