@memberjunction/codegen-lib 0.9.87 → 0.9.88
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.
|
@@ -223,7 +223,7 @@ export class ${entity.BaseTableCodeName}Resolver${entity.CustomResolverAPI ? 'Ba
|
|
|
223
223
|
async ${entity.BaseTableCodeName}(@Arg('${entity.PrimaryKey.Name}', () => ${entity.PrimaryKey.GraphQLType}) ${entity.PrimaryKey.Name}: ${entity.PrimaryKey.TSType}, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine): Promise<${serverGraphQLTypeName} | null> {
|
|
224
224
|
this.CheckUserReadPermissions('${entity.Name}', userPayload);
|
|
225
225
|
const sSQL = \`SELECT * FROM [${entity.SchemaName}].[${entity.BaseView}] WHERE [${entity.PrimaryKey.Name}]=${idQuotes}\${${entity.PrimaryKey.Name}}${idQuotes} \` + this.getRowLevelSecurityWhereClause('${entity.Name}', userPayload, EntityPermissionType.Read, 'AND');${auditAccessCode}
|
|
226
|
-
const result = this.MapFieldNamesToCodeNames('${entity.Name}', dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
226
|
+
const result = this.MapFieldNamesToCodeNames('${entity.Name}', await dataSource.query(sSQL).then((r) => r && r.length > 0 ? r[0] : {}))
|
|
227
227
|
return result;
|
|
228
228
|
}
|
|
229
229
|
`;
|
|
@@ -234,7 +234,7 @@ export class ${entity.BaseTableCodeName}Resolver${entity.CustomResolverAPI ? 'Ba
|
|
|
234
234
|
All${entity.CodeName}(@Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
235
235
|
this.CheckUserReadPermissions('${entity.Name}', userPayload);
|
|
236
236
|
const sSQL = 'SELECT * FROM [${entity.SchemaName}].[${entity.BaseView}]' + this.getRowLevelSecurityWhereClause('${entity.Name}', userPayload, EntityPermissionType.Read, ' WHERE');
|
|
237
|
-
const result = this.ArrayMapFieldNamesToCodeNames('${entity.Name}', dataSource.query(sSQL));
|
|
237
|
+
const result = this.ArrayMapFieldNamesToCodeNames('${entity.Name}', await dataSource.query(sSQL));
|
|
238
238
|
return result;
|
|
239
239
|
}
|
|
240
240
|
`;
|
|
@@ -462,7 +462,7 @@ function generateOneToManyFieldResolver(entity, r) {
|
|
|
462
462
|
async ${r.RelatedEntityCodeName}Array(@Root() ${instanceName}: ${entity.BaseTableCodeName + _graphQLTypeSuffix}, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
463
463
|
this.CheckUserReadPermissions('${r.RelatedEntity}', userPayload);
|
|
464
464
|
const sSQL = \`SELECT * FROM [${re.SchemaName}].[${r.RelatedEntityBaseView}]\ WHERE [${r.RelatedEntityJoinField}]=[\${${instanceName}.${!r.EntityKeyField ? entity.PrimaryKey.Name : r.EntityKeyField}}] \` + this.getRowLevelSecurityWhereClause('${r.RelatedEntity}', userPayload, EntityPermissionType.Read, 'AND');
|
|
465
|
-
const result = this.ArrayMapFieldNamesToCodeNames('${r.RelatedEntity}', dataSource.query(sSQL));
|
|
465
|
+
const result = this.ArrayMapFieldNamesToCodeNames('${r.RelatedEntity}', await dataSource.query(sSQL));
|
|
466
466
|
return result;
|
|
467
467
|
}
|
|
468
468
|
`;
|
|
@@ -476,7 +476,7 @@ function generateManyToManyFieldResolver(entity, r) {
|
|
|
476
476
|
async ${r.RelatedEntityCodeName}Array(@Root() ${instanceName}: ${entity.BaseTableCodeName + _graphQLTypeSuffix}, @Ctx() { dataSource, userPayload }: AppContext, @PubSub() pubSub: PubSubEngine) {
|
|
477
477
|
this.CheckUserReadPermissions('${r.RelatedEntity}', userPayload);
|
|
478
478
|
const sSQL = \`SELECT * FROM [${re.SchemaName}].[${r.RelatedEntityBaseView}]\ WHERE [${re.PrimaryKey.Name}] IN (SELECT [${r.JoinEntityInverseJoinField}] FROM [${re.SchemaName}].[${r.JoinView}] WHERE [${r.JoinEntityJoinField}]=[\${${instanceName}.${!r.EntityKeyField ? entity.PrimaryKey.Name : r.EntityKeyField}}]) \` + this.getRowLevelSecurityWhereClause('${r.RelatedEntity}', userPayload, EntityPermissionType.Read, 'AND');
|
|
479
|
-
const result = this.ArrayMapFieldNamesToCodeNames('${r.RelatedEntity}', dataSource.query(sSQL));
|
|
479
|
+
const result = this.ArrayMapFieldNamesToCodeNames('${r.RelatedEntity}', await dataSource.query(sSQL));
|
|
480
480
|
return result;
|
|
481
481
|
}
|
|
482
482
|
`;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@memberjunction/codegen-lib",
|
|
3
|
-
"version": "0.9.
|
|
3
|
+
"version": "0.9.88",
|
|
4
4
|
"description": "Library used by the CodeGen executable to generate code for the MemberJunction platform",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -19,10 +19,10 @@
|
|
|
19
19
|
"typescript": "^5.0.3"
|
|
20
20
|
},
|
|
21
21
|
"dependencies": {
|
|
22
|
-
"@memberjunction/core": "^0.9.
|
|
22
|
+
"@memberjunction/core": "^0.9.113",
|
|
23
23
|
"@memberjunction/core-entities": "^0.9.44",
|
|
24
24
|
"@memberjunction/global": "^0.9.107",
|
|
25
|
-
"@memberjunction/sqlserver-dataprovider": "^0.9.
|
|
25
|
+
"@memberjunction/sqlserver-dataprovider": "^0.9.112",
|
|
26
26
|
"env-var": "^7.4.1",
|
|
27
27
|
"fs-extra": "^11.1.1",
|
|
28
28
|
"glob": "^10.3.10",
|