@memberjunction/server 2.83.0 → 2.85.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.
@@ -26551,6 +26551,7 @@ let AIModel_ = class AIModel_ {
26551
26551
  MJ_AIPromptModels_ModelIDArray;
26552
26552
  MJ_AIPromptRuns_ModelIDArray;
26553
26553
  MJ_AIAgentRuns_OverrideModelIDArray;
26554
+ Queries_EmbeddingModelIDArray;
26554
26555
  };
26555
26556
  __decorate([
26556
26557
  Field(),
@@ -26695,6 +26696,10 @@ __decorate([
26695
26696
  Field(() => [AIAgentRun_]),
26696
26697
  __metadata("design:type", Array)
26697
26698
  ], AIModel_.prototype, "MJ_AIAgentRuns_OverrideModelIDArray", void 0);
26699
+ __decorate([
26700
+ Field(() => [Query_]),
26701
+ __metadata("design:type", Array)
26702
+ ], AIModel_.prototype, "Queries_EmbeddingModelIDArray", void 0);
26698
26703
  AIModel_ = __decorate([
26699
26704
  ObjectType({ description: `Catalog of all AI Models configured in the system` })
26700
26705
  ], AIModel_);
@@ -27005,6 +27010,15 @@ let AIModelResolver = class AIModelResolver extends ResolverBase {
27005
27010
  const result = this.ArrayMapFieldNamesToCodeNames('MJ: AI Agent Runs', rows);
27006
27011
  return result;
27007
27012
  }
27013
+ async Queries_EmbeddingModelIDArray(aimodel_, { dataSources, userPayload, providers }, pubSub) {
27014
+ this.CheckUserReadPermissions('Queries', userPayload);
27015
+ const provider = GetReadOnlyProvider(providers, { allowFallbackToReadWrite: true });
27016
+ const connPool = GetReadOnlyDataSource(dataSources, { allowFallbackToReadWrite: true });
27017
+ const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwQueries] WHERE [EmbeddingModelID]='${aimodel_.ID}' ` + this.getRowLevelSecurityWhereClause(provider, 'Queries', userPayload, EntityPermissionType.Read, 'AND');
27018
+ const rows = await SQLServerDataProvider.ExecuteSQLWithPool(connPool, sSQL, undefined, this.GetUserFromPayload(userPayload));
27019
+ const result = this.ArrayMapFieldNamesToCodeNames('Queries', rows);
27020
+ return result;
27021
+ }
27008
27022
  async CreateAIModel(input, { providers, userPayload }, pubSub) {
27009
27023
  const provider = GetReadWriteProvider(providers);
27010
27024
  return this.CreateRecord('AI Models', input, provider, userPayload, pubSub);
@@ -27189,6 +27203,15 @@ __decorate([
27189
27203
  __metadata("design:paramtypes", [AIModel_, Object, PubSubEngine]),
27190
27204
  __metadata("design:returntype", Promise)
27191
27205
  ], AIModelResolver.prototype, "MJ_AIAgentRuns_OverrideModelIDArray", null);
27206
+ __decorate([
27207
+ FieldResolver(() => [Query_]),
27208
+ __param(0, Root()),
27209
+ __param(1, Ctx()),
27210
+ __param(2, PubSub()),
27211
+ __metadata("design:type", Function),
27212
+ __metadata("design:paramtypes", [AIModel_, Object, PubSubEngine]),
27213
+ __metadata("design:returntype", Promise)
27214
+ ], AIModelResolver.prototype, "Queries_EmbeddingModelIDArray", null);
27192
27215
  __decorate([
27193
27216
  Mutation(() => AIModel_),
27194
27217
  __param(0, Arg('input', () => CreateAIModelInput)),
@@ -37148,7 +37171,10 @@ let Query_ = class Query_ {
37148
37171
  CacheEnabled;
37149
37172
  CacheTTLMinutes;
37150
37173
  CacheMaxSize;
37174
+ EmbeddingVector;
37175
+ EmbeddingModelID;
37151
37176
  Category;
37177
+ EmbeddingModel;
37152
37178
  QueryFields_QueryIDArray;
37153
37179
  QueryPermissions_QueryIDArray;
37154
37180
  DataContextItems_QueryIDArray;
@@ -37237,11 +37263,25 @@ __decorate([
37237
37263
  Field(() => Int, { nullable: true, description: `Maximum number of cached result sets for this query. NULL uses default size limit.` }),
37238
37264
  __metadata("design:type", Number)
37239
37265
  ], Query_.prototype, "CacheMaxSize", void 0);
37266
+ __decorate([
37267
+ Field({ nullable: true, description: `Optional JSON-serialized embedding vector for the query, used for similarity search and query analysis` }),
37268
+ __metadata("design:type", String)
37269
+ ], Query_.prototype, "EmbeddingVector", void 0);
37270
+ __decorate([
37271
+ Field({ nullable: true, description: `The AI Model used to generate the embedding vector for this query. Required for vector similarity comparisons.` }),
37272
+ MaxLength(16),
37273
+ __metadata("design:type", String)
37274
+ ], Query_.prototype, "EmbeddingModelID", void 0);
37240
37275
  __decorate([
37241
37276
  Field({ nullable: true }),
37242
37277
  MaxLength(100),
37243
37278
  __metadata("design:type", String)
37244
37279
  ], Query_.prototype, "Category", void 0);
37280
+ __decorate([
37281
+ Field({ nullable: true }),
37282
+ MaxLength(100),
37283
+ __metadata("design:type", String)
37284
+ ], Query_.prototype, "EmbeddingModel", void 0);
37245
37285
  __decorate([
37246
37286
  Field(() => [QueryField_]),
37247
37287
  __metadata("design:type", Array)
@@ -37284,6 +37324,8 @@ let CreateQueryInput = class CreateQueryInput {
37284
37324
  CacheEnabled;
37285
37325
  CacheTTLMinutes;
37286
37326
  CacheMaxSize;
37327
+ EmbeddingVector;
37328
+ EmbeddingModelID;
37287
37329
  };
37288
37330
  __decorate([
37289
37331
  Field({ nullable: true }),
@@ -37353,6 +37395,14 @@ __decorate([
37353
37395
  Field(() => Int, { nullable: true }),
37354
37396
  __metadata("design:type", Number)
37355
37397
  ], CreateQueryInput.prototype, "CacheMaxSize", void 0);
37398
+ __decorate([
37399
+ Field({ nullable: true }),
37400
+ __metadata("design:type", String)
37401
+ ], CreateQueryInput.prototype, "EmbeddingVector", void 0);
37402
+ __decorate([
37403
+ Field({ nullable: true }),
37404
+ __metadata("design:type", String)
37405
+ ], CreateQueryInput.prototype, "EmbeddingModelID", void 0);
37356
37406
  CreateQueryInput = __decorate([
37357
37407
  InputType()
37358
37408
  ], CreateQueryInput);
@@ -37375,6 +37425,8 @@ let UpdateQueryInput = class UpdateQueryInput {
37375
37425
  CacheEnabled;
37376
37426
  CacheTTLMinutes;
37377
37427
  CacheMaxSize;
37428
+ EmbeddingVector;
37429
+ EmbeddingModelID;
37378
37430
  OldValues___;
37379
37431
  };
37380
37432
  __decorate([
@@ -37445,6 +37497,14 @@ __decorate([
37445
37497
  Field(() => Int, { nullable: true }),
37446
37498
  __metadata("design:type", Number)
37447
37499
  ], UpdateQueryInput.prototype, "CacheMaxSize", void 0);
37500
+ __decorate([
37501
+ Field({ nullable: true }),
37502
+ __metadata("design:type", String)
37503
+ ], UpdateQueryInput.prototype, "EmbeddingVector", void 0);
37504
+ __decorate([
37505
+ Field({ nullable: true }),
37506
+ __metadata("design:type", String)
37507
+ ], UpdateQueryInput.prototype, "EmbeddingModelID", void 0);
37448
37508
  __decorate([
37449
37509
  Field(() => [KeyValuePairInput], { nullable: true }),
37450
37510
  __metadata("design:type", Array)