@memberjunction/server 0.9.237 → 0.9.238

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@memberjunction/server",
3
- "version": "0.9.237",
3
+ "version": "0.9.238",
4
4
  "description": "MemberJunction: This project provides API access via GraphQL to the common data store.",
5
5
  "main": "dist/index.js",
6
6
  "types": "src/index.ts",
@@ -22,15 +22,15 @@
22
22
  "@apollo/server": "^4.9.1",
23
23
  "@graphql-tools/utils": "^10.0.1",
24
24
  "@memberjunction/ai": "^0.9.160",
25
- "@memberjunction/aiengine": "^0.9.57",
25
+ "@memberjunction/aiengine": "^0.9.58",
26
26
  "@memberjunction/core": "^0.9.172",
27
- "@memberjunction/core-entities": "^0.9.156",
28
- "@memberjunction/data-context": "^0.9.44",
29
- "@memberjunction/data-context-server": "^0.9.40",
27
+ "@memberjunction/core-entities": "^0.9.157",
28
+ "@memberjunction/data-context": "^0.9.45",
29
+ "@memberjunction/data-context-server": "^0.9.41",
30
30
  "@memberjunction/global": "^0.9.153",
31
- "@memberjunction/queue": "^0.9.178",
32
- "@memberjunction/sqlserver-dataprovider": "^0.9.194",
33
- "@memberjunction/skip-types": "^0.9.69",
31
+ "@memberjunction/queue": "^0.9.179",
32
+ "@memberjunction/sqlserver-dataprovider": "^0.9.195",
33
+ "@memberjunction/skip-types": "^0.9.70",
34
34
  "@types/cors": "^2.8.13",
35
35
  "@types/jsonwebtoken": "^8.5.9",
36
36
  "@types/node": "^18.11.14",
@@ -2,7 +2,7 @@
2
2
  * ALL ENTITIES - TypeGraphQL Type Class Definition - AUTO GENERATED FILE
3
3
  * Generated Entities and Resolvers for Server
4
4
  *
5
- * GENERATED: 3/17/2024, 7:51:53 PM
5
+ * GENERATED: 3/18/2024, 2:22:24 PM
6
6
  *
7
7
  * >>> DO NOT MODIFY THIS FILE!!!!!!!!!!!!
8
8
  * >>> YOUR CHANGES WILL BE OVERWRITTEN
@@ -14576,6 +14576,32 @@ export class QueryCategoryResolver extends ResolverBase {
14576
14576
  const i = input, d = dataSource; // prevent error
14577
14577
  }
14578
14578
 
14579
+ @Mutation(() => QueryCategory_)
14580
+ async DeleteQueryCategory(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
14581
+ if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
14582
+ const entityObject = <QueryCategoryEntity>await new Metadata().GetEntityObject('Query Categories', this.GetUserFromPayload(userPayload));
14583
+ await entityObject.Load(ID);
14584
+ const returnValue = entityObject.GetAll(); // grab the values before we delete so we can return last state before delete if we are successful.
14585
+ if (await entityObject.Delete()) {
14586
+ await this.AfterDelete(dataSource, ID); // fire event
14587
+ return returnValue;
14588
+ }
14589
+ else
14590
+ return null; // delete failed, this will cause an exception
14591
+ }
14592
+ else
14593
+ return null; // BeforeDelete canceled the operation, this will cause an exception
14594
+ }
14595
+
14596
+ // Before/After UPDATE Event Hooks for Sub-Classes to Override
14597
+ protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
14598
+ const i = ID, d = dataSource; // prevent error;
14599
+ return true;
14600
+ }
14601
+ protected async AfterDelete(dataSource: DataSource, ID: number) {
14602
+ const i = ID, d = dataSource; // prevent error
14603
+ }
14604
+
14579
14605
  }
14580
14606
 
14581
14607
  //****************************************************************************
@@ -17092,6 +17118,32 @@ export class DashboardCategoryResolver extends ResolverBase {
17092
17118
  const i = input, d = dataSource; // prevent error
17093
17119
  }
17094
17120
 
