@memberjunction/server 5.2.0 → 5.3.0

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.
@@ -28,7 +28,9 @@ import {
28
28
  } from '@memberjunction/skip-types';
29
29
  import { DataContext } from '@memberjunction/data-context';
30
30
  import { UserInfo, LogStatus, LogError, Metadata, RunQuery, EntityInfo, EntityFieldInfo, EntityRelationshipInfo } from '@memberjunction/core';
31
- import { sendPostRequest } from '../util.js';
31
+ import { request as httpRequest } from 'http';
32
+ import { request as httpsRequest } from 'https';
33
+ import { gzip as gzipCompress, createGunzip } from 'zlib';
32
34
  import { configInfo, baseUrl, publicUrl, graphqlPort, graphqlRootPath, apiKey as callbackAPIKey } from '../config.js';
33
35
  import { GetAIAPIKey } from '@memberjunction/ai';
34
36
  import { AIEngine } from '@memberjunction/aiengine';
@@ -171,6 +173,20 @@ export interface SkipCallResult {
171
173
  allResponses?: any[];
172
174
  }
173
175
 
176
+ /**
177
+ * Shape of a single SSE event received from the Skip API stream.
178
+ * Skip sends two formats:
179
+ * - Wrapped: `{type: 'status_update'|'streaming'|'complete', value: SkipAPIResponse}`
180
+ * - Flat (queue): `{responsePhase: 'queued'|'error', message: '...', error: '...'}`
181
+ */
182
+ interface SkipStreamMessage {
183
+ type?: string;
184
+ value?: SkipAPIResponse;
185
+ responsePhase?: string;
186
+ message?: string;
187
+ error?: string;
188
+ }
189
+
174
190
  /**
175
191
  * Skip TypeScript SDK
176
192
  * Provides a clean interface for calling the Skip SaaS API
@@ -202,13 +218,12 @@ export class SkipSDK {
202
218
  // Build the Skip API request
203
219
  const skipRequest = await this.buildSkipRequest(options);
204
220
 
205
- // Call Skip API with streaming support
206
- const responses = await sendPostRequest(
221
+ // Call Skip API with SSE streaming support
222
+ const responses = await this.sendSSERequest(
207
223
  this.config.apiUrl,
208
224
  skipRequest,
209
- true, // useCompression
210
225
  this.buildHeaders(),
211
- (streamMessage: any) => {
226
+ (streamMessage: SkipStreamMessage) => {
212
227
  // Handle streaming status updates
213
228
  // Queue messages come as flat objects: {responsePhase: 'queued'|'error', message: '...', error: '...'}
214
229
  // Skip API messages come wrapped: {type: 'status_update', value: {responsePhase: '...', messages: [...]}}
@@ -649,6 +664,116 @@ export class SkipSDK {
649
664
  };
650
665
  }
651
666
 
667
+ /**
668
+ * Send an SSE-aware POST request to the Skip API.
669
+ * Replaces sendPostRequest for SSE format: parses `data: {json}\n\n` events
670
+ * instead of NDJSON `{json}\n` lines. This is required because Azure Container
671
+ * Apps' Envoy proxy buffers NDJSON responses but streams SSE responses.
672
+ */
673
+ private async sendSSERequest(
674
+ url: string,
675
+ payload: SkipAPIRequest,
676
+ headers: Record<string, string>,
677
+ streamCallback?: (event: SkipStreamMessage) => void
678
+ ): Promise<SkipStreamMessage[]> {
679
+ // Gzip the request body
680
+ const compressed = await new Promise<Buffer>((resolve, reject) => {
681
+ gzipCompress(JSON.stringify(payload), (err, result) => {
682
+ if (err) reject(err);
683
+ else resolve(result);
684
+ });
685
+ });
686
+
687
+ return new Promise((resolve, reject) => {
688
+ try {
689
+ const parsedUrl = new URL(url);
690
+ const options = {
691
+ hostname: parsedUrl.hostname,
692
+ port: parsedUrl.port || (parsedUrl.protocol === 'https:' ? 443 : 80),
693
+ path: parsedUrl.pathname,
694
+ method: 'POST' as const,
695
+ headers: {
696
+ 'Content-Type': 'application/json',
697
+ 'Content-Encoding': 'gzip',
698
+ ...headers
699
+ }
700
+ };
701
+
702
+ const requestFn = parsedUrl.protocol === 'https:' ? httpsRequest : httpRequest;
703
+ const events: SkipStreamMessage[] = [];
704
+ let buffer = '';
705
+ let streamEnded = false;
706
+
707
+ const parseSSELine = (line: string): void => {
708
+ if (line.trim() === '') return; // Skip empty lines (SSE event delimiters)
709
+ if (!line.startsWith('data: ')) return; // Skip non-data SSE fields
710
+ const jsonStr = line.slice(6);
711
+ if (!jsonStr.trim()) return;
712
+
713
+ try {
714
+ const event = JSON.parse(jsonStr) as SkipStreamMessage;
715
+ events.push(event);
716
+ streamCallback?.(event);
717
+ } catch (e) {
718
+ LogError(`[SkipSDK] SSE parse error: ${e}`);
719
+ }
720
+ };
721
+
722
+ const handleStreamEnd = (): void => {
723
+ if (streamEnded) return;
724
+ streamEnded = true;
725
+ // Try to parse any remaining data in buffer
726
+ if (buffer.trim()) {
727
+ parseSSELine(buffer);
728
+ }
729
+ resolve(events);
730
+ };
731
+
732
+ const req = requestFn(options, (res) => {
733
+ const gunzip = createGunzip();
734
+ const stream = res.headers['content-encoding'] === 'gzip' ? res.pipe(gunzip) : res;
735
+
736
+ stream.on('data', (chunk: Buffer) => {
737
+ buffer += chunk.toString();
738
+ let boundary: number;
739
+ while ((boundary = buffer.indexOf('\n')) !== -1) {
740
+ const line = buffer.substring(0, boundary);
741
+ buffer = buffer.substring(boundary + 1);
742
+ parseSSELine(line);
743
+ }
744
+ });
745
+
746
+ stream.on('end', handleStreamEnd);
747
+
748
+ stream.on('close', () => {
749
+ if (!streamEnded) {
750
+ LogError(`[SkipSDK] SSE stream closed prematurely for ${url}`);
751
+ handleStreamEnd();
752
+ }
753
+ });
754
+
755
+ stream.on('error', (e: Error) => {
756
+ if (!streamEnded) {
757
+ LogError(`[SkipSDK] SSE stream error for ${url}: ${e.message}`);
758
+ reject(new Error(`SSE stream error: ${e.message}`));
759
+ }
760
+ });
761
+ });
762
+
763
+ req.on('error', (e: Error) => {
764
+ LogError(`[SkipSDK] SSE request error for ${url}: ${e.message}`);
765
+ reject(new Error(`HTTP request failed to ${url}: ${e.message}`));
766
+ });
767
+
768
+ req.write(compressed);
769
+ req.end();
770
+ } catch (e) {
771
+ LogError(`[SkipSDK] sendSSERequest error: ${e}`);
772
+ reject(e);
773
+ }
774
+ });
775
+ }
776
+
652
777
  /**
653
778
  * Refreshes the Skip entities cache
654
779
  * Rebuilds the entity information that is provided to Skip
@@ -6297,6 +6297,14 @@ detailed information about what validation rules failed.`})
6297
6297
  @Field({nullable: true, description: `Human-readable notes and comments about this agent run step`})
6298
6298
  Comments?: string;
6299
6299
 
6300
+ @Field({nullable: true})
6301
+ @MaxLength(510)
6302
+ AgentRun?: string;
6303
+
6304
+ @Field({nullable: true})
6305
+ @MaxLength(510)
6306
+ Parent?: string;
6307
+
6300
6308
  @Field({nullable: true})
6301
6309
  @MaxLength(16)
6302
6310
  RootParentID?: string;
@@ -15293,6 +15301,10 @@ export class MJAIResultCache_ {
15293
15301
  @MaxLength(200)
15294
15302
  Configuration?: string;
15295
15303
 
15304
+ @Field({nullable: true})
15305
+ @MaxLength(510)
15306
+ PromptRun?: string;
15307
+
15296
15308
  }
15297
15309
 
15298
15310
  //****************************************************************************
@@ -27614,6 +27626,9 @@ export class MJConversationDetailArtifact_ {
27614
27626
  @MaxLength(10)
27615
27627
  _mj__UpdatedAt: Date;
27616
27628
 
27629
+ @Field()
27630
+ ConversationDetail: string;
27631
+
27617
27632
  @Field({nullable: true})
27618
27633
  @MaxLength(510)
27619
27634
  ArtifactVersion?: string;
@@ -28039,6 +28054,9 @@ export class MJConversationDetailRating_ {
28039
28054
  @MaxLength(10)
28040
28055
  _mj__UpdatedAt: Date;
28041
28056
 
28057
+ @Field()
28058
+ ConversationDetail: string;
28059
+
28042
28060
  @Field()
28043
28061
  @MaxLength(200)
28044
28062
  User: string;
@@ -28779,6 +28797,10 @@ export class MJConversation_ {
28779
28797
  @MaxLength(510)
28780
28798
  Project?: string;
28781
28799
 
28800
+ @Field({nullable: true})
28801
+ @MaxLength(510)
28802
+ TestRun?: string;
28803
+
28782
28804
  @Field(() => [MJConversationDetail_])
28783
28805
  MJConversationDetails_ConversationIDArray: MJConversationDetail_[]; // Link to MJConversationDetails
28784
28806
 
@@ -32612,6 +32634,10 @@ export class MJDuplicateRunDetail_ {
32612
32634
  @MaxLength(10)
32613
32635
  _mj__UpdatedAt: Date;
32614
32636
 
32637
+ @Field()
32638
+ @MaxLength(510)
32639
+ DuplicateRun: string;
32640
+
32615
32641
  @Field(() => [MJDuplicateRunDetailMatch_])
32616
32642
  MJDuplicateRunDetailMatches_DuplicateRunDetailIDArray: MJDuplicateRunDetailMatch_[]; // Link to MJDuplicateRunDetailMatches
32617
32643
 
@@ -33067,6 +33093,10 @@ export class MJEmployeeCompanyIntegration_ {
33067
33093
  @MaxLength(10)
33068
33094
  _mj__UpdatedAt: Date;
33069
33095
 
33096
+ @Field({nullable: true})
33097
+ @MaxLength(162)
33098
+ Employee?: string;
33099
+
33070
33100
  @Field()
33071
33101
  @MaxLength(510)
33072
33102
  CompanyIntegration: string;
@@ -33231,6 +33261,10 @@ export class MJEmployeeRole_ {
33231
33261
  @MaxLength(10)
33232
33262
  _mj__UpdatedAt: Date;
33233
33263
 
33264
+ @Field({nullable: true})
33265
+ @MaxLength(162)
33266
+ Employee?: string;
33267
+
33234
33268
  @Field()
33235
33269
  @MaxLength(100)
33236
33270
  Role: string;
@@ -33383,6 +33417,10 @@ export class MJEmployeeSkill_ {
33383
33417
  @MaxLength(10)
33384
33418
  _mj__UpdatedAt: Date;
33385
33419
 
33420
+ @Field({nullable: true})
33421
+ @MaxLength(162)
33422
+ Employee?: string;
33423
+
33386
33424
  @Field()
33387
33425
  @MaxLength(100)
33388
33426
  Skill: string;
@@ -34703,10 +34741,10 @@ export class MJEntity_ {
34703
34741
  @Field(() => Boolean, {description: `When false (default), child types are disjoint - a record can only be one child type at a time. When true, a record can simultaneously exist as multiple child types (e.g., a Person can be both a Member and a Volunteer).`})
34704
34742
  AllowMultipleSubtypes: boolean;
34705
34743
 
34706
- @Field({nullable: true})
34744
+ @Field({nullable: true, description: `Schema-based programmatic code name derived from the entity Name. Uses GetClassNameSchemaPrefix(SchemaName) as the prefix, then strips EntityNamePrefix from the Name and removes spaces. For "__mj" schema with entity "MJ: AI Models", this produces "MJAIModels". For entities in other schemas, the sanitized schema name is prepended. Used in GraphQL type generation and internal code references.`})
34707
34745
  CodeName?: string;
34708
34746
 
34709
- @Field({nullable: true})
34747
+ @Field({nullable: true, description: `Schema-based programmatic class name used for TypeScript entity classes, Zod schemas, and Angular form components. Computed as GetProgrammaticName(GetClassNameSchemaPrefix(SchemaName) + BaseTable + NameSuffix). The prefix is derived from SchemaName (guaranteed unique by SQL Server), not from EntityNamePrefix. For the core __mj schema, the prefix is "MJ"; for all other schemas it is the alphanumeric-sanitized schema name. This prevents cross-schema collisions and aligns with GraphQL type naming in getGraphQLTypeNameBase().`})
34710
34748
  ClassName?: string;
34711
34749
 
34712
34750
  @Field({nullable: true})
@@ -35840,6 +35878,13 @@ export class MJEntityActionFilter_ {
35840
35878
  @MaxLength(10)
35841
35879
  _mj__UpdatedAt: Date;
35842
35880
 
35881
+ @Field()
35882
+ @MaxLength(850)
35883
+ EntityAction: string;
35884
+
35885
+ @Field()
35886
+ ActionFilter: string;
35887
+
35843
35888
  }
35844
35889
 
35845
35890
  //****************************************************************************
@@ -36174,6 +36219,10 @@ export class MJEntityActionInvocation_ {
36174
36219
  @MaxLength(10)
36175
36220
  _mj__UpdatedAt: Date;
36176
36221
 
36222
+ @Field()
36223
+ @MaxLength(850)
36224
+ EntityAction: string;
36225
+
36177
36226
  @Field()
36178
36227
  @MaxLength(510)
36179
36228
  InvocationType: string;
@@ -36342,6 +36391,10 @@ export class MJEntityActionParam_ {
36342
36391
  @MaxLength(10)
36343
36392
  _mj__UpdatedAt: Date;
36344
36393
 
36394
+ @Field()
36395
+ @MaxLength(850)
36396
+ EntityAction: string;
36397
+
36345
36398
  @Field()
36346
36399
  @MaxLength(510)
36347
36400
  ActionParam: string;
@@ -36994,6 +37047,10 @@ export class MJEntityCommunicationField_ {
36994
37047
  @MaxLength(10)
36995
37048
  _mj__UpdatedAt: Date;
36996
37049
 
37050
+ @Field()
37051
+ @MaxLength(200)
37052
+ EntityCommunicationMessageType: string;
37053
+
36997
37054
  }
36998
37055
 
36999
37056
  //****************************************************************************
@@ -40427,6 +40484,14 @@ export class MJErrorLog_ {
40427
40484
  @MaxLength(10)
40428
40485
  _mj__UpdatedAt: Date;
40429
40486
 
40487
+ @Field({nullable: true})
40488
+ @MaxLength(200)
40489
+ CompanyIntegrationRun?: string;
40490
+
40491
+ @Field({nullable: true})
40492
+ @MaxLength(900)
40493
+ CompanyIntegrationRunDetail?: string;
40494
+
40430
40495
  }
40431
40496
 
40432
40497
  //****************************************************************************
@@ -44377,6 +44442,10 @@ export class MJMCPServerConnectionTool_ {
44377
44442
  @MaxLength(510)
44378
44443
  MCPServerConnection: string;
44379
44444
 
44445
+ @Field({nullable: true})
44446
+ @MaxLength(510)
44447
+ MCPServerTool?: string;
44448
+
44380
44449
  }
44381
44450
 
44382
44451
  //****************************************************************************
@@ -45625,6 +45694,10 @@ export class MJMCPToolExecutionLog_ {
45625
45694
  @MaxLength(510)
45626
45695
  MCPServerConnection: string;
45627
45696
 
45697
+ @Field({nullable: true})
45698
+ @MaxLength(510)
45699
+ MCPServerTool?: string;
45700
+
45628
45701
  @Field()
45629
45702
  @MaxLength(200)
45630
45703
  User: string;
@@ -47396,15 +47469,15 @@ export class MJOpenApp_ {
47396
47469
  @MaxLength(200)
47397
47470
  InstalledByUser: string;
47398
47471
 
47472
+ @Field(() => [MJOpenAppDependency_])
47473
+ MJOpenAppDependencies_OpenAppIDArray: MJOpenAppDependency_[]; // Link to MJOpenAppDependencies
47474
+
47399
47475
  @Field(() => [MJOpenAppDependency_])
47400
47476
  MJOpenAppDependencies_DependsOnAppIDArray: MJOpenAppDependency_[]; // Link to MJOpenAppDependencies
47401
47477
 
47402
47478
  @Field(() => [MJOpenAppInstallHistory_])
47403
47479
  MJOpenAppInstallHistories_OpenAppIDArray: MJOpenAppInstallHistory_[]; // Link to MJOpenAppInstallHistories
47404
47480
 
47405
- @Field(() => [MJOpenAppDependency_])
47406
- MJOpenAppDependencies_OpenAppIDArray: MJOpenAppDependency_[]; // Link to MJOpenAppDependencies
47407
-
47408
47481
  }
47409
47482
 
47410
47483
  //****************************************************************************
@@ -47589,6 +47662,17 @@ export class MJOpenAppResolver extends ResolverBase {
47589
47662
  return result;
47590
47663
  }
47591
47664
 
47665
+ @FieldResolver(() => [MJOpenAppDependency_])
47666
+ async MJOpenAppDependencies_OpenAppIDArray(@Root() mjopenapp_: MJOpenApp_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
47667
+ this.CheckUserReadPermissions('MJ: Open App Dependencies', userPayload);
47668
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
47669
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
47670
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwOpenAppDependencies] WHERE [OpenAppID]='${mjopenapp_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Open App Dependencies', userPayload, EntityPermissionType.Read, 'AND');
47671
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
47672
+ const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Open App Dependencies', rows, this.GetUserFromPayload(userPayload));
47673
+ return result;
47674
+ }
47675
+
47592
47676
  @FieldResolver(() => [MJOpenAppDependency_])
47593
47677
  async MJOpenAppDependencies_DependsOnAppIDArray(@Root() mjopenapp_: MJOpenApp_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
47594
47678
  this.CheckUserReadPermissions('MJ: Open App Dependencies', userPayload);
@@ -47611,17 +47695,6 @@ export class MJOpenAppResolver extends ResolverBase {
47611
47695
  return result;
47612
47696
  }
47613
47697
 
47614
- @FieldResolver(() => [MJOpenAppDependency_])
47615
- async MJOpenAppDependencies_OpenAppIDArray(@Root() mjopenapp_: MJOpenApp_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
47616
- this.CheckUserReadPermissions('MJ: Open App Dependencies', userPayload);
47617
- const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
47618
- const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
47619
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwOpenAppDependencies] WHERE [OpenAppID]='${mjopenapp_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Open App Dependencies', userPayload, EntityPermissionType.Read, 'AND');
47620
- const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
47621
- const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Open App Dependencies', rows, this.GetUserFromPayload(userPayload));
47622
- return result;
47623
- }
47624
-
47625
47698
  @Mutation(() => MJOpenApp_)
47626
47699
  async CreateMJOpenApp(
47627
47700
  @Arg('input', () => CreateMJOpenAppInput) input: CreateMJOpenAppInput,
@@ -50804,6 +50877,9 @@ export class MJRecommendationItem_ {
50804
50877
  @MaxLength(10)
50805
50878
  _mj__UpdatedAt: Date;
50806
50879
 
50880
+ @Field()
50881
+ Recommendation: string;
50882
+
50807
50883
  @Field()
50808
50884
  @MaxLength(510)
50809
50885
  DestinationEntity: string;
@@ -51341,6 +51417,10 @@ export class MJRecommendation_ {
51341
51417
  @MaxLength(10)
51342
51418
  _mj__UpdatedAt: Date;
51343
51419
 
51420
+ @Field()
51421
+ @MaxLength(510)
51422
+ RecommendationRun: string;
51423
+
51344
51424
  @Field()
51345
51425
  @MaxLength(510)
51346
51426
  SourceEntity: string;
@@ -51750,6 +51830,10 @@ export class MJRecordChange_ {
51750
51830
  @MaxLength(200)
51751
51831
  User: string;
51752
51832
 
51833
+ @Field({nullable: true})
51834
+ @MaxLength(200)
51835
+ ReplayRun?: string;
51836
+
51753
51837
  @Field({nullable: true})
51754
51838
  @MaxLength(200)
51755
51839
  Integration?: string;
@@ -52199,6 +52283,10 @@ export class MJRecordMergeDeletionLog_ {
52199
52283
  @MaxLength(10)
52200
52284
  _mj__UpdatedAt: Date;
52201
52285
 
52286
+ @Field()
52287
+ @MaxLength(900)
52288
+ RecordMergeLog: string;
52289
+
52202
52290
  }
52203
52291
 
52204
52292
  //****************************************************************************
@@ -53419,6 +53507,9 @@ export class MJReport_ {
53419
53507
  @MaxLength(510)
53420
53508
  Conversation?: string;
53421
53509
 
53510
+ @Field({nullable: true})
53511
+ ConversationDetail?: string;
53512
+
53422
53513
  @Field({nullable: true})
53423
53514
  @MaxLength(510)
53424
53515
  DataContext?: string;
@@ -54401,16 +54492,16 @@ export class MJRole_ {
54401
54492
  MJEmployeeRoles_RoleIDArray: MJEmployeeRole_[]; // Link to MJEmployeeRoles
54402
54493
 
54403
54494
  @Field(() => [MJEntityPermission_])
54404
- MJEntityPermissions_RoleNameArray: MJEntityPermission_[]; // Link to MJEntityPermissions
54495
+ MJEntityPermissions_RoleIDArray: MJEntityPermission_[]; // Link to MJEntityPermissions
54405
54496
 
54406
54497
  @Field(() => [MJUserRole_])
54407
- MJUserRoles_RoleNameArray: MJUserRole_[]; // Link to MJUserRoles
54498
+ MJUserRoles_RoleIDArray: MJUserRole_[]; // Link to MJUserRoles
54408
54499
 
54409
54500
  @Field(() => [MJAuthorizationRole_])
54410
- MJAuthorizationRoles_RoleNameArray: MJAuthorizationRole_[]; // Link to MJAuthorizationRoles
54501
+ MJAuthorizationRoles_RoleIDArray: MJAuthorizationRole_[]; // Link to MJAuthorizationRoles
54411
54502
 
54412
54503
  @Field(() => [MJQueryPermission_])
54413
- MJQueryPermissions_RoleNameArray: MJQueryPermission_[]; // Link to MJQueryPermissions
54504
+ MJQueryPermissions_RoleIDArray: MJQueryPermission_[]; // Link to MJQueryPermissions
54414
54505
 
54415
54506
  @Field(() => [MJResourcePermission_])
54416
54507
  MJResourcePermissions_RoleIDArray: MJResourcePermission_[]; // Link to MJResourcePermissions
@@ -54550,44 +54641,44 @@ export class MJRoleResolver extends ResolverBase {
54550
54641
  }
54551
54642
 
54552
54643
  @FieldResolver(() => [MJEntityPermission_])
54553
- async MJEntityPermissions_RoleNameArray(@Root() mjrole_: MJRole_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
54644
+ async MJEntityPermissions_RoleIDArray(@Root() mjrole_: MJRole_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
54554
54645
  this.CheckUserReadPermissions('MJ: Entity Permissions', userPayload);
54555
54646
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
54556
54647
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
54557
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwEntityPermissions] WHERE [RoleName]='${mjrole_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Entity Permissions', userPayload, EntityPermissionType.Read, 'AND');
54648
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwEntityPermissions] WHERE [RoleID]='${mjrole_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Entity Permissions', userPayload, EntityPermissionType.Read, 'AND');
54558
54649
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
54559
54650
  const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Entity Permissions', rows, this.GetUserFromPayload(userPayload));
54560
54651
  return result;
54561
54652
  }
54562
54653
 
54563
54654
  @FieldResolver(() => [MJUserRole_])
54564
- async MJUserRoles_RoleNameArray(@Root() mjrole_: MJRole_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
54655
+ async MJUserRoles_RoleIDArray(@Root() mjrole_: MJRole_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
54565
54656
  this.CheckUserReadPermissions('MJ: User Roles', userPayload);
54566
54657
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
54567
54658
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
54568
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwUserRoles] WHERE [RoleName]='${mjrole_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: User Roles', userPayload, EntityPermissionType.Read, 'AND');
54659
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwUserRoles] WHERE [RoleID]='${mjrole_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: User Roles', userPayload, EntityPermissionType.Read, 'AND');
54569
54660
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
54570
54661
  const result = await this.ArrayMapFieldNamesToCodeNames('MJ: User Roles', rows, this.GetUserFromPayload(userPayload));
54571
54662
  return result;
54572
54663
  }
54573
54664
 
54574
54665
  @FieldResolver(() => [MJAuthorizationRole_])
54575
- async MJAuthorizationRoles_RoleNameArray(@Root() mjrole_: MJRole_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
54666
+ async MJAuthorizationRoles_RoleIDArray(@Root() mjrole_: MJRole_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
54576
54667
  this.CheckUserReadPermissions('MJ: Authorization Roles', userPayload);
54577
54668
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
54578
54669
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
54579
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAuthorizationRoles] WHERE [RoleName]='${mjrole_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Authorization Roles', userPayload, EntityPermissionType.Read, 'AND');
54670
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAuthorizationRoles] WHERE [RoleID]='${mjrole_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Authorization Roles', userPayload, EntityPermissionType.Read, 'AND');
54580
54671
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
54581
54672
  const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Authorization Roles', rows, this.GetUserFromPayload(userPayload));
54582
54673
  return result;
54583
54674
  }
54584
54675
 
54585
54676
  @FieldResolver(() => [MJQueryPermission_])
54586
- async MJQueryPermissions_RoleNameArray(@Root() mjrole_: MJRole_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
54677
+ async MJQueryPermissions_RoleIDArray(@Root() mjrole_: MJRole_, @Ctx() { dataSources, userPayload, providers }: AppContext, @PubSub() pubSub: PubSubEngine) {
54587
54678
  this.CheckUserReadPermissions('MJ: Query Permissions', userPayload);
54588
54679
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
54589
54680
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
54590
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwQueryPermissions] WHERE [RoleName]='${mjrole_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Query Permissions', userPayload, EntityPermissionType.Read, 'AND');
54681
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwQueryPermissions] WHERE [RoleID]='${mjrole_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Query Permissions', userPayload, EntityPermissionType.Read, 'AND');
54591
54682
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
54592
54683
  const result = await this.ArrayMapFieldNamesToCodeNames('MJ: Query Permissions', rows, this.GetUserFromPayload(userPayload));
54593
54684
  return result;
@@ -57301,6 +57392,9 @@ export class MJTask_ {
57301
57392
  @MaxLength(510)
57302
57393
  Project?: string;
57303
57394
 
57395
+ @Field({nullable: true})
57396
+ ConversationDetail?: string;
57397
+
57304
57398
  @Field({nullable: true})
57305
57399
  @MaxLength(200)
57306
57400
  User?: string;
@@ -58197,6 +58291,10 @@ export class MJTemplateParam_ {
58197
58291
  @MaxLength(510)
58198
58292
  Entity?: string;
58199
58293
 
58294
+ @Field({nullable: true})
58295
+ @MaxLength(510)
58296
+ TemplateContent?: string;
58297
+
58200
58298
  }
58201
58299
 
58202
58300
  //****************************************************************************