@ampsec/platform-client 69.4.0 → 69.6.0

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/build/src/dto/assets.dto.d.ts +3 -0
  2. package/build/src/dto/assets.dto.js +1 -0
  3. package/build/src/dto/assets.dto.js.map +1 -1
  4. package/build/src/dto/coverage.dto.d.ts +27 -1
  5. package/build/src/dto/enums/findingBuckets.d.ts +21 -0
  6. package/build/src/dto/enums/findingBuckets.js +25 -0
  7. package/build/src/dto/enums/findingBuckets.js.map +1 -0
  8. package/build/src/dto/enums/index.d.ts +1 -0
  9. package/build/src/dto/enums/index.js +1 -0
  10. package/build/src/dto/enums/index.js.map +1 -1
  11. package/build/src/dto/findings.dto.d.ts +45 -5
  12. package/build/src/dto/findings.dto.js +16 -1
  13. package/build/src/dto/findings.dto.js.map +1 -1
  14. package/build/src/dto/flows.dto.d.ts +9 -0
  15. package/build/src/dto/flows.dto.js +1 -0
  16. package/build/src/dto/flows.dto.js.map +1 -1
  17. package/build/src/dto/notification.dto.d.ts +36 -36
  18. package/build/src/dto/page.dto.d.ts +62 -14
  19. package/build/src/dto/page.dto.js +41 -0
  20. package/build/src/dto/page.dto.js.map +1 -1
  21. package/build/src/dto/platform/platform.findings.dto.d.ts +6 -6
  22. package/build/src/dto/platform/platform.flows.dto.d.ts +6 -0
  23. package/build/src/dto/platform/platform.saasAssets.dto.d.ts +14 -0
  24. package/build/src/dto/platform/platform.tokens.dto.d.ts +6 -6
  25. package/build/src/dto/saasAssets.dto.d.ts +44 -0
  26. package/build/src/dto/saasAssets.dto.js +4 -0
  27. package/build/src/dto/saasAssets.dto.js.map +1 -1
  28. package/build/src/dto/tokens.dto.d.ts +5 -5
  29. package/build/src/services/engagements.service.d.ts +3 -0
  30. package/build/src/services/engagements.service.js +1 -0
  31. package/build/src/services/engagements.service.js.map +1 -1
  32. package/build/src/services/entity.service.d.ts +1 -0
  33. package/build/src/services/entity.service.js +12 -0
  34. package/build/src/services/entity.service.js.map +1 -1
  35. package/build/src/services/findings.service.d.ts +12 -1
  36. package/build/src/services/findings.service.js +24 -0
  37. package/build/src/services/findings.service.js.map +1 -1
  38. package/package.json +1 -1
  39. package/src/dto/assets.dto.ts +1 -0
  40. package/src/dto/enums/findingBuckets.ts +21 -0
  41. package/src/dto/enums/index.ts +1 -0
  42. package/src/dto/findings.dto.ts +20 -0
  43. package/src/dto/flows.dto.ts +2 -0
  44. package/src/dto/page.dto.ts +43 -12
  45. package/src/dto/saasAssets.dto.ts +4 -0
  46. package/src/services/engagements.service.ts +1 -0
  47. package/src/services/entity.service.ts +13 -0
  48. package/src/services/findings.service.ts +25 -1
@@ -323,8 +323,9 @@ export declare const _SlackNotificationUpsertDto: z.ZodObject<{
323
323
  createdAt: z.ZodOptional<z.ZodString>;
324
324
  updatedAt: z.ZodOptional<z.ZodString>;
325
325
  deletedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
326
- fid: z.ZodOptional<z.ZodString>;
326
+ flowStateId: z.ZodOptional<z.ZodString>;
327
327
  context: z.ZodOptional<z.ZodNativeEnum<typeof NotificationContextKind>>;
328
+ fid: z.ZodOptional<z.ZodString>;
328
329
  contentStrategy: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
329
330
  kind: z.ZodLiteral<ContentStrategyKind.RAW>;
330
331
  content: z.ZodString;
@@ -387,7 +388,6 @@ export declare const _SlackNotificationUpsertDto: z.ZodObject<{
387
388
  flowContext?: Record<string, any> | undefined;
388
389
  }>]>;
389
390
  agentId: z.ZodOptional<z.ZodString>;
390
- flowStateId: z.ZodOptional<z.ZodString>;
391
391
  deliveryMode: z.ZodOptional<z.ZodNativeEnum<typeof DeliveryModeKind>>;
392
392
  deliveryChannel: z.ZodLiteral<DeliveryStrategyKind.SLACK>;
