fix(all): Fixing bugs of 3.0
This commit is contained in:
parent
6cad39d8c7
commit
d09265e023
4 changed files with 50 additions and 44 deletions
|
@ -66,45 +66,45 @@ export class GuaribasConversation extends Model<GuaribasConversation> {
|
||||||
@PrimaryKey
|
@PrimaryKey
|
||||||
@AutoIncrement
|
@AutoIncrement
|
||||||
@Column(DataType.INTEGER)
|
@Column(DataType.INTEGER)
|
||||||
conversationId: number;
|
declare conversationId: number;
|
||||||
|
|
||||||
@ForeignKey(() => GuaribasInstance)
|
@ForeignKey(() => GuaribasInstance)
|
||||||
@Column(DataType.INTEGER)
|
@Column(DataType.INTEGER)
|
||||||
instanceId: number;
|
declare instanceId: number;
|
||||||
|
|
||||||
@ForeignKey(() => GuaribasSubject)
|
@ForeignKey(() => GuaribasSubject)
|
||||||
@Column(DataType.INTEGER)
|
@Column(DataType.INTEGER)
|
||||||
startSubjectId: number;
|
declare startSubjectId: number;
|
||||||
|
|
||||||
@BelongsTo(() => GuaribasSubject)
|
@BelongsTo(() => GuaribasSubject)
|
||||||
startSubject: GuaribasSubject;
|
declare startSubject: GuaribasSubject;
|
||||||
|
|
||||||
@ForeignKey(() => GuaribasChannel)
|
@ForeignKey(() => GuaribasChannel)
|
||||||
@Column(DataType.INTEGER)
|
@Column(DataType.INTEGER)
|
||||||
channelId: string;
|
declare channelId: string;
|
||||||
|
|
||||||
@Column(DataType.DATE)
|
@Column(DataType.DATE)
|
||||||
rateDate: Date;
|
declare rateDate: Date;
|
||||||
|
|
||||||
@Column(DataType.FLOAT)
|
@Column(DataType.FLOAT)
|
||||||
rate: number;
|
declare rate: number;
|
||||||
|
|
||||||
@Column(DataType.STRING(512))
|
@Column(DataType.STRING(512))
|
||||||
feedback: string;
|
declare feedback: string;
|
||||||
|
|
||||||
@CreatedAt
|
@CreatedAt
|
||||||
@Column(DataType.DATE)
|
@Column(DataType.DATE)
|
||||||
declare createdAt: Date;
|
declare createdAt: Date;
|
||||||
|
|
||||||
@Column(DataType.STRING(255))
|
@Column(DataType.STRING(255))
|
||||||
text: string;
|
declare text: string;
|
||||||
|
|
||||||
@ForeignKey(() => GuaribasUser)
|
@ForeignKey(() => GuaribasUser)
|
||||||
@Column(DataType.INTEGER)
|
@Column(DataType.INTEGER)
|
||||||
startedByUserId: number;
|
declare startedByUserId: number;
|
||||||
|
|
||||||
@BelongsTo(() => GuaribasUser)
|
@BelongsTo(() => GuaribasUser)
|
||||||
startedBy: GuaribasUser;
|
declare startedBy: GuaribasUser;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -115,14 +115,14 @@ export class GuaribasConversationMessage extends Model<GuaribasConversationMessa
|
||||||
@PrimaryKey
|
@PrimaryKey
|
||||||
@AutoIncrement
|
@AutoIncrement
|
||||||
@Column(DataType.INTEGER)
|
@Column(DataType.INTEGER)
|
||||||
conversationMessageId: number;
|
declare conversationMessageId: number;
|
||||||
|
|
||||||
@ForeignKey(() => GuaribasSubject)
|
@ForeignKey(() => GuaribasSubject)
|
||||||
@Column(DataType.INTEGER)
|
@Column(DataType.INTEGER)
|
||||||
subjectId: number;
|
declare subjectId: number;
|
||||||
|
|
||||||
@Column(DataType.TEXT)
|
@Column(DataType.TEXT)
|
||||||
content: string;
|
declare content: string;
|
||||||
|
|
||||||
@Column(DataType.DATE)
|
@Column(DataType.DATE)
|
||||||
@CreatedAt
|
@CreatedAt
|
||||||
|
@ -135,20 +135,20 @@ export class GuaribasConversationMessage extends Model<GuaribasConversationMessa
|
||||||
//tslint:disable-next-line:no-use-before-declare
|
//tslint:disable-next-line:no-use-before-declare
|
||||||
@ForeignKey(() => GuaribasConversation)
|
@ForeignKey(() => GuaribasConversation)
|
||||||
@Column(DataType.INTEGER)
|
@Column(DataType.INTEGER)
|
||||||
conversationId: number;
|
declare conversationId: number;
|
||||||
|
|
||||||
//tslint:disable-next-line:no-use-before-declare
|
//tslint:disable-next-line:no-use-before-declare
|
||||||
@BelongsTo(() => GuaribasConversation)
|
@BelongsTo(() => GuaribasConversation)
|
||||||
conversation: GuaribasConversation;
|
declare conversation: GuaribasConversation;
|
||||||
|
|
||||||
@ForeignKey(() => GuaribasInstance)
|
@ForeignKey(() => GuaribasInstance)
|
||||||
@Column(DataType.INTEGER)
|
@Column(DataType.INTEGER)
|
||||||
instanceId: number;
|
declare instanceId: number;
|
||||||
|
|
||||||
@ForeignKey(() => GuaribasUser)
|
@ForeignKey(() => GuaribasUser)
|
||||||
@Column(DataType.INTEGER)
|
@Column(DataType.INTEGER)
|
||||||
userId: number;
|
declare userId: number;
|
||||||
|
|
||||||
@BelongsTo(() => GuaribasUser)
|
@BelongsTo(() => GuaribasUser)
|
||||||
user: GuaribasUser;
|
declare user: GuaribasUser;
|
||||||
}
|
}
|
||||||
|
|
|
@ -59,7 +59,7 @@ export class GuaribasInstance extends Model<GuaribasInstance> implements IGBInst
|
||||||
@PrimaryKey
|
@PrimaryKey
|
||||||
@AutoIncrement
|
@AutoIncrement
|
||||||
@Column(DataType.INTEGER)
|
@Column(DataType.INTEGER)
|
||||||
instanceId: number;
|
declare instanceId: number;
|
||||||
|
|
||||||
@Column(DataType.STRING(255))
|
@Column(DataType.STRING(255))
|
||||||
declare botEndpoint: string;
|
declare botEndpoint: string;
|
||||||
|
|
|
@ -58,47 +58,47 @@ export class GuaribasUser extends Model<GuaribasUser> {
|
||||||
@PrimaryKey
|
@PrimaryKey
|
||||||
@AutoIncrement
|
@AutoIncrement
|
||||||
@Column(DataType.INTEGER)
|
@Column(DataType.INTEGER)
|
||||||
userId: number;
|
declare userId: number;
|
||||||
|
|
||||||
@Column(DataType.STRING(255))
|
@Column(DataType.STRING(255))
|
||||||
displayName: string;
|
declare displayName: string;
|
||||||
|
|
||||||
@Column(DataType.STRING(255))
|
@Column(DataType.STRING(255))
|
||||||
userSystemId: string;
|
declare userSystemId: string;
|
||||||
|
|
||||||
@Column(DataType.STRING(255))
|
@Column(DataType.STRING(255))
|
||||||
userName: string;
|
declare userName: string;
|
||||||
|
|
||||||
@Column(DataType.STRING(255))
|
@Column(DataType.STRING(255))
|
||||||
defaultChannel: string;
|
declare defaultChannel: string;
|
||||||
|
|
||||||
@Column(DataType.STRING(255))
|
@Column(DataType.STRING(255))
|
||||||
email: string;
|
declare email: string;
|
||||||
|
|
||||||
@Column(DataType.STRING(5))
|
@Column(DataType.STRING(5))
|
||||||
locale: string;
|
declare locale: string;
|
||||||
|
|
||||||
@ForeignKey(() => GuaribasInstance)
|
@ForeignKey(() => GuaribasInstance)
|
||||||
@Column(DataType.INTEGER)
|
@Column(DataType.INTEGER)
|
||||||
instanceId: number;
|
declare instanceId: number;
|
||||||
|
|
||||||
@BelongsTo(() => GuaribasInstance)
|
@BelongsTo(() => GuaribasInstance)
|
||||||
instance: GuaribasInstance;
|
declare instance: GuaribasInstance;
|
||||||
|
|
||||||
@Column(DataType.INTEGER)
|
@Column(DataType.INTEGER)
|
||||||
agentSystemId: string;
|
declare agentSystemId: string;
|
||||||
|
|
||||||
@Column(DataType.DATE)
|
@Column(DataType.DATE)
|
||||||
agentContacted: Date;
|
declare agentContacted: Date;
|
||||||
|
|
||||||
@Column(DataType.STRING(16))
|
@Column(DataType.STRING(16))
|
||||||
agentMode: string;
|
declare agentMode: string;
|
||||||
|
|
||||||
@Column(DataType.TEXT)
|
@Column(DataType.TEXT)
|
||||||
conversationReference: string;
|
declare conversationReference: string;
|
||||||
|
|
||||||
@Column(DataType.STRING(64))
|
@Column(DataType.STRING(64))
|
||||||
hearOnDialog: string;
|
declare hearOnDialog: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -109,18 +109,18 @@ export class GuaribasGroup extends Model<GuaribasGroup> {
|
||||||
@PrimaryKey
|
@PrimaryKey
|
||||||
@AutoIncrement
|
@AutoIncrement
|
||||||
@Column(DataType.INTEGER)
|
@Column(DataType.INTEGER)
|
||||||
groupId: number;
|
declare groupId: number;
|
||||||
|
|
||||||
@Length({ min: 0, max: 512 })
|
@Length({ min: 0, max: 512 })
|
||||||
@Column(DataType.STRING(512))
|
@Column(DataType.STRING(512))
|
||||||
displayName: string;
|
declare displayName: string;
|
||||||
|
|
||||||
@ForeignKey(() => GuaribasInstance)
|
@ForeignKey(() => GuaribasInstance)
|
||||||
@Column(DataType.INTEGER)
|
@Column(DataType.INTEGER)
|
||||||
instanceId: number;
|
declare instanceId: number;
|
||||||
|
|
||||||
@BelongsTo(() => GuaribasInstance)
|
@BelongsTo(() => GuaribasInstance)
|
||||||
instance: GuaribasInstance;
|
declare instance: GuaribasInstance;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -130,22 +130,22 @@ export class GuaribasGroup extends Model<GuaribasGroup> {
|
||||||
export class GuaribasUserGroup extends Model<GuaribasUserGroup> {
|
export class GuaribasUserGroup extends Model<GuaribasUserGroup> {
|
||||||
@ForeignKey(() => GuaribasUser)
|
@ForeignKey(() => GuaribasUser)
|
||||||
@Column(DataType.INTEGER)
|
@Column(DataType.INTEGER)
|
||||||
userId: number;
|
declare userId: number;
|
||||||
|
|
||||||
@ForeignKey(() => GuaribasGroup)
|
@ForeignKey(() => GuaribasGroup)
|
||||||
@Column(DataType.INTEGER)
|
@Column(DataType.INTEGER)
|
||||||
groupId: number;
|
declare groupId: number;
|
||||||
|
|
||||||
@ForeignKey(() => GuaribasInstance)
|
@ForeignKey(() => GuaribasInstance)
|
||||||
@Column(DataType.INTEGER)
|
@Column(DataType.INTEGER)
|
||||||
instanceId: number;
|
declare instanceId: number;
|
||||||
|
|
||||||
@BelongsTo(() => GuaribasInstance)
|
@BelongsTo(() => GuaribasInstance)
|
||||||
instance: GuaribasInstance;
|
declare instance: GuaribasInstance;
|
||||||
|
|
||||||
@BelongsTo(() => GuaribasGroup)
|
@BelongsTo(() => GuaribasGroup)
|
||||||
group: GuaribasGroup;
|
declare group: GuaribasGroup;
|
||||||
|
|
||||||
@BelongsTo(() => GuaribasUser)
|
@BelongsTo(() => GuaribasUser)
|
||||||
user: GuaribasUser;
|
declare user: GuaribasUser;
|
||||||
}
|
}
|
||||||
|
|
|
@ -110,6 +110,12 @@ export class GBServer {
|
||||||
server.use(bodyParser.json());
|
server.use(bodyParser.json());
|
||||||
server.use(bodyParser.urlencoded({ extended: true }));
|
server.use(bodyParser.urlencoded({ extended: true }));
|
||||||
|
|
||||||
|
process.on('unhandledRejection', (err, p) => {
|
||||||
|
console.log('An unhandledRejection occurred');
|
||||||
|
console.log(`Rejected Promise: ${p}`);
|
||||||
|
console.log(`Rejection: ${err}`);
|
||||||
|
});
|
||||||
|
|
||||||
// Creates working directory.
|
// Creates working directory.
|
||||||
|
|
||||||
process.env.PWD = process.cwd();
|
process.env.PWD = process.cwd();
|
||||||
|
|
Loading…
Add table
Reference in a new issue