@fluid-app/fluid-cli-portal 0.1.27 → 0.1.29
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/README.md +107 -0
- package/dist/index.d.mts +629 -276
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +1987 -86
- package/dist/index.mjs.map +1 -1
- package/dist/{pull-hAdXOpgb.mjs → pull-zrTaJuSb.mjs} +145 -80
- package/dist/pull-zrTaJuSb.mjs.map +1 -0
- package/package.json +2 -2
- package/templates/base/src/navigation.config.ts +1 -1
- package/templates/base/src/portal.config.ts +1 -1
- package/templates/base/src/preview-entry.tsx +35 -1
- package/templates/starter/package.json.template +3 -1
- package/dist/pull-hAdXOpgb.mjs.map +0 -1
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Command } from "commander";
|
|
2
|
-
import { CliError, FluidPlugin, Result } from "@fluid-app/fluid-cli";
|
|
2
|
+
import { CliError, FetchClient, FluidPlugin, Result } from "@fluid-app/fluid-cli";
|
|
3
3
|
|
|
4
4
|
//#region src/types.d.ts
|
|
5
5
|
/**
|
|
@@ -65,15 +65,31 @@ interface WidgetCreateOptions {
|
|
|
65
65
|
readonly category?: string;
|
|
66
66
|
}
|
|
67
67
|
/**
|
|
68
|
+
* Options for the portal deploy command
|
|
69
|
+
*/
|
|
70
|
+
interface PortalDeployOptions {
|
|
71
|
+
readonly environment?: string;
|
|
72
|
+
readonly outDir?: string;
|
|
73
|
+
readonly dryRun?: boolean;
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Options for the top-level widget publish command
|
|
77
|
+
*/
|
|
78
|
+
interface WidgetPublishOptions {
|
|
79
|
+
readonly droplet: string;
|
|
80
|
+
readonly outDir?: string;
|
|
81
|
+
readonly dryRun?: boolean;
|
|
82
|
+
}
|
|
83
|
+
/**
|
|
68
84
|
* Template variables for Handlebars processing
|
|
69
85
|
*/
|
|
70
86
|
interface TemplateVariables {
|
|
71
87
|
readonly projectName: string;
|
|
72
88
|
readonly sdkVersion: string;
|
|
89
|
+
/** portal-core link used only for --local scaffolds */
|
|
90
|
+
readonly localCoreVersion?: string;
|
|
73
91
|
/** CLI package version (versioned independently from the SDK) */
|
|
74
92
|
readonly cliVersion: string;
|
|
75
|
-
/** portal-core dependency version */
|
|
76
|
-
readonly coreVersion: string;
|
|
77
93
|
/** Selected page templates for the project */
|
|
78
94
|
readonly selectedPages: readonly SelectedPageTemplate[];
|
|
79
95
|
/** Whether any optional pages were selected */
|
|
@@ -167,11 +183,6 @@ declare function createDirectory(path: string): Promise<void>;
|
|
|
167
183
|
*/
|
|
168
184
|
declare function getSdkVersion(): Promise<string>;
|
|
169
185
|
/**
|
|
170
|
-
* Reads the portal-core version from the workspace package.json.
|
|
171
|
-
* Falls back to ^0.1.0 if not found.
|
|
172
|
-
*/
|
|
173
|
-
declare function getCoreVersion(): Promise<string>;
|
|
174
|
-
/**
|
|
175
186
|
* Read a file's content with Result-based error handling
|
|
176
187
|
*/
|
|
177
188
|
declare function readFileSafe(path: string): Promise<Result<string, FileSystemError>>;
|
|
@@ -212,6 +223,12 @@ declare const pushCommand: Command;
|
|
|
212
223
|
//#region src/commands/widget-create.d.ts
|
|
213
224
|
declare const widgetCommand: Command;
|
|
214
225
|
//#endregion
|
|
226
|
+
//#region src/commands/widget-publish.d.ts
|
|
227
|
+
declare const topLevelWidgetCommand: Command;
|
|
228
|
+
//#endregion
|
|
229
|
+
//#region src/commands/deploy.d.ts
|
|
230
|
+
declare const deployCommand: Command;
|
|
231
|
+
//#endregion
|
|
215
232
|
//#region src/commands/version.d.ts
|
|
216
233
|
declare const versionCommand: Command;
|
|
217
234
|
//#endregion
|
|
@@ -337,41 +354,148 @@ declare function diffAgainstSnapshot(portalDir: string, snapshot: Snapshot): Pro
|
|
|
337
354
|
*/
|
|
338
355
|
declare function buildSnapshot(portalDir: string, definitionName: string, definitionId: number): Promise<Snapshot>;
|
|
339
356
|
//#endregion
|
|
340
|
-
//#region ../../api-clients/fluidos/src/generated/
|
|
357
|
+
//#region ../../api-clients/fluidos/src/generated/fluid-os-v0.d.ts
|
|
341
358
|
interface components {
|
|
342
359
|
schemas: {
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
timestamp?: string;
|
|
346
|
-
}; /** @description Pagination metadata for list responses */
|
|
347
|
-
PaginationMeta: {
|
|
348
|
-
/**
|
|
349
|
-
* @description Total number of items across all pages
|
|
350
|
-
* @example 42
|
|
351
|
-
*/
|
|
352
|
-
total_count?: number;
|
|
353
|
-
/**
|
|
354
|
-
* @description Total number of pages
|
|
355
|
-
* @example 5
|
|
356
|
-
*/
|
|
357
|
-
total_pages?: number;
|
|
358
|
-
/**
|
|
359
|
-
* @description Current page number
|
|
360
|
-
* @example 1
|
|
361
|
-
*/
|
|
362
|
-
current_page?: number;
|
|
363
|
-
/**
|
|
364
|
-
* @description Unique identifier for the request
|
|
365
|
-
* @example 123e4567-e89b-12d3-a456-426614174000
|
|
366
|
-
*/
|
|
367
|
-
request_id?: string;
|
|
368
|
-
/**
|
|
369
|
-
* @description Timestamp of the response
|
|
370
|
-
* @example 2021-01-01T00:00:00Z
|
|
371
|
-
*/
|
|
360
|
+
Meta: {
|
|
361
|
+
request_id?: string; /** Format: date-time */
|
|
372
362
|
timestamp?: string;
|
|
363
|
+
};
|
|
364
|
+
PaginatedMeta: {
|
|
365
|
+
current_page: number;
|
|
366
|
+
request_id: string; /** Format: date-time */
|
|
367
|
+
timestamp: string;
|
|
368
|
+
total_count: number;
|
|
369
|
+
total_pages: number;
|
|
370
|
+
};
|
|
371
|
+
ErrorResponse: {
|
|
372
|
+
error_message: string;
|
|
373
|
+
errors: components["schemas"]["ErrorBag"];
|
|
374
|
+
meta: components["schemas"]["Meta"];
|
|
375
|
+
};
|
|
376
|
+
UnauthorizedResponse: {
|
|
377
|
+
message: string;
|
|
378
|
+
}; /** @description Any valid JSON value for provider, integration, theme, metadata, or other dynamic payloads whose keys are not fixed by the API contract. */
|
|
379
|
+
JsonValue: string | number | boolean | null | components["schemas"]["JsonValue"][] | {
|
|
380
|
+
[key: string]: components["schemas"]["JsonValue"];
|
|
381
|
+
}; /** @description A validation or API error value. */
|
|
382
|
+
ErrorValue: string | string[] | components["schemas"]["JsonValue"]; /** @description Validation errors keyed by field, a list of errors, a single error message, or null when no structured error details are available. */
|
|
383
|
+
ErrorBag: string | components["schemas"]["ErrorValue"][] | {
|
|
384
|
+
[key: string]: components["schemas"]["ErrorValue"];
|
|
385
|
+
} | null; /** @description An API error message represented as text or structured JSON. */
|
|
386
|
+
ErrorMessage: string | components["schemas"]["ErrorBag"] | null; /** @description Common legacy error response envelope. Older endpoints may return one or more of these fields depending on the controller path. */
|
|
387
|
+
StandardErrorResponse: {
|
|
388
|
+
message?: string;
|
|
389
|
+
error?: components["schemas"]["ErrorMessage"];
|
|
390
|
+
error_message?: components["schemas"]["ErrorMessage"];
|
|
391
|
+
errors?: components["schemas"]["ErrorBag"];
|
|
392
|
+
meta?: components["schemas"]["Meta"];
|
|
373
393
|
} & {
|
|
374
|
-
[key: string]:
|
|
394
|
+
[key: string]: components["schemas"]["JsonValue"];
|
|
395
|
+
}; /** @description Common legacy unauthorized response envelope. */
|
|
396
|
+
StandardUnauthorizedResponse: components["schemas"]["StandardErrorResponse"];
|
|
397
|
+
FluidOSDefinitionListResponse: {
|
|
398
|
+
definitions: components["schemas"]["FluidOSDefinitionBasic"][];
|
|
399
|
+
meta: components["schemas"]["PaginatedMeta"];
|
|
400
|
+
};
|
|
401
|
+
FluidOSDefinitionRequest: {
|
|
402
|
+
definition?: {
|
|
403
|
+
name: string;
|
|
404
|
+
active?: boolean;
|
|
405
|
+
} | null;
|
|
406
|
+
};
|
|
407
|
+
FluidOSDefinitionUpdateRequest: {
|
|
408
|
+
definition?: {
|
|
409
|
+
name?: string;
|
|
410
|
+
active?: boolean;
|
|
411
|
+
} | null;
|
|
412
|
+
};
|
|
413
|
+
FluidOSNavigationItemCreateRequest: {
|
|
414
|
+
navigation_item?: {
|
|
415
|
+
icon?: string;
|
|
416
|
+
label: string;
|
|
417
|
+
position: number;
|
|
418
|
+
parent_id?: number | null;
|
|
419
|
+
screen_id?: number | null;
|
|
420
|
+
slug?: string | null;
|
|
421
|
+
source?: "user" | "system" | "code" | null;
|
|
422
|
+
} | null;
|
|
423
|
+
};
|
|
424
|
+
FluidOSNavigationCreateRequest: {
|
|
425
|
+
navigation?: {
|
|
426
|
+
name: string;
|
|
427
|
+
platform: string;
|
|
428
|
+
} | null;
|
|
429
|
+
};
|
|
430
|
+
FluidOSProfileCreateRequest: {
|
|
431
|
+
profile?: {
|
|
432
|
+
name: string;
|
|
433
|
+
default?: boolean;
|
|
434
|
+
navigation_id?: number;
|
|
435
|
+
mobile_navigation_id?: number;
|
|
436
|
+
navigation_attributes?: {
|
|
437
|
+
name: string;
|
|
438
|
+
navigation_items_attributes?: Partial<NonNullable<components["schemas"]["FluidOSNavigationItemCreateRequest"]["navigation_item"]>>[];
|
|
439
|
+
};
|
|
440
|
+
mobile_navigation_attributes?: {
|
|
441
|
+
name: string;
|
|
442
|
+
navigation_items_attributes?: Partial<NonNullable<components["schemas"]["FluidOSNavigationItemCreateRequest"]["navigation_item"]>>[];
|
|
443
|
+
};
|
|
444
|
+
theme_ids?: number[];
|
|
445
|
+
permissions?: components["schemas"]["FluidOSDynamicPayload"];
|
|
446
|
+
} | null;
|
|
447
|
+
};
|
|
448
|
+
FluidOSScreenCreateRequest: {
|
|
449
|
+
screen?: {
|
|
450
|
+
name: string;
|
|
451
|
+
slug: string;
|
|
452
|
+
component_tree?: components["schemas"]["FluidOSDynamicPayload"] | null;
|
|
453
|
+
} | null;
|
|
454
|
+
};
|
|
455
|
+
FluidOSThemeCreateRequest: {
|
|
456
|
+
theme?: {
|
|
457
|
+
config: components["schemas"]["FluidOSDynamicPayload"];
|
|
458
|
+
name: string;
|
|
459
|
+
active?: boolean;
|
|
460
|
+
} | null;
|
|
461
|
+
};
|
|
462
|
+
FluidOSNavigationItemUpdateRequest: {
|
|
463
|
+
navigation_item?: Partial<NonNullable<components["schemas"]["FluidOSNavigationItemCreateRequest"]["navigation_item"]>> | null;
|
|
464
|
+
};
|
|
465
|
+
FluidOSNavigationUpdateRequest: {
|
|
466
|
+
navigation?: {
|
|
467
|
+
name?: string;
|
|
468
|
+
platform?: "web" | "mobile";
|
|
469
|
+
} | null;
|
|
470
|
+
};
|
|
471
|
+
FluidOSProfileUpdateRequest: {
|
|
472
|
+
profile?: {
|
|
473
|
+
name?: string;
|
|
474
|
+
default?: boolean;
|
|
475
|
+
navigation_id?: number;
|
|
476
|
+
mobile_navigation_id?: number;
|
|
477
|
+
theme_ids?: number[];
|
|
478
|
+
permissions?: components["schemas"]["FluidOSDynamicPayload"];
|
|
479
|
+
} | null;
|
|
480
|
+
};
|
|
481
|
+
FluidOSScreenUpdateRequest: {
|
|
482
|
+
screen?: {
|
|
483
|
+
name?: string;
|
|
484
|
+
slug?: string;
|
|
485
|
+
component_tree?: components["schemas"]["FluidOSDynamicPayload"] | null;
|
|
486
|
+
} | null;
|
|
487
|
+
};
|
|
488
|
+
FluidOSThemeUpdateRequest: {
|
|
489
|
+
theme?: {
|
|
490
|
+
name?: string;
|
|
491
|
+
active?: boolean;
|
|
492
|
+
config?: components["schemas"]["FluidOSDynamicPayload"];
|
|
493
|
+
} | null;
|
|
494
|
+
};
|
|
495
|
+
FluidOSVersionUpdateRequest: {
|
|
496
|
+
version?: {
|
|
497
|
+
active?: boolean;
|
|
498
|
+
} | null;
|
|
375
499
|
}; /** FluidOS::NavigationItem */
|
|
376
500
|
FluidOSNavigationItem: {
|
|
377
501
|
id: number;
|
|
@@ -381,286 +505,235 @@ interface components {
|
|
|
381
505
|
position?: number | null;
|
|
382
506
|
screen_id?: number | null;
|
|
383
507
|
slug?: string | null; /** @enum {string} */
|
|
384
|
-
source
|
|
385
|
-
children
|
|
386
|
-
}; /**
|
|
387
|
-
|
|
388
|
-
/** @description Array of rank IDs that can access this profile. Empty array allows all ranks. */ranks?: number[]; /** @description Array of roles that can access this profile. Empty array allows all roles. */
|
|
389
|
-
roles?: string[]; /** @description Array of platforms that can access this profile. Empty array allows all platforms. */
|
|
390
|
-
platform?: ("mobile" | "browser")[]; /** @description Array of country IDs that can access this profile. Empty array allows all countries. */
|
|
391
|
-
countries?: number[];
|
|
392
|
-
}; /** @description Standard error response */
|
|
393
|
-
Error: {
|
|
394
|
-
/**
|
|
395
|
-
* @description Simple error message (used for 404 and other simple errors)
|
|
396
|
-
* @example Resource not found
|
|
397
|
-
* @example Unauthorized
|
|
398
|
-
*/
|
|
399
|
-
error?: string;
|
|
400
|
-
/**
|
|
401
|
-
* @description Error message for validation errors
|
|
402
|
-
* @example Invalid parameters
|
|
403
|
-
*/
|
|
404
|
-
error_message?: string;
|
|
405
|
-
/**
|
|
406
|
-
* @description Detailed validation errors by field
|
|
407
|
-
* @example {
|
|
408
|
-
* "definition": {
|
|
409
|
-
* "name": [
|
|
410
|
-
* "must be filled"
|
|
411
|
-
* ]
|
|
412
|
-
* }
|
|
413
|
-
* }
|
|
414
|
-
*/
|
|
415
|
-
errors?: {
|
|
416
|
-
[key: string]: unknown;
|
|
417
|
-
};
|
|
418
|
-
meta?: components["schemas"]["ResponseMeta"];
|
|
419
|
-
} & {
|
|
420
|
-
[key: string]: unknown;
|
|
421
|
-
}; /** @description A profile optimized for rendering, with permissions stripped. Contains only the data needed to render the app. */
|
|
422
|
-
FluidOSRendererProfile: {
|
|
423
|
-
/** @description Unique identifier for the profile */id?: number; /** @description Display name of the profile */
|
|
424
|
-
name?: string; /** @description Whether this is the default profile for its platform */
|
|
425
|
-
default?: boolean; /** @description Navigation configuration for this profile */
|
|
426
|
-
navigation?: {
|
|
427
|
-
/** @description Tree structure of navigation items */navigation_tree?: components["schemas"]["FluidOSNavigationItem"][];
|
|
428
|
-
}; /** @description Array of theme IDs associated with this profile */
|
|
429
|
-
themes?: number[];
|
|
430
|
-
}; /** @description The Fluid OS manifest optimized for rendering. Contains a single matched profile based on platform, country, rank, and role parameters, along with filtered screens and themes. */
|
|
431
|
-
FluidOSRendererManifest: {
|
|
432
|
-
/** @description Name of the Fluid OS app */name?: string; /** @description ID of the Fluid OS definition */
|
|
433
|
-
definition_id?: number; /** @description Version number of the published manifest */
|
|
434
|
-
published_version?: number;
|
|
435
|
-
/**
|
|
436
|
-
* Format: date-time
|
|
437
|
-
* @description When this version was published
|
|
438
|
-
*/
|
|
439
|
-
published_at?: string; /** @description Navigation configurations for the app */
|
|
440
|
-
navigations?: components["schemas"]["FluidOSNavigationBasic"][]; /** @description The best matching profile for the given parameters */
|
|
441
|
-
profile?: components["schemas"]["FluidOSRendererProfile"]; /** @description Screens associated with the matched profile's navigation */
|
|
442
|
-
screens?: components["schemas"]["FluidOSScreen"][]; /** @description Themes associated with the matched profile */
|
|
443
|
-
themes?: components["schemas"]["FluidOSTheme"][];
|
|
444
|
-
}; /** FluidOS::Navigation */
|
|
445
|
-
FluidOSNavigationBasic: {
|
|
508
|
+
source?: "user" | "system" | "code";
|
|
509
|
+
children?: components["schemas"]["FluidOSNavigationItem"][];
|
|
510
|
+
}; /** FluidOS::Screen */
|
|
511
|
+
FluidOSScreenBasic: {
|
|
446
512
|
id: number;
|
|
447
513
|
name?: string | null;
|
|
448
|
-
|
|
449
|
-
|
|
514
|
+
slug?: string | null;
|
|
515
|
+
definition_id: number;
|
|
450
516
|
}; /** FluidOS::Screen */
|
|
451
517
|
FluidOSScreen: {
|
|
452
518
|
id: number;
|
|
453
519
|
name?: string | null;
|
|
454
520
|
slug?: string | null;
|
|
455
521
|
definition_id: number;
|
|
456
|
-
component_tree?:
|
|
522
|
+
component_tree?: components["schemas"]["FluidOSDynamicPayload"];
|
|
457
523
|
}; /** FluidOS::Theme */
|
|
458
524
|
FluidOSTheme: {
|
|
459
525
|
id: number;
|
|
460
|
-
config?:
|
|
526
|
+
config?: components["schemas"]["FluidOSDynamicPayload"];
|
|
461
527
|
active?: boolean | null;
|
|
462
528
|
name?: string | null;
|
|
463
529
|
definition_id: number;
|
|
464
|
-
}; /** FluidOS::
|
|
465
|
-
|
|
530
|
+
}; /** FluidOS::Navigation */
|
|
531
|
+
FluidOSNavigationBasic: {
|
|
466
532
|
id: number;
|
|
467
533
|
name?: string | null;
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
themes: components["schemas"]["FluidOSTheme"][];
|
|
473
|
-
}; /** FluidOS::Definition */
|
|
474
|
-
FluidOSDefinitionBasic: {
|
|
534
|
+
definition_id: number; /** @enum {string} */
|
|
535
|
+
platform: "web" | "mobile";
|
|
536
|
+
}; /** FluidOS::Navigation */
|
|
537
|
+
FluidOSNavigation: {
|
|
475
538
|
id: number;
|
|
476
539
|
name?: string | null;
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
active?: boolean;
|
|
483
|
-
};
|
|
484
|
-
};
|
|
485
|
-
FluidOSDefinitionUpdate: {
|
|
486
|
-
definition: {
|
|
487
|
-
name?: string;
|
|
488
|
-
active?: boolean;
|
|
489
|
-
};
|
|
490
|
-
}; /** FluidOS::Screen */
|
|
491
|
-
FluidOSScreenBasic: {
|
|
540
|
+
definition_id: number; /** @enum {string} */
|
|
541
|
+
platform: "web" | "mobile";
|
|
542
|
+
screens?: components["schemas"]["FluidOSScreen"][];
|
|
543
|
+
}; /** FluidOS::Navigation */
|
|
544
|
+
FluidOSNavigationWithItems: {
|
|
492
545
|
id: number;
|
|
493
546
|
name?: string | null;
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
FluidOSScreenCreate: {
|
|
498
|
-
screen: {
|
|
499
|
-
name: string;
|
|
500
|
-
slug: string;
|
|
501
|
-
component_tree?: null | Record<string, unknown>;
|
|
502
|
-
};
|
|
503
|
-
};
|
|
504
|
-
FluidOSScreenUpdate: {
|
|
505
|
-
screen?: unknown;
|
|
547
|
+
definition_id: number; /** @enum {string} */
|
|
548
|
+
platform: "web" | "mobile";
|
|
549
|
+
navigation_items?: components["schemas"]["FluidOSNavigationItem"][];
|
|
506
550
|
}; /** FluidOS::Profile */
|
|
507
551
|
FluidOSProfile: {
|
|
508
552
|
id: number;
|
|
509
553
|
name?: string | null;
|
|
510
554
|
default?: boolean | null;
|
|
511
|
-
permissions?: components["schemas"]["
|
|
555
|
+
permissions?: components["schemas"]["FluidOSDynamicPayload"];
|
|
512
556
|
definition_id: number;
|
|
513
|
-
navigation
|
|
514
|
-
mobile_navigation
|
|
515
|
-
themes
|
|
557
|
+
navigation?: components["schemas"]["FluidOSNavigationWithItems"] | null;
|
|
558
|
+
mobile_navigation?: components["schemas"]["FluidOSNavigationWithItems"];
|
|
559
|
+
themes?: components["schemas"]["FluidOSTheme"][];
|
|
516
560
|
}; /** FluidOS::Profile */
|
|
517
561
|
FluidOSProfileWithScreens: {
|
|
518
562
|
id: number;
|
|
519
563
|
name?: string | null;
|
|
520
564
|
default?: boolean | null;
|
|
521
|
-
permissions?: components["schemas"]["
|
|
565
|
+
permissions?: components["schemas"]["FluidOSDynamicPayload"];
|
|
522
566
|
definition_id: number;
|
|
523
|
-
navigation
|
|
524
|
-
mobile_navigation
|
|
525
|
-
themes
|
|
526
|
-
screens
|
|
527
|
-
|
|
528
|
-
|
|
529
|
-
};
|
|
530
|
-
FluidOSProfileCreate: {
|
|
531
|
-
profile: {
|
|
532
|
-
name: string;
|
|
533
|
-
default?: boolean; /** @description Mutually exclusive with navigation_attributes */
|
|
534
|
-
navigation_id?: number; /** @description Mutually exclusive with mobile_navigation_attributes */
|
|
535
|
-
mobile_navigation_id?: number; /** @description Mutually exclusive with navigation_id */
|
|
536
|
-
navigation_attributes?: {
|
|
537
|
-
name: string;
|
|
538
|
-
navigation_items_attributes?: {
|
|
539
|
-
screen_id?: number;
|
|
540
|
-
icon?: string;
|
|
541
|
-
label?: string;
|
|
542
|
-
position?: number;
|
|
543
|
-
parent_id?: number;
|
|
544
|
-
slug?: string; /** @enum {null|string} */
|
|
545
|
-
source?: "user" | "system" | "code" | null;
|
|
546
|
-
}[];
|
|
547
|
-
}; /** @description Mutually exclusive with mobile_navigation_id */
|
|
548
|
-
mobile_navigation_attributes?: {
|
|
549
|
-
name: string;
|
|
550
|
-
navigation_items_attributes?: {
|
|
551
|
-
screen_id?: number;
|
|
552
|
-
icon?: string;
|
|
553
|
-
label?: string;
|
|
554
|
-
position?: number;
|
|
555
|
-
parent_id?: number;
|
|
556
|
-
slug?: string; /** @enum {null|string} */
|
|
557
|
-
source?: "user" | "system" | "code" | null;
|
|
558
|
-
}[];
|
|
559
|
-
};
|
|
560
|
-
theme_ids?: number[];
|
|
561
|
-
permissions?: {
|
|
562
|
-
countries?: number[];
|
|
563
|
-
ranks?: number[];
|
|
564
|
-
roles?: string[];
|
|
565
|
-
platform?: string[];
|
|
566
|
-
};
|
|
567
|
-
};
|
|
568
|
-
};
|
|
569
|
-
FluidOSProfileUpdate: {
|
|
570
|
-
profile: {
|
|
571
|
-
name?: string;
|
|
572
|
-
default?: boolean;
|
|
573
|
-
navigation_id?: number;
|
|
574
|
-
mobile_navigation_id?: number;
|
|
575
|
-
theme_ids?: number[];
|
|
576
|
-
permissions?: {
|
|
577
|
-
countries?: number[];
|
|
578
|
-
ranks?: number[];
|
|
579
|
-
roles?: string[];
|
|
580
|
-
platform?: string[];
|
|
581
|
-
};
|
|
582
|
-
};
|
|
583
|
-
};
|
|
584
|
-
FluidOSThemeCreate: {
|
|
585
|
-
theme: {
|
|
586
|
-
name: string;
|
|
587
|
-
config: Record<string, unknown>;
|
|
588
|
-
active?: boolean;
|
|
589
|
-
};
|
|
590
|
-
};
|
|
591
|
-
FluidOSThemeUpdate: {
|
|
592
|
-
theme: {
|
|
593
|
-
name?: string;
|
|
594
|
-
active?: boolean;
|
|
595
|
-
config?: Record<string, unknown>;
|
|
596
|
-
};
|
|
597
|
-
}; /** FluidOS::Navigation */
|
|
598
|
-
FluidOSNavigation: {
|
|
567
|
+
navigation?: components["schemas"]["FluidOSNavigationWithItems"] | null;
|
|
568
|
+
mobile_navigation?: components["schemas"]["FluidOSNavigationWithItems"];
|
|
569
|
+
themes?: components["schemas"]["FluidOSTheme"][];
|
|
570
|
+
screens?: components["schemas"]["FluidOSScreen"][];
|
|
571
|
+
}; /** FluidOS::Definition */
|
|
572
|
+
FluidOSDefinitionBasic: {
|
|
599
573
|
id: number;
|
|
600
574
|
name?: string | null;
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
id: number;
|
|
605
|
-
name?: string | null;
|
|
606
|
-
slug?: string | null;
|
|
607
|
-
definition_id: number;
|
|
608
|
-
component_tree?: Record<string, unknown> | null;
|
|
609
|
-
}[];
|
|
610
|
-
}; /** FluidOS::Navigation */
|
|
611
|
-
FluidOSNavigationWithItems: {
|
|
575
|
+
active?: boolean | null;
|
|
576
|
+
}; /** FluidOS::Definition */
|
|
577
|
+
FluidOSDefinition: {
|
|
612
578
|
id: number;
|
|
613
579
|
name?: string | null;
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
navigation: {
|
|
620
|
-
name: string; /** @enum {string} */
|
|
621
|
-
platform: "web" | "mobile";
|
|
622
|
-
};
|
|
623
|
-
};
|
|
624
|
-
FluidOSNavigationUpdate: {
|
|
625
|
-
navigation: {
|
|
626
|
-
name?: string; /** @enum {string} */
|
|
627
|
-
platform?: "web" | "mobile";
|
|
628
|
-
};
|
|
629
|
-
};
|
|
630
|
-
FluidOSNavigationItemCreate: {
|
|
631
|
-
navigation_item: {
|
|
632
|
-
icon?: string;
|
|
633
|
-
label: string;
|
|
634
|
-
position: number;
|
|
635
|
-
parent_id?: null | number;
|
|
636
|
-
screen_id?: null | number;
|
|
637
|
-
slug?: null | string; /** @enum {null|string} */
|
|
638
|
-
source?: "user" | "system" | "code" | null;
|
|
639
|
-
};
|
|
640
|
-
};
|
|
641
|
-
FluidOSNavigationItemUpdate: {
|
|
642
|
-
navigation_item: {
|
|
643
|
-
icon?: string;
|
|
644
|
-
label?: string;
|
|
645
|
-
position?: number;
|
|
646
|
-
parent_id?: null | number;
|
|
647
|
-
screen_id?: null | number;
|
|
648
|
-
slug?: null | string; /** @enum {null|string} */
|
|
649
|
-
source?: "user" | "system" | "code" | null;
|
|
650
|
-
};
|
|
580
|
+
active?: boolean | null;
|
|
581
|
+
profiles?: components["schemas"]["FluidOSProfile"][];
|
|
582
|
+
screens?: components["schemas"]["FluidOSScreenBasic"][];
|
|
583
|
+
navigations?: components["schemas"]["FluidOSNavigationBasic"][];
|
|
584
|
+
themes?: components["schemas"]["FluidOSTheme"][];
|
|
651
585
|
}; /** FluidOS::Version */
|
|
652
586
|
FluidOSVersion: {
|
|
653
587
|
id: number;
|
|
654
588
|
active?: boolean | null;
|
|
655
|
-
manifest?:
|
|
589
|
+
manifest?: components["schemas"]["FluidOSDynamicPayload"]; /** Format: date-time */
|
|
656
590
|
published_at?: string | null;
|
|
657
591
|
definition_id: number;
|
|
658
|
-
};
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
|
|
592
|
+
}; /** @description Couples each widget package artifact path class with the only accepted contentType value. */
|
|
593
|
+
FluidOSWidgetPackageVersionArtifactContentTypeConstraint: {
|
|
594
|
+
/** @constant */path: "widget.js"; /** @constant */
|
|
595
|
+
contentType: "application/javascript";
|
|
596
|
+
} | {
|
|
597
|
+
/** @constant */path: "manifest.json"; /** @constant */
|
|
598
|
+
contentType: "application/json";
|
|
599
|
+
} | {
|
|
600
|
+
path: string; /** @constant */
|
|
601
|
+
contentType: "text/css";
|
|
602
|
+
} | {
|
|
603
|
+
path: string; /** @constant */
|
|
604
|
+
contentType: "application/json";
|
|
605
|
+
}; /** @description Couples each widget package artifact path class with the only accepted contentType/content_type alias values when supplied. */
|
|
606
|
+
FluidOSWidgetPackageVersionCompletionArtifactContentTypeConstraint: {
|
|
607
|
+
/** @constant */path: "widget.js"; /** @constant */
|
|
608
|
+
contentType?: "application/javascript"; /** @constant */
|
|
609
|
+
content_type?: "application/javascript";
|
|
610
|
+
} | {
|
|
611
|
+
/** @constant */path: "manifest.json"; /** @constant */
|
|
612
|
+
contentType?: "application/json"; /** @constant */
|
|
613
|
+
content_type?: "application/json";
|
|
614
|
+
} | {
|
|
615
|
+
path: string; /** @constant */
|
|
616
|
+
contentType?: "text/css"; /** @constant */
|
|
617
|
+
content_type?: "text/css";
|
|
618
|
+
} | {
|
|
619
|
+
path: string; /** @constant */
|
|
620
|
+
contentType?: "application/json"; /** @constant */
|
|
621
|
+
content_type?: "application/json";
|
|
622
|
+
}; /** @description Artifact metadata required before Fluid OS widget package upload URLs can be issued. Artifact paths must be unique within the request, and the artifact list must include widget.js and manifest.json before upload URLs are issued. Artifact paths are top-level package artifact filenames only; accepted names are widget.js, manifest.json, *.css, and *.js.map with no slash paths. Accepted content types are application/javascript for widget.js, application/json for manifest.json and *.js.map, and text/css for *.css. Byte sizes are non-negative and checked against configured per-artifact and bundle limits; defaults are 5 MiB per artifact and 10 MiB per bundle unless environment config changes them. */
|
|
623
|
+
FluidOSWidgetPackageVersionArtifactInput: {
|
|
624
|
+
/** @description Top-level package artifact filename. Accepted names are widget.js, manifest.json, *.css, or *.js.map; slash paths are not accepted. */path: string; /** @description Expected SHA256 checksum for the artifact content. */
|
|
625
|
+
sha256: string; /** @description Expected artifact size in bytes. Checked against configured per-artifact and bundle limits; defaults are 5 MiB per artifact and 10 MiB per bundle unless environment config changes them. */
|
|
626
|
+
bytes: number;
|
|
627
|
+
/**
|
|
628
|
+
* @description MIME content type used when uploading the artifact. Accepted values are application/javascript for widget.js, application/json for manifest.json and *.js.map, and text/css for *.css.
|
|
629
|
+
* @enum {string}
|
|
630
|
+
*/
|
|
631
|
+
contentType: "application/javascript" | "application/json" | "text/css";
|
|
632
|
+
} & components["schemas"]["FluidOSWidgetPackageVersionArtifactContentTypeConstraint"]; /** @description Request payload for starting a company-owned Fluid OS widget package version publish flow. Artifact paths must be unique top-level package artifact filenames. The artifacts list must include widget.js and manifest.json so the API can issue upload URLs and later verify the completed upload. */
|
|
633
|
+
FluidOSWidgetPackageVersionCreateRequest: {
|
|
634
|
+
/** @description Non-empty, object-path-safe company-owned widget package key. Use URL-safe characters only; . and .. are not accepted. */package_key: string; /** @description Non-empty, object-path-safe widget package version identifier accepted in the URL and upload path. Dotted versions such as 1.0.0 are accepted; only exact . or .. path segments and characters outside [A-Za-z0-9._~-] are rejected. */
|
|
635
|
+
version: string; /** @description Fluid OS builder version that produced this package. */
|
|
636
|
+
builder_version: string; /** @description Fluid OS CLI version that published this package. */
|
|
637
|
+
cli_version: string; /** @description Fluid OS runtime version targeted by this package. */
|
|
638
|
+
runtime_version: string; /** @description SHA256 checksum of the serialized manifest JSON. */
|
|
639
|
+
manifest_hash: string; /** @description Widget package manifest JSON. It must use the supported widget manifest structure, contain at least one extractable widget type, and every widget type in that structure must use the company-owned prefix `company.<package_key>.`. */
|
|
640
|
+
manifest: {
|
|
641
|
+
[key: string]: components["schemas"]["JsonValue"];
|
|
642
|
+
}; /** @description Top-level package artifacts to upload. The list must include widget.js and manifest.json. */
|
|
643
|
+
artifacts: components["schemas"]["FluidOSWidgetPackageVersionArtifactInput"][] & (unknown & unknown); /** @description Optional publisher metadata stored with the package version. */
|
|
644
|
+
build_metadata?: {
|
|
645
|
+
[key: string]: components["schemas"]["JsonValue"];
|
|
662
646
|
};
|
|
647
|
+
}; /** @description Upload instructions for a widget package artifact. */
|
|
648
|
+
FluidOSWidgetPackageVersionUpload: {
|
|
649
|
+
/** @description Top-level package artifact filename. */path: string; /** Format: uri */
|
|
650
|
+
upload_url: string; /** Format: uri */
|
|
651
|
+
public_url: string;
|
|
652
|
+
}; /** @description Upload session details for a pending Fluid OS widget package version. */
|
|
653
|
+
FluidOSWidgetPackageVersionCreateResponse: {
|
|
654
|
+
version_id: number; /** Format: uri */
|
|
655
|
+
artifact_base_url: string;
|
|
656
|
+
uploads: components["schemas"]["FluidOSWidgetPackageVersionUpload"][];
|
|
657
|
+
}; /** @description Optional artifact metadata supplied when completing a widget package upload. Artifact paths must be unique top-level package artifact filenames within the request; accepted names are widget.js, manifest.json, *.css, and *.js.map with no slash paths. Accepted content types are application/javascript for widget.js, application/json for manifest.json and *.js.map, and text/css for *.css. Byte sizes are non-negative and checked against configured per-artifact and bundle limits; defaults are 5 MiB per artifact and 10 MiB per bundle unless environment config changes them. sha256/checksum, bytes/size, and contentType/content_type are accepted aliases and must match when both aliases are present; supplied artifact metadata is compared with the stored upload-session/package version artifact metadata during verification. If artifacts are supplied, they must include exactly the stored upload-session artifact paths. Manifest verification is separate and happens against uploaded artifact content. */
|
|
658
|
+
FluidOSWidgetPackageVersionCompletionArtifactInput: {
|
|
659
|
+
/** @description Top-level package artifact filename. Accepted names are widget.js, manifest.json, *.css, or *.js.map; slash paths are not accepted. */path: string; /** @description Expected SHA256 checksum for the artifact content. */
|
|
660
|
+
sha256?: string; /** @description Alias for sha256. */
|
|
661
|
+
checksum?: string; /** @description Expected artifact size in bytes. Checked against configured per-artifact and bundle limits; defaults are 5 MiB per artifact and 10 MiB per bundle unless environment config changes them. */
|
|
662
|
+
bytes?: number; /** @description Alias for bytes; checked against the same configured per-artifact and bundle limits. */
|
|
663
|
+
size?: number;
|
|
664
|
+
/**
|
|
665
|
+
* @description MIME content type for the artifact. Accepted values are application/javascript for widget.js, application/json for manifest.json and *.js.map, and text/css for *.css.
|
|
666
|
+
* @enum {string}
|
|
667
|
+
*/
|
|
668
|
+
contentType?: "application/javascript" | "application/json" | "text/css";
|
|
669
|
+
/**
|
|
670
|
+
* @description Alias for contentType.
|
|
671
|
+
* @enum {string}
|
|
672
|
+
*/
|
|
673
|
+
content_type?: "application/javascript" | "application/json" | "text/css";
|
|
674
|
+
} & components["schemas"]["FluidOSWidgetPackageVersionCompletionArtifactContentTypeConstraint"]; /** @description Request payload for verifying uploaded company-owned Fluid OS widget package artifacts. The version path parameter, optional package_key, and any supplied artifact metadata must match the stored upload-session/package version artifact metadata before the package version is approved. If artifacts are supplied, they must include exactly the stored upload-session artifact paths. Uploaded manifest.json is verified for matching packageId, matching version, and valid company-owned `company.<package_key>.` widget type prefixes. */
|
|
675
|
+
FluidOSWidgetPackageVersionCompleteUploadRequest: {
|
|
676
|
+
/** @description Optional non-empty, object-path-safe widget package key. When omitted, the company's widget package is used; . and .. are not accepted. */package_key?: string | null; /** @description Optional artifact metadata to compare with the stored upload session. When supplied, the list must include exactly the stored upload-session artifact paths; omissions and extras are rejected. */
|
|
677
|
+
artifacts?: components["schemas"]["FluidOSWidgetPackageVersionCompletionArtifactInput"][];
|
|
678
|
+
}; /** @description Approved Fluid OS widget package version details. */
|
|
679
|
+
FluidOSWidgetPackageVersionCompleteUploadResponse: {
|
|
680
|
+
status: string;
|
|
681
|
+
packageId: string; /** @description Non-empty, object-path-safe widget package version identifier. Dotted versions such as 1.0.0 are accepted; only exact . or .. path segments and characters outside [A-Za-z0-9._~-] are rejected. */
|
|
682
|
+
version: string; /** Format: uri */
|
|
683
|
+
scriptUrl: string;
|
|
684
|
+
cssUrls: string[]; /** Format: uri */
|
|
685
|
+
manifestUrl: string;
|
|
686
|
+
}; /** @description Flat verification failure response returned when uploaded artifacts do not match the package manifest or expected metadata. */
|
|
687
|
+
FluidOSWidgetPackageVersionVerificationErrorResponse: {
|
|
688
|
+
/** @enum {string} */status: "error";
|
|
689
|
+
error_message: string;
|
|
690
|
+
details: {
|
|
691
|
+
[key: string]: components["schemas"]["JsonValue"];
|
|
692
|
+
};
|
|
693
|
+
}; /** @description Dynamic Fluid OS JSON payload whose keys are defined by the app builder configuration. */
|
|
694
|
+
FluidOSDynamicPayload: {
|
|
695
|
+
[key: string]: components["schemas"]["JsonValue"];
|
|
696
|
+
} | null;
|
|
697
|
+
FluidOSWidgetPackageCatalogEntry: {
|
|
698
|
+
/**
|
|
699
|
+
* @description Package ownership source for the shared widget loading path.
|
|
700
|
+
* @enum {string}
|
|
701
|
+
*/
|
|
702
|
+
source: "company" | "droplet";
|
|
703
|
+
/**
|
|
704
|
+
* @description Runtime package identifier prefixed by source.
|
|
705
|
+
* @example company.portal-home
|
|
706
|
+
* @example droplet.reviews
|
|
707
|
+
*/
|
|
708
|
+
packageId: string; /** @description Approved package version currently active for this owner. */
|
|
709
|
+
version: string; /** @description Public module script URL for the package runtime artifact. */
|
|
710
|
+
scriptUrl: string | null; /** @description Public stylesheet URLs for the package runtime artifacts. */
|
|
711
|
+
cssUrls: string[]; /** @description Public URL for the package manifest artifact. */
|
|
712
|
+
manifestUrl: string | null; /** @description Approved package manifest JSON used by the runtime loader. */
|
|
713
|
+
manifest: {
|
|
714
|
+
[key: string]: components["schemas"]["JsonValue"];
|
|
715
|
+
};
|
|
716
|
+
};
|
|
717
|
+
FluidOSWidgetPackageCatalogResponse: {
|
|
718
|
+
packages: components["schemas"]["FluidOSWidgetPackageCatalogEntry"][];
|
|
719
|
+
};
|
|
720
|
+
FluidOSWidgetPackageDropletForbiddenResponse: {
|
|
721
|
+
error: {
|
|
722
|
+
message: string;
|
|
723
|
+
details?: {
|
|
724
|
+
[key: string]: components["schemas"]["JsonValue"];
|
|
725
|
+
};
|
|
726
|
+
}; /** @enum {integer} */
|
|
727
|
+
status: 403;
|
|
728
|
+
meta?: components["schemas"]["Meta"];
|
|
729
|
+
};
|
|
730
|
+
FluidOSWidgetPackageRoleForbiddenResponse: {
|
|
731
|
+
message: string;
|
|
663
732
|
};
|
|
733
|
+
FluidOSWidgetPackagePermissionForbiddenResponse: {
|
|
734
|
+
error: string;
|
|
735
|
+
};
|
|
736
|
+
FluidOSWidgetPackageForbiddenResponse: components["schemas"]["FluidOSWidgetPackageDropletForbiddenResponse"] | components["schemas"]["FluidOSWidgetPackageRoleForbiddenResponse"] | components["schemas"]["FluidOSWidgetPackagePermissionForbiddenResponse"];
|
|
664
737
|
};
|
|
665
738
|
responses: never;
|
|
666
739
|
parameters: never;
|
|
@@ -802,8 +875,288 @@ declare function categorizeChanges(diff: SnapshotDiff): CategorizedChanges;
|
|
|
802
875
|
*/
|
|
803
876
|
declare function validateCrossReferences(portalDir: string, mappings: PortalMappings, changes: CategorizedChanges): Promise<ValidationError[]>;
|
|
804
877
|
//#endregion
|
|
878
|
+
//#region src/utils/widget-package-validation.d.ts
|
|
879
|
+
type WidgetPackageOwnerKind = "company" | "droplet";
|
|
880
|
+
type WidgetRuntimeContainer = "inline" | "block" | "card" | "fullscreen";
|
|
881
|
+
type WidgetRuntimeResizable = boolean | "horizontal" | "vertical" | "both";
|
|
882
|
+
interface SourceWidgetMetadata {
|
|
883
|
+
readonly name: string;
|
|
884
|
+
readonly displayName?: string;
|
|
885
|
+
readonly description?: string;
|
|
886
|
+
readonly icon?: string;
|
|
887
|
+
readonly category?: string;
|
|
888
|
+
readonly propertySchema?: Record<string, unknown>;
|
|
889
|
+
readonly defaultProps?: Record<string, unknown>;
|
|
890
|
+
readonly container?: unknown;
|
|
891
|
+
readonly minSdkVersion?: string;
|
|
892
|
+
readonly resizable?: unknown;
|
|
893
|
+
}
|
|
894
|
+
interface SourceWidgetPackageMetadata {
|
|
895
|
+
readonly manifestVersion?: number;
|
|
896
|
+
readonly scope?: string;
|
|
897
|
+
readonly packageStableId?: string;
|
|
898
|
+
readonly packageId: string;
|
|
899
|
+
readonly packageType?: string;
|
|
900
|
+
readonly version: string;
|
|
901
|
+
readonly widgets: readonly SourceWidgetMetadata[];
|
|
902
|
+
readonly cssUrls?: readonly string[];
|
|
903
|
+
}
|
|
904
|
+
interface WidgetDescriptorMetadata {
|
|
905
|
+
readonly type: string;
|
|
906
|
+
readonly name: string;
|
|
907
|
+
readonly displayName: string;
|
|
908
|
+
readonly description: string;
|
|
909
|
+
readonly icon: string;
|
|
910
|
+
readonly category: string;
|
|
911
|
+
readonly propertySchema: Record<string, unknown>;
|
|
912
|
+
readonly defaultProps: Record<string, unknown>;
|
|
913
|
+
readonly container: WidgetRuntimeContainer;
|
|
914
|
+
readonly minSdkVersion: string;
|
|
915
|
+
readonly resizable: WidgetRuntimeResizable;
|
|
916
|
+
}
|
|
917
|
+
interface WidgetPackageDescriptorMetadata {
|
|
918
|
+
readonly manifestVersion: 1;
|
|
919
|
+
readonly packageId: string;
|
|
920
|
+
readonly packageType: WidgetPackageOwnerKind;
|
|
921
|
+
readonly version: string;
|
|
922
|
+
readonly remoteEntryUrl: string;
|
|
923
|
+
readonly cssUrls: readonly string[];
|
|
924
|
+
readonly widgets: readonly WidgetDescriptorMetadata[];
|
|
925
|
+
}
|
|
926
|
+
interface ValidatedWidgetPackageBuild {
|
|
927
|
+
readonly sourcePackage: SourceWidgetPackageMetadata;
|
|
928
|
+
readonly packageKey: string;
|
|
929
|
+
readonly packageId: string;
|
|
930
|
+
readonly owner: WidgetPackageOwnerKind;
|
|
931
|
+
readonly version: string;
|
|
932
|
+
readonly widgets: readonly WidgetDescriptorMetadata[];
|
|
933
|
+
}
|
|
934
|
+
type WidgetPackageValidationErrorCode = "NO_SOURCE_PACKAGE" | "MULTIPLE_SOURCE_PACKAGES" | "INVALID_SOURCE_PACKAGE" | "INVALID_WIDGET_METADATA" | "UNSUPPORTED_OWNER" | "INVALID_PACKAGE_KEY" | "INVALID_VERSION" | "NO_WIDGETS" | "INVALID_WIDGET_NAME" | "INVALID_WIDGET_TYPE" | "DUPLICATE_WIDGET";
|
|
935
|
+
interface WidgetPackageValidationError {
|
|
936
|
+
readonly code: WidgetPackageValidationErrorCode;
|
|
937
|
+
readonly message: string;
|
|
938
|
+
readonly path?: string;
|
|
939
|
+
}
|
|
940
|
+
interface WidgetPackageValidationResult {
|
|
941
|
+
readonly success: boolean;
|
|
942
|
+
readonly value?: ValidatedWidgetPackageBuild;
|
|
943
|
+
readonly errors: readonly WidgetPackageValidationError[];
|
|
944
|
+
}
|
|
945
|
+
interface ValidateSourceWidgetPackageOptions {
|
|
946
|
+
readonly owner?: WidgetPackageOwnerKind;
|
|
947
|
+
}
|
|
948
|
+
declare function validateSingleSourceWidgetPackage(sourcePackages: readonly unknown[], options?: ValidateSourceWidgetPackageOptions): WidgetPackageValidationResult;
|
|
949
|
+
declare function buildWidgetPackageDescriptor(validated: ValidatedWidgetPackageBuild, options?: {
|
|
950
|
+
readonly remoteEntryUrl?: string;
|
|
951
|
+
readonly cssUrls?: readonly string[];
|
|
952
|
+
}): WidgetPackageDescriptorMetadata;
|
|
953
|
+
//#endregion
|
|
954
|
+
//#region src/utils/widget-package-builder.d.ts
|
|
955
|
+
interface BuildSharedWidgetPackageOptions {
|
|
956
|
+
readonly projectDir: string;
|
|
957
|
+
readonly publishDir?: string;
|
|
958
|
+
readonly owner?: WidgetPackageOwnerKind;
|
|
959
|
+
}
|
|
960
|
+
interface SharedWidgetPackageBuildResult {
|
|
961
|
+
readonly publishDir: string;
|
|
962
|
+
readonly packageId: string;
|
|
963
|
+
readonly version: string;
|
|
964
|
+
readonly manifestPath: string;
|
|
965
|
+
readonly publishManifestPath: string;
|
|
966
|
+
readonly widgetScriptPath: string;
|
|
967
|
+
}
|
|
968
|
+
interface SharedWidgetPackageBuildError {
|
|
969
|
+
readonly code: "CONFIG_LOAD_FAILED" | "VALIDATION_FAILED" | "INVALID_PUBLISH_DIR" | "WRITE_FAILED";
|
|
970
|
+
readonly message: string;
|
|
971
|
+
readonly details?: string;
|
|
972
|
+
}
|
|
973
|
+
declare function buildSharedWidgetPackage(options: BuildSharedWidgetPackageOptions): Promise<Result<SharedWidgetPackageBuildResult, SharedWidgetPackageBuildError>>;
|
|
974
|
+
declare function createWidgetPackageEntrySource(options: {
|
|
975
|
+
readonly configImportPath: string;
|
|
976
|
+
readonly validated: ValidatedWidgetPackageBuild;
|
|
977
|
+
}): string;
|
|
978
|
+
//#endregion
|
|
979
|
+
//#region src/utils/widget-package-config.d.ts
|
|
980
|
+
interface WidgetSourceConfig {
|
|
981
|
+
readonly path: string;
|
|
982
|
+
readonly relativePath: string;
|
|
983
|
+
}
|
|
984
|
+
interface WidgetSourceConfigLoadError {
|
|
985
|
+
readonly code: "CONFIG_LOAD_FAILED" | "INVALID_FORMAT";
|
|
986
|
+
readonly message: string;
|
|
987
|
+
readonly details?: string;
|
|
988
|
+
}
|
|
989
|
+
declare function resolvePortalWidgetSourceConfig(projectDir: string): Promise<WidgetSourceConfig | undefined>;
|
|
990
|
+
declare function loadSourceWidgetPackages(projectDir: string): Promise<Result<unknown[], WidgetSourceConfigLoadError>>;
|
|
991
|
+
//#endregion
|
|
992
|
+
//#region src/utils/widget-package-artifacts.d.ts
|
|
993
|
+
declare const WIDGET_PACKAGE_BUILDER_VERSION = "1";
|
|
994
|
+
interface ArtifactMetadata {
|
|
995
|
+
readonly path: string;
|
|
996
|
+
readonly sha256: string;
|
|
997
|
+
readonly bytes: number;
|
|
998
|
+
readonly contentType: string;
|
|
999
|
+
}
|
|
1000
|
+
interface PublishManifestMetadata {
|
|
1001
|
+
readonly packageId: string;
|
|
1002
|
+
readonly version: string;
|
|
1003
|
+
readonly builderVersion: string;
|
|
1004
|
+
readonly cliVersion: string;
|
|
1005
|
+
readonly runtimeVersion: string;
|
|
1006
|
+
readonly manifestHash: string;
|
|
1007
|
+
readonly artifacts: readonly ArtifactMetadata[];
|
|
1008
|
+
}
|
|
1009
|
+
declare function computeArtifactMetadata(filePath: string, baseDir: string): Promise<ArtifactMetadata>;
|
|
1010
|
+
declare function collectWidgetPackageArtifacts(publishDir: string): Promise<ArtifactMetadata[]>;
|
|
1011
|
+
declare function createPublishManifestMetadata(options: {
|
|
1012
|
+
readonly packageId: string;
|
|
1013
|
+
readonly version: string;
|
|
1014
|
+
readonly cliVersion: string;
|
|
1015
|
+
readonly runtimeVersion: string;
|
|
1016
|
+
readonly manifestContent: string | Buffer;
|
|
1017
|
+
readonly artifacts: readonly ArtifactMetadata[];
|
|
1018
|
+
readonly builderVersion?: string;
|
|
1019
|
+
}): PublishManifestMetadata;
|
|
1020
|
+
declare function getArtifactContentType(filePath: string): string;
|
|
1021
|
+
declare function sha256(content: string | Buffer): string;
|
|
1022
|
+
//#endregion
|
|
1023
|
+
//#region src/utils/widget-package-upload.d.ts
|
|
1024
|
+
type WidgetPackageUploadOwner = {
|
|
1025
|
+
readonly kind: "droplet";
|
|
1026
|
+
readonly uuid: string;
|
|
1027
|
+
} | {
|
|
1028
|
+
readonly kind: "company";
|
|
1029
|
+
};
|
|
1030
|
+
type WidgetPackageArtifactMetadata = ArtifactMetadata;
|
|
1031
|
+
interface WidgetPackageUploadArtifact extends WidgetPackageArtifactMetadata {
|
|
1032
|
+
readonly body: BodyInit;
|
|
1033
|
+
}
|
|
1034
|
+
interface WidgetPackageSessionRequest {
|
|
1035
|
+
readonly version: string;
|
|
1036
|
+
readonly packageKey: string;
|
|
1037
|
+
readonly builderVersion: string;
|
|
1038
|
+
readonly cliVersion: string;
|
|
1039
|
+
readonly runtimeVersion: string;
|
|
1040
|
+
readonly manifestHash: string;
|
|
1041
|
+
readonly manifest: Record<string, unknown>;
|
|
1042
|
+
readonly artifacts: readonly WidgetPackageArtifactMetadata[];
|
|
1043
|
+
}
|
|
1044
|
+
interface WidgetPackagePublishRequest extends Omit<WidgetPackageSessionRequest, "artifacts"> {
|
|
1045
|
+
readonly artifacts: readonly WidgetPackageUploadArtifact[];
|
|
1046
|
+
}
|
|
1047
|
+
type WidgetPackageArtifactPayload = ArtifactMetadata;
|
|
1048
|
+
interface WidgetPackageUploadSessionPayload {
|
|
1049
|
+
readonly version: string;
|
|
1050
|
+
readonly package_key: string;
|
|
1051
|
+
readonly builder_version: string;
|
|
1052
|
+
readonly cli_version: string;
|
|
1053
|
+
readonly runtime_version: string;
|
|
1054
|
+
readonly manifest_hash: string;
|
|
1055
|
+
readonly manifest: Record<string, unknown>;
|
|
1056
|
+
readonly artifacts: readonly WidgetPackageArtifactPayload[];
|
|
1057
|
+
}
|
|
1058
|
+
interface WidgetPackageCompleteUploadPayload {
|
|
1059
|
+
readonly package_key: string;
|
|
1060
|
+
readonly artifacts: readonly WidgetPackageArtifactPayload[];
|
|
1061
|
+
}
|
|
1062
|
+
interface WidgetPackageSignedUpload {
|
|
1063
|
+
readonly path: string;
|
|
1064
|
+
readonly url: string;
|
|
1065
|
+
readonly contentType: string;
|
|
1066
|
+
readonly headers: Readonly<Record<string, string>>;
|
|
1067
|
+
}
|
|
1068
|
+
interface WidgetPackageUploadSession {
|
|
1069
|
+
readonly version: string;
|
|
1070
|
+
readonly uploads: readonly WidgetPackageSignedUpload[];
|
|
1071
|
+
readonly raw: unknown;
|
|
1072
|
+
}
|
|
1073
|
+
interface WidgetPackageArtifactUploadResult {
|
|
1074
|
+
readonly path: string;
|
|
1075
|
+
readonly status: number;
|
|
1076
|
+
readonly contentType: string;
|
|
1077
|
+
}
|
|
1078
|
+
interface WidgetPackageCompleteResult {
|
|
1079
|
+
readonly version: string;
|
|
1080
|
+
readonly status?: string;
|
|
1081
|
+
readonly packageKey?: string;
|
|
1082
|
+
readonly raw: unknown;
|
|
1083
|
+
}
|
|
1084
|
+
interface WidgetPackagePublishResult {
|
|
1085
|
+
readonly dryRun: boolean;
|
|
1086
|
+
readonly sessionPayload: WidgetPackageUploadSessionPayload;
|
|
1087
|
+
readonly session?: WidgetPackageUploadSession;
|
|
1088
|
+
readonly uploadedArtifacts?: readonly WidgetPackageArtifactUploadResult[];
|
|
1089
|
+
readonly complete?: WidgetPackageCompleteResult;
|
|
1090
|
+
}
|
|
1091
|
+
interface BasePublishWidgetPackageVersionOptions {
|
|
1092
|
+
readonly owner: WidgetPackageUploadOwner;
|
|
1093
|
+
readonly request: WidgetPackagePublishRequest;
|
|
1094
|
+
readonly fetchImpl?: WidgetPackageUploadFetch;
|
|
1095
|
+
}
|
|
1096
|
+
interface DryRunPublishWidgetPackageVersionOptions extends BasePublishWidgetPackageVersionOptions {
|
|
1097
|
+
readonly client?: FetchClient;
|
|
1098
|
+
readonly dryRun: true;
|
|
1099
|
+
}
|
|
1100
|
+
interface PublishWidgetPackageVersionUploadOptions extends BasePublishWidgetPackageVersionOptions {
|
|
1101
|
+
readonly client: FetchClient;
|
|
1102
|
+
readonly dryRun?: boolean;
|
|
1103
|
+
}
|
|
1104
|
+
type PublishWidgetPackageVersionOptions = DryRunPublishWidgetPackageVersionOptions | PublishWidgetPackageVersionUploadOptions;
|
|
1105
|
+
type WidgetPackageUploadFetch = (input: string | URL, init: RequestInit) => Promise<Response>;
|
|
1106
|
+
declare class WidgetPackageUploadError extends Error {
|
|
1107
|
+
readonly code: string;
|
|
1108
|
+
constructor(code: string, message: string);
|
|
1109
|
+
}
|
|
1110
|
+
declare function buildWidgetPackageUploadSessionPayload(request: WidgetPackageSessionRequest): WidgetPackageUploadSessionPayload;
|
|
1111
|
+
declare function buildWidgetPackageCompleteUploadPayload(packageKey: string, artifacts: readonly WidgetPackageArtifactMetadata[]): WidgetPackageCompleteUploadPayload;
|
|
1112
|
+
declare function getWidgetPackageUploadSessionRoute(owner: WidgetPackageUploadOwner): string;
|
|
1113
|
+
declare function getWidgetPackageCompleteUploadRoute(owner: WidgetPackageUploadOwner, version: string): string;
|
|
1114
|
+
declare function requestWidgetPackageUploadSession(client: FetchClient, owner: WidgetPackageUploadOwner, request: WidgetPackageSessionRequest): Promise<WidgetPackageUploadSession>;
|
|
1115
|
+
declare function uploadWidgetPackageArtifacts(session: WidgetPackageUploadSession, artifacts: readonly WidgetPackageUploadArtifact[], fetchImpl?: WidgetPackageUploadFetch): Promise<WidgetPackageArtifactUploadResult[]>;
|
|
1116
|
+
declare function completeWidgetPackageUpload(client: FetchClient, owner: WidgetPackageUploadOwner, version: string, packageKey: string, artifacts: readonly WidgetPackageArtifactMetadata[]): Promise<WidgetPackageCompleteResult>;
|
|
1117
|
+
declare function publishWidgetPackageVersion(options: PublishWidgetPackageVersionOptions): Promise<WidgetPackagePublishResult>;
|
|
1118
|
+
declare function normalizeWidgetPackageUploadSession(response: unknown, requestedVersion: string, requestedArtifacts: readonly WidgetPackageArtifactMetadata[]): WidgetPackageUploadSession;
|
|
1119
|
+
declare function normalizeWidgetPackageCompleteResponse(response: unknown, requestedVersion: string): WidgetPackageCompleteResult;
|
|
1120
|
+
//#endregion
|
|
1121
|
+
//#region src/commands/widget-package-publish.d.ts
|
|
1122
|
+
interface PublishWidgetRuntimeArtifactsOptions {
|
|
1123
|
+
readonly projectDir: string;
|
|
1124
|
+
readonly outDir: string;
|
|
1125
|
+
readonly buildOwner: WidgetPackageOwnerKind;
|
|
1126
|
+
readonly uploadOwner: WidgetPackageUploadOwner;
|
|
1127
|
+
readonly dryRun?: boolean;
|
|
1128
|
+
readonly client?: FetchClient;
|
|
1129
|
+
}
|
|
1130
|
+
interface PublishWidgetRuntimeArtifactsResult {
|
|
1131
|
+
readonly build: SharedWidgetPackageBuildResult;
|
|
1132
|
+
readonly request: WidgetPackagePublishRequest;
|
|
1133
|
+
readonly publish: WidgetPackagePublishResult;
|
|
1134
|
+
}
|
|
1135
|
+
interface PublishWidgetRuntimeArtifactsDependencies {
|
|
1136
|
+
readonly buildSharedWidgetPackage?: typeof buildSharedWidgetPackage;
|
|
1137
|
+
readonly publishWidgetPackageVersion?: typeof publishWidgetPackageVersion;
|
|
1138
|
+
}
|
|
1139
|
+
declare function publishWidgetRuntimeArtifacts(options: PublishWidgetRuntimeArtifactsOptions, dependencies?: PublishWidgetRuntimeArtifactsDependencies): Promise<PublishWidgetRuntimeArtifactsResult>;
|
|
1140
|
+
declare function createWidgetPackagePublishRequest(options: {
|
|
1141
|
+
readonly publishDir: string;
|
|
1142
|
+
readonly manifestPath: string;
|
|
1143
|
+
readonly publishManifestPath: string;
|
|
1144
|
+
readonly owner: WidgetPackageOwnerKind;
|
|
1145
|
+
}): Promise<WidgetPackagePublishRequest>;
|
|
1146
|
+
declare function createAuthenticatedWidgetPackageClient(): FetchClient;
|
|
1147
|
+
declare function printWidgetPublishSummary(options: {
|
|
1148
|
+
readonly title: string;
|
|
1149
|
+
readonly ownerLabel: string;
|
|
1150
|
+
readonly environment?: string;
|
|
1151
|
+
readonly outDir: string;
|
|
1152
|
+
readonly result: PublishWidgetRuntimeArtifactsResult;
|
|
1153
|
+
}): void;
|
|
1154
|
+
declare function printRuntimeOnlyNotice(): void;
|
|
1155
|
+
declare function printDryRunSessionPayload(result: PublishWidgetRuntimeArtifactsResult): void;
|
|
1156
|
+
declare function validateWidgetPublishOutDir(projectDir: string, outDir: string): string;
|
|
1157
|
+
//#endregion
|
|
805
1158
|
//#region src/index.d.ts
|
|
806
1159
|
declare const plugin: FluidPlugin;
|
|
807
1160
|
//#endregion
|
|
808
|
-
export { type BuildOptions, type CategorizedChanges, type CreateOptions, type DefinitionMapping, type DevOptions, FILE_SYSTEM_ERRORS, type FileHash, type FileHashMap, type FileSystemError, type FileSystemErrorCode, type LocalNavigation, type LocalNavigationItem, type LocalProfile, type LocalScreen, type LocalTheme, type MappedResourceType, type PortalMappings, type ProjectConfig, type SelectedPageTemplate, type Snapshot, type SnapshotDiff, TEMPLATES, type TemplateName, type TemplatePaths, type TemplateVariables, type ValidationError, type WidgetCreateOptions, buildIdToSlugMap, buildNavigationIdToSlugMap, buildSnapshot, buildThemeIdToSlugMap, categorizeChanges, computeFileHash, copyTemplate, copyTemplateSafe, createCommand, createDirectory, createDirectorySafe, plugin as default, deriveScreenSlug, deriveSlug, diffAgainstSnapshot, directoryExists, doctorCommand, fileExists,
|
|
1161
|
+
export { type ArtifactMetadata, type BuildOptions, type BuildSharedWidgetPackageOptions, type CategorizedChanges, type CreateOptions, type DefinitionMapping, type DevOptions, FILE_SYSTEM_ERRORS, type FileHash, type FileHashMap, type FileSystemError, type FileSystemErrorCode, type LocalNavigation, type LocalNavigationItem, type LocalProfile, type LocalScreen, type LocalTheme, type MappedResourceType, type PortalDeployOptions, type PortalMappings, type ProjectConfig, type PublishManifestMetadata, type PublishWidgetPackageVersionOptions, type PublishWidgetRuntimeArtifactsDependencies, type PublishWidgetRuntimeArtifactsOptions, type PublishWidgetRuntimeArtifactsResult, type SelectedPageTemplate, type SharedWidgetPackageBuildError, type SharedWidgetPackageBuildResult, type Snapshot, type SnapshotDiff, type SourceWidgetMetadata, type SourceWidgetPackageMetadata, TEMPLATES, type TemplateName, type TemplatePaths, type TemplateVariables, type ValidateSourceWidgetPackageOptions, type ValidatedWidgetPackageBuild, type ValidationError, WIDGET_PACKAGE_BUILDER_VERSION, type WidgetCreateOptions, type WidgetDescriptorMetadata, type WidgetPackageArtifactMetadata, type WidgetPackageArtifactPayload, type WidgetPackageArtifactUploadResult, type WidgetPackageCompleteResult, type WidgetPackageCompleteUploadPayload, type WidgetPackageDescriptorMetadata, type WidgetPackageOwnerKind, type WidgetPackagePublishRequest, type WidgetPackagePublishResult, type WidgetPackageSessionRequest, type WidgetPackageSignedUpload, type WidgetPackageUploadArtifact, WidgetPackageUploadError, type WidgetPackageUploadFetch, type WidgetPackageUploadOwner, type WidgetPackageUploadSession, type WidgetPackageUploadSessionPayload, type WidgetPackageValidationError, type WidgetPackageValidationErrorCode, type WidgetPackageValidationResult, type WidgetPublishOptions, type WidgetSourceConfig, type WidgetSourceConfigLoadError, buildIdToSlugMap, buildNavigationIdToSlugMap, buildSharedWidgetPackage, buildSnapshot, buildThemeIdToSlugMap, buildWidgetPackageCompleteUploadPayload, buildWidgetPackageDescriptor, buildWidgetPackageUploadSessionPayload, categorizeChanges, collectWidgetPackageArtifacts, completeWidgetPackageUpload, computeArtifactMetadata, computeFileHash, copyTemplate, copyTemplateSafe, createAuthenticatedWidgetPackageClient, createCommand, createDirectory, createDirectorySafe, createPublishManifestMetadata, createWidgetPackageEntrySource, createWidgetPackagePublishRequest, plugin as default, deployCommand, deriveScreenSlug, deriveSlug, diffAgainstSnapshot, directoryExists, doctorCommand, fileExists, getArtifactContentType, getInstallCommand, getRunCommand, getSdkVersion, getSdkVersionSafe, getTemplatePaths, getWidgetPackageCompleteUploadRoute, getWidgetPackageUploadSessionRoute, installDependencies, loadSourceWidgetPackages, normalizeWidgetPackageCompleteResponse, normalizeWidgetPackageUploadSession, pathExists, printDryRunSessionPayload, printRuntimeOnlyNotice, printWidgetPublishSummary, promptProjectConfig, publishWidgetPackageVersion, publishWidgetRuntimeArtifacts, pullCommand, pushCommand, readFileSafe, readMappings, readSnapshot, removeMapping, requestWidgetPackageUploadSession, resolveIdToSlug, resolvePortalWidgetSourceConfig, resolveSlugToId, runPackageManager, sha256, slugFromPath, topLevelWidgetCommand, transformNavigation, transformNavigationItems, transformProfile, transformScreen, transformTheme, updateMapping, uploadWidgetPackageArtifacts, validateCrossReferences, validateSingleSourceWidgetPackage, validateWidgetPublishOutDir, versionCommand, widgetCommand, writeFileSafe, writeMappings, writeSnapshot };
|
|
809
1162
|
//# sourceMappingURL=index.d.mts.map
|