@ampsec/platform-client 13.2.0 → 13.3.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.
@@ -20,7 +20,7 @@ var AgentRole;
20
20
  AgentRole["SERVICE_ACCOUNT"] = "SERVICE_ACCOUNT";
21
21
  /** Unknown role. Used for validation */
22
22
  AgentRole["UNKNOWN"] = "UNKNOWN";
23
- })(AgentRole = exports.AgentRole || (exports.AgentRole = {}));
23
+ })(AgentRole || (exports.AgentRole = AgentRole = {}));
24
24
  const agentRoleLookupMap = {
25
25
  REPORT_VIEWER: AgentRole.REPORT_VIEWER,
26
26
  VIEWER: AgentRole.VIEWER,
@@ -1 +1 @@
1
- {"version":3,"file":"agent.role.js","sourceRoot":"","sources":["../../../../src/dto/enums/agent.role.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,SAiBX;AAjBD,WAAY,SAAS;IACnB,gCAAgC;IAChC,4CAA+B,CAAA;IAC/B,gCAAgC;IAChC,8BAAiB,CAAA;IACjB,qCAAqC;IACrC,4BAAe,CAAA;IACf,6DAA6D;IAC7D,4BAAe,CAAA;IACf,+BAA+B;IAC/B,4BAAe,CAAA;IACf,oCAAoC;IACpC,kCAAqB,CAAA;IACrB,0CAA0C;IAC1C,gDAAmC,CAAA;IACnC,wCAAwC;IACxC,gCAAmB,CAAA;AACrB,CAAC,EAjBW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAiBpB;AAED,MAAM,kBAAkB,GAA+B;IACrD,aAAa,EAAE,SAAS,CAAC,aAAa;IACtC,MAAM,EAAE,SAAS,CAAC,MAAM;IACxB,KAAK,EAAE,SAAS,CAAC,KAAK;IACtB,KAAK,EAAE,SAAS,CAAC,KAAK;IACtB,KAAK,EAAE,SAAS,CAAC,KAAK;IACtB,QAAQ,EAAE,SAAS,CAAC,QAAQ;IAC5B,eAAe,EAAE,SAAS,CAAC,eAAe;CAC3C,CAAC;AAEF,SAAgB,eAAe,CAAC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Status || (exports.AgentStatus = AgentStatus = {}));
11
11
  //# sourceMappingURL=agent.status.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"agent.status.js","sourceRoot":"","sources":["../../../../src/dto/enums/agent.status.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,kCAAmB,CAAA;IACnB,sCAAuB,CAAA;AACzB,CAAC,EAJW,WAAW,GAAX,mBAAW,KAAX,mBAAW,QAItB"}
1
+ {"version":3,"file":"agent.status.js","sourceRoot":"","sources":["../../../../src/dto/enums/agent.status.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,gCAAiB,CAAA;IACjB,kCAAmB,CAAA;IACnB,sCAAuB,CAAA;AACzB,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB"}
@@ -8,5 +8,5 @@ var ConnectorStatus;
8
8
  ConnectorStatus["DELETED"] = "DELETED";
9
9
  ConnectorStatus["FAILED"] = "FAILED";
10
10
  ConnectorStatus["DISABLED"] = "DISABLED";
11
- })(ConnectorStatus = exports.ConnectorStatus || (exports.ConnectorStatus = {}));
11
+ })(ConnectorStatus || (exports.ConnectorStatus = ConnectorStatus = {}));
12
12
  //# sourceMappingURL=connector.status.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"connector.status.js","sourceRoot":"","sources":["../../../../src/dto/enums/connector.status.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,sCAAmB,CAAA;IACnB,oCAAiB,CAAA;IACjB,wCAAqB,CAAA;AACvB,CAAC,EALW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAK1B"}
