@gridengine/angular-datagrid-enterprise 0.1.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/LICENSE ADDED
@@ -0,0 +1,39 @@
1
+ GridEngine for Angular — Enterprise Commercial License
2
+
3
+ Copyright (c) 2026 Bhushan Poojary. All rights reserved.
4
+
5
+ NOTICE: This software and its source code are the proprietary and confidential
6
+ property of Bhushan Poojary ("Licensor"). Use of this software is governed by
7
+ the terms of a commercial license agreement between you ("Licensee") and the
8
+ Licensor.
9
+
10
+ 1. GRANT OF LICENSE
11
+ Subject to payment of applicable license fees and acceptance of these terms,
12
+ Licensor grants Licensee a non-exclusive, non-transferable, non-sublicensable
13
+ license to use this software in Licensee's own applications.
14
+
15
+ 2. RESTRICTIONS
16
+ Licensee may NOT:
17
+ (a) redistribute, sell, or sublicense this software or its source code;
18
+ (b) remove or alter any proprietary notices or labels;
19
+ (c) use this software in any open-source project licensed under a copyleft
20
+ license (e.g. GPL) without written permission from Licensor;
21
+ (d) use this software beyond the developer seat count in Licensee's license key.
22
+
23
+ 3. OPEN-SOURCE BASE
24
+ This software includes "@gridengine/angular-datagrid" which is licensed under
25
+ the MIT License. A copy of that license is available at
26
+ https://github.com/bhushanpoojary/angular-datagrid/blob/main/LICENSE
27
+
28
+ 4. DISCLAIMER OF WARRANTIES
29
+ THE SOFTWARE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND.
30
+
31
+ 5. LIMITATION OF LIABILITY
32
+ IN NO EVENT SHALL LICENSOR BE LIABLE FOR ANY INDIRECT, INCIDENTAL, SPECIAL,
33
+ OR CONSEQUENTIAL DAMAGES ARISING OUT OF OR RELATED TO THIS SOFTWARE.
34
+
35
+ 6. TERMINATION
36
+ This license is effective until terminated. It terminates automatically if
37
+ Licensee breaches any of its terms.
38
+
39
+ To purchase a commercial license, visit: https://angular.gridengine.dev/pricing
package/README.md ADDED
@@ -0,0 +1,48 @@
1
+ # @gridengine/angular-datagrid-enterprise
2
+
3
+ Pro / Enterprise features for the [GridEngine Angular data grid](https://github.com/bhushanpoojary/angular-datagrid),
4
+ license-gated with offline Ed25519 verification via
5
+ [`@gridengine/license-core`](https://www.npmjs.com/package/@gridengine/license-core).
6
+
7
+ This package re-exports the entire open-source `@gridengine/angular-datagrid`
8
+ surface, so you only need a single import.
9
+
10
+ ## Install
11
+
12
+ ```bash
13
+ npm install @gridengine/angular-datagrid-enterprise
14
+ ```
15
+
16
+ ## Register your license key
17
+
18
+ Set the key once at bootstrap:
19
+
20
+ ```ts
21
+ import { bootstrapApplication } from '@angular/platform-browser';
22
+ import { provideGridEngineLicense } from '@gridengine/angular-datagrid-enterprise';
23
+ import { App } from './app/app';
24
+
25
+ bootstrapApplication(App, {
26
+ providers: [provideGridEngineLicense('YOUR-LICENSE-KEY')],
27
+ });
28
+ ```
29
+
30
+ ## Use the licensed grid
31
+
32
+ Wrap the base grid in `<gd-data-grid-pro>`. It stays fully functional without a
33
+ license (**evaluation mode**); an unlicensed grid simply shows a small watermark
34
+ and logs a one-time console warning.
35
+
36
+ ```html
37
+ <gd-data-grid-pro [licenseKey]="optionalPerInstanceKey">
38
+ <gd-data-grid [rowData]="rows" [columnDefs]="cols" />
39
+ </gd-data-grid-pro>
40
+ ```
41
+
42
+ ## Licensing
43
+
44
+ This is **soft licensing**, not DRM: verification is synchronous and
45
+ client-side. The bundle ships only the public verifying key, so it can check a
46
+ key's authenticity but never mint one. See [`LICENSE`](./LICENSE).
47
+
48
+ Purchase a license at <https://angular.gridengine.dev/pricing>.
@@ -0,0 +1,248 @@
1
+ export * from '@gridengine/angular-datagrid';
2
+ import * as i0 from '@angular/core';
3
+ import { input, ChangeDetectionStrategy, Component, computed, effect, makeEnvironmentProviders, provideEnvironmentInitializer } from '@angular/core';
4
+ import { validateLicense, resolveFeatures as resolveFeatures$1, TIER_FEATURES } from '@gridengine/license-core';
5
+ export { TIER_FEATURES } from '@gridengine/license-core';
6
+
7
+ /** The product id GridEngine license keys are scoped to for this package. */
8
+ const PRODUCT_ID = 'angular-datagrid';
9
+ /** Where a buyer can purchase / activate a license. */
10
+ const PURCHASE_URL = 'https://angular.gridengine.dev/pricing';
11
+ const PUBLIC_KEYRING = {
12
+ 'angular-datagrid-2026-08-09': 'GJx3r0A-xL2Q3-poGd3WbOh_B0EN9wwWOxMdksxs_S4',
13
+ };
14
+
15
+ /**
16
+ * LicenseManager — validates a `@gridengine/angular-datagrid-enterprise` license key.
17
+ *
18
+ * Verification uses `@gridengine/license-core` (Ed25519, keyring-based) — the
19
+ * same scheme the GridEngine store uses to sign keys after a real purchase. The
20
+ * private signing key lives only in the store's backend (Key Vault); this
21
+ * package ships only the matching PUBLIC verifying key, so it can check a key's
22
+ * authenticity but never mint one.
23
+ *
24
+ * This is soft licensing, not DRM: validation is synchronous and client-side,
25
+ * and a determined user could strip the check from their own bundle. Server-
26
+ * side entitlement checks remain authoritative for anything that matters.
27
+ *
28
+ * Feature access is derived from the license TIER (see `TIER_FEATURES`), with
29
+ * `payload.features` allowed to grant additional flags on top. The support
30
+ * level is metadata only — it never gates any in-bundle behaviour.
31
+ */
32
+ const _cache = new Map();
33
+ /**
34
+ * Global license key, set once at app bootstrap (typically via
35
+ * `provideGridEngineLicense(key)`) so every `<gd-data-grid-pro>` in the app
36
+ * picks it up without needing a `licenseKey` input on each instance. A
37
+ * `licenseKey` input, when given, still overrides this for that instance.
38
+ */
39
+ let _globalLicenseKey;
40
+ /** Set the license key once for the whole app (e.g. at app bootstrap). */
41
+ function setLicenseKey(key) {
42
+ _globalLicenseKey = key;
43
+ }
44
+ /** The key previously set via `setLicenseKey`, if any. */
45
+ function getLicenseKey() {
46
+ return _globalLicenseKey;
47
+ }
48
+ /**
49
+ * Validate a key against an arbitrary keyring. Exported (but not part of the
50
+ * public `LicenseManager` API surface) so tests can verify against a throwaway
51
+ * test keypair instead of the real production keyring.
52
+ */
53
+ function validateWithKeyring(key, keys) {
54
+ if (!key) {
55
+ return {
56
+ status: 'missing',
57
+ payload: null,
58
+ message: 'No @gridengine/angular-datagrid-enterprise license key provided. ' +
59
+ 'A watermark will be displayed. ' +
60
+ `Purchase a license at ${PURCHASE_URL}`,
61
+ };
62
+ }
63
+ return validateLicense(key, keys, PRODUCT_ID);
64
+ }
65
+ /**
66
+ * Validate a license key string. Results are cached per key so validation runs
67
+ * at most once per key per session.
68
+ */
69
+ function validate(key) {
70
+ if (!key)
71
+ return validateWithKeyring(key, PUBLIC_KEYRING);
72
+ const cached = _cache.get(key);
73
+ if (cached)
74
+ return cached;
75
+ const result = validateWithKeyring(key, PUBLIC_KEYRING);
76
+ _cache.set(key, result);
77
+ return result;
78
+ }
79
+ /**
80
+ * The set of feature flags granted by a validated payload: the tier defaults
81
+ * plus any explicit extras in `payload.features`.
82
+ */
83
+ function resolveFeatures(payload) {
84
+ return resolveFeatures$1(payload);
85
+ }
86
+ /**
87
+ * Check whether a specific feature is enabled for a key, against an arbitrary
88
+ * keyring. Exported (but not part of the public `LicenseManager` API surface)
89
+ * so tests can exercise this without the real production keyring.
90
+ */
91
+ function isFeatureEnabledWithKeyring(key, feature, keys) {
92
+ if (!key)
93
+ return true; // evaluation mode
94
+ const result = validateWithKeyring(key, keys);
95
+ if (result.status !== 'valid' || !result.payload)
96
+ return false;
97
+ return resolveFeatures(result.payload).has(feature);
98
+ }
99
+ /**
100
+ * Check whether a specific feature is enabled for a given key. Returns true
101
+ * when no key is given (evaluation mode — features accessible but watermarked),
102
+ * and false for any non-valid license.
103
+ */
104
+ function isFeatureEnabled(key, feature) {
105
+ if (!key)
106
+ return true; // evaluation mode
107
+ const result = validate(key);
108
+ if (result.status !== 'valid' || !result.payload)
109
+ return false;
110
+ return resolveFeatures(result.payload).has(feature);
111
+ }
112
+ const LicenseManager = {
113
+ validate,
114
+ isFeatureEnabled,
115
+ setLicenseKey,
116
+ getLicenseKey,
117
+ TIER_FEATURES,
118
+ };
119
+
120
+ /**
121
+ * GridLicenseWatermark — a subtle, non-blocking evaluation watermark shown in
122
+ * the corner of an enterprise grid when no valid license key is provided.
123
+ *
124
+ * The grid stays fully functional in evaluation mode; this only signals that a
125
+ * license is required for production use. It is rendered automatically by
126
+ * `<gd-data-grid-pro>` but is also exported for advanced consumers who compose
127
+ * the grid themselves.
128
+ */
129
+ class GridLicenseWatermark {
130
+ /** Package label shown in the watermark. */
131
+ label = input('@gridengine/angular-datagrid-enterprise', /* @ts-ignore */
132
+ ...(ngDevMode ? [{ debugName: "label" }] : /* istanbul ignore next */ []));
133
+ /** Purchase URL shown in the watermark. */
134
+ url = input(PURCHASE_URL, /* @ts-ignore */
135
+ ...(ngDevMode ? [{ debugName: "url" }] : /* istanbul ignore next */ []));
136
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: GridLicenseWatermark, deps: [], target: i0.ɵɵFactoryTarget.Component });
137
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.1.0", version: "22.1.2", type: GridLicenseWatermark, isStandalone: true, selector: "gd-license-watermark", inputs: { label: { classPropertyName: "label", publicName: "label", isSignal: true, isRequired: false, transformFunction: null }, url: { classPropertyName: "url", publicName: "url", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
138
+ <div class="gd-license-watermark" aria-hidden="true">
139
+ {{ label() }} — unlicensed — <span class="gd-license-watermark__url">{{ url() }}</span>
140
+ </div>
141
+ `, isInline: true, styles: [".gd-license-watermark{position:absolute;bottom:8px;right:12px;z-index:10;font-family:sans-serif;font-size:11px;letter-spacing:.02em;color:#00000059;pointer-events:none;-webkit-user-select:none;user-select:none}.gd-license-watermark__url{text-decoration:underline}\n"], changeDetection: i0.ChangeDetectionStrategy.OnPush });
142
+ }
143
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: GridLicenseWatermark, decorators: [{
144
+ type: Component,
145
+ args: [{ selector: 'gd-license-watermark', standalone: true, changeDetection: ChangeDetectionStrategy.OnPush, template: `
146
+ <div class="gd-license-watermark" aria-hidden="true">
147
+ {{ label() }} — unlicensed — <span class="gd-license-watermark__url">{{ url() }}</span>
148
+ </div>
149
+ `, styles: [".gd-license-watermark{position:absolute;bottom:8px;right:12px;z-index:10;font-family:sans-serif;font-size:11px;letter-spacing:.02em;color:#00000059;pointer-events:none;-webkit-user-select:none;user-select:none}.gd-license-watermark__url{text-decoration:underline}\n"] }]
150
+ }], propDecorators: { label: [{ type: i0.Input, args: [{ isSignal: true, alias: "label", required: false }] }], url: [{ type: i0.Input, args: [{ isSignal: true, alias: "url", required: false }] }] } });
151
+
152
+ /**
153
+ * DataGridPro — the license-aware wrapper for the GridEngine Angular grid.
154
+ *
155
+ * Projects a base `<gd-data-grid>` (or any content) and overlays an evaluation
156
+ * watermark when no valid license key is present. The grid remains fully
157
+ * functional without a license (evaluation mode); this component only adds the
158
+ * watermark + a one-time console warning.
159
+ *
160
+ * ```html
161
+ * <gd-data-grid-pro [licenseKey]="key">
162
+ * <gd-data-grid [rowData]="rows" [columnDefs]="cols" />
163
+ * </gd-data-grid-pro>
164
+ * ```
165
+ *
166
+ * A `[licenseKey]` input overrides the app-wide key set via
167
+ * `provideGridEngineLicense()` / `LicenseManager.setLicenseKey()`.
168
+ */
169
+ class DataGridPro {
170
+ /** Per-instance license key; overrides the app-wide key when provided. */
171
+ licenseKey = input(undefined, /* @ts-ignore */
172
+ ...(ngDevMode ? [{ debugName: "licenseKey" }] : /* istanbul ignore next */ []));
173
+ licenseResult = computed(() => LicenseManager.validate(this.licenseKey() ?? LicenseManager.getLicenseKey()), /* @ts-ignore */
174
+ ...(ngDevMode ? [{ debugName: "licenseResult" }] : /* istanbul ignore next */ []));
175
+ showWatermark = computed(() => this.licenseResult().status !== 'valid', /* @ts-ignore */
176
+ ...(ngDevMode ? [{ debugName: "showWatermark" }] : /* istanbul ignore next */ []));
177
+ warned = false;
178
+ constructor() {
179
+ effect(() => {
180
+ const result = this.licenseResult();
181
+ if (!this.warned && result.status !== 'valid') {
182
+ console.warn(`[@gridengine/angular-datagrid-enterprise] ${result.message}`);
183
+ this.warned = true;
184
+ }
185
+ });
186
+ }
187
+ /** The current license validation result (for advanced consumers). */
188
+ getLicenseResult() {
189
+ return this.licenseResult();
190
+ }
191
+ static ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: DataGridPro, deps: [], target: i0.ɵɵFactoryTarget.Component });
192
+ static ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "17.0.0", version: "22.1.2", type: DataGridPro, isStandalone: true, selector: "gd-data-grid-pro", inputs: { licenseKey: { classPropertyName: "licenseKey", publicName: "licenseKey", isSignal: true, isRequired: false, transformFunction: null } }, ngImport: i0, template: `
193
+ <div class="gd-data-grid-pro">
194
+ <ng-content />
195
+ @if (showWatermark()) {
196
+ <gd-license-watermark />
197
+ }
198
+ </div>
199
+ `, isInline: true, styles: [":host{display:block}.gd-data-grid-pro{position:relative;display:block}\n"], dependencies: [{ kind: "component", type: GridLicenseWatermark, selector: "gd-license-watermark", inputs: ["label", "url"] }], changeDetection: i0.ChangeDetectionStrategy.OnPush });
200
+ }
201
+ i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "22.1.2", ngImport: i0, type: DataGridPro, decorators: [{
202
+ type: Component,
203
+ args: [{ selector: 'gd-data-grid-pro', standalone: true, imports: [GridLicenseWatermark], changeDetection: ChangeDetectionStrategy.OnPush, template: `
204
+ <div class="gd-data-grid-pro">
205
+ <ng-content />
206
+ @if (showWatermark()) {
207
+ <gd-license-watermark />
208
+ }
209
+ </div>
210
+ `, styles: [":host{display:block}.gd-data-grid-pro{position:relative;display:block}\n"] }]
211
+ }], ctorParameters: () => [], propDecorators: { licenseKey: [{ type: i0.Input, args: [{ isSignal: true, alias: "licenseKey", required: false }] }] } });
212
+
213
+ /**
214
+ * `provideGridEngineLicense` — register a GridEngine Angular license key once
215
+ * for the whole application at bootstrap.
216
+ *
217
+ * Usage (standalone bootstrap):
218
+ *
219
+ * ```ts
220
+ * bootstrapApplication(App, {
221
+ * providers: [provideGridEngineLicense('BASE64URL.payload.signature')],
222
+ * });
223
+ * ```
224
+ *
225
+ * Every `<gd-data-grid-pro>` in the app then picks the key up automatically via
226
+ * `LicenseManager.getLicenseKey()`; a per-instance `[licenseKey]` input still
227
+ * overrides it for that instance.
228
+ */
229
+ function provideGridEngineLicense(key) {
230
+ return makeEnvironmentProviders([
231
+ provideEnvironmentInitializer(() => LicenseManager.setLicenseKey(key)),
232
+ ]);
233
+ }
234
+
235
+ /*
236
+ * Public API Surface of @gridengine/angular-datagrid-enterprise
237
+ *
238
+ * Re-exports the open-source base grid so consumers need a single import, then
239
+ * adds the license-gated Pro surface on top.
240
+ */
241
+ // ── Base grid (full re-export) ──────────────────────────────────────────────
242
+
243
+ /**
244
+ * Generated bundle index. Do not edit.
245
+ */
246
+
247
+ export { DataGridPro, GridLicenseWatermark, LicenseManager, PRODUCT_ID, PURCHASE_URL, provideGridEngineLicense };
248
+ //# sourceMappingURL=gridengine-angular-datagrid-enterprise.mjs.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"gridengine-angular-datagrid-enterprise.mjs","sources":["../../../projects/enterprise/src/lib/keyring.ts","../../../projects/enterprise/src/lib/license-manager.ts","../../../projects/enterprise/src/lib/license-watermark.ts","../../../projects/enterprise/src/lib/data-grid-pro.ts","../../../projects/enterprise/src/lib/provide-license.ts","../../../projects/enterprise/src/public-api.ts","../../../projects/enterprise/src/gridengine-angular-datagrid-enterprise.ts"],"sourcesContent":["/**\n * Public verifying keys for GridEngine Angular license keys.\n *\n * These are Ed25519 PUBLIC keys, keyed by `keyId` — safe to ship in the bundle\n * (they can only verify signatures, never mint keys). The matching PRIVATE key\n * lives only in the GridEngine store backend (Azure Key Vault secret\n * `signing-angular-datagrid`). Rotate by adding a new keyId here alongside the\n * old one, until previously issued keys expire.\n */\nimport type { PublicKeyRing } from '@gridengine/license-core';\n\n/** The product id GridEngine license keys are scoped to for this package. */\nexport const PRODUCT_ID = 'angular-datagrid';\n\n/** Where a buyer can purchase / activate a license. */\nexport const PURCHASE_URL = 'https://angular.gridengine.dev/pricing';\n\nexport const PUBLIC_KEYRING: PublicKeyRing = {\n 'angular-datagrid-2026-08-09': 'GJx3r0A-xL2Q3-poGd3WbOh_B0EN9wwWOxMdksxs_S4',\n};\n","/**\n * LicenseManager — validates a `@gridengine/angular-datagrid-enterprise` license key.\n *\n * Verification uses `@gridengine/license-core` (Ed25519, keyring-based) — the\n * same scheme the GridEngine store uses to sign keys after a real purchase. The\n * private signing key lives only in the store's backend (Key Vault); this\n * package ships only the matching PUBLIC verifying key, so it can check a key's\n * authenticity but never mint one.\n *\n * This is soft licensing, not DRM: validation is synchronous and client-side,\n * and a determined user could strip the check from their own bundle. Server-\n * side entitlement checks remain authoritative for anything that matters.\n *\n * Feature access is derived from the license TIER (see `TIER_FEATURES`), with\n * `payload.features` allowed to grant additional flags on top. The support\n * level is metadata only — it never gates any in-bundle behaviour.\n */\nimport {\n validateLicense,\n resolveFeatures as coreResolveFeatures,\n TIER_FEATURES,\n type LicensePayload,\n type LicenseTier,\n type SupportLevel,\n type LicenseStatus,\n type LicenseValidationResult,\n type PublicKeyRing,\n} from '@gridengine/license-core';\nimport { PRODUCT_ID, PURCHASE_URL, PUBLIC_KEYRING } from './keyring';\n\nexport type {\n LicensePayload,\n LicenseTier,\n SupportLevel,\n LicenseStatus,\n LicenseValidationResult,\n};\nexport { TIER_FEATURES };\n\nconst _cache = new Map<string, LicenseValidationResult>();\n\n/**\n * Global license key, set once at app bootstrap (typically via\n * `provideGridEngineLicense(key)`) so every `<gd-data-grid-pro>` in the app\n * picks it up without needing a `licenseKey` input on each instance. A\n * `licenseKey` input, when given, still overrides this for that instance.\n */\nlet _globalLicenseKey: string | undefined;\n\n/** Set the license key once for the whole app (e.g. at app bootstrap). */\nfunction setLicenseKey(key: string | undefined): void {\n _globalLicenseKey = key;\n}\n\n/** The key previously set via `setLicenseKey`, if any. */\nfunction getLicenseKey(): string | undefined {\n return _globalLicenseKey;\n}\n\n/**\n * Validate a key against an arbitrary keyring. Exported (but not part of the\n * public `LicenseManager` API surface) so tests can verify against a throwaway\n * test keypair instead of the real production keyring.\n */\nexport function validateWithKeyring(\n key: string | undefined,\n keys: PublicKeyRing | string,\n): LicenseValidationResult {\n if (!key) {\n return {\n status: 'missing',\n payload: null,\n message:\n 'No @gridengine/angular-datagrid-enterprise license key provided. ' +\n 'A watermark will be displayed. ' +\n `Purchase a license at ${PURCHASE_URL}`,\n };\n }\n return validateLicense(key, keys, PRODUCT_ID);\n}\n\n/**\n * Validate a license key string. Results are cached per key so validation runs\n * at most once per key per session.\n */\nfunction validate(key: string | undefined): LicenseValidationResult {\n if (!key) return validateWithKeyring(key, PUBLIC_KEYRING);\n\n const cached = _cache.get(key);\n if (cached) return cached;\n\n const result = validateWithKeyring(key, PUBLIC_KEYRING);\n _cache.set(key, result);\n return result;\n}\n\n/**\n * The set of feature flags granted by a validated payload: the tier defaults\n * plus any explicit extras in `payload.features`.\n */\nfunction resolveFeatures(payload: LicensePayload): Set<string> {\n return coreResolveFeatures(payload);\n}\n\n/**\n * Check whether a specific feature is enabled for a key, against an arbitrary\n * keyring. Exported (but not part of the public `LicenseManager` API surface)\n * so tests can exercise this without the real production keyring.\n */\nexport function isFeatureEnabledWithKeyring(\n key: string | undefined,\n feature: string,\n keys: PublicKeyRing | string,\n): boolean {\n if (!key) return true; // evaluation mode\n const result = validateWithKeyring(key, keys);\n if (result.status !== 'valid' || !result.payload) return false;\n return resolveFeatures(result.payload).has(feature);\n}\n\n/**\n * Check whether a specific feature is enabled for a given key. Returns true\n * when no key is given (evaluation mode — features accessible but watermarked),\n * and false for any non-valid license.\n */\nfunction isFeatureEnabled(key: string | undefined, feature: string): boolean {\n if (!key) return true; // evaluation mode\n const result = validate(key);\n if (result.status !== 'valid' || !result.payload) return false;\n return resolveFeatures(result.payload).has(feature);\n}\n\nexport const LicenseManager = {\n validate,\n isFeatureEnabled,\n setLicenseKey,\n getLicenseKey,\n TIER_FEATURES,\n} as const;\n","/**\n * GridLicenseWatermark — a subtle, non-blocking evaluation watermark shown in\n * the corner of an enterprise grid when no valid license key is provided.\n *\n * The grid stays fully functional in evaluation mode; this only signals that a\n * license is required for production use. It is rendered automatically by\n * `<gd-data-grid-pro>` but is also exported for advanced consumers who compose\n * the grid themselves.\n */\nimport { ChangeDetectionStrategy, Component, input } from '@angular/core';\nimport { PURCHASE_URL } from './keyring';\n\n@Component({\n selector: 'gd-license-watermark',\n standalone: true,\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"gd-license-watermark\" aria-hidden=\"true\">\n {{ label() }} — unlicensed — <span class=\"gd-license-watermark__url\">{{ url() }}</span>\n </div>\n `,\n styles: [\n `\n .gd-license-watermark {\n position: absolute;\n bottom: 8px;\n right: 12px;\n z-index: 10;\n font-family: sans-serif;\n font-size: 11px;\n letter-spacing: 0.02em;\n color: rgba(0, 0, 0, 0.35);\n pointer-events: none;\n user-select: none;\n }\n .gd-license-watermark__url {\n text-decoration: underline;\n }\n `,\n ],\n})\nexport class GridLicenseWatermark {\n /** Package label shown in the watermark. */\n readonly label = input('@gridengine/angular-datagrid-enterprise');\n /** Purchase URL shown in the watermark. */\n readonly url = input(PURCHASE_URL);\n}\n","/**\n * DataGridPro — the license-aware wrapper for the GridEngine Angular grid.\n *\n * Projects a base `<gd-data-grid>` (or any content) and overlays an evaluation\n * watermark when no valid license key is present. The grid remains fully\n * functional without a license (evaluation mode); this component only adds the\n * watermark + a one-time console warning.\n *\n * ```html\n * <gd-data-grid-pro [licenseKey]=\"key\">\n * <gd-data-grid [rowData]=\"rows\" [columnDefs]=\"cols\" />\n * </gd-data-grid-pro>\n * ```\n *\n * A `[licenseKey]` input overrides the app-wide key set via\n * `provideGridEngineLicense()` / `LicenseManager.setLicenseKey()`.\n */\nimport { ChangeDetectionStrategy, Component, computed, effect, input } from '@angular/core';\nimport type { LicenseValidationResult } from '@gridengine/license-core';\nimport { LicenseManager } from './license-manager';\nimport { GridLicenseWatermark } from './license-watermark';\n\n@Component({\n selector: 'gd-data-grid-pro',\n standalone: true,\n imports: [GridLicenseWatermark],\n changeDetection: ChangeDetectionStrategy.OnPush,\n template: `\n <div class=\"gd-data-grid-pro\">\n <ng-content />\n @if (showWatermark()) {\n <gd-license-watermark />\n }\n </div>\n `,\n styles: [\n `\n :host {\n display: block;\n }\n .gd-data-grid-pro {\n position: relative;\n display: block;\n }\n `,\n ],\n})\nexport class DataGridPro {\n /** Per-instance license key; overrides the app-wide key when provided. */\n readonly licenseKey = input<string | undefined>(undefined);\n\n protected readonly licenseResult = computed<LicenseValidationResult>(() =>\n LicenseManager.validate(this.licenseKey() ?? LicenseManager.getLicenseKey()),\n );\n\n protected readonly showWatermark = computed(() => this.licenseResult().status !== 'valid');\n\n private warned = false;\n\n constructor() {\n effect(() => {\n const result = this.licenseResult();\n if (!this.warned && result.status !== 'valid') {\n console.warn(`[@gridengine/angular-datagrid-enterprise] ${result.message}`);\n this.warned = true;\n }\n });\n }\n\n /** The current license validation result (for advanced consumers). */\n getLicenseResult(): LicenseValidationResult {\n return this.licenseResult();\n }\n}\n","/**\n * `provideGridEngineLicense` — register a GridEngine Angular license key once\n * for the whole application at bootstrap.\n *\n * Usage (standalone bootstrap):\n *\n * ```ts\n * bootstrapApplication(App, {\n * providers: [provideGridEngineLicense('BASE64URL.payload.signature')],\n * });\n * ```\n *\n * Every `<gd-data-grid-pro>` in the app then picks the key up automatically via\n * `LicenseManager.getLicenseKey()`; a per-instance `[licenseKey]` input still\n * overrides it for that instance.\n */\nimport { makeEnvironmentProviders, provideEnvironmentInitializer } from '@angular/core';\nimport type { EnvironmentProviders } from '@angular/core';\nimport { LicenseManager } from './license-manager';\n\nexport function provideGridEngineLicense(key: string | undefined): EnvironmentProviders {\n return makeEnvironmentProviders([\n provideEnvironmentInitializer(() => LicenseManager.setLicenseKey(key)),\n ]);\n}\n","/*\n * Public API Surface of @gridengine/angular-datagrid-enterprise\n *\n * Re-exports the open-source base grid so consumers need a single import, then\n * adds the license-gated Pro surface on top.\n */\n\n// ── Base grid (full re-export) ──────────────────────────────────────────────\nexport * from '@gridengine/angular-datagrid';\n\n// ── Pro component ───────────────────────────────────────────────────────────\nexport { DataGridPro } from './lib/data-grid-pro';\nexport { GridLicenseWatermark } from './lib/license-watermark';\n\n// ── License ─────────────────────────────────────────────────────────────────\nexport { LicenseManager, TIER_FEATURES } from './lib/license-manager';\nexport type {\n LicensePayload,\n LicenseTier,\n SupportLevel,\n LicenseStatus,\n LicenseValidationResult,\n} from './lib/license-manager';\nexport { provideGridEngineLicense } from './lib/provide-license';\nexport { PRODUCT_ID, PURCHASE_URL } from './lib/keyring';\n","/**\n * Generated bundle index. Do not edit.\n */\n\nexport * from './public-api';\n"],"names":["coreResolveFeatures"],"mappings":";;;;;;AAWA;AACO,MAAM,UAAU,GAAG;AAE1B;AACO,MAAM,YAAY,GAAG;AAErB,MAAM,cAAc,GAAkB;AAC3C,IAAA,6BAA6B,EAAE,6CAA6C;CAC7E;;ACnBD;;;;;;;;;;;;;;;;AAgBG;AAuBH,MAAM,MAAM,GAAG,IAAI,GAAG,EAAmC;AAEzD;;;;;AAKG;AACH,IAAI,iBAAqC;AAEzC;AACA,SAAS,aAAa,CAAC,GAAuB,EAAA;IAC5C,iBAAiB,GAAG,GAAG;AACzB;AAEA;AACA,SAAS,aAAa,GAAA;AACpB,IAAA,OAAO,iBAAiB;AAC1B;AAEA;;;;AAIG;AACG,SAAU,mBAAmB,CACjC,GAAuB,EACvB,IAA4B,EAAA;IAE5B,IAAI,CAAC,GAAG,EAAE;QACR,OAAO;AACL,YAAA,MAAM,EAAE,SAAS;AACjB,YAAA,OAAO,EAAE,IAAI;AACb,YAAA,OAAO,EACL,mEAAmE;gBACnE,iCAAiC;AACjC,gBAAA,CAAA,sBAAA,EAAyB,YAAY,CAAA,CAAE;SAC1C;IACH;IACA,OAAO,eAAe,CAAC,GAAG,EAAE,I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AAA,EAAA,KAAA,EAAA,iBAAA,EAAA,IAAA,EAAA,EAAA,EAAA,QAAA,EAAA,EAAA,EAAA,QAAA,EApBZ;;;;;;;AAOT,EAAA,CAAA,EAAA,QAAA,EAAA,IAAA,EAAA,MAAA,EAAA,CAAA,0EAAA,CAAA,EAAA,YAAA,EAAA,CAAA,EAAA,IAAA,EAAA,WAAA,EAAA,IAAA,EATS,oBAAoB,EAAA,QAAA,EAAA,sBAAA,EAAA,MAAA,EAAA,CAAA,OAAA,EAAA,KAAA,CAAA,EAAA,CAAA,EAAA,eAAA,EAAA,EAAA,CAAA,uBAAA,CAAA,MAAA,EAAA,CAAA;;2FAsBnB,WAAW,EAAA,UAAA,EAAA,CAAA;kBAzBvB,SAAS;+BACE,kBAAkB,EAAA,UAAA,EAChB,IAAI,EAAA,OAAA,EACP,CAAC,oBAAoB,CAAC,EAAA,eAAA,EACd,uBAAuB,CAAC,MAAM,EAAA,QAAA,EACrC;;;;;;;AAOT,EAAA,CAAA,EAAA,MAAA,EAAA,CAAA,0EAAA,CAAA,EAAA;;;AClCH;;;;;;;;;;;;;;;AAeG;AAKG,SAAU,wBAAwB,CAAC,GAAuB,EAAA;AAC9D,IAAA,OAAO,wBAAwB,CAAC;QAC9B,6BAA6B,CAAC,MAAM,cAAc,CAAC,aAAa,CAAC,GAAG,CAAC,CAAC;AACvE,KAAA,CAAC;AACJ;;ACxBA;;;;;AAKG;AAEH;;ACPA;;AAEG;;;;"}
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@gridengine/angular-datagrid-enterprise",
3
+ "version": "0.1.0",
4
+ "description": "Pro/Enterprise features for the GridEngine Angular data grid (license-gated).",
5
+ "license": "SEE LICENSE IN LICENSE",
6
+ "publishConfig": {
7
+ "access": "public"
8
+ },
9
+ "repository": {
10
+ "type": "git",
11
+ "url": "git+https://github.com/bhushanpoojary/angular-datagrid-enterprise.git"
12
+ },
13
+ "peerDependencies": {
14
+ "@angular/cdk": "^22.1.0",
15
+ "@angular/common": "^22.1.0",
16
+ "@angular/core": "^22.1.0",
17
+ "@gridengine/angular-datagrid": "^0.23.1",
18
+ "@gridengine/license-core": "^0.1.0"
19
+ },
20
+ "dependencies": {
21
+ "tslib": "^2.3.0"
22
+ },
23
+ "sideEffects": false,
24
+ "module": "fesm2022/gridengine-angular-datagrid-enterprise.mjs",
25
+ "typings": "types/gridengine-angular-datagrid-enterprise.d.ts",
26
+ "exports": {
27
+ "./package.json": {
28
+ "default": "./package.json"
29
+ },
30
+ ".": {
31
+ "types": "./types/gridengine-angular-datagrid-enterprise.d.ts",
32
+ "default": "./fesm2022/gridengine-angular-datagrid-enterprise.mjs"
33
+ }
34
+ },
35
+ "type": "module"
36
+ }
@@ -0,0 +1,87 @@
1
+ export * from '@gridengine/angular-datagrid';
2
+ import * as _angular_core from '@angular/core';
3
+ import { EnvironmentProviders } from '@angular/core';
4
+ import { LicenseValidationResult, LicenseTier } from '@gridengine/license-core';
5
+ export { LicensePayload, LicenseStatus, LicenseTier, LicenseValidationResult, SupportLevel, TIER_FEATURES } from '@gridengine/license-core';
6
+
7
+ declare class DataGridPro {
8
+ /** Per-instance license key; overrides the app-wide key when provided. */
9
+ readonly licenseKey: _angular_core.InputSignal<string | undefined>;
10
+ protected readonly licenseResult: _angular_core.Signal<LicenseValidationResult>;
11
+ protected readonly showWatermark: _angular_core.Signal<boolean>;
12
+ private warned;
13
+ constructor();
14
+ /** The current license validation result (for advanced consumers). */
15
+ getLicenseResult(): LicenseValidationResult;
16
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<DataGridPro, never>;
17
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<DataGridPro, "gd-data-grid-pro", never, { "licenseKey": { "alias": "licenseKey"; "required": false; "isSignal": true; }; }, {}, never, ["*"], true, never>;
18
+ }
19
+
20
+ declare class GridLicenseWatermark {
21
+ /** Package label shown in the watermark. */
22
+ readonly label: _angular_core.InputSignal<string>;
23
+ /** Purchase URL shown in the watermark. */
24
+ readonly url: _angular_core.InputSignal<string>;
25
+ static ɵfac: _angular_core.ɵɵFactoryDeclaration<GridLicenseWatermark, never>;
26
+ static ɵcmp: _angular_core.ɵɵComponentDeclaration<GridLicenseWatermark, "gd-license-watermark", never, { "label": { "alias": "label"; "required": false; "isSignal": true; }; "url": { "alias": "url"; "required": false; "isSignal": true; }; }, {}, never, never, true, never>;
27
+ }
28
+
29
+ /**
30
+ * LicenseManager — validates a `@gridengine/angular-datagrid-enterprise` license key.
31
+ *
32
+ * Verification uses `@gridengine/license-core` (Ed25519, keyring-based) — the
33
+ * same scheme the GridEngine store uses to sign keys after a real purchase. The
34
+ * private signing key lives only in the store's backend (Key Vault); this
35
+ * package ships only the matching PUBLIC verifying key, so it can check a key's
36
+ * authenticity but never mint one.
37
+ *
38
+ * This is soft licensing, not DRM: validation is synchronous and client-side,
39
+ * and a determined user could strip the check from their own bundle. Server-
40
+ * side entitlement checks remain authoritative for anything that matters.
41
+ *
42
+ * Feature access is derived from the license TIER (see `TIER_FEATURES`), with
43
+ * `payload.features` allowed to grant additional flags on top. The support
44
+ * level is metadata only — it never gates any in-bundle behaviour.
45
+ */
46
+
47
+ /** Set the license key once for the whole app (e.g. at app bootstrap). */
48
+ declare function setLicenseKey(key: string | undefined): void;
49
+ /** The key previously set via `setLicenseKey`, if any. */
50
+ declare function getLicenseKey(): string | undefined;
51
+ /**
52
+ * Validate a license key string. Results are cached per key so validation runs
53
+ * at most once per key per session.
54
+ */
55
+ declare function validate(key: string | undefined): LicenseValidationResult;
56
+ /**
57
+ * Check whether a specific feature is enabled for a given key. Returns true
58
+ * when no key is given (evaluation mode — features accessible but watermarked),
59
+ * and false for any non-valid license.
60
+ */
61
+ declare function isFeatureEnabled(key: string | undefined, feature: string): boolean;
62
+ declare const LicenseManager: {
63
+ readonly validate: typeof validate;
64
+ readonly isFeatureEnabled: typeof isFeatureEnabled;
65
+ readonly setLicenseKey: typeof setLicenseKey;
66
+ readonly getLicenseKey: typeof getLicenseKey;
67
+ readonly TIER_FEATURES: Record<LicenseTier, readonly string[]>;
68
+ };
69
+
70
+ declare function provideGridEngineLicense(key: string | undefined): EnvironmentProviders;
71
+
72
+ /**
73
+ * Public verifying keys for GridEngine Angular license keys.
74
+ *
75
+ * These are Ed25519 PUBLIC keys, keyed by `keyId` — safe to ship in the bundle
76
+ * (they can only verify signatures, never mint keys). The matching PRIVATE key
77
+ * lives only in the GridEngine store backend (Azure Key Vault secret
78
+ * `signing-angular-datagrid`). Rotate by adding a new keyId here alongside the
79
+ * old one, until previously issued keys expire.
80
+ */
81
+
82
+ /** The product id GridEngine license keys are scoped to for this package. */
83
+ declare const PRODUCT_ID = "angular-datagrid";
84
+ /** Where a buyer can purchase / activate a license. */
85
+ declare const PURCHASE_URL = "https://angular.gridengine.dev/pricing";
86
+
87
+ export { DataGridPro, GridLicenseWatermark, LicenseManager, PRODUCT_ID, PURCHASE_URL, provideGridEngineLicense };