@ampsec/platform-client 62.8.0 → 62.9.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 (53) hide show
  1. package/build/src/dto/base.dto.d.ts +6 -0
  2. package/build/src/dto/base.dto.js +8 -2
  3. package/build/src/dto/base.dto.js.map +1 -1
  4. package/build/src/dto/customActions.dto.d.ts +365 -0
  5. package/build/src/dto/customActions.dto.js +40 -0
  6. package/build/src/dto/customActions.dto.js.map +1 -0
  7. package/build/src/dto/customScores.dto.d.ts +153 -0
  8. package/build/src/dto/customScores.dto.js +17 -0
  9. package/build/src/dto/customScores.dto.js.map +1 -0
  10. package/build/src/dto/findings.dto.d.ts +88 -0
  11. package/build/src/dto/findings.dto.js +25 -0
  12. package/build/src/dto/findings.dto.js.map +1 -1
  13. package/build/src/dto/flows.dto.d.ts +19 -0
  14. package/build/src/dto/flows.dto.js +9 -10
  15. package/build/src/dto/flows.dto.js.map +1 -1
  16. package/build/src/dto/index.d.ts +2 -0
  17. package/build/src/dto/index.js +2 -0
  18. package/build/src/dto/index.js.map +1 -1
  19. package/build/src/dto/platform/index.d.ts +2 -0
  20. package/build/src/dto/platform/index.js +2 -0
  21. package/build/src/dto/platform/index.js.map +1 -1
  22. package/build/src/dto/platform/platform.customActions.dto.d.ts +303 -0
  23. package/build/src/dto/platform/platform.customActions.dto.js +12 -0
  24. package/build/src/dto/platform/platform.customActions.dto.js.map +1 -0
  25. package/build/src/dto/platform/platform.customScores.dto.d.ts +165 -0
  26. package/build/src/dto/platform/platform.customScores.dto.js +18 -0
  27. package/build/src/dto/platform/platform.customScores.dto.js.map +1 -0
  28. package/build/src/dto/platform/platform.findings.dto.d.ts +77 -0
  29. package/build/src/dto/platform/platform.findings.dto.js +9 -0
  30. package/build/src/dto/platform/platform.findings.dto.js.map +1 -1
  31. package/build/src/services/AmpApi.d.ts +5 -1
  32. package/build/src/services/AmpApi.js +4 -0
  33. package/build/src/services/AmpApi.js.map +1 -1
  34. package/build/src/services/AmpSdk.d.ts +5 -4
  35. package/build/src/services/AmpSdk.js +4 -0
  36. package/build/src/services/AmpSdk.js.map +1 -1
  37. package/build/src/services/constants.d.ts +4 -0
  38. package/build/src/services/constants.js +4 -0
  39. package/build/src/services/constants.js.map +1 -1
  40. package/package.json +1 -1
  41. package/src/dto/base.dto.ts +7 -2
  42. package/src/dto/customActions.dto.ts +44 -0
  43. package/src/dto/customScores.dto.ts +21 -0
  44. package/src/dto/findings.dto.ts +29 -1
  45. package/src/dto/flows.dto.ts +8 -11
  46. package/src/dto/index.ts +2 -0
  47. package/src/dto/platform/index.ts +2 -0
  48. package/src/dto/platform/platform.customActions.dto.ts +12 -0
  49. package/src/dto/platform/platform.customScores.dto.ts +22 -0
  50. package/src/dto/platform/platform.findings.dto.ts +12 -1
  51. package/src/services/AmpApi.ts +29 -1
  52. package/src/services/AmpSdk.ts +24 -3
  53. package/src/services/constants.ts +4 -0