393
393
  deliveryStrategy: z.ZodObject<{
@@ -467,10 +467,10 @@ export declare const _SlackNotificationUpsertDto: z.ZodObject<{
467
467
  createdAt?: string | undefined;
468
468
  updatedAt?: string | undefined;
469
469
  deletedAt?: string | null | undefined;
470
- fid?: string | undefined;
470
+ flowStateId?: string | undefined;
471
471
  context?: NotificationContextKind | undefined;
472
+ fid?: string | undefined;
472
473
  agentId?: string | undefined;
473
- flowStateId?: string | undefined;
474
474
  deliveryMode?: DeliveryModeKind | undefined;
475
475
  }, {
476
476
  status: NotificationStatus;
@@ -511,10 +511,10 @@ export declare const _SlackNotificationUpsertDto: z.ZodObject<{
511
511
  createdAt?: string | undefined;
512
512
  updatedAt?: string | undefined;
513
513
  deletedAt?: string | null | undefined;
514
- fid?: string | undefined;
514
+ flowStateId?: string | undefined;
515
515
  context?: NotificationContextKind | undefined;
516
+ fid?: string | undefined;
516
517
  agentId?: string | undefined;
517
- flowStateId?: string | undefined;
518
518
  deliveryMode?: DeliveryModeKind | undefined;
519
519
  }>;
520
520
  export type SlackNotificationUpsertDto = z.infer<typeof _SlackNotificationUpsertDto>;
@@ -525,8 +525,9 @@ export declare const _EmailNotificationUpsertDto: z.ZodObject<{
525
525
  createdAt: z.ZodOptional<z.ZodString>;
526
526
  updatedAt: z.ZodOptional<z.ZodString>;
527
527
  deletedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
528
- fid: z.ZodOptional<z.ZodString>;
528
+ flowStateId: z.ZodOptional<z.ZodString>;
529
529
  context: z.ZodOptional<z.ZodNativeEnum<typeof NotificationContextKind>>;
530
+ fid: z.ZodOptional<z.ZodString>;
530
531
  contentStrategy: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
531
532
  kind: z.ZodLiteral<ContentStrategyKind.RAW>;
532
533
  content: z.ZodString;
@@ -589,7 +590,6 @@ export declare const _EmailNotificationUpsertDto: z.ZodObject<{
589
590
  flowContext?: Record<string, any> | undefined;
590
591
  }>]>;
591
592
  agentId: z.ZodOptional<z.ZodString>;
592
- flowStateId: z.ZodOptional<z.ZodString>;
593
593
  deliveryMode: z.ZodOptional<z.ZodNativeEnum<typeof DeliveryModeKind>>;
594
594
  deliveryChannel: z.ZodLiteral<DeliveryStrategyKind.EMAIL>;
595
595
  deliveryStrategy: z.ZodObject<{
@@ -651,10 +651,10 @@ export declare const _EmailNotificationUpsertDto: z.ZodObject<{
651
651
  createdAt?: string | undefined;
652
652
  updatedAt?: string | undefined;
653
653
  deletedAt?: string | null | undefined;
654
- fid?: string | undefined;
654
+ flowStateId?: string | undefined;
655
655
  context?: NotificationContextKind | undefined;
656
+ fid?: string | undefined;
656
657
  agentId?: string | undefined;
657
- flowStateId?: string | undefined;
658
658
  deliveryMode?: DeliveryModeKind | undefined;
659
659
  }, {
660
660
  status: NotificationStatus;
@@ -692,10 +692,10 @@ export declare const _EmailNotificationUpsertDto: z.ZodObject<{
692
692
  createdAt?: string | undefined;
693
693
  updatedAt?: string | undefined;
694
694
  deletedAt?: string | null | undefined;
695
- fid?: string | undefined;
695
+ flowStateId?: string | undefined;
696
696
  context?: NotificationContextKind | undefined;
697
+ fid?: string | undefined;
697
698
  agentId?: string | undefined;
698
- flowStateId?: string | undefined;
699
699
  deliveryMode?: DeliveryModeKind | undefined;
700
700
  }>;
701
701
  export type EmailNotificationUpsertDto = z.infer<typeof _EmailNotificationUpsertDto>;
@@ -706,8 +706,9 @@ export declare const _NotificationUpsertDto: z.ZodDiscriminatedUnion<"deliveryCh
706
706
  createdAt: z.ZodOptional<z.ZodString>;
707
707
  updatedAt: z.ZodOptional<z.ZodString>;
708
708
  deletedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
709
- fid: z.ZodOptional<z.ZodString>;
709
+ flowStateId: z.ZodOptional<z.ZodString>;
710
710
  context: z.ZodOptional<z.ZodNativeEnum<typeof NotificationContextKind>>;
711
+ fid: z.ZodOptional<z.ZodString>;
711
712
  contentStrategy: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
712
713
  kind: z.ZodLiteral<ContentStrategyKind.RAW>;
713
714
  content: z.ZodString;
@@ -770,7 +771,6 @@ export declare const _NotificationUpsertDto: z.ZodDiscriminatedUnion<"deliveryCh
770
771
  flowContext?: Record<string, any> | undefined;
771
772
  }>]>;
772
773
  agentId: z.ZodOptional<z.ZodString>;
773
- flowStateId: z.ZodOptional<z.ZodString>;
774
774
  deliveryMode: z.ZodOptional<z.ZodNativeEnum<typeof DeliveryModeKind>>;
775
775
  deliveryChannel: z.ZodLiteral<DeliveryStrategyKind.SLACK>;
776
776
  deliveryStrategy: z.ZodObject<{
@@ -850,10 +850,10 @@ export declare const _NotificationUpsertDto: z.ZodDiscriminatedUnion<"deliveryCh
850
850
  createdAt?: string | undefined;
851
851
  updatedAt?: string | undefined;
852
852
  deletedAt?: string | null | undefined;
853
- fid?: string | undefined;
853
+ flowStateId?: string | undefined;
854
854
  context?: NotificationContextKind | undefined;
855
+ fid?: string | undefined;
855
856
  agentId?: string | undefined;
856
- flowStateId?: string | undefined;
857
857
  deliveryMode?: DeliveryModeKind | undefined;
858
858
  }, {
859
859
  status: NotificationStatus;
@@ -894,10 +894,10 @@ export declare const _NotificationUpsertDto: z.ZodDiscriminatedUnion<"deliveryCh
894
894
  createdAt?: string | undefined;
895
895
  updatedAt?: string | undefined;
896
896
  deletedAt?: string | null | undefined;
897
- fid?: string | undefined;
897
+ flowStateId?: string | undefined;
898
898
  context?: NotificationContextKind | undefined;
899
+ fid?: string | undefined;
899
900
  agentId?: string | undefined;
900
- flowStateId?: string | undefined;
901
901
  deliveryMode?: DeliveryModeKind | undefined;
902
902
  }>, z.ZodObject<{
903
903
  status: z.ZodNativeEnum<typeof NotificationStatus>;
@@ -906,8 +906,9 @@ export declare const _NotificationUpsertDto: z.ZodDiscriminatedUnion<"deliveryCh
906
906
  createdAt: z.ZodOptional<z.ZodString>;
907
907
  updatedAt: z.ZodOptional<z.ZodString>;
908
908
  deletedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
909
- fid: z.ZodOptional<z.ZodString>;
909
+ flowStateId: z.ZodOptional<z.ZodString>;
910
910
  context: z.ZodOptional<z.ZodNativeEnum<typeof NotificationContextKind>>;
911
+ fid: z.ZodOptional<z.ZodString>;
911
912
  contentStrategy: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
912
913
  kind: z.ZodLiteral<ContentStrategyKind.RAW>;
913
914
  content: z.ZodString;
@@ -970,7 +971,6 @@ export declare const _NotificationUpsertDto: z.ZodDiscriminatedUnion<"deliveryCh
970
971
  flowContext?: Record<string, any> | undefined;
971
972
  }>]>;
972
973
  agentId: z.ZodOptional<z.ZodString>;
973
- flowStateId: z.ZodOptional<z.ZodString>;
974
974
  deliveryMode: z.ZodOptional<z.ZodNativeEnum<typeof DeliveryModeKind>>;
975
975
  deliveryChannel: z.ZodLiteral<DeliveryStrategyKind.EMAIL>;
976
976
  deliveryStrategy: z.ZodObject<{
@@ -1032,10 +1032,10 @@ export declare const _NotificationUpsertDto: z.ZodDiscriminatedUnion<"deliveryCh
1032
1032
  createdAt?: string | undefined;
1033
1033
  updatedAt?: string | undefined;
1034
1034
  deletedAt?: string | null | undefined;
1035
- fid?: string | undefined;
1035
+ flowStateId?: string | undefined;
1036
1036
  context?: NotificationContextKind | undefined;
1037
+ fid?: string | undefined;
1037
1038
  agentId?: string | undefined;
1038
- flowStateId?: string | undefined;
1039
1039
  deliveryMode?: DeliveryModeKind | undefined;
1040
1040
  }, {
1041
1041
  status: NotificationStatus;
@@ -1073,10 +1073,10 @@ export declare const _NotificationUpsertDto: z.ZodDiscriminatedUnion<"deliveryCh
1073
1073
  createdAt?: string | undefined;
1074
1074
  updatedAt?: string | undefined;
1075
1075
  deletedAt?: string | null | undefined;
1076
- fid?: string | undefined;
1076
+ flowStateId?: string | undefined;
1077
1077
  context?: NotificationContextKind | undefined;
1078
+ fid?: string | undefined;
1078
1079
  agentId?: string | undefined;
1079
- flowStateId?: string | undefined;
1080
1080
  deliveryMode?: DeliveryModeKind | undefined;
1081
1081
  }>]>;
