@ampsec/platform-client 62.1.0 → 62.2.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.
@@ -0,0 +1,8 @@
1
+ export type CohortDto = {
2
+ /** Kind of the Cohort */
3
+ kind: string;
4
+ /** Display value of the Cohort */
5
+ displayValue: string;
6
+ /** Id or value of the Cohort */
7
+ value: string;
8
+ };
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=cohort.dto.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"cohort.dto.js","sourceRoot":"","sources":["../../../src/dto/cohort.dto.ts"],"names":[],"mappings":""}
@@ -28,3 +28,4 @@ export * from './ampSetting.dto';
28
28
  export * from './tenants.dto';
29
29
  export * from './users.dto';
30
30
  export * from './messagingChannels';
31
+ export * from './cohort.dto';
@@ -44,4 +44,5 @@ __exportStar(require("./ampSetting.dto"), exports);
44
44
  __exportStar(require("./tenants.dto"), exports);
45
45
  __exportStar(require("./users.dto"), exports);
46
46
  __exportStar(require("./messagingChannels"), exports);
47
+ __exportStar(require("./cohort.dto"), exports);
47
48
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,+CAA6B;AAC7B,8CAA4B;AAC5B,6CAA2B;AAC3B,mDAAiC;AACjC,8CAA4B;AAC5B,iDAA+B;AAC/B,yDAAuC;AACvC,0DAAwC;AACxC,6CAA2B;AAC3B,0CAAwB;AACxB,kDAAgC;AAChC,iDAA+B;AAC/B,yDAAuC;AACvC,8CAA4B;AAC5B,wCAAsB;AACtB,gDAA8B;AAC9B,qDAAmC;AACnC,6CAA2B;AAC3B,6CAA2B;AAC3B,kDAAgC;AAChC,sDAAoC;AACpC,yDAAuC;AACvC,mDAAiC;AACjC,uDAAqC;AACrC,kDAAgC;AAChC,mDAAiC;AACjC,gDAA8B;AAC9B,8CAA4B;AAC5B,sDAAoC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/dto/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,+CAA6B;AAC7B,+CAA6B;AAC7B,8CAA4B;AAC5B,6CAA2B;AAC3B,mDAAiC;AACjC,8CAA4B;AAC5B,iDAA+B;AAC/B,yDAAuC;AACvC,0DAAwC;AACxC,6CAA2B;AAC3B,0CAAwB;AACxB,kDAAgC;AAChC,iDAA+B;AAC/B,yDAAuC;AACvC,8CAA4B;AAC5B,wCAAsB;AACtB,gDAA8B;AAC9B,qDAAmC;AACnC,6CAA2B;AAC3B,6CAA2B;AAC3B,kDAAgC;AAChC,sDAAoC;AACpC,yDAAuC;AACvC,mDAAiC;AACjC,uDAAqC;AACrC,kDAAgC;AAChC,mDAAiC;AACjC,gDAA8B;AAC9B,8CAA4B;AAC5B,sDAAoC;AACpC,+CAA6B"}
@@ -3,6 +3,7 @@ import { AmpEntityService, AmpDataService, AmpReportService, AmpSettingsService,
3
3
  import { AmpRestClientOptions, AgentIdentityService, ConnectorInstallService, EnumService, RestClient } from './rest';
4
4
  import { UsersInsightsService } from './usersInsights.service';
5
5
  import { FlowSpecsService } from './flowSpecs.service';
6
+ import { CohortService } from './rest/CohortService';
6
7
  export type AmpApiOptions = AmpRestClientOptions;
7
8
  /**
8
9
  * AMP API
@@ -19,6 +20,7 @@ export type AmpApiOptions = AmpRestClientOptions;
19
20
  export declare class AmpApi {
20
21
  readonly agents: AmpEntityService<AgentUpsertDto, AgentDto>;
21
22
  readonly asset: AmpDataService<AssetDto>;
23
+ readonly cohorts: CohortService;
22
24
  readonly connectors: ConnectorsService;
23
25
  readonly enums: EnumService;
24
26
  readonly findings: FindingsService;
@@ -6,6 +6,7 @@ const constants_1 = require("./constants");
6
6
  const rest_1 = require("./rest");
7
7
  const usersInsights_service_1 = require("./usersInsights.service");
8
8
  const flowSpecs_service_1 = require("./flowSpecs.service");
9
+ const CohortService_1 = require("./rest/CohortService");
9
10
  /**
10
11
  * AMP API
11
12
  * This client is a wrapper around the AMP REST API meant to be used by
@@ -22,6 +23,7 @@ class AmpApi {
22
23
  constructor(rest) {
23
24
  this.agents = new _1.AmpEntityServiceImpl(rest, constants_1.KIND.AGENTS);
24
25
  this.asset = new _1.AmpDataServiceImpl(rest, constants_1.KIND.ASSETS);
26
+ this.cohorts = new CohortService_1.CohortService(rest);
25
27
  this.connectors = new _1.ConnectorsService(rest);
26
28
  this.enums = new rest_1.DefaultEnumService(rest);
27
29
  this.findings = new _1.FindingsService(rest);
@@ -1 +1 @@
1
- {"version":3,"file":"AmpApi.js","sourceRoot":"","sources":["../../../src/services/AmpApi.ts"],"names":[],"mappings":";;;AACA,wBAaW;AACX,2CAAmD;AACnD,iCAA0J;AAC1J,mEAA6D;AAC7D,2DAAqD;AAIrD;;;;;;;;;;;GAWG;AACH,MAAa,MAAM;IAuBjB,YAAY,IAAgB;QAC1B,IAAI,CAAC,MAAM,GAAG,IAAI,uBAAoB,CAA2B,IAAI,EAAE,gBAAI,CAAC,MAAM,CAAC,CAAC;QACpF,IAAI,CAAC,KAAK,GAAG,IAAI,qBAAkB,CAAW,IAAI,EAAE,gBAAI,CAAC,MAAM,CAAC,CAAC;QACjE,IAAI,CAAC,UAAU,GAAG,IAAI,oBAAiB,CAAC,IAAI,CAAC,CAAC;QAC9C,IAAI,CAAC,KAAK,GAAG,IAAI,yBAAkB,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,QAAQ,GAAG,IAAI,kBAAe,CAAC,IAAI,CAAC,CAAC;QAC1C,IAAI,CAAC,gBAAgB,GAAG,IAAI,0BAAuB,CAAC,IAAI,EAAE,gBAAI,CAAC,iBAAiB,CAAC,CAAC;QAClF,IAAI,CAAC,SAAS,GAAG,IAAI,oCAAgB,CAAC,IAAI,CAAC,CAAC;QAC5C,IAAI,CAAC,QAAQ,GAAG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{
4
+ protected readonly rest: RestClient;
5
+ constructor(rest: RestClient);
6
+ list: (q?: string) => Promise<Page<CohortDto>>;
7
+ }
@@ -0,0 +1,18 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.CohortService = void 0;
4
+ class CohortService {
5
+ constructor(rest) {
6
+ this.list = async (q) => {
7
+ const res = await this.rest.call({
8
+ url: '/api/v1/enum/cohorts',
9
+ method: 'GET',
10
+ params: { q },
11
+ });
12
+ return res.data;
13
+ };
14
+ this.rest = rest;
15
+ }
16
+ }
17
+ exports.CohortService = CohortService;
18
+ //# sourceMappingURL=CohortService.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"CohortService.js","sourceRoot":"","sources":["../../../../src/services/rest/CohortService.ts"],"names":[],"mappings":";;;AAGA,MAAa,aAAa;IAExB,YAAY,IAAgB;QAI5B,SAAI,GAAG,KAAK,EAAE,CAAU,EAA4B,EAAE;YACpD,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC/B,GAAG,EAAE,sBAAsB;gBAC3B,MAAM,EAAE,KAAK;gBACb,MAAM,EAAE,EAAC,CAAC,EAAC;aACZ,CAAC,CAAC;YACH,OAAO,GAAG,CAAC,IAAuB,CAAC;QACrC,CAAC,CAAC;QAVA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CAUF;AAdD,sCAcC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampsec/platform-client",
3
- "version": "62.1.0",
3
+ "version": "62.2.0",
4
4
  "description": "",
5
5
  "main": "build/src/index.js",
6
6
  "runkitExampleFilename": "example/main.js",
@@ -0,0 +1,8 @@
1
+ export type CohortDto = {
2
+ /** Kind of the Cohort */
3
+ kind: string;
4
+ /** Display value of the Cohort */
5
+ displayValue: string;
6
+ /** Id or value of the Cohort */
7
+ value: string;
8
+ };
package/src/dto/index.ts CHANGED
@@ -28,3 +28,4 @@ export * from './ampSetting.dto';
28
28
  export * from './tenants.dto';
