@gravitee/gamma-modules-sdk 1.1.0 → 1.2.0

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/dist/index.d.ts CHANGED
@@ -1,3 +1,4 @@
1
1
  export * from './permissions';
2
2
  export * from './environment';
3
+ export * from './license';
3
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,eAAe,CAAC;AAC9B,cAAc,eAAe,CAAC;AAC9B,cAAc,WAAW,CAAC"}
package/dist/index.js CHANGED
@@ -35,6 +35,26 @@ var e = class {
35
35
  getSnapshot() {
36
36
  return null;
37
37
  }
38
- }, s = new o(), c = () => null;
38
+ }, s = new o(), c = () => null, l = class {
39
+ setLicense(e) {}
40
+ getLicense() {
41
+ return null;
42
+ }
43
+ hasFeature(e) {
44
+ return !1;
45
+ }
46
+ hasPack(e) {
47
+ return !1;
48
+ }
49
+ isExpired() {
50
+ return !1;
51
+ }
52
+ subscribe(e) {
53
+ return () => {};
54
+ }
55
+ getSnapshot() {
56
+ return null;
57
+ }
58
+ }, u = new l(), d = (e) => !1, f = (e) => !1;
39
59
  //#endregion
40
- export { o as EnvironmentService, r as PermissionGate, e as PermissionService, s as environmentService, i as normalizeCrudMapRecord, a as normalizeOrganizationPermissionsFromRoles, t as permissionService, c as useEnvironment, n as useHasPermission };
60
+ export { o as EnvironmentService, l as LicenseService, r as PermissionGate, e as PermissionService, s as environmentService, u as licenseService, i as normalizeCrudMapRecord, a as normalizeOrganizationPermissionsFromRoles, t as permissionService, c as useEnvironment, d as useHasFeature, f as useHasPack, n as useHasPermission };
@@ -0,0 +1,4 @@
1
+ export type { License } from './types';
2
+ export type { ILicenseService, UseHasFeatureFn, UseHasPackFn } from './interfaces';
3
+ export { LicenseService, licenseService, useHasFeature, useHasPack } from './stubs';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/license/index.ts"],"names":[],"mappings":"AAAA,YAAY,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AACvC,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,EAAE,cAAc,EAAE,cAAc,EAAE,aAAa,EAAE,UAAU,EAAE,MAAM,SAAS,CAAC"}
@@ -0,0 +1,16 @@
1
+ import { License } from './types';
2
+ export interface ILicenseService {
3
+ setLicense(license: License | null): void;
4
+ getLicense(): License | null;
5
+ /** Pure membership check: the feature key is present in `license.features`. Does not account for expiry. */
6
+ hasFeature(feature: string): boolean;
7
+ /** Pure membership check: the pack key is present in `license.packs`. Does not account for expiry. */
8
+ hasPack(pack: string): boolean;
9
+ /** Whether the current license is expired (server-computed `license.isExpired`). */
10
+ isExpired(): boolean;
11
+ subscribe(listener: () => void): () => void;
12
+ getSnapshot(): License | null;
13
+ }
14
+ export type UseHasFeatureFn = (feature: string) => boolean;
15
+ export type UseHasPackFn = (pack: string) => boolean;
16
+ //# sourceMappingURL=interfaces.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"interfaces.d.ts","sourceRoot":"","sources":["../../src/license/interfaces.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC,MAAM,WAAW,eAAe;IAC9B,UAAU,CAAC,OAAO,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI,CAAC;IAC1C,UAAU,IAAI,OAAO,GAAG,IAAI,CAAC;IAC7B,4GAA4G;IAC5G,UAAU,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC;IACrC,sGAAsG;IACtG,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC;IAC/B,oFAAoF;IACpF,SAAS,IAAI,OAAO,CAAC;IACrB,SAAS,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI,CAAC;IAC5C,WAAW,IAAI,OAAO,GAAG,IAAI,CAAC;CAC/B;AAED,MAAM,MAAM,eAAe,GAAG,CAAC,OAAO,EAAE,MAAM,KAAK,OAAO,CAAC;AAC3D,MAAM,MAAM,YAAY,GAAG,CAAC,IAAI,EAAE,MAAM,KAAK,OAAO,CAAC"}
@@ -0,0 +1,20 @@
1
+ import { ILicenseService, UseHasFeatureFn, UseHasPackFn } from './interfaces';
2
+ import { License } from './types';
3
+ /**
4
+ * Stub implementations replaced at runtime by the host via Module Federation
5
+ * (`additionalShared`, singleton). Remotes bundle these for typing and a
6
+ * minimal runtime shape only.
7
+ */
8
+ export declare class LicenseService implements ILicenseService {
9
+ setLicense(_license: License | null): void;
10
+ getLicense(): License | null;
11
+ hasFeature(_feature: string): boolean;
12
+ hasPack(_pack: string): boolean;
13
+ isExpired(): boolean;
14
+ subscribe(_listener: () => void): () => void;
15
+ getSnapshot(): License | null;
16
+ }
17
+ export declare const licenseService: ILicenseService;
18
+ export declare const useHasFeature: UseHasFeatureFn;
19
+ export declare const useHasPack: UseHasPackFn;
20
+ //# sourceMappingURL=stubs.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"stubs.d.ts","sourceRoot":"","sources":["../../src/license/stubs.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,cAAc,CAAC;AACnF,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAC;AAEvC;;;;GAIG;AAEH,qBAAa,cAAe,YAAW,eAAe;IACpD,UAAU,CAAC,QAAQ,EAAE,OAAO,GAAG,IAAI,GAAG,IAAI;IAC1C,UAAU,IAAI,OAAO,GAAG,IAAI;IAG5B,UAAU,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO;IAGrC,OAAO,CAAC,KAAK,EAAE,MAAM,GAAG,OAAO;IAG/B,SAAS,IAAI,OAAO;IAGpB,SAAS,CAAC,SAAS,EAAE,MAAM,IAAI,GAAG,MAAM,IAAI;IAG5C,WAAW,IAAI,OAAO,GAAG,IAAI;CAG9B;AAED,eAAO,MAAM,cAAc,EAAE,eAAsC,CAAC;AAEpE,eAAO,MAAM,aAAa,EAAE,eAA6C,CAAC;AAE1E,eAAO,MAAM,UAAU,EAAE,YAAuC,CAAC"}
@@ -0,0 +1,9 @@
1
+ export interface License {
2
+ readonly tier: string;
3
+ readonly packs: string[];
4
+ readonly features: string[];
5
+ readonly scope?: string;
6
+ readonly expiresAt?: string;
7
+ readonly isExpired?: boolean;
8
+ }
9
+ //# sourceMappingURL=types.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/license/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,OAAO;IACtB,QAAQ,CAAC,IAAI,EAAE,MAAM,CAAC;IACtB,QAAQ,CAAC,KAAK,EAAE,MAAM,EAAE,CAAC;IACzB,QAAQ,CAAC,QAAQ,EAAE,MAAM,EAAE,CAAC;IAC5B,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;IACxB,QAAQ,CAAC,SAAS,CAAC,EAAE,MAAM,CAAC;IAC5B,QAAQ,CAAC,SAAS,CAAC,EAAE,OAAO,CAAC;CAC9B"}
package/dist/types.d.ts CHANGED
@@ -2,4 +2,6 @@ export type { IPermissionService, NormalizeCrudMapRecordFn, NormalizeOrgPermissi
2
2
  export type { PermissionCheck, PermissionScope, UserRole } from './permissions/types';
3
3
  export type { Environment } from './environment/types';
4
4
  export type { IEnvironmentService, UseEnvironmentFn } from './environment/interfaces';
5
+ export type { License } from './license/types';
6
+ export type { ILicenseService, UseHasFeatureFn, UseHasPackFn } from './license/interfaces';
5
7
  //# sourceMappingURL=types.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACtF,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC"}
1
+ {"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../src/types.ts"],"names":[],"mappings":"AAAA,YAAY,EACV,kBAAkB,EAClB,wBAAwB,EACxB,yBAAyB,EACzB,gBAAgB,EAChB,mBAAmB,EACnB,kBAAkB,EAClB,uBAAuB,GACxB,MAAM,0BAA0B,CAAC;AAClC,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AACtF,YAAY,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AACvD,YAAY,EAAE,mBAAmB,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAC;AACtF,YAAY,EAAE,OAAO,EAAE,MAAM,iBAAiB,CAAC;AAC/C,YAAY,EAAE,eAAe,EAAE,eAAe,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@gravitee/gamma-modules-sdk",
3
- "version": "1.1.0",
3
+ "version": "1.2.0",
4
4
  "type": "module",
5
5
  "license": "Apache-2.0",
6
6
  "packageManager": "yarn@4.13.0",