@chefuicore/core 0.7.0 → 1.0.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/components/chef-ui-alert.d.ts +25 -0
- package/dist/components/chef-ui-alert.d.ts.map +1 -0
- package/dist/components/chef-ui-app-bar.d.ts +23 -0
- package/dist/components/chef-ui-app-bar.d.ts.map +1 -0
- package/dist/components/chef-ui-avatar.d.ts +40 -0
- package/dist/components/chef-ui-avatar.d.ts.map +1 -0
- package/dist/components/chef-ui-badge.d.ts +25 -0
- package/dist/components/chef-ui-badge.d.ts.map +1 -0
- package/dist/components/chef-ui-breadcrumbs.d.ts +32 -0
- package/dist/components/chef-ui-breadcrumbs.d.ts.map +1 -0
- package/dist/components/chef-ui-card.d.ts +32 -0
- package/dist/components/chef-ui-card.d.ts.map +1 -0
- package/dist/components/chef-ui-chip.d.ts +26 -0
- package/dist/components/chef-ui-chip.d.ts.map +1 -0
- package/dist/components/chef-ui-dialog.d.ts +31 -0
- package/dist/components/chef-ui-dialog.d.ts.map +1 -0
- package/dist/components/chef-ui-divider.d.ts +16 -0
- package/dist/components/chef-ui-divider.d.ts.map +1 -0
- package/dist/components/chef-ui-drawer.d.ts +29 -0
- package/dist/components/chef-ui-drawer.d.ts.map +1 -0
- package/dist/components/chef-ui-list.d.ts +39 -0
- package/dist/components/chef-ui-list.d.ts.map +1 -0
- package/dist/components/chef-ui-menu.d.ts +44 -0
- package/dist/components/chef-ui-menu.d.ts.map +1 -0
- package/dist/components/chef-ui-pagination.d.ts +28 -0
- package/dist/components/chef-ui-pagination.d.ts.map +1 -0
- package/dist/components/chef-ui-progress.d.ts +38 -0
- package/dist/components/chef-ui-progress.d.ts.map +1 -0
- package/dist/components/chef-ui-rating.d.ts +33 -0
- package/dist/components/chef-ui-rating.d.ts.map +1 -0
- package/dist/components/chef-ui-skeleton.d.ts +15 -0
- package/dist/components/chef-ui-skeleton.d.ts.map +1 -0
- package/dist/components/chef-ui-slider.d.ts +36 -0
- package/dist/components/chef-ui-slider.d.ts.map +1 -0
- package/dist/components/chef-ui-snackbar.d.ts +37 -0
- package/dist/components/chef-ui-snackbar.d.ts.map +1 -0
- package/dist/components/chef-ui-stepper.d.ts +31 -0
- package/dist/components/chef-ui-stepper.d.ts.map +1 -0
- package/dist/components/chef-ui-switch.d.ts +27 -0
- package/dist/components/chef-ui-switch.d.ts.map +1 -0
- package/dist/components/chef-ui-tabs.d.ts +41 -0
- package/dist/components/chef-ui-tabs.d.ts.map +1 -0
- package/dist/components/chef-ui-text-field.d.ts +57 -0
- package/dist/components/chef-ui-text-field.d.ts.map +1 -0
- package/dist/components/chef-ui-tooltip.d.ts +33 -0
- package/dist/components/chef-ui-tooltip.d.ts.map +1 -0
- package/dist/index.cjs +9472 -127
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.ts +26 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9467 -127
- package/dist/index.js.map +1 -1
- package/dist/utils/license.d.ts +114 -0
- package/dist/utils/license.d.ts.map +1 -0
- package/dist/utils/licensed-element.d.ts +19 -0
- package/dist/utils/licensed-element.d.ts.map +1 -0
- package/package.json +1 -1
|
@@ -0,0 +1,114 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChefUI License Manager
|
|
3
|
+
*
|
|
4
|
+
* Token-based licensing system for commercial use.
|
|
5
|
+
* Each token is tied to a single project and priced per developer.
|
|
6
|
+
*
|
|
7
|
+
* Usage:
|
|
8
|
+
* import { ChefUILicense } from '@chefuicore/core';
|
|
9
|
+
* ChefUILicense.init({ token: 'your-token-here' });
|
|
10
|
+
*/
|
|
11
|
+
export interface LicenseConfig {
|
|
12
|
+
/** The license token provided to the customer */
|
|
13
|
+
token: string;
|
|
14
|
+
/** Optional: License validation endpoint URL */
|
|
15
|
+
validationEndpoint?: string;
|
|
16
|
+
}
|
|
17
|
+
export interface LicensePayload {
|
|
18
|
+
/** Unique license ID */
|
|
19
|
+
lid: string;
|
|
20
|
+
/** Organization / customer name */
|
|
21
|
+
org: string;
|
|
22
|
+
/** Project identifier this license is bound to */
|
|
23
|
+
project: string;
|
|
24
|
+
/** Maximum number of developers allowed */
|
|
25
|
+
maxDevs: number;
|
|
26
|
+
/** License type */
|
|
27
|
+
type: 'trial' | 'standard' | 'enterprise';
|
|
28
|
+
/** Expiration timestamp (ms since epoch) */
|
|
29
|
+
exp: number;
|
|
30
|
+
/** Issued at timestamp (ms since epoch) */
|
|
31
|
+
iat: number;
|
|
32
|
+
/** Feature flags (optional) */
|
|
33
|
+
features?: string[];
|
|
34
|
+
}
|
|
35
|
+
export type LicenseStatus = 'valid' | 'expired' | 'invalid' | 'missing';
|
|
36
|
+
type LicenseChangeCallback = (status: LicenseStatus) => void;
|
|
37
|
+
declare class LicenseManager {
|
|
38
|
+
private _token;
|
|
39
|
+
private _payload;
|
|
40
|
+
private _status;
|
|
41
|
+
private _validationEndpoint;
|
|
42
|
+
private _listeners;
|
|
43
|
+
private _remoteValidated;
|
|
44
|
+
private _remoteValidationPromise;
|
|
45
|
+
/**
|
|
46
|
+
* Initialize the license system. Call once at application startup.
|
|
47
|
+
*/
|
|
48
|
+
init(config: LicenseConfig): void;
|
|
49
|
+
/**
|
|
50
|
+
* Get the current license status
|
|
51
|
+
*/
|
|
52
|
+
get status(): LicenseStatus;
|
|
53
|
+
/**
|
|
54
|
+
* Check if the license is currently valid
|
|
55
|
+
*/
|
|
56
|
+
get isValid(): boolean;
|
|
57
|
+
/**
|
|
58
|
+
* Get the decoded license payload
|
|
59
|
+
*/
|
|
60
|
+
get payload(): LicensePayload | null;
|
|
61
|
+
/**
|
|
62
|
+
* Get the raw token string
|
|
63
|
+
*/
|
|
64
|
+
get token(): string | null;
|
|
65
|
+
/**
|
|
66
|
+
* Subscribe to license status changes
|
|
67
|
+
*/
|
|
68
|
+
onChange(callback: LicenseChangeCallback): () => void;
|
|
69
|
+
/**
|
|
70
|
+
* Reset the license (for testing or logout scenarios)
|
|
71
|
+
*/
|
|
72
|
+
reset(): void;
|
|
73
|
+
/**
|
|
74
|
+
* Decode a ChefUI license token.
|
|
75
|
+
* Token format: base64(JSON payload).base64(signature)
|
|
76
|
+
*/
|
|
77
|
+
private decodeToken;
|
|
78
|
+
/**
|
|
79
|
+
* Check if the license has expired
|
|
80
|
+
*/
|
|
81
|
+
private isExpired;
|
|
82
|
+
/**
|
|
83
|
+
* Simple signature computation for token validation.
|
|
84
|
+
* In production, this should use a proper HMAC or RSA verification.
|
|
85
|
+
*/
|
|
86
|
+
private computeSignature;
|
|
87
|
+
/**
|
|
88
|
+
* Base64 decode (browser & Node compatible)
|
|
89
|
+
*/
|
|
90
|
+
private base64Decode;
|
|
91
|
+
/**
|
|
92
|
+
* Base64 encode (browser & Node compatible)
|
|
93
|
+
*/
|
|
94
|
+
private base64Encode;
|
|
95
|
+
/**
|
|
96
|
+
* Remote validation against a licensing server
|
|
97
|
+
*/
|
|
98
|
+
private validateRemote;
|
|
99
|
+
/**
|
|
100
|
+
* Notify all listeners of status change
|
|
101
|
+
*/
|
|
102
|
+
private _notifyListeners;
|
|
103
|
+
/**
|
|
104
|
+
* Generate a license token (utility for server-side token generation).
|
|
105
|
+
* This is provided as a helper — in production, tokens should be generated server-side.
|
|
106
|
+
*/
|
|
107
|
+
static generateToken(payload: LicensePayload): string;
|
|
108
|
+
}
|
|
109
|
+
/** Singleton license manager instance */
|
|
110
|
+
export declare const ChefUILicense: LicenseManager;
|
|
111
|
+
/** Re-export for static token generation */
|
|
112
|
+
export declare const generateLicenseToken: typeof LicenseManager.generateToken;
|
|
113
|
+
export {};
|
|
114
|
+
//# sourceMappingURL=license.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"license.d.ts","sourceRoot":"","sources":["../../src/utils/license.ts"],"names":[],"mappings":"AAAA;;;;;;;;;GASG;AAEH,MAAM,WAAW,aAAa;IAC1B,iDAAiD;IACjD,KAAK,EAAE,MAAM,CAAC;IACd,gDAAgD;IAChD,kBAAk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,IAAI,IAAI;IASb;;;OAGG;IACH,OAAO,CAAC,WAAW;IA0BnB;;OAEG;IACH,OAAO,CAAC,SAAS;IAIjB;;;OAGG;IACH,OAAO,CAAC,gBAAgB;IAYxB;;OAEG;IACH,OAAO,CAAC,YAAY;IAQpB;;OAEG;IACH,OAAO,CAAC,YAAY;IAQpB;;OAEG;YACW,cAAc;IAoC5B;;OAEG;IACH,OAAO,CAAC,gBAAgB;IAIxB;;;OAGG;IACH,MAAM,CAAC,aAAa,CAAC,OAAO,EAAE,cAAc,GAAG,MAAM;CAMxD;AAED,yCAAyC;AACzC,eAAO,MAAM,aAAa,gBAAuB,CAAC;AAElD,4CAA4C;AAC5C,eAAO,MAAM,oBAAoB,qCAA+B,CAAC"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* ChefUI License Guard
|
|
3
|
+
*
|
|
4
|
+
* A non-invasive license enforcement layer that works with all ChefUI components.
|
|
5
|
+
* Instead of modifying every component's base class, this module uses a MutationObserver
|
|
6
|
+
* to monitor the DOM for ChefUI elements and applies license enforcement automatically.
|
|
7
|
+
*
|
|
8
|
+
* When the license is invalid/missing/expired:
|
|
9
|
+
* - Components get a visual overlay indicating the license issue
|
|
10
|
+
* - A console warning is printed
|
|
11
|
+
*
|
|
12
|
+
* This approach is scalable: no changes needed in individual component files.
|
|
13
|
+
*/
|
|
14
|
+
/**
|
|
15
|
+
* Start the license guard observer.
|
|
16
|
+
* This is called automatically when the core module is loaded.
|
|
17
|
+
*/
|
|
18
|
+
export declare function startLicenseGuard(): void;
|
|
19
|
+
//# sourceMappingURL=licensed-element.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"licensed-element.d.ts","sourceRoot":"","sources":["../../src/utils/licensed-element.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AA4IH;;;GAGG;AACH,wBAAgB,iBAAiB,IAAI,IAAI,CAoDxC"}
|
package/package.json
CHANGED