@memberjunction/server 2.108.0 → 2.110.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.
Files changed (39) hide show
  1. package/dist/agents/skip-agent.d.ts +1 -0
  2. package/dist/agents/skip-agent.d.ts.map +1 -1
  3. package/dist/agents/skip-agent.js +71 -20
  4. package/dist/agents/skip-agent.js.map +1 -1
  5. package/dist/agents/skip-sdk.d.ts.map +1 -1
  6. package/dist/agents/skip-sdk.js +29 -14
  7. package/dist/agents/skip-sdk.js.map +1 -1
  8. package/dist/generated/generated.d.ts +186 -15
  9. package/dist/generated/generated.d.ts.map +1 -1
  10. package/dist/generated/generated.js +1118 -95
  11. package/dist/generated/generated.js.map +1 -1
  12. package/dist/index.d.ts.map +1 -1
  13. package/dist/index.js +2 -0
  14. package/dist/index.js.map +1 -1
  15. package/dist/resolvers/CreateQueryResolver.d.ts +1 -0
  16. package/dist/resolvers/CreateQueryResolver.d.ts.map +1 -1
  17. package/dist/resolvers/CreateQueryResolver.js +73 -11
  18. package/dist/resolvers/CreateQueryResolver.js.map +1 -1
  19. package/dist/resolvers/RunAIAgentResolver.d.ts +6 -2
  20. package/dist/resolvers/RunAIAgentResolver.d.ts.map +1 -1
  21. package/dist/resolvers/RunAIAgentResolver.js +234 -8
  22. package/dist/resolvers/RunAIAgentResolver.js.map +1 -1
  23. package/dist/resolvers/TaskResolver.d.ts +1 -1
  24. package/dist/resolvers/TaskResolver.d.ts.map +1 -1
  25. package/dist/resolvers/TaskResolver.js +4 -3
  26. package/dist/resolvers/TaskResolver.js.map +1 -1
  27. package/dist/services/TaskOrchestrator.d.ts +3 -1
  28. package/dist/services/TaskOrchestrator.d.ts.map +1 -1
  29. package/dist/services/TaskOrchestrator.js +77 -2
  30. package/dist/services/TaskOrchestrator.js.map +1 -1
  31. package/package.json +35 -34
  32. package/src/agents/skip-agent.ts +130 -56
  33. package/src/agents/skip-sdk.ts +45 -16
  34. package/src/generated/generated.ts +720 -77
  35. package/src/index.ts +4 -0
  36. package/src/resolvers/CreateQueryResolver.ts +125 -28
  37. package/src/resolvers/RunAIAgentResolver.ts +397 -9
  38. package/src/resolvers/TaskResolver.ts +3 -2
  39. package/src/services/TaskOrchestrator.ts +118 -3
@@ -2502,8 +2502,8 @@ let MJAIAgentRun_ = class MJAIAgentRun_ {
2502
2502
  OverrideVendor;
2503
2503
  RootParentRunID;
2504
2504
  RootLastRunID;
2505
- MJ_AIAgentRunSteps_AgentRunIDArray;
2506
2505
  MJ_AIAgentRuns_ParentRunIDArray;
2506
+ MJ_AIAgentRunSteps_AgentRunIDArray;
2507
2507
  MJ_AIPromptRuns_AgentRunIDArray;
2508
2508
  };
2509
2509
  __decorate([
@@ -2726,14 +2726,14 @@ __decorate([
2726
2726
  MaxLength(16),
2727
2727
  __metadata("design:type", String)
2728
2728
  ], MJAIAgentRun_.prototype, "RootLastRunID", void 0);
2729
- __decorate([
2730
- Field(() => [MJAIAgentRunStep_]),
2731
- __metadata("design:type", Array)
2732
- ], MJAIAgentRun_.prototype, "MJ_AIAgentRunSteps_AgentRunIDArray", void 0);
2733
2729
  __decorate([
2734
2730
  Field(() => [MJAIAgentRun_]),
2735
2731
  __metadata("design:type", Array)
2736
2732
  ], MJAIAgentRun_.prototype, "MJ_AIAgentRuns_ParentRunIDArray", void 0);
2733
+ __decorate([
2734
+ Field(() => [MJAIAgentRunStep_]),
2735
+ __metadata("design:type", Array)
2736
+ ], MJAIAgentRun_.prototype, "MJ_AIAgentRunSteps_AgentRunIDArray", void 0);
2737
2737
  __decorate([
2738
2738
  Field(() => [MJAIPromptRun_]),
2739
2739
  __metadata("design:type", Array)
@@ -3203,22 +3203,22 @@ let MJAIAgentRunResolver = class MJAIAgentRunResolver extends ResolverBase {
3203
3203
  const result = this.MapFieldNamesToCodeNames('MJ: AI Agent Runs', rows && rows.length > 0 ? rows[0] : {});
3204
3204
  return result;
3205
3205
  }
3206
- async MJ_AIAgentRunSteps_AgentRunIDArray(mjaiagentrun_, { dataSources, userPayload, providers }, pubSub) {
3207
- this.CheckUserReadPermissions('MJ: AI Agent Run Steps', userPayload);
3206
+ async MJ_AIAgentRuns_ParentRunIDArray(mjaiagentrun_, { dataSources, userPayload, providers }, pubSub) {
3207
+ this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
3208
3208
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3209
3209
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
3210
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRunSteps] WHERE [AgentRunID]='${mjaiagentrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Run Steps', userPayload, EntityPermissionType.Read, 'AND');
3210
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRuns] WHERE [ParentRunID]='${mjaiagentrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Runs', userPayload, EntityPermissionType.Read, 'AND');
3211
3211
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
3212
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Run Steps', rows);
3212
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Runs', rows);
3213
3213
  return result;
3214
3214
  }
3215
- async MJ_AIAgentRuns_ParentRunIDArray(mjaiagentrun_, { dataSources, userPayload, providers }, pubSub) {
3216
- this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
3215
+ async MJ_AIAgentRunSteps_AgentRunIDArray(mjaiagentrun_, { dataSources, userPayload, providers }, pubSub) {
3216
+ this.CheckUserReadPermissions('MJ: AI Agent Run Steps', userPayload);
3217
3217
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
3218
3218
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
3219
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRuns] WHERE [ParentRunID]='${mjaiagentrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Runs', userPayload, EntityPermissionType.Read, 'AND');
3219
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentRunSteps] WHERE [AgentRunID]='${mjaiagentrun_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Run Steps', userPayload, EntityPermissionType.Read, 'AND');
3220
3220
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
3221
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Runs', rows);
3221
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Run Steps', rows);
3222
3222
  return result;
3223
3223
  }
