@memberjunction/server 2.107.0 → 2.109.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.
@@ -4460,6 +4460,7 @@ let MJAIAgent_ = class MJAIAgent_ {
4460
4460
  ChatHandlingOption;
4461
4461
  DefaultArtifactTypeID;
4462
4462
  OwnerUserID;
4463
+ InvocationMode;
4463
4464
  Parent;
4464
4465
  ContextCompressionPrompt;
4465
4466
  Type;
@@ -4474,6 +4475,7 @@ let MJAIAgent_ = class MJAIAgent_ {
4474
4475
  MJ_AIAgentRelationships_AgentIDArray;
4475
4476
  MJ_AIAgentArtifactTypes_AgentIDArray;
4476
4477
  MJ_AIAgentPermissions_AgentIDArray;
4478
+ MJ_AIAgentDataSources_AgentIDArray;
4477
4479
  AIAgentNotes_AgentIDArray;
4478
4480
  MJ_AIAgentPrompts_AgentIDArray;
4479
4481
  MJ_AIAgentRuns_AgentIDArray;
@@ -4666,6 +4668,11 @@ __decorate([
4666
4668
  MaxLength(16),
4667
4669
  __metadata("design:type", String)
4668
4670
  ], MJAIAgent_.prototype, "OwnerUserID", void 0);
4671
+ __decorate([
4672
+ Field({ description: `Controls how the agent can be invoked: Any (default - can be top-level or sub-agent), Top-Level (only callable as primary agent), Sub-Agent (only callable as sub-agent). Used to filter available agents in tools like Sage.` }),
4673
+ MaxLength(40),
4674
+ __metadata("design:type", String)
4675
+ ], MJAIAgent_.prototype, "InvocationMode", void 0);
4669
4676
  __decorate([
4670
4677
  Field({ nullable: true }),
4671
4678
  MaxLength(510),
@@ -4728,6 +4735,10 @@ __decorate([
4728
4735
  Field(() => [MJAIAgentPermission_]),
4729
4736
  __metadata("design:type", Array)
4730
4737
  ], MJAIAgent_.prototype, "MJ_AIAgentPermissions_AgentIDArray", void 0);
4738
+ __decorate([
4739
+ Field(() => [MJAIAgentDataSource_]),
4740
+ __metadata("design:type", Array)
4741
+ ], MJAIAgent_.prototype, "MJ_AIAgentDataSources_AgentIDArray", void 0);
4731
4742
  __decorate([
4732
4743
  Field(() => [MJAIAgentNote_]),
4733
4744
  __metadata("design:type", Array)
@@ -4810,6 +4821,7 @@ let CreateMJAIAgentInput = class CreateMJAIAgentInput {
4810
4821
  ChatHandlingOption;
4811
4822
  DefaultArtifactTypeID;
4812
4823
  OwnerUserID;
4824
+ InvocationMode;
4813
4825
  };
4814
4826
  __decorate([
4815
4827
  Field({ nullable: true }),
@@ -4959,6 +4971,10 @@ __decorate([
4959
4971
  Field({ nullable: true }),
4960
4972
  __metadata("design:type", String)
4961
4973
  ], CreateMJAIAgentInput.prototype, "OwnerUserID", void 0);
4974
+ __decorate([
4975
+ Field({ nullable: true }),
4976
+ __metadata("design:type", String)
4977
+ ], CreateMJAIAgentInput.prototype, "InvocationMode", void 0);
4962
4978
  CreateMJAIAgentInput = __decorate([
4963
4979
  InputType()
4964
4980
  ], CreateMJAIAgentInput);
@@ -5001,6 +5017,7 @@ let UpdateMJAIAgentInput = class UpdateMJAIAgentInput {
5001
5017
  ChatHandlingOption;
5002
5018
  DefaultArtifactTypeID;
5003
5019
  OwnerUserID;
5020
+ InvocationMode;
5004
5021
  OldValues___;
5005
5022
  };
5006
5023
  __decorate([
@@ -5151,6 +5168,10 @@ __decorate([
5151
5168
  Field({ nullable: true }),
5152
5169
  __metadata("design:type", String)
5153
5170
  ], UpdateMJAIAgentInput.prototype, "OwnerUserID", void 0);
5171
+ __decorate([
5172
+ Field({ nullable: true }),
5173
+ __metadata("design:type", String)
5174
+ ], UpdateMJAIAgentInput.prototype, "InvocationMode", void 0);
5154
5175
  __decorate([
5155
5176
  Field(() => [KeyValuePairInput], { nullable: true }),
5156
5177
  __metadata("design:type", Array)
@@ -5295,6 +5316,15 @@ let MJAIAgentResolver = class MJAIAgentResolver extends ResolverBase {
5295
5316
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Permissions', rows);
5296
5317
  return result;
5297
5318
  }
5319
+ async MJ_AIAgentDataSources_AgentIDArray(mjaiagent_, { dataSources, userPayload, providers }, pubSub) {
5320
+ this.CheckUserReadPermissions('MJ: AI Agent Data Sources', userPayload);
5321
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
5322
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
5323
+ 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');
5324
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
5325
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Data Sources', rows);
5326
+ return result;
5327
+ }
5298
5328
  async AIAgentNotes_AgentIDArray(mjaiagent_, { dataSources, userPayload, providers }, pubSub) {
5299
5329
  this.CheckUserReadPermissions('AI Agent Notes', userPayload);
5300
5330
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
@@ -5507,6 +5537,15 @@ __decorate([
5507
5537
  __metadata("design:paramtypes", [MJAIAgent_, Object, PubSubEngine]),
5508
5538
  __metadata("design:returntype", Promise)
5509
5539
  ], MJAIAgentResolver.prototype, "MJ_AIAgentPermissions_AgentIDArray", null);
5540
+ __decorate([
5541
+ FieldResolver(() => [MJAIAgentDataSource_]),
5542
+ __param(0, Root()),
5543
+ __param(1, Ctx()),
5544
+ __param(2, PubSub()),
5545
+ __metadata("design:type", Function),
5546
+ __metadata("design:paramtypes", [MJAIAgent_, Object, PubSubEngine]),
5547
+ __metadata("design:returntype", Promise)
5548
+ ], MJAIAgentResolver.prototype, "MJ_AIAgentDataSources_AgentIDArray", null);
5510
5549
  __decorate([
5511
5550
  FieldResolver(() => [MJAIAgentNote_]),
5512
5551
  __param(0, Root()),
@@ -8057,6 +8096,329 @@ MJEnvironmentResolver = __decorate([
8057
8096
  Resolver(MJEnvironment_)
8058
8097
  ], MJEnvironmentResolver);
8059
8098
  export { MJEnvironmentResolver };
8099
+ let MJArtifactPermission_ = class MJArtifactPermission_ {
8100
+ ID;
8101
+ ArtifactID;
8102
+ UserID;
8103
+ CanRead;
8104
+ CanEdit;
8105
+ CanDelete;
8106
+ CanShare;
8107
+ SharedByUserID;
8108
+ _mj__CreatedAt;
8109
+ _mj__UpdatedAt;
8110
+ Artifact;
8111
+ User;
8112
+ SharedByUser;
8113
+ };
8114
+ __decorate([
8115
+ Field(),
8116
+ MaxLength(16),
8117
+ __metadata("design:type", String)
8118
+ ], MJArtifactPermission_.prototype, "ID", void 0);
8119
+ __decorate([
8120
+ Field(),
8121
+ MaxLength(16),
8122
+ __metadata("design:type", String)
8123
+ ], MJArtifactPermission_.prototype, "ArtifactID", void 0);
8124
+ __decorate([
8125
+ Field(),
8126
+ MaxLength(16),
8127
+ __metadata("design:type", String)
8128
+ ], MJArtifactPermission_.prototype, "UserID", void 0);
8129
+ __decorate([
8130
+ Field(() => Boolean, { description: `Whether the user can view/read the artifact` }),
8131
+ __metadata("design:type", Boolean)
8132
+ ], MJArtifactPermission_.prototype, "CanRead", void 0);
8133
+ __decorate([
8134
+ Field(() => Boolean, { description: `Whether the user can modify the artifact or create new versions` }),
8135
+ __metadata("design:type", Boolean)
8136
+ ], MJArtifactPermission_.prototype, "CanEdit", void 0);
8137
+ __decorate([
8138
+ Field(() => Boolean, { description: `Whether the user can delete the artifact` }),
8139
+ __metadata("design:type", Boolean)
8140
+ ], MJArtifactPermission_.prototype, "CanDelete", void 0);
8141
+ __decorate([
8142
+ Field(() => Boolean, { description: `Whether the user can share the artifact with other users` }),
8143
+ __metadata("design:type", Boolean)
8144
+ ], MJArtifactPermission_.prototype, "CanShare", void 0);
8145
+ __decorate([
8146
+ Field({ nullable: true, description: `Foreign key to the User who shared this artifact (if shared)` }),
8147
+ MaxLength(16),
8148
+ __metadata("design:type", String)
8149
+ ], MJArtifactPermission_.prototype, "SharedByUserID", void 0);
8150
+ __decorate([
8151
+ Field(),
8152
+ MaxLength(10),
8153
+ __metadata("design:type", Date)
8154
+ ], MJArtifactPermission_.prototype, "_mj__CreatedAt", void 0);
8155
+ __decorate([
8156
+ Field(),
8157
+ MaxLength(10),
8158
+ __metadata("design:type", Date)
8159
+ ], MJArtifactPermission_.prototype, "_mj__UpdatedAt", void 0);
8160
+ __decorate([
8161
+ Field(),
8162
+ MaxLength(510),
8163
+ __metadata("design:type", String)
8164
+ ], MJArtifactPermission_.prototype, "Artifact", void 0);
8165
+ __decorate([
8166
+ Field(),
8167
+ MaxLength(200),
8168
+ __metadata("design:type", String)
8169
+ ], MJArtifactPermission_.prototype, "User", void 0);
8170
+ __decorate([
8171
+ Field({ nullable: true }),
8172
+ MaxLength(200),
8173
+ __metadata("design:type", String)
8174
+ ], MJArtifactPermission_.prototype, "SharedByUser", void 0);
8175
+ MJArtifactPermission_ = __decorate([
8176
+ ObjectType({ description: `Manages user permissions for artifacts with granular access control (Read, Edit, Delete, Share)` })
8177
+ ], MJArtifactPermission_);
8178
+ export { MJArtifactPermission_ };
8179
+ let CreateMJArtifactPermissionInput = class CreateMJArtifactPermissionInput {
8180
+ ID;
8181
+ ArtifactID;
8182
+ UserID;
8183
+ CanRead;
8184
+ CanEdit;
8185
+ CanDelete;
8186
+ CanShare;
8187
+ SharedByUserID;
8188
+ };
8189
+ __decorate([
8190
+ Field({ nullable: true }),
8191
+ __metadata("design:type", String)
8192
+ ], CreateMJArtifactPermissionInput.prototype, "ID", void 0);
8193
+ __decorate([
8194
+ Field({ nullable: true }),
8195
+ __metadata("design:type", String)
8196
+ ], CreateMJArtifactPermissionInput.prototype, "ArtifactID", void 0);
8197
+ __decorate([
8198
+ Field({ nullable: true }),
8199
+ __metadata("design:type", String)
8200
+ ], CreateMJArtifactPermissionInput.prototype, "UserID", void 0);
8201
+ __decorate([
8202
+ Field(() => Boolean, { nullable: true }),
8203
+ __metadata("design:type", Boolean)
8204
+ ], CreateMJArtifactPermissionInput.prototype, "CanRead", void 0);
8205
+ __decorate([
8206
+ Field(() => Boolean, { nullable: true }),
8207
+ __metadata("design:type", Boolean)
8208
+ ], CreateMJArtifactPermissionInput.prototype, "CanEdit", void 0);
8209
+ __decorate([
8210
+ Field(() => Boolean, { nullable: true }),
8211
+ __metadata("design:type", Boolean)
8212
+ ], CreateMJArtifactPermissionInput.prototype, "CanDelete", void 0);
8213
+ __decorate([
8214
+ Field(() => Boolean, { nullable: true }),
8215
+ __metadata("design:type", Boolean)
8216
+ ], CreateMJArtifactPermissionInput.prototype, "CanShare", void 0);
8217
+ __decorate([
8218
+ Field({ nullable: true }),
8219
+ __metadata("design:type", String)
8220
+ ], CreateMJArtifactPermissionInput.prototype, "SharedByUserID", void 0);
8221
+ CreateMJArtifactPermissionInput = __decorate([
8222
+ InputType()
8223
+ ], CreateMJArtifactPermissionInput);
8224
+ export { CreateMJArtifactPermissionInput };
8225
+ let UpdateMJArtifactPermissionInput = class UpdateMJArtifactPermissionInput {
8226
+ ID;
8227
+ ArtifactID;
8228
+ UserID;
8229
+ CanRead;
8230
+ CanEdit;
8231
+ CanDelete;
8232
+ CanShare;
8233
+ SharedByUserID;
8234
+ OldValues___;
8235
+ };
8236
+ __decorate([
8237
+ Field(),
8238
+ __metadata("design:type", String)
8239
+ ], UpdateMJArtifactPermissionInput.prototype, "ID", void 0);
8240
+ __decorate([
8241
+ Field({ nullable: true }),
8242
+ __metadata("design:type", String)
8243
+ ], UpdateMJArtifactPermissionInput.prototype, "ArtifactID", void 0);
8244
+ __decorate([
8245
+ Field({ nullable: true }),
8246
+ __metadata("design:type", String)
8247
+ ], UpdateMJArtifactPermissionInput.prototype, "UserID", void 0);
8248
+ __decorate([
8249
+ Field(() => Boolean, { nullable: true }),
8250
+ __metadata("design:type", Boolean)
8251
+ ], UpdateMJArtifactPermissionInput.prototype, "CanRead", void 0);
8252
+ __decorate([
8253
+ Field(() => Boolean, { nullable: true }),
8254
+ __metadata("design:type", Boolean)
8255
+ ], UpdateMJArtifactPermissionInput.prototype, "CanEdit", void 0);
8256
+ __decorate([
8257
+ Field(() => Boolean, { nullable: true }),
8258
+ __metadata("design:type", Boolean)
8259
+ ], UpdateMJArtifactPermissionInput.prototype, "CanDelete", void 0);
8260
+ __decorate([
8261
+ Field(() => Boolean, { nullable: true }),
8262
+ __metadata("design:type", Boolean)
8263
+ ], UpdateMJArtifactPermissionInput.prototype, "CanShare", void 0);
8264
+ __decorate([
8265
+ Field({ nullable: true }),
8266
+ __metadata("design:type", String)
8267
+ ], UpdateMJArtifactPermissionInput.prototype, "SharedByUserID", void 0);
8268
+ __decorate([
8269
+ Field(() => [KeyValuePairInput], { nullable: true }),
8270
+ __metadata("design:type", Array)
8271
+ ], UpdateMJArtifactPermissionInput.prototype, "OldValues___", void 0);
8272
+ UpdateMJArtifactPermissionInput = __decorate([
8273
+ InputType()
8274
+ ], UpdateMJArtifactPermissionInput);
8275
+ export { UpdateMJArtifactPermissionInput };
8276
+ let RunMJArtifactPermissionViewResult = class RunMJArtifactPermissionViewResult {
8277
+ Results;
8278
+ UserViewRunID;
8279
+ RowCount;
8280
+ TotalRowCount;
8281
+ ExecutionTime;
8282
+ ErrorMessage;
8283
+ Success;
8284
+ };
8285
+ __decorate([
8286
+ Field(() => [MJArtifactPermission_]),
8287
+ __metadata("design:type", Array)
8288
+ ], RunMJArtifactPermissionViewResult.prototype, "Results", void 0);
8289
+ __decorate([
8290
+ Field(() => String, { nullable: true }),
8291
+ __metadata("design:type", String)
8292
+ ], RunMJArtifactPermissionViewResult.prototype, "UserViewRunID", void 0);
8293
+ __decorate([
8294
+ Field(() => Int, { nullable: true }),
8295
+ __metadata("design:type", Number)
8296
+ ], RunMJArtifactPermissionViewResult.prototype, "RowCount", void 0);
8297
+ __decorate([
8298
+ Field(() => Int, { nullable: true }),
8299
+ __metadata("design:type", Number)
8300
+ ], RunMJArtifactPermissionViewResult.prototype, "TotalRowCount", void 0);
8301
+ __decorate([
8302
+ Field(() => Int, { nullable: true }),
8303
+ __metadata("design:type", Number)
8304
+ ], RunMJArtifactPermissionViewResult.prototype, "ExecutionTime", void 0);
8305
+ __decorate([
8306
+ Field({ nullable: true }),
8307
+ __metadata("design:type", String)
8308
+ ], RunMJArtifactPermissionViewResult.prototype, "ErrorMessage", void 0);
8309
+ __decorate([
8310
+ Field(() => Boolean, { nullable: false }),
8311
+ __metadata("design:type", Boolean)
8312
+ ], RunMJArtifactPermissionViewResult.prototype, "Success", void 0);
8313
+ RunMJArtifactPermissionViewResult = __decorate([
8314
+ ObjectType()
8315
+ ], RunMJArtifactPermissionViewResult);
8316
+ export { RunMJArtifactPermissionViewResult };
8317
+ let MJArtifactPermissionResolver = class MJArtifactPermissionResolver extends ResolverBase {
8318
+ async RunMJArtifactPermissionViewByID(input, { providers, userPayload }, pubSub) {
8319
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
8320
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
8321
+ }
8322
+ async RunMJArtifactPermissionViewByName(input, { providers, userPayload }, pubSub) {
8323
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
8324
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
8325
+ }
8326
+ async RunMJArtifactPermissionDynamicView(input, { providers, userPayload }, pubSub) {
8327
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
8328
+ input.EntityName = 'MJ: Artifact Permissions';
8329
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
8330
+ }
8331
+ async MJArtifactPermission(ID, { dataSources, userPayload, providers }, pubSub) {
8332
+ this.CheckUserReadPermissions('MJ: Artifact Permissions', userPayload);
8333
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
8334
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
8335
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwArtifactPermissions] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Artifact Permissions', userPayload, EntityPermissionType.Read, 'AND');
8336
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
8337
+ const result = this.MapFieldNamesToCodeNames('MJ: Artifact Permissions', rows && rows.length > 0 ? rows[0] : {});
8338
+ return result;
8339
+ }
8340
+ async CreateMJArtifactPermission(input, { providers, userPayload }, pubSub) {
8341
+ const provider = GetReadWriteProvider(providers);
8342
+ return this.CreateRecord('MJ: Artifact Permissions', input, provider, userPayload, pubSub);
8343
+ }
8344
+ async UpdateMJArtifactPermission(input, { providers, userPayload }, pubSub) {
8345
+ const provider = GetReadWriteProvider(providers);
8346
+ return this.UpdateRecord('MJ: Artifact Permissions', input, provider, userPayload, pubSub);
8347
+ }
8348
+ async DeleteMJArtifactPermission(ID, options, { providers, userPayload }, pubSub) {
8349
+ const provider = GetReadWriteProvider(providers);
8350
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
8351
+ return this.DeleteRecord('MJ: Artifact Permissions', key, options, provider, userPayload, pubSub);
8352
+ }
8353
+ };
8354
+ __decorate([
8355
+ Query(() => RunMJArtifactPermissionViewResult),
8356
+ __param(0, Arg('input', () => RunViewByIDInput)),
8357
+ __param(1, Ctx()),
8358
+ __param(2, PubSub()),
8359
+ __metadata("design:type", Function),
8360
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
8361
+ __metadata("design:returntype", Promise)
8362
+ ], MJArtifactPermissionResolver.prototype, "RunMJArtifactPermissionViewByID", null);
8363
+ __decorate([
8364
+ Query(() => RunMJArtifactPermissionViewResult),
8365
+ __param(0, Arg('input', () => RunViewByNameInput)),
8366
+ __param(1, Ctx()),
8367
+ __param(2, PubSub()),
8368
+ __metadata("design:type", Function),
8369
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
8370
+ __metadata("design:returntype", Promise)
8371
+ ], MJArtifactPermissionResolver.prototype, "RunMJArtifactPermissionViewByName", null);
8372
+ __decorate([
8373
+ Query(() => RunMJArtifactPermissionViewResult),
8374
+ __param(0, Arg('input', () => RunDynamicViewInput)),
8375
+ __param(1, Ctx()),
8376
+ __param(2, PubSub()),
8377
+ __metadata("design:type", Function),
8378
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
8379
+ __metadata("design:returntype", Promise)
8380
+ ], MJArtifactPermissionResolver.prototype, "RunMJArtifactPermissionDynamicView", null);
8381
+ __decorate([
8382
+ Query(() => MJArtifactPermission_, { nullable: true }),
8383
+ __param(0, Arg('ID', () => String)),
8384
+ __param(1, Ctx()),
8385
+ __param(2, PubSub()),
8386
+ __metadata("design:type", Function),
8387
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
8388
+ __metadata("design:returntype", Promise)
8389
+ ], MJArtifactPermissionResolver.prototype, "MJArtifactPermission", null);
8390
+ __decorate([
8391
+ Mutation(() => MJArtifactPermission_),
8392
+ __param(0, Arg('input', () => CreateMJArtifactPermissionInput)),
8393
+ __param(1, Ctx()),
8394
+ __param(2, PubSub()),
8395
+ __metadata("design:type", Function),
8396
+ __metadata("design:paramtypes", [CreateMJArtifactPermissionInput, Object, PubSubEngine]),
8397
+ __metadata("design:returntype", Promise)
8398
+ ], MJArtifactPermissionResolver.prototype, "CreateMJArtifactPermission", null);
8399
+ __decorate([
8400
+ Mutation(() => MJArtifactPermission_),
8401
+ __param(0, Arg('input', () => UpdateMJArtifactPermissionInput)),
8402
+ __param(1, Ctx()),
8403
+ __param(2, PubSub()),
8404
+ __metadata("design:type", Function),
8405
+ __metadata("design:paramtypes", [UpdateMJArtifactPermissionInput, Object, PubSubEngine]),
8406
+ __metadata("design:returntype", Promise)
8407
+ ], MJArtifactPermissionResolver.prototype, "UpdateMJArtifactPermission", null);
8408
+ __decorate([
8409
+ Mutation(() => MJArtifactPermission_),
8410
+ __param(0, Arg('ID', () => String)),
8411
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
8412
+ __param(2, Ctx()),
8413
+ __param(3, PubSub()),
8414
+ __metadata("design:type", Function),
8415
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
8416
+ __metadata("design:returntype", Promise)
8417
+ ], MJArtifactPermissionResolver.prototype, "DeleteMJArtifactPermission", null);
8418
+ MJArtifactPermissionResolver = __decorate([
8419
+ Resolver(MJArtifactPermission_)
8420
+ ], MJArtifactPermissionResolver);
8421
+ export { MJArtifactPermissionResolver };
8060
8422
  let MJAIAgentAction_ = class MJAIAgentAction_ {
8061
8423
  ID;
8062
8424
  AgentID;
@@ -8066,8 +8428,14 @@ let MJAIAgentAction_ = class MJAIAgentAction_ {
8066
8428
  _mj__UpdatedAt;
8067
8429
  MinExecutionsPerRun;
8068
8430
  MaxExecutionsPerRun;
8431
+ ResultExpirationTurns;
8432
+ ResultExpirationMode;
8433
+ CompactMode;
8434
+ CompactLength;
8435
+ CompactPromptID;
8069
8436
  Agent;
8070
8437
  Action;
8438
+ CompactPrompt;
8071
8439
  };
8072
8440
  __decorate([
8073
8441
  Field({ description: `The unique identifier for each AI agent-action mapping. Serves as the primary key.` }),
@@ -8107,6 +8475,29 @@ __decorate([
8107
8475
  Field(() => Int, { nullable: true, description: `Maximum number of times this action can be executed per agent run` }),
8108
8476
  __metadata("design:type", Number)
8109
8477
  ], MJAIAgentAction_.prototype, "MaxExecutionsPerRun", void 0);
8478
+ __decorate([
8479
+ Field(() => Int, { nullable: true, description: `Number of conversation turns before action results expire from conversation context. NULL = never expire (default). 0 = expire immediately after next turn.` }),
8480
+ __metadata("design:type", Number)
8481
+ ], MJAIAgentAction_.prototype, "ResultExpirationTurns", void 0);
8482
+ __decorate([
8483
+ Field({ description: `How to handle expired action results: None (no expiration, default), Remove (delete message entirely), Compact (reduce size via CompactMode while preserving key information).` }),
8484
+ MaxLength(40),
8485
+ __metadata("design:type", String)
8486
+ ], MJAIAgentAction_.prototype, "ResultExpirationMode", void 0);
8487
+ __decorate([
8488
+ Field({ nullable: true, description: `How to compact results when ResultExpirationMode=Compact: FirstNChars (truncate to CompactLength characters, fast and free), AISummary (use LLM to intelligently summarize with CompactPromptID or Action.DefaultCompactPromptID).` }),
8489
+ MaxLength(40),
8490
+ __metadata("design:type", String)
8491
+ ], MJAIAgentAction_.prototype, "CompactMode", void 0);
8492
+ __decorate([
8493
+ Field(() => Int, { nullable: true, description: `Number of characters to keep when CompactMode=FirstNChars. Required when CompactMode is FirstNChars, ignored otherwise.` }),
8494
+ __metadata("design:type", Number)
8495
+ ], MJAIAgentAction_.prototype, "CompactLength", void 0);
8496
+ __decorate([
8497
+ Field({ nullable: true, description: `Optional override for AI summarization prompt when CompactMode=AISummary. Lookup hierarchy: this field -> Action.DefaultCompactPromptID -> system default. Allows agent-specific summarization focus (e.g., technical vs. marketing perspective).` }),
8498
+ MaxLength(16),
8499
+ __metadata("design:type", String)
8500
+ ], MJAIAgentAction_.prototype, "CompactPromptID", void 0);
8110
8501
  __decorate([
8111
8502
  Field({ nullable: true }),
8112
8503
  MaxLength(510),
@@ -8117,6 +8508,11 @@ __decorate([
8117
8508
  MaxLength(850),
8118
8509
  __metadata("design:type", String)
8119
8510
  ], MJAIAgentAction_.prototype, "Action", void 0);
8511
+ __decorate([
8512
+ Field({ nullable: true }),
8513
+ MaxLength(510),
8514
+ __metadata("design:type", String)
8515
+ ], MJAIAgentAction_.prototype, "CompactPrompt", void 0);
8120
8516
  MJAIAgentAction_ = __decorate([
8121
8517
  ObjectType({ description: `Table to store the relationship between AI agents and actions.` })
8122
8518
  ], MJAIAgentAction_);
@@ -8128,6 +8524,11 @@ let CreateMJAIAgentActionInput = class CreateMJAIAgentActionInput {
8128
8524
  Status;
8129
8525
  MinExecutionsPerRun;
8130
8526
  MaxExecutionsPerRun;
8527
+ ResultExpirationTurns;
8528
+ ResultExpirationMode;
8529
+ CompactMode;
8530
+ CompactLength;
8531
+ CompactPromptID;
8131
8532
  };
8132
8533
  __decorate([
8133
8534
  Field({ nullable: true }),
@@ -8153,6 +8554,26 @@ __decorate([
8153
8554
  Field(() => Int, { nullable: true }),
8154
8555
  __metadata("design:type", Number)
8155
8556
  ], CreateMJAIAgentActionInput.prototype, "MaxExecutionsPerRun", void 0);
8557
+ __decorate([
8558
+ Field(() => Int, { nullable: true }),
8559
+ __metadata("design:type", Number)
8560
+ ], CreateMJAIAgentActionInput.prototype, "ResultExpirationTurns", void 0);
8561
+ __decorate([
8562
+ Field({ nullable: true }),
8563
+ __metadata("design:type", String)
8564
+ ], CreateMJAIAgentActionInput.prototype, "ResultExpirationMode", void 0);
8565
+ __decorate([
8566
+ Field({ nullable: true }),
8567
+ __metadata("design:type", String)
8568
+ ], CreateMJAIAgentActionInput.prototype, "CompactMode", void 0);
8569
+ __decorate([
8570
+ Field(() => Int, { nullable: true }),
8571
+ __metadata("design:type", Number)
8572
+ ], CreateMJAIAgentActionInput.prototype, "CompactLength", void 0);
8573
+ __decorate([
8574
+ Field({ nullable: true }),
8575
+ __metadata("design:type", String)
8576
+ ], CreateMJAIAgentActionInput.prototype, "CompactPromptID", void 0);
8156
8577
  CreateMJAIAgentActionInput = __decorate([
8157
8578
  InputType()
8158
8579
  ], CreateMJAIAgentActionInput);
@@ -8164,6 +8585,11 @@ let UpdateMJAIAgentActionInput = class UpdateMJAIAgentActionInput {
8164
8585
  Status;
8165
8586
  MinExecutionsPerRun;
8166
8587
  MaxExecutionsPerRun;
8588
+ ResultExpirationTurns;
8589
+ ResultExpirationMode;
8590
+ CompactMode;
8591
+ CompactLength;
8592
+ CompactPromptID;
8167
8593
  OldValues___;
8168
8594
  };
8169
8595
  __decorate([
@@ -8190,6 +8616,26 @@ __decorate([
8190
8616
  Field(() => Int, { nullable: true }),
8191
8617
  __metadata("design:type", Number)
8192
8618
  ], UpdateMJAIAgentActionInput.prototype, "MaxExecutionsPerRun", void 0);
8619
+ __decorate([
8620
+ Field(() => Int, { nullable: true }),
8621
+ __metadata("design:type", Number)
8622
+ ], UpdateMJAIAgentActionInput.prototype, "ResultExpirationTurns", void 0);
8623
+ __decorate([
8624
+ Field({ nullable: true }),
8625
+ __metadata("design:type", String)
8626
+ ], UpdateMJAIAgentActionInput.prototype, "ResultExpirationMode", void 0);
8627
+ __decorate([
8628
+ Field({ nullable: true }),
8629
+ __metadata("design:type", String)
8630
+ ], UpdateMJAIAgentActionInput.prototype, "CompactMode", void 0);
8631
+ __decorate([
8632
+ Field(() => Int, { nullable: true }),
8633
+ __metadata("design:type", Number)
8634
+ ], UpdateMJAIAgentActionInput.prototype, "CompactLength", void 0);
8635
+ __decorate([
8636
+ Field({ nullable: true }),
8637
+ __metadata("design:type", String)
8638
+ ], UpdateMJAIAgentActionInput.prototype, "CompactPromptID", void 0);
8193
8639
  __decorate([
8194
8640
  Field(() => [KeyValuePairInput], { nullable: true }),
8195
8641
  __metadata("design:type", Array)
@@ -9119,10 +9565,13 @@ let MJCollection_ = class MJCollection_ {
9119
9565
  Sequence;
9120
9566
  _mj__CreatedAt;
9121
9567
  _mj__UpdatedAt;
9568
+ OwnerID;
9122
9569
  Environment;
9123
9570
  Parent;
9571
+ Owner;
9124
9572
  RootParentID;
9125
9573
  MJ_CollectionArtifacts_CollectionIDArray;
9574
+ MJ_CollectionPermissions_CollectionIDArray;
9126
9575
  MJ_Collections_ParentIDArray;
9127
9576
  };
9128
9577
  __decorate([
@@ -9173,6 +9622,11 @@ __decorate([
9173
9622
  MaxLength(10),
9174
9623
  __metadata("design:type", Date)
9175
9624
  ], MJCollection_.prototype, "_mj__UpdatedAt", void 0);
9625
+ __decorate([
9626
+ Field({ nullable: true, description: `The user who owns this collection and has full permissions` }),
9627
+ MaxLength(16),
9628
+ __metadata("design:type", String)
9629
+ ], MJCollection_.prototype, "OwnerID", void 0);
9176
9630
  __decorate([
9177
9631
  Field(),
9178
9632
  MaxLength(510),
@@ -9183,6 +9637,11 @@ __decorate([
9183
9637
  MaxLength(510),
9184
9638
  __metadata("design:type", String)
9185
9639
  ], MJCollection_.prototype, "Parent", void 0);
9640
+ __decorate([
9641
+ Field({ nullable: true }),
9642
+ MaxLength(200),
9643
+ __metadata("design:type", String)
9644
+ ], MJCollection_.prototype, "Owner", void 0);
9186
9645
  __decorate([
9187
9646
  Field({ nullable: true }),
9188
9647
  MaxLength(16),
@@ -9192,6 +9651,10 @@ __decorate([
9192
9651
  Field(() => [MJCollectionArtifact_]),
9193
9652
  __metadata("design:type", Array)
9194
9653
  ], MJCollection_.prototype, "MJ_CollectionArtifacts_CollectionIDArray", void 0);
9654
+ __decorate([
9655
+ Field(() => [MJCollectionPermission_]),
9656
+ __metadata("design:type", Array)
9657
+ ], MJCollection_.prototype, "MJ_CollectionPermissions_CollectionIDArray", void 0);
9195
9658
  __decorate([
9196
9659
  Field(() => [MJCollection_]),
9197
9660
  __metadata("design:type", Array)
@@ -9209,6 +9672,7 @@ let CreateMJCollectionInput = class CreateMJCollectionInput {
9209
9672
  Icon;
9210
9673
  Color;
9211
9674
  Sequence;
9675
+ OwnerID;
9212
9676
  };
9213
9677
  __decorate([
9214
9678
  Field({ nullable: true }),
@@ -9242,6 +9706,10 @@ __decorate([
9242
9706
  Field(() => Int, { nullable: true }),
9243
9707
  __metadata("design:type", Number)
9244
9708
  ], CreateMJCollectionInput.prototype, "Sequence", void 0);
9709
+ __decorate([
9710
+ Field({ nullable: true }),
9711
+ __metadata("design:type", String)
9712
+ ], CreateMJCollectionInput.prototype, "OwnerID", void 0);
9245
9713
  CreateMJCollectionInput = __decorate([
9246
9714
  InputType()
9247
9715
  ], CreateMJCollectionInput);
@@ -9255,6 +9723,7 @@ let UpdateMJCollectionInput = class UpdateMJCollectionInput {
9255
9723
  Icon;
9256
9724
  Color;
9257
9725
  Sequence;
9726
+ OwnerID;
9258
9727
  OldValues___;
9259
9728
  };
9260
9729
  __decorate([
@@ -9289,6 +9758,10 @@ __decorate([
9289
9758
  Field(() => Int, { nullable: true }),
9290
9759
  __metadata("design:type", Number)
9291
9760
  ], UpdateMJCollectionInput.prototype, "Sequence", void 0);
9761
+ __decorate([
9762
+ Field({ nullable: true }),
9763
+ __metadata("design:type", String)
9764
+ ], UpdateMJCollectionInput.prototype, "OwnerID", void 0);
9292
9765
  __decorate([
9293
9766
  Field(() => [KeyValuePairInput], { nullable: true }),
9294
9767
  __metadata("design:type", Array)
@@ -9370,6 +9843,15 @@ let MJCollectionResolver = class MJCollectionResolver extends ResolverBase {
9370
9843
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collection Artifacts', rows);
9371
9844
  return result;
9372
9845
  }
9846
+ async MJ_CollectionPermissions_CollectionIDArray(mjcollection_, { dataSources, userPayload, providers }, pubSub) {
9847
+ this.CheckUserReadPermissions('MJ: Collection Permissions', userPayload);
9848
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
9849
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
9850
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollectionPermissions] WHERE [CollectionID]='${mjcollection_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collection Permissions', userPayload, EntityPermissionType.Read, 'AND');
9851
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
9852
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collection Permissions', rows);
9853
+ return result;
9854
+ }
9373
9855
  async MJ_Collections_ParentIDArray(mjcollection_, { dataSources, userPayload, providers }, pubSub) {
9374
9856
  this.CheckUserReadPermissions('MJ: Collections', userPayload);
9375
9857
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
@@ -9438,6 +9920,15 @@ __decorate([
9438
9920
  __metadata("design:paramtypes", [MJCollection_, Object, PubSubEngine]),
9439
9921
  __metadata("design:returntype", Promise)
9440
9922
  ], MJCollectionResolver.prototype, "MJ_CollectionArtifacts_CollectionIDArray", null);
9923
+ __decorate([
9924
+ FieldResolver(() => [MJCollectionPermission_]),
9925
+ __param(0, Root()),
9926
+ __param(1, Ctx()),
9927
+ __param(2, PubSub()),
9928
+ __metadata("design:type", Function),
9929
+ __metadata("design:paramtypes", [MJCollection_, Object, PubSubEngine]),
9930
+ __metadata("design:returntype", Promise)
9931
+ ], MJCollectionResolver.prototype, "MJ_CollectionPermissions_CollectionIDArray", null);
9441
9932
  __decorate([
9442
9933
  FieldResolver(() => [MJCollection_]),
9443
9934
  __param(0, Root()),
@@ -9859,6 +10350,7 @@ let MJAIPrompt_ = class MJAIPrompt_ {
9859
10350
  AIResultCache_AIPromptIDArray;
9860
10351
  MJ_AIConfigurations_DefaultPromptForContextCompressionIDArray;
9861
10352
  MJ_AIAgentTypes_SystemPromptIDArray;
10353
+ AIAgentActions_CompactPromptIDArray;
9862
10354
  MJ_AIConfigurations_DefaultPromptForContextSummarizationIDArray;
9863
10355
  AIPrompts_ResultSelectorPromptIDArray;
9864
10356
  MJ_AIPromptModels_PromptIDArray;
@@ -9866,6 +10358,7 @@ let MJAIPrompt_ = class MJAIPrompt_ {
9866
10358
  MJ_AIAgentSteps_PromptIDArray;
9867
10359
  MJ_AIPromptRuns_PromptIDArray;
9868
10360
  AIAgents_ContextCompressionPromptIDArray;
10361
+ Actions_DefaultCompactPromptIDArray;
9869
10362
  };
9870
10363
  __decorate([
9871
10364
  Field(),
@@ -10138,6 +10631,10 @@ __decorate([
10138
10631
  Field(() => [MJAIAgentType_]),
10139
10632
  __metadata("design:type", Array)
10140
10633
  ], MJAIPrompt_.prototype, "MJ_AIAgentTypes_SystemPromptIDArray", void 0);
10634
+ __decorate([
10635
+ Field(() => [MJAIAgentAction_]),
10636
+ __metadata("design:type", Array)
10637
+ ], MJAIPrompt_.prototype, "AIAgentActions_CompactPromptIDArray", void 0);
10141
10638
  __decorate([
10142
10639
  Field(() => [MJAIConfiguration_]),
10143
10640
  __metadata("design:type", Array)
@@ -10166,6 +10663,10 @@ __decorate([
10166
10663
  Field(() => [MJAIAgent_]),
10167
10664
  __metadata("design:type", Array)
10168
10665
  ], MJAIPrompt_.prototype, "AIAgents_ContextCompressionPromptIDArray", void 0);
10666
+ __decorate([
10667
+ Field(() => [MJAction_]),
10668
+ __metadata("design:type", Array)
10669
+ ], MJAIPrompt_.prototype, "Actions_DefaultCompactPromptIDArray", void 0);
10169
10670
  MJAIPrompt_ = __decorate([
10170
10671
  ObjectType({ description: `Stores AI prompts, including references to categories, types, and templates.` })
10171
10672
  ], MJAIPrompt_);
@@ -10768,6 +11269,15 @@ let MJAIPromptResolver = class MJAIPromptResolver extends ResolverBase {
10768
11269
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Types', rows);
10769
11270
  return result;
10770
11271
  }
11272
+ async AIAgentActions_CompactPromptIDArray(mjaiprompt_, { dataSources, userPayload, providers }, pubSub) {
11273
+ this.CheckUserReadPermissions('AI Agent Actions', userPayload);
11274
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
11275
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
11276
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentActions] WHERE [CompactPromptID]='${mjaiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'AI Agent Actions', userPayload, EntityPermissionType.Read, 'AND');
11277
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
11278
+ const result = this.ArrayMapFieldNamesToCodeNames('AI Agent Actions', rows);
11279
+ return result;
11280
+ }
10771
11281
  async MJ_AIConfigurations_DefaultPromptForContextSummarizationIDArray(mjaiprompt_, { dataSources, userPayload, providers }, pubSub) {
10772
11282
  this.CheckUserReadPermissions('MJ: AI Configurations', userPayload);
10773
11283
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
@@ -10831,6 +11341,15 @@ let MJAIPromptResolver = class MJAIPromptResolver extends ResolverBase {
10831
11341
  const result = this.ArrayMapFieldNamesToCodeNames('AI Agents', rows);
10832
11342
  return result;
10833
11343
  }
11344
+ async Actions_DefaultCompactPromptIDArray(mjaiprompt_, { dataSources, userPayload, providers }, pubSub) {
11345
+ this.CheckUserReadPermissions('Actions', userPayload);
11346
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
11347
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
11348
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwActions] WHERE [DefaultCompactPromptID]='${mjaiprompt_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'Actions', userPayload, EntityPermissionType.Read, 'AND');
11349
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
11350
+ const result = this.ArrayMapFieldNamesToCodeNames('Actions', rows);
11351
+ return result;
11352
+ }
10834
11353
  async CreateMJAIPrompt(input, { providers, userPayload }, pubSub) {
10835
11354
  const provider = GetReadWriteProvider(providers);
10836
11355
  return this.CreateRecord('AI Prompts', input, provider, userPayload, pubSub);
@@ -10908,6 +11427,15 @@ __decorate([
10908
11427
  __metadata("design:paramtypes", [MJAIPrompt_, Object, PubSubEngine]),
10909
11428
  __metadata("design:returntype", Promise)
10910
11429
  ], MJAIPromptResolver.prototype, "MJ_AIAgentTypes_SystemPromptIDArray", null);
11430
+ __decorate([
11431
+ FieldResolver(() => [MJAIAgentAction_]),
11432
+ __param(0, Root()),
11433
+ __param(1, Ctx()),
11434
+ __param(2, PubSub()),
11435
+ __metadata("design:type", Function),
11436
+ __metadata("design:paramtypes", [MJAIPrompt_, Object, PubSubEngine]),
11437
+ __metadata("design:returntype", Promise)
11438
+ ], MJAIPromptResolver.prototype, "AIAgentActions_CompactPromptIDArray", null);
10911
11439
  __decorate([
10912
11440
  FieldResolver(() => [MJAIConfiguration_]),
10913
11441
  __param(0, Root()),
@@ -10971,6 +11499,15 @@ __decorate([
10971
11499
  __metadata("design:paramtypes", [MJAIPrompt_, Object, PubSubEngine]),
10972
11500
  __metadata("design:returntype", Promise)
10973
11501
  ], MJAIPromptResolver.prototype, "AIAgents_ContextCompressionPromptIDArray", null);
11502
+ __decorate([
11503
+ FieldResolver(() => [MJAction_]),
11504
+ __param(0, Root()),
11505
+ __param(1, Ctx()),
11506
+ __param(2, PubSub()),
11507
+ __metadata("design:type", Function),
11508
+ __metadata("design:paramtypes", [MJAIPrompt_, Object, PubSubEngine]),
11509
+ __metadata("design:returntype", Promise)
11510
+ ], MJAIPromptResolver.prototype, "Actions_DefaultCompactPromptIDArray", null);
10974
11511
  __decorate([
10975
11512
  Mutation(() => MJAIPrompt_),
10976
11513
  __param(0, Arg('input', () => CreateMJAIPromptInput)),
@@ -16727,8 +17264,8 @@ let MJEntity_ = class MJEntity_ {
16727
17264
  RecommendationItems_DestinationEntityIDArray;
16728
17265
  EntityCommunicationMessageTypes_EntityIDArray;
16729
17266
  QueryEntities_EntityIDArray;
16730
- MJ_AccessControlRules_EntityIDArray;
16731
17267
  MJ_RecordLinks_SourceEntityIDArray;
17268
+ MJ_AccessControlRules_EntityIDArray;
16732
17269
  GeneratedCodes_LinkedEntityIDArray;
16733
17270
  MJ_RecordLinks_TargetEntityIDArray;
16734
17271
  };
@@ -17159,14 +17696,14 @@ __decorate([
17159
17696
  Field(() => [MJQueryEntity_]),
17160
17697
  __metadata("design:type", Array)
17161
17698
  ], MJEntity_.prototype, "QueryEntities_EntityIDArray", void 0);
17162
- __decorate([
17163
- Field(() => [MJAccessControlRule_]),
17164
- __metadata("design:type", Array)
17165
- ], MJEntity_.prototype, "MJ_AccessControlRules_EntityIDArray", void 0);
17166
17699
  __decorate([
17167
17700
  Field(() => [MJRecordLink_]),
17168
17701
  __metadata("design:type", Array)
17169
17702
  ], MJEntity_.prototype, "MJ_RecordLinks_SourceEntityIDArray", void 0);
17703
+ __decorate([
17704
+ Field(() => [MJAccessControlRule_]),
17705
+ __metadata("design:type", Array)
17706
+ ], MJEntity_.prototype, "MJ_AccessControlRules_EntityIDArray", void 0);
17170
17707
  __decorate([
17171
17708
  Field(() => [MJGeneratedCode_]),
17172
17709
  __metadata("design:type", Array)
@@ -18123,22 +18660,22 @@ let MJEntityResolverBase = class MJEntityResolverBase extends ResolverBase {
18123
18660
  const result = this.ArrayMapFieldNamesToCodeNames('Query Entities', rows);
18124
18661
  return result;
18125
18662
  }
18126
- async MJ_AccessControlRules_EntityIDArray(mjentity_, { dataSources, userPayload, providers }, pubSub) {
18127
- this.CheckUserReadPermissions('MJ: Access Control Rules', userPayload);
18663
+ async MJ_RecordLinks_SourceEntityIDArray(mjentity_, { dataSources, userPayload, providers }, pubSub) {
18664
+ this.CheckUserReadPermissions('MJ: Record Links', userPayload);
18128
18665
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
18129
18666
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
18130
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAccessControlRules] WHERE [EntityID]='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Access Control Rules', userPayload, EntityPermissionType.Read, 'AND');
18667
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwRecordLinks] WHERE [SourceEntityID]='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Record Links', userPayload, EntityPermissionType.Read, 'AND');
18131
18668
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
18132
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Access Control Rules', rows);
18669
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Record Links', rows);
18133
18670
  return result;
18134
18671
  }
18135
- async MJ_RecordLinks_SourceEntityIDArray(mjentity_, { dataSources, userPayload, providers }, pubSub) {
18136
- this.CheckUserReadPermissions('MJ: Record Links', userPayload);
18672
+ async MJ_AccessControlRules_EntityIDArray(mjentity_, { dataSources, userPayload, providers }, pubSub) {
18673
+ this.CheckUserReadPermissions('MJ: Access Control Rules', userPayload);
18137
18674
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
18138
18675
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
18139
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwRecordLinks] WHERE [SourceEntityID]='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Record Links', userPayload, EntityPermissionType.Read, 'AND');
18676
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAccessControlRules] WHERE [EntityID]='${mjentity_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Access Control Rules', userPayload, EntityPermissionType.Read, 'AND');
18140
18677
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
18141
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Record Links', rows);
18678
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Access Control Rules', rows);
18142
18679
  return result;
18143
18680
  }
18144
18681
  async GeneratedCodes_LinkedEntityIDArray(mjentity_, { dataSources, userPayload, providers }, pubSub) {
@@ -18542,23 +19079,23 @@ __decorate([
18542
19079
  __metadata("design:returntype", Promise)
18543
19080
  ], MJEntityResolverBase.prototype, "QueryEntities_EntityIDArray", null);
18544
19081
  __decorate([
18545
- FieldResolver(() => [MJAccessControlRule_]),
19082
+ FieldResolver(() => [MJRecordLink_]),
18546
19083
  __param(0, Root()),
18547
19084
  __param(1, Ctx()),
18548
19085
  __param(2, PubSub()),
18549
19086
  __metadata("design:type", Function),
18550
19087
  __metadata("design:paramtypes", [MJEntity_, Object, PubSubEngine]),
18551
19088
  __metadata("design:returntype", Promise)
18552
- ], MJEntityResolverBase.prototype, "MJ_AccessControlRules_EntityIDArray", null);
19089
+ ], MJEntityResolverBase.prototype, "MJ_RecordLinks_SourceEntityIDArray", null);
18553
19090
  __decorate([
18554
- FieldResolver(() => [MJRecordLink_]),
19091
+ FieldResolver(() => [MJAccessControlRule_]),
18555
19092
  __param(0, Root()),
18556
19093
  __param(1, Ctx()),
18557
19094
  __param(2, PubSub()),
18558
19095
  __metadata("design:type", Function),
18559
19096
  __metadata("design:paramtypes", [MJEntity_, Object, PubSubEngine]),
18560
19097
  __metadata("design:returntype", Promise)
18561
- ], MJEntityResolverBase.prototype, "MJ_RecordLinks_SourceEntityIDArray", null);
19098
+ ], MJEntityResolverBase.prototype, "MJ_AccessControlRules_EntityIDArray", null);
18562
19099
  __decorate([
18563
19100
  FieldResolver(() => [MJGeneratedCode_]),
18564
19101
  __param(0, Root()),
@@ -18670,16 +19207,21 @@ let MJUser_ = class MJUser_ {
18670
19207
  MJ_DashboardUserStates_UserIDArray;
18671
19208
  MJ_ArtifactVersions_UserIDArray;
18672
19209
  MJ_PublicLinks_UserIDArray;
18673
- MJ_ScheduledJobs_NotifyUserIDArray;
18674
19210
  MJ_ScheduledJobRuns_ExecutedByUserIDArray;
19211
+ MJ_ScheduledJobs_NotifyUserIDArray;
19212
+ MJ_ArtifactPermissions_UserIDArray;
18675
19213
  ResourcePermissions_UserIDArray;
18676
19214
  AIAgentRequests_RequestForUserIDArray;
18677
19215
  ConversationDetails_UserIDArray;
18678
19216
  MJ_AccessControlRules_GrantedByUserIDArray;
18679
19217
  MJ_Artifacts_UserIDArray;
18680
19218
  MJ_ScheduledJobs_OwnerUserIDArray;
19219
+ MJ_CollectionPermissions_SharedByUserIDArray;
19220
+ MJ_ArtifactPermissions_SharedByUserIDArray;
18681
19221
  MJ_AIAgentRuns_UserIDArray;
18682
19222
  MJ_AIAgentPermissions_UserIDArray;
19223
+ MJ_Collections_OwnerIDArray;
19224
+ MJ_CollectionPermissions_UserIDArray;
18683
19225
  MJ_Tasks_UserIDArray;
18684
19226
  AIAgents_OwnerUserIDArray;
18685
19227
  };
@@ -18942,14 +19484,18 @@ __decorate([
18942
19484
  Field(() => [MJPublicLink_]),
18943
19485
  __metadata("design:type", Array)
18944
19486
  ], MJUser_.prototype, "MJ_PublicLinks_UserIDArray", void 0);
19487
+ __decorate([
19488
+ Field(() => [MJScheduledJobRun_]),
19489
+ __metadata("design:type", Array)
19490
+ ], MJUser_.prototype, "MJ_ScheduledJobRuns_ExecutedByUserIDArray", void 0);
18945
19491
  __decorate([
18946
19492
  Field(() => [MJScheduledJob_]),
18947
19493
  __metadata("design:type", Array)
18948
19494
  ], MJUser_.prototype, "MJ_ScheduledJobs_NotifyUserIDArray", void 0);
18949
19495
  __decorate([
18950
- Field(() => [MJScheduledJobRun_]),
19496
+ Field(() => [MJArtifactPermission_]),
18951
19497
  __metadata("design:type", Array)
18952
- ], MJUser_.prototype, "MJ_ScheduledJobRuns_ExecutedByUserIDArray", void 0);
19498
+ ], MJUser_.prototype, "MJ_ArtifactPermissions_UserIDArray", void 0);
18953
19499
  __decorate([
18954
19500
  Field(() => [MJResourcePermission_]),
18955
19501
  __metadata("design:type", Array)
@@ -18974,6 +19520,14 @@ __decorate([
18974
19520
  Field(() => [MJScheduledJob_]),
18975
19521
  __metadata("design:type", Array)
18976
19522
  ], MJUser_.prototype, "MJ_ScheduledJobs_OwnerUserIDArray", void 0);
19523
+ __decorate([
19524
+ Field(() => [MJCollectionPermission_]),
19525
+ __metadata("design:type", Array)
19526
+ ], MJUser_.prototype, "MJ_CollectionPermissions_SharedByUserIDArray", void 0);
19527
+ __decorate([
19528
+ Field(() => [MJArtifactPermission_]),
19529
+ __metadata("design:type", Array)
19530
+ ], MJUser_.prototype, "MJ_ArtifactPermissions_SharedByUserIDArray", void 0);
18977
19531
  __decorate([
18978
19532
  Field(() => [MJAIAgentRun_]),
18979
19533
  __metadata("design:type", Array)
@@ -18982,6 +19536,14 @@ __decorate([
18982
19536
  Field(() => [MJAIAgentPermission_]),
18983
19537
  __metadata("design:type", Array)
18984
19538
  ], MJUser_.prototype, "MJ_AIAgentPermissions_UserIDArray", void 0);
19539
+ __decorate([
19540
+ Field(() => [MJCollection_]),
19541
+ __metadata("design:type", Array)
19542
+ ], MJUser_.prototype, "MJ_Collections_OwnerIDArray", void 0);
19543
+ __decorate([
19544
+ Field(() => [MJCollectionPermission_]),
19545
+ __metadata("design:type", Array)
19546
+ ], MJUser_.prototype, "MJ_CollectionPermissions_UserIDArray", void 0);
18985
19547
  __decorate([
18986
19548
  Field(() => [MJTask_]),
18987
19549
  __metadata("design:type", Array)
@@ -19564,6 +20126,15 @@ let MJUserResolverBase = class MJUserResolverBase extends ResolverBase {
19564
20126
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: Public Links', rows);
19565
20127
  return result;
19566
20128
  }
20129
+ async MJ_ScheduledJobRuns_ExecutedByUserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
20130
+ this.CheckUserReadPermissions('MJ: Scheduled Job Runs', userPayload);
20131
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20132
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
20133
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwScheduledJobRuns] WHERE [ExecutedByUserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Job Runs', userPayload, EntityPermissionType.Read, 'AND');
20134
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
20135
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Job Runs', rows);
20136
+ return result;
20137
+ }
19567
20138
  async MJ_ScheduledJobs_NotifyUserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
19568
20139
  this.CheckUserReadPermissions('MJ: Scheduled Jobs', userPayload);
19569
20140
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
@@ -19573,13 +20144,13 @@ let MJUserResolverBase = class MJUserResolverBase extends ResolverBase {
19573
20144
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Jobs', rows);
19574
20145
  return result;
19575
20146
  }
19576
- async MJ_ScheduledJobRuns_ExecutedByUserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
19577
- this.CheckUserReadPermissions('MJ: Scheduled Job Runs', userPayload);
20147
+ async MJ_ArtifactPermissions_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
20148
+ this.CheckUserReadPermissions('MJ: Artifact Permissions', userPayload);
19578
20149
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
19579
20150
  const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
19580
- const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwScheduledJobRuns] WHERE [ExecutedByUserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Scheduled Job Runs', userPayload, EntityPermissionType.Read, 'AND');
20151
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwArtifactPermissions] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Artifact Permissions', userPayload, EntityPermissionType.Read, 'AND');
19581
20152
  const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
19582
- const result = this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Job Runs', rows);
20153
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Artifact Permissions', rows);
19583
20154
  return result;
19584
20155
  }
19585
20156
  async ResourcePermissions_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
@@ -19636,6 +20207,24 @@ let MJUserResolverBase = class MJUserResolverBase extends ResolverBase {
19636
20207
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: Scheduled Jobs', rows);
19637
20208
  return result;
19638
20209
  }
20210
+ async MJ_CollectionPermissions_SharedByUserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
20211
+ this.CheckUserReadPermissions('MJ: Collection Permissions', userPayload);
20212
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20213
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
20214
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollectionPermissions] WHERE [SharedByUserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collection Permissions', userPayload, EntityPermissionType.Read, 'AND');
20215
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
20216
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collection Permissions', rows);
20217
+ return result;
20218
+ }
20219
+ async MJ_ArtifactPermissions_SharedByUserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
20220
+ this.CheckUserReadPermissions('MJ: Artifact Permissions', userPayload);
20221
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20222
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
20223
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwArtifactPermissions] WHERE [SharedByUserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Artifact Permissions', userPayload, EntityPermissionType.Read, 'AND');
20224
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
20225
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Artifact Permissions', rows);
20226
+ return result;
20227
+ }
19639
20228
  async MJ_AIAgentRuns_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
19640
20229
  this.CheckUserReadPermissions('MJ: AI Agent Runs', userPayload);
19641
20230
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
@@ -19654,6 +20243,24 @@ let MJUserResolverBase = class MJUserResolverBase extends ResolverBase {
19654
20243
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Permissions', rows);
19655
20244
  return result;
19656
20245
  }
20246
+ async MJ_Collections_OwnerIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
20247
+ this.CheckUserReadPermissions('MJ: Collections', userPayload);
20248
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20249
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
20250
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollections] WHERE [OwnerID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collections', userPayload, EntityPermissionType.Read, 'AND');
20251
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
20252
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collections', rows);
20253
+ return result;
20254
+ }
20255
+ async MJ_CollectionPermissions_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
20256
+ this.CheckUserReadPermissions('MJ: Collection Permissions', userPayload);
20257
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
20258
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
20259
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollectionPermissions] WHERE [UserID]='${mjuser_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collection Permissions', userPayload, EntityPermissionType.Read, 'AND');
20260
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
20261
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collection Permissions', rows);
20262
+ return result;
20263
+ }
19657
20264
  async MJ_Tasks_UserIDArray(mjuser_, { dataSources, userPayload, providers }, pubSub) {
19658
20265
  this.CheckUserReadPermissions('MJ: Tasks', userPayload);
19659
20266
  const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
@@ -20090,6 +20697,15 @@ __decorate([
20090
20697
  __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20091
20698
  __metadata("design:returntype", Promise)
20092
20699
  ], MJUserResolverBase.prototype, "MJ_PublicLinks_UserIDArray", null);
20700
+ __decorate([
20701
+ FieldResolver(() => [MJScheduledJobRun_]),
20702
+ __param(0, Root()),
20703
+ __param(1, Ctx()),
20704
+ __param(2, PubSub()),
20705
+ __metadata("design:type", Function),
20706
+ __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20707
+ __metadata("design:returntype", Promise)
20708
+ ], MJUserResolverBase.prototype, "MJ_ScheduledJobRuns_ExecutedByUserIDArray", null);
20093
20709
  __decorate([
20094
20710
  FieldResolver(() => [MJScheduledJob_]),
20095
20711
  __param(0, Root()),
@@ -20100,14 +20716,14 @@ __decorate([
20100
20716
  __metadata("design:returntype", Promise)
20101
20717
  ], MJUserResolverBase.prototype, "MJ_ScheduledJobs_NotifyUserIDArray", null);
20102
20718
  __decorate([
20103
- FieldResolver(() => [MJScheduledJobRun_]),
20719
+ FieldResolver(() => [MJArtifactPermission_]),
20104
20720
  __param(0, Root()),
20105
20721
  __param(1, Ctx()),
20106
20722
  __param(2, PubSub()),
20107
20723
  __metadata("design:type", Function),
20108
20724
  __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20109
20725
  __metadata("design:returntype", Promise)
20110
- ], MJUserResolverBase.prototype, "MJ_ScheduledJobRuns_ExecutedByUserIDArray", null);
20726
+ ], MJUserResolverBase.prototype, "MJ_ArtifactPermissions_UserIDArray", null);
20111
20727
  __decorate([
20112
20728
  FieldResolver(() => [MJResourcePermission_]),
20113
20729
  __param(0, Root()),
@@ -20162,6 +20778,24 @@ __decorate([
20162
20778
  __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20163
20779
  __metadata("design:returntype", Promise)
20164
20780
  ], MJUserResolverBase.prototype, "MJ_ScheduledJobs_OwnerUserIDArray", null);
20781
+ __decorate([
20782
+ FieldResolver(() => [MJCollectionPermission_]),
20783
+ __param(0, Root()),
20784
+ __param(1, Ctx()),
20785
+ __param(2, PubSub()),
20786
+ __metadata("design:type", Function),
20787
+ __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20788
+ __metadata("design:returntype", Promise)
20789
+ ], MJUserResolverBase.prototype, "MJ_CollectionPermissions_SharedByUserIDArray", null);
20790
+ __decorate([
20791
+ FieldResolver(() => [MJArtifactPermission_]),
20792
+ __param(0, Root()),
20793
+ __param(1, Ctx()),
20794
+ __param(2, PubSub()),
20795
+ __metadata("design:type", Function),
20796
+ __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20797
+ __metadata("design:returntype", Promise)
20798
+ ], MJUserResolverBase.prototype, "MJ_ArtifactPermissions_SharedByUserIDArray", null);
20165
20799
  __decorate([
20166
20800
  FieldResolver(() => [MJAIAgentRun_]),
20167
20801
  __param(0, Root()),
@@ -20180,6 +20814,24 @@ __decorate([
20180
20814
  __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20181
20815
  __metadata("design:returntype", Promise)
20182
20816
  ], MJUserResolverBase.prototype, "MJ_AIAgentPermissions_UserIDArray", null);
20817
+ __decorate([
20818
+ FieldResolver(() => [MJCollection_]),
20819
+ __param(0, Root()),
20820
+ __param(1, Ctx()),
20821
+ __param(2, PubSub()),
20822
+ __metadata("design:type", Function),
20823
+ __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20824
+ __metadata("design:returntype", Promise)
20825
+ ], MJUserResolverBase.prototype, "MJ_Collections_OwnerIDArray", null);
20826
+ __decorate([
20827
+ FieldResolver(() => [MJCollectionPermission_]),
20828
+ __param(0, Root()),
20829
+ __param(1, Ctx()),
20830
+ __param(2, PubSub()),
20831
+ __metadata("design:type", Function),
20832
+ __metadata("design:paramtypes", [MJUser_, Object, PubSubEngine]),
20833
+ __metadata("design:returntype", Promise)
20834
+ ], MJUserResolverBase.prototype, "MJ_CollectionPermissions_UserIDArray", null);
20183
20835
  __decorate([
20184
20836
  FieldResolver(() => [MJTask_]),
20185
20837
  __param(0, Root()),
@@ -36983,6 +37635,7 @@ let MJConversationDetail_ = class MJConversationDetail_ {
36983
37635
  ParentID;
36984
37636
  AgentID;
36985
37637
  Status;
37638
+ SuggestedResponses;
36986
37639
  Conversation;
36987
37640
  User;
36988
37641
  Artifact;
@@ -37090,6 +37743,10 @@ __decorate([
37090
37743
  MaxLength(40),
37091
37744
  __metadata("design:type", String)
37092
37745
  ], MJConversationDetail_.prototype, "Status", void 0);
37746
+ __decorate([
37747
+ Field({ nullable: true, description: `JSON array of suggested responses that can be displayed to the user for quick replies. Each response object contains: text (display text), allowInput (boolean), iconClass (optional Font Awesome class), and data (optional payload).` }),
37748
+ __metadata("design:type", String)
37749
+ ], MJConversationDetail_.prototype, "SuggestedResponses", void 0);
37093
37750
  __decorate([
37094
37751
  Field({ nullable: true }),
37095
37752
  MaxLength(510),
@@ -37159,6 +37816,7 @@ let CreateMJConversationDetailInput = class CreateMJConversationDetailInput {
37159
37816
  ParentID;
37160
37817
  AgentID;
37161
37818
  Status;
37819
+ SuggestedResponses;
37162
37820
  };
37163
37821
  __decorate([
37164
37822
  Field({ nullable: true }),
@@ -37236,6 +37894,10 @@ __decorate([
37236
37894
  Field({ nullable: true }),
37237
37895
  __metadata("design:type", String)
37238
37896
  ], CreateMJConversationDetailInput.prototype, "Status", void 0);
37897
+ __decorate([
37898
+ Field({ nullable: true }),
37899
+ __metadata("design:type", String)
37900
+ ], CreateMJConversationDetailInput.prototype, "SuggestedResponses", void 0);
37239
37901
  CreateMJConversationDetailInput = __decorate([
37240
37902
  InputType()
37241
37903
  ], CreateMJConversationDetailInput);
@@ -37260,6 +37922,7 @@ let UpdateMJConversationDetailInput = class UpdateMJConversationDetailInput {
37260
37922
  ParentID;
37261
37923
  AgentID;
37262
37924
  Status;
37925
+ SuggestedResponses;
37263
37926
  OldValues___;
37264
37927
  };
37265
37928
  __decorate([
@@ -37338,6 +38001,10 @@ __decorate([
37338
38001
  Field({ nullable: true }),
37339
38002
  __metadata("design:type", String)
37340
38003
  ], UpdateMJConversationDetailInput.prototype, "Status", void 0);
38004
+ __decorate([
38005
+ Field({ nullable: true }),
38006
+ __metadata("design:type", String)
38007
+ ], UpdateMJConversationDetailInput.prototype, "SuggestedResponses", void 0);
37341
38008
  __decorate([
37342
38009
  Field(() => [KeyValuePairInput], { nullable: true }),
37343
38010
  __metadata("design:type", Array)
@@ -49783,9 +50450,11 @@ let MJAction_ = class MJAction_ {
49783
50450
  DriverClass;
49784
50451
  ParentID;
49785
50452
  IconClass;
50453
+ DefaultCompactPromptID;
49786
50454
  Category;
49787
50455
  CodeApprovedByUser;
49788
50456
  Parent;
50457
+ DefaultCompactPrompt;
49789
50458
  RootParentID;
49790
50459
  ActionParams_ActionIDArray;
49791
50460
  ActionLibraries_ActionIDArray;
@@ -49900,6 +50569,11 @@ __decorate([
49900
50569
  MaxLength(200),
49901
50570
  __metadata("design:type", String)
49902
50571
  ], MJAction_.prototype, "IconClass", void 0);
50572
+ __decorate([
50573
+ Field({ nullable: true, description: `Default prompt for compacting/summarizing this action's results when used by agents with CompactMode=AISummary. Action designers define how their specific results should be summarized. Can be overridden per agent in AIAgentAction.CompactPromptID.` }),
50574
+ MaxLength(16),
50575
+ __metadata("design:type", String)
50576
+ ], MJAction_.prototype, "DefaultCompactPromptID", void 0);
49903
50577
  __decorate([
49904
50578
  Field({ nullable: true }),
49905
50579
  MaxLength(510),
@@ -49915,6 +50589,11 @@ __decorate([
49915
50589
  MaxLength(850),
49916
50590
  __metadata("design:type", String)
49917
50591
  ], MJAction_.prototype, "Parent", void 0);
50592
+ __decorate([
50593
+ Field({ nullable: true }),
50594
+ MaxLength(510),
50595
+ __metadata("design:type", String)
50596
+ ], MJAction_.prototype, "DefaultCompactPrompt", void 0);
49918
50597
  __decorate([
49919
50598
  Field({ nullable: true }),
49920
50599
  MaxLength(16),
@@ -49989,6 +50668,7 @@ let CreateMJActionInput = class CreateMJActionInput {
49989
50668
  DriverClass;
49990
50669
  ParentID;
49991
50670
  IconClass;
50671
+ DefaultCompactPromptID;
49992
50672
  };
49993
50673
  __decorate([
49994
50674
  Field({ nullable: true }),
@@ -50070,6 +50750,10 @@ __decorate([
50070
50750
  Field({ nullable: true }),
50071
50751
  __metadata("design:type", String)
50072
50752
  ], CreateMJActionInput.prototype, "IconClass", void 0);
50753
+ __decorate([
50754
+ Field({ nullable: true }),
50755
+ __metadata("design:type", String)
50756
+ ], CreateMJActionInput.prototype, "DefaultCompactPromptID", void 0);
50073
50757
  CreateMJActionInput = __decorate([
50074
50758
  InputType()
50075
50759
  ], CreateMJActionInput);
@@ -50095,6 +50779,7 @@ let UpdateMJActionInput = class UpdateMJActionInput {
50095
50779
  DriverClass;
50096
50780
  ParentID;
50097
50781
  IconClass;
50782
+ DefaultCompactPromptID;
50098
50783
  OldValues___;
50099
50784
  };
50100
50785
  __decorate([
@@ -50177,6 +50862,10 @@ __decorate([
50177
50862
  Field({ nullable: true }),
50178
50863
  __metadata("design:type", String)
50179
50864
  ], UpdateMJActionInput.prototype, "IconClass", void 0);
50865
+ __decorate([
50866
+ Field({ nullable: true }),
50867
+ __metadata("design:type", String)
50868
+ ], UpdateMJActionInput.prototype, "DefaultCompactPromptID", void 0);
50180
50869
  __decorate([
50181
50870
  Field(() => [KeyValuePairInput], { nullable: true }),
50182
50871
  __metadata("design:type", Array)
@@ -65094,6 +65783,7 @@ let MJArtifact_ = class MJArtifact_ {
65094
65783
  User;
65095
65784
  MJ_ArtifactVersions_ArtifactIDArray;
65096
65785
  MJ_CollectionArtifacts_ArtifactIDArray;
65786
+ MJ_ArtifactPermissions_ArtifactIDArray;
65097
65787
  };
65098
65788
  __decorate([
65099
65789
  Field(),
@@ -65161,6 +65851,10 @@ __decorate([
65161
65851
  Field(() => [MJCollectionArtifact_]),
65162
65852
  __metadata("design:type", Array)
65163
65853
  ], MJArtifact_.prototype, "MJ_CollectionArtifacts_ArtifactIDArray", void 0);
65854
+ __decorate([
65855
+ Field(() => [MJArtifactPermission_]),
65856
+ __metadata("design:type", Array)
65857
+ ], MJArtifact_.prototype, "MJ_ArtifactPermissions_ArtifactIDArray", void 0);
65164
65858
  MJArtifact_ = __decorate([
65165
65859
  ObjectType({ description: `Independent content items (code, documents, charts) that can be linked to multiple conversations and collections. Supports versioning and sharing.` })
65166
65860
  ], MJArtifact_);
@@ -65334,6 +66028,15 @@ let MJArtifactResolver = class MJArtifactResolver extends ResolverBase {
65334
66028
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: Collection Artifacts', rows);
65335
66029
  return result;
65336
66030
  }
66031
+ async MJ_ArtifactPermissions_ArtifactIDArray(mjartifact_, { dataSources, userPayload, providers }, pubSub) {
66032
+ this.CheckUserReadPermissions('MJ: Artifact Permissions', userPayload);
66033
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
66034
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
66035
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwArtifactPermissions] WHERE [ArtifactID]='${mjartifact_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Artifact Permissions', userPayload, EntityPermissionType.Read, 'AND');
66036
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
66037
+ const result = this.ArrayMapFieldNamesToCodeNames('MJ: Artifact Permissions', rows);
66038
+ return result;
66039
+ }
65337
66040
  async CreateMJArtifact(input, { providers, userPayload }, pubSub) {
65338
66041
  const provider = GetReadWriteProvider(providers);
65339
66042
  return this.CreateRecord('MJ: Artifacts', input, provider, userPayload, pubSub);
@@ -65402,6 +66105,15 @@ __decorate([
65402
66105
  __metadata("design:paramtypes", [MJArtifact_, Object, PubSubEngine]),
65403
66106
  __metadata("design:returntype", Promise)
65404
66107
  ], MJArtifactResolver.prototype, "MJ_CollectionArtifacts_ArtifactIDArray", null);
66108
+ __decorate([
66109
+ FieldResolver(() => [MJArtifactPermission_]),
66110
+ __param(0, Root()),
66111
+ __param(1, Ctx()),
66112
+ __param(2, PubSub()),
66113
+ __metadata("design:type", Function),
66114
+ __metadata("design:paramtypes", [MJArtifact_, Object, PubSubEngine]),
66115
+ __metadata("design:returntype", Promise)
66116
+ ], MJArtifactResolver.prototype, "MJ_ArtifactPermissions_ArtifactIDArray", null);
65405
66117
  __decorate([
65406
66118
  Mutation(() => MJArtifact_),
65407
66119
  __param(0, Arg('input', () => CreateMJArtifactInput)),
@@ -65806,6 +66518,329 @@ MJConversationArtifactResolver = __decorate([
65806
66518
  Resolver(MJConversationArtifact_)
65807
66519
  ], MJConversationArtifactResolver);
65808
66520
  export { MJConversationArtifactResolver };
66521
+ let MJCollectionPermission_ = class MJCollectionPermission_ {
66522
+ ID;
66523
+ CollectionID;
66524
+ UserID;
66525
+ CanRead;
66526
+ CanShare;
66527
+ CanEdit;
66528
+ CanDelete;
66529
+ SharedByUserID;
66530
+ _mj__CreatedAt;
66531
+ _mj__UpdatedAt;
66532
+ Collection;
66533
+ User;
66534
+ SharedByUser;
66535
+ };
66536
+ __decorate([
66537
+ Field(),
66538
+ MaxLength(16),
66539
+ __metadata("design:type", String)
66540
+ ], MJCollectionPermission_.prototype, "ID", void 0);
66541
+ __decorate([
66542
+ Field(),
66543
+ MaxLength(16),
66544
+ __metadata("design:type", String)
66545
+ ], MJCollectionPermission_.prototype, "CollectionID", void 0);
66546
+ __decorate([
66547
+ Field(),
66548
+ MaxLength(16),
66549
+ __metadata("design:type", String)
66550
+ ], MJCollectionPermission_.prototype, "UserID", void 0);
66551
+ __decorate([
66552
+ Field(() => Boolean, { description: `Always 1 - users must have read permission to access a shared collection` }),
66553
+ __metadata("design:type", Boolean)
66554
+ ], MJCollectionPermission_.prototype, "CanRead", void 0);
66555
+ __decorate([
66556
+ Field(() => Boolean, { description: `Can share this collection with others (but cannot grant more permissions than they have)` }),
66557
+ __metadata("design:type", Boolean)
66558
+ ], MJCollectionPermission_.prototype, "CanShare", void 0);
66559
+ __decorate([
66560
+ Field(() => Boolean, { description: `Can add/remove artifacts to/from this collection` }),
66561
+ __metadata("design:type", Boolean)
66562
+ ], MJCollectionPermission_.prototype, "CanEdit", void 0);
66563
+ __decorate([
66564
+ Field(() => Boolean, { description: `Can delete the collection, child collections, and artifacts` }),
66565
+ __metadata("design:type", Boolean)
66566
+ ], MJCollectionPermission_.prototype, "CanDelete", void 0);
66567
+ __decorate([
66568
+ Field({ nullable: true, description: `The user who shared this collection (NULL if shared by owner)` }),
66569
+ MaxLength(16),
66570
+ __metadata("design:type", String)
66571
+ ], MJCollectionPermission_.prototype, "SharedByUserID", void 0);
66572
+ __decorate([
66573
+ Field(),
66574
+ MaxLength(10),
66575
+ __metadata("design:type", Date)
66576
+ ], MJCollectionPermission_.prototype, "_mj__CreatedAt", void 0);
66577
+ __decorate([
66578
+ Field(),
66579
+ MaxLength(10),
66580
+ __metadata("design:type", Date)
66581
+ ], MJCollectionPermission_.prototype, "_mj__UpdatedAt", void 0);
66582
+ __decorate([
66583
+ Field(),
66584
+ MaxLength(510),
66585
+ __metadata("design:type", String)
66586
+ ], MJCollectionPermission_.prototype, "Collection", void 0);
66587
+ __decorate([
66588
+ Field(),
66589
+ MaxLength(200),
66590
+ __metadata("design:type", String)
66591
+ ], MJCollectionPermission_.prototype, "User", void 0);
66592
+ __decorate([
66593
+ Field({ nullable: true }),
66594
+ MaxLength(200),
66595
+ __metadata("design:type", String)
66596
+ ], MJCollectionPermission_.prototype, "SharedByUser", void 0);
66597
+ MJCollectionPermission_ = __decorate([
66598
+ ObjectType({ description: `Manages sharing permissions for collections, allowing granular access control` })
66599
+ ], MJCollectionPermission_);
66600
+ export { MJCollectionPermission_ };
66601
+ let CreateMJCollectionPermissionInput = class CreateMJCollectionPermissionInput {
66602
+ ID;
66603
+ CollectionID;
66604
+ UserID;
66605
+ CanRead;
66606
+ CanShare;
66607
+ CanEdit;
66608
+ CanDelete;
66609
+ SharedByUserID;
66610
+ };
66611
+ __decorate([
66612
+ Field({ nullable: true }),
66613
+ __metadata("design:type", String)
66614
+ ], CreateMJCollectionPermissionInput.prototype, "ID", void 0);
66615
+ __decorate([
66616
+ Field({ nullable: true }),
66617
+ __metadata("design:type", String)
66618
+ ], CreateMJCollectionPermissionInput.prototype, "CollectionID", void 0);
66619
+ __decorate([
66620
+ Field({ nullable: true }),
66621
+ __metadata("design:type", String)
66622
+ ], CreateMJCollectionPermissionInput.prototype, "UserID", void 0);
66623
+ __decorate([
66624
+ Field(() => Boolean, { nullable: true }),
66625
+ __metadata("design:type", Boolean)
66626
+ ], CreateMJCollectionPermissionInput.prototype, "CanRead", void 0);
66627
+ __decorate([
66628
+ Field(() => Boolean, { nullable: true }),
66629
+ __metadata("design:type", Boolean)
66630
+ ], CreateMJCollectionPermissionInput.prototype, "CanShare", void 0);
66631
+ __decorate([
66632
+ Field(() => Boolean, { nullable: true }),
66633
+ __metadata("design:type", Boolean)
66634
+ ], CreateMJCollectionPermissionInput.prototype, "CanEdit", void 0);
66635
+ __decorate([
66636
+ Field(() => Boolean, { nullable: true }),
66637
+ __metadata("design:type", Boolean)
66638
+ ], CreateMJCollectionPermissionInput.prototype, "CanDelete", void 0);
66639
+ __decorate([
66640
+ Field({ nullable: true }),
66641
+ __metadata("design:type", String)
66642
+ ], CreateMJCollectionPermissionInput.prototype, "SharedByUserID", void 0);
66643
+ CreateMJCollectionPermissionInput = __decorate([
66644
+ InputType()
66645
+ ], CreateMJCollectionPermissionInput);
66646
+ export { CreateMJCollectionPermissionInput };
66647
+ let UpdateMJCollectionPermissionInput = class UpdateMJCollectionPermissionInput {
66648
+ ID;
66649
+ CollectionID;
66650
+ UserID;
66651
+ CanRead;
66652
+ CanShare;
66653
+ CanEdit;
66654
+ CanDelete;
66655
+ SharedByUserID;
66656
+ OldValues___;
66657
+ };
66658
+ __decorate([
66659
+ Field(),
66660
+ __metadata("design:type", String)
66661
+ ], UpdateMJCollectionPermissionInput.prototype, "ID", void 0);
66662
+ __decorate([
66663
+ Field({ nullable: true }),
66664
+ __metadata("design:type", String)
66665
+ ], UpdateMJCollectionPermissionInput.prototype, "CollectionID", void 0);
66666
+ __decorate([
66667
+ Field({ nullable: true }),
66668
+ __metadata("design:type", String)
66669
+ ], UpdateMJCollectionPermissionInput.prototype, "UserID", void 0);
66670
+ __decorate([
66671
+ Field(() => Boolean, { nullable: true }),
66672
+ __metadata("design:type", Boolean)
66673
+ ], UpdateMJCollectionPermissionInput.prototype, "CanRead", void 0);
66674
+ __decorate([
66675
+ Field(() => Boolean, { nullable: true }),
66676
+ __metadata("design:type", Boolean)
66677
+ ], UpdateMJCollectionPermissionInput.prototype, "CanShare", void 0);
66678
+ __decorate([
66679
+ Field(() => Boolean, { nullable: true }),
66680
+ __metadata("design:type", Boolean)
66681
+ ], UpdateMJCollectionPermissionInput.prototype, "CanEdit", void 0);
66682
+ __decorate([
66683
+ Field(() => Boolean, { nullable: true }),
66684
+ __metadata("design:type", Boolean)
66685
+ ], UpdateMJCollectionPermissionInput.prototype, "CanDelete", void 0);
66686
+ __decorate([
66687
+ Field({ nullable: true }),
66688
+ __metadata("design:type", String)
66689
+ ], UpdateMJCollectionPermissionInput.prototype, "SharedByUserID", void 0);
66690
+ __decorate([
66691
+ Field(() => [KeyValuePairInput], { nullable: true }),
66692
+ __metadata("design:type", Array)
66693
+ ], UpdateMJCollectionPermissionInput.prototype, "OldValues___", void 0);
66694
+ UpdateMJCollectionPermissionInput = __decorate([
66695
+ InputType()
66696
+ ], UpdateMJCollectionPermissionInput);
66697
+ export { UpdateMJCollectionPermissionInput };
66698
+ let RunMJCollectionPermissionViewResult = class RunMJCollectionPermissionViewResult {
66699
+ Results;
66700
+ UserViewRunID;
66701
+ RowCount;
66702
+ TotalRowCount;
66703
+ ExecutionTime;
66704
+ ErrorMessage;
66705
+ Success;
66706
+ };
66707
+ __decorate([
66708
+ Field(() => [MJCollectionPermission_]),
66709
+ __metadata("design:type", Array)
66710
+ ], RunMJCollectionPermissionViewResult.prototype, "Results", void 0);
66711
+ __decorate([
66712
+ Field(() => String, { nullable: true }),
66713
+ __metadata("design:type", String)
66714
+ ], RunMJCollectionPermissionViewResult.prototype, "UserViewRunID", void 0);
66715
+ __decorate([
66716
+ Field(() => Int, { nullable: true }),
66717
+ __metadata("design:type", Number)
66718
+ ], RunMJCollectionPermissionViewResult.prototype, "RowCount", void 0);
66719
+ __decorate([
66720
+ Field(() => Int, { nullable: true }),
66721
+ __metadata("design:type", Number)
66722
+ ], RunMJCollectionPermissionViewResult.prototype, "TotalRowCount", void 0);
66723
+ __decorate([
66724
+ Field(() => Int, { nullable: true }),
66725
+ __metadata("design:type", Number)
66726
+ ], RunMJCollectionPermissionViewResult.prototype, "ExecutionTime", void 0);
66727
+ __decorate([
66728
+ Field({ nullable: true }),
66729
+ __metadata("design:type", String)
66730
+ ], RunMJCollectionPermissionViewResult.prototype, "ErrorMessage", void 0);
66731
+ __decorate([
66732
+ Field(() => Boolean, { nullable: false }),
66733
+ __metadata("design:type", Boolean)
66734
+ ], RunMJCollectionPermissionViewResult.prototype, "Success", void 0);
66735
+ RunMJCollectionPermissionViewResult = __decorate([
66736
+ ObjectType()
66737
+ ], RunMJCollectionPermissionViewResult);
66738
+ export { RunMJCollectionPermissionViewResult };
66739
+ let MJCollectionPermissionResolver = class MJCollectionPermissionResolver extends ResolverBase {
66740
+ async RunMJCollectionPermissionViewByID(input, { providers, userPayload }, pubSub) {
66741
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
66742
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
66743
+ }
66744
+ async RunMJCollectionPermissionViewByName(input, { providers, userPayload }, pubSub) {
66745
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
66746
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
66747
+ }
66748
+ async RunMJCollectionPermissionDynamicView(input, { providers, userPayload }, pubSub) {
66749
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
66750
+ input.EntityName = 'MJ: Collection Permissions';
66751
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
66752
+ }
66753
+ async MJCollectionPermission(ID, { dataSources, userPayload, providers }, pubSub) {
66754
+ this.CheckUserReadPermissions('MJ: Collection Permissions', userPayload);
66755
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
66756
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
66757
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwCollectionPermissions] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: Collection Permissions', userPayload, EntityPermissionType.Read, 'AND');
66758
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
66759
+ const result = this.MapFieldNamesToCodeNames('MJ: Collection Permissions', rows && rows.length > 0 ? rows[0] : {});
66760
+ return result;
66761
+ }
66762
+ async CreateMJCollectionPermission(input, { providers, userPayload }, pubSub) {
66763
+ const provider = GetReadWriteProvider(providers);
66764
+ return this.CreateRecord('MJ: Collection Permissions', input, provider, userPayload, pubSub);
66765
+ }
66766
+ async UpdateMJCollectionPermission(input, { providers, userPayload }, pubSub) {
66767
+ const provider = GetReadWriteProvider(providers);
66768
+ return this.UpdateRecord('MJ: Collection Permissions', input, provider, userPayload, pubSub);
66769
+ }
66770
+ async DeleteMJCollectionPermission(ID, options, { providers, userPayload }, pubSub) {
66771
+ const provider = GetReadWriteProvider(providers);
66772
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
66773
+ return this.DeleteRecord('MJ: Collection Permissions', key, options, provider, userPayload, pubSub);
66774
+ }
66775
+ };
66776
+ __decorate([
66777
+ Query(() => RunMJCollectionPermissionViewResult),
66778
+ __param(0, Arg('input', () => RunViewByIDInput)),
66779
+ __param(1, Ctx()),
66780
+ __param(2, PubSub()),
66781
+ __metadata("design:type", Function),
66782
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
66783
+ __metadata("design:returntype", Promise)
66784
+ ], MJCollectionPermissionResolver.prototype, "RunMJCollectionPermissionViewByID", null);
66785
+ __decorate([
66786
+ Query(() => RunMJCollectionPermissionViewResult),
66787
+ __param(0, Arg('input', () => RunViewByNameInput)),
66788
+ __param(1, Ctx()),
66789
+ __param(2, PubSub()),
66790
+ __metadata("design:type", Function),
66791
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
66792
+ __metadata("design:returntype", Promise)
66793
+ ], MJCollectionPermissionResolver.prototype, "RunMJCollectionPermissionViewByName", null);
66794
+ __decorate([
66795
+ Query(() => RunMJCollectionPermissionViewResult),
66796
+ __param(0, Arg('input', () => RunDynamicViewInput)),
66797
+ __param(1, Ctx()),
66798
+ __param(2, PubSub()),
66799
+ __metadata("design:type", Function),
66800
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
66801
+ __metadata("design:returntype", Promise)
66802
+ ], MJCollectionPermissionResolver.prototype, "RunMJCollectionPermissionDynamicView", null);
66803
+ __decorate([
66804
+ Query(() => MJCollectionPermission_, { nullable: true }),
66805
+ __param(0, Arg('ID', () => String)),
66806
+ __param(1, Ctx()),
66807
+ __param(2, PubSub()),
66808
+ __metadata("design:type", Function),
66809
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
66810
+ __metadata("design:returntype", Promise)
66811
+ ], MJCollectionPermissionResolver.prototype, "MJCollectionPermission", null);
66812
+ __decorate([
66813
+ Mutation(() => MJCollectionPermission_),
66814
+ __param(0, Arg('input', () => CreateMJCollectionPermissionInput)),
66815
+ __param(1, Ctx()),
66816
+ __param(2, PubSub()),
66817
+ __metadata("design:type", Function),
66818
+ __metadata("design:paramtypes", [CreateMJCollectionPermissionInput, Object, PubSubEngine]),
66819
+ __metadata("design:returntype", Promise)
66820
+ ], MJCollectionPermissionResolver.prototype, "CreateMJCollectionPermission", null);
66821
+ __decorate([
66822
+ Mutation(() => MJCollectionPermission_),
66823
+ __param(0, Arg('input', () => UpdateMJCollectionPermissionInput)),
66824
+ __param(1, Ctx()),
66825
+ __param(2, PubSub()),
66826
+ __metadata("design:type", Function),
66827
+ __metadata("design:paramtypes", [UpdateMJCollectionPermissionInput, Object, PubSubEngine]),
66828
+ __metadata("design:returntype", Promise)
66829
+ ], MJCollectionPermissionResolver.prototype, "UpdateMJCollectionPermission", null);
66830
+ __decorate([
66831
+ Mutation(() => MJCollectionPermission_),
66832
+ __param(0, Arg('ID', () => String)),
66833
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
66834
+ __param(2, Ctx()),
66835
+ __param(3, PubSub()),
66836
+ __metadata("design:type", Function),
66837
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
66838
+ __metadata("design:returntype", Promise)
66839
+ ], MJCollectionPermissionResolver.prototype, "DeleteMJCollectionPermission", null);
66840
+ MJCollectionPermissionResolver = __decorate([
66841
+ Resolver(MJCollectionPermission_)
66842
+ ], MJCollectionPermissionResolver);
66843
+ export { MJCollectionPermissionResolver };
65809
66844
  let MJAIAgentPrompt_ = class MJAIAgentPrompt_ {
65810
66845
  ID;
65811
66846
  AgentID;
@@ -67866,6 +68901,8 @@ let MJAIAgentRelationship_ = class MJAIAgentRelationship_ {
67866
68901
  _mj__CreatedAt;
67867
68902
  _mj__UpdatedAt;
67868
68903
  SubAgentOutputMapping;
68904
+ SubAgentInputMapping;
68905
+ SubAgentContextPaths;
67869
68906
  Agent;
67870
68907
  SubAgent;
67871
68908
  };
@@ -67903,6 +68940,14 @@ __decorate([
67903
68940
  Field({ nullable: true, description: `JSON configuration mapping sub-agent result payload paths to parent agent payload paths. Enables controlled merging of sub-agent results. Format: {"subAgentPath": "parentPath", "*": "captureAllPath"}. If null, sub-agent results are not automatically merged into parent payload.` }),
67904
68941
  __metadata("design:type", String)
67905
68942
  ], MJAIAgentRelationship_.prototype, "SubAgentOutputMapping", void 0);
68943
+ __decorate([
68944
+ Field({ nullable: true, description: `JSON mapping of parent payload paths to sub-agent initial payload paths. Enables structural data transfer from parent to related sub-agent. Format: {"parentPath": "subAgentPath", "parent.nested": "subAgent.field"}. Example: {"searchQuery": "query", "maxResults": "limit"}. If null, sub-agent starts with empty payload (default behavior).` }),
68945
+ __metadata("design:type", String)
68946
+ ], MJAIAgentRelationship_.prototype, "SubAgentInputMapping", void 0);
68947
+ __decorate([
68948
+ Field({ nullable: true, description: `JSON array of parent payload paths to send as LLM context to related sub-agent. Sub-agent receives this data in a formatted context message before its task message. Format: ["path1", "path2.nested", "path3.*", "*"]. Use "*" to send entire parent payload. Example: ["userPreferences", "priorFindings.summary", "sources[*]"]. If null, no parent context is sent (default behavior).` }),
68949
+ __metadata("design:type", String)
68950
+ ], MJAIAgentRelationship_.prototype, "SubAgentContextPaths", void 0);
67906
68951
  __decorate([
67907
68952
  Field({ nullable: true }),
67908
68953
  MaxLength(510),
@@ -67923,6 +68968,8 @@ let CreateMJAIAgentRelationshipInput = class CreateMJAIAgentRelationshipInput {
67923
68968
  SubAgentID;
67924
68969
  Status;
67925
68970
  SubAgentOutputMapping;
68971
+ SubAgentInputMapping;
68972
+ SubAgentContextPaths;
67926
68973
  };
67927
68974
  __decorate([
67928
68975
  Field({ nullable: true }),
@@ -67944,6 +68991,14 @@ __decorate([
67944
68991
  Field({ nullable: true }),
67945
68992
  __metadata("design:type", String)
67946
68993
  ], CreateMJAIAgentRelationshipInput.prototype, "SubAgentOutputMapping", void 0);
68994
+ __decorate([
68995
+ Field({ nullable: true }),
68996
+ __metadata("design:type", String)
68997
+ ], CreateMJAIAgentRelationshipInput.prototype, "SubAgentInputMapping", void 0);
68998
+ __decorate([
68999
+ Field({ nullable: true }),
69000
+ __metadata("design:type", String)
69001
+ ], CreateMJAIAgentRelationshipInput.prototype, "SubAgentContextPaths", void 0);
67947
69002
  CreateMJAIAgentRelationshipInput = __decorate([
67948
69003
  InputType()
67949
69004
  ], CreateMJAIAgentRelationshipInput);
@@ -67954,6 +69009,8 @@ let UpdateMJAIAgentRelationshipInput = class UpdateMJAIAgentRelationshipInput {
67954
69009
  SubAgentID;
67955
69010
  Status;
67956
69011
  SubAgentOutputMapping;
69012
+ SubAgentInputMapping;
69013
+ SubAgentContextPaths;
67957
69014
  OldValues___;
67958
69015
  };
67959
69016
  __decorate([
@@ -67976,6 +69033,14 @@ __decorate([
67976
69033
  Field({ nullable: true }),
67977
69034
  __metadata("design:type", String)
67978
69035
  ], UpdateMJAIAgentRelationshipInput.prototype, "SubAgentOutputMapping", void 0);
69036
+ __decorate([
69037
+ Field({ nullable: true }),
69038
+ __metadata("design:type", String)
69039
+ ], UpdateMJAIAgentRelationshipInput.prototype, "SubAgentInputMapping", void 0);
69040
+ __decorate([
69041
+ Field({ nullable: true }),
69042
+ __metadata("design:type", String)
69043
+ ], UpdateMJAIAgentRelationshipInput.prototype, "SubAgentContextPaths", void 0);
67979
69044
  __decorate([
67980
69045
  Field(() => [KeyValuePairInput], { nullable: true }),
67981
69046
  __metadata("design:type", Array)
@@ -78185,4 +79250,504 @@ MJArtifactVersionAttributeResolver = __decorate([
78185
79250
  Resolver(MJArtifactVersionAttribute_)
78186
79251
  ], MJArtifactVersionAttributeResolver);
78187
79252
  export { MJArtifactVersionAttributeResolver };
79253
+ let MJAIAgentDataSource_ = class MJAIAgentDataSource_ {
79254
+ ID;
79255
+ AgentID;
79256
+ Name;
79257
+ Description;
79258
+ SourceType;
79259
+ EntityName;
79260
+ ExtraFilter;
79261
+ OrderBy;
79262
+ FieldsToRetrieve;
79263
+ ResultType;
79264
+ QueryName;
79265
+ CategoryPath;
79266
+ Parameters;
79267
+ MaxRows;
79268
+ ExecutionOrder;
79269
+ Status;
79270
+ CachePolicy;
79271
+ CacheTimeoutSeconds;
79272
+ DestinationType;
79273
+ DestinationPath;
79274
+ _mj__CreatedAt;
79275
+ _mj__UpdatedAt;
79276
+ Agent;
79277
+ };
79278
+ __decorate([
79279
+ Field(),
79280
+ MaxLength(16),
79281
+ __metadata("design:type", String)
79282
+ ], MJAIAgentDataSource_.prototype, "ID", void 0);
79283
+ __decorate([
79284
+ Field(),
79285
+ MaxLength(16),
79286
+ __metadata("design:type", String)
79287
+ ], MJAIAgentDataSource_.prototype, "AgentID", void 0);
79288
+ __decorate([
79289
+ Field({ description: `Variable name for the data in the data parameter (e.g., "ALL_ENTITIES"). Must be unique within an agent.` }),
79290
+ MaxLength(510),
79291
+ __metadata("design:type", String)
79292
+ ], MJAIAgentDataSource_.prototype, "Name", void 0);
79293
+ __decorate([
79294
+ Field({ nullable: true, description: `Description of what this data source provides` }),
79295
+ __metadata("design:type", String)
79296
+ ], MJAIAgentDataSource_.prototype, "Description", void 0);
79297
+ __decorate([
79298
+ Field({ description: `Type of data source: RunView or RunQuery. Determines which parameters are used.` }),
79299
+ MaxLength(40),
79300
+ __metadata("design:type", String)
79301
+ ], MJAIAgentDataSource_.prototype, "SourceType", void 0);
79302
+ __decorate([
79303
+ Field({ nullable: true, description: `Entity name for RunView data sources (e.g., "Entities", "AI Models")` }),
79304
+ MaxLength(510),
79305
+ __metadata("design:type", String)
79306
+ ], MJAIAgentDataSource_.prototype, "EntityName", void 0);
79307
+ __decorate([
79308
+ Field({ nullable: true, description: `SQL WHERE clause filter for RunView data sources` }),
79309
+ __metadata("design:type", String)
79310
+ ], MJAIAgentDataSource_.prototype, "ExtraFilter", void 0);
79311
+ __decorate([
79312
+ Field({ nullable: true, description: `SQL ORDER BY clause for RunView data sources` }),
79313
+ MaxLength(1000),
79314
+ __metadata("design:type", String)
79315
+ ], MJAIAgentDataSource_.prototype, "OrderBy", void 0);
79316
+ __decorate([
79317
+ Field({ nullable: true, description: `JSON array of field names to return for RunView data sources (e.g., ["ID", "Name", "Description"])` }),
79318
+ __metadata("design:type", String)
79319
+ ], MJAIAgentDataSource_.prototype, "FieldsToRetrieve", void 0);
79320
+ __decorate([
79321
+ Field({ nullable: true, description: `Result type for RunView: simple (default) or entity_object` }),
79322
+ MaxLength(40),
79323
+ __metadata("design:type", String)
79324
+ ], MJAIAgentDataSource_.prototype, "ResultType", void 0);
79325
+ __decorate([
79326
+ Field({ nullable: true, description: `Query name for RunQuery data sources` }),
79327
+ MaxLength(510),
79328
+ __metadata("design:type", String)
79329
+ ], MJAIAgentDataSource_.prototype, "QueryName", void 0);
79330
+ __decorate([
79331
+ Field({ nullable: true, description: `Category path for RunQuery data sources (e.g., "/MJ/AI/Agents/")` }),
79332
+ MaxLength(1000),
79333
+ __metadata("design:type", String)
79334
+ ], MJAIAgentDataSource_.prototype, "CategoryPath", void 0);
79335
+ __decorate([
79336
+ Field({ nullable: true, description: `JSON object of parameters for RunQuery data sources (e.g., {"organizationId": "123"})` }),
79337
+ __metadata("design:type", String)
79338
+ ], MJAIAgentDataSource_.prototype, "Parameters", void 0);
79339
+ __decorate([
79340
+ Field(() => Int, { nullable: true, description: `Maximum number of rows to return. Applies to both RunView and RunQuery.` }),
79341
+ __metadata("design:type", Number)
79342
+ ], MJAIAgentDataSource_.prototype, "MaxRows", void 0);
79343
+ __decorate([
79344
+ Field(() => Int, { description: `Execution order when multiple data sources are defined for an agent (lower numbers execute first)` }),
79345
+ __metadata("design:type", Number)
79346
+ ], MJAIAgentDataSource_.prototype, "ExecutionOrder", void 0);
79347
+ __decorate([
79348
+ Field({ description: `Status of the data source: Active or Disabled` }),
79349
+ MaxLength(40),
79350
+ __metadata("design:type", String)
79351
+ ], MJAIAgentDataSource_.prototype, "Status", void 0);
79352
+ __decorate([
79353
+ Field({ description: `Cache policy: None (no caching), PerRun (cache for duration of agent run), PerAgent (cache across runs with timeout)` }),
79354
+ MaxLength(40),
79355
+ __metadata("design:type", String)
79356
+ ], MJAIAgentDataSource_.prototype, "CachePolicy", void 0);
79357
+ __decorate([
79358
+ Field(() => Int, { nullable: true, description: `Time-to-live in seconds for PerAgent cache policy. Ignored for other cache policies.` }),
79359
+ __metadata("design:type", Number)
79360
+ ], MJAIAgentDataSource_.prototype, "CacheTimeoutSeconds", void 0);
79361
+ __decorate([
79362
+ Field({ description: `Destination for the preloaded data: Data (for Nunjucks templates in prompts), Context (for actions only), or Payload (for agent state)` }),
79363
+ MaxLength(40),
79364
+ __metadata("design:type", String)
79365
+ ], MJAIAgentDataSource_.prototype, "DestinationType", void 0);
79366
+ __decorate([
79367
+ 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.` }),
79368
+ MaxLength(1000),
79369
+ __metadata("design:type", String)
79370
+ ], MJAIAgentDataSource_.prototype, "DestinationPath", void 0);
79371
+ __decorate([
79372
+ Field(),
79373
+ MaxLength(10),
79374
+ __metadata("design:type", Date)
79375
+ ], MJAIAgentDataSource_.prototype, "_mj__CreatedAt", void 0);
79376
+ __decorate([
79377
+ Field(),
79378
+ MaxLength(10),
79379
+ __metadata("design:type", Date)
79380
+ ], MJAIAgentDataSource_.prototype, "_mj__UpdatedAt", void 0);
79381
+ __decorate([
79382
+ Field({ nullable: true }),
79383
+ MaxLength(510),
79384
+ __metadata("design:type", String)
79385
+ ], MJAIAgentDataSource_.prototype, "Agent", void 0);
79386
+ MJAIAgentDataSource_ = __decorate([
79387
+ 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.` })
79388
+ ], MJAIAgentDataSource_);
79389
+ export { MJAIAgentDataSource_ };
79390
+ let CreateMJAIAgentDataSourceInput = class CreateMJAIAgentDataSourceInput {
79391
+ ID;
79392
+ AgentID;
79393
+ Name;
79394
+ Description;
79395
+ SourceType;
79396
+ EntityName;
79397
+ ExtraFilter;
79398
+ OrderBy;
79399
+ FieldsToRetrieve;
79400
+ ResultType;
79401
+ QueryName;
79402
+ CategoryPath;
79403
+ Parameters;
79404
+ MaxRows;
79405
+ ExecutionOrder;
79406
+ Status;
79407
+ CachePolicy;
79408
+ CacheTimeoutSeconds;
79409
+ DestinationType;
79410
+ DestinationPath;
79411
+ };
79412
+ __decorate([
79413
+ Field({ nullable: true }),
79414
+ __metadata("design:type", String)
79415
+ ], CreateMJAIAgentDataSourceInput.prototype, "ID", void 0);
79416
+ __decorate([
79417
+ Field({ nullable: true }),
79418
+ __metadata("design:type", String)
79419
+ ], CreateMJAIAgentDataSourceInput.prototype, "AgentID", void 0);
79420
+ __decorate([
79421
+ Field({ nullable: true }),
79422
+ __metadata("design:type", String)
79423
+ ], CreateMJAIAgentDataSourceInput.prototype, "Name", void 0);
79424
+ __decorate([
79425
+ Field({ nullable: true }),
79426
+ __metadata("design:type", String)
79427
+ ], CreateMJAIAgentDataSourceInput.prototype, "Description", void 0);
79428
+ __decorate([
79429
+ Field({ nullable: true }),
79430
+ __metadata("design:type", String)
79431
+ ], CreateMJAIAgentDataSourceInput.prototype, "SourceType", void 0);
79432
+ __decorate([
79433
+ Field({ nullable: true }),
79434
+ __metadata("design:type", String)
79435
+ ], CreateMJAIAgentDataSourceInput.prototype, "EntityName", void 0);
79436
+ __decorate([
79437
+ Field({ nullable: true }),
79438
+ __metadata("design:type", String)
79439
+ ], CreateMJAIAgentDataSourceInput.prototype, "ExtraFilter", void 0);
79440
+ __decorate([
79441
+ Field({ nullable: true }),
79442
+ __metadata("design:type", String)
79443
+ ], CreateMJAIAgentDataSourceInput.prototype, "OrderBy", void 0);
79444
+ __decorate([
79445
+ Field({ nullable: true }),
79446
+ __metadata("design:type", String)
79447
+ ], CreateMJAIAgentDataSourceInput.prototype, "FieldsToRetrieve", void 0);
79448
+ __decorate([
79449
+ Field({ nullable: true }),
79450
+ __metadata("design:type", String)
79451
+ ], CreateMJAIAgentDataSourceInput.prototype, "ResultType", void 0);
79452
+ __decorate([
79453
+ Field({ nullable: true }),
79454
+ __metadata("design:type", String)
79455
+ ], CreateMJAIAgentDataSourceInput.prototype, "QueryName", void 0);
79456
+ __decorate([
79457
+ Field({ nullable: true }),
79458
+ __metadata("design:type", String)
79459
+ ], CreateMJAIAgentDataSourceInput.prototype, "CategoryPath", void 0);
79460
+ __decorate([
79461
+ Field({ nullable: true }),
79462
+ __metadata("design:type", String)
79463
+ ], CreateMJAIAgentDataSourceInput.prototype, "Parameters", void 0);
79464
+ __decorate([
79465
+ Field(() => Int, { nullable: true }),
79466
+ __metadata("design:type", Number)
79467
+ ], CreateMJAIAgentDataSourceInput.prototype, "MaxRows", void 0);
79468
+ __decorate([
79469
+ Field(() => Int, { nullable: true }),
79470
+ __metadata("design:type", Number)
79471
+ ], CreateMJAIAgentDataSourceInput.prototype, "ExecutionOrder", void 0);
79472
+ __decorate([
79473
+ Field({ nullable: true }),
79474
+ __metadata("design:type", String)
79475
+ ], CreateMJAIAgentDataSourceInput.prototype, "Status", void 0);
79476
+ __decorate([
79477
+ Field({ nullable: true }),
79478
+ __metadata("design:type", String)
79479
+ ], CreateMJAIAgentDataSourceInput.prototype, "CachePolicy", void 0);
79480
+ __decorate([
79481
+ Field(() => Int, { nullable: true }),
79482
+ __metadata("design:type", Number)
79483
+ ], CreateMJAIAgentDataSourceInput.prototype, "CacheTimeoutSeconds", void 0);
79484
+ __decorate([
79485
+ Field({ nullable: true }),
79486
+ __metadata("design:type", String)
79487
+ ], CreateMJAIAgentDataSourceInput.prototype, "DestinationType", void 0);
79488
+ __decorate([
79489
+ Field({ nullable: true }),
79490
+ __metadata("design:type", String)
79491
+ ], CreateMJAIAgentDataSourceInput.prototype, "DestinationPath", void 0);
79492
+ CreateMJAIAgentDataSourceInput = __decorate([
79493
+ InputType()
79494
+ ], CreateMJAIAgentDataSourceInput);
79495
+ export { CreateMJAIAgentDataSourceInput };
79496
+ let UpdateMJAIAgentDataSourceInput = class UpdateMJAIAgentDataSourceInput {
79497
+ ID;
79498
+ AgentID;
79499
+ Name;
79500
+ Description;
79501
+ SourceType;
79502
+ EntityName;
79503
+ ExtraFilter;
79504
+ OrderBy;
79505
+ FieldsToRetrieve;
79506
+ ResultType;
79507
+ QueryName;
79508
+ CategoryPath;
79509
+ Parameters;
79510
+ MaxRows;
79511
+ ExecutionOrder;
79512
+ Status;
79513
+ CachePolicy;
79514
+ CacheTimeoutSeconds;
79515
+ DestinationType;
79516
+ DestinationPath;
79517
+ OldValues___;
79518
+ };
79519
+ __decorate([
79520
+ Field(),
79521
+ __metadata("design:type", String)
79522
+ ], UpdateMJAIAgentDataSourceInput.prototype, "ID", void 0);
79523
+ __decorate([
79524
+ Field({ nullable: true }),
79525
+ __metadata("design:type", String)
79526
+ ], UpdateMJAIAgentDataSourceInput.prototype, "AgentID", void 0);
79527
+ __decorate([
79528
+ Field({ nullable: true }),
79529
+ __metadata("design:type", String)
79530
+ ], UpdateMJAIAgentDataSourceInput.prototype, "Name", void 0);
79531
+ __decorate([
79532
+ Field({ nullable: true }),
79533
+ __metadata("design:type", String)
79534
+ ], UpdateMJAIAgentDataSourceInput.prototype, "Description", void 0);
79535
+ __decorate([
79536
+ Field({ nullable: true }),
79537
+ __metadata("design:type", String)
79538
+ ], UpdateMJAIAgentDataSourceInput.prototype, "SourceType", void 0);
79539
+ __decorate([
79540
+ Field({ nullable: true }),
79541
+ __metadata("design:type", String)
79542
+ ], UpdateMJAIAgentDataSourceInput.prototype, "EntityName", void 0);
79543
+ __decorate([
79544
+ Field({ nullable: true }),
79545
+ __metadata("design:type", String)
79546
+ ], UpdateMJAIAgentDataSourceInput.prototype, "ExtraFilter", void 0);
79547
+ __decorate([
79548
+ Field({ nullable: true }),
79549
+ __metadata("design:type", String)
79550
+ ], UpdateMJAIAgentDataSourceInput.prototype, "OrderBy", void 0);
79551
+ __decorate([
79552
+ Field({ nullable: true }),
79553
+ __metadata("design:type", String)
79554
+ ], UpdateMJAIAgentDataSourceInput.prototype, "FieldsToRetrieve", void 0);
79555
+ __decorate([
79556
+ Field({ nullable: true }),
79557
+ __metadata("design:type", String)
79558
+ ], UpdateMJAIAgentDataSourceInput.prototype, "ResultType", void 0);
79559
+ __decorate([
79560
+ Field({ nullable: true }),
79561
+ __metadata("design:type", String)
79562
+ ], UpdateMJAIAgentDataSourceInput.prototype, "QueryName", void 0);
79563
+ __decorate([
79564
+ Field({ nullable: true }),
79565
+ __metadata("design:type", String)
79566
+ ], UpdateMJAIAgentDataSourceInput.prototype, "CategoryPath", void 0);
79567
+ __decorate([
79568
+ Field({ nullable: true }),
79569
+ __metadata("design:type", String)
79570
+ ], UpdateMJAIAgentDataSourceInput.prototype, "Parameters", void 0);
79571
+ __decorate([
79572
+ Field(() => Int, { nullable: true }),
79573
+ __metadata("design:type", Number)
79574
+ ], UpdateMJAIAgentDataSourceInput.prototype, "MaxRows", void 0);
79575
+ __decorate([
79576
+ Field(() => Int, { nullable: true }),
79577
+ __metadata("design:type", Number)
79578
+ ], UpdateMJAIAgentDataSourceInput.prototype, "ExecutionOrder", void 0);
79579
+ __decorate([
79580
+ Field({ nullable: true }),
79581
+ __metadata("design:type", String)
79582
+ ], UpdateMJAIAgentDataSourceInput.prototype, "Status", void 0);
79583
+ __decorate([
79584
+ Field({ nullable: true }),
79585
+ __metadata("design:type", String)
79586
+ ], UpdateMJAIAgentDataSourceInput.prototype, "CachePolicy", void 0);
79587
+ __decorate([
79588
+ Field(() => Int, { nullable: true }),
79589
+ __metadata("design:type", Number)
79590
+ ], UpdateMJAIAgentDataSourceInput.prototype, "CacheTimeoutSeconds", void 0);
79591
+ __decorate([
79592
+ Field({ nullable: true }),
79593
+ __metadata("design:type", String)
79594
+ ], UpdateMJAIAgentDataSourceInput.prototype, "DestinationType", void 0);
79595
+ __decorate([
79596
+ Field({ nullable: true }),
79597
+ __metadata("design:type", String)
79598
+ ], UpdateMJAIAgentDataSourceInput.prototype, "DestinationPath", void 0);
79599
+ __decorate([
79600
+ Field(() => [KeyValuePairInput], { nullable: true }),
79601
+ __metadata("design:type", Array)
79602
+ ], UpdateMJAIAgentDataSourceInput.prototype, "OldValues___", void 0);
79603
+ UpdateMJAIAgentDataSourceInput = __decorate([
79604
+ InputType()
79605
+ ], UpdateMJAIAgentDataSourceInput);
79606
+ export { UpdateMJAIAgentDataSourceInput };
79607
+ let RunMJAIAgentDataSourceViewResult = class RunMJAIAgentDataSourceViewResult {
79608
+ Results;
79609
+ UserViewRunID;
79610
+ RowCount;
79611
+ TotalRowCount;
79612
+ ExecutionTime;
79613
+ ErrorMessage;
79614
+ Success;
79615
+ };
79616
+ __decorate([
79617
+ Field(() => [MJAIAgentDataSource_]),
79618
+ __metadata("design:type", Array)
79619
+ ], RunMJAIAgentDataSourceViewResult.prototype, "Results", void 0);
79620
+ __decorate([
79621
+ Field(() => String, { nullable: true }),
79622
+ __metadata("design:type", String)
79623
+ ], RunMJAIAgentDataSourceViewResult.prototype, "UserViewRunID", void 0);
79624
+ __decorate([
79625
+ Field(() => Int, { nullable: true }),
79626
+ __metadata("design:type", Number)
79627
+ ], RunMJAIAgentDataSourceViewResult.prototype, "RowCount", void 0);
79628
+ __decorate([
79629
+ Field(() => Int, { nullable: true }),
79630
+ __metadata("design:type", Number)
79631
+ ], RunMJAIAgentDataSourceViewResult.prototype, "TotalRowCount", void 0);
79632
+ __decorate([
79633
+ Field(() => Int, { nullable: true }),
79634
+ __metadata("design:type", Number)
79635
+ ], RunMJAIAgentDataSourceViewResult.prototype, "ExecutionTime", void 0);
79636
+ __decorate([
79637
+ Field({ nullable: true }),
79638
+ __metadata("design:type", String)
79639
+ ], RunMJAIAgentDataSourceViewResult.prototype, "ErrorMessage", void 0);
79640
+ __decorate([
79641
+ Field(() => Boolean, { nullable: false }),
79642
+ __metadata("design:type", Boolean)
79643
+ ], RunMJAIAgentDataSourceViewResult.prototype, "Success", void 0);
79644
+ RunMJAIAgentDataSourceViewResult = __decorate([
79645
+ ObjectType()
79646
+ ], RunMJAIAgentDataSourceViewResult);
79647
+ export { RunMJAIAgentDataSourceViewResult };
79648
+ let MJAIAgentDataSourceResolver = class MJAIAgentDataSourceResolver extends ResolverBase {
79649
+ async RunMJAIAgentDataSourceViewByID(input, { providers, userPayload }, pubSub) {
79650
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
79651
+ return super.RunViewByIDGeneric(input, provider, userPayload, pubSub);
79652
+ }
79653
+ async RunMJAIAgentDataSourceViewByName(input, { providers, userPayload }, pubSub) {
79654
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
79655
+ return super.RunViewByNameGeneric(input, provider, userPayload, pubSub);
79656
+ }
79657
+ async RunMJAIAgentDataSourceDynamicView(input, { providers, userPayload }, pubSub) {
79658
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
79659
+ input.EntityName = 'MJ: AI Agent Data Sources';
79660
+ return super.RunDynamicViewGeneric(input, provider, userPayload, pubSub);
79661
+ }
79662
+ async MJAIAgentDataSource(ID, { dataSources, userPayload, providers }, pubSub) {
79663
+ this.CheckUserReadPermissions('MJ: AI Agent Data Sources', userPayload);
79664
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
79665
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
79666
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwAIAgentDataSources] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'MJ: AI Agent Data Sources', userPayload, EntityPermissionType.Read, 'AND');
79667
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
79668
+ const result = this.MapFieldNamesToCodeNames('MJ: AI Agent Data Sources', rows && rows.length > 0 ? rows[0] : {});
79669
+ return result;
79670
+ }
79671
+ async CreateMJAIAgentDataSource(input, { providers, userPayload }, pubSub) {
79672
+ const provider = GetReadWriteProvider(providers);
79673
+ return this.CreateRecord('MJ: AI Agent Data Sources', input, provider, userPayload, pubSub);
79674
+ }
79675
+ async UpdateMJAIAgentDataSource(input, { providers, userPayload }, pubSub) {
79676
+ const provider = GetReadWriteProvider(providers);
79677
+ return this.UpdateRecord('MJ: AI Agent Data Sources', input, provider, userPayload, pubSub);
79678
+ }
79679
+ async DeleteMJAIAgentDataSource(ID, options, { providers, userPayload }, pubSub) {
79680
+ const provider = GetReadWriteProvider(providers);
79681
+ const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
79682
+ return this.DeleteRecord('MJ: AI Agent Data Sources', key, options, provider, userPayload, pubSub);
79683
+ }
79684
+ };
79685
+ __decorate([
79686
+ Query(() => RunMJAIAgentDataSourceViewResult),
79687
+ __param(0, Arg('input', () => RunViewByIDInput)),
79688
+ __param(1, Ctx()),
79689
+ __param(2, PubSub()),
79690
+ __metadata("design:type", Function),
79691
+ __metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
79692
+ __metadata("design:returntype", Promise)
79693
+ ], MJAIAgentDataSourceResolver.prototype, "RunMJAIAgentDataSourceViewByID", null);
79694
+ __decorate([
79695
+ Query(() => RunMJAIAgentDataSourceViewResult),
79696
+ __param(0, Arg('input', () => RunViewByNameInput)),
79697
+ __param(1, Ctx()),
79698
+ __param(2, PubSub()),
79699
+ __metadata("design:type", Function),
79700
+ __metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
79701
+ __metadata("design:returntype", Promise)
79702
+ ], MJAIAgentDataSourceResolver.prototype, "RunMJAIAgentDataSourceViewByName", null);
79703
+ __decorate([
79704
+ Query(() => RunMJAIAgentDataSourceViewResult),
79705
+ __param(0, Arg('input', () => RunDynamicViewInput)),
79706
+ __param(1, Ctx()),
79707
+ __param(2, PubSub()),
79708
+ __metadata("design:type", Function),
79709
+ __metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
79710
+ __metadata("design:returntype", Promise)
79711
+ ], MJAIAgentDataSourceResolver.prototype, "RunMJAIAgentDataSourceDynamicView", null);
79712
+ __decorate([
79713
+ Query(() => MJAIAgentDataSource_, { nullable: true }),
79714
+ __param(0, Arg('ID', () => String)),
79715
+ __param(1, Ctx()),
79716
+ __param(2, PubSub()),
79717
+ __metadata("design:type", Function),
79718
+ __metadata("design:paramtypes", [String, Object, PubSubEngine]),
79719
+ __metadata("design:returntype", Promise)
79720
+ ], MJAIAgentDataSourceResolver.prototype, "MJAIAgentDataSource", null);
79721
+ __decorate([
79722
+ Mutation(() => MJAIAgentDataSource_),
79723
+ __param(0, Arg('input', () => CreateMJAIAgentDataSourceInput)),
79724
+ __param(1, Ctx()),
79725
+ __param(2, PubSub()),
79726
+ __metadata("design:type", Function),
79727
+ __metadata("design:paramtypes", [CreateMJAIAgentDataSourceInput, Object, PubSubEngine]),
79728
+ __metadata("design:returntype", Promise)
79729
+ ], MJAIAgentDataSourceResolver.prototype, "CreateMJAIAgentDataSource", null);
79730
+ __decorate([
79731
+ Mutation(() => MJAIAgentDataSource_),
79732
+ __param(0, Arg('input', () => UpdateMJAIAgentDataSourceInput)),
79733
+ __param(1, Ctx()),
79734
+ __param(2, PubSub()),
79735
+ __metadata("design:type", Function),
79736
+ __metadata("design:paramtypes", [UpdateMJAIAgentDataSourceInput, Object, PubSubEngine]),
79737
+ __metadata("design:returntype", Promise)
79738
+ ], MJAIAgentDataSourceResolver.prototype, "UpdateMJAIAgentDataSource", null);
79739
+ __decorate([
79740
+ Mutation(() => MJAIAgentDataSource_),
79741
+ __param(0, Arg('ID', () => String)),
79742
+ __param(1, Arg('options___', () => DeleteOptionsInput)),
79743
+ __param(2, Ctx()),
79744
+ __param(3, PubSub()),
79745
+ __metadata("design:type", Function),
79746
+ __metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
79747
+ __metadata("design:returntype", Promise)
79748
+ ], MJAIAgentDataSourceResolver.prototype, "DeleteMJAIAgentDataSource", null);
79749
+ MJAIAgentDataSourceResolver = __decorate([
79750
+ Resolver(MJAIAgentDataSource_)
79751
+ ], MJAIAgentDataSourceResolver);
79752
+ export { MJAIAgentDataSourceResolver };
78188
79753
  //# sourceMappingURL=generated.js.map