@memberjunction/server 0.9.142 → 0.9.151
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/build.log.json +21 -0
- package/dist/generated/generated.js +1616 -1
- package/dist/generated/generated.js.map +1 -1
- package/dist/resolvers/AskSkipResolver.js +145 -154
- package/dist/resolvers/AskSkipResolver.js.map +1 -1
- package/package.json +9 -8
- package/src/generated/generated.ts +1251 -2
- package/src/resolvers/AskSkipResolver.ts +184 -172
- package/tsconfig.json +2 -1
|
@@ -18,7 +18,7 @@ exports.RecordChangeResolver = exports.RunRecordChangeViewResult = exports.Creat
|
|
|
18
18
|
exports.UpdateQueueInput = exports.CreateQueueInput = exports.Queue_ = exports.QueueTypeResolver = exports.RunQueueTypeViewResult = exports.QueueType_ = exports.AIModelTypeResolver = exports.RunAIModelTypeViewResult = exports.UpdateAIModelTypeInput = exports.AIModelType_ = exports.EntityAIActionResolver = exports.RunEntityAIActionViewResult = exports.UpdateEntityAIActionInput = exports.EntityAIAction_ = exports.AIModelActionResolver = exports.RunAIModelActionViewResult = exports.UpdateAIModelActionInput = exports.AIModelAction_ = exports.AIActionResolver = exports.RunAIActionViewResult = exports.UpdateAIActionInput = exports.AIAction_ = exports.AIModelResolver = exports.RunAIModelViewResult = exports.UpdateAIModelInput = exports.AIModel_ = exports.EntityFieldValueResolver = exports.RunEntityFieldValueViewResult = exports.EntityFieldValue_ = exports.AuditLogTypeResolver = exports.RunAuditLogTypeViewResult = exports.AuditLogType_ = exports.AuthorizationRoleResolver = exports.RunAuthorizationRoleViewResult = exports.AuthorizationRole_ = exports.AuthorizationResolver = exports.RunAuthorizationViewResult = exports.Authorization_ = exports.AuditLogResolver = exports.RunAuditLogViewResult = exports.UpdateAuditLogInput = exports.CreateAuditLogInput = exports.AuditLog_ = exports.RowLevelSecurityFilterResolver = exports.RunRowLevelSecurityFilterViewResult = exports.RowLevelSecurityFilter_ = exports.UserRoleResolver = exports.RunUserRoleViewResult = exports.CreateUserRoleInput = exports.UserRole_ = void 0;
|
|
19
19
|
exports.WorkspaceItemResolver = exports.RunWorkspaceItemViewResult = exports.UpdateWorkspaceItemInput = exports.CreateWorkspaceItemInput = exports.WorkspaceItem_ = exports.WorkspaceResolver = exports.RunWorkspaceViewResult = exports.UpdateWorkspaceInput = exports.CreateWorkspaceInput = exports.Workspace_ = exports.TaggedItemResolver = exports.RunTaggedItemViewResult = exports.TaggedItem_ = exports.TagResolver = exports.RunTagViewResult = exports.Tag_ = exports.ResourceTypeResolver = exports.RunResourceTypeViewResult = exports.ResourceType_ = exports.ReportSnapshotResolver = exports.RunReportSnapshotViewResult = exports.UpdateReportSnapshotInput = exports.CreateReportSnapshotInput = exports.ReportSnapshot_ = exports.ReportResolver = exports.RunReportViewResult = exports.UpdateReportInput = exports.CreateReportInput = exports.Report_ = exports.OutputDeliveryTypeResolver = exports.RunOutputDeliveryTypeViewResult = exports.OutputDeliveryType_ = exports.OutputFormatTypeResolver = exports.RunOutputFormatTypeViewResult = exports.OutputFormatType_ = exports.OutputTriggerTypeResolver = exports.RunOutputTriggerTypeViewResult = exports.OutputTriggerType_ = exports.DashboardResolver = exports.RunDashboardViewResult = exports.UpdateDashboardInput = exports.CreateDashboardInput = exports.Dashboard_ = exports.QueueTaskResolver = exports.RunQueueTaskViewResult = exports.UpdateQueueTaskInput = exports.CreateQueueTaskInput = exports.QueueTask_ = exports.QueueResolver = exports.RunQueueViewResult = void 0;
|
|
20
20
|
exports.RunQueryFieldViewResult = exports.UpdateQueryFieldInput = exports.CreateQueryFieldInput = exports.QueryField_ = exports.RecordMergeDeletionLogResolver = exports.RunRecordMergeDeletionLogViewResult = exports.UpdateRecordMergeDeletionLogInput = exports.CreateRecordMergeDeletionLogInput = exports.RecordMergeDeletionLog_ = exports.RecordMergeLogResolver = exports.RunRecordMergeLogViewResult = exports.UpdateRecordMergeLogInput = exports.CreateRecordMergeLogInput = exports.RecordMergeLog_ = exports.CompanyIntegrationRecordMapResolver = exports.RunCompanyIntegrationRecordMapViewResult = exports.UpdateCompanyIntegrationRecordMapInput = exports.CreateCompanyIntegrationRecordMapInput = exports.CompanyIntegrationRecordMap_ = exports.SchemaInfoResolver = exports.RunSchemaInfoViewResult = exports.UpdateSchemaInfoInput = exports.CreateSchemaInfoInput = exports.SchemaInfo_ = exports.ResourceFolderResolver = exports.RunResourceFolderViewResult = exports.UpdateResourceFolderInput = exports.CreateResourceFolderInput = exports.ResourceFolder_ = exports.UserNotificationResolver = exports.RunUserNotificationViewResult = exports.UpdateUserNotificationInput = exports.CreateUserNotificationInput = exports.UserNotification_ = exports.ConversationResolver = exports.RunConversationViewResult = exports.UpdateConversationInput = exports.CreateConversationInput = exports.Conversation_ = exports.ConversationDetailResolver = exports.RunConversationDetailViewResult = exports.UpdateConversationDetailInput = exports.CreateConversationDetailInput = exports.ConversationDetail_ = exports.DatasetItemResolver = exports.RunDatasetItemViewResult = exports.DatasetItem_ = exports.DatasetResolver = exports.RunDatasetViewResult = exports.Dataset_ = void 0;
|
|
21
|
-
exports.QueryPermissionResolver = exports.RunQueryPermissionViewResult = exports.UpdateQueryPermissionInput = exports.CreateQueryPermissionInput = exports.QueryPermission_ = exports.QueryResolver = exports.RunQueryViewResult = exports.UpdateQueryInput = exports.CreateQueryInput = exports.Query_ = exports.QueryCategoryResolver = exports.RunQueryCategoryViewResult = exports.UpdateQueryCategoryInput = exports.CreateQueryCategoryInput = exports.QueryCategory_ = exports.QueryFieldResolver = void 0;
|
|
21
|
+
exports.EntityDocumentResolver = exports.RunEntityDocumentViewResult = exports.UpdateEntityDocumentInput = exports.CreateEntityDocumentInput = exports.EntityDocument_ = exports.EntityRecordDocumentResolver = exports.RunEntityRecordDocumentViewResult = exports.UpdateEntityRecordDocumentInput = exports.CreateEntityRecordDocumentInput = exports.EntityRecordDocument_ = exports.VectorDatabaseResolver = exports.RunVectorDatabaseViewResult = exports.UpdateVectorDatabaseInput = exports.CreateVectorDatabaseInput = exports.VectorDatabase_ = exports.EntityDocumentRunResolver = exports.RunEntityDocumentRunViewResult = exports.UpdateEntityDocumentRunInput = exports.CreateEntityDocumentRunInput = exports.EntityDocumentRun_ = exports.EntityDocumentTypeResolver = exports.RunEntityDocumentTypeViewResult = exports.UpdateEntityDocumentTypeInput = exports.CreateEntityDocumentTypeInput = exports.EntityDocumentType_ = exports.VectorIndexResolver = exports.RunVectorIndexViewResult = exports.UpdateVectorIndexInput = exports.CreateVectorIndexInput = exports.VectorIndex_ = exports.QueryPermissionResolver = exports.RunQueryPermissionViewResult = exports.UpdateQueryPermissionInput = exports.CreateQueryPermissionInput = exports.QueryPermission_ = exports.QueryResolver = exports.RunQueryViewResult = exports.UpdateQueryInput = exports.CreateQueryInput = exports.Query_ = exports.QueryCategoryResolver = exports.RunQueryCategoryViewResult = exports.UpdateQueryCategoryInput = exports.CreateQueryCategoryInput = exports.QueryCategory_ = exports.QueryFieldResolver = void 0;
|
|
22
22
|
const server_1 = require("@memberjunction/server");
|
|
23
23
|
const core_1 = require("@memberjunction/core");
|
|
24
24
|
const class_validator_1 = require("class-validator");
|
|
@@ -3859,6 +3859,14 @@ __decorate([
|
|
|
3859
3859
|
(0, server_1.Field)(() => [QueryField_]),
|
|
3860
3860
|
__metadata("design:type", Array)
|
|
3861
3861
|
], Entity_.prototype, "QueryFieldsArray", void 0);
|
|
3862
|
+
__decorate([
|
|
3863
|
+
(0, server_1.Field)(() => [Conversation_]),
|
|
3864
|
+
__metadata("design:type", Array)
|
|
3865
|
+
], Entity_.prototype, "ConversationsArray", void 0);
|
|
3866
|
+
__decorate([
|
|
3867
|
+
(0, server_1.Field)(() => [EntityDocument_]),
|
|
3868
|
+
__metadata("design:type", Array)
|
|
3869
|
+
], Entity_.prototype, "EntityDocumentsArray", void 0);
|
|
3862
3870
|
exports.Entity_ = Entity_ = __decorate([
|
|
3863
3871
|
(0, server_1.ObjectType)({ description: 'Metadata about all of the entities in the system. This information is managed by CodeGen, don\'t modify the parts that come from SQL Server' })
|
|
3864
3872
|
], Entity_);
|
|
@@ -4345,6 +4353,18 @@ let EntityResolverBase = class EntityResolverBase extends server_1.ResolverBase
|
|
|
4345
4353
|
const result = this.ArrayMapFieldNamesToCodeNames('Query Fields', await dataSource.query(sSQL));
|
|
4346
4354
|
return result;
|
|
4347
4355
|
}
|
|
4356
|
+
async ConversationsArray(entity_, { dataSource, userPayload }, pubSub) {
|
|
4357
|
+
this.CheckUserReadPermissions('Conversations', userPayload);
|
|
4358
|
+
const sSQL = `SELECT * FROM [admin].[vwConversations] WHERE [LinkedEntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Conversations', userPayload, core_1.EntityPermissionType.Read, 'AND');
|
|
4359
|
+
const result = this.ArrayMapFieldNamesToCodeNames('Conversations', await dataSource.query(sSQL));
|
|
4360
|
+
return result;
|
|
4361
|
+
}
|
|
4362
|
+
async EntityDocumentsArray(entity_, { dataSource, userPayload }, pubSub) {
|
|
4363
|
+
this.CheckUserReadPermissions('Entity Documents', userPayload);
|
|
4364
|
+
const sSQL = `SELECT * FROM [admin].[vwEntityDocuments] WHERE [EntityID]=${entity_.ID} ` + this.getRowLevelSecurityWhereClause('Entity Documents', userPayload, core_1.EntityPermissionType.Read, 'AND');
|
|
4365
|
+
const result = this.ArrayMapFieldNamesToCodeNames('Entity Documents', await dataSource.query(sSQL));
|
|
4366
|
+
return result;
|
|
4367
|
+
}
|
|
4348
4368
|
async CreateEntity(input, { dataSource, userPayload }, pubSub) {
|
|
4349
4369
|
if (await this.BeforeCreate(dataSource, input)) {
|
|
4350
4370
|
const entityObject = await new core_1.Metadata().GetEntityObject('Entities', this.GetUserFromPayload(userPayload));
|
|
@@ -4643,6 +4663,24 @@ __decorate([
|
|
|
4643
4663
|
__metadata("design:paramtypes", [Entity_, Object, server_1.PubSubEngine]),
|
|
4644
4664
|
__metadata("design:returntype", Promise)
|
|
4645
4665
|
], EntityResolverBase.prototype, "QueryFieldsArray", null);
|
|
4666
|
+
__decorate([
|
|
4667
|
+
(0, server_1.FieldResolver)(() => [Conversation_]),
|
|
4668
|
+
__param(0, (0, server_1.Root)()),
|
|
4669
|
+
__param(1, (0, server_1.Ctx)()),
|
|
4670
|
+
__param(2, (0, server_1.PubSub)()),
|
|
4671
|
+
__metadata("design:type", Function),
|
|
4672
|
+
__metadata("design:paramtypes", [Entity_, Object, server_1.PubSubEngine]),
|
|
4673
|
+
__metadata("design:returntype", Promise)
|
|
4674
|
+
], EntityResolverBase.prototype, "ConversationsArray", null);
|
|
4675
|
+
__decorate([
|
|
4676
|
+
(0, server_1.FieldResolver)(() => [EntityDocument_]),
|
|
4677
|
+
__param(0, (0, server_1.Root)()),
|
|
4678
|
+
__param(1, (0, server_1.Ctx)()),
|
|
4679
|
+
__param(2, (0, server_1.PubSub)()),
|
|
4680
|
+
__metadata("design:type", Function),
|
|
4681
|
+
__metadata("design:paramtypes", [Entity_, Object, server_1.PubSubEngine]),
|
|
4682
|
+
__metadata("design:returntype", Promise)
|
|
4683
|
+
], EntityResolverBase.prototype, "EntityDocumentsArray", null);
|
|
4646
4684
|
__decorate([
|
|
4647
4685
|
(0, server_1.Mutation)(() => Entity_),
|
|
4648
4686
|
__param(0, (0, server_1.Arg)('input', () => CreateEntityInput)),
|
|
@@ -12124,6 +12162,10 @@ __decorate([
|
|
|
12124
12162
|
(0, server_1.Field)(() => [EntityAIAction_]),
|
|
12125
12163
|
__metadata("design:type", Array)
|
|
12126
12164
|
], AIModel_.prototype, "EntityAIActionsArray", void 0);
|
|
12165
|
+
__decorate([
|
|
12166
|
+
(0, server_1.Field)(() => [VectorIndex_]),
|
|
12167
|
+
__metadata("design:type", Array)
|
|
12168
|
+
], AIModel_.prototype, "VectorIndexesArray", void 0);
|
|
12127
12169
|
exports.AIModel_ = AIModel_ = __decorate([
|
|
12128
12170
|
(0, server_1.ObjectType)()
|
|
12129
12171
|
], AIModel_);
|
|
@@ -12240,6 +12282,12 @@ let AIModelResolver = class AIModelResolver extends server_1.ResolverBase {
|
|
|
12240
12282
|
const result = this.ArrayMapFieldNamesToCodeNames('Entity AI Actions', await dataSource.query(sSQL));
|
|
12241
12283
|
return result;
|
|
12242
12284
|
}
|
|
12285
|
+
async VectorIndexesArray(aimodel_, { dataSource, userPayload }, pubSub) {
|
|
12286
|
+
this.CheckUserReadPermissions('Vector Indexes', userPayload);
|
|
12287
|
+
const sSQL = `SELECT * FROM [admin].[vwVectorIndexes] WHERE [EmbeddingModelID]=${aimodel_.ID} ` + this.getRowLevelSecurityWhereClause('Vector Indexes', userPayload, core_1.EntityPermissionType.Read, 'AND');
|
|
12288
|
+
const result = this.ArrayMapFieldNamesToCodeNames('Vector Indexes', await dataSource.query(sSQL));
|
|
12289
|
+
return result;
|
|
12290
|
+
}
|
|
12243
12291
|
async UpdateAIModel(input, { dataSource, userPayload }, pubSub) {
|
|
12244
12292
|
if (await this.BeforeUpdate(dataSource, input)) {
|
|
12245
12293
|
const entityObject = await new core_1.Metadata().GetEntityObject('AI Models', this.GetUserFromPayload(userPayload));
|
|
@@ -12334,6 +12382,15 @@ __decorate([
|
|
|
12334
12382
|
__metadata("design:paramtypes", [AIModel_, Object, server_1.PubSubEngine]),
|
|
12335
12383
|
__metadata("design:returntype", Promise)
|
|
12336
12384
|
], AIModelResolver.prototype, "EntityAIActionsArray", null);
|
|
12385
|
+
__decorate([
|
|
12386
|
+
(0, server_1.FieldResolver)(() => [VectorIndex_]),
|
|
12387
|
+
__param(0, (0, server_1.Root)()),
|
|
12388
|
+
__param(1, (0, server_1.Ctx)()),
|
|
12389
|
+
__param(2, (0, server_1.PubSub)()),
|
|
12390
|
+
__metadata("design:type", Function),
|
|
12391
|
+
__metadata("design:paramtypes", [AIModel_, Object, server_1.PubSubEngine]),
|
|
12392
|
+
__metadata("design:returntype", Promise)
|
|
12393
|
+
], AIModelResolver.prototype, "VectorIndexesArray", null);
|
|
12337
12394
|
__decorate([
|
|
12338
12395
|
(0, server_1.Mutation)(() => AIModel_),
|
|
12339
12396
|
__param(0, (0, server_1.Arg)('input', () => UpdateAIModelInput)),
|
|
@@ -17159,6 +17216,14 @@ __decorate([
|
|
|
17159
17216
|
(0, class_validator_1.MaxLength)(100),
|
|
17160
17217
|
__metadata("design:type", String)
|
|
17161
17218
|
], Conversation_.prototype, "Type", void 0);
|
|
17219
|
+
__decorate([
|
|
17220
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
17221
|
+
__metadata("design:type", Number)
|
|
17222
|
+
], Conversation_.prototype, "LinkedEntityID", void 0);
|
|
17223
|
+
__decorate([
|
|
17224
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
17225
|
+
__metadata("design:type", Number)
|
|
17226
|
+
], Conversation_.prototype, "LinkedRecordID", void 0);
|
|
17162
17227
|
__decorate([
|
|
17163
17228
|
(0, server_1.Field)(),
|
|
17164
17229
|
(0, class_validator_1.MaxLength)(8),
|
|
@@ -17174,6 +17239,11 @@ __decorate([
|
|
|
17174
17239
|
(0, class_validator_1.MaxLength)(200),
|
|
17175
17240
|
__metadata("design:type", String)
|
|
17176
17241
|
], Conversation_.prototype, "User", void 0);
|
|
17242
|
+
__decorate([
|
|
17243
|
+
(0, server_1.Field)({ nullable: true }),
|
|
17244
|
+
(0, class_validator_1.MaxLength)(510),
|
|
17245
|
+
__metadata("design:type", String)
|
|
17246
|
+
], Conversation_.prototype, "LinkedEntity", void 0);
|
|
17177
17247
|
__decorate([
|
|
17178
17248
|
(0, server_1.Field)(() => [ConversationDetail_]),
|
|
17179
17249
|
__metadata("design:type", Array)
|
|
@@ -17208,6 +17278,14 @@ __decorate([
|
|
|
17208
17278
|
(0, server_1.Field)(),
|
|
17209
17279
|
__metadata("design:type", String)
|
|
17210
17280
|
], CreateConversationInput.prototype, "Type", void 0);
|
|
17281
|
+
__decorate([
|
|
17282
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
17283
|
+
__metadata("design:type", Number)
|
|
17284
|
+
], CreateConversationInput.prototype, "LinkedEntityID", void 0);
|
|
17285
|
+
__decorate([
|
|
17286
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
17287
|
+
__metadata("design:type", Number)
|
|
17288
|
+
], CreateConversationInput.prototype, "LinkedRecordID", void 0);
|
|
17211
17289
|
exports.CreateConversationInput = CreateConversationInput = __decorate([
|
|
17212
17290
|
(0, server_1.InputType)()
|
|
17213
17291
|
], CreateConversationInput);
|
|
@@ -17238,6 +17316,14 @@ __decorate([
|
|
|
17238
17316
|
(0, server_1.Field)(),
|
|
17239
17317
|
__metadata("design:type", String)
|
|
17240
17318
|
], UpdateConversationInput.prototype, "Type", void 0);
|
|
17319
|
+
__decorate([
|
|
17320
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
17321
|
+
__metadata("design:type", Number)
|
|
17322
|
+
], UpdateConversationInput.prototype, "LinkedEntityID", void 0);
|
|
17323
|
+
__decorate([
|
|
17324
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
17325
|
+
__metadata("design:type", Number)
|
|
17326
|
+
], UpdateConversationInput.prototype, "LinkedRecordID", void 0);
|
|
17241
17327
|
exports.UpdateConversationInput = UpdateConversationInput = __decorate([
|
|
17242
17328
|
(0, server_1.InputType)()
|
|
17243
17329
|
], UpdateConversationInput);
|
|
@@ -20203,4 +20289,1533 @@ __decorate([
|
|
|
20203
20289
|
exports.QueryPermissionResolver = QueryPermissionResolver = __decorate([
|
|
20204
20290
|
(0, server_1.Resolver)(QueryPermission_)
|
|
20205
20291
|
], QueryPermissionResolver);
|
|
20292
|
+
let VectorIndex_ = class VectorIndex_ {
|
|
20293
|
+
};
|
|
20294
|
+
exports.VectorIndex_ = VectorIndex_;
|
|
20295
|
+
__decorate([
|
|
20296
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
20297
|
+
__metadata("design:type", Number)
|
|
20298
|
+
], VectorIndex_.prototype, "ID", void 0);
|
|
20299
|
+
__decorate([
|
|
20300
|
+
(0, server_1.Field)(),
|
|
20301
|
+
(0, class_validator_1.MaxLength)(510),
|
|
20302
|
+
__metadata("design:type", String)
|
|
20303
|
+
], VectorIndex_.prototype, "Name", void 0);
|
|
20304
|
+
__decorate([
|
|
20305
|
+
(0, server_1.Field)({ nullable: true }),
|
|
20306
|
+
__metadata("design:type", String)
|
|
20307
|
+
], VectorIndex_.prototype, "Description", void 0);
|
|
20308
|
+
__decorate([
|
|
20309
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
20310
|
+
__metadata("design:type", Number)
|
|
20311
|
+
], VectorIndex_.prototype, "VectorDatabaseID", void 0);
|
|
20312
|
+
__decorate([
|
|
20313
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
20314
|
+
__metadata("design:type", Number)
|
|
20315
|
+
], VectorIndex_.prototype, "EmbeddingModelID", void 0);
|
|
20316
|
+
__decorate([
|
|
20317
|
+
(0, server_1.Field)(),
|
|
20318
|
+
(0, class_validator_1.MaxLength)(8),
|
|
20319
|
+
__metadata("design:type", Date)
|
|
20320
|
+
], VectorIndex_.prototype, "CreatedAt", void 0);
|
|
20321
|
+
__decorate([
|
|
20322
|
+
(0, server_1.Field)(),
|
|
20323
|
+
(0, class_validator_1.MaxLength)(8),
|
|
20324
|
+
__metadata("design:type", Date)
|
|
20325
|
+
], VectorIndex_.prototype, "UpdatedAt", void 0);
|
|
20326
|
+
__decorate([
|
|
20327
|
+
(0, server_1.Field)(),
|
|
20328
|
+
(0, class_validator_1.MaxLength)(200),
|
|
20329
|
+
__metadata("design:type", String)
|
|
20330
|
+
], VectorIndex_.prototype, "VectorDatabase", void 0);
|
|
20331
|
+
__decorate([
|
|
20332
|
+
(0, server_1.Field)(),
|
|
20333
|
+
(0, class_validator_1.MaxLength)(100),
|
|
20334
|
+
__metadata("design:type", String)
|
|
20335
|
+
], VectorIndex_.prototype, "EmbeddingModel", void 0);
|
|
20336
|
+
exports.VectorIndex_ = VectorIndex_ = __decorate([
|
|
20337
|
+
(0, server_1.ObjectType)()
|
|
20338
|
+
], VectorIndex_);
|
|
20339
|
+
let CreateVectorIndexInput = class CreateVectorIndexInput {
|
|
20340
|
+
};
|
|
20341
|
+
exports.CreateVectorIndexInput = CreateVectorIndexInput;
|
|
20342
|
+
__decorate([
|
|
20343
|
+
(0, server_1.Field)(),
|
|
20344
|
+
__metadata("design:type", String)
|
|
20345
|
+
], CreateVectorIndexInput.prototype, "Name", void 0);
|
|
20346
|
+
__decorate([
|
|
20347
|
+
(0, server_1.Field)({ nullable: true }),
|
|
20348
|
+
__metadata("design:type", String)
|
|
20349
|
+
], CreateVectorIndexInput.prototype, "Description", void 0);
|
|
20350
|
+
__decorate([
|
|
20351
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
20352
|
+
__metadata("design:type", Number)
|
|
20353
|
+
], CreateVectorIndexInput.prototype, "VectorDatabaseID", void 0);
|
|
20354
|
+
__decorate([
|
|
20355
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
20356
|
+
__metadata("design:type", Number)
|
|
20357
|
+
], CreateVectorIndexInput.prototype, "EmbeddingModelID", void 0);
|
|
20358
|
+
exports.CreateVectorIndexInput = CreateVectorIndexInput = __decorate([
|
|
20359
|
+
(0, server_1.InputType)()
|
|
20360
|
+
], CreateVectorIndexInput);
|
|
20361
|
+
let UpdateVectorIndexInput = class UpdateVectorIndexInput {
|
|
20362
|
+
};
|
|
20363
|
+
exports.UpdateVectorIndexInput = UpdateVectorIndexInput;
|
|
20364
|
+
__decorate([
|
|
20365
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
20366
|
+
__metadata("design:type", Number)
|
|
20367
|
+
], UpdateVectorIndexInput.prototype, "ID", void 0);
|
|
20368
|
+
__decorate([
|
|
20369
|
+
(0, server_1.Field)(),
|
|
20370
|
+
__metadata("design:type", String)
|
|
20371
|
+
], UpdateVectorIndexInput.prototype, "Name", void 0);
|
|
20372
|
+
__decorate([
|
|
20373
|
+
(0, server_1.Field)({ nullable: true }),
|
|
20374
|
+
__metadata("design:type", String)
|
|
20375
|
+
], UpdateVectorIndexInput.prototype, "Description", void 0);
|
|
20376
|
+
__decorate([
|
|
20377
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
20378
|
+
__metadata("design:type", Number)
|
|
20379
|
+
], UpdateVectorIndexInput.prototype, "VectorDatabaseID", void 0);
|
|
20380
|
+
__decorate([
|
|
20381
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
20382
|
+
__metadata("design:type", Number)
|
|
20383
|
+
], UpdateVectorIndexInput.prototype, "EmbeddingModelID", void 0);
|
|
20384
|
+
exports.UpdateVectorIndexInput = UpdateVectorIndexInput = __decorate([
|
|
20385
|
+
(0, server_1.InputType)()
|
|
20386
|
+
], UpdateVectorIndexInput);
|
|
20387
|
+
let RunVectorIndexViewResult = class RunVectorIndexViewResult {
|
|
20388
|
+
};
|
|
20389
|
+
exports.RunVectorIndexViewResult = RunVectorIndexViewResult;
|
|
20390
|
+
__decorate([
|
|
20391
|
+
(0, server_1.Field)(() => [VectorIndex_]),
|
|
20392
|
+
__metadata("design:type", Array)
|
|
20393
|
+
], RunVectorIndexViewResult.prototype, "Results", void 0);
|
|
20394
|
+
__decorate([
|
|
20395
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
20396
|
+
__metadata("design:type", Number)
|
|
20397
|
+
], RunVectorIndexViewResult.prototype, "UserViewRunID", void 0);
|
|
20398
|
+
__decorate([
|
|
20399
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
20400
|
+
__metadata("design:type", Number)
|
|
20401
|
+
], RunVectorIndexViewResult.prototype, "RowCount", void 0);
|
|
20402
|
+
__decorate([
|
|
20403
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
20404
|
+
__metadata("design:type", Number)
|
|
20405
|
+
], RunVectorIndexViewResult.prototype, "TotalRowCount", void 0);
|
|
20406
|
+
__decorate([
|
|
20407
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
20408
|
+
__metadata("design:type", Number)
|
|
20409
|
+
], RunVectorIndexViewResult.prototype, "ExecutionTime", void 0);
|
|
20410
|
+
__decorate([
|
|
20411
|
+
(0, server_1.Field)({ nullable: true }),
|
|
20412
|
+
__metadata("design:type", String)
|
|
20413
|
+
], RunVectorIndexViewResult.prototype, "ErrorMessage", void 0);
|
|
20414
|
+
__decorate([
|
|
20415
|
+
(0, server_1.Field)(() => Boolean, { nullable: false }),
|
|
20416
|
+
__metadata("design:type", Boolean)
|
|
20417
|
+
], RunVectorIndexViewResult.prototype, "Success", void 0);
|
|
20418
|
+
exports.RunVectorIndexViewResult = RunVectorIndexViewResult = __decorate([
|
|
20419
|
+
(0, server_1.ObjectType)()
|
|
20420
|
+
], RunVectorIndexViewResult);
|
|
20421
|
+
let VectorIndexResolver = class VectorIndexResolver extends server_1.ResolverBase {
|
|
20422
|
+
async RunVectorIndexViewByID(input, { dataSource, userPayload }, pubSub) {
|
|
20423
|
+
return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
|
|
20424
|
+
}
|
|
20425
|
+
async RunVectorIndexViewByName(input, { dataSource, userPayload }, pubSub) {
|
|
20426
|
+
return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
|
|
20427
|
+
}
|
|
20428
|
+
async RunVectorIndexDynamicView(input, { dataSource, userPayload }, pubSub) {
|
|
20429
|
+
input.EntityName = 'Vector Indexes';
|
|
20430
|
+
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
20431
|
+
}
|
|
20432
|
+
async VectorIndex(ID, { dataSource, userPayload }, pubSub) {
|
|
20433
|
+
this.CheckUserReadPermissions('Vector Indexes', userPayload);
|
|
20434
|
+
const sSQL = `SELECT * FROM [admin].[vwVectorIndexes] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Vector Indexes', userPayload, core_1.EntityPermissionType.Read, 'AND');
|
|
20435
|
+
const result = this.MapFieldNamesToCodeNames('Vector Indexes', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}));
|
|
20436
|
+
return result;
|
|
20437
|
+
}
|
|
20438
|
+
async CreateVectorIndex(input, { dataSource, userPayload }, pubSub) {
|
|
20439
|
+
if (await this.BeforeCreate(dataSource, input)) {
|
|
20440
|
+
const entityObject = await new core_1.Metadata().GetEntityObject('Vector Indexes', this.GetUserFromPayload(userPayload));
|
|
20441
|
+
await entityObject.NewRecord();
|
|
20442
|
+
entityObject.SetMany(input);
|
|
20443
|
+
if (await entityObject.Save()) {
|
|
20444
|
+
await this.AfterCreate(dataSource, input);
|
|
20445
|
+
return entityObject.GetAll();
|
|
20446
|
+
}
|
|
20447
|
+
else
|
|
20448
|
+
return null;
|
|
20449
|
+
}
|
|
20450
|
+
else
|
|
20451
|
+
return null;
|
|
20452
|
+
}
|
|
20453
|
+
async BeforeCreate(dataSource, input) {
|
|
20454
|
+
return true;
|
|
20455
|
+
}
|
|
20456
|
+
async AfterCreate(dataSource, input) {
|
|
20457
|
+
}
|
|
20458
|
+
async UpdateVectorIndex(input, { dataSource, userPayload }, pubSub) {
|
|
20459
|
+
if (await this.BeforeUpdate(dataSource, input)) {
|
|
20460
|
+
const entityObject = await new core_1.Metadata().GetEntityObject('Vector Indexes', this.GetUserFromPayload(userPayload));
|
|
20461
|
+
entityObject.LoadFromData(input);
|
|
20462
|
+
if (await entityObject.Save({ IgnoreDirtyState: true })) {
|
|
20463
|
+
await this.AfterUpdate(dataSource, input);
|
|
20464
|
+
return entityObject.GetAll();
|
|
20465
|
+
}
|
|
20466
|
+
else
|
|
20467
|
+
return null;
|
|
20468
|
+
}
|
|
20469
|
+
else
|
|
20470
|
+
return null;
|
|
20471
|
+
}
|
|
20472
|
+
async BeforeUpdate(dataSource, input) {
|
|
20473
|
+
const i = input, d = dataSource;
|
|
20474
|
+
return true;
|
|
20475
|
+
}
|
|
20476
|
+
async AfterUpdate(dataSource, input) {
|
|
20477
|
+
const i = input, d = dataSource;
|
|
20478
|
+
}
|
|
20479
|
+
};
|
|
20480
|
+
exports.VectorIndexResolver = VectorIndexResolver;
|
|
20481
|
+
__decorate([
|
|
20482
|
+
(0, server_1.Query)(() => RunVectorIndexViewResult),
|
|
20483
|
+
__param(0, (0, server_1.Arg)('input', () => server_1.RunViewByIDInput)),
|
|
20484
|
+
__param(1, (0, server_1.Ctx)()),
|
|
20485
|
+
__param(2, (0, server_1.PubSub)()),
|
|
20486
|
+
__metadata("design:type", Function),
|
|
20487
|
+
__metadata("design:paramtypes", [server_1.RunViewByIDInput, Object, server_1.PubSubEngine]),
|
|
20488
|
+
__metadata("design:returntype", Promise)
|
|
20489
|
+
], VectorIndexResolver.prototype, "RunVectorIndexViewByID", null);
|
|
20490
|
+
__decorate([
|
|
20491
|
+
(0, server_1.Query)(() => RunVectorIndexViewResult),
|
|
20492
|
+
__param(0, (0, server_1.Arg)('input', () => server_1.RunViewByNameInput)),
|
|
20493
|
+
__param(1, (0, server_1.Ctx)()),
|
|
20494
|
+
__param(2, (0, server_1.PubSub)()),
|
|
20495
|
+
__metadata("design:type", Function),
|
|
20496
|
+
__metadata("design:paramtypes", [server_1.RunViewByNameInput, Object, server_1.PubSubEngine]),
|
|
20497
|
+
__metadata("design:returntype", Promise)
|
|
20498
|
+
], VectorIndexResolver.prototype, "RunVectorIndexViewByName", null);
|
|
20499
|
+
__decorate([
|
|
20500
|
+
(0, server_1.Query)(() => RunVectorIndexViewResult),
|
|
20501
|
+
__param(0, (0, server_1.Arg)('input', () => server_1.RunDynamicViewInput)),
|
|
20502
|
+
__param(1, (0, server_1.Ctx)()),
|
|
20503
|
+
__param(2, (0, server_1.PubSub)()),
|
|
20504
|
+
__metadata("design:type", Function),
|
|
20505
|
+
__metadata("design:paramtypes", [server_1.RunDynamicViewInput, Object, server_1.PubSubEngine]),
|
|
20506
|
+
__metadata("design:returntype", Promise)
|
|
20507
|
+
], VectorIndexResolver.prototype, "RunVectorIndexDynamicView", null);
|
|
20508
|
+
__decorate([
|
|
20509
|
+
(0, server_1.Query)(() => VectorIndex_, { nullable: true }),
|
|
20510
|
+
__param(0, (0, server_1.Arg)('ID', () => server_1.Int)),
|
|
20511
|
+
__param(1, (0, server_1.Ctx)()),
|
|
20512
|
+
__param(2, (0, server_1.PubSub)()),
|
|
20513
|
+
__metadata("design:type", Function),
|
|
20514
|
+
__metadata("design:paramtypes", [Number, Object, server_1.PubSubEngine]),
|
|
20515
|
+
__metadata("design:returntype", Promise)
|
|
20516
|
+
], VectorIndexResolver.prototype, "VectorIndex", null);
|
|
20517
|
+
__decorate([
|
|
20518
|
+
(0, server_1.Mutation)(() => VectorIndex_),
|
|
20519
|
+
__param(0, (0, server_1.Arg)('input', () => CreateVectorIndexInput)),
|
|
20520
|
+
__param(1, (0, server_1.Ctx)()),
|
|
20521
|
+
__param(2, (0, server_1.PubSub)()),
|
|
20522
|
+
__metadata("design:type", Function),
|
|
20523
|
+
__metadata("design:paramtypes", [CreateVectorIndexInput, Object, server_1.PubSubEngine]),
|
|
20524
|
+
__metadata("design:returntype", Promise)
|
|
20525
|
+
], VectorIndexResolver.prototype, "CreateVectorIndex", null);
|
|
20526
|
+
__decorate([
|
|
20527
|
+
(0, server_1.Mutation)(() => VectorIndex_),
|
|
20528
|
+
__param(0, (0, server_1.Arg)('input', () => UpdateVectorIndexInput)),
|
|
20529
|
+
__param(1, (0, server_1.Ctx)()),
|
|
20530
|
+
__param(2, (0, server_1.PubSub)()),
|
|
20531
|
+
__metadata("design:type", Function),
|
|
20532
|
+
__metadata("design:paramtypes", [UpdateVectorIndexInput, Object, server_1.PubSubEngine]),
|
|
20533
|
+
__metadata("design:returntype", Promise)
|
|
20534
|
+
], VectorIndexResolver.prototype, "UpdateVectorIndex", null);
|
|
20535
|
+
exports.VectorIndexResolver = VectorIndexResolver = __decorate([
|
|
20536
|
+
(0, server_1.Resolver)(VectorIndex_)
|
|
20537
|
+
], VectorIndexResolver);
|
|
20538
|
+
let EntityDocumentType_ = class EntityDocumentType_ {
|
|
20539
|
+
};
|
|
20540
|
+
exports.EntityDocumentType_ = EntityDocumentType_;
|
|
20541
|
+
__decorate([
|
|
20542
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
20543
|
+
__metadata("design:type", Number)
|
|
20544
|
+
], EntityDocumentType_.prototype, "ID", void 0);
|
|
20545
|
+
__decorate([
|
|
20546
|
+
(0, server_1.Field)(),
|
|
20547
|
+
(0, class_validator_1.MaxLength)(200),
|
|
20548
|
+
__metadata("design:type", String)
|
|
20549
|
+
], EntityDocumentType_.prototype, "Name", void 0);
|
|
20550
|
+
__decorate([
|
|
20551
|
+
(0, server_1.Field)({ nullable: true }),
|
|
20552
|
+
__metadata("design:type", String)
|
|
20553
|
+
], EntityDocumentType_.prototype, "Description", void 0);
|
|
20554
|
+
__decorate([
|
|
20555
|
+
(0, server_1.Field)(),
|
|
20556
|
+
(0, class_validator_1.MaxLength)(8),
|
|
20557
|
+
__metadata("design:type", Date)
|
|
20558
|
+
], EntityDocumentType_.prototype, "CreatedAt", void 0);
|
|
20559
|
+
__decorate([
|
|
20560
|
+
(0, server_1.Field)(),
|
|
20561
|
+
(0, class_validator_1.MaxLength)(8),
|
|
20562
|
+
__metadata("design:type", Date)
|
|
20563
|
+
], EntityDocumentType_.prototype, "UpdatedAt", void 0);
|
|
20564
|
+
__decorate([
|
|
20565
|
+
(0, server_1.Field)(() => [EntityDocument_]),
|
|
20566
|
+
__metadata("design:type", Array)
|
|
20567
|
+
], EntityDocumentType_.prototype, "EntityDocumentsArray", void 0);
|
|
20568
|
+
exports.EntityDocumentType_ = EntityDocumentType_ = __decorate([
|
|
20569
|
+
(0, server_1.ObjectType)()
|
|
20570
|
+
], EntityDocumentType_);
|
|
20571
|
+
let CreateEntityDocumentTypeInput = class CreateEntityDocumentTypeInput {
|
|
20572
|
+
};
|
|
20573
|
+
exports.CreateEntityDocumentTypeInput = CreateEntityDocumentTypeInput;
|
|
20574
|
+
__decorate([
|
|
20575
|
+
(0, server_1.Field)(),
|
|
20576
|
+
__metadata("design:type", String)
|
|
20577
|
+
], CreateEntityDocumentTypeInput.prototype, "Name", void 0);
|
|
20578
|
+
__decorate([
|
|
20579
|
+
(0, server_1.Field)({ nullable: true }),
|
|
20580
|
+
__metadata("design:type", String)
|
|
20581
|
+
], CreateEntityDocumentTypeInput.prototype, "Description", void 0);
|
|
20582
|
+
exports.CreateEntityDocumentTypeInput = CreateEntityDocumentTypeInput = __decorate([
|
|
20583
|
+
(0, server_1.InputType)()
|
|
20584
|
+
], CreateEntityDocumentTypeInput);
|
|
20585
|
+
let UpdateEntityDocumentTypeInput = class UpdateEntityDocumentTypeInput {
|
|
20586
|
+
};
|
|
20587
|
+
exports.UpdateEntityDocumentTypeInput = UpdateEntityDocumentTypeInput;
|
|
20588
|
+
__decorate([
|
|
20589
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
20590
|
+
__metadata("design:type", Number)
|
|
20591
|
+
], UpdateEntityDocumentTypeInput.prototype, "ID", void 0);
|
|
20592
|
+
__decorate([
|
|
20593
|
+
(0, server_1.Field)(),
|
|
20594
|
+
__metadata("design:type", String)
|
|
20595
|
+
], UpdateEntityDocumentTypeInput.prototype, "Name", void 0);
|
|
20596
|
+
__decorate([
|
|
20597
|
+
(0, server_1.Field)({ nullable: true }),
|
|
20598
|
+
__metadata("design:type", String)
|
|
20599
|
+
], UpdateEntityDocumentTypeInput.prototype, "Description", void 0);
|
|
20600
|
+
exports.UpdateEntityDocumentTypeInput = UpdateEntityDocumentTypeInput = __decorate([
|
|
20601
|
+
(0, server_1.InputType)()
|
|
20602
|
+
], UpdateEntityDocumentTypeInput);
|
|
20603
|
+
let RunEntityDocumentTypeViewResult = class RunEntityDocumentTypeViewResult {
|
|
20604
|
+
};
|
|
20605
|
+
exports.RunEntityDocumentTypeViewResult = RunEntityDocumentTypeViewResult;
|
|
20606
|
+
__decorate([
|
|
20607
|
+
(0, server_1.Field)(() => [EntityDocumentType_]),
|
|
20608
|
+
__metadata("design:type", Array)
|
|
20609
|
+
], RunEntityDocumentTypeViewResult.prototype, "Results", void 0);
|
|
20610
|
+
__decorate([
|
|
20611
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
20612
|
+
__metadata("design:type", Number)
|
|
20613
|
+
], RunEntityDocumentTypeViewResult.prototype, "UserViewRunID", void 0);
|
|
20614
|
+
__decorate([
|
|
20615
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
20616
|
+
__metadata("design:type", Number)
|
|
20617
|
+
], RunEntityDocumentTypeViewResult.prototype, "RowCount", void 0);
|
|
20618
|
+
__decorate([
|
|
20619
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
20620
|
+
__metadata("design:type", Number)
|
|
20621
|
+
], RunEntityDocumentTypeViewResult.prototype, "TotalRowCount", void 0);
|
|
20622
|
+
__decorate([
|
|
20623
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
20624
|
+
__metadata("design:type", Number)
|
|
20625
|
+
], RunEntityDocumentTypeViewResult.prototype, "ExecutionTime", void 0);
|
|
20626
|
+
__decorate([
|
|
20627
|
+
(0, server_1.Field)({ nullable: true }),
|
|
20628
|
+
__metadata("design:type", String)
|
|
20629
|
+
], RunEntityDocumentTypeViewResult.prototype, "ErrorMessage", void 0);
|
|
20630
|
+
__decorate([
|
|
20631
|
+
(0, server_1.Field)(() => Boolean, { nullable: false }),
|
|
20632
|
+
__metadata("design:type", Boolean)
|
|
20633
|
+
], RunEntityDocumentTypeViewResult.prototype, "Success", void 0);
|
|
20634
|
+
exports.RunEntityDocumentTypeViewResult = RunEntityDocumentTypeViewResult = __decorate([
|
|
20635
|
+
(0, server_1.ObjectType)()
|
|
20636
|
+
], RunEntityDocumentTypeViewResult);
|
|
20637
|
+
let EntityDocumentTypeResolver = class EntityDocumentTypeResolver extends server_1.ResolverBase {
|
|
20638
|
+
async RunEntityDocumentTypeViewByID(input, { dataSource, userPayload }, pubSub) {
|
|
20639
|
+
return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
|
|
20640
|
+
}
|
|
20641
|
+
async RunEntityDocumentTypeViewByName(input, { dataSource, userPayload }, pubSub) {
|
|
20642
|
+
return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
|
|
20643
|
+
}
|
|
20644
|
+
async RunEntityDocumentTypeDynamicView(input, { dataSource, userPayload }, pubSub) {
|
|
20645
|
+
input.EntityName = 'Entity Document Types';
|
|
20646
|
+
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
20647
|
+
}
|
|
20648
|
+
async EntityDocumentType(ID, { dataSource, userPayload }, pubSub) {
|
|
20649
|
+
this.CheckUserReadPermissions('Entity Document Types', userPayload);
|
|
20650
|
+
const sSQL = `SELECT * FROM [admin].[vwEntityDocumentTypes] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Entity Document Types', userPayload, core_1.EntityPermissionType.Read, 'AND');
|
|
20651
|
+
const result = this.MapFieldNamesToCodeNames('Entity Document Types', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}));
|
|
20652
|
+
return result;
|
|
20653
|
+
}
|
|
20654
|
+
async EntityDocumentsArray(entitydocumenttype_, { dataSource, userPayload }, pubSub) {
|
|
20655
|
+
this.CheckUserReadPermissions('Entity Documents', userPayload);
|
|
20656
|
+
const sSQL = `SELECT * FROM [admin].[vwEntityDocuments] WHERE [TypeID]=${entitydocumenttype_.ID} ` + this.getRowLevelSecurityWhereClause('Entity Documents', userPayload, core_1.EntityPermissionType.Read, 'AND');
|
|
20657
|
+
const result = this.ArrayMapFieldNamesToCodeNames('Entity Documents', await dataSource.query(sSQL));
|
|
20658
|
+
return result;
|
|
20659
|
+
}
|
|
20660
|
+
async CreateEntityDocumentType(input, { dataSource, userPayload }, pubSub) {
|
|
20661
|
+
if (await this.BeforeCreate(dataSource, input)) {
|
|
20662
|
+
const entityObject = await new core_1.Metadata().GetEntityObject('Entity Document Types', this.GetUserFromPayload(userPayload));
|
|
20663
|
+
await entityObject.NewRecord();
|
|
20664
|
+
entityObject.SetMany(input);
|
|
20665
|
+
if (await entityObject.Save()) {
|
|
20666
|
+
await this.AfterCreate(dataSource, input);
|
|
20667
|
+
return entityObject.GetAll();
|
|
20668
|
+
}
|
|
20669
|
+
else
|
|
20670
|
+
return null;
|
|
20671
|
+
}
|
|
20672
|
+
else
|
|
20673
|
+
return null;
|
|
20674
|
+
}
|
|
20675
|
+
async BeforeCreate(dataSource, input) {
|
|
20676
|
+
return true;
|
|
20677
|
+
}
|
|
20678
|
+
async AfterCreate(dataSource, input) {
|
|
20679
|
+
}
|
|
20680
|
+
async UpdateEntityDocumentType(input, { dataSource, userPayload }, pubSub) {
|
|
20681
|
+
if (await this.BeforeUpdate(dataSource, input)) {
|
|
20682
|
+
const entityObject = await new core_1.Metadata().GetEntityObject('Entity Document Types', this.GetUserFromPayload(userPayload));
|
|
20683
|
+
entityObject.LoadFromData(input);
|
|
20684
|
+
if (await entityObject.Save({ IgnoreDirtyState: true })) {
|
|
20685
|
+
await this.AfterUpdate(dataSource, input);
|
|
20686
|
+
return entityObject.GetAll();
|
|
20687
|
+
}
|
|
20688
|
+
else
|
|
20689
|
+
return null;
|
|
20690
|
+
}
|
|
20691
|
+
else
|
|
20692
|
+
return null;
|
|
20693
|
+
}
|
|
20694
|
+
async BeforeUpdate(dataSource, input) {
|
|
20695
|
+
const i = input, d = dataSource;
|
|
20696
|
+
return true;
|
|
20697
|
+
}
|
|
20698
|
+
async AfterUpdate(dataSource, input) {
|
|
20699
|
+
const i = input, d = dataSource;
|
|
20700
|
+
}
|
|
20701
|
+
};
|
|
20702
|
+
exports.EntityDocumentTypeResolver = EntityDocumentTypeResolver;
|
|
20703
|
+
__decorate([
|
|
20704
|
+
(0, server_1.Query)(() => RunEntityDocumentTypeViewResult),
|
|
20705
|
+
__param(0, (0, server_1.Arg)('input', () => server_1.RunViewByIDInput)),
|
|
20706
|
+
__param(1, (0, server_1.Ctx)()),
|
|
20707
|
+
__param(2, (0, server_1.PubSub)()),
|
|
20708
|
+
__metadata("design:type", Function),
|
|
20709
|
+
__metadata("design:paramtypes", [server_1.RunViewByIDInput, Object, server_1.PubSubEngine]),
|
|
20710
|
+
__metadata("design:returntype", Promise)
|
|
20711
|
+
], EntityDocumentTypeResolver.prototype, "RunEntityDocumentTypeViewByID", null);
|
|
20712
|
+
__decorate([
|
|
20713
|
+
(0, server_1.Query)(() => RunEntityDocumentTypeViewResult),
|
|
20714
|
+
__param(0, (0, server_1.Arg)('input', () => server_1.RunViewByNameInput)),
|
|
20715
|
+
__param(1, (0, server_1.Ctx)()),
|
|
20716
|
+
__param(2, (0, server_1.PubSub)()),
|
|
20717
|
+
__metadata("design:type", Function),
|
|
20718
|
+
__metadata("design:paramtypes", [server_1.RunViewByNameInput, Object, server_1.PubSubEngine]),
|
|
20719
|
+
__metadata("design:returntype", Promise)
|
|
20720
|
+
], EntityDocumentTypeResolver.prototype, "RunEntityDocumentTypeViewByName", null);
|
|
20721
|
+
__decorate([
|
|
20722
|
+
(0, server_1.Query)(() => RunEntityDocumentTypeViewResult),
|
|
20723
|
+
__param(0, (0, server_1.Arg)('input', () => server_1.RunDynamicViewInput)),
|
|
20724
|
+
__param(1, (0, server_1.Ctx)()),
|
|
20725
|
+
__param(2, (0, server_1.PubSub)()),
|
|
20726
|
+
__metadata("design:type", Function),
|
|
20727
|
+
__metadata("design:paramtypes", [server_1.RunDynamicViewInput, Object, server_1.PubSubEngine]),
|
|
20728
|
+
__metadata("design:returntype", Promise)
|
|
20729
|
+
], EntityDocumentTypeResolver.prototype, "RunEntityDocumentTypeDynamicView", null);
|
|
20730
|
+
__decorate([
|
|
20731
|
+
(0, server_1.Query)(() => EntityDocumentType_, { nullable: true }),
|
|
20732
|
+
__param(0, (0, server_1.Arg)('ID', () => server_1.Int)),
|
|
20733
|
+
__param(1, (0, server_1.Ctx)()),
|
|
20734
|
+
__param(2, (0, server_1.PubSub)()),
|
|
20735
|
+
__metadata("design:type", Function),
|
|
20736
|
+
__metadata("design:paramtypes", [Number, Object, server_1.PubSubEngine]),
|
|
20737
|
+
__metadata("design:returntype", Promise)
|
|
20738
|
+
], EntityDocumentTypeResolver.prototype, "EntityDocumentType", null);
|
|
20739
|
+
__decorate([
|
|
20740
|
+
(0, server_1.FieldResolver)(() => [EntityDocument_]),
|
|
20741
|
+
__param(0, (0, server_1.Root)()),
|
|
20742
|
+
__param(1, (0, server_1.Ctx)()),
|
|
20743
|
+
__param(2, (0, server_1.PubSub)()),
|
|
20744
|
+
__metadata("design:type", Function),
|
|
20745
|
+
__metadata("design:paramtypes", [EntityDocumentType_, Object, server_1.PubSubEngine]),
|
|
20746
|
+
__metadata("design:returntype", Promise)
|
|
20747
|
+
], EntityDocumentTypeResolver.prototype, "EntityDocumentsArray", null);
|
|
20748
|
+
__decorate([
|
|
20749
|
+
(0, server_1.Mutation)(() => EntityDocumentType_),
|
|
20750
|
+
__param(0, (0, server_1.Arg)('input', () => CreateEntityDocumentTypeInput)),
|
|
20751
|
+
__param(1, (0, server_1.Ctx)()),
|
|
20752
|
+
__param(2, (0, server_1.PubSub)()),
|
|
20753
|
+
__metadata("design:type", Function),
|
|
20754
|
+
__metadata("design:paramtypes", [CreateEntityDocumentTypeInput, Object, server_1.PubSubEngine]),
|
|
20755
|
+
__metadata("design:returntype", Promise)
|
|
20756
|
+
], EntityDocumentTypeResolver.prototype, "CreateEntityDocumentType", null);
|
|
20757
|
+
__decorate([
|
|
20758
|
+
(0, server_1.Mutation)(() => EntityDocumentType_),
|
|
20759
|
+
__param(0, (0, server_1.Arg)('input', () => UpdateEntityDocumentTypeInput)),
|
|
20760
|
+
__param(1, (0, server_1.Ctx)()),
|
|
20761
|
+
__param(2, (0, server_1.PubSub)()),
|
|
20762
|
+
__metadata("design:type", Function),
|
|
20763
|
+
__metadata("design:paramtypes", [UpdateEntityDocumentTypeInput, Object, server_1.PubSubEngine]),
|
|
20764
|
+
__metadata("design:returntype", Promise)
|
|
20765
|
+
], EntityDocumentTypeResolver.prototype, "UpdateEntityDocumentType", null);
|
|
20766
|
+
exports.EntityDocumentTypeResolver = EntityDocumentTypeResolver = __decorate([
|
|
20767
|
+
(0, server_1.Resolver)(EntityDocumentType_)
|
|
20768
|
+
], EntityDocumentTypeResolver);
|
|
20769
|
+
let EntityDocumentRun_ = class EntityDocumentRun_ {
|
|
20770
|
+
};
|
|
20771
|
+
exports.EntityDocumentRun_ = EntityDocumentRun_;
|
|
20772
|
+
__decorate([
|
|
20773
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
20774
|
+
__metadata("design:type", Number)
|
|
20775
|
+
], EntityDocumentRun_.prototype, "ID", void 0);
|
|
20776
|
+
__decorate([
|
|
20777
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
20778
|
+
__metadata("design:type", Number)
|
|
20779
|
+
], EntityDocumentRun_.prototype, "EntityDocumentID", void 0);
|
|
20780
|
+
__decorate([
|
|
20781
|
+
(0, server_1.Field)({ nullable: true }),
|
|
20782
|
+
(0, class_validator_1.MaxLength)(8),
|
|
20783
|
+
__metadata("design:type", Date)
|
|
20784
|
+
], EntityDocumentRun_.prototype, "StartedAt", void 0);
|
|
20785
|
+
__decorate([
|
|
20786
|
+
(0, server_1.Field)({ nullable: true }),
|
|
20787
|
+
(0, class_validator_1.MaxLength)(8),
|
|
20788
|
+
__metadata("design:type", Date)
|
|
20789
|
+
], EntityDocumentRun_.prototype, "EndedAt", void 0);
|
|
20790
|
+
__decorate([
|
|
20791
|
+
(0, server_1.Field)(),
|
|
20792
|
+
(0, class_validator_1.MaxLength)(30),
|
|
20793
|
+
__metadata("design:type", String)
|
|
20794
|
+
], EntityDocumentRun_.prototype, "Status", void 0);
|
|
20795
|
+
__decorate([
|
|
20796
|
+
(0, server_1.Field)(),
|
|
20797
|
+
(0, class_validator_1.MaxLength)(8),
|
|
20798
|
+
__metadata("design:type", Date)
|
|
20799
|
+
], EntityDocumentRun_.prototype, "CreatedAt", void 0);
|
|
20800
|
+
__decorate([
|
|
20801
|
+
(0, server_1.Field)(),
|
|
20802
|
+
(0, class_validator_1.MaxLength)(8),
|
|
20803
|
+
__metadata("design:type", Date)
|
|
20804
|
+
], EntityDocumentRun_.prototype, "UpdatedAt", void 0);
|
|
20805
|
+
__decorate([
|
|
20806
|
+
(0, server_1.Field)(),
|
|
20807
|
+
(0, class_validator_1.MaxLength)(500),
|
|
20808
|
+
__metadata("design:type", String)
|
|
20809
|
+
], EntityDocumentRun_.prototype, "EntityDocument", void 0);
|
|
20810
|
+
exports.EntityDocumentRun_ = EntityDocumentRun_ = __decorate([
|
|
20811
|
+
(0, server_1.ObjectType)()
|
|
20812
|
+
], EntityDocumentRun_);
|
|
20813
|
+
let CreateEntityDocumentRunInput = class CreateEntityDocumentRunInput {
|
|
20814
|
+
};
|
|
20815
|
+
exports.CreateEntityDocumentRunInput = CreateEntityDocumentRunInput;
|
|
20816
|
+
__decorate([
|
|
20817
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
20818
|
+
__metadata("design:type", Number)
|
|
20819
|
+
], CreateEntityDocumentRunInput.prototype, "EntityDocumentID", void 0);
|
|
20820
|
+
__decorate([
|
|
20821
|
+
(0, server_1.Field)({ nullable: true }),
|
|
20822
|
+
__metadata("design:type", Date)
|
|
20823
|
+
], CreateEntityDocumentRunInput.prototype, "StartedAt", void 0);
|
|
20824
|
+
__decorate([
|
|
20825
|
+
(0, server_1.Field)({ nullable: true }),
|
|
20826
|
+
__metadata("design:type", Date)
|
|
20827
|
+
], CreateEntityDocumentRunInput.prototype, "EndedAt", void 0);
|
|
20828
|
+
__decorate([
|
|
20829
|
+
(0, server_1.Field)(),
|
|
20830
|
+
__metadata("design:type", String)
|
|
20831
|
+
], CreateEntityDocumentRunInput.prototype, "Status", void 0);
|
|
20832
|
+
exports.CreateEntityDocumentRunInput = CreateEntityDocumentRunInput = __decorate([
|
|
20833
|
+
(0, server_1.InputType)()
|
|
20834
|
+
], CreateEntityDocumentRunInput);
|
|
20835
|
+
let UpdateEntityDocumentRunInput = class UpdateEntityDocumentRunInput {
|
|
20836
|
+
};
|
|
20837
|
+
exports.UpdateEntityDocumentRunInput = UpdateEntityDocumentRunInput;
|
|
20838
|
+
__decorate([
|
|
20839
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
20840
|
+
__metadata("design:type", Number)
|
|
20841
|
+
], UpdateEntityDocumentRunInput.prototype, "ID", void 0);
|
|
20842
|
+
__decorate([
|
|
20843
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
20844
|
+
__metadata("design:type", Number)
|
|
20845
|
+
], UpdateEntityDocumentRunInput.prototype, "EntityDocumentID", void 0);
|
|
20846
|
+
__decorate([
|
|
20847
|
+
(0, server_1.Field)({ nullable: true }),
|
|
20848
|
+
__metadata("design:type", Date)
|
|
20849
|
+
], UpdateEntityDocumentRunInput.prototype, "StartedAt", void 0);
|
|
20850
|
+
__decorate([
|
|
20851
|
+
(0, server_1.Field)({ nullable: true }),
|
|
20852
|
+
__metadata("design:type", Date)
|
|
20853
|
+
], UpdateEntityDocumentRunInput.prototype, "EndedAt", void 0);
|
|
20854
|
+
__decorate([
|
|
20855
|
+
(0, server_1.Field)(),
|
|
20856
|
+
__metadata("design:type", String)
|
|
20857
|
+
], UpdateEntityDocumentRunInput.prototype, "Status", void 0);
|
|
20858
|
+
exports.UpdateEntityDocumentRunInput = UpdateEntityDocumentRunInput = __decorate([
|
|
20859
|
+
(0, server_1.InputType)()
|
|
20860
|
+
], UpdateEntityDocumentRunInput);
|
|
20861
|
+
let RunEntityDocumentRunViewResult = class RunEntityDocumentRunViewResult {
|
|
20862
|
+
};
|
|
20863
|
+
exports.RunEntityDocumentRunViewResult = RunEntityDocumentRunViewResult;
|
|
20864
|
+
__decorate([
|
|
20865
|
+
(0, server_1.Field)(() => [EntityDocumentRun_]),
|
|
20866
|
+
__metadata("design:type", Array)
|
|
20867
|
+
], RunEntityDocumentRunViewResult.prototype, "Results", void 0);
|
|
20868
|
+
__decorate([
|
|
20869
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
20870
|
+
__metadata("design:type", Number)
|
|
20871
|
+
], RunEntityDocumentRunViewResult.prototype, "UserViewRunID", void 0);
|
|
20872
|
+
__decorate([
|
|
20873
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
20874
|
+
__metadata("design:type", Number)
|
|
20875
|
+
], RunEntityDocumentRunViewResult.prototype, "RowCount", void 0);
|
|
20876
|
+
__decorate([
|
|
20877
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
20878
|
+
__metadata("design:type", Number)
|
|
20879
|
+
], RunEntityDocumentRunViewResult.prototype, "TotalRowCount", void 0);
|
|
20880
|
+
__decorate([
|
|
20881
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
20882
|
+
__metadata("design:type", Number)
|
|
20883
|
+
], RunEntityDocumentRunViewResult.prototype, "ExecutionTime", void 0);
|
|
20884
|
+
__decorate([
|
|
20885
|
+
(0, server_1.Field)({ nullable: true }),
|
|
20886
|
+
__metadata("design:type", String)
|
|
20887
|
+
], RunEntityDocumentRunViewResult.prototype, "ErrorMessage", void 0);
|
|
20888
|
+
__decorate([
|
|
20889
|
+
(0, server_1.Field)(() => Boolean, { nullable: false }),
|
|
20890
|
+
__metadata("design:type", Boolean)
|
|
20891
|
+
], RunEntityDocumentRunViewResult.prototype, "Success", void 0);
|
|
20892
|
+
exports.RunEntityDocumentRunViewResult = RunEntityDocumentRunViewResult = __decorate([
|
|
20893
|
+
(0, server_1.ObjectType)()
|
|
20894
|
+
], RunEntityDocumentRunViewResult);
|
|
20895
|
+
let EntityDocumentRunResolver = class EntityDocumentRunResolver extends server_1.ResolverBase {
|
|
20896
|
+
async RunEntityDocumentRunViewByID(input, { dataSource, userPayload }, pubSub) {
|
|
20897
|
+
return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
|
|
20898
|
+
}
|
|
20899
|
+
async RunEntityDocumentRunViewByName(input, { dataSource, userPayload }, pubSub) {
|
|
20900
|
+
return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
|
|
20901
|
+
}
|
|
20902
|
+
async RunEntityDocumentRunDynamicView(input, { dataSource, userPayload }, pubSub) {
|
|
20903
|
+
input.EntityName = 'Entity Document Runs';
|
|
20904
|
+
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
20905
|
+
}
|
|
20906
|
+
async EntityDocumentRun(ID, { dataSource, userPayload }, pubSub) {
|
|
20907
|
+
this.CheckUserReadPermissions('Entity Document Runs', userPayload);
|
|
20908
|
+
const sSQL = `SELECT * FROM [admin].[vwEntityDocumentRuns] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Entity Document Runs', userPayload, core_1.EntityPermissionType.Read, 'AND');
|
|
20909
|
+
const result = this.MapFieldNamesToCodeNames('Entity Document Runs', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}));
|
|
20910
|
+
return result;
|
|
20911
|
+
}
|
|
20912
|
+
async CreateEntityDocumentRun(input, { dataSource, userPayload }, pubSub) {
|
|
20913
|
+
if (await this.BeforeCreate(dataSource, input)) {
|
|
20914
|
+
const entityObject = await new core_1.Metadata().GetEntityObject('Entity Document Runs', this.GetUserFromPayload(userPayload));
|
|
20915
|
+
await entityObject.NewRecord();
|
|
20916
|
+
entityObject.SetMany(input);
|
|
20917
|
+
if (await entityObject.Save()) {
|
|
20918
|
+
await this.AfterCreate(dataSource, input);
|
|
20919
|
+
return entityObject.GetAll();
|
|
20920
|
+
}
|
|
20921
|
+
else
|
|
20922
|
+
return null;
|
|
20923
|
+
}
|
|
20924
|
+
else
|
|
20925
|
+
return null;
|
|
20926
|
+
}
|
|
20927
|
+
async BeforeCreate(dataSource, input) {
|
|
20928
|
+
return true;
|
|
20929
|
+
}
|
|
20930
|
+
async AfterCreate(dataSource, input) {
|
|
20931
|
+
}
|
|
20932
|
+
async UpdateEntityDocumentRun(input, { dataSource, userPayload }, pubSub) {
|
|
20933
|
+
if (await this.BeforeUpdate(dataSource, input)) {
|
|
20934
|
+
const entityObject = await new core_1.Metadata().GetEntityObject('Entity Document Runs', this.GetUserFromPayload(userPayload));
|
|
20935
|
+
entityObject.LoadFromData(input);
|
|
20936
|
+
if (await entityObject.Save({ IgnoreDirtyState: true })) {
|
|
20937
|
+
await this.AfterUpdate(dataSource, input);
|
|
20938
|
+
return entityObject.GetAll();
|
|
20939
|
+
}
|
|
20940
|
+
else
|
|
20941
|
+
return null;
|
|
20942
|
+
}
|
|
20943
|
+
else
|
|
20944
|
+
return null;
|
|
20945
|
+
}
|
|
20946
|
+
async BeforeUpdate(dataSource, input) {
|
|
20947
|
+
const i = input, d = dataSource;
|
|
20948
|
+
return true;
|
|
20949
|
+
}
|
|
20950
|
+
async AfterUpdate(dataSource, input) {
|
|
20951
|
+
const i = input, d = dataSource;
|
|
20952
|
+
}
|
|
20953
|
+
};
|
|
20954
|
+
exports.EntityDocumentRunResolver = EntityDocumentRunResolver;
|
|
20955
|
+
__decorate([
|
|
20956
|
+
(0, server_1.Query)(() => RunEntityDocumentRunViewResult),
|
|
20957
|
+
__param(0, (0, server_1.Arg)('input', () => server_1.RunViewByIDInput)),
|
|
20958
|
+
__param(1, (0, server_1.Ctx)()),
|
|
20959
|
+
__param(2, (0, server_1.PubSub)()),
|
|
20960
|
+
__metadata("design:type", Function),
|
|
20961
|
+
__metadata("design:paramtypes", [server_1.RunViewByIDInput, Object, server_1.PubSubEngine]),
|
|
20962
|
+
__metadata("design:returntype", Promise)
|
|
20963
|
+
], EntityDocumentRunResolver.prototype, "RunEntityDocumentRunViewByID", null);
|
|
20964
|
+
__decorate([
|
|
20965
|
+
(0, server_1.Query)(() => RunEntityDocumentRunViewResult),
|
|
20966
|
+
__param(0, (0, server_1.Arg)('input', () => server_1.RunViewByNameInput)),
|
|
20967
|
+
__param(1, (0, server_1.Ctx)()),
|
|
20968
|
+
__param(2, (0, server_1.PubSub)()),
|
|
20969
|
+
__metadata("design:type", Function),
|
|
20970
|
+
__metadata("design:paramtypes", [server_1.RunViewByNameInput, Object, server_1.PubSubEngine]),
|
|
20971
|
+
__metadata("design:returntype", Promise)
|
|
20972
|
+
], EntityDocumentRunResolver.prototype, "RunEntityDocumentRunViewByName", null);
|
|
20973
|
+
__decorate([
|
|
20974
|
+
(0, server_1.Query)(() => RunEntityDocumentRunViewResult),
|
|
20975
|
+
__param(0, (0, server_1.Arg)('input', () => server_1.RunDynamicViewInput)),
|
|
20976
|
+
__param(1, (0, server_1.Ctx)()),
|
|
20977
|
+
__param(2, (0, server_1.PubSub)()),
|
|
20978
|
+
__metadata("design:type", Function),
|
|
20979
|
+
__metadata("design:paramtypes", [server_1.RunDynamicViewInput, Object, server_1.PubSubEngine]),
|
|
20980
|
+
__metadata("design:returntype", Promise)
|
|
20981
|
+
], EntityDocumentRunResolver.prototype, "RunEntityDocumentRunDynamicView", null);
|
|
20982
|
+
__decorate([
|
|
20983
|
+
(0, server_1.Query)(() => EntityDocumentRun_, { nullable: true }),
|
|
20984
|
+
__param(0, (0, server_1.Arg)('ID', () => server_1.Int)),
|
|
20985
|
+
__param(1, (0, server_1.Ctx)()),
|
|
20986
|
+
__param(2, (0, server_1.PubSub)()),
|
|
20987
|
+
__metadata("design:type", Function),
|
|
20988
|
+
__metadata("design:paramtypes", [Number, Object, server_1.PubSubEngine]),
|
|
20989
|
+
__metadata("design:returntype", Promise)
|
|
20990
|
+
], EntityDocumentRunResolver.prototype, "EntityDocumentRun", null);
|
|
20991
|
+
__decorate([
|
|
20992
|
+
(0, server_1.Mutation)(() => EntityDocumentRun_),
|
|
20993
|
+
__param(0, (0, server_1.Arg)('input', () => CreateEntityDocumentRunInput)),
|
|
20994
|
+
__param(1, (0, server_1.Ctx)()),
|
|
20995
|
+
__param(2, (0, server_1.PubSub)()),
|
|
20996
|
+
__metadata("design:type", Function),
|
|
20997
|
+
__metadata("design:paramtypes", [CreateEntityDocumentRunInput, Object, server_1.PubSubEngine]),
|
|
20998
|
+
__metadata("design:returntype", Promise)
|
|
20999
|
+
], EntityDocumentRunResolver.prototype, "CreateEntityDocumentRun", null);
|
|
21000
|
+
__decorate([
|
|
21001
|
+
(0, server_1.Mutation)(() => EntityDocumentRun_),
|
|
21002
|
+
__param(0, (0, server_1.Arg)('input', () => UpdateEntityDocumentRunInput)),
|
|
21003
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21004
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21005
|
+
__metadata("design:type", Function),
|
|
21006
|
+
__metadata("design:paramtypes", [UpdateEntityDocumentRunInput, Object, server_1.PubSubEngine]),
|
|
21007
|
+
__metadata("design:returntype", Promise)
|
|
21008
|
+
], EntityDocumentRunResolver.prototype, "UpdateEntityDocumentRun", null);
|
|
21009
|
+
exports.EntityDocumentRunResolver = EntityDocumentRunResolver = __decorate([
|
|
21010
|
+
(0, server_1.Resolver)(EntityDocumentRun_)
|
|
21011
|
+
], EntityDocumentRunResolver);
|
|
21012
|
+
let VectorDatabase_ = class VectorDatabase_ {
|
|
21013
|
+
};
|
|
21014
|
+
exports.VectorDatabase_ = VectorDatabase_;
|
|
21015
|
+
__decorate([
|
|
21016
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
21017
|
+
__metadata("design:type", Number)
|
|
21018
|
+
], VectorDatabase_.prototype, "ID", void 0);
|
|
21019
|
+
__decorate([
|
|
21020
|
+
(0, server_1.Field)(),
|
|
21021
|
+
(0, class_validator_1.MaxLength)(200),
|
|
21022
|
+
__metadata("design:type", String)
|
|
21023
|
+
], VectorDatabase_.prototype, "Name", void 0);
|
|
21024
|
+
__decorate([
|
|
21025
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21026
|
+
__metadata("design:type", String)
|
|
21027
|
+
], VectorDatabase_.prototype, "Description", void 0);
|
|
21028
|
+
__decorate([
|
|
21029
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21030
|
+
(0, class_validator_1.MaxLength)(510),
|
|
21031
|
+
__metadata("design:type", String)
|
|
21032
|
+
], VectorDatabase_.prototype, "DefaultURL", void 0);
|
|
21033
|
+
__decorate([
|
|
21034
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21035
|
+
(0, class_validator_1.MaxLength)(200),
|
|
21036
|
+
__metadata("design:type", String)
|
|
21037
|
+
], VectorDatabase_.prototype, "ClassKey", void 0);
|
|
21038
|
+
__decorate([
|
|
21039
|
+
(0, server_1.Field)(),
|
|
21040
|
+
(0, class_validator_1.MaxLength)(8),
|
|
21041
|
+
__metadata("design:type", Date)
|
|
21042
|
+
], VectorDatabase_.prototype, "CreatedAt", void 0);
|
|
21043
|
+
__decorate([
|
|
21044
|
+
(0, server_1.Field)(),
|
|
21045
|
+
(0, class_validator_1.MaxLength)(8),
|
|
21046
|
+
__metadata("design:type", Date)
|
|
21047
|
+
], VectorDatabase_.prototype, "UpdatedAt", void 0);
|
|
21048
|
+
__decorate([
|
|
21049
|
+
(0, server_1.Field)(() => [VectorIndex_]),
|
|
21050
|
+
__metadata("design:type", Array)
|
|
21051
|
+
], VectorDatabase_.prototype, "VectorIndexesArray", void 0);
|
|
21052
|
+
exports.VectorDatabase_ = VectorDatabase_ = __decorate([
|
|
21053
|
+
(0, server_1.ObjectType)()
|
|
21054
|
+
], VectorDatabase_);
|
|
21055
|
+
let CreateVectorDatabaseInput = class CreateVectorDatabaseInput {
|
|
21056
|
+
};
|
|
21057
|
+
exports.CreateVectorDatabaseInput = CreateVectorDatabaseInput;
|
|
21058
|
+
__decorate([
|
|
21059
|
+
(0, server_1.Field)(),
|
|
21060
|
+
__metadata("design:type", String)
|
|
21061
|
+
], CreateVectorDatabaseInput.prototype, "Name", void 0);
|
|
21062
|
+
__decorate([
|
|
21063
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21064
|
+
__metadata("design:type", String)
|
|
21065
|
+
], CreateVectorDatabaseInput.prototype, "Description", void 0);
|
|
21066
|
+
__decorate([
|
|
21067
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21068
|
+
__metadata("design:type", String)
|
|
21069
|
+
], CreateVectorDatabaseInput.prototype, "DefaultURL", void 0);
|
|
21070
|
+
__decorate([
|
|
21071
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21072
|
+
__metadata("design:type", String)
|
|
21073
|
+
], CreateVectorDatabaseInput.prototype, "ClassKey", void 0);
|
|
21074
|
+
exports.CreateVectorDatabaseInput = CreateVectorDatabaseInput = __decorate([
|
|
21075
|
+
(0, server_1.InputType)()
|
|
21076
|
+
], CreateVectorDatabaseInput);
|
|
21077
|
+
let UpdateVectorDatabaseInput = class UpdateVectorDatabaseInput {
|
|
21078
|
+
};
|
|
21079
|
+
exports.UpdateVectorDatabaseInput = UpdateVectorDatabaseInput;
|
|
21080
|
+
__decorate([
|
|
21081
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
21082
|
+
__metadata("design:type", Number)
|
|
21083
|
+
], UpdateVectorDatabaseInput.prototype, "ID", void 0);
|
|
21084
|
+
__decorate([
|
|
21085
|
+
(0, server_1.Field)(),
|
|
21086
|
+
__metadata("design:type", String)
|
|
21087
|
+
], UpdateVectorDatabaseInput.prototype, "Name", void 0);
|
|
21088
|
+
__decorate([
|
|
21089
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21090
|
+
__metadata("design:type", String)
|
|
21091
|
+
], UpdateVectorDatabaseInput.prototype, "Description", void 0);
|
|
21092
|
+
__decorate([
|
|
21093
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21094
|
+
__metadata("design:type", String)
|
|
21095
|
+
], UpdateVectorDatabaseInput.prototype, "DefaultURL", void 0);
|
|
21096
|
+
__decorate([
|
|
21097
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21098
|
+
__metadata("design:type", String)
|
|
21099
|
+
], UpdateVectorDatabaseInput.prototype, "ClassKey", void 0);
|
|
21100
|
+
exports.UpdateVectorDatabaseInput = UpdateVectorDatabaseInput = __decorate([
|
|
21101
|
+
(0, server_1.InputType)()
|
|
21102
|
+
], UpdateVectorDatabaseInput);
|
|
21103
|
+
let RunVectorDatabaseViewResult = class RunVectorDatabaseViewResult {
|
|
21104
|
+
};
|
|
21105
|
+
exports.RunVectorDatabaseViewResult = RunVectorDatabaseViewResult;
|
|
21106
|
+
__decorate([
|
|
21107
|
+
(0, server_1.Field)(() => [VectorDatabase_]),
|
|
21108
|
+
__metadata("design:type", Array)
|
|
21109
|
+
], RunVectorDatabaseViewResult.prototype, "Results", void 0);
|
|
21110
|
+
__decorate([
|
|
21111
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
21112
|
+
__metadata("design:type", Number)
|
|
21113
|
+
], RunVectorDatabaseViewResult.prototype, "UserViewRunID", void 0);
|
|
21114
|
+
__decorate([
|
|
21115
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
21116
|
+
__metadata("design:type", Number)
|
|
21117
|
+
], RunVectorDatabaseViewResult.prototype, "RowCount", void 0);
|
|
21118
|
+
__decorate([
|
|
21119
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
21120
|
+
__metadata("design:type", Number)
|
|
21121
|
+
], RunVectorDatabaseViewResult.prototype, "TotalRowCount", void 0);
|
|
21122
|
+
__decorate([
|
|
21123
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
21124
|
+
__metadata("design:type", Number)
|
|
21125
|
+
], RunVectorDatabaseViewResult.prototype, "ExecutionTime", void 0);
|
|
21126
|
+
__decorate([
|
|
21127
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21128
|
+
__metadata("design:type", String)
|
|
21129
|
+
], RunVectorDatabaseViewResult.prototype, "ErrorMessage", void 0);
|
|
21130
|
+
__decorate([
|
|
21131
|
+
(0, server_1.Field)(() => Boolean, { nullable: false }),
|
|
21132
|
+
__metadata("design:type", Boolean)
|
|
21133
|
+
], RunVectorDatabaseViewResult.prototype, "Success", void 0);
|
|
21134
|
+
exports.RunVectorDatabaseViewResult = RunVectorDatabaseViewResult = __decorate([
|
|
21135
|
+
(0, server_1.ObjectType)()
|
|
21136
|
+
], RunVectorDatabaseViewResult);
|
|
21137
|
+
let VectorDatabaseResolver = class VectorDatabaseResolver extends server_1.ResolverBase {
|
|
21138
|
+
async RunVectorDatabaseViewByID(input, { dataSource, userPayload }, pubSub) {
|
|
21139
|
+
return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
|
|
21140
|
+
}
|
|
21141
|
+
async RunVectorDatabaseViewByName(input, { dataSource, userPayload }, pubSub) {
|
|
21142
|
+
return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
|
|
21143
|
+
}
|
|
21144
|
+
async RunVectorDatabaseDynamicView(input, { dataSource, userPayload }, pubSub) {
|
|
21145
|
+
input.EntityName = 'Vector Databases';
|
|
21146
|
+
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
21147
|
+
}
|
|
21148
|
+
async VectorDatabase(ID, { dataSource, userPayload }, pubSub) {
|
|
21149
|
+
this.CheckUserReadPermissions('Vector Databases', userPayload);
|
|
21150
|
+
const sSQL = `SELECT * FROM [admin].[vwVectorDatabases] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Vector Databases', userPayload, core_1.EntityPermissionType.Read, 'AND');
|
|
21151
|
+
const result = this.MapFieldNamesToCodeNames('Vector Databases', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}));
|
|
21152
|
+
return result;
|
|
21153
|
+
}
|
|
21154
|
+
async VectorIndexesArray(vectordatabase_, { dataSource, userPayload }, pubSub) {
|
|
21155
|
+
this.CheckUserReadPermissions('Vector Indexes', userPayload);
|
|
21156
|
+
const sSQL = `SELECT * FROM [admin].[vwVectorIndexes] WHERE [VectorDatabaseID]=${vectordatabase_.ID} ` + this.getRowLevelSecurityWhereClause('Vector Indexes', userPayload, core_1.EntityPermissionType.Read, 'AND');
|
|
21157
|
+
const result = this.ArrayMapFieldNamesToCodeNames('Vector Indexes', await dataSource.query(sSQL));
|
|
21158
|
+
return result;
|
|
21159
|
+
}
|
|
21160
|
+
async CreateVectorDatabase(input, { dataSource, userPayload }, pubSub) {
|
|
21161
|
+
if (await this.BeforeCreate(dataSource, input)) {
|
|
21162
|
+
const entityObject = await new core_1.Metadata().GetEntityObject('Vector Databases', this.GetUserFromPayload(userPayload));
|
|
21163
|
+
await entityObject.NewRecord();
|
|
21164
|
+
entityObject.SetMany(input);
|
|
21165
|
+
if (await entityObject.Save()) {
|
|
21166
|
+
await this.AfterCreate(dataSource, input);
|
|
21167
|
+
return entityObject.GetAll();
|
|
21168
|
+
}
|
|
21169
|
+
else
|
|
21170
|
+
return null;
|
|
21171
|
+
}
|
|
21172
|
+
else
|
|
21173
|
+
return null;
|
|
21174
|
+
}
|
|
21175
|
+
async BeforeCreate(dataSource, input) {
|
|
21176
|
+
return true;
|
|
21177
|
+
}
|
|
21178
|
+
async AfterCreate(dataSource, input) {
|
|
21179
|
+
}
|
|
21180
|
+
async UpdateVectorDatabase(input, { dataSource, userPayload }, pubSub) {
|
|
21181
|
+
if (await this.BeforeUpdate(dataSource, input)) {
|
|
21182
|
+
const entityObject = await new core_1.Metadata().GetEntityObject('Vector Databases', this.GetUserFromPayload(userPayload));
|
|
21183
|
+
entityObject.LoadFromData(input);
|
|
21184
|
+
if (await entityObject.Save({ IgnoreDirtyState: true })) {
|
|
21185
|
+
await this.AfterUpdate(dataSource, input);
|
|
21186
|
+
return entityObject.GetAll();
|
|
21187
|
+
}
|
|
21188
|
+
else
|
|
21189
|
+
return null;
|
|
21190
|
+
}
|
|
21191
|
+
else
|
|
21192
|
+
return null;
|
|
21193
|
+
}
|
|
21194
|
+
async BeforeUpdate(dataSource, input) {
|
|
21195
|
+
const i = input, d = dataSource;
|
|
21196
|
+
return true;
|
|
21197
|
+
}
|
|
21198
|
+
async AfterUpdate(dataSource, input) {
|
|
21199
|
+
const i = input, d = dataSource;
|
|
21200
|
+
}
|
|
21201
|
+
};
|
|
21202
|
+
exports.VectorDatabaseResolver = VectorDatabaseResolver;
|
|
21203
|
+
__decorate([
|
|
21204
|
+
(0, server_1.Query)(() => RunVectorDatabaseViewResult),
|
|
21205
|
+
__param(0, (0, server_1.Arg)('input', () => server_1.RunViewByIDInput)),
|
|
21206
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21207
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21208
|
+
__metadata("design:type", Function),
|
|
21209
|
+
__metadata("design:paramtypes", [server_1.RunViewByIDInput, Object, server_1.PubSubEngine]),
|
|
21210
|
+
__metadata("design:returntype", Promise)
|
|
21211
|
+
], VectorDatabaseResolver.prototype, "RunVectorDatabaseViewByID", null);
|
|
21212
|
+
__decorate([
|
|
21213
|
+
(0, server_1.Query)(() => RunVectorDatabaseViewResult),
|
|
21214
|
+
__param(0, (0, server_1.Arg)('input', () => server_1.RunViewByNameInput)),
|
|
21215
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21216
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21217
|
+
__metadata("design:type", Function),
|
|
21218
|
+
__metadata("design:paramtypes", [server_1.RunViewByNameInput, Object, server_1.PubSubEngine]),
|
|
21219
|
+
__metadata("design:returntype", Promise)
|
|
21220
|
+
], VectorDatabaseResolver.prototype, "RunVectorDatabaseViewByName", null);
|
|
21221
|
+
__decorate([
|
|
21222
|
+
(0, server_1.Query)(() => RunVectorDatabaseViewResult),
|
|
21223
|
+
__param(0, (0, server_1.Arg)('input', () => server_1.RunDynamicViewInput)),
|
|
21224
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21225
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21226
|
+
__metadata("design:type", Function),
|
|
21227
|
+
__metadata("design:paramtypes", [server_1.RunDynamicViewInput, Object, server_1.PubSubEngine]),
|
|
21228
|
+
__metadata("design:returntype", Promise)
|
|
21229
|
+
], VectorDatabaseResolver.prototype, "RunVectorDatabaseDynamicView", null);
|
|
21230
|
+
__decorate([
|
|
21231
|
+
(0, server_1.Query)(() => VectorDatabase_, { nullable: true }),
|
|
21232
|
+
__param(0, (0, server_1.Arg)('ID', () => server_1.Int)),
|
|
21233
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21234
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21235
|
+
__metadata("design:type", Function),
|
|
21236
|
+
__metadata("design:paramtypes", [Number, Object, server_1.PubSubEngine]),
|
|
21237
|
+
__metadata("design:returntype", Promise)
|
|
21238
|
+
], VectorDatabaseResolver.prototype, "VectorDatabase", null);
|
|
21239
|
+
__decorate([
|
|
21240
|
+
(0, server_1.FieldResolver)(() => [VectorIndex_]),
|
|
21241
|
+
__param(0, (0, server_1.Root)()),
|
|
21242
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21243
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21244
|
+
__metadata("design:type", Function),
|
|
21245
|
+
__metadata("design:paramtypes", [VectorDatabase_, Object, server_1.PubSubEngine]),
|
|
21246
|
+
__metadata("design:returntype", Promise)
|
|
21247
|
+
], VectorDatabaseResolver.prototype, "VectorIndexesArray", null);
|
|
21248
|
+
__decorate([
|
|
21249
|
+
(0, server_1.Mutation)(() => VectorDatabase_),
|
|
21250
|
+
__param(0, (0, server_1.Arg)('input', () => CreateVectorDatabaseInput)),
|
|
21251
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21252
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21253
|
+
__metadata("design:type", Function),
|
|
21254
|
+
__metadata("design:paramtypes", [CreateVectorDatabaseInput, Object, server_1.PubSubEngine]),
|
|
21255
|
+
__metadata("design:returntype", Promise)
|
|
21256
|
+
], VectorDatabaseResolver.prototype, "CreateVectorDatabase", null);
|
|
21257
|
+
__decorate([
|
|
21258
|
+
(0, server_1.Mutation)(() => VectorDatabase_),
|
|
21259
|
+
__param(0, (0, server_1.Arg)('input', () => UpdateVectorDatabaseInput)),
|
|
21260
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21261
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21262
|
+
__metadata("design:type", Function),
|
|
21263
|
+
__metadata("design:paramtypes", [UpdateVectorDatabaseInput, Object, server_1.PubSubEngine]),
|
|
21264
|
+
__metadata("design:returntype", Promise)
|
|
21265
|
+
], VectorDatabaseResolver.prototype, "UpdateVectorDatabase", null);
|
|
21266
|
+
exports.VectorDatabaseResolver = VectorDatabaseResolver = __decorate([
|
|
21267
|
+
(0, server_1.Resolver)(VectorDatabase_)
|
|
21268
|
+
], VectorDatabaseResolver);
|
|
21269
|
+
let EntityRecordDocument_ = class EntityRecordDocument_ {
|
|
21270
|
+
};
|
|
21271
|
+
exports.EntityRecordDocument_ = EntityRecordDocument_;
|
|
21272
|
+
__decorate([
|
|
21273
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
21274
|
+
__metadata("design:type", Number)
|
|
21275
|
+
], EntityRecordDocument_.prototype, "ID", void 0);
|
|
21276
|
+
__decorate([
|
|
21277
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
21278
|
+
__metadata("design:type", Number)
|
|
21279
|
+
], EntityRecordDocument_.prototype, "EntityID", void 0);
|
|
21280
|
+
__decorate([
|
|
21281
|
+
(0, server_1.Field)(),
|
|
21282
|
+
(0, class_validator_1.MaxLength)(510),
|
|
21283
|
+
__metadata("design:type", String)
|
|
21284
|
+
], EntityRecordDocument_.prototype, "RecordID", void 0);
|
|
21285
|
+
__decorate([
|
|
21286
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21287
|
+
__metadata("design:type", String)
|
|
21288
|
+
], EntityRecordDocument_.prototype, "DocumentText", void 0);
|
|
21289
|
+
__decorate([
|
|
21290
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
21291
|
+
__metadata("design:type", Number)
|
|
21292
|
+
], EntityRecordDocument_.prototype, "VectorIndexID", void 0);
|
|
21293
|
+
__decorate([
|
|
21294
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21295
|
+
(0, class_validator_1.MaxLength)(100),
|
|
21296
|
+
__metadata("design:type", String)
|
|
21297
|
+
], EntityRecordDocument_.prototype, "VectorID", void 0);
|
|
21298
|
+
__decorate([
|
|
21299
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21300
|
+
__metadata("design:type", String)
|
|
21301
|
+
], EntityRecordDocument_.prototype, "VectorJSON", void 0);
|
|
21302
|
+
__decorate([
|
|
21303
|
+
(0, server_1.Field)(),
|
|
21304
|
+
(0, class_validator_1.MaxLength)(8),
|
|
21305
|
+
__metadata("design:type", Date)
|
|
21306
|
+
], EntityRecordDocument_.prototype, "EntityRecordUpdatedAt", void 0);
|
|
21307
|
+
__decorate([
|
|
21308
|
+
(0, server_1.Field)(),
|
|
21309
|
+
(0, class_validator_1.MaxLength)(8),
|
|
21310
|
+
__metadata("design:type", Date)
|
|
21311
|
+
], EntityRecordDocument_.prototype, "CreatedAt", void 0);
|
|
21312
|
+
__decorate([
|
|
21313
|
+
(0, server_1.Field)(),
|
|
21314
|
+
(0, class_validator_1.MaxLength)(8),
|
|
21315
|
+
__metadata("design:type", Date)
|
|
21316
|
+
], EntityRecordDocument_.prototype, "UpdatedAt", void 0);
|
|
21317
|
+
exports.EntityRecordDocument_ = EntityRecordDocument_ = __decorate([
|
|
21318
|
+
(0, server_1.ObjectType)()
|
|
21319
|
+
], EntityRecordDocument_);
|
|
21320
|
+
let CreateEntityRecordDocumentInput = class CreateEntityRecordDocumentInput {
|
|
21321
|
+
};
|
|
21322
|
+
exports.CreateEntityRecordDocumentInput = CreateEntityRecordDocumentInput;
|
|
21323
|
+
__decorate([
|
|
21324
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
21325
|
+
__metadata("design:type", Number)
|
|
21326
|
+
], CreateEntityRecordDocumentInput.prototype, "EntityID", void 0);
|
|
21327
|
+
__decorate([
|
|
21328
|
+
(0, server_1.Field)(),
|
|
21329
|
+
__metadata("design:type", String)
|
|
21330
|
+
], CreateEntityRecordDocumentInput.prototype, "RecordID", void 0);
|
|
21331
|
+
__decorate([
|
|
21332
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21333
|
+
__metadata("design:type", String)
|
|
21334
|
+
], CreateEntityRecordDocumentInput.prototype, "DocumentText", void 0);
|
|
21335
|
+
__decorate([
|
|
21336
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
21337
|
+
__metadata("design:type", Number)
|
|
21338
|
+
], CreateEntityRecordDocumentInput.prototype, "VectorIndexID", void 0);
|
|
21339
|
+
__decorate([
|
|
21340
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21341
|
+
__metadata("design:type", String)
|
|
21342
|
+
], CreateEntityRecordDocumentInput.prototype, "VectorID", void 0);
|
|
21343
|
+
__decorate([
|
|
21344
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21345
|
+
__metadata("design:type", String)
|
|
21346
|
+
], CreateEntityRecordDocumentInput.prototype, "VectorJSON", void 0);
|
|
21347
|
+
__decorate([
|
|
21348
|
+
(0, server_1.Field)(),
|
|
21349
|
+
__metadata("design:type", Date)
|
|
21350
|
+
], CreateEntityRecordDocumentInput.prototype, "EntityRecordUpdatedAt", void 0);
|
|
21351
|
+
exports.CreateEntityRecordDocumentInput = CreateEntityRecordDocumentInput = __decorate([
|
|
21352
|
+
(0, server_1.InputType)()
|
|
21353
|
+
], CreateEntityRecordDocumentInput);
|
|
21354
|
+
let UpdateEntityRecordDocumentInput = class UpdateEntityRecordDocumentInput {
|
|
21355
|
+
};
|
|
21356
|
+
exports.UpdateEntityRecordDocumentInput = UpdateEntityRecordDocumentInput;
|
|
21357
|
+
__decorate([
|
|
21358
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
21359
|
+
__metadata("design:type", Number)
|
|
21360
|
+
], UpdateEntityRecordDocumentInput.prototype, "ID", void 0);
|
|
21361
|
+
__decorate([
|
|
21362
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
21363
|
+
__metadata("design:type", Number)
|
|
21364
|
+
], UpdateEntityRecordDocumentInput.prototype, "EntityID", void 0);
|
|
21365
|
+
__decorate([
|
|
21366
|
+
(0, server_1.Field)(),
|
|
21367
|
+
__metadata("design:type", String)
|
|
21368
|
+
], UpdateEntityRecordDocumentInput.prototype, "RecordID", void 0);
|
|
21369
|
+
__decorate([
|
|
21370
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21371
|
+
__metadata("design:type", String)
|
|
21372
|
+
], UpdateEntityRecordDocumentInput.prototype, "DocumentText", void 0);
|
|
21373
|
+
__decorate([
|
|
21374
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
21375
|
+
__metadata("design:type", Number)
|
|
21376
|
+
], UpdateEntityRecordDocumentInput.prototype, "VectorIndexID", void 0);
|
|
21377
|
+
__decorate([
|
|
21378
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21379
|
+
__metadata("design:type", String)
|
|
21380
|
+
], UpdateEntityRecordDocumentInput.prototype, "VectorID", void 0);
|
|
21381
|
+
__decorate([
|
|
21382
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21383
|
+
__metadata("design:type", String)
|
|
21384
|
+
], UpdateEntityRecordDocumentInput.prototype, "VectorJSON", void 0);
|
|
21385
|
+
__decorate([
|
|
21386
|
+
(0, server_1.Field)(),
|
|
21387
|
+
__metadata("design:type", Date)
|
|
21388
|
+
], UpdateEntityRecordDocumentInput.prototype, "EntityRecordUpdatedAt", void 0);
|
|
21389
|
+
exports.UpdateEntityRecordDocumentInput = UpdateEntityRecordDocumentInput = __decorate([
|
|
21390
|
+
(0, server_1.InputType)()
|
|
21391
|
+
], UpdateEntityRecordDocumentInput);
|
|
21392
|
+
let RunEntityRecordDocumentViewResult = class RunEntityRecordDocumentViewResult {
|
|
21393
|
+
};
|
|
21394
|
+
exports.RunEntityRecordDocumentViewResult = RunEntityRecordDocumentViewResult;
|
|
21395
|
+
__decorate([
|
|
21396
|
+
(0, server_1.Field)(() => [EntityRecordDocument_]),
|
|
21397
|
+
__metadata("design:type", Array)
|
|
21398
|
+
], RunEntityRecordDocumentViewResult.prototype, "Results", void 0);
|
|
21399
|
+
__decorate([
|
|
21400
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
21401
|
+
__metadata("design:type", Number)
|
|
21402
|
+
], RunEntityRecordDocumentViewResult.prototype, "UserViewRunID", void 0);
|
|
21403
|
+
__decorate([
|
|
21404
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
21405
|
+
__metadata("design:type", Number)
|
|
21406
|
+
], RunEntityRecordDocumentViewResult.prototype, "RowCount", void 0);
|
|
21407
|
+
__decorate([
|
|
21408
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
21409
|
+
__metadata("design:type", Number)
|
|
21410
|
+
], RunEntityRecordDocumentViewResult.prototype, "TotalRowCount", void 0);
|
|
21411
|
+
__decorate([
|
|
21412
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
21413
|
+
__metadata("design:type", Number)
|
|
21414
|
+
], RunEntityRecordDocumentViewResult.prototype, "ExecutionTime", void 0);
|
|
21415
|
+
__decorate([
|
|
21416
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21417
|
+
__metadata("design:type", String)
|
|
21418
|
+
], RunEntityRecordDocumentViewResult.prototype, "ErrorMessage", void 0);
|
|
21419
|
+
__decorate([
|
|
21420
|
+
(0, server_1.Field)(() => Boolean, { nullable: false }),
|
|
21421
|
+
__metadata("design:type", Boolean)
|
|
21422
|
+
], RunEntityRecordDocumentViewResult.prototype, "Success", void 0);
|
|
21423
|
+
exports.RunEntityRecordDocumentViewResult = RunEntityRecordDocumentViewResult = __decorate([
|
|
21424
|
+
(0, server_1.ObjectType)()
|
|
21425
|
+
], RunEntityRecordDocumentViewResult);
|
|
21426
|
+
let EntityRecordDocumentResolver = class EntityRecordDocumentResolver extends server_1.ResolverBase {
|
|
21427
|
+
async RunEntityRecordDocumentViewByID(input, { dataSource, userPayload }, pubSub) {
|
|
21428
|
+
return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
|
|
21429
|
+
}
|
|
21430
|
+
async RunEntityRecordDocumentViewByName(input, { dataSource, userPayload }, pubSub) {
|
|
21431
|
+
return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
|
|
21432
|
+
}
|
|
21433
|
+
async RunEntityRecordDocumentDynamicView(input, { dataSource, userPayload }, pubSub) {
|
|
21434
|
+
input.EntityName = 'Entity Record Documents';
|
|
21435
|
+
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
21436
|
+
}
|
|
21437
|
+
async EntityRecordDocument(ID, { dataSource, userPayload }, pubSub) {
|
|
21438
|
+
this.CheckUserReadPermissions('Entity Record Documents', userPayload);
|
|
21439
|
+
const sSQL = `SELECT * FROM [admin].[vwEntityRecordDocuments] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Entity Record Documents', userPayload, core_1.EntityPermissionType.Read, 'AND');
|
|
21440
|
+
const result = this.MapFieldNamesToCodeNames('Entity Record Documents', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}));
|
|
21441
|
+
return result;
|
|
21442
|
+
}
|
|
21443
|
+
async CreateEntityRecordDocument(input, { dataSource, userPayload }, pubSub) {
|
|
21444
|
+
if (await this.BeforeCreate(dataSource, input)) {
|
|
21445
|
+
const entityObject = await new core_1.Metadata().GetEntityObject('Entity Record Documents', this.GetUserFromPayload(userPayload));
|
|
21446
|
+
await entityObject.NewRecord();
|
|
21447
|
+
entityObject.SetMany(input);
|
|
21448
|
+
if (await entityObject.Save()) {
|
|
21449
|
+
await this.AfterCreate(dataSource, input);
|
|
21450
|
+
return entityObject.GetAll();
|
|
21451
|
+
}
|
|
21452
|
+
else
|
|
21453
|
+
return null;
|
|
21454
|
+
}
|
|
21455
|
+
else
|
|
21456
|
+
return null;
|
|
21457
|
+
}
|
|
21458
|
+
async BeforeCreate(dataSource, input) {
|
|
21459
|
+
return true;
|
|
21460
|
+
}
|
|
21461
|
+
async AfterCreate(dataSource, input) {
|
|
21462
|
+
}
|
|
21463
|
+
async UpdateEntityRecordDocument(input, { dataSource, userPayload }, pubSub) {
|
|
21464
|
+
if (await this.BeforeUpdate(dataSource, input)) {
|
|
21465
|
+
const entityObject = await new core_1.Metadata().GetEntityObject('Entity Record Documents', this.GetUserFromPayload(userPayload));
|
|
21466
|
+
entityObject.LoadFromData(input);
|
|
21467
|
+
if (await entityObject.Save({ IgnoreDirtyState: true })) {
|
|
21468
|
+
await this.AfterUpdate(dataSource, input);
|
|
21469
|
+
return entityObject.GetAll();
|
|
21470
|
+
}
|
|
21471
|
+
else
|
|
21472
|
+
return null;
|
|
21473
|
+
}
|
|
21474
|
+
else
|
|
21475
|
+
return null;
|
|
21476
|
+
}
|
|
21477
|
+
async BeforeUpdate(dataSource, input) {
|
|
21478
|
+
const i = input, d = dataSource;
|
|
21479
|
+
return true;
|
|
21480
|
+
}
|
|
21481
|
+
async AfterUpdate(dataSource, input) {
|
|
21482
|
+
const i = input, d = dataSource;
|
|
21483
|
+
}
|
|
21484
|
+
};
|
|
21485
|
+
exports.EntityRecordDocumentResolver = EntityRecordDocumentResolver;
|
|
21486
|
+
__decorate([
|
|
21487
|
+
(0, server_1.Query)(() => RunEntityRecordDocumentViewResult),
|
|
21488
|
+
__param(0, (0, server_1.Arg)('input', () => server_1.RunViewByIDInput)),
|
|
21489
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21490
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21491
|
+
__metadata("design:type", Function),
|
|
21492
|
+
__metadata("design:paramtypes", [server_1.RunViewByIDInput, Object, server_1.PubSubEngine]),
|
|
21493
|
+
__metadata("design:returntype", Promise)
|
|
21494
|
+
], EntityRecordDocumentResolver.prototype, "RunEntityRecordDocumentViewByID", null);
|
|
21495
|
+
__decorate([
|
|
21496
|
+
(0, server_1.Query)(() => RunEntityRecordDocumentViewResult),
|
|
21497
|
+
__param(0, (0, server_1.Arg)('input', () => server_1.RunViewByNameInput)),
|
|
21498
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21499
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21500
|
+
__metadata("design:type", Function),
|
|
21501
|
+
__metadata("design:paramtypes", [server_1.RunViewByNameInput, Object, server_1.PubSubEngine]),
|
|
21502
|
+
__metadata("design:returntype", Promise)
|
|
21503
|
+
], EntityRecordDocumentResolver.prototype, "RunEntityRecordDocumentViewByName", null);
|
|
21504
|
+
__decorate([
|
|
21505
|
+
(0, server_1.Query)(() => RunEntityRecordDocumentViewResult),
|
|
21506
|
+
__param(0, (0, server_1.Arg)('input', () => server_1.RunDynamicViewInput)),
|
|
21507
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21508
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21509
|
+
__metadata("design:type", Function),
|
|
21510
|
+
__metadata("design:paramtypes", [server_1.RunDynamicViewInput, Object, server_1.PubSubEngine]),
|
|
21511
|
+
__metadata("design:returntype", Promise)
|
|
21512
|
+
], EntityRecordDocumentResolver.prototype, "RunEntityRecordDocumentDynamicView", null);
|
|
21513
|
+
__decorate([
|
|
21514
|
+
(0, server_1.Query)(() => EntityRecordDocument_, { nullable: true }),
|
|
21515
|
+
__param(0, (0, server_1.Arg)('ID', () => server_1.Int)),
|
|
21516
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21517
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21518
|
+
__metadata("design:type", Function),
|
|
21519
|
+
__metadata("design:paramtypes", [Number, Object, server_1.PubSubEngine]),
|
|
21520
|
+
__metadata("design:returntype", Promise)
|
|
21521
|
+
], EntityRecordDocumentResolver.prototype, "EntityRecordDocument", null);
|
|
21522
|
+
__decorate([
|
|
21523
|
+
(0, server_1.Mutation)(() => EntityRecordDocument_),
|
|
21524
|
+
__param(0, (0, server_1.Arg)('input', () => CreateEntityRecordDocumentInput)),
|
|
21525
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21526
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21527
|
+
__metadata("design:type", Function),
|
|
21528
|
+
__metadata("design:paramtypes", [CreateEntityRecordDocumentInput, Object, server_1.PubSubEngine]),
|
|
21529
|
+
__metadata("design:returntype", Promise)
|
|
21530
|
+
], EntityRecordDocumentResolver.prototype, "CreateEntityRecordDocument", null);
|
|
21531
|
+
__decorate([
|
|
21532
|
+
(0, server_1.Mutation)(() => EntityRecordDocument_),
|
|
21533
|
+
__param(0, (0, server_1.Arg)('input', () => UpdateEntityRecordDocumentInput)),
|
|
21534
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21535
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21536
|
+
__metadata("design:type", Function),
|
|
21537
|
+
__metadata("design:paramtypes", [UpdateEntityRecordDocumentInput, Object, server_1.PubSubEngine]),
|
|
21538
|
+
__metadata("design:returntype", Promise)
|
|
21539
|
+
], EntityRecordDocumentResolver.prototype, "UpdateEntityRecordDocument", null);
|
|
21540
|
+
exports.EntityRecordDocumentResolver = EntityRecordDocumentResolver = __decorate([
|
|
21541
|
+
(0, server_1.Resolver)(EntityRecordDocument_)
|
|
21542
|
+
], EntityRecordDocumentResolver);
|
|
21543
|
+
let EntityDocument_ = class EntityDocument_ {
|
|
21544
|
+
};
|
|
21545
|
+
exports.EntityDocument_ = EntityDocument_;
|
|
21546
|
+
__decorate([
|
|
21547
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
21548
|
+
__metadata("design:type", Number)
|
|
21549
|
+
], EntityDocument_.prototype, "ID", void 0);
|
|
21550
|
+
__decorate([
|
|
21551
|
+
(0, server_1.Field)(),
|
|
21552
|
+
(0, class_validator_1.MaxLength)(500),
|
|
21553
|
+
__metadata("design:type", String)
|
|
21554
|
+
], EntityDocument_.prototype, "Name", void 0);
|
|
21555
|
+
__decorate([
|
|
21556
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
21557
|
+
__metadata("design:type", Number)
|
|
21558
|
+
], EntityDocument_.prototype, "EntityID", void 0);
|
|
21559
|
+
__decorate([
|
|
21560
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
21561
|
+
__metadata("design:type", Number)
|
|
21562
|
+
], EntityDocument_.prototype, "TypeID", void 0);
|
|
21563
|
+
__decorate([
|
|
21564
|
+
(0, server_1.Field)(),
|
|
21565
|
+
(0, class_validator_1.MaxLength)(30),
|
|
21566
|
+
__metadata("design:type", String)
|
|
21567
|
+
], EntityDocument_.prototype, "Status", void 0);
|
|
21568
|
+
__decorate([
|
|
21569
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21570
|
+
__metadata("design:type", String)
|
|
21571
|
+
], EntityDocument_.prototype, "Template", void 0);
|
|
21572
|
+
__decorate([
|
|
21573
|
+
(0, server_1.Field)(),
|
|
21574
|
+
(0, class_validator_1.MaxLength)(8),
|
|
21575
|
+
__metadata("design:type", Date)
|
|
21576
|
+
], EntityDocument_.prototype, "CreatedAt", void 0);
|
|
21577
|
+
__decorate([
|
|
21578
|
+
(0, server_1.Field)(),
|
|
21579
|
+
(0, class_validator_1.MaxLength)(8),
|
|
21580
|
+
__metadata("design:type", Date)
|
|
21581
|
+
], EntityDocument_.prototype, "UpdatedAt", void 0);
|
|
21582
|
+
__decorate([
|
|
21583
|
+
(0, server_1.Field)(),
|
|
21584
|
+
(0, class_validator_1.MaxLength)(510),
|
|
21585
|
+
__metadata("design:type", String)
|
|
21586
|
+
], EntityDocument_.prototype, "Entity", void 0);
|
|
21587
|
+
__decorate([
|
|
21588
|
+
(0, server_1.Field)(),
|
|
21589
|
+
(0, class_validator_1.MaxLength)(200),
|
|
21590
|
+
__metadata("design:type", String)
|
|
21591
|
+
], EntityDocument_.prototype, "Type", void 0);
|
|
21592
|
+
__decorate([
|
|
21593
|
+
(0, server_1.Field)(() => [EntityDocumentRun_]),
|
|
21594
|
+
__metadata("design:type", Array)
|
|
21595
|
+
], EntityDocument_.prototype, "EntityDocumentRunsArray", void 0);
|
|
21596
|
+
exports.EntityDocument_ = EntityDocument_ = __decorate([
|
|
21597
|
+
(0, server_1.ObjectType)()
|
|
21598
|
+
], EntityDocument_);
|
|
21599
|
+
let CreateEntityDocumentInput = class CreateEntityDocumentInput {
|
|
21600
|
+
};
|
|
21601
|
+
exports.CreateEntityDocumentInput = CreateEntityDocumentInput;
|
|
21602
|
+
__decorate([
|
|
21603
|
+
(0, server_1.Field)(),
|
|
21604
|
+
__metadata("design:type", String)
|
|
21605
|
+
], CreateEntityDocumentInput.prototype, "Name", void 0);
|
|
21606
|
+
__decorate([
|
|
21607
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
21608
|
+
__metadata("design:type", Number)
|
|
21609
|
+
], CreateEntityDocumentInput.prototype, "EntityID", void 0);
|
|
21610
|
+
__decorate([
|
|
21611
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
21612
|
+
__metadata("design:type", Number)
|
|
21613
|
+
], CreateEntityDocumentInput.prototype, "TypeID", void 0);
|
|
21614
|
+
__decorate([
|
|
21615
|
+
(0, server_1.Field)(),
|
|
21616
|
+
__metadata("design:type", String)
|
|
21617
|
+
], CreateEntityDocumentInput.prototype, "Status", void 0);
|
|
21618
|
+
__decorate([
|
|
21619
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21620
|
+
__metadata("design:type", String)
|
|
21621
|
+
], CreateEntityDocumentInput.prototype, "Template", void 0);
|
|
21622
|
+
exports.CreateEntityDocumentInput = CreateEntityDocumentInput = __decorate([
|
|
21623
|
+
(0, server_1.InputType)()
|
|
21624
|
+
], CreateEntityDocumentInput);
|
|
21625
|
+
let UpdateEntityDocumentInput = class UpdateEntityDocumentInput {
|
|
21626
|
+
};
|
|
21627
|
+
exports.UpdateEntityDocumentInput = UpdateEntityDocumentInput;
|
|
21628
|
+
__decorate([
|
|
21629
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
21630
|
+
__metadata("design:type", Number)
|
|
21631
|
+
], UpdateEntityDocumentInput.prototype, "ID", void 0);
|
|
21632
|
+
__decorate([
|
|
21633
|
+
(0, server_1.Field)(),
|
|
21634
|
+
__metadata("design:type", String)
|
|
21635
|
+
], UpdateEntityDocumentInput.prototype, "Name", void 0);
|
|
21636
|
+
__decorate([
|
|
21637
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
21638
|
+
__metadata("design:type", Number)
|
|
21639
|
+
], UpdateEntityDocumentInput.prototype, "EntityID", void 0);
|
|
21640
|
+
__decorate([
|
|
21641
|
+
(0, server_1.Field)(() => server_1.Int),
|
|
21642
|
+
__metadata("design:type", Number)
|
|
21643
|
+
], UpdateEntityDocumentInput.prototype, "TypeID", void 0);
|
|
21644
|
+
__decorate([
|
|
21645
|
+
(0, server_1.Field)(),
|
|
21646
|
+
__metadata("design:type", String)
|
|
21647
|
+
], UpdateEntityDocumentInput.prototype, "Status", void 0);
|
|
21648
|
+
__decorate([
|
|
21649
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21650
|
+
__metadata("design:type", String)
|
|
21651
|
+
], UpdateEntityDocumentInput.prototype, "Template", void 0);
|
|
21652
|
+
exports.UpdateEntityDocumentInput = UpdateEntityDocumentInput = __decorate([
|
|
21653
|
+
(0, server_1.InputType)()
|
|
21654
|
+
], UpdateEntityDocumentInput);
|
|
21655
|
+
let RunEntityDocumentViewResult = class RunEntityDocumentViewResult {
|
|
21656
|
+
};
|
|
21657
|
+
exports.RunEntityDocumentViewResult = RunEntityDocumentViewResult;
|
|
21658
|
+
__decorate([
|
|
21659
|
+
(0, server_1.Field)(() => [EntityDocument_]),
|
|
21660
|
+
__metadata("design:type", Array)
|
|
21661
|
+
], RunEntityDocumentViewResult.prototype, "Results", void 0);
|
|
21662
|
+
__decorate([
|
|
21663
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
21664
|
+
__metadata("design:type", Number)
|
|
21665
|
+
], RunEntityDocumentViewResult.prototype, "UserViewRunID", void 0);
|
|
21666
|
+
__decorate([
|
|
21667
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
21668
|
+
__metadata("design:type", Number)
|
|
21669
|
+
], RunEntityDocumentViewResult.prototype, "RowCount", void 0);
|
|
21670
|
+
__decorate([
|
|
21671
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
21672
|
+
__metadata("design:type", Number)
|
|
21673
|
+
], RunEntityDocumentViewResult.prototype, "TotalRowCount", void 0);
|
|
21674
|
+
__decorate([
|
|
21675
|
+
(0, server_1.Field)(() => server_1.Int, { nullable: true }),
|
|
21676
|
+
__metadata("design:type", Number)
|
|
21677
|
+
], RunEntityDocumentViewResult.prototype, "ExecutionTime", void 0);
|
|
21678
|
+
__decorate([
|
|
21679
|
+
(0, server_1.Field)({ nullable: true }),
|
|
21680
|
+
__metadata("design:type", String)
|
|
21681
|
+
], RunEntityDocumentViewResult.prototype, "ErrorMessage", void 0);
|
|
21682
|
+
__decorate([
|
|
21683
|
+
(0, server_1.Field)(() => Boolean, { nullable: false }),
|
|
21684
|
+
__metadata("design:type", Boolean)
|
|
21685
|
+
], RunEntityDocumentViewResult.prototype, "Success", void 0);
|
|
21686
|
+
exports.RunEntityDocumentViewResult = RunEntityDocumentViewResult = __decorate([
|
|
21687
|
+
(0, server_1.ObjectType)()
|
|
21688
|
+
], RunEntityDocumentViewResult);
|
|
21689
|
+
let EntityDocumentResolver = class EntityDocumentResolver extends server_1.ResolverBase {
|
|
21690
|
+
async RunEntityDocumentViewByID(input, { dataSource, userPayload }, pubSub) {
|
|
21691
|
+
return super.RunViewByIDGeneric(input, dataSource, userPayload, pubSub);
|
|
21692
|
+
}
|
|
21693
|
+
async RunEntityDocumentViewByName(input, { dataSource, userPayload }, pubSub) {
|
|
21694
|
+
return super.RunViewByNameGeneric(input, dataSource, userPayload, pubSub);
|
|
21695
|
+
}
|
|
21696
|
+
async RunEntityDocumentDynamicView(input, { dataSource, userPayload }, pubSub) {
|
|
21697
|
+
input.EntityName = 'Entity Documents';
|
|
21698
|
+
return super.RunDynamicViewGeneric(input, dataSource, userPayload, pubSub);
|
|
21699
|
+
}
|
|
21700
|
+
async EntityDocument(ID, { dataSource, userPayload }, pubSub) {
|
|
21701
|
+
this.CheckUserReadPermissions('Entity Documents', userPayload);
|
|
21702
|
+
const sSQL = `SELECT * FROM [admin].[vwEntityDocuments] WHERE [ID]=${ID} ` + this.getRowLevelSecurityWhereClause('Entity Documents', userPayload, core_1.EntityPermissionType.Read, 'AND');
|
|
21703
|
+
const result = this.MapFieldNamesToCodeNames('Entity Documents', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}));
|
|
21704
|
+
return result;
|
|
21705
|
+
}
|
|
21706
|
+
async EntityDocumentRunsArray(entitydocument_, { dataSource, userPayload }, pubSub) {
|
|
21707
|
+
this.CheckUserReadPermissions('Entity Document Runs', userPayload);
|
|
21708
|
+
const sSQL = `SELECT * FROM [admin].[vwEntityDocumentRuns] WHERE [EntityDocumentID]=${entitydocument_.ID} ` + this.getRowLevelSecurityWhereClause('Entity Document Runs', userPayload, core_1.EntityPermissionType.Read, 'AND');
|
|
21709
|
+
const result = this.ArrayMapFieldNamesToCodeNames('Entity Document Runs', await dataSource.query(sSQL));
|
|
21710
|
+
return result;
|
|
21711
|
+
}
|
|
21712
|
+
async CreateEntityDocument(input, { dataSource, userPayload }, pubSub) {
|
|
21713
|
+
if (await this.BeforeCreate(dataSource, input)) {
|
|
21714
|
+
const entityObject = await new core_1.Metadata().GetEntityObject('Entity Documents', this.GetUserFromPayload(userPayload));
|
|
21715
|
+
await entityObject.NewRecord();
|
|
21716
|
+
entityObject.SetMany(input);
|
|
21717
|
+
if (await entityObject.Save()) {
|
|
21718
|
+
await this.AfterCreate(dataSource, input);
|
|
21719
|
+
return entityObject.GetAll();
|
|
21720
|
+
}
|
|
21721
|
+
else
|
|
21722
|
+
return null;
|
|
21723
|
+
}
|
|
21724
|
+
else
|
|
21725
|
+
return null;
|
|
21726
|
+
}
|
|
21727
|
+
async BeforeCreate(dataSource, input) {
|
|
21728
|
+
return true;
|
|
21729
|
+
}
|
|
21730
|
+
async AfterCreate(dataSource, input) {
|
|
21731
|
+
}
|
|
21732
|
+
async UpdateEntityDocument(input, { dataSource, userPayload }, pubSub) {
|
|
21733
|
+
if (await this.BeforeUpdate(dataSource, input)) {
|
|
21734
|
+
const entityObject = await new core_1.Metadata().GetEntityObject('Entity Documents', this.GetUserFromPayload(userPayload));
|
|
21735
|
+
entityObject.LoadFromData(input);
|
|
21736
|
+
if (await entityObject.Save({ IgnoreDirtyState: true })) {
|
|
21737
|
+
await this.AfterUpdate(dataSource, input);
|
|
21738
|
+
return entityObject.GetAll();
|
|
21739
|
+
}
|
|
21740
|
+
else
|
|
21741
|
+
return null;
|
|
21742
|
+
}
|
|
21743
|
+
else
|
|
21744
|
+
return null;
|
|
21745
|
+
}
|
|
21746
|
+
async BeforeUpdate(dataSource, input) {
|
|
21747
|
+
const i = input, d = dataSource;
|
|
21748
|
+
return true;
|
|
21749
|
+
}
|
|
21750
|
+
async AfterUpdate(dataSource, input) {
|
|
21751
|
+
const i = input, d = dataSource;
|
|
21752
|
+
}
|
|
21753
|
+
};
|
|
21754
|
+
exports.EntityDocumentResolver = EntityDocumentResolver;
|
|
21755
|
+
__decorate([
|
|
21756
|
+
(0, server_1.Query)(() => RunEntityDocumentViewResult),
|
|
21757
|
+
__param(0, (0, server_1.Arg)('input', () => server_1.RunViewByIDInput)),
|
|
21758
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21759
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21760
|
+
__metadata("design:type", Function),
|
|
21761
|
+
__metadata("design:paramtypes", [server_1.RunViewByIDInput, Object, server_1.PubSubEngine]),
|
|
21762
|
+
__metadata("design:returntype", Promise)
|
|
21763
|
+
], EntityDocumentResolver.prototype, "RunEntityDocumentViewByID", null);
|
|
21764
|
+
__decorate([
|
|
21765
|
+
(0, server_1.Query)(() => RunEntityDocumentViewResult),
|
|
21766
|
+
__param(0, (0, server_1.Arg)('input', () => server_1.RunViewByNameInput)),
|
|
21767
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21768
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21769
|
+
__metadata("design:type", Function),
|
|
21770
|
+
__metadata("design:paramtypes", [server_1.RunViewByNameInput, Object, server_1.PubSubEngine]),
|
|
21771
|
+
__metadata("design:returntype", Promise)
|
|
21772
|
+
], EntityDocumentResolver.prototype, "RunEntityDocumentViewByName", null);
|
|
21773
|
+
__decorate([
|
|
21774
|
+
(0, server_1.Query)(() => RunEntityDocumentViewResult),
|
|
21775
|
+
__param(0, (0, server_1.Arg)('input', () => server_1.RunDynamicViewInput)),
|
|
21776
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21777
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21778
|
+
__metadata("design:type", Function),
|
|
21779
|
+
__metadata("design:paramtypes", [server_1.RunDynamicViewInput, Object, server_1.PubSubEngine]),
|
|
21780
|
+
__metadata("design:returntype", Promise)
|
|
21781
|
+
], EntityDocumentResolver.prototype, "RunEntityDocumentDynamicView", null);
|
|
21782
|
+
__decorate([
|
|
21783
|
+
(0, server_1.Query)(() => EntityDocument_, { nullable: true }),
|
|
21784
|
+
__param(0, (0, server_1.Arg)('ID', () => server_1.Int)),
|
|
21785
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21786
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21787
|
+
__metadata("design:type", Function),
|
|
21788
|
+
__metadata("design:paramtypes", [Number, Object, server_1.PubSubEngine]),
|
|
21789
|
+
__metadata("design:returntype", Promise)
|
|
21790
|
+
], EntityDocumentResolver.prototype, "EntityDocument", null);
|
|
21791
|
+
__decorate([
|
|
21792
|
+
(0, server_1.FieldResolver)(() => [EntityDocumentRun_]),
|
|
21793
|
+
__param(0, (0, server_1.Root)()),
|
|
21794
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21795
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21796
|
+
__metadata("design:type", Function),
|
|
21797
|
+
__metadata("design:paramtypes", [EntityDocument_, Object, server_1.PubSubEngine]),
|
|
21798
|
+
__metadata("design:returntype", Promise)
|
|
21799
|
+
], EntityDocumentResolver.prototype, "EntityDocumentRunsArray", null);
|
|
21800
|
+
__decorate([
|
|
21801
|
+
(0, server_1.Mutation)(() => EntityDocument_),
|
|
21802
|
+
__param(0, (0, server_1.Arg)('input', () => CreateEntityDocumentInput)),
|
|
21803
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21804
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21805
|
+
__metadata("design:type", Function),
|
|
21806
|
+
__metadata("design:paramtypes", [CreateEntityDocumentInput, Object, server_1.PubSubEngine]),
|
|
21807
|
+
__metadata("design:returntype", Promise)
|
|
21808
|
+
], EntityDocumentResolver.prototype, "CreateEntityDocument", null);
|
|
21809
|
+
__decorate([
|
|
21810
|
+
(0, server_1.Mutation)(() => EntityDocument_),
|
|
21811
|
+
__param(0, (0, server_1.Arg)('input', () => UpdateEntityDocumentInput)),
|
|
21812
|
+
__param(1, (0, server_1.Ctx)()),
|
|
21813
|
+
__param(2, (0, server_1.PubSub)()),
|
|
21814
|
+
__metadata("design:type", Function),
|
|
21815
|
+
__metadata("design:paramtypes", [UpdateEntityDocumentInput, Object, server_1.PubSubEngine]),
|
|
21816
|
+
__metadata("design:returntype", Promise)
|
|
21817
|
+
], EntityDocumentResolver.prototype, "UpdateEntityDocument", null);
|
|
21818
|
+
exports.EntityDocumentResolver = EntityDocumentResolver = __decorate([
|
|
21819
|
+
(0, server_1.Resolver)(EntityDocument_)
|
|
21820
|
+
], EntityDocumentResolver);
|
|
20206
21821
|
//# sourceMappingURL=generated.js.map
|