@budgetbuddyde/types 1.0.21 → 1.0.23

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.
Files changed (48) hide show
  1. package/lib/ApiResponse.type.d.ts +0 -3
  2. package/lib/Budget.types.d.ts +114 -0
  3. package/lib/Budget.types.js +27 -0
  4. package/lib/Category.types.d.ts +52 -0
  5. package/lib/Category.types.js +23 -0
  6. package/lib/DailyBalance.types.d.ts +24 -0
  7. package/lib/DailyBalance.types.js +14 -0
  8. package/lib/{Auth.type.js → Deprecated/Auth.type.js} +1 -1
  9. package/lib/{Budget.type.js → Deprecated/Budget.type.js} +1 -1
  10. package/lib/{Category.type.js → Deprecated/Category.type.js} +1 -1
  11. package/lib/{DailyTransaction.type.js → Deprecated/DailyTransaction.type.js} +1 -1
  12. package/lib/{File.type.js → Deprecated/File.type.js} +1 -1
  13. package/lib/{PaymentMethod.type.js → Deprecated/PaymentMethod.type.js} +1 -1
  14. package/lib/{Role.type.js → Deprecated/Role.type.js} +1 -1
  15. package/lib/Deprecated/Stock.types.d.ts +326 -0
  16. package/lib/Deprecated/Stock.types.js +110 -0
  17. package/lib/{Subscription.type.js → Deprecated/Subscription.type.js} +1 -1
  18. package/lib/{Transaction.type.js → Deprecated/Transaction.type.js} +1 -1
  19. package/lib/{User.type.js → Deprecated/User.type.js} +1 -1
  20. package/lib/MonthlyBalance.types.d.ts +24 -0
  21. package/lib/MonthlyBalance.types.js +14 -0
  22. package/lib/PaymentMethod.types.d.ts +70 -0
  23. package/lib/PaymentMethod.types.js +29 -0
  24. package/lib/PocketBase.types.d.ts +22 -0
  25. package/lib/PocketBase.types.js +19 -0
  26. package/lib/{Stock.types.d.ts → Stocks/Stock.types.d.ts} +494 -489
  27. package/lib/{Stock.types.js → Stocks/Stock.types.js} +85 -126
  28. package/lib/Stocks/index.d.ts +1 -0
  29. package/lib/Stocks/index.js +17 -0
  30. package/lib/Subscription.types.d.ts +233 -0
  31. package/lib/Subscription.types.js +46 -0
  32. package/lib/Transaction.types.d.ts +227 -0
  33. package/lib/Transaction.types.js +45 -0
  34. package/lib/User.types.d.ts +36 -0
  35. package/lib/User.types.js +19 -0
  36. package/lib/index.d.ts +10 -11
  37. package/lib/index.js +10 -11
  38. package/package.json +1 -1
  39. package/lib/{Auth.type.d.ts → Deprecated/Auth.type.d.ts} +12 -12
  40. package/lib/{Budget.type.d.ts → Deprecated/Budget.type.d.ts} +107 -107
  41. package/lib/{Category.type.d.ts → Deprecated/Category.type.d.ts} +30 -30
  42. package/lib/{DailyTransaction.type.d.ts → Deprecated/DailyTransaction.type.d.ts} +0 -0
  43. package/lib/{File.type.d.ts → Deprecated/File.type.d.ts} +0 -0
  44. package/lib/{PaymentMethod.type.d.ts → Deprecated/PaymentMethod.type.d.ts} +30 -30
  45. package/lib/{Role.type.d.ts → Deprecated/Role.type.d.ts} +2 -2
  46. package/lib/{Subscription.type.d.ts → Deprecated/Subscription.type.d.ts} +124 -124
  47. package/lib/{Transaction.type.d.ts → Deprecated/Transaction.type.d.ts} +126 -126
  48. package/lib/{User.type.d.ts → Deprecated/User.type.d.ts} +6 -6
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZStockPosition = exports.ZClosePositionPayload = exports.ZUpdatePositionPayload = exports.ZOpenPositionPayload = exports.ZMaterializedStockPositionTable = exports.ZStockPositionTable = exports.ZStockExchangeTable = exports.ZStockExchanges = void 0;
4
+ const zod_1 = require("zod");
5
+ const Base_type_1 = require("../Base.type");
6
+ const Stock_types_1 = require("../Stocks/Stock.types");
7
+ exports.ZStockExchanges = zod_1.z.record(zod_1.z.string(), zod_1.z.object({ label: zod_1.z.string(), ticker: zod_1.z.string() }));
8
+ /**
9
+ * Represents a stock exchange table.
10
+ */
11
+ exports.ZStockExchangeTable = zod_1.z.object({
12
+ symbol: zod_1.z.string().max(5),
13
+ name: zod_1.z.string().max(100),
14
+ exchange: zod_1.z.string().max(100),
15
+ country: zod_1.z.string().max(100),
16
+ created_at: Base_type_1.ZCreatedAt,
17
+ });
18
+ /**
19
+ * Represents a stock position table.
20
+ *
21
+ * @remarks
22
+ * This type defines the structure of a stock position table, including properties such as id, owner, bought_at, exchange, isin, buy_in, and currency.
23
+ */
24
+ exports.ZStockPositionTable = zod_1.z.object({
25
+ id: zod_1.z.number(),
26
+ owner: zod_1.z.string().uuid(),
27
+ bought_at: Base_type_1.ZDate,
28
+ exchange: zod_1.z.string(),
29
+ isin: zod_1.z.string().max(12),
30
+ buy_in: zod_1.z.number(),
31
+ currency: zod_1.z.string().max(3),
32
+ quantity: zod_1.z.number(),
33
+ created_at: Base_type_1.ZCreatedAt,
34
+ });
35
+ /**
36
+ * Represents a stock position table with resolved joins.
37
+ */
38
+ exports.ZMaterializedStockPositionTable = zod_1.z.object({
39
+ id: zod_1.z.number(),
40
+ owner: zod_1.z.string(),
41
+ bought_at: Base_type_1.ZDate,
42
+ exchange: zod_1.z.object({
43
+ symbol: zod_1.z.string().max(5),
44
+ name: zod_1.z.string().max(100),
45
+ exchange: zod_1.z.string().max(100),
46
+ country: zod_1.z.string().max(100),
47
+ }),
48
+ isin: zod_1.z.string().max(12),
49
+ buy_in: zod_1.z.number(),
50
+ currency: zod_1.z.string().max(3),
51
+ quantity: zod_1.z.number(),
52
+ created_at: Base_type_1.ZCreatedAt,
53
+ });
54
+ /**
55
+ * Represents the payload for opening a position.
56
+ */
57
+ exports.ZOpenPositionPayload = zod_1.z.object({
58
+ owner: zod_1.z.string().uuid(),
59
+ bought_at: Base_type_1.ZDate,
60
+ exchange: zod_1.z.string(),
61
+ isin: zod_1.z.string().max(12),
62
+ buy_in: zod_1.z.number(),
63
+ currency: zod_1.z.string().max(3),
64
+ quantity: zod_1.z.number(),
65
+ });
66
+ /**
67
+ * Represents the payload for updating a position.
68
+ */
69
+ exports.ZUpdatePositionPayload = zod_1.z.object({
70
+ id: zod_1.z.number(),
71
+ bought_at: Base_type_1.ZDate,
72
+ exchange: zod_1.z.string(),
73
+ isin: zod_1.z.string().max(12),
74
+ buy_in: zod_1.z.number(),
75
+ quantity: zod_1.z.number(),
76
+ });
77
+ /**
78
+ * Represents the payload for closing a position.
79
+ */
80
+ exports.ZClosePositionPayload = zod_1.z.object({
81
+ id: zod_1.z.number(),
82
+ });
83
+ exports.ZStockPosition = zod_1.z.object({
84
+ id: zod_1.z.number(),
85
+ owner: zod_1.z.string().uuid(),
86
+ bought_at: Base_type_1.ZDate,
87
+ exchange: zod_1.z.object({
88
+ symbol: zod_1.z.string(),
89
+ name: zod_1.z.string(),
90
+ exchange: zod_1.z.string(),
91
+ country: zod_1.z.string(),
92
+ }),
93
+ isin: zod_1.z.string(),
94
+ buy_in: zod_1.z.number(),
95
+ currency: Stock_types_1.ZCurrency,
96
+ quantity: zod_1.z.number(),
97
+ created_at: Base_type_1.ZDate,
98
+ name: zod_1.z.string(),
99
+ logo: zod_1.z.string(),
100
+ volume: zod_1.z.number(),
101
+ quote: zod_1.z.object({
102
+ currency: Stock_types_1.ZCurrency,
103
+ exchange: zod_1.z.string(),
104
+ date: Base_type_1.ZDate,
105
+ datetime: Base_type_1.ZDate,
106
+ price: zod_1.z.number(),
107
+ isin: zod_1.z.string(),
108
+ cachedAt: Base_type_1.ZDate,
109
+ }),
110
+ });
@@ -5,7 +5,7 @@ const zod_1 = require("zod");
5
5
  const User_type_1 = require("./User.type");
