@supernova-studio/client 0.48.13 → 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,690 +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
- createdByUserId: _zod.z.string()
2487
- });
2488
- var DocumentationPageSnapshot = DesignElementSnapshotBase.extend({
2489
- page: DocumentationPageV2,
2490
- pageContentHash: _zod.z.string(),
2491
- pageContentStorageKey: _zod.z.string()
2492
- });
2493
- var ElementGroupSnapshot = DesignElementSnapshotBase.extend({
2494
- group: ElementGroup
2495
- });
2496
- var ElementViewBaseColumnType = _zod.z.enum(["Name", "Description", "Value", "UpdatedAt"]);
2497
- var ElementViewColumnType = _zod.z.union([
2498
- _zod.z.literal("BaseProperty"),
2499
- _zod.z.literal("PropertyDefinition"),
2500
- _zod.z.literal("Theme")
2501
- ]);
2502
- var ElementViewColumnSharedAttributes = _zod.z.object({
2503
- id: _zod.z.string(),
2504
- persistentId: _zod.z.string(),
2505
- elementDataViewId: _zod.z.string(),
2506
- sortPosition: _zod.z.number(),
2507
- width: _zod.z.number()
2508
- });
2509
- var ElementViewBasePropertyColumn = ElementViewColumnSharedAttributes.extend({
2510
- type: _zod.z.literal("BaseProperty"),
2511
- basePropertyType: ElementViewBaseColumnType
2512
- });
2513
- var ElementViewPropertyDefinitionColumn = ElementViewColumnSharedAttributes.extend({
2514
- type: _zod.z.literal("PropertyDefinition"),
2515
- propertyDefinitionId: _zod.z.string()
2516
- });
2517
- var ElementViewThemeColumn = ElementViewColumnSharedAttributes.extend({
2518
- type: _zod.z.literal("Theme"),
2519
- themeId: _zod.z.string()
2520
- });
2521
- var ElementViewColumn = _zod.z.discriminatedUnion("type", [
2522
- ElementViewBasePropertyColumn,
2523
- ElementViewPropertyDefinitionColumn,
2524
- ElementViewThemeColumn
2525
- ]);
2526
- var ElementView = _zod.z.object({
2527
- id: _zod.z.string(),
2528
- persistentId: _zod.z.string(),
2529
- designSystemVersionId: _zod.z.string(),
2530
- name: _zod.z.string(),
2531
- description: _zod.z.string(),
2532
- targetElementType: ElementPropertyTargetType,
2533
- isDefault: _zod.z.boolean()
2534
- });
2535
- var Brand = _zod.z.object({
2536
- id: _zod.z.string(),
2537
- designSystemVersionId: _zod.z.string(),
2538
- persistentId: _zod.z.string(),
2539
- name: _zod.z.string(),
2540
- description: _zod.z.string()
2541
- });
2542
- var NpmRegistryAuthType = _zod.z.enum(["Basic", "Bearer", "None", "Custom"]);
2543
- var NpmRegistryType = _zod.z.enum(["NPMJS", "GitHub", "AzureDevOps", "Artifactory", "Custom"]);
2544
- var NpmRegistryBasicAuthConfig = _zod.z.object({
2545
- authType: _zod.z.literal(NpmRegistryAuthType.Enum.Basic),
2546
- username: _zod.z.string(),
2547
- password: _zod.z.string()
2548
- });
2549
- var NpmRegistryBearerAuthConfig = _zod.z.object({
2550
- authType: _zod.z.literal(NpmRegistryAuthType.Enum.Bearer),
2551
- accessToken: _zod.z.string()
2552
- });
2553
- var NpmRegistryNoAuthConfig = _zod.z.object({
2554
- authType: _zod.z.literal(NpmRegistryAuthType.Enum.None)
2555
- });
2556
- var NpmRegistrCustomAuthConfig = _zod.z.object({
2557
- authType: _zod.z.literal(NpmRegistryAuthType.Enum.Custom),
2558
- authHeaderName: _zod.z.string(),
2559
- authHeaderValue: _zod.z.string()
2560
- });
2561
- var NpmRegistryAuthConfig = _zod.z.discriminatedUnion("authType", [
2562
- NpmRegistryBasicAuthConfig,
2563
- NpmRegistryBearerAuthConfig,
2564
- NpmRegistryNoAuthConfig,
2565
- NpmRegistrCustomAuthConfig
2566
- ]);
2567
- var NpmRegistryConfigBase = _zod.z.object({
2568
- registryType: NpmRegistryType,
2569
- enabledScopes: _zod.z.array(_zod.z.string()),
2570
- customRegistryUrl: _zod.z.string().optional(),
2571
- bypassProxy: _zod.z.boolean().default(false),
2572
- npmProxyRegistryConfigId: _zod.z.string().optional(),
2573
- npmProxyVersion: _zod.z.number().optional()
2574
- });
2575
- var NpmRegistryConfig = NpmRegistryConfigBase.and(NpmRegistryAuthConfig);
2576
- var SsoProvider = _zod.z.object({
2577
- providerId: _zod.z.string(),
2578
- defaultAutoInviteValue: _zod.z.boolean(),
2579
- autoInviteDomains: _zod.z.record(_zod.z.string(), _zod.z.boolean()),
2580
- skipDocsSupernovaLogin: _zod.z.boolean(),
2581
- areInvitesDisabled: _zod.z.boolean(),
2582
- isTestMode: _zod.z.boolean(),
2583
- emailDomains: _zod.z.array(_zod.z.string()),
2584
- metadataXml: _zod.z.string().nullish()
2585
- });
2586
- var isValidCIDR = (value) => {
2587
- 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
+ }
2588
2552
  };
