Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions src/__tests__/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,7 @@ describe("API client", function() {
"splitTransaction",
"getTransactionSplits",
"patchTransactionSplit",
"postLlmGatewaySavingsGoals",
"deleteTransactionSplits",
"getGlobalCounterparties",
"getJWTBearerToken",
Expand Down
2 changes: 2 additions & 0 deletions src/requests/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ import usersAndConnections from "./users-and-connections"
import resellerCheck from "./reseller-check"
import categoriseTransactions from "./categorise-transactions"
import consentHistory from "./consent-history"
import llmGateway from "./llm-gateway"

export default ({config, request}: RequestsParams) => {
return {
Expand Down Expand Up @@ -75,5 +76,6 @@ export default ({config, request}: RequestsParams) => {
...resellerCheck({config, request}),
...categoriseTransactions({config, request}),
...consentHistory({config, request}),
...llmGateway({config, request}),
}
}
31 changes: 31 additions & 0 deletions src/requests/llm-gateway.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
import type {ApiResponse, ExtraOptions, RequestsParams} from "../request"

const LLM_GATEWAY_SAVINGS_GOALS_WRITE_SCOPE = "llm_gateway_savings_goals:write"

export default ({config, request}: RequestsParams) => {
const {resourceServerUrl} = config

return {
postLlmGatewaySavingsGoals: async (
{userId, body = {}}: {userId: string, body?: Record<string, unknown>},
options?: ExtraOptions,
) =>
request<ApiResponse<Record<string, unknown>>>(
`${resourceServerUrl}/llm-gateway/savings-goals`,
{
method: "POST",
body,
cc: options?.token
? undefined
: {
scope: LLM_GATEWAY_SAVINGS_GOALS_WRITE_SCOPE,
sub: userId,
},
options: {
version: "v3",
...options,
},
},
),
}
}
Loading