Skip to content

Commit

Permalink
Allow for optional user ID parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
gilberthl-mh committed Jun 12, 2023
1 parent 7e9e9f3 commit d6034ce
Show file tree
Hide file tree
Showing 11 changed files with 35 additions and 35 deletions.
4 changes: 2 additions & 2 deletions src/requests/beneficiaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ export default ({config, request}: RequestsParams): BeneficiariesRequests => {
scope,
}: {
id: string
userId: string
userId?: string
scope: string
}, options?: ExtraOptions): Promise<any> =>
request(`${resourceServerUrl}/beneficiaries/${id}`, {
Expand All @@ -27,7 +27,7 @@ export default ({config, request}: RequestsParams): BeneficiariesRequests => {
scope,
}: {
params: SearchParams
userId: string
userId?: string
scope: string
}, options?: ExtraOptions): Promise<any> =>
request(`${resourceServerUrl}/beneficiaries`, {
Expand Down
28 changes: 14 additions & 14 deletions src/requests/types/accounts.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,69 +7,69 @@ import type {RecurringTransactionEstimate} from "../../schema/transaction"
import type {StandingOrder, StandingOrderWithDetail} from "../../schema/standing-order"

export interface AccountsRequests {
getAccounts: ({userId, params}: { userId: string, params?: SearchParams }, options?: ExtraOptions) => Promise<ApiResponse<Account[]>>
getAccounts: ({userId, params}: { userId?: string, params?: SearchParams }, options?: ExtraOptions) => Promise<ApiResponse<Account[]>>
getAccountsWithDetails: ({
userId,
}: {
userId: string
userId?: string
params?: SearchParams
}, options?: ExtraOptions) => Promise<ApiResponse<AccountWithDetails[]>>
getAccountsList: ({userId, params}: { userId: string, params?: SearchParams }, options?: ExtraOptions) => Promise<ApiResponse<Account[]>>
getAccountsList: ({userId, params}: { userId?: string, params?: SearchParams }, options?: ExtraOptions) => Promise<ApiResponse<Account[]>>
getAccountsListWithDetails: ({
userId,
}: {
userId: string
userId?: string
params?: SearchParams
}, options?: ExtraOptions) => Promise<ApiResponse<AccountWithDetails[]>>
getAccount: ({userId, accountId}: { userId: string, accountId: string }, options?: ExtraOptions) => Promise<ApiResponse<Account>>
getAccount: ({userId, accountId}: { userId?: string, accountId: string }, options?: ExtraOptions) => Promise<ApiResponse<Account>>
getAccountBalances: ({
userId,
accountId,
}: {
userId: string
userId?: string
accountId: string
}, options?: ExtraOptions) => Promise<ApiResponse<Balance[]>>
getAccountWithDetails: ({
userId,
accountId,
}: {
userId: string
userId?: string
accountId: string
}, options?: ExtraOptions) => Promise<ApiResponse<AccountWithDetails>>
getAccountHoldings: ({
userId,
accountId,
}: {
userId: string
userId?: string
accountId: string
}, options?: ExtraOptions) => Promise<ApiResponse<HoldingsValuation[]>>
getAccountHoldingsWithMatches: ({
userId,
accountId,
}: {
userId: string
userId?: string
accountId: string
}, options?: ExtraOptions) => Promise<ApiResponse<HoldingWithMatches[]>>
getAccountCounterparties: ({
userId,
accountId,
}: {
userId: string
userId?: string
accountId: string
params?: SearchParams
}, options?: ExtraOptions) => Promise<ApiResponse<Counterparty[]>>
getAccountRecurringTransactions: ({
userId,
accountId,
}: {
userId: string
userId?: string
accountId: string
}, options?: ExtraOptions) => Promise<ApiResponse<RecurringTransactionEstimate[]>>
getAccountStandingOrders: ({
userId,
accountId,
}: {
userId: string
userId?: string
accountId: string
}, options?: ExtraOptions) => Promise<ApiResponse<StandingOrder[]>>
createAccount: ({userId, account}: { userId: string, account: AccountPost }, options?: ExtraOptions) => Promise<ApiResponse<Account>>
Expand All @@ -79,15 +79,15 @@ export interface AccountsRequests {
accountId,
holdingId,
}: {
userId: string
userId?: string
accountId: string
holdingId: string
}, options?: ExtraOptions) => Promise<ApiResponse<HoldingWithMatchesAndHistory>>
getAccountStandingOrdersWithDetail: ({
userId,
accountId,
}: {
userId: string
userId?: string
accountId: string
}, options?: ExtraOptions) => Promise<ApiResponse<StandingOrderWithDetail[]>>
addAccountBalance: ({userId, accountId, balance}: {userId: string, accountId: string, balance: AccountBalancePost}, options?: ExtraOptions) => Promise<ApiResponse<AccountBalancePost>>
Expand Down
8 changes: 4 additions & 4 deletions src/requests/types/beneficiaries.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,30 +7,30 @@ export interface BeneficiariesRequests {
userId,
}: {
id: string
userId: string
userId?: string
}, options?: ExtraOptions) => Promise<ApiResponse<Beneficiary>>

getBeneficiaryWithDetail: ({
id,
userId,
}: {
id: string
userId: string
userId?: string
}, options?: ExtraOptions) => Promise<ApiResponse<BeneficiaryWithDetails>>

getBeneficiaries: ({
params,
userId,
}: {
params?: SearchParams
userId: string
userId?: string
}, options?: ExtraOptions) => Promise<ApiResponse<Beneficiary[]>>

getBeneficiariesWithDetail: ({
params,
userId,
}: {
params?: SearchParams
userId: string
userId?: string
}, options?: ExtraOptions) => Promise<ApiResponse<BeneficiaryWithDetails[]>>
}
8 changes: 4 additions & 4 deletions src/requests/types/categories.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface CategoriesRequests {
userId,
params,
}: {
userId: string
userId?: string
params?: SearchParams & {type?: CategoryType}
}, options?: ExtraOptions) => Promise<ApiResponse<Category[]>>

