@spritz-finance/api-client 0.2.0 → 0.2.2

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.
@@ -21,6 +21,7 @@ declare enum BankAccountSubType {
21
21
  Savings = "Savings"
22
22
  }
23
23
  declare enum BankAccountType {
24
+ CABankAccount = "CABankAccount",
24
25
  USBankAccount = "USBankAccount"
25
26
  }
26
27
  declare enum BillType {
@@ -77,6 +78,16 @@ declare enum PaymentStatus {
77
78
  declare enum VirtualCardType {
78
79
  USVirtualDebitCard = "USVirtualDebitCard"
79
80
  }
81
+ interface BankAccountInput {
82
+ accountNumber: string;
83
+ details?: any | null;
84
+ email?: string | null;
85
+ holder?: string | null;
86
+ name: string;
87
+ ownedByUser?: boolean | null;
88
+ subType: BankAccountSubType;
89
+ type: BankAccountType;
90
+ }
80
91
  interface CreateDirectPaymentInput {
81
92
  accountId: string;
82
93
  amount: number;
@@ -87,14 +98,46 @@ interface CreateDirectPaymentInput {
87
98
  testPayment?: boolean | null;
88
99
  tokenAddress?: string | null;
89
100
  }
90
- interface USBankAccountInput {
101
+
102
+ interface CreateBankAccount_createBankAccount_bankAccountDetails_CanadianBankAccountDetails {
103
+ __typename: 'CanadianBankAccountDetails';
104
+ }
105
+ interface CreateBankAccount_createBankAccount_bankAccountDetails_USBankAccountDetails {
106
+ __typename: 'USBankAccountDetails';
107
+ routingNumber: string;
108
+ }
109
+ type CreateBankAccount_createBankAccount_bankAccountDetails = CreateBankAccount_createBankAccount_bankAccountDetails_CanadianBankAccountDetails | CreateBankAccount_createBankAccount_bankAccountDetails_USBankAccountDetails;
110
+ interface CreateBankAccount_createBankAccount_dataSync {
111
+ __typename: 'AccountDataSync';
112
+ lastSync: any | null;
113
+ syncStatus: AccountSyncStatus | null;
114
+ }
115
+ interface CreateBankAccount_createBankAccount_institution {
116
+ __typename: 'BankAccountInstitution' | 'BillInstitution';
117
+ id: string;
118
+ name: string;
119
+ logo: string | null;
120
+ }
121
+ interface CreateBankAccount_createBankAccount {
122
+ __typename: 'BankAccount';
123
+ id: string;
124
+ name: string | null;
125
+ userId: string;
126
+ country: string;
127
+ currency: string;
128
+ payable: boolean;
129
+ originator: PayableAccountOriginator;
130
+ type: PayableAccountType;
131
+ createdAt: any;
91
132
  accountNumber: string;
92
- email: string;
133
+ bankAccountType: BankAccountType;
134
+ bankAccountSubType: BankAccountSubType;
93
135
  holder: string;
94
- name: string;
95
- ownedByUser?: boolean | null;
96
- routingNumber: string;
97
- subType: BankAccountSubType;
136
+ email: string;
137
+ ownedByUser: boolean;
138
+ bankAccountDetails: CreateBankAccount_createBankAccount_bankAccountDetails;
139
+ dataSync: CreateBankAccount_createBankAccount_dataSync | null;
140
+ institution: CreateBankAccount_createBankAccount_institution | null;
98
141
  }
99
142
 
100
143
  interface AccountPayments_paymentsForAccount {
@@ -102,7 +145,7 @@ interface AccountPayments_paymentsForAccount {
102
145
  id: string;
103
146
  userId: any;
104
147
  status: PaymentStatus;
105
- accountId: any | null;
148
+ accountId: any;
106
149
  amount: number | null;
107
150
  feeAmount: number | null;
108
151
  createdAt: any;
@@ -357,7 +400,6 @@ interface PayableAccountInstitutionFragment {
357
400
  id: string;
358
401
  country: string;
359
402
  currency: string;
360
- createdAt: any;
361
403
  name: string;
362
404
  logo: string | null;
363
405
  }
@@ -367,7 +409,7 @@ interface PaymentFragment {
367
409
  id: string;
368
410
  userId: any;
369
411
  status: PaymentStatus;
370
- accountId: any | null;
412
+ accountId: any;
371
413
  amount: number | null;
372
414
  feeAmount: number | null;
373
415
  createdAt: any;
@@ -391,7 +433,7 @@ interface PaymentRequestPayment_paymentForPaymentRequest {
391
433
  id: string;
392
434
  userId: any;
393
435
  status: PaymentStatus;
394
- accountId: any | null;
436
+ accountId: any;
395
437
  amount: number | null;
396
438
  feeAmount: number | null;
397
439
  createdAt: any;
@@ -408,7 +450,6 @@ interface PopularBillInstitutions_popularUSBillInstitutions {
408
450
  id: string;
409
451
  country: string;
410
452
  currency: string;
411
- createdAt: any;
412
453
  name: string;
413
454
  logo: string | null;
414
455
  }
@@ -424,7 +465,6 @@ interface SearchUSBillInstitutions_searchUSBillInstitutions {
424
465
  id: string;
425
466
  country: string;
426
467
  currency: string;
427
- createdAt: any;
428
468
  name: string;
429
469
  logo: string | null;
430
470
  }
@@ -811,53 +851,6 @@ interface WalletTokenBalancesVariables {
811
851
  network?: string | null;
812
852
  }
813
853
 
814
- interface CreateUSBankAccount_createUSBankAccount_bankAccountDetails_CanadianBankAccountDetails {
815
- __typename: 'CanadianBankAccountDetails';
816
- }
817
- interface CreateUSBankAccount_createUSBankAccount_bankAccountDetails_USBankAccountDetails {
818
- __typename: 'USBankAccountDetails';
819
- routingNumber: string;
820
- }
821
- type CreateUSBankAccount_createUSBankAccount_bankAccountDetails = CreateUSBankAccount_createUSBankAccount_bankAccountDetails_CanadianBankAccountDetails | CreateUSBankAccount_createUSBankAccount_bankAccountDetails_USBankAccountDetails;
822
- interface CreateUSBankAccount_createUSBankAccount_dataSync {
823
- __typename: 'AccountDataSync';
824
- lastSync: any | null;
825
- syncStatus: AccountSyncStatus | null;
826
- }
827
- interface CreateUSBankAccount_createUSBankAccount_institution {
828
- __typename: 'BankAccountInstitution' | 'BillInstitution';
829
- id: string;
830
- name: string;
831
- logo: string | null;
832
- }
833
- interface CreateUSBankAccount_createUSBankAccount {
834
- __typename: 'BankAccount';
835
- id: string;
836
- name: string | null;
837
- userId: string;
838
- country: string;
839
- currency: string;
840
- payable: boolean;
841
- originator: PayableAccountOriginator;
842
- type: PayableAccountType;
843
- createdAt: any;
844
- accountNumber: string;
845
- bankAccountType: BankAccountType;
846
- bankAccountSubType: BankAccountSubType;
847
- holder: string;
848
- email: string;
849
- ownedByUser: boolean;
850
- bankAccountDetails: CreateUSBankAccount_createUSBankAccount_bankAccountDetails;
851
- dataSync: CreateUSBankAccount_createUSBankAccount_dataSync | null;
852
- institution: CreateUSBankAccount_createUSBankAccount_institution | null;
853
- }
854
- interface CreateUSBankAccount {
855
- createUSBankAccount: CreateUSBankAccount_createUSBankAccount;
856
- }
857
- interface CreateUSBankAccountVariables {
858
- createUSAccountInput: USBankAccountInput;
859
- }
860
-
861
854
  interface DeletePayableAccount_deletePayableAccount_BankAccount_dataSync {
862
855
  __typename: 'AccountDataSync';
863
856
  lastSync: any | null;
@@ -1034,15 +1027,17 @@ declare class SpritzClient {
1034
1027
  private makeStatusError;
1035
1028
  }
1036
1029
 
1037
- type CreateInputMapping$1 = {
1038
- [BankAccountType.USBankAccount]: USBankAccountInput;
1030
+ type BaseBankAccountInput = Omit<BankAccountInput, 'details' | 'type'>;
1031
+ type UsBankAccountInput = BaseBankAccountInput & {
1032
+ routingNumber: string;
1039
1033
  };
1040
- type CreateMutationMapping$1 = {
1041
- [BankAccountType.USBankAccount]: {
1042
- query: CreateUSBankAccount;
1043
- variables: CreateUSBankAccountVariables;
1044
- response: keyof CreateUSBankAccount;
1045
- };
1034
+ type CaBankAccountInput = BaseBankAccountInput & {
1035
+ transitNumber: string;
1036
+ institutionNumber: string;
1037
+ };
1038
+ type CreateInputMapping$1 = {
1039
+ [BankAccountType.USBankAccount]: UsBankAccountInput;
1040
+ [BankAccountType.CABankAccount]: CaBankAccountInput;
1046
1041
  };
1047
1042
  declare class BankAccountService {
1048
1043
  private client;
@@ -1050,7 +1045,7 @@ declare class BankAccountService {
1050
1045
  list(): Promise<UserBankAccounts_bankAccounts[]>;
1051
1046
  rename(accountId: string, name: string): Promise<RenameBankAccount_renamePayableAccount_BankAccount>;
1052
1047
  delete(accountId: string): Promise<DeletePayableAccount_deletePayableAccount_BankAccount>;
1053
- create<T extends BankAccountType>(type: T, input: CreateInputMapping$1[T]): Promise<NonNullable<CreateMutationMapping$1[T]["query"][keyof CreateMutationMapping$1[T]["query"]]> | null>;
1048
+ create<T extends BankAccountType>(type: T, input: CreateInputMapping$1[T]): Promise<CreateBankAccount_createBankAccount>;
1054
1049
  }
1055
1050
 
1056
1051
  interface CreateUSBill_addUSBill_billAccountDetails {
@@ -1225,7 +1220,7 @@ declare class VirtualCardService {
1225
1220
  private client;
1226
1221
  constructor(client: SpritzClient);
1227
1222
  fetch(): Promise<UserVirtualDebitCard_virtualDebitCard | null>;
1228
- create<T extends VirtualCardType>(type: T, input: CreateInputMapping[T]): Promise<NonNullable<CreateMutationMapping[T]["query"][keyof CreateMutationMapping[T]["query"]]> | null>;
1223
+ create<T extends VirtualCardType>(type: T, input?: CreateInputMapping[T]): Promise<NonNullable<CreateMutationMapping[T]["query"][keyof CreateMutationMapping[T]["query"]]> | null>;
1229
1224
  }
1230
1225
 
1231
1226
  declare const EVENTS: readonly ["account.created", "account.updated", "account.deleted", "payment.created", "payment.updated", "payment.completed", "payment.refunded"];
@@ -1291,4 +1286,4 @@ declare class SpritzApiClient {
1291
1286
  setApiKey(_apiKey: string): this;
1292
1287
  }
1293
1288
 
1294
- export { AccountPayments, AccountPaymentsVariables, AccountPayments_paymentsForAccount, BankAccountFragment, BankAccountFragment_bankAccountDetails, BankAccountFragment_bankAccountDetails_CanadianBankAccountDetails, BankAccountFragment_bankAccountDetails_USBankAccountDetails, BankAccountFragment_institution, BankAccountSubType, BankAccountType, BillFragment, BillFragment_billAccountDetails, BillFragment_dataSync, BillFragment_institution, BillType, CreateDirectPaymentInput, CreatePaymentRequestInput, CurrentUser, CurrentUser_me, Environment, GetSpritzPayParams, GetSpritzPayParamsVariables, GetSpritzPayParams_spritzPayParams, PayableAccountFragment, PayableAccountFragment_BankAccount, PayableAccountFragment_BankAccount_bankAccountDetails, PayableAccountFragment_BankAccount_bankAccountDetails_CanadianBankAccountDetails, PayableAccountFragment_BankAccount_bankAccountDetails_USBankAccountDetails, PayableAccountFragment_BankAccount_dataSync, PayableAccountFragment_BankAccount_institution, PayableAccountFragment_Bill, PayableAccountFragment_Bill_billAccountDetails, PayableAccountFragment_Bill_dataSync, PayableAccountFragment_Bill_institution, PayableAccountFragment_VirtualCard, PayableAccountFragment_VirtualCard_billingInfo, PayableAccountFragment_VirtualCard_billingInfo_address, PayableAccountFragment_VirtualCard_dataSync, PayableAccountFragment_VirtualCard_institution, PayableAccountInstitutionFragment, PayableAccountType, PaymentFragment, PaymentNetwork, PaymentRequestFragment, PaymentRequestPayment, PaymentRequestPaymentVariables, PaymentRequestPayment_paymentForPaymentRequest, DirectPaymentStatus as PaymentRequestStatus, PaymentStatus, PopularBillInstitutions, PopularBillInstitutionsVariables, PopularBillInstitutions_popularUSBillInstitutions, SearchUSBillInstitutions, SearchUSBillInstitutionsVariables, SearchUSBillInstitutions_searchUSBillInstitutions, SpritzApiClient, TokenBalanceFragment, TransactionPrice, TransactionPriceVariables, USBankAccountInput, UserBankAccounts, UserBankAccounts_bankAccounts, UserBankAccounts_bankAccounts_bankAccountDetails, UserBankAccounts_bankAccounts_bankAccountDetails_CanadianBankAccountDetails, UserBankAccounts_bankAccounts_bankAccountDetails_USBankAccountDetails, UserBankAccounts_bankAccounts_institution, UserBills, UserBills_bills, UserBills_bills_billAccountDetails, UserBills_bills_dataSync, UserBills_bills_institution, UserFragment, UserPayableAccounts, UserPayableAccounts_payableAccounts, UserPayableAccounts_payableAccounts_BankAccount, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails_CanadianBankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails_USBankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_dataSync, UserPayableAccounts_payableAccounts_BankAccount_institution, UserPayableAccounts_payableAccounts_Bill, UserPayableAccounts_payableAccounts_Bill_billAccountDetails, UserPayableAccounts_payableAccounts_Bill_dataSync, UserPayableAccounts_payableAccounts_Bill_institution, UserPayableAccounts_payableAccounts_VirtualCard, UserPayableAccounts_payableAccounts_VirtualCard_billingInfo, UserPayableAccounts_payableAccounts_VirtualCard_billingInfo_address, UserPayableAccounts_payableAccounts_VirtualCard_dataSync, UserPayableAccounts_payableAccounts_VirtualCard_institution, UserVerification, UserVerification_verification, UserVerification_verification_identity, UserVerification_verification_identity_user, UserVirtualDebitCard, UserVirtualDebitCard_virtualDebitCard, UserVirtualDebitCard_virtualDebitCard_billingInfo, UserVirtualDebitCard_virtualDebitCard_billingInfo_address, VirtualCardType, VirtualDebitCardFragment, VirtualDebitCardFragment_billingInfo, VirtualDebitCardFragment_billingInfo_address, WalletTokenBalances, WalletTokenBalancesVariables, WalletTokenBalances_tokenBalances };
1289
+ export { AccountPayments, AccountPaymentsVariables, AccountPayments_paymentsForAccount, BankAccountFragment, BankAccountFragment_bankAccountDetails, BankAccountFragment_bankAccountDetails_CanadianBankAccountDetails, BankAccountFragment_bankAccountDetails_USBankAccountDetails, BankAccountFragment_institution, BankAccountInput, BankAccountSubType, BankAccountType, BillFragment, BillFragment_billAccountDetails, BillFragment_dataSync, BillFragment_institution, BillType, CreateDirectPaymentInput, CreatePaymentRequestInput, CurrentUser, CurrentUser_me, Environment, GetSpritzPayParams, GetSpritzPayParamsVariables, GetSpritzPayParams_spritzPayParams, PayableAccountFragment, PayableAccountFragment_BankAccount, PayableAccountFragment_BankAccount_bankAccountDetails, PayableAccountFragment_BankAccount_bankAccountDetails_CanadianBankAccountDetails, PayableAccountFragment_BankAccount_bankAccountDetails_USBankAccountDetails, PayableAccountFragment_BankAccount_dataSync, PayableAccountFragment_BankAccount_institution, PayableAccountFragment_Bill, PayableAccountFragment_Bill_billAccountDetails, PayableAccountFragment_Bill_dataSync, PayableAccountFragment_Bill_institution, PayableAccountFragment_VirtualCard, PayableAccountFragment_VirtualCard_billingInfo, PayableAccountFragment_VirtualCard_billingInfo_address, PayableAccountFragment_VirtualCard_dataSync, PayableAccountFragment_VirtualCard_institution, PayableAccountInstitutionFragment, PayableAccountType, PaymentFragment, PaymentNetwork, PaymentRequestFragment, PaymentRequestPayment, PaymentRequestPaymentVariables, PaymentRequestPayment_paymentForPaymentRequest, DirectPaymentStatus as PaymentRequestStatus, PaymentStatus, PopularBillInstitutions, PopularBillInstitutionsVariables, PopularBillInstitutions_popularUSBillInstitutions, SearchUSBillInstitutions, SearchUSBillInstitutionsVariables, SearchUSBillInstitutions_searchUSBillInstitutions, SpritzApiClient, TokenBalanceFragment, TransactionPrice, TransactionPriceVariables, UserBankAccounts, UserBankAccounts_bankAccounts, UserBankAccounts_bankAccounts_bankAccountDetails, UserBankAccounts_bankAccounts_bankAccountDetails_CanadianBankAccountDetails, UserBankAccounts_bankAccounts_bankAccountDetails_USBankAccountDetails, UserBankAccounts_bankAccounts_institution, UserBills, UserBills_bills, UserBills_bills_billAccountDetails, UserBills_bills_dataSync, UserBills_bills_institution, UserFragment, UserPayableAccounts, UserPayableAccounts_payableAccounts, UserPayableAccounts_payableAccounts_BankAccount, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails_CanadianBankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_bankAccountDetails_USBankAccountDetails, UserPayableAccounts_payableAccounts_BankAccount_dataSync, UserPayableAccounts_payableAccounts_BankAccount_institution, UserPayableAccounts_payableAccounts_Bill, UserPayableAccounts_payableAccounts_Bill_billAccountDetails, UserPayableAccounts_payableAccounts_Bill_dataSync, UserPayableAccounts_payableAccounts_Bill_institution, UserPayableAccounts_payableAccounts_VirtualCard, UserPayableAccounts_payableAccounts_VirtualCard_billingInfo, UserPayableAccounts_payableAccounts_VirtualCard_billingInfo_address, UserPayableAccounts_payableAccounts_VirtualCard_dataSync, UserPayableAccounts_payableAccounts_VirtualCard_institution, UserVerification, UserVerification_verification, UserVerification_verification_identity, UserVerification_verification_identity_user, UserVirtualDebitCard, UserVirtualDebitCard_virtualDebitCard, UserVirtualDebitCard_virtualDebitCard_billingInfo, UserVirtualDebitCard_virtualDebitCard_billingInfo_address, VirtualCardType, VirtualDebitCardFragment, VirtualDebitCardFragment_billingInfo, VirtualDebitCardFragment_billingInfo_address, WalletTokenBalances, WalletTokenBalancesVariables, WalletTokenBalances_tokenBalances };