2589
- var WorkspaceIpWhitelistEntry = _zod.z.object({
2590
- isEnabled: _zod.z.boolean(),
2591
- name: _zod.z.string(),
2592
- range: _zod.z.string().refine(isValidCIDR, {
2593
- message: "Invalid IP CIDR"
2594
- })
2595
- });
2596
- var WorkspaceIpSettings = _zod.z.object({
2597
- isEnabledForCloud: _zod.z.boolean(),
2598
- isEnabledForDocs: _zod.z.boolean(),
2599
- entries: _zod.z.array(WorkspaceIpWhitelistEntry)
2600
- });
2601
- var WorkspaceProfile = _zod.z.object({
2602
- name: _zod.z.string(),
2603
- handle: _zod.z.string(),
2604
- color: _zod.z.string(),
2605
- avatar: nullishToOptional(_zod.z.string()),
2606
- billingDetails: nullishToOptional(BillingDetails)
2607
- });
2608
- var WorkspaceProfileUpdate = WorkspaceProfile.omit({
2609
- avatar: true
2610
- });
2611
- var Workspace = _zod.z.object({
2612
- id: _zod.z.string(),
2613
- profile: WorkspaceProfile,
2614
- subscription: Subscription,
2615
- ipWhitelist: nullishToOptional(WorkspaceIpSettings),
2616
- sso: nullishToOptional(SsoProvider),
2617
- npmRegistrySettings: nullishToOptional(NpmRegistryConfig)
2618
- });
2619
- var WorkspaceWithDesignSystems = _zod.z.object({
2620
- workspace: Workspace,
2621
- designSystems: _zod.z.array(DesignSystem)
2622
- });
2623
- var DesignSystemSwitcher = _zod.z.object({
2624
- isEnabled: _zod.z.boolean(),
2625
- designSystemIds: _zod.z.array(_zod.z.string())
2626
- });
2627
- var DesignSystem = _zod.z.object({
2628
- id: _zod.z.string(),
2629
- workspaceId: _zod.z.string(),
2630
- name: _zod.z.string(),
2631
- description: _zod.z.string(),
2632
- docExporterId: nullishToOptional(_zod.z.string()),
2633
- docSlug: _zod.z.string(),
2634
- docUserSlug: nullishToOptional(_zod.z.string()),
2635
- docSlugDeprecated: _zod.z.string(),
2636
- isPublic: _zod.z.boolean(),
2637
- isMultibrand: _zod.z.boolean(),
2638
- docViewUrl: nullishToOptional(_zod.z.string()),
2639
- basePrefixes: _zod.z.array(_zod.z.string()),
2640
- designSystemSwitcher: nullishToOptional(DesignSystemSwitcher),
2641
- createdAt: _zod.z.coerce.date(),
2642
- updatedAt: _zod.z.coerce.date()
2643
- });
2644
- var DesignSystemWithWorkspace = _zod.z.object({
2645
- designSystem: DesignSystem,
2646
- workspace: Workspace
2647
- });
2648
- var DS_NAME_MIN_LENGTH = 2;
2649
- var DS_NAME_MAX_LENGTH = 64;
2650
- var DS_DESC_MAX_LENGTH = 64;
2651
- var DesignSystemUpdateInputMetadata = _zod.z.object({
2652
- name: _zod.z.string().min(DS_NAME_MIN_LENGTH).max(DS_NAME_MAX_LENGTH).trim().optional(),
2653
- description: _zod.z.string().max(DS_DESC_MAX_LENGTH).trim().optional()
2654
- });
2655
- var DesignSystemUpdateInput = DesignSystem.partial().omit({
2656
- id: true,
2657
- createdAt: true,
2658
- updatedAt: true,
2659
- docSlug: true,
2660
- docViewUrl: true,
2661
- designSystemSwitcher: true
2662
- }).extend({
2663
- meta: DesignSystemUpdateInputMetadata.optional()
2664
- });
2665
- var DS_NAME_MIN_LENGTH2 = 2;
2666
- var DS_NAME_MAX_LENGTH2 = 64;
2667
- var DS_DESC_MAX_LENGTH2 = 64;
2668
- var DesignSystemCreateInputMetadata = _zod.z.object({
2669
- name: _zod.z.string().min(DS_NAME_MIN_LENGTH2).max(DS_NAME_MAX_LENGTH2).trim(),
2670
- description: _zod.z.string().max(DS_DESC_MAX_LENGTH2).trim()
2671
- });
2672
- var DesignSystemCreateInput = _zod.z.object({
2673
- meta: DesignSystemCreateInputMetadata,
2674
- workspaceId: _zod.z.string(),
2675
- isPublic: _zod.z.boolean().optional(),
2676
- basePrefixes: _zod.z.array(_zod.z.string()).optional(),
2677
- docUserSlug: _zod.z.string().nullish().optional(),
2678
- source: _zod.z.array(_zod.z.string()).optional()
2679
- });
2680
- var ExporterPropertyImageValue = _zod.z.object({
2681
- asset: PageBlockAsset.optional(),
2682
- assetId: _zod.z.string().optional(),
2683
- assetUrl: _zod.z.string().optional()
2684
- });
2685
- var ExporterPropertyValue = _zod.z.object({
2686
- key: _zod.z.string(),
2687
- value: _zod.z.union([
2688
- _zod.z.number(),
2689
- _zod.z.string(),
2690
- _zod.z.boolean(),
2691
- ExporterPropertyImageValue,
2692
- ColorTokenData,
2693
- TypographyTokenData
2694
- ])
2695
- });
2696
- var ExporterPropertyValuesCollection = _zod.z.object({
2697
- id: _zod.z.string(),
2698
- designSystemId: _zod.z.string(),
2699
- exporterId: _zod.z.string(),
2700
- values: _zod.z.array(ExporterPropertyValue)
2701
- });
2702
- var PublishedDocPage = _zod.z.object({
2703
- id: _zod.z.string(),
2704
- publishedDocId: _zod.z.string(),
2705
- pageShortPersistentId: _zod.z.string(),
2706
- pathV1: _zod.z.string(),
2707
- pathV2: _zod.z.string(),
2708
- storagePath: _zod.z.string(),
2709
- locale: _zod.z.string().optional(),
2710
- isPrivate: _zod.z.boolean(),
2711
- isHidden: _zod.z.boolean(),
2712
- createdAt: _zod.z.coerce.date(),
2713
- updatedAt: _zod.z.coerce.date()
2714
- });
2715
- var publishedDocEnvironments = ["Live", "Preview"];
2716
- var PublishedDocEnvironment = _zod.z.enum(publishedDocEnvironments);
2717
- var PublishedDocsChecksums = _zod.z.record(_zod.z.string());
2718
- var PublishedDocRoutingVersion = _zod.z.enum(["1", "2"]);
2719
- var PublishedDoc = _zod.z.object({
2720
- id: _zod.z.string(),
2721
- designSystemVersionId: _zod.z.string(),
2722
- createdAt: _zod.z.coerce.date(),
2723
- updatedAt: _zod.z.coerce.date(),
2724
- lastPublishedAt: _zod.z.coerce.date(),
2725
- isDefault: _zod.z.boolean(),
2726
- isPublic: _zod.z.boolean(),
2727
- environment: PublishedDocEnvironment,
2728
- checksums: PublishedDocsChecksums,
2729
- storagePath: _zod.z.string(),
2730
- wasMigrated: _zod.z.boolean(),
2731
- routingVersion: PublishedDocRoutingVersion,
2732
- usesLocalizations: _zod.z.boolean(),
2733
- wasPublishedWithLocalizations: _zod.z.boolean(),
2734
- tokenCount: _zod.z.number(),
2735
- assetCount: _zod.z.number()
2736
- });
2737
- var DesignSystemVersion = _zod.z.object({
2738
- id: _zod.z.string(),
2739
- version: _zod.z.string(),
2740
- createdAt: _zod.z.date(),
2741
- designSystemId: _zod.z.string(),
2742
- name: _zod.z.string(),
2743
- comment: _zod.z.string(),
2744
- isReadonly: _zod.z.boolean(),
2745
- changeLog: _zod.z.string(),
2746
- parentId: _zod.z.string().optional(),
2747
- isDraftsFeatureAdopted: _zod.z.boolean()
2748
- });
2749
- var VersionCreationJobStatus = _zod.z.enum(["Success", "InProgress", "Error"]);
2750
- var VersionCreationJob = _zod.z.object({
2751
- id: _zod.z.string(),
2752
- version: _zod.z.string(),
2753
- designSystemId: _zod.z.string(),
2754
- designSystemVersionId: nullishToOptional(_zod.z.string()),
2755
- status: VersionCreationJobStatus,
2756
- errorMessage: nullishToOptional(_zod.z.string())
2757
- });
2758
- var BITBUCKET_SLUG = /^[-a-zA-Z0-9~]*$/;
2759
- var BITBUCKET_MAX_LENGTH = 64;
2760
- var ExportJobDocumentationChanges = _zod.z.object({
2761
- pagePersistentIds: _zod.z.string().array(),
2762
- groupPersistentIds: _zod.z.string().array()
2763
- });
2764
- var ExporterDestinationDocs = _zod.z.object({
2765
- environment: PublishedDocEnvironment,
2766
- changes: nullishToOptional(ExportJobDocumentationChanges)
2767
- });
2768
- var ExporterDestinationS3 = _zod.z.object({});
2769
- var ExporterDestinationGithub = _zod.z.object({
2770
- credentialId: _zod.z.string().optional(),
2771
- // Repository
2772
- url: _zod.z.string(),
2773
- // Location
2774
- branch: _zod.z.string(),
2775
- relativePath: nullishToOptional(_zod.z.string()),
2776
- // Legacy deprecated fields. Use `credentialId` instead
2777
- connectionId: nullishToOptional(_zod.z.string()),
2778
- userId: nullishToOptional(_zod.z.number())
2779
- });
2780
- var ExporterDestinationAzure = _zod.z.object({
2781
- credentialId: _zod.z.string().optional(),
2782
- // Repository
2783
- organizationId: _zod.z.string(),
2784
- projectId: _zod.z.string(),
2785
- repositoryId: _zod.z.string(),
2786
- // Location
2787
- branch: _zod.z.string(),
2788
- relativePath: nullishToOptional(_zod.z.string()),
2789
- // Maybe not needed
2790
- url: nullishToOptional(_zod.z.string()),
2791
- // Legacy deprecated fields. Use `credentialId` instead
2792
- connectionId: nullishToOptional(_zod.z.string()),
2793
- userId: nullishToOptional(_zod.z.number())
2794
- });
2795
- var ExporterDestinationGitlab = _zod.z.object({
2796
- credentialId: _zod.z.string().optional(),
2797
- // Repository
2798
- projectId: _zod.z.string(),
2799
- // Location
2800
- branch: _zod.z.string(),
2801
- relativePath: nullishToOptional(_zod.z.string()),
2802
- // Maybe not needed
2803
- url: nullishToOptional(_zod.z.string()),
2804
- // Legacy deprecated fields. Use `credentialId` instead
2805
- connectionId: nullishToOptional(_zod.z.string()),
2806
- userId: nullishToOptional(_zod.z.number())
2807
- });
2808
- var ExporterDestinationBitbucket = _zod.z.object({
2809
- credentialId: _zod.z.string().optional(),
2810
- // Repository
2811
- workspaceSlug: _zod.z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
2812
- projectKey: _zod.z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
2813
- repoSlug: _zod.z.string().max(BITBUCKET_MAX_LENGTH).regex(BITBUCKET_SLUG),
2814
- // Location
2815
- branch: _zod.z.string(),
2816
- relativePath: nullishToOptional(_zod.z.string()),
2817
- // Legacy deprecated fields. Use `credentialId` instead
2818
- connectionId: nullishToOptional(_zod.z.string()),
2819
- userId: nullishToOptional(_zod.z.number())
2820
- });
2821
- var ExportDestinationsMap = _zod.z.object({
2822
- webhookUrl: _zod.z.string().optional(),
2823
- destinationSnDocs: ExporterDestinationDocs.optional(),
2824
- destinationS3: ExporterDestinationS3.optional(),
2825
- destinationGithub: ExporterDestinationGithub.optional(),
2826
- destinationAzure: ExporterDestinationAzure.optional(),
2827
- destinationGitlab: ExporterDestinationGitlab.optional(),
2828
- destinationBitbucket: ExporterDestinationBitbucket.optional()
2829
- });
2830
- var PipelineEventType = _zod.z.enum(["OnVersionReleased", "OnHeadChanged", "OnSourceUpdated", "None"]);
2831
- var PipelineDestinationGitType = _zod.z.enum(["Github", "Gitlab", "Bitbucket", "Azure"]);
2832
- var PipelineDestinationExtraType = _zod.z.enum(["WebhookUrl", "S3", "Documentation"]);
2833
- var PipelineDestinationType = _zod.z.union([PipelineDestinationGitType, PipelineDestinationExtraType]);
2834
- var Pipeline = _zod.z.object({
2835
- id: _zod.z.string(),
2836
- name: _zod.z.string(),
2837
- eventType: PipelineEventType,
2838
- isEnabled: _zod.z.boolean(),
2839
- workspaceId: _zod.z.string(),
2840
- designSystemId: _zod.z.string(),
2841
- exporterId: _zod.z.string(),
2842
- brandPersistentId: _zod.z.string().optional(),
2843
- themePersistentId: _zod.z.string().optional(),
2844
- // Destinations
2845
- ...ExportDestinationsMap.shape
2846
- });
2847
- var ExportJobDump = _zod.z.object({
2848
- id: _zod.z.string(),
2849
- createdAt: _zod.z.coerce.date(),
2850
- finishedAt: _zod.z.coerce.date(),
2851
- exportArtefacts: _zod.z.string()
2852
- });
2853
- var CodeIntegrationDump = _zod.z.object({
2854
- exporters: Exporter.array(),
2855
- pipelines: Pipeline.array(),
2856
- exportJobs: ExportJobDump.array()
2857
- });
2858
- var DesignSystemVersionRoom = Entity.extend({
2859
- designSystemVersionId: _zod.z.string(),
2860
- liveblocksId: _zod.z.string()
2861
- });
2862
- var DesignSystemVersionRoomInternalSettings = _zod.z.object({
2863
- routingVersion: _zod.z.string(),
2864
- isDraftFeatureAdopted: _zod.z.boolean()
2865
- });
2866
- var DesignSystemVersionRoomInitialState = _zod.z.object({
2867
- pages: _zod.z.array(DocumentationPageV2),
2868
- groups: _zod.z.array(ElementGroup),
2869
- pageSnapshots: _zod.z.array(DocumentationPageSnapshot),
2870
- groupSnapshots: _zod.z.array(ElementGroupSnapshot),
2871
- internalSettings: DesignSystemVersionRoomInternalSettings
2872
- });
2873
- var DesignSystemVersionRoomUpdate = _zod.z.object({
2874
- pages: _zod.z.array(DocumentationPageV2),
2875
- groups: _zod.z.array(ElementGroup),
2876
- pageIdsToDelete: _zod.z.array(_zod.z.string()),
2877
- groupIdsToDelete: _zod.z.array(_zod.z.string()),
2878
- pageSnapshots: _zod.z.array(DocumentationPageSnapshot),
2879
- groupSnapshots: _zod.z.array(ElementGroupSnapshot),
2880
- pageSnapshotIdsToDelete: _zod.z.array(_zod.z.string()),
2881
- groupSnapshotIdsToDelete: _zod.z.array(_zod.z.string()),
2882
- pageHashesToUpdate: _zod.z.record(_zod.z.string(), _zod.z.string())
2883
- });
2884
- var DocumentationPageRoom = Entity.extend({
2885
- designSystemVersionId: _zod.z.string(),
2886
- documentationPageId: _zod.z.string(),
2887
- liveblocksId: _zod.z.string(),
2888
- isDirty: _zod.z.boolean()
2889
- });
2890
- var DocumentationPageRoomState = _zod.z.object({
2891
- pageItems: _zod.z.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
2892
- itemConfiguration: DocumentationItemConfigurationV2
2893
- });
2894
- var DocumentationPageRoomRoomUpdate = _zod.z.object({
2895
- page: DocumentationPageV2,
2896
- pageParent: ElementGroup
2897
- });
2898
- var DocumentationPageRoomInitialStateUpdate = DocumentationPageRoomRoomUpdate.extend({
2899
- pageItems: _zod.z.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
2900
- blockDefinitions: _zod.z.array(PageBlockDefinition)
2901
- });
2902
- var RestoredDocumentationPage = _zod.z.object({
2903
- page: DocumentationPageV2,
2904
- pageParent: ElementGroup,
2905
- pageContent: DocumentationPageContentData,
2906
- contentHash: _zod.z.string(),
2907
- roomId: _zod.z.string().optional()
2908
- });
2909
- var RestoredDocumentationGroup = _zod.z.object({
2910
- group: ElementGroup,
2911
- parent: ElementGroup
2912
- });
2913
- var RoomTypeEnum = /* @__PURE__ */ ((RoomTypeEnum2) => {
2914
- RoomTypeEnum2["DocumentationPage"] = "documentation-page";
2915
- RoomTypeEnum2["DesignSystemVersion"] = "design-system-version";
2916
- RoomTypeEnum2["Workspace"] = "workspace";
2917
- return RoomTypeEnum2;
2918
- })(RoomTypeEnum || {});
2919
- var RoomTypeSchema = _zod.z.nativeEnum(RoomTypeEnum);
2920
- var RoomType = RoomTypeSchema.enum;
2921
- var WorkspaceRoom = Entity.extend({
2922
- workspaceId: _zod.z.string(),
2923
- liveblocksId: _zod.z.string()
2924
- });
2925
- var PublishedDocsDump = _zod.z.object({
2926
- documentation: PublishedDoc,
2927
- pages: PublishedDocPage.array()
2928
- });
2929
- var DocumentationThreadDump = _zod.z.object({
2930
- thread: DocumentationCommentThread,
2931
- comments: DocumentationComment.array()
2932
- });
2933
- var DocumentationPageRoomDump = _zod.z.object({
2934
- room: DocumentationPageRoom,
2935
- threads: DocumentationThreadDump.array()
2936
- });
2937
- var DesignSystemVersionMultiplayerDump = _zod.z.object({
2938
- documentationPages: DocumentationPageRoomDump.array()
2939
- });
2940
- var DesignSystemVersionDump = _zod.z.object({
2941
- version: DesignSystemVersion,
2942
- brands: Brand.array(),
2943
- elements: DesignElement.array(),
2944
- elementPropertyDefinitions: ElementPropertyDefinition.array(),
2945
- elementPropertyValues: ElementPropertyValue.array(),
2946
- elementViews: ElementView.array(),
2947
- elementColumns: ElementViewColumn.array(),
2948
- documentationPageContents: DocumentationPageContent.array(),
2949
- documentationPageRooms: DocumentationPageRoomDump.array(),
2950
- publishedDocumentations: PublishedDocsDump.array(),
2951
- assetReferences: AssetReference.array()
2952
- });
2953
- var DesignSystemDump = _zod.z.object({
2954
- designSystem: DesignSystem,
2955
- dataSources: DataSource.array(),
2956
- versions: DesignSystemVersionDump.array(),
2957
- customDomain: CustomDomain.optional(),
2958
- files: Asset.array()
2959
- });
2960
- var IntegrationAuthType = _zod.z.union([_zod.z.literal("OAuth2"), _zod.z.literal("PAT")]);
2961
- var ExternalServiceType = _zod.z.union([
2962
- _zod.z.literal("figma"),
2963
- _zod.z.literal("github"),
2964
- _zod.z.literal("azure"),
2965
- _zod.z.literal("gitlab"),
2966
- _zod.z.literal("bitbucket")
2967
- ]);
2968
- var IntegrationUserInfo = _zod.z.object({
2969
- id: _zod.z.string(),
2970
- handle: _zod.z.string().optional(),
2971
- avatarUrl: _zod.z.string().optional(),
2972
- email: _zod.z.string().optional(),
2973
- authType: IntegrationAuthType.optional(),
2974
- customUrl: _zod.z.string().optional()
2975
- });
2976
- var UserLinkedIntegrations = _zod.z.object({
2977
- figma: IntegrationUserInfo.optional(),
2978
- github: IntegrationUserInfo.array().optional(),
2979
- azure: IntegrationUserInfo.array().optional(),
2980
- gitlab: IntegrationUserInfo.array().optional(),
2981
- bitbucket: IntegrationUserInfo.array().optional()
2982
- });
2983
- var UserAnalyticsCleanupSchedule = _zod.z.object({
2984
- userId: _zod.z.string(),
2985
- createdAt: _zod.z.coerce.date(),
2986
- deleteAt: _zod.z.coerce.date()
2987
- });
2988
- var UserAnalyticsCleanupScheduleDbInput = UserAnalyticsCleanupSchedule.omit({
2989
- createdAt: true
2990
- });
2991
- var CreateUserInput = _zod.z.object({
2992
- email: _zod.z.string(),
2993
- name: _zod.z.string(),
2994
- username: _zod.z.string()
2995
- });
2996
- var UserIdentity = _zod.z.object({
2997
- id: _zod.z.string(),
2998
- userId: _zod.z.string()
2999
- });
3000
- var UserMinified = _zod.z.object({
3001
- id: _zod.z.string(),
3002
- name: _zod.z.string(),
3003
- email: _zod.z.string(),
3004
- avatar: _zod.z.string().optional()
3005
- });
3006
- var LiveblocksNotificationSettings = _zod.z.object({
3007
- sendCommentNotificationEmails: _zod.z.boolean()
3008
- });
3009
- var UserNotificationSettings = _zod.z.object({
3010
- liveblocksNotificationSettings: LiveblocksNotificationSettings
3011
- });
3012
- var UserOnboardingDepartment = _zod.z.enum(["Design", "Engineering", "Product", "Brand", "Other"]);
3013
- var UserOnboardingJobLevel = _zod.z.enum(["Executive", "Manager", "IndividualContributor", "Other"]);
3014
- var UserOnboarding = _zod.z.object({
3015
- companyName: _zod.z.string().optional(),
3016
- numberOfPeopleInOrg: _zod.z.string().optional(),
3017
- numberOfPeopleInDesignTeam: _zod.z.string().optional(),
3018
- department: UserOnboardingDepartment.optional(),
3019
- jobTitle: _zod.z.string().optional(),
3020
- phase: _zod.z.string().optional(),
3021
- jobLevel: UserOnboardingJobLevel.optional(),
3022
- designSystemName: _zod.z.string().optional(),
3023
- defaultDestination: _zod.z.string().optional(),
3024
- figmaUrl: _zod.z.string().optional()
3025
- });
3026
- var UserProfile = _zod.z.object({
3027
- name: _zod.z.string(),
3028
- avatar: _zod.z.string().optional(),
3029
- nickname: _zod.z.string().optional(),
3030
- onboarding: UserOnboarding.optional()
3031
- });
3032
- var UserProfileUpdate = UserProfile.partial().omit({
3033
- avatar: true
3034
- });
3035
- var UserTest = _zod.z.object({
3036
- id: _zod.z.string(),
3037
- email: _zod.z.string()
3038
- });
3039
- var User = _zod.z.object({
3040
- id: _zod.z.string(),
3041
- email: _zod.z.string(),
3042
- emailVerified: _zod.z.boolean(),
3043
- createdAt: _zod.z.coerce.date(),
3044
- trialExpiresAt: _zod.z.coerce.date().optional(),
3045
- profile: UserProfile,
3046
- linkedIntegrations: UserLinkedIntegrations.optional(),
3047
- loggedOutAt: _zod.z.coerce.date().optional(),
3048
- isProtected: _zod.z.boolean()
3049
- });
3050
- var SupernovaException = class _SupernovaException extends Error {
3051
- //
3052
- // Properties
3053
- //
3054
- constructor(type, message) {
3055
- super(`${type}: ${message}`);
3056
- this.type = type;
3057
- }
3058
- static wrongFormat(message) {
3059
- return new _SupernovaException("WrongFormat", message);
3060
- }
3061
- static validationError(message) {
3062
- return new _SupernovaException("ValidationError", message);
3063
- }
3064
- static accessDenied(message) {
3065
- return new _SupernovaException("AccessDenied", message);
3066
- }
3067
- static tooMuchWork(message) {
3068
- return new _SupernovaException("TooMuchWork", message);
3069
- }
3070
- static notFound(message) {
3071
- return new _SupernovaException("ResourceNotFound", message);
3072
- }
3073
- static timeout(message) {
3074
- return new _SupernovaException("Timeout", message);
3075
- }
3076
- static conflict(message) {
3077
- return new _SupernovaException("Conflict", message);
3078
- }
3079
- static notImplemented(message) {
3080
- return new _SupernovaException("NotImplemented", message);
3081
- }
3082
- static wrongActionOrder(message) {
3083
- return new _SupernovaException("WrongActionOrder", message);
3084
- }
3085
- static invalidOperation(message) {
3086
- return new _SupernovaException("InvalidOperation", message);
3087
- }
3088
- static shouldNotHappen(message) {
3089
- return new _SupernovaException("UnexpectedError", message);
3090
- }
3091
- static ipRestricted(message) {
3092
- return new _SupernovaException("IPRestricted", message);
3093
- }
3094
- static planRestricted(message) {
3095
- return new _SupernovaException("PlanRestricted", message);
3096
- }
3097
- static missingWorkspacePermission(message) {
3098
- return new _SupernovaException("MissingWorkspacePermission", message);
3099
- }
3100
- static missingExporterPermission(message) {
3101
- return new _SupernovaException("MissingExporterPermission", message);
3102
- }
3103
- static missingIntegration(message) {
3104
- return new _SupernovaException("MissingIntegration", message);
3105
- }
3106
- static missingIntegrationAccess(message) {
3107
- return new _SupernovaException("MissingIntegrationAccess", message);
3108
- }
3109
- static noAccess(message) {
3110
- return new _SupernovaException("NoAccess", message);
3111
- }
3112
- static missingCredentials(message) {
3113
- return new _SupernovaException("MissingCredentials", message);
3114
- }
3115
- static thirdPartyError(message) {
3116
- return new _SupernovaException("ThirdPartyError", message);
3117
- }
3118
- //
3119
- // To refactor
3120
- //
3121
- static badRequest(message) {
3122
- return new _SupernovaException("BadRequest", message);
3123
- }
3124
- };
3125
- function tryParseUrl(url) {
3126
- try {
3127
- return parseUrl(url);
3128
- } catch (e) {
3129
- console.error(`Error parsing URL ${url}`);
3130
- console.error(e);
3131
- return null;
3132
- }
3133
- }
3134
- function parseUrl(url) {
3135
- return new URL(url.startsWith("https://") || url.startsWith("http://") ? url : `https://${url}`);
3136
- }
3137
- function mapByUnique(items, keyFn) {
3138
- const result = /* @__PURE__ */ new Map();
3139
- for (const item of items) {
3140
- result.set(keyFn(item), item);
3141
- }
3142
- return result;
3143
- }
3144
- function groupBy(items, keyFn) {
3145
- const result = /* @__PURE__ */ new Map();
3146
- for (const item of items) {
3147
- const key = keyFn(item);
3148
- const array = result.get(key);
3149
- if (array) {
3150
- array.push(item);
3151
- } else {
3152
- result.set(key, [item]);
3153
- }
3154
- }
3155
- return result;
3156
- }
3157
- var ContentLoadInstruction = _zod.z.object({
3158
- from: _zod.z.string(),
3159
- to: _zod.z.string(),
3160
- authorizationHeaderKvsId: _zod.z.string().optional(),
3161
- 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()
3162
2590
  });