1
+ {"version":3,"file":"connector.status.js","sourceRoot":"","sources":["../../../../src/dto/enums/connector.status.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,oCAAiB,CAAA;IACjB,sCAAmB,CAAA;IACnB,oCAAiB,CAAA;IACjB,wCAAqB,CAAA;AACvB,CAAC,EALW,eAAe,+BAAf,eAAe,QAK1B"}
@@ -8,5 +8,5 @@ var FindingSeverity;
8
8
  FindingSeverity["MEDIUM"] = "MEDIUM";
9
9
  FindingSeverity["HIGH"] = "HIGH";
10
10
  FindingSeverity["CRITICAL"] = "CRITICAL";
11
- })(FindingSeverity = exports.FindingSeverity || (exports.FindingSeverity = {}));
11
+ })(FindingSeverity || (exports.FindingSeverity = FindingSeverity = {}));
12
12
  //# sourceMappingURL=finding.severity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"finding.severity.js","sourceRoot":"","sources":["../../../../src/dto/enums/finding.severity.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,8BAAW,CAAA;IACX,oCAAiB,CAAA;IACjB,gCAAa,CAAA;IACb,wCAAqB,CAAA;AACvB,CAAC,EALW,eAAe,GAAf,uBAAe,KAAf,uBAAe,QAK1B"}
1
+ {"version":3,"file":"finding.severity.js","sourceRoot":"","sources":["../../../../src/dto/enums/finding.severity.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,eAKX;AALD,WAAY,eAAe;IACzB,8BAAW,CAAA;IACX,oCAAiB,CAAA;IACjB,gCAAa,CAAA;IACb,wCAAqB,CAAA;AACvB,CAAC,EALW,eAAe,+BAAf,eAAe,QAK1B"}
@@ -6,5 +6,5 @@ var FindingStatus;
6
6
  (function (FindingStatus) {
7
7
  FindingStatus["OPEN"] = "OPEN";
8
8
  FindingStatus["CLOSED"] = "CLOSED";
9
- })(FindingStatus = exports.FindingStatus || (exports.FindingStatus = {}));
9
+ })(FindingStatus || (exports.FindingStatus = FindingStatus = {}));
10
10
  //# sourceMappingURL=finding.status.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"finding.status.js","sourceRoot":"","sources":["../../../../src/dto/enums/finding.status.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,8BAAa,CAAA;IACb,kCAAiB,CAAA;AACnB,CAAC,EAHW,aAAa,GAAb,qBAAa,KAAb,qBAAa,QAGxB"}
1
+ {"version":3,"file":"finding.status.js","sourceRoot":"","sources":["../../../../src/dto/enums/finding.status.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,aAGX;AAHD,WAAY,aAAa;IACvB,8BAAa,CAAA;IACb,kCAAiB,CAAA;AACnB,CAAC,EAHW,aAAa,6BAAb,aAAa,QAGxB"}
@@ -9,5 +9,5 @@ var JobExecutionStatus;
9
9
  JobExecutionStatus["RUNNING"] = "RUNNING";
10
10
  JobExecutionStatus["FAILED"] = "FAILED";
11
11
  JobExecutionStatus["SUCCEEDED"] = "SUCCEEDED";
12
- })(JobExecutionStatus = exports.JobExecutionStatus || (exports.JobExecutionStatus = {}));
12
+ })(JobExecutionStatus || (exports.JobExecutionStatus = JobExecutionStatus = {}));
13
13
  //# sourceMappingURL=jobExecution.status.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"jobExecution.status.js","sourceRoot":"","sources":["../../../../src/dto/enums/jobExecution.status.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,kBAMX;AAND,WAAY,kBAAkB;IAC5B,6CAAuB,CAAA;IACvB,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;IACnB,uCAAiB,CAAA;IACjB,6CAAuB,CAAA;AACzB,CAAC,EANW,kBAAkB,GAAlB,0BAAkB,KAAlB,0BAAkB,QAM7B"}