1082
1082
  export type NotificationUpsertDto = z.infer<typeof _NotificationUpsertDto>;
@@ -1087,8 +1087,9 @@ export declare const _NotificationDto: z.ZodIntersection<z.ZodDiscriminatedUnion
1087
1087
  createdAt: z.ZodOptional<z.ZodString>;
1088
1088
  updatedAt: z.ZodOptional<z.ZodString>;
1089
1089
  deletedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1090
- fid: z.ZodOptional<z.ZodString>;
1090
+ flowStateId: z.ZodOptional<z.ZodString>;
1091
1091
  context: z.ZodOptional<z.ZodNativeEnum<typeof NotificationContextKind>>;
1092
+ fid: z.ZodOptional<z.ZodString>;
1092
1093
  contentStrategy: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1093
1094
  kind: z.ZodLiteral<ContentStrategyKind.RAW>;
1094
1095
  content: z.ZodString;
@@ -1151,7 +1152,6 @@ export declare const _NotificationDto: z.ZodIntersection<z.ZodDiscriminatedUnion
1151
1152
  flowContext?: Record<string, any> | undefined;
1152
1153
  }>]>;
1153
1154
  agentId: z.ZodOptional<z.ZodString>;
1154
- flowStateId: z.ZodOptional<z.ZodString>;
1155
1155
  deliveryMode: z.ZodOptional<z.ZodNativeEnum<typeof DeliveryModeKind>>;