3163
2591
  var ContentLoaderPayload = _zod.z.object({
3164
2592
  type: _zod.z.literal("Single"),
@@ -3177,7 +2605,7 @@ var ContentLoaderPayload = _zod.z.object({
3177
2605
  );
3178
2606
  function slugify(str, options) {
3179
2607
  const slug = _slugify2.default.call(void 0, _nullishCoalesce(str, () => ( "")), options);
3180
- return _optionalChain([slug, 'optionalAccess', _ => _.length]) > 0 ? slug : "item";
2608
+ return _optionalChain([slug, 'optionalAccess', _2 => _2.length]) > 0 ? slug : "item";
3181
2609
  }
3182
2610
  var RESERVED_SLUGS = [
3183
2611
  "workspaces",
@@ -3800,6 +3228,591 @@ var RESERVED_SLUGS = [
3800
3228
  ];
3801
3229
  var RESERVED_SLUGS_SET = new Set(RESERVED_SLUGS);
3802
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
+ });
3803
3816
  var IntegrationDesignSystem = _zod.z.object({
3804
3817
  designSystemId: _zod.z.string(),
3805
3818
  brandId: _zod.z.string(),
@@ -3867,7 +3880,7 @@ var IntegrationToken = _zod.z.object({
3867
3880
  token_bitbucket_username: _zod.z.string().optional(),
3868
3881
  // Bitbucket only
3869
3882
  custom_url: _zod.z.string().optional().transform((value) => {
3870
- if (!_optionalChain([value, 'optionalAccess', _2 => _2.trim, 'call', _3 => _3()]))
3883
+ if (!_optionalChain([value, 'optionalAccess', _3 => _3.trim, 'call', _4 => _4()]))
3871
3884
  return void 0;
3872
3885
  return formatCustomUrl(value);
3873
3886
  })
@@ -4175,7 +4188,7 @@ var CreateWorkspaceInput = _zod.z.object({
4175
4188
  product: ProductCodeSchema,
4176
4189
  priceId: _zod.z.string(),
4177
4190
  billingEmail: _zod.z.string().email().optional(),
4178
- 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(),
4179
4192
  invites: UserInvites.optional(),
4180
4193
  promoCode: _zod.z.string().optional(),
4181
4194
  status: InternalStatusSchema.optional(),
@@ -4298,7 +4311,7 @@ function calculateElementParentChain(elementParentPersistentId, groupPersistentI
4298
4311
  const parent = groupPersistentIdToGroupMap.get(parentId);
4299
4312
  if (parent)
4300
4313
  result.push(parent);
4301
- parentId = _optionalChain([parent, 'optionalAccess', _5 => _5.parentPersistentId]);
4314
+ parentId = _optionalChain([parent, 'optionalAccess', _6 => _6.parentPersistentId]);
4302
4315
  }
4303
4316
  return result;
4304
4317
  }
@@ -4307,7 +4320,7 @@ function applyPrivacyConfigurationToNestedItems(pages, groups, getDefaultItemCon
4307
4320
  ...group,
4308
4321
  data: {
4309
4322
  ...group.data,
4310
- 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()))
4311
4324
  }
4312
4325
  }));
4313
4326
  const groupPersistentIdToGroupMap = mapByUnique(fixedGroups, (group) => group.persistentId);
@@ -4319,8 +4332,8 @@ function applyPrivacyConfigurationToNestedItems(pages, groups, getDefaultItemCon
4319
4332
  const parent = groupPersistentIdToGroupMap.get(nextParentId);
4320
4333
  if (!parent)
4321
4334
  break;
4322
- isHidden = isHidden || _optionalChain([parent, 'access', _8 => _8.data, 'optionalAccess', _9 => _9.configuration, 'optionalAccess', _10 => _10.isHidden]) || false;
4323
- 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;
4324
4337
  nextParentId = parent.parentPersistentId;
4325
4338
  }
4326
4339
  groupToFix.data.configuration.isHidden = isHidden;
@@ -4328,7 +4341,7 @@ function applyPrivacyConfigurationToNestedItems(pages, groups, getDefaultItemCon
4328
4341
  }
4329
4342
  const fixedPages = [];
4330
4343
  for (const page of pages) {
4331
- 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()));
4332
4345
  const parent = groupPersistentIdToGroupMap.get(page.parentPersistentId);
4333
4346
  fixedPages.push({
4334
4347
  ...page,
@@ -4336,8 +4349,8 @@ function applyPrivacyConfigurationToNestedItems(pages, groups, getDefaultItemCon
4336
4349
  ...page.data,
4337
4350
  configuration: {
4338
4351
  ...configuration,
4339
- isHidden: configuration.isHidden || _optionalChain([parent, 'optionalAccess', _16 => _16.data, 'optionalAccess', _17 => _17.configuration, 'optionalAccess', _18 => _18.isHidden]) || false,
4340
- 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
4341
4354
  }
4342
4355
  }
4343
4356
  });
@@ -4355,7 +4368,7 @@ function elementGroupsToDocumentationGroupDTOV1(groups, pages) {
4355
4368
  return groups.map((group) => {
4356
4369
  return {
4357
4370
  ...elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap),
4358
- 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]))
4359
4372
  };
4360
4373
  });
