@layerfi/components 0.1.99-alpha.3 → 0.1.99

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.
@@ -5575,7 +5575,6 @@ __export(index_exports, {
5575
5575
  Direction: () => Direction,
5576
5576
  DisplayState: () => DisplayState,
5577
5577
  GeneralLedgerView: () => GeneralLedgerView,
5578
- Integrations: () => Integrations,
5579
5578
  Journal: () => Journal,
5580
5579
  LayerProvider: () => LayerProvider,
5581
5580
  LinkAccounts: () => LinkAccounts,
@@ -5589,6 +5588,7 @@ __export(index_exports, {
5589
5588
  Reports: () => Reports,
5590
5589
  StatementOfCashFlow: () => StatementOfCashFlow,
5591
5590
  Tasks: () => Tasks,
5591
+ unstable_Integrations: () => unstable_Integrations,
5592
5592
  useBankTransactionsContext: () => useBankTransactionsContext,
5593
5593
  useDataSync: () => useDataSync,
5594
5594
  useLayerContext: () => useLayerContext
@@ -5602,7 +5602,7 @@ var import_react18 = require("react");
5602
5602
  var import_react16 = require("react");
5603
5603
 
5604
5604
  // package.json
5605
- var version = "0.1.99-alpha.3";
5605
+ var version = "0.1.99";
5606
5606
 
5607
5607
  // src/models/APIError.ts
5608
5608
  var APIError = class _APIError extends Error {
@@ -7463,7 +7463,7 @@ function useBankTransactions({
7463
7463
 
7464
7464
  // src/hooks/useBankTransactions/useCategorizeBankTransaction.ts
7465
7465
  var import_react13 = require("react");
7466
- var import_swr3 = require("swr");
7466
+ var import_swr4 = require("swr");
7467
7467
  var import_mutation = __toESM(require("swr/mutation"));
7468
7468
 
7469
7469
  // src/utils/swr/withSWRKeyTags.ts
@@ -7474,9 +7474,53 @@ function withSWRKeyTags(key, predicate) {
7474
7474
  return isStringArray(key.tags) ? predicate(key.tags) : false;
7475
7475
  }
7476
7476
 
7477
+ // src/hooks/bookkeeping/useBankAccounts.ts
7478
+ var import_swr3 = __toESM(require("swr"));
7479
+ var BANK_ACCOUNTS_TAG_KEY = "#bank-accounts";
7480
+ var getBankAccounts = get(
7481
+ ({ businessId }) => `/v1/businesses/${businessId}/bank-accounts`
7482
+ );
7483
+ function buildKey3({
7484
+ access_token: accessToken,
7485
+ apiUrl,
7486
+ businessId
7487
+ }) {
7488
+ if (accessToken && apiUrl) {
7489
+ return {
7490
+ accessToken,
7491
+ apiUrl,
7492
+ businessId,
7493
+ tags: [BANK_ACCOUNTS_TAG_KEY]
7494
+ };
7495
+ }
7496
+ }
7497
+ var requiresNotification = (bankAccount) => bankAccount.is_disconnected && bankAccount.notify_when_disconnected;
7498
+ var useBankAccounts = () => {
7499
+ var _a, _b;
7500
+ const { businessId } = useLayerContext();
7501
+ const { apiUrl } = useEnvironment();
7502
+ const { data: auth } = useAuth();
7503
+ const { data, error, isLoading } = (0, import_swr3.default)(
7504
+ () => buildKey3(__spreadProps(__spreadValues({}, auth), {
7505
+ apiUrl,
7506
+ businessId
7507
+ })),
7508
+ ({ accessToken, apiUrl: apiUrl2, businessId: businessId2 }) => getBankAccounts(apiUrl2, accessToken, { params: { businessId: businessId2 } })()
7509
+ );
7510
+ const disconnectedAccountsRequiringNotification = ((_a = data == null ? void 0 : data.data) != null ? _a : []).filter(
7511
+ (account) => requiresNotification(account)
7512
+ ).length;
7513
+ return {
7514
+ bankAccounts: (_b = data == null ? void 0 : data.data) != null ? _b : [],
7515
+ isLoading,
7516
+ error,
7517
+ disconnectedAccountsRequiringNotification
7518
+ };
7519
+ };
7520
+
7477
7521
  // src/hooks/useBankTransactions/useCategorizeBankTransaction.ts
7478
7522
  var CATEGORIZE_BANK_TRANSACTION_TAG = "#categorize-bank-transaction";
7479
- function buildKey3({
7523
+ function buildKey4({
7480
7524
  access_token: accessToken,
7481
7525
  apiUrl,
7482
7526
  businessId
@@ -7495,9 +7539,9 @@ function useCategorizeBankTransaction({
7495
7539
  }) {
7496
7540
  const { data: auth } = useAuth();
7497
7541
  const { businessId } = useLayerContext();
7498
- const { mutate } = (0, import_swr3.useSWRConfig)();
7542
+ const { mutate } = (0, import_swr4.useSWRConfig)();
7499
7543
  const mutationResponse = (0, import_mutation.default)(
7500
- () => buildKey3({
7544
+ () => buildKey4({
7501
7545
  access_token: auth == null ? void 0 : auth.access_token,
7502
7546
  apiUrl: auth == null ? void 0 : auth.apiUrl,
7503
7547
  businessId
@@ -7526,7 +7570,7 @@ function useCategorizeBankTransaction({
7526
7570
  const triggerResult = yield originalTrigger(...triggerParameters);
7527
7571
  void mutate((key) => withSWRKeyTags(
7528
7572
  key,
7529
- (tags) => tags.includes(CATEGORIZE_BANK_TRANSACTION_TAG)
7573
+ (tags) => tags.includes(BANK_ACCOUNTS_TAG_KEY) || tags.includes(EXTERNAL_ACCOUNTS_TAG_KEY)
7530
7574
  ));
7531
7575
  void mutateBankTransactions(void 0, { revalidate: true });
7532
7576
  return triggerResult;
@@ -7551,52 +7595,6 @@ function useCategorizeBankTransaction({
7551
7595
  var import_react14 = require("react");
7552
7596
  var import_swr5 = require("swr");
7553
7597
  var import_mutation2 = __toESM(require("swr/mutation"));
7554
-
7555
- // src/hooks/bookkeeping/useBankAccounts.ts
7556
- var import_swr4 = __toESM(require("swr"));
7557
- var BANK_ACCOUNTS_TAG_KEY = "#bank-accounts";
7558
- var getBankAccounts = get(
7559
- ({ businessId }) => `/v1/businesses/${businessId}/bank-accounts`
7560
- );
7561
- function buildKey4({
7562
- access_token: accessToken,
7563
- apiUrl,
7564
- businessId
7565
- }) {
7566
- if (accessToken && apiUrl) {
7567
- return {
7568
- accessToken,
7569
- apiUrl,
7570
- businessId,
7571
- tags: [BANK_ACCOUNTS_TAG_KEY]
7572
- };
7573
- }
7574
- }
7575
- var requiresNotification = (bankAccount) => bankAccount.is_disconnected && bankAccount.notify_when_disconnected;
7576
- var useBankAccounts = () => {
7577
- var _a, _b;
7578
- const { businessId } = useLayerContext();
7579
- const { apiUrl } = useEnvironment();
7580
- const { data: auth } = useAuth();
7581
- const { data, error, isLoading } = (0, import_swr4.default)(
7582
- () => buildKey4(__spreadProps(__spreadValues({}, auth), {
7583
- apiUrl,
7584
- businessId
7585
- })),
7586
- ({ accessToken, apiUrl: apiUrl2, businessId: businessId2 }) => getBankAccounts(apiUrl2, accessToken, { params: { businessId: businessId2 } })()
7587
- );
7588
- const disconnectedAccountsRequiringNotification = ((_a = data == null ? void 0 : data.data) != null ? _a : []).filter(
7589
- (account) => requiresNotification(account)
7590
- ).length;
7591
- return {
7592
- bankAccounts: (_b = data == null ? void 0 : data.data) != null ? _b : [],
7593
- isLoading,
7594
- error,
7595
- disconnectedAccountsRequiringNotification
7596
- };
7597
- };
7598
-
7599
- // src/hooks/useBankTransactions/useMatchBankTransaction.ts
7600
7598
  var MATCH_BANK_TRANSACTION_TAG = "#match-bank-transaction";
7601
7599
  function buildKey5({
7602
7600
  access_token: accessToken,
@@ -19064,7 +19062,7 @@ var IntegrationsConnectMenu = () => {
19064
19062
  // src/components/Integrations/Integrations.tsx
19065
19063
  var import_jsx_runtime164 = require("react/jsx-runtime");
19066
19064
  var COMPONENT_NAME3 = "integrations";
19067
- var Integrations = (props) => {
19065
+ var unstable_Integrations = (props) => {
19068
19066
  return /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(QuickbooksContextProvider, { children: /* @__PURE__ */ (0, import_jsx_runtime164.jsx)(IntegrationsComponent, __spreadValues({}, props)) });
19069
19067
  };
19070
19068
  var IntegrationsComponent = ({
@@ -30928,7 +30926,6 @@ var Components = ({
30928
30926
  Direction,
30929
30927
  DisplayState,
30930
30928
  GeneralLedgerView,
30931
- Integrations,
30932
30929
  Journal,
30933
30930
  LayerProvider,
30934
30931
  LinkAccounts,
@@ -30942,6 +30939,7 @@ var Components = ({
30942
30939
  Reports,
30943
30940
  StatementOfCashFlow,
30944
30941
  Tasks,
30942
+ unstable_Integrations,
30945
30943
  useBankTransactionsContext,
30946
30944
  useDataSync,
30947
30945
  useLayerContext
@@ -5570,7 +5570,7 @@ import { useState as useState8 } from "react";
5570
5570
  import { useReducer, useEffect as useEffect4 } from "react";
5571
5571
 
5572
5572
  // package.json
5573
- var version = "0.1.99-alpha.3";
5573
+ var version = "0.1.99";
5574
5574
 
5575
5575
  // src/models/APIError.ts
5576
5576
  var APIError = class _APIError extends Error {
@@ -7442,9 +7442,53 @@ function withSWRKeyTags(key, predicate) {
7442
7442
  return isStringArray(key.tags) ? predicate(key.tags) : false;
7443
7443
  }
7444
7444
 
7445
+ // src/hooks/bookkeeping/useBankAccounts.ts
7446
+ import useSWR3 from "swr";
7447
+ var BANK_ACCOUNTS_TAG_KEY = "#bank-accounts";
7448
+ var getBankAccounts = get(
7449
+ ({ businessId }) => `/v1/businesses/${businessId}/bank-accounts`
7450
+ );
7451
+ function buildKey3({
7452
+ access_token: accessToken,
7453
+ apiUrl,
7454
+ businessId
7455
+ }) {
7456
+ if (accessToken && apiUrl) {
7457
+ return {
7458
+ accessToken,
7459
+ apiUrl,
7460
+ businessId,
7461
+ tags: [BANK_ACCOUNTS_TAG_KEY]
7462
+ };
7463
+ }
7464
+ }
7465
+ var requiresNotification = (bankAccount) => bankAccount.is_disconnected && bankAccount.notify_when_disconnected;
7466
+ var useBankAccounts = () => {
7467
+ var _a, _b;
7468
+ const { businessId } = useLayerContext();
7469
+ const { apiUrl } = useEnvironment();
7470
+ const { data: auth } = useAuth();
7471
+ const { data, error, isLoading } = useSWR3(
7472
+ () => buildKey3(__spreadProps(__spreadValues({}, auth), {
7473
+ apiUrl,
7474
+ businessId
7475
+ })),
7476
+ ({ accessToken, apiUrl: apiUrl2, businessId: businessId2 }) => getBankAccounts(apiUrl2, accessToken, { params: { businessId: businessId2 } })()
7477
+ );
7478
+ const disconnectedAccountsRequiringNotification = ((_a = data == null ? void 0 : data.data) != null ? _a : []).filter(
7479
+ (account) => requiresNotification(account)
7480
+ ).length;
7481
+ return {
7482
+ bankAccounts: (_b = data == null ? void 0 : data.data) != null ? _b : [],
7483
+ isLoading,
7484
+ error,
7485
+ disconnectedAccountsRequiringNotification
7486
+ };
7487
+ };
7488
+
7445
7489
  // src/hooks/useBankTransactions/useCategorizeBankTransaction.ts
7446
7490
  var CATEGORIZE_BANK_TRANSACTION_TAG = "#categorize-bank-transaction";
7447
- function buildKey3({
7491
+ function buildKey4({
7448
7492
  access_token: accessToken,
7449
7493
  apiUrl,
7450
7494
  businessId
@@ -7465,7 +7509,7 @@ function useCategorizeBankTransaction({
7465
7509
  const { businessId } = useLayerContext();
7466
7510
  const { mutate } = useSWRConfig();
7467
7511
  const mutationResponse = useSWRMutation(
7468
- () => buildKey3({
7512
+ () => buildKey4({
7469
7513
  access_token: auth == null ? void 0 : auth.access_token,
7470
7514
  apiUrl: auth == null ? void 0 : auth.apiUrl,
7471
7515
  businessId
@@ -7494,7 +7538,7 @@ function useCategorizeBankTransaction({
7494
7538
  const triggerResult = yield originalTrigger(...triggerParameters);
7495
7539
  void mutate((key) => withSWRKeyTags(
7496
7540
  key,
7497
- (tags) => tags.includes(CATEGORIZE_BANK_TRANSACTION_TAG)
7541
+ (tags) => tags.includes(BANK_ACCOUNTS_TAG_KEY) || tags.includes(EXTERNAL_ACCOUNTS_TAG_KEY)
7498
7542
  ));
7499
7543
  void mutateBankTransactions(void 0, { revalidate: true });
7500
7544
  return triggerResult;
@@ -7519,52 +7563,6 @@ function useCategorizeBankTransaction({
7519
7563
  import { useCallback as useCallback2 } from "react";
7520
7564
  import { useSWRConfig as useSWRConfig2 } from "swr";
7521
7565
  import useSWRMutation2 from "swr/mutation";
7522
-
7523
- // src/hooks/bookkeeping/useBankAccounts.ts
7524
- import useSWR3 from "swr";
7525
- var BANK_ACCOUNTS_TAG_KEY = "#bank-accounts";
7526
- var getBankAccounts = get(
7527
- ({ businessId }) => `/v1/businesses/${businessId}/bank-accounts`
7528
- );
7529
- function buildKey4({
7530
- access_token: accessToken,
7531
- apiUrl,
7532
- businessId
7533
- }) {
7534
- if (accessToken && apiUrl) {
7535
- return {
7536
- accessToken,
7537
- apiUrl,
7538
- businessId,
7539
- tags: [BANK_ACCOUNTS_TAG_KEY]
7540
- };
7541
- }
7542
- }
7543
- var requiresNotification = (bankAccount) => bankAccount.is_disconnected && bankAccount.notify_when_disconnected;
7544
- var useBankAccounts = () => {
7545
- var _a, _b;
7546
- const { businessId } = useLayerContext();
7547
- const { apiUrl } = useEnvironment();
7548
- const { data: auth } = useAuth();
7549
- const { data, error, isLoading } = useSWR3(
7550
- () => buildKey4(__spreadProps(__spreadValues({}, auth), {
7551
- apiUrl,
7552
- businessId
7553
- })),
7554
- ({ accessToken, apiUrl: apiUrl2, businessId: businessId2 }) => getBankAccounts(apiUrl2, accessToken, { params: { businessId: businessId2 } })()
7555
- );
7556
- const disconnectedAccountsRequiringNotification = ((_a = data == null ? void 0 : data.data) != null ? _a : []).filter(
7557
- (account) => requiresNotification(account)
7558
- ).length;
7559
- return {
7560
- bankAccounts: (_b = data == null ? void 0 : data.data) != null ? _b : [],
7561
- isLoading,
7562
- error,
7563
- disconnectedAccountsRequiringNotification
7564
- };
7565
- };
7566
-
7567
- // src/hooks/useBankTransactions/useMatchBankTransaction.ts
7568
7566
  var MATCH_BANK_TRANSACTION_TAG = "#match-bank-transaction";
7569
7567
  function buildKey5({
7570
7568
  access_token: accessToken,
@@ -19101,7 +19099,7 @@ var IntegrationsConnectMenu = () => {
19101
19099
  // src/components/Integrations/Integrations.tsx
19102
19100
  import { jsx as jsx164, jsxs as jsxs104 } from "react/jsx-runtime";
19103
19101
  var COMPONENT_NAME3 = "integrations";
19104
- var Integrations = (props) => {
19102
+ var unstable_Integrations = (props) => {
19105
19103
  return /* @__PURE__ */ jsx164(QuickbooksContextProvider, { children: /* @__PURE__ */ jsx164(IntegrationsComponent, __spreadValues({}, props)) });
19106
19104
  };
19107
19105
  var IntegrationsComponent = ({
@@ -31006,7 +31004,6 @@ export {
31006
31004
  Direction,
31007
31005
  DisplayState,
31008
31006
  GeneralLedgerView,
31009
- Integrations,
31010
31007
  Journal,
31011
31008
  LayerProvider,
31012
31009
  LinkAccounts,
@@ -31020,6 +31017,7 @@ export {
31020
31017
  Reports,
31021
31018
  StatementOfCashFlow,
31022
31019
  Tasks,
31020
+ unstable_Integrations,
31023
31021
  useBankTransactionsContext,
31024
31022
  useDataSync,
31025
31023
  useLayerContext
package/dist/index.d.ts CHANGED
@@ -2724,7 +2724,7 @@ declare module '@layerfi/components/components/Integrations/Integrations' {
2724
2724
  title?: string;
2725
2725
  };
2726
2726
  }
2727
- export const Integrations: (props: IntegrationsProps) => import("react/jsx-runtime").JSX.Element;
2727
+ export const unstable_Integrations: (props: IntegrationsProps) => import("react/jsx-runtime").JSX.Element;
2728
2728
  export const IntegrationsComponent: ({ elevated, stringOverrides, }: IntegrationsProps) => import("react/jsx-runtime").JSX.Element;
2729
2729
 
2730
2730
  }
@@ -6682,7 +6682,7 @@ declare module '@layerfi/components/index' {
6682
6682
  export { Onboarding } from '@layerfi/components/components/Onboarding/index';
6683
6683
  export { LinkedAccounts } from '@layerfi/components/components/LinkedAccounts/index';
6684
6684
  export { BankTransactions } from '@layerfi/components/components/BankTransactions/index';
6685
- export { Integrations } from '@layerfi/components/components/Integrations/Integrations';
6685
+ export { unstable_Integrations } from '@layerfi/components/components/Integrations/Integrations';
6686
6686
  export { Quickbooks } from '@layerfi/components/components/Quickbooks/index';
6687
6687
  export { ProfitAndLoss } from '@layerfi/components/components/ProfitAndLoss/index';
6688
6688
  export { BalanceSheet } from '@layerfi/components/components/BalanceSheet/index';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@layerfi/components",
3
- "version": "0.1.99-alpha.3",
3
+ "version": "0.1.99",
4
4
  "description": "Layer React Components",
5
5
  "main": "dist/cjs/index.cjs",
6
6
  "module": "dist/esm/index.mjs",