@dreamtree-org/landing-kit 0.9.0 → 0.10.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/MIGRATION.md +16 -0
- package/PLATFORM-API.md +17 -13
- package/README.md +1 -1
- package/ai-skills/landing-kit.md +7 -6
- package/dist/platform.cjs +1094 -398
- package/dist/platform.js +1092 -396
- package/package.json +1 -1
- package/platform.d.ts +37 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@dreamtree-org/landing-kit",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.10.0",
|
|
4
4
|
"description": "The shared marketing site, auth frame (AuthShell + brands) and Platform admin console for every Dreamtree product: content-driven landing pages, login/signup shell, platform console client, Express routes, prerender and SEO files.",
|
|
5
5
|
"author": {
|
|
6
6
|
"name": "Partha Preetham Krishna",
|
package/platform.d.ts
CHANGED
|
@@ -5,7 +5,7 @@ export const PLATFORM_API_BASE: '/api/platform';
|
|
|
5
5
|
export const PLATFORM_LOGIN_PATH: '/platform/login';
|
|
6
6
|
export const STEP_UP_REQUIRED: 'STEP_UP_REQUIRED';
|
|
7
7
|
|
|
8
|
-
export type PlatformFeature = 'overview' | 'companies' | 'jobs' | 'plans' | 'audit' | 'support' | 'settings' | 'admins';
|
|
8
|
+
export type PlatformFeature = 'overview' | 'companies' | 'jobs' | 'plans' | 'audit' | 'support' | 'settings' | 'domains' | 'admins';
|
|
9
9
|
/** Every console feature, in nav order. */
|
|
10
10
|
export const PLATFORM_FEATURES: readonly PlatformFeature[];
|
|
11
11
|
/** Features a server without `GET /me` serves. */
|
|
@@ -91,7 +91,7 @@ export interface PlatformMe {
|
|
|
91
91
|
permissions: string[];
|
|
92
92
|
/** `console` false = enrollment-only session (enroll an authenticator first). */
|
|
93
93
|
access?: { console: boolean; stepUpFresh: boolean };
|
|
94
|
-
features: Partial<Record<PlatformFeature
|
|
94
|
+
features: Partial<Record<PlatformFeature, boolean>>;
|
|
95
95
|
app: { key: string; name: string; companyLoginPath?: string };
|
|
96
96
|
}
|
|
97
97
|
|
|
@@ -187,28 +187,35 @@ export interface Plan {
|
|
|
187
187
|
seats?: number | null;
|
|
188
188
|
limits?: Record<string, number | null>;
|
|
189
189
|
features?: string[];
|
|
190
|
+
sort?: number;
|
|
190
191
|
}
|
|
191
192
|
|
|
192
193
|
export interface Subscription {
|
|
193
194
|
id: string;
|
|
194
195
|
companyId: string;
|
|
195
196
|
planId: string;
|
|
197
|
+
planCode?: string | null;
|
|
198
|
+
planName?: string | null;
|
|
196
199
|
status: 'trial' | 'active' | 'past_due' | 'cancelled' | 'expired';
|
|
197
200
|
startsAt: Iso;
|
|
198
201
|
endsAt: Iso | null;
|
|
199
202
|
seats?: number | null;
|
|
200
203
|
notes?: string | null;
|
|
204
|
+
createdBy?: string | null;
|
|
205
|
+
createdAt?: Iso;
|
|
201
206
|
}
|
|
202
207
|
|
|
203
208
|
export interface SettingsField {
|
|
204
209
|
key: string;
|
|
205
210
|
label: string;
|
|
206
211
|
type: 'text' | 'number' | 'boolean' | 'select' | 'secret' | 'email' | 'url';
|
|
207
|
-
options?: string
|
|
212
|
+
options?: Array<{ value: string; label: string }>;
|
|
208
213
|
/** Secret values come back masked (`set: true`), never in clear. */
|
|
209
214
|
value?: unknown;
|
|
210
215
|
set?: boolean;
|
|
211
216
|
help?: string;
|
|
217
|
+
/** Where the value comes from. */
|
|
218
|
+
source?: 'branch' | 'company' | 'default' | null;
|
|
212
219
|
}
|
|
213
220
|
export interface SettingsFamily {
|
|
214
221
|
family: string;
|
|
@@ -216,24 +223,37 @@ export interface SettingsFamily {
|
|
|
216
223
|
scope: 'platform' | 'company';
|
|
217
224
|
fields: SettingsField[];
|
|
218
225
|
}
|
|
226
|
+
/** GET settings?company= */
|
|
227
|
+
export interface SettingsResponse {
|
|
228
|
+
families: SettingsFamily[];
|
|
229
|
+
/** Send back with PUT settings/:family; a stale version answers 409. */
|
|
230
|
+
version: number;
|
|
231
|
+
}
|
|
219
232
|
|
|
220
233
|
export interface SupportGrant {
|
|
221
234
|
id: string;
|
|
222
235
|
companyId: string;
|
|
223
236
|
companyName?: string;
|
|
224
237
|
requestedBy: string;
|
|
238
|
+
requestedById?: string;
|
|
225
239
|
approvedBy?: string | null;
|
|
226
240
|
reason: string;
|
|
241
|
+
/** Length of the access window, counted from approval. */
|
|
242
|
+
minutes?: number | null;
|
|
227
243
|
status: 'requested' | 'active' | 'expired' | 'revoked';
|
|
228
244
|
expiresAt: Iso | null;
|
|
245
|
+
approvedAt?: Iso | null;
|
|
246
|
+
revokedAt?: Iso | null;
|
|
229
247
|
createdAt: Iso;
|
|
230
248
|
}
|
|
231
249
|
|
|
232
250
|
export interface CompanyDomain {
|
|
233
251
|
id: string;
|
|
234
252
|
host: string;
|
|
253
|
+
status?: 'pending' | 'verified';
|
|
235
254
|
primary: boolean;
|
|
236
255
|
verifiedAt: Iso | null;
|
|
256
|
+
createdAt?: Iso;
|
|
237
257
|
verification?: { type: 'TXT'; name: string; value: string };
|
|
238
258
|
}
|
|
239
259
|
|
|
@@ -327,6 +347,8 @@ export function usePlatform(): {
|
|
|
327
347
|
href(rel?: string): string;
|
|
328
348
|
navigate(href: string): void;
|
|
329
349
|
can(permission: string): boolean;
|
|
350
|
+
/** Features this console shows (requested ∩ advertised by GET /me). */
|
|
351
|
+
features: PlatformFeature[];
|
|
330
352
|
companyLoginPath(slug: string): string;
|
|
331
353
|
companyLoginUrl(slug: string): string;
|
|
332
354
|
};
|
|
@@ -340,3 +362,15 @@ export const CopyButton: ComponentType<{ value: string; label?: string }>;
|
|
|
340
362
|
export const OneTimeSecret: ComponentType<{ title?: string; loginUrl?: string; email: string; password: string; onDone?: () => void }>;
|
|
341
363
|
export const InspectResult: ComponentType<{ report: Record<string, any> }>;
|
|
342
364
|
export function describeAction(action: string): string;
|
|
365
|
+
/** "₹999.00 / month" from minor units. */
|
|
366
|
+
export function formatPrice(priceMinor: number, currency?: string, interval?: Plan['interval']): string;
|
|
367
|
+
|
|
368
|
+
/** Built-in v1.1 views, exported for products that compose their own console. They render inside <PlatformConsole>. */
|
|
369
|
+
export const PlansView: ComponentType;
|
|
370
|
+
export const SupportAccessView: ComponentType;
|
|
371
|
+
export const SupportGrants: ComponentType<{ companyId?: string; companyName?: string }>;
|
|
372
|
+
type CompanyTabProps = { company: { id: string; displayName?: string } & Record<string, any>; setFlash(flash: { kind: 'success' | 'error' | 'warning' | 'info'; msg: string } | null): void };
|
|
373
|
+
export const SubscriptionTab: ComponentType<CompanyTabProps>;
|
|
374
|
+
export const DomainsTab: ComponentType<CompanyTabProps>;
|
|
375
|
+
export const SettingsTab: ComponentType<CompanyTabProps>;
|
|
376
|
+
export const SupportTab: ComponentType<CompanyTabProps>;
|