@memberjunction/server 0.9.245 → 0.9.247
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.
|
@@ -35,14 +35,14 @@ var __param = (this && this.__param) || function (paramIndex, decorator) {
|
|
|
35
35
|
return function (target, key) { decorator(target, key, paramIndex); }
|
|
36
36
|
};
|
|
37
37
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
38
|
-
exports.
|
|
39
|
-
exports.
|
|
40
|
-
exports.
|
|
41
|
-
exports.
|
|
42
|
-
exports.
|
|
43
|
-
exports.
|
|
44
|
-
exports.
|
|
45
|
-
exports.FileEntityRecordLinkResolver = exports.RunFileEntityRecordLinkViewResult = exports.UpdateFileEntityRecordLinkInput = exports.CreateFileEntityRecordLinkInput = exports.FileEntityRecordLink_ = exports.FileCategoryResolver = exports.RunFileCategoryViewResult = exports.UpdateFileCategoryInput = exports.CreateFileCategoryInput = exports.FileCategory_ = exports.FileResolver = exports.RunFileViewResult = exports.UpdateFileInput = exports.CreateFileInput = exports.File_ = exports.FileStorageProviderResolver = exports.RunFileStorageProviderViewResult = exports.UpdateFileStorageProviderInput = exports.CreateFileStorageProviderInput = exports.FileStorageProvider_ = exports.ReportCategoryResolver = exports.RunReportCategoryViewResult = exports.UpdateReportCategoryInput = exports.CreateReportCategoryInput = exports.ReportCategory_ = exports.DashboardCategoryResolver = exports.RunDashboardCategoryViewResult = exports.UpdateDashboardCategoryInput = exports.CreateDashboardCategoryInput = exports.DashboardCategory_ = exports.UserViewCategoryResolver = exports.RunUserViewCategoryViewResult = exports.UpdateUserViewCategoryInput = exports.CreateUserViewCategoryInput = exports.UserViewCategory_ = exports.DataContextResolver = void 0;
|
|
38
|
+
exports.UpdateEntityFieldInput = exports.CreateEntityFieldInput = exports.EntityField_ = exports.CompanyIntegrationResolver = exports.RunCompanyIntegrationViewResult = exports.UpdateCompanyIntegrationInput = exports.CompanyIntegration_ = exports.IntegrationResolver = exports.RunIntegrationViewResult = exports.UpdateIntegrationInput = exports.Integration_ = exports.IntegrationURLFormatResolver = exports.RunIntegrationURLFormatViewResult = exports.UpdateIntegrationURLFormatInput = exports.IntegrationURLFormat_ = exports.SkillResolver = exports.RunSkillViewResult = exports.Skill_ = exports.RoleResolver = exports.RunRoleViewResult = exports.UpdateRoleInput = exports.CreateRoleInput = exports.Role_ = exports.EmployeeSkillResolver = exports.RunEmployeeSkillViewResult = exports.UpdateEmployeeSkillInput = exports.EmployeeSkill_ = exports.EmployeeRoleResolver = exports.RunEmployeeRoleViewResult = exports.UpdateEmployeeRoleInput = exports.EmployeeRole_ = exports.EmployeeCompanyIntegrationResolver = exports.RunEmployeeCompanyIntegrationViewResult = exports.UpdateEmployeeCompanyIntegrationInput = exports.EmployeeCompanyIntegration_ = exports.UserFavoriteResolverBase = exports.RunUserFavoriteViewResult = exports.UpdateUserFavoriteInput = exports.CreateUserFavoriteInput = exports.UserFavorite_ = exports.EmployeeResolver = exports.RunEmployeeViewResult = exports.UpdateEmployeeInput = exports.CreateEmployeeInput = exports.Employee_ = exports.CompanyResolver = exports.RunCompanyViewResult = exports.UpdateCompanyInput = exports.CreateCompanyInput = exports.Company_ = void 0;
|
|
39
|
+
exports.CreateEntityPermissionInput = exports.EntityPermission_ = exports.ApplicationEntityResolver = exports.RunApplicationEntityViewResult = exports.UpdateApplicationEntityInput = exports.CreateApplicationEntityInput = exports.ApplicationEntity_ = exports.ApplicationResolver = exports.RunApplicationViewResult = exports.UpdateApplicationInput = exports.CreateApplicationInput = exports.Application_ = exports.ErrorLogResolver = exports.RunErrorLogViewResult = exports.UpdateErrorLogInput = exports.ErrorLog_ = exports.CompanyIntegrationRunDetailResolver = exports.RunCompanyIntegrationRunDetailViewResult = exports.UpdateCompanyIntegrationRunDetailInput = exports.CompanyIntegrationRunDetail_ = exports.CompanyIntegrationRunResolver = exports.RunCompanyIntegrationRunViewResult = exports.UpdateCompanyIntegrationRunInput = exports.CompanyIntegrationRun_ = exports.UserViewResolverBase = exports.RunUserViewViewResult = exports.UpdateUserViewInput = exports.CreateUserViewInput = exports.UserView_ = exports.UserRecordLogResolver = exports.RunUserRecordLogViewResult = exports.UpdateUserRecordLogInput = exports.UserRecordLog_ = exports.EntityRelationshipResolver = exports.RunEntityRelationshipViewResult = exports.UpdateEntityRelationshipInput = exports.CreateEntityRelationshipInput = exports.EntityRelationship_ = exports.UserResolverBase = exports.RunUserViewResult = exports.UpdateUserInput = exports.CreateUserInput = exports.User_ = exports.EntityResolverBase = exports.RunEntityViewResult = exports.UpdateEntityInput = exports.CreateEntityInput = exports.Entity_ = exports.EntityFieldResolver = exports.RunEntityFieldViewResult = void 0;
|
|
40
|
+
exports.CreateRecordChangeInput = exports.RecordChange_ = exports.WorkflowEngineResolver = exports.RunWorkflowEngineViewResult = exports.UpdateWorkflowEngineInput = exports.WorkflowEngine_ = exports.WorkflowResolver = exports.RunWorkflowViewResult = exports.UpdateWorkflowInput = exports.Workflow_ = exports.WorkflowRunResolver = exports.RunWorkflowRunViewResult = exports.UpdateWorkflowRunInput = exports.WorkflowRun_ = exports.UserViewRunDetailResolver = exports.RunUserViewRunDetailViewResult = exports.UpdateUserViewRunDetailInput = exports.CreateUserViewRunDetailInput = exports.UserViewRunDetail_ = exports.UserViewRunResolver = exports.RunUserViewRunViewResult = exports.UpdateUserViewRunInput = exports.CreateUserViewRunInput = exports.UserViewRun_ = exports.ListDetailResolver = exports.RunListDetailViewResult = exports.UpdateListDetailInput = exports.CreateListDetailInput = exports.ListDetail_ = exports.ListResolver = exports.RunListViewResult = exports.UpdateListInput = exports.CreateListInput = exports.List_ = exports.CompanyIntegrationRunAPILogResolver = exports.RunCompanyIntegrationRunAPILogViewResult = exports.UpdateCompanyIntegrationRunAPILogInput = exports.CompanyIntegrationRunAPILog_ = exports.UserApplicationResolver = exports.RunUserApplicationViewResult = exports.UpdateUserApplicationInput = exports.UserApplication_ = exports.UserApplicationEntityResolver = exports.RunUserApplicationEntityViewResult = exports.UpdateUserApplicationEntityInput = exports.CreateUserApplicationEntityInput = exports.UserApplicationEntity_ = exports.EntityPermissionResolver = exports.RunEntityPermissionViewResult = exports.UpdateEntityPermissionInput = void 0;
|
|
41
|
+
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_ = exports.RecordChangeResolver = exports.RunRecordChangeViewResult = void 0;
|
|
42
|
+
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 = exports.UpdateQueueInput = exports.CreateQueueInput = void 0;
|
|
43
|
+
exports.CreateQueryCategoryInput = exports.QueryCategory_ = exports.QueryFieldResolver = 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.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_ = exports.WorkspaceItemResolver = exports.RunWorkspaceItemViewResult = void 0;
|
|
44
|
+
exports.CreateDataContextInput = exports.DataContext_ = exports.DataContextItemResolver = exports.RunDataContextItemViewResult = exports.UpdateDataContextItemInput = exports.CreateDataContextItemInput = exports.DataContextItem_ = 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 = void 0;
|
|
45
|
+
exports.FileEntityRecordLinkResolver = exports.RunFileEntityRecordLinkViewResult = exports.UpdateFileEntityRecordLinkInput = exports.CreateFileEntityRecordLinkInput = exports.FileEntityRecordLink_ = exports.FileCategoryResolver = exports.RunFileCategoryViewResult = exports.UpdateFileCategoryInput = exports.CreateFileCategoryInput = exports.FileCategory_ = exports.FileResolver = exports.RunFileViewResult = exports.UpdateFileInput = exports.CreateFileInput = exports.File_ = exports.FileStorageProviderResolver = exports.RunFileStorageProviderViewResult = exports.UpdateFileStorageProviderInput = exports.CreateFileStorageProviderInput = exports.FileStorageProvider_ = exports.ReportCategoryResolver = exports.RunReportCategoryViewResult = exports.UpdateReportCategoryInput = exports.CreateReportCategoryInput = exports.ReportCategory_ = exports.DashboardCategoryResolver = exports.RunDashboardCategoryViewResult = exports.UpdateDashboardCategoryInput = exports.CreateDashboardCategoryInput = exports.DashboardCategory_ = exports.UserViewCategoryResolver = exports.RunUserViewCategoryViewResult = exports.UpdateUserViewCategoryInput = exports.CreateUserViewCategoryInput = exports.UserViewCategory_ = exports.DataContextResolver = exports.RunDataContextViewResult = exports.UpdateDataContextInput = void 0;
|
|
46
46
|
const server_1 = require("@memberjunction/server");
|
|
47
47
|
const core_1 = require("@memberjunction/core");
|
|
48
48
|
const class_validator_1 = require("class-validator");
|
|
@@ -1705,6 +1705,28 @@ __decorate([
|
|
|
1705
1705
|
exports.Role_ = Role_ = __decorate([
|
|
1706
1706
|
(0, server_1.ObjectType)({ description: 'Roles are used for security administration and can have zero to many Users as members' })
|
|
1707
1707
|
], Role_);
|
|
1708
|
+
let CreateRoleInput = class CreateRoleInput {
|
|
1709
|
+
};
|
|
1710
|
+
exports.CreateRoleInput = CreateRoleInput;
|
|
1711
|
+
__decorate([
|
|
1712
|
+
(0, server_1.Field)(),
|
|
1713
|
+
__metadata("design:type", String)
|
|
1714
|
+
], CreateRoleInput.prototype, "Name", void 0);
|
|
1715
|
+
__decorate([
|
|
1716
|
+
(0, server_1.Field)({ nullable: true }),
|
|
1717
|
+
__metadata("design:type", String)
|
|
1718
|
+
], CreateRoleInput.prototype, "Description", void 0);
|
|
1719
|
+
__decorate([
|
|
1720
|
+
(0, server_1.Field)({ nullable: true }),
|
|
1721
|
+
__metadata("design:type", String)
|
|
1722
|
+
], CreateRoleInput.prototype, "DirectoryID", void 0);
|
|
1723
|
+
__decorate([
|
|
1724
|
+
(0, server_1.Field)({ nullable: true }),
|
|
1725
|
+
__metadata("design:type", String)
|
|
1726
|
+
], CreateRoleInput.prototype, "SQLName", void 0);
|
|
1727
|
+
exports.CreateRoleInput = CreateRoleInput = __decorate([
|
|
1728
|
+
(0, server_1.InputType)()
|
|
1729
|
+
], CreateRoleInput);
|
|
1708
1730
|
let UpdateRoleInput = class UpdateRoleInput {
|
|
1709
1731
|
};
|
|
1710
1732
|
exports.UpdateRoleInput = UpdateRoleInput;
|
|
@@ -1818,6 +1840,26 @@ let RoleResolver = class RoleResolver extends server_1.ResolverBase {
|
|
|
1818
1840
|
const result = this.ArrayMapFieldNamesToCodeNames('Query Permissions', await dataSource.query(sSQL));
|
|
1819
1841
|
return result;
|
|
1820
1842
|
}
|
|
1843
|
+
async CreateRole(input, { dataSource, userPayload }, pubSub) {
|
|
1844
|
+
if (await this.BeforeCreate(dataSource, input)) {
|
|
1845
|
+
const entityObject = await new core_1.Metadata().GetEntityObject('Roles', this.GetUserFromPayload(userPayload));
|
|
1846
|
+
await entityObject.NewRecord();
|
|
1847
|
+
entityObject.SetMany(input);
|
|
1848
|
+
if (await entityObject.Save()) {
|
|
1849
|
+
await this.AfterCreate(dataSource, input);
|
|
1850
|
+
return entityObject.GetAll();
|
|
1851
|
+
}
|
|
1852
|
+
else
|
|
1853
|
+
return null;
|
|
1854
|
+
}
|
|
1855
|
+
else
|
|
1856
|
+
return null;
|
|
1857
|
+
}
|
|
1858
|
+
async BeforeCreate(dataSource, input) {
|
|
1859
|
+
return true;
|
|
1860
|
+
}
|
|
1861
|
+
async AfterCreate(dataSource, input) {
|
|
1862
|
+
}
|
|
1821
1863
|
async UpdateRole(input, { dataSource, userPayload }, pubSub) {
|
|
1822
1864
|
if (await this.BeforeUpdate(dataSource, input)) {
|
|
1823
1865
|
const entityObject = await new core_1.Metadata().GetEntityObject('Roles', this.GetUserFromPayload(userPayload));
|
|
@@ -1839,6 +1881,28 @@ let RoleResolver = class RoleResolver extends server_1.ResolverBase {
|
|
|
1839
1881
|
async AfterUpdate(dataSource, input) {
|
|
1840
1882
|
const i = input, d = dataSource;
|
|
1841
1883
|
}
|
|
1884
|
+
async DeleteRole(ID, { dataSource, userPayload }, pubSub) {
|
|
1885
|
+
if (await this.BeforeDelete(dataSource, ID)) {
|
|
1886
|
+
const entityObject = await new core_1.Metadata().GetEntityObject('Roles', this.GetUserFromPayload(userPayload));
|
|
1887
|
+
await entityObject.Load(ID);
|
|
1888
|
+
const returnValue = entityObject.GetAll();
|
|
1889
|
+
if (await entityObject.Delete()) {
|
|
1890
|
+
await this.AfterDelete(dataSource, ID);
|
|
1891
|
+
return returnValue;
|
|
1892
|
+
}
|
|
1893
|
+
else
|
|
1894
|
+
return null;
|
|
1895
|
+
}
|
|
1896
|
+
else
|
|
1897
|
+
return null;
|
|
1898
|
+
}
|
|
1899
|
+
async BeforeDelete(dataSource, ID) {
|
|
1900
|
+
const i = ID, d = dataSource;
|
|
1901
|
+
return true;
|
|
1902
|
+
}
|
|
1903
|
+
async AfterDelete(dataSource, ID) {
|
|
1904
|
+
const i = ID, d = dataSource;
|
|
1905
|
+
}
|
|
1842
1906
|
};
|
|
1843
1907
|
exports.RoleResolver = RoleResolver;
|
|
1844
1908
|
__decorate([
|
|
@@ -1930,6 +1994,15 @@ __decorate([
|
|
|
1930
1994
|
__metadata("design:paramtypes", [Role_, Object, server_1.PubSubEngine]),
|
|
1931
1995
|
__metadata("design:returntype", Promise)
|
|
1932
1996
|
], RoleResolver.prototype, "QueryPermissionsArray", null);
|
|
1997
|
+
__decorate([
|
|
1998
|
+
(0, server_1.Mutation)(() => Role_),
|
|
1999
|
+
__param(0, (0, server_1.Arg)('input', () => CreateRoleInput)),
|
|
2000
|
+
__param(1, (0, server_1.Ctx)()),
|
|
2001
|
+
__param(2, (0, server_1.PubSub)()),
|
|
2002
|
+
__metadata("design:type", Function),
|
|
2003
|
+
__metadata("design:paramtypes", [CreateRoleInput, Object, server_1.PubSubEngine]),
|
|
2004
|
+
__metadata("design:returntype", Promise)
|
|
2005
|
+
], RoleResolver.prototype, "CreateRole", null);
|
|
1933
2006
|
__decorate([
|
|
1934
2007
|
(0, server_1.Mutation)(() => Role_),
|
|
1935
2008
|
__param(0, (0, server_1.Arg)('input', () => UpdateRoleInput)),
|
|
@@ -1939,6 +2012,15 @@ __decorate([
|
|
|
1939
2012
|
__metadata("design:paramtypes", [UpdateRoleInput, Object, server_1.PubSubEngine]),
|
|
1940
2013
|
__metadata("design:returntype", Promise)
|
|
1941
2014
|
], RoleResolver.prototype, "UpdateRole", null);
|
|
2015
|
+
__decorate([
|
|
2016
|
+
(0, server_1.Mutation)(() => Role_),
|
|
2017
|
+
__param(0, (0, server_1.Arg)('ID', () => server_1.Int)),
|
|
2018
|
+
__param(1, (0, server_1.Ctx)()),
|
|
2019
|
+
__param(2, (0, server_1.PubSub)()),
|
|
2020
|
+
__metadata("design:type", Function),
|
|
2021
|
+
__metadata("design:paramtypes", [Number, Object, server_1.PubSubEngine]),
|
|
2022
|
+
__metadata("design:returntype", Promise)
|
|
2023
|
+
], RoleResolver.prototype, "DeleteRole", null);
|
|
1942
2024
|
exports.RoleResolver = RoleResolver = __decorate([
|
|
1943
2025
|
(0, server_1.Resolver)(Role_)
|
|
1944
2026
|
], RoleResolver);
|
|
@@ -7521,6 +7603,20 @@ __decorate([
|
|
|
7521
7603
|
exports.Application_ = Application_ = __decorate([
|
|
7522
7604
|
(0, server_1.ObjectType)({ description: 'Applications are used to group entities in the user interface for ease of user access' })
|
|
7523
7605
|
], Application_);
|
|
7606
|
+
let CreateApplicationInput = class CreateApplicationInput {
|
|
7607
|
+
};
|
|
7608
|
+
exports.CreateApplicationInput = CreateApplicationInput;
|
|
7609
|
+
__decorate([
|
|
7610
|
+
(0, server_1.Field)(),
|
|
7611
|
+
__metadata("design:type", String)
|
|
7612
|
+
], CreateApplicationInput.prototype, "Name", void 0);
|
|
7613
|
+
__decorate([
|
|
7614
|
+
(0, server_1.Field)({ nullable: true }),
|
|
7615
|
+
__metadata("design:type", String)
|
|
7616
|
+
], CreateApplicationInput.prototype, "Description", void 0);
|
|
7617
|
+
exports.CreateApplicationInput = CreateApplicationInput = __decorate([
|
|
7618
|
+
(0, server_1.InputType)()
|
|
7619
|
+
], CreateApplicationInput);
|
|
7524
7620
|
let UpdateApplicationInput = class UpdateApplicationInput {
|
|
7525
7621
|
};
|
|
7526
7622
|
exports.UpdateApplicationInput = UpdateApplicationInput;
|
|
@@ -7608,11 +7704,32 @@ let ApplicationResolver = class ApplicationResolver extends server_1.ResolverBas
|
|
|
7608
7704
|
const result = this.ArrayMapFieldNamesToCodeNames('User Applications', await dataSource.query(sSQL));
|
|
7609
7705
|
return result;
|
|
7610
7706
|
}
|
|
7707
|
+
async CreateApplication(input, { dataSource, userPayload }, pubSub) {
|
|
7708
|
+
if (await this.BeforeCreate(dataSource, input)) {
|
|
7709
|
+
const entityObject = await new core_1.Metadata().GetEntityObject('Applications', this.GetUserFromPayload(userPayload));
|
|
7710
|
+
await entityObject.NewRecord();
|
|
7711
|
+
entityObject.SetMany(input);
|
|
7712
|
+
if (await entityObject.Save()) {
|
|
7713
|
+
await this.AfterCreate(dataSource, input);
|
|
7714
|
+
return entityObject.GetAll();
|
|
7715
|
+
}
|
|
7716
|
+
else
|
|
7717
|
+
return null;
|
|
7718
|
+
}
|
|
7719
|
+
else
|
|
7720
|
+
return null;
|
|
7721
|
+
}
|
|
7722
|
+
async BeforeCreate(dataSource, input) {
|
|
7723
|
+
return true;
|
|
7724
|
+
}
|
|
7725
|
+
async AfterCreate(dataSource, input) {
|
|
7726
|
+
}
|
|
7611
7727
|
async UpdateApplication(input, { dataSource, userPayload }, pubSub) {
|
|
7612
7728
|
if (await this.BeforeUpdate(dataSource, input)) {
|
|
7613
7729
|
const entityObject = await new core_1.Metadata().GetEntityObject('Applications', this.GetUserFromPayload(userPayload));
|
|
7614
|
-
entityObject.
|
|
7615
|
-
|
|
7730
|
+
await entityObject.Load(input.ID);
|
|
7731
|
+
entityObject.SetMany(input);
|
|
7732
|
+
if (await entityObject.Save()) {
|
|
7616
7733
|
await this.AfterUpdate(dataSource, input);
|
|
7617
7734
|
return entityObject.GetAll();
|
|
7618
7735
|
}
|
|
@@ -7629,6 +7746,28 @@ let ApplicationResolver = class ApplicationResolver extends server_1.ResolverBas
|
|
|
7629
7746
|
async AfterUpdate(dataSource, input) {
|
|
7630
7747
|
const i = input, d = dataSource;
|
|
7631
7748
|
}
|
|
7749
|
+
async DeleteApplication(ID, { dataSource, userPayload }, pubSub) {
|
|
7750
|
+
if (await this.BeforeDelete(dataSource, ID)) {
|
|
7751
|
+
const entityObject = await new core_1.Metadata().GetEntityObject('Applications', this.GetUserFromPayload(userPayload));
|
|
7752
|
+
await entityObject.Load(ID);
|
|
7753
|
+
const returnValue = entityObject.GetAll();
|
|
7754
|
+
if (await entityObject.Delete()) {
|
|
7755
|
+
await this.AfterDelete(dataSource, ID);
|
|
7756
|
+
return returnValue;
|
|
7757
|
+
}
|
|
7758
|
+
else
|
|
7759
|
+
return null;
|
|
7760
|
+
}
|
|
7761
|
+
else
|
|
7762
|
+
return null;
|
|
7763
|
+
}
|
|
7764
|
+
async BeforeDelete(dataSource, ID) {
|
|
7765
|
+
const i = ID, d = dataSource;
|
|
7766
|
+
return true;
|
|
7767
|
+
}
|
|
7768
|
+
async AfterDelete(dataSource, ID) {
|
|
7769
|
+
const i = ID, d = dataSource;
|
|
7770
|
+
}
|
|
7632
7771
|
};
|
|
7633
7772
|
exports.ApplicationResolver = ApplicationResolver;
|
|
7634
7773
|
__decorate([
|
|
@@ -7693,6 +7832,15 @@ __decorate([
|
|
|
7693
7832
|
__metadata("design:paramtypes", [Application_, Object, server_1.PubSubEngine]),
|
|
7694
7833
|
__metadata("design:returntype", Promise)
|
|
7695
7834
|
], ApplicationResolver.prototype, "UserApplicationsArray", null);
|
|
7835
|
+
__decorate([
|
|
7836
|
+
(0, server_1.Mutation)(() => Application_),
|
|
7837
|
+
__param(0, (0, server_1.Arg)('input', () => CreateApplicationInput)),
|
|
7838
|
+
__param(1, (0, server_1.Ctx)()),
|
|
7839
|
+
__param(2, (0, server_1.PubSub)()),
|
|
7840
|
+
__metadata("design:type", Function),
|
|
7841
|
+
__metadata("design:paramtypes", [CreateApplicationInput, Object, server_1.PubSubEngine]),
|
|
7842
|
+
__metadata("design:returntype", Promise)
|
|
7843
|
+
], ApplicationResolver.prototype, "CreateApplication", null);
|
|
7696
7844
|
__decorate([
|
|
7697
7845
|
(0, server_1.Mutation)(() => Application_),
|
|
7698
7846
|
__param(0, (0, server_1.Arg)('input', () => UpdateApplicationInput)),
|
|
@@ -7702,6 +7850,15 @@ __decorate([
|
|
|
7702
7850
|
__metadata("design:paramtypes", [UpdateApplicationInput, Object, server_1.PubSubEngine]),
|
|
7703
7851
|
__metadata("design:returntype", Promise)
|
|
7704
7852
|
], ApplicationResolver.prototype, "UpdateApplication", null);
|
|
7853
|
+
__decorate([
|
|
7854
|
+
(0, server_1.Mutation)(() => Application_),
|
|
7855
|
+
__param(0, (0, server_1.Arg)('ID', () => server_1.Int)),
|
|
7856
|
+
__param(1, (0, server_1.Ctx)()),
|
|
7857
|
+
__param(2, (0, server_1.PubSub)()),
|
|
7858
|
+
__metadata("design:type", Function),
|
|
7859
|
+
__metadata("design:paramtypes", [Number, Object, server_1.PubSubEngine]),
|
|
7860
|
+
__metadata("design:returntype", Promise)
|
|
7861
|
+
], ApplicationResolver.prototype, "DeleteApplication", null);
|
|
7705
7862
|
exports.ApplicationResolver = ApplicationResolver = __decorate([
|
|
7706
7863
|
(0, server_1.Resolver)(Application_)
|
|
7707
7864
|
], ApplicationResolver);
|