Expand All @@ -21,7 +21,7 @@ export interface CategoriesRequests {
categoryId,
params,
}: {
userId: string
userId?: string
categoryId: string
params?: {type?: CategoryType}
}, options?: ExtraOptions) => Promise<ApiResponse<Category>>
Expand All @@ -30,7 +30,7 @@ export interface CategoriesRequests {
userId,
params,
}: {
userId: string
userId?: string
params?: {type?: CategoryType}
}, options?: ExtraOptions) => Promise<ApiResponse<CategoryGroup[]>>

Expand All @@ -44,7 +44,7 @@ export interface CategoriesRequests {
userId,
category,
}: {
userId: string
userId?: string
category: CategoryPost
}, options?: ExtraOptions) => Promise<ApiResponse<Category>>
}
2 changes: 1 addition & 1 deletion src/requests/types/regular-transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface RegularTransactionsRequests {
userId,
params,
}: {
userId: string
userId?: string
params?: RegularTransactionSearchParams
}, options?: ExtraOptions) => Promise<ApiResponse<RegularTransaction[]>>
}
2 changes: 1 addition & 1 deletion src/requests/types/spending-analysis.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ export interface SpendingAnalysisRequests {
categoryIds,
projectIds,
}: {
userId: string
userId?: string
dates: Date[]
accountIds?: string[]
categoryIds?: string[]
Expand Down
2 changes: 1 addition & 1 deletion src/requests/types/sync.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface SyncRequests {
customerIpAddress,
customerLastLoggedTime,
}: {
userId: string
userId?: string
connectionId: string
customerIpAddress?: string
customerLastLoggedTime?: string
Expand Down
2 changes: 1 addition & 1 deletion src/requests/types/tax.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ export interface TaxRequests {
userId,
params,
}: {
userId: string
userId?: string
params?: TaxSearchParams
}, options?: ExtraOptions) => Promise<ApiResponse<Tax>>
}
8 changes: 4 additions & 4 deletions src/requests/types/transaction-files.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export interface TransactionFilesRequests {
fileData,
fileName,
}: {
userId: string
userId?: string
transactionId: string
fileName: string
fileData: any
Expand All @@ -18,7 +18,7 @@ export interface TransactionFilesRequests {
userId,
transactionId,
}: {
userId: string
userId?: string
transactionId: string
}, options?: ExtraOptions) => Promise<ApiResponse<TransactionFile[]>>

Expand All @@ -27,7 +27,7 @@ export interface TransactionFilesRequests {
transactionId,
fileId,
}: {
userId: string
userId?: string
transactionId: string
fileId: string
}, options?: ExtraOptions) => Promise<ApiResponse<TransactionFile>>
Expand All @@ -37,7 +37,7 @@ export interface TransactionFilesRequests {
transactionId,
fileId,
}: {
userId: string
userId?: string
transactionId: string
fileId: string
}, options?: ExtraOptions) => Promise<number>
Expand Down
2 changes: 1 addition & 1 deletion src/requests/types/transaction-splits.ts
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ export interface TransactionSplitsRequests {
userId,
transactionId,
}: {
userId: string
userId?: string
transactionId: string
}, options?: ExtraOptions) => Promise<ApiResponse<TransactionSplit[]>>

Expand Down
4 changes: 2 additions & 2 deletions src/requests/types/transactions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,15 +6,15 @@ export interface TransactionsRequests {
userId,
params,
}: {
userId: string
userId?: string
params?: TransactionSearchParams
}, options?: ExtraOptions) => Promise<ApiResponse<Transaction[]>>

getTransaction: ({
userId,
transactionId,
}: {
userId: string
userId?: string
transactionId: string
}, options?: ExtraOptions) => Promise<ApiResponse<Transaction>>

Expand Down

0 comments on commit d6034ce

Please sign in to comment.