17121
+ @Mutation(() => DashboardCategory_)
17122
+ async DeleteDashboardCategory(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
17123
+ if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
17124
+ const entityObject = <DashboardCategoryEntity>await new Metadata().GetEntityObject('Dashboard Categories', this.GetUserFromPayload(userPayload));
17125
+ await entityObject.Load(ID);
17126
+ const returnValue = entityObject.GetAll(); // grab the values before we delete so we can return last state before delete if we are successful.
17127
+ if (await entityObject.Delete()) {
17128
+ await this.AfterDelete(dataSource, ID); // fire event
17129
+ return returnValue;
17130
+ }
17131
+ else
17132
+ return null; // delete failed, this will cause an exception
17133
+ }
17134
+ else
17135
+ return null; // BeforeDelete canceled the operation, this will cause an exception
17136
+ }
17137
+
17138
+ // Before/After UPDATE Event Hooks for Sub-Classes to Override
17139
+ protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
17140
+ const i = ID, d = dataSource; // prevent error;
17141
+ return true;
17142
+ }
17143
+ protected async AfterDelete(dataSource: DataSource, ID: number) {
17144
+ const i = ID, d = dataSource; // prevent error
17145
+ }
17146
+
17095
17147
  }
17096
17148
 
17097
17149
  //****************************************************************************
@@ -17295,6 +17347,32 @@ export class ReportCategoryResolver extends ResolverBase {
17295
17347
  const i = input, d = dataSource; // prevent error
17296
17348
  }
17297
17349
 
17350
+ @Mutation(() => ReportCategory_)
17351
+ async DeleteReportCategory(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
17352
+ if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
17353
+ const entityObject = <ReportCategoryEntity>await new Metadata().GetEntityObject('Report Categories', this.GetUserFromPayload(userPayload));
17354
+ await entityObject.Load(ID);
17355
+ const returnValue = entityObject.GetAll(); // grab the values before we delete so we can return last state before delete if we are successful.
17356
+ if (await entityObject.Delete()) {
17357
+ await this.AfterDelete(dataSource, ID); // fire event
17358
+ return returnValue;
17359
+ }
17360
+ else
17361
+ return null; // delete failed, this will cause an exception
17362
+ }
17363
+ else
17364
+ return null; // BeforeDelete canceled the operation, this will cause an exception
17365
+ }
17366
+
17367
+ // Before/After UPDATE Event Hooks for Sub-Classes to Override
17368
+ protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
17369
+ const i = ID, d = dataSource; // prevent error;
17370
+ return true;
17371
+ }
17372
+ protected async AfterDelete(dataSource: DataSource, ID: number) {
17373
+ const i = ID, d = dataSource; // prevent error
17374
+ }
17375
+
17298
17376
  }
17299
17377
 
17300
17378
  //****************************************************************************
@@ -17950,6 +18028,32 @@ export class FileCategoryResolver extends ResolverBase {
17950
18028
  const i = input, d = dataSource; // prevent error
17951
18029
  }
17952
18030
 
18031
+ @Mutation(() => FileCategory_)
18032
+ async DeleteFileCategory(@Arg('ID', () => Int) ID: number, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
18033
+ if (await this.BeforeDelete(dataSource, ID)) { // fire event and proceed if it wasn't cancelled
18034
+ const entityObject = <FileCategoryEntity>await new Metadata().GetEntityObject('File Categories', this.GetUserFromPayload(userPayload));
18035
+ await entityObject.Load(ID);
18036
+ const returnValue = entityObject.GetAll(); // grab the values before we delete so we can return last state before delete if we are successful.
18037
+ if (await entityObject.Delete()) {
18038
+ await this.AfterDelete(dataSource, ID); // fire event
18039
+ return returnValue;
18040
+ }
18041
+ else
18042
+ return null; // delete failed, this will cause an exception
18043
+ }
18044
+ else
18045
+ return null; // BeforeDelete canceled the operation, this will cause an exception
18046
+ }
18047
+
18048
+ // Before/After UPDATE Event Hooks for Sub-Classes to Override
18049
+ protected async BeforeDelete(dataSource: DataSource, ID: number): Promise<boolean> {
18050
+ const i = ID, d = dataSource; // prevent error;
18051
+ return true;
18052
+ }
18053
+ protected async AfterDelete(dataSource: DataSource, ID: number) {
18054
+ const i = ID, d = dataSource; // prevent error
18055
+ }
18056
+
17953
18057
  }
17954
18058
 
17955
18059
  //****************************************************************************