@layerfi/components 0.1.67 → 0.1.68

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/index.d.ts CHANGED
@@ -51,7 +51,8 @@ declare module '@layerfi/components/api/layer/balance_sheet' {
51
51
  }
52
52
  declare module '@layerfi/components/api/layer/bankTransactions' {
53
53
  import { CategoryUpdate, BankTransaction, Metadata } from '@layerfi/components/types';
54
- import { BankTransactionMatch, BankTransactionMatchType, BankTransactionMetadata, DocumentS3Urls, FileMetadata } from '@layerfi/components/types/bank_transactions';
54
+ import { BankTransactionMatch, BankTransactionMatchType, BankTransactionMetadata, DocumentS3Urls } from '@layerfi/components/types/bank_transactions';
55
+ import { FileMetadata } from '@layerfi/components/types/file_upload';
55
56
  import { S3PresignedUrl } from '@layerfi/components/types/general';
56
57
  export type GetBankTransactionsReturn = {
57
58
  data?: BankTransaction[];
@@ -124,6 +125,19 @@ declare module '@layerfi/components/api/layer/bankTransactions' {
124
125
  data: DocumentS3Urls;
125
126
  errors: unknown;
126
127
  }>;
128
+ export const getBankTransactionDocument: (baseUrl: string, accessToken: string | undefined, options?: {
129
+ params?: Record<string, string | undefined> | undefined;
130
+ } | undefined) => () => Promise<{
131
+ data: S3PresignedUrl;
132
+ errors: unknown;
133
+ }>;
134
+ export const archiveBankTransactionDocument: (baseUrl: string, accessToken: string | undefined, options?: {
135
+ params?: Record<string, string | undefined> | undefined;
136
+ body?: Record<string, unknown> | undefined;
137
+ } | undefined) => Promise<{
138
+ data: {};
139
+ errors: unknown;
140
+ }>;
127
141
  export const uploadBankTransactionDocument: (baseUrl: string, accessToken: string) => ({ businessId, bankTransactionId, file, documentType, }: {
128
142
  businessId: string;
129
143
  bankTransactionId: string;
@@ -406,6 +420,7 @@ declare module '@layerfi/components/api/layer/statement-of-cash-flow' {
406
420
 
407
421
  }
408
422
  declare module '@layerfi/components/api/layer/tasks' {
423
+ import { FileMetadata } from '@layerfi/components/types/file_upload';
409
424
  import { TaskTypes } from '@layerfi/components/types/tasks';
410
425
  export const getTasks: (baseUrl: string, accessToken: string | undefined, options?: {
411
426
  params?: Record<string, string | undefined> | undefined;
@@ -424,6 +439,14 @@ declare module '@layerfi/components/api/layer/tasks' {
424
439
  } | undefined) => Promise<{
425
440
  data: TaskTypes;
426
441
  }>;
442
+ export const completeTaskWithUpload: (baseUrl: string, accessToken: string) => ({ businessId, taskId, file, }: {
443
+ businessId: string;
444
+ taskId: string;
445
+ file: File;
446
+ }) => Promise<{
447
+ data: FileMetadata;
448
+ errors: unknown;
449
+ }>;
427
450
 
428
451
  }
429
452
  declare module '@layerfi/components/api/layer' {
@@ -492,6 +515,19 @@ declare module '@layerfi/components/api/layer' {
492
515
  data: import("@layerfi/components/types/bank_transactions").DocumentS3Urls;
493
516
  errors: unknown;
494
517
  }>;
518
+ getBankTransactionDocument: (baseUrl: string, accessToken: string | undefined, options?: {
519
+ params?: Record<string, string | undefined> | undefined;
520
+ } | undefined) => () => Promise<{
521
+ data: import("@layerfi/components/types/general").S3PresignedUrl;
522
+ errors: unknown;
523
+ }>;
524
+ archiveBankTransactionDocument: (baseUrl: string, accessToken: string | undefined, options?: {
525
+ params?: Record<string, string | undefined> | undefined;
526
+ body?: Record<string, unknown> | undefined;
527
+ } | undefined) => Promise<{
528
+ data: {};
529
+ errors: unknown;
530
+ }>;
495
531
  updateBankTransactionMetadata: (baseUrl: string, accessToken: string | undefined, options?: {
496
532
  params?: Record<string, string | undefined> | undefined;
497
533
  body?: {
@@ -507,7 +543,7 @@ declare module '@layerfi/components/api/layer' {
507
543
  file: File;
508
544
  documentType: string;
509
545
  }) => Promise<{
510
- data: import("@layerfi/components/types/bank_transactions").FileMetadata;
546
+ data: import("@layerfi/components/types/file_upload").FileMetadata;
511
547
  errors: unknown;
512
548
  }>;
513
549
  getCategories: (baseUrl: string, accessToken: string | undefined, options?: {
@@ -649,6 +685,14 @@ declare module '@layerfi/components/api/layer' {
649
685
  } | undefined) => () => Promise<{
650
686
  data: import("@layerfi/components/types/tasks").TaskTypes[];
651
687
  }>;
688
+ completeTaskWithUpload: (baseUrl: string, accessToken: string) => ({ businessId, taskId, file, }: {
689
+ businessId: string;
690
+ taskId: string;
691
+ file: File;
692
+ }) => Promise<{
693
+ data: import("@layerfi/components/types/file_upload").FileMetadata;
694
+ errors: unknown;
695
+ }>;
652
696
  submitResponseToTask: (baseUrl: string, accessToken: string | undefined, options?: {
653
697
  params?: Record<string, string | undefined> | undefined;
654
698
  body?: Record<string, unknown> | undefined;
@@ -1249,7 +1293,7 @@ declare module '@layerfi/components/components/BankTransactions/utils' {
1249
1293
  }
1250
1294
  declare module '@layerfi/components/components/BankTransactionsLoader/BankTransactionsLoader' {
1251
1295
  import React from 'react';
1252
- export const BankTransactionsLoader: ({ isLoading, showTooltips }: {
1296
+ export const BankTransactionsLoader: ({ isLoading, showTooltips, }: {
1253
1297
  isLoading: boolean;
1254
1298
  showTooltips: boolean;
1255
1299
  }) => React.JSX.Element;
@@ -1379,8 +1423,13 @@ declare module '@layerfi/components/components/Button/IconButton' {
1379
1423
  icon: ReactNode;
1380
1424
  active?: boolean;
1381
1425
  withBorder?: boolean;
1426
+ href?: HTMLAnchorElement['href'];
1427
+ target?: HTMLAnchorElement['target'];
1428
+ rel?: HTMLAnchorElement['rel'];
1429
+ download?: HTMLAnchorElement['download'];
1430
+ onClick?: (e: React.MouseEvent<HTMLAnchorElement | HTMLButtonElement, MouseEvent>) => void;
1382
1431
  }
1383
- export const IconButton: ({ className, children, icon, active, withBorder, ...props }: IconButtonProps) => React.JSX.Element;
1432
+ export const IconButton: ({ className, children, icon, active, withBorder, href, target, rel, download, ...props }: IconButtonProps) => React.JSX.Element;
1384
1433
 
1385
1434
  }
1386
1435
  declare module '@layerfi/components/components/Button/Link' {
@@ -1901,6 +1950,15 @@ declare module '@layerfi/components/components/ExpandedBankTransactionRow/Expand
1901
1950
  export type SaveHandle = {
1902
1951
  save: () => void;
1903
1952
  };
1953
+ export interface DocumentWithStatus {
1954
+ id?: string;
1955
+ url?: string;
1956
+ status: 'pending' | 'uploaded' | 'failed' | 'deleting';
1957
+ type?: string;
1958
+ name?: string;
1959
+ date?: string;
1960
+ error?: string;
1961
+ }
1904
1962
  export const ExpandedBankTransactionRow: React.ForwardRefExoticComponent<Props & React.RefAttributes<SaveHandle>>;
1905
1963
  export {};
1906
1964
 
@@ -1908,6 +1966,28 @@ declare module '@layerfi/components/components/ExpandedBankTransactionRow/Expand
1908
1966
  declare module '@layerfi/components/components/ExpandedBankTransactionRow/index' {
1909
1967
  export { ExpandedBankTransactionRow } from '@layerfi/components/components/ExpandedBankTransactionRow/ExpandedBankTransactionRow';
1910
1968
 
1969
+ }
1970
+ declare module '@layerfi/components/components/FileThumb/FileThumb' {
1971
+ import React from 'react';
1972
+ export interface FileThumbProps {
1973
+ url?: string;
1974
+ type?: string;
1975
+ uploadPending?: boolean;
1976
+ deletePending?: boolean;
1977
+ name?: string;
1978
+ date?: string;
1979
+ onDelete?: () => void;
1980
+ enableOpen?: boolean;
1981
+ onOpen?: (e: React.MouseEvent<HTMLAnchorElement, MouseEvent>) => void;
1982
+ enableDownload?: boolean;
1983
+ error?: string;
1984
+ }
1985
+ export const FileThumb: ({ url, type, uploadPending, deletePending, name, date, onDelete, enableOpen, onOpen, enableDownload, error, }: FileThumbProps) => React.JSX.Element;
1986
+
1987
+ }
1988
+ declare module '@layerfi/components/components/FileThumb/index' {
1989
+ export { FileThumb } from '@layerfi/components/components/FileThumb/FileThumb';
1990
+
1911
1991
  }
1912
1992
  declare module '@layerfi/components/components/GlobalWidgets/GlobalWidgets' {
1913
1993
  import React from 'react';
@@ -1993,8 +2073,10 @@ declare module '@layerfi/components/components/Input/FileInput' {
1993
2073
  export interface FileInputProps {
1994
2074
  text?: string;
1995
2075
  onUpload?: (file: File) => void;
2076
+ disabled?: boolean;
2077
+ secondary?: boolean;
1996
2078
  }
1997
- export const FileInput: ({ text, onUpload }: FileInputProps) => React.JSX.Element;
2079
+ export const FileInput: ({ text, onUpload, disabled, secondary, }: FileInputProps) => React.JSX.Element;
1998
2080
 
1999
2081
  }
2000
2082
  declare module '@layerfi/components/components/Input/Input' {
@@ -3120,6 +3202,7 @@ declare module '@layerfi/components/components/Tasks/Tasks' {
3120
3202
  error?: unknown;
3121
3203
  refetch: () => void;
3122
3204
  submitResponseToTask: (taskId: string, userResponse: string) => void;
3205
+ uploadDocumentForTask: (taskId: string, file: File) => void;
3123
3206
  }>;
3124
3207
  export const useTasksContext: () => {
3125
3208
  data?: import("@layerfi/components/types/tasks").TaskTypes[] | undefined;
@@ -3129,6 +3212,7 @@ declare module '@layerfi/components/components/Tasks/Tasks' {
3129
3212
  error?: unknown;
3130
3213
  refetch: () => void;
3131
3214
  submitResponseToTask: (taskId: string, userResponse: string) => void;
3215
+ uploadDocumentForTask: (taskId: string, file: File) => void;
3132
3216
  };
3133
3217
  export interface TasksStringOverrides {
3134
3218
  header?: string;
@@ -3885,6 +3969,7 @@ declare module '@layerfi/components/contexts/TasksContext/TasksContext' {
3885
3969
  error?: unknown;
3886
3970
  refetch: () => void;
3887
3971
  submitResponseToTask: (taskId: string, userResponse: string) => void;
3972
+ uploadDocumentForTask: (taskId: string, file: File) => void;
3888
3973
  }>;
3889
3974
 
3890
3975
  }
@@ -4389,6 +4474,11 @@ declare module '@layerfi/components/hooks/useTableExpandRow/useTableExpandRow' {
4389
4474
  declare module '@layerfi/components/hooks/useTasks/index' {
4390
4475
  export { useTasks } from '@layerfi/components/hooks/useTasks/useTasks';
4391
4476
 
4477
+ }
4478
+ declare module '@layerfi/components/hooks/useTasks/mockData' {
4479
+ import { TaskTypes } from '@layerfi/components/types/tasks';
4480
+ export const mockData: TaskTypes[];
4481
+
4392
4482
  }
4393
4483
  declare module '@layerfi/components/hooks/useTasks/useTasks' {
4394
4484
  import { LoadedStatus } from '@layerfi/components/types/general';
@@ -4401,6 +4491,7 @@ declare module '@layerfi/components/hooks/useTasks/useTasks' {
4401
4491
  error?: unknown;
4402
4492
  refetch: () => void;
4403
4493
  submitResponseToTask: (taskId: string, userResponse: string) => void;
4494
+ uploadDocumentForTask: (taskId: string, file: File) => void;
4404
4495
  };
4405
4496
  export const useTasks: UseTasks;
4406
4497
  export {};
@@ -4548,6 +4639,20 @@ declare module '@layerfi/components/icons/Expand' {
4548
4639
  const Expand: ({ ...props }: IconSvgProps) => React.JSX.Element;
4549
4640
  export default Expand;
4550
4641
 
4642
+ }
4643
+ declare module '@layerfi/components/icons/Eye' {
4644
+ import * as React from 'react';
4645
+ import { IconSvgProps } from '@layerfi/components/icons/types';
4646
+ const Eye: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
4647
+ export default Eye;
4648
+
4649
+ }
4650
+ declare module '@layerfi/components/icons/File' {
4651
+ import * as React from 'react';
4652
+ import { IconSvgProps } from '@layerfi/components/icons/types';
4653
+ const File: ({ size, ...props }: IconSvgProps) => React.JSX.Element;
4654
+ export default File;
4655
+
4551
4656
  }
4552
4657
  declare module '@layerfi/components/icons/Folder' {
4553
4658
  import * as React from 'react';
@@ -4927,6 +5032,8 @@ declare module '@layerfi/components/types/bank_transactions' {
4927
5032
  processing?: boolean;
4928
5033
  suggested_matches?: SuggestedMatch[];
4929
5034
  match?: BankTransactionMatch;
5035
+ document_ids: String[];
5036
+ metadata: BankTransactionMetadata;
4930
5037
  }
4931
5038
  export interface SuggestedMatch {
4932
5039
  id: string;
@@ -4958,13 +5065,6 @@ declare module '@layerfi/components/types/bank_transactions' {
4958
5065
  type: 'Document_S3_Urls';
4959
5066
  documentUrls: S3PresignedUrl[];
4960
5067
  }
4961
- export interface FileMetadata {
4962
- type: 'File_Metadata';
4963
- id: string | null;
4964
- fileType: string;
4965
- fileName: string;
4966
- documentType: string;
4967
- }
4968
5068
 
4969
5069
  }
4970
5070
  declare module '@layerfi/components/types/business' {
@@ -5129,6 +5229,17 @@ declare module '@layerfi/components/types/chart_of_accounts' {
5129
5229
  account_subtype?: string;
5130
5230
  };
5131
5231
 
5232
+ }
5233
+ declare module '@layerfi/components/types/file_upload' {
5234
+ export interface FileMetadata {
5235
+ type: 'File_Metadata';
5236
+ id: string | null;
5237
+ fileType: string;
5238
+ fileName: string;
5239
+ documentType: DocumentType;
5240
+ }
5241
+ export type DocumentType = 'RECEIPT' | 'BANK_STATEMENT' | 'LOAN_STATEMENT' | 'PAYROLL_STATEMENT' | 'PAYOUT_STATEMENT' | 'OTHER';
5242
+
5132
5243
  }
5133
5244
  declare module '@layerfi/components/types/general' {
5134
5245
  export type SortDirection = 'asc' | 'desc';
@@ -5141,6 +5252,8 @@ declare module '@layerfi/components/types/general' {
5141
5252
  type: 'S3_Presigned_Url';
5142
5253
  presignedUrl: string;
5143
5254
  fileType: string;
5255
+ fileName: string;
5256
+ createdAt: string;
5144
5257
  }
5145
5258
  export type LoadedStatus = 'initial' | 'loading' | 'complete';
5146
5259
  export enum DataModel {
@@ -5173,7 +5286,7 @@ declare module '@layerfi/components/types/journal' {
5173
5286
  entry_at: string;
5174
5287
  reversal_of_id: string | null;
5175
5288
  reversal_id: string | null;
5176
- line_items: JournalEntryLineItem[];
5289
+ line_items: JournalEntryLine[];
5177
5290
  source?: LedgerEntrySource;
5178
5291
  }
5179
5292
  export interface JournalEntryLine {
@@ -5434,9 +5547,16 @@ declare module '@layerfi/components/types/ledger_accounts' {
5434
5547
  invoice_number: string;
5435
5548
  amount: number;
5436
5549
  }
5550
+ export interface RefundLedgerEntrySource extends LedgerEntrySource {
5551
+ external_id: string;
5552
+ refund_id: string;
5553
+ refunded_to_customer_amount: number;
5554
+ recipient_name: string;
5555
+ }
5437
5556
  export interface RefundPaymentLedgerEntrySource extends LedgerEntrySource {
5438
5557
  external_id: string;
5439
5558
  refund_id: string;
5559
+ refund_payment_id: string;
5440
5560
  refunded_to_customer_amount: number;
5441
5561
  recipient_name: string;
5442
5562
  }
@@ -5659,6 +5779,7 @@ declare module '@layerfi/components/types/table' {
5659
5779
 
5660
5780
  }
5661
5781
  declare module '@layerfi/components/types/tasks' {
5782
+ import { DocumentType } from '@layerfi/components/types/file_upload';
5662
5783
  export interface TaskTypes {
5663
5784
  id: string;
5664
5785
  question: string;
@@ -5666,16 +5787,17 @@ declare module '@layerfi/components/types/tasks' {
5666
5787
  title: string;
5667
5788
  transaction_id: string | null;
5668
5789
  type: string;
5669
- user_marked_completed_at: string;
5670
- user_response: string;
5790
+ user_marked_completed_at: string | null;
5791
+ user_response: string | null;
5671
5792
  user_response_type: TasksResponseType;
5672
5793
  archived_at: string | null;
5673
- completed_at: string;
5794
+ completed_at: string | null;
5674
5795
  created_at: string;
5675
5796
  updated_at: string;
5797
+ document_type: DocumentType;
5676
5798
  }
5677
5799
  export type TasksStatusType = 'COMPLETED' | 'TODO' | 'USER_MARKED_COMPLETED';
5678
- export type TasksResponseType = 'FREE_RESPONSE';
5800
+ export type TasksResponseType = 'FREE_RESPONSE' | 'UPLOAD_DOCUMENT';
5679
5801
  export function isComplete(taskType: TasksStatusType): boolean;
5680
5802
 
5681
5803
  }