1156
1156
  deliveryChannel: z.ZodLiteral<DeliveryStrategyKind.SLACK>;
1157
1157
  deliveryStrategy: z.ZodObject<{
@@ -1231,10 +1231,10 @@ export declare const _NotificationDto: z.ZodIntersection<z.ZodDiscriminatedUnion
1231
1231
  createdAt?: string | undefined;
1232
1232
  updatedAt?: string | undefined;
1233
1233
  deletedAt?: string | null | undefined;
1234
- fid?: string | undefined;
1234
+ flowStateId?: string | undefined;
1235
1235
  context?: NotificationContextKind | undefined;
1236
+ fid?: string | undefined;
1236
1237
  agentId?: string | undefined;
1237
- flowStateId?: string | undefined;
1238
1238
  deliveryMode?: DeliveryModeKind | undefined;
1239
1239
  }, {
1240
1240
  status: NotificationStatus;
@@ -1275,10 +1275,10 @@ export declare const _NotificationDto: z.ZodIntersection<z.ZodDiscriminatedUnion
1275
1275
  createdAt?: string | undefined;
1276
1276
  updatedAt?: string | undefined;
1277
1277
  deletedAt?: string | null | undefined;
1278
- fid?: string | undefined;
1278
+ flowStateId?: string | undefined;
1279
1279
  context?: NotificationContextKind | undefined;
1280
+ fid?: string | undefined;
1280
1281
  agentId?: string | undefined;
1281
- flowStateId?: string | undefined;
1282
1282
  deliveryMode?: DeliveryModeKind | undefined;
1283
1283
  }>, z.ZodObject<{
1284
1284
  status: z.ZodNativeEnum<typeof NotificationStatus>;
@@ -1287,8 +1287,9 @@ export declare const _NotificationDto: z.ZodIntersection<z.ZodDiscriminatedUnion
1287
1287
  createdAt: z.ZodOptional<z.ZodString>;
1288
1288
  updatedAt: z.ZodOptional<z.ZodString>;
1289
1289
  deletedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
1290
- fid: z.ZodOptional<z.ZodString>;
1290
+ flowStateId: z.ZodOptional<z.ZodString>;
1291
1291
  context: z.ZodOptional<z.ZodNativeEnum<typeof NotificationContextKind>>;
1292
+ fid: z.ZodOptional<z.ZodString>;
1292
1293
  contentStrategy: z.ZodDiscriminatedUnion<"kind", [z.ZodObject<{
1293
1294
  kind: z.ZodLiteral<ContentStrategyKind.RAW>;
1294
1295
  content: z.ZodString;
@@ -1351,7 +1352,6 @@ export declare const _NotificationDto: z.ZodIntersection<z.ZodDiscriminatedUnion
1351
1352
  flowContext?: Record<string, any> | undefined;
1352
1353
  }>]>;
1353
1354
  agentId: z.ZodOptional<z.ZodString>;
1354
- flowStateId: z.ZodOptional<z.ZodString>;
1355
1355
  deliveryMode: z.ZodOptional<z.ZodNativeEnum<typeof DeliveryModeKind>>;
1356
1356
  deliveryChannel: z.ZodLiteral<DeliveryStrategyKind.EMAIL>;
1357
1357
  deliveryStrategy: z.ZodObject<{
@@ -1413,10 +1413,10 @@ export declare const _NotificationDto: z.ZodIntersection<z.ZodDiscriminatedUnion
1413
1413
  createdAt?: string | undefined;
1414
1414
  updatedAt?: string | undefined;
1415
1415
  deletedAt?: string | null | undefined;
1416
- fid?: string | undefined;
1416
+ flowStateId?: string | undefined;
1417
1417
  context?: NotificationContextKind | undefined;
1418
+ fid?: string | undefined;
1418
1419
  agentId?: string | undefined;
1419
- flowStateId?: string | undefined;
1420
1420
  deliveryMode?: DeliveryModeKind | undefined;
1421
1421
  }, {
1422
1422
  status: NotificationStatus;
@@ -1454,10 +1454,10 @@ export declare const _NotificationDto: z.ZodIntersection<z.ZodDiscriminatedUnion
1454
1454
  createdAt?: string | undefined;
1455
1455
  updatedAt?: string | undefined;
1456
1456
  deletedAt?: string | null | undefined;
1457
- fid?: string | undefined;
1457
+ flowStateId?: string | undefined;
1458
1458
  context?: NotificationContextKind | undefined;
1459
+ fid?: string | undefined;
1459
1460
  agentId?: string | undefined;
1460
- flowStateId?: string | undefined;
1461
1461
  deliveryMode?: DeliveryModeKind | undefined;
1462
1462
  }>]>, z.ZodObject<{
1463
1463
  id: z.ZodString;
@@ -1,18 +1,66 @@
1
- export type Page<T> = {
1
+ import { z } from 'zod';
2
+ export declare const getTypedPageSchema: <DataT>(dataSchema?: z.ZodType<DataT>) => z.ZodObject<{
3
+ kind: z.ZodString;
4
+ data: z.ZodArray<z.ZodType<DataT, z.ZodTypeDef, DataT>, "many">;
5
+ error: z.ZodNullable<z.ZodString>;
6
+ hints: z.ZodIntersection<z.ZodObject<{
7
+ limit: z.ZodOptional<z.ZodNumber>;
8
+ offset: z.ZodOptional<z.ZodNumber>;
9
+ hasMore: z.ZodOptional<z.ZodBoolean>;
10
+ next: z.ZodOptional<z.ZodString>;
11
+ count: z.ZodOptional<z.ZodNumber>;
12
+ links: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
13
+ }, "strip", z.ZodTypeAny, {
14
+ limit?: number | undefined;
15
+ offset?: number | undefined;
16
+ hasMore?: boolean | undefined;
17
+ next?: string | undefined;
18
+ count?: number | undefined;
19
+ links?: Record<string, string> | undefined;
20
+ }, {
21
+ limit?: number | undefined;
22
+ offset?: number | undefined;
23
+ hasMore?: boolean | undefined;
24
+ next?: string | undefined;
25
+ count?: number | undefined;
26
+ links?: Record<string, string> | undefined;
27
+ }>, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodNumber, z.ZodString, z.ZodBoolean, z.ZodNull, z.ZodRecord<z.ZodString, z.ZodString>, z.ZodUndefined]>>>;
28
+ }, "strip", z.ZodTypeAny, {
29
+ error: string | null;
30
+ data: DataT[];
31
+ kind: string;
32
+ hints: {
33
+ limit?: number | undefined;
34
+ offset?: number | undefined;
35
+ hasMore?: boolean | undefined;
36
+ next?: string | undefined;
37
+ count?: number | undefined;
38
+ links?: Record<string, string> | undefined;
39
+ } & Record<string, string | number | boolean | Record<string, string> | null | undefined>;
40
+ }, {
41
+ error: string | null;
42
+ data: DataT[];
2
43
  kind: string;
3
- data: T[];
44
+ hints: {
45
+ limit?: number | undefined;
46
+ offset?: number | undefined;
47
+ hasMore?: boolean | undefined;
48
+ next?: string | undefined;
49
+ count?: number | undefined;
50
+ links?: Record<string, string> | undefined;
51
+ } & Record<string, string | number | boolean | Record<string, string> | null | undefined>;
52
+ }>;
53
+ export declare const toTypedPage: <DataT>(dataSchema: z.ZodType<DataT>, data: unknown) => {
54
+ data: DataT[];
4
55
  error: string | null;
56
+ kind: string;
5
57
  hints: {
6
- limit?: number;
7
- offset?: number;
8
- hasMore?: boolean;
9
- next?: string;
10
- count?: number;
11
- links?: {
12
- [keyName: string]: string;
13
- };
14
- [propName: string]: number | string | boolean | null | {
15
- [keyName: string]: string;
16
- } | undefined;
17
- };
58
+ limit?: number | undefined;
59
+ offset?: number | undefined;
60
+ hasMore?: boolean | undefined;
61
+ next?: string | undefined;
62
+ count?: number | undefined;
63
+ links?: Record<string, string> | undefined;
64
+ } & Record<string, string | number | boolean | Record<string, string> | null | undefined>;
18
65
  };
