@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.
- package/CHANGELOG.json +160 -1
- package/CHANGELOG.md +34 -2
- package/dist/generated/generated.d.ts +197 -135
- package/dist/generated/generated.d.ts.map +1 -1
- package/dist/generated/generated.js +617 -314
- package/dist/generated/generated.js.map +1 -1
- package/dist/resolvers/AskSkipResolver.js +8 -8
- package/dist/resolvers/AskSkipResolver.js.map +1 -1
- package/dist/resolvers/EntityCommunicationsResolver.d.ts +4 -4
- package/dist/resolvers/EntityCommunicationsResolver.d.ts.map +1 -1
- package/dist/resolvers/EntityCommunicationsResolver.js +4 -4
- package/dist/resolvers/EntityCommunicationsResolver.js.map +1 -1
- package/package.json +21 -21
- package/src/generated/generated.ts +542 -307
- package/src/resolvers/AskSkipResolver.ts +9 -9
- package/src/resolvers/EntityCommunicationsResolver.ts +5 -5
|
@@ -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.
|
|
279
|
-
updatedAt: q.
|
|
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.
|
|
298
|
-
updatedAt: f.
|
|
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,
|
|
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
|
|
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
|
|
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.
|
|
489
|
-
const bDate = new Date(b.
|
|
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
|
-
|
|
32
|
+
_mj_CreatedAt: Date;
|
|
33
33
|
|
|
34
34
|
@Field()
|
|
35
|
-
|
|
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
|
-
|
|
74
|
+
_mj_CreatedAt: Date;
|
|
75
75
|
|
|
76
76
|
@Field()
|
|
77
|
-
|
|
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(
|
|
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) {
|