@ampsec/platform-client 87.11.1 → 87.12.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.
@@ -33,3 +33,116 @@ export declare const _TrainingUpsertDto: z.ZodObject<{
33
33
  thumbnailUrl?: string | undefined;
34
34
  }>;
35
35
  export type TrainingUpsertDto = z.infer<typeof _TrainingUpsertDto>;
36
+ export declare enum TrainingSelectionStrategy {
37
+ Scheduled = "Scheduled",
38
+ Module = "Module",
39
+ Custom = "Custom"
40
+ }
41
+ export declare const _TrainingModuleRequest: z.ZodObject<{
42
+ videoUrl: z.ZodString;
43
+ subject: z.ZodString;
44
+ thumbnailUrl: z.ZodOptional<z.ZodString>;
45
+ description: z.ZodOptional<z.ZodString>;
46
+ }, "strip", z.ZodTypeAny, {
47
+ subject: string;
48
+ videoUrl: string;
49
+ description?: string | undefined;
50
+ thumbnailUrl?: string | undefined;
51
+ }, {
52
+ subject: string;
53
+ videoUrl: string;
54
+ description?: string | undefined;
55
+ thumbnailUrl?: string | undefined;
56
+ }>;
57
+ export type TrainingModuleRequest = z.infer<typeof _TrainingModuleRequest>;
58
+ export declare const _CreateTrainingForUserRequest: z.ZodObject<{
59
+ selectionStrategy: z.ZodNativeEnum<typeof TrainingSelectionStrategy>;
60
+ trainingRequest: z.ZodOptional<z.ZodObject<{
61
+ videoUrl: z.ZodString;
62
+ subject: z.ZodString;
63
+ thumbnailUrl: z.ZodOptional<z.ZodString>;
64
+ description: z.ZodOptional<z.ZodString>;
65
+ }, "strip", z.ZodTypeAny, {
66
+ subject: string;
67
+ videoUrl: string;
68
+ description?: string | undefined;
69
+ thumbnailUrl?: string | undefined;
70
+ }, {
71
+ subject: string;
72
+ videoUrl: string;
73
+ description?: string | undefined;
74
+ thumbnailUrl?: string | undefined;
75
+ }>>;
76
+ trainingRequests: z.ZodOptional<z.ZodArray<z.ZodObject<{
77
+ videoUrl: z.ZodString;
78
+ subject: z.ZodString;
79
+ thumbnailUrl: z.ZodOptional<z.ZodString>;
80
+ description: z.ZodOptional<z.ZodString>;
81
+ }, "strip", z.ZodTypeAny, {
82
+ subject: string;
83
+ videoUrl: string;
84
+ description?: string | undefined;
85
+ thumbnailUrl?: string | undefined;
86
+ }, {
87
+ subject: string;
88
+ videoUrl: string;
89
+ description?: string | undefined;
90
+ thumbnailUrl?: string | undefined;
91
+ }>, "many">>;
92
+ }, "strip", z.ZodTypeAny, {
93
+ selectionStrategy: TrainingSelectionStrategy;
94
+ trainingRequest?: {
95
+ subject: string;
96
+ videoUrl: string;
97
+ description?: string | undefined;
98
+ thumbnailUrl?: string | undefined;
99
+ } | undefined;
100
+ trainingRequests?: {
101
+ subject: string;
102
+ videoUrl: string;
103
+ description?: string | undefined;
104
+ thumbnailUrl?: string | undefined;
105
+ }[] | undefined;
106
+ }, {
107
+ selectionStrategy: TrainingSelectionStrategy;
108
+ trainingRequest?: {
109
+ subject: string;
110
+ videoUrl: string;
111
+ description?: string | undefined;
112
+ thumbnailUrl?: string | undefined;
113
+ } | undefined;
114
+ trainingRequests?: {
115
+ subject: string;
116
+ videoUrl: string;
117
+ description?: string | undefined;
118
+ thumbnailUrl?: string | undefined;
119
+ }[] | undefined;
120
+ }>;
121
+ export type CreateTrainingForUserRequest = z.infer<typeof _CreateTrainingForUserRequest>;
122
+ export declare const _CreateTrainingForUserResponse: z.ZodObject<{
123
+ success: z.ZodBoolean;
124
+ sessionId: z.ZodString;
125
+ componentsCreated: z.ZodNumber;
126
+ modulesAssigned: z.ZodArray<z.ZodObject<{
127
+ subject: z.ZodString;
128
+ }, "strip", z.ZodTypeAny, {
129
+ subject: string;
130
+ }, {
131
+ subject: string;
132
+ }>, "many">;
133
+ }, "strip", z.ZodTypeAny, {
134
+ sessionId: string;
135
+ success: boolean;
136
+ componentsCreated: number;
137
+ modulesAssigned: {
138
+ subject: string;
139
+ }[];
140
+ }, {
141
+ sessionId: string;
142
+ success: boolean;
143
+ componentsCreated: number;
144
+ modulesAssigned: {
145
+ subject: string;
146
+ }[];
147
+ }>;
148
+ export type CreateTrainingForUserResponse = z.infer<typeof _CreateTrainingForUserResponse>;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports._TrainingUpsertDto = exports._TrainingDto = void 0;
3
+ exports._CreateTrainingForUserResponse = exports._CreateTrainingForUserRequest = exports._TrainingModuleRequest = exports.TrainingSelectionStrategy = exports._TrainingUpsertDto = exports._TrainingDto = void 0;
4
4
  const zod_1 = require("zod");