@@ -0,0 +1,22 @@
1
+ import {z} from 'zod';
2
+ import {_CustomScoreCohortDto, _CustomScoreCohortUpsertDto, _CustomScoreValueDto, _CustomScoreValueUpsertDto} from '../customScores.dto';
3
+
4
+ export const _PlatformCustomScoreValueDto = _CustomScoreValueDto.extend({
5
+ tid: z.string(),
6
+ });
7
+ export type PlatformCustomScoreValueDto = z.infer<typeof _PlatformCustomScoreValueDto>;
8
+
9
+ export const _PlatformCustomScoreValueUpsertDto = _CustomScoreValueUpsertDto.extend({
10
+ tid: z.string(),
11
+ });
12
+ export type PlatformCustomScoreValueUpsertDto = z.infer<typeof _PlatformCustomScoreValueUpsertDto>;
13
+
14
+ export const _PlatformCustomScoreCohortDto = _CustomScoreCohortDto.extend({
15
+ tid: z.string(),
16
+ });
17
+ export type PlatformCustomScoreCohortDto = z.infer<typeof _PlatformCustomScoreCohortDto>;
18
+
19
+ export const _PlatformCustomScoreCohortUpsertDto = _CustomScoreCohortDto.extend({
20
+ tid: z.string(),
21
+ });
22
+ export type PlatformCustomScoreCohortUpsertDto = z.infer<typeof _PlatformCustomScoreCohortUpsertDto>;
@@ -1,6 +1,17 @@
1
- import {FindingDto, FindingUpsertDto} from '../findings.dto';
1
+ import {z} from 'zod';
2
+ import {FindingDto, FindingUpsertDto, _FindingSpecDto, _FindingSpecUpsertDto} from '../findings.dto';
2
3
  import {TenantBased, UpsertTenantBased} from './tenant.based.dto';
3
4
 
4
5
  export type PlatformFindingUpsertDto = FindingUpsertDto & UpsertTenantBased;
5
6
 
6
7
  export type PlatformFindingDto = FindingDto & TenantBased;
