@memberjunction/server 1.8.0 → 1.8.1

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.
@@ -275,8 +275,8 @@ export class AskSkipResolver {
275
275
  feedback: q.Feedback,
276
276
  status: q.Status,
277
277
  qualityRank: q.QualityRank,
278
- createdAt: q.CreatedAt,
279
- updatedAt: q.UpdatedAt,
278
+ createdAt: q.__mj_CreatedAt,
279
+ updatedAt: q.__mj_UpdatedAt,
280
280
  categoryID: q.CategoryID,
281
281
  fields: q.Fields.map((f) => {
282
282
  return {
@@ -294,8 +294,8 @@ export class AskSkipResolver {
294
294
  computationDescription: f.ComputationDescription,
295
295
  isSummary: f.IsSummary,
296
296
  summaryDescription: f.SummaryDescription,
297
- createdAt: f.CreatedAt,
298
- updatedAt: f.UpdatedAt,
297
+ createdAt: f.__mj_CreatedAt,
298
+ updatedAt: f.__mj_UpdatedAt,
299
299
  }
300
300
  })
301
301
  }
@@ -470,23 +470,23 @@ export class AskSkipResolver {
470
470
  const md = new Metadata();
471
471
  const e = md.Entities.find((e) => e.Name === 'Conversation Details');
472
472
  const sql = `SELECT
473
- ${maxHistoricalMessages ? 'TOP ' + maxHistoricalMessages : ''} ID, Message, Role, CreatedAt
473
+ ${maxHistoricalMessages ? 'TOP ' + maxHistoricalMessages : ''} ID, Message, Role, __mj_CreatedAt
474
474
  FROM
475
475
  ${e.SchemaName}.${e.BaseView}
476
476
  WHERE
477
477
  ConversationID = ${ConversationId}
478
478
  ORDER
479
- BY CreatedAt DESC`;
479
+ BY __mj_CreatedAt DESC`;
480
480
  const result = await dataSource.query(sql);
481
481
  if (!result)
482
482
  throw new Error(`Error running SQL: ${sql}`);
483
483
  else {
484
- // first, let's sort the result array into a local variable called returnData and in that we will sort by CreatedAt in ASCENDING order so we have the right chronological order
484
+ // first, let's sort the result array into a local variable called returnData and in that we will sort by __mj_CreatedAt in ASCENDING order so we have the right chronological order
485
485
  // the reason we're doing a LOCAL sort here is because in the SQL query above, we're sorting in DESCENDING order so we can use the TOP clause to limit the number of records and get the
486
486
  // N most recent records. We want to sort in ASCENDING order because we want to send the messages to the Skip API in the order they were created.
487
487
  const returnData = result.sort((a: any, b: any) => {
488
- const aDate = new Date(a.CreatedAt);
489
- const bDate = new Date(b.CreatedAt);
488
+ const aDate = new Date(a.__mj_CreatedAt);
489
+ const bDate = new Date(b.__mj_CreatedAt);
490
490
  return aDate.getTime() - bDate.getTime();
491
491
  });
492
492
 
@@ -29,10 +29,10 @@ export class CommunicationProviderMessageType {
29
29
  AdditionalAttributes: string;
30
30
 
31
31
  @Field()
32
- CreatedAt: Date;
32
+ _mj_CreatedAt: Date;
33
33
 
34
34
  @Field()
35
- UpdatedAt: Date;
35
+ _mj_UpdatedAt: Date;
36
36
 
37
37
  @Field()
38
38
  CommunicationProvider?: string;
@@ -71,10 +71,10 @@ export class TemplateInputType {
71
71
  IsActive: boolean;
72
72
 
73
73
  @Field()
74
- CreatedAt: Date;
74
+ _mj_CreatedAt: Date;
75
75
 
76
76
  @Field()
77
- UpdatedAt: Date;
77
+ _mj_UpdatedAt: Date;
78
78
 
79
79
  @Field({ nullable: true})
80
80
  Category?: string;
@@ -169,7 +169,7 @@ export class ReportResolver {
169
169
  @Ctx() { userPayload }: AppContext): Promise<RunEntityCommunicationResultType> {
170
170
  try {
171
171
  await EntityCommunicationsEngine.Instance.Config(false, userPayload.userRecord);
172
- const newMessage = new Message(<Message>message);
172
+ const newMessage = new Message(message as unknown as Message);
173
173
  await TemplateEngineServer.Instance.Config(false, userPayload.userRecord);
174
174
  // for the templates, replace the values from the input with the objects from the Template Engine we have here
175
175
  if (newMessage.BodyTemplate) {