@memberjunction/server 2.120.0 → 2.122.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.
- package/dist/agents/skip-sdk.d.ts.map +1 -1
- package/dist/agents/skip-sdk.js +42 -52
- package/dist/agents/skip-sdk.js.map +1 -1
- package/dist/auth/BaseAuthProvider.d.ts +1 -0
- package/dist/auth/BaseAuthProvider.d.ts.map +1 -1
- package/dist/auth/BaseAuthProvider.js +46 -3
- package/dist/auth/BaseAuthProvider.js.map +1 -1
- package/dist/auth/newUsers.d.ts.map +1 -1
- package/dist/auth/newUsers.js +23 -10
- package/dist/auth/newUsers.js.map +1 -1
- package/dist/generated/generated.d.ts +9308 -9190
- package/dist/generated/generated.d.ts.map +1 -1
- package/dist/generated/generated.js +47702 -47019
- package/dist/generated/generated.js.map +1 -1
- package/dist/resolvers/AskSkipResolver.d.ts.map +1 -1
- package/dist/resolvers/AskSkipResolver.js +47 -64
- package/dist/resolvers/AskSkipResolver.js.map +1 -1
- package/dist/resolvers/CreateQueryResolver.d.ts +39 -8
- package/dist/resolvers/CreateQueryResolver.d.ts.map +1 -1
- package/dist/resolvers/CreateQueryResolver.js +329 -77
- package/dist/resolvers/CreateQueryResolver.js.map +1 -1
- package/package.json +41 -41
- package/src/agents/skip-sdk.ts +42 -53
- package/src/auth/BaseAuthProvider.ts +68 -5
- package/src/auth/newUsers.ts +30 -11
- package/src/generated/generated.ts +27883 -27450
- package/src/generic/RunViewResolver.ts +793 -793
- package/src/resolvers/AskSkipResolver.ts +47 -64
- package/src/resolvers/CreateQueryResolver.ts +262 -72
- package/src/resolvers/QueryResolver.ts +275 -275
|
@@ -1682,70 +1682,53 @@ export class AskSkipResolver {
|
|
|
1682
1682
|
protected BuildSkipQueries(status: "Pending" | "In-Review" | "Approved" | "Rejected" | "Obsolete" = 'Approved'): SkipQueryInfo[] {
|
|
1683
1683
|
const md = new Metadata();
|
|
1684
1684
|
const approvedQueries = md.Queries.filter((q) => q.Status === status);
|
|
1685
|
-
return approvedQueries.map((q) => {
|
|
1686
|
-
|
|
1687
|
-
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1701
|
-
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1705
|
-
|
|
1706
|
-
|
|
1707
|
-
|
|
1708
|
-
|
|
1709
|
-
|
|
1710
|
-
|
|
1711
|
-
|
|
1712
|
-
|
|
1713
|
-
|
|
1714
|
-
|
|
1715
|
-
|
|
1716
|
-
|
|
1717
|
-
|
|
1718
|
-
|
|
1719
|
-
|
|
1720
|
-
|
|
1721
|
-
|
|
1722
|
-
|
|
1723
|
-
|
|
1724
|
-
|
|
1725
|
-
|
|
1726
|
-
|
|
1727
|
-
|
|
1728
|
-
|
|
1729
|
-
|
|
1730
|
-
|
|
1731
|
-
|
|
1732
|
-
updatedAt: p.__mj_UpdatedAt,
|
|
1733
|
-
};
|
|
1734
|
-
}),
|
|
1735
|
-
entities: q.Entities.map((e) => {
|
|
1736
|
-
return {
|
|
1737
|
-
id: `${e.QueryID}_${e.EntityID}`, // Composite key since QueryEntityInfo doesn't have a single ID field
|
|
1738
|
-
queryID: e.QueryID,
|
|
1739
|
-
entityID: e.EntityID,
|
|
1740
|
-
entityName: e.Entity,
|
|
1741
|
-
detectionMethod: e.DetectionMethod,
|
|
1742
|
-
autoDetectConfidenceScore: e.AutoDetectConfidenceScore,
|
|
1743
|
-
createdAt: e.__mj_CreatedAt,
|
|
1744
|
-
updatedAt: e.__mj_UpdatedAt,
|
|
1745
|
-
};
|
|
1746
|
-
})
|
|
1747
|
-
}
|
|
1748
|
-
});
|
|
1685
|
+
return approvedQueries.map((q) => ({
|
|
1686
|
+
ID: q.ID,
|
|
1687
|
+
Name: q.Name,
|
|
1688
|
+
Description: q.Description,
|
|
1689
|
+
Category: q.Category,
|
|
1690
|
+
CategoryPath: this.buildQueryCategoryPath(md, q.CategoryID),
|
|
1691
|
+
CategoryID: q.CategoryID,
|
|
1692
|
+
SQL: q.SQL,
|
|
1693
|
+
Status: q.Status,
|
|
1694
|
+
QualityRank: q.QualityRank,
|
|
1695
|
+
EmbeddingVector: q.EmbeddingVector,
|
|
1696
|
+
EmbeddingModelID: q.EmbeddingModelID,
|
|
1697
|
+
EmbeddingModelName: q.EmbeddingModel,
|
|
1698
|
+
Fields: q.Fields.map((f) => ({
|
|
1699
|
+
ID: f.ID,
|
|
1700
|
+
QueryID: f.QueryID,
|
|
1701
|
+
Name: f.Name,
|
|
1702
|
+
Description: f.Description,
|
|
1703
|
+
Sequence: f.Sequence,
|
|
1704
|
+
SQLBaseType: f.SQLBaseType,
|
|
1705
|
+
SQLFullType: f.SQLFullType,
|
|
1706
|
+
SourceEntityID: f.SourceEntityID,
|
|
1707
|
+
SourceEntity: f.SourceEntity,
|
|
1708
|
+
SourceFieldName: f.SourceFieldName,
|
|
1709
|
+
IsComputed: f.IsComputed,
|
|
1710
|
+
ComputationDescription: f.ComputationDescription,
|
|
1711
|
+
IsSummary: f.IsSummary,
|
|
1712
|
+
SummaryDescription: f.SummaryDescription
|
|
1713
|
+
})),
|
|
1714
|
+
Parameters: q.Parameters.map((p) => ({
|
|
1715
|
+
ID: p.ID,
|
|
1716
|
+
QueryID: p.QueryID,
|
|
1717
|
+
Name: p.Name,
|
|
1718
|
+
Description: p.Description,
|
|
1719
|
+
Type: p.Type,
|
|
1720
|
+
IsRequired: p.IsRequired,
|
|
1721
|
+
DefaultValue: p.DefaultValue,
|
|
1722
|
+
SampleValue: p.SampleValue,
|
|
1723
|
+
ValidationFilters: p.ValidationFilters
|
|
1724
|
+
})),
|
|
1725
|
+
Entities: q.Entities.map((e) => ({
|
|
1726
|
+
ID: e.ID,
|
|
1727
|
+
QueryID: e.QueryID,
|
|
1728
|
+
EntityID: e.EntityID,
|
|
1729
|
+
Entity: e.Entity
|
|
1730
|
+
}))
|
|
1731
|
+
}));
|
|
1749
1732
|
}
|
|
1750
1733
|
|
|
1751
1734
|
// /**
|
|
@@ -160,9 +160,6 @@ export class QueryFieldType {
|
|
|
160
160
|
@Field(() => String, { nullable: true })
|
|
161
161
|
Description?: string;
|
|
162
162
|
|
|
163
|
-
@Field(() => String, { nullable: true })
|
|
164
|
-
Type?: string;
|
|
165
|
-
|
|
166
163
|
@Field(() => Number)
|
|
167
164
|
Sequence!: number;
|
|
168
165
|
|
|
@@ -172,11 +169,26 @@ export class QueryFieldType {
|
|
|
172
169
|
@Field(() => String, { nullable: true })
|
|
173
170
|
SQLFullType?: string;
|
|
174
171
|
|
|
172
|
+
@Field(() => String, { nullable: true })
|
|
173
|
+
SourceEntityID?: string;
|
|
174
|
+
|
|
175
|
+
@Field(() => String, { nullable: true })
|
|
176
|
+
SourceEntity?: string;
|
|
177
|
+
|
|
178
|
+
@Field(() => String, { nullable: true })
|
|
179
|
+
SourceFieldName?: string;
|
|
180
|
+
|
|
175
181
|
@Field(() => Boolean)
|
|
176
182
|
IsComputed!: boolean;
|
|
177
183
|
|
|
178
184
|
@Field(() => String, { nullable: true })
|
|
179
185
|
ComputationDescription?: string;
|
|
186
|
+
|
|
187
|
+
@Field(() => Boolean, { nullable: true })
|
|
188
|
+
IsSummary?: boolean;
|
|
189
|
+
|
|
190
|
+
@Field(() => String, { nullable: true })
|
|
191
|
+
SummaryDescription?: string;
|
|
180
192
|
}
|
|
181
193
|
|
|
182
194
|
@ObjectType()
|
|
@@ -190,17 +202,23 @@ export class QueryParameterType {
|
|
|
190
202
|
@Field(() => String)
|
|
191
203
|
Name!: string;
|
|
192
204
|
|
|
205
|
+
@Field(() => String, { nullable: true })
|
|
206
|
+
Description?: string;
|
|
207
|
+
|
|
193
208
|
@Field(() => String)
|
|
194
209
|
Type!: string;
|
|
195
210
|
|
|
211
|
+
@Field(() => Boolean)
|
|
212
|
+
IsRequired!: boolean;
|
|
213
|
+
|
|
196
214
|
@Field(() => String, { nullable: true })
|
|
197
215
|
DefaultValue?: string;
|
|
198
216
|
|
|
199
217
|
@Field(() => String, { nullable: true })
|
|
200
|
-
|
|
218
|
+
SampleValue?: string;
|
|
201
219
|
|
|
202
|
-
@Field(() =>
|
|
203
|
-
|
|
220
|
+
@Field(() => String, { nullable: true })
|
|
221
|
+
ValidationFilters?: string;
|
|
204
222
|
}
|
|
205
223
|
|
|
206
224
|
@ObjectType()
|
|
@@ -215,7 +233,7 @@ export class QueryEntityType {
|
|
|
215
233
|
EntityID!: string;
|
|
216
234
|
|
|
217
235
|
@Field(() => String, { nullable: true })
|
|
218
|
-
|
|
236
|
+
Entity?: string;
|
|
219
237
|
}
|
|
220
238
|
|
|
221
239
|
@ObjectType()
|
|
@@ -230,7 +248,7 @@ export class QueryPermissionType {
|
|
|
230
248
|
RoleID!: string;
|
|
231
249
|
|
|
232
250
|
@Field(() => String, { nullable: true })
|
|
233
|
-
|
|
251
|
+
Role?: string;
|
|
234
252
|
}
|
|
235
253
|
|
|
236
254
|
@ObjectType()
|
|
@@ -241,9 +259,41 @@ export class CreateQueryResultType {
|
|
|
241
259
|
@Field(() => String, { nullable: true })
|
|
242
260
|
ErrorMessage?: string;
|
|
243
261
|
|
|
262
|
+
// Core query properties
|
|
263
|
+
@Field(() => String, { nullable: true })
|
|
264
|
+
ID?: string;
|
|
265
|
+
|
|
266
|
+
@Field(() => String, { nullable: true })
|
|
267
|
+
Name?: string;
|
|
268
|
+
|
|
269
|
+
@Field(() => String, { nullable: true })
|
|
270
|
+
Description?: string;
|
|
271
|
+
|
|
272
|
+
@Field(() => String, { nullable: true })
|
|
273
|
+
CategoryID?: string;
|
|
274
|
+
|
|
275
|
+
@Field(() => String, { nullable: true })
|
|
276
|
+
Category?: string;
|
|
277
|
+
|
|
278
|
+
@Field(() => String, { nullable: true })
|
|
279
|
+
SQL?: string;
|
|
280
|
+
|
|
281
|
+
@Field(() => String, { nullable: true })
|
|
282
|
+
Status?: string;
|
|
283
|
+
|
|
284
|
+
@Field(() => Number, { nullable: true })
|
|
285
|
+
QualityRank?: number;
|
|
286
|
+
|
|
287
|
+
@Field(() => String, { nullable: true })
|
|
288
|
+
EmbeddingVector?: string;
|
|
289
|
+
|
|
290
|
+
@Field(() => String, { nullable: true })
|
|
291
|
+
EmbeddingModelID?: string;
|
|
292
|
+
|
|
244
293
|
@Field(() => String, { nullable: true })
|
|
245
|
-
|
|
294
|
+
EmbeddingModelName?: string;
|
|
246
295
|
|
|
296
|
+
// Related collections
|
|
247
297
|
@Field(() => [QueryFieldType], { nullable: true })
|
|
248
298
|
Fields?: QueryFieldType[];
|
|
249
299
|
|
|
@@ -265,9 +315,41 @@ export class UpdateQueryResultType {
|
|
|
265
315
|
@Field(() => String, { nullable: true })
|
|
266
316
|
ErrorMessage?: string;
|
|
267
317
|
|
|
318
|
+
// Core query properties
|
|
268
319
|
@Field(() => String, { nullable: true })
|
|
269
|
-
|
|
320
|
+
ID?: string;
|
|
270
321
|
|
|
322
|
+
@Field(() => String, { nullable: true })
|
|
323
|
+
Name?: string;
|
|
324
|
+
|
|
325
|
+
@Field(() => String, { nullable: true })
|
|
326
|
+
Description?: string;
|
|
327
|
+
|
|
328
|
+
@Field(() => String, { nullable: true })
|
|
329
|
+
CategoryID?: string;
|
|
330
|
+
|
|
331
|
+
@Field(() => String, { nullable: true })
|
|
332
|
+
Category?: string;
|
|
333
|
+
|
|
334
|
+
@Field(() => String, { nullable: true })
|
|
335
|
+
SQL?: string;
|
|
336
|
+
|
|
337
|
+
@Field(() => String, { nullable: true })
|
|
338
|
+
Status?: string;
|
|
339
|
+
|
|
340
|
+
@Field(() => Number, { nullable: true })
|
|
341
|
+
QualityRank?: number;
|
|
342
|
+
|
|
343
|
+
@Field(() => String, { nullable: true })
|
|
344
|
+
EmbeddingVector?: string;
|
|
345
|
+
|
|
346
|
+
@Field(() => String, { nullable: true })
|
|
347
|
+
EmbeddingModelID?: string;
|
|
348
|
+
|
|
349
|
+
@Field(() => String, { nullable: true })
|
|
350
|
+
EmbeddingModelName?: string;
|
|
351
|
+
|
|
352
|
+
// Related collections
|
|
271
353
|
@Field(() => [QueryFieldType], { nullable: true })
|
|
272
354
|
Fields?: QueryFieldType[];
|
|
273
355
|
|
|
@@ -289,8 +371,24 @@ export class DeleteQueryResultType {
|
|
|
289
371
|
@Field(() => String, { nullable: true })
|
|
290
372
|
ErrorMessage?: string;
|
|
291
373
|
|
|
374
|
+
// Core query properties of deleted query
|
|
375
|
+
@Field(() => String, { nullable: true })
|
|
376
|
+
ID?: string;
|
|
377
|
+
|
|
378
|
+
@Field(() => String, { nullable: true })
|
|
379
|
+
Name?: string;
|
|
380
|
+
|
|
381
|
+
@Field(() => String, { nullable: true })
|
|
382
|
+
Description?: string;
|
|
383
|
+
|
|
292
384
|
@Field(() => String, { nullable: true })
|
|
293
|
-
|
|
385
|
+
CategoryID?: string;
|
|
386
|
+
|
|
387
|
+
@Field(() => String, { nullable: true })
|
|
388
|
+
SQL?: string;
|
|
389
|
+
|
|
390
|
+
@Field(() => String, { nullable: true })
|
|
391
|
+
Status?: string;
|
|
294
392
|
}
|
|
295
393
|
|
|
296
394
|
@Resolver()
|
|
@@ -368,16 +466,56 @@ export class MJQueryResolverExtended extends MJQueryResolver {
|
|
|
368
466
|
|
|
369
467
|
return {
|
|
370
468
|
Success: true,
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
469
|
+
ID: record.ID,
|
|
470
|
+
Name: record.Name,
|
|
471
|
+
Description: record.Description,
|
|
472
|
+
CategoryID: record.CategoryID,
|
|
473
|
+
Category: record.Category,
|
|
474
|
+
SQL: record.SQL,
|
|
475
|
+
Status: record.Status,
|
|
476
|
+
QualityRank: record.QualityRank,
|
|
477
|
+
EmbeddingVector: record.EmbeddingVector,
|
|
478
|
+
EmbeddingModelID: record.EmbeddingModelID,
|
|
479
|
+
EmbeddingModelName: record.EmbeddingModel,
|
|
480
|
+
Fields: record.QueryFields.map(f => ({
|
|
481
|
+
ID: f.ID,
|
|
482
|
+
QueryID: f.QueryID,
|
|
483
|
+
Name: f.Name,
|
|
484
|
+
Description: f.Description,
|
|
485
|
+
Sequence: f.Sequence,
|
|
486
|
+
SQLBaseType: f.SQLBaseType,
|
|
487
|
+
SQLFullType: f.SQLFullType,
|
|
488
|
+
SourceEntityID: f.SourceEntityID,
|
|
489
|
+
SourceEntity: f.SourceEntity,
|
|
490
|
+
SourceFieldName: f.SourceFieldName,
|
|
491
|
+
IsComputed: f.IsComputed,
|
|
492
|
+
ComputationDescription: f.ComputationDescription,
|
|
493
|
+
IsSummary: f.IsSummary,
|
|
494
|
+
SummaryDescription: f.SummaryDescription
|
|
495
|
+
})),
|
|
496
|
+
Parameters: record.QueryParameters.map(p => ({
|
|
497
|
+
ID: p.ID,
|
|
498
|
+
QueryID: p.QueryID,
|
|
499
|
+
Name: p.Name,
|
|
500
|
+
Description: p.Description,
|
|
501
|
+
Type: p.Type,
|
|
502
|
+
IsRequired: p.IsRequired,
|
|
503
|
+
DefaultValue: p.DefaultValue,
|
|
504
|
+
SampleValue: p.SampleValue,
|
|
505
|
+
ValidationFilters: p.ValidationFilters
|
|
506
|
+
})),
|
|
507
|
+
Entities: record.QueryEntities.map(e => ({
|
|
508
|
+
ID: e.ID,
|
|
509
|
+
QueryID: e.QueryID,
|
|
510
|
+
EntityID: e.EntityID,
|
|
511
|
+
Entity: e.Entity
|
|
512
|
+
})),
|
|
513
|
+
Permissions: record.QueryPermissions.map(p => ({
|
|
514
|
+
ID: p.ID,
|
|
515
|
+
QueryID: p.QueryID,
|
|
516
|
+
RoleID: p.RoleID,
|
|
517
|
+
Role: p.Role
|
|
518
|
+
}))
|
|
381
519
|
};
|
|
382
520
|
}
|
|
383
521
|
else {
|
|
@@ -391,16 +529,56 @@ export class MJQueryResolverExtended extends MJQueryResolver {
|
|
|
391
529
|
LogStatus(`[CreateQuery] Unique constraint detected for query '${input.Name}'. Using existing query (ID: ${existingQuery.ID}) created by concurrent request.`);
|
|
392
530
|
return {
|
|
393
531
|
Success: true,
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
532
|
+
ID: existingQuery.ID,
|
|
533
|
+
Name: existingQuery.Name,
|
|
534
|
+
Description: existingQuery.Description,
|
|
535
|
+
CategoryID: existingQuery.CategoryID,
|
|
536
|
+
Category: existingQuery.Category,
|
|
537
|
+
SQL: existingQuery.SQL,
|
|
538
|
+
Status: existingQuery.Status,
|
|
539
|
+
QualityRank: existingQuery.QualityRank,
|
|
540
|
+
EmbeddingVector: existingQuery.EmbeddingVector,
|
|
541
|
+
EmbeddingModelID: existingQuery.EmbeddingModelID,
|
|
542
|
+
EmbeddingModelName: existingQuery.EmbeddingModel,
|
|
543
|
+
Fields: existingQuery.Fields?.map((f: any) => ({
|
|
544
|
+
ID: f.ID,
|
|
545
|
+
QueryID: f.QueryID,
|
|
546
|
+
Name: f.Name,
|
|
547
|
+
Description: f.Description,
|
|
548
|
+
Sequence: f.Sequence,
|
|
549
|
+
SQLBaseType: f.SQLBaseType,
|
|
550
|
+
SQLFullType: f.SQLFullType,
|
|
551
|
+
SourceEntityID: f.SourceEntityID,
|
|
552
|
+
SourceEntity: f.SourceEntity,
|
|
553
|
+
SourceFieldName: f.SourceFieldName,
|
|
554
|
+
IsComputed: f.IsComputed,
|
|
555
|
+
ComputationDescription: f.ComputationDescription,
|
|
556
|
+
IsSummary: f.IsSummary,
|
|
557
|
+
SummaryDescription: f.SummaryDescription
|
|
558
|
+
})) || [],
|
|
559
|
+
Parameters: existingQuery.Parameters?.map((p: any) => ({
|
|
560
|
+
ID: p.ID,
|
|
561
|
+
QueryID: p.QueryID,
|
|
562
|
+
Name: p.Name,
|
|
563
|
+
Description: p.Description,
|
|
564
|
+
Type: p.Type,
|
|
565
|
+
IsRequired: p.IsRequired,
|
|
566
|
+
DefaultValue: p.DefaultValue,
|
|
567
|
+
SampleValue: p.SampleValue,
|
|
568
|
+
ValidationFilters: p.ValidationFilters
|
|
569
|
+
})) || [],
|
|
570
|
+
Entities: existingQuery.Entities?.map((e: any) => ({
|
|
398
571
|
ID: e.ID,
|
|
399
572
|
QueryID: e.QueryID,
|
|
400
573
|
EntityID: e.EntityID,
|
|
401
|
-
|
|
574
|
+
Entity: e.Entity
|
|
402
575
|
})) || [],
|
|
403
|
-
Permissions: existingQuery.Permissions
|
|
576
|
+
Permissions: existingQuery.Permissions?.map((p: any) => ({
|
|
577
|
+
ID: p.ID,
|
|
578
|
+
QueryID: p.QueryID,
|
|
579
|
+
RoleID: p.RoleID,
|
|
580
|
+
Role: p.Role
|
|
581
|
+
})) || []
|
|
404
582
|
};
|
|
405
583
|
}
|
|
406
584
|
|
|
@@ -437,7 +615,7 @@ export class MJQueryResolverExtended extends MJQueryResolver {
|
|
|
437
615
|
ID: permissionEntity.ID,
|
|
438
616
|
QueryID: permissionEntity.QueryID,
|
|
439
617
|
RoleID: permissionEntity.RoleID,
|
|
440
|
-
|
|
618
|
+
Role: permissionEntity.Role
|
|
441
619
|
});
|
|
442
620
|
}
|
|
443
621
|
}
|
|
@@ -545,51 +723,58 @@ export class MJQueryResolverExtended extends MJQueryResolver {
|
|
|
545
723
|
await queryEntity.RefreshRelatedMetadata(true);
|
|
546
724
|
}
|
|
547
725
|
|
|
548
|
-
// Use the properties from QueryEntityExtended instead of manual loading
|
|
549
|
-
const fields: QueryFieldType[] = queryEntity.QueryFields.map(f => ({
|
|
550
|
-
ID: f.ID,
|
|
551
|
-
QueryID: f.QueryID,
|
|
552
|
-
Name: f.Name,
|
|
553
|
-
Description: f.Description || undefined,
|
|
554
|
-
Type: f.SQLBaseType || undefined,
|
|
555
|
-
Sequence: f.Sequence,
|
|
556
|
-
SQLBaseType: f.SQLBaseType || undefined,
|
|
557
|
-
SQLFullType: f.SQLFullType || undefined,
|
|
558
|
-
IsComputed: f.IsComputed,
|
|
559
|
-
ComputationDescription: f.ComputationDescription || undefined
|
|
560
|
-
}));
|
|
561
|
-
|
|
562
|
-
const parameters: QueryParameterType[] = queryEntity.QueryParameters.map(p => ({
|
|
563
|
-
ID: p.ID,
|
|
564
|
-
QueryID: p.QueryID,
|
|
565
|
-
Name: p.Name,
|
|
566
|
-
Type: p.Type,
|
|
567
|
-
DefaultValue: p.DefaultValue || undefined,
|
|
568
|
-
Comments: '', // Not available in QueryParameterInfo
|
|
569
|
-
IsRequired: p.IsRequired
|
|
570
|
-
}));
|
|
571
|
-
|
|
572
|
-
const entities: QueryEntityType[] = queryEntity.QueryEntities.map(e => ({
|
|
573
|
-
ID: e.ID,
|
|
574
|
-
QueryID: e.QueryID,
|
|
575
|
-
EntityID: e.EntityID,
|
|
576
|
-
EntityName: e.Entity || undefined // Property is called Entity, not EntityName
|
|
577
|
-
}));
|
|
578
|
-
|
|
579
|
-
const permissions: QueryPermissionType[] = queryEntity.QueryPermissions.map(p => ({
|
|
580
|
-
ID: p.ID,
|
|
581
|
-
QueryID: p.QueryID,
|
|
582
|
-
RoleID: p.RoleID,
|
|
583
|
-
RoleName: p.Role || undefined // Property is called Role, not RoleName
|
|
584
|
-
}));
|
|
585
|
-
|
|
586
726
|
return {
|
|
587
727
|
Success: true,
|
|
588
|
-
|
|
589
|
-
|
|
590
|
-
|
|
591
|
-
|
|
592
|
-
|
|
728
|
+
ID: queryEntity.ID,
|
|
729
|
+
Name: queryEntity.Name,
|
|
730
|
+
Description: queryEntity.Description,
|
|
731
|
+
CategoryID: queryEntity.CategoryID,
|
|
732
|
+
Category: queryEntity.Category,
|
|
733
|
+
SQL: queryEntity.SQL,
|
|
734
|
+
Status: queryEntity.Status,
|
|
735
|
+
QualityRank: queryEntity.QualityRank,
|
|
736
|
+
EmbeddingVector: queryEntity.EmbeddingVector,
|
|
737
|
+
EmbeddingModelID: queryEntity.EmbeddingModelID,
|
|
738
|
+
EmbeddingModelName: queryEntity.EmbeddingModel,
|
|
739
|
+
Fields: queryEntity.QueryFields.map(f => ({
|
|
740
|
+
ID: f.ID,
|
|
741
|
+
QueryID: f.QueryID,
|
|
742
|
+
Name: f.Name,
|
|
743
|
+
Description: f.Description,
|
|
744
|
+
Sequence: f.Sequence,
|
|
745
|
+
SQLBaseType: f.SQLBaseType,
|
|
746
|
+
SQLFullType: f.SQLFullType,
|
|
747
|
+
SourceEntityID: f.SourceEntityID,
|
|
748
|
+
SourceEntity: f.SourceEntity,
|
|
749
|
+
SourceFieldName: f.SourceFieldName,
|
|
750
|
+
IsComputed: f.IsComputed,
|
|
751
|
+
ComputationDescription: f.ComputationDescription,
|
|
752
|
+
IsSummary: f.IsSummary,
|
|
753
|
+
SummaryDescription: f.SummaryDescription
|
|
754
|
+
})),
|
|
755
|
+
Parameters: queryEntity.QueryParameters.map(p => ({
|
|
756
|
+
ID: p.ID,
|
|
757
|
+
QueryID: p.QueryID,
|
|
758
|
+
Name: p.Name,
|
|
759
|
+
Description: p.Description,
|
|
760
|
+
Type: p.Type,
|
|
761
|
+
IsRequired: p.IsRequired,
|
|
762
|
+
DefaultValue: p.DefaultValue,
|
|
763
|
+
SampleValue: p.SampleValue,
|
|
764
|
+
ValidationFilters: p.ValidationFilters
|
|
765
|
+
})),
|
|
766
|
+
Entities: queryEntity.QueryEntities.map(e => ({
|
|
767
|
+
ID: e.ID,
|
|
768
|
+
QueryID: e.QueryID,
|
|
769
|
+
EntityID: e.EntityID,
|
|
770
|
+
Entity: e.Entity
|
|
771
|
+
})),
|
|
772
|
+
Permissions: queryEntity.QueryPermissions.map(p => ({
|
|
773
|
+
ID: p.ID,
|
|
774
|
+
QueryID: p.QueryID,
|
|
775
|
+
RoleID: p.RoleID,
|
|
776
|
+
Role: p.Role
|
|
777
|
+
}))
|
|
593
778
|
};
|
|
594
779
|
|
|
595
780
|
} catch (err) {
|
|
@@ -640,7 +825,12 @@ export class MJQueryResolverExtended extends MJQueryResolver {
|
|
|
640
825
|
if (deletedQuery) {
|
|
641
826
|
return {
|
|
642
827
|
Success: true,
|
|
643
|
-
|
|
828
|
+
ID: deletedQuery.ID,
|
|
829
|
+
Name: deletedQuery.Name,
|
|
830
|
+
Description: deletedQuery.Description,
|
|
831
|
+
CategoryID: deletedQuery.CategoryID,
|
|
832
|
+
SQL: deletedQuery.SQL,
|
|
833
|
+
Status: deletedQuery.Status
|
|
644
834
|
};
|
|
645
835
|
} else {
|
|
646
836
|
return {
|