4361
4374
  }
@@ -4363,7 +4376,7 @@ function elementGroupsToDocumentationGroupFixedConfigurationDTOV1(groups, pages)
4363
4376
  const childrenIdsMap = calculateChildrenIdsMapV1(pages, groups);
4364
4377
  const { groups: fixedGroups } = applyPrivacyConfigurationToNestedItems(pages, groups, getDtoDefaultItemConfigurationV1);
4365
4378
  return fixedGroups.map((group) => {
4366
- 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]));
4367
4380
  return {
4368
4381
  ...elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap),
4369
4382
  // backward compatibility with custom doc exporters, anyway these groups will not be shown, so we can adjust title
@@ -4388,7 +4401,7 @@ function elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap) {
4388
4401
  title: group.meta.name,
4389
4402
  childrenIds,
4390
4403
  isRoot: !group.parentPersistentId,
4391
- 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")),
4392
4405
  shortPersistentId: group.shortPersistentId,
4393
4406
  type: "Group"
4394
4407
  };
@@ -4457,10 +4470,10 @@ function elementGroupToDocumentationGroupStructureDTOV2(group, childrenIdsMap) {
4457
4470
  createdAt: group.createdAt,
4458
4471
  updatedAt: group.updatedAt,
4459
4472
  title: group.meta.name,
4460
- 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])),
4461
4474
  childrenIds,
