@supernova-studio/client 0.58.19 → 1.0.0-alpha.3

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.
Files changed (196) hide show
  1. package/dist/index.d.mts +1363 -1321
  2. package/dist/index.d.ts +1363 -1321
  3. package/dist/index.js +536 -339
  4. package/dist/index.js.map +1 -1
  5. package/dist/index.mjs +839 -642
  6. package/dist/index.mjs.map +1 -1
  7. package/package.json +4 -3
  8. package/src/api/client.ts +0 -31
  9. package/src/api/conversion/documentation/documentation-group-v1-to-dto.ts +0 -114
  10. package/src/api/conversion/documentation/documentation-group-v2-to-dto.ts +0 -92
  11. package/src/api/conversion/documentation/documentation-item-configuration-v1-to-dto.ts +0 -52
  12. package/src/api/conversion/documentation/documentation-item-configuration-v2-to-dto.ts +0 -34
  13. package/src/api/conversion/documentation/documentation-page-to-dto-utils.ts +0 -131
  14. package/src/api/conversion/documentation/documentation-page-v1-to-dto.ts +0 -69
  15. package/src/api/conversion/documentation/documentation-page-v2-to-dto.ts +0 -72
  16. package/src/api/conversion/documentation/index.ts +0 -7
  17. package/src/api/conversion/export/index.ts +0 -1
  18. package/src/api/conversion/export/pipeline.ts +0 -25
  19. package/src/api/conversion/index.ts +0 -3
  20. package/src/api/conversion/integrations/git.ts +0 -37
  21. package/src/api/conversion/integrations/index.ts +0 -2
  22. package/src/api/conversion/integrations/integration.ts +0 -37
  23. package/src/api/dto/aux/color.ts +0 -7
  24. package/src/api/dto/aux/index.ts +0 -3
  25. package/src/api/dto/aux/meta.ts +0 -8
  26. package/src/api/dto/aux/pagination.ts +0 -8
  27. package/src/api/dto/bff/app-bootstrap-data.ts +0 -20
  28. package/src/api/dto/bff/index.ts +0 -1
  29. package/src/api/dto/collections/index.ts +0 -1
  30. package/src/api/dto/collections/token-collection.ts +0 -24
  31. package/src/api/dto/design-systems/brand.ts +0 -44
  32. package/src/api/dto/design-systems/component.ts +0 -40
  33. package/src/api/dto/design-systems/contact.ts +0 -11
  34. package/src/api/dto/design-systems/data-source.ts +0 -141
  35. package/src/api/dto/design-systems/design-system.ts +0 -68
  36. package/src/api/dto/design-systems/elements-diff.ts +0 -14
  37. package/src/api/dto/design-systems/figma-variables.ts +0 -108
  38. package/src/api/dto/design-systems/import-job.ts +0 -61
  39. package/src/api/dto/design-systems/index.ts +0 -13
  40. package/src/api/dto/design-systems/members.ts +0 -50
  41. package/src/api/dto/design-systems/role.ts +0 -11
  42. package/src/api/dto/design-systems/stats.ts +0 -19
  43. package/src/api/dto/design-systems/version.ts +0 -56
  44. package/src/api/dto/design-systems/view.ts +0 -45
  45. package/src/api/dto/design-tokens/design-token.ts +0 -78
  46. package/src/api/dto/design-tokens/index.ts +0 -1
  47. package/src/api/dto/documentation/anchor.ts +0 -15
  48. package/src/api/dto/documentation/approvals.ts +0 -15
  49. package/src/api/dto/documentation/block-definition.ts +0 -28
  50. package/src/api/dto/documentation/block.ts +0 -6
  51. package/src/api/dto/documentation/documentation-page-snapshot.ts +0 -18
  52. package/src/api/dto/documentation/index.ts +0 -8
  53. package/src/api/dto/documentation/link-preview.ts +0 -23
  54. package/src/api/dto/documentation/publish.ts +0 -23
  55. package/src/api/dto/documentation/room.ts +0 -12
  56. package/src/api/dto/elements/components/figma-component-group.ts +0 -19
  57. package/src/api/dto/elements/components/figma-component.ts +0 -56
  58. package/src/api/dto/elements/components/index.ts +0 -2
  59. package/src/api/dto/elements/documentation/draft-state.ts +0 -37
  60. package/src/api/dto/elements/documentation/group-action.ts +0 -108
  61. package/src/api/dto/elements/documentation/group-v1.ts +0 -35
  62. package/src/api/dto/elements/documentation/group-v2.ts +0 -117
  63. package/src/api/dto/elements/documentation/hierarchy.ts +0 -22
  64. package/src/api/dto/elements/documentation/index.ts +0 -13
  65. package/src/api/dto/elements/documentation/item-configuration-v1.ts +0 -24
  66. package/src/api/dto/elements/documentation/item-configuration-v2.ts +0 -14
  67. package/src/api/dto/elements/documentation/metadata.ts +0 -8
  68. package/src/api/dto/elements/documentation/page-actions-v2.ts +0 -121
  69. package/src/api/dto/elements/documentation/page-content.ts +0 -15
  70. package/src/api/dto/elements/documentation/page-v1.ts +0 -21
  71. package/src/api/dto/elements/documentation/page-v2.ts +0 -120
  72. package/src/api/dto/elements/documentation/structure.ts +0 -37
  73. package/src/api/dto/elements/elements-action-v2.ts +0 -104
  74. package/src/api/dto/elements/figma-nodes/figma-node.ts +0 -106
  75. package/src/api/dto/elements/figma-nodes/index.ts +0 -2
  76. package/src/api/dto/elements/figma-nodes/node-actions-v2.ts +0 -24
  77. package/src/api/dto/elements/frame-node-structures/frame-node-structure.ts +0 -17
  78. package/src/api/dto/elements/frame-node-structures/index.ts +0 -1
  79. package/src/api/dto/elements/get-elements-v2.ts +0 -21
  80. package/src/api/dto/elements/index.ts +0 -7
  81. package/src/api/dto/elements/properties/index.ts +0 -2
  82. package/src/api/dto/elements/properties/property-definitions.ts +0 -75
  83. package/src/api/dto/elements/properties/property-values.ts +0 -38
  84. package/src/api/dto/export/exporter-property.ts +0 -95
  85. package/src/api/dto/export/exporter.ts +0 -87
  86. package/src/api/dto/export/filter.ts +0 -6
  87. package/src/api/dto/export/index.ts +0 -5
  88. package/src/api/dto/export/job.ts +0 -87
  89. package/src/api/dto/export/pipeline.ts +0 -43
  90. package/src/api/dto/figma-components/assets/download.ts +0 -30
  91. package/src/api/dto/figma-components/assets/index.ts +0 -1
  92. package/src/api/dto/figma-components/index.ts +0 -1
  93. package/src/api/dto/index.ts +0 -13
  94. package/src/api/dto/liveblocks/auth-response.ts +0 -7
  95. package/src/api/dto/liveblocks/index.ts +0 -1
  96. package/src/api/dto/themes/index.ts +0 -2
  97. package/src/api/dto/themes/override.ts +0 -27
  98. package/src/api/dto/themes/theme.ts +0 -45
  99. package/src/api/dto/users/authenticated-user.ts +0 -43
  100. package/src/api/dto/users/index.ts +0 -3
  101. package/src/api/dto/users/update.ts +0 -8
  102. package/src/api/dto/users/user.ts +0 -31
  103. package/src/api/dto/workspaces/git.ts +0 -32
  104. package/src/api/dto/workspaces/index.ts +0 -6
  105. package/src/api/dto/workspaces/integrations.ts +0 -34
  106. package/src/api/dto/workspaces/invitations.ts +0 -30
  107. package/src/api/dto/workspaces/membership.ts +0 -41
  108. package/src/api/dto/workspaces/npm-registry.ts +0 -35
  109. package/src/api/dto/workspaces/workspace.ts +0 -34
  110. package/src/api/endpoints/codegen/codegen.ts +0 -13
  111. package/src/api/endpoints/codegen/exporters.ts +0 -13
  112. package/src/api/endpoints/codegen/index.ts +0 -3
  113. package/src/api/endpoints/codegen/pipelines.ts +0 -37
  114. package/src/api/endpoints/design-system/bff.ts +0 -13
  115. package/src/api/endpoints/design-system/contact.ts +0 -12
  116. package/src/api/endpoints/design-system/design-systems.ts +0 -55
  117. package/src/api/endpoints/design-system/index.ts +0 -6
  118. package/src/api/endpoints/design-system/members.ts +0 -24
  119. package/src/api/endpoints/design-system/sources.ts +0 -35
  120. package/src/api/endpoints/design-system/versions/brands.ts +0 -45
  121. package/src/api/endpoints/design-system/versions/documentation.ts +0 -27
  122. package/src/api/endpoints/design-system/versions/ds-components.ts +0 -28
  123. package/src/api/endpoints/design-system/versions/elements-action.ts +0 -55
  124. package/src/api/endpoints/design-system/versions/elements.ts +0 -13
  125. package/src/api/endpoints/design-system/versions/figma-component-groups.ts +0 -13
  126. package/src/api/endpoints/design-system/versions/figma-components.ts +0 -13
  127. package/src/api/endpoints/design-system/versions/figma-frame-structures.ts +0 -13
  128. package/src/api/endpoints/design-system/versions/import-jobs.ts +0 -13
  129. package/src/api/endpoints/design-system/versions/index.ts +0 -18
  130. package/src/api/endpoints/design-system/versions/overrides.ts +0 -17
  131. package/src/api/endpoints/design-system/versions/property-definitions.ts +0 -43
  132. package/src/api/endpoints/design-system/versions/property-values.ts +0 -25
  133. package/src/api/endpoints/design-system/versions/stats.ts +0 -12
  134. package/src/api/endpoints/design-system/versions/themes.ts +0 -35
  135. package/src/api/endpoints/design-system/versions/token-collections.ts +0 -13
  136. package/src/api/endpoints/design-system/versions/token-groups.ts +0 -28
  137. package/src/api/endpoints/design-system/versions/tokens.ts +0 -27
  138. package/src/api/endpoints/design-system/versions/versions.ts +0 -79
  139. package/src/api/endpoints/index.ts +0 -5
  140. package/src/api/endpoints/liveblocks.ts +0 -14
  141. package/src/api/endpoints/users.ts +0 -26
  142. package/src/api/endpoints/workspaces/index.ts +0 -3
  143. package/src/api/endpoints/workspaces/workspace-invites.ts +0 -34
  144. package/src/api/endpoints/workspaces/workspace-members.ts +0 -31
  145. package/src/api/endpoints/workspaces/workspaces.ts +0 -47
  146. package/src/api/index.ts +0 -6
  147. package/src/api/payloads/design-systems/index.ts +0 -2
  148. package/src/api/payloads/design-systems/update-design-system.ts +0 -29
  149. package/src/api/payloads/design-systems/version.ts +0 -29
  150. package/src/api/payloads/documentation/block-definitions.ts +0 -12
  151. package/src/api/payloads/documentation/design-data-doc-diff.ts +0 -7
  152. package/src/api/payloads/documentation/index.ts +0 -2
  153. package/src/api/payloads/export/index.ts +0 -1
  154. package/src/api/payloads/export/pipeline.ts +0 -50
  155. package/src/api/payloads/index.ts +0 -6
  156. package/src/api/payloads/liveblocks/auth.ts +0 -7
  157. package/src/api/payloads/liveblocks/index.ts +0 -1
  158. package/src/api/payloads/users/index.ts +0 -2
  159. package/src/api/payloads/users/notifications/index.ts +0 -1
  160. package/src/api/payloads/users/notifications/notification-settings.ts +0 -17
  161. package/src/api/payloads/users/profile/index.ts +0 -1
  162. package/src/api/payloads/users/profile/update.ts +0 -4
  163. package/src/api/payloads/workspaces/index.ts +0 -3
  164. package/src/api/payloads/workspaces/transfer-ownership.ts +0 -7
  165. package/src/api/payloads/workspaces/workspace-configuration.ts +0 -50
  166. package/src/api/payloads/workspaces/workspace-integrations.ts +0 -26
  167. package/src/api/transport/index.ts +0 -2
  168. package/src/api/transport/request-executor-error.ts +0 -66
  169. package/src/api/transport/request-executor.ts +0 -87
  170. package/src/index.ts +0 -3
  171. package/src/utils/figma.ts +0 -53
  172. package/src/utils/hash.ts +0 -62
  173. package/src/utils/index.ts +0 -3
  174. package/src/utils/query.ts +0 -18
  175. package/src/yjs/design-system-content/documentation-hierarchy.ts +0 -35
  176. package/src/yjs/design-system-content/index.ts +0 -2
  177. package/src/yjs/design-system-content/item-configuration.ts +0 -93
  178. package/src/yjs/docs-editor/blocks-to-prosemirror.ts +0 -764
  179. package/src/yjs/docs-editor/index.ts +0 -7
  180. package/src/yjs/docs-editor/list-tree-builder.ts +0 -127
  181. package/src/yjs/docs-editor/mock.ts +0 -2104
  182. package/src/yjs/docs-editor/model/block.ts +0 -8
  183. package/src/yjs/docs-editor/model/index.ts +0 -2
  184. package/src/yjs/docs-editor/model/page.ts +0 -8
  185. package/src/yjs/docs-editor/prosemirror/index.ts +0 -3
  186. package/src/yjs/docs-editor/prosemirror/inner-editor-schema.ts +0 -145
  187. package/src/yjs/docs-editor/prosemirror/main-editor-schema.ts +0 -577
  188. package/src/yjs/docs-editor/prosemirror/types.ts +0 -19
  189. package/src/yjs/docs-editor/prosemirror-to-blocks.ts +0 -975
  190. package/src/yjs/docs-editor/utils.ts +0 -115
  191. package/src/yjs/index.ts +0 -3
  192. package/src/yjs/version-room/backend.ts +0 -78
  193. package/src/yjs/version-room/base.ts +0 -211
  194. package/src/yjs/version-room/frontend.ts +0 -461
  195. package/src/yjs/version-room/index.ts +0 -4
  196. package/src/yjs/version-room/utils.ts +0 -109
package/dist/index.mjs CHANGED
@@ -859,6 +859,23 @@ var ContentLoaderPayload = z34.object({
859
859
  location: z34.string()
860
860
  })
861
861
  );