6
6
  const Category_type_1 = require("./Category.type");
7
7
  const PaymentMethod_type_1 = require("./PaymentMethod.type");
8
- const Base_type_1 = require("./Base.type");
8
+ const Base_type_1 = require("../Base.type");
9
9
  const ZExecuteAt = zod_1.z
10
10
  .union([zod_1.z.number(), zod_1.z.date()])
11
11
  .refine(value => {
@@ -5,7 +5,7 @@ const zod_1 = require("zod");
5
5
  const User_type_1 = require("./User.type");
6
6
  const Category_type_1 = require("./Category.type");
7
7
  const PaymentMethod_type_1 = require("./PaymentMethod.type");
8
- const Base_type_1 = require("./Base.type");
8
+ const Base_type_1 = require("../Base.type");
9
9
  /**
10
10
  * TransactionFile
11
11
  */
@@ -3,7 +3,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.ZUpdateUserPayload = exports.ZUser = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const Role_type_1 = require("./Role.type");
6
- const index_1 = require("./index");
6
+ const index_1 = require("../index");
7
7
  exports.ZUser = zod_1.z.object({
8
8
  uuid: zod_1.z.string().uuid(),
9
9
  isVerified: zod_1.z.boolean().default(false),
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ export declare const ZMonthlyBalance: z.ZodObject<{
3
+ id: z.ZodString;
4
+ date: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodDate, z.ZodNumber]>, z.ZodString]>, Date, string | number | Date>;
5
+ balance: z.ZodNumber;
6
+ income: z.ZodNumber;
7
+ expenses: z.ZodNumber;
8
+ owner: z.ZodString;
9
+ }, "strip", z.ZodTypeAny, {
10
+ id: string;
11
+ date: Date;
12
+ owner: string;
13
+ balance: number;
14
+ income: number;
15
+ expenses: number;
16
+ }, {
17
+ id: string;
18
+ date: (string | number | Date) & (string | number | Date | undefined);
19
+ owner: string;
20
+ balance: number;
21
+ income: number;
22
+ expenses: number;
23
+ }>;
24
+ export type TMonthlyBalance = z.infer<typeof ZMonthlyBalance>;
@@ -0,0 +1,14 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZMonthlyBalance = void 0;
4
+ const zod_1 = require("zod");
5
+ const Base_type_1 = require("./Base.type");
6
+ const PocketBase_types_1 = require("./PocketBase.types");
7
+ exports.ZMonthlyBalance = zod_1.z.object({
8
+ id: zod_1.z.string(),
9
+ date: Base_type_1.ZDate,
10
+ balance: zod_1.z.number(),
11
+ income: zod_1.z.number(),
12
+ expenses: zod_1.z.number(),
13
+ owner: PocketBase_types_1.ZId,
14
+ });
@@ -0,0 +1,70 @@
1
+ import { z } from 'zod';
2
+ export declare const ZPaymentMethod: z.ZodObject<{
3
+ owner: z.ZodString;
4
+ name: z.ZodString;
5
+ provider: z.ZodString;
6
+ address: z.ZodString;
7
+ description: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | null, string | null | undefined>;
8
+ id: z.ZodString;
9
+ created: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodDate, z.ZodNumber]>, z.ZodString]>, Date, string | number | Date>;
10
+ updated: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodDate, z.ZodNumber]>, z.ZodString]>, Date, string | number | Date>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ id: string;
13
+ address: string;
14
+ name: string;
15
+ description: string | null;
16
+ created: Date;
17
+ updated: Date;
18
+ owner: string;
19
+ provider: string;
20
+ }, {
21
+ id: string;
22
+ address: string;
23
+ name: string;
24
+ created: (string | number | Date) & (string | number | Date | undefined);
25
+ updated: (string | number | Date) & (string | number | Date | undefined);
26
+ owner: string;
27
+ provider: string;
28
+ description?: string | null | undefined;
29
+ }>;
30
+ export type TPaymentMethod = z.infer<typeof ZPaymentMethod>;
31
+ export declare const ZCreatePaymentMethodPayload: z.ZodObject<{
32
+ owner: z.ZodString;
33
+ name: z.ZodString;
34
+ provider: z.ZodString;
35
+ address: z.ZodString;
36
+ description: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | null, string | null | undefined>;
37
+ }, "strip", z.ZodTypeAny, {
38
+ address: string;
39
+ name: string;
40
+ description: string | null;
41
+ owner: string;
42
+ provider: string;
43
+ }, {
44
+ address: string;
45
+ name: string;
46
+ owner: string;
47
+ provider: string;
48
+ description?: string | null | undefined;
49
+ }>;
50
+ export type TCreatePaymentMethodPayload = z.infer<typeof ZCreatePaymentMethodPayload>;
51
+ export declare const ZUpdatePaymentMethodPayload: z.ZodObject<{
52
+ owner: z.ZodString;
53
+ name: z.ZodString;
54
+ provider: z.ZodString;
55
+ address: z.ZodString;
56
+ description: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | null, string | null | undefined>;
57
+ }, "strip", z.ZodTypeAny, {
58
+ address: string;
59
+ name: string;
60
+ description: string | null;
61
+ owner: string;
62
+ provider: string;
63
+ }, {
64
+ address: string;
65
+ name: string;
66
+ owner: string;
67
+ provider: string;
68
+ description?: string | null | undefined;
69
+ }>;
70
+ export type TUpdatePaymentMethodPayload = z.infer<typeof ZUpdatePaymentMethodPayload>;
@@ -0,0 +1,29 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZUpdatePaymentMethodPayload = exports.ZCreatePaymentMethodPayload = exports.ZPaymentMethod = void 0;
4
+ const zod_1 = require("zod");
5
+ const PocketBase_types_1 = require("./PocketBase.types");
6
+ exports.ZPaymentMethod = zod_1.z.object({
7
+ ...PocketBase_types_1.ZBaseModel.shape,
8
+ ...zod_1.z.object({
9
+ owner: PocketBase_types_1.ZId,
10
+ name: zod_1.z.string(),
11
+ provider: zod_1.z.string(),
12
+ address: zod_1.z.string(),
13
+ description: PocketBase_types_1.ZNullableString,
14
+ }).shape,
15
+ });
16
+ exports.ZCreatePaymentMethodPayload = zod_1.z.object({
17
+ owner: PocketBase_types_1.ZId,
18
+ name: zod_1.z.string(),
19
+ provider: zod_1.z.string(),
20
+ address: zod_1.z.string(),
21
+ description: PocketBase_types_1.ZNullableString,
22
+ });
23
+ exports.ZUpdatePaymentMethodPayload = zod_1.z.object({
24
+ owner: PocketBase_types_1.ZId,
25
+ name: zod_1.z.string(),
26
+ provider: zod_1.z.string(),
27
+ address: zod_1.z.string(),
28
+ description: PocketBase_types_1.ZNullableString,
29
+ });
@@ -0,0 +1,22 @@
1
+ import { z } from 'zod';
2
+ /**
3
+ * @description 15 characters string to store as record ID. If not set, it will be auto generated.
4
+ */
5
+ export declare const ZId: z.ZodString;
6
+ export type TId = z.infer<typeof ZId>;
7
+ export declare const ZBaseModel: z.ZodObject<{
8
+ id: z.ZodString;
9
+ created: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodDate, z.ZodNumber]>, z.ZodString]>, Date, string | number | Date>;
10
+ updated: z.ZodEffects<z.ZodUnion<[z.ZodUnion<[z.ZodDate, z.ZodNumber]>, z.ZodString]>, Date, string | number | Date>;
11
+ }, "strip", z.ZodTypeAny, {
12
+ id: string;
13
+ created: Date;
14
+ updated: Date;
15
+ }, {
16
+ id: string;
17
+ created: (string | number | Date) & (string | number | Date | undefined);
18
+ updated: (string | number | Date) & (string | number | Date | undefined);
19
+ }>;
20
+ export type TBaseModel = z.infer<typeof ZBaseModel>;
21
+ export declare const ZNullableString: z.ZodEffects<z.ZodOptional<z.ZodNullable<z.ZodString>>, string | null, string | null | undefined>;
22
+ export type TNullableString = z.infer<typeof ZNullableString>;
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZNullableString = exports.ZBaseModel = exports.ZId = void 0;
4
+ const zod_1 = require("zod");
5
+ const Base_type_1 = require("./Base.type");
6
+ /**
7
+ * @description 15 characters string to store as record ID. If not set, it will be auto generated.
8
+ */
9
+ exports.ZId = zod_1.z.string().length(15);
10
+ exports.ZBaseModel = zod_1.z.object({
11
+ id: exports.ZId,
12
+ created: Base_type_1.ZDate,
13
+ updated: Base_type_1.ZDate,
14
+ });
15
+ exports.ZNullableString = zod_1.z
16
+ .string()
17
+ .nullable()
18
+ .optional()
19
+ .transform(v => (typeof v === 'string' && v.length > 0 ? v : null));