4462
4475
  isRoot: !group.parentPersistentId,
4463
- 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")),
4464
4477
  shortPersistentId: group.shortPersistentId,
4465
4478
  type: "Group"
4466
4479
  };
@@ -4613,7 +4626,7 @@ function integrationToDto(integration) {
4613
4626
  workspaceId: integration.workspaceId,
4614
4627
  type: integration.type,
4615
4628
  createdAt: integration.createdAt,
4616
- 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)]),
4617
4630
  integrationDesignSystems: _nullishCoalesce(integration.integrationDesignSystems, () => ( void 0))
4618
4631
  };
4619
4632
  }
@@ -5072,7 +5085,9 @@ var DTODocumentationDraftStateUpdated = _zod.z.object({
5072
5085
  })
5073
5086
  });
5074
5087
  var DTODocumentationDraftStateDeleted = _zod.z.object({
5075
- 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()
5076
5091
  });
5077
5092
  var DTODocumentationDraftState = _zod.z.discriminatedUnion("changeType", [
5078
5093
  DTODocumentationDraftStateCreated,
@@ -5080,6 +5095,13 @@ var DTODocumentationDraftState = _zod.z.discriminatedUnion("changeType", [
5080
5095
  DTODocumentationDraftStateDeleted
5081
5096
  ]);
5082
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
+
5083
5105
  // src/api/dto/elements/documentation/page-v2.ts
5084
5106
  var DTODocumentationPageV2 = _zod.z.object({
5085
5107
  id: _zod.z.string(),
@@ -5095,6 +5117,8 @@ var DTODocumentationPageV2 = _zod.z.object({
5095
5117
  path: _zod.z.string(),
5096
5118
  /** Defined when a page has changed since last publish and can be included into a partial publish */
5097
5119
  draftState: DTODocumentationDraftState.optional(),
5120
+ /** Defined if a page was published at least once and contains metadata about last publish */
5121
+ publishMetadata: DTODocumentationPublishMetadata.optional(),
5098
5122
  // Backward compatibility
5099
5123
  type: _zod.z.literal("Page")
5100
5124
  });
@@ -5306,7 +5330,9 @@ var DTODocumentationGroupV2 = ElementGroup.omit({
5306
5330
  configuration: DTODocumentationItemConfigurationV2,
5307
5331
  type: _zod.z.literal("Group"),
5308
5332
  /** Defined when a group has changed since last publish and can be included into a partial publish */
5309
- 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()
5310
5336
  });
5311
5337
  var DTOCreateDocumentationGroupInput = _zod.z.object({
5312
5338
  // Identifier
@@ -5479,18 +5505,6 @@ var DTODocumentationHierarchyV2 = _zod.z.object({
5479
5505
  /** Defined when a page has changed since last publish and can be included into a partial publish */
5480
5506
  draftState: DTODocumentationDraftState.optional()
5481
5507
  })
5482
- ),
5483
- deletedPages: _zod.z.array(
5484
- DTODocumentationPageV2.extend({
5485
- /** Deleted page is always a draft change */
5486
- draftState: DTODocumentationDraftState
5487
- })
5488
- ),
5489
- deletedGroups: _zod.z.array(
5490
- DTODocumentationGroupV2.extend({
5491
- /** Deleted page is always a draft change */
5492
- draftState: DTODocumentationDraftState
5493
- })
5494
5508
  )
5495
5509
  });
5496
5510
 
@@ -6131,7 +6145,8 @@ var FrontendVersionRoomYDoc = class {
6131
6145
  //
6132
6146
  // Hierarchy
6133
6147
  //
6134
- getDocumentationHierarchy() {
6148
+ getDocumentationHierarchy(options = {}) {
6149
+ const { includeDeletedContent } = options;
6135
6150
  const doc = new VersionRoomBaseYDoc(this.yDoc);
6136
6151
  const pages = doc.getPages();
6137
6152
  const groups = doc.getGroups();
@@ -6143,48 +6158,28 @@ var FrontendVersionRoomYDoc = class {
6143
6158
  if (!settings.isDraftFeatureAdopted) {
6144
6159
  return {
6145
6160
  pages: pageDTOs,
6146
- groups: groupDTOs,
6147
- deletedGroups: [],
6148
- deletedPages: []
6161
+ groups: groupDTOs
6149
6162
  };
6150
6163
  }
6151
6164
  const pageDraftStates = this.buildPageDraftStates(pages, pageSnapshots);
6165
+ const pagePublishedMetadata = this.buildPagePublishedMetadata(pages, pageSnapshots);
6152
6166
  pageDTOs.forEach((p) => {
6153
6167
  const draftState = pageDraftStates.get(p.id);
6154
6168
  draftState && (p.draftState = draftState);
6169
+ const publishMetadata = pagePublishedMetadata.get(p.id);
6170
+ publishMetadata && (p.publishMetadata = publishMetadata);
6155
6171
  });
6156
6172
  const groupDraftStates = this.buildGroupDraftStates(groups, groupSnapshots);
6173
+ const groupPublishedMetadata = this.buildGroupPublishedMetadata(groups, groupSnapshots);
6157
6174
  groupDTOs.forEach((g) => {
6158
6175
  const draftState = groupDraftStates.get(g.id);
6159
6176
  draftState && (g.draftState = draftState);
6160
- });
6161
- const pageIds = new Set(pages.map((p) => p.id));
6162
- const deletedPagesMap = mapByUnique(
6163
- pageSnapshots.filter((s) => !pageIds.has(s.page.id)).map((s) => s.page),
6164
- (p) => p.id
6165
- );
6166
- const deletedPages = Array.from(deletedPagesMap.values());
6167
- const groupIds = new Set(groups.map((p) => p.id));
6168
- const deletedGroupsMap = mapByUnique(
6169
- groupSnapshots.filter((s) => !groupIds.has(s.group.id)).map((s) => s.group),
6170
- (g) => g.id
6171
- );
6172
- const deletedGroups = Array.from(deletedGroupsMap.values());
6173
- const deletedPageDTOs = documentationPagesToDTOV2(
6174
- deletedPages,
6175
- [...groups, ...deletedGroups],
6176
- settings.routingVersion
6177
- ).map((p) => {
6178
- return { ...p, draftState: { changeType: "Deleted" } };
6179
- });
6180
- const deletedGroupDTOs = elementGroupsToDocumentationGroupDTOV2(deletedGroups, deletedPages).map((g) => {
6181
- return { ...g, draftState: { changeType: "Deleted" } };
6177
+ const publishMetadata = groupPublishedMetadata.get(g.id);
6178
+ publishMetadata && (g.publishMetadata = publishMetadata);
6182
6179
  });
6183
6180
  return {
6184
6181
  pages: pageDTOs,
6185
- groups: groupDTOs,
6186
- deletedPages: deletedPageDTOs,
6187
- deletedGroups: deletedGroupDTOs
6182
+ groups: groupDTOs
6188
6183
  };
6189
6184
  }
6190
6185
  //
@@ -6207,7 +6202,7 @@ var FrontendVersionRoomYDoc = class {
6207
6202
  const publishedPage = publishedPagesById.get(snapshot.page.id);
6208
6203
  publishedState = this.itemStateFromPage(publishedPage, snapshot.pageContentHash);
6209
6204
  }
6210
- 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]))), () => ( ""));
6211
6206
  const currentState = this.itemStateFromPage(page, currentPageContentHash);
6212
6207
  const draftState = this.createDraftState(page.persistentId, currentState, publishedState);
6213
6208
  if (draftState)
@@ -6215,6 +6210,40 @@ var FrontendVersionRoomYDoc = class {
6215
6210
  });
