@budgetbuddyde/types 1.0.31 → 1.0.33

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.
@@ -7,6 +7,7 @@ export type TApiResponse<T> = {
7
7
  status: number | HTTPStatusCode;
8
8
  message: string | null;
9
9
  data: T | null;
10
+ from: 'db' | 'cache';
10
11
  };
11
12
  /**
12
13
  * Represents an API response.
@@ -26,6 +27,7 @@ export declare class ApiResponse<T> {
26
27
  status: number | HTTPStatusCode;
27
28
  message: string | null;
28
29
  data: T | null;
30
+ from: 'db' | 'cache';
29
31
  private constructor();
30
32
  /**
31
33
  * Creates a new instance of ApiResponseBuilder.
@@ -57,6 +59,12 @@ export declare class ApiResponseBuilder<T> {
57
59
  * @returns The ApiResponseBuilder instance.
58
60
  */
59
61
  withData(data: T | null): ApiResponseBuilder<T>;
62
+ /**
63
+ * Sets the source of the response data.
64
+ * @param from The source of the response data. Must be either "db" or "cache".
65
+ * @returns The ApiResponseBuilder instance.
66
+ */
67
+ withFrom(from: 'db' | 'cache'): ApiResponseBuilder<T>;
60
68
  /**
61
69
  * Builds the API response.
62
70
  * @returns The built ApiResponse instance.
@@ -20,6 +20,7 @@ class ApiResponse {
20
20
  this.status = 200;
21
21
  this.message = null;
22
22
  this.data = null;
23
+ this.from = 'db';
23
24
  }
24
25
  /**
25
26
  * Creates a new instance of ApiResponseBuilder.
@@ -66,6 +67,15 @@ class ApiResponseBuilder {
66
67
  this.response.data = data;
67
68
  return this;
68
69
  }
70
+ /**
71
+ * Sets the source of the response data.
72
+ * @param from The source of the response data. Must be either "db" or "cache".
73
+ * @returns The ApiResponseBuilder instance.
74
+ */
75
+ withFrom(from) {
76
+ this.response.from = from;
77
+ return this;
78
+ }
69
79
  /**
70
80
  * Builds the API response.
71
81
  * @returns The built ApiResponse instance.
@@ -3278,7 +3278,7 @@ export declare const ZAssetWatchlist: z.ZodObject<{
3278
3278
  isin: string;
3279
3279
  }>;
3280
3280
  export type TAssetWatchlist = z.infer<typeof ZAssetWatchlist>;
3281
- declare const ZAssetWatchlistWithQuote: z.ZodObject<{
3281
+ export declare const ZAssetWatchlistWithQuote: z.ZodObject<{
3282
3282
  owner: z.ZodString;
3283
3283
  exchange: z.ZodString;
3284
3284
  isin: z.ZodString;
@@ -3553,4 +3553,3 @@ export declare const ZDeleteWatchlistAssetPayload: z.ZodObject<{
3553
3553
  id: string;
3554
3554
  }>;
3555
3555
  export type TDeleteWatchlistAssetPayload = z.infer<typeof ZDeleteWatchlistAssetPayload>;
3556
- export {};
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ZDeleteWatchlistAssetPayload = exports.ZAddWatchlistAssetPayload = exports.ZAssetWatchlist = exports.ZRelatedStockWithQuotes = exports.ZRelatedStock = exports.ZUpdateStockPositionPayload = exports.ZCreateStockPositionPayload = exports.ZStockPositionWithQuote = exports.ZStockPosition = exports.ZStockExchange = exports.ZAssetDetails = exports.ZDividendDetailList = exports.ZDividendDetails = exports.ZPayoutInterval = exports.ZDividend = exports.ZAssetChartQuote = exports.ZAssetSearchResult = exports.ZAsset = exports.ZStockQuote = exports.ZStockType = exports.ZTimeframe = exports.ZCurrency = exports.ZWKN = exports.ZIsin = void 0;
3
+ exports.ZDeleteWatchlistAssetPayload = exports.ZAddWatchlistAssetPayload = exports.ZAssetWatchlistWithQuote = exports.ZAssetWatchlist = exports.ZRelatedStockWithQuotes = exports.ZRelatedStock = exports.ZUpdateStockPositionPayload = exports.ZCreateStockPositionPayload = exports.ZStockPositionWithQuote = exports.ZStockPosition = exports.ZStockExchange = exports.ZAssetDetails = exports.ZDividendDetailList = exports.ZDividendDetails = exports.ZPayoutInterval = exports.ZDividend = exports.ZAssetChartQuote = exports.ZAssetSearchResult = exports.ZAsset = exports.ZStockQuote = exports.ZStockType = exports.ZTimeframe = exports.ZCurrency = exports.ZWKN = exports.ZIsin = void 0;
4
4
  const zod_1 = require("zod");
5
5
  const PocketBase_types_1 = require("../PocketBase.types");
6
6
  const Base_type_1 = require("../Base.type");
@@ -423,7 +423,7 @@ exports.ZAssetWatchlist = zod_1.z.object({
423
423
  isin: exports.ZIsin,
424
424
  }).shape,
425
425
  });
426
- const ZAssetWatchlistWithQuote = zod_1.z.object({
426
+ exports.ZAssetWatchlistWithQuote = zod_1.z.object({
427
427
  ...PocketBase_types_1.ZBaseModel.shape,
428
428
  ...zod_1.z.object({
429
429
  owner: PocketBase_types_1.ZId,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@budgetbuddyde/types",
3
- "version": "1.0.31",
3
+ "version": "1.0.33",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "description": "Budget Buddy Typescript Types",