66
+ export type Page<DataT> = z.infer<ReturnType<typeof getTypedPageSchema<DataT>>>;
@@ -1,3 +1,44 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.toTypedPage = exports.getTypedPageSchema = void 0;
4
+ const zod_1 = require("zod");
5
+ const _PageHintValue = zod_1.z.union([zod_1.z.number(), zod_1.z.string(), zod_1.z.boolean(), zod_1.z.null(), zod_1.z.record(zod_1.z.string()), zod_1.z.undefined()]);
6
+ const getTypedPageSchema = (dataSchema = zod_1.z.any()) => zod_1.z.object({
7
+ kind: zod_1.z.string(),
8
+ data: zod_1.z.array(dataSchema),
9
+ error: zod_1.z.string().nullable(),
10
+ hints: zod_1.z
11
+ .object({
12
+ limit: zod_1.z.number().optional(),
13
+ offset: zod_1.z.number().optional(),
14
+ hasMore: zod_1.z.boolean().optional(),
15
+ next: zod_1.z.string().optional(),
16
+ count: zod_1.z.number().optional(),
17
+ links: zod_1.z.record(zod_1.z.string()).optional(),
18
+ })
19
+ .and(zod_1.z.record(_PageHintValue)),
20
+ });
21
+ exports.getTypedPageSchema = getTypedPageSchema;
22
+ const toTypedPage = (dataSchema, data) => {
23
+ const structuredData = (0, exports.getTypedPageSchema)().parse(data);
24
+ return {
25
+ ...structuredData,
26
+ data: structuredData.data.map((d) => dataSchema.parse(d)),
27
+ };
28
+ };
29
+ exports.toTypedPage = toTypedPage;
30
+ // export type Page<T> = {
31
+ // kind: string;
32
+ // data: T[];
33
+ // error: string | null;
34
+ // hints: {
35
+ // limit?: number;
36
+ // offset?: number;
37
+ // hasMore?: boolean;
38
+ // next?: string;
39
+ // count?: number;
40
+ // links?: {[keyName: string]: string};
41
+ // [propName: string]: number | string | boolean | null | {[keyName: string]: string} | undefined;
42
+ // };
43
+ // };
3
44
  //# sourceMappingURL=page.dto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"page.dto.js","sourceRoot":"","sources":["../../../src/dto/page.dto.ts"],"names":[],"mappings":""}
