@budgetbuddyde/types 1.0.4 → 1.0.6

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.
@@ -0,0 +1,24 @@
1
+ import { z } from 'zod';
2
+ export declare const ZFile: z.ZodObject<{
3
+ name: z.ZodString;
4
+ size: z.ZodNumber;
5
+ location: z.ZodString;
6
+ type: z.ZodString;
7
+ last_edited_at: z.ZodEffects<z.ZodUnion<[z.ZodDate, z.ZodString]>, Date, string | Date>;
8
+ created_at: z.ZodEffects<z.ZodUnion<[z.ZodDate, z.ZodString]>, Date, string | Date>;
9
+ }, "strip", z.ZodTypeAny, {
10
+ type: string;
11
+ location: string;
12
+ name: string;
13
+ size: number;
14
+ last_edited_at: Date;
15
+ created_at: Date;
16
+ }, {
17
+ type: string;
18
+ location: string;
19
+ name: string;
20
+ size: number;
21
+ last_edited_at: (string | Date) & (string | Date | undefined);
22
+ created_at: (string | Date) & (string | Date | undefined);
23
+ }>;
24
+ export type TFile = z.infer<typeof ZFile>;
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.ZFile = void 0;
4
+ const zod_1 = require("zod");
5
+ exports.ZFile = zod_1.z.object({
6
+ name: zod_1.z.string(),
7
+ size: zod_1.z.number(),
8
+ location: zod_1.z.string(),
9
+ type: zod_1.z.string(),
10
+ last_edited_at: zod_1.z
11
+ .date()
12
+ .or(zod_1.z.string())
13
+ .transform(val => new Date(val)),
14
+ created_at: zod_1.z
15
+ .date()
16
+ .or(zod_1.z.string())
17
+ .transform(val => new Date(val)),
18
+ });
@@ -1,4 +1,30 @@
1
1
  import { z } from 'zod';
