@nominalso/vibe-bridge 0.7.0 → 0.8.1
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/dist/{chunk-QAMP6I2C.js → chunk-7ET6VUWW.js} +18 -2
- package/dist/chunk-7ET6VUWW.js.map +1 -0
- package/dist/index.browser.cjs +17 -1
- package/dist/index.browser.cjs.map +1 -1
- package/dist/index.browser.js +17 -1
- package/dist/index.browser.js.map +1 -1
- package/dist/index.cjs +17 -1
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +2 -2
- package/dist/index.d.ts +2 -2
- package/dist/index.js +1 -1
- package/dist/index.server.cjs +17 -1
- package/dist/index.server.cjs.map +1 -1
- package/dist/index.server.d.cts +2 -2
- package/dist/index.server.d.ts +2 -2
- package/dist/index.server.js +1 -1
- package/dist/{version-Cufn3-b0.d.cts → version-08MdcXcY.d.cts} +190 -6
- package/dist/{version-Cufn3-b0.d.ts → version-08MdcXcY.d.ts} +190 -6
- package/package.json +1 -1
- package/dist/chunk-QAMP6I2C.js.map +0 -1
|
@@ -9,7 +9,15 @@ type AccountingAccountType = 'Bank' | 'Current Asset' | 'Non-current Asset' | 'F
|
|
|
9
9
|
type AccountingAccountingClass = 'Asset' | 'Equity' | 'Liability' | 'Revenue' | 'Expense' | 'Statistical';
|
|
10
10
|
type AccountingBalanceOutput = {
|
|
11
11
|
balance?: number;
|
|
12
|
-
currency?:
|
|
12
|
+
currency?: string | null;
|
|
13
|
+
};
|
|
14
|
+
type AccountingBulkSetLineDimensionValueRequest = {
|
|
15
|
+
dimension_id: string;
|
|
16
|
+
dimension_value_id: string;
|
|
17
|
+
line_ids: Array<string>;
|
|
18
|
+
};
|
|
19
|
+
type AccountingBulkSetLineDimensionValueResponse = {
|
|
20
|
+
updated_count: number;
|
|
13
21
|
};
|
|
14
22
|
type AccountingCerPaginationOutput = {
|
|
15
23
|
results?: Array<AccountingConsolidationExchangeRate>;
|
|
@@ -79,6 +87,36 @@ type AccountingDimensionValue = {
|
|
|
79
87
|
effective_rule_id?: number | null;
|
|
80
88
|
has_children?: boolean;
|
|
81
89
|
};
|
|
90
|
+
/**
|
|
91
|
+
* SDK-facing shape of a single account + dimension value's movement balance over the requested window.
|
|
92
|
+
*
|
|
93
|
+
* Mirrors the internal DimensionAccountBalance — primary/secondary currency amounts, their credit/debit
|
|
94
|
+
* splits, and CTA — so the Rollforward has the full breakdown, but as a stable Response type
|
|
95
|
+
* decoupled from the aggregation model. Field names match the source so it maps via
|
|
96
|
+
* model_validate(from_attributes).
|
|
97
|
+
*/
|
|
98
|
+
type AccountingDimensionValueBalanceResponse = {
|
|
99
|
+
account_id: string;
|
|
100
|
+
dimension_id: string;
|
|
101
|
+
dimension_value_id?: string | null;
|
|
102
|
+
subsidiary_id: number;
|
|
103
|
+
primary_currency_amount?: number | null;
|
|
104
|
+
credit_primary_currency_amount?: number | null;
|
|
105
|
+
debit_primary_currency_amount?: number | null;
|
|
106
|
+
secondary_currency_amount?: number | null;
|
|
107
|
+
credit_secondary_currency_amount?: number | null;
|
|
108
|
+
debit_secondary_currency_amount?: number | null;
|
|
109
|
+
cta_amount?: number | null;
|
|
110
|
+
cta_credit_amount?: number | null;
|
|
111
|
+
cta_debit_amount?: number | null;
|
|
112
|
+
};
|
|
113
|
+
type AccountingDimensionValueCreateUpdate = {
|
|
114
|
+
value: string;
|
|
115
|
+
subsidiary_id?: number | null;
|
|
116
|
+
provider_uid?: string | null;
|
|
117
|
+
parent_id?: string | null;
|
|
118
|
+
children?: Array<AccountingDimensionValueCreateUpdate>;
|
|
119
|
+
};
|
|
82
120
|
type AccountingDimensionValueOverrideSource = 'user' | 'provider';
|
|
83
121
|
type AccountingDimensionValueSlim = {
|
|
84
122
|
id: string;
|
|
@@ -131,8 +169,14 @@ type AccountingDimensionWithRules = {
|
|
|
131
169
|
values?: Array<AccountingDimensionValueWithRules>;
|
|
132
170
|
};
|
|
133
171
|
type AccountingExchangeRate = {
|
|
134
|
-
|
|
135
|
-
|
|
172
|
+
/**
|
|
173
|
+
* Full currency name as per the Currency enum (e.g. 'United States Dollar', 'Euro', 'New Israeli Shekel').
|
|
174
|
+
*/
|
|
175
|
+
from_currency: string;
|
|
176
|
+
/**
|
|
177
|
+
* Full currency name as per the Currency enum (e.g. 'United States Dollar', 'Euro', 'New Israeli Shekel').
|
|
178
|
+
*/
|
|
179
|
+
to_currency: string;
|
|
136
180
|
rate: number;
|
|
137
181
|
};
|
|
138
182
|
type AccountingExchangeRates = {
|
|
@@ -326,6 +370,10 @@ type AccountingPaginationPositionInput = {
|
|
|
326
370
|
};
|
|
327
371
|
type AccountingPeriod = 'Annual' | 'Quarterly' | 'Monthly';
|
|
328
372
|
type AccountingProviderOperationErrorType = 'Connection Error' | 'Authentication Error' | 'Data Operation Error' | 'Server Error' | 'Not Ready For Sync';
|
|
373
|
+
type AccountingSetLineDimensionValueRequest = {
|
|
374
|
+
dimension_id: string;
|
|
375
|
+
dimension_value_id: string;
|
|
376
|
+
};
|
|
329
377
|
type AccountingSimpleCoAPaginationOutput = {
|
|
330
378
|
results: Array<AccountingSimpleTAccount>;
|
|
331
379
|
pagination?: AccountingPaginationOutput | null;
|
|
@@ -357,7 +405,10 @@ type AccountingTAccountOutput = {
|
|
|
357
405
|
is_manually_created?: boolean;
|
|
358
406
|
provider_id: string;
|
|
359
407
|
subsidiary_id: number;
|
|
360
|
-
|
|
408
|
+
/**
|
|
409
|
+
* Full currency name as per the Currency enum (e.g. 'United States Dollar', 'Euro', 'New Israeli Shekel').
|
|
410
|
+
*/
|
|
411
|
+
currency?: string;
|
|
361
412
|
sourced_account_id?: string | null;
|
|
362
413
|
account_balance?: AccountingBalanceOutput;
|
|
363
414
|
primary_balance?: AccountingBalanceOutput;
|
|
@@ -397,7 +448,10 @@ type AccountingTAccountWithSubAccounts = {
|
|
|
397
448
|
is_manually_created?: boolean;
|
|
398
449
|
provider_id: string;
|
|
399
450
|
subsidiary_id: number;
|
|
400
|
-
|
|
451
|
+
/**
|
|
452
|
+
* Full currency name as per the Currency enum (e.g. 'United States Dollar', 'Euro', 'New Israeli Shekel').
|
|
453
|
+
*/
|
|
454
|
+
currency?: string;
|
|
401
455
|
sourced_account_id?: string | null;
|
|
402
456
|
account_balance?: AccountingBalanceOutput;
|
|
403
457
|
primary_balance?: AccountingBalanceOutput;
|
|
@@ -438,7 +492,10 @@ type AccountingTAccountWithoutSubsidiaryMappingOutput = {
|
|
|
438
492
|
is_manually_created?: boolean;
|
|
439
493
|
provider_id: string;
|
|
440
494
|
subsidiary_id: number;
|
|
441
|
-
|
|
495
|
+
/**
|
|
496
|
+
* Full currency name as per the Currency enum (e.g. 'United States Dollar', 'Euro', 'New Israeli Shekel').
|
|
497
|
+
*/
|
|
498
|
+
currency?: string;
|
|
442
499
|
sourced_account_id?: string | null;
|
|
443
500
|
account_balance?: AccountingBalanceOutput;
|
|
444
501
|
primary_balance?: AccountingBalanceOutput;
|
|
@@ -2635,6 +2692,40 @@ type GetSubsidiaryJournalLinesApiAccountingSubsidiarySubsidiaryIdJournalEntryLin
|
|
|
2635
2692
|
200: Array<AccountingJournalEntryLineWithJournalEntryWithDimensionsWithOperationCtx> | AccountingJournalEntryLinePaginationOutput;
|
|
2636
2693
|
};
|
|
2637
2694
|
type GetSubsidiaryJournalLinesApiAccountingSubsidiarySubsidiaryIdJournalEntryLinesGetResponse = GetSubsidiaryJournalLinesApiAccountingSubsidiarySubsidiaryIdJournalEntryLinesGetResponses[keyof GetSubsidiaryJournalLinesApiAccountingSubsidiarySubsidiaryIdJournalEntryLinesGetResponses];
|
|
2695
|
+
type SetLineDimensionValueApiAccountingSubsidiarySubsidiaryIdJournalEntryLinesLineIdDimensionValuePutData = {
|
|
2696
|
+
body: AccountingSetLineDimensionValueRequest;
|
|
2697
|
+
path: {
|
|
2698
|
+
subsidiary_id: number;
|
|
2699
|
+
/**
|
|
2700
|
+
* The journal-entry line to assign the dimension value to.
|
|
2701
|
+
*/
|
|
2702
|
+
line_id: string;
|
|
2703
|
+
};
|
|
2704
|
+
query?: never;
|
|
2705
|
+
url: '/api/accounting/subsidiary/{subsidiary_id}/journal-entry/lines/{line_id}/dimension-value';
|
|
2706
|
+
};
|
|
2707
|
+
type SetLineDimensionValueApiAccountingSubsidiarySubsidiaryIdJournalEntryLinesLineIdDimensionValuePutResponses = {
|
|
2708
|
+
/**
|
|
2709
|
+
* Successful Response
|
|
2710
|
+
*/
|
|
2711
|
+
200: AccountingLineDimensionValueOverride;
|
|
2712
|
+
};
|
|
2713
|
+
type SetLineDimensionValueApiAccountingSubsidiarySubsidiaryIdJournalEntryLinesLineIdDimensionValuePutResponse = SetLineDimensionValueApiAccountingSubsidiarySubsidiaryIdJournalEntryLinesLineIdDimensionValuePutResponses[keyof SetLineDimensionValueApiAccountingSubsidiarySubsidiaryIdJournalEntryLinesLineIdDimensionValuePutResponses];
|
|
2714
|
+
type BulkSetLineDimensionValueApiAccountingSubsidiarySubsidiaryIdJournalEntryLinesDimensionValueBulkPutData = {
|
|
2715
|
+
body: AccountingBulkSetLineDimensionValueRequest;
|
|
2716
|
+
path: {
|
|
2717
|
+
subsidiary_id: number;
|
|
2718
|
+
};
|
|
2719
|
+
query?: never;
|
|
2720
|
+
url: '/api/accounting/subsidiary/{subsidiary_id}/journal-entry/lines/dimension-value/bulk';
|
|
2721
|
+
};
|
|
2722
|
+
type BulkSetLineDimensionValueApiAccountingSubsidiarySubsidiaryIdJournalEntryLinesDimensionValueBulkPutResponses = {
|
|
2723
|
+
/**
|
|
2724
|
+
* Successful Response
|
|
2725
|
+
*/
|
|
2726
|
+
200: AccountingBulkSetLineDimensionValueResponse;
|
|
2727
|
+
};
|
|
2728
|
+
type BulkSetLineDimensionValueApiAccountingSubsidiarySubsidiaryIdJournalEntryLinesDimensionValueBulkPutResponse = BulkSetLineDimensionValueApiAccountingSubsidiarySubsidiaryIdJournalEntryLinesDimensionValueBulkPutResponses[keyof BulkSetLineDimensionValueApiAccountingSubsidiarySubsidiaryIdJournalEntryLinesDimensionValueBulkPutResponses];
|
|
2638
2729
|
type GetSubsidiaryJournalApiAccountingSubsidiarySubsidiaryIdJournalEntryGetData = {
|
|
2639
2730
|
body?: AccountingPaginationPositionInput | null;
|
|
2640
2731
|
path: {
|
|
@@ -2722,6 +2813,57 @@ type GetDimensionsApiAccountingDimensionGetResponses = {
|
|
|
2722
2813
|
200: Array<AccountingDimensionWithRules>;
|
|
2723
2814
|
};
|
|
2724
2815
|
type GetDimensionsApiAccountingDimensionGetResponse = GetDimensionsApiAccountingDimensionGetResponses[keyof GetDimensionsApiAccountingDimensionGetResponses];
|
|
2816
|
+
type GetDimensionBalanceApiAccountingDimensionDimensionIdBalanceGetData = {
|
|
2817
|
+
body?: never;
|
|
2818
|
+
path: {
|
|
2819
|
+
dimension_id: string;
|
|
2820
|
+
};
|
|
2821
|
+
query: {
|
|
2822
|
+
/**
|
|
2823
|
+
* Subsidiary whose balances to read.
|
|
2824
|
+
*/
|
|
2825
|
+
subsidiary_id: number;
|
|
2826
|
+
/**
|
|
2827
|
+
* Accounts to include in the balance.
|
|
2828
|
+
*/
|
|
2829
|
+
account_ids: Array<string>;
|
|
2830
|
+
/**
|
|
2831
|
+
* Start of the movement window (inclusive).
|
|
2832
|
+
*/
|
|
2833
|
+
from_date: string;
|
|
2834
|
+
/**
|
|
2835
|
+
* End of the movement window (inclusive).
|
|
2836
|
+
*/
|
|
2837
|
+
to_date: string;
|
|
2838
|
+
/**
|
|
2839
|
+
* Restrict to these dimension values; omit or leave empty to return all of the dimension's values.
|
|
2840
|
+
*/
|
|
2841
|
+
dimension_value_ids?: Array<string> | null;
|
|
2842
|
+
};
|
|
2843
|
+
url: '/api/accounting/dimension/{dimension_id}/balance';
|
|
2844
|
+
};
|
|
2845
|
+
type GetDimensionBalanceApiAccountingDimensionDimensionIdBalanceGetResponses = {
|
|
2846
|
+
/**
|
|
2847
|
+
* Successful Response
|
|
2848
|
+
*/
|
|
2849
|
+
200: Array<AccountingDimensionValueBalanceResponse>;
|
|
2850
|
+
};
|
|
2851
|
+
type GetDimensionBalanceApiAccountingDimensionDimensionIdBalanceGetResponse = GetDimensionBalanceApiAccountingDimensionDimensionIdBalanceGetResponses[keyof GetDimensionBalanceApiAccountingDimensionDimensionIdBalanceGetResponses];
|
|
2852
|
+
type AddDimensionValueApiAccountingDimensionDimensionIdValuePostData = {
|
|
2853
|
+
body: AccountingDimensionValueCreateUpdate;
|
|
2854
|
+
path: {
|
|
2855
|
+
dimension_id: string;
|
|
2856
|
+
};
|
|
2857
|
+
query?: never;
|
|
2858
|
+
url: '/api/accounting/dimension/{dimension_id}/value';
|
|
2859
|
+
};
|
|
2860
|
+
type AddDimensionValueApiAccountingDimensionDimensionIdValuePostResponses = {
|
|
2861
|
+
/**
|
|
2862
|
+
* Successful Response
|
|
2863
|
+
*/
|
|
2864
|
+
200: AccountingDimensionValue;
|
|
2865
|
+
};
|
|
2866
|
+
type AddDimensionValueApiAccountingDimensionDimensionIdValuePostResponse = AddDimensionValueApiAccountingDimensionDimensionIdValuePostResponses[keyof AddDimensionValueApiAccountingDimensionDimensionIdValuePostResponses];
|
|
2725
2867
|
type GetAccountDimensionAssignmentsForDimensionApiAccountingDimensionDimensionIdAccountAccountIdGetData = {
|
|
2726
2868
|
body?: never;
|
|
2727
2869
|
path: {
|
|
@@ -2783,11 +2925,29 @@ type GetDimensionValuesHierarchicalApiAccountingDimensionValueHierarchicalGetDat
|
|
|
2783
2925
|
body?: never;
|
|
2784
2926
|
path?: never;
|
|
2785
2927
|
query?: {
|
|
2928
|
+
/**
|
|
2929
|
+
* Filter to values belonging to a specific dimension ID.
|
|
2930
|
+
*/
|
|
2786
2931
|
dimension_id?: string | null;
|
|
2932
|
+
/**
|
|
2933
|
+
* Text search filter on the parent dimension name.
|
|
2934
|
+
*/
|
|
2787
2935
|
dimension_name?: string | null;
|
|
2936
|
+
/**
|
|
2937
|
+
* Parent value ID for lazy-loading children; omit for roots.
|
|
2938
|
+
*/
|
|
2788
2939
|
parent_id?: string | null;
|
|
2940
|
+
/**
|
|
2941
|
+
* Search query; matching values are returned with ancestor context.
|
|
2942
|
+
*/
|
|
2789
2943
|
search_query?: string | null;
|
|
2944
|
+
/**
|
|
2945
|
+
* Explicit value IDs to include, with their ancestors for tree context.
|
|
2946
|
+
*/
|
|
2790
2947
|
include_ids?: Array<string> | null;
|
|
2948
|
+
/**
|
|
2949
|
+
* Return a lightweight response without rules and extended metadata.
|
|
2950
|
+
*/
|
|
2791
2951
|
slim?: boolean;
|
|
2792
2952
|
};
|
|
2793
2953
|
url: '/api/accounting/dimension-value/hierarchical';
|
|
@@ -3598,6 +3758,22 @@ interface RequestRegistry {
|
|
|
3598
3758
|
payload: Omit<GetDimensionValuesHierarchicalApiAccountingDimensionValueHierarchicalGetData, 'url'>;
|
|
3599
3759
|
data: GetDimensionValuesHierarchicalApiAccountingDimensionValueHierarchicalGetResponse;
|
|
3600
3760
|
};
|
|
3761
|
+
GET_DIMENSION_BALANCE: {
|
|
3762
|
+
payload: Omit<GetDimensionBalanceApiAccountingDimensionDimensionIdBalanceGetData, 'url'>;
|
|
3763
|
+
data: GetDimensionBalanceApiAccountingDimensionDimensionIdBalanceGetResponse;
|
|
3764
|
+
};
|
|
3765
|
+
ADD_DIMENSION_VALUE: {
|
|
3766
|
+
payload: Omit<AddDimensionValueApiAccountingDimensionDimensionIdValuePostData, 'url'>;
|
|
3767
|
+
data: AddDimensionValueApiAccountingDimensionDimensionIdValuePostResponse;
|
|
3768
|
+
};
|
|
3769
|
+
SET_LINE_DIMENSION_VALUE: {
|
|
3770
|
+
payload: Omit<SetLineDimensionValueApiAccountingSubsidiarySubsidiaryIdJournalEntryLinesLineIdDimensionValuePutData, 'url'>;
|
|
3771
|
+
data: SetLineDimensionValueApiAccountingSubsidiarySubsidiaryIdJournalEntryLinesLineIdDimensionValuePutResponse;
|
|
3772
|
+
};
|
|
3773
|
+
BULK_SET_LINE_DIMENSION_VALUE: {
|
|
3774
|
+
payload: Omit<BulkSetLineDimensionValueApiAccountingSubsidiarySubsidiaryIdJournalEntryLinesDimensionValueBulkPutData, 'url'>;
|
|
3775
|
+
data: BulkSetLineDimensionValueApiAccountingSubsidiarySubsidiaryIdJournalEntryLinesDimensionValueBulkPutResponse;
|
|
3776
|
+
};
|
|
3601
3777
|
GET_JOURNAL_LINES: {
|
|
3602
3778
|
payload: Omit<GetSubsidiaryJournalLinesApiAccountingSubsidiarySubsidiaryIdJournalEntryLinesGetData, 'url'>;
|
|
3603
3779
|
data: GetSubsidiaryJournalLinesApiAccountingSubsidiarySubsidiaryIdJournalEntryLinesGetResponse;
|
|
@@ -3877,6 +4053,14 @@ declare abstract class BridgeDataMethods {
|
|
|
3877
4053
|
getDimensionValuesHierarchical(payload: RequestRegistry['GET_DIMENSION_VALUES_HIERARCHICAL']['payload']): Promise<RequestRegistry['GET_DIMENSION_VALUES_HIERARCHICAL']['data']>;
|
|
3878
4054
|
/** List account assignments for a dimension/account pair. */
|
|
3879
4055
|
getDimensionAccountAssignments(payload: RequestRegistry['GET_DIMENSION_ACCOUNT_ASSIGNMENTS']['payload']): Promise<RequestRegistry['GET_DIMENSION_ACCOUNT_ASSIGNMENTS']['data']>;
|
|
4056
|
+
/** Get dimension-value balances for a dimension over a date window. */
|
|
4057
|
+
getDimensionBalance(payload: RequestRegistry['GET_DIMENSION_BALANCE']['payload']): Promise<RequestRegistry['GET_DIMENSION_BALANCE']['data']>;
|
|
4058
|
+
/** Add a new value under an existing dimension. */
|
|
4059
|
+
addDimensionValue(payload: RequestRegistry['ADD_DIMENSION_VALUE']['payload']): Promise<RequestRegistry['ADD_DIMENSION_VALUE']['data']>;
|
|
4060
|
+
/** Set or override the dimension value on a single journal-entry line. */
|
|
4061
|
+
setLineDimensionValue(payload: RequestRegistry['SET_LINE_DIMENSION_VALUE']['payload']): Promise<RequestRegistry['SET_LINE_DIMENSION_VALUE']['data']>;
|
|
4062
|
+
/** Bulk-assign a dimension value to many journal-entry lines at once. */
|
|
4063
|
+
bulkSetLineDimensionValue(payload: RequestRegistry['BULK_SET_LINE_DIMENSION_VALUE']['payload']): Promise<RequestRegistry['BULK_SET_LINE_DIMENSION_VALUE']['data']>;
|
|
3880
4064
|
/**
|
|
3881
4065
|
* Fetch journal entries for a subsidiary, optionally filtered by date range.
|
|
3882
4066
|
*
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nominalso/vibe-bridge",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.8.1",
|
|
4
4
|
"description": "Iframe-side SDK for building Nominal Vibe Apps — connects an embedded app to its Nominal host over a typed postMessage bridge (context, data fetch, file upload, subroute deep-linking). Safe to import from SSR, React Server Components, and edge/Worker runtimes.",
|
|
5
5
|
"license": "UNLICENSED",
|
|
6
6
|
"homepage": "https://github.com/nominalso/vibe-apps-sdk#readme",
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../../protocol-types/dist/index.js","../package.json","../src/version.ts","../src/data-methods.ts"],"sourcesContent":["// src/subroute.ts\nfunction normalizeSubroute(subroute) {\n const normalized = subroute.startsWith(\"/\") ? subroute : `/${subroute}`;\n const path = normalized.split(/[?#]/)[0];\n let decoded = path;\n let prev;\n do {\n prev = decoded;\n decoded = decoded.replace(/%25/gi, \"%\").replace(/%2e/gi, \".\").replace(/%2f/gi, \"/\");\n } while (decoded !== prev);\n if (decoded.split(\"/\").some((segment) => segment === \"..\")) return null;\n return normalized;\n}\n\n// src/protocol.ts\nvar PROTOCOL_ID = \"nominal-vibe-bridge\";\nvar PROTOCOL_VERSION = 2;\nvar BRIDGE_KINDS = [\"request\", \"response\", \"push\", \"command\", \"progress\"];\nvar CORRELATED_KINDS = [\"request\", \"response\", \"progress\"];\nvar BRIDGE_KINDS_SET = new Set(BRIDGE_KINDS);\nvar CORRELATED_KINDS_SET = new Set(CORRELATED_KINDS);\nfunction isBridgeMessage(data) {\n if (typeof data !== \"object\" || data === null) return false;\n const d = data;\n if (d.__protocol !== PROTOCOL_ID) return false;\n if (d.__version !== PROTOCOL_VERSION) return false;\n if (typeof d.kind !== \"string\" || !BRIDGE_KINDS_SET.has(d.kind)) return false;\n if (typeof d.type !== \"string\") return false;\n if (CORRELATED_KINDS_SET.has(d.kind) && typeof d.requestId !== \"string\") return false;\n return true;\n}\n\n// src/errors.ts\nvar BRIDGE_ERROR_BRAND = /* @__PURE__ */ Symbol.for(\"@nominalso/vibe-bridge:BridgeError\");\nvar HTTP_BRIDGE_ERROR_BRAND = /* @__PURE__ */ Symbol.for(\"@nominalso/vibe-bridge:HttpBridgeError\");\nvar BridgeError = class extends Error {\n constructor(code, message) {\n super(message);\n this.code = code;\n this.name = \"BridgeError\";\n }\n /**\n * Cross-realm-safe type guard. Prefer this over `instanceof BridgeError` when\n * an error may have been thrown by a differently-built copy of the SDK (e.g.\n * server bundle vs client bundle) — it matches on a process-global brand\n * rather than class identity.\n */\n static isBridgeError(err) {\n return typeof err === \"object\" && err !== null && err[BRIDGE_ERROR_BRAND] === true;\n }\n};\nObject.defineProperty(BridgeError.prototype, BRIDGE_ERROR_BRAND, {\n value: true,\n enumerable: false\n});\nvar HttpBridgeError = class extends BridgeError {\n constructor(status, message) {\n super(\"REQUEST_FAILED\", message);\n this.status = status;\n this.name = \"HttpBridgeError\";\n }\n /**\n * Cross-realm-safe type guard (see {@link BridgeError.isBridgeError}). Returns\n * `true` only for `HttpBridgeError` instances, not plain `BridgeError`s.\n */\n static isHttpBridgeError(err) {\n return typeof err === \"object\" && err !== null && err[HTTP_BRIDGE_ERROR_BRAND] === true;\n }\n};\nObject.defineProperty(HttpBridgeError.prototype, HTTP_BRIDGE_ERROR_BRAND, {\n value: true,\n enumerable: false\n});\n\n// src/origins.ts\nfunction isOriginPattern(entry) {\n return entry.includes(\"*\");\n}\nvar patternCache = /* @__PURE__ */ new Map();\nfunction patternToRegExp(pattern) {\n const cached = patternCache.get(pattern);\n if (cached) return cached;\n const escaped = pattern.replace(/[.*+?^${}()|[\\]\\\\]/g, \"\\\\$&\");\n const body = escaped.replace(/\\\\\\*/g, \"[^./:@?#\\\\s]+\");\n const compiled = new RegExp(`^${body}$`);\n patternCache.set(pattern, compiled);\n return compiled;\n}\nfunction matchesOrigin(origin, entry) {\n if (!isOriginPattern(entry)) return origin === entry;\n return patternToRegExp(entry).test(origin);\n}\nfunction isOriginAllowed(origin, allowlist, { allowPatterns }) {\n for (const entry of allowlist) {\n if (isOriginPattern(entry)) {\n if (allowPatterns && matchesOrigin(origin, entry)) return true;\n } else if (origin === entry) {\n return true;\n }\n }\n return false;\n}\nexport {\n BridgeError,\n HttpBridgeError,\n PROTOCOL_ID,\n PROTOCOL_VERSION,\n isBridgeMessage,\n isOriginAllowed,\n isOriginPattern,\n matchesOrigin,\n normalizeSubroute\n};\n","{\n \"name\": \"@nominalso/vibe-bridge\",\n \"version\": \"0.7.0\",\n \"description\": \"Iframe-side SDK for building Nominal Vibe Apps — connects an embedded app to its Nominal host over a typed postMessage bridge (context, data fetch, file upload, subroute deep-linking). Safe to import from SSR, React Server Components, and edge/Worker runtimes.\",\n \"license\": \"UNLICENSED\",\n \"homepage\": \"https://github.com/nominalso/vibe-apps-sdk#readme\",\n \"bugs\": {\n \"url\": \"https://github.com/nominalso/vibe-apps-sdk/issues\"\n },\n \"repository\": {\n \"type\": \"git\",\n \"url\": \"github:nominalso/vibe-apps-sdk\",\n \"directory\": \"packages/bridge\"\n },\n \"type\": \"module\",\n \"sideEffects\": false,\n \"types\": \"./dist/index.d.ts\",\n \"main\": \"./dist/index.browser.cjs\",\n \"exports\": {\n \".\": {\n \"types\": \"./dist/index.d.ts\",\n \"react-server\": \"./dist/index.server.js\",\n \"workerd\": \"./dist/index.server.js\",\n \"worker\": \"./dist/index.server.js\",\n \"edge-light\": \"./dist/index.server.js\",\n \"deno\": \"./dist/index.server.js\",\n \"browser\": {\n \"import\": \"./dist/index.browser.js\",\n \"require\": \"./dist/index.browser.cjs\"\n },\n \"default\": {\n \"import\": \"./dist/index.browser.js\",\n \"require\": \"./dist/index.browser.cjs\"\n }\n },\n \"./server\": {\n \"types\": \"./dist/index.d.ts\",\n \"import\": \"./dist/index.server.js\",\n \"require\": \"./dist/index.server.cjs\"\n },\n \"./package.json\": \"./package.json\"\n },\n \"files\": [\n \"dist\",\n \"docs\",\n \"AGENTS.md\",\n \"llms.txt\"\n ],\n \"publishConfig\": {\n \"registry\": \"https://registry.npmjs.org/\",\n \"access\": \"public\"\n },\n \"scripts\": {\n \"clean\": \"rm -rf dist node_modules\",\n \"build\": \"rm -rf dist && tsup\",\n \"lint\": \"eslint src\",\n \"typecheck\": \"tsc --noEmit\",\n \"test\": \"vitest run\"\n },\n \"optionalDependencies\": {\n \"posthog-js\": \"^1.393.5\"\n },\n \"devDependencies\": {\n \"@nominalso/vibe-api-types\": \"workspace:*\",\n \"@nominalso/vibe-protocol-types\": \"workspace:*\"\n }\n}\n","import { version } from '../package.json'\n\n/**\n * Published version of this package (`@nominalso/vibe-bridge`), sent to the host\n * in the `CONNECT` handshake. Import-safe from any environment.\n */\nexport const BRIDGE_VERSION: string = version\n","import type { RequestRegistry } from '@nominalso/vibe-protocol-types'\n\nexport interface UploadOptions {\n /** Domain entity the file attaches to, e.g. `'JOURNAL_ENTRY'`. */\n entityType: string\n /** Id of the entity the file attaches to, when applicable. */\n entityId?: string | number\n /** Called with incremental progress (`0`–`100`) while the upload streams. */\n onProgress?: (p: RequestRegistry['UPLOAD_FILE']['progress']) => void\n}\n\n/**\n * The typed Nominal data methods (~46) plus {@link BridgeDataMethods.upload},\n * factored onto a base class so {@link VibeAppBridge} stays focused on\n * connection/transport. Each method is a thin typed wrapper over `request()`;\n * `VibeAppBridge` provides the concrete `request` implementation.\n */\nexport abstract class BridgeDataMethods {\n /**\n * Low-level typed request for **any** operation in {@link RequestRegistry} —\n * implemented by {@link VibeAppBridge}. The named methods below wrap this.\n */\n abstract request<K extends keyof RequestRegistry>(\n type: K,\n payload: RequestRegistry[K]['payload'],\n onProgress?: (payload: unknown) => void,\n ): Promise<RequestRegistry[K]['data']>\n\n // ---------------------------------------------------------------------------\n // Operations — Accounting: chart of accounts\n //\n // Each method is a typed wrapper over `request('<OP>', payload)`. The payload\n // and return types come straight from the Nominal API (`RequestRegistry`).\n // For any operation without a named method, call `request('<OP>', payload)`.\n // ---------------------------------------------------------------------------\n\n /**\n * Fetch the flat chart of accounts for a subsidiary.\n *\n * @example\n * ```ts\n * const ctx = await bridge.connect()\n * const accounts = await bridge.getChartOfAccounts({\n * path: { subsidiary_id: ctx.subsidiaryId },\n * })\n * ```\n */\n getChartOfAccounts(\n payload: RequestRegistry['GET_CHART_OF_ACCOUNTS']['payload'],\n ): Promise<RequestRegistry['GET_CHART_OF_ACCOUNTS']['data']> {\n return this.request('GET_CHART_OF_ACCOUNTS', payload)\n }\n\n /** Fetch the chart of accounts as a hierarchical tree for a subsidiary. */\n getCoaTree(\n payload: RequestRegistry['GET_COA_TREE']['payload'],\n ): Promise<RequestRegistry['GET_COA_TREE']['data']> {\n return this.request('GET_COA_TREE', payload)\n }\n\n /** Fetch a simplified flat chart of accounts for a subsidiary. */\n getCoaFlatSimple(\n payload: RequestRegistry['GET_COA_FLAT_SIMPLE']['payload'],\n ): Promise<RequestRegistry['GET_COA_FLAT_SIMPLE']['data']> {\n return this.request('GET_COA_FLAT_SIMPLE', payload)\n }\n\n /** Fetch the flat chart of accounts grouped by account group. */\n getCoaGrouped(\n payload: RequestRegistry['GET_COA_GROUPED']['payload'],\n ): Promise<RequestRegistry['GET_COA_GROUPED']['data']> {\n return this.request('GET_COA_GROUPED', payload)\n }\n\n /** Fetch a single chart-of-accounts account by id within a subsidiary. */\n getCoaAccount(\n payload: RequestRegistry['GET_COA_ACCOUNT']['payload'],\n ): Promise<RequestRegistry['GET_COA_ACCOUNT']['data']> {\n return this.request('GET_COA_ACCOUNT', payload)\n }\n\n /** List the currencies available to a subsidiary's chart of accounts. */\n getSubsidiaryAvailableCurrencies(\n payload: RequestRegistry['GET_SUBSIDIARY_AVAILABLE_CURRENCIES']['payload'],\n ): Promise<RequestRegistry['GET_SUBSIDIARY_AVAILABLE_CURRENCIES']['data']> {\n return this.request('GET_SUBSIDIARY_AVAILABLE_CURRENCIES', payload)\n }\n\n /** Fetch accounts at the tenant level. */\n getAccounts(\n payload: RequestRegistry['GET_ACCOUNTS']['payload'],\n ): Promise<RequestRegistry['GET_ACCOUNTS']['data']> {\n return this.request('GET_ACCOUNTS', payload)\n }\n\n /** Fetch a single account by id. */\n getAccount(\n payload: RequestRegistry['GET_ACCOUNT']['payload'],\n ): Promise<RequestRegistry['GET_ACCOUNT']['data']> {\n return this.request('GET_ACCOUNT', payload)\n }\n\n // ---------------------------------------------------------------------------\n // Operations — Accounting: exchange rates\n // ---------------------------------------------------------------------------\n\n /** Fetch currency conversion rates for a currency. */\n getConversionRates(\n payload: RequestRegistry['GET_CONVERSION_RATES']['payload'],\n ): Promise<RequestRegistry['GET_CONVERSION_RATES']['data']> {\n return this.request('GET_CONVERSION_RATES', payload)\n }\n\n /** Fetch the effective consolidation exchange rate. */\n getEffectiveExchangeRate(\n payload: RequestRegistry['GET_EFFECTIVE_EXCHANGE_RATE']['payload'],\n ): Promise<RequestRegistry['GET_EFFECTIVE_EXCHANGE_RATE']['data']> {\n return this.request('GET_EFFECTIVE_EXCHANGE_RATE', payload)\n }\n\n /** Fetch the exchange-rate period covering a given input date. */\n getExchangeRateByDate(\n payload: RequestRegistry['GET_EXCHANGE_RATE_BY_DATE']['payload'],\n ): Promise<RequestRegistry['GET_EXCHANGE_RATE_BY_DATE']['data']> {\n return this.request('GET_EXCHANGE_RATE_BY_DATE', payload)\n }\n\n // ---------------------------------------------------------------------------\n // Operations — Accounting: dimensions\n // ---------------------------------------------------------------------------\n\n /** List accounting dimensions. */\n getDimensions(\n payload: RequestRegistry['GET_DIMENSIONS']['payload'],\n ): Promise<RequestRegistry['GET_DIMENSIONS']['data']> {\n return this.request('GET_DIMENSIONS', payload)\n }\n\n /** List values for accounting dimensions. */\n getDimensionValues(\n payload: RequestRegistry['GET_DIMENSION_VALUES']['payload'],\n ): Promise<RequestRegistry['GET_DIMENSION_VALUES']['data']> {\n return this.request('GET_DIMENSION_VALUES', payload)\n }\n\n /** List dimension values in hierarchical form. */\n getDimensionValuesHierarchical(\n payload: RequestRegistry['GET_DIMENSION_VALUES_HIERARCHICAL']['payload'],\n ): Promise<RequestRegistry['GET_DIMENSION_VALUES_HIERARCHICAL']['data']> {\n return this.request('GET_DIMENSION_VALUES_HIERARCHICAL', payload)\n }\n\n /** List account assignments for a dimension/account pair. */\n getDimensionAccountAssignments(\n payload: RequestRegistry['GET_DIMENSION_ACCOUNT_ASSIGNMENTS']['payload'],\n ): Promise<RequestRegistry['GET_DIMENSION_ACCOUNT_ASSIGNMENTS']['data']> {\n return this.request('GET_DIMENSION_ACCOUNT_ASSIGNMENTS', payload)\n }\n\n // ---------------------------------------------------------------------------\n // Operations — Accounting: journal entries\n // ---------------------------------------------------------------------------\n\n /**\n * Fetch journal entries for a subsidiary, optionally filtered by date range.\n *\n * @example\n * ```ts\n * const entries = await bridge.getJournalEntries({\n * path: { subsidiary_id: ctx.subsidiaryId },\n * query: { from_date: '2026-01-01', to_date: '2026-03-31' },\n * })\n * ```\n */\n getJournalEntries(\n payload: RequestRegistry['GET_JOURNAL_ENTRIES']['payload'],\n ): Promise<RequestRegistry['GET_JOURNAL_ENTRIES']['data']> {\n return this.request('GET_JOURNAL_ENTRIES', payload)\n }\n\n /** Fetch journal entry lines for a subsidiary. */\n getJournalLines(\n payload: RequestRegistry['GET_JOURNAL_LINES']['payload'],\n ): Promise<RequestRegistry['GET_JOURNAL_LINES']['data']> {\n return this.request('GET_JOURNAL_LINES', payload)\n }\n\n /** Fetch a single journal entry by id within a subsidiary. */\n getJournalEntry(\n payload: RequestRegistry['GET_JOURNAL_ENTRY']['payload'],\n ): Promise<RequestRegistry['GET_JOURNAL_ENTRY']['data']> {\n return this.request('GET_JOURNAL_ENTRY', payload)\n }\n\n // ---------------------------------------------------------------------------\n // Operations — Activity: period instances\n // ---------------------------------------------------------------------------\n\n /** List accounting period instances. */\n getPeriods(\n payload: RequestRegistry['GET_PERIODS']['payload'],\n ): Promise<RequestRegistry['GET_PERIODS']['data']> {\n return this.request('GET_PERIODS', payload)\n }\n\n /** Fetch a single period instance by id. */\n getPeriodInstance(\n payload: RequestRegistry['GET_PERIOD_INSTANCE']['payload'],\n ): Promise<RequestRegistry['GET_PERIOD_INSTANCE']['data']> {\n return this.request('GET_PERIOD_INSTANCE', payload)\n }\n\n /** Fetch a period instance by its display slug (e.g. `\"mar-2026\"`). */\n getPeriodInstanceBySlug(\n payload: RequestRegistry['GET_PERIOD_INSTANCE_BY_SLUG']['payload'],\n ): Promise<RequestRegistry['GET_PERIOD_INSTANCE_BY_SLUG']['data']> {\n return this.request('GET_PERIOD_INSTANCE_BY_SLUG', payload)\n }\n\n /** Fetch the close-progress breakdown for a period (by slug). */\n getPeriodProgressBreakdown(\n payload: RequestRegistry['GET_PERIOD_PROGRESS_BREAKDOWN']['payload'],\n ): Promise<RequestRegistry['GET_PERIOD_PROGRESS_BREAKDOWN']['data']> {\n return this.request('GET_PERIOD_PROGRESS_BREAKDOWN', payload)\n }\n\n // ---------------------------------------------------------------------------\n // Operations — Activity: activity definitions\n // ---------------------------------------------------------------------------\n\n /** List activity definitions. */\n getActivityDefinitions(\n payload: RequestRegistry['GET_ACTIVITY_DEFINITIONS']['payload'],\n ): Promise<RequestRegistry['GET_ACTIVITY_DEFINITIONS']['data']> {\n return this.request('GET_ACTIVITY_DEFINITIONS', payload)\n }\n\n /** Fetch a single activity definition by id. */\n getActivityDefinition(\n payload: RequestRegistry['GET_ACTIVITY_DEFINITION']['payload'],\n ): Promise<RequestRegistry['GET_ACTIVITY_DEFINITION']['data']> {\n return this.request('GET_ACTIVITY_DEFINITION', payload)\n }\n\n // ---------------------------------------------------------------------------\n // Operations — Activity: activity instances\n // ---------------------------------------------------------------------------\n\n /** List activity instances. */\n getActivityInstances(\n payload: RequestRegistry['GET_ACTIVITY_INSTANCES']['payload'],\n ): Promise<RequestRegistry['GET_ACTIVITY_INSTANCES']['data']> {\n return this.request('GET_ACTIVITY_INSTANCES', payload)\n }\n\n /** Fetch a single activity instance by id. */\n getActivityInstance(\n payload: RequestRegistry['GET_ACTIVITY_INSTANCE']['payload'],\n ): Promise<RequestRegistry['GET_ACTIVITY_INSTANCE']['data']> {\n return this.request('GET_ACTIVITY_INSTANCE', payload)\n }\n\n /** Fetch an activity instance for a given period + activity definition. */\n getActivityInstanceByPeriod(\n payload: RequestRegistry['GET_ACTIVITY_INSTANCE_BY_PERIOD']['payload'],\n ): Promise<RequestRegistry['GET_ACTIVITY_INSTANCE_BY_PERIOD']['data']> {\n return this.request('GET_ACTIVITY_INSTANCE_BY_PERIOD', payload)\n }\n\n /** List task instances for an activity instance. */\n getActivityInstanceTasks(\n payload: RequestRegistry['GET_ACTIVITY_INSTANCE_TASKS']['payload'],\n ): Promise<RequestRegistry['GET_ACTIVITY_INSTANCE_TASKS']['data']> {\n return this.request('GET_ACTIVITY_INSTANCE_TASKS', payload)\n }\n\n /** List task instances for an activity in a given period. */\n getActivityPeriodTasks(\n payload: RequestRegistry['GET_ACTIVITY_PERIOD_TASKS']['payload'],\n ): Promise<RequestRegistry['GET_ACTIVITY_PERIOD_TASKS']['data']> {\n return this.request('GET_ACTIVITY_PERIOD_TASKS', payload)\n }\n\n // ---------------------------------------------------------------------------\n // Operations — Activity: task definitions\n // ---------------------------------------------------------------------------\n\n /** List task definitions. */\n getTaskDefinitions(\n payload: RequestRegistry['GET_TASK_DEFINITIONS']['payload'],\n ): Promise<RequestRegistry['GET_TASK_DEFINITIONS']['data']> {\n return this.request('GET_TASK_DEFINITIONS', payload)\n }\n\n /** Fetch a single task definition by id. */\n getTaskDefinition(\n payload: RequestRegistry['GET_TASK_DEFINITION']['payload'],\n ): Promise<RequestRegistry['GET_TASK_DEFINITION']['data']> {\n return this.request('GET_TASK_DEFINITION', payload)\n }\n\n /** Create a task definition. */\n createTaskDefinition(\n payload: RequestRegistry['CREATE_TASK_DEFINITION']['payload'],\n ): Promise<RequestRegistry['CREATE_TASK_DEFINITION']['data']> {\n return this.request('CREATE_TASK_DEFINITION', payload)\n }\n\n /** Update a task definition by id. */\n updateTaskDefinition(\n payload: RequestRegistry['UPDATE_TASK_DEFINITION']['payload'],\n ): Promise<RequestRegistry['UPDATE_TASK_DEFINITION']['data']> {\n return this.request('UPDATE_TASK_DEFINITION', payload)\n }\n\n /** Query task definitions by filter. */\n getTaskDefinitionsByFilter(\n payload: RequestRegistry['GET_TASK_DEFINITIONS_BY_FILTER']['payload'],\n ): Promise<RequestRegistry['GET_TASK_DEFINITIONS_BY_FILTER']['data']> {\n return this.request('GET_TASK_DEFINITIONS_BY_FILTER', payload)\n }\n\n // ---------------------------------------------------------------------------\n // Operations — Activity: task instances\n // ---------------------------------------------------------------------------\n\n /** List task instances. */\n getTaskInstances(\n payload: RequestRegistry['GET_TASK_INSTANCES']['payload'],\n ): Promise<RequestRegistry['GET_TASK_INSTANCES']['data']> {\n return this.request('GET_TASK_INSTANCES', payload)\n }\n\n /** Fetch a single task instance by id. */\n getTaskInstance(\n payload: RequestRegistry['GET_TASK_INSTANCE']['payload'],\n ): Promise<RequestRegistry['GET_TASK_INSTANCE']['data']> {\n return this.request('GET_TASK_INSTANCE', payload)\n }\n\n /**\n * Submit a Close-Management task output. This is the **only write path** back\n * into Nominal — Vibe Apps never write Nominal data directly.\n *\n * @example\n * ```ts\n * // `body` carries the task-specific output shape.\n * await bridge.postTaskOutput({\n * path: { task_instance_id: 'task-1' },\n * body: {},\n * })\n * ```\n */\n postTaskOutput(\n payload: RequestRegistry['POST_TASK_OUTPUT']['payload'],\n ): Promise<RequestRegistry['POST_TASK_OUTPUT']['data']> {\n return this.request('POST_TASK_OUTPUT', payload)\n }\n\n /** Query task instances by filter. */\n getTaskInstancesByFilter(\n payload: RequestRegistry['GET_TASK_INSTANCES_BY_FILTER']['payload'],\n ): Promise<RequestRegistry['GET_TASK_INSTANCES_BY_FILTER']['data']> {\n return this.request('GET_TASK_INSTANCES_BY_FILTER', payload)\n }\n\n // ---------------------------------------------------------------------------\n // Operations — Audit trail\n // ---------------------------------------------------------------------------\n\n /** List audit-trail events. */\n getAuditEvents(\n payload: RequestRegistry['GET_AUDIT_EVENTS']['payload'],\n ): Promise<RequestRegistry['GET_AUDIT_EVENTS']['data']> {\n return this.request('GET_AUDIT_EVENTS', payload)\n }\n\n /** List audit-trail events for a specific entity. */\n getEntityAuditEvents(\n payload: RequestRegistry['GET_ENTITY_AUDIT_EVENTS']['payload'],\n ): Promise<RequestRegistry['GET_ENTITY_AUDIT_EVENTS']['data']> {\n return this.request('GET_ENTITY_AUDIT_EVENTS', payload)\n }\n\n // ---------------------------------------------------------------------------\n // Operations — Period manager: fiscal calendars\n // ---------------------------------------------------------------------------\n\n /** List fiscal calendars for a subsidiary. */\n getFiscalCalendars(\n payload: RequestRegistry['GET_FISCAL_CALENDARS']['payload'],\n ): Promise<RequestRegistry['GET_FISCAL_CALENDARS']['data']> {\n return this.request('GET_FISCAL_CALENDARS', payload)\n }\n\n /** Fetch a single fiscal calendar by id. */\n getFiscalCalendar(\n payload: RequestRegistry['GET_FISCAL_CALENDAR']['payload'],\n ): Promise<RequestRegistry['GET_FISCAL_CALENDAR']['data']> {\n return this.request('GET_FISCAL_CALENDAR', payload)\n }\n\n // ---------------------------------------------------------------------------\n // Operations — Tenancy\n // ---------------------------------------------------------------------------\n\n /** List subsidiaries for the tenant. */\n getSubsidiaries(\n payload: RequestRegistry['GET_SUBSIDIARIES']['payload'],\n ): Promise<RequestRegistry['GET_SUBSIDIARIES']['data']> {\n return this.request('GET_SUBSIDIARIES', payload)\n }\n\n /** Fetch a single subsidiary by id. */\n getSubsidiary(\n payload: RequestRegistry['GET_SUBSIDIARY']['payload'],\n ): Promise<RequestRegistry['GET_SUBSIDIARY']['data']> {\n return this.request('GET_SUBSIDIARY', payload)\n }\n\n /** List parent currencies for a subsidiary. */\n getSubsidiaryParentCurrencies(\n payload: RequestRegistry['GET_SUBSIDIARY_PARENT_CURRENCIES']['payload'],\n ): Promise<RequestRegistry['GET_SUBSIDIARY_PARENT_CURRENCIES']['data']> {\n return this.request('GET_SUBSIDIARY_PARENT_CURRENCIES', payload)\n }\n\n /** List users for the tenant. */\n getTenantUsers(\n payload: RequestRegistry['GET_TENANT_USERS']['payload'],\n ): Promise<RequestRegistry['GET_TENANT_USERS']['data']> {\n return this.request('GET_TENANT_USERS', payload)\n }\n\n /**\n * Uploads a file through the host. Converts the `File` to an `ArrayBuffer`\n * before sending — sandboxed iframes cannot pass `File` handles across\n * windows. Resolves once Nominal has stored the file.\n *\n * @example\n * ```ts\n * const input = document.querySelector<HTMLInputElement>('#file')!\n * const file = input.files![0]\n * const result = await bridge.upload(file, {\n * entityType: 'JOURNAL_ENTRY',\n * entityId: '123',\n * onProgress: (p) => console.log(`${p.progress}%`),\n * })\n * // result.attachmentId, result.name\n * ```\n */\n async upload(\n file: File,\n options: UploadOptions,\n ): Promise<RequestRegistry['UPLOAD_FILE']['data']> {\n const buffer = await file.arrayBuffer()\n const payload: RequestRegistry['UPLOAD_FILE']['payload'] = {\n buffer,\n fileName: file.name,\n fileType: file.type,\n entityType: options.entityType,\n entityId: options.entityId,\n }\n const onProgress = options.onProgress\n ? (p: unknown): void => options.onProgress!(p as RequestRegistry['UPLOAD_FILE']['progress'])\n : undefined\n return this.request('UPLOAD_FILE', payload, onProgress)\n }\n}\n"],"mappings":";AACA,SAAS,kBAAkB,UAAU;AACnC,QAAM,aAAa,SAAS,WAAW,GAAG,IAAI,WAAW,IAAI,QAAQ;AACrE,QAAM,OAAO,WAAW,MAAM,MAAM,EAAE,CAAC;AACvC,MAAI,UAAU;AACd,MAAI;AACJ,KAAG;AACD,WAAO;AACP,cAAU,QAAQ,QAAQ,SAAS,GAAG,EAAE,QAAQ,SAAS,GAAG,EAAE,QAAQ,SAAS,GAAG;AAAA,EACpF,SAAS,YAAY;AACrB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