@supernova-studio/client 0.48.12 → 0.48.14

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -115,13 +115,14 @@ var _zod = require('zod');
115
115
 
116
116
 
117
117
 
118
+ var _slugify = require('@sindresorhus/slugify'); var _slugify2 = _interopRequireDefault(_slugify);
118
119
 
119
120
 
120
121
 
121
122
 
122
123
 
123
- var _ipcidr = require('ip-cidr'); var _ipcidr2 = _interopRequireDefault(_ipcidr);
124
124
 
125
+ var _ipcidr = require('ip-cidr'); var _ipcidr2 = _interopRequireDefault(_ipcidr);
125
126
 
126
127
 
127
128
 
@@ -149,7 +150,6 @@ var _ipcidr = require('ip-cidr'); var _ipcidr2 = _interopRequireDefault(_ipcidr)
149
150
 
150
151
 
151
152
 
152
- var _slugify = require('@sindresorhus/slugify'); var _slugify2 = _interopRequireDefault(_slugify);
153
153
 
154
154
 
155
155
 
@@ -2475,689 +2475,118 @@ var DocumentationCommentThread = _zod.z.object({
2475
2475
  createdAt: _zod.z.coerce.date(),
2476
2476
  updatedAt: _zod.z.coerce.date()
2477
2477
  });
