@supernova-studio/client 0.58.18 → 1.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +1349 -1323
- package/dist/index.d.ts +1349 -1323
- package/dist/index.js +462 -329
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +764 -631
- package/dist/index.mjs.map +1 -1
- package/package.json +4 -3
- package/src/api/client.ts +0 -31
- package/src/api/conversion/documentation/documentation-group-v1-to-dto.ts +0 -114
- package/src/api/conversion/documentation/documentation-group-v2-to-dto.ts +0 -92
- package/src/api/conversion/documentation/documentation-item-configuration-v1-to-dto.ts +0 -52
- package/src/api/conversion/documentation/documentation-item-configuration-v2-to-dto.ts +0 -34
- package/src/api/conversion/documentation/documentation-page-to-dto-utils.ts +0 -131
- package/src/api/conversion/documentation/documentation-page-v1-to-dto.ts +0 -69
- package/src/api/conversion/documentation/documentation-page-v2-to-dto.ts +0 -72
- package/src/api/conversion/documentation/index.ts +0 -7
- package/src/api/conversion/export/index.ts +0 -1
- package/src/api/conversion/export/pipeline.ts +0 -25
- package/src/api/conversion/index.ts +0 -3
- package/src/api/conversion/integrations/git.ts +0 -37
- package/src/api/conversion/integrations/index.ts +0 -2
- package/src/api/conversion/integrations/integration.ts +0 -37
- package/src/api/dto/aux/color.ts +0 -7
- package/src/api/dto/aux/index.ts +0 -3
- package/src/api/dto/aux/meta.ts +0 -8
- package/src/api/dto/aux/pagination.ts +0 -8
- package/src/api/dto/bff/app-bootstrap-data.ts +0 -20
- package/src/api/dto/bff/index.ts +0 -1
- package/src/api/dto/collections/index.ts +0 -1
- package/src/api/dto/collections/token-collection.ts +0 -24
- package/src/api/dto/design-systems/brand.ts +0 -44
- package/src/api/dto/design-systems/component.ts +0 -40
- package/src/api/dto/design-systems/contact.ts +0 -11
- package/src/api/dto/design-systems/data-source.ts +0 -141
- package/src/api/dto/design-systems/design-system.ts +0 -68
- package/src/api/dto/design-systems/elements-diff.ts +0 -14
- package/src/api/dto/design-systems/figma-variables.ts +0 -108
- package/src/api/dto/design-systems/import-job.ts +0 -61
- package/src/api/dto/design-systems/index.ts +0 -13
- package/src/api/dto/design-systems/members.ts +0 -50
- package/src/api/dto/design-systems/role.ts +0 -11
- package/src/api/dto/design-systems/stats.ts +0 -19
- package/src/api/dto/design-systems/version.ts +0 -56
- package/src/api/dto/design-systems/view.ts +0 -45
- package/src/api/dto/design-tokens/design-token.ts +0 -78
- package/src/api/dto/design-tokens/index.ts +0 -1
- package/src/api/dto/documentation/anchor.ts +0 -15
- package/src/api/dto/documentation/approvals.ts +0 -15
- package/src/api/dto/documentation/block-definition.ts +0 -28
- package/src/api/dto/documentation/block.ts +0 -6
- package/src/api/dto/documentation/documentation-page-snapshot.ts +0 -18
- package/src/api/dto/documentation/index.ts +0 -8
- package/src/api/dto/documentation/link-preview.ts +0 -23
- package/src/api/dto/documentation/publish.ts +0 -23
- package/src/api/dto/documentation/room.ts +0 -12
- package/src/api/dto/elements/components/figma-component-group.ts +0 -19
- package/src/api/dto/elements/components/figma-component.ts +0 -56
- package/src/api/dto/elements/components/index.ts +0 -2
- package/src/api/dto/elements/documentation/draft-state.ts +0 -37
- package/src/api/dto/elements/documentation/group-action.ts +0 -108
- package/src/api/dto/elements/documentation/group-v1.ts +0 -35
- package/src/api/dto/elements/documentation/group-v2.ts +0 -117
- package/src/api/dto/elements/documentation/hierarchy.ts +0 -22
- package/src/api/dto/elements/documentation/index.ts +0 -13
- package/src/api/dto/elements/documentation/item-configuration-v1.ts +0 -24
- package/src/api/dto/elements/documentation/item-configuration-v2.ts +0 -14
- package/src/api/dto/elements/documentation/metadata.ts +0 -8
- package/src/api/dto/elements/documentation/page-actions-v2.ts +0 -121
- package/src/api/dto/elements/documentation/page-content.ts +0 -15
- package/src/api/dto/elements/documentation/page-v1.ts +0 -21
- package/src/api/dto/elements/documentation/page-v2.ts +0 -120
- package/src/api/dto/elements/documentation/structure.ts +0 -37
- package/src/api/dto/elements/elements-action-v2.ts +0 -104
- package/src/api/dto/elements/figma-nodes/figma-node.ts +0 -106
- package/src/api/dto/elements/figma-nodes/index.ts +0 -2
- package/src/api/dto/elements/figma-nodes/node-actions-v2.ts +0 -24
- package/src/api/dto/elements/frame-node-structures/frame-node-structure.ts +0 -17
- package/src/api/dto/elements/frame-node-structures/index.ts +0 -1
- package/src/api/dto/elements/get-elements-v2.ts +0 -21
- package/src/api/dto/elements/index.ts +0 -7
- package/src/api/dto/elements/properties/index.ts +0 -2
- package/src/api/dto/elements/properties/property-definitions.ts +0 -75
- package/src/api/dto/elements/properties/property-values.ts +0 -38
- package/src/api/dto/export/exporter-property.ts +0 -95
- package/src/api/dto/export/exporter.ts +0 -87
- package/src/api/dto/export/filter.ts +0 -6
- package/src/api/dto/export/index.ts +0 -5
- package/src/api/dto/export/job.ts +0 -87
- package/src/api/dto/export/pipeline.ts +0 -43
- package/src/api/dto/figma-components/assets/download.ts +0 -30
- package/src/api/dto/figma-components/assets/index.ts +0 -1
- package/src/api/dto/figma-components/index.ts +0 -1
- package/src/api/dto/index.ts +0 -13
- package/src/api/dto/liveblocks/auth-response.ts +0 -7
- package/src/api/dto/liveblocks/index.ts +0 -1
- package/src/api/dto/themes/index.ts +0 -2
- package/src/api/dto/themes/override.ts +0 -27
- package/src/api/dto/themes/theme.ts +0 -45
- package/src/api/dto/users/authenticated-user.ts +0 -43
- package/src/api/dto/users/index.ts +0 -3
- package/src/api/dto/users/update.ts +0 -8
- package/src/api/dto/users/user.ts +0 -31
- package/src/api/dto/workspaces/git.ts +0 -32
- package/src/api/dto/workspaces/index.ts +0 -6
- package/src/api/dto/workspaces/integrations.ts +0 -34
- package/src/api/dto/workspaces/invitations.ts +0 -30
- package/src/api/dto/workspaces/membership.ts +0 -41
- package/src/api/dto/workspaces/npm-registry.ts +0 -35
- package/src/api/dto/workspaces/workspace.ts +0 -34
- package/src/api/endpoints/codegen/codegen.ts +0 -13
- package/src/api/endpoints/codegen/exporters.ts +0 -13
- package/src/api/endpoints/codegen/index.ts +0 -3
- package/src/api/endpoints/codegen/pipelines.ts +0 -37
- package/src/api/endpoints/design-system/bff.ts +0 -13
- package/src/api/endpoints/design-system/contact.ts +0 -12
- package/src/api/endpoints/design-system/design-systems.ts +0 -55
- package/src/api/endpoints/design-system/index.ts +0 -6
- package/src/api/endpoints/design-system/members.ts +0 -24
- package/src/api/endpoints/design-system/sources.ts +0 -35
- package/src/api/endpoints/design-system/versions/brands.ts +0 -45
- package/src/api/endpoints/design-system/versions/documentation.ts +0 -27
- package/src/api/endpoints/design-system/versions/ds-components.ts +0 -28
- package/src/api/endpoints/design-system/versions/elements-action.ts +0 -55
- package/src/api/endpoints/design-system/versions/elements.ts +0 -13
- package/src/api/endpoints/design-system/versions/figma-component-groups.ts +0 -13
- package/src/api/endpoints/design-system/versions/figma-components.ts +0 -13
- package/src/api/endpoints/design-system/versions/figma-frame-structures.ts +0 -13
- package/src/api/endpoints/design-system/versions/import-jobs.ts +0 -13
- package/src/api/endpoints/design-system/versions/index.ts +0 -18
- package/src/api/endpoints/design-system/versions/overrides.ts +0 -17
- package/src/api/endpoints/design-system/versions/property-definitions.ts +0 -43
- package/src/api/endpoints/design-system/versions/property-values.ts +0 -25
- package/src/api/endpoints/design-system/versions/stats.ts +0 -12
- package/src/api/endpoints/design-system/versions/themes.ts +0 -35
- package/src/api/endpoints/design-system/versions/token-collections.ts +0 -13
- package/src/api/endpoints/design-system/versions/token-groups.ts +0 -28
- package/src/api/endpoints/design-system/versions/tokens.ts +0 -27
- package/src/api/endpoints/design-system/versions/versions.ts +0 -79
- package/src/api/endpoints/index.ts +0 -5
- package/src/api/endpoints/liveblocks.ts +0 -14
- package/src/api/endpoints/users.ts +0 -26
- package/src/api/endpoints/workspaces/index.ts +0 -3
- package/src/api/endpoints/workspaces/workspace-invites.ts +0 -34
- package/src/api/endpoints/workspaces/workspace-members.ts +0 -31
- package/src/api/endpoints/workspaces/workspaces.ts +0 -47
- package/src/api/index.ts +0 -6
- package/src/api/payloads/design-systems/index.ts +0 -2
- package/src/api/payloads/design-systems/update-design-system.ts +0 -29
- package/src/api/payloads/design-systems/version.ts +0 -29
- package/src/api/payloads/documentation/block-definitions.ts +0 -12
- package/src/api/payloads/documentation/design-data-doc-diff.ts +0 -7
- package/src/api/payloads/documentation/index.ts +0 -2
- package/src/api/payloads/export/index.ts +0 -1
- package/src/api/payloads/export/pipeline.ts +0 -50
- package/src/api/payloads/index.ts +0 -6
- package/src/api/payloads/liveblocks/auth.ts +0 -7
- package/src/api/payloads/liveblocks/index.ts +0 -1
- package/src/api/payloads/users/index.ts +0 -2
- package/src/api/payloads/users/notifications/index.ts +0 -1
- package/src/api/payloads/users/notifications/notification-settings.ts +0 -17
- package/src/api/payloads/users/profile/index.ts +0 -1
- package/src/api/payloads/users/profile/update.ts +0 -4
- package/src/api/payloads/workspaces/index.ts +0 -3
- package/src/api/payloads/workspaces/transfer-ownership.ts +0 -7
- package/src/api/payloads/workspaces/workspace-configuration.ts +0 -50
- package/src/api/payloads/workspaces/workspace-integrations.ts +0 -26
- package/src/api/transport/index.ts +0 -2
- package/src/api/transport/request-executor-error.ts +0 -66
- package/src/api/transport/request-executor.ts +0 -87
- package/src/index.ts +0 -3
- package/src/utils/figma.ts +0 -53
- package/src/utils/hash.ts +0 -62
- package/src/utils/index.ts +0 -3
- package/src/utils/query.ts +0 -18
- package/src/yjs/design-system-content/documentation-hierarchy.ts +0 -35
- package/src/yjs/design-system-content/index.ts +0 -2
- package/src/yjs/design-system-content/item-configuration.ts +0 -93
- package/src/yjs/docs-editor/blocks-to-prosemirror.ts +0 -764
- package/src/yjs/docs-editor/index.ts +0 -7
- package/src/yjs/docs-editor/list-tree-builder.ts +0 -127
- package/src/yjs/docs-editor/mock.ts +0 -2104
- package/src/yjs/docs-editor/model/block.ts +0 -8
- package/src/yjs/docs-editor/model/index.ts +0 -2
- package/src/yjs/docs-editor/model/page.ts +0 -8
- package/src/yjs/docs-editor/prosemirror/index.ts +0 -3
- package/src/yjs/docs-editor/prosemirror/inner-editor-schema.ts +0 -145
- package/src/yjs/docs-editor/prosemirror/main-editor-schema.ts +0 -577
- package/src/yjs/docs-editor/prosemirror/types.ts +0 -19
- package/src/yjs/docs-editor/prosemirror-to-blocks.ts +0 -975
- package/src/yjs/docs-editor/utils.ts +0 -115
- package/src/yjs/index.ts +0 -3
- package/src/yjs/version-room/backend.ts +0 -78
- package/src/yjs/version-room/base.ts +0 -211
- package/src/yjs/version-room/frontend.ts +0 -461
- package/src/yjs/version-room/index.ts +0 -4
- 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",
|
|
@@ -4283,8 +4300,7 @@ var RestoredDocumentationGroup = z149.object({
|
|
|
4283
4300
|
parent: ElementGroup
|
|
4284
4301
|
});
|
|
4285
4302
|
var RoomTypeEnum = /* @__PURE__ */ ((RoomTypeEnum2) => {
|
|
4286
|
-
RoomTypeEnum2["
|
|
4287
|
-
RoomTypeEnum2["DocumentationPage"] = "doc-page";
|
|
4303
|
+
RoomTypeEnum2["DocumentationPage"] = "documentation-page";
|
|
4288
4304
|
RoomTypeEnum2["DesignSystemVersion"] = "design-system-version";
|
|
4289
4305
|
RoomTypeEnum2["Workspace"] = "workspace";
|
|
4290
4306
|
return RoomTypeEnum2;
|
|
@@ -4952,10 +4968,10 @@ function elementGroupsToDocumentationGroupFixedConfigurationDTOV2(groups, pages)
|
|
|
4952
4968
|
function elementGroupToDocumentationGroupStructureDTOV2(group, childrenIdsMap) {
|
|
4953
4969
|
const childrenIds = childrenIdsMap.get(group.persistentId) ?? [];
|
|
4954
4970
|
if (!group.shortPersistentId) {
|
|
4955
|
-
throw new Error(`Short persistent id is required for docs groups, group id: ${group.
|
|
4971
|
+
throw new Error(`Short persistent id is required for docs groups, group id: ${group.persistentId}`);
|
|
4956
4972
|
}
|
|
4957
4973
|
return {
|
|
4958
|
-
id:
|
|
4974
|
+
id: "to_be_removed",
|
|
4959
4975
|
designSystemVersionId: group.designSystemVersionId,
|
|
4960
4976
|
persistentId: group.persistentId,
|
|
4961
4977
|
slug: group.slug,
|
|
@@ -5037,11 +5053,11 @@ function documentationPagesFixedConfigurationToDTOV2(pages, groups, routingVersi
|
|
|
5037
5053
|
function _documentationPageToDTOV2(page, pagePathMap) {
|
|
5038
5054
|
let path = pagePathMap.get(page.persistentId);
|
|
5039
5055
|
if (!path)
|
|
5040
|
-
throw new Error(`Path for page ${page.
|
|
5056
|
+
throw new Error(`Path for page ${page.persistentId} was not calculated`);
|
|
5041
5057
|
if (path.startsWith("/"))
|
|
5042
5058
|
path = path.substring(1);
|
|
5043
5059
|
return {
|
|
5044
|
-
id:
|
|
5060
|
+
id: "to_be_removed",
|
|
5045
5061
|
designSystemVersionId: page.designSystemVersionId,
|
|
5046
5062
|
persistentId: page.persistentId,
|
|
5047
5063
|
shortPersistentId: page.shortPersistentId,
|
|
@@ -6167,7 +6183,7 @@ import { z as z218 } from "zod";
|
|
|
6167
6183
|
var DTODocumentationPageApprovalState = DocumentationPageApproval;
|
|
6168
6184
|
var DTODocumentationGroupApprovalState = z218.object({
|
|
6169
6185
|
persistentId: z218.string(),
|
|
6170
|
-
|
|
6186
|
+
groupPersistentId: z218.string(),
|
|
6171
6187
|
designSystemVersionId: z218.string(),
|
|
6172
6188
|
approvalState: DocumentationPageApprovalState
|
|
6173
6189
|
});
|
|
@@ -6468,62 +6484,53 @@ var DTOPublishDocumentationResponse = z228.object({
|
|
|
6468
6484
|
job: DTOExportJob
|
|
6469
6485
|
});
|
|
6470
6486
|
|
|
6471
|
-
// src/api/dto/documentation/room.ts
|
|
6472
|
-
import { z as z229 } from "zod";
|
|
6473
|
-
var DTODocumentationPageRoom = z229.object({
|
|
6474
|
-
id: z229.string()
|
|
6475
|
-
});
|
|
6476
|
-
var DTODocumentationPageRoomResponse = z229.object({
|
|
6477
|
-
room: DTODocumentationPageRoom
|
|
6478
|
-
});
|
|
6479
|
-
|
|
6480
6487
|
// src/api/dto/elements/components/figma-component-group.ts
|
|
6481
|
-
import
|
|
6482
|
-
var DTOFigmaComponentGroup =
|
|
6483
|
-
id:
|
|
6484
|
-
designSystemVersionId:
|
|
6485
|
-
persistentId:
|
|
6486
|
-
isRoot:
|
|
6487
|
-
brandId:
|
|
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(),
|
|
6488
6495
|
meta: DTOObjectMeta,
|
|
6489
|
-
childrenIds:
|
|
6496
|
+
childrenIds: z229.string().array()
|
|
6490
6497
|
});
|
|
6491
|
-
var DTOFigmaComponentGroupListResponse =
|
|
6498
|
+
var DTOFigmaComponentGroupListResponse = z229.object({
|
|
6492
6499
|
groups: DTOFigmaComponentGroup.array()
|
|
6493
6500
|
});
|
|
6494
6501
|
|
|
6495
6502
|
// src/api/dto/elements/components/figma-component.ts
|
|
6496
|
-
import { z as
|
|
6503
|
+
import { z as z230 } from "zod";
|
|
6497
6504
|
var DTOFigmaComponentProperty = FigmaComponentProperty;
|
|
6498
|
-
var DTOFigmaComponentPropertyMap =
|
|
6499
|
-
var DTOFigmaComponent =
|
|
6500
|
-
id:
|
|
6501
|
-
persistentId:
|
|
6502
|
-
designSystemVersionId:
|
|
6503
|
-
brandId:
|
|
6504
|
-
thumbnailUrl:
|
|
6505
|
-
svgUrl:
|
|
6506
|
-
exportProperties:
|
|
6507
|
-
isAsset:
|
|
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()
|
|
6508
6515
|
}),
|
|
6509
|
-
createdAt:
|
|
6510
|
-
updatedAt:
|
|
6516
|
+
createdAt: z230.coerce.date(),
|
|
6517
|
+
updatedAt: z230.coerce.date(),
|
|
6511
6518
|
meta: ObjectMeta,
|
|
6512
6519
|
originComponent: FigmaComponentOrigin.optional(),
|
|
6513
|
-
parentComponentPersistentId:
|
|
6514
|
-
childrenPersistentIds:
|
|
6520
|
+
parentComponentPersistentId: z230.string().optional(),
|
|
6521
|
+
childrenPersistentIds: z230.string().array().optional(),
|
|
6515
6522
|
componentPropertyDefinitions: DTOFigmaComponentPropertyMap.optional(),
|
|
6516
|
-
variantPropertyValues:
|
|
6523
|
+
variantPropertyValues: z230.record(z230.string()).optional()
|
|
6517
6524
|
});
|
|
6518
|
-
var DTOFigmaComponentListResponse =
|
|
6525
|
+
var DTOFigmaComponentListResponse = z230.object({
|
|
6519
6526
|
components: DTOFigmaComponent.array()
|
|
6520
6527
|
});
|
|
6521
6528
|
|
|
6522
6529
|
// src/api/dto/elements/documentation/group-action.ts
|
|
6523
|
-
import { z as
|
|
6530
|
+
import { z as z232 } from "zod";
|
|
6524
6531
|
|
|
6525
6532
|
// src/api/dto/elements/documentation/group-v2.ts
|
|
6526
|
-
import { z as
|
|
6533
|
+
import { z as z231 } from "zod";
|
|
6527
6534
|
var DTODocumentationGroupV2 = ElementGroup.omit({
|
|
6528
6535
|
sortOrder: true,
|
|
6529
6536
|
parentPersistentId: true,
|
|
@@ -6533,13 +6540,13 @@ var DTODocumentationGroupV2 = ElementGroup.omit({
|
|
|
6533
6540
|
data: true,
|
|
6534
6541
|
shortPersistentId: true
|
|
6535
6542
|
}).extend({
|
|
6536
|
-
title:
|
|
6537
|
-
isRoot:
|
|
6538
|
-
childrenIds:
|
|
6543
|
+
title: z231.string(),
|
|
6544
|
+
isRoot: z231.boolean(),
|
|
6545
|
+
childrenIds: z231.array(z231.string()),
|
|
6539
6546
|
groupBehavior: DocumentationGroupBehavior,
|
|
6540
|
-
shortPersistentId:
|
|
6547
|
+
shortPersistentId: z231.string(),
|
|
6541
6548
|
configuration: DTODocumentationItemConfigurationV2,
|
|
6542
|
-
type:
|
|
6549
|
+
type: z231.literal("Group"),
|
|
6543
6550
|
/** Defined when a group has changed since last publish and can be included into a partial publish */
|
|
6544
6551
|
draftState: DTODocumentationDraftState.optional(),
|
|
6545
6552
|
/** Defined if a group was published at least once and contains metadata about last publish */
|
|
@@ -6547,127 +6554,127 @@ var DTODocumentationGroupV2 = ElementGroup.omit({
|
|
|
6547
6554
|
//** An approval state for frontend to utilize. */
|
|
6548
6555
|
approvalState: DTODocumentationGroupApprovalState.optional()
|
|
6549
6556
|
});
|
|
6550
|
-
var DTOCreateDocumentationGroupInput =
|
|
6557
|
+
var DTOCreateDocumentationGroupInput = z231.object({
|
|
6551
6558
|
// Identifier
|
|
6552
|
-
persistentId:
|
|
6559
|
+
persistentId: z231.string(),
|
|
6553
6560
|
// Group properties
|
|
6554
|
-
title:
|
|
6561
|
+
title: z231.string(),
|
|
6555
6562
|
configuration: DTODocumentationItemConfigurationV2.partial().optional(),
|
|
6556
6563
|
// Group placement properties
|
|
6557
|
-
afterPersistentId:
|
|
6558
|
-
parentPersistentId:
|
|
6564
|
+
afterPersistentId: z231.string().nullish(),
|
|
6565
|
+
parentPersistentId: z231.string()
|
|
6559
6566
|
});
|
|
6560
|
-
var DTOUpdateDocumentationGroupInput =
|
|
6567
|
+
var DTOUpdateDocumentationGroupInput = z231.object({
|
|
6561
6568
|
// Identifier of the group to update
|
|
6562
|
-
id:
|
|
6569
|
+
id: z231.string(),
|
|
6563
6570
|
// Group properties
|
|
6564
|
-
title:
|
|
6571
|
+
title: z231.string().optional(),
|
|
6565
6572
|
configuration: DTODocumentationItemConfigurationV2.partial().optional()
|
|
6566
6573
|
});
|
|
6567
|
-
var DTOMoveDocumentationGroupInput =
|
|
6574
|
+
var DTOMoveDocumentationGroupInput = z231.object({
|
|
6568
6575
|
// Identifier of the group to update
|
|
6569
|
-
id:
|
|
6576
|
+
id: z231.string(),
|
|
6570
6577
|
// Group placement properties
|
|
6571
|
-
parentPersistentId:
|
|
6572
|
-
afterPersistentId:
|
|
6578
|
+
parentPersistentId: z231.string(),
|
|
6579
|
+
afterPersistentId: z231.string().nullish()
|
|
6573
6580
|
});
|
|
6574
|
-
var DTODuplicateDocumentationGroupInput =
|
|
6581
|
+
var DTODuplicateDocumentationGroupInput = z231.object({
|
|
6575
6582
|
// Identifier of the group to duplicate from
|
|
6576
|
-
id:
|
|
6583
|
+
id: z231.string(),
|
|
6577
6584
|
// New group persistent id
|
|
6578
|
-
persistentId:
|
|
6585
|
+
persistentId: z231.string(),
|
|
6579
6586
|
// Group placement properties
|
|
6580
|
-
afterPersistentId:
|
|
6581
|
-
parentPersistentId:
|
|
6587
|
+
afterPersistentId: z231.string().nullish(),
|
|
6588
|
+
parentPersistentId: z231.string()
|
|
6582
6589
|
});
|
|
6583
|
-
var DTOCreateDocumentationTabInput =
|
|
6590
|
+
var DTOCreateDocumentationTabInput = z231.object({
|
|
6584
6591
|
// New group persistent id
|
|
6585
|
-
persistentId:
|
|
6592
|
+
persistentId: z231.string(),
|
|
6586
6593
|
// If this is page, we will attempt to convert it to tab
|
|
6587
6594
|
// If this is tab group, we will add a new tab to it
|
|
6588
|
-
fromItemPersistentId:
|
|
6589
|
-
tabName:
|
|
6595
|
+
fromItemPersistentId: z231.string(),
|
|
6596
|
+
tabName: z231.string()
|
|
6590
6597
|
});
|
|
6591
|
-
var DTODeleteDocumentationTabGroupInput =
|
|
6598
|
+
var DTODeleteDocumentationTabGroupInput = z231.object({
|
|
6592
6599
|
// Deleted group id
|
|
6593
|
-
id:
|
|
6600
|
+
id: z231.string()
|
|
6594
6601
|
});
|
|
6595
|
-
var DTODeleteDocumentationGroupInput =
|
|
6602
|
+
var DTODeleteDocumentationGroupInput = z231.object({
|
|
6596
6603
|
// Identifier
|
|
6597
|
-
id:
|
|
6604
|
+
id: z231.string(),
|
|
6598
6605
|
// Deletion options
|
|
6599
|
-
deleteSubtree:
|
|
6606
|
+
deleteSubtree: z231.boolean().default(false)
|
|
6600
6607
|
});
|
|
6601
6608
|
|
|
6602
6609
|
// src/api/dto/elements/documentation/group-action.ts
|
|
6603
|
-
var SuccessPayload =
|
|
6604
|
-
success:
|
|
6610
|
+
var SuccessPayload = z232.object({
|
|
6611
|
+
success: z232.literal(true)
|
|
6605
6612
|
});
|
|
6606
|
-
var DTODocumentationGroupCreateActionOutputV2 =
|
|
6607
|
-
type:
|
|
6613
|
+
var DTODocumentationGroupCreateActionOutputV2 = z232.object({
|
|
6614
|
+
type: z232.literal("DocumentationGroupCreate"),
|
|
6608
6615
|
output: SuccessPayload
|
|
6609
6616
|
});
|
|
6610
|
-
var DTODocumentationTabCreateActionOutputV2 =
|
|
6611
|
-
type:
|
|
6617
|
+
var DTODocumentationTabCreateActionOutputV2 = z232.object({
|
|
6618
|
+
type: z232.literal("DocumentationTabCreate"),
|
|
6612
6619
|
output: SuccessPayload
|
|
6613
6620
|
});
|
|
6614
|
-
var DTODocumentationGroupUpdateActionOutputV2 =
|
|
6615
|
-
type:
|
|
6621
|
+
var DTODocumentationGroupUpdateActionOutputV2 = z232.object({
|
|
6622
|
+
type: z232.literal("DocumentationGroupUpdate"),
|
|
6616
6623
|
output: SuccessPayload
|
|
6617
6624
|
});
|
|
6618
|
-
var DTODocumentationGroupMoveActionOutputV2 =
|
|
6619
|
-
type:
|
|
6625
|
+
var DTODocumentationGroupMoveActionOutputV2 = z232.object({
|
|
6626
|
+
type: z232.literal("DocumentationGroupMove"),
|
|
6620
6627
|
output: SuccessPayload
|
|
6621
6628
|
});
|
|
6622
|
-
var DTODocumentationGroupDuplicateActionOutputV2 =
|
|
6623
|
-
type:
|
|
6629
|
+
var DTODocumentationGroupDuplicateActionOutputV2 = z232.object({
|
|
6630
|
+
type: z232.literal("DocumentationGroupDuplicate"),
|
|
6624
6631
|
output: SuccessPayload
|
|
6625
6632
|
});
|
|
6626
|
-
var DTODocumentationGroupDeleteActionOutputV2 =
|
|
6627
|
-
type:
|
|
6633
|
+
var DTODocumentationGroupDeleteActionOutputV2 = z232.object({
|
|
6634
|
+
type: z232.literal("DocumentationGroupDelete"),
|
|
6628
6635
|
output: SuccessPayload
|
|
6629
6636
|
});
|
|
6630
|
-
var DTODocumentationTabGroupDeleteActionOutputV2 =
|
|
6631
|
-
type:
|
|
6637
|
+
var DTODocumentationTabGroupDeleteActionOutputV2 = z232.object({
|
|
6638
|
+
type: z232.literal("DocumentationTabGroupDelete"),
|
|
6632
6639
|
output: SuccessPayload
|
|
6633
6640
|
});
|
|
6634
|
-
var DTODocumentationGroupCreateActionInputV2 =
|
|
6635
|
-
type:
|
|
6641
|
+
var DTODocumentationGroupCreateActionInputV2 = z232.object({
|
|
6642
|
+
type: z232.literal("DocumentationGroupCreate"),
|
|
6636
6643
|
input: DTOCreateDocumentationGroupInput
|
|
6637
6644
|
});
|
|
6638
|
-
var DTODocumentationTabCreateActionInputV2 =
|
|
6639
|
-
type:
|
|
6645
|
+
var DTODocumentationTabCreateActionInputV2 = z232.object({
|
|
6646
|
+
type: z232.literal("DocumentationTabCreate"),
|
|
6640
6647
|
input: DTOCreateDocumentationTabInput
|
|
6641
6648
|
});
|
|
6642
|
-
var DTODocumentationGroupUpdateActionInputV2 =
|
|
6643
|
-
type:
|
|
6649
|
+
var DTODocumentationGroupUpdateActionInputV2 = z232.object({
|
|
6650
|
+
type: z232.literal("DocumentationGroupUpdate"),
|
|
6644
6651
|
input: DTOUpdateDocumentationGroupInput
|
|
6645
6652
|
});
|
|
6646
|
-
var DTODocumentationGroupMoveActionInputV2 =
|
|
6647
|
-
type:
|
|
6653
|
+
var DTODocumentationGroupMoveActionInputV2 = z232.object({
|
|
6654
|
+
type: z232.literal("DocumentationGroupMove"),
|
|
6648
6655
|
input: DTOMoveDocumentationGroupInput
|
|
6649
6656
|
});
|
|
6650
|
-
var DTODocumentationGroupDuplicateActionInputV2 =
|
|
6651
|
-
type:
|
|
6657
|
+
var DTODocumentationGroupDuplicateActionInputV2 = z232.object({
|
|
6658
|
+
type: z232.literal("DocumentationGroupDuplicate"),
|
|
6652
6659
|
input: DTODuplicateDocumentationGroupInput
|
|
6653
6660
|
});
|
|
6654
|
-
var DTODocumentationGroupDeleteActionInputV2 =
|
|
6655
|
-
type:
|
|
6661
|
+
var DTODocumentationGroupDeleteActionInputV2 = z232.object({
|
|
6662
|
+
type: z232.literal("DocumentationGroupDelete"),
|
|
6656
6663
|
input: DTODeleteDocumentationGroupInput
|
|
6657
6664
|
});
|
|
6658
|
-
var DTODocumentationTabGroupDeleteActionInputV2 =
|
|
6659
|
-
type:
|
|
6665
|
+
var DTODocumentationTabGroupDeleteActionInputV2 = z232.object({
|
|
6666
|
+
type: z232.literal("DocumentationTabGroupDelete"),
|
|
6660
6667
|
input: DTODeleteDocumentationTabGroupInput
|
|
6661
6668
|
});
|
|
6662
6669
|
|
|
6663
6670
|
// src/api/dto/elements/documentation/group-v1.ts
|
|
6664
|
-
import { z as
|
|
6671
|
+
import { z as z234 } from "zod";
|
|
6665
6672
|
|
|
6666
6673
|
// src/api/dto/elements/documentation/item-configuration-v1.ts
|
|
6667
|
-
import { z as
|
|
6668
|
-
var DocumentationColorV1 =
|
|
6669
|
-
aliasTo:
|
|
6670
|
-
value:
|
|
6674
|
+
import { z as z233 } from "zod";
|
|
6675
|
+
var DocumentationColorV1 = z233.object({
|
|
6676
|
+
aliasTo: z233.string().optional(),
|
|
6677
|
+
value: z233.string().optional()
|
|
6671
6678
|
});
|
|
6672
6679
|
var DTODocumentationItemHeaderV1 = DocumentationItemHeaderV1.omit({
|
|
6673
6680
|
foregroundColor: true,
|
|
@@ -6676,10 +6683,10 @@ var DTODocumentationItemHeaderV1 = DocumentationItemHeaderV1.omit({
|
|
|
6676
6683
|
foregroundColor: DocumentationColorV1.optional(),
|
|
6677
6684
|
backgroundColor: DocumentationColorV1.optional()
|
|
6678
6685
|
});
|
|
6679
|
-
var DTODocumentationItemConfigurationV1 =
|
|
6680
|
-
showSidebar:
|
|
6681
|
-
isPrivate:
|
|
6682
|
-
isHidden:
|
|
6686
|
+
var DTODocumentationItemConfigurationV1 = z233.object({
|
|
6687
|
+
showSidebar: z233.boolean(),
|
|
6688
|
+
isPrivate: z233.boolean(),
|
|
6689
|
+
isHidden: z233.boolean(),
|
|
6683
6690
|
header: DTODocumentationItemHeaderV1
|
|
6684
6691
|
});
|
|
6685
6692
|
|
|
@@ -6693,27 +6700,27 @@ var DTODocumentationGroupStructureV1 = ElementGroup.omit({
|
|
|
6693
6700
|
data: true,
|
|
6694
6701
|
shortPersistentId: true
|
|
6695
6702
|
}).extend({
|
|
6696
|
-
title:
|
|
6697
|
-
isRoot:
|
|
6698
|
-
childrenIds:
|
|
6703
|
+
title: z234.string(),
|
|
6704
|
+
isRoot: z234.boolean(),
|
|
6705
|
+
childrenIds: z234.array(z234.string()),
|
|
6699
6706
|
groupBehavior: DocumentationGroupBehavior,
|
|
6700
|
-
shortPersistentId:
|
|
6701
|
-
type:
|
|
6707
|
+
shortPersistentId: z234.string(),
|
|
6708
|
+
type: z234.literal("Group")
|
|
6702
6709
|
});
|
|
6703
6710
|
var DTODocumentationGroupV1 = DTODocumentationGroupStructureV1.extend({
|
|
6704
6711
|
configuration: DTODocumentationItemConfigurationV1
|
|
6705
6712
|
});
|
|
6706
6713
|
|
|
6707
6714
|
// src/api/dto/elements/documentation/hierarchy.ts
|
|
6708
|
-
import { z as
|
|
6709
|
-
var DTODocumentationHierarchyV2 =
|
|
6710
|
-
pages:
|
|
6715
|
+
import { z as z235 } from "zod";
|
|
6716
|
+
var DTODocumentationHierarchyV2 = z235.object({
|
|
6717
|
+
pages: z235.array(
|
|
6711
6718
|
DTODocumentationPageV2.extend({
|
|
6712
6719
|
/** Defined when a page has changed since last publish and can be included into a partial publish */
|
|
6713
6720
|
draftState: DTODocumentationDraftState.optional()
|
|
6714
6721
|
})
|
|
6715
6722
|
),
|
|
6716
|
-
groups:
|
|
6723
|
+
groups: z235.array(
|
|
6717
6724
|
DTODocumentationGroupV2.extend({
|
|
6718
6725
|
/** Defined when a page has changed since last publish and can be included into a partial publish */
|
|
6719
6726
|
draftState: DTODocumentationDraftState.optional()
|
|
@@ -6722,84 +6729,84 @@ var DTODocumentationHierarchyV2 = z236.object({
|
|
|
6722
6729
|
});
|
|
6723
6730
|
|
|
6724
6731
|
// src/api/dto/elements/documentation/page-actions-v2.ts
|
|
6725
|
-
import { z as
|
|
6726
|
-
var SuccessPayload2 =
|
|
6727
|
-
success:
|
|
6732
|
+
import { z as z236 } from "zod";
|
|
6733
|
+
var SuccessPayload2 = z236.object({
|
|
6734
|
+
success: z236.literal(true)
|
|
6728
6735
|
});
|
|
6729
|
-
var DTODocumentationPageCreateActionOutputV2 =
|
|
6730
|
-
type:
|
|
6736
|
+
var DTODocumentationPageCreateActionOutputV2 = z236.object({
|
|
6737
|
+
type: z236.literal("DocumentationPageCreate"),
|
|
6731
6738
|
output: SuccessPayload2
|
|
6732
6739
|
});
|
|
6733
|
-
var DTODocumentationPageUpdateActionOutputV2 =
|
|
6734
|
-
type:
|
|
6740
|
+
var DTODocumentationPageUpdateActionOutputV2 = z236.object({
|
|
6741
|
+
type: z236.literal("DocumentationPageUpdate"),
|
|
6735
6742
|
output: SuccessPayload2
|
|
6736
6743
|
});
|
|
6737
|
-
var DTODocumentationPageMoveActionOutputV2 =
|
|
6738
|
-
type:
|
|
6744
|
+
var DTODocumentationPageMoveActionOutputV2 = z236.object({
|
|
6745
|
+
type: z236.literal("DocumentationPageMove"),
|
|
6739
6746
|
output: SuccessPayload2
|
|
6740
6747
|
});
|
|
6741
|
-
var DTODocumentationPageDuplicateActionOutputV2 =
|
|
6742
|
-
type:
|
|
6748
|
+
var DTODocumentationPageDuplicateActionOutputV2 = z236.object({
|
|
6749
|
+
type: z236.literal("DocumentationPageDuplicate"),
|
|
6743
6750
|
output: SuccessPayload2
|
|
6744
6751
|
});
|
|
6745
|
-
var DTODocumentationPageDeleteActionOutputV2 =
|
|
6746
|
-
type:
|
|
6752
|
+
var DTODocumentationPageDeleteActionOutputV2 = z236.object({
|
|
6753
|
+
type: z236.literal("DocumentationPageDelete"),
|
|
6747
6754
|
output: SuccessPayload2
|
|
6748
6755
|
});
|
|
6749
|
-
var DTODocumentationPageRestoreActionOutput =
|
|
6750
|
-
type:
|
|
6756
|
+
var DTODocumentationPageRestoreActionOutput = z236.object({
|
|
6757
|
+
type: z236.literal("DocumentationPageRestore"),
|
|
6751
6758
|
output: SuccessPayload2
|
|
6752
6759
|
});
|
|
6753
|
-
var DTODocumentationGroupRestoreActionOutput =
|
|
6754
|
-
type:
|
|
6760
|
+
var DTODocumentationGroupRestoreActionOutput = z236.object({
|
|
6761
|
+
type: z236.literal("DocumentationGroupRestore"),
|
|
6755
6762
|
output: SuccessPayload2
|
|
6756
6763
|
});
|
|
6757
|
-
var DTODocumentationPageApprovalStateChangeActionOutput =
|
|
6758
|
-
type:
|
|
6764
|
+
var DTODocumentationPageApprovalStateChangeActionOutput = z236.object({
|
|
6765
|
+
type: z236.literal("DocumentationPageApprovalStateChange"),
|
|
6759
6766
|
output: SuccessPayload2
|
|
6760
6767
|
});
|
|
6761
|
-
var DTODocumentationPageCreateActionInputV2 =
|
|
6762
|
-
type:
|
|
6768
|
+
var DTODocumentationPageCreateActionInputV2 = z236.object({
|
|
6769
|
+
type: z236.literal("DocumentationPageCreate"),
|
|
6763
6770
|
input: DTOCreateDocumentationPageInputV2
|
|
6764
6771
|
});
|
|
6765
|
-
var DTODocumentationPageUpdateActionInputV2 =
|
|
6766
|
-
type:
|
|
6772
|
+
var DTODocumentationPageUpdateActionInputV2 = z236.object({
|
|
6773
|
+
type: z236.literal("DocumentationPageUpdate"),
|
|
6767
6774
|
input: DTOUpdateDocumentationPageInputV2
|
|
6768
6775
|
});
|
|
6769
|
-
var DTODocumentationPageMoveActionInputV2 =
|
|
6770
|
-
type:
|
|
6776
|
+
var DTODocumentationPageMoveActionInputV2 = z236.object({
|
|
6777
|
+
type: z236.literal("DocumentationPageMove"),
|
|
6771
6778
|
input: DTOMoveDocumentationPageInputV2
|
|
6772
6779
|
});
|
|
6773
|
-
var DTODocumentationPageDuplicateActionInputV2 =
|
|
6774
|
-
type:
|
|
6780
|
+
var DTODocumentationPageDuplicateActionInputV2 = z236.object({
|
|
6781
|
+
type: z236.literal("DocumentationPageDuplicate"),
|
|
6775
6782
|
input: DTODuplicateDocumentationPageInputV2
|
|
6776
6783
|
});
|
|
6777
|
-
var DTODocumentationPageDeleteActionInputV2 =
|
|
6778
|
-
type:
|
|
6784
|
+
var DTODocumentationPageDeleteActionInputV2 = z236.object({
|
|
6785
|
+
type: z236.literal("DocumentationPageDelete"),
|
|
6779
6786
|
input: DTODeleteDocumentationPageInputV2
|
|
6780
6787
|
});
|
|
6781
|
-
var DTODocumentationPageRestoreActionInput =
|
|
6782
|
-
type:
|
|
6788
|
+
var DTODocumentationPageRestoreActionInput = z236.object({
|
|
6789
|
+
type: z236.literal("DocumentationPageRestore"),
|
|
6783
6790
|
input: DTORestoreDocumentationPageInput
|
|
6784
6791
|
});
|
|
6785
|
-
var DTODocumentationGroupRestoreActionInput =
|
|
6786
|
-
type:
|
|
6792
|
+
var DTODocumentationGroupRestoreActionInput = z236.object({
|
|
6793
|
+
type: z236.literal("DocumentationGroupRestore"),
|
|
6787
6794
|
input: DTORestoreDocumentationGroupInput
|
|
6788
6795
|
});
|
|
6789
|
-
var DTODocumentationPageApprovalStateChangeActionInput =
|
|
6790
|
-
type:
|
|
6796
|
+
var DTODocumentationPageApprovalStateChangeActionInput = z236.object({
|
|
6797
|
+
type: z236.literal("DocumentationPageApprovalStateChange"),
|
|
6791
6798
|
input: DTODocumentationPageApprovalStateChangeInput
|
|
6792
6799
|
});
|
|
6793
6800
|
|
|
6794
6801
|
// src/api/dto/elements/documentation/page-content.ts
|
|
6795
|
-
import { z as
|
|
6802
|
+
import { z as z237 } from "zod";
|
|
6796
6803
|
var DTODocumentationPageContent = DocumentationPageContent;
|
|
6797
|
-
var DTODocumentationPageContentGetResponse =
|
|
6804
|
+
var DTODocumentationPageContentGetResponse = z237.object({
|
|
6798
6805
|
pageContent: DTODocumentationPageContent
|
|
6799
6806
|
});
|
|
6800
6807
|
|
|
6801
6808
|
// src/api/dto/elements/documentation/page-v1.ts
|
|
6802
|
-
import { z as
|
|
6809
|
+
import { z as z238 } from "zod";
|
|
6803
6810
|
var DocumentationPageV1DTO = DocumentationPageV1.omit({
|
|
6804
6811
|
data: true,
|
|
6805
6812
|
meta: true,
|
|
@@ -6807,63 +6814,63 @@ var DocumentationPageV1DTO = DocumentationPageV1.omit({
|
|
|
6807
6814
|
sortOrder: true
|
|
6808
6815
|
}).extend({
|
|
6809
6816
|
configuration: DTODocumentationItemConfigurationV1,
|
|
6810
|
-
blocks:
|
|
6811
|
-
title:
|
|
6812
|
-
path:
|
|
6817
|
+
blocks: z238.array(PageBlockV1),
|
|
6818
|
+
title: z238.string(),
|
|
6819
|
+
path: z238.string()
|
|
6813
6820
|
});
|
|
6814
6821
|
|
|
6815
6822
|
// src/api/dto/elements/documentation/structure.ts
|
|
6816
|
-
import { z as
|
|
6817
|
-
var DTODocumentationStructureItemType =
|
|
6818
|
-
var DTODocumentationStructureItemBase =
|
|
6823
|
+
import { z as z239 } from "zod";
|
|
6824
|
+
var DTODocumentationStructureItemType = z239.enum(["Group", "Page"]);
|
|
6825
|
+
var DTODocumentationStructureItemBase = z239.object({
|
|
6819
6826
|
type: DTODocumentationStructureItemType,
|
|
6820
|
-
id:
|
|
6821
|
-
designSystemVersionId:
|
|
6822
|
-
shortPersistentId:
|
|
6823
|
-
persistentId:
|
|
6824
|
-
title:
|
|
6825
|
-
createdAt:
|
|
6826
|
-
updatedAt:
|
|
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()
|
|
6827
6834
|
});
|
|
6828
6835
|
var DTODocumentationStructureGroupItem = DTODocumentationStructureItemBase.extend({
|
|
6829
|
-
type:
|
|
6830
|
-
groupBehavior:
|
|
6831
|
-
childrenIds:
|
|
6832
|
-
isRoot:
|
|
6836
|
+
type: z239.literal(DTODocumentationStructureItemType.enum.Group),
|
|
6837
|
+
groupBehavior: z239.string(),
|
|
6838
|
+
childrenIds: z239.string().array(),
|
|
6839
|
+
isRoot: z239.boolean()
|
|
6833
6840
|
});
|
|
6834
6841
|
var DTODocumentationStructurePageItem = DTODocumentationStructureItemBase.extend({
|
|
6835
|
-
type:
|
|
6836
|
-
path:
|
|
6842
|
+
type: z239.literal(DTODocumentationStructureItemType.enum.Page),
|
|
6843
|
+
path: z239.string()
|
|
6837
6844
|
});
|
|
6838
|
-
var DTODocumentationStructureItem =
|
|
6845
|
+
var DTODocumentationStructureItem = z239.discriminatedUnion("type", [
|
|
6839
6846
|
DTODocumentationStructureGroupItem,
|
|
6840
6847
|
DTODocumentationStructurePageItem
|
|
6841
6848
|
]);
|
|
6842
|
-
var DTODocumentationStructure =
|
|
6843
|
-
items:
|
|
6849
|
+
var DTODocumentationStructure = z239.object({
|
|
6850
|
+
items: z239.array(DTODocumentationStructureItem)
|
|
6844
6851
|
});
|
|
6845
6852
|
|
|
6846
6853
|
// src/api/dto/elements/figma-nodes/figma-node.ts
|
|
6847
|
-
import { z as
|
|
6854
|
+
import { z as z240 } from "zod";
|
|
6848
6855
|
var DTOFigmaNodeRenderFormat = FigmaNodeRenderFormat;
|
|
6849
|
-
var DTOFigmaNodeOrigin =
|
|
6850
|
-
sourceId:
|
|
6851
|
-
fileId:
|
|
6852
|
-
parentName:
|
|
6856
|
+
var DTOFigmaNodeOrigin = z240.object({
|
|
6857
|
+
sourceId: z240.string(),
|
|
6858
|
+
fileId: z240.string().optional(),
|
|
6859
|
+
parentName: z240.string().optional()
|
|
6853
6860
|
});
|
|
6854
|
-
var DTOFigmaNodeData =
|
|
6861
|
+
var DTOFigmaNodeData = z240.object({
|
|
6855
6862
|
// Id of the node in the Figma file
|
|
6856
|
-
figmaNodeId:
|
|
6863
|
+
figmaNodeId: z240.string(),
|
|
6857
6864
|
// Validity
|
|
6858
|
-
isValid:
|
|
6865
|
+
isValid: z240.boolean(),
|
|
6859
6866
|
// Asset data
|
|
6860
|
-
assetId:
|
|
6861
|
-
assetUrl:
|
|
6867
|
+
assetId: z240.string(),
|
|
6868
|
+
assetUrl: z240.string(),
|
|
6862
6869
|
assetFormat: DTOFigmaNodeRenderFormat,
|
|
6863
6870
|
// Asset metadata
|
|
6864
|
-
assetScale:
|
|
6865
|
-
assetWidth:
|
|
6866
|
-
assetHeight:
|
|
6871
|
+
assetScale: z240.number(),
|
|
6872
|
+
assetWidth: z240.number().optional(),
|
|
6873
|
+
assetHeight: z240.number().optional()
|
|
6867
6874
|
});
|
|
6868
6875
|
var DTOFigmaNode = FigmaNodeReference.omit({
|
|
6869
6876
|
data: true,
|
|
@@ -6872,127 +6879,127 @@ var DTOFigmaNode = FigmaNodeReference.omit({
|
|
|
6872
6879
|
data: DTOFigmaNodeData,
|
|
6873
6880
|
origin: DTOFigmaNodeOrigin
|
|
6874
6881
|
});
|
|
6875
|
-
var DTOFigmaNodeRenderInputBase =
|
|
6882
|
+
var DTOFigmaNodeRenderInputBase = z240.object({
|
|
6876
6883
|
/**
|
|
6877
6884
|
* Format in which the node must be rendered, png by default.
|
|
6878
6885
|
*/
|
|
6879
6886
|
format: FigmaNodeRenderFormat.default("Png")
|
|
6880
6887
|
});
|
|
6881
6888
|
var DTOFigmaNodeRenderIdInput = DTOFigmaNodeRenderInputBase.extend({
|
|
6882
|
-
inputType:
|
|
6889
|
+
inputType: z240.literal("NodeId").optional().transform((v) => v ?? "NodeId"),
|
|
6883
6890
|
/**
|
|
6884
6891
|
* Id of a design system's data source representing a linked Figma file
|
|
6885
6892
|
*/
|
|
6886
|
-
sourceId:
|
|
6893
|
+
sourceId: z240.string(),
|
|
6887
6894
|
/**
|
|
6888
6895
|
* Id of a node within the Figma file
|
|
6889
6896
|
*/
|
|
6890
|
-
figmaFileNodeId:
|
|
6897
|
+
figmaFileNodeId: z240.string()
|
|
6891
6898
|
});
|
|
6892
6899
|
var DTOFigmaNodeRenderUrlInput = DTOFigmaNodeRenderInputBase.extend({
|
|
6893
|
-
inputType:
|
|
6900
|
+
inputType: z240.literal("URL"),
|
|
6894
6901
|
/**
|
|
6895
6902
|
* Id of a design system's data source representing a linked Figma file
|
|
6896
6903
|
*/
|
|
6897
|
-
figmaNodeUrl:
|
|
6904
|
+
figmaNodeUrl: z240.string()
|
|
6898
6905
|
});
|
|
6899
|
-
var DTOFigmaNodeRenderInput =
|
|
6906
|
+
var DTOFigmaNodeRenderInput = z240.discriminatedUnion("inputType", [
|
|
6900
6907
|
DTOFigmaNodeRenderIdInput,
|
|
6901
6908
|
DTOFigmaNodeRenderUrlInput
|
|
6902
6909
|
]);
|
|
6903
6910
|
|
|
6904
6911
|
// src/api/dto/elements/figma-nodes/node-actions-v2.ts
|
|
6905
|
-
import { z as
|
|
6906
|
-
var DTOFigmaNodeRenderActionOutput =
|
|
6907
|
-
type:
|
|
6908
|
-
figmaNodes:
|
|
6912
|
+
import { z as z241 } from "zod";
|
|
6913
|
+
var DTOFigmaNodeRenderActionOutput = z241.object({
|
|
6914
|
+
type: z241.literal("FigmaNodeRender"),
|
|
6915
|
+
figmaNodes: z241.array(DTOFigmaNode)
|
|
6909
6916
|
});
|
|
6910
|
-
var DTOFigmaNodeRenderActionInput =
|
|
6911
|
-
type:
|
|
6917
|
+
var DTOFigmaNodeRenderActionInput = z241.object({
|
|
6918
|
+
type: z241.literal("FigmaNodeRender"),
|
|
6912
6919
|
input: DTOFigmaNodeRenderInput.array()
|
|
6913
6920
|
});
|
|
6914
6921
|
|
|
6915
6922
|
// src/api/dto/elements/frame-node-structures/frame-node-structure.ts
|
|
6916
|
-
import { z as
|
|
6917
|
-
var DTOFrameNodeStructure =
|
|
6918
|
-
id:
|
|
6919
|
-
persistentId:
|
|
6920
|
-
designSystemVersionId:
|
|
6923
|
+
import { z as z242 } from "zod";
|
|
6924
|
+
var DTOFrameNodeStructure = z242.object({
|
|
6925
|
+
id: z242.string(),
|
|
6926
|
+
persistentId: z242.string(),
|
|
6927
|
+
designSystemVersionId: z242.string(),
|
|
6921
6928
|
origin: FigmaFileStructureOrigin,
|
|
6922
6929
|
assetsInFile: FigmaFileStructureStatistics
|
|
6923
6930
|
});
|
|
6924
|
-
var DTOFrameNodeStructureListResponse =
|
|
6931
|
+
var DTOFrameNodeStructureListResponse = z242.object({
|
|
6925
6932
|
structures: DTOFrameNodeStructure.array()
|
|
6926
6933
|
});
|
|
6927
6934
|
|
|
6928
6935
|
// src/api/dto/elements/properties/property-definitions.ts
|
|
6929
|
-
import { z as
|
|
6936
|
+
import { z as z243 } from "zod";
|
|
6930
6937
|
var CODE_NAME_REGEX2 = /^[a-zA-Z_$][a-zA-Z_$0-9]{1,99}$/;
|
|
6931
|
-
var DTOElementPropertyDefinitionOption =
|
|
6932
|
-
id:
|
|
6933
|
-
name:
|
|
6938
|
+
var DTOElementPropertyDefinitionOption = z243.object({
|
|
6939
|
+
id: z243.string(),
|
|
6940
|
+
name: z243.string(),
|
|
6934
6941
|
backgroundColor: DTOColorTokenInlineData.optional()
|
|
6935
6942
|
});
|
|
6936
|
-
var DTOElementPropertyDefinition =
|
|
6937
|
-
id:
|
|
6938
|
-
designSystemVersionId:
|
|
6943
|
+
var DTOElementPropertyDefinition = z243.object({
|
|
6944
|
+
id: z243.string(),
|
|
6945
|
+
designSystemVersionId: z243.string(),
|
|
6939
6946
|
meta: DTOObjectMeta,
|
|
6940
|
-
persistentId:
|
|
6947
|
+
persistentId: z243.string(),
|
|
6941
6948
|
type: ElementPropertyTypeSchema,
|
|
6942
6949
|
targetElementType: ElementPropertyTargetType,
|
|
6943
|
-
codeName:
|
|
6944
|
-
options: nullishToOptional(
|
|
6950
|
+
codeName: z243.string().regex(CODE_NAME_REGEX2),
|
|
6951
|
+
options: nullishToOptional(z243.array(DTOElementPropertyDefinitionOption)),
|
|
6945
6952
|
linkElementType: nullishToOptional(ElementPropertyLinkType),
|
|
6946
|
-
isImmutable:
|
|
6953
|
+
isImmutable: z243.boolean(),
|
|
6947
6954
|
immutablePropertyType: ElementPropertyImmutableType.optional()
|
|
6948
6955
|
});
|
|
6949
|
-
var DTOElementPropertyDefinitionListResponse =
|
|
6950
|
-
definitions:
|
|
6956
|
+
var DTOElementPropertyDefinitionListResponse = z243.object({
|
|
6957
|
+
definitions: z243.array(DTOElementPropertyDefinition)
|
|
6951
6958
|
});
|
|
6952
|
-
var DTOElementPropertyDefinitionResponse =
|
|
6959
|
+
var DTOElementPropertyDefinitionResponse = z243.object({
|
|
6953
6960
|
definition: DTOElementPropertyDefinition
|
|
6954
6961
|
});
|
|
6955
|
-
var DTOElementPropertyDefinitionCreatePayload =
|
|
6962
|
+
var DTOElementPropertyDefinitionCreatePayload = z243.object({
|
|
6956
6963
|
meta: DTOObjectMeta,
|
|
6957
|
-
persistentId:
|
|
6964
|
+
persistentId: z243.string(),
|
|
6958
6965
|
type: ElementPropertyTypeSchema,
|
|
6959
6966
|
targetElementType: ElementPropertyTargetType,
|
|
6960
|
-
codeName:
|
|
6961
|
-
options: nullishToOptional(
|
|
6967
|
+
codeName: z243.string().regex(CODE_NAME_REGEX2),
|
|
6968
|
+
options: nullishToOptional(z243.array(DTOElementPropertyDefinitionOption)),
|
|
6962
6969
|
linkElementType: nullishToOptional(ElementPropertyLinkType),
|
|
6963
|
-
columnWidth:
|
|
6970
|
+
columnWidth: z243.number().max(1024).optional()
|
|
6964
6971
|
});
|
|
6965
|
-
var DTOElementPropertyDefinitionUpdatePayload =
|
|
6972
|
+
var DTOElementPropertyDefinitionUpdatePayload = z243.object({
|
|
6966
6973
|
meta: DTOObjectMeta.optional(),
|
|
6967
|
-
codeName:
|
|
6968
|
-
options:
|
|
6974
|
+
codeName: z243.string().regex(CODE_NAME_REGEX2).optional(),
|
|
6975
|
+
options: z243.array(DTOElementPropertyDefinitionOption).optional()
|
|
6969
6976
|
});
|
|
6970
6977
|
|
|
6971
6978
|
// src/api/dto/elements/properties/property-values.ts
|
|
6972
|
-
import { z as
|
|
6973
|
-
var DTOElementPropertyValue =
|
|
6974
|
-
id:
|
|
6975
|
-
designSystemVersionId:
|
|
6976
|
-
definitionId:
|
|
6977
|
-
targetElementId:
|
|
6978
|
-
value:
|
|
6979
|
-
valuePreview:
|
|
6980
|
-
});
|
|
6981
|
-
var DTOElementPropertyValueListResponse =
|
|
6982
|
-
values:
|
|
6983
|
-
});
|
|
6984
|
-
var DTOElementPropertyValueResponse =
|
|
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({
|
|
6985
6992
|
value: DTOElementPropertyValue
|
|
6986
6993
|
});
|
|
6987
|
-
var DTOElementPropertyValueUpsertPaylod =
|
|
6988
|
-
definitionId:
|
|
6989
|
-
targetElementId:
|
|
6990
|
-
value:
|
|
6994
|
+
var DTOElementPropertyValueUpsertPaylod = z244.object({
|
|
6995
|
+
definitionId: z244.string(),
|
|
6996
|
+
targetElementId: z244.string(),
|
|
6997
|
+
value: z244.string().or(z244.number()).or(z244.boolean())
|
|
6991
6998
|
});
|
|
6992
6999
|
|
|
6993
7000
|
// src/api/dto/elements/elements-action-v2.ts
|
|
6994
|
-
import { z as
|
|
6995
|
-
var DTOElementActionOutput =
|
|
7001
|
+
import { z as z245 } from "zod";
|
|
7002
|
+
var DTOElementActionOutput = z245.discriminatedUnion("type", [
|
|
6996
7003
|
// Documentation pages
|
|
6997
7004
|
DTODocumentationPageCreateActionOutputV2,
|
|
6998
7005
|
DTODocumentationPageUpdateActionOutputV2,
|
|
@@ -7015,7 +7022,7 @@ var DTOElementActionOutput = z246.discriminatedUnion("type", [
|
|
|
7015
7022
|
// Approvals
|
|
7016
7023
|
DTODocumentationPageApprovalStateChangeActionOutput
|
|
7017
7024
|
]);
|
|
7018
|
-
var DTOElementActionInput =
|
|
7025
|
+
var DTOElementActionInput = z245.discriminatedUnion("type", [
|
|
7019
7026
|
// Documentation pages
|
|
7020
7027
|
DTODocumentationPageCreateActionInputV2,
|
|
7021
7028
|
DTODocumentationPageUpdateActionInputV2,
|
|
@@ -7040,80 +7047,80 @@ var DTOElementActionInput = z246.discriminatedUnion("type", [
|
|
|
7040
7047
|
]);
|
|
7041
7048
|
|
|
7042
7049
|
// src/api/dto/elements/get-elements-v2.ts
|
|
7043
|
-
import { z as
|
|
7044
|
-
var DTOElementsGetTypeFilter =
|
|
7045
|
-
var DTOElementsGetQuerySchema =
|
|
7046
|
-
types:
|
|
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)))
|
|
7047
7054
|
});
|
|
7048
|
-
var DTOElementsGetOutput =
|
|
7049
|
-
figmaNodes:
|
|
7055
|
+
var DTOElementsGetOutput = z246.object({
|
|
7056
|
+
figmaNodes: z246.array(DTOFigmaNode).optional()
|
|
7050
7057
|
});
|
|
7051
7058
|
|
|
7052
7059
|
// src/api/dto/figma-components/assets/download.ts
|
|
7053
|
-
import { z as
|
|
7054
|
-
var DTOAssetRenderConfiguration =
|
|
7055
|
-
prefix:
|
|
7056
|
-
suffix:
|
|
7057
|
-
scale:
|
|
7058
|
-
format:
|
|
7059
|
-
});
|
|
7060
|
-
var DTORenderedAssetFile =
|
|
7061
|
-
assetId:
|
|
7062
|
-
fileName:
|
|
7063
|
-
sourceUrl:
|
|
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(),
|
|
7064
7071
|
settings: DTOAssetRenderConfiguration,
|
|
7065
|
-
originalName:
|
|
7072
|
+
originalName: z247.string()
|
|
7066
7073
|
});
|
|
7067
|
-
var DTODownloadAssetsRequest =
|
|
7068
|
-
persistentIds:
|
|
7074
|
+
var DTODownloadAssetsRequest = z247.object({
|
|
7075
|
+
persistentIds: z247.array(z247.string().uuid()).optional(),
|
|
7069
7076
|
settings: DTOAssetRenderConfiguration.array()
|
|
7070
7077
|
});
|
|
7071
|
-
var DTODownloadAssetsResponse =
|
|
7078
|
+
var DTODownloadAssetsResponse = z247.object({
|
|
7072
7079
|
items: DTORenderedAssetFile.array()
|
|
7073
7080
|
});
|
|
7074
7081
|
|
|
7075
7082
|
// src/api/dto/liveblocks/auth-response.ts
|
|
7076
|
-
import { z as
|
|
7077
|
-
var DTOLiveblocksAuthResponse =
|
|
7078
|
-
token:
|
|
7083
|
+
import { z as z248 } from "zod";
|
|
7084
|
+
var DTOLiveblocksAuthResponse = z248.object({
|
|
7085
|
+
token: z248.string()
|
|
7079
7086
|
});
|
|
7080
7087
|
|
|
7081
7088
|
// src/api/dto/themes/override.ts
|
|
7082
|
-
import { z as
|
|
7089
|
+
import { z as z249 } from "zod";
|
|
7083
7090
|
var DTOThemeOverride = DesignTokenTypedData.and(
|
|
7084
|
-
|
|
7085
|
-
tokenPersistentId:
|
|
7091
|
+
z249.object({
|
|
7092
|
+
tokenPersistentId: z249.string(),
|
|
7086
7093
|
origin: ThemeOverrideOrigin.optional()
|
|
7087
7094
|
})
|
|
7088
7095
|
);
|
|
7089
7096
|
var DTOThemeOverrideCreatePayload = DesignTokenTypedData.and(
|
|
7090
|
-
|
|
7091
|
-
tokenPersistentId:
|
|
7097
|
+
z249.object({
|
|
7098
|
+
tokenPersistentId: z249.string()
|
|
7092
7099
|
})
|
|
7093
7100
|
);
|
|
7094
7101
|
|
|
7095
7102
|
// src/api/dto/themes/theme.ts
|
|
7096
|
-
import { z as
|
|
7097
|
-
var DTOTheme =
|
|
7098
|
-
id:
|
|
7099
|
-
persistentId:
|
|
7100
|
-
designSystemVersionId:
|
|
7101
|
-
brandId:
|
|
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(),
|
|
7102
7109
|
meta: ObjectMeta,
|
|
7103
|
-
codeName:
|
|
7110
|
+
codeName: z250.string(),
|
|
7104
7111
|
overrides: DTOThemeOverride.array()
|
|
7105
7112
|
});
|
|
7106
|
-
var DTOThemeResponse =
|
|
7113
|
+
var DTOThemeResponse = z250.object({
|
|
7107
7114
|
theme: DTOTheme
|
|
7108
7115
|
});
|
|
7109
|
-
var DTOThemeListResponse =
|
|
7116
|
+
var DTOThemeListResponse = z250.object({
|
|
7110
7117
|
themes: DTOTheme.array()
|
|
7111
7118
|
});
|
|
7112
|
-
var DTOThemeCreatePayload =
|
|
7119
|
+
var DTOThemeCreatePayload = z250.object({
|
|
7113
7120
|
meta: ObjectMeta,
|
|
7114
|
-
persistentId:
|
|
7115
|
-
brandId:
|
|
7116
|
-
codeName:
|
|
7121
|
+
persistentId: z250.string(),
|
|
7122
|
+
brandId: z250.string(),
|
|
7123
|
+
codeName: z250.string(),
|
|
7117
7124
|
overrides: DTOThemeOverride.array()
|
|
7118
7125
|
});
|
|
7119
7126
|
|
|
@@ -7280,7 +7287,7 @@ var CodegenEndpoint = class {
|
|
|
7280
7287
|
};
|
|
7281
7288
|
|
|
7282
7289
|
// src/api/endpoints/design-system/versions/brands.ts
|
|
7283
|
-
import { z as
|
|
7290
|
+
import { z as z251 } from "zod";
|
|
7284
7291
|
var BrandsEndpoint = class {
|
|
7285
7292
|
constructor(requestExecutor) {
|
|
7286
7293
|
this.requestExecutor = requestExecutor;
|
|
@@ -7314,7 +7321,7 @@ var BrandsEndpoint = class {
|
|
|
7314
7321
|
});
|
|
7315
7322
|
}
|
|
7316
7323
|
delete(dsId, vId, brandId) {
|
|
7317
|
-
return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/brands/${brandId}`,
|
|
7324
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/brands/${brandId}`, z251.any(), {
|
|
7318
7325
|
method: "DELETE"
|
|
7319
7326
|
});
|
|
7320
7327
|
}
|
|
@@ -7325,8 +7332,8 @@ var DocumentationEndpoint = class {
|
|
|
7325
7332
|
constructor(requestExecutor) {
|
|
7326
7333
|
this.requestExecutor = requestExecutor;
|
|
7327
7334
|
}
|
|
7328
|
-
|
|
7329
|
-
return
|
|
7335
|
+
getStructure(designSystemId, versionId) {
|
|
7336
|
+
return this.requestExecutor.json(
|
|
7330
7337
|
`/design-systems/${designSystemId}/versions/${versionId}/documentation/structure`,
|
|
7331
7338
|
DTODocumentationStructure
|
|
7332
7339
|
);
|
|
@@ -7334,13 +7341,10 @@ var DocumentationEndpoint = class {
|
|
|
7334
7341
|
async getDocStructure(dsId, vId) {
|
|
7335
7342
|
return await this.requestExecutor.json(
|
|
7336
7343
|
`/design-systems/${dsId}/versions/${vId}/documentation/structure`,
|
|
7337
|
-
DTODocumentationStructure
|
|
7338
|
-
|
|
7339
|
-
|
|
7340
|
-
|
|
7341
|
-
return await this.requestExecutor.json(
|
|
7342
|
-
`/design-systems/${dsId}/versions/${vId}/documentation/pages/${pageId}/room`,
|
|
7343
|
-
DTODocumentationPageRoomResponse
|
|
7344
|
+
DTODocumentationStructure,
|
|
7345
|
+
{
|
|
7346
|
+
method: "GET"
|
|
7347
|
+
}
|
|
7344
7348
|
);
|
|
7345
7349
|
}
|
|
7346
7350
|
};
|
|
@@ -7471,7 +7475,7 @@ var ImportJobsEndpoint = class {
|
|
|
7471
7475
|
};
|
|
7472
7476
|
|
|
7473
7477
|
// src/api/endpoints/design-system/versions/overrides.ts
|
|
7474
|
-
import { z as
|
|
7478
|
+
import { z as z252 } from "zod";
|
|
7475
7479
|
var OverridesEndpoint = class {
|
|
7476
7480
|
constructor(requestExecutor) {
|
|
7477
7481
|
this.requestExecutor = requestExecutor;
|
|
@@ -7479,7 +7483,7 @@ var OverridesEndpoint = class {
|
|
|
7479
7483
|
create(dsId, versionId, themeId, body) {
|
|
7480
7484
|
return this.requestExecutor.json(
|
|
7481
7485
|
`/design-systems/${dsId}/versions/${versionId}/themes/${themeId}/overrides`,
|
|
7482
|
-
|
|
7486
|
+
z252.any(),
|
|
7483
7487
|
{
|
|
7484
7488
|
method: "POST",
|
|
7485
7489
|
body
|
|
@@ -7489,7 +7493,7 @@ var OverridesEndpoint = class {
|
|
|
7489
7493
|
};
|
|
7490
7494
|
|
|
7491
7495
|
// src/api/endpoints/design-system/versions/property-definitions.ts
|
|
7492
|
-
import { z as
|
|
7496
|
+
import { z as z253 } from "zod";
|
|
7493
7497
|
var ElementPropertyDefinitionsEndpoint = class {
|
|
7494
7498
|
constructor(requestExecutor) {
|
|
7495
7499
|
this.requestExecutor = requestExecutor;
|
|
@@ -7517,7 +7521,7 @@ var ElementPropertyDefinitionsEndpoint = class {
|
|
|
7517
7521
|
delete(designSystemId, versionId, defId) {
|
|
7518
7522
|
return this.requestExecutor.json(
|
|
7519
7523
|
`/design-systems/${designSystemId}/versions/${versionId}/element-properties/definitions/${defId}`,
|
|
7520
|
-
|
|
7524
|
+
z253.any(),
|
|
7521
7525
|
{ method: "DELETE" }
|
|
7522
7526
|
);
|
|
7523
7527
|
}
|
|
@@ -7556,7 +7560,7 @@ var VersionStatsEndpoint = class {
|
|
|
7556
7560
|
};
|
|
7557
7561
|
|
|
7558
7562
|
// src/api/endpoints/design-system/versions/themes.ts
|
|
7559
|
-
import { z as
|
|
7563
|
+
import { z as z254 } from "zod";
|
|
7560
7564
|
var ThemesEndpoint = class {
|
|
7561
7565
|
constructor(requestExecutor) {
|
|
7562
7566
|
this.requestExecutor = requestExecutor;
|
|
@@ -7579,7 +7583,7 @@ var ThemesEndpoint = class {
|
|
|
7579
7583
|
});
|
|
7580
7584
|
}
|
|
7581
7585
|
delete(dsId, versionId, themeId) {
|
|
7582
|
-
return this.requestExecutor.json(`/design-systems/${dsId}/versions/${versionId}/themes/${themeId}`,
|
|
7586
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/versions/${versionId}/themes/${themeId}`, z254.any(), {
|
|
7583
7587
|
method: "DELETE"
|
|
7584
7588
|
});
|
|
7585
7589
|
}
|
|
@@ -7726,7 +7730,7 @@ var DesignSystemContactsEndpoint = class {
|
|
|
7726
7730
|
};
|
|
7727
7731
|
|
|
7728
7732
|
// src/api/endpoints/design-system/design-systems.ts
|
|
7729
|
-
import { z as
|
|
7733
|
+
import { z as z256 } from "zod";
|
|
7730
7734
|
|
|
7731
7735
|
// src/api/endpoints/design-system/members.ts
|
|
7732
7736
|
var DesignSystemMembersEndpoint = class {
|
|
@@ -7747,7 +7751,7 @@ var DesignSystemMembersEndpoint = class {
|
|
|
7747
7751
|
};
|
|
7748
7752
|
|
|
7749
7753
|
// src/api/endpoints/design-system/sources.ts
|
|
7750
|
-
import { z as
|
|
7754
|
+
import { z as z255 } from "zod";
|
|
7751
7755
|
var DesignSystemSourcesEndpoint = class {
|
|
7752
7756
|
constructor(requestExecutor) {
|
|
7753
7757
|
this.requestExecutor = requestExecutor;
|
|
@@ -7762,7 +7766,7 @@ var DesignSystemSourcesEndpoint = class {
|
|
|
7762
7766
|
return this.requestExecutor.json(`/design-systems/${dsId}/sources`, DTODataSourcesListResponse);
|
|
7763
7767
|
}
|
|
7764
7768
|
delete(dsId, sourceId) {
|
|
7765
|
-
return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`,
|
|
7769
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, z255.any(), { method: "DELETE" });
|
|
7766
7770
|
}
|
|
7767
7771
|
figmaImport(dsId, payload) {
|
|
7768
7772
|
return this.requestExecutor.json(`/design-systems/${dsId}/versions/head/cloud-import`, DTOImportJobResponse, {
|
|
@@ -7797,7 +7801,7 @@ var DesignSystemsEndpoint = class {
|
|
|
7797
7801
|
return this.requestExecutor.json(`/design-systems/${dsId}`, DTODesignSystemResponse);
|
|
7798
7802
|
}
|
|
7799
7803
|
delete(dsId) {
|
|
7800
|
-
return this.requestExecutor.json(`/design-systems/${dsId}`,
|
|
7804
|
+
return this.requestExecutor.json(`/design-systems/${dsId}`, z256.any(), { method: "DELETE" });
|
|
7801
7805
|
}
|
|
7802
7806
|
update(dsId, body) {
|
|
7803
7807
|
return this.requestExecutor.json(`/design-systems/${dsId}`, DTODesignSystemResponse, {
|
|
@@ -7841,7 +7845,7 @@ var WorkspaceInvitationsEndpoint = class {
|
|
|
7841
7845
|
};
|
|
7842
7846
|
|
|
7843
7847
|
// src/api/endpoints/workspaces/workspace-members.ts
|
|
7844
|
-
import { z as
|
|
7848
|
+
import { z as z257 } from "zod";
|
|
7845
7849
|
var WorkspaceMembersEndpoint = class {
|
|
7846
7850
|
constructor(requestExecutor) {
|
|
7847
7851
|
this.requestExecutor = requestExecutor;
|
|
@@ -7858,7 +7862,7 @@ var WorkspaceMembersEndpoint = class {
|
|
|
7858
7862
|
});
|
|
7859
7863
|
}
|
|
7860
7864
|
invite(workspaceId, body) {
|
|
7861
|
-
return this.requestExecutor.json(`/workspaces/${workspaceId}/members`,
|
|
7865
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/members`, z257.any(), { method: "POST", body });
|
|
7862
7866
|
}
|
|
7863
7867
|
delete(workspaceId, userId) {
|
|
7864
7868
|
return this.requestExecutor.json(`/workspaces/${workspaceId}/members/${userId}`, DTOWorkspaceResponse, {
|
|
@@ -7868,7 +7872,7 @@ var WorkspaceMembersEndpoint = class {
|
|
|
7868
7872
|
};
|
|
7869
7873
|
|
|
7870
7874
|
// src/api/endpoints/workspaces/workspaces.ts
|
|
7871
|
-
import { z as
|
|
7875
|
+
import { z as z258 } from "zod";
|
|
7872
7876
|
var WorkspacesEndpoint = class {
|
|
7873
7877
|
constructor(requestExecutor) {
|
|
7874
7878
|
this.requestExecutor = requestExecutor;
|
|
@@ -7891,10 +7895,10 @@ var WorkspacesEndpoint = class {
|
|
|
7891
7895
|
return this.requestExecutor.json(`/workspaces/${workspaceId}`, DTOWorkspaceResponse, { method: "GET" });
|
|
7892
7896
|
}
|
|
7893
7897
|
delete(workspaceId) {
|
|
7894
|
-
return this.requestExecutor.json(`/workspaces/${workspaceId}`,
|
|
7898
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}`, z258.any(), { method: "DELETE" });
|
|
7895
7899
|
}
|
|
7896
7900
|
subscription(workspaceId) {
|
|
7897
|
-
return this.requestExecutor.json(`/workspaces/${workspaceId}/subscription`,
|
|
7901
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/subscription`, z258.any(), { method: "GET" });
|
|
7898
7902
|
}
|
|
7899
7903
|
transferOwnership(workspaceId, body) {
|
|
7900
7904
|
return this.requestExecutor.json(`/workspaces/${workspaceId}/ownership`, DTOWorkspaceResponse, {
|
|
@@ -7981,9 +7985,9 @@ ${bodyText}`,
|
|
|
7981
7985
|
|
|
7982
7986
|
// src/api/transport/request-executor.ts
|
|
7983
7987
|
import fetch from "node-fetch";
|
|
7984
|
-
import { z as
|
|
7985
|
-
var ResponseWrapper =
|
|
7986
|
-
result:
|
|
7988
|
+
import { z as z259 } from "zod";
|
|
7989
|
+
var ResponseWrapper = z259.object({
|
|
7990
|
+
result: z259.record(z259.any())
|
|
7987
7991
|
});
|
|
7988
7992
|
var RequestExecutor = class {
|
|
7989
7993
|
constructor(testServerConfig) {
|
|
@@ -8039,19 +8043,6 @@ var RequestExecutor = class {
|
|
|
8039
8043
|
}
|
|
8040
8044
|
};
|
|
8041
8045
|
|
|
8042
|
-
// src/api/endpoints/liveblocks.ts
|
|
8043
|
-
var LiveblocksEndpoint = class {
|
|
8044
|
-
constructor(requestExecutor) {
|
|
8045
|
-
this.requestExecutor = requestExecutor;
|
|
8046
|
-
}
|
|
8047
|
-
auth(body) {
|
|
8048
|
-
return this.requestExecutor.json("/liveblocks/auth", DTOLiveblocksAuthResponse, {
|
|
8049
|
-
method: "POST",
|
|
8050
|
-
body
|
|
8051
|
-
});
|
|
8052
|
-
}
|
|
8053
|
-
};
|
|
8054
|
-
|
|
8055
8046
|
// src/api/client.ts
|
|
8056
8047
|
var SupernovaApiClient = class {
|
|
8057
8048
|
constructor(config) {
|
|
@@ -8059,7 +8050,6 @@ var SupernovaApiClient = class {
|
|
|
8059
8050
|
__publicField(this, "workspaces");
|
|
8060
8051
|
__publicField(this, "designSystems");
|
|
8061
8052
|
__publicField(this, "codegen");
|
|
8062
|
-
__publicField(this, "liveblocks");
|
|
8063
8053
|
const requestExecutor = new RequestExecutor({
|
|
8064
8054
|
host: config.host,
|
|
8065
8055
|
accessToken: config.accessToken
|
|
@@ -8068,12 +8058,14 @@ var SupernovaApiClient = class {
|
|
|
8068
8058
|
this.workspaces = new WorkspacesEndpoint(requestExecutor);
|
|
8069
8059
|
this.designSystems = new DesignSystemsEndpoint(requestExecutor);
|
|
8070
8060
|
this.codegen = new CodegenEndpoint(requestExecutor);
|
|
8071
|
-
this.liveblocks = new LiveblocksEndpoint(requestExecutor);
|
|
8072
8061
|
}
|
|
8073
8062
|
};
|
|
8074
8063
|
|
|
8064
|
+
// src/sync/docs-structure-repo.ts
|
|
8065
|
+
import PQueue from "p-queue";
|
|
8066
|
+
|
|
8075
8067
|
// src/yjs/design-system-content/documentation-hierarchy.ts
|
|
8076
|
-
import { z as
|
|
8068
|
+
import { z as z260 } from "zod";
|
|
8077
8069
|
|
|
8078
8070
|
// src/yjs/version-room/base.ts
|
|
8079
8071
|
var VersionRoomBaseYDoc = class {
|
|
@@ -8081,6 +8073,17 @@ var VersionRoomBaseYDoc = class {
|
|
|
8081
8073
|
__publicField(this, "yDoc");
|
|
8082
8074
|
this.yDoc = yDoc;
|
|
8083
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
|
+
}
|
|
8084
8087
|
//
|
|
8085
8088
|
// Pages
|
|
8086
8089
|
//
|
|
@@ -8232,6 +8235,236 @@ var VersionRoomBaseYDoc = class {
|
|
|
8232
8235
|
}
|
|
8233
8236
|
};
|
|
8234
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
|
+
|
|
8235
8468
|
// src/yjs/version-room/utils.ts
|
|
8236
8469
|
function generatePageContentHash(content, definitions, debug = false) {
|
|
8237
8470
|
let sanitizedContent = structuredClone(content);
|
|
@@ -8311,247 +8544,8 @@ var FrontendVersionRoomYDoc = class {
|
|
|
8311
8544
|
// Hierarchy
|
|
8312
8545
|
//
|
|
8313
8546
|
getDocumentationHierarchy(options = {}) {
|
|
8314
|
-
const includeDeletedContent = options.includeDeletedContent ?? false;
|
|
8315
8547
|
const doc = new VersionRoomBaseYDoc(this.yDoc);
|
|
8316
|
-
|
|
8317
|
-
const groups = doc.getGroups();
|
|
8318
|
-
const pageSnapshots = doc.getPageSnapshots();
|
|
8319
|
-
const groupSnapshots = doc.getGroupSnapshots();
|
|
8320
|
-
if (includeDeletedContent) {
|
|
8321
|
-
pages.push(...this.getDeletedPages(pages, pageSnapshots));
|
|
8322
|
-
groups.push(...this.getDeletedGroups(groups, groupSnapshots));
|
|
8323
|
-
}
|
|
8324
|
-
const settings = doc.getDocumentationInternalSettings();
|
|
8325
|
-
const pageDTOs = documentationPagesToDTOV2(pages, groups, settings.routingVersion);
|
|
8326
|
-
const groupDTOs = elementGroupsToDocumentationGroupDTOV2(groups, pages);
|
|
8327
|
-
if (!settings.isDraftFeatureAdopted) {
|
|
8328
|
-
return {
|
|
8329
|
-
pages: pageDTOs,
|
|
8330
|
-
groups: groupDTOs
|
|
8331
|
-
};
|
|
8332
|
-
}
|
|
8333
|
-
const pageDraftStates = this.buildPageDraftCreatedAndUpdatedStates(pages, pageSnapshots);
|
|
8334
|
-
const pageDraftDeletedStates = this.buildPageDraftDeletedStates(pages, pageSnapshots);
|
|
8335
|
-
const pagePublishedMetadata = this.buildPagePublishedMetadata(pages, pageSnapshots);
|
|
8336
|
-
const pageApprovalStates = this.buildPageApprovalStates(pages);
|
|
8337
|
-
pageDTOs.forEach((p) => {
|
|
8338
|
-
const draftState = pageDraftDeletedStates.get(p.id) ?? pageDraftStates.get(p.id);
|
|
8339
|
-
draftState && (p.draftState = draftState);
|
|
8340
|
-
const publishMetadata = pagePublishedMetadata.get(p.id);
|
|
8341
|
-
publishMetadata && (p.publishMetadata = publishMetadata);
|
|
8342
|
-
const approvalState = pageApprovalStates.get(p.id);
|
|
8343
|
-
approvalState && (p.approvalState = approvalState);
|
|
8344
|
-
});
|
|
8345
|
-
const groupDraftStates = this.buildGroupDraftCreatedAndUpdatedStates(groups, groupSnapshots);
|
|
8346
|
-
const groupDraftDeletedStates = this.buildGroupDraftDeletedStates(groups, groupSnapshots);
|
|
8347
|
-
const groupPublishedMetadata = this.buildGroupPublishedMetadata(groups, groupSnapshots);
|
|
8348
|
-
const groupApprovalStates = this.buildGroupApprovalStates(groups, groupSnapshots);
|
|
8349
|
-
groupDTOs.forEach((g) => {
|
|
8350
|
-
const draftState = groupDraftDeletedStates.get(g.id) ?? groupDraftStates.get(g.id);
|
|
8351
|
-
draftState && (g.draftState = draftState);
|
|
8352
|
-
const publishMetadata = groupPublishedMetadata.get(g.id);
|
|
8353
|
-
publishMetadata && (g.publishMetadata = publishMetadata);
|
|
8354
|
-
const approvalState = groupApprovalStates.get(g.id);
|
|
8355
|
-
approvalState && (g.approvalState = approvalState);
|
|
8356
|
-
});
|
|
8357
|
-
return {
|
|
8358
|
-
pages: pageDTOs,
|
|
8359
|
-
groups: groupDTOs
|
|
8360
|
-
};
|
|
8361
|
-
}
|
|
8362
|
-
//
|
|
8363
|
-
// Drafts - Pages
|
|
8364
|
-
//
|
|
8365
|
-
buildPageDraftDeletedStates(pages, pageSnapshots) {
|
|
8366
|
-
const deletedSnapshotsByPageId = mapByUnique(
|
|
8367
|
-
pickLatestPageSnapshots(pageSnapshots.filter((s) => s.reason === "Deletion")),
|
|
8368
|
-
(s) => s.page.id
|
|
8369
|
-
);
|
|
8370
|
-
const result = /* @__PURE__ */ new Map();
|
|
8371
|
-
pages.forEach((page) => {
|
|
8372
|
-
const deletedSnapshot = deletedSnapshotsByPageId.get(page.id);
|
|
8373
|
-
if (!deletedSnapshot)
|
|
8374
|
-
return;
|
|
8375
|
-
result.set(page.id, {
|
|
8376
|
-
changeType: "Deleted",
|
|
8377
|
-
deletedAt: deletedSnapshot.createdAt,
|
|
8378
|
-
deletedByUserId: deletedSnapshot.createdByUserId
|
|
8379
|
-
});
|
|
8380
|
-
});
|
|
8381
|
-
return result;
|
|
8382
|
-
}
|
|
8383
|
-
buildPageDraftCreatedAndUpdatedStates(pages, pageSnapshots) {
|
|
8384
|
-
const doc = new VersionRoomBaseYDoc(this.yDoc);
|
|
8385
|
-
const pageHashes = doc.getDocumentationPageContentHashes();
|
|
8386
|
-
const publishedSnapshots = pickLatestPageSnapshots(pageSnapshots.filter((s) => s.reason === "Publish"));
|
|
8387
|
-
const publishedSnapshotsByPageId = mapByUnique(publishedSnapshots, (s) => s.page.id);
|
|
8388
|
-
const result = /* @__PURE__ */ new Map();
|
|
8389
|
-
pages.forEach((page) => {
|
|
8390
|
-
const snapshot = publishedSnapshotsByPageId.get(page.id);
|
|
8391
|
-
let publishedState;
|
|
8392
|
-
if (snapshot) {
|
|
8393
|
-
publishedState = this.itemStateFromPage(snapshot.page, snapshot.pageContentHash);
|
|
8394
|
-
}
|
|
8395
|
-
const currentPageContentHash = pageHashes[page.persistentId] ?? snapshot?.pageContentHash ?? "";
|
|
8396
|
-
const currentState = this.itemStateFromPage(page, currentPageContentHash);
|
|
8397
|
-
const draftState = this.createDraftState(page.persistentId, currentState, publishedState);
|
|
8398
|
-
if (draftState)
|
|
8399
|
-
result.set(page.id, draftState);
|
|
8400
|
-
});
|
|
8401
|
-
return result;
|
|
8402
|
-
}
|
|
8403
|
-
itemStateFromPage(page, pageContentHash) {
|
|
8404
|
-
return {
|
|
8405
|
-
title: page.meta.name,
|
|
8406
|
-
configuration: page.data.configuration ?? defaultDocumentationItemConfigurationV2,
|
|
8407
|
-
contentHash: pageContentHash
|
|
8408
|
-
};
|
|
8409
|
-
}
|
|
8410
|
-
getDeletedPages(pages, pageSnapshots) {
|
|
8411
|
-
const existingPageIds = new Set(pages.map((p) => p.id));
|
|
8412
|
-
const latestSnapshots = pickLatestPageSnapshots(pageSnapshots);
|
|
8413
|
-
return latestSnapshots.filter((s) => !existingPageIds.has(s.page.id)).map((s) => s.page);
|
|
8414
|
-
}
|
|
8415
|
-
buildPagePublishedMetadata(pages, pageSnapshots) {
|
|
8416
|
-
const publishedPageSnapshotsById = mapByUnique(
|
|
8417
|
-
pickLatestPageSnapshots(pageSnapshots.filter((s) => s.reason === "Publish")),
|
|
8418
|
-
(s) => s.page.id
|
|
8419
|
-
);
|
|
8420
|
-
const result = /* @__PURE__ */ new Map();
|
|
8421
|
-
pages.forEach((p) => {
|
|
8422
|
-
const publishedSnapshot = publishedPageSnapshotsById.get(p.id);
|
|
8423
|
-
if (!publishedSnapshot)
|
|
8424
|
-
return;
|
|
8425
|
-
result.set(p.id, {
|
|
8426
|
-
lastPublishedAt: publishedSnapshot.createdAt,
|
|
8427
|
-
lastPublishedByUserId: publishedSnapshot.createdByUserId
|
|
8428
|
-
});
|
|
8429
|
-
});
|
|
8430
|
-
return result;
|
|
8431
|
-
}
|
|
8432
|
-
//
|
|
8433
|
-
// Drafts - Groups
|
|
8434
|
-
//
|
|
8435
|
-
buildGroupDraftDeletedStates(groups, groupSnapshots) {
|
|
8436
|
-
const deletedSnapshotsByGroupId = mapByUnique(
|
|
8437
|
-
pickLatestGroupSnapshots(groupSnapshots.filter((s) => s.reason === "Deletion")),
|
|
8438
|
-
(s) => s.group.id
|
|
8439
|
-
);
|
|
8440
|
-
const result = /* @__PURE__ */ new Map();
|
|
8441
|
-
groups.forEach((group) => {
|
|
8442
|
-
if (!group.parentPersistentId)
|
|
8443
|
-
return;
|
|
8444
|
-
const deletedSnapshot = deletedSnapshotsByGroupId.get(group.id);
|
|
8445
|
-
if (!deletedSnapshot)
|
|
8446
|
-
return;
|
|
8447
|
-
result.set(group.id, {
|
|
8448
|
-
changeType: "Deleted",
|
|
8449
|
-
deletedAt: deletedSnapshot.createdAt,
|
|
8450
|
-
deletedByUserId: deletedSnapshot.createdByUserId
|
|
8451
|
-
});
|
|
8452
|
-
});
|
|
8453
|
-
return result;
|
|
8454
|
-
}
|
|
8455
|
-
buildGroupDraftCreatedAndUpdatedStates(groups, groupSnapshots) {
|
|
8456
|
-
const publishedSnapshots = pickLatestGroupSnapshots(groupSnapshots.filter((s) => s.reason === "Publish"));
|
|
8457
|
-
const publishedSnapshotsByGroupId = mapByUnique(publishedSnapshots, (s) => s.group.id);
|
|
8458
|
-
const result = /* @__PURE__ */ new Map();
|
|
8459
|
-
groups.forEach((group) => {
|
|
8460
|
-
if (!group.parentPersistentId)
|
|
8461
|
-
return;
|
|
8462
|
-
const currentState = this.itemStateFromGroup(group);
|
|
8463
|
-
const snapshot = publishedSnapshotsByGroupId.get(group.id);
|
|
8464
|
-
let publishedState;
|
|
8465
|
-
if (snapshot) {
|
|
8466
|
-
publishedState = this.itemStateFromGroup(snapshot.group);
|
|
8467
|
-
}
|
|
8468
|
-
const draftState = this.createDraftState(group.persistentId, currentState, publishedState);
|
|
8469
|
-
if (draftState)
|
|
8470
|
-
result.set(group.id, draftState);
|
|
8471
|
-
});
|
|
8472
|
-
return result;
|
|
8473
|
-
}
|
|
8474
|
-
itemStateFromGroup(group) {
|
|
8475
|
-
return {
|
|
8476
|
-
title: group.meta.name,
|
|
8477
|
-
configuration: group.data?.configuration ?? defaultDocumentationItemConfigurationV2,
|
|
8478
|
-
contentHash: "-"
|
|
8479
|
-
};
|
|
8480
|
-
}
|
|
8481
|
-
getDeletedGroups(groups, groupSnapshots) {
|
|
8482
|
-
const existingGroupIds = new Set(groups.map((p) => p.id));
|
|
8483
|
-
const latestSnapshots = pickLatestGroupSnapshots(groupSnapshots);
|
|
8484
|
-
return latestSnapshots.filter((s) => !existingGroupIds.has(s.group.id)).map((s) => s.group);
|
|
8485
|
-
}
|
|
8486
|
-
buildGroupPublishedMetadata(groups, groupSnapshots) {
|
|
8487
|
-
const publishedGroupSnapshotsById = mapByUnique(
|
|
8488
|
-
pickLatestGroupSnapshots(groupSnapshots.filter((s) => s.reason === "Publish")),
|
|
8489
|
-
(s) => s.group.id
|
|
8490
|
-
);
|
|
8491
|
-
const result = /* @__PURE__ */ new Map();
|
|
8492
|
-
groups.forEach((g) => {
|
|
8493
|
-
if (!g.parentPersistentId)
|
|
8494
|
-
return;
|
|
8495
|
-
const publishedSnapshot = publishedGroupSnapshotsById.get(g.id);
|
|
8496
|
-
if (!publishedSnapshot)
|
|
8497
|
-
return;
|
|
8498
|
-
result.set(g.id, {
|
|
8499
|
-
lastPublishedAt: publishedSnapshot.createdAt,
|
|
8500
|
-
lastPublishedByUserId: publishedSnapshot.createdByUserId
|
|
8501
|
-
});
|
|
8502
|
-
});
|
|
8503
|
-
return result;
|
|
8504
|
-
}
|
|
8505
|
-
//
|
|
8506
|
-
// Drafts - Shared
|
|
8507
|
-
//
|
|
8508
|
-
createDraftState(itemPersistentId, currentState, publishedState) {
|
|
8509
|
-
if (!publishedState) {
|
|
8510
|
-
return { changeType: "Created" };
|
|
8511
|
-
}
|
|
8512
|
-
const updatedDraftState = {
|
|
8513
|
-
changeType: "Updated",
|
|
8514
|
-
changes: {}
|
|
8515
|
-
};
|
|
8516
|
-
if (currentState.title !== publishedState.title) {
|
|
8517
|
-
if (this.debug) {
|
|
8518
|
-
console.log(`Item ${itemPersistentId} (${currentState.title}): updated title`);
|
|
8519
|
-
}
|
|
8520
|
-
updatedDraftState.changes.previousTitle = publishedState.title;
|
|
8521
|
-
}
|
|
8522
|
-
const currentConfigHash = generateHash(currentState.configuration, this.debug);
|
|
8523
|
-
const publishedConfigHash = generateHash(publishedState.configuration, this.debug);
|
|
8524
|
-
if (currentConfigHash !== publishedConfigHash) {
|
|
8525
|
-
if (this.debug) {
|
|
8526
|
-
console.log(`Item ${itemPersistentId} (${currentState.title}): updated configuration`);
|
|
8527
|
-
}
|
|
8528
|
-
const configurationDto = documentationItemConfigurationToDTOV2(publishedState.configuration);
|
|
8529
|
-
updatedDraftState.changes.previousConfiguration = configurationDto;
|
|
8530
|
-
}
|
|
8531
|
-
if (currentState.contentHash !== publishedState.contentHash) {
|
|
8532
|
-
if (this.debug) {
|
|
8533
|
-
console.log(`Item ${itemPersistentId} (${currentState.title}): updated content hash`);
|
|
8534
|
-
}
|
|
8535
|
-
updatedDraftState.changes.previousContentHash = publishedState.contentHash;
|
|
8536
|
-
}
|
|
8537
|
-
if (Object.keys(updatedDraftState.changes).length) {
|
|
8538
|
-
return updatedDraftState;
|
|
8539
|
-
}
|
|
8540
|
-
return void 0;
|
|
8541
|
-
}
|
|
8542
|
-
buildGroupApprovalStates(groups, groupSnapshots) {
|
|
8543
|
-
const result = /* @__PURE__ */ new Map();
|
|
8544
|
-
const allGroups = [...groups, ...groupSnapshots];
|
|
8545
|
-
for (const g of allGroups) {
|
|
8546
|
-
const approvalState = {
|
|
8547
|
-
approvalState: "Approved",
|
|
8548
|
-
designSystemVersionId: g.designSystemVersionId,
|
|
8549
|
-
persistentId: g.persistentId,
|
|
8550
|
-
groupId: g.id
|
|
8551
|
-
};
|
|
8552
|
-
result.set(g.id, approvalState);
|
|
8553
|
-
}
|
|
8554
|
-
return result;
|
|
8548
|
+
return computeDocsHierarchy(doc.getState(), options);
|
|
8555
8549
|
}
|
|
8556
8550
|
//
|
|
8557
8551
|
// Update page content hash
|
|
@@ -8587,40 +8581,27 @@ var FrontendVersionRoomYDoc = class {
|
|
|
8587
8581
|
const settings = doc.getDocumentationInternalSettings();
|
|
8588
8582
|
return settings.approvalRequiredForPublishing;
|
|
8589
8583
|
}
|
|
8590
|
-
buildPageApprovalStates(pages) {
|
|
8591
|
-
const doc = new VersionRoomBaseYDoc(this.yDoc);
|
|
8592
|
-
const pageIds = pages.map((p) => p.id);
|
|
8593
|
-
const result = /* @__PURE__ */ new Map();
|
|
8594
|
-
const approvals = doc.getApprovals();
|
|
8595
|
-
for (const pId of pageIds) {
|
|
8596
|
-
const approval = approvals.find((approval2) => approval2.pageId === pId);
|
|
8597
|
-
if (approval) {
|
|
8598
|
-
result.set(pId, approval);
|
|
8599
|
-
}
|
|
8600
|
-
}
|
|
8601
|
-
return result;
|
|
8602
|
-
}
|
|
8603
8584
|
};
|
|
8604
8585
|
|
|
8605
8586
|
// src/yjs/design-system-content/documentation-hierarchy.ts
|
|
8606
|
-
var DocumentationHierarchySettings =
|
|
8607
|
-
routingVersion:
|
|
8608
|
-
isDraftFeatureAdopted:
|
|
8609
|
-
isApprovalFeatureEnabled:
|
|
8610
|
-
approvalRequiredForPublishing:
|
|
8587
|
+
var DocumentationHierarchySettings = z260.object({
|
|
8588
|
+
routingVersion: z260.string(),
|
|
8589
|
+
isDraftFeatureAdopted: z260.boolean(),
|
|
8590
|
+
isApprovalFeatureEnabled: z260.boolean(),
|
|
8591
|
+
approvalRequiredForPublishing: z260.boolean()
|
|
8611
8592
|
});
|
|
8612
8593
|
function yjsToDocumentationHierarchy(doc) {
|
|
8613
8594
|
return new FrontendVersionRoomYDoc(doc).getDocumentationHierarchy();
|
|
8614
8595
|
}
|
|
8615
8596
|
|
|
8616
8597
|
// src/yjs/design-system-content/item-configuration.ts
|
|
8617
|
-
import { z as
|
|
8618
|
-
var DTODocumentationPageRoomHeaderData =
|
|
8619
|
-
title:
|
|
8598
|
+
import { z as z261 } from "zod";
|
|
8599
|
+
var DTODocumentationPageRoomHeaderData = z261.object({
|
|
8600
|
+
title: z261.string(),
|
|
8620
8601
|
configuration: DTODocumentationItemConfigurationV2
|
|
8621
8602
|
});
|
|
8622
|
-
var DTODocumentationPageRoomHeaderDataUpdate =
|
|
8623
|
-
title:
|
|
8603
|
+
var DTODocumentationPageRoomHeaderDataUpdate = z261.object({
|
|
8604
|
+
title: z261.string().optional(),
|
|
8624
8605
|
configuration: DTODocumentationItemConfigurationV2.omit({ header: true }).extend({ header: DocumentationItemHeaderV2.partial() }).optional()
|
|
8625
8606
|
});
|
|
8626
8607
|
function itemConfigurationToYjs(yDoc, item) {
|
|
@@ -8671,7 +8652,7 @@ function yjsToItemConfiguration(yDoc) {
|
|
|
8671
8652
|
header: rawHeader
|
|
8672
8653
|
};
|
|
8673
8654
|
return {
|
|
8674
|
-
title:
|
|
8655
|
+
title: z261.string().parse(title),
|
|
8675
8656
|
configuration: DTODocumentationItemConfigurationV2.parse(rawConfig)
|
|
8676
8657
|
};
|
|
8677
8658
|
}
|
|
@@ -8681,9 +8662,9 @@ var PageBlockEditorModel = PageBlockEditorModelV2;
|
|
|
8681
8662
|
var PageSectionEditorModel = PageSectionEditorModelV2;
|
|
8682
8663
|
|
|
8683
8664
|
// src/yjs/docs-editor/model/page.ts
|
|
8684
|
-
import { z as
|
|
8685
|
-
var DocumentationPageEditorModel =
|
|
8686
|
-
blocks:
|
|
8665
|
+
import { z as z262 } from "zod";
|
|
8666
|
+
var DocumentationPageEditorModel = z262.object({
|
|
8667
|
+
blocks: z262.array(DocumentationPageContentItem)
|
|
8687
8668
|
});
|
|
8688
8669
|
|
|
8689
8670
|
// src/yjs/docs-editor/prosemirror/inner-editor-schema.ts
|
|
@@ -12204,7 +12185,7 @@ var blocks = [
|
|
|
12204
12185
|
|
|
12205
12186
|
// src/yjs/docs-editor/prosemirror-to-blocks.ts
|
|
12206
12187
|
import { yXmlFragmentToProsemirrorJSON } from "y-prosemirror";
|
|
12207
|
-
import { z as
|
|
12188
|
+
import { z as z263 } from "zod";
|
|
12208
12189
|
function yDocToPage(yDoc, definitions) {
|
|
12209
12190
|
return yXmlFragmentToPage(yDoc.getXmlFragment("default"), definitions);
|
|
12210
12191
|
}
|
|
@@ -12284,7 +12265,7 @@ function prosemirrorNodeToSectionItem(prosemirrorNode, definitionsMap) {
|
|
|
12284
12265
|
return null;
|
|
12285
12266
|
return {
|
|
12286
12267
|
id,
|
|
12287
|
-
title: getProsemirrorAttribute(prosemirrorNode, "title",
|
|
12268
|
+
title: getProsemirrorAttribute(prosemirrorNode, "title", z263.string()) ?? "",
|
|
12288
12269
|
columns: (prosemirrorNode.content ?? []).filter((c) => c.type === "sectionItemColumn").map((c) => prosemirrorNodeToSectionColumns(c, definitionsMap)).filter(nonNullFilter)
|
|
12289
12270
|
};
|
|
12290
12271
|
}
|
|
@@ -12319,7 +12300,7 @@ function internalProsemirrorNodesToBlocks(prosemirrorNodes, definitionsMap, dept
|
|
|
12319
12300
|
});
|
|
12320
12301
|
}
|
|
12321
12302
|
function internalProsemirrorNodeToBlock(prosemirrorNode, definitionsMap, depth) {
|
|
12322
|
-
const definitionId = getProsemirrorAttribute(prosemirrorNode, "definitionId",
|
|
12303
|
+
const definitionId = getProsemirrorAttribute(prosemirrorNode, "definitionId", z263.string());
|
|
12323
12304
|
if (!definitionId) {
|
|
12324
12305
|
console.warn(`definitionId on ${prosemirrorNode.type} is required to be interpreted as a block, skipping node`);
|
|
12325
12306
|
return [];
|
|
@@ -12361,7 +12342,7 @@ function parseAsRichText(prosemirrorNode, definition, property) {
|
|
|
12361
12342
|
if (!id)
|
|
12362
12343
|
return null;
|
|
12363
12344
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
12364
|
-
const calloutType = parseCalloutType(getProsemirrorAttribute(prosemirrorNode, "type",
|
|
12345
|
+
const calloutType = parseCalloutType(getProsemirrorAttribute(prosemirrorNode, "type", z263.string().optional()));
|
|
12365
12346
|
return {
|
|
12366
12347
|
id,
|
|
12367
12348
|
type: "Block",
|
|
@@ -12489,10 +12470,10 @@ function parseRichTextAttribute(mark) {
|
|
|
12489
12470
|
return null;
|
|
12490
12471
|
}
|
|
12491
12472
|
function parseProsemirrorLink(mark) {
|
|
12492
|
-
const href = getProsemirrorAttribute(mark, "href",
|
|
12473
|
+
const href = getProsemirrorAttribute(mark, "href", z263.string().optional());
|
|
12493
12474
|
if (!href)
|
|
12494
12475
|
return null;
|
|
12495
|
-
const target = getProsemirrorAttribute(mark, "target",
|
|
12476
|
+
const target = getProsemirrorAttribute(mark, "target", z263.string().optional());
|
|
12496
12477
|
const openInNewTab = target === "_blank";
|
|
12497
12478
|
if (href.startsWith("@")) {
|
|
12498
12479
|
return {
|
|
@@ -12511,10 +12492,10 @@ function parseProsemirrorLink(mark) {
|
|
|
12511
12492
|
}
|
|
12512
12493
|
}
|
|
12513
12494
|
function parseProsemirrorCommentHighlight(mark) {
|
|
12514
|
-
const highlightId = getProsemirrorAttribute(mark, "highlightId",
|
|
12495
|
+
const highlightId = getProsemirrorAttribute(mark, "highlightId", z263.string().optional());
|
|
12515
12496
|
if (!highlightId)
|
|
12516
12497
|
return null;
|
|
12517
|
-
const isResolved = getProsemirrorAttribute(mark, "resolved",
|
|
12498
|
+
const isResolved = getProsemirrorAttribute(mark, "resolved", z263.boolean().optional()) ?? false;
|
|
12518
12499
|
return {
|
|
12519
12500
|
type: "Comment",
|
|
12520
12501
|
commentHighlightId: highlightId,
|
|
@@ -12526,7 +12507,7 @@ function parseAsTable(prosemirrorNode, definition, property) {
|
|
|
12526
12507
|
if (!id)
|
|
12527
12508
|
return null;
|
|
12528
12509
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
12529
|
-
const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder",
|
|
12510
|
+
const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", z263.boolean().optional()) !== false;
|
|
12530
12511
|
const tableChild = prosemirrorNode.content?.find((c) => c.type === "table");
|
|
12531
12512
|
if (!tableChild) {
|
|
12532
12513
|
return emptyTable(id, variantId, 0);
|
|
@@ -12573,9 +12554,9 @@ function parseAsTableCell(prosemirrorNode) {
|
|
|
12573
12554
|
const id = getProsemirrorBlockId(prosemirrorNode);
|
|
12574
12555
|
if (!id)
|
|
12575
12556
|
return null;
|
|
12576
|
-
const textAlign = getProsemirrorAttribute(prosemirrorNode, "textAlign",
|
|
12557
|
+
const textAlign = getProsemirrorAttribute(prosemirrorNode, "textAlign", z263.string().optional());
|
|
12577
12558
|
let columnWidth;
|
|
12578
|
-
const columnWidthArray = getProsemirrorAttribute(prosemirrorNode, "colwidth",
|
|
12559
|
+
const columnWidthArray = getProsemirrorAttribute(prosemirrorNode, "colwidth", z263.array(z263.number()).nullish());
|
|
12579
12560
|
if (columnWidthArray) {
|
|
12580
12561
|
columnWidth = roundDimension(columnWidthArray[0]);
|
|
12581
12562
|
}
|
|
@@ -12613,7 +12594,7 @@ function parseAsTableNode(prosemirrorNode) {
|
|
|
12613
12594
|
value: parseRichText(prosemirrorNode.content ?? [])
|
|
12614
12595
|
};
|
|
12615
12596
|
case "image":
|
|
12616
|
-
const items = getProsemirrorAttribute(prosemirrorNode, "items",
|
|
12597
|
+
const items = getProsemirrorAttribute(prosemirrorNode, "items", z263.string());
|
|
12617
12598
|
if (!items)
|
|
12618
12599
|
return null;
|
|
12619
12600
|
const parsedItems = PageBlockItemV2.array().safeParse(JSON.parse(items));
|
|
@@ -12733,7 +12714,7 @@ function definitionExpectsPlaceholderItem(definition) {
|
|
|
12733
12714
|
);
|
|
12734
12715
|
}
|
|
12735
12716
|
function parseBlockItems(prosemirrorNode, definition) {
|
|
12736
|
-
const itemsString = getProsemirrorAttribute(prosemirrorNode, "items",
|
|
12717
|
+
const itemsString = getProsemirrorAttribute(prosemirrorNode, "items", z263.string());
|
|
12737
12718
|
if (!itemsString)
|
|
12738
12719
|
return null;
|
|
12739
12720
|
const itemsJson = JSON.parse(itemsString);
|
|
@@ -12745,18 +12726,18 @@ function parseBlockItems(prosemirrorNode, definition) {
|
|
|
12745
12726
|
}
|
|
12746
12727
|
function parseAppearance(prosemirrorNode) {
|
|
12747
12728
|
let appearance = {};
|
|
12748
|
-
const rawAppearanceString = getProsemirrorAttribute(prosemirrorNode, "appearance",
|
|
12729
|
+
const rawAppearanceString = getProsemirrorAttribute(prosemirrorNode, "appearance", z263.string().optional());
|
|
12749
12730
|
if (rawAppearanceString) {
|
|
12750
12731
|
const parsedAppearance = PageBlockAppearanceV2.safeParse(JSON.parse(rawAppearanceString));
|
|
12751
12732
|
if (parsedAppearance.success) {
|
|
12752
12733
|
appearance = parsedAppearance.data;
|
|
12753
12734
|
}
|
|
12754
12735
|
}
|
|
12755
|
-
const columns = getProsemirrorAttribute(prosemirrorNode, "columns",
|
|
12736
|
+
const columns = getProsemirrorAttribute(prosemirrorNode, "columns", z263.number().optional());
|
|
12756
12737
|
if (columns) {
|
|
12757
12738
|
appearance.numberOfColumns = columns;
|
|
12758
12739
|
}
|
|
12759
|
-
const backgroundColor = getProsemirrorAttribute(prosemirrorNode, "backgroundColor",
|
|
12740
|
+
const backgroundColor = getProsemirrorAttribute(prosemirrorNode, "backgroundColor", z263.string().optional());
|
|
12760
12741
|
if (backgroundColor) {
|
|
12761
12742
|
const parsedColor = PageBlockColorV2.safeParse(JSON.parse(backgroundColor));
|
|
12762
12743
|
if (parsedColor.success) {
|
|
@@ -12851,13 +12832,13 @@ function valueSchemaForPropertyType(type) {
|
|
|
12851
12832
|
}
|
|
12852
12833
|
}
|
|
12853
12834
|
function getProsemirrorBlockId(prosemirrorNode) {
|
|
12854
|
-
const id = getProsemirrorAttribute(prosemirrorNode, "id",
|
|
12835
|
+
const id = getProsemirrorAttribute(prosemirrorNode, "id", z263.string());
|
|
12855
12836
|
if (!id)
|
|
12856
12837
|
console.warn(`Prosemirror attribute "id" on ${prosemirrorNode.type} is required`);
|
|
12857
12838
|
return id;
|
|
12858
12839
|
}
|
|
12859
12840
|
function getProsemirrorBlockVariantId(prosemirrorNode) {
|
|
12860
|
-
return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(
|
|
12841
|
+
return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(z263.string()));
|
|
12861
12842
|
}
|
|
12862
12843
|
function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
|
|
12863
12844
|
const parsedAttr = validationSchema.safeParse(prosemirrorNode.attrs?.[attributeName]);
|
|
@@ -12914,6 +12895,156 @@ var BackendVersionRoomYDoc = class {
|
|
|
12914
12895
|
return Object.fromEntries(validHashes);
|
|
12915
12896
|
}
|
|
12916
12897
|
};
|
|
12898
|
+
|
|
12899
|
+
// src/sync/local-state.ts
|
|
12900
|
+
var LocalStorage = class {
|
|
12901
|
+
constructor() {
|
|
12902
|
+
__publicField(this, "pages", /* @__PURE__ */ new Map());
|
|
12903
|
+
__publicField(this, "groups", /* @__PURE__ */ new Map());
|
|
12904
|
+
}
|
|
12905
|
+
addPage(page) {
|
|
12906
|
+
if (this.pages.has(page.persistentId)) {
|
|
12907
|
+
throw new Error(`Page with id ${page.persistentId} already exists`);
|
|
12908
|
+
}
|
|
12909
|
+
this.pages.set(page.persistentId, page);
|
|
12910
|
+
}
|
|
12911
|
+
getPage(persistentId) {
|
|
12912
|
+
const page = this.pages.get(persistentId);
|
|
12913
|
+
if (!page) {
|
|
12914
|
+
throw new Error(`Page with id ${persistentId} doesn't exist`);
|
|
12915
|
+
}
|
|
12916
|
+
return page;
|
|
12917
|
+
}
|
|
12918
|
+
getAllPages() {
|
|
12919
|
+
return Array.from(this.pages.values());
|
|
12920
|
+
}
|
|
12921
|
+
removePage(persistentId) {
|
|
12922
|
+
this.pages.delete(persistentId);
|
|
12923
|
+
}
|
|
12924
|
+
};
|
|
12925
|
+
|
|
12926
|
+
// src/sync/docs-structure-repo.ts
|
|
12927
|
+
var DocsStructureRepo = class {
|
|
12928
|
+
};
|
|
12929
|
+
var DocsStructureRepository = class {
|
|
12930
|
+
constructor(yDoc, transactionExecutor) {
|
|
12931
|
+
__publicField(this, "localState", new LocalStorage());
|
|
12932
|
+
__publicField(this, "yDoc");
|
|
12933
|
+
__publicField(this, "yObserver");
|
|
12934
|
+
__publicField(this, "yState");
|
|
12935
|
+
__publicField(this, "trxQueue");
|
|
12936
|
+
__publicField(this, "hierarchyObservers", /* @__PURE__ */ new Set());
|
|
12937
|
+
this.yDoc = yDoc;
|
|
12938
|
+
this.yState = new VersionRoomBaseYDoc(this.yDoc).getState();
|
|
12939
|
+
this.yObserver = yDoc.on("update", () => this.onYUpdate());
|
|
12940
|
+
this.trxQueue = new TransactionQueue(transactionExecutor);
|
|
12941
|
+
}
|
|
12942
|
+
//
|
|
12943
|
+
// Lifecycle
|
|
12944
|
+
//
|
|
12945
|
+
addHierarchyObserver(observer) {
|
|
12946
|
+
this.hierarchyObservers.add(observer);
|
|
12947
|
+
}
|
|
12948
|
+
removeHierarchyObserver(observer) {
|
|
12949
|
+
this.hierarchyObservers.delete(observer);
|
|
12950
|
+
}
|
|
12951
|
+
dispose() {
|
|
12952
|
+
this.yDoc.off("update", this.yObserver);
|
|
12953
|
+
this.hierarchyObservers.clear();
|
|
12954
|
+
this.trxQueue.clear();
|
|
12955
|
+
}
|
|
12956
|
+
//
|
|
12957
|
+
// Actions
|
|
12958
|
+
//
|
|
12959
|
+
createPage(input) {
|
|
12960
|
+
void this.createPage(input);
|
|
12961
|
+
}
|
|
12962
|
+
createPagePromise(input) {
|
|
12963
|
+
this.localState.addPage({
|
|
12964
|
+
createdAt: /* @__PURE__ */ new Date(),
|
|
12965
|
+
parentPersistentId: input.parentPersistentId,
|
|
12966
|
+
persistentId: input.persistentId,
|
|
12967
|
+
shortPersistentId: generateShortPersistentId(),
|
|
12968
|
+
slug: slugify(input.title),
|
|
12969
|
+
meta: { name: input.title },
|
|
12970
|
+
updatedAt: /* @__PURE__ */ new Date(),
|
|
12971
|
+
data: { configuration: input.configuration },
|
|
12972
|
+
sortOrder: this.calculateSortOrder(input.parentPersistentId, input.afterPersistentId),
|
|
12973
|
+
designSystemVersionId: ""
|
|
12974
|
+
});
|
|
12975
|
+
const promise = this.trxQueue.enqueue({
|
|
12976
|
+
type: "DocumentationPageCreate",
|
|
12977
|
+
input: {
|
|
12978
|
+
persistentId: input.persistentId,
|
|
12979
|
+
parentPersistentId: input.parentPersistentId,
|
|
12980
|
+
title: input.title,
|
|
12981
|
+
afterPersistentId: input.afterPersistentId,
|
|
12982
|
+
configuration: input.configuration
|
|
12983
|
+
}
|
|
12984
|
+
});
|
|
12985
|
+
this.recalculateHierarchy();
|
|
12986
|
+
return promise;
|
|
12987
|
+
}
|
|
12988
|
+
//
|
|
12989
|
+
// Reactions
|
|
12990
|
+
//
|
|
12991
|
+
recalculateHierarchy() {
|
|
12992
|
+
const hierarchy = computeDocsHierarchy({
|
|
12993
|
+
approvals: this.yState.approvals,
|
|
12994
|
+
groups: this.yState.groups,
|
|
12995
|
+
groupSnapshots: this.yState.groupSnapshots,
|
|
12996
|
+
pageContentHashes: this.yState.pageContentHashes,
|
|
12997
|
+
pages: [...this.yState.pages, ...this.localState.getAllPages()],
|
|
12998
|
+
pageSnapshots: this.yState.pageSnapshots,
|
|
12999
|
+
settings: this.yState.settings
|
|
13000
|
+
});
|
|
13001
|
+
this.hierarchyObservers.forEach((o) => o(hierarchy));
|
|
13002
|
+
}
|
|
13003
|
+
onYUpdate() {
|
|
13004
|
+
this.yState = new VersionRoomBaseYDoc(this.yDoc).getState();
|
|
13005
|
+
this.recalculateHierarchy();
|
|
13006
|
+
}
|
|
13007
|
+
//
|
|
13008
|
+
// Utils
|
|
13009
|
+
//
|
|
13010
|
+
calculateSortOrder(parentPersistentId, afterPersistentId) {
|
|
13011
|
+
const sortOrderStep = Math.pow(2, 16);
|
|
13012
|
+
const neighbours = [
|
|
13013
|
+
...this.yState.pages.filter((p) => p.parentPersistentId === parentPersistentId),
|
|
13014
|
+
...this.yState.groups.filter((g) => g.parentPersistentId === parentPersistentId)
|
|
13015
|
+
];
|
|
13016
|
+
if (!neighbours.length)
|
|
13017
|
+
return 0;
|
|
13018
|
+
neighbours.sort((lhs, rhs) => lhs.sortOrder - rhs.sortOrder);
|
|
13019
|
+
if (!afterPersistentId)
|
|
13020
|
+
return neighbours[0].sortOrder - sortOrderStep;
|
|
13021
|
+
const index = neighbours.findIndex((e) => e.persistentId === afterPersistentId);
|
|
13022
|
+
if (index < 0 || index === neighbours.length - 1) {
|
|
13023
|
+
return neighbours[neighbours.length - 1].sortOrder + sortOrderStep;
|
|
13024
|
+
}
|
|
13025
|
+
const left = neighbours[index].sortOrder;
|
|
13026
|
+
const right = neighbours[index + 1]?.sortOrder ?? left + sortOrderStep * 2;
|
|
13027
|
+
return (right + left) / 2;
|
|
13028
|
+
}
|
|
13029
|
+
};
|
|
13030
|
+
var TransactionQueue = class {
|
|
13031
|
+
constructor(executor) {
|
|
13032
|
+
__publicField(this, "executor");
|
|
13033
|
+
__publicField(this, "queue", new PQueue({
|
|
13034
|
+
concurrency: 1
|
|
13035
|
+
}));
|
|
13036
|
+
this.executor = executor;
|
|
13037
|
+
}
|
|
13038
|
+
enqueue(trx) {
|
|
13039
|
+
return this.queue.add(() => this.executor(trx));
|
|
13040
|
+
}
|
|
13041
|
+
onEmpty() {
|
|
13042
|
+
return this.queue.onEmpty();
|
|
13043
|
+
}
|
|
13044
|
+
clear() {
|
|
13045
|
+
this.queue.clear();
|
|
13046
|
+
}
|
|
13047
|
+
};
|
|
12917
13048
|
export {
|
|
12918
13049
|
BackendVersionRoomYDoc,
|
|
12919
13050
|
BlockDefinitionUtils,
|
|
@@ -13033,10 +13164,8 @@ export {
|
|
|
13033
13164
|
DTODocumentationPageMoveActionOutputV2,
|
|
13034
13165
|
DTODocumentationPageRestoreActionInput,
|
|
13035
13166
|
DTODocumentationPageRestoreActionOutput,
|
|
13036
|
-
DTODocumentationPageRoom,
|
|
13037
13167
|
DTODocumentationPageRoomHeaderData,
|
|
13038
13168
|
DTODocumentationPageRoomHeaderDataUpdate,
|
|
13039
|
-
DTODocumentationPageRoomResponse,
|
|
13040
13169
|
DTODocumentationPageSnapshot,
|
|
13041
13170
|
DTODocumentationPageUpdateActionInputV2,
|
|
13042
13171
|
DTODocumentationPageUpdateActionOutputV2,
|
|
@@ -13211,6 +13340,8 @@ export {
|
|
|
13211
13340
|
DesignSystemVersionsEndpoint,
|
|
13212
13341
|
DesignSystemsEndpoint,
|
|
13213
13342
|
DimensionsVariableScopeType,
|
|
13343
|
+
DocsStructureRepo,
|
|
13344
|
+
DocsStructureRepository,
|
|
13214
13345
|
DocumentationEndpoint,
|
|
13215
13346
|
DocumentationHierarchySettings,
|
|
13216
13347
|
DocumentationPageEditorModel,
|
|
@@ -13228,6 +13359,7 @@ export {
|
|
|
13228
13359
|
FrontendVersionRoomYDoc,
|
|
13229
13360
|
ImportJobsEndpoint,
|
|
13230
13361
|
ListTreeBuilder,
|
|
13362
|
+
LocalStorage,
|
|
13231
13363
|
NpmRegistryInput,
|
|
13232
13364
|
ObjectMeta2 as ObjectMeta,
|
|
13233
13365
|
OverridesEndpoint,
|
|
@@ -13262,6 +13394,7 @@ export {
|
|
|
13262
13394
|
blockToProsemirrorNode,
|
|
13263
13395
|
buildDocPagePublishPaths,
|
|
13264
13396
|
calculateElementParentChain,
|
|
13397
|
+
computeDocsHierarchy,
|
|
13265
13398
|
documentationItemConfigurationToDTOV1,
|
|
13266
13399
|
documentationItemConfigurationToDTOV2,
|
|
13267
13400
|
documentationPageToDTOV2,
|