File tree Expand file tree Collapse file tree 6 files changed +22
-25
lines changed
Expand file tree Collapse file tree 6 files changed +22
-25
lines changed Original file line number Diff line number Diff line change 11import { createMachine , interpret } from "xstate" ;
22import * as actions from "./chat-bot-actions" ;
33import { VerificationRequestStateMachineService } from "../verification-request/state-machine/verification-request.state-machine.service" ;
4- import { M2M } from "../entities/m2m.entity" ;
54
65export interface ChatBotContext {
76 verificationRequest : string ;
@@ -15,7 +14,7 @@ export const createChatBotMachine = (
1514 verificationRequestStateMachineService : VerificationRequestStateMachineService ,
1615 value ?,
1716 context ?,
18- M2MUser ?: M2M ,
17+ M2MUser ?,
1918) => {
2019 const chatBotMachine = createMachine < ChatBotContext > (
2120 {
Original file line number Diff line number Diff line change @@ -8,6 +8,7 @@ import { ConfigService } from "@nestjs/config";
88import { ChatBotStateService } from "../chat-bot-state/chat-bot-state.service" ;
99import { VerificationRequestStateMachineService } from "../verification-request/state-machine/verification-request.state-machine.service" ;
1010import { Roles } from "../auth/ability/ability.factory" ;
11+ import { M2M } from "../entities/m2m.entity" ;
1112
1213const diacriticsRegex = / [ \u0300 - \u036f ] / g;
1314const MESSAGE_MAP = {
@@ -23,7 +24,7 @@ interface ChatBotContext {
2324 sourceChannel ?: string ;
2425}
2526
26- function M2MUser ( clientId ) {
27+ function M2MUser ( clientId ) : M2M {
2728 return {
2829 isM2M : true ,
2930 clientId,
Original file line number Diff line number Diff line change 1+ import { Roles } from "../auth/ability/ability.factory" ;
12export class M2M {
2- isM2M : boolean ;
3- role : {
4- main : string ;
5- } ;
6- scopes : string [ ] ;
3+ isM2M : boolean ;
4+ clientId : string ;
5+ subject : string ;
6+ scopes : string [ ] ;
7+ role : {
8+ main : Roles . Integration ;
9+ } ;
10+ namespace : string ;
711}
Original file line number Diff line number Diff line change 1- import { Roles } from "../../auth/ability/ability.factory " ;
1+ import { M2M } from "../../entities/m2m.entity " ;
22import { HistoryType , TargetModel } from "../schema/history.schema" ;
33import { Types } from "mongoose" ;
44
@@ -33,16 +33,6 @@ interface HistoryItem {
3333}
3434
3535type PerformedBy = Types . ObjectId [ ] | M2M | string | null ;
36- interface M2M {
37- isM2M : boolean ;
38- clientId : string ;
39- subject : string ;
40- scopes : string [ ] ;
41- role : {
42- main : Roles . Integration ;
43- } ;
44- namespace : string ;
45- }
4636interface HistoryDetails {
4737 after : AfterAndBeforeType ;
4838 before ?: AfterAndBeforeType | null ;
Original file line number Diff line number Diff line change @@ -12,10 +12,12 @@ export type User = {
1212} ;
1313
1414export class M2M {
15- isM2M : boolean ;
16- subject : string ;
17- role : {
18- main : string ;
19- } ;
20- scopes : string [ ] ;
15+ isM2M : boolean ;
16+ clientId : string ;
17+ subject : string ;
18+ scopes : string [ ] ;
19+ role : {
20+ main : Roles . Integration ;
21+ } ;
22+ namespace : string ;
2123}
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ enum Roles {
1616 Reviewer = "reviewer" ,
1717 Admin = "admin" ,
1818 SuperAdmin = "super-admin" ,
19+ Integration = "integration" ,
1920}
2021
2122enum Status {
You can’t perform that action at this time.
0 commit comments