2478
- var DesignElementSnapshotReason = _zod.z.enum(["Publish", "Deletion"]);
2479
- var DesignElementSnapshotBase = _zod.z.object({
2480
- id: _zod.z.string(),
2481
- persistentId: _zod.z.string(),
2482
- designSystemVersionId: _zod.z.string(),
2483
- createdAt: _zod.z.coerce.date(),
2484
- updatedAt: _zod.z.coerce.date(),
2485
- reason: DesignElementSnapshotReason
2486
- });
2487
- var DocumentationPageSnapshot = DesignElementSnapshotBase.extend({
2488
- page: DocumentationPageV2,
2489
- pageContentHash: _zod.z.string(),
2490
- pageContentStorageKey: _zod.z.string()
2491
- });
2492
- var ElementGroupSnapshot = DesignElementSnapshotBase.extend({
2493
- group: ElementGroup
2494
- });
2495
- var ElementViewBaseColumnType = _zod.z.enum(["Name", "Description", "Value", "UpdatedAt"]);
2496
- var ElementViewColumnType = _zod.z.union([
2497
- _zod.z.literal("BaseProperty"),
2498
- _zod.z.literal("PropertyDefinition"),
2499
- _zod.z.literal("Theme")
2500
- ]);
2501
- var ElementViewColumnSharedAttributes = _zod.z.object({
2502
- id: _zod.z.string(),
2503
- persistentId: _zod.z.string(),
2504
- elementDataViewId: _zod.z.string(),
2505
- sortPosition: _zod.z.number(),
2506
- width: _zod.z.number()
2507
- });
2508
- var ElementViewBasePropertyColumn = ElementViewColumnSharedAttributes.extend({
2509
- type: _zod.z.literal("BaseProperty"),
2510
- basePropertyType: ElementViewBaseColumnType
2511
- });
2512
- var ElementViewPropertyDefinitionColumn = ElementViewColumnSharedAttributes.extend({
2513
- type: _zod.z.literal("PropertyDefinition"),
2514
- propertyDefinitionId: _zod.z.string()
2515
- });
2516
- var ElementViewThemeColumn = ElementViewColumnSharedAttributes.extend({
2517
- type: _zod.z.literal("Theme"),
2518
- themeId: _zod.z.string()
2519
- });
2520
- var ElementViewColumn = _zod.z.discriminatedUnion("type", [
2521
- ElementViewBasePropertyColumn,
2522
- ElementViewPropertyDefinitionColumn,
2523
- ElementViewThemeColumn
2524
- ]);
2525
- var ElementView = _zod.z.object({
2526
- id: _zod.z.string(),
2527
- persistentId: _zod.z.string(),
2528
- designSystemVersionId: _zod.z.string(),
2529
- name: _zod.z.string(),
2530
- description: _zod.z.string(),
2531
- targetElementType: ElementPropertyTargetType,
2532
- isDefault: _zod.z.boolean()
2533
- });
2534
- var Brand = _zod.z.object({
2535
- id: _zod.z.string(),
2536
- designSystemVersionId: _zod.z.string(),
2537
- persistentId: _zod.z.string(),
2538
- name: _zod.z.string(),
2539
- description: _zod.z.string()
2540
- });
2541
- var NpmRegistryAuthType = _zod.z.enum(["Basic", "Bearer", "None", "Custom"]);
2542
- var NpmRegistryType = _zod.z.enum(["NPMJS", "GitHub", "AzureDevOps", "Artifactory", "Custom"]);
2543
- var NpmRegistryBasicAuthConfig = _zod.z.object({
2544
- authType: _zod.z.literal(NpmRegistryAuthType.Enum.Basic),
2545
- username: _zod.z.string(),
2546
- password: _zod.z.string()
2547
- });
2548
- var NpmRegistryBearerAuthConfig = _zod.z.object({
2549
- authType: _zod.z.literal(NpmRegistryAuthType.Enum.Bearer),
2550
- accessToken: _zod.z.string()
2551
- });
2552
- var NpmRegistryNoAuthConfig = _zod.z.object({
2553
- authType: _zod.z.literal(NpmRegistryAuthType.Enum.None)
2554
- });
2555
- var NpmRegistrCustomAuthConfig = _zod.z.object({
2556
- authType: _zod.z.literal(NpmRegistryAuthType.Enum.Custom),
2557
- authHeaderName: _zod.z.string(),
2558
- authHeaderValue: _zod.z.string()
2559
- });
2560
- var NpmRegistryAuthConfig = _zod.z.discriminatedUnion("authType", [
2561
- NpmRegistryBasicAuthConfig,
2562
- NpmRegistryBearerAuthConfig,
2563
- NpmRegistryNoAuthConfig,
2564
- NpmRegistrCustomAuthConfig
2565
- ]);
2566
- var NpmRegistryConfigBase = _zod.z.object({
2567
- registryType: NpmRegistryType,
2568
- enabledScopes: _zod.z.array(_zod.z.string()),
2569
- customRegistryUrl: _zod.z.string().optional(),
2570
- bypassProxy: _zod.z.boolean().default(false),
2571
- npmProxyRegistryConfigId: _zod.z.string().optional(),
2572
- npmProxyVersion: _zod.z.number().optional()
2573
- });
2574
- var NpmRegistryConfig = NpmRegistryConfigBase.and(NpmRegistryAuthConfig);
2575
- var SsoProvider = _zod.z.object({
2576
- providerId: _zod.z.string(),
2577
- defaultAutoInviteValue: _zod.z.boolean(),
2578
- autoInviteDomains: _zod.z.record(_zod.z.string(), _zod.z.boolean()),
2579
- skipDocsSupernovaLogin: _zod.z.boolean(),
2580
- areInvitesDisabled: _zod.z.boolean(),
2581
- isTestMode: _zod.z.boolean(),
2582
- emailDomains: _zod.z.array(_zod.z.string()),
2583
- metadataXml: _zod.z.string().nullish()
2584
- });
2585
- var isValidCIDR = (value) => {
2586
- return _ipcidr2.default.isValidAddress(value);
2478
+ var SupernovaException = class _SupernovaException extends Error {
2479
+ //
2480
+ // Properties
2481
+ //
2482
+ constructor(type, message) {
2483
+ super(`${type}: ${message}`);
2484
+ this.type = type;
2485
+ }
2486
+ static wrongFormat(message) {
2487
+ return new _SupernovaException("WrongFormat", message);
2488
+ }
2489
+ static validationError(message) {
2490
+ return new _SupernovaException("ValidationError", message);
2491
+ }
2492
+ static accessDenied(message) {
2493
+ return new _SupernovaException("AccessDenied", message);
2494
+ }
2495
+ static tooMuchWork(message) {
2496
+ return new _SupernovaException("TooMuchWork", message);
2497
+ }
2498
+ static notFound(message) {
2499
+ return new _SupernovaException("ResourceNotFound", message);
2500
+ }
2501
+ static timeout(message) {
2502
+ return new _SupernovaException("Timeout", message);
2503
+ }
2504
+ static conflict(message) {
2505
+ return new _SupernovaException("Conflict", message);
2506
+ }
2507
+ static notImplemented(message) {
2508
+ return new _SupernovaException("NotImplemented", message);
2509
+ }
2510
+ static wrongActionOrder(message) {
2511
+ return new _SupernovaException("WrongActionOrder", message);
2512
+ }
2513
+ static invalidOperation(message) {
2514
+ return new _SupernovaException("InvalidOperation", message);
2515
+ }
2516
+ static shouldNotHappen(message) {
2517
+ return new _SupernovaException("UnexpectedError", message);
2518
+ }
2519
+ static ipRestricted(message) {
2520
+ return new _SupernovaException("IPRestricted", message);
2521
+ }
2522
+ static planRestricted(message) {
2523
+ return new _SupernovaException("PlanRestricted", message);
2524
+ }
2525
+ static missingWorkspacePermission(message) {
2526
+ return new _SupernovaException("MissingWorkspacePermission", message);
2527
+ }
2528
+ static missingExporterPermission(message) {
2529
+ return new _SupernovaException("MissingExporterPermission", message);
2530
+ }
2531
+ static missingIntegration(message) {
2532
+ return new _SupernovaException("MissingIntegration", message);
2533
+ }
2534
+ static missingIntegrationAccess(message) {
2535
+ return new _SupernovaException("MissingIntegrationAccess", message);
2536
+ }
2537
+ static noAccess(message) {
2538
+ return new _SupernovaException("NoAccess", message);
2539
+ }
2540
+ static missingCredentials(message) {
2541
+ return new _SupernovaException("MissingCredentials", message);
2542
+ }
2543
+ static thirdPartyError(message) {
2544
+ return new _SupernovaException("ThirdPartyError", message);
2545
+ }
2546
+ //
2547
+ // To refactor
2548
+ //
2549
+ static badRequest(message) {
2550
+ return new _SupernovaException("BadRequest", message);
2551
+ }
2587
2552
  };
2588
- var WorkspaceIpWhitelistEntry = _zod.z.object({
2589
- isEnabled: _zod.z.boolean(),
2590
- name: _zod.z.string(),
2591
- range: _zod.z.string().refine(isValidCIDR, {
2592
- message: "Invalid IP CIDR"
2593
- })
2594
- });
2595
- var WorkspaceIpSettings = _zod.z.object({
2596
- isEnabledForCloud: _zod.z.boolean(),
2597
- isEnabledForDocs: _zod.z.boolean(),
2598
- entries: _zod.z.array(WorkspaceIpWhitelistEntry)
2599
- });
2600
- var WorkspaceProfile = _zod.z.object({
2601
- name: _zod.z.string(),
2602
- handle: _zod.z.string(),
2603
- color: _zod.z.string(),
2604
- avatar: nullishToOptional(_zod.z.string()),
2605
- billingDetails: nullishToOptional(BillingDetails)
2606
- });
2607
- var WorkspaceProfileUpdate = WorkspaceProfile.omit({
2608
- avatar: true
2609
- });
2610
- var Workspace = _zod.z.object({
2611
- id: _zod.z.string(),
2612
- profile: WorkspaceProfile,
2613
- subscription: Subscription,
2614
- ipWhitelist: nullishToOptional(WorkspaceIpSettings),
2615
- sso: nullishToOptional(SsoProvider),
2616
- npmRegistrySettings: nullishToOptional(NpmRegistryConfig)
2617
- });
2618
- var WorkspaceWithDesignSystems = _zod.z.object({
2619
- workspace: Workspace,
2620
- designSystems: _zod.z.array(DesignSystem)
2621
- });
2622
- var DesignSystemSwitcher = _zod.z.object({
2623
- isEnabled: _zod.z.boolean(),
2624
- designSystemIds: _zod.z.array(_zod.z.string())
2625
- });
2626
- var DesignSystem = _zod.z.object({
2627
- id: _zod.z.string(),
2628
- workspaceId: _zod.z.string(),
2629
- name: _zod.z.string(),
2630
- description: _zod.z.string(),
2631
- docExporterId: nullishToOptional(_zod.z.string()),
2632
- docSlug: _zod.z.string(),
2633
- docUserSlug: nullishToOptional(_zod.z.string()),
2634
- docSlugDeprecated: _zod.z.string(),
2635
- isPublic: _zod.z.boolean(),
2636
- isMultibrand: _zod.z.boolean(),
2637
- docViewUrl: nullishToOptional(_zod.z.string()),
2638
- basePrefixes: _zod.z.array(_zod.z.string()),
2639
- designSystemSwitcher: nullishToOptional(DesignSystemSwitcher),
2640
- createdAt: _zod.z.coerce.date(),
2641
- updatedAt: _zod.z.coerce.date()
2642
- });
2643
- var DesignSystemWithWorkspace = _zod.z.object({
2644
- designSystem: DesignSystem,
2645
- workspace: Workspace
2646
- });
2647
- var DS_NAME_MIN_LENGTH = 2;
2648
- var DS_NAME_MAX_LENGTH = 64;
2649
- var DS_DESC_MAX_LENGTH = 64;
2650
- var DesignSystemUpdateInputMetadata = _zod.z.object({
2651
- name: _zod.z.string().min(DS_NAME_MIN_LENGTH).max(DS_NAME_MAX_LENGTH).trim().optional(),
2652
- description: _zod.z.string().max(DS_DESC_MAX_LENGTH).trim().optional()
2653
- });
2654
- var DesignSystemUpdateInput = DesignSystem.partial().omit({
2655
- id: true,
2656
- createdAt: true,
2657
- updatedAt: true,
2658
- docSlug: true,
2659
- docViewUrl: true,
2660
- designSystemSwitcher: true
2661
- }).extend({
2662
- meta: DesignSystemUpdateInputMetadata.optional()
2663
- });
2664
- var DS_NAME_MIN_LENGTH2 = 2;
2665
- var DS_NAME_MAX_LENGTH2 = 64;
2666
- var DS_DESC_MAX_LENGTH2 = 64;
2667
- var DesignSystemCreateInputMetadata = _zod.z.object({
2668
- name: _zod.z.string().min(DS_NAME_MIN_LENGTH2).max(DS_NAME_MAX_LENGTH2).trim(),
2669
- description: _zod.z.string().max(DS_DESC_MAX_LENGTH2).trim()
2670
- });
2671
- var DesignSystemCreateInput = _zod.z.object({
2672
- meta: DesignSystemCreateInputMetadata,
2673
- workspaceId: _zod.z.string(),
2674
- isPublic: _zod.z.boolean().optional(),
2675
- basePrefixes: _zod.z.array(_zod.z.string()).optional(),
2676
- docUserSlug: _zod.z.string().nullish().optional(),
2677
- source: _zod.z.array(_zod.z.string()).optional()
2678
- });
2679
- var ExporterPropertyImageValue = _zod.z.object({
2680
- asset: PageBlockAsset.optional(),
2681
- assetId: _zod.z.string().optional(),
2682
- assetUrl: _zod.z.string().optional()
2683
- });
2684
- var ExporterPropertyValue = _zod.z.object({
2685
- key: _zod.z.string(),
2686
- value: _zod.z.union([
2687
- _zod.z.number(),
2688
- _zod.z.string(),
2689
- _zod.z.boolean(),
2690
- ExporterPropertyImageValue,
2691
- ColorTokenData,
2692
- TypographyTokenData
2693
- ])
2694
- });
2695
- var ExporterPropertyValuesCollection = _zod.z.object({
2696
- id: _zod.z.string(),
2697
- designSystemId: _zod.z.string(),
2698
- exporterId: _zod.z.string(),
2699
- values: _zod.z.array(ExporterPropertyValue)
2700
- });
2701
- var PublishedDocPage = _zod.z.object({
2702
- id: _zod.z.string(),
2703
- publishedDocId: _zod.z.string(),
2704
- pageShortPersistentId: _zod.z.string(),
2705
- pathV1: _zod.z.string(),
2706
- pathV2: _zod.z.string(),
2707
- storagePath: _zod.z.string(),
2708
- locale: _zod.z.string().optional(),
2709
- isPrivate: _zod.z.boolean(),
2710
- isHidden: _zod.z.boolean(),
2711
- createdAt: _zod.z.coerce.date(),
2712
- updatedAt: _zod.z.coerce.date()
2713
- });
2714
- var publishedDocEnvironments = ["Live", "Preview"];
2715
- var PublishedDocEnvironment = _zod.z.enum(publishedDocEnvironments);
2716
- var PublishedDocsChecksums = _zod.z.record(_zod.z.string());
2717
- var PublishedDocRoutingVersion = _zod.z.enum(["1", "2"]);
2718
- var PublishedDoc = _zod.z.object({
2719
- id: _zod.z.string(),
2720
- designSystemVersionId: _zod.z.string(),
2721
- createdAt: _zod.z.coerce.date(),
2722
- updatedAt: _zod.z.coerce.date(),
2723
- lastPublishedAt: _zod.z.coerce.date(),
2724
- isDefault: _zod.z.boolean(),
2725
- isPublic: _zod.z.boolean(),
2726
- environment: PublishedDocEnvironment,
2727
- checksums: PublishedDocsChecksums,
2728
- storagePath: _zod.z.string(),
2729
- wasMigrated: _zod.z.boolean(),
2730
- routingVersion: PublishedDocRoutingVersion,
2731
- usesLocalizations: _zod.z.boolean(),
2732
- wasPublishedWithLocalizations: _zod.z.boolean(),
2733
- tokenCount: _zod.z.number(),
2734
- assetCount: _zod.z.number()
2735
- });
2736
- var DesignSystemVersion = _zod.z.object({
2737
- id: _zod.z.string(),
2738
- version: _zod.z.string(),
2739
- createdAt: _zod.z.date(),
2740
- designSystemId: _zod.z.string(),
2741
- name: _zod.z.string(),
2742
- comment: _zod.z.string(),
2743
- isReadonly: _zod.z.boolean(),
2744
- changeLog: _zod.z.string(),
2745
- parentId: _zod.z.string().optional(),
2746
- isDraftsFeatureAdopted: _zod.z.boolean()
2747
- });
2748
- var VersionCreationJobStatus = _zod.z.enum(["Success", "InProgress", "Error"]);
2749
- var VersionCreationJob = _zod.z.object({
2750
- id: _zod.z.string(),
2751
- version: _zod.z.string(),
2752
- designSystemId: _zod.z.string(),
2753
- designSystemVersionId: nullishToOptional(_zod.z.string()),
2754
- status: VersionCreationJobStatus,
2755
- errorMessage: nullishToOptional(_zod.z.string())
2756
- });
2757
- var BITBUCKET_SLUG = /^[-a-zA-Z0-9~]*$/;
2758
- var BITBUCKET_MAX_LENGTH = 64;
2759
- var ExportJobDocumentationChanges = _zod.z.object({
2760
- pagePersistentIds: _zod.z.string().array(),
2761
- groupPersistentIds: _zod.z.string().array()
2762
- });
2763
- var ExporterDestinationDocs = _zod.z.object({
2764
- environment: PublishedDocEnvironment,
2765
- changes: nullishToOptional(ExportJobDocumentationChanges)
2766
- });
2767
- var ExporterDestinationS3 = _zod.z.object({});
2768
- var ExporterDestinationGithub = _zod.z.object({
2769
- credentialId: _zod.z.string().optional(),
2770
- // Repository
2771
- url: _zod.z.string(),
2772
- // Location
2773
- branch: _zod.z.string(),
2774
- relativePath: nullishToOptional(_zod.z.string()),
2775
- // Legacy deprecated fields. Use `credentialId` instead
2776
- connectionId: nullishToOptional(_zod.z.string()),
2777
- userId: nullishToOptional(_zod.z.number())
2778
- });
2779
- var ExporterDestinationAzure = _zod.z.object({
2780
- credentialId: _zod.z.string().optional(),
2781
- // Repository
2782
- organizationId: _zod.z.string(),
2783
- projectId: _zod.z.string(),
2784
- repositoryId: _zod.z.string(),
2785
- // Location
2786
- branch: _zod.z.string(),
2787
- relativePath: nullishToOptional(_zod.z.string()),
2788
- // Maybe not needed
2789
- url: nullishToOptional(_zod.z.string()),
2790
- // Legacy deprecated fields. Use `credentialId` instead
2791
- connectionId: nullishToOptional(_zod.z.string()),
2792
- userId: nullishToOptional(_zod.z.number())
2793
- });
2794
- var ExporterDestinationGitlab = _zod.z.object({
2795
- credentialId: _zod.z.string().optional(),
2796
- // Repository
2797
- projectId: _zod.z.string(),
2798
- // Location
2799
- branch: _zod.z.string(),
2800
- relativePath: nullishToOptional(_zod.z.string()),
2801
- // Maybe not needed
2802
- url: nullishToOptional(_zod.z.string()),
2803
- // Legacy deprecated fields. Use `credentialId` instead
2804
- connectionId: nullishToOptional(_zod.z.string()),
2805
- userId: nullishToOptional(_zod.z.number())
2806
- });
2807
- var ExporterDestinationBitbucket = _zod.z.object({
2808
- credentialId: _zod.z.string().optional(),
2809
- // Repository
2810
- workspaceSlug: _zod.z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
2811
- projectKey: _zod.z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
2812
- repoSlug: _zod.z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
2813
- // Location
2814
- branch: _zod.z.string(),
2815
- relativePath: nullishToOptional(_zod.z.string()),
2816
- // Legacy deprecated fields. Use `credentialId` instead
2817
- connectionId: nullishToOptional(_zod.z.string()),
2818
- userId: nullishToOptional(_zod.z.number())
2819
- });
2820
- var ExportDestinationsMap = _zod.z.object({
2821
- webhookUrl: _zod.z.string().optional(),
2822
- destinationSnDocs: ExporterDestinationDocs.optional(),
2823
- destinationS3: ExporterDestinationS3.optional(),
2824
- destinationGithub: ExporterDestinationGithub.optional(),
2825
- destinationAzure: ExporterDestinationAzure.optional(),
2826
- destinationGitlab: ExporterDestinationGitlab.optional(),
2827
- destinationBitbucket: ExporterDestinationBitbucket.optional()
2828
- });
2829
- var PipelineEventType = _zod.z.enum(["OnVersionReleased", "OnHeadChanged", "OnSourceUpdated", "None"]);
2830
- var PipelineDestinationGitType = _zod.z.enum(["Github", "Gitlab", "Bitbucket", "Azure"]);
2831
- var PipelineDestinationExtraType = _zod.z.enum(["WebhookUrl", "S3", "Documentation"]);
2832
- var PipelineDestinationType = _zod.z.union([PipelineDestinationGitType, PipelineDestinationExtraType]);
2833
- var Pipeline = _zod.z.object({
2834
- id: _zod.z.string(),
2835
- name: _zod.z.string(),
2836
- eventType: PipelineEventType,
2837
- isEnabled: _zod.z.boolean(),
2838
- workspaceId: _zod.z.string(),
2839
- designSystemId: _zod.z.string(),
2840
- exporterId: _zod.z.string(),
2841
- brandPersistentId: _zod.z.string().optional(),
2842
- themePersistentId: _zod.z.string().optional(),
2843
- // Destinations
2844
- ...ExportDestinationsMap.shape
2845
- });
2846
- var ExportJobDump = _zod.z.object({
2847
- id: _zod.z.string(),
2848
- createdAt: _zod.z.coerce.date(),
2849
- finishedAt: _zod.z.coerce.date(),
2850
- exportArtefacts: _zod.z.string()
2851
- });
2852
- var CodeIntegrationDump = _zod.z.object({
2853
- exporters: Exporter.array(),
2854
- pipelines: Pipeline.array(),
2855
- exportJobs: ExportJobDump.array()
2856
- });
2857
- var DesignSystemVersionRoom = Entity.extend({
2858
- designSystemVersionId: _zod.z.string(),
2859
- liveblocksId: _zod.z.string()
2860
- });
2861
- var DesignSystemVersionRoomInternalSettings = _zod.z.object({
2862
- routingVersion: _zod.z.string(),
2863
- isDraftFeatureAdopted: _zod.z.boolean()
2864
- });
2865
- var DesignSystemVersionRoomInitialState = _zod.z.object({
2866
- pages: _zod.z.array(DocumentationPageV2),
2867
- groups: _zod.z.array(ElementGroup),
2868
- pageSnapshots: _zod.z.array(DocumentationPageSnapshot),
2869
- groupSnapshots: _zod.z.array(ElementGroupSnapshot),
2870
- internalSettings: DesignSystemVersionRoomInternalSettings
2871
- });
2872
- var DesignSystemVersionRoomUpdate = _zod.z.object({
2873
- pages: _zod.z.array(DocumentationPageV2),
2874
- groups: _zod.z.array(ElementGroup),
2875
- pageIdsToDelete: _zod.z.array(_zod.z.string()),
2876
- groupIdsToDelete: _zod.z.array(_zod.z.string()),
2877
- pageSnapshots: _zod.z.array(DocumentationPageSnapshot),
2878
- groupSnapshots: _zod.z.array(ElementGroupSnapshot),
2879
- pageSnapshotIdsToDelete: _zod.z.array(_zod.z.string()),
2880
- groupSnapshotIdsToDelete: _zod.z.array(_zod.z.string()),
2881
- pageHashesToUpdate: _zod.z.record(_zod.z.string(), _zod.z.string())
2882
- });
2883
- var DocumentationPageRoom = Entity.extend({
2884
- designSystemVersionId: _zod.z.string(),
2885
- documentationPageId: _zod.z.string(),
2886
- liveblocksId: _zod.z.string(),
2887
- isDirty: _zod.z.boolean()
2888
- });
2889
- var DocumentationPageRoomState = _zod.z.object({
2890
- pageItems: _zod.z.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
2891
- itemConfiguration: DocumentationItemConfigurationV2
2892
- });
2893
- var DocumentationPageRoomRoomUpdate = _zod.z.object({
2894
- page: DocumentationPageV2,
2895
- pageParent: ElementGroup
2896
- });
2897
- var DocumentationPageRoomInitialStateUpdate = DocumentationPageRoomRoomUpdate.extend({
2898
- pageItems: _zod.z.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
2899
- blockDefinitions: _zod.z.array(PageBlockDefinition)
2900
- });
2901
- var RestoredDocumentationPage = _zod.z.object({
2902
- page: DocumentationPageV2,
2903
- pageParent: ElementGroup,
2904
- pageContent: DocumentationPageContentData,
2905
- contentHash: _zod.z.string(),
2906
- roomId: _zod.z.string().optional()
2907
- });
2908
- var RestoredDocumentationGroup = _zod.z.object({
2909
- group: ElementGroup,
2910
- parent: ElementGroup
2911
- });
2912
- var RoomTypeEnum = /* @__PURE__ */ ((RoomTypeEnum2) => {
2913
- RoomTypeEnum2["DocumentationPage"] = "documentation-page";
2914
- RoomTypeEnum2["DesignSystemVersion"] = "design-system-version";
2915
- RoomTypeEnum2["Workspace"] = "workspace";
2916
- return RoomTypeEnum2;
2917
- })(RoomTypeEnum || {});
2918
- var RoomTypeSchema = _zod.z.nativeEnum(RoomTypeEnum);
2919
- var RoomType = RoomTypeSchema.enum;
2920
- var WorkspaceRoom = Entity.extend({
2921
- workspaceId: _zod.z.string(),
2922
- liveblocksId: _zod.z.string()
2923
- });
2924
- var PublishedDocsDump = _zod.z.object({
2925
- documentation: PublishedDoc,
2926
- pages: PublishedDocPage.array()
2927
- });
2928
- var DocumentationThreadDump = _zod.z.object({
2929
- thread: DocumentationCommentThread,
2930
- comments: DocumentationComment.array()
2931
- });
2932
- var DocumentationPageRoomDump = _zod.z.object({
2933
- room: DocumentationPageRoom,
2934
- threads: DocumentationThreadDump.array()
2935
- });
2936
- var DesignSystemVersionMultiplayerDump = _zod.z.object({
2937
- documentationPages: DocumentationPageRoomDump.array()
2938
- });
2939
- var DesignSystemVersionDump = _zod.z.object({
2940
- version: DesignSystemVersion,
2941
- brands: Brand.array(),
2942
- elements: DesignElement.array(),
2943
- elementPropertyDefinitions: ElementPropertyDefinition.array(),
2944
- elementPropertyValues: ElementPropertyValue.array(),
2945
- elementViews: ElementView.array(),
2946
- elementColumns: ElementViewColumn.array(),
2947
- documentationPageContents: DocumentationPageContent.array(),
2948
- documentationPageRooms: DocumentationPageRoomDump.array(),
2949
- publishedDocumentations: PublishedDocsDump.array(),
2950
- assetReferences: AssetReference.array()
2951
- });
2952
- var DesignSystemDump = _zod.z.object({
2953
- designSystem: DesignSystem,
2954
- dataSources: DataSource.array(),
2955
- versions: DesignSystemVersionDump.array(),
2956
- customDomain: CustomDomain.optional(),
2957
- files: Asset.array()
2958
- });
2959
- var IntegrationAuthType = _zod.z.union([_zod.z.literal("OAuth2"), _zod.z.literal("PAT")]);
2960
- var ExternalServiceType = _zod.z.union([
2961
- _zod.z.literal("figma"),
2962
- _zod.z.literal("github"),
2963
- _zod.z.literal("azure"),
2964
- _zod.z.literal("gitlab"),
2965
- _zod.z.literal("bitbucket")
2966
- ]);
2967
- var IntegrationUserInfo = _zod.z.object({
2968
- id: _zod.z.string(),
2969
- handle: _zod.z.string().optional(),
2970
- avatarUrl: _zod.z.string().optional(),
2971
- email: _zod.z.string().optional(),
2972
- authType: IntegrationAuthType.optional(),
2973
- customUrl: _zod.z.string().optional()
2974
- });
2975
- var UserLinkedIntegrations = _zod.z.object({
2976
- figma: IntegrationUserInfo.optional(),
2977
- github: IntegrationUserInfo.array().optional(),
2978
- azure: IntegrationUserInfo.array().optional(),
2979
- gitlab: IntegrationUserInfo.array().optional(),
2980
- bitbucket: IntegrationUserInfo.array().optional()
2981
- });
2982
- var UserAnalyticsCleanupSchedule = _zod.z.object({
2983
- userId: _zod.z.string(),
2984
- createdAt: _zod.z.coerce.date(),
2985
- deleteAt: _zod.z.coerce.date()
2986
- });
2987
- var UserAnalyticsCleanupScheduleDbInput = UserAnalyticsCleanupSchedule.omit({
2988
- createdAt: true
2989
- });
2990
- var CreateUserInput = _zod.z.object({
2991
- email: _zod.z.string(),
2992
- name: _zod.z.string(),
2993
- username: _zod.z.string()
2994
- });
2995
- var UserIdentity = _zod.z.object({
2996
- id: _zod.z.string(),
2997
- userId: _zod.z.string()
2998
- });
2999
- var UserMinified = _zod.z.object({
3000
- id: _zod.z.string(),
3001
- name: _zod.z.string(),
3002
- email: _zod.z.string(),
3003
- avatar: _zod.z.string().optional()
3004
- });
3005
- var LiveblocksNotificationSettings = _zod.z.object({
3006
- sendCommentNotificationEmails: _zod.z.boolean()
3007
- });
3008
- var UserNotificationSettings = _zod.z.object({
3009
- liveblocksNotificationSettings: LiveblocksNotificationSettings
3010
- });
3011
- var UserOnboardingDepartment = _zod.z.enum(["Design", "Engineering", "Product", "Brand", "Other"]);
3012
- var UserOnboardingJobLevel = _zod.z.enum(["Executive", "Manager", "IndividualContributor", "Other"]);
3013
- var UserOnboarding = _zod.z.object({
3014
- companyName: _zod.z.string().optional(),
3015
- numberOfPeopleInOrg: _zod.z.string().optional(),
3016
- numberOfPeopleInDesignTeam: _zod.z.string().optional(),
3017
- department: UserOnboardingDepartment.optional(),
3018
- jobTitle: _zod.z.string().optional(),
3019
- phase: _zod.z.string().optional(),
3020
- jobLevel: UserOnboardingJobLevel.optional(),
3021
- designSystemName: _zod.z.string().optional(),
3022
- defaultDestination: _zod.z.string().optional(),
3023
- figmaUrl: _zod.z.string().optional()
3024
- });
3025
- var UserProfile = _zod.z.object({
3026
- name: _zod.z.string(),
3027
- avatar: _zod.z.string().optional(),
3028
- nickname: _zod.z.string().optional(),
3029
- onboarding: UserOnboarding.optional()
3030
- });
3031
- var UserProfileUpdate = UserProfile.partial().omit({
3032
- avatar: true
3033
- });
3034
- var UserTest = _zod.z.object({
3035
- id: _zod.z.string(),
3036
- email: _zod.z.string()
3037
- });
3038
- var User = _zod.z.object({
3039
- id: _zod.z.string(),
3040
- email: _zod.z.string(),
3041
- emailVerified: _zod.z.boolean(),
3042
- createdAt: _zod.z.coerce.date(),
3043
- trialExpiresAt: _zod.z.coerce.date().optional(),
3044
- profile: UserProfile,
3045
- linkedIntegrations: UserLinkedIntegrations.optional(),
3046
- loggedOutAt: _zod.z.coerce.date().optional(),
3047
- isProtected: _zod.z.boolean()
3048
- });
3049
- var SupernovaException = class _SupernovaException extends Error {
3050
- //
3051
- // Properties
3052
- //
3053
- constructor(type, message) {
3054
- super(`${type}: ${message}`);
3055
- this.type = type;
3056
- }
3057
- static wrongFormat(message) {
3058
- return new _SupernovaException("WrongFormat", message);
3059
- }
3060
- static validationError(message) {
3061
- return new _SupernovaException("ValidationError", message);
3062
- }
3063
- static accessDenied(message) {
3064
- return new _SupernovaException("AccessDenied", message);
3065
- }
3066
- static tooMuchWork(message) {
3067
- return new _SupernovaException("TooMuchWork", message);
3068
- }
3069
- static notFound(message) {
3070
- return new _SupernovaException("ResourceNotFound", message);
3071
- }
3072
- static timeout(message) {
3073
- return new _SupernovaException("Timeout", message);
3074
- }
3075
- static conflict(message) {
3076
- return new _SupernovaException("Conflict", message);
3077
- }
3078
- static notImplemented(message) {
3079
- return new _SupernovaException("NotImplemented", message);
3080
- }
3081
- static wrongActionOrder(message) {
3082
- return new _SupernovaException("WrongActionOrder", message);
3083
- }
3084
- static invalidOperation(message) {
3085
- return new _SupernovaException("InvalidOperation", message);
3086
- }
3087
- static shouldNotHappen(message) {
3088
- return new _SupernovaException("UnexpectedError", message);
3089
- }
3090
- static ipRestricted(message) {
3091
- return new _SupernovaException("IPRestricted", message);
3092
- }
3093
- static planRestricted(message) {
3094
- return new _SupernovaException("PlanRestricted", message);
3095
- }
3096
- static missingWorkspacePermission(message) {
3097
- return new _SupernovaException("MissingWorkspacePermission", message);
3098
- }
3099
- static missingExporterPermission(message) {
3100
- return new _SupernovaException("MissingExporterPermission", message);
3101
- }
3102
- static missingIntegration(message) {
3103
- return new _SupernovaException("MissingIntegration", message);
3104
- }
3105
- static missingIntegrationAccess(message) {
3106
- return new _SupernovaException("MissingIntegrationAccess", message);
3107
- }
3108
- static noAccess(message) {
3109
- return new _SupernovaException("NoAccess", message);
3110
- }
3111
- static missingCredentials(message) {
3112
- return new _SupernovaException("MissingCredentials", message);
3113
- }
3114
- static thirdPartyError(message) {
3115
- return new _SupernovaException("ThirdPartyError", message);
3116
- }
3117
- //
3118
- // To refactor
3119
- //
3120
- static badRequest(message) {
3121
- return new _SupernovaException("BadRequest", message);
3122
- }
3123
- };
3124
- function tryParseUrl(url) {
3125
- try {
3126
- return parseUrl(url);
3127
- } catch (e) {
3128
- console.error(`Error parsing URL ${url}`);
3129
- console.error(e);
3130
- return null;
3131
- }
3132
- }
3133
- function parseUrl(url) {
3134
- return new URL(url.startsWith("https://") || url.startsWith("http://") ? url : `https://${url}`);
3135
- }
3136
- function mapByUnique(items, keyFn) {
3137
- const result = /* @__PURE__ */ new Map();
3138
- for (const item of items) {
3139
- result.set(keyFn(item), item);
3140
- }
3141
- return result;
3142
- }
3143
- function groupBy(items, keyFn) {
3144
- const result = /* @__PURE__ */ new Map();
3145
- for (const item of items) {
3146
- const key = keyFn(item);
3147
- const array = result.get(key);
3148
- if (array) {
3149
- array.push(item);
3150
- } else {
3151
- result.set(key, [item]);
3152
- }
3153
- }
3154
- return result;
3155
- }
3156
- var ContentLoadInstruction = _zod.z.object({
3157
- from: _zod.z.string(),
3158
- to: _zod.z.string(),
3159
- authorizationHeaderKvsId: _zod.z.string().optional(),
3160
- timeout: _zod.z.number().optional()
2553
+ function tryParseUrl(url) {
2554
+ try {
2555
+ return parseUrl(url);
2556
+ } catch (e) {
2557
+ console.error(`Error parsing URL ${url}`);
2558
+ console.error(e);
2559
+ return null;
2560
+ }
2561
+ }
2562
+ function parseUrl(url) {
2563
+ return new URL(url.startsWith("https://") || url.startsWith("http://") ? url : `https://${url}`);
2564
+ }
2565
+ function mapByUnique(items, keyFn) {
2566
+ const result = /* @__PURE__ */ new Map();
2567
+ for (const item of items) {
2568
+ result.set(keyFn(item), item);
2569
+ }
2570
+ return result;
2571
+ }
2572
+ function groupBy(items, keyFn) {
2573
+ const result = /* @__PURE__ */ new Map();
2574
+ for (const item of items) {
2575
+ const key = keyFn(item);
2576
+ const array = result.get(key);
2577
+ if (array) {
2578
+ array.push(item);
2579
+ } else {
2580
+ result.set(key, [item]);
2581
+ }
2582
+ }
2583
+ return result;
2584
+ }
2585
+ var ContentLoadInstruction = _zod.z.object({
2586
+ from: _zod.z.string(),
2587
+ to: _zod.z.string(),
2588
+ authorizationHeaderKvsId: _zod.z.string().optional(),
2589
+ timeout: _zod.z.number().optional()
3161
2590
  });
3162
2591
  var ContentLoaderPayload = _zod.z.object({
3163
2592
  type: _zod.z.literal("Single"),
@@ -3176,7 +2605,7 @@ var ContentLoaderPayload = _zod.z.object({
3176
2605
  );
3177
2606
  function slugify(str, options) {
3178
2607
  const slug = _slugify2.default.call(void 0, _nullishCoalesce(str, () => ( "")), options);
3179
- return _optionalChain([slug, 'optionalAccess', _ => _.length]) > 0 ? slug : "item";
2608
+ return _optionalChain([slug, 'optionalAccess', _2 => _2.length]) > 0 ? slug : "item";
3180
2609
  }
3181
2610
  var RESERVED_SLUGS = [
3182
2611
  "workspaces",
@@ -3799,6 +3228,591 @@ var RESERVED_SLUGS = [
3799
3228
  ];
3800
3229
  var RESERVED_SLUGS_SET = new Set(RESERVED_SLUGS);
3801
3230
  var slugRegex = /^[a-z0-9][a-z0-9-]*[a-z0-9]$/;
3231
+ var DesignElementSnapshotReason = _zod.z.enum(["Publish", "Deletion"]);
3232
+ var DesignElementSnapshotBase = _zod.z.object({
3233
+ id: _zod.z.string(),
3234
+ persistentId: _zod.z.string(),
3235
+ designSystemVersionId: _zod.z.string(),
3236
+ createdAt: _zod.z.coerce.date(),
3237
+ updatedAt: _zod.z.coerce.date(),
3238
+ reason: DesignElementSnapshotReason,
3239
+ createdByUserId: _zod.z.string()
3240
+ });
3241
+ function pickLatestSnapshots(snapshots, getSnapshotElementId) {
3242
+ const groupedSnapshots = groupBy(snapshots, getSnapshotElementId);
3243
+ return Array.from(groupedSnapshots.entries()).map(([_, snapshots2]) => {
3244
+ const sorted = snapshots2.sort((lhs, rhs) => rhs.createdAt.getTime() - lhs.createdAt.getTime());
3245
+ return sorted[0];
3246
+ });
3247
+ }
3248
+ var DocumentationPageSnapshot = DesignElementSnapshotBase.extend({
3249
+ page: DocumentationPageV2,
3250
+ pageContentHash: _zod.z.string(),
3251
+ pageContentStorageKey: _zod.z.string()
3252
+ });
3253
+ function pickLatestPageSnapshots(snapshots) {
3254
+ return pickLatestSnapshots(snapshots, (s) => s.page.id);
3255
+ }
3256
+ var ElementGroupSnapshot = DesignElementSnapshotBase.extend({
3257
+ group: ElementGroup
3258
+ });
3259
+ function pickLatestGroupSnapshots(snapshots) {
3260
+ return pickLatestSnapshots(snapshots, (s) => s.group.id);
3261
+ }
3262
+ var ElementViewBaseColumnType = _zod.z.enum(["Name", "Description", "Value", "UpdatedAt"]);
3263
+ var ElementViewColumnType = _zod.z.union([
3264
+ _zod.z.literal("BaseProperty"),
3265
+ _zod.z.literal("PropertyDefinition"),
3266
+ _zod.z.literal("Theme")
3267
+ ]);
3268
+ var ElementViewColumnSharedAttributes = _zod.z.object({
3269
+ id: _zod.z.string(),
3270
+ persistentId: _zod.z.string(),
3271
+ elementDataViewId: _zod.z.string(),
3272
+ sortPosition: _zod.z.number(),
3273
+ width: _zod.z.number()
3274
+ });
3275
+ var ElementViewBasePropertyColumn = ElementViewColumnSharedAttributes.extend({
3276
+ type: _zod.z.literal("BaseProperty"),
3277
+ basePropertyType: ElementViewBaseColumnType
3278
+ });
3279
+ var ElementViewPropertyDefinitionColumn = ElementViewColumnSharedAttributes.extend({
3280
+ type: _zod.z.literal("PropertyDefinition"),
3281
+ propertyDefinitionId: _zod.z.string()
3282
+ });
3283
+ var ElementViewThemeColumn = ElementViewColumnSharedAttributes.extend({
3284
+ type: _zod.z.literal("Theme"),
3285
+ themeId: _zod.z.string()
3286
+ });
3287
+ var ElementViewColumn = _zod.z.discriminatedUnion("type", [
3288
+ ElementViewBasePropertyColumn,
3289
+ ElementViewPropertyDefinitionColumn,
3290
+ ElementViewThemeColumn
3291
+ ]);
3292
+ var ElementView = _zod.z.object({
3293
+ id: _zod.z.string(),
3294
+ persistentId: _zod.z.string(),
3295
+ designSystemVersionId: _zod.z.string(),
3296
+ name: _zod.z.string(),
3297
+ description: _zod.z.string(),
3298
+ targetElementType: ElementPropertyTargetType,
3299
+ isDefault: _zod.z.boolean()
3300
+ });
3301
+ var Brand = _zod.z.object({
3302
+ id: _zod.z.string(),
3303
+ designSystemVersionId: _zod.z.string(),
3304
+ persistentId: _zod.z.string(),
3305
+ name: _zod.z.string(),
3306
+ description: _zod.z.string()
3307
+ });
3308
+ var NpmRegistryAuthType = _zod.z.enum(["Basic", "Bearer", "None", "Custom"]);
3309
+ var NpmRegistryType = _zod.z.enum(["NPMJS", "GitHub", "AzureDevOps", "Artifactory", "Custom"]);
3310
+ var NpmRegistryBasicAuthConfig = _zod.z.object({
3311
+ authType: _zod.z.literal(NpmRegistryAuthType.Enum.Basic),
3312
+ username: _zod.z.string(),
3313
+ password: _zod.z.string()
3314
+ });
3315
+ var NpmRegistryBearerAuthConfig = _zod.z.object({
3316
+ authType: _zod.z.literal(NpmRegistryAuthType.Enum.Bearer),
3317
+ accessToken: _zod.z.string()
3318
+ });
3319
+ var NpmRegistryNoAuthConfig = _zod.z.object({
3320
+ authType: _zod.z.literal(NpmRegistryAuthType.Enum.None)
3321
+ });
3322
+ var NpmRegistrCustomAuthConfig = _zod.z.object({
3323
+ authType: _zod.z.literal(NpmRegistryAuthType.Enum.Custom),
3324
+ authHeaderName: _zod.z.string(),
3325
+ authHeaderValue: _zod.z.string()
3326
+ });
3327
+ var NpmRegistryAuthConfig = _zod.z.discriminatedUnion("authType", [
3328
+ NpmRegistryBasicAuthConfig,
3329
+ NpmRegistryBearerAuthConfig,
3330
+ NpmRegistryNoAuthConfig,
3331
+ NpmRegistrCustomAuthConfig
3332
+ ]);
3333
+ var NpmRegistryConfigBase = _zod.z.object({
3334
+ registryType: NpmRegistryType,
3335
+ enabledScopes: _zod.z.array(_zod.z.string()),
3336
+ customRegistryUrl: _zod.z.string().optional(),
3337
+ bypassProxy: _zod.z.boolean().default(false),
3338
+ npmProxyRegistryConfigId: _zod.z.string().optional(),
3339
+ npmProxyVersion: _zod.z.number().optional()
3340
+ });
3341
+ var NpmRegistryConfig = NpmRegistryConfigBase.and(NpmRegistryAuthConfig);
3342
+ var SsoProvider = _zod.z.object({
3343
+ providerId: _zod.z.string(),
3344
+ defaultAutoInviteValue: _zod.z.boolean(),
3345
+ autoInviteDomains: _zod.z.record(_zod.z.string(), _zod.z.boolean()),
3346
+ skipDocsSupernovaLogin: _zod.z.boolean(),
3347
+ areInvitesDisabled: _zod.z.boolean(),
3348
+ isTestMode: _zod.z.boolean(),
3349
+ emailDomains: _zod.z.array(_zod.z.string()),
3350
+ metadataXml: _zod.z.string().nullish()
3351
+ });
3352
+ var isValidCIDR = (value) => {
3353
+ return _ipcidr2.default.isValidAddress(value);
3354
+ };
3355
+ var WorkspaceIpWhitelistEntry = _zod.z.object({
3356
+ isEnabled: _zod.z.boolean(),
3357
+ name: _zod.z.string(),
3358
+ range: _zod.z.string().refine(isValidCIDR, {
3359
+ message: "Invalid IP CIDR"
3360
+ })
3361
+ });
3362
+ var WorkspaceIpSettings = _zod.z.object({
3363
+ isEnabledForCloud: _zod.z.boolean(),
3364
+ isEnabledForDocs: _zod.z.boolean(),
3365
+ entries: _zod.z.array(WorkspaceIpWhitelistEntry)
3366
+ });
3367
+ var WorkspaceProfile = _zod.z.object({
3368
+ name: _zod.z.string(),
3369
+ handle: _zod.z.string(),
3370
+ color: _zod.z.string(),
3371
+ avatar: nullishToOptional(_zod.z.string()),
3372
+ billingDetails: nullishToOptional(BillingDetails)
3373
+ });
3374
+ var WorkspaceProfileUpdate = WorkspaceProfile.omit({
3375
+ avatar: true
3376
+ });
3377
+ var Workspace = _zod.z.object({
3378
+ id: _zod.z.string(),
3379
+ profile: WorkspaceProfile,
3380
+ subscription: Subscription,
3381
+ ipWhitelist: nullishToOptional(WorkspaceIpSettings),
3382
+ sso: nullishToOptional(SsoProvider),
3383
+ npmRegistrySettings: nullishToOptional(NpmRegistryConfig)
3384
+ });
3385
+ var WorkspaceWithDesignSystems = _zod.z.object({
3386
+ workspace: Workspace,
3387
+ designSystems: _zod.z.array(DesignSystem)
3388
+ });
3389
+ var DesignSystemSwitcher = _zod.z.object({
3390
+ isEnabled: _zod.z.boolean(),
3391
+ designSystemIds: _zod.z.array(_zod.z.string())
3392
+ });
3393
+ var DesignSystem = _zod.z.object({
3394
+ id: _zod.z.string(),
3395
+ workspaceId: _zod.z.string(),
3396
+ name: _zod.z.string(),
3397
+ description: _zod.z.string(),
3398
+ docExporterId: nullishToOptional(_zod.z.string()),
3399
+ docSlug: _zod.z.string(),
3400
+ docUserSlug: nullishToOptional(_zod.z.string()),
3401
+ docSlugDeprecated: _zod.z.string(),
3402
+ isPublic: _zod.z.boolean(),
3403
+ isMultibrand: _zod.z.boolean(),
3404
+ docViewUrl: nullishToOptional(_zod.z.string()),
3405
+ basePrefixes: _zod.z.array(_zod.z.string()),
3406
+ designSystemSwitcher: nullishToOptional(DesignSystemSwitcher),
3407
+ createdAt: _zod.z.coerce.date(),
3408
+ updatedAt: _zod.z.coerce.date()
3409
+ });
3410
+ var DesignSystemWithWorkspace = _zod.z.object({
3411
+ designSystem: DesignSystem,
3412
+ workspace: Workspace
3413
+ });
3414
+ var DS_NAME_MIN_LENGTH = 2;
3415
+ var DS_NAME_MAX_LENGTH = 64;
3416
+ var DS_DESC_MAX_LENGTH = 64;
3417
+ var DesignSystemUpdateInputMetadata = _zod.z.object({
3418
+ name: _zod.z.string().min(DS_NAME_MIN_LENGTH).max(DS_NAME_MAX_LENGTH).trim().optional(),
3419
+ description: _zod.z.string().max(DS_DESC_MAX_LENGTH).trim().optional()
3420
+ });
3421
+ var DesignSystemUpdateInput = DesignSystem.partial().omit({
3422
+ id: true,
3423
+ createdAt: true,
3424
+ updatedAt: true,
3425
+ docSlug: true,
3426
+ docViewUrl: true,
3427
+ designSystemSwitcher: true
3428
+ }).extend({
3429
+ meta: DesignSystemUpdateInputMetadata.optional()
3430
+ });
3431
+ var DS_NAME_MIN_LENGTH2 = 2;
3432
+ var DS_NAME_MAX_LENGTH2 = 64;
3433
+ var DS_DESC_MAX_LENGTH2 = 64;
3434
+ var DesignSystemCreateInputMetadata = _zod.z.object({
3435
+ name: _zod.z.string().min(DS_NAME_MIN_LENGTH2).max(DS_NAME_MAX_LENGTH2).trim(),
3436
+ description: _zod.z.string().max(DS_DESC_MAX_LENGTH2).trim()
3437
+ });
3438
+ var DesignSystemCreateInput = _zod.z.object({
3439
+ meta: DesignSystemCreateInputMetadata,
3440
+ workspaceId: _zod.z.string(),
3441
+ isPublic: _zod.z.boolean().optional(),
3442
+ basePrefixes: _zod.z.array(_zod.z.string()).optional(),
3443
+ docUserSlug: _zod.z.string().nullish().optional(),
3444
+ source: _zod.z.array(_zod.z.string()).optional()
3445
+ });
3446
+ var ExporterPropertyImageValue = _zod.z.object({
3447
+ asset: PageBlockAsset.optional(),
3448
+ assetId: _zod.z.string().optional(),
3449
+ assetUrl: _zod.z.string().optional()
3450
+ });
3451
+ var ExporterPropertyValue = _zod.z.object({
3452
+ key: _zod.z.string(),
3453
+ value: _zod.z.union([
3454
+ _zod.z.number(),
3455
+ _zod.z.string(),
3456
+ _zod.z.boolean(),
3457
+ ExporterPropertyImageValue,
3458
+ ColorTokenData,
3459
+ TypographyTokenData
3460
+ ])
3461
+ });
3462
+ var ExporterPropertyValuesCollection = _zod.z.object({
3463
+ id: _zod.z.string(),
3464
+ designSystemId: _zod.z.string(),
3465
+ exporterId: _zod.z.string(),
3466
+ values: _zod.z.array(ExporterPropertyValue)
3467
+ });
3468
+ var PublishedDocPage = _zod.z.object({
3469
+ id: _zod.z.string(),
3470
+ publishedDocId: _zod.z.string(),
3471
+ pageShortPersistentId: _zod.z.string(),
3472
+ pathV1: _zod.z.string(),
3473
+ pathV2: _zod.z.string(),
3474
+ storagePath: _zod.z.string(),
3475
+ locale: _zod.z.string().optional(),
3476
+ isPrivate: _zod.z.boolean(),
3477
+ isHidden: _zod.z.boolean(),
3478
+ createdAt: _zod.z.coerce.date(),
3479
+ updatedAt: _zod.z.coerce.date()
3480
+ });
3481
+ var publishedDocEnvironments = ["Live", "Preview"];
3482
+ var PublishedDocEnvironment = _zod.z.enum(publishedDocEnvironments);
3483
+ var PublishedDocsChecksums = _zod.z.record(_zod.z.string());
3484
+ var PublishedDocRoutingVersion = _zod.z.enum(["1", "2"]);
3485
+ var PublishedDoc = _zod.z.object({
3486
+ id: _zod.z.string(),
3487
+ designSystemVersionId: _zod.z.string(),
3488
+ createdAt: _zod.z.coerce.date(),
3489
+ updatedAt: _zod.z.coerce.date(),
3490
+ lastPublishedAt: _zod.z.coerce.date(),
3491
+ isDefault: _zod.z.boolean(),
3492
+ isPublic: _zod.z.boolean(),
3493
+ environment: PublishedDocEnvironment,
3494
+ checksums: PublishedDocsChecksums,
3495
+ storagePath: _zod.z.string(),
3496
+ wasMigrated: _zod.z.boolean(),
3497
+ routingVersion: PublishedDocRoutingVersion,
3498
+ usesLocalizations: _zod.z.boolean(),
3499
+ wasPublishedWithLocalizations: _zod.z.boolean(),
3500
+ tokenCount: _zod.z.number(),
3501
+ assetCount: _zod.z.number()
3502
+ });
3503
+ var DesignSystemVersion = _zod.z.object({
3504
+ id: _zod.z.string(),
3505
+ version: _zod.z.string(),
3506
+ createdAt: _zod.z.date(),
3507
+ designSystemId: _zod.z.string(),
3508
+ name: _zod.z.string(),
3509
+ comment: _zod.z.string(),
3510
+ isReadonly: _zod.z.boolean(),
3511
+ changeLog: _zod.z.string(),
3512
+ parentId: _zod.z.string().optional(),
3513
+ isDraftsFeatureAdopted: _zod.z.boolean()
3514
+ });
3515
+ var VersionCreationJobStatus = _zod.z.enum(["Success", "InProgress", "Error"]);
3516
+ var VersionCreationJob = _zod.z.object({
3517
+ id: _zod.z.string(),
3518
+ version: _zod.z.string(),
3519
+ designSystemId: _zod.z.string(),
3520
+ designSystemVersionId: nullishToOptional(_zod.z.string()),
3521
+ status: VersionCreationJobStatus,
3522
+ errorMessage: nullishToOptional(_zod.z.string())
3523
+ });
3524
+ var BITBUCKET_SLUG = /^[-a-zA-Z0-9~]*$/;
3525
+ var BITBUCKET_MAX_LENGTH = 64;
3526
+ var ExportJobDocumentationChanges = _zod.z.object({
3527
+ pagePersistentIds: _zod.z.string().array(),
3528
+ groupPersistentIds: _zod.z.string().array()
3529
+ });
3530
+ var ExporterDestinationDocs = _zod.z.object({
3531
+ environment: PublishedDocEnvironment,
3532
+ changes: nullishToOptional(ExportJobDocumentationChanges)
3533
+ });
3534
+ var ExporterDestinationS3 = _zod.z.object({});
3535
+ var ExporterDestinationGithub = _zod.z.object({
3536
+ credentialId: _zod.z.string().optional(),
3537
+ // Repository
3538
+ url: _zod.z.string(),
3539
+ // Location
3540
+ branch: _zod.z.string(),
3541
+ relativePath: nullishToOptional(_zod.z.string()),
3542
+ // Legacy deprecated fields. Use `credentialId` instead
3543
+ connectionId: nullishToOptional(_zod.z.string()),
3544
+ userId: nullishToOptional(_zod.z.number())
3545
+ });
3546
+ var ExporterDestinationAzure = _zod.z.object({
3547
+ credentialId: _zod.z.string().optional(),
3548
+ // Repository
3549
+ organizationId: _zod.z.string(),
3550
+ projectId: _zod.z.string(),
3551
+ repositoryId: _zod.z.string(),
3552
+ // Location
3553
+ branch: _zod.z.string(),
3554
+ relativePath: nullishToOptional(_zod.z.string()),
3555
+ // Maybe not needed
3556
+ url: nullishToOptional(_zod.z.string()),
3557
+ // Legacy deprecated fields. Use `credentialId` instead
3558
+ connectionId: nullishToOptional(_zod.z.string()),
3559
+ userId: nullishToOptional(_zod.z.number())
3560
+ });
3561
+ var ExporterDestinationGitlab = _zod.z.object({
3562
+ credentialId: _zod.z.string().optional(),
3563
+ // Repository
3564
+ projectId: _zod.z.string(),
3565
+ // Location
3566
+ branch: _zod.z.string(),
3567
+ relativePath: nullishToOptional(_zod.z.string()),
3568
+ // Maybe not needed
3569
+ url: nullishToOptional(_zod.z.string()),
3570
+ // Legacy deprecated fields. Use `credentialId` instead
3571
+ connectionId: nullishToOptional(_zod.z.string()),
3572
+ userId: nullishToOptional(_zod.z.number())
3573
+ });
3574
+ var ExporterDestinationBitbucket = _zod.z.object({
3575
+ credentialId: _zod.z.string().optional(),
3576
+ // Repository
3577
+ workspaceSlug: _zod.z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
3578
+ projectKey: _zod.z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
3579
+ repoSlug: _zod.z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
3580
+ // Location
3581
+ branch: _zod.z.string(),
3582
+ relativePath: nullishToOptional(_zod.z.string()),
3583
+ // Legacy deprecated fields. Use `credentialId` instead
3584
+ connectionId: nullishToOptional(_zod.z.string()),
3585
+ userId: nullishToOptional(_zod.z.number())
3586
+ });
3587
+ var ExportDestinationsMap = _zod.z.object({
3588
+ webhookUrl: _zod.z.string().optional(),
3589
+ destinationSnDocs: ExporterDestinationDocs.optional(),
3590
+ destinationS3: ExporterDestinationS3.optional(),
3591
+ destinationGithub: ExporterDestinationGithub.optional(),
3592
+ destinationAzure: ExporterDestinationAzure.optional(),
3593
+ destinationGitlab: ExporterDestinationGitlab.optional(),
3594
+ destinationBitbucket: ExporterDestinationBitbucket.optional()
3595
+ });
3596
+ var PipelineEventType = _zod.z.enum(["OnVersionReleased", "OnHeadChanged", "OnSourceUpdated", "None"]);
3597
+ var PipelineDestinationGitType = _zod.z.enum(["Github", "Gitlab", "Bitbucket", "Azure"]);
3598
+ var PipelineDestinationExtraType = _zod.z.enum(["WebhookUrl", "S3", "Documentation"]);
3599
+ var PipelineDestinationType = _zod.z.union([PipelineDestinationGitType, PipelineDestinationExtraType]);
3600
+ var Pipeline = _zod.z.object({
3601
+ id: _zod.z.string(),
3602
+ name: _zod.z.string(),
3603
+ eventType: PipelineEventType,
3604
+ isEnabled: _zod.z.boolean(),
3605
+ workspaceId: _zod.z.string(),
3606
+ designSystemId: _zod.z.string(),
3607
+ exporterId: _zod.z.string(),
3608
+ brandPersistentId: _zod.z.string().optional(),
3609
+ themePersistentId: _zod.z.string().optional(),
3610
+ // Destinations
3611
+ ...ExportDestinationsMap.shape
3612
+ });
3613
+ var ExportJobDump = _zod.z.object({
3614
+ id: _zod.z.string(),
3615
+ createdAt: _zod.z.coerce.date(),
3616
+ finishedAt: _zod.z.coerce.date(),
3617
+ exportArtefacts: _zod.z.string()
3618
+ });
3619
+ var CodeIntegrationDump = _zod.z.object({
3620
+ exporters: Exporter.array(),
3621
+ pipelines: Pipeline.array(),
3622
+ exportJobs: ExportJobDump.array()
3623
+ });
3624
+ var DesignSystemVersionRoom = Entity.extend({
3625
+ designSystemVersionId: _zod.z.string(),
3626
+ liveblocksId: _zod.z.string()
3627
+ });
3628
+ var DesignSystemVersionRoomInternalSettings = _zod.z.object({
3629
+ routingVersion: _zod.z.string(),
3630
+ isDraftFeatureAdopted: _zod.z.boolean()
3631
+ });
3632
+ var DesignSystemVersionRoomInitialState = _zod.z.object({
3633
+ pages: _zod.z.array(DocumentationPageV2),
3634
+ groups: _zod.z.array(ElementGroup),
3635
+ pageSnapshots: _zod.z.array(DocumentationPageSnapshot),
3636
+ groupSnapshots: _zod.z.array(ElementGroupSnapshot),
3637
+ internalSettings: DesignSystemVersionRoomInternalSettings
3638
+ });
3639
+ var DesignSystemVersionRoomUpdate = _zod.z.object({
3640
+ pages: _zod.z.array(DocumentationPageV2),
3641
+ groups: _zod.z.array(ElementGroup),
3642
+ pageIdsToDelete: _zod.z.array(_zod.z.string()),
3643
+ groupIdsToDelete: _zod.z.array(_zod.z.string()),
3644
+ pageSnapshots: _zod.z.array(DocumentationPageSnapshot),
3645
+ groupSnapshots: _zod.z.array(ElementGroupSnapshot),
3646
+ pageSnapshotIdsToDelete: _zod.z.array(_zod.z.string()),
3647
+ groupSnapshotIdsToDelete: _zod.z.array(_zod.z.string()),
3648
+ pageHashesToUpdate: _zod.z.record(_zod.z.string(), _zod.z.string())
3649
+ });
3650
+ var DocumentationPageRoom = Entity.extend({
3651
+ designSystemVersionId: _zod.z.string(),
3652
+ documentationPageId: _zod.z.string(),
3653
+ liveblocksId: _zod.z.string(),
3654
+ isDirty: _zod.z.boolean()
3655
+ });
3656
+ var DocumentationPageRoomState = _zod.z.object({
3657
+ pageItems: _zod.z.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
3658
+ itemConfiguration: DocumentationItemConfigurationV2
3659
+ });
3660
+ var DocumentationPageRoomRoomUpdate = _zod.z.object({
3661
+ page: DocumentationPageV2,
3662
+ pageParent: ElementGroup
3663
+ });
3664
+ var DocumentationPageRoomInitialStateUpdate = DocumentationPageRoomRoomUpdate.extend({
3665
+ pageItems: _zod.z.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
3666
+ blockDefinitions: _zod.z.array(PageBlockDefinition)
3667
+ });
3668
+ var RestoredDocumentationPage = _zod.z.object({
3669
+ page: DocumentationPageV2,
3670
+ pageParent: ElementGroup,
3671
+ pageContent: DocumentationPageContentData,
3672
+ contentHash: _zod.z.string(),
3673
+ roomId: _zod.z.string().optional()
3674
+ });
3675
+ var RestoredDocumentationGroup = _zod.z.object({
3676
+ group: ElementGroup,
3677
+ parent: ElementGroup
3678
+ });
3679
+ var RoomTypeEnum = /* @__PURE__ */ ((RoomTypeEnum2) => {
3680
+ RoomTypeEnum2["DocumentationPage"] = "documentation-page";
3681
+ RoomTypeEnum2["DesignSystemVersion"] = "design-system-version";
3682
+ RoomTypeEnum2["Workspace"] = "workspace";
3683
+ return RoomTypeEnum2;
3684
+ })(RoomTypeEnum || {});
3685
+ var RoomTypeSchema = _zod.z.nativeEnum(RoomTypeEnum);
3686
+ var RoomType = RoomTypeSchema.enum;
3687
+ var WorkspaceRoom = Entity.extend({
3688
+ workspaceId: _zod.z.string(),
3689
+ liveblocksId: _zod.z.string()
3690
+ });
3691
+ var PublishedDocsDump = _zod.z.object({
3692
+ documentation: PublishedDoc,
3693
+ pages: PublishedDocPage.array()
3694
+ });
3695
+ var DocumentationThreadDump = _zod.z.object({
3696
+ thread: DocumentationCommentThread,
3697
+ comments: DocumentationComment.array()
3698
+ });
3699
+ var DocumentationPageRoomDump = _zod.z.object({
3700
+ room: DocumentationPageRoom,
3701
+ threads: DocumentationThreadDump.array()
3702
+ });
3703
+ var DesignSystemVersionMultiplayerDump = _zod.z.object({
3704
+ documentationPages: DocumentationPageRoomDump.array()
3705
+ });
3706
+ var DesignSystemVersionDump = _zod.z.object({
3707
+ version: DesignSystemVersion,
3708
+ brands: Brand.array(),
3709
+ elements: DesignElement.array(),
3710
+ elementPropertyDefinitions: ElementPropertyDefinition.array(),
3711
+ elementPropertyValues: ElementPropertyValue.array(),
3712
+ elementViews: ElementView.array(),
3713
+ elementColumns: ElementViewColumn.array(),
3714
+ documentationPageContents: DocumentationPageContent.array(),
3715
+ documentationPageRooms: DocumentationPageRoomDump.array(),
3716
+ publishedDocumentations: PublishedDocsDump.array(),
3717
+ assetReferences: AssetReference.array()
3718
+ });
3719
+ var DesignSystemDump = _zod.z.object({
3720
+ designSystem: DesignSystem,
3721
+ dataSources: DataSource.array(),
3722
+ versions: DesignSystemVersionDump.array(),
3723
+ customDomain: CustomDomain.optional(),
3724
+ files: Asset.array()
3725
+ });
3726
+ var IntegrationAuthType = _zod.z.union([_zod.z.literal("OAuth2"), _zod.z.literal("PAT")]);
3727
+ var ExternalServiceType = _zod.z.union([
3728
+ _zod.z.literal("figma"),
3729
+ _zod.z.literal("github"),
3730
+ _zod.z.literal("azure"),
3731
+ _zod.z.literal("gitlab"),
3732
+ _zod.z.literal("bitbucket")
3733
+ ]);
3734
+ var IntegrationUserInfo = _zod.z.object({
3735
+ id: _zod.z.string(),
3736
+ handle: _zod.z.string().optional(),
3737
+ avatarUrl: _zod.z.string().optional(),
3738
+ email: _zod.z.string().optional(),
3739
+ authType: IntegrationAuthType.optional(),
3740
+ customUrl: _zod.z.string().optional()
3741
+ });
3742
+ var UserLinkedIntegrations = _zod.z.object({
3743
+ figma: IntegrationUserInfo.optional(),
3744
+ github: IntegrationUserInfo.array().optional(),
3745
+ azure: IntegrationUserInfo.array().optional(),
3746
+ gitlab: IntegrationUserInfo.array().optional(),
3747
+ bitbucket: IntegrationUserInfo.array().optional()
3748
+ });
3749
+ var UserAnalyticsCleanupSchedule = _zod.z.object({
3750
+ userId: _zod.z.string(),
3751
+ createdAt: _zod.z.coerce.date(),
3752
+ deleteAt: _zod.z.coerce.date()
3753
+ });
3754
+ var UserAnalyticsCleanupScheduleDbInput = UserAnalyticsCleanupSchedule.omit({
3755
+ createdAt: true
3756
+ });
3757
+ var CreateUserInput = _zod.z.object({
3758
+ email: _zod.z.string(),
3759
+ name: _zod.z.string(),
3760
+ username: _zod.z.string()
3761
+ });
3762
+ var UserIdentity = _zod.z.object({
3763
+ id: _zod.z.string(),
3764
+ userId: _zod.z.string()
3765
+ });
3766
+ var UserMinified = _zod.z.object({
3767
+ id: _zod.z.string(),
3768
+ name: _zod.z.string(),
3769
+ email: _zod.z.string(),
3770
+ avatar: _zod.z.string().optional()
3771
+ });
3772
+ var LiveblocksNotificationSettings = _zod.z.object({
3773
+ sendCommentNotificationEmails: _zod.z.boolean()
3774
+ });
3775
+ var UserNotificationSettings = _zod.z.object({
3776
+ liveblocksNotificationSettings: LiveblocksNotificationSettings
3777
+ });
3778
+ var UserOnboardingDepartment = _zod.z.enum(["Design", "Engineering", "Product", "Brand", "Other"]);
3779
+ var UserOnboardingJobLevel = _zod.z.enum(["Executive", "Manager", "IndividualContributor", "Other"]);
3780
+ var UserOnboarding = _zod.z.object({
3781
+ companyName: _zod.z.string().optional(),
3782
+ numberOfPeopleInOrg: _zod.z.string().optional(),
3783
+ numberOfPeopleInDesignTeam: _zod.z.string().optional(),
3784
+ department: UserOnboardingDepartment.optional(),
3785
+ jobTitle: _zod.z.string().optional(),
3786
+ phase: _zod.z.string().optional(),
3787
+ jobLevel: UserOnboardingJobLevel.optional(),
3788
+ designSystemName: _zod.z.string().optional(),
3789
+ defaultDestination: _zod.z.string().optional(),
3790
+ figmaUrl: _zod.z.string().optional()
3791
+ });
3792
+ var UserProfile = _zod.z.object({
3793
+ name: _zod.z.string(),
3794
+ avatar: _zod.z.string().optional(),
3795
+ nickname: _zod.z.string().optional(),
3796
+ onboarding: UserOnboarding.optional()
3797
+ });
3798
+ var UserProfileUpdate = UserProfile.partial().omit({
3799
+ avatar: true
3800
+ });
3801
+ var UserTest = _zod.z.object({
3802
+ id: _zod.z.string(),
3803
+ email: _zod.z.string()
3804
+ });
3805
+ var User = _zod.z.object({
3806
+ id: _zod.z.string(),
3807
+ email: _zod.z.string(),
3808
+ emailVerified: _zod.z.boolean(),
3809
+ createdAt: _zod.z.coerce.date(),
3810
+ trialExpiresAt: _zod.z.coerce.date().optional(),
3811
+ profile: UserProfile,
3812
+ linkedIntegrations: UserLinkedIntegrations.optional(),
3813
+ loggedOutAt: _zod.z.coerce.date().optional(),
3814
+ isProtected: _zod.z.boolean()
3815
+ });
3802
3816
  var IntegrationDesignSystem = _zod.z.object({
3803
3817
  designSystemId: _zod.z.string(),
3804
3818
  brandId: _zod.z.string(),
@@ -3866,7 +3880,7 @@ var IntegrationToken = _zod.z.object({
3866
3880
  token_bitbucket_username: _zod.z.string().optional(),
3867
3881
  // Bitbucket only
3868
3882
  custom_url: _zod.z.string().optional().transform((value) => {
3869
- if (!_optionalChain([value, 'optionalAccess', _2 => _2.trim, 'call', _3 => _3()]))
3883
+ if (!_optionalChain([value, 'optionalAccess', _3 => _3.trim, 'call', _4 => _4()]))
3870
3884
  return void 0;
3871
3885
  return formatCustomUrl(value);
3872
3886
  })
@@ -4174,7 +4188,7 @@ var CreateWorkspaceInput = _zod.z.object({
4174
4188
  product: ProductCodeSchema,
4175
4189
  priceId: _zod.z.string(),
4176
4190
  billingEmail: _zod.z.string().email().optional(),
4177
- handle: _zod.z.string().regex(slugRegex).min(HANDLE_MIN_LENGTH).max(HANDLE_MAX_LENGTH).refine((value) => _optionalChain([value, 'optionalAccess', _4 => _4.length]) > 0).optional(),
4191
+ handle: _zod.z.string().regex(slugRegex).min(HANDLE_MIN_LENGTH).max(HANDLE_MAX_LENGTH).refine((value) => _optionalChain([value, 'optionalAccess', _5 => _5.length]) > 0).optional(),
4178
4192
  invites: UserInvites.optional(),
4179
4193
  promoCode: _zod.z.string().optional(),
4180
4194
  status: InternalStatusSchema.optional(),
@@ -4297,7 +4311,7 @@ function calculateElementParentChain(elementParentPersistentId, groupPersistentI
4297
4311
  const parent = groupPersistentIdToGroupMap.get(parentId);
4298
4312
  if (parent)
4299
4313
  result.push(parent);
4300
- parentId = _optionalChain([parent, 'optionalAccess', _5 => _5.parentPersistentId]);
4314
+ parentId = _optionalChain([parent, 'optionalAccess', _6 => _6.parentPersistentId]);
4301
4315
  }
4302
4316
  return result;
4303
4317
  }
@@ -4306,7 +4320,7 @@ function applyPrivacyConfigurationToNestedItems(pages, groups, getDefaultItemCon
4306
4320
  ...group,
4307
4321
  data: {
4308
4322
  ...group.data,
4309
- configuration: _nullishCoalesce(_optionalChain([group, 'access', _6 => _6.data, 'optionalAccess', _7 => _7.configuration]), () => ( getDefaultItemConfiguration()))
4323
+ configuration: _nullishCoalesce(_optionalChain([group, 'access', _7 => _7.data, 'optionalAccess', _8 => _8.configuration]), () => ( getDefaultItemConfiguration()))
4310
4324
  }
4311
4325
  }));
4312
4326
  const groupPersistentIdToGroupMap = mapByUnique(fixedGroups, (group) => group.persistentId);
@@ -4318,8 +4332,8 @@ function applyPrivacyConfigurationToNestedItems(pages, groups, getDefaultItemCon
4318
4332
  const parent = groupPersistentIdToGroupMap.get(nextParentId);
4319
4333
  if (!parent)
4320
4334
  break;
4321
- isHidden = isHidden || _optionalChain([parent, 'access', _8 => _8.data, 'optionalAccess', _9 => _9.configuration, 'optionalAccess', _10 => _10.isHidden]) || false;
4322
- isPrivate = isPrivate || _optionalChain([parent, 'access', _11 => _11.data, 'optionalAccess', _12 => _12.configuration, 'optionalAccess', _13 => _13.isPrivate]) || false;
4335
+ isHidden = isHidden || _optionalChain([parent, 'access', _9 => _9.data, 'optionalAccess', _10 => _10.configuration, 'optionalAccess', _11 => _11.isHidden]) || false;
4336
+ isPrivate = isPrivate || _optionalChain([parent, 'access', _12 => _12.data, 'optionalAccess', _13 => _13.configuration, 'optionalAccess', _14 => _14.isPrivate]) || false;
4323
4337
  nextParentId = parent.parentPersistentId;
4324
4338
  }
4325
4339
  groupToFix.data.configuration.isHidden = isHidden;
@@ -4327,7 +4341,7 @@ function applyPrivacyConfigurationToNestedItems(pages, groups, getDefaultItemCon
4327
4341
  }
4328
4342
  const fixedPages = [];
4329
4343
  for (const page of pages) {
4330
- const configuration = _nullishCoalesce(_optionalChain([page, 'access', _14 => _14.data, 'optionalAccess', _15 => _15.configuration]), () => ( getDefaultItemConfiguration()));
4344
+ const configuration = _nullishCoalesce(_optionalChain([page, 'access', _15 => _15.data, 'optionalAccess', _16 => _16.configuration]), () => ( getDefaultItemConfiguration()));
4331
4345
  const parent = groupPersistentIdToGroupMap.get(page.parentPersistentId);
4332
4346
  fixedPages.push({
4333
4347
  ...page,
@@ -4335,8 +4349,8 @@ function applyPrivacyConfigurationToNestedItems(pages, groups, getDefaultItemCon
4335
4349
  ...page.data,
4336
4350
  configuration: {
4337
4351
  ...configuration,
4338
- isHidden: configuration.isHidden || _optionalChain([parent, 'optionalAccess', _16 => _16.data, 'optionalAccess', _17 => _17.configuration, 'optionalAccess', _18 => _18.isHidden]) || false,
4339
- isPrivate: configuration.isPrivate || _optionalChain([parent, 'optionalAccess', _19 => _19.data, 'optionalAccess', _20 => _20.configuration, 'optionalAccess', _21 => _21.isPrivate]) || false
4352
+ isHidden: configuration.isHidden || _optionalChain([parent, 'optionalAccess', _17 => _17.data, 'optionalAccess', _18 => _18.configuration, 'optionalAccess', _19 => _19.isHidden]) || false,
4353
+ isPrivate: configuration.isPrivate || _optionalChain([parent, 'optionalAccess', _20 => _20.data, 'optionalAccess', _21 => _21.configuration, 'optionalAccess', _22 => _22.isPrivate]) || false
4340
4354
  }
4341
4355
  }
4342
4356
  });
@@ -4354,7 +4368,7 @@ function elementGroupsToDocumentationGroupDTOV1(groups, pages) {
4354
4368
  return groups.map((group) => {
4355
4369
  return {
4356
4370
  ...elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap),
4357
- configuration: documentationItemConfigurationToDTOV1(_optionalChain([group, 'access', _22 => _22.data, 'optionalAccess', _23 => _23.configuration]))
4371
+ configuration: documentationItemConfigurationToDTOV1(_optionalChain([group, 'access', _23 => _23.data, 'optionalAccess', _24 => _24.configuration]))
4358
4372
  };
4359
4373
  });
4360
4374
  }
@@ -4362,7 +4376,7 @@ function elementGroupsToDocumentationGroupFixedConfigurationDTOV1(groups, pages)
4362
4376
  const childrenIdsMap = calculateChildrenIdsMapV1(pages, groups);
4363
4377
  const { groups: fixedGroups } = applyPrivacyConfigurationToNestedItems(pages, groups, getDtoDefaultItemConfigurationV1);
4364
4378
  return fixedGroups.map((group) => {
4365
- const configuration = documentationItemConfigurationToDTOV1(_optionalChain([group, 'access', _24 => _24.data, 'optionalAccess', _25 => _25.configuration]));
4379
+ const configuration = documentationItemConfigurationToDTOV1(_optionalChain([group, 'access', _25 => _25.data, 'optionalAccess', _26 => _26.configuration]));
4366
4380
  return {
4367
4381
  ...elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap),
4368
4382
  // backward compatibility with custom doc exporters, anyway these groups will not be shown, so we can adjust title
@@ -4387,7 +4401,7 @@ function elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap) {
4387
4401
  title: group.meta.name,
4388
4402
  childrenIds,
4389
4403
  isRoot: !group.parentPersistentId,
4390
- groupBehavior: _nullishCoalesce(_optionalChain([group, 'access', _26 => _26.data, 'optionalAccess', _27 => _27.behavior]), () => ( "Group")),
4404
+ groupBehavior: _nullishCoalesce(_optionalChain([group, 'access', _27 => _27.data, 'optionalAccess', _28 => _28.behavior]), () => ( "Group")),
4391
4405
  shortPersistentId: group.shortPersistentId,
4392
4406
  type: "Group"
4393
4407
  };
@@ -4456,10 +4470,10 @@ function elementGroupToDocumentationGroupStructureDTOV2(group, childrenIdsMap) {
4456
4470
  createdAt: group.createdAt,
4457
4471
  updatedAt: group.updatedAt,
4458
4472
  title: group.meta.name,
4459
- configuration: documentationItemConfigurationToDTOV2(_optionalChain([group, 'optionalAccess', _28 => _28.data, 'optionalAccess', _29 => _29.configuration])),
4473
+ configuration: documentationItemConfigurationToDTOV2(_optionalChain([group, 'optionalAccess', _29 => _29.data, 'optionalAccess', _30 => _30.configuration])),
4460
4474
  childrenIds,
4461
4475
  isRoot: !group.parentPersistentId,
4462
- groupBehavior: _nullishCoalesce(_optionalChain([group, 'access', _30 => _30.data, 'optionalAccess', _31 => _31.behavior]), () => ( "Group")),
4476
+ groupBehavior: _nullishCoalesce(_optionalChain([group, 'access', _31 => _31.data, 'optionalAccess', _32 => _32.behavior]), () => ( "Group")),
4463
4477
  shortPersistentId: group.shortPersistentId,
4464
4478
  type: "Group"
4465
4479
  };
@@ -4612,7 +4626,7 @@ function integrationToDto(integration) {
4612
4626
  workspaceId: integration.workspaceId,
4613
4627
  type: integration.type,
4614
4628
  createdAt: integration.createdAt,
4615
- integrationCredentials: _optionalChain([integration, 'access', _32 => _32.integrationCredentials, 'optionalAccess', _33 => _33.map, 'call', _34 => _34(integrationCredentialToDto)]),
4629
+ integrationCredentials: _optionalChain([integration, 'access', _33 => _33.integrationCredentials, 'optionalAccess', _34 => _34.map, 'call', _35 => _35(integrationCredentialToDto)]),
4616
4630
  integrationDesignSystems: _nullishCoalesce(integration.integrationDesignSystems, () => ( void 0))
4617
4631
  };
4618
4632
  }
@@ -5071,7 +5085,9 @@ var DTODocumentationDraftStateUpdated = _zod.z.object({
5071
5085
  })
5072
5086
  });
5073
5087
  var DTODocumentationDraftStateDeleted = _zod.z.object({
5074
- changeType: _zod.z.literal(DTODocumentationDraftChangeType.enum.Deleted)
5088
+ changeType: _zod.z.literal(DTODocumentationDraftChangeType.enum.Deleted),
5089
+ deletedAt: _zod.z.coerce.date(),
5090
+ deletedByUserId: _zod.z.string()
5075
5091
  });
5076
5092
  var DTODocumentationDraftState = _zod.z.discriminatedUnion("changeType", [
5077
5093
  DTODocumentationDraftStateCreated,
@@ -5079,6 +5095,13 @@ var DTODocumentationDraftState = _zod.z.discriminatedUnion("changeType", [
5079
5095
  DTODocumentationDraftStateDeleted
5080
5096
  ]);
5081
5097
 
5098
+ // src/api/dto/elements/documentation/metadata.ts
5099
+
5100
+ var DTODocumentationPublishMetadata = _zod.z.object({
5101
+ lastPublishedByUserId: _zod.z.string(),
5102
+ lastPublishedAt: _zod.z.coerce.date()
5103
+ });
5104
+
5082
5105
  // src/api/dto/elements/documentation/page-v2.ts
5083
5106
  var DTODocumentationPageV2 = _zod.z.object({
5084
5107
  id: _zod.z.string(),
@@ -5094,6 +5117,8 @@ var DTODocumentationPageV2 = _zod.z.object({
5094
5117
  path: _zod.z.string(),
5095
5118
  /** Defined when a page has changed since last publish and can be included into a partial publish */
5096
5119
  draftState: DTODocumentationDraftState.optional(),
5120
+ /** Defined if a page was published at least once and contains metadata about last publish */
5121
+ publishMetadata: DTODocumentationPublishMetadata.optional(),
5097
5122
  // Backward compatibility
5098
5123
  type: _zod.z.literal("Page")
5099
5124
  });
@@ -5305,7 +5330,9 @@ var DTODocumentationGroupV2 = ElementGroup.omit({
5305
5330
  configuration: DTODocumentationItemConfigurationV2,
5306
5331
  type: _zod.z.literal("Group"),
5307
5332
  /** Defined when a group has changed since last publish and can be included into a partial publish */
5308
- draftState: DTODocumentationDraftState.optional()
5333
+ draftState: DTODocumentationDraftState.optional(),
5334
+ /** Defined if a group was published at least once and contains metadata about last publish */
5335
+ publishMetadata: DTODocumentationPublishMetadata.optional()
5309
5336
  });
5310
5337
  var DTOCreateDocumentationGroupInput = _zod.z.object({
5311
5338
  // Identifier
@@ -5478,18 +5505,6 @@ var DTODocumentationHierarchyV2 = _zod.z.object({
5478
5505
  /** Defined when a page has changed since last publish and can be included into a partial publish */
5479
5506
  draftState: DTODocumentationDraftState.optional()
5480
5507
  })
5481
- ),
5482
- deletedPages: _zod.z.array(
5483
- DTODocumentationPageV2.extend({
5484
- /** Deleted page is always a draft change */
5485
- draftState: DTODocumentationDraftState
5486
- })
5487
- ),
5488
- deletedGroups: _zod.z.array(
5489
- DTODocumentationGroupV2.extend({
5490
- /** Deleted page is always a draft change */
5491
- draftState: DTODocumentationDraftState
5492
- })
5493
5508
  )
5494
5509
  });
5495
5510
 
@@ -6130,7 +6145,8 @@ var FrontendVersionRoomYDoc = class {
6130
6145
  //
6131
6146
  // Hierarchy
6132
6147
  //
6133
- getDocumentationHierarchy() {
6148
+ getDocumentationHierarchy(options = {}) {
6149
+ const { includeDeletedContent } = options;
6134
6150
  const doc = new VersionRoomBaseYDoc(this.yDoc);
6135
6151
  const pages = doc.getPages();
6136
6152
  const groups = doc.getGroups();
@@ -6142,48 +6158,28 @@ var FrontendVersionRoomYDoc = class {
6142
6158
  if (!settings.isDraftFeatureAdopted) {
6143
6159
  return {
6144
6160
  pages: pageDTOs,
6145
- groups: groupDTOs,
6146
- deletedGroups: [],
6147
- deletedPages: []
6161
+ groups: groupDTOs
6148
6162
  };
6149
6163
  }
6150
6164
  const pageDraftStates = this.buildPageDraftStates(pages, pageSnapshots);
6165
+ const pagePublishedMetadata = this.buildPagePublishedMetadata(pages, pageSnapshots);
6151
6166
  pageDTOs.forEach((p) => {
6152
6167
  const draftState = pageDraftStates.get(p.id);
6153
6168
  draftState && (p.draftState = draftState);
6169
+ const publishMetadata = pagePublishedMetadata.get(p.id);
6170
+ publishMetadata && (p.publishMetadata = publishMetadata);
6154
6171
  });
6155
6172
  const groupDraftStates = this.buildGroupDraftStates(groups, groupSnapshots);
6173
+ const groupPublishedMetadata = this.buildGroupPublishedMetadata(groups, groupSnapshots);
6156
6174
  groupDTOs.forEach((g) => {
6157
6175
  const draftState = groupDraftStates.get(g.id);
6158
6176
  draftState && (g.draftState = draftState);
6159
- });
6160
- const pageIds = new Set(pages.map((p) => p.id));
6161
- const deletedPagesMap = mapByUnique(
6162
- pageSnapshots.filter((s) => !pageIds.has(s.page.id)).map((s) => s.page),
6163
- (p) => p.id
6164
- );
6165
- const deletedPages = Array.from(deletedPagesMap.values());
6166
- const groupIds = new Set(groups.map((p) => p.id));
6167
- const deletedGroupsMap = mapByUnique(
6168
- groupSnapshots.filter((s) => !groupIds.has(s.group.id)).map((s) => s.group),
6169
- (g) => g.id
6170
- );
6171
- const deletedGroups = Array.from(deletedGroupsMap.values());
6172
- const deletedPageDTOs = documentationPagesToDTOV2(
6173
- deletedPages,
6174
- [...groups, ...deletedGroups],
6175
- settings.routingVersion
6176
- ).map((p) => {
6177
- return { ...p, draftState: { changeType: "Deleted" } };
6178
- });
6179
- const deletedGroupDTOs = elementGroupsToDocumentationGroupDTOV2(deletedGroups, deletedPages).map((g) => {
6180
- return { ...g, draftState: { changeType: "Deleted" } };
6177
+ const publishMetadata = groupPublishedMetadata.get(g.id);
6178
+ publishMetadata && (g.publishMetadata = publishMetadata);
6181
6179
  });
6182
6180
  return {
6183
6181
  pages: pageDTOs,
6184
- groups: groupDTOs,
6185
- deletedPages: deletedPageDTOs,
6186
- deletedGroups: deletedGroupDTOs
6182
+ groups: groupDTOs
6187
6183
  };
6188
6184
  }
6189
6185
  //
@@ -6206,7 +6202,7 @@ var FrontendVersionRoomYDoc = class {
6206
6202
  const publishedPage = publishedPagesById.get(snapshot.page.id);
6207
6203
  publishedState = this.itemStateFromPage(publishedPage, snapshot.pageContentHash);
6208
6204
  }
6209
- const currentPageContentHash = _nullishCoalesce(_nullishCoalesce(pageHashes[page.persistentId], () => ( _optionalChain([snapshot, 'optionalAccess', _35 => _35.pageContentHash]))), () => ( ""));
6205
+ const currentPageContentHash = _nullishCoalesce(_nullishCoalesce(pageHashes[page.persistentId], () => ( _optionalChain([snapshot, 'optionalAccess', _36 => _36.pageContentHash]))), () => ( ""));
6210
6206
  const currentState = this.itemStateFromPage(page, currentPageContentHash);
6211
6207
  const draftState = this.createDraftState(page.persistentId, currentState, publishedState);
6212
6208
  if (draftState)
@@ -6214,6 +6210,40 @@ var FrontendVersionRoomYDoc = class {
6214
6210
  });
6215
6211
  return result;
6216
6212
  }
6213
+ buildPagePublishedMetadata(pages, pageSnapshots) {
6214
+ const publishedPageSnapshotsById = mapByUnique(
6215
+ pickLatestPageSnapshots(pageSnapshots.filter((s) => s.reason === "Publish")),
6216
+ (s) => s.page.id
6217
+ );
6218
+ const result = /* @__PURE__ */ new Map();
6219
+ pages.forEach((p) => {
6220
+ const publishedSnapshot = publishedPageSnapshotsById.get(p.id);
6221
+ if (!publishedSnapshot)
6222
+ return;
6223
+ result.set(p.id, {
6224
+ lastPublishedAt: publishedSnapshot.createdAt,
6225
+ lastPublishedByUserId: publishedSnapshot.createdByUserId
6226
+ });
6227
+ });
6228
+ return result;
6229
+ }
6230
+ buildGroupPublishedMetadata(groups, groupSnapshots) {
6231
+ const publishedGroupSnapshotsById = mapByUnique(
6232
+ pickLatestGroupSnapshots(groupSnapshots.filter((s) => s.reason === "Publish")),
6233
+ (s) => s.group.id
6234
+ );
6235
+ const result = /* @__PURE__ */ new Map();
6236
+ groups.forEach((g) => {
6237
+ const publishedSnapshot = publishedGroupSnapshotsById.get(g.id);
6238
+ if (!publishedSnapshot)
6239
+ return;
6240
+ result.set(g.id, {
6241
+ lastPublishedAt: publishedSnapshot.createdAt,
6242
+ lastPublishedByUserId: publishedSnapshot.createdByUserId
6243
+ });
6244
+ });
6245
+ return result;
6246
+ }
6217
6247
  itemStateFromPage(page, pageContentHash) {
6218
6248
  return {
6219
6249
  title: page.meta.name,
@@ -6250,7 +6280,7 @@ var FrontendVersionRoomYDoc = class {
6250
6280
  itemStateFromGroup(group) {
6251
6281
  return {
6252
6282
  title: group.meta.name,
6253
- configuration: _nullishCoalesce(_optionalChain([group, 'access', _36 => _36.data, 'optionalAccess', _37 => _37.configuration]), () => ( defaultDocumentationItemConfigurationV2)),
6283
+ configuration: _nullishCoalesce(_optionalChain([group, 'access', _37 => _37.data, 'optionalAccess', _38 => _38.configuration]), () => ( defaultDocumentationItemConfigurationV2)),
6254
6284
  contentHash: "-"
6255
6285
  };
6256
6286
  }
@@ -6311,6 +6341,10 @@ var FrontendVersionRoomYDoc = class {
6311
6341
  const settings = doc.getDocumentationInternalSettings();
6312
6342
  return settings.isDraftFeatureAdopted;
6313
6343
  }
6344
+ hasPublishedDocumentationContent() {
6345
+ const doc = new VersionRoomBaseYDoc(this.yDoc);
6346
+ return doc.getPageSnapshots().filter((s) => s.reason === "Publish").length > 0 || doc.getGroupSnapshots().filter((s) => s.reason === "Publish").length > 0;
6347
+ }
6314
6348
  };
6315
6349
 
6316
6350
  // src/yjs/design-system-content/documentation-hierarchy.ts
@@ -6335,7 +6369,7 @@ var DTODocumentationPageRoomHeaderDataUpdate = _zod.z.object({
6335
6369
  function itemConfigurationToYjs(yDoc, item) {
6336
6370
  yDoc.transact((trx) => {
6337
6371
  const { title, configuration } = item;
6338
- const header = _optionalChain([configuration, 'optionalAccess', _38 => _38.header]);
6372
+ const header = _optionalChain([configuration, 'optionalAccess', _39 => _39.header]);
6339
6373
  if (title !== void 0) {
6340
6374
  const headerYMap = trx.doc.getMap("itemTitle");
6341
6375
  headerYMap.set("title", title);
@@ -6353,9 +6387,9 @@ function itemConfigurationToYjs(yDoc, item) {
6353
6387
  header.minHeight !== void 0 && headerYMap.set("minHeight", header.minHeight);
6354
6388
  }
6355
6389
  const configYMap = trx.doc.getMap("itemConfiguration");
6356
- _optionalChain([configuration, 'optionalAccess', _39 => _39.showSidebar]) !== void 0 && configYMap.set("showSidebar", configuration.showSidebar);
6357
- _optionalChain([configuration, 'optionalAccess', _40 => _40.isHidden]) !== void 0 && configYMap.set("isHidden", configuration.isHidden);
6358
- _optionalChain([configuration, 'optionalAccess', _41 => _41.isPrivate]) !== void 0 && configYMap.set("isPrivate", configuration.isPrivate);
6390
+ _optionalChain([configuration, 'optionalAccess', _40 => _40.showSidebar]) !== void 0 && configYMap.set("showSidebar", configuration.showSidebar);
6391
+ _optionalChain([configuration, 'optionalAccess', _41 => _41.isHidden]) !== void 0 && configYMap.set("isHidden", configuration.isHidden);
6392
+ _optionalChain([configuration, 'optionalAccess', _42 => _42.isPrivate]) !== void 0 && configYMap.set("isPrivate", configuration.isPrivate);
6359
6393
  });
6360
6394
  }
6361
6395
  function yjsToItemConfiguration(yDoc) {
@@ -7147,7 +7181,7 @@ var ListTreeBuilder = class {
7147
7181
  }
7148
7182
  addWithProperty(block, multiRichTextProperty) {
7149
7183
  const parsedOptions = PageBlockDefinitionMutiRichTextOptions.optional().parse(multiRichTextProperty.options);
7150
- return this.add(block, multiRichTextProperty.id, _optionalChain([parsedOptions, 'optionalAccess', _42 => _42.multiRichTextStyle]) || "OL");
7184
+ return this.add(block, multiRichTextProperty.id, _optionalChain([parsedOptions, 'optionalAccess', _43 => _43.multiRichTextStyle]) || "OL");
7151
7185
  }
7152
7186
  add(block, multiRichTextPropertyId, multiRichTextPropertyStyle) {
7153
7187
  const list = this.createList(block, multiRichTextPropertyId, multiRichTextPropertyStyle);
@@ -7167,7 +7201,7 @@ var ListTreeBuilder = class {
7167
7201
  }
7168
7202
  const listParent = this.getParentOfDepth(block.data.indentLevel);
7169
7203
  const lastChild = listParent.children[listParent.children.length - 1];
7170
- if (_optionalChain([lastChild, 'optionalAccess', _43 => _43.type]) === "List") {
7204
+ if (_optionalChain([lastChild, 'optionalAccess', _44 => _44.type]) === "List") {
7171
7205
  lastChild.children.push(...list.leadingChildren);
7172
7206
  return;
7173
7207
  } else {
@@ -7354,7 +7388,7 @@ function serializeAsRichTextBlock(input) {
7354
7388
  const textPropertyValue = BlockParsingUtils.richTextPropertyValue(blockItem, richTextProperty.id);
7355
7389
  const enrichedInput = { ...input, richTextPropertyValue: textPropertyValue };
7356
7390
  const parsedOptions = PageBlockDefinitionRichTextOptions.optional().parse(richTextProperty.options);
7357
- const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess', _44 => _44.richTextStyle]), () => ( "Default"));
7391
+ const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess', _45 => _45.richTextStyle]), () => ( "Default"));
7358
7392
  switch (style) {
7359
7393
  case "Callout":
7360
7394
  return serializeAsCallout(enrichedInput);
@@ -7576,7 +7610,7 @@ function serializeBlockNodeAttributes(block) {
7576
7610
  };
7577
7611
  }
7578
7612
  function richTextHeadingLevel(property) {
7579
- const style = _optionalChain([property, 'access', _45 => _45.options, 'optionalAccess', _46 => _46.richTextStyle]);
7613
+ const style = _optionalChain([property, 'access', _46 => _46.options, 'optionalAccess', _47 => _47.richTextStyle]);
7580
7614
  if (!style)
7581
7615
  return void 0;
7582
7616
  switch (style) {
@@ -7689,7 +7723,7 @@ function serializeAsCustomBlock(block, definition) {
7689
7723
  linksTo: i.linksTo
7690
7724
  };
7691
7725
  });
7692
- const columns = _optionalChain([block, 'access', _47 => _47.data, 'access', _48 => _48.appearance, 'optionalAccess', _49 => _49.numberOfColumns]);
7726
+ const columns = _optionalChain([block, 'access', _48 => _48.data, 'access', _49 => _49.appearance, 'optionalAccess', _50 => _50.numberOfColumns]);
7693
7727
  return {
7694
7728
  type: serializeCustomBlockNodeType(block, definition),
7695
7729
  attrs: {
@@ -10309,10 +10343,10 @@ function parseAsMultiRichText(prosemirrorNode, definition, property, definitions
10309
10343
  const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
10310
10344
  const result = [];
10311
10345
  const listItems = [];
10312
- _optionalChain([prosemirrorNode, 'access', _50 => _50.content, 'optionalAccess', _51 => _51.forEach, 'call', _52 => _52((c) => {
10346
+ _optionalChain([prosemirrorNode, 'access', _51 => _51.content, 'optionalAccess', _52 => _52.forEach, 'call', _53 => _53((c) => {
10313
10347
  if (c.type !== "listItem")
10314
10348
  return;
10315
- _optionalChain([c, 'access', _53 => _53.content, 'optionalAccess', _54 => _54.forEach, 'call', _55 => _55((cc) => {
10349
+ _optionalChain([c, 'access', _54 => _54.content, 'optionalAccess', _55 => _55.forEach, 'call', _56 => _56((cc) => {
10316
10350
  listItems.push(cc);
10317
10351
  })]);
10318
10352
  })]);
@@ -10415,17 +10449,17 @@ function parseAsTable(prosemirrorNode, definition, property) {
10415
10449
  return null;
10416
10450
  const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
10417
10451
  const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", _zod.z.boolean().optional()) !== false;
10418
- const tableChild = _optionalChain([prosemirrorNode, 'access', _56 => _56.content, 'optionalAccess', _57 => _57.find, 'call', _58 => _58((c) => c.type === "table")]);
10452
+ const tableChild = _optionalChain([prosemirrorNode, 'access', _57 => _57.content, 'optionalAccess', _58 => _58.find, 'call', _59 => _59((c) => c.type === "table")]);
10419
10453
  if (!tableChild) {
10420
10454
  return emptyTable(id, variantId, 0);
10421
10455
  }
10422
- const rows = _nullishCoalesce(_optionalChain([tableChild, 'access', _59 => _59.content, 'optionalAccess', _60 => _60.filter, 'call', _61 => _61((c) => c.type === "tableRow" && !!_optionalChain([c, 'access', _62 => _62.content, 'optionalAccess', _63 => _63.length]))]), () => ( []));
10456
+ const rows = _nullishCoalesce(_optionalChain([tableChild, 'access', _60 => _60.content, 'optionalAccess', _61 => _61.filter, 'call', _62 => _62((c) => c.type === "tableRow" && !!_optionalChain([c, 'access', _63 => _63.content, 'optionalAccess', _64 => _64.length]))]), () => ( []));
10423
10457
  if (!rows.length) {
10424
10458
  return emptyTable(id, variantId, 0);
10425
10459
  }
10426
- const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access', _64 => _64[0], 'access', _65 => _65.content, 'optionalAccess', _66 => _66.filter, 'call', _67 => _67((c) => c.type === "tableHeader"), 'access', _68 => _68.length]), () => ( 0));
10427
- const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access', _69 => _69.content, 'optionalAccess', _70 => _70[0], 'optionalAccess', _71 => _71.type]) === "tableHeader").length;
10428
- const hasHeaderRow = _optionalChain([rows, 'access', _72 => _72[0], 'access', _73 => _73.content, 'optionalAccess', _74 => _74.length]) === rowHeaderCells;
10460
+ const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access', _65 => _65[0], 'access', _66 => _66.content, 'optionalAccess', _67 => _67.filter, 'call', _68 => _68((c) => c.type === "tableHeader"), 'access', _69 => _69.length]), () => ( 0));
10461
+ const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access', _70 => _70.content, 'optionalAccess', _71 => _71[0], 'optionalAccess', _72 => _72.type]) === "tableHeader").length;
10462
+ const hasHeaderRow = _optionalChain([rows, 'access', _73 => _73[0], 'access', _74 => _74.content, 'optionalAccess', _75 => _75.length]) === rowHeaderCells;
10429
10463
  const hasHeaderColumn = rows.length === columnHeaderCells;
10430
10464
  const tableValue = {
10431
10465
  showBorder: hasBorder,
@@ -10507,7 +10541,7 @@ function parseAsTableNode(prosemirrorNode) {
10507
10541
  const parsedItems = PageBlockItemV2.array().safeParse(JSON.parse(items));
10508
10542
  if (!parsedItems.success)
10509
10543
  return null;
10510
- const rawImagePropertyValue = _optionalChain([parsedItems, 'access', _75 => _75.data, 'access', _76 => _76[0], 'optionalAccess', _77 => _77.props, 'access', _78 => _78.image]);
10544
+ const rawImagePropertyValue = _optionalChain([parsedItems, 'access', _76 => _76.data, 'access', _77 => _77[0], 'optionalAccess', _78 => _78.props, 'access', _79 => _79.image]);
10511
10545
  if (!rawImagePropertyValue)
10512
10546
  return null;
10513
10547
  const imagePropertyValueParseResult = PageBlockItemImageValue.safeParse(rawImagePropertyValue);
@@ -10743,7 +10777,7 @@ function getProsemirrorBlockVariantId(prosemirrorNode) {
10743
10777
  return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(_zod.z.string()));
10744
10778
  }
10745
10779
  function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
10746
- const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access', _79 => _79.attrs, 'optionalAccess', _80 => _80[attributeName]]));
10780
+ const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access', _80 => _80.attrs, 'optionalAccess', _81 => _81[attributeName]]));
10747
10781
  if (parsedAttr.success) {
10748
10782
  return parsedAttr.data;
10749
10783
  } else {