6216
6211
  return result;
6217
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
+ }
6218
6247
  itemStateFromPage(page, pageContentHash) {
6219
6248
  return {
6220
6249
  title: page.meta.name,
@@ -6251,7 +6280,7 @@ var FrontendVersionRoomYDoc = class {
6251
6280
  itemStateFromGroup(group) {
6252
6281
  return {
6253
6282
  title: group.meta.name,
6254
- 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)),
6255
6284
  contentHash: "-"
6256
6285
  };
6257
6286
  }
@@ -6312,6 +6341,10 @@ var FrontendVersionRoomYDoc = class {
6312
6341
  const settings = doc.getDocumentationInternalSettings();
6313
6342
  return settings.isDraftFeatureAdopted;
6314
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
+ }
6315
6348
  };
6316
6349
 
6317
6350
  // src/yjs/design-system-content/documentation-hierarchy.ts
@@ -6336,7 +6369,7 @@ var DTODocumentationPageRoomHeaderDataUpdate = _zod.z.object({
6336
6369
  function itemConfigurationToYjs(yDoc, item) {
6337
6370
  yDoc.transact((trx) => {
6338
6371
  const { title, configuration } = item;
6339
- const header = _optionalChain([configuration, 'optionalAccess', _38 => _38.header]);
6372
+ const header = _optionalChain([configuration, 'optionalAccess', _39 => _39.header]);
6340
6373
  if (title !== void 0) {
6341
6374
  const headerYMap = trx.doc.getMap("itemTitle");
6342
6375
  headerYMap.set("title", title);
@@ -6354,9 +6387,9 @@ function itemConfigurationToYjs(yDoc, item) {
6354
6387
  header.minHeight !== void 0 && headerYMap.set("minHeight", header.minHeight);
6355
6388
  }
6356
6389
  const configYMap = trx.doc.getMap("itemConfiguration");
6357
- _optionalChain([configuration, 'optionalAccess', _39 => _39.showSidebar]) !== void 0 && configYMap.set("showSidebar", configuration.showSidebar);
6358
- _optionalChain([configuration, 'optionalAccess', _40 => _40.isHidden]) !== void 0 && configYMap.set("isHidden", configuration.isHidden);
6359
- _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);
6360
6393
  });
6361
6394
  }
6362
6395
  function yjsToItemConfiguration(yDoc) {
@@ -7148,7 +7181,7 @@ var ListTreeBuilder = class {
7148
7181
  }
7149
7182
  addWithProperty(block, multiRichTextProperty) {
7150
7183
  const parsedOptions = PageBlockDefinitionMutiRichTextOptions.optional().parse(multiRichTextProperty.options);
7151
- 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");
7152
7185
  }
7153
7186
  add(block, multiRichTextPropertyId, multiRichTextPropertyStyle) {
7154
7187
  const list = this.createList(block, multiRichTextPropertyId, multiRichTextPropertyStyle);
@@ -7168,7 +7201,7 @@ var ListTreeBuilder = class {
7168
7201
  }
7169
7202
  const listParent = this.getParentOfDepth(block.data.indentLevel);
7170
7203
  const lastChild = listParent.children[listParent.children.length - 1];
7171
- if (_optionalChain([lastChild, 'optionalAccess', _43 => _43.type]) === "List") {
7204
+ if (_optionalChain([lastChild, 'optionalAccess', _44 => _44.type]) === "List") {
7172
7205
  lastChild.children.push(...list.leadingChildren);
7173
7206
  return;
7174
7207
  } else {
@@ -7355,7 +7388,7 @@ function serializeAsRichTextBlock(input) {
7355
7388
  const textPropertyValue = BlockParsingUtils.richTextPropertyValue(blockItem, richTextProperty.id);
7356
7389
  const enrichedInput = { ...input, richTextPropertyValue: textPropertyValue };
7357
7390
  const parsedOptions = PageBlockDefinitionRichTextOptions.optional().parse(richTextProperty.options);
7358
- const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess', _44 => _44.richTextStyle]), () => ( "Default"));
7391
+ const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess', _45 => _45.richTextStyle]), () => ( "Default"));
7359
7392
  switch (style) {
7360
7393
  case "Callout":
7361
7394
  return serializeAsCallout(enrichedInput);
@@ -7577,7 +7610,7 @@ function serializeBlockNodeAttributes(block) {
7577
7610
  };
7578
7611
  }
7579
7612
  function richTextHeadingLevel(property) {
7580
- 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]);
7581
7614
  if (!style)
7582
7615
  return void 0;
7583
7616
  switch (style) {
@@ -7690,7 +7723,7 @@ function serializeAsCustomBlock(block, definition) {
7690
7723
  linksTo: i.linksTo
7691
7724
  };
7692
7725
  });
7693
- 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]);
7694
7727
  return {
7695
7728
  type: serializeCustomBlockNodeType(block, definition),
7696
7729
  attrs: {
@@ -10310,10 +10343,10 @@ function parseAsMultiRichText(prosemirrorNode, definition, property, definitions
10310
10343
  const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
10311
10344
  const result = [];
10312
10345
  const listItems = [];
10313
- _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) => {
10314
10347
  if (c.type !== "listItem")
10315
10348
  return;
10316
- _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) => {
10317
10350
  listItems.push(cc);
10318
10351
  })]);
10319
10352
  })]);