5
5
  exports._TrainingDto = zod_1.z.object({
6
6
  subject: zod_1.z.string(),
@@ -9,4 +9,27 @@ exports._TrainingDto = zod_1.z.object({
9
9
  description: zod_1.z.string().optional(),
10
10
  });
11
11
  exports._TrainingUpsertDto = exports._TrainingDto.partial();
12
+ var TrainingSelectionStrategy;
13
+ (function (TrainingSelectionStrategy) {
14
+ TrainingSelectionStrategy["Scheduled"] = "Scheduled";
15
+ TrainingSelectionStrategy["Module"] = "Module";
16
+ TrainingSelectionStrategy["Custom"] = "Custom";
17
+ })(TrainingSelectionStrategy || (exports.TrainingSelectionStrategy = TrainingSelectionStrategy = {}));
18
+ exports._TrainingModuleRequest = zod_1.z.object({
19
+ videoUrl: zod_1.z.string().url(),
20
+ subject: zod_1.z.string(),
21
+ thumbnailUrl: zod_1.z.string().url().optional(),
22
+ description: zod_1.z.string().optional(),
23
+ });
24
+ exports._CreateTrainingForUserRequest = zod_1.z.object({
25
+ selectionStrategy: zod_1.z.nativeEnum(TrainingSelectionStrategy),
26
+ trainingRequest: exports._TrainingModuleRequest.optional(),
27
+ trainingRequests: zod_1.z.array(exports._TrainingModuleRequest).optional(),
28
+ });
29
+ exports._CreateTrainingForUserResponse = zod_1.z.object({
30
+ success: zod_1.z.boolean(),
31
+ sessionId: zod_1.z.string(),
32
+ componentsCreated: zod_1.z.number(),
33
+ modulesAssigned: zod_1.z.array(zod_1.z.object({ subject: zod_1.z.string() })),
34
+ });
12
35
  //# sourceMappingURL=trainings.dto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"trainings.dto.js","sourceRoot":"","sources":["../../../src/dto/trainings.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AAET,QAAA,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IACnC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAC1B,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACzC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAIU,QAAA,kBAAkB,GAAG,oBAAY,CAAC,OAAO,EAAE,CAAC"}
1
+ {"version":3,"file":"trainings.dto.js","sourceRoot":"","sources":["../../../src/dto/trainings.dto.ts"],"names":[],"mappings":";;;AAAA,6BAAsB;AAET,QAAA,YAAY,GAAG,OAAC,CAAC,MAAM,CAAC;IACnC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAC1B,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACzC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAIU,QAAA,kBAAkB,GAAG,oBAAY,CAAC,OAAO,EAAE,CAAC;AAGzD,IAAY,yBAIX;AAJD,WAAY,yBAAyB;IACnC,oDAAuB,CAAA;IACvB,8CAAiB,CAAA;IACjB,8CAAiB,CAAA;AACnB,CAAC,EAJW,yBAAyB,yCAAzB,yBAAyB,QAIpC;AAEY,QAAA,sBAAsB,GAAG,OAAC,CAAC,MAAM,CAAC;IAC7C,QAAQ,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE;IAC1B,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE;IACnB,YAAY,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,CAAC,QAAQ,EAAE;IACzC,WAAW,EAAE,OAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE;CACnC,CAAC,CAAC;AAIU,QAAA,6BAA6B,GAAG,OAAC,CAAC,MAAM,CAAC;IACpD,iBAAiB,EAAE,OAAC,CAAC,UAAU,CAAC,yBAAyB,CAAC;IAC1D,eAAe,EAAE,8BAAsB,CAAC,QAAQ,EAAE;IAClD,gBAAgB,EAAE,OAAC,CAAC,KAAK,CAAC,8BAAsB,CAAC,CAAC,QAAQ,EAAE;CAC7D,CAAC,CAAC;AAIU,QAAA,8BAA8B,GAAG,OAAC,CAAC,MAAM,CAAC;IACrD,OAAO,EAAE,OAAC,CAAC,OAAO,EAAE;IACpB,SAAS,EAAE,OAAC,CAAC,MAAM,EAAE;IACrB,iBAAiB,EAAE,OAAC,CAAC,MAAM,EAAE;IAC7B,eAAe,EAAE,OAAC,CAAC,KAAK,CAAC,OAAC,CAAC,MAAM,CAAC,EAAC,OAAO,EAAE,OAAC,CAAC,MAAM,EAAE,EAAC,CAAC,CAAC;CAC1D,CAAC,CAAC"}
@@ -15,6 +15,7 @@ import { EngagementService } from './engagements.service';
15
15
  import { AmpSdkTagSpecsService } from './tagSpecs.service';
16
16
  import { AmpSdkFindingsTagsService } from './findingsTags.service';
17
17
  import { RulesService } from './rules.service';
18
+ import { AmpSdkTrainingsPlatformService } from './trainings.platform.service';
18
19
  export type AmpSdkOptions = AmpRestClientOptions;
19
20
  /**
20
21
  * AMP API
@@ -58,6 +59,7 @@ export declare class AmpSdkServices {
58
59
  readonly stagedSaaSUsers: TruncatableAmpEntityService<PlatformStagedSaasUserUpsertDto, PlatformStagedSaasUserDto>;
59
60
  readonly settings: AmpSdkSettingsService;
60
61
  readonly tagSpecs: AmpSdkTagSpecsService;
62
+ readonly trainings: AmpSdkTrainingsPlatformService;
61
63
  readonly tenants: TenantsService;
62
64
  readonly tenantNotes: TenantNotesService;
63
65
  readonly tokens: AmpSdkTenantService<PlatformTokenUpsertDto, PlatformTokenDto>;
@@ -18,6 +18,7 @@ const engagements_service_1 = require("./engagements.service");
18
18
  const tagSpecs_service_1 = require("./tagSpecs.service");
19
19
  const findingsTags_service_1 = require("./findingsTags.service");
20
20
  const rules_service_1 = require("./rules.service");
21
+ const trainings_platform_service_1 = require("./trainings.platform.service");
21
22
  /**
22
23
  * AMP API
23
24
  * This client is a wrapper around the AMP REST API meant to be used by
@@ -65,6 +66,7 @@ class AmpSdkServices {
65
66
  this.stagedSaaSUsers = new entity_service_1.TruncatableAmpEntityServiceImpl(rest, constants_1.KIND.STAGED_SAAS_USERS, constants_1.TARGET_API_PLATFORM);
66
67
  this.settings = new settings_service_1.AmpSdkSettingsService(rest);
67
68
  this.tagSpecs = new tagSpecs_service_1.AmpSdkTagSpecsService(rest, constants_1.KIND.TAG_SPECS, constants_1.TARGET_API_AGENT);
69
+ this.trainings = new trainings_platform_service_1.AmpSdkTrainingsPlatformService(rest);
68
70
  this.tenants = new TenantsService_1.TenantsService(rest, constants_1.TARGET_API_PLATFORM);
69
71
  this.tenantNotes = new entity_service_1.TenantNotesService(rest, constants_1.TARGET_API_PLATFORM);
70
72
  this.tokens = new entity_service_1.AmpEntityServiceImpl(rest, constants_1.KIND.TOKENS, constants_1.TARGET_API_PLATFORM);
@@ -1 +1 @@
1
- {"version":3,"file":"AmpSdk.js","sourceRoot":"","sources":["../../../src/services/AmpSdk.ts"],"names":[],"mappings":";;;AAkDA,qDAS0B;AAC1B,qFAA4E;AAC5E,iCAA0E;AAC1E,2CAAwE;AACxE,oDAAmE;AACnE,yDAAyD;AACzD,6DAA+J;AAC/J,6DAAuD;AACvD,yEAAmE;AACnE,6EAAsE;AACtE,mDAAqD;AACrD,0DAAqD;AACrD,yDAAmD;AACnD,+DAAwD;AACxD,yDAAyD;AACzD,iEAAiE;AACjE,mDAA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AI,CAAC,MAAM,GAAG,IAAI,qCAAoB,CAA2C,IAAI,EAAE,gBAAI,CAAC,MAAM,EAAE,+BAAmB,CAAC,CAAC;QACzH,IAAI,CAAC,KAAK,GAAG,IAAI,kCAAiB,CAAC,IAAI,EAAE,+BAAmB,CAAC,CAAC;QAC9D,IAAI,CAAC,gBAAgB,GAAG,IAAI,qCAAoB,CAA+D,IAAI,EAAE,gBAAI,CAAC,iBAAiB,EAAE,+BAAmB,CAAC,CAAC;QAClK,IAAI,CAAC,oBAAoB,GAAG,IAAI,qCAAoB,CAClD,IAAI,EACJ,gBAAI,CAAC,qBAAqB,EAC1B,+BAAmB,CACpB,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,QAAQ,CAAC,OAAsB;QACpC,MAAM,IAAI,GAAG,IAAA,uBAAgB,EAAC,OAAO,CAAC,CAAC;QACvC,OAAO,IAAI,cAAc,CAAC,IAAI,CAAC,CAAC;IAClC,CAAC;CACF;AA7GD,wCA6GC"}
@@ -22,3 +22,4 @@ export * from './customActionsService';
22
22
  export * from './userExtension.service';
23
23
  export * from './rules.service';
24
24
  export * from './ruleSets.service';
25
+ export * from './trainings.platform.service';
@@ -38,4 +38,5 @@ __exportStar(require("./customActionsService"), exports);
38
38
  __exportStar(require("./userExtension.service"), exports);
39
39
  __exportStar(require("./rules.service"), exports);
40
40
  __exportStar(require("./ruleSets.service"), exports);
41
+ __exportStar(require("./trainings.platform.service"), exports);
41
42
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2DAAyC;AACzC,iDAA+B;AAC/B,mDAAiC;AACjC,6DAA2C;AAC3C,qDAAmC;AACnC,mDAAiC;AACjC,yCAAuB;AACvB,uDAAqC;AACrC,qDAAmC;AACnC,0CAAwB;AACxB,uDAAqC;AACrC,+DAA6C;AAC7C,yDAAuC;AACvC,oDAAkC;AAClC,uDAAqC;AACrC,uDAAqC;AACrC,yDAAuC;AACvC,0DAAwC;AACxC,kDAAgC;AAChC,qDAAmC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/services/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,2CAAyB;AACzB,8CAA4B;AAC5B,2CAAyB;AACzB,8CAA4B;AAC5B,2DAAyC;AACzC,iDAA+B;AAC/B,mDAAiC;AACjC,6DAA2C;AAC3C,qDAAmC;AACnC,mDAAiC;AACjC,yCAAuB;AACvB,uDAAqC;AACrC,qDAAmC;AACnC,0CAAwB;AACxB,uDAAqC;AACrC,+DAA6C;AAC7C,yDAAuC;AACvC,oDAAkC;AAClC,uDAAqC;AACrC,uDAAqC;AACrC,yDAAuC;AACvC,0DAAwC;AACxC,kDAAgC;AAChC,qDAAmC;AACnC,+DAA6C"}
@@ -10,5 +10,6 @@ export declare class RulesService {
10
10
  updateRuleSet: (id: string, rulesDto: RuleUpsertDtoSchema) => Promise<RestResponse>;
11
11
  getRulesByTenant: (tid: string, cid?: string) => Promise<RestResponse>;
12
12
  getRuleSet: (cid: string, forceRefresh?: boolean) => Promise<RestResponse>;
13
+ getRuleById: (id: string) => Promise<RestResponse>;
13
14
  deleteRuleSet: (id: string) => Promise<RestResponse>;
14
15
  }
@@ -35,6 +35,12 @@ class RulesService {
35
35
  params: { cid, forceRefresh },
36
36
  });
37
37
  };
38
+ this.getRuleById = async (id) => {
39
+ return await this.rest.call({
40
+ url: `/${this.targetApi}/v1/${this.kind}/${id}`,
41
+ method: 'GET',
42
+ });
43
+ };
38
44
  this.deleteRuleSet = async (id) => {
39
45
  return await this.rest.call({
40
46
  url: `/${this.targetApi}/v1/${this.kind}/${id}`,
@@ -1 +1 @@
1
- {"version":3,"file":"rules.service.js","sourceRoot":"","sources":["../../../src/services/rules.service.ts"],"names":[],"mappings":";;;AAIA,MAAa,YAAY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QAtDA,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;QACjB,IAAI,CAAC,SAAS,GAAG,SAAS,CAAC;IAC7B,CAAC;CAoDF;AA7DD,oCA6DC"}
@@ -0,0 +1,7 @@
1
+ import { CreateTrainingForUserRequest, CreateTrainingForUserResponse } from '../dto/trainings.dto';
2
+ import { RestClient } from './rest';
3
+ export declare class AmpSdkTrainingsPlatformService {
4
+ private readonly rest;
5
+ constructor(rest: RestClient);
6
+ createForUser: (userId: string, request: CreateTrainingForUserRequest) => Promise<CreateTrainingForUserResponse>;
7
+ }
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.AmpSdkTrainingsPlatformService = void 0;
4
+ const constants_1 = require("./constants");
5
+ class AmpSdkTrainingsPlatformService {
6
+ constructor(rest) {
7
+ this.rest = rest;
8
+ this.createForUser = async (userId, request) => {
9
+ const res = await this.rest.call({
10
+ url: `/${constants_1.TARGET_API_PLATFORM}/v1/${constants_1.KIND.TRAININGS}/create/${userId}`,
11
+ method: 'POST',
12
+ data: request,
13
+ });
14
+ return res;
15
+ };
16
+ }
17
+ }
18
+ exports.AmpSdkTrainingsPlatformService = AmpSdkTrainingsPlatformService;
19
+ //# sourceMappingURL=trainings.platform.service.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"trainings.platform.service.js","sourceRoot":"","sources":["../../../src/services/trainings.platform.service.ts"],"names":[],"mappings":";;;AACA,2CAAsD;AAGtD,MAAa,8BAA8B;IACzC,YAA6B,IAAgB;QAAhB,SAAI,GAAJ,IAAI,CAAY;QAE7C,kBAAa,GAAG,KAAK,EAAE,MAAc,EAAE,OAAqC,EAA0C,EAAE;YACtH,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,IAAI,CAAC,IAAI,CAAC;gBAC/B,GAAG,EAAE,IAAI,+BAAmB,OAAO,gBAAI,CAAC,SAAS,WAAW,MAAM,EAAE;gBACpE,MAAM,EAAE,MAAM;gBACd,IAAI,EAAE,OAAO;aACd,CAAC,CAAC;YACH,OAAO,GAA+C,CAAC;QACzD,CAAC,CAAC;IAT8C,CAAC;CAUlD;AAXD,wEAWC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ampsec/platform-client",
3
- "version": "87.11.1",
3
+ "version": "87.12.0",
4
4
  "description": "",
5
5
  "main": "build/src/index.js",
6
6
  "runkitExampleFilename": "example/main.js",
@@ -11,3 +11,35 @@ export type TrainingDto = z.infer<typeof _TrainingDto>;
11
11
 
12
12
  export const _TrainingUpsertDto = _TrainingDto.partial();
13
13
  export type TrainingUpsertDto = z.infer<typeof _TrainingUpsertDto>;
14
+
15
+ export enum TrainingSelectionStrategy {
16
+ Scheduled = 'Scheduled',
17
+ Module = 'Module',
18
+ Custom = 'Custom',
19
+ }
20
+
21
+ export const _TrainingModuleRequest = z.object({
22
+ videoUrl: z.string().url(),
23
+ subject: z.string(),
24
+ thumbnailUrl: z.string().url().optional(),
25
+ description: z.string().optional(),
26
+ });
27
+
28
+ export type TrainingModuleRequest = z.infer<typeof _TrainingModuleRequest>;
29
+
30
+ export const _CreateTrainingForUserRequest = z.object({
31
+ selectionStrategy: z.nativeEnum(TrainingSelectionStrategy),
32
+ trainingRequest: _TrainingModuleRequest.optional(),
33
+ trainingRequests: z.array(_TrainingModuleRequest).optional(),
34
+ });
35
+
36
+ export type CreateTrainingForUserRequest = z.infer<typeof _CreateTrainingForUserRequest>;
37
+
38
+ export const _CreateTrainingForUserResponse = z.object({
39
+ success: z.boolean(),
40
+ sessionId: z.string(),
41
+ componentsCreated: z.number(),
42
+ modulesAssigned: z.array(z.object({subject: z.string()})),
43
+ });
44
+
45
+ export type CreateTrainingForUserResponse = z.infer<typeof _CreateTrainingForUserResponse>;
@@ -74,6 +74,7 @@ import {EngagementService} from './engagements.service';
74
74
  import {AmpSdkTagSpecsService} from './tagSpecs.service';
75
75
  import {AmpSdkFindingsTagsService} from './findingsTags.service';
76
76
  import {RulesService} from './rules.service';
77
+ import {AmpSdkTrainingsPlatformService} from './trainings.platform.service';
77
78
 
78
79
  export type AmpSdkOptions = AmpRestClientOptions;
79
80
 
@@ -119,6 +120,7 @@ export class AmpSdkServices {
119
120
  readonly stagedSaaSUsers: TruncatableAmpEntityService<PlatformStagedSaasUserUpsertDto, PlatformStagedSaasUserDto>;
120
121
  readonly settings: AmpSdkSettingsService;
121
122
  readonly tagSpecs: AmpSdkTagSpecsService;
123
+ readonly trainings: AmpSdkTrainingsPlatformService;
122
124
  readonly tenants: TenantsService;
123
125
  readonly tenantNotes: TenantNotesService;
124
126
  readonly tokens: AmpSdkTenantService<PlatformTokenUpsertDto, PlatformTokenDto>;
@@ -177,6 +179,7 @@ export class AmpSdkServices {
177
179
 
178
180
  this.settings = new AmpSdkSettingsService(rest);
179
181
  this.tagSpecs = new AmpSdkTagSpecsService(rest, KIND.TAG_SPECS, TARGET_API_AGENT);
182
+ this.trainings = new AmpSdkTrainingsPlatformService(rest);
180
183
  this.tenants = new TenantsService(rest, TARGET_API_PLATFORM);
181
184
  this.tenantNotes = new TenantNotesService(rest, TARGET_API_PLATFORM);
182
185
  this.tokens = new AmpEntityServiceImpl<PlatformTokenUpsertDto, PlatformTokenDto>(rest, KIND.TOKENS, TARGET_API_PLATFORM);
@@ -22,3 +22,4 @@ export * from './customActionsService';
22
22
  export * from './userExtension.service';
23
23
  export * from './rules.service';
24
24
  export * from './ruleSets.service';
25
+ export * from './trainings.platform.service';
@@ -50,6 +50,13 @@ export class RulesService {
50
50
  });
51
51
  };
52
52
 
53
+ getRuleById = async (id: string): Promise<RestResponse> => {
54
+ return await this.rest.call({
55
+ url: `/${this.targetApi}/v1/${this.kind}/${id}`,
56
+ method: 'GET',
57
+ });
58
+ };
59
+
53
60
  deleteRuleSet = async (id: string): Promise<RestResponse> => {
54
61
  return await this.rest.call({
55
62
  url: `/${this.targetApi}/v1/${this.kind}/${id}`,
@@ -0,0 +1,16 @@
1
+ import {CreateTrainingForUserRequest, CreateTrainingForUserResponse} from '../dto/trainings.dto';
2
+ import {KIND, TARGET_API_PLATFORM} from './constants';
3
+ import {RestClient} from './rest';
4
+
5
+ export class AmpSdkTrainingsPlatformService {
6
+ constructor(private readonly rest: RestClient) {}
7
+
8
+ createForUser = async (userId: string, request: CreateTrainingForUserRequest): Promise<CreateTrainingForUserResponse> => {
9
+ const res = await this.rest.call({
10
+ url: `/${TARGET_API_PLATFORM}/v1/${KIND.TRAININGS}/create/${userId}`,
11
+ method: 'POST',
12
+ data: request,
13
+ });
14
+ return res as unknown as CreateTrainingForUserResponse;
15
+ };
16
+ }