money-lover-app-client 1.0.6 → 1.0.8

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/client.d.ts CHANGED
@@ -1,6 +1,6 @@
1
- import { MoneyLoverCategory } from "./interfaces/category";
2
- import { MoneyLoverTransaction } from "./interfaces/transaction";
3
- import { MoneyLoverWallet } from "./interfaces/wallet";
1
+ import { Category } from "./interfaces/category";
2
+ import { UpsertTransaction } from "./interfaces/transaction";
3
+ import { Wallet } from "./interfaces/wallet";
4
4
  declare class MoneyLoverClient {
5
5
  private _jwtToken;
6
6
  constructor();
@@ -10,10 +10,10 @@ declare class MoneyLoverClient {
10
10
  isTokenValid(): boolean;
11
11
  getToken(): string | null;
12
12
  getUserInfo(): Promise<any>;
13
- getWallets(): Promise<MoneyLoverWallet[]>;
14
- getCategories(walletId: string): Promise<MoneyLoverCategory[]>;
13
+ getWallets(): Promise<Wallet[]>;
14
+ getCategories(walletId: string): Promise<Category[]>;
15
15
  getTransactions(walletId: string, startDate: Date, endDate: Date): Promise<any>;
16
- addTransaction(transaction: MoneyLoverTransaction): Promise<MoneyLoverTransaction>;
16
+ addTransaction(transaction: UpsertTransaction): Promise<UpsertTransaction>;
17
17
  }
18
18
  export default MoneyLoverClient;
19
19
  export declare const NewMoneyLoverClient: () => MoneyLoverClient;
@@ -1,4 +1,4 @@
1
1
  import MoneyLoverClient from "../client";
2
- import { MoneyLoverCategory } from "../interfaces/category";
3
- declare const getCategories: (client: MoneyLoverClient, walletId: string) => Promise<MoneyLoverCategory[]>;
2
+ import { Category } from "../interfaces/category";
3
+ declare const getCategories: (client: MoneyLoverClient, walletId: string) => Promise<Category[]>;
4
4
  export default getCategories;
@@ -1,5 +1,5 @@
1
1
  import MoneyLoverClient from "../client";
2
- import { MoneyLoverTransaction } from "../interfaces/transaction";
2
+ import { UpsertTransaction } from "../interfaces/transaction";
3
3
  declare const getTransactions: (client: MoneyLoverClient, walletId: string, startDate: Date, endDate: Date) => Promise<any>;
4
- declare const addTransaction: (client: MoneyLoverClient, transaction: MoneyLoverTransaction) => Promise<MoneyLoverTransaction>;
4
+ declare const addTransaction: (client: MoneyLoverClient, transaction: UpsertTransaction) => Promise<UpsertTransaction>;
5
5
  export { getTransactions, addTransaction };
@@ -1,3 +1,3 @@
1
1
  import MoneyLoverClient from "../client";
2
- declare const getWallets: (client: MoneyLoverClient) => Promise<import("..").MoneyLoverWallet[]>;
2
+ declare const getWallets: (client: MoneyLoverClient) => Promise<import("..").Wallet[]>;
3
3
  export default getWallets;
package/dist/index.d.ts CHANGED
@@ -4,9 +4,9 @@ import login from "./commands/login";
4
4
  import logout from "./commands/logout";
5
5
  import { addTransaction, getTransactions } from "./commands/transactions";
6
6
  import getWallets from "./commands/wallets";
7
- import { MoneyLoverCategory } from "./interfaces/category";
7
+ import { Category } from "./interfaces/category";
8
8
  import { CategoryType } from "./interfaces/category-type";
9
- import { MoneyLoverTransaction } from "./interfaces/transaction";
9
+ import { Transaction, UpsertTransaction } from "./interfaces/transaction";
10
10
  import { UserProfile } from "./interfaces/user-profile";
11
- import { MoneyLoverWallet } from "./interfaces/wallet";
12
- export { MoneyLoverClient, NewMoneyLoverClient, getCategories, login, logout, getTransactions, addTransaction, getWallets, CategoryType, MoneyLoverCategory, MoneyLoverTransaction, UserProfile, MoneyLoverWallet, };
11
+ import { Wallet } from "./interfaces/wallet";
12
+ export { MoneyLoverClient, NewMoneyLoverClient, getCategories, login, logout, getTransactions, addTransaction, getWallets, CategoryType, Category, Transaction, UpsertTransaction, UserProfile, Wallet, };
@@ -0,0 +1,7 @@
1
+ export interface Account {
2
+ _id: string;
3
+ name: string;
4
+ currency_id: number;
5
+ icon: string;
6
+ account_type: number;
7
+ }
@@ -0,0 +1,7 @@
1
+ export interface CategoryParent {
2
+ _id: string;
3
+ name: string;
4
+ icon: string;
5
+ type: number;
6
+ metadata: string;
7
+ }
@@ -1,4 +1,5 @@
1
- export interface MoneyLoverCategory {
1
+ import { CategoryParent } from "./category-parent";
2
+ export interface Category {
2
3
  /** Internal unique identifier for the specific item */
3
4
  _id: string;
4
5
  /** Display name (e.g., "Tejas") */
@@ -20,6 +21,6 @@ export interface MoneyLoverCategory {
20
21
  /** Duplicate of _id, often used for legacy or specific API compatibility */
21
22
  id: string;
22
23
  /** Optional parent category ID for hierarchical categorization */
23
- parent?: string;
24
+ parent?: CategoryParent;
24
25
  exclude_accounts: string[];
25
26
  }
@@ -1,7 +1,24 @@
1
- export interface MoneyLoverTransaction {
1
+ import { Account } from "./account";
2
+ import { Category } from "./category";
3
+ import { UserSnippet } from "./user-snippet";
4
+ export interface UpsertTransaction {
2
5
  account: string;
3
6
  category: string;
4
7
  amount: string;
5
8
  note: string;
6
9
  date: Date;
7
10
  }
11
+ export interface Transaction {
12
+ _id: string;
13
+ note: string;
14
+ account: Account;
15
+ category: Category;
16
+ amount: number;
17
+ displayDate: string;
18
+ with: any[];
19
+ campaign: any[];
20
+ lastEditBy: UserSnippet;
21
+ exclude_report: boolean;
22
+ images: any[];
23
+ createdAt: string;
24
+ }
@@ -0,0 +1,4 @@
1
+ export interface UserSnippet {
2
+ _id: string;
3
+ email: string;
4
+ }
@@ -1,4 +1,5 @@
1
- export interface MoneyLoverWallet {
1
+ import { UserSnippet } from "./user-snippet";
2
+ export interface Wallet {
2
3
  _id: string;
3
4
  name: string;
4
5
  currency_id: number;
@@ -9,16 +10,12 @@ export interface MoneyLoverWallet {
9
10
  account_type: number;
10
11
  exclude_total: boolean;
11
12
  icon: string;
12
- listUser: MoneyLoverObjectUser[];
13
+ listUser: UserSnippet[];
13
14
  createdAt: string;
14
15
  updateAt: string;
15
16
  isDelete: boolean;
16
17
  balance: MoneyLoverBankTransaction[];
17
18
  }
18
- export interface MoneyLoverObjectUser {
19
- _id: string;
20
- email: string;
21
- }
22
19
  export interface MoneyLoverBankTransaction {
23
20
  date: string;
24
21
  valueDate: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "money-lover-app-client",
3
- "version": "1.0.6",
3
+ "version": "1.0.8",
4
4
  "main": "dist/bundle.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "scripts": {