@appxdigital/appx-core 0.1.69 → 0.1.71

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.
@@ -1 +1 @@
1
- {"version":3,"file":"session-serializer.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/session/session-serializer.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAE7D,qBACa,iBAAkB,SAAQ,kBAAkB;IACzC,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAIzC,aAAa,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ;IAIjC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ;CAcvD"}
1
+ {"version":3,"file":"session-serializer.d.ts","sourceRoot":"","sources":["../../../../src/modules/auth/session/session-serializer.ts"],"names":[],"mappings":"AACA,OAAO,EAAC,kBAAkB,EAAC,MAAM,kBAAkB,CAAC;AACpD,OAAO,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAE7D,qBACa,iBAAkB,SAAQ,kBAAkB;IACzC,OAAO,CAAC,MAAM;gBAAN,MAAM,EAAE,aAAa;IAIzC,aAAa,CAAC,IAAI,EAAE,GAAG,EAAE,IAAI,EAAE,QAAQ;IAIjC,eAAe,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ;CAiBvD"}
@@ -29,6 +29,9 @@ let SessionSerializer = class SessionSerializer extends passport_1.PassportSeria
29
29
  id: true,
30
30
  role: true,
31
31
  },
32
+ }, {
33
+ BYPASS_FILTERING: true,
34
+ BYPASS_OMISSION: true,
32
35
  });
33
36
  done(null, user);
34
37
  }
@@ -1 +1 @@
1
- {"version":3,"file":"prisma.service.d.ts","sourceRoot":"","sources":["../../src/prisma/prisma.service.ts"],"names":[],"mappings":"AACA,OAAO,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AWG;IACH,OAAO,CAAC,oBAAoB;IAqG5B,eAAe,CAAC,WAAW,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM;;;;;;;IAoCzD;;;;;;;OAOG;IACH,OAAO,CAAC,eAAe;IAgBvB;;;;;;;OAOG;IACH,OAAO,CAAC,mBAAmB;IAwB3B;;;;;;;OAOG;IACH,OAAO,CAAC,eAAe;IAQvB;;;;;;;;;OASG;IACH,OAAO,CAAC,iBAAiB;IAkDzB;;;;;;;;OAQG;IACH,OAAO,CAAC,mBAAmB;CAgB9B"}
@@ -295,25 +295,27 @@ let PrismaService = class PrismaService {
295
295
  const permissionsConfig = this.normalizedPermissionsConfig;
296
296
  const normalizedName = modelName.toLowerCase().trim();
297
297
  const permissions = permissionsConfig[normalizedName]?.[userRole];
298
- for (const model of Object.keys(args.select)) {
299
- if (!this.fieldConfigs[model.toLowerCase()]) {
300
- continue;
301
- }
302
- const relation = this.getRelationType(modelName, model);
303
- if (relation.relation === 'belongsTo') {
304
- const relatedPermissions = permissionsConfig[model.toLowerCase()]?.[userRole]?.[action];
305
- belongsToQueue.push({
306
- modelName: model,
307
- relation,
308
- relatedPermissions,
309
- });
310
- continue;
311
- }
312
- if (permissionsConfig[model.toLowerCase()]) {
313
- this.applyWhereConditions(model, userRole, args.select[model], user, action);
314
- }
315
- else {
316
- throw new common_1.ForbiddenException(`No permissions found for model ${model} and role ${userRole}`);
298
+ if (args.select) {
299
+ for (const model of Object.keys(args.select)) {
300
+ if (!this.fieldConfigs[model.toLowerCase()]) {
301
+ continue;
302
+ }
303
+ const relation = this.getRelationType(modelName, model);
304
+ if (relation.relation === 'belongsTo') {
305
+ const relatedPermissions = permissionsConfig[model.toLowerCase()]?.[userRole]?.[action];
306
+ belongsToQueue.push({
307
+ modelName: model,
308
+ relation,
309
+ relatedPermissions,
310
+ });
311
+ continue;
312
+ }
313
+ if (permissionsConfig[model.toLowerCase()]) {
314
+ this.applyWhereConditions(model, userRole, args.select[model], user, action);
315
+ }
316
+ else {
317
+ throw new common_1.ForbiddenException(`No permissions found for model ${model} and role ${userRole}`);
318
+ }
317
319
  }
318
320
  }
319
321
  if (!permissions) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@appxdigital/appx-core",
3
- "version": "0.1.69",
3
+ "version": "0.1.71",
4
4
  "description": "Appx Core is a library that provides a set of tools to help you build your application faster.",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",