@vcita/oauth-client-nestjs 3.4.1-rc.0 → 3.4.2

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/CHANGELOG.md CHANGED
@@ -8,6 +8,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
8
8
 
9
9
  ___
10
10
  # Releases
11
+ ## 3.4.1 (2025-01-15)
12
+ ### Added
13
+ - Utility function to create a chain of belongsTo entities
14
+
11
15
  ## 3.4.0 (2024-08-14)
12
16
  ### Added
13
17
  - Function to Actor entity - getActor(actor: ActorType)
@@ -3,5 +3,5 @@ import { FeatureFlagsEntity } from './feature-flags.entity';
3
3
  export declare class FeatureFlagsService {
4
4
  private readonly internalProxy;
5
5
  constructor(internalProxy: InternalProxyService);
6
- getFlagsByBusiness(buisenessUid: string): Promise<FeatureFlagsEntity>;
6
+ getFlagsByBusiness(businessUid: string): Promise<FeatureFlagsEntity>;
7
7
  }
@@ -17,8 +17,11 @@ let FeatureFlagsService = class FeatureFlagsService {
17
17
  constructor(internalProxy) {
18
18
  this.internalProxy = internalProxy;
19
19
  }
20
- async getFlagsByBusiness(buisenessUid) {
21
- const flags = await this.internalProxy.getRequest('platform/v1/businesses', `${buisenessUid}/features`, {});
20
+ async getFlagsByBusiness(businessUid) {
21
+ if (process.env.RNP_MIGRATION === 'true') {
22
+ return new feature_flags_entity_1.FeatureFlagsEntity(['staff_role_permissions']);
23
+ }
24
+ const flags = await this.internalProxy.getRequest('platform/v1/businesses', `${businessUid}/features`, {});
22
25
  return new feature_flags_entity_1.FeatureFlagsEntity(flags);
23
26
  }
24
27
  };
@@ -1 +1 @@
1
- {"version":3,"file":"feature-flags.service.js","sourceRoot":"","sources":["../../src/feature-flags/feature-flags.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,qFAAgF;AAChF,iEAA4D;AAG5D,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;IAC9B,YAA6B,aAAmC;QAAnC,kBAAa,GAAb,aAAa,CAAsB;IAAG,CAAC;IAEpE,KAAK,CAAC,kBAAkB,CAAC,YAAoB;QAC3C,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,UAAU,CAC/C,wBAAwB,EACxB,GAAG,YAAY,WAAW,EAC1B,EAAE,CACH,CAAC;QAEF,OAAO,IAAI,yCAAkB,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;CACF,CAAA;AAZY,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;qCAEiC,6CAAoB;GADrD,mBAAmB,CAY/B;AAZY,kDAAmB"}
1
+ {"version":3,"file":"feature-flags.service.js","sourceRoot":"","sources":["../../src/feature-flags/feature-flags.service.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAA4C;AAC5C,qFAAgF;AAChF,iEAA4D;AAG5D,IAAa,mBAAmB,GAAhC,MAAa,mBAAmB;IAC9B,YAA6B,aAAmC;QAAnC,kBAAa,GAAb,aAAa,CAAsB;IAAG,CAAC;IAEpE,KAAK,CAAC,kBAAkB,CAAC,WAAmB;QAC1C,IAAI,OAAO,CAAC,GAAG,CAAC,aAAa,KAAK,MAAM,EAAE;YACxC,OAAO,IAAI,yCAAkB,CAAC,CAAC,wBAAwB,CAAC,CAAC,CAAC;SAC3D;QAED,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,aAAa,CAAC,UAAU,CAC/C,wBAAwB,EACxB,GAAG,WAAW,WAAW,EACzB,EAAE,CACH,CAAC;QAEF,OAAO,IAAI,yCAAkB,CAAC,KAAK,CAAC,CAAC;IACvC,CAAC;CACF,CAAA;AAhBY,mBAAmB;IAD/B,IAAA,mBAAU,GAAE;qCAEiC,6CAAoB;GADrD,mBAAmB,CAgB/B;AAhBY,kDAAmB"}
@@ -5,6 +5,5 @@ export declare enum ActorType {
5
5
  DIRECTORY = "directory",
6
6
  BUSINESS = "business",
7
7
  STAFF = "staff",
8
- CLIENT = "client",
9
- OPERATOR = "operator"
8
+ CLIENT = "client"
10
9
  }
@@ -10,6 +10,5 @@ var ActorType;
10
10
  ActorType["BUSINESS"] = "business";
11
11
  ActorType["STAFF"] = "staff";
12
12
  ActorType["CLIENT"] = "client";
13
- ActorType["OPERATOR"] = "operator";
14
13
  })(ActorType = exports.ActorType || (exports.ActorType = {}));
15
14
  //# sourceMappingURL=actors.enum.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"actors.enum.js","sourceRoot":"","sources":["../../../src/oauth/enums/actors.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,SASX;AATD,WAAY,SAAS;IACnB,4BAAe,CAAA;IACf,wBAAW,CAAA;IACX,0BAAa,CAAA;IACb,oCAAuB,CAAA;IACvB,kCAAqB,CAAA;IACrB,4BAAe,CAAA;IACf,8BAAiB,CAAA;IACjB,kCAAqB,CAAA;AACvB,CAAC,EATW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QASpB"}
1
+ {"version":3,"file":"actors.enum.js","sourceRoot":"","sources":["../../../src/oauth/enums/actors.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,SAQX;AARD,WAAY,SAAS;IACnB,4BAAe,CAAA;IACf,wBAAW,CAAA;IACX,0BAAa,CAAA;IACb,oCAAuB,CAAA;IACvB,kCAAqB,CAAA;IACrB,4BAAe,CAAA;IACf,8BAAiB,CAAA;AACnB,CAAC,EARW,SAAS,GAAT,iBAAS,KAAT,iBAAS,QAQpB"}
@@ -1,3 +1,7 @@
1
- import { AuthorizationPayloadEntity } from '../..';
1
+ import { ActorType, AuthorizationPayloadEntity, BelongsEntity } from '../..';
2
2
  export declare function MockDefaultStaffAuthorization(): AuthorizationPayloadEntity;
3
3
  export declare function MockStaffAuthorization(business_uid: any, staff_uid: any): AuthorizationPayloadEntity;
4
+ export declare function createBelongsToHierarchy(hierarchy: {
5
+ uid: string;
6
+ type: ActorType;
7
+ }[]): BelongsEntity | null;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.MockStaffAuthorization = exports.MockDefaultStaffAuthorization = void 0;
3
+ exports.createBelongsToHierarchy = exports.MockStaffAuthorization = exports.MockDefaultStaffAuthorization = void 0;
4
4
  const __1 = require("../..");
5
5
  function MockDefaultStaffAuthorization() {
6
6
  return MockStaffAuthorization('business_1111', 'staff_1111');
@@ -12,4 +12,15 @@ function MockStaffAuthorization(business_uid, staff_uid) {
12
12
  return new __1.AuthorizationPayloadEntity(null, actorStaff);
13
13
  }
14
14
  exports.MockStaffAuthorization = MockStaffAuthorization;
15
+ function createBelongsToHierarchy(hierarchy) {
16
+ if (hierarchy.length === 0)
17
+ return null;
18
+ let current = null;
19
+ for (let i = hierarchy.length - 1; i >= 0; i -= 1) {
20
+ const { uid, type } = hierarchy[i];
21
+ current = new __1.BelongsEntity(uid, type, current);
22
+ }
23
+ return current;
24
+ }
25
+ exports.createBelongsToHierarchy = createBelongsToHierarchy;
15
26
  //# sourceMappingURL=mock-oauth.dto.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"mock-oauth.dto.js","sourceRoot":"","sources":["../../../src/oauth/tests/mock-oauth.dto.ts"],"names":[],"mappings":";;;AAAA,6BAKe;AAEf,SAAgB,6BAA6B;IAC3C,OAAO,sBAAsB,CAAC,eAAe,EAAE,YAAY,CAAC,CAAC;AAC/D,CAAC;AAFD,sEAEC;AAED,SAAgB,sBAAsB,CAAC,YAAY,EAAE,SAAS;IAC5D,MAAM,eAAe,GAAG,IAAI,iBAAa,CAAC,YAAY,EAAE,aAAS,CAAC,QAAQ,CAAC,CAAC;IAC5E,MAAM,UAAU,GAAG,IAAI,eAAW,CAAC,SAAS,EAAE,aAAS,CAAC,KAAK,EAAE,eAAe,CAAC,CAAC;IAChF,OAAO,IAAI,8BAA0B,CAAC,IAAI,EAAE,UAAU,CAAC,CAAC;AAC1D,CAAC;AAJD,wDAIC"}
1
+ {"version":3,"file":"mock-oauth.dto.js","sourceRoot":"","sources":["../../../src/oauth/tests/mock-o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