2
+ /**
3
+ * TransactionFile
4
+ */
5
+ export declare const ZTransactionFile: z.ZodObject<{
6
+ uuid: z.ZodString;
7
+ fileName: z.ZodString;
8
+ fileSize: z.ZodNumber;
9
+ mimeType: z.ZodString;
10
+ location: z.ZodString;
11
+ createdAt: z.ZodEffects<z.ZodUnion<[z.ZodDate, z.ZodNumber]>, Date, number | Date>;
12
+ }, "strip", z.ZodTypeAny, {
13
+ location: string;
14
+ uuid: string;
15
+ createdAt: Date;
16
+ fileName: string;
17
+ fileSize: number;
18
+ mimeType: string;
19
+ }, {
20
+ location: string;
21
+ uuid: string;
22
+ createdAt: (number | Date) & (number | Date | undefined);
23
+ fileName: string;
24
+ fileSize: number;
25
+ mimeType: string;
26
+ }>;
27
+ export type TTransactionFile = z.infer<typeof ZTransactionFile>;
2
28
  export declare const ZTransaction: z.ZodObject<{
3
29
  id: z.ZodNumber;
4
30
  owner: z.ZodObject<{
@@ -281,6 +307,28 @@ export declare const ZTransaction: z.ZodObject<{
281
307
  receiver: z.ZodString;
282
308
  description: z.ZodDefault<z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, string | null>>;
283
309
  transferAmount: z.ZodEffects<z.ZodUnion<[z.ZodNumber, z.ZodString]>, number, string | number>;
310
+ attachedFiles: z.ZodArray<z.ZodObject<{
311
+ uuid: z.ZodString;
312
+ fileName: z.ZodString;
313
+ fileSize: z.ZodNumber;
314
+ mimeType: z.ZodString;
315
+ location: z.ZodString;
316
+ createdAt: z.ZodEffects<z.ZodUnion<[z.ZodDate, z.ZodNumber]>, Date, number | Date>;
317
+ }, "strip", z.ZodTypeAny, {
318
+ location: string;
319
+ uuid: string;
320
+ createdAt: Date;
321
+ fileName: string;
322
+ fileSize: number;
323
+ mimeType: string;
324
+ }, {
325
+ location: string;
326
+ uuid: string;
327
+ createdAt: (number | Date) & (number | Date | undefined);
328
+ fileName: string;
329
+ fileSize: number;
330
+ mimeType: string;
331
+ }>, "many">;
284
332
  createdAt: z.ZodEffects<z.ZodUnion<[z.ZodDate, z.ZodNumber]>, Date, number | Date>;
285
333
  }, "strip", z.ZodTypeAny, {
286
334
  id: number;
@@ -351,6 +399,14 @@ export declare const ZTransaction: z.ZodObject<{
351
399
  };
352
400
  processedAt: Date;
353
401
  transferAmount: number;
402
+ attachedFiles: {
403
+ location: string;
404
+ uuid: string;
405
+ createdAt: Date;
406
+ fileName: string;
407
+ fileSize: number;
408
+ mimeType: string;
409
+ }[];
354
410
  }, {
355
411
  id: number;
356
412
  receiver: string;
@@ -419,6 +475,14 @@ export declare const ZTransaction: z.ZodObject<{
419
475
  };
420
476
  processedAt: (number | Date) & (number | Date | undefined);
421
477
  transferAmount: string | number;
478
+ attachedFiles: {
479
+ location: string;
480
+ uuid: string;
481
+ createdAt: (number | Date) & (number | Date | undefined);
482
+ fileName: string;
483
+ fileSize: number;
484
+ mimeType: string;
485
+ }[];
422
486
  description?: string | null | undefined;
423
487
  }>;
424
488
  export type TTransaction = z.infer<typeof ZTransaction>;
@@ -765,6 +829,28 @@ export declare const ZDeleteTransactionResponsePayload: z.ZodObject<{
765
829
  receiver: z.ZodString;
766
830
  description: z.ZodDefault<z.ZodEffects<z.ZodNullable<z.ZodString>, string | null, string | null>>;
767
831
  transferAmount: z.ZodEffects<z.ZodUnion<[z.ZodNumber, z.ZodString]>, number, string | number>;
832
+ attachedFiles: z.ZodArray<z.ZodObject<{
833
+ uuid: z.ZodString;
834
+ fileName: z.ZodString;
835
+ fileSize: z.ZodNumber;
836
+ mimeType: z.ZodString;
837
+ location: z.ZodString;
838
+ createdAt: z.ZodEffects<z.ZodUnion<[z.ZodDate, z.ZodNumber]>, Date, number | Date>;
839
+ }, "strip", z.ZodTypeAny, {
840
+ location: string;
841
+ uuid: string;
842
+ createdAt: Date;
843
+ fileName: string;
844
+ fileSize: number;
845
+ mimeType: string;
846
+ }, {
847
+ location: string;
848
+ uuid: string;
849
+ createdAt: (number | Date) & (number | Date | undefined);
850
+ fileName: string;
851
+ fileSize: number;
852
+ mimeType: string;
853
+ }>, "many">;
768
854
  createdAt: z.ZodEffects<z.ZodUnion<[z.ZodDate, z.ZodNumber]>, Date, number | Date>;
769
855
  }, "strip", z.ZodTypeAny, {
770
856
  id: number;
@@ -835,6 +921,14 @@ export declare const ZDeleteTransactionResponsePayload: z.ZodObject<{
835
921
  };
836
922
  processedAt: Date;
837
923
  transferAmount: number;
924
+ attachedFiles: {
925
+ location: string;
926
+ uuid: string;
927
+ createdAt: Date;
928
+ fileName: string;
929
+ fileSize: number;
930
+ mimeType: string;
931
+ }[];
838
932
  }, {
839
933
  id: number;
840
934
  receiver: string;
@@ -903,6 +997,14 @@ export declare const ZDeleteTransactionResponsePayload: z.ZodObject<{
903
997
  };
904
998
  processedAt: (number | Date) & (number | Date | undefined);
905
999
  transferAmount: string | number;
1000
+ attachedFiles: {
1001
+ location: string;
1002
+ uuid: string;
1003
+ createdAt: (number | Date) & (number | Date | undefined);
1004
+ fileName: string;
1005
+ fileSize: number;
1006
+ mimeType: string;
1007
+ }[];
906
1008
  description?: string | null | undefined;
907
1009
  }>, "many">;
908
1010
  failed: z.ZodArray<z.ZodObject<{
@@ -985,6 +1087,14 @@ export declare const ZDeleteTransactionResponsePayload: z.ZodObject<{
985
1087
  };
986
1088
  processedAt: Date;
987
1089
  transferAmount: number;
1090
+ attachedFiles: {
1091
+ location: string;
1092
+ uuid: string;
1093
+ createdAt: Date;
1094
+ fileName: string;
1095
+ fileSize: number;
1096
+ mimeType: string;
1097
+ }[];
988
1098
  }[];
989
1099
  }, {
990
1100
  failed: {
@@ -1058,6 +1168,14 @@ export declare const ZDeleteTransactionResponsePayload: z.ZodObject<{
1058
1168
  };
1059
1169
  processedAt: (number | Date) & (number | Date | undefined);
1060
1170
  transferAmount: string | number;
1171
+ attachedFiles: {
1172
+ location: string;
1173
+ uuid: string;
1174
+ createdAt: (number | Date) & (number | Date | undefined);
1175
+ fileName: string;
1176
+ fileSize: number;
1177
+ mimeType: string;
1178
+ }[];
1061
1179
  description?: string | null | undefined;
1062
1180
  }[];
1063
1181
  }>;
@@ -1,11 +1,27 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ZDeleteTransactionResponsePayload = exports.ZDeleteTransactionPayload = exports.ZUpdateTransactionPayload = exports.ZCreateTransactionPayload = exports.ZTransaction = void 0;
3
+ exports.ZDeleteTransactionResponsePayload = exports.ZDeleteTransactionPayload = exports.ZUpdateTransactionPayload = exports.ZCreateTransactionPayload = exports.ZTransaction = exports.ZTransactionFile = void 0;
4
4
  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
8
  const Base_type_1 = require("./Base.type");
9
+ /**
10
+ * TransactionFile
11
+ */
12
+ exports.ZTransactionFile = zod_1.z.object({
13
+ uuid: zod_1.z.string().uuid(),
14
+ // owner: ZUser,
15
+ // transaction: ZTransaction,
16
+ fileName: zod_1.z.string(),
17
+ fileSize: zod_1.z.number(),
18
+ mimeType: zod_1.z.string().max(20, { message: 'Mimetype is too long' }),
19
+ location: zod_1.z.string().max(100, { message: 'Location is too long' }),
20
+ createdAt: Base_type_1.ZCreatedAt,
21
+ });
22
+ /**
23
+ * Transaction
24
+ */
9
25
  const ZTransferAmount = zod_1.z
10
26
  .number()
11
27
  .or(zod_1.z.string())
@@ -19,6 +35,7 @@ exports.ZTransaction = zod_1.z.object({
19
35
  receiver: zod_1.z.string(),
20
36
  description: Base_type_1.ZDescription,
21
37
  transferAmount: ZTransferAmount,
38
+ attachedFiles: zod_1.z.array(exports.ZTransactionFile),
22
39
  createdAt: Base_type_1.ZCreatedAt,
23
40
  });
24
41
  exports.ZCreateTransactionPayload = zod_1.z.object({
package/lib/index.d.ts CHANGED
@@ -10,3 +10,4 @@ export * from './Budget.type';
10
10
  export * from './DailyTransaction.type';
11
11
  export * from './Role.type';
12
12
  export * from './HttpStatusCode.type';
13
+ export * from './File.type';
package/lib/index.js CHANGED
@@ -26,3 +26,4 @@ __exportStar(require("./Budget.type"), exports);
26
26
  __exportStar(require("./DailyTransaction.type"), exports);
27
27
  __exportStar(require("./Role.type"), exports);
28
28
  __exportStar(require("./HttpStatusCode.type"), exports);
29
+ __exportStar(require("./File.type"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@budgetbuddyde/types",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "main": "lib/index.js",
5
5
  "types": "lib/index.d.ts",
6
6
  "description": "Budget Buddy Typescript Types",