easywork-common-lib 1.0.1069 → 1.0.1071

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.
@@ -24,7 +24,7 @@ exports.ClientSource = ClientSource;
24
24
  __decorate([
25
25
  (0, swagger_1.ApiProperty)({ type: String, description: "Nombre", minLength: 3 }),
26
26
  (0, class_validator_1.MinLength)(2),
27
- (0, typeorm_1.Column)({ unique: true }),
27
+ (0, typeorm_1.Column)(),
28
28
  __metadata("design:type", String)
29
29
  ], ClientSource.prototype, "name", void 0);
30
30
  __decorate([
@@ -50,6 +50,7 @@ __decorate([
50
50
  __metadata("design:type", group_entity_1.Group)
51
51
  ], ClientSource.prototype, "group", void 0);
52
52
  exports.ClientSource = ClientSource = __decorate([
53
- (0, typeorm_1.Entity)()
53
+ (0, typeorm_1.Entity)(),
54
+ (0, typeorm_1.Index)(["name", "group"], { unique: true })
54
55
  ], ClientSource);
55
56
  //# sourceMappingURL=client_sources.entity.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"client_sources.entity.js","sourceRoot":"","sources":["../../../../../src/entities/helpers/sales/common/client_sources.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yEAAqE;AACrE,qDAA4C;AAC5C,qCAAoD;AACpD,6CAA8C;AAC9C,wDAA8C;AAGvC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,wBAAU;IAI1C,IAAI,CAAS;IAQb,SAAS,CAAU;IAYnB,KAAK,CAAS;CACf,CAAA;AAzBY,oCAAY;AAIvB;IAHC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IAClE,IAAA,2BAAS,EAAC,CAAC,CAAC;IACZ,IAAA,gBAAM,EAAC,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;;0CACZ;AAQb;IANC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,uCAAuC;QACpD,OAAO,EAAE,KAAK;KACf,CAAC;IACD,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;+CACR;AAYnB;IAVC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,GAAG,EAAE,CAAC,oBAAK;QACjB,WAAW,EAAE,OAAO;QACpB,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,oBAAK,EAAE;QACtB,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,IAAI;KACf,CAAC;8BACM,oBAAK;2CAAC;uBAxBH,YAAY;IADxB,IAAA,gBAAM,GAAE;GACI,YAAY,CAyBxB"}
1
+ {"version":3,"file":"client_sources.entity.js","sourceRoot":"","sources":["../../../../../src/entities/helpers/sales/common/client_sources.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,yEAAqE;AACrE,qDAA4C;AAC5C,qCAA2D;AAC3D,6CAA8C;AAC9C,wDAA8C;AAIvC,IAAM,YAAY,GAAlB,MAAM,YAAa,SAAQ,wBAAU;IAI1C,IAAI,CAAS;IAQb,SAAS,CAAU;IAYnB,KAAK,CAAS;CACf,CAAA;AAzBY,oCAAY;AAIvB;IAHC,IAAA,qBAAW,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,WAAW,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC,EAAE,CAAC;IAClE,IAAA,2BAAS,EAAC,CAAC,CAAC;IACZ,IAAA,gBAAM,GAAE;;0CACI;AAQb;IANC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,OAAO;QACb,WAAW,EAAE,uCAAuC;QACpD,OAAO,EAAE,KAAK;KACf,CAAC;IACD,IAAA,gBAAM,EAAC,EAAE,OAAO,EAAE,KAAK,EAAE,CAAC;;+CACR;AAYnB;IAVC,IAAA,qBAAW,EAAC;QACX,IAAI,EAAE,GAAG,EAAE,CAAC,oBAAK;QACjB,WAAW,EAAE,OAAO;QACpB,QAAQ,EAAE,KAAK;KAChB,CAAC;IACD,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,oBAAK,EAAE;QACtB,QAAQ,EAAE,UAAU;QACpB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,IAAI;KACf,CAAC;8BACM,oBAAK;2CAAC;uBAxBH,YAAY;IAFxB,IAAA,gBAAM,GAAE;IACR,IAAA,eAAK,EAAC,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,CAAC;GAC9B,YAAY,CAyBxB"}
@@ -0,0 +1,15 @@
1
+ import { BaseEntityOnlyEssential } from '../../common/database/base.entity';
2
+ import { PlanFeature } from './plan-feature';
3
+ export declare enum FeatureType {
4
+ BOOLEAN = "boolean",
5
+ LIMIT = "limit",
6
+ TEXT = "text"
7
+ }
8
+ export declare class Feature extends BaseEntityOnlyEssential {
9
+ key: string;
10
+ name: string;
11
+ description: string;
12
+ category: string;
13
+ type: FeatureType;
14
+ planFeatures: PlanFeature[];
15
+ }
@@ -0,0 +1,64 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.Feature = exports.FeatureType = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const base_entity_1 = require("../../common/database/base.entity");
15
+ const swagger_1 = require("@nestjs/swagger");
16
+ const plan_feature_1 = require("./plan-feature");
17
+ var FeatureType;
18
+ (function (FeatureType) {
19
+ FeatureType["BOOLEAN"] = "boolean";
20
+ FeatureType["LIMIT"] = "limit";
21
+ FeatureType["TEXT"] = "text";
22
+ })(FeatureType || (exports.FeatureType = FeatureType = {}));
23
+ let Feature = class Feature extends base_entity_1.BaseEntityOnlyEssential {
24
+ key;
25
+ name;
26
+ description;
27
+ category;
28
+ type;
29
+ planFeatures;
30
+ };
31
+ exports.Feature = Feature;
32
+ __decorate([
33
+ (0, swagger_1.ApiProperty)({ description: 'Nombre único y programático de la característica', example: 'PRO_POLICY_READER' }),
34
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, unique: true, nullable: false }),
35
+ __metadata("design:type", String)
36
+ ], Feature.prototype, "key", void 0);
37
+ __decorate([
38
+ (0, swagger_1.ApiProperty)({ description: 'Nombre de la característica para mostrar al usuario', example: 'Lector de Pólizas Pro' }),
39
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
40
+ __metadata("design:type", String)
41
+ ], Feature.prototype, "name", void 0);
42
+ __decorate([
43
+ (0, swagger_1.ApiProperty)({ description: 'Descripción detallada de lo que hace la característica', example: 'Permite analizar y extraer datos de pólizas en formato PDF.' }),
44
+ (0, typeorm_1.Column)({ type: 'text', nullable: true }),
45
+ __metadata("design:type", String)
46
+ ], Feature.prototype, "description", void 0);
47
+ __decorate([
48
+ (0, swagger_1.ApiProperty)({ description: 'Categoría para agrupar en la UI', example: 'Reportes' }),
49
+ (0, typeorm_1.Column)({ type: 'varchar', length: 100, nullable: true }),
50
+ __metadata("design:type", String)
51
+ ], Feature.prototype, "category", void 0);
52
+ __decorate([
53
+ (0, swagger_1.ApiProperty)({ description: 'El tipo de valor que esta característica almacena', enum: FeatureType, example: FeatureType.BOOLEAN }),
54
+ (0, typeorm_1.Column)({ type: 'enum', enum: FeatureType, nullable: false }),
55
+ __metadata("design:type", String)
56
+ ], Feature.prototype, "type", void 0);
57
+ __decorate([
58
+ (0, typeorm_1.OneToMany)(() => plan_feature_1.PlanFeature, planFeature => planFeature.feature),
59
+ __metadata("design:type", Array)
60
+ ], Feature.prototype, "planFeatures", void 0);
61
+ exports.Feature = Feature = __decorate([
62
+ (0, typeorm_1.Entity)('features')
63
+ ], Feature);
64
+ //# sourceMappingURL=feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"feature.js","sourceRoot":"","sources":["../../../src/entities/subscriptions/feature.ts"],"names":[],"mappings":";;;;;;;;;;;;AACA,qCAAoD;AACpD,mEAA4E;AAC5E,6CAA8C;AAC9C,iDAA6C;AAE7C,IAAY,WAIX;AAJD,WAAY,WAAW;IACrB,kCAAmB,CAAA;IACnB,8BAAe,CAAA;IACf,4BAAa,CAAA;AACf,CAAC,EAJW,WAAW,2BAAX,WAAW,QAItB;AAGM,IAAM,OAAO,GAAb,MAAM,OAAQ,SAAQ,qCAAuB;IAGlD,GAAG,CAAS;IAIZ,IAAI,CAAS;IAIb,WAAW,CAAS;IAIpB,QAAQ,CAAS;IAIjB,IAAI,CAAc;IAGlB,YAAY,CAAgB;CAC7B,CAAA;AAvBY,0BAAO;AAGlB;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,kDAAkD,EAAE,OAAO,EAAE,mBAAmB,EAAE,CAAC;IAC9G,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;oCAC5D;AAIZ;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,qDAAqD,EAAE,OAAO,EAAE,uBAAuB,EAAE,CAAC;IACrH,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;qCAC7C;AAIb;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,wDAAwD,EAAE,OAAO,EAAE,6DAA6D,EAAE,CAAC;IAC9J,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;4CACrB;AAIpB;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,iCAAiC,EAAE,OAAO,EAAE,UAAU,EAAE,CAAC;IACpF,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,IAAI,EAAE,CAAC;;yCACxC;AAIjB;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,mDAAmD,EAAE,IAAI,EAAE,WAAW,EAAE,OAAO,EAAE,WAAW,CAAC,OAAO,EAAE,CAAC;IAClI,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,EAAE,WAAW,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;qCAC3C;AAGlB;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,0BAAW,EAAE,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,OAAO,CAAC;;6CACrC;kBAtBjB,OAAO;IADnB,IAAA,gBAAM,EAAC,UAAU,CAAC;GACN,OAAO,CAuBnB"}
@@ -0,0 +1,8 @@
1
+ import { Plan } from './plan.entity';
2
+ import { Feature } from './feature';
3
+ export declare class PlanFeature {
4
+ id: string;
5
+ value: string;
6
+ plan: Plan;
7
+ feature: Feature;
8
+ }
@@ -0,0 +1,44 @@
1
+ "use strict";
2
+ var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
+ var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
+ if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
+ else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
+ return c > 3 && r && Object.defineProperty(target, key, r), r;
7
+ };
8
+ var __metadata = (this && this.__metadata) || function (k, v) {
9
+ if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
+ };
11
+ Object.defineProperty(exports, "__esModule", { value: true });
12
+ exports.PlanFeature = void 0;
13
+ const typeorm_1 = require("typeorm");
14
+ const plan_entity_1 = require("./plan.entity");
15
+ const swagger_1 = require("@nestjs/swagger");
16
+ const feature_1 = require("./feature");
17
+ let PlanFeature = class PlanFeature {
18
+ id;
19
+ value;
20
+ plan;
21
+ feature;
22
+ };
23
+ exports.PlanFeature = PlanFeature;
24
+ __decorate([
25
+ (0, typeorm_1.PrimaryGeneratedColumn)('uuid'),
26
+ __metadata("design:type", String)
27
+ ], PlanFeature.prototype, "id", void 0);
28
+ __decorate([
29
+ (0, swagger_1.ApiProperty)({ description: 'Valor de la característica para este plan. Puede ser "true", "100", "ilimitado", etc.', example: 'true' }),
30
+ (0, typeorm_1.Column)({ type: 'varchar', length: 255, nullable: false }),
31
+ __metadata("design:type", String)
32
+ ], PlanFeature.prototype, "value", void 0);
33
+ __decorate([
34
+ (0, typeorm_1.ManyToOne)(() => plan_entity_1.Plan, plan => plan.planFeatures, { onDelete: 'CASCADE' }),
35
+ __metadata("design:type", plan_entity_1.Plan)
36
+ ], PlanFeature.prototype, "plan", void 0);
37
+ __decorate([
38
+ (0, typeorm_1.ManyToOne)(() => feature_1.Feature, feature => feature.planFeatures, { onDelete: 'CASCADE', eager: true }),
39
+ __metadata("design:type", feature_1.Feature)
40
+ ], PlanFeature.prototype, "feature", void 0);
41
+ exports.PlanFeature = PlanFeature = __decorate([
42
+ (0, typeorm_1.Entity)('plan_features')
43
+ ], PlanFeature);
44
+ //# sourceMappingURL=plan-feature.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"plan-feature.js","sourceRoot":"","sources":["../../../src/entities/subscriptions/plan-feature.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAA4E;AAC5E,+CAAqC;AACrC,6CAA8C;AAC9C,uCAAoC;AAG7B,IAAM,WAAW,GAAjB,MAAM,WAAW;IAEtB,EAAE,CAAS;IAIX,KAAK,CAAS;IAGd,IAAI,CAAO;IAGX,OAAO,CAAU;CAClB,CAAA;AAbY,kCAAW;AAEtB;IADC,IAAA,gCAAsB,EAAC,MAAM,CAAC;;uCACpB;AAIX;IAFC,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,uFAAuF,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC;IACtI,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,MAAM,EAAE,GAAG,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;;0CAC5C;AAGd;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,kBAAI,EAAE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,YAAY,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,CAAC;8BACpE,kBAAI;yCAAC;AAGX;IADC,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,iBAAO,EAAE,OAAO,CAAC,EAAE,CAAC,OAAO,CAAC,YAAY,EAAE,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;8BACvF,iBAAO;4CAAC;sBAZN,WAAW;IADvB,IAAA,gBAAM,EAAC,eAAe,CAAC;GACX,WAAW,CAavB"}
@@ -1,5 +1,6 @@
1
1
  import { BaseEntityOnlyEssential } from '../../common/database/base.entity';