3224
3224
  async MJ_AIPromptRuns_AgentRunIDArray(mjaiagentrun_, { dataSources, userPayload, providers }, pubSub) {
@@ -3281,23 +3281,23 @@ __decorate([
3281
3281
  __metadata("design:returntype", Promise)
3282
3282
  ], MJAIAgentRunResolver.prototype, "MJAIAgentRun", null);
3283
3283
  __decorate([
3284
- FieldResolver(() => [MJAIAgentRunStep_]),
3284
+ FieldResolver(() => [MJAIAgentRun_]),
3285
3285
  __param(0, Root()),
3286
3286
  __param(1, Ctx()),
3287
3287
  __param(2, PubSub()),
3288
3288
  __metadata("design:type", Function),
3289
3289
  __metadata("design:paramtypes", [MJAIAgentRun_, Object, PubSubEngine]),
3290
3290
  __metadata("design:returntype", Promise)
3291
- ], MJAIAgentRunResolver.prototype, "MJ_AIAgentRunSteps_AgentRunIDArray", null);
3291
+ ], MJAIAgentRunResolver.prototype, "MJ_AIAgentRuns_ParentRunIDArray", null);
3292
3292
  __decorate([
3293
- FieldResolver(() => [MJAIAgentRun_]),
3293
+ FieldResolver(() => [MJAIAgentRunStep_]),
3294
3294
  __param(0, Root()),
3295
3295
  __param(1, Ctx()),
3296
3296
  __param(2, PubSub()),
3297
3297
  __metadata("design:type", Function),
3298
3298
  __metadata("design:paramtypes", [MJAIAgentRun_, Object, PubSubEngine]),
3299
3299
  __metadata("design:returntype", Promise)
3300
- ], MJAIAgentRunResolver.prototype, "MJ_AIAgentRuns_ParentRunIDArray", null);
3300
+ ], MJAIAgentRunResolver.prototype, "MJ_AIAgentRunSteps_AgentRunIDArray", null);
3301
3301
  __decorate([
3302
3302
  FieldResolver(() => [MJAIPromptRun_]),
3303
3303
  __param(0, Root()),
@@ -4461,6 +4461,9 @@ let MJAIAgent_ = class MJAIAgent_ {
4461
4461
  DefaultArtifactTypeID;
4462
4462
  OwnerUserID;
4463
4463
  InvocationMode;
4464
+ ArtifactCreationMode;
4465
+ FunctionalRequirements;
4466
+ TechnicalDesign;
4464
4467
  Parent;
4465
4468
  ContextCompressionPrompt;
4466
4469
  Type;
@@ -4475,6 +4478,7 @@ let MJAIAgent_ = class MJAIAgent_ {
4475
4478
  MJ_AIAgentRelationships_AgentIDArray;
4476
4479
  MJ_AIAgentArtifactTypes_AgentIDArray;
4477
4480
  MJ_AIAgentPermissions_AgentIDArray;
4481
+ MJ_AIAgentDataSources_AgentIDArray;
4478
4482
  AIAgentNotes_AgentIDArray;
4479
4483
  MJ_AIAgentPrompts_AgentIDArray;
4480
4484
  MJ_AIAgentRuns_AgentIDArray;
@@ -4556,7 +4560,7 @@ __decorate([
4556
4560
  __metadata("design:type", String)
4557
4561
  ], MJAIAgent_.prototype, "TypeID", void 0);
4558
4562
  __decorate([
4559
- Field({ nullable: true, description: `Current status of the AI agent. Active agents can be executed, Disabled agents are inactive, and Pending agents are awaiting configuration or approval. Allowed values: Active, Disabled, Pending.` }),
4563
+ Field({ description: `Current status of the AI agent. Active agents can be executed, Disabled agents are inactive, and Pending agents are awaiting configuration or approval. Allowed values: Active, Disabled, Pending.` }),
4560
4564
  MaxLength(40),
4561
4565
  __metadata("design:type", String)
4562
4566
  ], MJAIAgent_.prototype, "Status", void 0);
@@ -4672,6 +4676,19 @@ __decorate([
4672
4676
  MaxLength(40),
4673
4677
  __metadata("design:type", String)
4674
4678
  ], MJAIAgent_.prototype, "InvocationMode", void 0);
4679
+ __decorate([
4680
+ Field({ description: `Controls how artifacts are created from this agent's payloads. "Always" creates visible artifacts, "Never" skips artifact creation, "System Only" creates hidden system artifacts.` }),
4681
+ MaxLength(40),
4682
+ __metadata("design:type", String)
4683
+ ], MJAIAgent_.prototype, "ArtifactCreationMode", void 0);
4684
+ __decorate([
4685
+ Field({ nullable: true, description: `Detailed markdown formatted requirements that explain the business goals of the agent without specific technical implementation details.` }),
4686
+ __metadata("design:type", String)
4687
+ ], MJAIAgent_.prototype, "FunctionalRequirements", void 0);
4688
+ __decorate([
4689
+ Field({ nullable: true, description: `Detailed markdown that explains the structure of the agent including agent architecture, actions, sub-agents, prompts, and payload structure.` }),
4690
+ __metadata("design:type", String)
4691
+ ], MJAIAgent_.prototype, "TechnicalDesign", void 0);
4675
4692
  __decorate([
4676
4693
  Field({ nullable: true }),
4677
4694
  MaxLength(510),
@@ -4734,6 +4751,10 @@ __decorate([
4734
4751
  Field(() => [MJAIAgentPermission_]),
4735
4752
  __metadata("design:type", Array)
4736
4753
  ], MJAIAgent_.prototype, "MJ_AIAgentPermissions_AgentIDArray", void 0);
4754
+ __decorate([
4755
+ Field(() => [MJAIAgentDataSource_]),
4756
+ __metadata("design:type", Array)
4757
+ ], MJAIAgent_.prototype, "MJ_AIAgentDataSources_AgentIDArray", void 0);
4737
4758
  __decorate([
4738
4759
  Field(() => [MJAIAgentNote_]),
4739
4760
  __metadata("design:type", Array)
@@ -4817,6 +4838,9 @@ let CreateMJAIAgentInput = class CreateMJAIAgentInput {
4817
4838
  DefaultArtifactTypeID;
4818
4839
  OwnerUserID;
4819
4840
  InvocationMode;
4841
+ ArtifactCreationMode;
4842
+ FunctionalRequirements;
4843
+ TechnicalDesign;
4820
4844
  };
4821
4845
  __decorate([
4822
4846
  Field({ nullable: true }),
@@ -4970,6 +4994,18 @@ __decorate([
4970
4994
  Field({ nullable: true }),
4971
4995
  __metadata("design:type", String)
4972
4996
  ], CreateMJAIAgentInput.prototype, "InvocationMode", void 0);
4997
+ __decorate([
4998
+ Field({ nullable: true }),
4999
+ __metadata("design:type", String)
5000
+ ], CreateMJAIAgentInput.prototype, "ArtifactCreationMode", void 0);
5001
+ __decorate([
5002
+ Field({ nullable: true }),
5003
+ __metadata("design:type", String)
5004
+ ], CreateMJAIAgentInput.prototype, "FunctionalRequirements", void 0);
5005
+ __decorate([
5006
+ Field({ nullable: true }),
5007
+ __metadata("design:type", String)
5008
+ ], CreateMJAIAgentInput.prototype, "TechnicalDesign", void 0);
4973
5009
  CreateMJAIAgentInput = __decorate([
4974
5010
  InputType()
4975
5011
  ], CreateMJAIAgentInput);
@@ -5013,6 +5049,9 @@ let UpdateMJAIAgentInput = class UpdateMJAIAgentInput {
5013
5049
  DefaultArtifactTypeID;
5014
5050
  OwnerUserID;
5015
5051
  InvocationMode;
5052
+ ArtifactCreationMode;
5053
+ FunctionalRequirements;
5054
+ TechnicalDesign;
5016
5055
  OldValues___;
5017
5056
  };
5018
5057
  __decorate([
@@ -5167,6 +5206,18 @@ __decorate([
5167
5206
  Field({ nullable: true }),
5168
5207
  __metadata("design:type", String)
5169
5208
  ], UpdateMJAIAgentInput.prototype, "InvocationMode", void 0);
5209
+ __decorate([
5210
+ Field({ nullable: true }),
5211
+ __metadata("design:type", String)
5212
+ ], UpdateMJAIAgentInput.prototype, "ArtifactCreationMode", void 0);
5213
+ __decorate([
5214
+ Field({ nullable: true }),
5215
+ __metadata("design:type", String)
5216
+ ], UpdateMJAIAgentInput.prototype, "FunctionalRequirements", void 0);
5217
+ __decorate([
5218
+ Field({ nullable: true }),
5219
+ __metadata("design:type", String)
5220
+ ], UpdateMJAIAgentInput.prototype, "TechnicalDesign", void 0);
5170
5221
  __decorate([
5171
5222
  Field(() => [KeyValuePairInput], { nullable: true }),
5172
5223
  __metadata("design:type", Array)
@@ -5311,6 +5362,15 @@ let MJAIAgentResolver = class MJAIAgentResolver extends ResolverBase {
5311
5362
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Permissions', rows);
5312
5363
  return result;
5313
5364
  }
5365
+ async MJ_AIAgentDataSources_AgentIDArray(mjaiagent_, { dataSources, userPayload, providers }, pubSub) {
5366
+ this.CheckUserReadPermissions('MJ: AI Agent Data Sources', userPayload);
5367
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5368
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
5369
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentDataSources] WHERE [AgentID]='${mjaiagent_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Data Sources', userPayload, EntityPermissionType.Read, 'AND');
5370
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
5371
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Data Sources', rows);
5372
+ return result;
5373
+ }
5314
5374
  async AIAgentNotes_AgentIDArray(mjaiagent_, { dataSources, userPayload, providers }, pubSub) {
5315
5375
  this.CheckUserReadPermissions('AI Agent Notes', userPayload);
5316
5376
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
@@ -5523,6 +5583,15 @@ __decorate([
5523
5583
  __metadata("design:paramtypes", [MJAIAgent_, Object, PubSubEngine]),
5524
5584
  __metadata("design:returntype", Promise)
5525
5585
  ], MJAIAgentResolver.prototype, "MJ_AIAgentPermissions_AgentIDArray", null);
5586
+ __decorate([
5587
+ FieldResolver(() => [MJAIAgentDataSource_]),
5588
+ __param(0, Root()),
5589
+ __param(1, Ctx()),
5590
+ __param(2, PubSub()),
5591
+ __metadata("design:type", Function),
5592
+ __metadata("design:paramtypes", [MJAIAgent_, Object, PubSubEngine]),
5593
+ __metadata("design:returntype", Promise)
5594
+ ], MJAIAgentResolver.prototype, "MJ_AIAgentDataSources_AgentIDArray", null);
5526
5595
  __decorate([
5527
5596
  FieldResolver(() => [MJAIAgentNote_]),
5528
5597
  __param(0, Root()),
@@ -8073,6 +8142,329 @@ MJEnvironmentResolver = __decorate([
8073
8142
  Resolver(MJEnvironment_)
8074
8143
  ], MJEnvironmentResolver);
8075
8144
  export { MJEnvironmentResolver };
8145
+ let MJArtifactPermission_ = class MJArtifactPermission_ {
8146
+ ID;
8147
+ ArtifactID;
8148
+ UserID;
8149
+ CanRead;
8150
+ CanEdit;
8151
+ CanDelete;
8152
+ CanShare;
8153
+ SharedByUserID;
8154
+ _mj__CreatedAt;
8155
+ _mj__UpdatedAt;
8156
+ Artifact;
8157
+ User;
8158
+ SharedByUser;
8159
+ };
8160
+ __decorate([
8161
+ Field(),
8162
+ MaxLength(16),
8163
+ __metadata("design:type", String)
8164
+ ], MJArtifactPermission_.prototype, "ID", void 0);
8165
+ __decorate([
8166
+ Field(),
8167
+ MaxLength(16),
8168
+ __metadata("design:type", String)
8169
+ ], MJArtifactPermission_.prototype, "ArtifactID", void 0);
8170
+ __decorate([
8171
+ Field(),
8172
+ MaxLength(16),
8173
+ __metadata("design:type", String)
8174
+ ], MJArtifactPermission_.prototype, "UserID", void 0);
8175
+ __decorate([
8176
+ Field(() => Boolean, { description: `Whether the user can view/read the artifact` }),
8177
+ __metadata("design:type", Boolean)
8178
+ ], MJArtifactPermission_.prototype, "CanRead", void 0);
8179
+ __decorate([
8180
+ Field(() => Boolean, { description: `Whether the user can modify the artifact or create new versions` }),
8181
+ __metadata("design:type", Boolean)
8182
+ ], MJArtifactPermission_.prototype, "CanEdit", void 0);
8183
+ __decorate([
8184
+ Field(() => Boolean, { description: `Whether the user can delete the artifact` }),
8185
+ __metadata("design:type", Boolean)
8186
+ ], MJArtifactPermission_.prototype, "CanDelete", void 0);
8187
+ __decorate([
8188
+ Field(() => Boolean, { description: `Whether the user can share the artifact with other users` }),
8189
+ __metadata("design:type", Boolean)
8190
+ ], MJArtifactPermission_.prototype, "CanShare", void 0);
8191
+ __decorate([
8192
+ Field({ nullable: true, description: `Foreign key to the User who shared this artifact (if shared)` }),
8193
+ MaxLength(16),
8194
+ __metadata("design:type", String)
8195
+ ], MJArtifactPermission_.prototype, "SharedByUserID", void 0);
8196
+ __decorate([
8197
+ Field(),
8198
+ MaxLength(10),
8199
+ __metadata("design:type", Date)
8200
+ ], MJArtifactPermission_.prototype, "_mj__CreatedAt", void 0);
8201
+ __decorate([
8202
+ Field(),
8203
+ MaxLength(10),
8204
+ __metadata("design:type", Date)
8205
+ ], MJArtifactPermission_.prototype, "_mj__UpdatedAt", void 0);
8206
+ __decorate([
8207
+ Field(),
8208
+ MaxLength(510),
8209
+ __metadata("design:type", String)
8210
+ ], MJArtifactPermission_.prototype, "Artifact", void 0);
8211
+ __decorate([
8212
+ Field(),
8213
+ MaxLength(200),
8214
+ __metadata("design:type", String)
8215
+ ], MJArtifactPermission_.prototype, "User", void 0);
8216
+ __decorate([
8217
+ Field({ nullable: true }),
8218
+ MaxLength(200),
8219
+ __metadata("design:type", String)
8220
+ ], MJArtifactPermission_.prototype, "SharedByUser", void 0);
8221
+ MJArtifactPermission_ = __decorate([
8222
+ ObjectType({ description: `Manages user permissions for artifacts with granular access control (Read, Edit, Delete, Share)` })
8223
+ ], MJArtifactPermission_);
8224
+ export { MJArtifactPermission_ };
8225
+ let CreateMJArtifactPermissionInput = class CreateMJArtifactPermissionInput {
8226
+ ID;
8227
+ ArtifactID;
8228
+ UserID;
8229
+ CanRead;
8230
+ CanEdit;
8231
+ CanDelete;
8232
+ CanShare;
8233
+ SharedByUserID;
8234
+ };
8235
+ __decorate([
8236
+ Field({ nullable: true }),
8237
+ __metadata("design:type", String)
8238
+ ], CreateMJArtifactPermissionInput.prototype, "ID", void 0);
8239
+ __decorate([
8240
+ Field({ nullable: true }),
8241
+ __metadata("design:type", String)
8242
+ ], CreateMJArtifactPermissionInput.prototype, "ArtifactID", void 0);
8243
+ __decorate([
8244
+ Field({ nullable: true }),
8245
+ __metadata("design:type", String)
8246
+ ], CreateMJArtifactPermissionInput.prototype, "UserID", void 0);
8247
+ __decorate([
8248
+ Field(() => Boolean, { nullable: true }),
8249
+ __metadata("design:type", Boolean)
8250
+ ], CreateMJArtifactPermissionInput.prototype, "CanRead", void 0);
8251
+ __decorate([
8252
+ Field(() => Boolean, { nullable: true }),
8253
+ __metadata("design:type", Boolean)
8254
+ ], CreateMJArtifactPermissionInput.prototype, "CanEdit", void 0);
8255
+ __decorate([
8256
+ Field(() => Boolean, { nullable: true }),
8257
+ __metadata("design:type", Boolean)
8258
+ ], CreateMJArtifactPermissionInput.prototype, "CanDelete", void 0);
8259
+ __decorate([
8260
+ Field(() => Boolean, { nullable: true }),
8261
+ __metadata("design:type", Boolean)
8262
+ ], CreateMJArtifactPermissionInput.prototype, "CanShare", void 0);
8263
+ __decorate([
8264
+ Field({ nullable: true }),
8265
+ __metadata("design:type", String)
8266
+ ], CreateMJArtifactPermissionInput.prototype, "SharedByUserID", void 0);
8267
+ CreateMJArtifactPermissionInput = __decorate([
8268
+ InputType()
8269
+ ], CreateMJArtifactPermissionInput);
8270
+ export { CreateMJArtifactPermissionInput };
8271
+ let UpdateMJArtifactPermissionInput = class UpdateMJArtifactPermissionInput {
8272
+ ID;
8273
+ ArtifactID;
8274
+ UserID;
8275
+ CanRead;
8276
+ CanEdit;
8277
+ CanDelete;
8278
+ CanShare;
8279
+ SharedByUserID;
8280
+ OldValues___;
8281
+ };
8282
+ __decorate([
8283
+ Field(),
8284
+ __metadata("design:type", String)
8285
+ ], UpdateMJArtifactPermissionInput.prototype, "ID", void 0);
8286
+ __decorate([
8287
+ Field({ nullable: true }),
8288
+ __metadata("design:type", String)
8289
+ ], UpdateMJArtifactPermissionInput.prototype, "ArtifactID", void 0);
8290
+ __decorate([
8291
+ Field({ nullable: true }),
8292
+ __metadata("design:type", String)
8293
+ ], UpdateMJArtifactPermissionInput.prototype, "UserID", void 0);
8294
+ __decorate([
8295
+ Field(() => Boolean, { nullable: true }),
8296
+ __metadata("design:type", Boolean)
8297
+ ], UpdateMJArtifactPermissionInput.prototype, "CanRead", void 0);
8298
+ __decorate([
8299
+ Field(() => Boolean, { nullable: true }),
8300
+ __metadata("design:type", Boolean)
8301
+ ], UpdateMJArtifactPermissionInput.prototype, "CanEdit", void 0);
8302
+ __decorate([
8303
+ Field(() => Boolean, { nullable: true }),
8304
+ __metadata("design:type", Boolean)
8305
+ ], UpdateMJArtifactPermissionInput.prototype, "CanDelete", void 0);
8306
+ __decorate([
8307
+ Field(() => Boolean, { nullable: true }),
8308
+ __metadata("design:type", Boolean)
8309
+ ], UpdateMJArtifactPermissionInput.prototype, "CanShare", void 0);
8310
+ __decorate([
8311
+ Field({ nullable: true }),
8312
+ __metadata("design:type", String)
8313
+ ], UpdateMJArtifactPermissionInput.prototype, "SharedByUserID", void 0);
8314
+ __decorate([
8315
+ Field(() => [KeyValuePairInput], { nullable: true }),
8316
+ __metadata("design:type", Array)
8317
+ ], UpdateMJArtifactPermissionInput.prototype, "OldValues___", void 0);
8318
+ UpdateMJArtifactPermissionInput = __decorate([
8319
+ InputType()
8320
+ ], UpdateMJArtifactPermissionInput);
8321
+ export { UpdateMJArtifactPermissionInput };
8322
+ let RunMJArtifactPermissionViewResult = class RunMJArtifactPermissionViewResult {
8323
+ Results;
8324
+ UserViewRunID;
8325
+ RowCount;
8326
+ TotalRowCount;
8327
+ ExecutionTime;
8328
+ ErrorMessage;
8329
+ Success;
8330
+ };
8331
+ __decorate([
8332
+ Field(() => [MJArtifactPermission_]),
8333
+ __metadata("design:type", Array)
8334
+ ], RunMJArtifactPermissionViewResult.prototype, "Results", void 0);
8335
+ __decorate([
8336
+ Field(() => String, { nullable: true }),
8337
+ __metadata("design:type", String)
8338
+ ], RunMJArtifactPermissionViewResult.prototype, "UserViewRunID", void 0);
8339
+ __decorate([
8340
+ Field(() => Int, { nullable: true }),
8341
+ __metadata("design:type", Number)
8342
+ ], RunMJArtifactPermissionViewResult.prototype, "RowCount", void 0);
8343
+ __decorate([
8344
+ Field(() => Int, { nullable: true }),
8345
+ __metadata("design:type", Number)
8346
+ ], RunMJArtifactPermissionViewResult.prototype, "TotalRowCount", void 0);
8347
+ __decorate([
8348
+ Field(() => Int, { nullable: true }),
8349
+ __metadata("design:type", Number)
8350
+ ], RunMJArtifactPermissionViewResult.prototype, "ExecutionTime", void 0);
8351
+ __decorate([
8352
+ Field({ nullable: true }),
8353
+ __metadata("design:type", String)
8354
+ ], RunMJArtifactPermissionViewResult.prototype, "ErrorMessage", void 0);
8355
+ __decorate([
8356
+ Field(() => Boolean, { nullable: false }),
8357
+ __metadata("design:type", Boolean)
8358
+ ], RunMJArtifactPermissionViewResult.prototype, "Success", void 0);
8359
+ RunMJArtifactPermissionViewResult = __decorate([
8360
+ ObjectType()
8361
+ ], RunMJArtifactPermissionViewResult);
8362
+ export { RunMJArtifactPermissionViewResult };
8363
+ let MJArtifactPermissionResolver = class MJArtifactPermissionResolver extends ResolverBase {
8364
+ async RunMJArtifactPermissionViewByID(input, { providers, userPayload }, pubSub) {
8365
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
8366
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
8367
+ }
8368
+ async RunMJArtifactPermissionViewByName(input, { providers, userPayload }, pubSub) {
8369
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
8370
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
8371
+ }
8372
+ async RunMJArtifactPermissionDynamicView(input, { providers, userPayload }, pubSub) {
8373
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
8374
+ input.EntityName = 'MJ: Artifact Permissions';
8375
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
8376
+ }
8377
+ async MJArtifactPermission(ID, { dataSources, userPayload, providers }, pubSub) {
8378
+ this.CheckUserReadPermissions('MJ: Artifact Permissions', userPayload);
8379
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
8380
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
8381
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwArtifactPermissions] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Artifact Permissions', userPayload, EntityPermissionType.Read, 'AND');
8382
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
8383
+ const result = this.MapFieldNamesToCodeNames('MJ: Artifact Permissions', rows && rows.length > 0 ? rows[0] : {});
8384
+ return result;
8385
+ }
8386
+ async CreateMJArtifactPermission(input, { providers, userPayload }, pubSub) {
8387
+ const provider = GetReadWriteProvider(providers);
8388
+ return this.CreateRecord('MJ: Artifact Permissions', input, provider, userPayload, pubSub);
8389
+ }
8390
+ async UpdateMJArtifactPermission(input, { providers, userPayload }, pubSub) {
8391
+ const provider = GetReadWriteProvider(providers);
8392
+ return this.UpdateRecord('MJ: Artifact Permissions', input, provider, userPayload, pubSub);
8393
+ }
8394
+ async DeleteMJArtifactPermission(ID, options, { providers, userPayload }, pubSub) {
8395
+ const provider = GetReadWriteProvider(providers);
8396
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
8397
+ return this.DeleteRecord('MJ: Artifact Permissions', key, options, provider, userPayload, pubSub);
8398
+ }
8399
+ };
8400
+ __decorate([
8401
+ Query(() => RunMJArtifactPermissionViewResult),
8402
+ __param(0, Arg('input', () => RunViewByIDInput)),
8403
+ __param(1, Ctx()),
8404
+ __param(2, PubSub()),
8405
+ __metadata("design:type", Function),
8406
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
8407
+ __metadata("design:returntype", Promise)
8408
+ ], MJArtifactPermissionResolver.prototype, "RunMJArtifactPermissionViewByID", null);
8409
+ __decorate([
8410
+ Query(() => RunMJArtifactPermissionViewResult),
8411
+ __param(0, Arg('input', () => RunViewByNameInput)),
8412
+ __param(1, Ctx()),
8413
+ __param(2, PubSub()),
8414
+ __metadata("design:type", Function),
8415
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
8416
+ __metadata("design:returntype", Promise)
8417
+ ], MJArtifactPermissionResolver.prototype, "RunMJArtifactPermissionViewByName", null);
8418
+ __decorate([
8419
+ Query(() => RunMJArtifactPermissionViewResult),
8420
+ __param(0, Arg('input', () => RunDynamicViewInput)),
8421
+ __param(1, Ctx()),
8422
+ __param(2, PubSub()),
8423
+ __metadata("design:type", Function),
8424
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
8425
+ __metadata("design:returntype", Promise)
8426
+ ], MJArtifactPermissionResolver.prototype, "RunMJArtifactPermissionDynamicView", null);
8427
+ __decorate([
8428
+ Query(() => MJArtifactPermission_, { nullable: true }),
8429
+ __param(0, Arg('ID', () => String)),
8430
+ __param(1, Ctx()),
8431
+ __param(2, PubSub()),
8432
+ __metadata("design:type", Function),
8433
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
8434
+ __metadata("design:returntype", Promise)
8435
+ ], MJArtifactPermissionResolver.prototype, "MJArtifactPermission", null);
8436
+ __decorate([
8437
+ Mutation(() => MJArtifactPermission_),
8438
+ __param(0, Arg('input', () => CreateMJArtifactPermissionInput)),
8439
+ __param(1, Ctx()),
8440
+ __param(2, PubSub()),
8441
+ __metadata("design:type", Function),
8442
+ __metadata("design:paramtypes", [CreateMJArtifactPermissionInput, Object, PubSubEngine]),
8443
+ __metadata("design:returntype", Promise)
8444
+ ], MJArtifactPermissionResolver.prototype, "CreateMJArtifactPermission", null);
8445
+ __decorate([
8446
+ Mutation(() => MJArtifactPermission_),
8447
+ __param(0, Arg('input', () => UpdateMJArtifactPermissionInput)),
8448
+ __param(1, Ctx()),
8449
+ __param(2, PubSub()),
8450
+ __metadata("design:type", Function),
8451
+ __metadata("design:paramtypes", [UpdateMJArtifactPermissionInput, Object, PubSubEngine]),
8452
+ __metadata("design:returntype", Promise)
8453
+ ], MJArtifactPermissionResolver.prototype, "UpdateMJArtifactPermission", null);
8454
+ __decorate([
8455
+ Mutation(() => MJArtifactPermission_),
8456
+ __param(0, Arg('ID', () => String)),
8457
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
8458
+ __param(2, Ctx()),
8459
+ __param(3, PubSub()),
8460
+ __metadata("design:type", Function),
8461
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
8462
+ __metadata("design:returntype", Promise)
8463
+ ], MJArtifactPermissionResolver.prototype, "DeleteMJArtifactPermission", null);
8464
+ MJArtifactPermissionResolver = __decorate([
8465
+ Resolver(MJArtifactPermission_)
8466
+ ], MJArtifactPermissionResolver);
8467
+ export { MJArtifactPermissionResolver };
8076
8468
  let MJAIAgentAction_ = class MJAIAgentAction_ {
8077
8469
  ID;
8078
8470
  AgentID;
@@ -10007,8 +10399,8 @@ let MJAIPrompt_ = class MJAIPrompt_ {
10007
10399
  AIAgentActions_CompactPromptIDArray;
10008
10400
  MJ_AIConfigurations_DefaultPromptForContextSummarizationIDArray;
10009
10401
  AIPrompts_ResultSelectorPromptIDArray;
10010
- MJ_AIPromptModels_PromptIDArray;
10011
10402
  MJ_AIAgentPrompts_PromptIDArray;
10403
+ MJ_AIPromptModels_PromptIDArray;
10012
10404
  MJ_AIAgentSteps_PromptIDArray;
10013
10405
  MJ_AIPromptRuns_PromptIDArray;
10014
10406
  AIAgents_ContextCompressionPromptIDArray;
@@ -10297,14 +10689,14 @@ __decorate([
10297
10689
  Field(() => [MJAIPrompt_]),
10298
10690
  __metadata("design:type", Array)
10299
10691
  ], MJAIPrompt_.prototype, "AIPrompts_ResultSelectorPromptIDArray", void 0);
10300
- __decorate([
10301
- Field(() => [MJAIPromptModel_]),
10302
- __metadata("design:type", Array)
10303
- ], MJAIPrompt_.prototype, "MJ_AIPromptModels_PromptIDArray", void 0);
10304
10692
  __decorate([
10305
10693
  Field(() => [MJAIAgentPrompt_]),
10306
10694
  __metadata("design:type", Array)
10307
10695
  ], MJAIPrompt_.prototype, "MJ_AIAgentPrompts_PromptIDArray", void 0);
10696
+ __decorate([
10697
+ Field(() => [MJAIPromptModel_]),
10698
+ __metadata("design:type", Array)
10699
+ ], MJAIPrompt_.prototype, "MJ_AIPromptModels_PromptIDArray", void 0);
10308
10700
  __decorate([
10309
10701
  Field(() => [MJAIAgentStep_]),
10310
10702
  __metadata("design:type", Array)
@@ -10950,22 +11342,22 @@ let MJAIPromptResolver = class MJAIPromptResolver extends ResolverBase {
10950
11342
  const result = this.ArrayMapFieldNamesToCodeNames('AI Prompts', rows);
10951
11343
  return result;
10952
11344
  }
10953
- async MJ_AIPromptModels_PromptIDArray(mjaiprompt_, { dataSources, userPayload, providers }, pubSub) {
10954
- this.CheckUserReadPermissions('MJ: AI Prompt Models', userPayload);
11345
+ async MJ_AIAgentPrompts_PromptIDArray(mjaiprompt_, { dataSources, userPayload, providers }, pubSub) {
11346
+ this.CheckUserReadPermissions('MJ: AI Agent Prompts', userPayload);
10955
11347
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
10956
11348
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
10957
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptModels] WHERE [PromptID]='${mjaiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Models', userPayload, EntityPermissionType.Read, 'AND');
11349
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentPrompts] WHERE [PromptID]='${mjaiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Prompts', userPayload, EntityPermissionType.Read, 'AND');
10958
11350
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
10959
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Models', rows);
11351
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Prompts', rows);
10960
11352
  return result;
10961
11353
  }
10962
- async MJ_AIAgentPrompts_PromptIDArray(mjaiprompt_, { dataSources, userPayload, providers }, pubSub) {
10963
- this.CheckUserReadPermissions('MJ: AI Agent Prompts', userPayload);
11354
+ async MJ_AIPromptModels_PromptIDArray(mjaiprompt_, { dataSources, userPayload, providers }, pubSub) {
11355
+ this.CheckUserReadPermissions('MJ: AI Prompt Models', userPayload);
10964
11356
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
10965
11357
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
10966
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentPrompts] WHERE [PromptID]='${mjaiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Prompts', userPayload, EntityPermissionType.Read, 'AND');
11358
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIPromptModels] WHERE [PromptID]='${mjaiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Prompt Models', userPayload, EntityPermissionType.Read, 'AND');
10967
11359
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
10968
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Prompts', rows);
11360
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Prompt Models', rows);
10969
11361
  return result;
10970
11362
  }
10971
11363
  async MJ_AIAgentSteps_PromptIDArray(mjaiprompt_, { dataSources, userPayload, providers }, pubSub) {
@@ -11109,23 +11501,23 @@ __decorate([
11109
11501
  __metadata("design:returntype", Promise)
11110
11502
  ], MJAIPromptResolver.prototype, "AIPrompts_ResultSelectorPromptIDArray", null);
11111
11503
  __decorate([
11112
- FieldResolver(() => [MJAIPromptModel_]),
11504
+ FieldResolver(() => [MJAIAgentPrompt_]),
11113
11505
  __param(0, Root()),
11114
11506
  __param(1, Ctx()),
11115
11507
  __param(2, PubSub()),
11116
11508
  __metadata("design:type", Function),
11117
11509
  __metadata("design:paramtypes", [MJAIPrompt_, Object, PubSubEngine]),
11118
11510
  __metadata("design:returntype", Promise)
11119
- ], MJAIPromptResolver.prototype, "MJ_AIPromptModels_PromptIDArray", null);
11511
+ ], MJAIPromptResolver.prototype, "MJ_AIAgentPrompts_PromptIDArray", null);
11120
11512
  __decorate([
11121
- FieldResolver(() => [MJAIAgentPrompt_]),
11513
+ FieldResolver(() => [MJAIPromptModel_]),
11122
11514
  __param(0, Root()),
11123
11515
  __param(1, Ctx()),
11124
11516
  __param(2, PubSub()),
11125
11517
  __metadata("design:type", Function),
11126
11518
  __metadata("design:paramtypes", [MJAIPrompt_, Object, PubSubEngine]),
11127
11519
  __metadata("design:returntype", Promise)
11128
- ], MJAIPromptResolver.prototype, "MJ_AIAgentPrompts_PromptIDArray", null);
11520
+ ], MJAIPromptResolver.prototype, "MJ_AIPromptModels_PromptIDArray", null);
11129
11521
  __decorate([
11130
11522
  FieldResolver(() => [MJAIAgentStep_]),
11131
11523
  __param(0, Root()),
@@ -16918,8 +17310,8 @@ let MJEntity_ = class MJEntity_ {
16918
17310
  RecommendationItems_DestinationEntityIDArray;
16919
17311
  EntityCommunicationMessageTypes_EntityIDArray;
16920
17312
  QueryEntities_EntityIDArray;
16921
- MJ_RecordLinks_SourceEntityIDArray;
16922
17313
  MJ_AccessControlRules_EntityIDArray;
17314
+ MJ_RecordLinks_SourceEntityIDArray;
16923
17315
  GeneratedCodes_LinkedEntityIDArray;
16924
17316
  MJ_RecordLinks_TargetEntityIDArray;
16925
17317
  };
@@ -17350,14 +17742,14 @@ __decorate([
17350
17742
  Field(() => [MJQueryEntity_]),
17351
17743
  __metadata("design:type", Array)
17352
17744
  ], MJEntity_.prototype, "QueryEntities_EntityIDArray", void 0);
17353
- __decorate([
17354
- Field(() => [MJRecordLink_]),
17355
- __metadata("design:type", Array)
17356
- ], MJEntity_.prototype, "MJ_RecordLinks_SourceEntityIDArray", void 0);
17357
17745
  __decorate([
17358
17746
  Field(() => [MJAccessControlRule_]),
17359
17747
  __metadata("design:type", Array)
17360
17748
  ], MJEntity_.prototype, "MJ_AccessControlRules_EntityIDArray", void 0);
17749
+ __decorate([
17750
+ Field(() => [MJRecordLink_]),
17751
+ __metadata("design:type", Array)
17752
+ ], MJEntity_.prototype, "MJ_RecordLinks_SourceEntityIDArray", void 0);
17361
17753
  __decorate([
17362
17754
  Field(() => [MJGeneratedCode_]),
17363
17755
  __metadata("design:type", Array)
@@ -18314,22 +18706,22 @@ let MJEntityResolverBase = class MJEntityResolverBase extends ResolverBase {
18314
18706
  const result = this.ArrayMapFieldNamesToCodeNames('Query Entities', rows);
18315
18707
  return result;
18316
18708
  }
18317
- async MJ_RecordLinks_SourceEntityIDArray(mjentity_, { dataSources, userPayload, providers }, pubSub) {
18318
- this.CheckUserReadPermissions('MJ: Record Links', userPayload);
18709
+ async MJ_AccessControlRules_EntityIDArray(mjentity_, { dataSources, userPayload, providers }, pubSub) {
18710
+ this.CheckUserReadPermissions('MJ: Access Control Rules', userPayload);
18319
18711
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
18320
18712
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
18321
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwRecordLinks] WHERE [SourceEntityID]='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Record Links', userPayload, EntityPermissionType.Read, 'AND');
18713
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAccessControlRules] WHERE [EntityID]='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Access Control Rules', userPayload, EntityPermissionType.Read, 'AND');
18322
18714
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
18323
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Record Links', rows);
18715
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Access Control Rules', rows);
18324
18716
  return result;
18325
18717
  }
18326
- async MJ_AccessControlRules_EntityIDArray(mjentity_, { dataSources, userPayload, providers }, pubSub) {
18327
- this.CheckUserReadPermissions('MJ: Access Control Rules', userPayload);
18718
+ async MJ_RecordLinks_SourceEntityIDArray(mjentity_, { dataSources, userPayload, providers }, pubSub) {
18719
+ this.CheckUserReadPermissions('MJ: Record Links', userPayload);
18328
18720
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
18329
18721
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
18330
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAccessControlRules] WHERE [EntityID]='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Access Control Rules', userPayload, EntityPermissionType.Read, 'AND');
18722
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwRecordLinks] WHERE [SourceEntityID]='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Record Links', userPayload, EntityPermissionType.Read, 'AND');
18331
18723
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
18332
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Access Control Rules', rows);
18724
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Record Links', rows);
18333
18725
  return result;
18334
18726
  }
18335
18727
  async GeneratedCodes_LinkedEntityIDArray(mjentity_, { dataSources, userPayload, providers }, pubSub) {
@@ -18733,23 +19125,23 @@ __decorate([
18733
19125
  __metadata("design:returntype", Promise)
18734
19126
  ], MJEntityResolverBase.prototype, "QueryEntities_EntityIDArray", null);
18735
19127
  __decorate([
18736
- FieldResolver(() => [MJRecordLink_]),
19128
+ FieldResolver(() => [MJAccessControlRule_]),
18737
19129
  __param(0, Root()),
18738
19130
  __param(1, Ctx()),
18739
19131
  __param(2, PubSub()),
18740
19132
  __metadata("design:type", Function),
18741
19133
  __metadata("design:paramtypes", [MJEntity_, Object, PubSubEngine]),
18742
19134
  __metadata("design:returntype", Promise)
18743
- ], MJEntityResolverBase.prototype, "MJ_RecordLinks_SourceEntityIDArray", null);
19135
+ ], MJEntityResolverBase.prototype, "MJ_AccessControlRules_EntityIDArray", null);
18744
19136
  __decorate([
18745
- FieldResolver(() => [MJAccessControlRule_]),
19137
+ FieldResolver(() => [MJRecordLink_]),
18746
19138
  __param(0, Root()),
18747
19139
  __param(1, Ctx()),
18748
19140
  __param(2, PubSub()),
18749
19141
  __metadata("design:type", Function),
18750
19142
  __metadata("design:paramtypes", [MJEntity_, Object, PubSubEngine]),
18751
19143
  __metadata("design:returntype", Promise)
18752
- ], MJEntityResolverBase.prototype, "MJ_AccessControlRules_EntityIDArray", null);
19144
+ ], MJEntityResolverBase.prototype, "MJ_RecordLinks_SourceEntityIDArray", null);
18753
19145
  __decorate([
18754
19146
  FieldResolver(() => [MJGeneratedCode_]),
18755
19147
  __param(0, Root()),
@@ -18815,6 +19207,8 @@ let MJUser_ = class MJUser_ {
18815
19207
  EmployeeID;
18816
19208
  _mj__CreatedAt;
18817
19209
  _mj__UpdatedAt;
19210
+ UserImageURL;
19211
+ UserImageIconClass;
18818
19212
  FirstLast;
18819
19213
  EmployeeFirstLast;
18820
19214
  EmployeeEmail;
@@ -18857,12 +19251,13 @@ let MJUser_ = class MJUser_ {
18857
19251
  AIAgentRequests_ResponseByUserIDArray;
18858
19252
  AIAgentNotes_UserIDArray;
18859
19253
  MJ_ReportUserStates_UserIDArray;
18860
- MJ_DashboardUserPreferences_UserIDArray;
18861
19254
  MJ_DashboardUserStates_UserIDArray;
19255
+ MJ_DashboardUserPreferences_UserIDArray;
18862
19256
  MJ_ArtifactVersions_UserIDArray;
18863
19257
  MJ_PublicLinks_UserIDArray;
18864
- MJ_ScheduledJobRuns_ExecutedByUserIDArray;
18865
19258
  MJ_ScheduledJobs_NotifyUserIDArray;
19259
+ MJ_ScheduledJobRuns_ExecutedByUserIDArray;
19260
+ MJ_ArtifactPermissions_UserIDArray;
18866
19261
  ResourcePermissions_UserIDArray;
18867
19262
  AIAgentRequests_RequestForUserIDArray;
18868
19263
  ConversationDetails_UserIDArray;
@@ -18870,10 +19265,11 @@ let MJUser_ = class MJUser_ {
18870
19265
  MJ_Artifacts_UserIDArray;
18871
19266
  MJ_ScheduledJobs_OwnerUserIDArray;
18872
19267
  MJ_CollectionPermissions_SharedByUserIDArray;
19268
+ MJ_ArtifactPermissions_SharedByUserIDArray;
18873
19269
  MJ_AIAgentRuns_UserIDArray;
18874
19270
  MJ_AIAgentPermissions_UserIDArray;
18875
- MJ_CollectionPermissions_UserIDArray;
18876
19271
  MJ_Collections_OwnerIDArray;
19272
+ MJ_CollectionPermissions_UserIDArray;
18877
19273
  MJ_Tasks_UserIDArray;
18878
19274
  AIAgents_OwnerUserIDArray;
18879
19275
  };
@@ -18946,6 +19342,15 @@ __decorate([
18946
19342
  MaxLength(10),
18947
19343
  __metadata("design:type", Date)
18948
19344
  ], MJUser_.prototype, "_mj__UpdatedAt", void 0);
19345
+ __decorate([
19346
+ Field({ nullable: true, description: `User avatar image. Can be a Base64 encoded data URI (e.g., "data:image/png;base64,...") or a URL to an image file. Preferred over UserImageIconClass when present. Recommended for small thumbnail images only to maintain performance.` }),
19347
+ __metadata("design:type", String)
19348
+ ], MJUser_.prototype, "UserImageURL", void 0);
19349
+ __decorate([
19350
+ Field({ nullable: true, description: `Font Awesome icon class for user avatar (e.g., "fa-solid fa-user-astronaut"). Used as fallback when UserImageURL is not provided. Example classes: "fa-solid fa-user", "fa-regular fa-circle-user", "fa-solid fa-user-tie".` }),
19351
+ MaxLength(200),
19352
+ __metadata("design:type", String)
19353
+ ], MJUser_.prototype, "UserImageIconClass", void 0);
18949
19354
  __decorate([
18950
19355
  Field({ nullable: true }),
18951
19356
  MaxLength(202),
@@ -19120,14 +19525,14 @@ __decorate([
19120
19525
  Field(() => [MJReportUserState_]),
19121
19526
  __metadata("design:type", Array)
19122
19527
  ], MJUser_.prototype, "MJ_ReportUserStates_UserIDArray", void 0);
19123
- __decorate([
19124
- Field(() => [MJDashboardUserPreference_]),
19125
- __metadata("design:type", Array)
19126
- ], MJUser_.prototype, "MJ_DashboardUserPreferences_UserIDArray", void 0);
19127
19528
  __decorate([
19128
19529
  Field(() => [MJDashboardUserState_]),
19129
19530
  __metadata("design:type", Array)
19130
19531
  ], MJUser_.prototype, "MJ_DashboardUserStates_UserIDArray", void 0);
19532
+ __decorate([
19533
+ Field(() => [MJDashboardUserPreference_]),
19534
+ __metadata("design:type", Array)
19535
+ ], MJUser_.prototype, "MJ_DashboardUserPreferences_UserIDArray", void 0);
19131
19536
  __decorate([
19132
19537
  Field(() => [MJArtifactVersion_]),
19133
19538
  __metadata("design:type", Array)
@@ -19136,14 +19541,18 @@ __decorate([
19136
19541
  Field(() => [MJPublicLink_]),
19137
19542
  __metadata("design:type", Array)
19138
19543
  ], MJUser_.prototype, "MJ_PublicLinks_UserIDArray", void 0);
19544
+ __decorate([
19545
+ Field(() => [MJScheduledJob_]),
19546
+ __metadata("design:type", Array)
19547
+ ], MJUser_.prototype, "MJ_ScheduledJobs_NotifyUserIDArray", void 0);
19139
19548
  __decorate([
19140
19549
  Field(() => [MJScheduledJobRun_]),
19141
19550
  __metadata("design:type", Array)
19142
19551
  ], MJUser_.prototype, "MJ_ScheduledJobRuns_ExecutedByUserIDArray", void 0);
19143
19552
  __decorate([
19144
- Field(() => [MJScheduledJob_]),
19553
+ Field(() => [MJArtifactPermission_]),
19145
19554
  __metadata("design:type", Array)
19146
- ], MJUser_.prototype, "MJ_ScheduledJobs_NotifyUserIDArray", void 0);
19555
+ ], MJUser_.prototype, "MJ_ArtifactPermissions_UserIDArray", void 0);
19147
19556
  __decorate([
19148
19557
  Field(() => [MJResourcePermission_]),
19149
19558
  __metadata("design:type", Array)
@@ -19172,6 +19581,10 @@ __decorate([
19172
19581
  Field(() => [MJCollectionPermission_]),
19173
19582
  __metadata("design:type", Array)
19174
19583
  ], MJUser_.prototype, "MJ_CollectionPermissions_SharedByUserIDArray", void 0);
19584
+ __decorate([
19585
+ Field(() => [MJArtifactPermission_]),
19586
+ __metadata("design:type", Array)
19587
+ ], MJUser_.prototype, "MJ_ArtifactPermissions_SharedByUserIDArray", void 0);
19175
19588
  __decorate([
19176
19589
  Field(() => [MJAIAgentRun_]),
19177
19590
  __metadata("design:type", Array)
@@ -19180,14 +19593,14 @@ __decorate([
19180
19593
  Field(() => [MJAIAgentPermission_]),
19181
19594
  __metadata("design:type", Array)
19182
19595
  ], MJUser_.prototype, "MJ_AIAgentPermissions_UserIDArray", void 0);
19183
- __decorate([
19184
- Field(() => [MJCollectionPermission_]),
19185
- __metadata("design:type", Array)
19186
- ], MJUser_.prototype, "MJ_CollectionPermissions_UserIDArray", void 0);
19187
19596
  __decorate([
19188
19597
  Field(() => [MJCollection_]),
19189
19598
  __metadata("design:type", Array)
19190
19599
  ], MJUser_.prototype, "MJ_Collections_OwnerIDArray", void 0);
19600
+ __decorate([
19601
+ Field(() => [MJCollectionPermission_]),
19602
+ __metadata("design:type", Array)
19603
+ ], MJUser_.prototype, "MJ_CollectionPermissions_UserIDArray", void 0);
19191
19604
  __decorate([
19192
19605
  Field(() => [MJTask_]),
19193
19606
  __metadata("design:type", Array)
@@ -19213,6 +19626,8 @@ let CreateMJUserInput = class CreateMJUserInput {
19213
19626
  LinkedEntityID;
19214
19627
  LinkedEntityRecordID;
19215
19628
  EmployeeID;
19629
+ UserImageURL;
19630
+ UserImageIconClass;
19216
19631
  };
19217
19632
  __decorate([
19218
19633
  Field({ nullable: true }),
@@ -19262,6 +19677,14 @@ __decorate([
19262
19677
  Field({ nullable: true }),
19263
19678
  __metadata("design:type", String)
19264
19679
  ], CreateMJUserInput.prototype, "EmployeeID", void 0);
19680
+ __decorate([
19681
+ Field({ nullable: true }),
19682
+ __metadata("design:type", String)
19683
+ ], CreateMJUserInput.prototype, "UserImageURL", void 0);
19684
+ __decorate([
19685
+ Field({ nullable: true }),
19686
+ __metadata("design:type", String)
19687
+ ], CreateMJUserInput.prototype, "UserImageIconClass", void 0);
19265
19688
  CreateMJUserInput = __decorate([
19266
19689
  InputType()
19267
19690
  ], CreateMJUserInput);
@@ -19279,6 +19702,8 @@ let UpdateMJUserInput = class UpdateMJUserInput {
19279
19702
  LinkedEntityID;
19280
19703
  LinkedEntityRecordID;
19281
19704
  EmployeeID;
19705
+ UserImageURL;
19706
+ UserImageIconClass;
19282
19707
  OldValues___;
19283
19708
  };
19284
19709
  __decorate([
@@ -19329,6 +19754,14 @@ __decorate([
19329
19754
  Field({ nullable: true }),
19330
19755
  __metadata("design:type", String)
19331
19756
  ], UpdateMJUserInput.prototype, "EmployeeID", void 0);
19757
+ __decorate([
19758
+ Field({ nullable: true }),
19759
+ __metadata("design:type", String)
19760
+ ], UpdateMJUserInput.prototype, "UserImageURL", void 0);
19761
+ __decorate([
19762
+ Field({ nullable: true }),
19763
+ __metadata("design:type", String)
19764
+ ], UpdateMJUserInput.prototype, "UserImageIconClass", void 0);
19332
19765
  __decorate([
19333
19766
  Field(() => [KeyValuePairInput], { nullable: true }),
19334
19767
  __metadata("design:type", Array)
@@ -19734,22 +20167,22 @@ let MJUserResolverBase = class MJUserResolverBase extends ResolverBase {
19734
20167
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: Report User States', rows);
19735
20168
  return result;
19736
20169
  }
19737
- async MJ_DashboardUserPreferences_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
19738
- this.CheckUserReadPermissions('MJ: Dashboard User Preferences', userPayload);
20170
+ async MJ_DashboardUserStates_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
20171
+ this.CheckUserReadPermissions('MJ: Dashboard User States', userPayload);
19739
20172
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
19740
20173
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
19741
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwDashboardUserPreferences] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Dashboard User Preferences', userPayload, EntityPermissionType.Read, 'AND');
20174
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwDashboardUserStates] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Dashboard User States', userPayload, EntityPermissionType.Read, 'AND');
19742
20175
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
19743
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Dashboard User Preferences', rows);
20176
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Dashboard User States', rows);
19744
20177
  return result;
19745
20178
  }
19746
- async MJ_DashboardUserStates_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
19747
- this.CheckUserReadPermissions('MJ: Dashboard User States', userPayload);
20179
+ async MJ_DashboardUserPreferences_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
20180
+ this.CheckUserReadPermissions('MJ: Dashboard User Preferences', userPayload);
19748
20181
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
19749
20182
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
19750
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwDashboardUserStates] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Dashboard User States', userPayload, EntityPermissionType.Read, 'AND');
20183
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwDashboardUserPreferences] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Dashboard User Preferences', userPayload, EntityPermissionType.Read, 'AND');
19751
20184
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
19752
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Dashboard User States', rows);
20185
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Dashboard User Preferences', rows);
19753
20186
  return result;
19754
20187
  }
19755
20188
  async MJ_ArtifactVersions_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
@@ -19770,6 +20203,15 @@ let MJUserResolverBase = class MJUserResolverBase extends ResolverBase {
19770
20203
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: Public Links', rows);
19771
20204
  return result;
19772
20205
  }
20206
+ async MJ_ScheduledJobs_NotifyUserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
20207
+ this.CheckUserReadPermissions('MJ: Scheduled Jobs', userPayload);
20208
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20209
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
20210
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwScheduledJobs] WHERE [NotifyUserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Jobs', userPayload, EntityPermissionType.Read, 'AND');
20211
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
20212
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Jobs', rows);
20213
+ return result;
20214
+ }
19773
20215
  async MJ_ScheduledJobRuns_ExecutedByUserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
19774
20216
  this.CheckUserReadPermissions('MJ: Scheduled Job Runs', userPayload);
19775
20217
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
@@ -19779,13 +20221,13 @@ let MJUserResolverBase = class MJUserResolverBase extends ResolverBase {
19779
20221
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Job Runs', rows);
19780
20222
  return result;
19781
20223
  }
19782
- async MJ_ScheduledJobs_NotifyUserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
19783
- this.CheckUserReadPermissions('MJ: Scheduled Jobs', userPayload);
20224
+ async MJ_ArtifactPermissions_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
20225
+ this.CheckUserReadPermissions('MJ: Artifact Permissions', userPayload);
19784
20226
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
19785
20227
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
19786
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwScheduledJobs] WHERE [NotifyUserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Jobs', userPayload, EntityPermissionType.Read, 'AND');
20228
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwArtifactPermissions] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Artifact Permissions', userPayload, EntityPermissionType.Read, 'AND');
19787
20229
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
19788
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Jobs', rows);
20230
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Artifact Permissions', rows);
19789
20231
  return result;
19790
20232
  }
19791
20233
  async ResourcePermissions_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
@@ -19851,6 +20293,15 @@ let MJUserResolverBase = class MJUserResolverBase extends ResolverBase {
19851
20293
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collection Permissions', rows);
19852
20294
  return result;
19853
20295
  }
20296
+ async MJ_ArtifactPermissions_SharedByUserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
20297
+ this.CheckUserReadPermissions('MJ: Artifact Permissions', userPayload);
20298
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20299
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
20300
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwArtifactPermissions] WHERE [SharedByUserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Artifact Permissions', userPayload, EntityPermissionType.Read, 'AND');
20301
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
20302
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Artifact Permissions', rows);
20303
+ return result;
20304
+ }
19854
20305
  async MJ_AIAgentRuns_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
19855
20306
  this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
19856
20307
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
@@ -19869,22 +20320,22 @@ let MJUserResolverBase = class MJUserResolverBase extends ResolverBase {
19869
20320
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Permissions', rows);
19870
20321
  return result;
19871
20322
  }
19872
- async MJ_CollectionPermissions_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
19873
- this.CheckUserReadPermissions('MJ: Collection Permissions', userPayload);
20323
+ async MJ_Collections_OwnerIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
20324
+ this.CheckUserReadPermissions('MJ: Collections', userPayload);
19874
20325
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
19875
20326
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
19876
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollectionPermissions] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collection Permissions', userPayload, EntityPermissionType.Read, 'AND');
20327
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollections] WHERE [OwnerID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collections', userPayload, EntityPermissionType.Read, 'AND');
19877
20328
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
19878
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collection Permissions', rows);
20329
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collections', rows);
19879
20330
  return result;
19880
20331
  }
19881
- async MJ_Collections_OwnerIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
19882
- this.CheckUserReadPermissions('MJ: Collections', userPayload);
20332
+ async MJ_CollectionPermissions_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
20333
+ this.CheckUserReadPermissions('MJ: Collection Permissions', userPayload);
19883
20334
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
19884
20335
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
19885
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollections] WHERE [OwnerID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collections', userPayload, EntityPermissionType.Read, 'AND');
20336
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollectionPermissions] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collection Permissions', userPayload, EntityPermissionType.Read, 'AND');
19886
20337
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
19887
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collections', rows);
20338
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collection Permissions', rows);
19888
20339
  return result;
19889
20340
  }
19890
20341
  async MJ_Tasks_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
@@ -20288,23 +20739,23 @@ __decorate([
20288
20739
  __metadata("design:returntype", Promise)
20289
20740
  ], MJUserResolverBase.prototype, "MJ_ReportUserStates_UserIDArray", null);
20290
20741
  __decorate([
20291
- FieldResolver(() => [MJDashboardUserPreference_]),
20742
+ FieldResolver(() => [MJDashboardUserState_]),
20292
20743
  __param(0, Root()),
20293
20744
  __param(1, Ctx()),
20294
20745
  __param(2, PubSub()),
20295
20746
  __metadata("design:type", Function),
20296
20747
  __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20297
20748
  __metadata("design:returntype", Promise)
20298
- ], MJUserResolverBase.prototype, "MJ_DashboardUserPreferences_UserIDArray", null);
20749
+ ], MJUserResolverBase.prototype, "MJ_DashboardUserStates_UserIDArray", null);
20299
20750
  __decorate([
20300
- FieldResolver(() => [MJDashboardUserState_]),
20751
+ FieldResolver(() => [MJDashboardUserPreference_]),
20301
20752
  __param(0, Root()),
20302
20753
  __param(1, Ctx()),
20303
20754
  __param(2, PubSub()),
20304
20755
  __metadata("design:type", Function),
20305
20756
  __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20306
20757
  __metadata("design:returntype", Promise)
20307
- ], MJUserResolverBase.prototype, "MJ_DashboardUserStates_UserIDArray", null);
20758
+ ], MJUserResolverBase.prototype, "MJ_DashboardUserPreferences_UserIDArray", null);
20308
20759
  __decorate([
20309
20760
  FieldResolver(() => [MJArtifactVersion_]),
20310
20761
  __param(0, Root()),
@@ -20323,6 +20774,15 @@ __decorate([
20323
20774
  __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20324
20775
  __metadata("design:returntype", Promise)
20325
20776
  ], MJUserResolverBase.prototype, "MJ_PublicLinks_UserIDArray", null);
20777
+ __decorate([
20778
+ FieldResolver(() => [MJScheduledJob_]),
20779
+ __param(0, Root()),
20780
+ __param(1, Ctx()),
20781
+ __param(2, PubSub()),
20782
+ __metadata("design:type", Function),
20783
+ __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20784
+ __metadata("design:returntype", Promise)
20785
+ ], MJUserResolverBase.prototype, "MJ_ScheduledJobs_NotifyUserIDArray", null);
20326
20786
  __decorate([
20327
20787
  FieldResolver(() => [MJScheduledJobRun_]),
20328
20788
  __param(0, Root()),
@@ -20333,14 +20793,14 @@ __decorate([
20333
20793
  __metadata("design:returntype", Promise)
20334
20794
  ], MJUserResolverBase.prototype, "MJ_ScheduledJobRuns_ExecutedByUserIDArray", null);
20335
20795
  __decorate([
20336
- FieldResolver(() => [MJScheduledJob_]),
20796
+ FieldResolver(() => [MJArtifactPermission_]),
20337
20797
  __param(0, Root()),
20338
20798
  __param(1, Ctx()),
20339
20799
  __param(2, PubSub()),
20340
20800
  __metadata("design:type", Function),
20341
20801
  __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20342
20802
  __metadata("design:returntype", Promise)
20343
- ], MJUserResolverBase.prototype, "MJ_ScheduledJobs_NotifyUserIDArray", null);
20803
+ ], MJUserResolverBase.prototype, "MJ_ArtifactPermissions_UserIDArray", null);
20344
20804
  __decorate([
20345
20805
  FieldResolver(() => [MJResourcePermission_]),
20346
20806
  __param(0, Root()),
@@ -20404,6 +20864,15 @@ __decorate([
20404
20864
  __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20405
20865
  __metadata("design:returntype", Promise)
20406
20866
  ], MJUserResolverBase.prototype, "MJ_CollectionPermissions_SharedByUserIDArray", null);
20867
+ __decorate([
20868
+ FieldResolver(() => [MJArtifactPermission_]),
20869
+ __param(0, Root()),
20870
+ __param(1, Ctx()),
20871
+ __param(2, PubSub()),
20872
+ __metadata("design:type", Function),
20873
+ __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20874
+ __metadata("design:returntype", Promise)
20875
+ ], MJUserResolverBase.prototype, "MJ_ArtifactPermissions_SharedByUserIDArray", null);
20407
20876
  __decorate([
20408
20877
  FieldResolver(() => [MJAIAgentRun_]),
20409
20878
  __param(0, Root()),
@@ -20423,23 +20892,23 @@ __decorate([
20423
20892
  __metadata("design:returntype", Promise)
20424
20893
  ], MJUserResolverBase.prototype, "MJ_AIAgentPermissions_UserIDArray", null);
20425
20894
  __decorate([
20426
- FieldResolver(() => [MJCollectionPermission_]),
20895
+ FieldResolver(() => [MJCollection_]),
20427
20896
  __param(0, Root()),
20428
20897
  __param(1, Ctx()),
20429
20898
  __param(2, PubSub()),
20430
20899
  __metadata("design:type", Function),
20431
20900
  __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20432
20901
  __metadata("design:returntype", Promise)
20433
- ], MJUserResolverBase.prototype, "MJ_CollectionPermissions_UserIDArray", null);
20902
+ ], MJUserResolverBase.prototype, "MJ_Collections_OwnerIDArray", null);
20434
20903
  __decorate([
20435
- FieldResolver(() => [MJCollection_]),
20904
+ FieldResolver(() => [MJCollectionPermission_]),
20436
20905
  __param(0, Root()),
20437
20906
  __param(1, Ctx()),
20438
20907
  __param(2, PubSub()),
20439
20908
  __metadata("design:type", Function),
20440
20909
  __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20441
20910
  __metadata("design:returntype", Promise)
20442
- ], MJUserResolverBase.prototype, "MJ_Collections_OwnerIDArray", null);
20911
+ ], MJUserResolverBase.prototype, "MJ_CollectionPermissions_UserIDArray", null);
20443
20912
  __decorate([
20444
20913
  FieldResolver(() => [MJTask_]),
20445
20914
  __param(0, Root()),
@@ -53758,6 +54227,7 @@ let MJCommunicationProvider_ = class MJCommunicationProvider_ {
53758
54227
  SupportsScheduledSending;
53759
54228
  SupportsForwarding;
53760
54229
  SupportsReplying;
54230
+ SupportsDrafts;
53761
54231
  CommunicationProviderMessageTypes_CommunicationProviderIDArray;
53762
54232
  CommunicationLogs_CommunicationProviderIDArray;
53763
54233
  };
@@ -53810,6 +54280,10 @@ __decorate([
53810
54280
  Field(() => Boolean, { description: `Whether or not the provider supports replying to messages` }),
53811
54281
  __metadata("design:type", Boolean)
53812
54282
  ], MJCommunicationProvider_.prototype, "SupportsReplying", void 0);
54283
+ __decorate([
54284
+ Field(() => Boolean, { description: `Whether or not the provider supports creating draft messages` }),
54285
+ __metadata("design:type", Boolean)
54286
+ ], MJCommunicationProvider_.prototype, "SupportsDrafts", void 0);
53813
54287
  __decorate([
53814
54288
  Field(() => [MJCommunicationProviderMessageType_]),
53815
54289
  __metadata("design:type", Array)
@@ -53832,6 +54306,7 @@ let CreateMJCommunicationProviderInput = class CreateMJCommunicationProviderInpu
53832
54306
  SupportsScheduledSending;
53833
54307
  SupportsForwarding;
53834
54308
  SupportsReplying;
54309
+ SupportsDrafts;
53835
54310
  };
53836
54311
  __decorate([
53837
54312
  Field({ nullable: true }),
@@ -53869,6 +54344,10 @@ __decorate([
53869
54344
  Field(() => Boolean, { nullable: true }),
53870
54345
  __metadata("design:type", Boolean)
53871
54346
  ], CreateMJCommunicationProviderInput.prototype, "SupportsReplying", void 0);
54347
+ __decorate([
54348
+ Field(() => Boolean, { nullable: true }),
54349
+ __metadata("design:type", Boolean)
54350
+ ], CreateMJCommunicationProviderInput.prototype, "SupportsDrafts", void 0);
53872
54351
  CreateMJCommunicationProviderInput = __decorate([
53873
54352
  InputType()
53874
54353
  ], CreateMJCommunicationProviderInput);
@@ -53883,6 +54362,7 @@ let UpdateMJCommunicationProviderInput = class UpdateMJCommunicationProviderInpu
53883
54362
  SupportsScheduledSending;
53884
54363
  SupportsForwarding;
53885
54364
  SupportsReplying;
54365
+ SupportsDrafts;
53886
54366
  OldValues___;
53887
54367
  };
53888
54368
  __decorate([
@@ -53921,6 +54401,10 @@ __decorate([
53921
54401
  Field(() => Boolean, { nullable: true }),
53922
54402
  __metadata("design:type", Boolean)
53923
54403
  ], UpdateMJCommunicationProviderInput.prototype, "SupportsReplying", void 0);
54404
+ __decorate([
54405
+ Field(() => Boolean, { nullable: true }),
54406
+ __metadata("design:type", Boolean)
54407
+ ], UpdateMJCommunicationProviderInput.prototype, "SupportsDrafts", void 0);
53924
54408
  __decorate([
53925
54409
  Field(() => [KeyValuePairInput], { nullable: true }),
53926
54410
  __metadata("design:type", Array)
@@ -65386,11 +65870,13 @@ let MJArtifact_ = class MJArtifact_ {
65386
65870
  UserID;
65387
65871
  _mj__CreatedAt;
65388
65872
  _mj__UpdatedAt;
65873
+ Visibility;
65389
65874
  Environment;
65390
65875
  Type;
65391
65876
  User;
65392
65877
  MJ_ArtifactVersions_ArtifactIDArray;
65393
65878
  MJ_CollectionArtifacts_ArtifactIDArray;
65879
+ MJ_ArtifactPermissions_ArtifactIDArray;
65394
65880
  };
65395
65881
  __decorate([
65396
65882
  Field(),
@@ -65435,6 +65921,11 @@ __decorate([
65435
65921
  MaxLength(10),
65436
65922
  __metadata("design:type", Date)
65437
65923
  ], MJArtifact_.prototype, "_mj__UpdatedAt", void 0);
65924
+ __decorate([
65925
+ Field({ description: `Controls artifact visibility in user-facing lists. "Always" shows in all lists, "System Only" hides from normal views (for system-generated artifacts like agent routing payloads).` }),
65926
+ MaxLength(40),
65927
+ __metadata("design:type", String)
65928
+ ], MJArtifact_.prototype, "Visibility", void 0);
65438
65929
  __decorate([
65439
65930
  Field(),
65440
65931
  MaxLength(510),
@@ -65458,6 +65949,10 @@ __decorate([
65458
65949
  Field(() => [MJCollectionArtifact_]),
65459
65950
  __metadata("design:type", Array)
65460
65951
  ], MJArtifact_.prototype, "MJ_CollectionArtifacts_ArtifactIDArray", void 0);
65952
+ __decorate([
65953
+ Field(() => [MJArtifactPermission_]),
65954
+ __metadata("design:type", Array)
65955
+ ], MJArtifact_.prototype, "MJ_ArtifactPermissions_ArtifactIDArray", void 0);
65461
65956
  MJArtifact_ = __decorate([
65462
65957
  ObjectType({ description: `Independent content items (code, documents, charts) that can be linked to multiple conversations and collections. Supports versioning and sharing.` })
65463
65958
  ], MJArtifact_);
@@ -65470,6 +65965,7 @@ let CreateMJArtifactInput = class CreateMJArtifactInput {
65470
65965
  TypeID;
65471
65966
  Comments;
65472
65967
  UserID;
65968
+ Visibility;
65473
65969
  };
65474
65970
  __decorate([
65475
65971
  Field({ nullable: true }),
@@ -65499,6 +65995,10 @@ __decorate([
65499
65995
  Field({ nullable: true }),
65500
65996
  __metadata("design:type", String)
65501
65997
  ], CreateMJArtifactInput.prototype, "UserID", void 0);
65998
+ __decorate([
65999
+ Field({ nullable: true }),
66000
+ __metadata("design:type", String)
66001
+ ], CreateMJArtifactInput.prototype, "Visibility", void 0);
65502
66002
  CreateMJArtifactInput = __decorate([
65503
66003
  InputType()
65504
66004
  ], CreateMJArtifactInput);
@@ -65511,6 +66011,7 @@ let UpdateMJArtifactInput = class UpdateMJArtifactInput {
65511
66011
  TypeID;
65512
66012
  Comments;
65513
66013
  UserID;
66014
+ Visibility;
65514
66015
  OldValues___;
65515
66016
  };
65516
66017
  __decorate([
@@ -65541,6 +66042,10 @@ __decorate([
65541
66042
  Field({ nullable: true }),
65542
66043
  __metadata("design:type", String)
65543
66044
  ], UpdateMJArtifactInput.prototype, "UserID", void 0);
66045
+ __decorate([
66046
+ Field({ nullable: true }),
66047
+ __metadata("design:type", String)
66048
+ ], UpdateMJArtifactInput.prototype, "Visibility", void 0);
65544
66049
  __decorate([
65545
66050
  Field(() => [KeyValuePairInput], { nullable: true }),
65546
66051
  __metadata("design:type", Array)
@@ -65631,6 +66136,15 @@ let MJArtifactResolver = class MJArtifactResolver extends ResolverBase {
65631
66136
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collection Artifacts', rows);
65632
66137
  return result;
65633
66138
  }
66139
+ async MJ_ArtifactPermissions_ArtifactIDArray(mjartifact_, { dataSources, userPayload, providers }, pubSub) {
66140
+ this.CheckUserReadPermissions('MJ: Artifact Permissions', userPayload);
66141
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
66142
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
66143
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwArtifactPermissions] WHERE [ArtifactID]='${mjartifact_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Artifact Permissions', userPayload, EntityPermissionType.Read, 'AND');
66144
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
66145
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Artifact Permissions', rows);
66146
+ return result;
66147
+ }
65634
66148
  async CreateMJArtifact(input, { providers, userPayload }, pubSub) {
65635
66149
  const provider = GetReadWriteProvider(providers);
65636
66150
  return this.CreateRecord('MJ: Artifacts', input, provider, userPayload, pubSub);
@@ -65699,6 +66213,15 @@ __decorate([
65699
66213
  __metadata("design:paramtypes", [MJArtifact_, Object, PubSubEngine]),
65700
66214
  __metadata("design:returntype", Promise)
65701
66215
  ], MJArtifactResolver.prototype, "MJ_CollectionArtifacts_ArtifactIDArray", null);
66216
+ __decorate([
66217
+ FieldResolver(() => [MJArtifactPermission_]),
66218
+ __param(0, Root()),
66219
+ __param(1, Ctx()),
66220
+ __param(2, PubSub()),
66221
+ __metadata("design:type", Function),
66222
+ __metadata("design:paramtypes", [MJArtifact_, Object, PubSubEngine]),
66223
+ __metadata("design:returntype", Promise)
66224
+ ], MJArtifactResolver.prototype, "MJ_ArtifactPermissions_ArtifactIDArray", null);
65702
66225
  __decorate([
65703
66226
  Mutation(() => MJArtifact_),
65704
66227
  __param(0, Arg('input', () => CreateMJArtifactInput)),
@@ -78835,4 +79358,504 @@ MJArtifactVersionAttributeResolver = __decorate([
78835
79358
  Resolver(MJArtifactVersionAttribute_)
78836
79359
  ], MJArtifactVersionAttributeResolver);
78837
79360
  export { MJArtifactVersionAttributeResolver };
79361
+ let MJAIAgentDataSource_ = class MJAIAgentDataSource_ {
79362
+ ID;
79363
+ AgentID;
79364
+ Name;
79365
+ Description;
79366
+ SourceType;
79367
+ EntityName;
79368
+ ExtraFilter;
79369
+ OrderBy;
79370
+ FieldsToRetrieve;
79371
+ ResultType;
79372
+ QueryName;
79373
+ CategoryPath;
79374
+ Parameters;
79375
+ MaxRows;
79376
+ ExecutionOrder;
79377
+ Status;
79378
+ CachePolicy;
79379
+ CacheTimeoutSeconds;
79380
+ DestinationType;
79381
+ DestinationPath;
79382
+ _mj__CreatedAt;
79383
+ _mj__UpdatedAt;
79384
+ Agent;
79385
+ };
79386
+ __decorate([
79387
+ Field(),
79388
+ MaxLength(16),
79389
+ __metadata("design:type", String)
79390
+ ], MJAIAgentDataSource_.prototype, "ID", void 0);
79391
+ __decorate([
79392
+ Field(),
79393
+ MaxLength(16),
79394
+ __metadata("design:type", String)
79395
+ ], MJAIAgentDataSource_.prototype, "AgentID", void 0);
79396
+ __decorate([
79397
+ Field({ description: `Variable name for the data in the data parameter (e.g., "ALL_ENTITIES"). Must be unique within an agent.` }),
79398
+ MaxLength(510),
79399
+ __metadata("design:type", String)
79400
+ ], MJAIAgentDataSource_.prototype, "Name", void 0);
79401
+ __decorate([
79402
+ Field({ nullable: true, description: `Description of what this data source provides` }),
79403
+ __metadata("design:type", String)
79404
+ ], MJAIAgentDataSource_.prototype, "Description", void 0);
79405
+ __decorate([
79406
+ Field({ description: `Type of data source: RunView or RunQuery. Determines which parameters are used.` }),
79407
+ MaxLength(40),
79408
+ __metadata("design:type", String)
79409
+ ], MJAIAgentDataSource_.prototype, "SourceType", void 0);
79410
+ __decorate([
79411
+ Field({ nullable: true, description: `Entity name for RunView data sources (e.g., "Entities", "AI Models")` }),
79412
+ MaxLength(510),
79413
+ __metadata("design:type", String)
79414
+ ], MJAIAgentDataSource_.prototype, "EntityName", void 0);
79415
+ __decorate([
79416
+ Field({ nullable: true, description: `SQL WHERE clause filter for RunView data sources` }),
79417
+ __metadata("design:type", String)
79418
+ ], MJAIAgentDataSource_.prototype, "ExtraFilter", void 0);
79419
+ __decorate([
79420
+ Field({ nullable: true, description: `SQL ORDER BY clause for RunView data sources` }),
79421
+ MaxLength(1000),
79422
+ __metadata("design:type", String)
79423
+ ], MJAIAgentDataSource_.prototype, "OrderBy", void 0);
79424
+ __decorate([
79425
+ Field({ nullable: true, description: `JSON array of field names to return for RunView data sources (e.g., ["ID", "Name", "Description"])` }),
79426
+ __metadata("design:type", String)
79427
+ ], MJAIAgentDataSource_.prototype, "FieldsToRetrieve", void 0);
79428
+ __decorate([
79429
+ Field({ nullable: true, description: `Result type for RunView: simple (default) or entity_object` }),
79430
+ MaxLength(40),
79431
+ __metadata("design:type", String)
79432
+ ], MJAIAgentDataSource_.prototype, "ResultType", void 0);
79433
+ __decorate([
79434
+ Field({ nullable: true, description: `Query name for RunQuery data sources` }),
79435
+ MaxLength(510),
79436
+ __metadata("design:type", String)
79437
+ ], MJAIAgentDataSource_.prototype, "QueryName", void 0);
79438
+ __decorate([
79439
+ Field({ nullable: true, description: `Category path for RunQuery data sources (e.g., "/MJ/AI/Agents/")` }),
79440
+ MaxLength(1000),
79441
+ __metadata("design:type", String)
79442
+ ], MJAIAgentDataSource_.prototype, "CategoryPath", void 0);
79443
+ __decorate([
79444
+ Field({ nullable: true, description: `JSON object of parameters for RunQuery data sources (e.g., {"organizationId": "123"})` }),
79445
+ __metadata("design:type", String)
79446
+ ], MJAIAgentDataSource_.prototype, "Parameters", void 0);
79447
+ __decorate([
79448
+ Field(() => Int, { nullable: true, description: `Maximum number of rows to return. Applies to both RunView and RunQuery.` }),
79449
+ __metadata("design:type", Number)
79450
+ ], MJAIAgentDataSource_.prototype, "MaxRows", void 0);
79451
+ __decorate([
79452
+ Field(() => Int, { description: `Execution order when multiple data sources are defined for an agent (lower numbers execute first)` }),
79453
+ __metadata("design:type", Number)
79454
+ ], MJAIAgentDataSource_.prototype, "ExecutionOrder", void 0);
79455
+ __decorate([
79456
+ Field({ description: `Status of the data source: Active or Disabled` }),
79457
+ MaxLength(40),
79458
+ __metadata("design:type", String)
79459
+ ], MJAIAgentDataSource_.prototype, "Status", void 0);
79460
+ __decorate([
79461
+ Field({ description: `Cache policy: None (no caching), PerRun (cache for duration of agent run), PerAgent (cache across runs with timeout)` }),
79462
+ MaxLength(40),
79463
+ __metadata("design:type", String)
79464
+ ], MJAIAgentDataSource_.prototype, "CachePolicy", void 0);
79465
+ __decorate([
79466
+ Field(() => Int, { nullable: true, description: `Time-to-live in seconds for PerAgent cache policy. Ignored for other cache policies.` }),
79467
+ __metadata("design:type", Number)
79468
+ ], MJAIAgentDataSource_.prototype, "CacheTimeoutSeconds", void 0);
79469
+ __decorate([
79470
+ Field({ description: `Destination for the preloaded data: Data (for Nunjucks templates in prompts), Context (for actions only), or Payload (for agent state)` }),
79471
+ MaxLength(40),
79472
+ __metadata("design:type", String)
79473
+ ], MJAIAgentDataSource_.prototype, "DestinationType", void 0);
79474
+ __decorate([
79475
+ Field({ nullable: true, description: `Path within the destination where data should be injected. Supports nested paths using dot notation (e.g., "config.api.endpoints", "analysis.orders.recent"). If null, uses Name as root-level key.` }),
79476
+ MaxLength(1000),
79477
+ __metadata("design:type", String)
79478
+ ], MJAIAgentDataSource_.prototype, "DestinationPath", void 0);
79479
+ __decorate([
79480
+ Field(),
79481
+ MaxLength(10),
79482
+ __metadata("design:type", Date)
79483
+ ], MJAIAgentDataSource_.prototype, "_mj__CreatedAt", void 0);
79484
+ __decorate([
79485
+ Field(),
79486
+ MaxLength(10),
79487
+ __metadata("design:type", Date)
79488
+ ], MJAIAgentDataSource_.prototype, "_mj__UpdatedAt", void 0);
79489
+ __decorate([
79490
+ Field({ nullable: true }),
79491
+ MaxLength(510),
79492
+ __metadata("design:type", String)
79493
+ ], MJAIAgentDataSource_.prototype, "Agent", void 0);
79494
+ MJAIAgentDataSource_ = __decorate([
79495
+ ObjectType({ description: `Defines data sources that should be preloaded into the data parameter before agent execution. Supports both RunView and RunQuery sources with configurable caching.` })
79496
+ ], MJAIAgentDataSource_);
79497
+ export { MJAIAgentDataSource_ };
79498
+ let CreateMJAIAgentDataSourceInput = class CreateMJAIAgentDataSourceInput {
79499
+ ID;
79500
+ AgentID;
79501
+ Name;
79502
+ Description;
79503
+ SourceType;
79504
+ EntityName;
79505
+ ExtraFilter;
79506
+ OrderBy;
79507
+ FieldsToRetrieve;
79508
+ ResultType;
79509
+ QueryName;
79510
+ CategoryPath;
79511
+ Parameters;
79512
+ MaxRows;
79513
+ ExecutionOrder;
79514
+ Status;
79515
+ CachePolicy;
79516
+ CacheTimeoutSeconds;
79517
+ DestinationType;
79518
+ DestinationPath;
79519
+ };
79520
+ __decorate([
79521
+ Field({ nullable: true }),
79522
+ __metadata("design:type", String)
79523
+ ], CreateMJAIAgentDataSourceInput.prototype, "ID", void 0);
79524
+ __decorate([
79525
+ Field({ nullable: true }),
79526
+ __metadata("design:type", String)
79527
+ ], CreateMJAIAgentDataSourceInput.prototype, "AgentID", void 0);
79528
+ __decorate([
79529
+ Field({ nullable: true }),
79530
+ __metadata("design:type", String)
79531
+ ], CreateMJAIAgentDataSourceInput.prototype, "Name", void 0);
79532
+ __decorate([
79533
+ Field({ nullable: true }),
79534
+ __metadata("design:type", String)
79535
+ ], CreateMJAIAgentDataSourceInput.prototype, "Description", void 0);
79536
+ __decorate([
79537
+ Field({ nullable: true }),
79538
+ __metadata("design:type", String)
79539
+ ], CreateMJAIAgentDataSourceInput.prototype, "SourceType", void 0);
79540
+ __decorate([
79541
+ Field({ nullable: true }),
79542
+ __metadata("design:type", String)
79543
+ ], CreateMJAIAgentDataSourceInput.prototype, "EntityName", void 0);
79544
+ __decorate([
79545
+ Field({ nullable: true }),
79546
+ __metadata("design:type", String)
79547
+ ], CreateMJAIAgentDataSourceInput.prototype, "ExtraFilter", void 0);
79548
+ __decorate([
79549
+ Field({ nullable: true }),
79550
+ __metadata("design:type", String)
79551
+ ], CreateMJAIAgentDataSourceInput.prototype, "OrderBy", void 0);
79552
+ __decorate([
79553
+ Field({ nullable: true }),
79554
+ __metadata("design:type", String)
79555
+ ], CreateMJAIAgentDataSourceInput.prototype, "FieldsToRetrieve", void 0);
79556
+ __decorate([
79557
+ Field({ nullable: true }),
79558
+ __metadata("design:type", String)
79559
+ ], CreateMJAIAgentDataSourceInput.prototype, "ResultType", void 0);
79560
+ __decorate([
79561
+ Field({ nullable: true }),
79562
+ __metadata("design:type", String)
79563
+ ], CreateMJAIAgentDataSourceInput.prototype, "QueryName", void 0);
79564
+ __decorate([
79565
+ Field({ nullable: true }),
79566
+ __metadata("design:type", String)
79567
+ ], CreateMJAIAgentDataSourceInput.prototype, "CategoryPath", void 0);
79568
+ __decorate([
79569
+ Field({ nullable: true }),
79570
+ __metadata("design:type", String)
79571
+ ], CreateMJAIAgentDataSourceInput.prototype, "Parameters", void 0);
79572
+ __decorate([
79573
+ Field(() => Int, { nullable: true }),
79574
+ __metadata("design:type", Number)
79575
+ ], CreateMJAIAgentDataSourceInput.prototype, "MaxRows", void 0);
79576
+ __decorate([
79577
+ Field(() => Int, { nullable: true }),
79578
+ __metadata("design:type", Number)
79579
+ ], CreateMJAIAgentDataSourceInput.prototype, "ExecutionOrder", void 0);
79580
+ __decorate([
79581
+ Field({ nullable: true }),
79582
+ __metadata("design:type", String)
79583
+ ], CreateMJAIAgentDataSourceInput.prototype, "Status", void 0);
79584
+ __decorate([
79585
+ Field({ nullable: true }),
79586
+ __metadata("design:type", String)
79587
+ ], CreateMJAIAgentDataSourceInput.prototype, "CachePolicy", void 0);
79588
+ __decorate([
79589
+ Field(() => Int, { nullable: true }),
79590
+ __metadata("design:type", Number)
79591
+ ], CreateMJAIAgentDataSourceInput.prototype, "CacheTimeoutSeconds", void 0);
79592
+ __decorate([
79593
+ Field({ nullable: true }),
79594
+ __metadata("design:type", String)
79595
+ ], CreateMJAIAgentDataSourceInput.prototype, "DestinationType", void 0);
79596
+ __decorate([
79597
+ Field({ nullable: true }),
79598
+ __metadata("design:type", String)
79599
+ ], CreateMJAIAgentDataSourceInput.prototype, "DestinationPath", void 0);
79600
+ CreateMJAIAgentDataSourceInput = __decorate([
79601
+ InputType()
79602
+ ], CreateMJAIAgentDataSourceInput);
79603
+ export { CreateMJAIAgentDataSourceInput };
79604
+ let UpdateMJAIAgentDataSourceInput = class UpdateMJAIAgentDataSourceInput {
79605
+ ID;
79606
+ AgentID;
79607
+ Name;
79608
+ Description;
79609
+ SourceType;
79610
+ EntityName;
79611
+ ExtraFilter;
79612
+ OrderBy;
79613
+ FieldsToRetrieve;
79614
+ ResultType;
79615
+ QueryName;
79616
+ CategoryPath;
79617
+ Parameters;
79618
+ MaxRows;
79619
+ ExecutionOrder;
79620
+ Status;
79621
+ CachePolicy;
79622
+ CacheTimeoutSeconds;
79623
+ DestinationType;
79624
+ DestinationPath;
79625
+ OldValues___;
79626
+ };
79627
+ __decorate([
79628
+ Field(),
79629
+ __metadata("design:type", String)
79630
+ ], UpdateMJAIAgentDataSourceInput.prototype, "ID", void 0);
79631
+ __decorate([
79632
+ Field({ nullable: true }),
79633
+ __metadata("design:type", String)
79634
+ ], UpdateMJAIAgentDataSourceInput.prototype, "AgentID", void 0);
79635
+ __decorate([
79636
+ Field({ nullable: true }),
79637
+ __metadata("design:type", String)
79638
+ ], UpdateMJAIAgentDataSourceInput.prototype, "Name", void 0);
79639
+ __decorate([
79640
+ Field({ nullable: true }),
79641
+ __metadata("design:type", String)
79642
+ ], UpdateMJAIAgentDataSourceInput.prototype, "Description", void 0);
79643
+ __decorate([
79644
+ Field({ nullable: true }),
79645
+ __metadata("design:type", String)
79646
+ ], UpdateMJAIAgentDataSourceInput.prototype, "SourceType", void 0);
79647
+ __decorate([
79648
+ Field({ nullable: true }),
79649
+ __metadata("design:type", String)
79650
+ ], UpdateMJAIAgentDataSourceInput.prototype, "EntityName", void 0);
79651
+ __decorate([
79652
+ Field({ nullable: true }),
79653
+ __metadata("design:type", String)
79654
+ ], UpdateMJAIAgentDataSourceInput.prototype, "ExtraFilter", void 0);
79655
+ __decorate([
79656
+ Field({ nullable: true }),
79657
+ __metadata("design:type", String)
79658
+ ], UpdateMJAIAgentDataSourceInput.prototype, "OrderBy", void 0);
79659
+ __decorate([
79660
+ Field({ nullable: true }),
79661
+ __metadata("design:type", String)
79662
+ ], UpdateMJAIAgentDataSourceInput.prototype, "FieldsToRetrieve", void 0);
79663
+ __decorate([
79664
+ Field({ nullable: true }),
79665
+ __metadata("design:type", String)
79666
+ ], UpdateMJAIAgentDataSourceInput.prototype, "ResultType", void 0);
79667
+ __decorate([
79668
+ Field({ nullable: true }),
79669
+ __metadata("design:type", String)
79670
+ ], UpdateMJAIAgentDataSourceInput.prototype, "QueryName", void 0);
79671
+ __decorate([
79672
+ Field({ nullable: true }),
79673
+ __metadata("design:type", String)
79674
+ ], UpdateMJAIAgentDataSourceInput.prototype, "CategoryPath", void 0);
79675
+ __decorate([
79676
+ Field({ nullable: true }),
79677
+ __metadata("design:type", String)
79678
+ ], UpdateMJAIAgentDataSourceInput.prototype, "Parameters", void 0);
79679
+ __decorate([
79680
+ Field(() => Int, { nullable: true }),
79681
+ __metadata("design:type", Number)
79682
+ ], UpdateMJAIAgentDataSourceInput.prototype, "MaxRows", void 0);
79683
+ __decorate([
79684
+ Field(() => Int, { nullable: true }),
79685
+ __metadata("design:type", Number)
79686
+ ], UpdateMJAIAgentDataSourceInput.prototype, "ExecutionOrder", void 0);
79687
+ __decorate([
79688
+ Field({ nullable: true }),
79689
+ __metadata("design:type", String)
79690
+ ], UpdateMJAIAgentDataSourceInput.prototype, "Status", void 0);
79691
+ __decorate([
79692
+ Field({ nullable: true }),
79693
+ __metadata("design:type", String)
79694
+ ], UpdateMJAIAgentDataSourceInput.prototype, "CachePolicy", void 0);
79695
+ __decorate([
79696
+ Field(() => Int, { nullable: true }),
79697
+ __metadata("design:type", Number)
79698
+ ], UpdateMJAIAgentDataSourceInput.prototype, "CacheTimeoutSeconds", void 0);
79699
+ __decorate([
79700
+ Field({ nullable: true }),
79701
+ __metadata("design:type", String)
79702
+ ], UpdateMJAIAgentDataSourceInput.prototype, "DestinationType", void 0);
79703
+ __decorate([
79704
+ Field({ nullable: true }),
79705
+ __metadata("design:type", String)
79706
+ ], UpdateMJAIAgentDataSourceInput.prototype, "DestinationPath", void 0);
79707
+ __decorate([
79708
+ Field(() => [KeyValuePairInput], { nullable: true }),
79709
+ __metadata("design:type", Array)
79710
+ ], UpdateMJAIAgentDataSourceInput.prototype, "OldValues___", void 0);
79711
+ UpdateMJAIAgentDataSourceInput = __decorate([
79712
+ InputType()
79713
+ ], UpdateMJAIAgentDataSourceInput);
79714
+ export { UpdateMJAIAgentDataSourceInput };
79715
+ let RunMJAIAgentDataSourceViewResult = class RunMJAIAgentDataSourceViewResult {
79716
+ Results;
79717
+ UserViewRunID;
79718
+ RowCount;
79719
+ TotalRowCount;
79720
+ ExecutionTime;
79721
+ ErrorMessage;
79722
+ Success;
79723
+ };
79724
+ __decorate([
79725
+ Field(() => [MJAIAgentDataSource_]),
79726
+ __metadata("design:type", Array)
79727
+ ], RunMJAIAgentDataSourceViewResult.prototype, "Results", void 0);
79728
+ __decorate([
79729
+ Field(() => String, { nullable: true }),
79730
+ __metadata("design:type", String)
79731
+ ], RunMJAIAgentDataSourceViewResult.prototype, "UserViewRunID", void 0);
79732
+ __decorate([
79733
+ Field(() => Int, { nullable: true }),
79734
+ __metadata("design:type", Number)
79735
+ ], RunMJAIAgentDataSourceViewResult.prototype, "RowCount", void 0);
79736
+ __decorate([
79737
+ Field(() => Int, { nullable: true }),
79738
+ __metadata("design:type", Number)
79739
+ ], RunMJAIAgentDataSourceViewResult.prototype, "TotalRowCount", void 0);
79740
+ __decorate([
79741
+ Field(() => Int, { nullable: true }),
79742
+ __metadata("design:type", Number)
79743
+ ], RunMJAIAgentDataSourceViewResult.prototype, "ExecutionTime", void 0);
79744
+ __decorate([
79745
+ Field({ nullable: true }),
79746
+ __metadata("design:type", String)
79747
+ ], RunMJAIAgentDataSourceViewResult.prototype, "ErrorMessage", void 0);
79748
+ __decorate([
79749
+ Field(() => Boolean, { nullable: false }),
79750
+ __metadata("design:type", Boolean)
79751
+ ], RunMJAIAgentDataSourceViewResult.prototype, "Success", void 0);
79752
+ RunMJAIAgentDataSourceViewResult = __decorate([
79753
+ ObjectType()
79754
+ ], RunMJAIAgentDataSourceViewResult);
79755
+ export { RunMJAIAgentDataSourceViewResult };
79756
+ let MJAIAgentDataSourceResolver = class MJAIAgentDataSourceResolver extends ResolverBase {
79757
+ async RunMJAIAgentDataSourceViewByID(input, { providers, userPayload }, pubSub) {
79758
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
79759
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
79760
+ }
79761
+ async RunMJAIAgentDataSourceViewByName(input, { providers, userPayload }, pubSub) {
79762
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
79763
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
79764
+ }
79765
+ async RunMJAIAgentDataSourceDynamicView(input, { providers, userPayload }, pubSub) {
79766
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
79767
+ input.EntityName = 'MJ: AI Agent Data Sources';
79768
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
79769
+ }
79770
+ async MJAIAgentDataSource(ID, { dataSources, userPayload, providers }, pubSub) {
79771
+ this.CheckUserReadPermissions('MJ: AI Agent Data Sources', userPayload);
79772
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
79773
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
79774
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentDataSources] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Data Sources', userPayload, EntityPermissionType.Read, 'AND');
79775
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
79776
+ const result = this.MapFieldNamesToCodeNames('MJ: AI Agent Data Sources', rows && rows.length > 0 ? rows[0] : {});
79777
+ return result;
79778
+ }
79779
+ async CreateMJAIAgentDataSource(input, { providers, userPayload }, pubSub) {
79780
+ const provider = GetReadWriteProvider(providers);
79781
+ return this.CreateRecord('MJ: AI Agent Data Sources', input, provider, userPayload, pubSub);
79782
+ }
79783
+ async UpdateMJAIAgentDataSource(input, { providers, userPayload }, pubSub) {
79784
+ const provider = GetReadWriteProvider(providers);
79785
+ return this.UpdateRecord('MJ: AI Agent Data Sources', input, provider, userPayload, pubSub);
79786
+ }
79787
+ async DeleteMJAIAgentDataSource(ID, options, { providers, userPayload }, pubSub) {
79788
+ const provider = GetReadWriteProvider(providers);
79789
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
79790
+ return this.DeleteRecord('MJ: AI Agent Data Sources', key, options, provider, userPayload, pubSub);
79791
+ }
79792
+ };
79793
+ __decorate([
79794
+ Query(() => RunMJAIAgentDataSourceViewResult),
79795
+ __param(0, Arg('input', () => RunViewByIDInput)),
79796
+ __param(1, Ctx()),
79797
+ __param(2, PubSub()),
79798
+ __metadata("design:type", Function),
79799
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
79800
+ __metadata("design:returntype", Promise)
79801
+ ], MJAIAgentDataSourceResolver.prototype, "RunMJAIAgentDataSourceViewByID", null);
79802
+ __decorate([
79803
+ Query(() => RunMJAIAgentDataSourceViewResult),
79804
+ __param(0, Arg('input', () => RunViewByNameInput)),
79805
+ __param(1, Ctx()),
79806
+ __param(2, PubSub()),
79807
+ __metadata("design:type", Function),
79808
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
79809
+ __metadata("design:returntype", Promise)
79810
+ ], MJAIAgentDataSourceResolver.prototype, "RunMJAIAgentDataSourceViewByName", null);
79811
+ __decorate([
79812
+ Query(() => RunMJAIAgentDataSourceViewResult),
79813
+ __param(0, Arg('input', () => RunDynamicViewInput)),
79814
+ __param(1, Ctx()),
79815
+ __param(2, PubSub()),
79816
+ __metadata("design:type", Function),
79817
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
79818
+ __metadata("design:returntype", Promise)
79819
+ ], MJAIAgentDataSourceResolver.prototype, "RunMJAIAgentDataSourceDynamicView", null);
79820
+ __decorate([
79821
+ Query(() => MJAIAgentDataSource_, { nullable: true }),
79822
+ __param(0, Arg('ID', () => String)),
79823
+ __param(1, Ctx()),
79824
+ __param(2, PubSub()),
79825
+ __metadata("design:type", Function),
79826
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
79827
+ __metadata("design:returntype", Promise)
79828
+ ], MJAIAgentDataSourceResolver.prototype, "MJAIAgentDataSource", null);
79829
+ __decorate([
79830
+ Mutation(() => MJAIAgentDataSource_),
79831
+ __param(0, Arg('input', () => CreateMJAIAgentDataSourceInput)),
79832
+ __param(1, Ctx()),
79833
+ __param(2, PubSub()),
79834
+ __metadata("design:type", Function),
79835
+ __metadata("design:paramtypes", [CreateMJAIAgentDataSourceInput, Object, PubSubEngine]),
79836
+ __metadata("design:returntype", Promise)
79837
+ ], MJAIAgentDataSourceResolver.prototype, "CreateMJAIAgentDataSource", null);
79838
+ __decorate([
79839
+ Mutation(() => MJAIAgentDataSource_),
79840
+ __param(0, Arg('input', () => UpdateMJAIAgentDataSourceInput)),
79841
+ __param(1, Ctx()),
79842
+ __param(2, PubSub()),
79843
+ __metadata("design:type", Function),
79844
+ __metadata("design:paramtypes", [UpdateMJAIAgentDataSourceInput, Object, PubSubEngine]),
79845
+ __metadata("design:returntype", Promise)
79846
+ ], MJAIAgentDataSourceResolver.prototype, "UpdateMJAIAgentDataSource", null);
79847
+ __decorate([
79848
+ Mutation(() => MJAIAgentDataSource_),
79849
+ __param(0, Arg('ID', () => String)),
79850
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
79851
+ __param(2, Ctx()),
79852
+ __param(3, PubSub()),
79853
+ __metadata("design:type", Function),
79854
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
79855
+ __metadata("design:returntype", Promise)
79856
+ ], MJAIAgentDataSourceResolver.prototype, "DeleteMJAIAgentDataSource", null);
79857
+ MJAIAgentDataSourceResolver = __decorate([
79858
+ Resolver(MJAIAgentDataSource_)
79859
+ ], MJAIAgentDataSourceResolver);
79860
+ export { MJAIAgentDataSourceResolver };
78838
79861
  //# sourceMappingURL=generated.js.map