29
29
  export * from './users.dto';
30
30
  export * from './messagingChannels';
31
+ export * from './cohort.dto';
@@ -17,6 +17,7 @@ import {KIND, TARGET_API_AGENT} from './constants';
17
17
  import {getAmpRestClient, AmpRestClientOptions, AgentIdentityService, ConnectorInstallService, DefaultEnumService, EnumService, RestClient} from './rest';
18
18
  import {UsersInsightsService} from './usersInsights.service';
19
19
  import {FlowSpecsService} from './flowSpecs.service';
20
+ import {CohortService} from './rest/CohortService';
20
21
 
21
22
  export type AmpApiOptions = AmpRestClientOptions;
22
23
 
@@ -35,6 +36,7 @@ export type AmpApiOptions = AmpRestClientOptions;
35
36
  export class AmpApi {
36
37
  readonly agents: AmpEntityService<AgentUpsertDto, AgentDto>;
37
38
  readonly asset: AmpDataService<AssetDto>;
39
+ readonly cohorts: CohortService;
38
40
  readonly connectors: ConnectorsService;
39
41
  readonly enums: EnumService;
40
42
  readonly findings: FindingsService;
@@ -58,6 +60,7 @@ export class AmpApi {
58
60
  constructor(rest: RestClient) {
59
61
  this.agents = new AmpEntityServiceImpl<AgentUpsertDto, AgentDto>(rest, KIND.AGENTS);
60
62
  this.asset = new AmpDataServiceImpl<AssetDto>(rest, KIND.ASSETS);
63
+ this.cohorts = new CohortService(rest);
61
64
  this.connectors = new ConnectorsService(rest);
62
65
  this.enums = new DefaultEnumService(rest);
63
66
  this.findings = new FindingsService(rest);
@@ -0,0 +1,18 @@
1
+ import {CohortDto, Page} from '../../dto';
2
+ import {RestClient} from './RestClient';
3
+
4
+ export class CohortService {
5
+ protected readonly rest: RestClient;
6
+ constructor(rest: RestClient) {
7
+ this.rest = rest;
8
+ }
9
+
10
+ list = async (q?: string): Promise<Page<CohortDto>> => {
11
+ const res = await this.rest.call({
12
+ url: '/api/v1/enum/cohorts',
13
+ method: 'GET',
14
+ params: {q},
15
+ });
16
+ return res.data as Page<CohortDto>;
17
+ };
18
+ }