@memberjunction/server 2.15.2 → 2.16.1
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/generated/generated.d.ts +41 -0
- package/dist/generated/generated.d.ts.map +1 -1
- package/dist/generated/generated.js +267 -0
- package/dist/generated/generated.js.map +1 -1
- package/dist/resolvers/AskSkipResolver.d.ts +3 -2
- package/dist/resolvers/AskSkipResolver.d.ts.map +1 -1
- package/dist/resolvers/AskSkipResolver.js +41 -5
- package/dist/resolvers/AskSkipResolver.js.map +1 -1
- package/dist/resolvers/InfoResolver.d.ts +9 -0
- package/dist/resolvers/InfoResolver.d.ts.map +1 -0
- package/dist/resolvers/InfoResolver.js +41 -0
- package/dist/resolvers/InfoResolver.js.map +1 -0
- package/package.json +23 -23
- package/src/generated/generated.ts +167 -1
- package/src/resolvers/AskSkipResolver.ts +50 -7
- package/src/resolvers/InfoResolver.ts +19 -0
|
@@ -6125,6 +6125,7 @@ let Entity_ = class Entity_ {
|
|
|
6125
6125
|
RecordChanges_EntityIDArray;
|
|
6126
6126
|
ApplicationEntities_EntityIDArray;
|
|
6127
6127
|
ResourceTypes_EntityIDArray;
|
|
6128
|
+
QueryEntities_EntityIDArray;
|
|
6128
6129
|
};
|
|
6129
6130
|
__decorate([
|
|
6130
6131
|
Field(),
|
|
@@ -6503,6 +6504,10 @@ __decorate([
|
|
|
6503
6504
|
Field(() => [ResourceType_]),
|
|
6504
6505
|
__metadata("design:type", Array)
|
|
6505
6506
|
], Entity_.prototype, "ResourceTypes_EntityIDArray", void 0);
|
|
6507
|
+
__decorate([
|
|
6508
|
+
Field(() => [QueryEntity_]),
|
|
6509
|
+
__metadata("design:type", Array)
|
|
6510
|
+
], Entity_.prototype, "QueryEntities_EntityIDArray", void 0);
|
|
6506
6511
|
Entity_ = __decorate([
|
|
6507
6512
|
ObjectType({ description: 'Catalog of all entities across all schemas' })
|
|
6508
6513
|
], Entity_);
|
|
@@ -7223,6 +7228,12 @@ let EntityResolverBase = class EntityResolverBase extends ResolverBase {
|
|
|
7223
7228
|
const result = this.ArrayMapFieldNamesToCodeNames('Resource Types', await dataSource.query(sSQL));
|
|
7224
7229
|
return result;
|
|
7225
7230
|
}
|
|
7231
|
+
async QueryEntities_EntityIDArray(entity_, { dataSource, userPayload }, pubSub) {
|
|
7232
|
+
this.CheckUserReadPermissions('Query Entities', userPayload);
|
|
7233
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwQueryEntities] WHERE [EntityID]='${entity_.ID}' ` + this.getRowLevelSecurityWhereClause('Query Entities', userPayload, EntityPermissionType.Read, 'AND');
|
|
7234
|
+
const result = this.ArrayMapFieldNamesToCodeNames('Query Entities', await dataSource.query(sSQL));
|
|
7235
|
+
return result;
|
|
7236
|
+
}
|
|
7226
7237
|
async CreateEntity(input, { dataSource, userPayload }, pubSub) {
|
|
7227
7238
|
return this.CreateRecord('Entities', input, dataSource, userPayload, pubSub);
|
|
7228
7239
|
}
|
|
@@ -7593,6 +7604,15 @@ __decorate([
|
|
|
7593
7604
|
__metadata("design:paramtypes", [Entity_, Object, PubSubEngine]),
|
|
7594
7605
|
__metadata("design:returntype", Promise)
|
|
7595
7606
|
], EntityResolverBase.prototype, "ResourceTypes_EntityIDArray", null);
|
|
7607
|
+
__decorate([
|
|
7608
|
+
FieldResolver(() => [QueryEntity_]),
|
|
7609
|
+
__param(0, Root()),
|
|
7610
|
+
__param(1, Ctx()),
|
|
7611
|
+
__param(2, PubSub()),
|
|
7612
|
+
__metadata("design:type", Function),
|
|
7613
|
+
__metadata("design:paramtypes", [Entity_, Object, PubSubEngine]),
|
|
7614
|
+
__metadata("design:returntype", Promise)
|
|
7615
|
+
], EntityResolverBase.prototype, "QueryEntities_EntityIDArray", null);
|
|
7596
7616
|
__decorate([
|
|
7597
7617
|
Mutation(() => Entity_),
|
|
7598
7618
|
__param(0, Arg('input', () => CreateEntityInput)),
|
|
@@ -25117,6 +25137,7 @@ let Query_ = class Query_ {
|
|
|
25117
25137
|
QueryFields_QueryIDArray;
|
|
25118
25138
|
DataContextItems_QueryIDArray;
|
|
25119
25139
|
QueryPermissions_QueryIDArray;
|
|
25140
|
+
QueryEntities_QueryIDArray;
|
|
25120
25141
|
};
|
|
25121
25142
|
__decorate([
|
|
25122
25143
|
Field(),
|
|
@@ -25197,6 +25218,10 @@ __decorate([
|
|
|
25197
25218
|
Field(() => [QueryPermission_]),
|
|
25198
25219
|
__metadata("design:type", Array)
|
|
25199
25220
|
], Query_.prototype, "QueryPermissions_QueryIDArray", void 0);
|
|
25221
|
+
__decorate([
|
|
25222
|
+
Field(() => [QueryEntity_]),
|
|
25223
|
+
__metadata("design:type", Array)
|
|
25224
|
+
], Query_.prototype, "QueryEntities_QueryIDArray", void 0);
|
|
25200
25225
|
Query_ = __decorate([
|
|
25201
25226
|
ObjectType({ description: 'Catalog of stored queries. This is useful for any arbitrary query that is known to be performant and correct and can be reused. Queries can be viewed/run by a user, used programatically via RunQuery, and also used by AI systems for improved reliability instead of dynamically generated SQL. Queries can also improve security since they store the SQL instead of using dynamic SQL.' })
|
|
25202
25227
|
], Query_);
|
|
@@ -25409,6 +25434,12 @@ let QueryResolver = class QueryResolver extends ResolverBase {
|
|
|
25409
25434
|
const result = this.ArrayMapFieldNamesToCodeNames('Query Permissions', await dataSource.query(sSQL));
|
|
25410
25435
|
return result;
|
|
25411
25436
|
}
|
|
25437
|
+
async QueryEntities_QueryIDArray(query_, { dataSource, userPayload }, pubSub) {
|
|
25438
|
+
this.CheckUserReadPermissions('Query Entities', userPayload);
|
|
25439
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwQueryEntities] WHERE [QueryID]='${query_.ID}' ` + this.getRowLevelSecurityWhereClause('Query Entities', userPayload, EntityPermissionType.Read, 'AND');
|
|
25440
|
+
const result = this.ArrayMapFieldNamesToCodeNames('Query Entities', await dataSource.query(sSQL));
|
|
25441
|
+
return result;
|
|
25442
|
+
}
|
|
25412
25443
|
async CreateQuery(input, { dataSource, userPayload }, pubSub) {
|
|
25413
25444
|
return this.CreateRecord('Queries', input, dataSource, userPayload, pubSub);
|
|
25414
25445
|
}
|
|
@@ -25479,6 +25510,15 @@ __decorate([
|
|
|
25479
25510
|
__metadata("design:paramtypes", [Query_, Object, PubSubEngine]),
|
|
25480
25511
|
__metadata("design:returntype", Promise)
|
|
25481
25512
|
], QueryResolver.prototype, "QueryPermissions_QueryIDArray", null);
|
|
25513
|
+
__decorate([
|
|
25514
|
+
FieldResolver(() => [QueryEntity_]),
|
|
25515
|
+
__param(0, Root()),
|
|
25516
|
+
__param(1, Ctx()),
|
|
25517
|
+
__param(2, PubSub()),
|
|
25518
|
+
__metadata("design:type", Function),
|
|
25519
|
+
__metadata("design:paramtypes", [Query_, Object, PubSubEngine]),
|
|
25520
|
+
__metadata("design:returntype", Promise)
|
|
25521
|
+
], QueryResolver.prototype, "QueryEntities_QueryIDArray", null);
|
|
25482
25522
|
__decorate([
|
|
25483
25523
|
Mutation(() => Query_),
|
|
25484
25524
|
__param(0, Arg('input', () => CreateQueryInput)),
|
|
@@ -42838,6 +42878,233 @@ ResourceLinkResolver = __decorate([
|
|
|
42838
42878
|
Resolver(ResourceLink_)
|
|
42839
42879
|
], ResourceLinkResolver);
|
|
42840
42880
|
export { ResourceLinkResolver };
|
|
42881
|
+
let QueryEntity_ = class QueryEntity_ {
|
|
42882
|
+
ID;
|
|
42883
|
+
QueryID;
|
|
42884
|
+
EntityID;
|
|
42885
|
+
_mj__CreatedAt;
|
|
42886
|
+
_mj__UpdatedAt;
|
|
42887
|
+
Query;
|
|
42888
|
+
Entity;
|
|
42889
|
+
};
|
|
42890
|
+
__decorate([
|
|
42891
|
+
Field({ description: 'Unique identifier for the QueryEntity record.' }),
|
|
42892
|
+
MaxLength(16),
|
|
42893
|
+
__metadata("design:type", String)
|
|
42894
|
+
], QueryEntity_.prototype, "ID", void 0);
|
|
42895
|
+
__decorate([
|
|
42896
|
+
Field({ description: 'References the ID of the query in the Queries table.' }),
|
|
42897
|
+
MaxLength(16),
|
|
42898
|
+
__metadata("design:type", String)
|
|
42899
|
+
], QueryEntity_.prototype, "QueryID", void 0);
|
|
42900
|
+
__decorate([
|
|
42901
|
+
Field({ description: 'References the ID of the entity in the Entities table.' }),
|
|
42902
|
+
MaxLength(16),
|
|
42903
|
+
__metadata("design:type", String)
|
|
42904
|
+
], QueryEntity_.prototype, "EntityID", void 0);
|
|
42905
|
+
__decorate([
|
|
42906
|
+
Field(),
|
|
42907
|
+
MaxLength(10),
|
|
42908
|
+
__metadata("design:type", Date)
|
|
42909
|
+
], QueryEntity_.prototype, "_mj__CreatedAt", void 0);
|
|
42910
|
+
__decorate([
|
|
42911
|
+
Field(),
|
|
42912
|
+
MaxLength(10),
|
|
42913
|
+
__metadata("design:type", Date)
|
|
42914
|
+
], QueryEntity_.prototype, "_mj__UpdatedAt", void 0);
|
|
42915
|
+
__decorate([
|
|
42916
|
+
Field(),
|
|
42917
|
+
MaxLength(510),
|
|
42918
|
+
__metadata("design:type", String)
|
|
42919
|
+
], QueryEntity_.prototype, "Query", void 0);
|
|
42920
|
+
__decorate([
|
|
42921
|
+
Field(),
|
|
42922
|
+
MaxLength(510),
|
|
42923
|
+
__metadata("design:type", String)
|
|
42924
|
+
], QueryEntity_.prototype, "Entity", void 0);
|
|
42925
|
+
QueryEntity_ = __decorate([
|
|
42926
|
+
ObjectType({ description: 'Tracks which entities are involved in a given query. The Queries table stores SQL and descriptions for stored queries that can be executed and serve as examples for AI.' })
|
|
42927
|
+
], QueryEntity_);
|
|
42928
|
+
export { QueryEntity_ };
|
|
42929
|
+
let CreateQueryEntityInput = class CreateQueryEntityInput {
|
|
42930
|
+
QueryID;
|
|
42931
|
+
EntityID;
|
|
42932
|
+
};
|
|
42933
|
+
__decorate([
|
|
42934
|
+
Field(),
|
|
42935
|
+
__metadata("design:type", String)
|
|
42936
|
+
], CreateQueryEntityInput.prototype, "QueryID", void 0);
|
|
42937
|
+
__decorate([
|
|
42938
|
+
Field(),
|
|
42939
|
+
__metadata("design:type", String)
|
|
42940
|
+
], CreateQueryEntityInput.prototype, "EntityID", void 0);
|
|
42941
|
+
CreateQueryEntityInput = __decorate([
|
|
42942
|
+
InputType()
|
|
42943
|
+
], CreateQueryEntityInput);
|
|
42944
|
+
export { CreateQueryEntityInput };
|
|
42945
|
+
let UpdateQueryEntityInput = class UpdateQueryEntityInput {
|
|
42946
|
+
ID;
|
|
42947
|
+
QueryID;
|
|
42948
|
+
EntityID;
|
|
42949
|
+
OldValues___;
|
|
42950
|
+
};
|
|
42951
|
+
__decorate([
|
|
42952
|
+
Field(),
|
|
42953
|
+
__metadata("design:type", String)
|
|
42954
|
+
], UpdateQueryEntityInput.prototype, "ID", void 0);
|
|
42955
|
+
__decorate([
|
|
42956
|
+
Field(),
|
|
42957
|
+
__metadata("design:type", String)
|
|
42958
|
+
], UpdateQueryEntityInput.prototype, "QueryID", void 0);
|
|
42959
|
+
__decorate([
|
|
42960
|
+
Field(),
|
|
42961
|
+
__metadata("design:type", String)
|
|
42962
|
+
], UpdateQueryEntityInput.prototype, "EntityID", void 0);
|
|
42963
|
+
__decorate([
|
|
42964
|
+
Field(() => [KeyValuePairInput], { nullable: true }),
|
|
42965
|
+
__metadata("design:type", Array)
|
|
42966
|
+
], UpdateQueryEntityInput.prototype, "OldValues___", void 0);
|
|
42967
|
+
UpdateQueryEntityInput = __decorate([
|
|
42968
|
+
InputType()
|
|
42969
|
+
], UpdateQueryEntityInput);
|
|
42970
|
+
export { UpdateQueryEntityInput };
|
|
42971
|
+
let RunQueryEntityViewResult = class RunQueryEntityViewResult {
|
|
42972
|
+
Results;
|
|
42973
|
+
UserViewRunID;
|
|
42974
|
+
RowCount;
|
|
42975
|
+
TotalRowCount;
|
|
42976
|
+
ExecutionTime;
|
|
42977
|
+
ErrorMessage;
|
|
42978
|
+
Success;
|
|
42979
|
+
};
|
|
42980
|
+
__decorate([
|
|
42981
|
+
Field(() => [QueryEntity_]),
|
|
42982
|
+
__metadata("design:type", Array)
|
|
42983
|
+
], RunQueryEntityViewResult.prototype, "Results", void 0);
|
|
42984
|
+
__decorate([
|
|
42985
|
+
Field(() => String, { nullable: true }),
|
|
42986
|
+
__metadata("design:type", String)
|
|
42987
|
+
], RunQueryEntityViewResult.prototype, "UserViewRunID", void 0);
|
|
42988
|
+
__decorate([
|
|
42989
|
+
Field(() => Int, { nullable: true }),
|
|
42990
|
+
__metadata("design:type", Number)
|
|
42991
|
+
], RunQueryEntityViewResult.prototype, "RowCount", void 0);
|
|
42992
|
+
__decorate([
|
|
42993
|
+
Field(() => Int, { nullable: true }),
|
|
42994
|
+
__metadata("design:type", Number)
|
|
42995
|
+
], RunQueryEntityViewResult.prototype, "TotalRowCount", void 0);
|
|
42996
|
+
__decorate([
|
|
42997
|
+
Field(() => Int, { nullable: true }),
|
|
42998
|
+
__metadata("design:type", Number)
|
|
42999
|
+
], RunQueryEntityViewResult.prototype, "ExecutionTime", void 0);
|
|
43000
|
+
__decorate([
|
|
43001
|
+
Field({ nullable: true }),
|
|
43002
|
+
__metadata("design:type", String)
|
|
43003
|
+
], RunQueryEntityViewResult.prototype, "ErrorMessage", void 0);
|
|
43004
|
+
__decorate([
|
|
43005
|
+
Field(() => Boolean, { nullable: false }),
|
|
43006
|
+
__metadata("design:type", Boolean)
|
|
43007
|
+
], RunQueryEntityViewResult.prototype, "Success", void 0);
|
|
43008
|
+
RunQueryEntityViewResult = __decorate([
|
|
43009
|
+
ObjectType()
|
|
43010
|
+
], RunQueryEntityViewResult);
|
|
43011
|
+
export { RunQueryEntityViewResult };
|
|
43012
|
+
let QueryEntityResolver = class QueryEntityResolver extends ResolverBase {
|
|
43013
|
+
async RunQueryEntityViewByID(input, { dataSource, userPayload }, pubSub) {
|
|
43014
|
+
return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
|
|
43015
|
+
}
|
|
43016
|
+
async RunQueryEntityViewByName(input, { dataSource, userPayload }, pubSub) {
|
|
43017
|
+
return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
|
|
43018
|
+
}
|
|
43019
|
+
async RunQueryEntityDynamicView(input, { dataSource, userPayload }, pubSub) {
|
|
43020
|
+
input.EntityName = 'Query Entities';
|
|
43021
|
+
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
43022
|
+
}
|
|
43023
|
+
async QueryEntity(ID, { dataSource, userPayload }, pubSub) {
|
|
43024
|
+
this.CheckUserReadPermissions('Query Entities', userPayload);
|
|
43025
|
+
const sSQL = `SELECT * FROM [${Metadata.Provider.ConfigData.MJCoreSchemaName}].[vwQueryEntities] WHERE [ID]='${ID}' ` + this.getRowLevelSecurityWhereClause('Query Entities', userPayload, EntityPermissionType.Read, 'AND');
|
|
43026
|
+
const result = this.MapFieldNamesToCodeNames('Query Entities', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}));
|
|
43027
|
+
return result;
|
|
43028
|
+
}
|
|
43029
|
+
async CreateQueryEntity(input, { dataSource, userPayload }, pubSub) {
|
|
43030
|
+
return this.CreateRecord('Query Entities', input, dataSource, userPayload, pubSub);
|
|
43031
|
+
}
|
|
43032
|
+
async UpdateQueryEntity(input, { dataSource, userPayload }, pubSub) {
|
|
43033
|
+
return this.UpdateRecord('Query Entities', input, dataSource, userPayload, pubSub);
|
|
43034
|
+
}
|
|
43035
|
+
async DeleteQueryEntity(ID, options, { dataSource, userPayload }, pubSub) {
|
|
43036
|
+
const key = new CompositeKey([{ FieldName: 'ID', Value: ID }]);
|
|
43037
|
+
return this.DeleteRecord('Query Entities', key, options, dataSource, userPayload, pubSub);
|
|
43038
|
+
}
|
|
43039
|
+
};
|
|
43040
|
+
__decorate([
|
|
43041
|
+
Query(() => RunQueryEntityViewResult),
|
|
43042
|
+
__param(0, Arg('input', () => RunViewByIDInput)),
|
|
43043
|
+
__param(1, Ctx()),
|
|
43044
|
+
__param(2, PubSub()),
|
|
43045
|
+
__metadata("design:type", Function),
|
|
43046
|
+
__metadata("design:paramtypes", [RunViewByIDInput, Object, PubSubEngine]),
|
|
43047
|
+
__metadata("design:returntype", Promise)
|
|
43048
|
+
], QueryEntityResolver.prototype, "RunQueryEntityViewByID", null);
|
|
43049
|
+
__decorate([
|
|
43050
|
+
Query(() => RunQueryEntityViewResult),
|
|
43051
|
+
__param(0, Arg('input', () => RunViewByNameInput)),
|
|
43052
|
+
__param(1, Ctx()),
|
|
43053
|
+
__param(2, PubSub()),
|
|
43054
|
+
__metadata("design:type", Function),
|
|
43055
|
+
__metadata("design:paramtypes", [RunViewByNameInput, Object, PubSubEngine]),
|
|
43056
|
+
__metadata("design:returntype", Promise)
|
|
43057
|
+
], QueryEntityResolver.prototype, "RunQueryEntityViewByName", null);
|
|
43058
|
+
__decorate([
|
|
43059
|
+
Query(() => RunQueryEntityViewResult),
|
|
43060
|
+
__param(0, Arg('input', () => RunDynamicViewInput)),
|
|
43061
|
+
__param(1, Ctx()),
|
|
43062
|
+
__param(2, PubSub()),
|
|
43063
|
+
__metadata("design:type", Function),
|
|
43064
|
+
__metadata("design:paramtypes", [RunDynamicViewInput, Object, PubSubEngine]),
|
|
43065
|
+
__metadata("design:returntype", Promise)
|
|
43066
|
+
], QueryEntityResolver.prototype, "RunQueryEntityDynamicView", null);
|
|
43067
|
+
__decorate([
|
|
43068
|
+
Query(() => QueryEntity_, { nullable: true }),
|
|
43069
|
+
__param(0, Arg('ID', () => String)),
|
|
43070
|
+
__param(1, Ctx()),
|
|
43071
|
+
__param(2, PubSub()),
|
|
43072
|
+
__metadata("design:type", Function),
|
|
43073
|
+
__metadata("design:paramtypes", [String, Object, PubSubEngine]),
|
|
43074
|
+
__metadata("design:returntype", Promise)
|
|
43075
|
+
], QueryEntityResolver.prototype, "QueryEntity", null);
|
|
43076
|
+
__decorate([
|
|
43077
|
+
Mutation(() => QueryEntity_),
|
|
43078
|
+
__param(0, Arg('input', () => CreateQueryEntityInput)),
|
|
43079
|
+
__param(1, Ctx()),
|
|
43080
|
+
__param(2, PubSub()),
|
|
43081
|
+
__metadata("design:type", Function),
|
|
43082
|
+
__metadata("design:paramtypes", [CreateQueryEntityInput, Object, PubSubEngine]),
|
|
43083
|
+
__metadata("design:returntype", Promise)
|
|
43084
|
+
], QueryEntityResolver.prototype, "CreateQueryEntity", null);
|
|
43085
|
+
__decorate([
|
|
43086
|
+
Mutation(() => QueryEntity_),
|
|
43087
|
+
__param(0, Arg('input', () => UpdateQueryEntityInput)),
|
|
43088
|
+
__param(1, Ctx()),
|
|
43089
|
+
__param(2, PubSub()),
|
|
43090
|
+
__metadata("design:type", Function),
|
|
43091
|
+
__metadata("design:paramtypes", [UpdateQueryEntityInput, Object, PubSubEngine]),
|
|
43092
|
+
__metadata("design:returntype", Promise)
|
|
43093
|
+
], QueryEntityResolver.prototype, "UpdateQueryEntity", null);
|
|
43094
|
+
__decorate([
|
|
43095
|
+
Mutation(() => QueryEntity_),
|
|
43096
|
+
__param(0, Arg('ID', () => String)),
|
|
43097
|
+
__param(1, Arg('options___', () => DeleteOptionsInput)),
|
|
43098
|
+
__param(2, Ctx()),
|
|
43099
|
+
__param(3, PubSub()),
|
|
43100
|
+
__metadata("design:type", Function),
|
|
43101
|
+
__metadata("design:paramtypes", [String, DeleteOptionsInput, Object, PubSubEngine]),
|
|
43102
|
+
__metadata("design:returntype", Promise)
|
|
43103
|
+
], QueryEntityResolver.prototype, "DeleteQueryEntity", null);
|
|
43104
|
+
QueryEntityResolver = __decorate([
|
|
43105
|
+
Resolver(QueryEntity_)
|
|
43106
|
+
], QueryEntityResolver);
|
|
43107
|
+
export { QueryEntityResolver };
|
|
42841
43108
|
let ContentProcessRun_ = class ContentProcessRun_ {
|
|
42842
43109
|
ID;
|
|
42843
43110
|
SourceID;
|