2
2
  import { Subscription } from './subscription.entity';
3
+ import { PlanFeature } from './plan-feature';
3
4
  export declare enum BillingCycle {
4
5
  MONTHLY = "monthly",
5
6
  ANNUALLY = "annually",
@@ -13,7 +14,7 @@ export declare class Plan extends BaseEntityOnlyEssential {
13
14
  billingCycle: BillingCycle;
14
15
  userLimit: number | null;
15
16
  storageLimitGb: number | null;
16
- features: Record<string, any> | null;
17
+ planFeatures: PlanFeature[];
17
18
  isActive: boolean;
18
19
  subscription: Subscription;
19
20
  }
@@ -14,6 +14,7 @@ const typeorm_1 = require("typeorm");
14
14
  const swagger_1 = require("@nestjs/swagger");
15
15
  const base_entity_1 = require("../../common/database/base.entity");
16
16
  const subscription_entity_1 = require("./subscription.entity");
17
+ const plan_feature_1 = require("./plan-feature");
17
18
  var BillingCycle;
18
19
  (function (BillingCycle) {
19
20
  BillingCycle["MONTHLY"] = "monthly";
@@ -28,7 +29,7 @@ let Plan = class Plan extends base_entity_1.BaseEntityOnlyEssential {
28
29
  billingCycle;
29
30
  userLimit;
30
31
  storageLimitGb;
31
- features;
32
+ planFeatures;
32
33
  isActive;
33
34
  subscription;
34
35
  };
@@ -81,14 +82,14 @@ __decorate([
81
82
  __metadata("design:type", Number)
82
83
  ], Plan.prototype, "storageLimitGb", void 0);
83
84
  __decorate([
84
- (0, typeorm_1.Column)({ type: 'json', nullable: true }),
85
85
  (0, swagger_1.ApiProperty)({
86
86
  description: 'JSON para otros límites/flags de características específicas',
87
87
  example: { featureA: true, featureB_limit: 1000 },
88
88
  nullable: true,
89
89
  }),
90
- __metadata("design:type", Object)
91
- ], Plan.prototype, "features", void 0);
90
+ (0, typeorm_1.OneToMany)(() => plan_feature_1.PlanFeature, planFeature => planFeature.plan, { cascade: true, eager: true }),
91
+ __metadata("design:type", Array)
92
+ ], Plan.prototype, "planFeatures", void 0);
92
93
  __decorate([
93
94
  (0, typeorm_1.Column)({ type: 'boolean', default: true, nullable: false }),
94
95
  (0, swagger_1.ApiProperty)({ description: 'Indica si el plan está activo (true) o ha sido deprecado (false)', example: true }),
@@ -1 +1 @@
1
- {"version":3,"file":"plan.entity.js","sourceRoot":"","sources":["../../../src/entities/subscriptions/plan.entity.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,qCAAmD;AACnD,6CAA8C;AAC9C,mEAA4E;AAC5E,+DAAqD;AAEr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AAE,EAAE,QAAQ,EAAE,IAAI,EAAE,cAAc,EAAE,IAAI,EAAE;QACjD,QAAQ,EAAE,IAAI;KACf,CAAC;IACD,IAAA,mBAAS,EAAC,GAAG,EAAE,CAAC,0BAAW,EAAE,WAAW,CAAC,EAAE,CAAC,WAAW,CAAC,IAAI,EAAE,EAAE,OAAO,EAAE,IAAI,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC;;0CAClE;AAI5B;IAFC,IAAA,gBAAM,EAAC,EAAE,IAAI,EAAE,SAAS,EAAE,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC3D,IAAA,qBAAW,EAAC,EAAE,WAAW,EAAE,kEAAkE,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC;;sCAC9F;AAGlB;IADC,IAAA,kBAAQ,EAAC,GAAG,EAAE,CAAC,kCAAY,EAAE,YAAY,CAAC,EAAE,CAAC,YAAY,CAAC,KAAK,CAAC;8BACnD,kCAAY;0CAAC;eAtDhB,IAAI;IADhB,IAAA,gBAAM,EAAC,OAAO,CAAC;GACH,IAAI,CAuDhB"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "easywork-common-lib",
3
- "version": "1.0.1069",
3
+ "version": "1.0.1071",
4
4
  "description": "Librería común de Easywork",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -1,35 +0,0 @@
1
- export declare class AppModule {
2
- }
3
- import { Repository } from 'typeorm';
4
- import { ContactAuthorizationService, ResourceAuthorizationFactory, PermissionAction } from 'easywork-common-lib/modules';
5
- import { Contact, SubGroup, User } from 'easywork-common-lib/entities';
6
- export declare class ContactService {
7
- private contactRepository;
8
- private subGroupRepository;
9
- private readonly contactAuthService;
10
- private readonly authFactory;
11
- constructor(contactRepository: Repository<Contact>, subGroupRepository: Repository<SubGroup>, contactAuthService: ContactAuthorizationService, authFactory: ResourceAuthorizationFactory);
12
- getAllContacts(user: User): Promise<Contact[]>;
13
- getContactById(id: string, user: User): Promise<Contact>;
14
- }
15
- export declare class PoliciesService {
16
- private subGroupRepository;
17
- private readonly authFactory;
18
- constructor(subGroupRepository: Repository<SubGroup>, authFactory: ResourceAuthorizationFactory);
19
- getAllPolicies(user: User): Promise<any>;
20
- }
21
- import { AuthorizationService } from 'easywork-common-lib/modules';
22
- export declare class GenericResourceService {
23
- private readonly authService;
24
- constructor(authService: AuthorizationService);
25
- checkUserAccess(user: User, action: PermissionAction, resource: string): Promise<any>;
26
- validateMultiplePermissions(user: User): Promise<any>;
27
- }
28
- export declare class ContactController {
29
- private readonly contactService;
30
- constructor(contactService: ContactService);
31
- getAllContacts(user: User): Promise<Contact[]>;
32
- getContactById(id: string, user: User): Promise<Contact>;
33
- }
34
- export declare class ContactModule {
35
- }
@@ -1,180 +0,0 @@
1
- "use strict";
2
- var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
3
- var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
4
- if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
5
- else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
6
- return c > 3 && r && Object.defineProperty(target, key, r), r;
7
- };
8
- var __metadata = (this && this.__metadata) || function (k, v) {
9
- if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
10
- };
11
- var __param = (this && this.__param) || function (paramIndex, decorator) {
12
- return function (target, key) { decorator(target, key, paramIndex); }
13
- };
14
- var _a, _b, _c, _d, _e, _f;
15
- Object.defineProperty(exports, "__esModule", { value: true });
16
- exports.ContactModule = exports.ContactController = exports.GenericResourceService = exports.PoliciesService = exports.ContactService = exports.AppModule = void 0;
17
- const common_1 = require("@nestjs/common");
18
- const modules_1 = require("easywork-common-lib/modules");
19
- let AppModule = class AppModule {
20
- };
21
- exports.AppModule = AppModule;
22
- exports.AppModule = AppModule = __decorate([
23
- (0, common_1.Module)({
24
- imports: [
25
- modules_1.AuthorizationModule,
26
- modules_1.AuthorizationModule.forRoot({
27
- cache: {
28
- ttl: 600,
29
- max: 2000,
30
- },
31
- }),
32
- ],
33
- })
34
- ], AppModule);
35
- const common_2 = require("@nestjs/common");
36
- const typeorm_1 = require("typeorm");
37
- const typeorm_2 = require("@nestjs/typeorm");
38
- const modules_2 = require("easywork-common-lib/modules");
39
- const entities_1 = require("easywork-common-lib/entities");
40
- let ContactService = class ContactService {
41
- contactRepository;
42
- subGroupRepository;
43
- contactAuthService;
44
- authFactory;
45
- constructor(contactRepository, subGroupRepository, contactAuthService, authFactory) {
46
- this.contactRepository = contactRepository;
47
- this.subGroupRepository = subGroupRepository;
48
- this.contactAuthService = contactAuthService;
49
- this.authFactory = authFactory;
50
- }
51
- async getAllContacts(user) {
52
- const queryBuilder = this.contactRepository
53
- .createQueryBuilder('contact');
54
- await this.contactAuthService.applyContactPermissionFilters(queryBuilder, user, {
55
- action: modules_2.PermissionAction.READ,
56
- subGroupRepository: this.subGroupRepository,
57
- });
58
- return queryBuilder.getMany();
59
- }
60
- async getContactById(id, user) {
61
- const contact = await this.contactRepository.findOne({ where: { id } });
62
- if (!contact) {
63
- throw new Error('Contact not found');
64
- }
65
- await this.contactAuthService.validateContactAccess(user, modules_2.PermissionAction.READ, contact, this.subGroupRepository);
66
- return contact;
67
- }
68
- };
69
- exports.ContactService = ContactService;
70
- exports.ContactService = ContactService = __decorate([
71
- (0, common_2.Injectable)(),
72
- __param(0, (0, typeorm_2.InjectRepository)(entities_1.Contact)),
73
- __param(1, (0, typeorm_2.InjectRepository)(entities_1.SubGroup)),
74
- __metadata("design:paramtypes", [typeorm_1.Repository,
75
- typeorm_1.Repository, typeof (_a = typeof modules_2.ContactAuthorizationService !== "undefined" && modules_2.ContactAuthorizationService) === "function" ? _a : Object, typeof (_b = typeof modules_2.ResourceAuthorizationFactory !== "undefined" && modules_2.ResourceAuthorizationFactory) === "function" ? _b : Object])
76
- ], ContactService);
77
- let PoliciesService = class PoliciesService {
78
- subGroupRepository;
79
- authFactory;
80
- constructor(subGroupRepository, authFactory) {
81
- this.subGroupRepository = subGroupRepository;
82
- this.authFactory = authFactory;
83
- }
84
- async getAllPolicies(user) {
85
- const queryBuilder = this.policyRepository
86
- .createQueryBuilder('policy');
87
- const policyAuth = this.authFactory.forPolicy(this.subGroupRepository);
88
- await policyAuth.applyPermissionFilters(queryBuilder, user, {
89
- action: modules_2.PermissionAction.READ,
90
- });
91
- return queryBuilder.getMany();
92
- }
93
- };
94
- exports.PoliciesService = PoliciesService;
95
- exports.PoliciesService = PoliciesService = __decorate([
96
- (0, common_2.Injectable)(),
97
- __param(0, (0, typeorm_2.InjectRepository)(entities_1.SubGroup)),
98
- __metadata("design:paramtypes", [typeorm_1.Repository, typeof (_c = typeof modules_2.ResourceAuthorizationFactory !== "undefined" && modules_2.ResourceAuthorizationFactory) === "function" ? _c : Object])
99
- ], PoliciesService);
100
- const modules_3 = require("easywork-common-lib/modules");
101
- let GenericResourceService = class GenericResourceService {
102
- authService;
103
- constructor(authService) {
104
- this.authService = authService;
105
- }
106
- async checkUserAccess(user, action, resource) {
107
- const result = await this.authService.canAccess({
108
- user,
109
- action,
110
- resource,
111
- });
112
- return result.allowed;
113
- }
114
- async validateMultiplePermissions(user) {
115
- const results = await this.authService.canAccessMultiple([
116
- { user, action: modules_2.PermissionAction.READ, resource: 'contact' },
117
- { user, action: modules_2.PermissionAction.CREATE, resource: 'lead' },
118
- { user, action: modules_2.PermissionAction.UPDATE, resource: 'policy' },
119
- ]);
120
- return results;
121
- }
122
- };
123
- exports.GenericResourceService = GenericResourceService;
124
- exports.GenericResourceService = GenericResourceService = __decorate([
125
- (0, common_2.Injectable)(),
126
- __metadata("design:paramtypes", [typeof (_d = typeof modules_3.AuthorizationService !== "undefined" && modules_3.AuthorizationService) === "function" ? _d : Object])
127
- ], GenericResourceService);
128
- const common_3 = require("@nestjs/common");
129
- const modules_4 = require("easywork-common-lib/modules");
130
- const your_auth_decorator_1 = require("your-auth-decorator");
131
- let ContactController = class ContactController {
132
- contactService;
133
- constructor(contactService) {
134
- this.contactService = contactService;
135
- }
136
- async getAllContacts(user) {
137
- return this.contactService.getAllContacts(user);
138
- }
139
- async getContactById(id, user) {
140
- return this.contactService.getContactById(id, user);
141
- }
142
- };
143
- exports.ContactController = ContactController;
144
- __decorate([
145
- (0, common_3.Get)(),
146
- __param(0, (0, your_auth_decorator_1.CurrentUser)()),
147
- __metadata("design:type", Function),
148
- __metadata("design:paramtypes", [typeof (_e = typeof entities_1.User !== "undefined" && entities_1.User) === "function" ? _e : Object]),
149
- __metadata("design:returntype", Promise)
150
- ], ContactController.prototype, "getAllContacts", null);
151
- __decorate([
152
- (0, common_3.Get)(':id'),
153
- __param(0, (0, common_3.Param)('id')),
154
- __param(1, (0, your_auth_decorator_1.CurrentUser)()),
155
- __metadata("design:type", Function),
156
- __metadata("design:paramtypes", [String, typeof (_f = typeof entities_1.User !== "undefined" && entities_1.User) === "function" ? _f : Object]),
157
- __metadata("design:returntype", Promise)
158
- ], ContactController.prototype, "getContactById", null);
159
- exports.ContactController = ContactController = __decorate([
160
- (0, common_3.Controller)('contacts'),
161
- (0, common_3.UseGuards)(modules_4.EnhancedRolesPolicyGuard),
162
- __metadata("design:paramtypes", [ContactService])
163
- ], ContactController);
164
- let ContactModule = class ContactModule {
165
- };
166
- exports.ContactModule = ContactModule;
167
- exports.ContactModule = ContactModule = __decorate([
168
- (0, common_1.Module)({
169
- imports: [
170
- TypeOrmModule.forFeature([entities_1.Contact, entities_1.Lead, Policy]),
171
- ],
172
- controllers: [ContactController],
173
- providers: [
174
- ContactService,
175
- PoliciesService,
176
- GenericResourceService,
177
- ],
178
- })
179
- ], ContactModule);
180
- //# sourceMappingURL=usage-example.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"usage-example.js","sourceRoot":"","sources":["../../../src/modules/authorization/usage-example.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