1
+ {"version":3,"file":"jobExecution.status.js","sourceRoot":"","sources":["../../../../src/dto/enums/jobExecution.status.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,kBAMX;AAND,WAAY,kBAAkB;IAC5B,6CAAuB,CAAA;IACvB,uCAAiB,CAAA;IACjB,yCAAmB,CAAA;IACnB,uCAAiB,CAAA;IACjB,6CAAuB,CAAA;AACzB,CAAC,EANW,kBAAkB,kCAAlB,kBAAkB,QAM7B"}
@@ -7,5 +7,5 @@ var MetricKind;
7
7
  MetricKind["BASE"] = "BASE";
8
8
  MetricKind["DESCRIPTIVE"] = "DESCRIPTIVE";
9
9
  MetricKind["TRENDING"] = "TRENDING";
10
- })(MetricKind = exports.MetricKind || (exports.MetricKind = {}));
10
+ })(MetricKind || (exports.MetricKind = MetricKind = {}));
11
11
  //# sourceMappingURL=metric.kind.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"metric.kind.js","sourceRoot":"","sources":["../../../../src/dto/enums/metric.kind.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,yCAA2B,CAAA;IAC3B,mCAAqB,CAAA;AACvB,CAAC,EAJW,UAAU,GAAV,kBAAU,KAAV,kBAAU,QAIrB"}
1
+ {"version":3,"file":"metric.kind.js","sourceRoot":"","sources":["../../../../src/dto/enums/metric.kind.ts"],"names":[],"mappings":";;;AAAA,mCAAmC;AACnC,IAAY,UAIX;AAJD,WAAY,UAAU;IACpB,2BAAa,CAAA;IACb,yCAA2B,CAAA;IAC3B,mCAAqB,CAAA;AACvB,CAAC,EAJW,UAAU,0BAAV,UAAU,QAIrB"}
@@ -1,6 +1,5 @@
1
- import { PlatformAgentDto, PlatformAgentUpsertDto, PlatformAssetDto, PlatformAssetUpsertDto, PlatformConnectorDto, PlatformConnectorUpsertDto, PlatformFindingDto, PlatformFindingUpsertDto, PlatformReportResultDto, PlatformReportResultUpsertDto, PlatformSaasAssetDto, PlatformSaasAssetUpsertDto, PlatformSaasComponentDto, PlatformSaasComponentUpsertDto, PlatformSaasUserDto, PlatformSaasUserUpsertDto, PlatformUserDto, PlatformUserUpsertDto, ProviderDto, TenantDto, TenantUpsertDto } from '../dto';
1
+ import { PlatformAgentDto, PlatformAgentUpsertDto, PlatformAssetDto, PlatformAssetUpsertDto, PlatformConnectorDto, PlatformConnectorUpsertDto, PlatformFindingDto, PlatformFindingUpsertDto, PlatformProviderUpsertDto, PlatformReportResultDto, PlatformReportResultUpsertDto, PlatformSaasAssetDto, PlatformSaasAssetUpsertDto, PlatformSaasComponentDto, PlatformSaasComponentUpsertDto, PlatformSaasUserDto, PlatformSaasUserUpsertDto, PlatformUserDto, PlatformUserUpsertDto, ProviderDto, TenantDto, TenantUpsertDto } from '../dto';
2
2
  import { AmpEntityService, AmpGlobalEntityService, AmpSaaSEntityService } from './entity.service';
3
- import { AmpDataService } from './data.service';
4
3
  import { AmpRestClientOptions, RestClient } from './rest';
5
4
  import { PlatformJobSpecDto, PlatformJobSpecUpsertDto } from '../dto/platform/platform.jobSpec.dto';
6
5
  import { PlatformJobExecutionStateDto, PlatformJobExecutionStateUpsertDto } from '../dto/platform/platform.jobExecutionState.dto';
@@ -12,9 +11,7 @@ export type AmpSdkOptions = AmpRestClientOptions;
12
11
  * trying to implement a simple web client you should leverage the AmpApi
13
12
  * instead (see {@link AmpApi} ).
14
13
  *