1
+ {"version":3,"file":"page.dto.js","sourceRoot":"","sources":["../../../src/dto/page.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AAEtB,MAAM,cAAc,GAAG,OAAC,CAAC,KAAK,CAAC,CAAC,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,MAAM,EAAE,EAAE,OAAC,CAAC,OAAO,EAAE,EAAE,OAAC,CAAC,IAAI,EAAE,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,EAAE,OAAC,CAAC,SAAS,EAAE,CAAC,CAAC,CAAC;AAE9G,MAAM,kBAAkB,GAAG,CAAQ,aAA+B,OAAC,CAAC,GAAG,EAAE,EAAE,EAAE,CAClF,OAAC,CAAC,MAAM,CAAC;IACP,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE;IAChB,IAAI,EAAE,OAAC,CAAC,KAAK,CAAC,UAAU,CAAC;IACzB,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;IAC5B,KAAK,EAAE,OAAC;SACL,MAAM,CAAC;QACN,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC5B,MAAM,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC7B,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE,CAAC,QAAQ,EAAE;QAC/B,IAAI,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC3B,KAAK,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;QAC5B,KAAK,EAAE,OAAC,CAAC,MAAM,CAAC,OAAC,CAAC,MAAM,EAAE,CAAC,CAAC,QAAQ,EAAE;KACvC,CAAC;SACD,GAAG,CAAC,OAAC,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;CACjC,CAAC,CAAC;AAfQ,QAAA,kBAAkB,sBAe1B;AAEE,MAAM,WAAW,GAAG,CAAQ,UAA4B,EAAE,IAAa,EAAE,EAAE;IAChF,MAAM,cAAc,GAAG,IAAA,0BAAkB,GAAE,CAAC,KAAK,CAAC,IAAI,CAAC,CAAC;IACxD,OAAO;QACL,GAAG,cAAc;QACjB,IAAI,EAAE,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC,CAAU,EAAE,EAAE,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;KACnE,CAAC;AACJ,CAAC,CAAC;AANW,QAAA,WAAW,eAMtB;AAIF,0BAA0B;AAC1B,kBAAkB;AAClB,eAAe;AACf,0BAA0B;AAC1B,aAAa;AACb,sBAAsB;AACtB,uBAAuB;AACvB,yBAAyB;AACzB,qBAAqB;AACrB,sBAAsB;AACtB,2CAA2C;AAC3C,sGAAsG;AACtG,OAAO;AACP,KAAK"}
@@ -14,8 +14,8 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
14
14
  displayValue: z.ZodString;
15
15
  score: z.ZodOptional<z.ZodNumber>;
16
16
  kind: z.ZodNativeEnum<typeof import("..").FindingSpecKind>;
17
- eventType: z.ZodString;
18
17
  severity: z.ZodNativeEnum<typeof import("..").FindingSeverity>;
18
+ eventType: z.ZodString;
19
19
  insights: z.ZodOptional<z.ZodObject<{
20
20
  meta: z.ZodOptional<z.ZodObject<{
21
21
  kind: z.ZodNativeEnum<typeof import("..").FindingKind>;
@@ -121,8 +121,8 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
121
121
  deletedAt: string | null;
122
122
  displayValue: string;
123
123
  kind: import("..").FindingSpecKind;
124
- eventType: string;
125
124
  severity: import("..").FindingSeverity;
125
+ eventType: string;
126
126
  description?: unknown;
127
127
  cid?: string | null | undefined;
128
128
  score?: number | undefined;
@@ -156,8 +156,8 @@ export declare const _PlatformFindingSpecDto: z.ZodObject<{
156
156
  deletedAt: string | null;
157
157
  displayValue: string;
158
158
  kind: import("..").FindingSpecKind;
159
- eventType: string;
160
159
  severity: import("..").FindingSeverity;
160
+ eventType: string;
161
161
  description?: unknown;
162
162
  cid?: string | null | undefined;
163
163
  score?: number | undefined;
@@ -195,8 +195,8 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
195
195
  displayValue: z.ZodString;
196
196
  score: z.ZodOptional<z.ZodNumber>;
197
197
  kind: z.ZodNativeEnum<typeof import("..").FindingSpecKind>;
198
- eventType: z.ZodString;
199
198
  severity: z.ZodNativeEnum<typeof import("..").FindingSeverity>;
199
+ eventType: z.ZodString;
200
200
  insights: z.ZodOptional<z.ZodObject<{
201
201
  meta: z.ZodOptional<z.ZodObject<{
202
202
  kind: z.ZodNativeEnum<typeof import("..").FindingKind>;
@@ -298,8 +298,8 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
298
298
  tid: string;
299
299
  displayValue: string;
300
300
  kind: import("..").FindingSpecKind;
301
- eventType: string;
302
301
  severity: import("..").FindingSeverity;
302
+ eventType: string;
303
303
  description?: unknown;
304
304
  id?: string | undefined;
305
305
  cid?: string | null | undefined;
@@ -333,8 +333,8 @@ export declare const _PlatformFindingSpecUpsertDto: z.ZodObject<{
333
333
  tid: string;
334
334
  displayValue: string;
335
335
  kind: import("..").FindingSpecKind;
336
- eventType: string;
337
336
  severity: import("..").FindingSeverity;
337
+ eventType: string;
338
338
  description?: unknown;
339
339
  id?: string | undefined;
340
340
  cid?: string | null | undefined;
@@ -1070,6 +1070,7 @@ export declare const _PlatformFlowStateUpsertDto: z.ZodObject<{
1070
1070
  error?: unknown;
1071
1071
  };
1072
1072
  }>, "many">;
1073
+ bucketKey: z.ZodOptional<z.ZodString>;
1073
1074
  id: z.ZodOptional<z.ZodString>;
1074
1075
  createdAt: z.ZodOptional<z.ZodString>;
1075
1076
  updatedAt: z.ZodOptional<z.ZodString>;
@@ -1108,6 +1109,7 @@ export declare const _PlatformFlowStateUpsertDto: z.ZodObject<{
1108
1109
  fid?: string | undefined;
1109
1110
  specId?: string | undefined;
1110
1111
  specStatus?: FlowSpecStatusKind | undefined;
1112
+ bucketKey?: string | undefined;
1111
1113
  id?: string | undefined;
1112
1114
  createdAt?: string | undefined;
1113
1115
  updatedAt?: string | undefined;
@@ -1146,6 +1148,7 @@ export declare const _PlatformFlowStateUpsertDto: z.ZodObject<{
1146
1148
  fid?: string | undefined;
1147
1149
  specId?: string | undefined;
1148
1150
  specStatus?: FlowSpecStatusKind | undefined;
1151
+ bucketKey?: string | undefined;
1149
1152
  id?: string | undefined;
1150
1153
  createdAt?: string | undefined;
1151
1154
  updatedAt?: string | undefined;
@@ -1280,6 +1283,7 @@ export declare const _PlatformFlowStateDto: z.ZodObject<{
1280
1283
  error?: unknown;
1281
1284
  };
1282
1285
  }>, "many">;
1286
+ bucketKey: z.ZodOptional<z.ZodString>;
1283
1287
  id: z.ZodString;
1284
1288
  createdAt: z.ZodString;
1285
1289
  updatedAt: z.ZodString;
@@ -1323,6 +1327,7 @@ export declare const _PlatformFlowStateDto: z.ZodObject<{
1323
1327
  fid?: string | undefined;
1324
1328
  specId?: string | undefined;
1325
1329
  specStatus?: FlowSpecStatusKind | undefined;
1330
+ bucketKey?: string | undefined;
1326
1331
  }, {
1327
1332
  status: "RUNNING" | "SUCCESS" | "ERROR" | "CANCELLED" | "EXPIRED";
1328
1333
  id: string;
@@ -1361,6 +1366,7 @@ export declare const _PlatformFlowStateDto: z.ZodObject<{
1361
1366
  fid?: string | undefined;
1362
1367
  specId?: string | undefined;
1363
1368
  specStatus?: FlowSpecStatusKind | undefined;
1369
+ bucketKey?: string | undefined;
1364
1370
  }>;
1365
1371
  export type PlatformFlowStateDto = z.infer<typeof _PlatformFlowStateDto>;
1366
1372
  export declare const NOOP_FLOW_SPEC: PlatformFlowSpecDto;
@@ -48,6 +48,8 @@ export declare const _StagedSaasAssetUpsertDto: z.ZodObject<{
48
48
  }, {
49
49
  email?: string | undefined;
50
50
  }>>;
51
+ make: z.ZodOptional<z.ZodString>;
52
+ model: z.ZodOptional<z.ZodString>;
51
53
  }, "strip", z.ZodTypeAny, {
52
54
  extId: string;
53
55
  assetType: import("..").GlobalAssetType;
@@ -62,6 +64,8 @@ export declare const _StagedSaasAssetUpsertDto: z.ZodObject<{
62
64
  owner?: {
63
65
  email?: string | undefined;
64
66
  } | undefined;
67
+ make?: string | undefined;
68
+ model?: string | undefined;
65
69
  }, {
66
70
  extId: string;
67
71
  assetType: import("..").GlobalAssetType;
@@ -76,6 +80,8 @@ export declare const _StagedSaasAssetUpsertDto: z.ZodObject<{
76
80
  owner?: {
77
81
  email?: string | undefined;
78
82
  } | undefined;
83
+ make?: string | undefined;
84
+ model?: string | undefined;
79
85
  }>;
80
86
  _raw: z.ZodUnknown;
81
87
  }, "strip", z.ZodTypeAny, {
@@ -93,6 +99,8 @@ export declare const _StagedSaasAssetUpsertDto: z.ZodObject<{
93
99
  owner?: {
94
100
  email?: string | undefined;
95
101
  } | undefined;
102
+ make?: string | undefined;
103
+ model?: string | undefined;
96
104
  };
97
105
  _raw?: unknown;
98
106
  }, {
@@ -110,6 +118,8 @@ export declare const _StagedSaasAssetUpsertDto: z.ZodObject<{
110
118
  owner?: {
111
119
  email?: string | undefined;
112
120
  } | undefined;
121
+ make?: string | undefined;
122
+ model?: string | undefined;
113
123
  };
114
124
  _raw?: unknown;
115
125
  }>;
@@ -139,6 +149,8 @@ export declare const _StagedSaasAssetUpsertDto: z.ZodObject<{
139
149
  owner?: {
140
150
  email?: string | undefined;
141
151
  } | undefined;
152
+ make?: string | undefined;
153
+ model?: string | undefined;
142
154
  };
143
155
  _raw?: unknown;
144
156
  };
@@ -173,6 +185,8 @@ export declare const _StagedSaasAssetUpsertDto: z.ZodObject<{
173
185
  owner?: {
174
186
  email?: string | undefined;
175
187
  } | undefined;
188
+ make?: string | undefined;
189
+ model?: string | undefined;
176
190
  };
177
191
  _raw?: unknown;
178
192
  };
@@ -1,6 +1,7 @@
1
1
  import { z } from 'zod';
2
2
  export declare const _PlatformTokenDto: z.ZodObject<{
3
3
  displayValue: z.ZodOptional<z.ZodString>;
4
+ key: z.ZodString;
4
5
  links: z.ZodObject<{
5
6
  _self: z.ZodString;
6
7
  webhook: z.ZodString;
@@ -11,7 +12,6 @@ export declare const _PlatformTokenDto: z.ZodObject<{
11
12
  _self: string;
12
13
  webhook: string;
13
14
  }>;
14
- key: z.ZodString;
15
15
  id: z.ZodString;
16
16
  createdAt: z.ZodString;
17
17
  updatedAt: z.ZodString;
@@ -23,11 +23,11 @@ export declare const _PlatformTokenDto: z.ZodObject<{
23
23
  createdAt: string;
24
24
  updatedAt: string;
25
25
  deletedAt: string | null;
26
+ key: string;
26
27
  links: {
27
28
  _self: string;
28
29
  webhook: string;
29
30
  };
30
- key: string;
31
31
  displayValue?: string | undefined;
32
32
  }, {
33
33
  id: string;
@@ -35,16 +35,17 @@ export declare const _PlatformTokenDto: z.ZodObject<{
35
35
  createdAt: string;
36
36
  updatedAt: string;
37
37
  deletedAt: string | null;
38
+ key: string;
38
39
  links: {
39
40
  _self: string;
40
41
  webhook: string;
41
42
  };
42
- key: string;
43
43
  displayValue?: string | undefined;
44
44
  }>;
45
45
  export type PlatformTokenDto = z.infer<typeof _PlatformTokenDto>;
46
46
  export declare const _PlatformTokenUpsertDto: z.ZodObject<{
47
47
  displayValue: z.ZodOptional<z.ZodString>;
48
+ key: z.ZodString;
48
49
  links: z.ZodObject<{
49
50
  _self: z.ZodString;
50
51
  webhook: z.ZodString;
@@ -55,18 +56,17 @@ export declare const _PlatformTokenUpsertDto: z.ZodObject<{
55
56
  _self: string;
56
57
  webhook: string;
57
58
  }>;
58
- key: z.ZodString;
59
59
  id: z.ZodOptional<z.ZodString>;
60
60
  createdAt: z.ZodOptional<z.ZodString>;
61
61
  updatedAt: z.ZodOptional<z.ZodString>;
62
62
  deletedAt: z.ZodOptional<z.ZodNullable<z.ZodString>>;
63
63
  tid: z.ZodOptional<z.ZodString>;
64
64
  }, "strip", z.ZodTypeAny, {
65
+ key: string;
65
66
  links: {
66
67
  _self: string;
67
68
  webhook: string;
68
69
  };
69
- key: string;
70
70
  displayValue?: string | undefined;
71
71
  id?: string | undefined;
72
72
  createdAt?: string | undefined;
@@ -74,11 +74,11 @@ export declare const _PlatformTokenUpsertDto: z.ZodObject<{
74
74
  deletedAt?: string | null | undefined;
75
75
  tid?: string | undefined;
76
76
  }, {
77
+ key: string;
77
78
  links: {
78
79
  _self: string;
79
80
  webhook: string;
80
81
  };
81
- key: string;
82
82
  displayValue?: string | undefined;
83
83
  id?: string | undefined;
84
84
  createdAt?: string | undefined;