862
+ var shortPersistentIdLength = 8;
863
+ var alphanumeric = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ0123456789";
864
+ function generateShortPersistentId() {
865
+ return generateAlphanumericId(shortPersistentIdLength);
866
+ }
867
+ function generateAlphanumericId(length) {
868
+ let randomString = "";
869
+ for (let i = 0; i < length; i++) {
870
+ const randomIndex = Math.floor(Math.random() * alphanumeric.length);
871
+ randomString += alphanumeric.charAt(randomIndex);
872
+ }
873
+ return randomString;
874
+ }
875
+ function slugify(str, options) {
876
+ const slug = slugifyImplementation(str ?? "", options);
877
+ return slug?.length > 0 ? slug : "item";
878
+ }
862
879
  var RESERVED_SLUGS = [
863
880
  "workspaces",
864
881
  "workspace",
@@ -2712,7 +2729,6 @@ var ShadowLayerValue = z70.object({
2712
2729
  type: ShadowType
2713
2730
  });
2714
2731
  var ShadowTokenDataBase = tokenAliasOrValue(ShadowLayerValue);
2715
- var ShadowValue = z70.array(ShadowTokenDataBase);
2716
2732
  var ShadowTokenData = tokenAliasOrValue(z70.array(ShadowTokenDataBase));
2717
2733
  var SizeUnit = z71.enum(["Pixels", "Rem", "Percent"]);
2718
2734
  var SizeValue = z71.object({
@@ -3230,15 +3246,10 @@ var FigmaImportBaseContext = z90.object({
3230
3246
  */
3231
3247
  importWarnings: z90.record(ImportWarning.array()).default({})
3232
3248
  });
3233
- var FeatureFlagsKeepAliases = z90.object({
3234
- isTypographyPropsKeepAliasesEnabled: z90.boolean().default(false),
3235
- isGradientPropsKeepAliasesEnabled: z90.boolean().default(false),
3236
- isShadowPropsKeepAliasesEnabled: z90.boolean().default(false)
3237
- });
3238
3249
  var FigmaImportContextWithSourcesState = FigmaImportBaseContext.extend({
3239
3250
  sourcesWithMissingAccess: z90.array(z90.string()).default([]),
3240
3251
  shadowOpacityOptional: z90.boolean().default(false),
3241
- featureFlagsKeepAliases: FeatureFlagsKeepAliases.default({})
3252
+ typographyPropsKeepAliases: z90.boolean().default(false)
3242
3253
  });
3243
3254
  var ChangedImportedFigmaSourceData = ImportedFigmaSourceData.extend({
3244
3255
  importMetadata: DataSourceFigmaImportMetadata
@@ -4289,8 +4300,7 @@ var RestoredDocumentationGroup = z149.object({
4289
4300
  parent: ElementGroup
4290
4301
  });
4291
4302
  var RoomTypeEnum = /* @__PURE__ */ ((RoomTypeEnum2) => {
4292
- RoomTypeEnum2["DocumentationPageOld"] = "documentation-page";
4293
- RoomTypeEnum2["DocumentationPage"] = "doc-page";
4303
+ RoomTypeEnum2["DocumentationPage"] = "documentation-page";
4294
4304
  RoomTypeEnum2["DesignSystemVersion"] = "design-system-version";
4295
4305
  RoomTypeEnum2["Workspace"] = "workspace";
4296
4306
  return RoomTypeEnum2;
@@ -4614,9 +4624,7 @@ var FlaggedFeature = z169.enum([
4614
4624
  "ShadowOpacityOptional",
4615
4625
  "DisableImporter",
4616
4626
  "VariablesOrder",
4617
- "TypographyPropsKeepAliases",
4618
- "GradientPropsKeepAliases",
4619
- "ShadowPropsKeepAliases"
4627
+ "TypographyPropsKeepAliases"
4620
4628
  ]);
4621
4629
  var FeatureFlagMap = z169.record(FlaggedFeature, z169.boolean());
4622
4630
  var FeatureFlag = z169.object({
@@ -4960,10 +4968,10 @@ function elementGroupsToDocumentationGroupFixedConfigurationDTOV2(groups, pages)
4960
4968
  function elementGroupToDocumentationGroupStructureDTOV2(group, childrenIdsMap) {
4961
4969
  const childrenIds = childrenIdsMap.get(group.persistentId) ?? [];
4962
4970
  if (!group.shortPersistentId) {
4963
- throw new Error(`Short persistent id is required for docs groups, group id: ${group.id}`);
4971
+ throw new Error(`Short persistent id is required for docs groups, group id: ${group.persistentId}`);
4964
4972
  }
4965
4973
  return {
4966
- id: group.id,
4974
+ id: "to_be_removed",
4967
4975
  designSystemVersionId: group.designSystemVersionId,
4968
4976
  persistentId: group.persistentId,
4969
4977
  slug: group.slug,
@@ -5045,11 +5053,11 @@ function documentationPagesFixedConfigurationToDTOV2(pages, groups, routingVersi
5045
5053
  function _documentationPageToDTOV2(page, pagePathMap) {
5046
5054
  let path = pagePathMap.get(page.persistentId);
5047
5055
  if (!path)
5048
- throw new Error(`Path for page ${page.id} was not calculated`);
5056
+ throw new Error(`Path for page ${page.persistentId} was not calculated`);
5049
5057
  if (path.startsWith("/"))
5050
5058
  path = path.substring(1);
5051
5059
  return {
5052
- id: page.id,
5060
+ id: "to_be_removed",
5053
5061
  designSystemVersionId: page.designSystemVersionId,
5054
5062
  persistentId: page.persistentId,
5055
5063
  shortPersistentId: page.shortPersistentId,
@@ -6175,7 +6183,7 @@ import { z as z218 } from "zod";
6175
6183
  var DTODocumentationPageApprovalState = DocumentationPageApproval;
6176
6184
  var DTODocumentationGroupApprovalState = z218.object({
6177
6185
  persistentId: z218.string(),
6178
- groupId: z218.string(),
6186
+ groupPersistentId: z218.string(),
6179
6187
  designSystemVersionId: z218.string(),
6180
6188
  approvalState: DocumentationPageApprovalState
6181
6189
  });
@@ -6476,62 +6484,53 @@ var DTOPublishDocumentationResponse = z228.object({
6476
6484
  job: DTOExportJob
6477
6485
  });
6478
6486
 
6479
- // src/api/dto/documentation/room.ts
6480
- import { z as z229 } from "zod";
6481
- var DTODocumentationPageRoom = z229.object({
6482
- id: z229.string()
6483
- });
6484
- var DTODocumentationPageRoomResponse = z229.object({
6485
- room: DTODocumentationPageRoom
6486
- });
6487
-
6488
6487
  // src/api/dto/elements/components/figma-component-group.ts
6489
- import z230 from "zod";
6490
- var DTOFigmaComponentGroup = z230.object({
6491
- id: z230.string(),
6492
- designSystemVersionId: z230.string(),
6493
- persistentId: z230.string(),
6494
- isRoot: z230.boolean(),
6495
- brandId: z230.string(),
6488
+ import z229 from "zod";
6489
+ var DTOFigmaComponentGroup = z229.object({
6490
+ id: z229.string(),
6491
+ designSystemVersionId: z229.string(),
6492
+ persistentId: z229.string(),
6493
+ isRoot: z229.boolean(),
6494
+ brandId: z229.string(),
6496
6495
  meta: DTOObjectMeta,
6497
- childrenIds: z230.string().array()
6496
+ childrenIds: z229.string().array()
6498
6497
  });
6499
- var DTOFigmaComponentGroupListResponse = z230.object({
6498
+ var DTOFigmaComponentGroupListResponse = z229.object({
6500
6499
  groups: DTOFigmaComponentGroup.array()
6501
6500
  });
6502
6501
 
6503
6502
  // src/api/dto/elements/components/figma-component.ts
6504
- import { z as z231 } from "zod";
6503
+ import { z as z230 } from "zod";
6505
6504
  var DTOFigmaComponentProperty = FigmaComponentProperty;
6506
- var DTOFigmaComponentPropertyMap = z231.record(DTOFigmaComponentProperty);
6507
- var DTOFigmaComponent = z231.object({
6508
- id: z231.string(),
6509
- persistentId: z231.string(),
6510
- designSystemVersionId: z231.string(),
6511
- brandId: z231.string(),
6512
- thumbnailUrl: z231.string().optional(),
6513
- svgUrl: z231.string().optional(),
6514
- exportProperties: z231.object({
6515
- isAsset: z231.boolean()
6505
+ var DTOFigmaComponentPropertyMap = z230.record(DTOFigmaComponentProperty);
6506
+ var DTOFigmaComponent = z230.object({
6507
+ id: z230.string(),
6508
+ persistentId: z230.string(),
6509
+ designSystemVersionId: z230.string(),
6510
+ brandId: z230.string(),
6511
+ thumbnailUrl: z230.string().optional(),
6512
+ svgUrl: z230.string().optional(),
6513
+ exportProperties: z230.object({
6514
+ isAsset: z230.boolean()
6516
6515
  }),
6517
- createdAt: z231.coerce.date(),
6518
- updatedAt: z231.coerce.date(),
6516
+ createdAt: z230.coerce.date(),
6517
+ updatedAt: z230.coerce.date(),
6519
6518
  meta: ObjectMeta,
6520
6519
  originComponent: FigmaComponentOrigin.optional(),
6521
- parentComponentPersistentId: z231.string().optional(),
6522
- childrenPersistentIds: z231.string().array().optional(),
6520
+ parentComponentPersistentId: z230.string().optional(),
6521
+ childrenPersistentIds: z230.string().array().optional(),
6523
6522
  componentPropertyDefinitions: DTOFigmaComponentPropertyMap.optional(),
6524
- variantPropertyValues: z231.record(z231.string()).optional()
6523
+ variantPropertyValues: z230.record(z230.string()).optional()
6525
6524
  });
6526
- var DTOFigmaComponentListResponse = z231.object({
6525
+ var DTOFigmaComponentListResponse = z230.object({
6527
6526
  components: DTOFigmaComponent.array()
6528
6527
  });
6529
6528
 
6530
6529
  // src/api/dto/elements/documentation/group-action.ts
6531
- import { z as z233 } from "zod";
6530
+ import { z as z232 } from "zod";
6532
6531
 
6533
6532
  // src/api/dto/elements/documentation/group-v2.ts
6534
- import { z as z232 } from "zod";
6533
+ import { z as z231 } from "zod";
6535
6534
  var DTODocumentationGroupV2 = ElementGroup.omit({
6536
6535
  sortOrder: true,
6537
6536
  parentPersistentId: true,
@@ -6541,13 +6540,13 @@ var DTODocumentationGroupV2 = ElementGroup.omit({
6541
6540
  data: true,
6542
6541
  shortPersistentId: true
6543
6542
  }).extend({
6544
- title: z232.string(),
6545
- isRoot: z232.boolean(),
6546
- childrenIds: z232.array(z232.string()),
6543
+ title: z231.string(),
6544
+ isRoot: z231.boolean(),
6545
+ childrenIds: z231.array(z231.string()),
6547
6546
  groupBehavior: DocumentationGroupBehavior,
6548
- shortPersistentId: z232.string(),
6547
+ shortPersistentId: z231.string(),
6549
6548
  configuration: DTODocumentationItemConfigurationV2,
6550
- type: z232.literal("Group"),
6549
+ type: z231.literal("Group"),
6551
6550
  /** Defined when a group has changed since last publish and can be included into a partial publish */
6552
6551
  draftState: DTODocumentationDraftState.optional(),
6553
6552
  /** Defined if a group was published at least once and contains metadata about last publish */
@@ -6555,127 +6554,127 @@ var DTODocumentationGroupV2 = ElementGroup.omit({
6555
6554
  //** An approval state for frontend to utilize. */
6556
6555
  approvalState: DTODocumentationGroupApprovalState.optional()
6557
6556
  });
6558
- var DTOCreateDocumentationGroupInput = z232.object({
6557
+ var DTOCreateDocumentationGroupInput = z231.object({
6559
6558
  // Identifier
6560
- persistentId: z232.string(),
6559
+ persistentId: z231.string(),
6561
6560
  // Group properties
6562
- title: z232.string(),
6561
+ title: z231.string(),
6563
6562
  configuration: DTODocumentationItemConfigurationV2.partial().optional(),
6564
6563
  // Group placement properties
6565
- afterPersistentId: z232.string().nullish(),
6566
- parentPersistentId: z232.string()
6564
+ afterPersistentId: z231.string().nullish(),
6565
+ parentPersistentId: z231.string()
6567
6566
  });
6568
- var DTOUpdateDocumentationGroupInput = z232.object({
6567
+ var DTOUpdateDocumentationGroupInput = z231.object({
6569
6568
  // Identifier of the group to update
6570
- id: z232.string(),
6569
+ id: z231.string(),
6571
6570
  // Group properties
6572
- title: z232.string().optional(),
6571
+ title: z231.string().optional(),
6573
6572
  configuration: DTODocumentationItemConfigurationV2.partial().optional()
6574
6573
  });
6575
- var DTOMoveDocumentationGroupInput = z232.object({
6574
+ var DTOMoveDocumentationGroupInput = z231.object({
6576
6575
  // Identifier of the group to update
6577
- id: z232.string(),
6576
+ id: z231.string(),
6578
6577
  // Group placement properties
6579
- parentPersistentId: z232.string(),
6580
- afterPersistentId: z232.string().nullish()
6578
+ parentPersistentId: z231.string(),
6579
+ afterPersistentId: z231.string().nullish()
6581
6580
  });
6582
- var DTODuplicateDocumentationGroupInput = z232.object({
6581
+ var DTODuplicateDocumentationGroupInput = z231.object({
6583
6582
  // Identifier of the group to duplicate from
6584
- id: z232.string(),
6583
+ id: z231.string(),
6585
6584
  // New group persistent id
6586
- persistentId: z232.string(),
6585
+ persistentId: z231.string(),
6587
6586
  // Group placement properties
6588
- afterPersistentId: z232.string().nullish(),
6589
- parentPersistentId: z232.string()
6587
+ afterPersistentId: z231.string().nullish(),
6588
+ parentPersistentId: z231.string()
6590
6589
  });
6591
- var DTOCreateDocumentationTabInput = z232.object({
6590
+ var DTOCreateDocumentationTabInput = z231.object({
6592
6591
  // New group persistent id
6593
- persistentId: z232.string(),
6592
+ persistentId: z231.string(),
6594
6593
  // If this is page, we will attempt to convert it to tab
6595
6594
  // If this is tab group, we will add a new tab to it
6596
- fromItemPersistentId: z232.string(),
6597
- tabName: z232.string()
6595
+ fromItemPersistentId: z231.string(),
6596
+ tabName: z231.string()
6598
6597
  });
6599
- var DTODeleteDocumentationTabGroupInput = z232.object({
6598
+ var DTODeleteDocumentationTabGroupInput = z231.object({
6600
6599
  // Deleted group id
6601
- id: z232.string()
6600
+ id: z231.string()
6602
6601
  });
6603
- var DTODeleteDocumentationGroupInput = z232.object({
6602
+ var DTODeleteDocumentationGroupInput = z231.object({
6604
6603
  // Identifier
6605
- id: z232.string(),
6604
+ id: z231.string(),
6606
6605
  // Deletion options
6607
- deleteSubtree: z232.boolean().default(false)
6606
+ deleteSubtree: z231.boolean().default(false)
6608
6607
  });
6609
6608
 
6610
6609
  // src/api/dto/elements/documentation/group-action.ts
6611
- var SuccessPayload = z233.object({
6612
- success: z233.literal(true)
6610
+ var SuccessPayload = z232.object({
6611
+ success: z232.literal(true)
6613
6612
  });
6614
- var DTODocumentationGroupCreateActionOutputV2 = z233.object({
6615
- type: z233.literal("DocumentationGroupCreate"),
6613
+ var DTODocumentationGroupCreateActionOutputV2 = z232.object({
6614
+ type: z232.literal("DocumentationGroupCreate"),
6616
6615
  output: SuccessPayload
6617
6616
  });
6618
- var DTODocumentationTabCreateActionOutputV2 = z233.object({
6619
- type: z233.literal("DocumentationTabCreate"),
6617
+ var DTODocumentationTabCreateActionOutputV2 = z232.object({
6618
+ type: z232.literal("DocumentationTabCreate"),
6620
6619
  output: SuccessPayload
6621
6620
  });
6622
- var DTODocumentationGroupUpdateActionOutputV2 = z233.object({
6623
- type: z233.literal("DocumentationGroupUpdate"),
6621
+ var DTODocumentationGroupUpdateActionOutputV2 = z232.object({
6622
+ type: z232.literal("DocumentationGroupUpdate"),
6624
6623
  output: SuccessPayload
6625
6624
  });
6626
- var DTODocumentationGroupMoveActionOutputV2 = z233.object({
6627
- type: z233.literal("DocumentationGroupMove"),
6625
+ var DTODocumentationGroupMoveActionOutputV2 = z232.object({
6626
+ type: z232.literal("DocumentationGroupMove"),
6628
6627
  output: SuccessPayload
6629
6628
  });
6630
- var DTODocumentationGroupDuplicateActionOutputV2 = z233.object({
6631
- type: z233.literal("DocumentationGroupDuplicate"),
6629
+ var DTODocumentationGroupDuplicateActionOutputV2 = z232.object({
6630
+ type: z232.literal("DocumentationGroupDuplicate"),
6632
6631
  output: SuccessPayload
6633
6632
  });
6634
- var DTODocumentationGroupDeleteActionOutputV2 = z233.object({
6635
- type: z233.literal("DocumentationGroupDelete"),
6633
+ var DTODocumentationGroupDeleteActionOutputV2 = z232.object({
6634
+ type: z232.literal("DocumentationGroupDelete"),
6636
6635
  output: SuccessPayload
6637
6636
  });
6638
- var DTODocumentationTabGroupDeleteActionOutputV2 = z233.object({
6639
- type: z233.literal("DocumentationTabGroupDelete"),
6637
+ var DTODocumentationTabGroupDeleteActionOutputV2 = z232.object({
6638
+ type: z232.literal("DocumentationTabGroupDelete"),
6640
6639
  output: SuccessPayload
6641
6640
  });
6642
- var DTODocumentationGroupCreateActionInputV2 = z233.object({
6643
- type: z233.literal("DocumentationGroupCreate"),
6641
+ var DTODocumentationGroupCreateActionInputV2 = z232.object({
6642
+ type: z232.literal("DocumentationGroupCreate"),
6644
6643
  input: DTOCreateDocumentationGroupInput
6645
6644
  });
6646
- var DTODocumentationTabCreateActionInputV2 = z233.object({
6647
- type: z233.literal("DocumentationTabCreate"),
6645
+ var DTODocumentationTabCreateActionInputV2 = z232.object({
6646
+ type: z232.literal("DocumentationTabCreate"),
6648
6647
  input: DTOCreateDocumentationTabInput
6649
6648
  });
6650
- var DTODocumentationGroupUpdateActionInputV2 = z233.object({
6651
- type: z233.literal("DocumentationGroupUpdate"),
6649
+ var DTODocumentationGroupUpdateActionInputV2 = z232.object({
6650
+ type: z232.literal("DocumentationGroupUpdate"),
6652
6651
  input: DTOUpdateDocumentationGroupInput
6653
6652
  });
6654
- var DTODocumentationGroupMoveActionInputV2 = z233.object({
6655
- type: z233.literal("DocumentationGroupMove"),
6653
+ var DTODocumentationGroupMoveActionInputV2 = z232.object({
6654
+ type: z232.literal("DocumentationGroupMove"),
6656
6655
  input: DTOMoveDocumentationGroupInput
6657
6656
  });
6658
- var DTODocumentationGroupDuplicateActionInputV2 = z233.object({
6659
- type: z233.literal("DocumentationGroupDuplicate"),
6657
+ var DTODocumentationGroupDuplicateActionInputV2 = z232.object({
6658
+ type: z232.literal("DocumentationGroupDuplicate"),
6660
6659
  input: DTODuplicateDocumentationGroupInput
6661
6660
  });
6662
- var DTODocumentationGroupDeleteActionInputV2 = z233.object({
6663
- type: z233.literal("DocumentationGroupDelete"),
6661
+ var DTODocumentationGroupDeleteActionInputV2 = z232.object({
6662
+ type: z232.literal("DocumentationGroupDelete"),
6664
6663
  input: DTODeleteDocumentationGroupInput
6665
6664
  });
6666
- var DTODocumentationTabGroupDeleteActionInputV2 = z233.object({
6667
- type: z233.literal("DocumentationTabGroupDelete"),
6665
+ var DTODocumentationTabGroupDeleteActionInputV2 = z232.object({
6666
+ type: z232.literal("DocumentationTabGroupDelete"),
6668
6667
  input: DTODeleteDocumentationTabGroupInput
6669
6668
  });
6670
6669
 
6671
6670
  // src/api/dto/elements/documentation/group-v1.ts
6672
- import { z as z235 } from "zod";
6671
+ import { z as z234 } from "zod";
6673
6672
 
6674
6673
  // src/api/dto/elements/documentation/item-configuration-v1.ts
6675
- import { z as z234 } from "zod";
6676
- var DocumentationColorV1 = z234.object({
6677
- aliasTo: z234.string().optional(),
6678
- value: z234.string().optional()
6674
+ import { z as z233 } from "zod";
6675
+ var DocumentationColorV1 = z233.object({
6676
+ aliasTo: z233.string().optional(),
6677
+ value: z233.string().optional()
6679
6678
  });
6680
6679
  var DTODocumentationItemHeaderV1 = DocumentationItemHeaderV1.omit({
6681
6680
  foregroundColor: true,
@@ -6684,10 +6683,10 @@ var DTODocumentationItemHeaderV1 = DocumentationItemHeaderV1.omit({
6684
6683
  foregroundColor: DocumentationColorV1.optional(),
6685
6684
  backgroundColor: DocumentationColorV1.optional()
6686
6685
  });
6687
- var DTODocumentationItemConfigurationV1 = z234.object({
6688
- showSidebar: z234.boolean(),
6689
- isPrivate: z234.boolean(),
6690
- isHidden: z234.boolean(),
6686
+ var DTODocumentationItemConfigurationV1 = z233.object({
6687
+ showSidebar: z233.boolean(),
6688
+ isPrivate: z233.boolean(),
6689
+ isHidden: z233.boolean(),
6691
6690
  header: DTODocumentationItemHeaderV1
6692
6691
  });
6693
6692
 
@@ -6701,27 +6700,27 @@ var DTODocumentationGroupStructureV1 = ElementGroup.omit({
6701
6700
  data: true,
6702
6701
  shortPersistentId: true
6703
6702
  }).extend({
6704
- title: z235.string(),
6705
- isRoot: z235.boolean(),
6706
- childrenIds: z235.array(z235.string()),
6703
+ title: z234.string(),
6704
+ isRoot: z234.boolean(),
6705
+ childrenIds: z234.array(z234.string()),
6707
6706
  groupBehavior: DocumentationGroupBehavior,
6708
- shortPersistentId: z235.string(),
6709
- type: z235.literal("Group")
6707
+ shortPersistentId: z234.string(),
6708
+ type: z234.literal("Group")
6710
6709
  });
6711
6710
  var DTODocumentationGroupV1 = DTODocumentationGroupStructureV1.extend({
6712
6711
  configuration: DTODocumentationItemConfigurationV1
6713
6712
  });
6714
6713
 
6715
6714
  // src/api/dto/elements/documentation/hierarchy.ts
6716
- import { z as z236 } from "zod";
6717
- var DTODocumentationHierarchyV2 = z236.object({
6718
- pages: z236.array(
6715
+ import { z as z235 } from "zod";
6716
+ var DTODocumentationHierarchyV2 = z235.object({
6717
+ pages: z235.array(
6719
6718
  DTODocumentationPageV2.extend({
6720
6719
  /** Defined when a page has changed since last publish and can be included into a partial publish */
6721
6720
  draftState: DTODocumentationDraftState.optional()
6722
6721
  })
6723
6722
  ),
6724
- groups: z236.array(
6723
+ groups: z235.array(
6725
6724
  DTODocumentationGroupV2.extend({
6726
6725
  /** Defined when a page has changed since last publish and can be included into a partial publish */
6727
6726
  draftState: DTODocumentationDraftState.optional()
@@ -6730,84 +6729,84 @@ var DTODocumentationHierarchyV2 = z236.object({
6730
6729
  });
6731
6730
 
6732
6731
  // src/api/dto/elements/documentation/page-actions-v2.ts
6733
- import { z as z237 } from "zod";
6734
- var SuccessPayload2 = z237.object({
6735
- success: z237.literal(true)
6732
+ import { z as z236 } from "zod";
6733
+ var SuccessPayload2 = z236.object({
6734
+ success: z236.literal(true)
6736
6735
  });
6737
- var DTODocumentationPageCreateActionOutputV2 = z237.object({
6738
- type: z237.literal("DocumentationPageCreate"),
6736
+ var DTODocumentationPageCreateActionOutputV2 = z236.object({
6737
+ type: z236.literal("DocumentationPageCreate"),
6739
6738
  output: SuccessPayload2
6740
6739
  });
6741
- var DTODocumentationPageUpdateActionOutputV2 = z237.object({
6742
- type: z237.literal("DocumentationPageUpdate"),
6740
+ var DTODocumentationPageUpdateActionOutputV2 = z236.object({
6741
+ type: z236.literal("DocumentationPageUpdate"),
6743
6742
  output: SuccessPayload2
6744
6743
  });
6745
- var DTODocumentationPageMoveActionOutputV2 = z237.object({
6746
- type: z237.literal("DocumentationPageMove"),
6744
+ var DTODocumentationPageMoveActionOutputV2 = z236.object({
6745
+ type: z236.literal("DocumentationPageMove"),
6747
6746
  output: SuccessPayload2
6748
6747
  });
6749
- var DTODocumentationPageDuplicateActionOutputV2 = z237.object({
6750
- type: z237.literal("DocumentationPageDuplicate"),
6748
+ var DTODocumentationPageDuplicateActionOutputV2 = z236.object({
6749
+ type: z236.literal("DocumentationPageDuplicate"),
6751
6750
  output: SuccessPayload2
6752
6751
  });
6753
- var DTODocumentationPageDeleteActionOutputV2 = z237.object({
6754
- type: z237.literal("DocumentationPageDelete"),
6752
+ var DTODocumentationPageDeleteActionOutputV2 = z236.object({
6753
+ type: z236.literal("DocumentationPageDelete"),
6755
6754
  output: SuccessPayload2
6756
6755
  });
6757
- var DTODocumentationPageRestoreActionOutput = z237.object({
6758
- type: z237.literal("DocumentationPageRestore"),
6756
+ var DTODocumentationPageRestoreActionOutput = z236.object({
6757
+ type: z236.literal("DocumentationPageRestore"),
6759
6758
  output: SuccessPayload2
6760
6759
  });
6761
- var DTODocumentationGroupRestoreActionOutput = z237.object({
6762
- type: z237.literal("DocumentationGroupRestore"),
6760
+ var DTODocumentationGroupRestoreActionOutput = z236.object({
6761
+ type: z236.literal("DocumentationGroupRestore"),
6763
6762
  output: SuccessPayload2
6764
6763
  });
6765
- var DTODocumentationPageApprovalStateChangeActionOutput = z237.object({
6766
- type: z237.literal("DocumentationPageApprovalStateChange"),
6764
+ var DTODocumentationPageApprovalStateChangeActionOutput = z236.object({
6765
+ type: z236.literal("DocumentationPageApprovalStateChange"),
6767
6766
  output: SuccessPayload2
6768
6767
  });
6769
- var DTODocumentationPageCreateActionInputV2 = z237.object({
6770
- type: z237.literal("DocumentationPageCreate"),
6768
+ var DTODocumentationPageCreateActionInputV2 = z236.object({
6769
+ type: z236.literal("DocumentationPageCreate"),
6771
6770
  input: DTOCreateDocumentationPageInputV2
6772
6771
  });
6773
- var DTODocumentationPageUpdateActionInputV2 = z237.object({
6774
- type: z237.literal("DocumentationPageUpdate"),
6772
+ var DTODocumentationPageUpdateActionInputV2 = z236.object({
6773
+ type: z236.literal("DocumentationPageUpdate"),
6775
6774
  input: DTOUpdateDocumentationPageInputV2
6776
6775
  });
6777
- var DTODocumentationPageMoveActionInputV2 = z237.object({
6778
- type: z237.literal("DocumentationPageMove"),
6776
+ var DTODocumentationPageMoveActionInputV2 = z236.object({
6777
+ type: z236.literal("DocumentationPageMove"),
6779
6778
  input: DTOMoveDocumentationPageInputV2
6780
6779
  });
6781
- var DTODocumentationPageDuplicateActionInputV2 = z237.object({
6782
- type: z237.literal("DocumentationPageDuplicate"),
6780
+ var DTODocumentationPageDuplicateActionInputV2 = z236.object({
6781
+ type: z236.literal("DocumentationPageDuplicate"),
6783
6782
  input: DTODuplicateDocumentationPageInputV2
6784
6783
  });
6785
- var DTODocumentationPageDeleteActionInputV2 = z237.object({
6786
- type: z237.literal("DocumentationPageDelete"),
6784
+ var DTODocumentationPageDeleteActionInputV2 = z236.object({
6785
+ type: z236.literal("DocumentationPageDelete"),
6787
6786
  input: DTODeleteDocumentationPageInputV2
6788
6787
  });
6789
- var DTODocumentationPageRestoreActionInput = z237.object({
6790
- type: z237.literal("DocumentationPageRestore"),
6788
+ var DTODocumentationPageRestoreActionInput = z236.object({
6789
+ type: z236.literal("DocumentationPageRestore"),
6791
6790
  input: DTORestoreDocumentationPageInput
6792
6791
  });
6793
- var DTODocumentationGroupRestoreActionInput = z237.object({
6794
- type: z237.literal("DocumentationGroupRestore"),
6792
+ var DTODocumentationGroupRestoreActionInput = z236.object({
6793
+ type: z236.literal("DocumentationGroupRestore"),
6795
6794
  input: DTORestoreDocumentationGroupInput
6796
6795
  });
6797
- var DTODocumentationPageApprovalStateChangeActionInput = z237.object({
6798
- type: z237.literal("DocumentationPageApprovalStateChange"),
6796
+ var DTODocumentationPageApprovalStateChangeActionInput = z236.object({
6797
+ type: z236.literal("DocumentationPageApprovalStateChange"),
6799
6798
  input: DTODocumentationPageApprovalStateChangeInput
6800
6799
  });
6801
6800
 
6802
6801
  // src/api/dto/elements/documentation/page-content.ts
6803
- import { z as z238 } from "zod";
6802
+ import { z as z237 } from "zod";
6804
6803
  var DTODocumentationPageContent = DocumentationPageContent;
6805
- var DTODocumentationPageContentGetResponse = z238.object({
6804
+ var DTODocumentationPageContentGetResponse = z237.object({
6806
6805
  pageContent: DTODocumentationPageContent
6807
6806
  });
6808
6807
 
6809
6808
  // src/api/dto/elements/documentation/page-v1.ts
6810
- import { z as z239 } from "zod";
6809
+ import { z as z238 } from "zod";
6811
6810
  var DocumentationPageV1DTO = DocumentationPageV1.omit({
6812
6811
  data: true,
6813
6812
  meta: true,
@@ -6815,63 +6814,63 @@ var DocumentationPageV1DTO = DocumentationPageV1.omit({
6815
6814
  sortOrder: true
6816
6815
  }).extend({
6817
6816
  configuration: DTODocumentationItemConfigurationV1,
6818
- blocks: z239.array(PageBlockV1),
6819
- title: z239.string(),
6820
- path: z239.string()
6817
+ blocks: z238.array(PageBlockV1),
6818
+ title: z238.string(),
6819
+ path: z238.string()
6821
6820
  });
6822
6821
 
6823
6822
  // src/api/dto/elements/documentation/structure.ts
6824
- import { z as z240 } from "zod";
6825
- var DTODocumentationStructureItemType = z240.enum(["Group", "Page"]);
6826
- var DTODocumentationStructureItemBase = z240.object({
6823
+ import { z as z239 } from "zod";
6824
+ var DTODocumentationStructureItemType = z239.enum(["Group", "Page"]);
6825
+ var DTODocumentationStructureItemBase = z239.object({
6827
6826
  type: DTODocumentationStructureItemType,
6828
- id: z240.string(),
6829
- designSystemVersionId: z240.string(),
6830
- shortPersistentId: z240.string(),
6831
- persistentId: z240.string(),
6832
- title: z240.string(),
6833
- createdAt: z240.coerce.date(),
6834
- updatedAt: z240.coerce.date()
6827
+ id: z239.string(),
6828
+ designSystemVersionId: z239.string(),
6829
+ shortPersistentId: z239.string(),
6830
+ persistentId: z239.string(),
6831
+ title: z239.string(),
6832
+ createdAt: z239.coerce.date(),
6833
+ updatedAt: z239.coerce.date()
6835
6834
  });
6836
6835
  var DTODocumentationStructureGroupItem = DTODocumentationStructureItemBase.extend({
6837
- type: z240.literal(DTODocumentationStructureItemType.enum.Group),
6838
- groupBehavior: z240.string(),
6839
- childrenIds: z240.string().array(),
6840
- isRoot: z240.boolean()
6836
+ type: z239.literal(DTODocumentationStructureItemType.enum.Group),
6837
+ groupBehavior: z239.string(),
6838
+ childrenIds: z239.string().array(),
6839
+ isRoot: z239.boolean()
6841
6840
  });
6842
6841
  var DTODocumentationStructurePageItem = DTODocumentationStructureItemBase.extend({
6843
- type: z240.literal(DTODocumentationStructureItemType.enum.Page),
6844
- path: z240.string()
6842
+ type: z239.literal(DTODocumentationStructureItemType.enum.Page),
6843
+ path: z239.string()
6845
6844
  });
6846
- var DTODocumentationStructureItem = z240.discriminatedUnion("type", [
6845
+ var DTODocumentationStructureItem = z239.discriminatedUnion("type", [
6847
6846
  DTODocumentationStructureGroupItem,
6848
6847
  DTODocumentationStructurePageItem
6849
6848
  ]);
6850
- var DTODocumentationStructure = z240.object({
6851
- items: z240.array(DTODocumentationStructureItem)
6849
+ var DTODocumentationStructure = z239.object({
6850
+ items: z239.array(DTODocumentationStructureItem)
6852
6851
  });
6853
6852
 
6854
6853
  // src/api/dto/elements/figma-nodes/figma-node.ts
6855
- import { z as z241 } from "zod";
6854
+ import { z as z240 } from "zod";
6856
6855
  var DTOFigmaNodeRenderFormat = FigmaNodeRenderFormat;
6857
- var DTOFigmaNodeOrigin = z241.object({
6858
- sourceId: z241.string(),
6859
- fileId: z241.string().optional(),
6860
- parentName: z241.string().optional()
6856
+ var DTOFigmaNodeOrigin = z240.object({
6857
+ sourceId: z240.string(),
6858
+ fileId: z240.string().optional(),
6859
+ parentName: z240.string().optional()
6861
6860
  });
6862
- var DTOFigmaNodeData = z241.object({
6861
+ var DTOFigmaNodeData = z240.object({
6863
6862
  // Id of the node in the Figma file
6864
- figmaNodeId: z241.string(),
6863
+ figmaNodeId: z240.string(),
6865
6864
  // Validity
6866
- isValid: z241.boolean(),
6865
+ isValid: z240.boolean(),
6867
6866
  // Asset data
6868
- assetId: z241.string(),
6869
- assetUrl: z241.string(),
6867
+ assetId: z240.string(),
6868
+ assetUrl: z240.string(),
6870
6869
  assetFormat: DTOFigmaNodeRenderFormat,
6871
6870
  // Asset metadata
6872
- assetScale: z241.number(),
6873
- assetWidth: z241.number().optional(),
6874
- assetHeight: z241.number().optional()
6871
+ assetScale: z240.number(),
6872
+ assetWidth: z240.number().optional(),
6873
+ assetHeight: z240.number().optional()
6875
6874
  });
6876
6875
  var DTOFigmaNode = FigmaNodeReference.omit({
6877
6876
  data: true,
@@ -6880,127 +6879,127 @@ var DTOFigmaNode = FigmaNodeReference.omit({
6880
6879
  data: DTOFigmaNodeData,
6881
6880
  origin: DTOFigmaNodeOrigin
6882
6881
  });
6883
- var DTOFigmaNodeRenderInputBase = z241.object({
6882
+ var DTOFigmaNodeRenderInputBase = z240.object({
6884
6883
  /**
6885
6884
  * Format in which the node must be rendered, png by default.
6886
6885
  */
6887
6886
  format: FigmaNodeRenderFormat.default("Png")
6888
6887
  });
6889
6888
  var DTOFigmaNodeRenderIdInput = DTOFigmaNodeRenderInputBase.extend({
6890
- inputType: z241.literal("NodeId").optional().transform((v) => v ?? "NodeId"),
6889
+ inputType: z240.literal("NodeId").optional().transform((v) => v ?? "NodeId"),
6891
6890
  /**
6892
6891
  * Id of a design system's data source representing a linked Figma file
6893
6892
  */
6894
- sourceId: z241.string(),
6893
+ sourceId: z240.string(),
6895
6894
  /**
6896
6895
  * Id of a node within the Figma file
6897
6896
  */
6898
- figmaFileNodeId: z241.string()
6897
+ figmaFileNodeId: z240.string()
6899
6898
  });
6900
6899
  var DTOFigmaNodeRenderUrlInput = DTOFigmaNodeRenderInputBase.extend({
6901
- inputType: z241.literal("URL"),
6900
+ inputType: z240.literal("URL"),
6902
6901
  /**
6903
6902
  * Id of a design system's data source representing a linked Figma file
6904
6903
  */
6905
- figmaNodeUrl: z241.string()
6904
+ figmaNodeUrl: z240.string()
6906
6905
  });
6907
- var DTOFigmaNodeRenderInput = z241.discriminatedUnion("inputType", [
6906
+ var DTOFigmaNodeRenderInput = z240.discriminatedUnion("inputType", [
6908
6907
  DTOFigmaNodeRenderIdInput,
6909
6908
  DTOFigmaNodeRenderUrlInput
6910
6909
  ]);
6911
6910
 
6912
6911
  // src/api/dto/elements/figma-nodes/node-actions-v2.ts
6913
- import { z as z242 } from "zod";
6914
- var DTOFigmaNodeRenderActionOutput = z242.object({
6915
- type: z242.literal("FigmaNodeRender"),
6916
- figmaNodes: z242.array(DTOFigmaNode)
6912
+ import { z as z241 } from "zod";
6913
+ var DTOFigmaNodeRenderActionOutput = z241.object({
6914
+ type: z241.literal("FigmaNodeRender"),
6915
+ figmaNodes: z241.array(DTOFigmaNode)
6917
6916
  });
6918
- var DTOFigmaNodeRenderActionInput = z242.object({
6919
- type: z242.literal("FigmaNodeRender"),
6917
+ var DTOFigmaNodeRenderActionInput = z241.object({
6918
+ type: z241.literal("FigmaNodeRender"),
6920
6919
  input: DTOFigmaNodeRenderInput.array()
6921
6920
  });
6922
6921
 
6923
6922
  // src/api/dto/elements/frame-node-structures/frame-node-structure.ts
6924
- import { z as z243 } from "zod";
6925
- var DTOFrameNodeStructure = z243.object({
6926
- id: z243.string(),
6927
- persistentId: z243.string(),
6928
- designSystemVersionId: z243.string(),
6923
+ import { z as z242 } from "zod";
6924
+ var DTOFrameNodeStructure = z242.object({
6925
+ id: z242.string(),
6926
+ persistentId: z242.string(),
6927
+ designSystemVersionId: z242.string(),
6929
6928
  origin: FigmaFileStructureOrigin,
6930
6929
  assetsInFile: FigmaFileStructureStatistics
6931
6930
  });
6932
- var DTOFrameNodeStructureListResponse = z243.object({
6931
+ var DTOFrameNodeStructureListResponse = z242.object({
6933
6932
  structures: DTOFrameNodeStructure.array()
6934
6933
  });
6935
6934
 
6936
6935
  // src/api/dto/elements/properties/property-definitions.ts
6937
- import { z as z244 } from "zod";
6936
+ import { z as z243 } from "zod";
6938
6937
  var CODE_NAME_REGEX2 = /^[a-zA-Z_$][a-zA-Z_$0-9]{1,99}$/;
6939
- var DTOElementPropertyDefinitionOption = z244.object({
6940
- id: z244.string(),
6941
- name: z244.string(),
6938
+ var DTOElementPropertyDefinitionOption = z243.object({
6939
+ id: z243.string(),
6940
+ name: z243.string(),
6942
6941
  backgroundColor: DTOColorTokenInlineData.optional()
6943
6942
  });
6944
- var DTOElementPropertyDefinition = z244.object({
6945
- id: z244.string(),
6946
- designSystemVersionId: z244.string(),
6943
+ var DTOElementPropertyDefinition = z243.object({
6944
+ id: z243.string(),
6945
+ designSystemVersionId: z243.string(),
6947
6946
  meta: DTOObjectMeta,
6948
- persistentId: z244.string(),
6947
+ persistentId: z243.string(),
6949
6948
  type: ElementPropertyTypeSchema,
6950
6949
  targetElementType: ElementPropertyTargetType,
6951
- codeName: z244.string().regex(CODE_NAME_REGEX2),
6952
- options: nullishToOptional(z244.array(DTOElementPropertyDefinitionOption)),
6950
+ codeName: z243.string().regex(CODE_NAME_REGEX2),
6951
+ options: nullishToOptional(z243.array(DTOElementPropertyDefinitionOption)),
6953
6952
  linkElementType: nullishToOptional(ElementPropertyLinkType),
6954
- isImmutable: z244.boolean(),
6953
+ isImmutable: z243.boolean(),
6955
6954
  immutablePropertyType: ElementPropertyImmutableType.optional()
6956
6955
  });
6957
- var DTOElementPropertyDefinitionListResponse = z244.object({
6958
- definitions: z244.array(DTOElementPropertyDefinition)
6956
+ var DTOElementPropertyDefinitionListResponse = z243.object({
6957
+ definitions: z243.array(DTOElementPropertyDefinition)
6959
6958
  });
6960
- var DTOElementPropertyDefinitionResponse = z244.object({
6959
+ var DTOElementPropertyDefinitionResponse = z243.object({
6961
6960
  definition: DTOElementPropertyDefinition
6962
6961
  });
6963
- var DTOElementPropertyDefinitionCreatePayload = z244.object({
6962
+ var DTOElementPropertyDefinitionCreatePayload = z243.object({
6964
6963
  meta: DTOObjectMeta,
6965
- persistentId: z244.string(),
6964
+ persistentId: z243.string(),
6966
6965
  type: ElementPropertyTypeSchema,
6967
6966
  targetElementType: ElementPropertyTargetType,
6968
- codeName: z244.string().regex(CODE_NAME_REGEX2),
6969
- options: nullishToOptional(z244.array(DTOElementPropertyDefinitionOption)),
6967
+ codeName: z243.string().regex(CODE_NAME_REGEX2),
6968
+ options: nullishToOptional(z243.array(DTOElementPropertyDefinitionOption)),
6970
6969
  linkElementType: nullishToOptional(ElementPropertyLinkType),
6971
- columnWidth: z244.number().max(1024).optional()
6970
+ columnWidth: z243.number().max(1024).optional()
6972
6971
  });
6973
- var DTOElementPropertyDefinitionUpdatePayload = z244.object({
6972
+ var DTOElementPropertyDefinitionUpdatePayload = z243.object({
6974
6973
  meta: DTOObjectMeta.optional(),
6975
- codeName: z244.string().regex(CODE_NAME_REGEX2).optional(),
6976
- options: z244.array(DTOElementPropertyDefinitionOption).optional()
6974
+ codeName: z243.string().regex(CODE_NAME_REGEX2).optional(),
6975
+ options: z243.array(DTOElementPropertyDefinitionOption).optional()
6977
6976
  });
6978
6977
 
6979
6978
  // src/api/dto/elements/properties/property-values.ts
6980
- import { z as z245 } from "zod";
6981
- var DTOElementPropertyValue = z245.object({
6982
- id: z245.string(),
6983
- designSystemVersionId: z245.string(),
6984
- definitionId: z245.string(),
6985
- targetElementId: z245.string(),
6986
- value: z245.union([z245.string(), z245.number(), z245.boolean()]).optional(),
6987
- valuePreview: z245.string().optional()
6988
- });
6989
- var DTOElementPropertyValueListResponse = z245.object({
6990
- values: z245.array(DTOElementPropertyValue)
6991
- });
6992
- var DTOElementPropertyValueResponse = z245.object({
6979
+ import { z as z244 } from "zod";
6980
+ var DTOElementPropertyValue = z244.object({
6981
+ id: z244.string(),
6982
+ designSystemVersionId: z244.string(),
6983
+ definitionId: z244.string(),
6984
+ targetElementId: z244.string(),
6985
+ value: z244.union([z244.string(), z244.number(), z244.boolean()]).optional(),
6986
+ valuePreview: z244.string().optional()
6987
+ });
6988
+ var DTOElementPropertyValueListResponse = z244.object({
6989
+ values: z244.array(DTOElementPropertyValue)
6990
+ });
6991
+ var DTOElementPropertyValueResponse = z244.object({
6993
6992
  value: DTOElementPropertyValue
6994
6993
  });
6995
- var DTOElementPropertyValueUpsertPaylod = z245.object({
6996
- definitionId: z245.string(),
6997
- targetElementId: z245.string(),
6998
- value: z245.string().or(z245.number()).or(z245.boolean())
6994
+ var DTOElementPropertyValueUpsertPaylod = z244.object({
6995
+ definitionId: z244.string(),
6996
+ targetElementId: z244.string(),
6997
+ value: z244.string().or(z244.number()).or(z244.boolean())
6999
6998
  });
7000
6999
 
7001
7000
  // src/api/dto/elements/elements-action-v2.ts
7002
- import { z as z246 } from "zod";
7003
- var DTOElementActionOutput = z246.discriminatedUnion("type", [
7001
+ import { z as z245 } from "zod";
7002
+ var DTOElementActionOutput = z245.discriminatedUnion("type", [
7004
7003
  // Documentation pages
7005
7004
  DTODocumentationPageCreateActionOutputV2,
7006
7005
  DTODocumentationPageUpdateActionOutputV2,
@@ -7023,7 +7022,7 @@ var DTOElementActionOutput = z246.discriminatedUnion("type", [
7023
7022
  // Approvals
7024
7023
  DTODocumentationPageApprovalStateChangeActionOutput
7025
7024
  ]);
7026
- var DTOElementActionInput = z246.discriminatedUnion("type", [
7025
+ var DTOElementActionInput = z245.discriminatedUnion("type", [
7027
7026
  // Documentation pages
7028
7027
  DTODocumentationPageCreateActionInputV2,
7029
7028
  DTODocumentationPageUpdateActionInputV2,
@@ -7048,80 +7047,80 @@ var DTOElementActionInput = z246.discriminatedUnion("type", [
7048
7047
  ]);
7049
7048
 
7050
7049
  // src/api/dto/elements/get-elements-v2.ts
7051
- import { z as z247 } from "zod";
7052
- var DTOElementsGetTypeFilter = z247.enum(["FigmaNode"]);
7053
- var DTOElementsGetQuerySchema = z247.object({
7054
- types: z247.string().transform((val) => val.split(",").map((v) => DTOElementsGetTypeFilter.parse(v)))
7050
+ import { z as z246 } from "zod";
7051
+ var DTOElementsGetTypeFilter = z246.enum(["FigmaNode"]);
7052
+ var DTOElementsGetQuerySchema = z246.object({
7053
+ types: z246.string().transform((val) => val.split(",").map((v) => DTOElementsGetTypeFilter.parse(v)))
7055
7054
  });
7056
- var DTOElementsGetOutput = z247.object({
7057
- figmaNodes: z247.array(DTOFigmaNode).optional()
7055
+ var DTOElementsGetOutput = z246.object({
7056
+ figmaNodes: z246.array(DTOFigmaNode).optional()
7058
7057
  });
7059
7058
 
7060
7059
  // src/api/dto/figma-components/assets/download.ts
7061
- import { z as z248 } from "zod";
7062
- var DTOAssetRenderConfiguration = z248.object({
7063
- prefix: z248.string().optional(),
7064
- suffix: z248.string().optional(),
7065
- scale: z248.enum(["x1", "x2", "x3", "x4"]),
7066
- format: z248.enum(["png", "pdf", "svg"])
7067
- });
7068
- var DTORenderedAssetFile = z248.object({
7069
- assetId: z248.string(),
7070
- fileName: z248.string(),
7071
- sourceUrl: z248.string(),
7060
+ import { z as z247 } from "zod";
7061
+ var DTOAssetRenderConfiguration = z247.object({
7062
+ prefix: z247.string().optional(),
7063
+ suffix: z247.string().optional(),
7064
+ scale: z247.enum(["x1", "x2", "x3", "x4"]),
7065
+ format: z247.enum(["png", "pdf", "svg"])
7066
+ });
7067
+ var DTORenderedAssetFile = z247.object({
7068
+ assetId: z247.string(),
7069
+ fileName: z247.string(),
7070
+ sourceUrl: z247.string(),
7072
7071
  settings: DTOAssetRenderConfiguration,
7073
- originalName: z248.string()
7072
+ originalName: z247.string()
7074
7073
  });
7075
- var DTODownloadAssetsRequest = z248.object({
7076
- persistentIds: z248.array(z248.string().uuid()).optional(),
7074
+ var DTODownloadAssetsRequest = z247.object({
7075
+ persistentIds: z247.array(z247.string().uuid()).optional(),
7077
7076
  settings: DTOAssetRenderConfiguration.array()
7078
7077
  });
7079
- var DTODownloadAssetsResponse = z248.object({
7078
+ var DTODownloadAssetsResponse = z247.object({
7080
7079
  items: DTORenderedAssetFile.array()
7081
7080
  });
7082
7081
 
7083
7082
  // src/api/dto/liveblocks/auth-response.ts
7084
- import { z as z249 } from "zod";
7085
- var DTOLiveblocksAuthResponse = z249.object({
7086
- token: z249.string()
7083
+ import { z as z248 } from "zod";
7084
+ var DTOLiveblocksAuthResponse = z248.object({
7085
+ token: z248.string()
7087
7086
  });
7088
7087
 
7089
7088
  // src/api/dto/themes/override.ts
7090
- import { z as z250 } from "zod";
7089
+ import { z as z249 } from "zod";
7091
7090
  var DTOThemeOverride = DesignTokenTypedData.and(
7092
- z250.object({
7093
- tokenPersistentId: z250.string(),
7091
+ z249.object({
7092
+ tokenPersistentId: z249.string(),
7094
7093
  origin: ThemeOverrideOrigin.optional()
7095
7094
  })
7096
7095
  );
7097
7096
  var DTOThemeOverrideCreatePayload = DesignTokenTypedData.and(
7098
- z250.object({
7099
- tokenPersistentId: z250.string()
7097
+ z249.object({
7098
+ tokenPersistentId: z249.string()
7100
7099
  })
7101
7100
  );
7102
7101
 
7103
7102
  // src/api/dto/themes/theme.ts
7104
- import { z as z251 } from "zod";
7105
- var DTOTheme = z251.object({
7106
- id: z251.string(),
7107
- persistentId: z251.string(),
7108
- designSystemVersionId: z251.string(),
7109
- brandId: z251.string(),
7103
+ import { z as z250 } from "zod";
7104
+ var DTOTheme = z250.object({
7105
+ id: z250.string(),
7106
+ persistentId: z250.string(),
7107
+ designSystemVersionId: z250.string(),
7108
+ brandId: z250.string(),
7110
7109
  meta: ObjectMeta,
7111
- codeName: z251.string(),
7110
+ codeName: z250.string(),
7112
7111
  overrides: DTOThemeOverride.array()
7113
7112
  });
7114
- var DTOThemeResponse = z251.object({
7113
+ var DTOThemeResponse = z250.object({
7115
7114
  theme: DTOTheme
7116
7115
  });
7117
- var DTOThemeListResponse = z251.object({
7116
+ var DTOThemeListResponse = z250.object({
7118
7117
  themes: DTOTheme.array()
7119
7118
  });
7120
- var DTOThemeCreatePayload = z251.object({
7119
+ var DTOThemeCreatePayload = z250.object({
7121
7120
  meta: ObjectMeta,
7122
- persistentId: z251.string(),
7123
- brandId: z251.string(),
7124
- codeName: z251.string(),
7121
+ persistentId: z250.string(),
7122
+ brandId: z250.string(),
7123
+ codeName: z250.string(),
7125
7124
  overrides: DTOThemeOverride.array()
7126
7125
  });
7127
7126
 
@@ -7288,7 +7287,7 @@ var CodegenEndpoint = class {
7288
7287
  };
7289
7288
 
7290
7289
  // src/api/endpoints/design-system/versions/brands.ts
7291
- import { z as z252 } from "zod";
7290
+ import { z as z251 } from "zod";
7292
7291
  var BrandsEndpoint = class {
7293
7292
  constructor(requestExecutor) {
7294
7293
  this.requestExecutor = requestExecutor;
@@ -7322,7 +7321,7 @@ var BrandsEndpoint = class {
7322
7321
  });
7323
7322
  }
7324
7323
  delete(dsId, vId, brandId) {
7325
- return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/brands/${brandId}`, z252.any(), {
7324
+ return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/brands/${brandId}`, z251.any(), {
7326
7325
  method: "DELETE"
7327
7326
  });
7328
7327
  }
@@ -7333,8 +7332,8 @@ var DocumentationEndpoint = class {
7333
7332
  constructor(requestExecutor) {
7334
7333
  this.requestExecutor = requestExecutor;
7335
7334
  }
7336
- async getStructure(designSystemId, versionId) {
7337
- return await this.requestExecutor.json(
7335
+ getStructure(designSystemId, versionId) {
7336
+ return this.requestExecutor.json(
7338
7337
  `/design-systems/${designSystemId}/versions/${versionId}/documentation/structure`,
7339
7338
  DTODocumentationStructure
7340
7339
  );
@@ -7342,13 +7341,10 @@ var DocumentationEndpoint = class {
7342
7341
  async getDocStructure(dsId, vId) {
7343
7342
  return await this.requestExecutor.json(
7344
7343
  `/design-systems/${dsId}/versions/${vId}/documentation/structure`,
7345
- DTODocumentationStructure
7346
- );
7347
- }
7348
- async getPageRoom(dsId, vId, pageId) {
7349
- return await this.requestExecutor.json(
7350
- `/design-systems/${dsId}/versions/${vId}/documentation/pages/${pageId}/room`,
7351
- DTODocumentationPageRoomResponse
7344
+ DTODocumentationStructure,
7345
+ {
7346
+ method: "GET"
7347
+ }
7352
7348
  );
7353
7349
  }
7354
7350
  };
@@ -7479,7 +7475,7 @@ var ImportJobsEndpoint = class {
7479
7475
  };
7480
7476
 
7481
7477
  // src/api/endpoints/design-system/versions/overrides.ts
7482
- import { z as z253 } from "zod";
7478
+ import { z as z252 } from "zod";
7483
7479
  var OverridesEndpoint = class {
7484
7480
  constructor(requestExecutor) {
7485
7481
  this.requestExecutor = requestExecutor;
@@ -7487,7 +7483,7 @@ var OverridesEndpoint = class {
7487
7483
  create(dsId, versionId, themeId, body) {
7488
7484
  return this.requestExecutor.json(
7489
7485
  `/design-systems/${dsId}/versions/${versionId}/themes/${themeId}/overrides`,
7490
- z253.any(),
7486
+ z252.any(),
7491
7487
  {
7492
7488
  method: "POST",
7493
7489
  body
@@ -7497,7 +7493,7 @@ var OverridesEndpoint = class {
7497
7493
  };
7498
7494
 
7499
7495
  // src/api/endpoints/design-system/versions/property-definitions.ts
7500
- import { z as z254 } from "zod";
7496
+ import { z as z253 } from "zod";
7501
7497
  var ElementPropertyDefinitionsEndpoint = class {
7502
7498
  constructor(requestExecutor) {
7503
7499
  this.requestExecutor = requestExecutor;
@@ -7525,7 +7521,7 @@ var ElementPropertyDefinitionsEndpoint = class {
7525
7521
  delete(designSystemId, versionId, defId) {
7526
7522
  return this.requestExecutor.json(
7527
7523
  `/design-systems/${designSystemId}/versions/${versionId}/element-properties/definitions/${defId}`,
7528
- z254.any(),
7524
+ z253.any(),
7529
7525
  { method: "DELETE" }
7530
7526
  );
7531
7527
  }
@@ -7564,7 +7560,7 @@ var VersionStatsEndpoint = class {
7564
7560
  };
7565
7561
 
7566
7562
  // src/api/endpoints/design-system/versions/themes.ts
7567
- import { z as z255 } from "zod";
7563
+ import { z as z254 } from "zod";
7568
7564
  var ThemesEndpoint = class {
7569
7565
  constructor(requestExecutor) {
7570
7566
  this.requestExecutor = requestExecutor;
@@ -7587,7 +7583,7 @@ var ThemesEndpoint = class {
7587
7583
  });
7588
7584
  }
7589
7585
  delete(dsId, versionId, themeId) {
7590
- return this.requestExecutor.json(`/design-systems/${dsId}/versions/${versionId}/themes/${themeId}`, z255.any(), {
7586
+ return this.requestExecutor.json(`/design-systems/${dsId}/versions/${versionId}/themes/${themeId}`, z254.any(), {
7591
7587
  method: "DELETE"
7592
7588
  });
7593
7589
  }
@@ -7734,7 +7730,7 @@ var DesignSystemContactsEndpoint = class {
7734
7730
  };
7735
7731
 
7736
7732
  // src/api/endpoints/design-system/design-systems.ts
7737
- import { z as z257 } from "zod";
7733
+ import { z as z256 } from "zod";
7738
7734
 
7739
7735
  // src/api/endpoints/design-system/members.ts
7740
7736
  var DesignSystemMembersEndpoint = class {
@@ -7755,7 +7751,7 @@ var DesignSystemMembersEndpoint = class {
7755
7751
  };
7756
7752
 
7757
7753
  // src/api/endpoints/design-system/sources.ts
7758
- import { z as z256 } from "zod";
7754
+ import { z as z255 } from "zod";
7759
7755
  var DesignSystemSourcesEndpoint = class {
7760
7756
  constructor(requestExecutor) {
7761
7757
  this.requestExecutor = requestExecutor;
@@ -7770,7 +7766,7 @@ var DesignSystemSourcesEndpoint = class {
7770
7766
  return this.requestExecutor.json(`/design-systems/${dsId}/sources`, DTODataSourcesListResponse);
7771
7767
  }
7772
7768
  delete(dsId, sourceId) {
7773
- return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, z256.any(), { method: "DELETE" });
7769
+ return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, z255.any(), { method: "DELETE" });
7774
7770
  }
7775
7771
  figmaImport(dsId, payload) {
7776
7772
  return this.requestExecutor.json(`/design-systems/${dsId}/versions/head/cloud-import`, DTOImportJobResponse, {
@@ -7805,7 +7801,7 @@ var DesignSystemsEndpoint = class {
7805
7801
  return this.requestExecutor.json(`/design-systems/${dsId}`, DTODesignSystemResponse);
7806
7802
  }
7807
7803
  delete(dsId) {
7808
- return this.requestExecutor.json(`/design-systems/${dsId}`, z257.any(), { method: "DELETE" });
7804
+ return this.requestExecutor.json(`/design-systems/${dsId}`, z256.any(), { method: "DELETE" });
7809
7805
  }
7810
7806
  update(dsId, body) {
7811
7807
  return this.requestExecutor.json(`/design-systems/${dsId}`, DTODesignSystemResponse, {
@@ -7849,7 +7845,7 @@ var WorkspaceInvitationsEndpoint = class {
7849
7845
  };
7850
7846
 
7851
7847
  // src/api/endpoints/workspaces/workspace-members.ts
7852
- import { z as z258 } from "zod";
7848
+ import { z as z257 } from "zod";
7853
7849
  var WorkspaceMembersEndpoint = class {
7854
7850
  constructor(requestExecutor) {
7855
7851
  this.requestExecutor = requestExecutor;
@@ -7866,7 +7862,7 @@ var WorkspaceMembersEndpoint = class {
7866
7862
  });
7867
7863
  }
7868
7864
  invite(workspaceId, body) {
7869
- return this.requestExecutor.json(`/workspaces/${workspaceId}/members`, z258.any(), { method: "POST", body });
7865
+ return this.requestExecutor.json(`/workspaces/${workspaceId}/members`, z257.any(), { method: "POST", body });
7870
7866
  }
7871
7867
  delete(workspaceId, userId) {
7872
7868
  return this.requestExecutor.json(`/workspaces/${workspaceId}/members/${userId}`, DTOWorkspaceResponse, {
@@ -7876,7 +7872,7 @@ var WorkspaceMembersEndpoint = class {
7876
7872
  };
7877
7873
 
7878
7874
  // src/api/endpoints/workspaces/workspaces.ts
7879
- import { z as z259 } from "zod";
7875
+ import { z as z258 } from "zod";
7880
7876
  var WorkspacesEndpoint = class {
7881
7877
  constructor(requestExecutor) {
7882
7878
  this.requestExecutor = requestExecutor;
@@ -7899,10 +7895,10 @@ var WorkspacesEndpoint = class {
7899
7895
  return this.requestExecutor.json(`/workspaces/${workspaceId}`, DTOWorkspaceResponse, { method: "GET" });
7900
7896
  }
7901
7897
  delete(workspaceId) {
7902
- return this.requestExecutor.json(`/workspaces/${workspaceId}`, z259.any(), { method: "DELETE" });
7898
+ return this.requestExecutor.json(`/workspaces/${workspaceId}`, z258.any(), { method: "DELETE" });
7903
7899
  }
7904
7900
  subscription(workspaceId) {
7905
- return this.requestExecutor.json(`/workspaces/${workspaceId}/subscription`, z259.any(), { method: "GET" });
7901
+ return this.requestExecutor.json(`/workspaces/${workspaceId}/subscription`, z258.any(), { method: "GET" });
7906
7902
  }
7907
7903
  transferOwnership(workspaceId, body) {
7908
7904
  return this.requestExecutor.json(`/workspaces/${workspaceId}/ownership`, DTOWorkspaceResponse, {
@@ -7912,19 +7908,6 @@ var WorkspacesEndpoint = class {
7912
7908
  }
7913
7909
  };
7914
7910
 
7915
- // src/api/endpoints/liveblocks.ts
7916
- var LiveblocksEndpoint = class {
7917
- constructor(requestExecutor) {
7918
- this.requestExecutor = requestExecutor;
7919
- }
7920
- auth(body) {
7921
- return this.requestExecutor.json("/liveblocks/auth", DTOLiveblocksAuthResponse, {
7922
- method: "POST",
7923
- body
7924
- });
7925
- }
7926
- };
7927
-
7928
7911
  // src/api/endpoints/users.ts
7929
7912
  var UsersEndpoint = class {
7930
7913
  constructor(requestExecutor) {
@@ -8002,9 +7985,9 @@ ${bodyText}`,
8002
7985
 
8003
7986
  // src/api/transport/request-executor.ts
8004
7987
  import fetch from "node-fetch";
8005
- import { z as z260 } from "zod";
8006
- var ResponseWrapper = z260.object({
8007
- result: z260.record(z260.any())
7988
+ import { z as z259 } from "zod";
7989
+ var ResponseWrapper = z259.object({
7990
+ result: z259.record(z259.any())
8008
7991
  });
8009
7992
  var RequestExecutor = class {
8010
7993
  constructor(testServerConfig) {
@@ -8067,7 +8050,6 @@ var SupernovaApiClient = class {
8067
8050
  __publicField(this, "workspaces");
8068
8051
  __publicField(this, "designSystems");
8069
8052
  __publicField(this, "codegen");
8070
- __publicField(this, "liveblocks");
8071
8053
  const requestExecutor = new RequestExecutor({
8072
8054
  host: config.host,
8073
8055
  accessToken: config.accessToken
@@ -8076,12 +8058,14 @@ var SupernovaApiClient = class {
8076
8058
  this.workspaces = new WorkspacesEndpoint(requestExecutor);
8077
8059
  this.designSystems = new DesignSystemsEndpoint(requestExecutor);
8078
8060
  this.codegen = new CodegenEndpoint(requestExecutor);
8079
- this.liveblocks = new LiveblocksEndpoint(requestExecutor);
8080
8061
  }
8081
8062
  };
8082
8063
 
8064
+ // src/sync/docs-structure-repo.ts
8065
+ import PQueue from "p-queue";
8066
+
8083
8067
  // src/yjs/design-system-content/documentation-hierarchy.ts
8084
- import { z as z261 } from "zod";
8068
+ import { z as z260 } from "zod";
8085
8069
 
8086
8070
  // src/yjs/version-room/base.ts
8087
8071
  var VersionRoomBaseYDoc = class {
@@ -8089,6 +8073,17 @@ var VersionRoomBaseYDoc = class {
8089
8073
  __publicField(this, "yDoc");
8090
8074
  this.yDoc = yDoc;
8091
8075
  }
8076
+ getState() {
8077
+ return {
8078
+ approvals: this.getApprovals(),
8079
+ groups: this.getGroups(),
8080
+ groupSnapshots: this.getGroupSnapshots(),
8081
+ pageContentHashes: this.getDocumentationPageContentHashes(),
8082
+ pages: this.getPages(),
8083
+ pageSnapshots: this.getPageSnapshots(),
8084
+ settings: this.getDocumentationInternalSettings()
8085
+ };
8086
+ }
8092
8087
  //
8093
8088
  // Pages
8094
8089
  //
@@ -8240,6 +8235,236 @@ var VersionRoomBaseYDoc = class {
8240
8235
  }
8241
8236
  };
8242
8237
 
8238
+ // src/yjs/version-room/compute-dto.ts
8239
+ function computeDocsHierarchy(input, options = {}) {
8240
+ const includeDeletedContent = options.includeDeletedContent ?? false;
8241
+ const debug = options.debug ?? false;
8242
+ const { pages, groups, pageSnapshots, groupSnapshots, settings, pageContentHashes, approvals } = input;
8243
+ if (includeDeletedContent) {
8244
+ pages.push(...getDeletedPages(pages, pageSnapshots));
8245
+ groups.push(...getDeletedGroups(groups, groupSnapshots));
8246
+ }
8247
+ const pageDTOs = documentationPagesToDTOV2(pages, groups, settings.routingVersion);
8248
+ const groupDTOs = elementGroupsToDocumentationGroupDTOV2(groups, pages);
8249
+ if (!settings.isDraftFeatureAdopted) {
8250
+ return {
8251
+ pages: pageDTOs,
8252
+ groups: groupDTOs
8253
+ };
8254
+ }
8255
+ const pageDraftStates = buildPageDraftCreatedAndUpdatedStates(pages, pageSnapshots, pageContentHashes, debug);
8256
+ const pageDraftDeletedStates = buildPageDraftDeletedStates(pages, pageSnapshots);
8257
+ const pagePublishedMetadata = buildPagePublishedMetadata(pages, pageSnapshots);
8258
+ const pageApprovalStates = mapByUnique(approvals, (a) => a.pagePersistentId);
8259
+ pageDTOs.forEach((p) => {
8260
+ const draftState = pageDraftDeletedStates.get(p.persistentId) ?? pageDraftStates.get(p.persistentId);
8261
+ draftState && (p.draftState = draftState);
8262
+ const publishMetadata = pagePublishedMetadata.get(p.persistentId);
8263
+ publishMetadata && (p.publishMetadata = publishMetadata);
8264
+ const approvalState = pageApprovalStates.get(p.persistentId);
8265
+ approvalState && (p.approvalState = approvalState);
8266
+ });
8267
+ const groupDraftStates = buildGroupDraftCreatedAndUpdatedStates(groups, groupSnapshots, debug);
8268
+ const groupDraftDeletedStates = buildGroupDraftDeletedStates(groups, groupSnapshots);
8269
+ const groupPublishedMetadata = buildGroupPublishedMetadata(groups, groupSnapshots);
8270
+ const groupApprovalStates = buildGroupApprovalStates(groups, groupSnapshots);
8271
+ groupDTOs.forEach((g) => {
8272
+ const draftState = groupDraftDeletedStates.get(g.persistentId) ?? groupDraftStates.get(g.persistentId);
8273
+ draftState && (g.draftState = draftState);
8274
+ const publishMetadata = groupPublishedMetadata.get(g.persistentId);
8275
+ publishMetadata && (g.publishMetadata = publishMetadata);
8276
+ const approvalState = groupApprovalStates.get(g.persistentId);
8277
+ approvalState && (g.approvalState = approvalState);
8278
+ });
8279
+ return {
8280
+ pages: pageDTOs,
8281
+ groups: groupDTOs
8282
+ };
8283
+ }
8284
+ function getDeletedPages(pages, pageSnapshots) {
8285
+ const existingPagePersistentIds = new Set(pages.map((p) => p.persistentId));
8286
+ const latestSnapshots = pickLatestPageSnapshots(pageSnapshots);
8287
+ return latestSnapshots.filter((s) => !existingPagePersistentIds.has(s.page.persistentId)).map((s) => s.page);
8288
+ }
8289
+ function getDeletedGroups(groups, groupSnapshots) {
8290
+ const existingGroupPersistentIds = new Set(groups.map((p) => p.persistentId));
8291
+ const latestSnapshots = pickLatestGroupSnapshots(groupSnapshots);
8292
+ return latestSnapshots.filter((s) => !existingGroupPersistentIds.has(s.group.persistentId)).map((s) => s.group);
8293
+ }
8294
+ function buildPageDraftCreatedAndUpdatedStates(pages, pageSnapshots, pageHashes, debug) {
8295
+ const publishedSnapshots = pickLatestPageSnapshots(pageSnapshots.filter((s) => s.reason === "Publish"));
8296
+ const publishedSnapshotsByPagePersistentId = mapByUnique(publishedSnapshots, (s) => s.page.persistentId);
8297
+ const result = /* @__PURE__ */ new Map();
8298
+ pages.forEach((page) => {
8299
+ const snapshot = publishedSnapshotsByPagePersistentId.get(page.persistentId);
8300
+ let publishedState;
8301
+ if (snapshot) {
8302
+ publishedState = itemStateFromPage(snapshot.page, snapshot.pageContentHash);
8303
+ }
8304
+ const currentPageContentHash = pageHashes[page.persistentId] ?? snapshot?.pageContentHash ?? "";
8305
+ const currentState = itemStateFromPage(page, currentPageContentHash);
8306
+ const draftState = createDraftState(page.persistentId, currentState, publishedState, debug);
8307
+ if (draftState)
8308
+ result.set(page.persistentId, draftState);
8309
+ });
8310
+ return result;
8311
+ }
8312
+ function itemStateFromPage(page, pageContentHash) {
8313
+ return {
8314
+ title: page.meta.name,
8315
+ configuration: page.data.configuration ?? defaultDocumentationItemConfigurationV2,
8316
+ contentHash: pageContentHash
8317
+ };
8318
+ }
8319
+ function buildPagePublishedMetadata(pages, pageSnapshots) {
8320
+ const publishedPageSnapshotsByPersistentId = mapByUnique(
8321
+ pickLatestPageSnapshots(pageSnapshots.filter((s) => s.reason === "Publish")),
8322
+ (s) => s.page.persistentId
8323
+ );
8324
+ const result = /* @__PURE__ */ new Map();
8325
+ pages.forEach((p) => {
8326
+ const publishedSnapshot = publishedPageSnapshotsByPersistentId.get(p.persistentId);
8327
+ if (!publishedSnapshot)
8328
+ return;
8329
+ result.set(p.persistentId, {
8330
+ lastPublishedAt: publishedSnapshot.createdAt,
8331
+ lastPublishedByUserId: publishedSnapshot.createdByUserId
8332
+ });
8333
+ });
8334
+ return result;
8335
+ }
8336
+ function createDraftState(itemPersistentId, currentState, publishedState, debug) {
8337
+ if (!publishedState) {
8338
+ return { changeType: "Created" };
8339
+ }
8340
+ const updatedDraftState = {
8341
+ changeType: "Updated",
8342
+ changes: {}
8343
+ };
8344
+ if (currentState.title !== publishedState.title) {
8345
+ if (debug) {
8346
+ console.log(`Item ${itemPersistentId} (${currentState.title}): updated title`);
8347
+ }
8348
+ updatedDraftState.changes.previousTitle = publishedState.title;
8349
+ }
8350
+ const currentConfigHash = generateHash(currentState.configuration, debug);
8351
+ const publishedConfigHash = generateHash(publishedState.configuration, debug);
8352
+ if (currentConfigHash !== publishedConfigHash) {
8353
+ if (debug) {
8354
+ console.log(`Item ${itemPersistentId} (${currentState.title}): updated configuration`);
8355
+ }
8356
+ const configurationDto = documentationItemConfigurationToDTOV2(publishedState.configuration);
8357
+ updatedDraftState.changes.previousConfiguration = configurationDto;
8358
+ }
8359
+ if (currentState.contentHash !== publishedState.contentHash) {
8360
+ if (debug) {
8361
+ console.log(`Item ${itemPersistentId} (${currentState.title}): updated content hash`);
8362
+ }
8363
+ updatedDraftState.changes.previousContentHash = publishedState.contentHash;
8364
+ }
8365
+ if (Object.keys(updatedDraftState.changes).length) {
8366
+ return updatedDraftState;
8367
+ }
8368
+ return void 0;
8369
+ }
8370
+ function buildGroupApprovalStates(groups, groupSnapshots) {
8371
+ const result = /* @__PURE__ */ new Map();
8372
+ const allGroups = [...groups, ...groupSnapshots];
8373
+ for (const g of allGroups) {
8374
+ const approvalState = {
8375
+ approvalState: "Approved",
8376
+ designSystemVersionId: g.designSystemVersionId,
8377
+ persistentId: g.persistentId,
8378
+ groupPersistentId: g.persistentId
8379
+ };
8380
+ result.set(g.persistentId, approvalState);
8381
+ }
8382
+ return result;
8383
+ }
8384
+ function buildPageDraftDeletedStates(pages, pageSnapshots) {
8385
+ const deletedSnapshotsByPagePersistentId = mapByUnique(
8386
+ pickLatestPageSnapshots(pageSnapshots.filter((s) => s.reason === "Deletion")),
8387
+ (s) => s.page.persistentId
8388
+ );
8389
+ const result = /* @__PURE__ */ new Map();
8390
+ pages.forEach((page) => {
8391
+ const deletedSnapshot = deletedSnapshotsByPagePersistentId.get(page.persistentId);
8392
+ if (!deletedSnapshot)
8393
+ return;
8394
+ result.set(page.persistentId, {
8395
+ changeType: "Deleted",
8396
+ deletedAt: deletedSnapshot.createdAt,
8397
+ deletedByUserId: deletedSnapshot.createdByUserId
8398
+ });
8399
+ });
8400
+ return result;
8401
+ }
8402
+ function buildGroupDraftDeletedStates(groups, groupSnapshots) {
8403
+ const deletedSnapshotsByGroupPersistentId = mapByUnique(
8404
+ pickLatestGroupSnapshots(groupSnapshots.filter((s) => s.reason === "Deletion")),
8405
+ (s) => s.group.persistentId
8406
+ );
8407
+ const result = /* @__PURE__ */ new Map();
8408
+ groups.forEach((group) => {
8409
+ if (!group.parentPersistentId)
8410
+ return;
8411
+ const deletedSnapshot = deletedSnapshotsByGroupPersistentId.get(group.persistentId);
8412
+ if (!deletedSnapshot)
8413
+ return;
8414
+ result.set(group.persistentId, {
8415
+ changeType: "Deleted",
8416
+ deletedAt: deletedSnapshot.createdAt,
8417
+ deletedByUserId: deletedSnapshot.createdByUserId
8418
+ });
8419
+ });
8420
+ return result;
8421
+ }
8422
+ function buildGroupDraftCreatedAndUpdatedStates(groups, groupSnapshots, debug) {
8423
+ const publishedSnapshots = pickLatestGroupSnapshots(groupSnapshots.filter((s) => s.reason === "Publish"));
8424
+ const publishedSnapshotsByGroupPersistent = mapByUnique(publishedSnapshots, (s) => s.group.persistentId);
8425
+ const result = /* @__PURE__ */ new Map();
8426
+ groups.forEach((group) => {
8427
+ if (!group.parentPersistentId)
8428
+ return;
8429
+ const currentState = itemStateFromGroup(group);
8430
+ const snapshot = publishedSnapshotsByGroupPersistent.get(group.persistentId);
8431
+ let publishedState;
8432
+ if (snapshot) {
8433
+ publishedState = itemStateFromGroup(snapshot.group);
8434
+ }
8435
+ const draftState = createDraftState(group.persistentId, currentState, publishedState, debug);
8436
+ if (draftState)
8437
+ result.set(group.persistentId, draftState);
8438
+ });
8439
+ return result;
8440
+ }
8441
+ function itemStateFromGroup(group) {
8442
+ return {
8443
+ title: group.meta.name,
8444
+ configuration: group.data?.configuration ?? defaultDocumentationItemConfigurationV2,
8445
+ contentHash: "-"
8446
+ };
8447
+ }
8448
+ function buildGroupPublishedMetadata(groups, groupSnapshots) {
8449
+ const publishedGroupSnapshotsByPersistentId = mapByUnique(
8450
+ pickLatestGroupSnapshots(groupSnapshots.filter((s) => s.reason === "Publish")),
8451
+ (s) => s.group.persistentId
8452
+ );
8453
+ const result = /* @__PURE__ */ new Map();
8454
+ groups.forEach((g) => {
8455
+ if (!g.parentPersistentId)
8456
+ return;
8457
+ const publishedSnapshot = publishedGroupSnapshotsByPersistentId.get(g.persistentId);
8458
+ if (!publishedSnapshot)
8459
+ return;
8460
+ result.set(g.persistentId, {
8461
+ lastPublishedAt: publishedSnapshot.createdAt,
8462
+ lastPublishedByUserId: publishedSnapshot.createdByUserId
8463
+ });
8464
+ });
8465
+ return result;
8466
+ }
8467
+
8243
8468
  // src/yjs/version-room/utils.ts
8244
8469
  function generatePageContentHash(content, definitions, debug = false) {
8245
8470
  let sanitizedContent = structuredClone(content);
@@ -8319,247 +8544,8 @@ var FrontendVersionRoomYDoc = class {
8319
8544
  // Hierarchy
8320
8545
  //
8321
8546
  getDocumentationHierarchy(options = {}) {
8322
- const includeDeletedContent = options.includeDeletedContent ?? false;
8323
8547
  const doc = new VersionRoomBaseYDoc(this.yDoc);
8324
- const pages = doc.getPages();
8325
- const groups = doc.getGroups();
8326
- const pageSnapshots = doc.getPageSnapshots();
8327
- const groupSnapshots = doc.getGroupSnapshots();
8328
- if (includeDeletedContent) {
8329
- pages.push(...this.getDeletedPages(pages, pageSnapshots));
8330
- groups.push(...this.getDeletedGroups(groups, groupSnapshots));
8331
- }
8332
- const settings = doc.getDocumentationInternalSettings();
8333
- const pageDTOs = documentationPagesToDTOV2(pages, groups, settings.routingVersion);
8334
- const groupDTOs = elementGroupsToDocumentationGroupDTOV2(groups, pages);
8335
- if (!settings.isDraftFeatureAdopted) {
8336
- return {
8337
- pages: pageDTOs,
8338
- groups: groupDTOs
8339
- };
8340
- }
8341
- const pageDraftStates = this.buildPageDraftCreatedAndUpdatedStates(pages, pageSnapshots);
8342
- const pageDraftDeletedStates = this.buildPageDraftDeletedStates(pages, pageSnapshots);
8343
- const pagePublishedMetadata = this.buildPagePublishedMetadata(pages, pageSnapshots);
8344
- const pageApprovalStates = this.buildPageApprovalStates(pages);
8345
- pageDTOs.forEach((p) => {
8346
- const draftState = pageDraftDeletedStates.get(p.id) ?? pageDraftStates.get(p.id);
8347
- draftState && (p.draftState = draftState);
8348
- const publishMetadata = pagePublishedMetadata.get(p.id);
8349
- publishMetadata && (p.publishMetadata = publishMetadata);
8350
- const approvalState = pageApprovalStates.get(p.id);
8351
- approvalState && (p.approvalState = approvalState);
8352
- });
8353
- const groupDraftStates = this.buildGroupDraftCreatedAndUpdatedStates(groups, groupSnapshots);
8354
- const groupDraftDeletedStates = this.buildGroupDraftDeletedStates(groups, groupSnapshots);
8355
- const groupPublishedMetadata = this.buildGroupPublishedMetadata(groups, groupSnapshots);
8356
- const groupApprovalStates = this.buildGroupApprovalStates(groups, groupSnapshots);
8357
- groupDTOs.forEach((g) => {
8358
- const draftState = groupDraftDeletedStates.get(g.id) ?? groupDraftStates.get(g.id);
8359
- draftState && (g.draftState = draftState);
8360
- const publishMetadata = groupPublishedMetadata.get(g.id);
8361
- publishMetadata && (g.publishMetadata = publishMetadata);
8362
- const approvalState = groupApprovalStates.get(g.id);
8363
- approvalState && (g.approvalState = approvalState);
8364
- });
8365
- return {
8366
- pages: pageDTOs,
8367
- groups: groupDTOs
8368
- };
8369
- }
8370
- //
8371
- // Drafts - Pages
8372
- //
8373
- buildPageDraftDeletedStates(pages, pageSnapshots) {
8374
- const deletedSnapshotsByPageId = mapByUnique(
8375
- pickLatestPageSnapshots(pageSnapshots.filter((s) => s.reason === "Deletion")),
8376
- (s) => s.page.id
8377
- );
8378
- const result = /* @__PURE__ */ new Map();
8379
- pages.forEach((page) => {
8380
- const deletedSnapshot = deletedSnapshotsByPageId.get(page.id);
8381
- if (!deletedSnapshot)
8382
- return;
8383
- result.set(page.id, {
8384
- changeType: "Deleted",
8385
- deletedAt: deletedSnapshot.createdAt,
8386
- deletedByUserId: deletedSnapshot.createdByUserId
8387
- });
8388
- });
8389
- return result;
8390
- }
8391
- buildPageDraftCreatedAndUpdatedStates(pages, pageSnapshots) {
8392
- const doc = new VersionRoomBaseYDoc(this.yDoc);
8393
- const pageHashes = doc.getDocumentationPageContentHashes();
8394
- const publishedSnapshots = pickLatestPageSnapshots(pageSnapshots.filter((s) => s.reason === "Publish"));
8395
- const publishedSnapshotsByPageId = mapByUnique(publishedSnapshots, (s) => s.page.id);
8396
- const result = /* @__PURE__ */ new Map();
8397
- pages.forEach((page) => {
8398
- const snapshot = publishedSnapshotsByPageId.get(page.id);
8399
- let publishedState;
8400
- if (snapshot) {
8401
- publishedState = this.itemStateFromPage(snapshot.page, snapshot.pageContentHash);
8402
- }
8403
- const currentPageContentHash = pageHashes[page.persistentId] ?? snapshot?.pageContentHash ?? "";
8404
- const currentState = this.itemStateFromPage(page, currentPageContentHash);
8405
- const draftState = this.createDraftState(page.persistentId, currentState, publishedState);
8406
- if (draftState)
8407
- result.set(page.id, draftState);
8408
- });
8409
- return result;
8410
- }
8411
- itemStateFromPage(page, pageContentHash) {
8412
- return {
8413
- title: page.meta.name,
8414
- configuration: page.data.configuration ?? defaultDocumentationItemConfigurationV2,
8415
- contentHash: pageContentHash
8416
- };
8417
- }
8418
- getDeletedPages(pages, pageSnapshots) {
8419
- const existingPageIds = new Set(pages.map((p) => p.id));
8420
- const latestSnapshots = pickLatestPageSnapshots(pageSnapshots);
8421
- return latestSnapshots.filter((s) => !existingPageIds.has(s.page.id)).map((s) => s.page);
8422
- }
8423
- buildPagePublishedMetadata(pages, pageSnapshots) {
8424
- const publishedPageSnapshotsById = mapByUnique(
8425
- pickLatestPageSnapshots(pageSnapshots.filter((s) => s.reason === "Publish")),
8426
- (s) => s.page.id
8427
- );
8428
- const result = /* @__PURE__ */ new Map();
8429
- pages.forEach((p) => {
8430
- const publishedSnapshot = publishedPageSnapshotsById.get(p.id);
8431
- if (!publishedSnapshot)
8432
- return;
8433
- result.set(p.id, {
8434
- lastPublishedAt: publishedSnapshot.createdAt,
8435
- lastPublishedByUserId: publishedSnapshot.createdByUserId
8436
- });
8437
- });
8438
- return result;
8439
- }
8440
- //
8441
- // Drafts - Groups
8442
- //
8443
- buildGroupDraftDeletedStates(groups, groupSnapshots) {
8444
- const deletedSnapshotsByGroupId = mapByUnique(
8445
- pickLatestGroupSnapshots(groupSnapshots.filter((s) => s.reason === "Deletion")),
8446
- (s) => s.group.id
8447
- );
8448
- const result = /* @__PURE__ */ new Map();
8449
- groups.forEach((group) => {
8450
- if (!group.parentPersistentId)
8451
- return;
8452
- const deletedSnapshot = deletedSnapshotsByGroupId.get(group.id);
8453
- if (!deletedSnapshot)
8454
- return;
8455
- result.set(group.id, {
8456
- changeType: "Deleted",
8457
- deletedAt: deletedSnapshot.createdAt,
8458
- deletedByUserId: deletedSnapshot.createdByUserId
8459
- });
8460
- });
8461
- return result;
8462
- }
8463
- buildGroupDraftCreatedAndUpdatedStates(groups, groupSnapshots) {
8464
- const publishedSnapshots = pickLatestGroupSnapshots(groupSnapshots.filter((s) => s.reason === "Publish"));
8465
- const publishedSnapshotsByGroupId = mapByUnique(publishedSnapshots, (s) => s.group.id);
8466
- const result = /* @__PURE__ */ new Map();
8467
- groups.forEach((group) => {
8468
- if (!group.parentPersistentId)
8469
- return;
8470
- const currentState = this.itemStateFromGroup(group);
8471
- const snapshot = publishedSnapshotsByGroupId.get(group.id);
8472
- let publishedState;
8473
- if (snapshot) {
8474
- publishedState = this.itemStateFromGroup(snapshot.group);
8475
- }
8476
- const draftState = this.createDraftState(group.persistentId, currentState, publishedState);
8477
- if (draftState)
8478
- result.set(group.id, draftState);
8479
- });
8480
- return result;
8481
- }
8482
- itemStateFromGroup(group) {
8483
- return {
8484
- title: group.meta.name,
8485
- configuration: group.data?.configuration ?? defaultDocumentationItemConfigurationV2,
8486
- contentHash: "-"
8487
- };
8488
- }
8489
- getDeletedGroups(groups, groupSnapshots) {
8490
- const existingGroupIds = new Set(groups.map((p) => p.id));
8491
- const latestSnapshots = pickLatestGroupSnapshots(groupSnapshots);
8492
- return latestSnapshots.filter((s) => !existingGroupIds.has(s.group.id)).map((s) => s.group);
8493
- }
8494
- buildGroupPublishedMetadata(groups, groupSnapshots) {
8495
- const publishedGroupSnapshotsById = mapByUnique(
8496
- pickLatestGroupSnapshots(groupSnapshots.filter((s) => s.reason === "Publish")),
8497
- (s) => s.group.id
8498
- );
8499
- const result = /* @__PURE__ */ new Map();
8500
- groups.forEach((g) => {
8501
- if (!g.parentPersistentId)
8502
- return;
8503
- const publishedSnapshot = publishedGroupSnapshotsById.get(g.id);
8504
- if (!publishedSnapshot)
8505
- return;
8506
- result.set(g.id, {
8507
- lastPublishedAt: publishedSnapshot.createdAt,
8508
- lastPublishedByUserId: publishedSnapshot.createdByUserId
8509
- });
8510
- });
8511
- return result;
8512
- }
8513
- //
8514
- // Drafts - Shared
8515
- //
8516
- createDraftState(itemPersistentId, currentState, publishedState) {
8517
- if (!publishedState) {
8518
- return { changeType: "Created" };
8519
- }
8520
- const updatedDraftState = {
8521
- changeType: "Updated",
8522
- changes: {}
8523
- };
8524
- if (currentState.title !== publishedState.title) {
8525
- if (this.debug) {
8526
- console.log(`Item ${itemPersistentId} (${currentState.title}): updated title`);
8527
- }
8528
- updatedDraftState.changes.previousTitle = publishedState.title;
8529
- }
8530
- const currentConfigHash = generateHash(currentState.configuration, this.debug);
8531
- const publishedConfigHash = generateHash(publishedState.configuration, this.debug);
8532
- if (currentConfigHash !== publishedConfigHash) {
8533
- if (this.debug) {
8534
- console.log(`Item ${itemPersistentId} (${currentState.title}): updated configuration`);
8535
- }
8536
- const configurationDto = documentationItemConfigurationToDTOV2(publishedState.configuration);
8537
- updatedDraftState.changes.previousConfiguration = configurationDto;
8538
- }
8539
- if (currentState.contentHash !== publishedState.contentHash) {
8540
- if (this.debug) {
8541
- console.log(`Item ${itemPersistentId} (${currentState.title}): updated content hash`);
8542
- }
8543
- updatedDraftState.changes.previousContentHash = publishedState.contentHash;
8544
- }
8545
- if (Object.keys(updatedDraftState.changes).length) {
8546
- return updatedDraftState;
8547
- }
8548
- return void 0;
8549
- }
8550
- buildGroupApprovalStates(groups, groupSnapshots) {
8551
- const result = /* @__PURE__ */ new Map();
8552
- const allGroups = [...groups, ...groupSnapshots];
8553
- for (const g of allGroups) {
8554
- const approvalState = {
8555
- approvalState: "Approved",
8556
- designSystemVersionId: g.designSystemVersionId,
8557
- persistentId: g.persistentId,
8558
- groupId: g.id
8559
- };
8560
- result.set(g.id, approvalState);
8561
- }
8562
- return result;
8548
+ return computeDocsHierarchy(doc.getState(), options);
8563
8549
  }
8564
8550
  //
8565
8551
  // Update page content hash
@@ -8595,40 +8581,27 @@ var FrontendVersionRoomYDoc = class {
8595
8581
  const settings = doc.getDocumentationInternalSettings();
8596
8582
  return settings.approvalRequiredForPublishing;
8597
8583
  }
8598
- buildPageApprovalStates(pages) {
8599
- const doc = new VersionRoomBaseYDoc(this.yDoc);
8600
- const pageIds = pages.map((p) => p.id);
8601
- const result = /* @__PURE__ */ new Map();
8602
- const approvals = doc.getApprovals();
8603
- for (const pId of pageIds) {
8604
- const approval = approvals.find((approval2) => approval2.pageId === pId);
8605
- if (approval) {
8606
- result.set(pId, approval);
8607
- }
8608
- }
8609
- return result;
8610
- }
8611
8584
  };
8612
8585
 
8613
8586
  // src/yjs/design-system-content/documentation-hierarchy.ts
8614
- var DocumentationHierarchySettings = z261.object({
8615
- routingVersion: z261.string(),
8616
- isDraftFeatureAdopted: z261.boolean(),
8617
- isApprovalFeatureEnabled: z261.boolean(),
8618
- approvalRequiredForPublishing: z261.boolean()
8587
+ var DocumentationHierarchySettings = z260.object({
8588
+ routingVersion: z260.string(),
8589
+ isDraftFeatureAdopted: z260.boolean(),
8590
+ isApprovalFeatureEnabled: z260.boolean(),
8591
+ approvalRequiredForPublishing: z260.boolean()
8619
8592
  });
8620
8593
  function yjsToDocumentationHierarchy(doc) {
8621
8594
  return new FrontendVersionRoomYDoc(doc).getDocumentationHierarchy();
8622
8595
  }
8623
8596
 
8624
8597
  // src/yjs/design-system-content/item-configuration.ts
8625
- import { z as z262 } from "zod";
8626
- var DTODocumentationPageRoomHeaderData = z262.object({
8627
- title: z262.string(),
8598
+ import { z as z261 } from "zod";
8599
+ var DTODocumentationPageRoomHeaderData = z261.object({
8600
+ title: z261.string(),
8628
8601
  configuration: DTODocumentationItemConfigurationV2
8629
8602
  });
8630
- var DTODocumentationPageRoomHeaderDataUpdate = z262.object({
8631
- title: z262.string().optional(),
8603
+ var DTODocumentationPageRoomHeaderDataUpdate = z261.object({
8604
+ title: z261.string().optional(),
8632
8605
  configuration: DTODocumentationItemConfigurationV2.omit({ header: true }).extend({ header: DocumentationItemHeaderV2.partial() }).optional()
8633
8606
  });
8634
8607
  function itemConfigurationToYjs(yDoc, item) {
@@ -8679,7 +8652,7 @@ function yjsToItemConfiguration(yDoc) {
8679
8652
  header: rawHeader
8680
8653
  };
8681
8654
  return {
8682
- title: z262.string().parse(title),
8655
+ title: z261.string().parse(title),
8683
8656
  configuration: DTODocumentationItemConfigurationV2.parse(rawConfig)
8684
8657
  };
8685
8658
  }
@@ -8689,9 +8662,9 @@ var PageBlockEditorModel = PageBlockEditorModelV2;
8689
8662
  var PageSectionEditorModel = PageSectionEditorModelV2;
8690
8663
 
8691
8664
  // src/yjs/docs-editor/model/page.ts
8692
- import { z as z263 } from "zod";
8693
- var DocumentationPageEditorModel = z263.object({
8694
- blocks: z263.array(DocumentationPageContentItem)
8665
+ import { z as z262 } from "zod";
8666
+ var DocumentationPageEditorModel = z262.object({
8667
+ blocks: z262.array(DocumentationPageContentItem)
8695
8668
  });
8696
8669
 
8697
8670
  // src/yjs/docs-editor/prosemirror/inner-editor-schema.ts
@@ -12212,7 +12185,7 @@ var blocks = [
12212
12185
 
12213
12186
  // src/yjs/docs-editor/prosemirror-to-blocks.ts
12214
12187
  import { yXmlFragmentToProsemirrorJSON } from "y-prosemirror";
12215
- import { z as z264 } from "zod";
12188
+ import { z as z263 } from "zod";
12216
12189
  function yDocToPage(yDoc, definitions) {
12217
12190
  return yXmlFragmentToPage(yDoc.getXmlFragment("default"), definitions);
12218
12191
  }
@@ -12292,7 +12265,7 @@ function prosemirrorNodeToSectionItem(prosemirrorNode, definitionsMap) {
12292
12265
  return null;
12293
12266
  return {
12294
12267
  id,
12295
- title: getProsemirrorAttribute(prosemirrorNode, "title", z264.string()) ?? "",
12268
+ title: getProsemirrorAttribute(prosemirrorNode, "title", z263.string()) ?? "",
12296
12269
  columns: (prosemirrorNode.content ?? []).filter((c) => c.type === "sectionItemColumn").map((c) => prosemirrorNodeToSectionColumns(c, definitionsMap)).filter(nonNullFilter)
12297
12270
  };
12298
12271
  }
@@ -12327,7 +12300,7 @@ function internalProsemirrorNodesToBlocks(prosemirrorNodes, definitionsMap, dept
12327
12300
  });
12328
12301
  }
12329
12302
  function internalProsemirrorNodeToBlock(prosemirrorNode, definitionsMap, depth) {
12330
- const definitionId = getProsemirrorAttribute(prosemirrorNode, "definitionId", z264.string());
12303
+ const definitionId = getProsemirrorAttribute(prosemirrorNode, "definitionId", z263.string());
12331
12304
  if (!definitionId) {
12332
12305
  console.warn(`definitionId on ${prosemirrorNode.type} is required to be interpreted as a block, skipping node`);
12333
12306
  return [];
@@ -12369,7 +12342,7 @@ function parseAsRichText(prosemirrorNode, definition, property) {
12369
12342
  if (!id)
12370
12343
  return null;
12371
12344
  const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
12372
- const calloutType = parseCalloutType(getProsemirrorAttribute(prosemirrorNode, "type", z264.string().optional()));
12345
+ const calloutType = parseCalloutType(getProsemirrorAttribute(prosemirrorNode, "type", z263.string().optional()));
12373
12346
  return {
12374
12347
  id,
12375
12348
  type: "Block",
@@ -12497,10 +12470,10 @@ function parseRichTextAttribute(mark) {
12497
12470
  return null;
12498
12471
  }
12499
12472
  function parseProsemirrorLink(mark) {
12500
- const href = getProsemirrorAttribute(mark, "href", z264.string().optional());
12473
+ const href = getProsemirrorAttribute(mark, "href", z263.string().optional());
12501
12474
  if (!href)
12502
12475
  return null;
12503
- const target = getProsemirrorAttribute(mark, "target", z264.string().optional());
12476
+ const target = getProsemirrorAttribute(mark, "target", z263.string().optional());
12504
12477
  const openInNewTab = target === "_blank";
12505
12478
  if (href.startsWith("@")) {
12506
12479
  return {
@@ -12519,10 +12492,10 @@ function parseProsemirrorLink(mark) {
12519
12492
  }
12520
12493
  }
12521
12494
  function parseProsemirrorCommentHighlight(mark) {
12522
- const highlightId = getProsemirrorAttribute(mark, "highlightId", z264.string().optional());
12495
+ const highlightId = getProsemirrorAttribute(mark, "highlightId", z263.string().optional());
12523
12496
  if (!highlightId)
12524
12497
  return null;
12525
- const isResolved = getProsemirrorAttribute(mark, "resolved", z264.boolean().optional()) ?? false;
12498
+ const isResolved = getProsemirrorAttribute(mark, "resolved", z263.boolean().optional()) ?? false;
12526
12499
  return {
12527
12500
  type: "Comment",
12528
12501
  commentHighlightId: highlightId,
@@ -12534,7 +12507,7 @@ function parseAsTable(prosemirrorNode, definition, property) {
12534
12507
  if (!id)
12535
12508
  return null;
12536
12509
  const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
12537
- const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", z264.boolean().optional()) !== false;
12510
+ const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", z263.boolean().optional()) !== false;
12538
12511
  const tableChild = prosemirrorNode.content?.find((c) => c.type === "table");
12539
12512
  if (!tableChild) {
12540
12513
  return emptyTable(id, variantId, 0);
@@ -12581,9 +12554,9 @@ function parseAsTableCell(prosemirrorNode) {
12581
12554
  const id = getProsemirrorBlockId(prosemirrorNode);
12582
12555
  if (!id)
12583
12556
  return null;
12584
- const textAlign = getProsemirrorAttribute(prosemirrorNode, "textAlign", z264.string().optional());
12557
+ const textAlign = getProsemirrorAttribute(prosemirrorNode, "textAlign", z263.string().optional());
12585
12558
  let columnWidth;
12586
- const columnWidthArray = getProsemirrorAttribute(prosemirrorNode, "colwidth", z264.array(z264.number()).nullish());
12559
+ const columnWidthArray = getProsemirrorAttribute(prosemirrorNode, "colwidth", z263.array(z263.number()).nullish());
12587
12560
  if (columnWidthArray) {
12588
12561
  columnWidth = roundDimension(columnWidthArray[0]);
12589
12562
  }
@@ -12621,7 +12594,7 @@ function parseAsTableNode(prosemirrorNode) {
12621
12594
  value: parseRichText(prosemirrorNode.content ?? [])
12622
12595
  };
12623
12596
  case "image":
12624
- const items = getProsemirrorAttribute(prosemirrorNode, "items", z264.string());
12597
+ const items = getProsemirrorAttribute(prosemirrorNode, "items", z263.string());
12625
12598
  if (!items)
12626
12599
  return null;
12627
12600
  const parsedItems = PageBlockItemV2.array().safeParse(JSON.parse(items));
@@ -12741,7 +12714,7 @@ function definitionExpectsPlaceholderItem(definition) {
12741
12714
  );
12742
12715
  }
12743
12716
  function parseBlockItems(prosemirrorNode, definition) {
12744
- const itemsString = getProsemirrorAttribute(prosemirrorNode, "items", z264.string());
12717
+ const itemsString = getProsemirrorAttribute(prosemirrorNode, "items", z263.string());
12745
12718
  if (!itemsString)
12746
12719
  return null;
12747
12720
  const itemsJson = JSON.parse(itemsString);
@@ -12753,18 +12726,18 @@ function parseBlockItems(prosemirrorNode, definition) {
12753
12726
  }
12754
12727
  function parseAppearance(prosemirrorNode) {
12755
12728
  let appearance = {};
12756
- const rawAppearanceString = getProsemirrorAttribute(prosemirrorNode, "appearance", z264.string().optional());
12729
+ const rawAppearanceString = getProsemirrorAttribute(prosemirrorNode, "appearance", z263.string().optional());
12757
12730
  if (rawAppearanceString) {
12758
12731
  const parsedAppearance = PageBlockAppearanceV2.safeParse(JSON.parse(rawAppearanceString));
12759
12732
  if (parsedAppearance.success) {
12760
12733
  appearance = parsedAppearance.data;
12761
12734
  }
12762
12735
  }
12763
- const columns = getProsemirrorAttribute(prosemirrorNode, "columns", z264.number().optional());
12736
+ const columns = getProsemirrorAttribute(prosemirrorNode, "columns", z263.number().optional());
12764
12737
  if (columns) {
12765
12738
  appearance.numberOfColumns = columns;
12766
12739
  }
12767
- const backgroundColor = getProsemirrorAttribute(prosemirrorNode, "backgroundColor", z264.string().optional());
12740
+ const backgroundColor = getProsemirrorAttribute(prosemirrorNode, "backgroundColor", z263.string().optional());
12768
12741
  if (backgroundColor) {
12769
12742
  const parsedColor = PageBlockColorV2.safeParse(JSON.parse(backgroundColor));
12770
12743
  if (parsedColor.success) {
@@ -12859,13 +12832,13 @@ function valueSchemaForPropertyType(type) {
12859
12832
  }
12860
12833
  }
12861
12834
  function getProsemirrorBlockId(prosemirrorNode) {
12862
- const id = getProsemirrorAttribute(prosemirrorNode, "id", z264.string());
12835
+ const id = getProsemirrorAttribute(prosemirrorNode, "id", z263.string());
12863
12836
  if (!id)
12864
12837
  console.warn(`Prosemirror attribute "id" on ${prosemirrorNode.type} is required`);
12865
12838
  return id;
12866
12839
  }
12867
12840
  function getProsemirrorBlockVariantId(prosemirrorNode) {
12868
- return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(z264.string()));
12841
+ return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(z263.string()));
12869
12842
  }
12870
12843
  function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
12871
12844
  const parsedAttr = validationSchema.safeParse(prosemirrorNode.attrs?.[attributeName]);
@@ -12922,6 +12895,229 @@ var BackendVersionRoomYDoc = class {
12922
12895
  return Object.fromEntries(validHashes);
12923
12896
  }
12924
12897
  };
12898
+
12899
+ // src/sync/local-state.ts
12900
+ var LocalStorage = class {
12901
+ constructor() {
12902
+ __publicField(this, "pages", /* @__PURE__ */ new Map());
12903
+ __publicField(this, "deletedPageIds", /* @__PURE__ */ new Set());
12904
+ __publicField(this, "groups", /* @__PURE__ */ new Map());
12905
+ }
12906
+ setPage(page) {
12907
+ if (this.pages.has(page.persistentId)) {
12908
+ throw new Error(`Page with id ${page.persistentId} already exists`);
12909
+ }
12910
+ this.pages.set(page.persistentId, page);
12911
+ }
12912
+ deletePage(persistentId) {
12913
+ this.pages.delete(persistentId);
12914
+ this.deletedPageIds.add(persistentId);
12915
+ }
12916
+ tryGetPage(persistentId) {
12917
+ return this.pages.get(persistentId);
12918
+ }
12919
+ getPage(persistentId) {
12920
+ const page = this.tryGetPage(persistentId);
12921
+ if (!page)
12922
+ throw new Error(`Page with id ${persistentId} doesn't exist`);
12923
+ return page;
12924
+ }
12925
+ getAllPages() {
12926
+ return Array.from(this.pages.values());
12927
+ }
12928
+ getAllDeletedPages() {
12929
+ return this.deletedPageIds;
12930
+ }
12931
+ removePage(persistentId) {
12932
+ this.pages.delete(persistentId);
12933
+ }
12934
+ };
12935
+
12936
+ // src/sync/docs-structure-repo.ts
12937
+ var DocsStructureRepo = class {
12938
+ };
12939
+ var DocsStructureRepository = class {
12940
+ constructor(yDoc, transactionExecutor) {
12941
+ __publicField(this, "localState", new LocalStorage());
12942
+ __publicField(this, "yDoc");
12943
+ __publicField(this, "yObserver");
12944
+ __publicField(this, "yState");
12945
+ __publicField(this, "trxQueue");
12946
+ __publicField(this, "hierarchyObservers", /* @__PURE__ */ new Set());
12947
+ this.yDoc = yDoc;
12948
+ this.yState = new VersionRoomBaseYDoc(this.yDoc).getState();
12949
+ this.yObserver = yDoc.on("update", () => this.onYUpdate());
12950
+ this.trxQueue = new TransactionQueue(transactionExecutor);
12951
+ }
12952
+ //
12953
+ // Lifecycle
12954
+ //
12955
+ addHierarchyObserver(observer) {
12956
+ this.hierarchyObservers.add(observer);
12957
+ }
12958
+ removeHierarchyObserver(observer) {
12959
+ this.hierarchyObservers.delete(observer);
12960
+ }
12961
+ dispose() {
12962
+ this.yDoc.off("update", this.yObserver);
12963
+ this.hierarchyObservers.clear();
12964
+ this.trxQueue.clear();
12965
+ }
12966
+ //
12967
+ // Actions
12968
+ //
12969
+ createPage(input) {
12970
+ void this.createPage(input);
12971
+ }
12972
+ createPagePromise(input) {
12973
+ this.localState.setPage({
12974
+ createdAt: /* @__PURE__ */ new Date(),
12975
+ parentPersistentId: input.parentPersistentId,
12976
+ persistentId: input.persistentId,
12977
+ shortPersistentId: generateShortPersistentId(),
12978
+ slug: slugify(input.title),
12979
+ meta: { name: input.title },
12980
+ updatedAt: /* @__PURE__ */ new Date(),
12981
+ data: { configuration: input.configuration },
12982
+ sortOrder: this.calculateSortOrder(input.parentPersistentId, input.afterPersistentId),
12983
+ designSystemVersionId: ""
12984
+ });
12985
+ this.recalculateHierarchy();
12986
+ return this.trxQueue.enqueue({
12987
+ type: "DocumentationPageCreate",
12988
+ input: {
12989
+ persistentId: input.persistentId,
12990
+ parentPersistentId: input.parentPersistentId,
12991
+ title: input.title,
12992
+ afterPersistentId: input.afterPersistentId,
12993
+ configuration: input.configuration
12994
+ }
12995
+ });
12996
+ }
12997
+ updatePage(update) {
12998
+ void this.updatePagePromise(update);
12999
+ }
13000
+ updatePagePromise(update) {
13001
+ this.updatePageLocally(update);
13002
+ this.recalculateHierarchy();
13003
+ return this.trxQueue.enqueue({
13004
+ type: "DocumentationPageUpdate",
13005
+ input: {
13006
+ id: update.persistentId,
13007
+ configuration: update.configuration,
13008
+ title: update.title
13009
+ }
13010
+ });
13011
+ }
13012
+ updatePageLocally(update) {
13013
+ const basePage = this.lookupPage(update.persistentId);
13014
+ this.localState.setPage(this.createLocalPageUpdate(basePage, update));
13015
+ }
13016
+ deletePagePromise(persistentId) {
13017
+ this.lookupPage(persistentId);
13018
+ this.localState.deletePage(persistentId);
13019
+ this.recalculateHierarchy();
13020
+ return this.trxQueue.enqueue({
13021
+ type: "DocumentationPageDelete",
13022
+ input: {
13023
+ id: persistentId
13024
+ }
13025
+ });
13026
+ }
13027
+ deletePage(persistentId) {
13028
+ void this.deletePagePromise(persistentId);
13029
+ }
13030
+ createLocalPageUpdate(basePage, update) {
13031
+ const { title, configuration } = update;
13032
+ return {
13033
+ createdAt: basePage.createdAt,
13034
+ data: {
13035
+ configuration: configuration ?? basePage.data.configuration
13036
+ },
13037
+ designSystemVersionId: basePage.designSystemVersionId,
13038
+ meta: { name: title ?? basePage.meta.name },
13039
+ parentPersistentId: basePage.parentPersistentId,
13040
+ persistentId: basePage.persistentId,
13041
+ shortPersistentId: basePage.shortPersistentId,
13042
+ sortOrder: basePage.sortOrder,
13043
+ updatedAt: /* @__PURE__ */ new Date(),
13044
+ slug: basePage.slug
13045
+ };
13046
+ }
13047
+ lookupPage(persistentId) {
13048
+ const localPageToUpdate = this.localState.tryGetPage(persistentId);
13049
+ if (localPageToUpdate)
13050
+ return localPageToUpdate;
13051
+ const remotePage = this.yState.pages.find((p) => p.persistentId === persistentId);
13052
+ if (remotePage)
13053
+ return remotePage;
13054
+ throw SupernovaException.notFound(`Page ${persistentId} was not found`);
13055
+ }
13056
+ //
13057
+ // Reactions
13058
+ //
13059
+ recalculateHierarchy() {
13060
+ const allPagesById = mapByUnique(this.yState.pages, (p) => p.persistentId);
13061
+ this.localState.getAllPages().forEach((p) => {
13062
+ allPagesById.set(p.persistentId, p);
13063
+ });
13064
+ this.localState.getAllDeletedPages().forEach((id) => allPagesById.delete(id));
13065
+ const hierarchy = computeDocsHierarchy({
13066
+ approvals: this.yState.approvals,
13067
+ groups: this.yState.groups,
13068
+ groupSnapshots: this.yState.groupSnapshots,
13069
+ pageContentHashes: this.yState.pageContentHashes,
13070
+ pages: Array.from(allPagesById.values()),
13071
+ pageSnapshots: this.yState.pageSnapshots,
13072
+ settings: this.yState.settings
13073
+ });
13074
+ this.hierarchyObservers.forEach((o) => o(hierarchy));
13075
+ }
13076
+ onYUpdate() {
13077
+ this.yState = new VersionRoomBaseYDoc(this.yDoc).getState();
13078
+ this.recalculateHierarchy();
13079
+ }
13080
+ //
13081
+ // Utils
13082
+ //
13083
+ calculateSortOrder(parentPersistentId, afterPersistentId) {
13084
+ const sortOrderStep = Math.pow(2, 16);
13085
+ const neighbours = [
13086
+ ...this.yState.pages.filter((p) => p.parentPersistentId === parentPersistentId),
13087
+ ...this.yState.groups.filter((g) => g.parentPersistentId === parentPersistentId)
13088
+ ];
13089
+ if (!neighbours.length)
13090
+ return 0;
13091
+ neighbours.sort((lhs, rhs) => lhs.sortOrder - rhs.sortOrder);
13092
+ if (!afterPersistentId)
13093
+ return neighbours[0].sortOrder - sortOrderStep;
13094
+ const index = neighbours.findIndex((e) => e.persistentId === afterPersistentId);
13095
+ if (index < 0 || index === neighbours.length - 1) {
13096
+ return neighbours[neighbours.length - 1].sortOrder + sortOrderStep;
13097
+ }
13098
+ const left = neighbours[index].sortOrder;
13099
+ const right = neighbours[index + 1]?.sortOrder ?? left + sortOrderStep * 2;
13100
+ return (right + left) / 2;
13101
+ }
13102
+ };
13103
+ var TransactionQueue = class {
13104
+ constructor(executor) {
13105
+ __publicField(this, "executor");
13106
+ __publicField(this, "queue", new PQueue({
13107
+ concurrency: 1
13108
+ }));
13109
+ this.executor = executor;
13110
+ }
13111
+ enqueue(trx) {
13112
+ return this.queue.add(() => this.executor(trx));
13113
+ }
13114
+ onEmpty() {
13115
+ return this.queue.onEmpty();
13116
+ }
13117
+ clear() {
13118
+ this.queue.clear();
13119
+ }
13120
+ };
12925
13121
  export {
12926
13122
  BackendVersionRoomYDoc,
12927
13123
  BlockDefinitionUtils,
@@ -13041,10 +13237,8 @@ export {
13041
13237
  DTODocumentationPageMoveActionOutputV2,
13042
13238
  DTODocumentationPageRestoreActionInput,
13043
13239
  DTODocumentationPageRestoreActionOutput,
13044
- DTODocumentationPageRoom,
13045
13240
  DTODocumentationPageRoomHeaderData,
13046
13241
  DTODocumentationPageRoomHeaderDataUpdate,
13047
- DTODocumentationPageRoomResponse,
13048
13242
  DTODocumentationPageSnapshot,
13049
13243
  DTODocumentationPageUpdateActionInputV2,
13050
13244
  DTODocumentationPageUpdateActionOutputV2,
@@ -13219,6 +13413,8 @@ export {
13219
13413
  DesignSystemVersionsEndpoint,
13220
13414
  DesignSystemsEndpoint,
13221
13415
  DimensionsVariableScopeType,
13416
+ DocsStructureRepo,
13417
+ DocsStructureRepository,
13222
13418
  DocumentationEndpoint,
13223
13419
  DocumentationHierarchySettings,
13224
13420
  DocumentationPageEditorModel,
@@ -13236,7 +13432,7 @@ export {
13236
13432
  FrontendVersionRoomYDoc,
13237
13433
  ImportJobsEndpoint,
13238
13434
  ListTreeBuilder,
13239
- LiveblocksEndpoint,
13435
+ LocalStorage,
13240
13436
  NpmRegistryInput,
13241
13437
  ObjectMeta2 as ObjectMeta,
13242
13438
  OverridesEndpoint,
@@ -13271,6 +13467,7 @@ export {
13271
13467
  blockToProsemirrorNode,
13272
13468
  buildDocPagePublishPaths,
13273
13469
  calculateElementParentChain,
13470
+ computeDocsHierarchy,
13274
13471
  documentationItemConfigurationToDTOV1,
13275
13472
  documentationItemConfigurationToDTOV2,
13276
13473
  documentationPageToDTOV2,