15
- * This client provides CRUD access to most of the AMP API. You
16
- * have READ_ONLY access to the following resources:
17
- * - providers: {@link AmpSdkServices.providers}
14
+ * This client provides CRUD access to all of the AMP API.
18
15
  */
19
16
  export declare class AmpSdkServices {
20
17
  readonly agents: AmpEntityService<PlatformAgentUpsertDto, PlatformAgentDto>;
@@ -23,7 +20,7 @@ export declare class AmpSdkServices {
23
20
  readonly findings: AmpSaaSEntityService<PlatformFindingUpsertDto, PlatformFindingDto>;
24
21
  readonly jobExecutions: AmpEntityService<PlatformJobExecutionStateUpsertDto, PlatformJobExecutionStateDto>;
25
22
  readonly jobs: AmpEntityService<PlatformJobSpecUpsertDto, PlatformJobSpecDto>;
26
- readonly providers: AmpDataService<ProviderDto>;
23
+ readonly providers: AmpEntityService<PlatformProviderUpsertDto, ProviderDto>;
27
24
  readonly reportResults: AmpSaaSEntityService<PlatformReportResultUpsertDto, PlatformReportResultDto>;
28
25
  readonly saasAssets: AmpSaaSEntityService<PlatformSaasAssetUpsertDto, PlatformSaasAssetDto>;
29
26
  readonly saasComponents: AmpSaaSEntityService<PlatformSaasComponentUpsertDto, PlatformSaasComponentDto>;
@@ -2,7 +2,6 @@
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.AmpSdkServices = void 0;
4
4
  const entity_service_1 = require("./entity.service");
5
- const data_service_1 = require("./data.service");
6
5
  const rest_1 = require("./rest");
7
6
  const constants_1 = require("./constants");
8
7
  /**
@@ -12,9 +11,7 @@ const constants_1 = require("./constants");
12
11
  * trying to implement a simple web client you should leverage the AmpApi
13
12
  * instead (see {@link AmpApi} ).
14
13
  *
15
- * This client provides CRUD access to most of the AMP API. You
16
- * have READ_ONLY access to the following resources:
17
- * - providers: {@link AmpSdkServices.providers}
14
+ * This client provides CRUD access to all of the AMP API.
18
15
  */
19
16
  class AmpSdkServices {
20
17
  constructor(rest) {
@@ -24,7 +21,7 @@ class AmpSdkServices {
24
21
  this.findings = new entity_service_1.AmpSaaSEntityServiceImpl(rest, constants_1.KIND.FINDINGS, constants_1.TARGET_API_PLATFORM);
25
22
  this.jobExecutions = new entity_service_1.AmpEntityServiceImpl(rest, constants_1.KIND.JOB_EXECUTIONS, constants_1.TARGET_API_PLATFORM);
26
23
  this.jobs = new entity_service_1.AmpEntityServiceImpl(rest, constants_1.KIND.JOB_SPEC, constants_1.TARGET_API_PLATFORM);
27
- this.providers = new data_service_1.AmpDataServiceImpl(rest, constants_1.KIND.PROVIDERS, constants_1.TARGET_API_AGENT);
24
+ this.providers = new entity_service_1.AmpEntityServiceImpl(rest, constants_1.KIND.PROVIDERS, constants_1.TARGET_API_PLATFORM);
28
25
  this.reportResults = new entity_service_1.AmpSaaSEntityServiceImpl(rest, constants_1.KIND.REPORT_RESULTS, constants_1.TARGET_API_PLATFORM);
29
26
  this.saasAssets = new entity_service_1.AmpSaaSEntityServiceImpl(rest, constants_1.KIND.SAAS_ASSETS, constants_1.TARGET_API_PLATFORM);
30
27
  this.saasComponents = new entity_service_1.AmpSaaSEntityServiceImpl(rest, constants_1.KIND.SAAS_COMPONENTS, constants_1.TARGET_API_PLATFORM);
@@ -1 +1 @@
1
- {"version":3,"file":"AmpSdk.js","sourceRoot":"","sources":["../../../src/services/AmpSdk.ts"],"names":[],"mappings":";;;AAuBA,qDAA4K;AAC5K,iDAAkE;AAClE,iCAA0E;AAC1E,2CAAwE;AAMxE;;;;;;;;;;GAUG;AACH,MAAa,cAAc;IAezB,YAAY,IAAgB;QAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,qCAAoB,CAA2C,IAAI,EAAE,gBAAI,CAAC,MAAM,EAAE,+BAAmB,CAAC,CAAC;QACzH,IAAI,CAAC,KAAK,GAAG,IAAI,2CAA0B,CAA2C,IAAI,EAAE,gBAAI,CAAC,MAAM,EAAE,+BAAmB,CAAC,CAAC;QAC9H,IAAI,CAAC,UAAU,GAAG,IAAI,qCAAoB,CAAmD,IAAI,EAAE,gBAAI,CAAC,UAAU,EAAE,+BAAmB,CAAC,CAAC;QACzI,IAAI,CAAC,QAAQ,GAAG,IAAI,yCAAwB,CAA+C,IAAI,EAAE,gBAAI,CAAC,QAAQ,EAAE,+BAAmB,CAAC,CAAC;QACrI,IAAI,CAAC,aAAa,GAAG,IAAI,qCAAoB,CAAmE,IAAI,EAAE,gBAAI,CAAC,cAAc,EAAE,+BAAmB,CAAC,CAAC;QAChK,IAAI,CAAC,IAAI,GAAG,IAAI,qCAAoB,CAA+C,IAAI,EAAE,gBAAI,CAAC,QAAQ,EAAE,+BAAmB,CAAC,CAAC;QAC7H,IAAI,CAAC,SAAS,GAAG,IAAI,iCAAkB,CAAc,IAAI,EAAE,gBAAI,CAAC,SAAS,EAAE,4BAAgB,CAAC,CAAC;QAC7F,IAAI,CAAC,aAAa,GAAG,IAAI,yCAAwB,CAAyD,IAAI,EAAE,gBAAI,CAAC,cAAc,EAAE,+BAAmB,CAAC,CAAC;QAC1J,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O,CAAC,CAAC;QACvC,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACF;AAnCD,wCAmCC"}
@@ -21,13 +21,11 @@ class AmpDataServiceImpl {
21
21
  }
22
22
  async getPage(req) {
23
23
  return this.call(req, (error) => {
24
- if (error instanceof Error) {
25
- console.error(error.message);
26
- }
24
+ const message = error instanceof Error ? error.message : 'Unknown error';
27
25
  return {
28
26
  data: [],
29
27
  kind: this.kind.toUpperCase(),
30
- error: error.message,
28
+ error: message,
31
29
  hints: {},
32
30
  };
33
31
  });
@@ -1 +1 @@
1
- {"version":3,"file":"data.service.js","sourceRoot":"","sources":["../../../src/services/data.service.ts"],"names":[],"mappings":";;;AAUA,MAAa,kBAAkB;IAK7B,YAAY,IAAgB,EAAE,IAAY,EAAE,YAAuB,KAAK;QACtE,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;IAES,KAAK,CAAC,IAAI,CAAI,GAAgB,EAAE,YAA6B;QACrE,IAAI;YACF,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;YACtC,OAAO,GAAG,CAAC,IAAS,CAAC;SACtB;QAAC,OAAO,KAAc,EAAE;YACvB,IAAI,KAAK,YAAY,KAAK,EAAE;gBAC1B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC;aAC9B;YACD,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;SAC5B;IACH,CAAC;IAES,KAAK,CAAC,OAAO,CAAC,GAAgB;QACtC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAc,EAAE,EAAE;YACvC,IAAI,KAAK,YAAY,KAAK,EAAE;gBAC1B,OAAO,CAAC,KAAK,CAAC,KAAK,CAAC,OAAO,CAAC,CA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aAC9B;YACD,OAAO,YAAY,CAAC,KAAK,CAAC,CAAC;SAC5B;IACH,CAAC;IAES,KAAK,CAAC,OAAO,CAAC,GAAgB;QACtC,OAAO,IAAI,CAAC,IAAI,CAAC,GAAG,EAAE,CAAC,KAAc,EAAE,EAAE;YACvC,MAAM,OAAO,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,eAAe,CAAC;YACzE,OAAO;gBACL,IAAI,EAAE,EAAE;gBACR,IAAI,EAAE,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE;gBAC7B,KAAK,EAAE,OAAO;gBACd,KAAK,EAAE,EAAE;aACV,CAAC;QACJ,CAAC,CAAC,CAAC;IACL,CAAC;IAED,IAAI,CAAC,MAAsB;QACzB,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,GAAG,EAAE,IAAI,IAAI,CAAC,SAAS,OAAO,IAAI,CAAC,IAAI,EAAE;YACzC,MAAM,EAAE,KAAK;YACb,MAAM,EAAE,MAAM;SACf,CAAC,CAAC;IACL,CAAC;IAED,OAAO,CAAC,EAAU;QAChB,OAAO,IAAI,CAAC,OAAO,CAAC;YAClB,GAAG,EAAE,IAAI,IAAI,CAAC,SAAS,OAAO,IAAI,CAAC,IAAI,IAAI,EAAE,EAAE;YAC/C,MAAM,EAAE,KAAK;SACd,CAAC,CAAC;IACL,CAAC;CACF;AAjDD,gDAiDC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampsec/platform-client",
3
- "version": "13.2.0",
3
+ "version": "13.3.0",
4
4
  "description": "",
5
5
  "main": "build/src/index.js",
6
6
  "runkitExampleFilename": "example/main.js",
@@ -14,7 +14,8 @@
14
14
  "lint": "gts lint src",
15
15
  "clean": "gts clean src",
16
16
  "fix": "gts fix",
17
- "test": "jest"
17
+ "test": "jest",
18
+ "verify": "npm run lint && npm run test && npm run build"
18
19
  },
19
20
  "keywords": [],
20
21
  "author": "Amplifier Security <engineering@amplifiersecurity.com>",
@@ -7,6 +7,7 @@ import {
7
7
  PlatformConnectorUpsertDto,
8
8
  PlatformFindingDto,
9
9
  PlatformFindingUpsertDto,
10
+ PlatformProviderUpsertDto,
10
11
  PlatformReportResultDto,
11
12
  PlatformReportResultUpsertDto,
12
13
  PlatformSaasAssetDto,
@@ -22,9 +23,8 @@ import {
22
23
  TenantUpsertDto,
23
24
  } from '../dto';
24
25
  import {AmpEntityService, AmpEntityServiceImpl, AmpGlobalEntityService, AmpGlobalEntityServiceImpl, AmpSaaSEntityService, AmpSaaSEntityServiceImpl} from './entity.service';
25
- import {AmpDataService, AmpDataServiceImpl} from './data.service';
26
26
  import {AmpRestClientOptions, RestClient, getAmpRestClient} from './rest';
27
- import {KIND, TARGET_API_AGENT, TARGET_API_PLATFORM} from './constants';
27
+ import {KIND, TARGET_API_PLATFORM} from './constants';
28
28
  import {PlatformJobSpecDto, PlatformJobSpecUpsertDto} from '../dto/platform/platform.jobSpec.dto';
29
29
  import {PlatformJobExecutionStateDto, PlatformJobExecutionStateUpsertDto} from '../dto/platform/platform.jobExecutionState.dto';
30
30
 
@@ -37,9 +37,7 @@ export type AmpSdkOptions = AmpRestClientOptions;
37
37
  * trying to implement a simple web client you should leverage the AmpApi
38
38
  * instead (see {@link AmpApi} ).
39
39
  *
40
- * This client provides CRUD access to most of the AMP API. You
41
- * have READ_ONLY access to the following resources:
42
- * - providers: {@link AmpSdkServices.providers}
40
+ * This client provides CRUD access to all of the AMP API.
43
41
  */
44
42
  export class AmpSdkServices {
45
43
  readonly agents: AmpEntityService<PlatformAgentUpsertDto, PlatformAgentDto>;
@@ -48,7 +46,7 @@ export class AmpSdkServices {
48
46
  readonly findings: AmpSaaSEntityService<PlatformFindingUpsertDto, PlatformFindingDto>;
49
47
  readonly jobExecutions: AmpEntityService<PlatformJobExecutionStateUpsertDto, PlatformJobExecutionStateDto>;
50
48
  readonly jobs: AmpEntityService<PlatformJobSpecUpsertDto, PlatformJobSpecDto>;
51
- readonly providers: AmpDataService<ProviderDto>;
49
+ readonly providers: AmpEntityService<PlatformProviderUpsertDto, ProviderDto>;
52
50
  readonly reportResults: AmpSaaSEntityService<PlatformReportResultUpsertDto, PlatformReportResultDto>;
53
51
  readonly saasAssets: AmpSaaSEntityService<PlatformSaasAssetUpsertDto, PlatformSaasAssetDto>;
54
52
  readonly saasComponents: AmpSaaSEntityService<PlatformSaasComponentUpsertDto, PlatformSaasComponentDto>;
@@ -63,7 +61,7 @@ export class AmpSdkServices {
63
61
  this.findings = new AmpSaaSEntityServiceImpl<PlatformFindingUpsertDto, PlatformFindingDto>(rest, KIND.FINDINGS, TARGET_API_PLATFORM);
64
62
  this.jobExecutions = new AmpEntityServiceImpl<PlatformJobExecutionStateUpsertDto, PlatformJobExecutionStateDto>(rest, KIND.JOB_EXECUTIONS, TARGET_API_PLATFORM);
65
63
  this.jobs = new AmpEntityServiceImpl<PlatformJobSpecUpsertDto, PlatformJobSpecDto>(rest, KIND.JOB_SPEC, TARGET_API_PLATFORM);
66
- this.providers = new AmpDataServiceImpl<ProviderDto>(rest, KIND.PROVIDERS, TARGET_API_AGENT);
64
+ this.providers = new AmpEntityServiceImpl<PlatformProviderUpsertDto, ProviderDto>(rest, KIND.PROVIDERS, TARGET_API_PLATFORM);
67
65
  this.reportResults = new AmpSaaSEntityServiceImpl<PlatformReportResultUpsertDto, PlatformReportResultDto>(rest, KIND.REPORT_RESULTS, TARGET_API_PLATFORM);
68
66
  this.saasAssets = new AmpSaaSEntityServiceImpl<PlatformSaasAssetUpsertDto, PlatformSaasAssetDto>(rest, KIND.SAAS_ASSETS, TARGET_API_PLATFORM);
69
67
  this.saasComponents = new AmpSaaSEntityServiceImpl<PlatformSaasComponentUpsertDto, PlatformSaasComponentDto>(rest, KIND.SAAS_COMPONENTS, TARGET_API_PLATFORM);
@@ -33,13 +33,11 @@ export class AmpDataServiceImpl<ReadT extends BaseDto> implements AmpDataService
33
33
 
34
34
  protected async getPage(req: RestRequest): Promise<Page<ReadT>> {
35
35
  return this.call(req, (error: unknown) => {
36
- if (error instanceof Error) {
37
- console.error(error.message);
38
- }
36
+ const message = error instanceof Error ? error.message : 'Unknown error';
39
37
  return {
40
38
  data: [],
41
39
  kind: this.kind.toUpperCase(),
42
- error: (error as {message: string}).message,
40
+ error: message,
43
41
  hints: {},
44
42
  };
45
43
  });