@spritz-finance/service-client 0.3.108 → 0.3.109

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.
@@ -1,5 +1,5 @@
1
1
  export * as PayableAccountsClient from './payableAccountsServiceClient';
2
- import { ExternalBillInput, PayableAccount, PayableAccountInstitution, UpsertVirtualCardInput } from './types';
2
+ import { ExternalBillInput, PayableAccount, PayableAccountInstitution, SimpleCardTransaction, UpsertVirtualCardInput } from './types';
3
3
  export declare function getAccount(accountId: string): Promise<(Omit<import("../lib/graphClient/generated").Bill, "type" | "institution"> & {
4
4
  __t: import("../lib/graphClient/generated").PayableAccountType;
5
5
  externalId?: string;
@@ -81,3 +81,4 @@ export declare function upsertBillFromExternalAccount(input: ExternalBillInput):
81
81
  export declare function getAccountById(accountId: string): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<PayableAccount>>;
82
82
  export declare function createUSVirtualCardNoKyc(userId: string): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<PayableAccount>>;
83
83
  export declare function upsertVirtualCard(input: UpsertVirtualCardInput): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<PayableAccount>>;
84
+ export declare function getRecentCardSpendTransactions(userId: string): Promise<import("../types").ApiFailure | import("../types").ApiSuccess<SimpleCardTransaction[]>>;
@@ -23,7 +23,7 @@ var __importStar = (this && this.__importStar) || function (mod) {
23
23
  return result;
24
24
  };
25
25
  Object.defineProperty(exports, "__esModule", { value: true });
26
- exports.upsertVirtualCard = exports.createUSVirtualCardNoKyc = exports.getAccountById = exports.upsertBillFromExternalAccount = exports.getAccountInstitution = exports.getAccounts = exports.getAccountsForUser = exports.getAccountByExternalId = exports.getAccount = exports.PayableAccountsClient = void 0;
26
+ exports.getRecentCardSpendTransactions = exports.upsertVirtualCard = exports.createUSVirtualCardNoKyc = exports.getAccountById = exports.upsertBillFromExternalAccount = exports.getAccountInstitution = exports.getAccounts = exports.getAccountsForUser = exports.getAccountByExternalId = exports.getAccount = exports.PayableAccountsClient = void 0;
27
27
  exports.PayableAccountsClient = __importStar(require("./payableAccountsServiceClient"));
28
28
  const serviceClient_1 = require("../serviceClient");
29
29
  const PAYABLE_ACCOUNTS_ENDPOINT = '/payable-accounts';
@@ -81,3 +81,9 @@ async function upsertVirtualCard(input) {
81
81
  .then((res) => res.data);
82
82
  }
83
83
  exports.upsertVirtualCard = upsertVirtualCard;
84
+ async function getRecentCardSpendTransactions(userId) {
85
+ return serviceClient_1.baseClient
86
+ .get(`${PAYABLE_ACCOUNTS_ENDPOINT}/virtual-card/recent-transactions/user/${userId}`)
87
+ .then((res) => res.data);
88
+ }
89
+ exports.getRecentCardSpendTransactions = getRecentCardSpendTransactions;
@@ -103,3 +103,18 @@ export type UpsertVirtualCardInput = {
103
103
  };
104
104
  };
105
105
  };
106
+ export type SimpleCardTransaction = {
107
+ id: string;
108
+ userId: string;
109
+ amount: number;
110
+ status: string;
111
+ currency: string;
112
+ timestamp: string;
113
+ description: string;
114
+ mccCode: string;
115
+ mccDescription?: string;
116
+ merchantCity?: string;
117
+ merchantCountry?: string;
118
+ merchant?: string;
119
+ iconUrl?: string;
120
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@spritz-finance/service-client",
3
- "version": "0.3.108",
3
+ "version": "0.3.109",
4
4
  "description": "Service client",
5
5
  "main": "lib/index.js",
6
6
  "types": "lib/index.d.ts",