8
+
9
+ export const _PlatformFindingSpecDto = _FindingSpecDto.extend({
10
+ tid: z.string(),
11
+ });
12
+ export type PlatformFindingSpecDto = z.infer<typeof _PlatformFindingSpecDto>;
13
+
14
+ export const _PlatformFindingSpecUpsertDto = _FindingSpecUpsertDto.extend({
15
+ tid: z.string(),
16
+ });
17
+ export type PlatformFindingSpecUpsertDto = z.infer<typeof _PlatformFindingSpecUpsertDto>;
@@ -1,4 +1,24 @@
1
- import {AgentDto, AgentUpsertDto, AssetDto, ProviderDto, ReportResultDto, SaasAssetDto, SaasComponentDto, SaasUserDto, TenantDto, TenantUpsertDto, UserDto} from '../dto';
1
+ import {
2
+ AgentDto,
3
+ AgentUpsertDto,
4
+ AssetDto,
5
+ CustomActionDto,
6
+ CustomActionUpsertDto,
7
+ CustomScoreCohortDto,
8
+ CustomScoreCohortUpsertDto,
9
+ CustomScoreValueDto,
10
+ CustomScoreValueUpsertDto,
11
+ FindingSpecDto,
12
+ FindingSpecUpsertDto,
13
+ ProviderDto,
14
+ ReportResultDto,
15
+ SaasAssetDto,
16
+ SaasComponentDto,
17
+ SaasUserDto,
18
+ TenantDto,
19
+ TenantUpsertDto,
20
+ UserDto,
21
+ } from '../dto';
2
22
  import {
3
23
  AmpEntityService,
4
24
  AmpEntityServiceImpl,
@@ -38,9 +58,13 @@ export class AmpApi {
38
58
  readonly asset: AmpDataService<AssetDto>;
39
59
  readonly cohorts: CohortService;
40
60
  readonly connectors: ConnectorsService;
61
+ readonly customActions: AmpEntityService<CustomActionUpsertDto, CustomActionDto>;
62
+ readonly customScoreValues: AmpEntityService<CustomScoreValueUpsertDto, CustomScoreValueDto>;
63
+ readonly customScoreCohorts: AmpEntityService<CustomScoreCohortUpsertDto, CustomScoreCohortDto>;
41
64
  readonly enums: EnumService;
42
65
  readonly findings: FindingsService;
43
66
  readonly findingsInsights: FindingsInsightsService;
67
+ readonly findingSpecs: AmpEntityService<FindingSpecUpsertDto, FindingSpecDto>;
44
68
  readonly flowSpecs: FlowSpecsService;
45
69
  readonly identity: AgentIdentityService;
46
70
  readonly install: ConnectorInstallService;
@@ -62,9 +86,13 @@ export class AmpApi {
62
86
  this.asset = new AmpDataServiceImpl<AssetDto>(rest, KIND.ASSETS);
63
87
  this.cohorts = new CohortService(rest);
64
88
  this.connectors = new ConnectorsService(rest);
89
+ this.customActions = new AmpEntityServiceImpl<CustomActionUpsertDto, CustomActionDto>(rest, KIND.CUSTOM_ACTIONS);
90
+ this.customScoreCohorts = new AmpEntityServiceImpl<CustomScoreCohortUpsertDto, CustomScoreCohortDto>(rest, KIND.CUSTOM_SCORE_COHORTS);
91
+ this.customScoreValues = new AmpEntityServiceImpl<CustomScoreValueUpsertDto, CustomScoreValueDto>(rest, KIND.CUSTOM_SCORE_VALUES);
65
92
  this.enums = new DefaultEnumService(rest);
66
93
  this.findings = new FindingsService(rest);
67
94
  this.findingsInsights = new FindingsInsightsService(rest, KIND.FINDINGS_INSIGHTS);
95
+ this.findingSpecs = new AmpEntityServiceImpl<FindingSpecUpsertDto, FindingSpecDto>(rest, KIND.FINDING_SPECS);
68
96
  this.flowSpecs = new FlowSpecsService(rest);
69
97
  this.identity = new AgentIdentityService(rest);
70
98
  this.install = new ConnectorInstallService(rest, TARGET_API_AGENT);
@@ -3,8 +3,24 @@ import {
3
3
  PlatformAgentUpsertDto,
4
4
  PlatformConnectorDto,
5
5
  PlatformConnectorUpsertDto,
6
+ PlatformCustomActionDto,
7
+ PlatformCustomActionUpsertDto,
8
+ PlatformCustomScoreCohortDto,
9
+ PlatformCustomScoreCohortUpsertDto,
10
+ PlatformCustomScoreValueDto,
11
+ PlatformCustomScoreValueUpsertDto,
6
12
  PlatformFindingDto,
13
+ PlatformFindingSpecDto,
14
+ PlatformFindingSpecUpsertDto,
7
15
  PlatformFindingUpsertDto,
16
+ PlatformFlowSpecDto,
17
+ PlatformFlowSpecUpsertDto,
18
+ PlatformFlowStateDto,
19
+ PlatformFlowStateUpsertDto,
20
+ PlatformJobExecutionStateDto,
21
+ PlatformJobExecutionStateUpsertDto,
22
+ PlatformJobSpecDto,
23
+ PlatformJobSpecUpsertDto,
8
24
  PlatformNotificationDto,
9
25
  PlatformNotificationUpsertDto,
10
26
  PlatformProviderUpsertDto,
@@ -37,14 +53,11 @@ import {
37
53
  } from './entity.service';
38
54
  import {AmpRestClientOptions, RestClient, getAmpRestClient} from './rest';
39
55
  import {KIND, TARGET_API_PLATFORM} from './constants';
40
- import {PlatformJobSpecDto, PlatformJobSpecUpsertDto} from '../dto/platform/platform.jobSpec.dto';
41
- import {PlatformJobExecutionStateDto, PlatformJobExecutionStateUpsertDto} from '../dto/platform/platform.jobExecutionState.dto';
42
56
  import {DefaultEnumService, EnumService} from './rest/EnumService';
43
57
  import {AmpSdkSettingsService} from './settings.service';
44
58
  import {AmpSaaSEntityService, AmpSaaSEntityServiceImpl, AmpSdkSaasAssetService, AmpSdkSaasComponentService, AmpSdkSaasUserService} from './saasEntity.service';
45
59
  import {ContentfulService} from './contentful.service';
46
60
  import {FindingsInsightsService} from './findingsInsights.service';
47
- import {PlatformFlowSpecDto, PlatformFlowSpecUpsertDto, PlatformFlowStateDto, PlatformFlowStateUpsertDto} from '../dto/platform/platform.flows.dto';
48
61
 
49
62
  export type AmpSdkOptions = AmpRestClientOptions;
50
63
 
@@ -62,8 +75,12 @@ export class AmpSdkServices {
62
75
  readonly asset: AmpSdkAssetService;
63
76
  readonly connectors: AmpEntityService<PlatformConnectorUpsertDto, PlatformConnectorDto>;
64
77
  readonly contentful: ContentfulService;
78
+ readonly customActions: AmpEntityService<PlatformCustomActionUpsertDto, PlatformCustomActionDto>;
79
+ readonly customScoreCohorts: AmpEntityService<PlatformCustomScoreCohortUpsertDto, PlatformCustomScoreCohortDto>;
80
+ readonly customScoreValues: AmpEntityService<PlatformCustomScoreValueUpsertDto, PlatformCustomScoreValueDto>;
65
81
  readonly enums: EnumService;
66
82
  readonly findings: AmpSaaSEntityService<PlatformFindingUpsertDto, PlatformFindingDto>;
83
+ readonly findingSpecs: AmpSaaSEntityService<PlatformFindingSpecUpsertDto, PlatformFindingSpecDto>;
67
84
  readonly findingsInsights: FindingsInsightsService;
68
85
  readonly flowSpecs: AmpSaaSEntityService<PlatformFlowSpecUpsertDto, PlatformFlowSpecDto>;
69
86
  readonly flowStates: AmpSaaSEntityService<PlatformFlowStateUpsertDto, PlatformFlowStateDto>;
@@ -88,8 +105,12 @@ export class AmpSdkServices {
88
105
  this.asset = new AmpSdkAssetService(rest, TARGET_API_PLATFORM);
89
106
  this.connectors = new AmpEntityServiceImpl<PlatformConnectorUpsertDto, PlatformConnectorDto>(rest, KIND.CONNECTORS, TARGET_API_PLATFORM);
90
107
  this.contentful = new ContentfulService();
108
+ this.customActions = new AmpEntityServiceImpl<PlatformCustomActionUpsertDto, PlatformCustomActionDto>(rest, KIND.CUSTOM_ACTIONS, TARGET_API_PLATFORM);
109
+ this.customScoreCohorts = new AmpEntityServiceImpl<PlatformCustomScoreCohortUpsertDto, PlatformCustomScoreCohortDto>(rest, KIND.CUSTOM_SCORE_COHORTS, TARGET_API_PLATFORM);
110
+ this.customScoreValues = new AmpEntityServiceImpl<PlatformCustomScoreValueUpsertDto, PlatformCustomScoreValueDto>(rest, KIND.CUSTOM_SCORE_VALUES, TARGET_API_PLATFORM);
91
111
  this.enums = new DefaultEnumService(rest, TARGET_API_PLATFORM);
92
112
  this.findings = new AmpSaaSEntityServiceImpl<PlatformFindingUpsertDto, PlatformFindingDto>(rest, KIND.FINDINGS, TARGET_API_PLATFORM);
113
+ this.findingSpecs = new AmpSaaSEntityServiceImpl<PlatformFindingSpecUpsertDto, PlatformFindingSpecDto>(rest, KIND.FINDING_SPECS, TARGET_API_PLATFORM);
93
114
  this.findingsInsights = new FindingsInsightsService(rest, KIND.FINDINGS_INSIGHTS, TARGET_API_PLATFORM);
94
115
  this.flowSpecs = new AmpSaaSEntityServiceImpl<PlatformFlowSpecUpsertDto, PlatformFlowSpecDto>(rest, KIND.FLOW_SPECS, TARGET_API_PLATFORM);
95
116
  this.flowStates = new AmpSaaSEntityServiceImpl<PlatformFlowStateUpsertDto, PlatformFlowStateDto>(rest, KIND.FLOW_STATES, TARGET_API_PLATFORM);
@@ -13,11 +13,15 @@ export const KIND = {
13
13
  AGENTS: 'agents',
14
14
  ASSETS: 'assets',
15
15
  CONNECTORS: 'connectors',
16
+ CUSTOM_ACTIONS: 'custom_actions',
17
+ CUSTOM_SCORE_COHORTS: 'custom_score_cohorts',
18
+ CUSTOM_SCORE_VALUES: 'custom_score_values',
16
19
  ENUM_DEPARTMENTS: 'departments',
17
20
  ENUM_ORGANIZATIONS: 'organizations',
18
21
  ENUM_TITLES: 'titles',
19
22
  FINDINGS: 'findings',
20
23
  FINDINGS_INSIGHTS: 'findings_insights',
24
+ FINDING_SPECS: 'findings_specs',
21
25
  FLOW_SPECS: 'flow_specs',
22
26
  FLOW_STATES: 'flow_states',
23
27
  JOB_EXECUTIONS: 'job_executions',