@memberjunction/server 1.2.0 → 1.2.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.
@@ -72,6 +72,13 @@ export class RunViewByIDInput {
72
72
  })
73
73
  IgnoreMaxRows?: boolean;
74
74
 
75
+ @Field(() => Int, {
76
+ nullable: true,
77
+ description:
78
+ 'if a value > 0 is provided, and IgnoreMaxRows is set to false, this value is used for the max rows to be returned by the view.',
79
+ })
80
+ MaxRows?: number
81
+
75
82
  @Field(() => Boolean, {
76
83
  nullable: true,
77
84
  description:
@@ -147,6 +154,13 @@ export class RunViewByNameInput {
147
154
  })
148
155
  IgnoreMaxRows?: boolean;
149
156
 
157
+ @Field(() => Int, {
158
+ nullable: true,
159
+ description:
160
+ 'if a value > 0 is provided, and IgnoreMaxRows is set to false, this value is used for the max rows to be returned by the view.',
161
+ })
162
+ MaxRows?: number
163
+
150
164
  @Field(() => Boolean, {
151
165
  nullable: true,
152
166
  description:
@@ -207,6 +221,13 @@ export class RunDynamicViewInput {
207
221
  })
208
222
  IgnoreMaxRows?: boolean;
209
223
 
224
+ @Field(() => Int, {
225
+ nullable: true,
226
+ description:
227
+ 'if a value > 0 is provided, and IgnoreMaxRows is set to false, this value is used for the max rows to be returned by the view.',
228
+ })
229
+ MaxRows?: number
230
+
210
231
  @Field(() => Boolean, {
211
232
  nullable: true,
212
233
  description:
@@ -99,11 +99,13 @@ export class AskSkipResolver {
99
99
  dci.RecordID = PrimaryKeys.map((pk) => pk.Value).join(',');
100
100
  await dci.Save();
101
101
 
102
- await dataContext.Load(dataContext.ID, dataSource, false, true, user); // load again because we added a new data context item
102
+ await dataContext.Load(dataContext.ID, dataSource, false, true, 10, user); // load again because we added a new data context item
103
+ await dataContext.SaveItems(); // persist
103
104
 
104
105
  // also, in the situation for a new convo, we need to update the Conversation ID to have a LinkedEntity and LinkedRecord
105
106
  convoEntity.LinkedEntityID = dci.EntityID;
106
107
  convoEntity.LinkedRecordID = PrimaryKeys.map((pk) => pk.Value).join(',');
108
+ convoEntity.DataContextID = dataContext.ID;
107
109
  await convoEntity.Save();
108
110
  }
109
111
 
@@ -197,7 +199,7 @@ export class AskSkipResolver {
197
199
  const user = UserCache.Instance.Users.find((u) => u.Email.trim().toLowerCase() === userPayload.email.trim().toLowerCase());
198
200
  if (!user) throw new Error(`User ${userPayload.email} not found in UserCache`);
199
201
  const dataContext: DataContext = new DataContext();
200
- await dataContext.Load(DataContextId, dataSource, true, true, user);
202
+ await dataContext.Load(DataContextId, dataSource, true, false, 0, user);
201
203
  const input = this.buildSkipAPIRequest([], 0, dataContext, 'run_existing_script', false, false);
202
204
  return this.handleSimpleSkipPostRequest(input);
203
205
  }
@@ -426,7 +428,7 @@ export class AskSkipResolver {
426
428
  await convoDetailEntity.Save();
427
429
 
428
430
  const dataContext = MJGlobal.Instance.ClassFactory.CreateInstance<DataContext>(DataContext); // await this.LoadDataContext(md, dataSource, dataContextEntity, user, false);
429
- await dataContext.Load(dataContextEntity.ID, dataSource, false, true, user);
431
+ await dataContext.Load(dataContextEntity.ID, dataSource, false, false, 0, user);
430
432
  return {dataContext, convoEntity, dataContextEntity, convoDetailEntity};
431
433
  }
432
434
 
@@ -713,7 +715,7 @@ export class AskSkipResolver {
713
715
  item.Type = 'sql';
714
716
  item.SQL = dr.text;
715
717
  item.AdditionalDescription = dr.description;
716
- if (!await item.LoadData(dataSource, false, true, user))
718
+ if (!await item.LoadData(dataSource, false, false, 0, user))
717
719
  throw new Error(`SQL data request failed: ${item.DataLoadingError}`);
718
720
  break;
719
721
  case "stored_query":
@@ -724,7 +726,7 @@ export class AskSkipResolver {
724
726
  item.QueryID = query.ID;
725
727
  item.RecordName = query.Name;
726
728
  item.AdditionalDescription = dr.description;
727
- if (!await item.LoadData(dataSource, false, true, user))
729
+ if (!await item.LoadData(dataSource, false, false, 0, user))
728
730
  throw new Error(`SQL data request failed: ${item.DataLoadingError}`);
729
731
  }
730
732
  else