@@ -10416,17 +10449,17 @@ function parseAsTable(prosemirrorNode, definition, property) {
10416
10449
  return null;
10417
10450
  const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
10418
10451
  const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", _zod.z.boolean().optional()) !== false;
10419
- 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")]);
10420
10453
  if (!tableChild) {
10421
10454
  return emptyTable(id, variantId, 0);
10422
10455
  }
10423
- 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]))]), () => ( []));
10424
10457
  if (!rows.length) {
10425
10458
  return emptyTable(id, variantId, 0);
10426
10459
  }
10427
- 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));
10428
- const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access', _69 => _69.content, 'optionalAccess', _70 => _70[0], 'optionalAccess', _71 => _71.type]) === "tableHeader").length;
10429
- 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;
10430
10463
  const hasHeaderColumn = rows.length === columnHeaderCells;
10431
10464
  const tableValue = {
10432
10465
  showBorder: hasBorder,
@@ -10508,7 +10541,7 @@ function parseAsTableNode(prosemirrorNode) {
10508
10541
  const parsedItems = PageBlockItemV2.array().safeParse(JSON.parse(items));
10509
10542
  if (!parsedItems.success)
10510
10543
  return null;
10511
- 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]);
10512
10545
  if (!rawImagePropertyValue)
10513
10546
  return null;
10514
10547
  const imagePropertyValueParseResult = PageBlockItemImageValue.safeParse(rawImagePropertyValue);
@@ -10744,7 +10777,7 @@ function getProsemirrorBlockVariantId(prosemirrorNode) {
10744
10777
  return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(_zod.z.string()));
10745
10778
  }
10746
10779
  function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
10747
- 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]]));
10748
10781
  if (parsedAttr.success) {
10749
10782
  return parsedAttr.data;
10750
10783
  } else {