@supernova-studio/client 0.47.41 → 0.47.43
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 +5850 -264
- package/dist/index.d.ts +5850 -264
- package/dist/index.js +238 -89
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +581 -432
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/conversion/documentation/documentation-elements-to-hierarchy-v2-dto.ts +5 -3
- package/src/api/dto/elements/documentation/draft-state.ts +16 -0
- package/src/api/dto/elements/documentation/group-v2.ts +6 -1
- package/src/api/dto/elements/documentation/index.ts +1 -0
- package/src/api/dto/elements/documentation/page-v2.ts +10 -4
- package/src/yjs/design-system-content/documentation-hierarchy.ts +6 -144
- package/src/yjs/docs-editor/blocks-to-prosemirror.ts +1 -0
- package/src/yjs/docs-editor/prosemirror-to-blocks.ts +1 -0
- package/src/yjs/index.ts +1 -0
- package/src/yjs/version-room/backend.ts +42 -0
- package/src/yjs/version-room/base.ts +238 -0
- package/src/yjs/version-room/frontend.ts +34 -0
- package/src/yjs/version-room/index.ts +3 -0
package/dist/index.mjs
CHANGED
|
@@ -4353,11 +4353,13 @@ function documentationPageToStructureDTOV2(page, pagePathMap) {
|
|
|
4353
4353
|
}
|
|
4354
4354
|
|
|
4355
4355
|
// src/api/conversion/documentation/documentation-elements-to-hierarchy-v2-dto.ts
|
|
4356
|
-
function documentationElementsToHierarchyDto(docPages, docGroups,
|
|
4356
|
+
function documentationElementsToHierarchyDto(docPages, docGroups, routingVersion) {
|
|
4357
4357
|
return {
|
|
4358
4358
|
pages: documentationPagesToStructureDTOV2(docPages, docGroups, routingVersion),
|
|
4359
4359
|
groups: elementGroupsToDocumentationGroupStructureDTOV2(docGroups, docPages),
|
|
4360
|
-
|
|
4360
|
+
// TODO Artem
|
|
4361
|
+
deletedGroups: [],
|
|
4362
|
+
deletedPages: []
|
|
4361
4363
|
};
|
|
4362
4364
|
}
|
|
4363
4365
|
|
|
@@ -4964,10 +4966,7 @@ var DTODocumentationLinkPreviewRequest = z178.object({
|
|
|
4964
4966
|
documentationItemPersistentId: z178.string().optional()
|
|
4965
4967
|
});
|
|
4966
4968
|
|
|
4967
|
-
// src/api/dto/elements/documentation/
|
|
4968
|
-
import { z as z181 } from "zod";
|
|
4969
|
-
|
|
4970
|
-
// src/api/dto/elements/documentation/group-v2.ts
|
|
4969
|
+
// src/api/dto/elements/documentation/draft-state.ts
|
|
4971
4970
|
import { z as z180 } from "zod";
|
|
4972
4971
|
|
|
4973
4972
|
// src/api/dto/elements/documentation/item-configuration-v2.ts
|
|
@@ -4980,7 +4979,22 @@ var DTODocumentationItemConfigurationV2 = z179.object({
|
|
|
4980
4979
|
header: DTODocumentationItemHeaderV2
|
|
4981
4980
|
});
|
|
4982
4981
|
|
|
4982
|
+
// src/api/dto/elements/documentation/draft-state.ts
|
|
4983
|
+
var DTODocumentationDraftChangeType = z180.enum(["Created", "Updated", "Deleted"]);
|
|
4984
|
+
var DTODocumentationDraftState = z180.object({
|
|
4985
|
+
changeType: DTODocumentationDraftChangeType,
|
|
4986
|
+
changes: z180.object({
|
|
4987
|
+
previousTitle: z180.string().optional(),
|
|
4988
|
+
previousConfiguration: DTODocumentationItemConfigurationV2.optional(),
|
|
4989
|
+
previousContentHash: z180.string().optional()
|
|
4990
|
+
})
|
|
4991
|
+
});
|
|
4992
|
+
|
|
4993
|
+
// src/api/dto/elements/documentation/group-action.ts
|
|
4994
|
+
import { z as z182 } from "zod";
|
|
4995
|
+
|
|
4983
4996
|
// src/api/dto/elements/documentation/group-v2.ts
|
|
4997
|
+
import { z as z181 } from "zod";
|
|
4984
4998
|
var DTODocumentationGroupV2 = ElementGroup.omit({
|
|
4985
4999
|
sortOrder: true,
|
|
4986
5000
|
parentPersistentId: true,
|
|
@@ -4990,136 +5004,138 @@ var DTODocumentationGroupV2 = ElementGroup.omit({
|
|
|
4990
5004
|
data: true,
|
|
4991
5005
|
shortPersistentId: true
|
|
4992
5006
|
}).extend({
|
|
4993
|
-
title:
|
|
4994
|
-
isRoot:
|
|
4995
|
-
childrenIds:
|
|
5007
|
+
title: z181.string(),
|
|
5008
|
+
isRoot: z181.boolean(),
|
|
5009
|
+
childrenIds: z181.array(z181.string()),
|
|
4996
5010
|
groupBehavior: DocumentationGroupBehavior,
|
|
4997
|
-
shortPersistentId:
|
|
5011
|
+
shortPersistentId: z181.string(),
|
|
4998
5012
|
configuration: DTODocumentationItemConfigurationV2,
|
|
4999
|
-
type:
|
|
5013
|
+
type: z181.literal("Group"),
|
|
5014
|
+
/** Defined when a group has changed since last publish and can be included into a partial publish */
|
|
5015
|
+
draftState: DTODocumentationDraftState.optional()
|
|
5000
5016
|
});
|
|
5001
5017
|
var DTODocumentationGroupStructureV2 = DTODocumentationGroupV2;
|
|
5002
|
-
var DTOCreateDocumentationGroupInput =
|
|
5018
|
+
var DTOCreateDocumentationGroupInput = z181.object({
|
|
5003
5019
|
// Identifier
|
|
5004
|
-
persistentId:
|
|
5020
|
+
persistentId: z181.string().uuid(),
|
|
5005
5021
|
// Group properties
|
|
5006
|
-
title:
|
|
5022
|
+
title: z181.string(),
|
|
5007
5023
|
configuration: DTODocumentationItemConfigurationV2.partial().optional(),
|
|
5008
5024
|
// Group placement properties
|
|
5009
|
-
afterPersistentId:
|
|
5010
|
-
parentPersistentId:
|
|
5025
|
+
afterPersistentId: z181.string().uuid().nullish(),
|
|
5026
|
+
parentPersistentId: z181.string().uuid()
|
|
5011
5027
|
});
|
|
5012
|
-
var DTOUpdateDocumentationGroupInput =
|
|
5028
|
+
var DTOUpdateDocumentationGroupInput = z181.object({
|
|
5013
5029
|
// Identifier of the group to update
|
|
5014
|
-
id:
|
|
5030
|
+
id: z181.string(),
|
|
5015
5031
|
// Group properties
|
|
5016
|
-
title:
|
|
5032
|
+
title: z181.string().optional(),
|
|
5017
5033
|
configuration: DTODocumentationItemConfigurationV2.partial().optional()
|
|
5018
5034
|
});
|
|
5019
|
-
var DTOMoveDocumentationGroupInput =
|
|
5035
|
+
var DTOMoveDocumentationGroupInput = z181.object({
|
|
5020
5036
|
// Identifier of the group to update
|
|
5021
|
-
id:
|
|
5037
|
+
id: z181.string(),
|
|
5022
5038
|
// Group placement properties
|
|
5023
|
-
parentPersistentId:
|
|
5024
|
-
afterPersistentId:
|
|
5039
|
+
parentPersistentId: z181.string().uuid(),
|
|
5040
|
+
afterPersistentId: z181.string().uuid().nullish()
|
|
5025
5041
|
});
|
|
5026
|
-
var DTODuplicateDocumentationGroupInput =
|
|
5042
|
+
var DTODuplicateDocumentationGroupInput = z181.object({
|
|
5027
5043
|
// Identifier of the group to duplicate from
|
|
5028
|
-
id:
|
|
5044
|
+
id: z181.string(),
|
|
5029
5045
|
// New group persistent id
|
|
5030
|
-
persistentId:
|
|
5046
|
+
persistentId: z181.string().uuid(),
|
|
5031
5047
|
// Group placement properties
|
|
5032
|
-
afterPersistentId:
|
|
5033
|
-
parentPersistentId:
|
|
5048
|
+
afterPersistentId: z181.string().uuid().nullish(),
|
|
5049
|
+
parentPersistentId: z181.string().uuid()
|
|
5034
5050
|
});
|
|
5035
|
-
var DTOCreateDocumentationTabInput =
|
|
5051
|
+
var DTOCreateDocumentationTabInput = z181.object({
|
|
5036
5052
|
// New group persistent id
|
|
5037
|
-
persistentId:
|
|
5053
|
+
persistentId: z181.string().uuid(),
|
|
5038
5054
|
// If this is page, we will attempt to convert it to tab
|
|
5039
5055
|
// If this is tab group, we will add a new tab to it
|
|
5040
|
-
fromItemPersistentId:
|
|
5041
|
-
tabName:
|
|
5056
|
+
fromItemPersistentId: z181.string(),
|
|
5057
|
+
tabName: z181.string()
|
|
5042
5058
|
});
|
|
5043
|
-
var DTODeleteDocumentationTabGroupInput =
|
|
5059
|
+
var DTODeleteDocumentationTabGroupInput = z181.object({
|
|
5044
5060
|
// Deleted group id
|
|
5045
|
-
id:
|
|
5061
|
+
id: z181.string()
|
|
5046
5062
|
});
|
|
5047
|
-
var DTODeleteDocumentationGroupInput =
|
|
5063
|
+
var DTODeleteDocumentationGroupInput = z181.object({
|
|
5048
5064
|
// Identifier
|
|
5049
|
-
id:
|
|
5065
|
+
id: z181.string(),
|
|
5050
5066
|
// Deletion options
|
|
5051
|
-
deleteSubtree:
|
|
5067
|
+
deleteSubtree: z181.boolean().default(false)
|
|
5052
5068
|
});
|
|
5053
5069
|
|
|
5054
5070
|
// src/api/dto/elements/documentation/group-action.ts
|
|
5055
|
-
var SuccessPayload =
|
|
5056
|
-
success:
|
|
5071
|
+
var SuccessPayload = z182.object({
|
|
5072
|
+
success: z182.literal(true)
|
|
5057
5073
|
});
|
|
5058
|
-
var DTODocumentationGroupCreateActionOutputV2 =
|
|
5059
|
-
type:
|
|
5074
|
+
var DTODocumentationGroupCreateActionOutputV2 = z182.object({
|
|
5075
|
+
type: z182.literal("DocumentationGroupCreate"),
|
|
5060
5076
|
output: SuccessPayload
|
|
5061
5077
|
});
|
|
5062
|
-
var DTODocumentationTabCreateActionOutputV2 =
|
|
5063
|
-
type:
|
|
5078
|
+
var DTODocumentationTabCreateActionOutputV2 = z182.object({
|
|
5079
|
+
type: z182.literal("DocumentationTabCreate"),
|
|
5064
5080
|
output: SuccessPayload
|
|
5065
5081
|
});
|
|
5066
|
-
var DTODocumentationGroupUpdateActionOutputV2 =
|
|
5067
|
-
type:
|
|
5082
|
+
var DTODocumentationGroupUpdateActionOutputV2 = z182.object({
|
|
5083
|
+
type: z182.literal("DocumentationGroupUpdate"),
|
|
5068
5084
|
output: SuccessPayload
|
|
5069
5085
|
});
|
|
5070
|
-
var DTODocumentationGroupMoveActionOutputV2 =
|
|
5071
|
-
type:
|
|
5086
|
+
var DTODocumentationGroupMoveActionOutputV2 = z182.object({
|
|
5087
|
+
type: z182.literal("DocumentationGroupMove"),
|
|
5072
5088
|
output: SuccessPayload
|
|
5073
5089
|
});
|
|
5074
|
-
var DTODocumentationGroupDuplicateActionOutputV2 =
|
|
5075
|
-
type:
|
|
5090
|
+
var DTODocumentationGroupDuplicateActionOutputV2 = z182.object({
|
|
5091
|
+
type: z182.literal("DocumentationGroupDuplicate"),
|
|
5076
5092
|
output: SuccessPayload
|
|
5077
5093
|
});
|
|
5078
|
-
var DTODocumentationGroupDeleteActionOutputV2 =
|
|
5079
|
-
type:
|
|
5094
|
+
var DTODocumentationGroupDeleteActionOutputV2 = z182.object({
|
|
5095
|
+
type: z182.literal("DocumentationGroupDelete"),
|
|
5080
5096
|
output: SuccessPayload
|
|
5081
5097
|
});
|
|
5082
|
-
var DTODocumentationTabGroupDeleteActionOutputV2 =
|
|
5083
|
-
type:
|
|
5098
|
+
var DTODocumentationTabGroupDeleteActionOutputV2 = z182.object({
|
|
5099
|
+
type: z182.literal("DocumentationTabGroupDelete"),
|
|
5084
5100
|
output: SuccessPayload
|
|
5085
5101
|
});
|
|
5086
|
-
var DTODocumentationGroupCreateActionInputV2 =
|
|
5087
|
-
type:
|
|
5102
|
+
var DTODocumentationGroupCreateActionInputV2 = z182.object({
|
|
5103
|
+
type: z182.literal("DocumentationGroupCreate"),
|
|
5088
5104
|
input: DTOCreateDocumentationGroupInput
|
|
5089
5105
|
});
|
|
5090
|
-
var DTODocumentationTabCreateActionInputV2 =
|
|
5091
|
-
type:
|
|
5106
|
+
var DTODocumentationTabCreateActionInputV2 = z182.object({
|
|
5107
|
+
type: z182.literal("DocumentationTabCreate"),
|
|
5092
5108
|
input: DTOCreateDocumentationTabInput
|
|
5093
5109
|
});
|
|
5094
|
-
var DTODocumentationGroupUpdateActionInputV2 =
|
|
5095
|
-
type:
|
|
5110
|
+
var DTODocumentationGroupUpdateActionInputV2 = z182.object({
|
|
5111
|
+
type: z182.literal("DocumentationGroupUpdate"),
|
|
5096
5112
|
input: DTOUpdateDocumentationGroupInput
|
|
5097
5113
|
});
|
|
5098
|
-
var DTODocumentationGroupMoveActionInputV2 =
|
|
5099
|
-
type:
|
|
5114
|
+
var DTODocumentationGroupMoveActionInputV2 = z182.object({
|
|
5115
|
+
type: z182.literal("DocumentationGroupMove"),
|
|
5100
5116
|
input: DTOMoveDocumentationGroupInput
|
|
5101
5117
|
});
|
|
5102
|
-
var DTODocumentationGroupDuplicateActionInputV2 =
|
|
5103
|
-
type:
|
|
5118
|
+
var DTODocumentationGroupDuplicateActionInputV2 = z182.object({
|
|
5119
|
+
type: z182.literal("DocumentationGroupDuplicate"),
|
|
5104
5120
|
input: DTODuplicateDocumentationGroupInput
|
|
5105
5121
|
});
|
|
5106
|
-
var DTODocumentationGroupDeleteActionInputV2 =
|
|
5107
|
-
type:
|
|
5122
|
+
var DTODocumentationGroupDeleteActionInputV2 = z182.object({
|
|
5123
|
+
type: z182.literal("DocumentationGroupDelete"),
|
|
5108
5124
|
input: DTODeleteDocumentationGroupInput
|
|
5109
5125
|
});
|
|
5110
|
-
var DTODocumentationTabGroupDeleteActionInputV2 =
|
|
5111
|
-
type:
|
|
5126
|
+
var DTODocumentationTabGroupDeleteActionInputV2 = z182.object({
|
|
5127
|
+
type: z182.literal("DocumentationTabGroupDelete"),
|
|
5112
5128
|
input: DTODeleteDocumentationTabGroupInput
|
|
5113
5129
|
});
|
|
5114
5130
|
|
|
5115
5131
|
// src/api/dto/elements/documentation/group-v1.ts
|
|
5116
|
-
import { z as
|
|
5132
|
+
import { z as z184 } from "zod";
|
|
5117
5133
|
|
|
5118
5134
|
// src/api/dto/elements/documentation/item-configuration-v1.ts
|
|
5119
|
-
import { z as
|
|
5120
|
-
var DocumentationColorV1 =
|
|
5121
|
-
aliasTo:
|
|
5122
|
-
value:
|
|
5135
|
+
import { z as z183 } from "zod";
|
|
5136
|
+
var DocumentationColorV1 = z183.object({
|
|
5137
|
+
aliasTo: z183.string().optional(),
|
|
5138
|
+
value: z183.string().optional()
|
|
5123
5139
|
});
|
|
5124
5140
|
var DTODocumentationItemHeaderV1 = DocumentationItemHeaderV1.omit({
|
|
5125
5141
|
foregroundColor: true,
|
|
@@ -5128,10 +5144,10 @@ var DTODocumentationItemHeaderV1 = DocumentationItemHeaderV1.omit({
|
|
|
5128
5144
|
foregroundColor: DocumentationColorV1.optional(),
|
|
5129
5145
|
backgroundColor: DocumentationColorV1.optional()
|
|
5130
5146
|
});
|
|
5131
|
-
var DTODocumentationItemConfigurationV1 =
|
|
5132
|
-
showSidebar:
|
|
5133
|
-
isPrivate:
|
|
5134
|
-
isHidden:
|
|
5147
|
+
var DTODocumentationItemConfigurationV1 = z183.object({
|
|
5148
|
+
showSidebar: z183.boolean(),
|
|
5149
|
+
isPrivate: z183.boolean(),
|
|
5150
|
+
isHidden: z183.boolean(),
|
|
5135
5151
|
header: DTODocumentationItemHeaderV1
|
|
5136
5152
|
});
|
|
5137
5153
|
|
|
@@ -5145,131 +5161,134 @@ var DTODocumentationGroupStructureV1 = ElementGroup.omit({
|
|
|
5145
5161
|
data: true,
|
|
5146
5162
|
shortPersistentId: true
|
|
5147
5163
|
}).extend({
|
|
5148
|
-
title:
|
|
5149
|
-
isRoot:
|
|
5150
|
-
childrenIds:
|
|
5164
|
+
title: z184.string(),
|
|
5165
|
+
isRoot: z184.boolean(),
|
|
5166
|
+
childrenIds: z184.array(z184.string()),
|
|
5151
5167
|
groupBehavior: DocumentationGroupBehavior,
|
|
5152
|
-
shortPersistentId:
|
|
5153
|
-
type:
|
|
5168
|
+
shortPersistentId: z184.string(),
|
|
5169
|
+
type: z184.literal("Group")
|
|
5154
5170
|
});
|
|
5155
5171
|
var DTODocumentationGroupV1 = DTODocumentationGroupStructureV1.extend({
|
|
5156
5172
|
configuration: DTODocumentationItemConfigurationV1
|
|
5157
5173
|
});
|
|
5158
5174
|
|
|
5159
5175
|
// src/api/dto/elements/documentation/page-actions-v2.ts
|
|
5160
|
-
import { z as
|
|
5176
|
+
import { z as z186 } from "zod";
|
|
5161
5177
|
|
|
5162
5178
|
// src/api/dto/elements/documentation/page-v2.ts
|
|
5163
|
-
import { z as
|
|
5179
|
+
import { z as z185 } from "zod";
|
|
5164
5180
|
var DTODocumentationPageV2 = DocumentationPageV2.omit({
|
|
5165
5181
|
data: true,
|
|
5166
5182
|
meta: true,
|
|
5167
5183
|
parentPersistentId: true,
|
|
5168
5184
|
sortOrder: true
|
|
5169
5185
|
}).extend({
|
|
5170
|
-
title:
|
|
5171
|
-
path:
|
|
5172
|
-
type:
|
|
5173
|
-
configuration: DTODocumentationItemConfigurationV2
|
|
5186
|
+
title: z185.string(),
|
|
5187
|
+
path: z185.string(),
|
|
5188
|
+
type: z185.literal("Page"),
|
|
5189
|
+
configuration: DTODocumentationItemConfigurationV2,
|
|
5190
|
+
/** Defined when a page has changed since last publish and can be included into a partial publish */
|
|
5191
|
+
draftState: DTODocumentationDraftState.optional()
|
|
5174
5192
|
});
|
|
5175
5193
|
var DTODocumentationPageStructureV2 = DTODocumentationPageV2;
|
|
5176
|
-
var DTODocumentationHierarchyV2 =
|
|
5177
|
-
pages:
|
|
5178
|
-
groups:
|
|
5179
|
-
|
|
5194
|
+
var DTODocumentationHierarchyV2 = z185.object({
|
|
5195
|
+
pages: z185.array(DTODocumentationPageStructureV2),
|
|
5196
|
+
groups: z185.array(DTODocumentationGroupStructureV2),
|
|
5197
|
+
deletedPages: z185.array(DTODocumentationPageStructureV2),
|
|
5198
|
+
deletedGroups: z185.array(DTODocumentationGroupStructureV2)
|
|
5180
5199
|
});
|
|
5181
|
-
var DTOCreateDocumentationPageInputV2 =
|
|
5200
|
+
var DTOCreateDocumentationPageInputV2 = z185.object({
|
|
5182
5201
|
// Identifier
|
|
5183
|
-
persistentId:
|
|
5202
|
+
persistentId: z185.string().uuid(),
|
|
5184
5203
|
// Page properties
|
|
5185
|
-
title:
|
|
5204
|
+
title: z185.string(),
|
|
5186
5205
|
configuration: DTODocumentationItemConfigurationV2.partial().optional(),
|
|
5187
5206
|
// Page placement properties
|
|
5188
|
-
parentPersistentId:
|
|
5189
|
-
afterPersistentId:
|
|
5207
|
+
parentPersistentId: z185.string().uuid(),
|
|
5208
|
+
afterPersistentId: z185.string().uuid().nullish()
|
|
5190
5209
|
});
|
|
5191
|
-
var DTOUpdateDocumentationPageInputV2 =
|
|
5210
|
+
var DTOUpdateDocumentationPageInputV2 = z185.object({
|
|
5192
5211
|
// Identifier of the group to update
|
|
5193
|
-
id:
|
|
5212
|
+
id: z185.string(),
|
|
5194
5213
|
// Page properties
|
|
5195
|
-
title:
|
|
5214
|
+
title: z185.string().optional(),
|
|
5196
5215
|
configuration: DTODocumentationItemConfigurationV2.partial().optional()
|
|
5197
5216
|
});
|
|
5198
|
-
var DTOMoveDocumentationPageInputV2 =
|
|
5217
|
+
var DTOMoveDocumentationPageInputV2 = z185.object({
|
|
5199
5218
|
// Identifier of the group to update
|
|
5200
|
-
id:
|
|
5219
|
+
id: z185.string(),
|
|
5201
5220
|
// Page placement properties
|
|
5202
|
-
parentPersistentId:
|
|
5203
|
-
afterPersistentId:
|
|
5221
|
+
parentPersistentId: z185.string().uuid(),
|
|
5222
|
+
afterPersistentId: z185.string().uuid().nullish()
|
|
5204
5223
|
});
|
|
5205
|
-
var DTODuplicateDocumentationPageInputV2 =
|
|
5224
|
+
var DTODuplicateDocumentationPageInputV2 = z185.object({
|
|
5206
5225
|
// Identifier of the page to duplicate from
|
|
5207
|
-
id:
|
|
5226
|
+
id: z185.string(),
|
|
5208
5227
|
// New page persistent id
|
|
5209
|
-
persistentId:
|
|
5228
|
+
persistentId: z185.string().uuid(),
|
|
5210
5229
|
// Page placement properties
|
|
5211
|
-
parentPersistentId:
|
|
5212
|
-
afterPersistentId:
|
|
5230
|
+
parentPersistentId: z185.string().uuid(),
|
|
5231
|
+
afterPersistentId: z185.string().uuid().nullish()
|
|
5213
5232
|
});
|
|
5214
|
-
var DTODeleteDocumentationPageInputV2 =
|
|
5233
|
+
var DTODeleteDocumentationPageInputV2 = z185.object({
|
|
5215
5234
|
// Identifier
|
|
5216
|
-
id:
|
|
5235
|
+
id: z185.string()
|
|
5217
5236
|
});
|
|
5218
5237
|
|
|
5219
5238
|
// src/api/dto/elements/documentation/page-actions-v2.ts
|
|
5220
|
-
var SuccessPayload2 =
|
|
5221
|
-
success:
|
|
5239
|
+
var SuccessPayload2 = z186.object({
|
|
5240
|
+
success: z186.literal(true)
|
|
5222
5241
|
});
|
|
5223
|
-
var DTODocumentationPageCreateActionOutputV2 =
|
|
5224
|
-
type:
|
|
5242
|
+
var DTODocumentationPageCreateActionOutputV2 = z186.object({
|
|
5243
|
+
type: z186.literal("DocumentationPageCreate"),
|
|
5225
5244
|
output: SuccessPayload2
|
|
5226
5245
|
});
|
|
5227
|
-
var DTODocumentationPageUpdateActionOutputV2 =
|
|
5228
|
-
type:
|
|
5246
|
+
var DTODocumentationPageUpdateActionOutputV2 = z186.object({
|
|
5247
|
+
type: z186.literal("DocumentationPageUpdate"),
|
|
5229
5248
|
output: SuccessPayload2
|
|
5230
5249
|
});
|
|
5231
|
-
var DTODocumentationPageMoveActionOutputV2 =
|
|
5232
|
-
type:
|
|
5250
|
+
var DTODocumentationPageMoveActionOutputV2 = z186.object({
|
|
5251
|
+
type: z186.literal("DocumentationPageMove"),
|
|
5233
5252
|
output: SuccessPayload2
|
|
5234
5253
|
});
|
|
5235
|
-
var DTODocumentationPageDuplicateActionOutputV2 =
|
|
5236
|
-
type:
|
|
5254
|
+
var DTODocumentationPageDuplicateActionOutputV2 = z186.object({
|
|
5255
|
+
type: z186.literal("DocumentationPageDuplicate"),
|
|
5237
5256
|
output: SuccessPayload2
|
|
5238
5257
|
});
|
|
5239
|
-
var DTODocumentationPageDeleteActionOutputV2 =
|
|
5240
|
-
type:
|
|
5258
|
+
var DTODocumentationPageDeleteActionOutputV2 = z186.object({
|
|
5259
|
+
type: z186.literal("DocumentationPageDelete"),
|
|
5241
5260
|
output: SuccessPayload2
|
|
5242
5261
|
});
|
|
5243
|
-
var DTODocumentationPageCreateActionInputV2 =
|
|
5244
|
-
type:
|
|
5262
|
+
var DTODocumentationPageCreateActionInputV2 = z186.object({
|
|
5263
|
+
type: z186.literal("DocumentationPageCreate"),
|
|
5245
5264
|
input: DTOCreateDocumentationPageInputV2
|
|
5246
5265
|
});
|
|
5247
|
-
var DTODocumentationPageUpdateActionInputV2 =
|
|
5248
|
-
type:
|
|
5266
|
+
var DTODocumentationPageUpdateActionInputV2 = z186.object({
|
|
5267
|
+
type: z186.literal("DocumentationPageUpdate"),
|
|
5249
5268
|
input: DTOUpdateDocumentationPageInputV2
|
|
5250
5269
|
});
|
|
5251
|
-
var DTODocumentationPageMoveActionInputV2 =
|
|
5252
|
-
type:
|
|
5270
|
+
var DTODocumentationPageMoveActionInputV2 = z186.object({
|
|
5271
|
+
type: z186.literal("DocumentationPageMove"),
|
|
5253
5272
|
input: DTOMoveDocumentationPageInputV2
|
|
5254
5273
|
});
|
|
5255
|
-
var DTODocumentationPageDuplicateActionInputV2 =
|
|
5256
|
-
type:
|
|
5274
|
+
var DTODocumentationPageDuplicateActionInputV2 = z186.object({
|
|
5275
|
+
type: z186.literal("DocumentationPageDuplicate"),
|
|
5257
5276
|
input: DTODuplicateDocumentationPageInputV2
|
|
5258
5277
|
});
|
|
5259
|
-
var DTODocumentationPageDeleteActionInputV2 =
|
|
5260
|
-
type:
|
|
5278
|
+
var DTODocumentationPageDeleteActionInputV2 = z186.object({
|
|
5279
|
+
type: z186.literal("DocumentationPageDelete"),
|
|
5261
5280
|
input: DTODeleteDocumentationPageInputV2
|
|
5262
5281
|
});
|
|
5263
5282
|
|
|
5264
5283
|
// src/api/dto/elements/documentation/page-content.ts
|
|
5265
|
-
import { z as
|
|
5284
|
+
import { z as z187 } from "zod";
|
|
5266
5285
|
var DTODocumentationPageContent = DocumentationPageContent;
|
|
5267
|
-
var DTODocumentationPageContentGetResponse =
|
|
5286
|
+
var DTODocumentationPageContentGetResponse = z187.object({
|
|
5268
5287
|
pageContent: DTODocumentationPageContent
|
|
5269
5288
|
});
|
|
5270
5289
|
|
|
5271
5290
|
// src/api/dto/elements/documentation/page-v1.ts
|
|
5272
|
-
import { z as
|
|
5291
|
+
import { z as z188 } from "zod";
|
|
5273
5292
|
var DocumentationPageV1DTO = DocumentationPageV1.omit({
|
|
5274
5293
|
data: true,
|
|
5275
5294
|
meta: true,
|
|
@@ -5277,30 +5296,30 @@ var DocumentationPageV1DTO = DocumentationPageV1.omit({
|
|
|
5277
5296
|
sortOrder: true
|
|
5278
5297
|
}).extend({
|
|
5279
5298
|
configuration: DTODocumentationItemConfigurationV1,
|
|
5280
|
-
blocks:
|
|
5281
|
-
title:
|
|
5282
|
-
path:
|
|
5299
|
+
blocks: z188.array(PageBlockV1),
|
|
5300
|
+
title: z188.string(),
|
|
5301
|
+
path: z188.string()
|
|
5283
5302
|
});
|
|
5284
5303
|
|
|
5285
5304
|
// src/api/dto/elements/figma-nodes/figma-node.ts
|
|
5286
|
-
import { z as
|
|
5287
|
-
var DTOFigmaNodeOrigin =
|
|
5288
|
-
sourceId:
|
|
5289
|
-
fileId:
|
|
5290
|
-
parentName:
|
|
5305
|
+
import { z as z189 } from "zod";
|
|
5306
|
+
var DTOFigmaNodeOrigin = z189.object({
|
|
5307
|
+
sourceId: z189.string(),
|
|
5308
|
+
fileId: z189.string().optional(),
|
|
5309
|
+
parentName: z189.string().optional()
|
|
5291
5310
|
});
|
|
5292
|
-
var DTOFigmaNodeData =
|
|
5311
|
+
var DTOFigmaNodeData = z189.object({
|
|
5293
5312
|
// Id of the node in the Figma file
|
|
5294
|
-
figmaNodeId:
|
|
5313
|
+
figmaNodeId: z189.string(),
|
|
5295
5314
|
// Validity
|
|
5296
|
-
isValid:
|
|
5315
|
+
isValid: z189.boolean(),
|
|
5297
5316
|
// Asset data
|
|
5298
|
-
assetId:
|
|
5299
|
-
assetUrl:
|
|
5317
|
+
assetId: z189.string(),
|
|
5318
|
+
assetUrl: z189.string(),
|
|
5300
5319
|
// Asset metadata
|
|
5301
|
-
assetScale:
|
|
5302
|
-
assetWidth:
|
|
5303
|
-
assetHeight:
|
|
5320
|
+
assetScale: z189.number(),
|
|
5321
|
+
assetWidth: z189.number().optional(),
|
|
5322
|
+
assetHeight: z189.number().optional()
|
|
5304
5323
|
});
|
|
5305
5324
|
var DTOFigmaNode = FigmaFileStructure.omit({
|
|
5306
5325
|
data: true,
|
|
@@ -5309,105 +5328,105 @@ var DTOFigmaNode = FigmaFileStructure.omit({
|
|
|
5309
5328
|
data: DTOFigmaNodeData,
|
|
5310
5329
|
origin: DTOFigmaNodeOrigin
|
|
5311
5330
|
});
|
|
5312
|
-
var DTOFigmaNodeRenderInput =
|
|
5331
|
+
var DTOFigmaNodeRenderInput = z189.object({
|
|
5313
5332
|
// Id of a design system's data source representing a linked Figma file
|
|
5314
|
-
sourceId:
|
|
5333
|
+
sourceId: z189.string(),
|
|
5315
5334
|
// Id of a node within the Figma file
|
|
5316
|
-
figmaFileNodeId:
|
|
5335
|
+
figmaFileNodeId: z189.string()
|
|
5317
5336
|
});
|
|
5318
5337
|
|
|
5319
5338
|
// src/api/dto/elements/figma-nodes/node-actions-v2.ts
|
|
5320
|
-
import { z as
|
|
5321
|
-
var DTOFigmaNodeRenderActionOutput =
|
|
5322
|
-
type:
|
|
5323
|
-
figmaNodes:
|
|
5339
|
+
import { z as z190 } from "zod";
|
|
5340
|
+
var DTOFigmaNodeRenderActionOutput = z190.object({
|
|
5341
|
+
type: z190.literal("FigmaNodeRender"),
|
|
5342
|
+
figmaNodes: z190.array(DTOFigmaNode)
|
|
5324
5343
|
});
|
|
5325
|
-
var DTOFigmaNodeRenderActionInput =
|
|
5326
|
-
type:
|
|
5344
|
+
var DTOFigmaNodeRenderActionInput = z190.object({
|
|
5345
|
+
type: z190.literal("FigmaNodeRender"),
|
|
5327
5346
|
input: DTOFigmaNodeRenderInput.array()
|
|
5328
5347
|
});
|
|
5329
5348
|
|
|
5330
5349
|
// src/api/dto/elements/properties/property-definitions-actions-v2.ts
|
|
5331
|
-
import { z as
|
|
5350
|
+
import { z as z192 } from "zod";
|
|
5332
5351
|
|
|
5333
5352
|
// src/api/dto/elements/properties/property-definitions.ts
|
|
5334
|
-
import { z as
|
|
5353
|
+
import { z as z191 } from "zod";
|
|
5335
5354
|
var CODE_NAME_REGEX2 = /^[a-zA-Z_$][a-zA-Z_$0-9]{1,99}$/;
|
|
5336
|
-
var DTOElementPropertyDefinition =
|
|
5337
|
-
id:
|
|
5338
|
-
designSystemVersionId:
|
|
5355
|
+
var DTOElementPropertyDefinition = z191.object({
|
|
5356
|
+
id: z191.string(),
|
|
5357
|
+
designSystemVersionId: z191.string(),
|
|
5339
5358
|
meta: ObjectMeta,
|
|
5340
|
-
persistentId:
|
|
5359
|
+
persistentId: z191.string(),
|
|
5341
5360
|
type: ElementPropertyTypeSchema,
|
|
5342
5361
|
targetElementType: ElementPropertyTargetType,
|
|
5343
|
-
codeName:
|
|
5344
|
-
options:
|
|
5362
|
+
codeName: z191.string().regex(CODE_NAME_REGEX2),
|
|
5363
|
+
options: z191.array(ElementPropertyDefinitionOption).optional(),
|
|
5345
5364
|
linkElementType: ElementPropertyLinkType.optional()
|
|
5346
5365
|
});
|
|
5347
|
-
var DTOElementPropertyDefinitionsGetResponse =
|
|
5348
|
-
definitions:
|
|
5366
|
+
var DTOElementPropertyDefinitionsGetResponse = z191.object({
|
|
5367
|
+
definitions: z191.array(DTOElementPropertyDefinition)
|
|
5349
5368
|
});
|
|
5350
5369
|
var DTOCreateElementPropertyDefinitionInputV2 = DTOElementPropertyDefinition.omit({
|
|
5351
5370
|
id: true,
|
|
5352
5371
|
designSystemVersionId: true
|
|
5353
5372
|
});
|
|
5354
|
-
var DTOUpdateElementPropertyDefinitionInputV2 =
|
|
5355
|
-
id:
|
|
5356
|
-
name:
|
|
5357
|
-
description:
|
|
5358
|
-
codeName:
|
|
5359
|
-
options:
|
|
5373
|
+
var DTOUpdateElementPropertyDefinitionInputV2 = z191.object({
|
|
5374
|
+
id: z191.string(),
|
|
5375
|
+
name: z191.string().optional(),
|
|
5376
|
+
description: z191.string().optional(),
|
|
5377
|
+
codeName: z191.string().regex(CODE_NAME_REGEX2).optional(),
|
|
5378
|
+
options: z191.array(ElementPropertyDefinitionOption).optional()
|
|
5360
5379
|
});
|
|
5361
|
-
var DTODeleteElementPropertyDefinitionInputV2 =
|
|
5362
|
-
id:
|
|
5380
|
+
var DTODeleteElementPropertyDefinitionInputV2 = z191.object({
|
|
5381
|
+
id: z191.string()
|
|
5363
5382
|
});
|
|
5364
5383
|
|
|
5365
5384
|
// src/api/dto/elements/properties/property-definitions-actions-v2.ts
|
|
5366
|
-
var SuccessPayload3 =
|
|
5367
|
-
success:
|
|
5385
|
+
var SuccessPayload3 = z192.object({
|
|
5386
|
+
success: z192.literal(true)
|
|
5368
5387
|
});
|
|
5369
|
-
var DTOPropertyDefinitionCreateActionOutputV2 =
|
|
5370
|
-
type:
|
|
5388
|
+
var DTOPropertyDefinitionCreateActionOutputV2 = z192.object({
|
|
5389
|
+
type: z192.literal("PropertyDefinitionCreate"),
|
|
5371
5390
|
definition: DTOElementPropertyDefinition
|
|
5372
5391
|
});
|
|
5373
|
-
var DTOPropertyDefinitionUpdateActionOutputV2 =
|
|
5374
|
-
type:
|
|
5392
|
+
var DTOPropertyDefinitionUpdateActionOutputV2 = z192.object({
|
|
5393
|
+
type: z192.literal("PropertyDefinitionUpdate"),
|
|
5375
5394
|
definition: DTOElementPropertyDefinition
|
|
5376
5395
|
});
|
|
5377
|
-
var DTOPropertyDefinitionDeleteActionOutputV2 =
|
|
5378
|
-
type:
|
|
5396
|
+
var DTOPropertyDefinitionDeleteActionOutputV2 = z192.object({
|
|
5397
|
+
type: z192.literal("PropertyDefinitionDelete"),
|
|
5379
5398
|
output: SuccessPayload3
|
|
5380
5399
|
});
|
|
5381
|
-
var DTOPropertyDefinitionCreateActionInputV2 =
|
|
5382
|
-
type:
|
|
5400
|
+
var DTOPropertyDefinitionCreateActionInputV2 = z192.object({
|
|
5401
|
+
type: z192.literal("PropertyDefinitionCreate"),
|
|
5383
5402
|
input: DTOCreateElementPropertyDefinitionInputV2
|
|
5384
5403
|
});
|
|
5385
|
-
var DTOPropertyDefinitionUpdateActionInputV2 =
|
|
5386
|
-
type:
|
|
5404
|
+
var DTOPropertyDefinitionUpdateActionInputV2 = z192.object({
|
|
5405
|
+
type: z192.literal("PropertyDefinitionUpdate"),
|
|
5387
5406
|
input: DTOUpdateElementPropertyDefinitionInputV2
|
|
5388
5407
|
});
|
|
5389
|
-
var DTOPropertyDefinitionDeleteActionInputV2 =
|
|
5390
|
-
type:
|
|
5408
|
+
var DTOPropertyDefinitionDeleteActionInputV2 = z192.object({
|
|
5409
|
+
type: z192.literal("PropertyDefinitionDelete"),
|
|
5391
5410
|
input: DTODeleteElementPropertyDefinitionInputV2
|
|
5392
5411
|
});
|
|
5393
5412
|
|
|
5394
5413
|
// src/api/dto/elements/properties/property-values.ts
|
|
5395
|
-
import { z as
|
|
5396
|
-
var DTOElementPropertyValue =
|
|
5397
|
-
id:
|
|
5398
|
-
designSystemVersionId:
|
|
5399
|
-
definitionId:
|
|
5400
|
-
targetElementId:
|
|
5401
|
-
value:
|
|
5402
|
-
valuePreview:
|
|
5414
|
+
import { z as z193 } from "zod";
|
|
5415
|
+
var DTOElementPropertyValue = z193.object({
|
|
5416
|
+
id: z193.string(),
|
|
5417
|
+
designSystemVersionId: z193.string(),
|
|
5418
|
+
definitionId: z193.string(),
|
|
5419
|
+
targetElementId: z193.string(),
|
|
5420
|
+
value: z193.union([z193.string(), z193.number(), z193.boolean()]).optional(),
|
|
5421
|
+
valuePreview: z193.string().optional()
|
|
5403
5422
|
});
|
|
5404
|
-
var DTOElementPropertyValuesGetResponse =
|
|
5405
|
-
values:
|
|
5423
|
+
var DTOElementPropertyValuesGetResponse = z193.object({
|
|
5424
|
+
values: z193.array(DTOElementPropertyValue)
|
|
5406
5425
|
});
|
|
5407
5426
|
|
|
5408
5427
|
// src/api/dto/elements/elements-action-v2.ts
|
|
5409
|
-
import { z as
|
|
5410
|
-
var DTOElementActionOutput =
|
|
5428
|
+
import { z as z194 } from "zod";
|
|
5429
|
+
var DTOElementActionOutput = z194.discriminatedUnion("type", [
|
|
5411
5430
|
// Documentation pages
|
|
5412
5431
|
DTODocumentationPageCreateActionOutputV2,
|
|
5413
5432
|
DTODocumentationPageUpdateActionOutputV2,
|
|
@@ -5429,7 +5448,7 @@ var DTOElementActionOutput = z193.discriminatedUnion("type", [
|
|
|
5429
5448
|
DTOPropertyDefinitionUpdateActionOutputV2,
|
|
5430
5449
|
DTOPropertyDefinitionDeleteActionOutputV2
|
|
5431
5450
|
]);
|
|
5432
|
-
var DTOElementActionInput =
|
|
5451
|
+
var DTOElementActionInput = z194.discriminatedUnion("type", [
|
|
5433
5452
|
// Documentation pages
|
|
5434
5453
|
DTODocumentationPageCreateActionInputV2,
|
|
5435
5454
|
DTODocumentationPageUpdateActionInputV2,
|
|
@@ -5453,220 +5472,220 @@ var DTOElementActionInput = z193.discriminatedUnion("type", [
|
|
|
5453
5472
|
]);
|
|
5454
5473
|
|
|
5455
5474
|
// src/api/dto/elements/get-elements-v2.ts
|
|
5456
|
-
import { z as
|
|
5457
|
-
var DTOElementsGetTypeFilter =
|
|
5458
|
-
var DTOElementsGetQuerySchema =
|
|
5459
|
-
types:
|
|
5475
|
+
import { z as z195 } from "zod";
|
|
5476
|
+
var DTOElementsGetTypeFilter = z195.enum(["FigmaNode"]);
|
|
5477
|
+
var DTOElementsGetQuerySchema = z195.object({
|
|
5478
|
+
types: z195.string().transform((val) => val.split(",").map((v) => DTOElementsGetTypeFilter.parse(v)))
|
|
5460
5479
|
});
|
|
5461
|
-
var DTOElementsGetOutput =
|
|
5462
|
-
figmaNodes:
|
|
5480
|
+
var DTOElementsGetOutput = z195.object({
|
|
5481
|
+
figmaNodes: z195.array(DTOFigmaNode).optional()
|
|
5463
5482
|
});
|
|
5464
5483
|
|
|
5465
5484
|
// src/api/dto/export/exporter.ts
|
|
5466
|
-
import { z as
|
|
5467
|
-
var DTOExporterType =
|
|
5468
|
-
var DTOExporterSource =
|
|
5469
|
-
var DTOExporterMembershipRole =
|
|
5470
|
-
var DTOExporter =
|
|
5471
|
-
id:
|
|
5472
|
-
name:
|
|
5473
|
-
isPrivate:
|
|
5485
|
+
import { z as z196 } from "zod";
|
|
5486
|
+
var DTOExporterType = z196.enum(["documentation", "code"]);
|
|
5487
|
+
var DTOExporterSource = z196.enum(["git", "upload"]);
|
|
5488
|
+
var DTOExporterMembershipRole = z196.enum(["Owner", "OwnerArchived", "User"]);
|
|
5489
|
+
var DTOExporter = z196.object({
|
|
5490
|
+
id: z196.string(),
|
|
5491
|
+
name: z196.string(),
|
|
5492
|
+
isPrivate: z196.boolean(),
|
|
5474
5493
|
exporterType: DTOExporterType,
|
|
5475
|
-
isDefaultDocumentationExporter:
|
|
5476
|
-
iconURL:
|
|
5494
|
+
isDefaultDocumentationExporter: z196.boolean(),
|
|
5495
|
+
iconURL: z196.string().optional(),
|
|
5477
5496
|
configurationProperties: PulsarContributionConfigurationProperty.array(),
|
|
5478
5497
|
customBlocks: PulsarCustomBlock.array(),
|
|
5479
|
-
blockVariants:
|
|
5480
|
-
usesBrands:
|
|
5481
|
-
usesThemes:
|
|
5498
|
+
blockVariants: z196.record(z196.string(), PulsarContributionVariant.array()),
|
|
5499
|
+
usesBrands: z196.boolean(),
|
|
5500
|
+
usesThemes: z196.boolean(),
|
|
5482
5501
|
source: DTOExporterSource,
|
|
5483
|
-
gitUrl:
|
|
5484
|
-
gitBranch:
|
|
5485
|
-
gitDirectory:
|
|
5502
|
+
gitUrl: z196.string().optional(),
|
|
5503
|
+
gitBranch: z196.string().optional(),
|
|
5504
|
+
gitDirectory: z196.string().optional()
|
|
5486
5505
|
});
|
|
5487
|
-
var DTOExporterMembership =
|
|
5488
|
-
workspaceId:
|
|
5489
|
-
exporterId:
|
|
5506
|
+
var DTOExporterMembership = z196.object({
|
|
5507
|
+
workspaceId: z196.string(),
|
|
5508
|
+
exporterId: z196.string(),
|
|
5490
5509
|
role: DTOExporterMembershipRole
|
|
5491
5510
|
});
|
|
5492
|
-
var DTOExporterCreateOutput =
|
|
5511
|
+
var DTOExporterCreateOutput = z196.object({
|
|
5493
5512
|
exporter: DTOExporter,
|
|
5494
5513
|
membership: DTOExporterMembership
|
|
5495
5514
|
});
|
|
5496
|
-
var DTOExporterGitProviderEnum =
|
|
5497
|
-
var DTOExporterCreateInput =
|
|
5498
|
-
url:
|
|
5515
|
+
var DTOExporterGitProviderEnum = z196.enum(["github", "gitlab", "bitbucket", "azure"]);
|
|
5516
|
+
var DTOExporterCreateInput = z196.object({
|
|
5517
|
+
url: z196.string(),
|
|
5499
5518
|
provider: DTOExporterGitProviderEnum
|
|
5500
5519
|
});
|
|
5501
|
-
var DTOExporterUpdateInput =
|
|
5502
|
-
url:
|
|
5520
|
+
var DTOExporterUpdateInput = z196.object({
|
|
5521
|
+
url: z196.string().optional()
|
|
5503
5522
|
});
|
|
5504
5523
|
|
|
5505
5524
|
// src/api/dto/export/job.ts
|
|
5506
|
-
import { z as
|
|
5507
|
-
var DTOExportJobCreatedBy =
|
|
5508
|
-
userId:
|
|
5509
|
-
userName:
|
|
5525
|
+
import { z as z197 } from "zod";
|
|
5526
|
+
var DTOExportJobCreatedBy = z197.object({
|
|
5527
|
+
userId: z197.string(),
|
|
5528
|
+
userName: z197.string()
|
|
5510
5529
|
});
|
|
5511
|
-
var DTOExportJobDesignSystemPreview =
|
|
5512
|
-
id:
|
|
5530
|
+
var DTOExportJobDesignSystemPreview = z197.object({
|
|
5531
|
+
id: z197.string(),
|
|
5513
5532
|
meta: ObjectMeta
|
|
5514
5533
|
});
|
|
5515
|
-
var DTOExportJobDesignSystemVersionPreview =
|
|
5516
|
-
id:
|
|
5534
|
+
var DTOExportJobDesignSystemVersionPreview = z197.object({
|
|
5535
|
+
id: z197.string(),
|
|
5517
5536
|
meta: ObjectMeta,
|
|
5518
|
-
version:
|
|
5519
|
-
isReadonly:
|
|
5537
|
+
version: z197.string(),
|
|
5538
|
+
isReadonly: z197.boolean()
|
|
5520
5539
|
});
|
|
5521
|
-
var DTOExportJobDestinations =
|
|
5540
|
+
var DTOExportJobDestinations = z197.object({
|
|
5522
5541
|
s3: ExporterDestinationS3.optional(),
|
|
5523
5542
|
azure: ExporterDestinationAzure.optional(),
|
|
5524
5543
|
bitbucket: ExporterDestinationBitbucket.optional(),
|
|
5525
5544
|
github: ExporterDestinationGithub.optional(),
|
|
5526
5545
|
gitlab: ExporterDestinationGitlab.optional(),
|
|
5527
5546
|
documentation: ExporterDestinationDocs.optional(),
|
|
5528
|
-
webhookUrl:
|
|
5547
|
+
webhookUrl: z197.string().optional()
|
|
5529
5548
|
});
|
|
5530
|
-
var DTOExportJob =
|
|
5531
|
-
id:
|
|
5532
|
-
createdAt:
|
|
5533
|
-
finishedAt:
|
|
5534
|
-
index:
|
|
5549
|
+
var DTOExportJob = z197.object({
|
|
5550
|
+
id: z197.string(),
|
|
5551
|
+
createdAt: z197.coerce.date(),
|
|
5552
|
+
finishedAt: z197.coerce.date().optional(),
|
|
5553
|
+
index: z197.number().optional(),
|
|
5535
5554
|
status: ExportJobStatus,
|
|
5536
|
-
estimatedExecutionTime:
|
|
5555
|
+
estimatedExecutionTime: z197.number().optional(),
|
|
5537
5556
|
createdBy: DTOExportJobCreatedBy.optional(),
|
|
5538
5557
|
designSystem: DTOExportJobDesignSystemPreview,
|
|
5539
5558
|
designSystemVersion: DTOExportJobDesignSystemVersionPreview,
|
|
5540
5559
|
destinations: DTOExportJobDestinations,
|
|
5541
|
-
exporterId:
|
|
5542
|
-
scheduleId:
|
|
5560
|
+
exporterId: z197.string(),
|
|
5561
|
+
scheduleId: z197.string().optional(),
|
|
5543
5562
|
result: ExportJobResult.optional(),
|
|
5544
|
-
brandPersistentId:
|
|
5545
|
-
themePersistentId:
|
|
5563
|
+
brandPersistentId: z197.string().optional(),
|
|
5564
|
+
themePersistentId: z197.string().optional()
|
|
5546
5565
|
});
|
|
5547
|
-
var DTOExportJobResponse =
|
|
5566
|
+
var DTOExportJobResponse = z197.object({
|
|
5548
5567
|
job: DTOExportJob
|
|
5549
5568
|
});
|
|
5550
5569
|
|
|
5551
5570
|
// src/api/dto/export/pipeline.ts
|
|
5552
|
-
import { z as
|
|
5553
|
-
var DTOPipeline =
|
|
5554
|
-
id:
|
|
5555
|
-
name:
|
|
5571
|
+
import { z as z198 } from "zod";
|
|
5572
|
+
var DTOPipeline = z198.object({
|
|
5573
|
+
id: z198.string(),
|
|
5574
|
+
name: z198.string(),
|
|
5556
5575
|
eventType: PipelineEventType,
|
|
5557
|
-
isEnabled:
|
|
5558
|
-
workspaceId:
|
|
5559
|
-
designSystemId:
|
|
5560
|
-
exporterId:
|
|
5561
|
-
brandPersistentId:
|
|
5562
|
-
themePersistentId:
|
|
5576
|
+
isEnabled: z198.boolean(),
|
|
5577
|
+
workspaceId: z198.string(),
|
|
5578
|
+
designSystemId: z198.string(),
|
|
5579
|
+
exporterId: z198.string(),
|
|
5580
|
+
brandPersistentId: z198.string().optional(),
|
|
5581
|
+
themePersistentId: z198.string().optional(),
|
|
5563
5582
|
...ExportDestinationsMap.shape,
|
|
5564
5583
|
latestJobs: DTOExportJob.array()
|
|
5565
5584
|
});
|
|
5566
5585
|
|
|
5567
5586
|
// src/api/dto/liveblocks/auth-response.ts
|
|
5568
|
-
import { z as
|
|
5569
|
-
var DTOLiveblocksAuthResponse =
|
|
5570
|
-
token:
|
|
5587
|
+
import { z as z199 } from "zod";
|
|
5588
|
+
var DTOLiveblocksAuthResponse = z199.object({
|
|
5589
|
+
token: z199.string()
|
|
5571
5590
|
});
|
|
5572
5591
|
|
|
5573
5592
|
// src/api/dto/users/profile/update.ts
|
|
5574
|
-
import { z as
|
|
5575
|
-
var DTOUserProfileUpdateResponse =
|
|
5593
|
+
import { z as z200 } from "zod";
|
|
5594
|
+
var DTOUserProfileUpdateResponse = z200.object({
|
|
5576
5595
|
user: User
|
|
5577
5596
|
});
|
|
5578
5597
|
|
|
5579
5598
|
// src/api/dto/workspaces/git.ts
|
|
5580
|
-
import { z as
|
|
5581
|
-
var DTOGitOrganization =
|
|
5582
|
-
id:
|
|
5583
|
-
name:
|
|
5584
|
-
url:
|
|
5585
|
-
slug:
|
|
5586
|
-
});
|
|
5587
|
-
var DTOGitProject =
|
|
5588
|
-
id:
|
|
5589
|
-
name:
|
|
5590
|
-
url:
|
|
5591
|
-
slug:
|
|
5592
|
-
});
|
|
5593
|
-
var DTOGitRepository =
|
|
5594
|
-
id:
|
|
5595
|
-
name:
|
|
5596
|
-
url:
|
|
5597
|
-
slug:
|
|
5598
|
-
defaultBranch:
|
|
5599
|
-
});
|
|
5600
|
-
var DTOGitBranch =
|
|
5601
|
-
name:
|
|
5602
|
-
lastCommitId:
|
|
5599
|
+
import { z as z201 } from "zod";
|
|
5600
|
+
var DTOGitOrganization = z201.object({
|
|
5601
|
+
id: z201.string(),
|
|
5602
|
+
name: z201.string(),
|
|
5603
|
+
url: z201.string(),
|
|
5604
|
+
slug: z201.string()
|
|
5605
|
+
});
|
|
5606
|
+
var DTOGitProject = z201.object({
|
|
5607
|
+
id: z201.string(),
|
|
5608
|
+
name: z201.string(),
|
|
5609
|
+
url: z201.string(),
|
|
5610
|
+
slug: z201.string()
|
|
5611
|
+
});
|
|
5612
|
+
var DTOGitRepository = z201.object({
|
|
5613
|
+
id: z201.string(),
|
|
5614
|
+
name: z201.string(),
|
|
5615
|
+
url: z201.string(),
|
|
5616
|
+
slug: z201.string(),
|
|
5617
|
+
defaultBranch: z201.string().optional()
|
|
5618
|
+
});
|
|
5619
|
+
var DTOGitBranch = z201.object({
|
|
5620
|
+
name: z201.string(),
|
|
5621
|
+
lastCommitId: z201.string()
|
|
5603
5622
|
});
|
|
5604
5623
|
|
|
5605
5624
|
// src/api/dto/workspaces/integrations.ts
|
|
5606
|
-
import { z as
|
|
5625
|
+
import { z as z202 } from "zod";
|
|
5607
5626
|
var DTOIntegrationCredentials = IntegrationCredentials.omit({
|
|
5608
5627
|
accessToken: true,
|
|
5609
5628
|
refreshToken: true
|
|
5610
5629
|
});
|
|
5611
|
-
var DTOIntegration =
|
|
5612
|
-
id:
|
|
5613
|
-
workspaceId:
|
|
5630
|
+
var DTOIntegration = z202.object({
|
|
5631
|
+
id: z202.string(),
|
|
5632
|
+
workspaceId: z202.string(),
|
|
5614
5633
|
type: ExtendedIntegrationType,
|
|
5615
|
-
createdAt:
|
|
5616
|
-
integrationCredentials:
|
|
5617
|
-
integrationDesignSystems:
|
|
5634
|
+
createdAt: z202.coerce.date(),
|
|
5635
|
+
integrationCredentials: z202.array(DTOIntegrationCredentials).optional(),
|
|
5636
|
+
integrationDesignSystems: z202.array(IntegrationDesignSystem).optional()
|
|
5618
5637
|
});
|
|
5619
|
-
var DTOIntegrationOAuthGetResponse =
|
|
5620
|
-
url:
|
|
5638
|
+
var DTOIntegrationOAuthGetResponse = z202.object({
|
|
5639
|
+
url: z202.string()
|
|
5621
5640
|
});
|
|
5622
|
-
var DTOIntegrationPostResponse =
|
|
5641
|
+
var DTOIntegrationPostResponse = z202.object({
|
|
5623
5642
|
integration: DTOIntegration
|
|
5624
5643
|
});
|
|
5625
|
-
var DTOIntegrationsGetListResponse =
|
|
5644
|
+
var DTOIntegrationsGetListResponse = z202.object({
|
|
5626
5645
|
integrations: DTOIntegration.array()
|
|
5627
5646
|
});
|
|
5628
5647
|
|
|
5629
5648
|
// src/api/dto/workspaces/membership.ts
|
|
5630
|
-
import { z as
|
|
5649
|
+
import { z as z205 } from "zod";
|
|
5631
5650
|
|
|
5632
5651
|
// src/api/dto/workspaces/workspace.ts
|
|
5633
|
-
import { z as
|
|
5652
|
+
import { z as z204 } from "zod";
|
|
5634
5653
|
|
|
5635
5654
|
// src/api/dto/workspaces/npm-registry.ts
|
|
5636
|
-
import { z as
|
|
5655
|
+
import { z as z203 } from "zod";
|
|
5637
5656
|
var DTONpmRegistryConfigConstants = {
|
|
5638
5657
|
passwordPlaceholder: "redacted"
|
|
5639
5658
|
};
|
|
5640
|
-
var DTONpmRegistryConfig =
|
|
5659
|
+
var DTONpmRegistryConfig = z203.object({
|
|
5641
5660
|
// Registry basic configuration
|
|
5642
5661
|
registryType: NpmRegistryType,
|
|
5643
|
-
registryUrl:
|
|
5644
|
-
customRegistryUrl:
|
|
5662
|
+
registryUrl: z203.string(),
|
|
5663
|
+
customRegistryUrl: z203.string().optional(),
|
|
5645
5664
|
// URL of Supernova NPM packages proxy
|
|
5646
|
-
proxyUrl:
|
|
5665
|
+
proxyUrl: z203.string(),
|
|
5647
5666
|
// Auth configuration
|
|
5648
5667
|
authType: NpmRegistryAuthType,
|
|
5649
|
-
accessToken:
|
|
5650
|
-
username:
|
|
5651
|
-
password:
|
|
5668
|
+
accessToken: z203.literal(DTONpmRegistryConfigConstants.passwordPlaceholder).optional(),
|
|
5669
|
+
username: z203.string().optional(),
|
|
5670
|
+
password: z203.literal(DTONpmRegistryConfigConstants.passwordPlaceholder).optional(),
|
|
5652
5671
|
// NPM package scopes for whih the proxy should be enabled
|
|
5653
|
-
enabledScopes:
|
|
5672
|
+
enabledScopes: z203.array(z203.string()),
|
|
5654
5673
|
// True if client should bypass Supernova proxy and connect directly to the registry
|
|
5655
5674
|
// (e.g. when the NPM registry is behind a VPN or firewall which prevents Supernova from accessing it)
|
|
5656
|
-
bypassProxy:
|
|
5675
|
+
bypassProxy: z203.boolean()
|
|
5657
5676
|
});
|
|
5658
5677
|
|
|
5659
5678
|
// src/api/dto/workspaces/workspace.ts
|
|
5660
|
-
var DTOWorkspace =
|
|
5661
|
-
id:
|
|
5679
|
+
var DTOWorkspace = z204.object({
|
|
5680
|
+
id: z204.string(),
|
|
5662
5681
|
profile: WorkspaceProfile,
|
|
5663
5682
|
subscription: Subscription,
|
|
5664
5683
|
npmRegistry: DTONpmRegistryConfig.optional()
|
|
5665
5684
|
});
|
|
5666
5685
|
|
|
5667
5686
|
// src/api/dto/workspaces/membership.ts
|
|
5668
|
-
var DTOWorkspaceRole =
|
|
5669
|
-
var DTOUserWorkspaceMembership =
|
|
5687
|
+
var DTOWorkspaceRole = z205.enum(["Owner", "Admin", "Creator", "Viewer", "Billing"]);
|
|
5688
|
+
var DTOUserWorkspaceMembership = z205.object({
|
|
5670
5689
|
// Workspace the user is a member of
|
|
5671
5690
|
workspace: DTOWorkspace,
|
|
5672
5691
|
// Assigned role the user has in the workspace
|
|
@@ -5676,8 +5695,8 @@ var DTOUserWorkspaceMembership = z204.object({
|
|
|
5676
5695
|
// when a workspace's subscription is downgraded to free tier
|
|
5677
5696
|
effectiveRole: DTOWorkspaceRole
|
|
5678
5697
|
});
|
|
5679
|
-
var DTOUserWorkspaceMembershipsResponse =
|
|
5680
|
-
membership:
|
|
5698
|
+
var DTOUserWorkspaceMembershipsResponse = z205.object({
|
|
5699
|
+
membership: z205.array(DTOUserWorkspaceMembership)
|
|
5681
5700
|
});
|
|
5682
5701
|
|
|
5683
5702
|
// src/utils/hash.ts
|
|
@@ -5729,18 +5748,28 @@ function generateHash(input) {
|
|
|
5729
5748
|
}
|
|
5730
5749
|
|
|
5731
5750
|
// src/yjs/design-system-content/documentation-hierarchy.ts
|
|
5732
|
-
import { z as
|
|
5733
|
-
|
|
5734
|
-
|
|
5735
|
-
|
|
5736
|
-
|
|
5737
|
-
|
|
5738
|
-
|
|
5739
|
-
|
|
5740
|
-
|
|
5741
|
-
|
|
5751
|
+
import { z as z206 } from "zod";
|
|
5752
|
+
|
|
5753
|
+
// src/yjs/version-room/base.ts
|
|
5754
|
+
var VersionRoomBaseYDoc = class {
|
|
5755
|
+
constructor(yDoc) {
|
|
5756
|
+
__publicField(this, "yDoc");
|
|
5757
|
+
this.yDoc = yDoc;
|
|
5758
|
+
}
|
|
5759
|
+
//
|
|
5760
|
+
// Pages
|
|
5761
|
+
//
|
|
5762
|
+
getDocumentationPages() {
|
|
5763
|
+
const pagesMap = this.pagesYMap;
|
|
5764
|
+
const pages = [];
|
|
5765
|
+
pagesMap.forEach((page) => {
|
|
5766
|
+
pages.push(DocumentationPageV2.parse(page));
|
|
5742
5767
|
});
|
|
5743
|
-
|
|
5768
|
+
return pages;
|
|
5769
|
+
}
|
|
5770
|
+
updateDocumentationPages(pages) {
|
|
5771
|
+
const pagesMap = this.pagesYMap;
|
|
5772
|
+
pages.forEach((page) => {
|
|
5744
5773
|
const sanitizedPage = {
|
|
5745
5774
|
...page,
|
|
5746
5775
|
data: {
|
|
@@ -5749,89 +5778,185 @@ function documentationHierarchyToYjs(doc, transaction) {
|
|
|
5749
5778
|
};
|
|
5750
5779
|
pagesMap.set(page.id, JSON.parse(JSON.stringify(sanitizedPage)));
|
|
5751
5780
|
});
|
|
5752
|
-
|
|
5753
|
-
|
|
5754
|
-
|
|
5781
|
+
}
|
|
5782
|
+
deleteDocumentationPages(ids) {
|
|
5783
|
+
const pagesMap = this.pagesYMap;
|
|
5784
|
+
ids.forEach((id) => pagesMap.delete(id));
|
|
5785
|
+
}
|
|
5786
|
+
get pagesYMap() {
|
|
5787
|
+
return this.yDoc.getMap("documentationPages");
|
|
5788
|
+
}
|
|
5789
|
+
//
|
|
5790
|
+
// Groups
|
|
5791
|
+
//
|
|
5792
|
+
getDocumentationGroups() {
|
|
5793
|
+
const groupsMap = this.groupsYMap;
|
|
5794
|
+
const groups = [];
|
|
5795
|
+
groupsMap.forEach((group) => {
|
|
5796
|
+
groups.push(ElementGroup.parse(group));
|
|
5755
5797
|
});
|
|
5756
|
-
|
|
5798
|
+
return groups;
|
|
5799
|
+
}
|
|
5800
|
+
updateDocumentationGroups(groups) {
|
|
5801
|
+
const groupsMap = this.groupsYMap;
|
|
5802
|
+
groups.forEach((group) => {
|
|
5757
5803
|
groupsMap.set(group.id, JSON.parse(JSON.stringify(group)));
|
|
5758
5804
|
});
|
|
5759
|
-
|
|
5760
|
-
|
|
5761
|
-
|
|
5762
|
-
|
|
5763
|
-
|
|
5764
|
-
|
|
5765
|
-
|
|
5766
|
-
}
|
|
5767
|
-
|
|
5768
|
-
|
|
5769
|
-
|
|
5770
|
-
|
|
5771
|
-
|
|
5772
|
-
|
|
5773
|
-
|
|
5774
|
-
|
|
5775
|
-
const pagesMap = getPagesYMap(doc);
|
|
5776
|
-
const groupsMap = getGroupsYMap(doc);
|
|
5777
|
-
const publishedSnapshotsMap = getPublishedSnapshotsYMap(doc);
|
|
5778
|
-
const pages = [];
|
|
5779
|
-
pagesMap.forEach((page) => {
|
|
5780
|
-
pages.push(DocumentationPageV2.parse(page));
|
|
5781
|
-
});
|
|
5782
|
-
const groups = [];
|
|
5783
|
-
groupsMap.forEach((group) => {
|
|
5784
|
-
groups.push(ElementGroup.parse(group));
|
|
5785
|
-
});
|
|
5786
|
-
const publishedSnapshots = [];
|
|
5787
|
-
publishedSnapshotsMap.forEach((state) => {
|
|
5788
|
-
publishedSnapshots.push(DesignElementSnapshot.parse(state));
|
|
5789
|
-
});
|
|
5790
|
-
const internalSettings = parseDocumentationInternalSettings(doc);
|
|
5791
|
-
const hierarchy = documentationElementsToHierarchyDto(
|
|
5792
|
-
pages,
|
|
5793
|
-
groups,
|
|
5794
|
-
publishedSnapshots,
|
|
5795
|
-
internalSettings.routingVersion ?? "2"
|
|
5796
|
-
);
|
|
5797
|
-
return hierarchy;
|
|
5798
|
-
}
|
|
5799
|
-
function parseDocumentationInternalSettings(doc) {
|
|
5800
|
-
const map = getInternalSettingsYMap(doc);
|
|
5801
|
-
const rawSettings = {
|
|
5802
|
-
routingVersion: map.get("routingVersion"),
|
|
5803
|
-
isDraftFeatureAdopted: map.get("isDraftFeatureAdapted") ?? false
|
|
5804
|
-
};
|
|
5805
|
-
const settingsParseResult = DocumentationHierarchySettings.safeParse(rawSettings);
|
|
5806
|
-
if (!settingsParseResult.success) {
|
|
5807
|
-
return {
|
|
5808
|
-
routingVersion: "2",
|
|
5809
|
-
isDraftFeatureAdopted: false
|
|
5805
|
+
}
|
|
5806
|
+
deleteDocumentationGroups(ids) {
|
|
5807
|
+
const groupsMap = this.groupsYMap;
|
|
5808
|
+
ids.forEach((id) => groupsMap.delete(id));
|
|
5809
|
+
}
|
|
5810
|
+
get groupsYMap() {
|
|
5811
|
+
return this.yDoc.getMap("documentationGroups");
|
|
5812
|
+
}
|
|
5813
|
+
//
|
|
5814
|
+
// Documentation internal settings
|
|
5815
|
+
//
|
|
5816
|
+
getDocumentationInternalSettings() {
|
|
5817
|
+
const map = this.internalSettingsYMap;
|
|
5818
|
+
const rawSettings = {
|
|
5819
|
+
routingVersion: map.get("routingVersion"),
|
|
5820
|
+
isDraftFeatureAdopted: map.get("isDraftFeatureAdapted") ?? false
|
|
5810
5821
|
};
|
|
5822
|
+
const settingsParseResult = DocumentationHierarchySettings.safeParse(rawSettings);
|
|
5823
|
+
if (!settingsParseResult.success) {
|
|
5824
|
+
return {
|
|
5825
|
+
routingVersion: "2",
|
|
5826
|
+
isDraftFeatureAdopted: false
|
|
5827
|
+
};
|
|
5828
|
+
}
|
|
5829
|
+
return settingsParseResult.data;
|
|
5811
5830
|
}
|
|
5812
|
-
|
|
5813
|
-
|
|
5814
|
-
|
|
5815
|
-
|
|
5816
|
-
|
|
5817
|
-
|
|
5818
|
-
|
|
5819
|
-
|
|
5820
|
-
|
|
5821
|
-
|
|
5822
|
-
|
|
5823
|
-
|
|
5824
|
-
|
|
5831
|
+
updateDocumentationInternalSettings(settings) {
|
|
5832
|
+
const map = this.internalSettingsYMap;
|
|
5833
|
+
map.set("routingVersion", settings.routingVersion);
|
|
5834
|
+
}
|
|
5835
|
+
get internalSettingsYMap() {
|
|
5836
|
+
return this.yDoc.getMap("documentationInternalSettings");
|
|
5837
|
+
}
|
|
5838
|
+
//
|
|
5839
|
+
// Documentation page published snapshot
|
|
5840
|
+
//
|
|
5841
|
+
getDocumentationPagePublishedSnapshots() {
|
|
5842
|
+
return this.getSnapshots(this.documentationPagePublishedStatesYMap);
|
|
5843
|
+
}
|
|
5844
|
+
updateDocumentationPagePublishedSnapshots(snapshots) {
|
|
5845
|
+
this.setSnapshots(this.documentationPagePublishedStatesYMap, snapshots);
|
|
5846
|
+
}
|
|
5847
|
+
get documentationPagePublishedStatesYMap() {
|
|
5848
|
+
return this.yDoc.getMap("documentationPagePublishedSnapshots");
|
|
5849
|
+
}
|
|
5850
|
+
//
|
|
5851
|
+
// Documentation page deleted snapshot
|
|
5852
|
+
//
|
|
5853
|
+
getDocumentationPageDeletedSnapshots() {
|
|
5854
|
+
return this.getSnapshots(this.documentationPageDeletedStatesYMap);
|
|
5855
|
+
}
|
|
5856
|
+
updateDocumentationPageDeletedSnapshots(snapshots) {
|
|
5857
|
+
this.setSnapshots(this.documentationPageDeletedStatesYMap, snapshots);
|
|
5858
|
+
}
|
|
5859
|
+
get documentationPageDeletedStatesYMap() {
|
|
5860
|
+
return this.yDoc.getMap("documentationPageDeletedSnapshots");
|
|
5861
|
+
}
|
|
5862
|
+
//
|
|
5863
|
+
// Documentation group published snapshots
|
|
5864
|
+
//
|
|
5865
|
+
getDocumentationGroupPublishedSnapshots() {
|
|
5866
|
+
return this.getSnapshots(this.documentationGroupPublishedStatesYMap);
|
|
5867
|
+
}
|
|
5868
|
+
updateDocumentationGroupPublishedSnapshots(snapshots) {
|
|
5869
|
+
this.setSnapshots(this.documentationGroupPublishedStatesYMap, snapshots);
|
|
5870
|
+
}
|
|
5871
|
+
get documentationGroupPublishedStatesYMap() {
|
|
5872
|
+
return this.yDoc.getMap("documentationGroupPublishedSnapshots");
|
|
5873
|
+
}
|
|
5874
|
+
//
|
|
5875
|
+
// Documentation group deleted snapshots
|
|
5876
|
+
//
|
|
5877
|
+
getDocumentationGroupDeletedSnapshots() {
|
|
5878
|
+
return this.getSnapshots(this.documentationGroupDeletedStatesYMap);
|
|
5879
|
+
}
|
|
5880
|
+
updateDocumentationGroupDeletedSnapshots(snapshots) {
|
|
5881
|
+
this.setSnapshots(this.documentationGroupDeletedStatesYMap, snapshots);
|
|
5882
|
+
}
|
|
5883
|
+
get documentationGroupDeletedStatesYMap() {
|
|
5884
|
+
return this.yDoc.getMap("documentationGroupDeletedSnapshots");
|
|
5885
|
+
}
|
|
5886
|
+
//
|
|
5887
|
+
// Snapshot utils
|
|
5888
|
+
//
|
|
5889
|
+
getSnapshots(map) {
|
|
5890
|
+
const snapshots = [];
|
|
5891
|
+
map.forEach((snapshot) => {
|
|
5892
|
+
snapshots.push(DesignElementSnapshot.parse(snapshot));
|
|
5893
|
+
});
|
|
5894
|
+
return snapshots;
|
|
5895
|
+
}
|
|
5896
|
+
setSnapshots(map, snapshots) {
|
|
5897
|
+
snapshots.forEach((snapshot) => {
|
|
5898
|
+
map.set(snapshot.id, JSON.parse(JSON.stringify(snapshot)));
|
|
5899
|
+
});
|
|
5900
|
+
}
|
|
5901
|
+
//
|
|
5902
|
+
// Documentation page content hashes
|
|
5903
|
+
//
|
|
5904
|
+
getDocumentationPageContentHashes() {
|
|
5905
|
+
const map = this.documentationPageContentHashesYMap;
|
|
5906
|
+
const result = {};
|
|
5907
|
+
map.forEach((hash2, key) => {
|
|
5908
|
+
result[key] = hash2;
|
|
5909
|
+
});
|
|
5910
|
+
return result;
|
|
5911
|
+
}
|
|
5912
|
+
updateDocumentationPageContentHashes(hashes) {
|
|
5913
|
+
const map = this.documentationPageContentHashesYMap;
|
|
5914
|
+
Object.entries(hashes).forEach(([key, hash2]) => map.set(key, hash2));
|
|
5915
|
+
}
|
|
5916
|
+
get documentationPageContentHashesYMap() {
|
|
5917
|
+
return this.yDoc.getMap("documentationPageHashes");
|
|
5918
|
+
}
|
|
5919
|
+
};
|
|
5920
|
+
|
|
5921
|
+
// src/yjs/version-room/frontend.ts
|
|
5922
|
+
var FrontendVersionRoomYDoc = class {
|
|
5923
|
+
constructor(yDoc) {
|
|
5924
|
+
__publicField(this, "yDoc");
|
|
5925
|
+
this.yDoc = yDoc;
|
|
5926
|
+
}
|
|
5927
|
+
getDocumentationHierarchy() {
|
|
5928
|
+
const doc = new VersionRoomBaseYDoc(this.yDoc);
|
|
5929
|
+
const pages = doc.getDocumentationPages();
|
|
5930
|
+
const groups = doc.getDocumentationGroups();
|
|
5931
|
+
const settings = doc.getDocumentationInternalSettings();
|
|
5932
|
+
const hierarchy = documentationElementsToHierarchyDto(pages, groups, settings.routingVersion);
|
|
5933
|
+
return hierarchy;
|
|
5934
|
+
}
|
|
5935
|
+
notifyDocumentationPageContentUpdated(pageId, content) {
|
|
5936
|
+
const pageContentHash = generateHash(content);
|
|
5937
|
+
new VersionRoomBaseYDoc(this.yDoc).updateDocumentationPageContentHashes({
|
|
5938
|
+
[pageId]: pageContentHash
|
|
5939
|
+
});
|
|
5940
|
+
}
|
|
5941
|
+
};
|
|
5942
|
+
|
|
5943
|
+
// src/yjs/design-system-content/documentation-hierarchy.ts
|
|
5944
|
+
var DocumentationHierarchySettings = z206.object({
|
|
5945
|
+
routingVersion: z206.string(),
|
|
5946
|
+
isDraftFeatureAdopted: z206.boolean()
|
|
5947
|
+
});
|
|
5948
|
+
function yjsToDocumentationHierarchy(doc) {
|
|
5949
|
+
return new FrontendVersionRoomYDoc(doc).getDocumentationHierarchy();
|
|
5825
5950
|
}
|
|
5826
5951
|
|
|
5827
5952
|
// src/yjs/design-system-content/item-configuration.ts
|
|
5828
|
-
import { z as
|
|
5829
|
-
var DTODocumentationPageRoomHeaderData =
|
|
5830
|
-
title:
|
|
5953
|
+
import { z as z207 } from "zod";
|
|
5954
|
+
var DTODocumentationPageRoomHeaderData = z207.object({
|
|
5955
|
+
title: z207.string(),
|
|
5831
5956
|
configuration: DTODocumentationItemConfigurationV2
|
|
5832
5957
|
});
|
|
5833
|
-
var DTODocumentationPageRoomHeaderDataUpdate =
|
|
5834
|
-
title:
|
|
5958
|
+
var DTODocumentationPageRoomHeaderDataUpdate = z207.object({
|
|
5959
|
+
title: z207.string().optional(),
|
|
5835
5960
|
configuration: DTODocumentationItemConfigurationV2.omit({ header: true }).extend({ header: DocumentationItemHeaderV2.partial() }).optional()
|
|
5836
5961
|
});
|
|
5837
5962
|
function itemConfigurationToYjs(yDoc, item) {
|
|
@@ -5882,7 +6007,7 @@ function yjsToItemConfiguration(yDoc) {
|
|
|
5882
6007
|
header: rawHeader
|
|
5883
6008
|
};
|
|
5884
6009
|
return {
|
|
5885
|
-
title:
|
|
6010
|
+
title: z207.string().parse(title),
|
|
5886
6011
|
configuration: DTODocumentationItemConfigurationV2.parse(rawConfig)
|
|
5887
6012
|
};
|
|
5888
6013
|
}
|
|
@@ -5892,9 +6017,9 @@ var PageBlockEditorModel = PageBlockEditorModelV2;
|
|
|
5892
6017
|
var PageSectionEditorModel = PageSectionEditorModelV2;
|
|
5893
6018
|
|
|
5894
6019
|
// src/yjs/docs-editor/model/page.ts
|
|
5895
|
-
import { z as
|
|
5896
|
-
var DocumentationPageEditorModel =
|
|
5897
|
-
blocks:
|
|
6020
|
+
import { z as z208 } from "zod";
|
|
6021
|
+
var DocumentationPageEditorModel = z208.object({
|
|
6022
|
+
blocks: z208.array(PageBlockEditorModel.or(PageSectionEditorModel))
|
|
5898
6023
|
});
|
|
5899
6024
|
|
|
5900
6025
|
// src/yjs/docs-editor/prosemirror/schema.ts
|
|
@@ -7051,6 +7176,7 @@ function serializeTableNode(node) {
|
|
|
7051
7176
|
id: node.id,
|
|
7052
7177
|
props: {
|
|
7053
7178
|
image: {
|
|
7179
|
+
caption: node.caption,
|
|
7054
7180
|
value: node.value
|
|
7055
7181
|
}
|
|
7056
7182
|
}
|
|
@@ -8866,7 +8992,7 @@ var blocks = [
|
|
|
8866
8992
|
|
|
8867
8993
|
// src/yjs/docs-editor/prosemirror-to-blocks.ts
|
|
8868
8994
|
import { yXmlFragmentToProsemirrorJSON } from "y-prosemirror";
|
|
8869
|
-
import { z as
|
|
8995
|
+
import { z as z209 } from "zod";
|
|
8870
8996
|
function yDocToPage(yDoc, definitions) {
|
|
8871
8997
|
return yXmlFragmentToPage(yDoc.getXmlFragment("default"), definitions);
|
|
8872
8998
|
}
|
|
@@ -8909,7 +9035,7 @@ function prosemirrorNodeToSectionItem(prosemirrorNode, definitionsMap) {
|
|
|
8909
9035
|
return null;
|
|
8910
9036
|
return {
|
|
8911
9037
|
id,
|
|
8912
|
-
title: getProsemirrorAttribute(prosemirrorNode, "title",
|
|
9038
|
+
title: getProsemirrorAttribute(prosemirrorNode, "title", z209.string()) ?? "",
|
|
8913
9039
|
columns: (prosemirrorNode.content ?? []).filter((c) => c.type === "sectionItemColumn").map((c) => prosemirrorNodeToSectionColumns(c, definitionsMap)).filter(nonNullFilter)
|
|
8914
9040
|
};
|
|
8915
9041
|
}
|
|
@@ -8944,7 +9070,7 @@ function internalProsemirrorNodesToBlocks(prosemirrorNodes, definitionsMap, dept
|
|
|
8944
9070
|
});
|
|
8945
9071
|
}
|
|
8946
9072
|
function internalProsemirrorNodeToBlock(prosemirrorNode, definitionsMap, depth) {
|
|
8947
|
-
const definitionId = getProsemirrorAttribute(prosemirrorNode, "definitionId",
|
|
9073
|
+
const definitionId = getProsemirrorAttribute(prosemirrorNode, "definitionId", z209.string());
|
|
8948
9074
|
if (!definitionId) {
|
|
8949
9075
|
console.warn(`definitionId on ${prosemirrorNode.type} is required to be interpreted as a block, skipping node`);
|
|
8950
9076
|
return [];
|
|
@@ -8986,7 +9112,7 @@ function parseAsRichText(prosemirrorNode, definition, property) {
|
|
|
8986
9112
|
if (!id)
|
|
8987
9113
|
return null;
|
|
8988
9114
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
8989
|
-
const calloutType = parseCalloutType(getProsemirrorAttribute(prosemirrorNode, "type",
|
|
9115
|
+
const calloutType = parseCalloutType(getProsemirrorAttribute(prosemirrorNode, "type", z209.string().optional()));
|
|
8990
9116
|
return {
|
|
8991
9117
|
id,
|
|
8992
9118
|
type: "Block",
|
|
@@ -9112,10 +9238,10 @@ function parseRichTextAttribute(mark) {
|
|
|
9112
9238
|
return null;
|
|
9113
9239
|
}
|
|
9114
9240
|
function parseProsemirrorLink(mark) {
|
|
9115
|
-
const href = getProsemirrorAttribute(mark, "href",
|
|
9241
|
+
const href = getProsemirrorAttribute(mark, "href", z209.string().optional());
|
|
9116
9242
|
if (!href)
|
|
9117
9243
|
return null;
|
|
9118
|
-
const target = getProsemirrorAttribute(mark, "target",
|
|
9244
|
+
const target = getProsemirrorAttribute(mark, "target", z209.string().optional());
|
|
9119
9245
|
const openInNewTab = target === "_blank";
|
|
9120
9246
|
if (href.startsWith("@")) {
|
|
9121
9247
|
return {
|
|
@@ -9138,7 +9264,7 @@ function parseAsTable(prosemirrorNode, definition, property) {
|
|
|
9138
9264
|
if (!id)
|
|
9139
9265
|
return null;
|
|
9140
9266
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
9141
|
-
const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder",
|
|
9267
|
+
const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", z209.boolean().optional()) !== false;
|
|
9142
9268
|
const tableChild = prosemirrorNode.content?.find((c) => c.type === "table");
|
|
9143
9269
|
if (!tableChild) {
|
|
9144
9270
|
return emptyTable(id, variantId, 0);
|
|
@@ -9185,9 +9311,9 @@ function parseAsTableCell(prosemirrorNode) {
|
|
|
9185
9311
|
const id = getProsemirrorBlockId(prosemirrorNode);
|
|
9186
9312
|
if (!id)
|
|
9187
9313
|
return null;
|
|
9188
|
-
const textAlign = getProsemirrorAttribute(prosemirrorNode, "textAlign",
|
|
9314
|
+
const textAlign = getProsemirrorAttribute(prosemirrorNode, "textAlign", z209.string().optional());
|
|
9189
9315
|
let columnWidth;
|
|
9190
|
-
const columnWidthArray = getProsemirrorAttribute(prosemirrorNode, "colwidth",
|
|
9316
|
+
const columnWidthArray = getProsemirrorAttribute(prosemirrorNode, "colwidth", z209.array(z209.number()).optional());
|
|
9191
9317
|
if (columnWidthArray) {
|
|
9192
9318
|
columnWidth = columnWidthArray[0];
|
|
9193
9319
|
}
|
|
@@ -9225,7 +9351,7 @@ function parseAsTableNode(prosemirrorNode) {
|
|
|
9225
9351
|
value: parseRichText(prosemirrorNode.content ?? [])
|
|
9226
9352
|
};
|
|
9227
9353
|
case "image":
|
|
9228
|
-
const items = getProsemirrorAttribute(prosemirrorNode, "items",
|
|
9354
|
+
const items = getProsemirrorAttribute(prosemirrorNode, "items", z209.string());
|
|
9229
9355
|
if (!items)
|
|
9230
9356
|
return null;
|
|
9231
9357
|
const parsedItems = PageBlockItemV2.array().safeParse(JSON.parse(items));
|
|
@@ -9240,7 +9366,8 @@ function parseAsTableNode(prosemirrorNode) {
|
|
|
9240
9366
|
return {
|
|
9241
9367
|
type: "Image",
|
|
9242
9368
|
id,
|
|
9243
|
-
value: imagePropertyValueParseResult.data.value
|
|
9369
|
+
value: imagePropertyValueParseResult.data.value,
|
|
9370
|
+
caption: imagePropertyValueParseResult.data.caption
|
|
9244
9371
|
};
|
|
9245
9372
|
default:
|
|
9246
9373
|
return null;
|
|
@@ -9341,7 +9468,7 @@ function definitionExpectsPlaceholderItem(definition) {
|
|
|
9341
9468
|
);
|
|
9342
9469
|
}
|
|
9343
9470
|
function parseBlockItems(prosemirrorNode, definition) {
|
|
9344
|
-
const itemsString = getProsemirrorAttribute(prosemirrorNode, "items",
|
|
9471
|
+
const itemsString = getProsemirrorAttribute(prosemirrorNode, "items", z209.string());
|
|
9345
9472
|
if (!itemsString)
|
|
9346
9473
|
return null;
|
|
9347
9474
|
const itemsJson = JSON.parse(itemsString);
|
|
@@ -9353,18 +9480,18 @@ function parseBlockItems(prosemirrorNode, definition) {
|
|
|
9353
9480
|
}
|
|
9354
9481
|
function parseAppearance(prosemirrorNode) {
|
|
9355
9482
|
let appearance = {};
|
|
9356
|
-
const rawAppearanceString = getProsemirrorAttribute(prosemirrorNode, "appearance",
|
|
9483
|
+
const rawAppearanceString = getProsemirrorAttribute(prosemirrorNode, "appearance", z209.string().optional());
|
|
9357
9484
|
if (rawAppearanceString) {
|
|
9358
9485
|
const parsedAppearance = PageBlockAppearanceV2.safeParse(JSON.parse(rawAppearanceString));
|
|
9359
9486
|
if (parsedAppearance.success) {
|
|
9360
9487
|
appearance = parsedAppearance.data;
|
|
9361
9488
|
}
|
|
9362
9489
|
}
|
|
9363
|
-
const columns = getProsemirrorAttribute(prosemirrorNode, "columns",
|
|
9490
|
+
const columns = getProsemirrorAttribute(prosemirrorNode, "columns", z209.number().optional());
|
|
9364
9491
|
if (columns) {
|
|
9365
9492
|
appearance.numberOfColumns = columns;
|
|
9366
9493
|
}
|
|
9367
|
-
const backgroundColor = getProsemirrorAttribute(prosemirrorNode, "backgroundColor",
|
|
9494
|
+
const backgroundColor = getProsemirrorAttribute(prosemirrorNode, "backgroundColor", z209.string().optional());
|
|
9368
9495
|
if (backgroundColor) {
|
|
9369
9496
|
const parsedColor = PageBlockColorV2.safeParse(JSON.parse(backgroundColor));
|
|
9370
9497
|
if (parsedColor.success) {
|
|
@@ -9457,13 +9584,13 @@ function valueSchemaForPropertyType(type) {
|
|
|
9457
9584
|
}
|
|
9458
9585
|
}
|
|
9459
9586
|
function getProsemirrorBlockId(prosemirrorNode) {
|
|
9460
|
-
const id = getProsemirrorAttribute(prosemirrorNode, "id",
|
|
9587
|
+
const id = getProsemirrorAttribute(prosemirrorNode, "id", z209.string());
|
|
9461
9588
|
if (!id)
|
|
9462
9589
|
console.warn(`Prosemirror attribute "id" on ${prosemirrorNode.type} is required`);
|
|
9463
9590
|
return id;
|
|
9464
9591
|
}
|
|
9465
9592
|
function getProsemirrorBlockVariantId(prosemirrorNode) {
|
|
9466
|
-
return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(
|
|
9593
|
+
return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(z209.string()));
|
|
9467
9594
|
}
|
|
9468
9595
|
function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
|
|
9469
9596
|
const parsedAttr = validationSchema.safeParse(prosemirrorNode.attrs?.[attributeName]);
|
|
@@ -9485,7 +9612,26 @@ function mapByUnique2(items, keyFn) {
|
|
|
9485
9612
|
}
|
|
9486
9613
|
return result;
|
|
9487
9614
|
}
|
|
9615
|
+
|
|
9616
|
+
// src/yjs/version-room/backend.ts
|
|
9617
|
+
var BackendVersionRoomYDoc = class {
|
|
9618
|
+
constructor(yDoc) {
|
|
9619
|
+
__publicField(this, "yDoc");
|
|
9620
|
+
this.yDoc = yDoc;
|
|
9621
|
+
}
|
|
9622
|
+
updateDocumentationHierarchy(transaction) {
|
|
9623
|
+
this.yDoc.transact((trx) => {
|
|
9624
|
+
const yDoc = new VersionRoomBaseYDoc(trx.doc);
|
|
9625
|
+
transaction.pageIdsToDelete.length && yDoc.deleteDocumentationPages(transaction.pageIdsToDelete);
|
|
9626
|
+
transaction.pages.length && yDoc.updateDocumentationPages(transaction.pages);
|
|
9627
|
+
transaction.groupIdsToDelete.length && yDoc.deleteDocumentationGroups(transaction.groupIdsToDelete);
|
|
9628
|
+
transaction.groups.length && yDoc.updateDocumentationGroups(transaction.groups);
|
|
9629
|
+
transaction.internalSettings && yDoc.updateDocumentationInternalSettings(transaction.internalSettings);
|
|
9630
|
+
});
|
|
9631
|
+
}
|
|
9632
|
+
};
|
|
9488
9633
|
export {
|
|
9634
|
+
BackendVersionRoomYDoc,
|
|
9489
9635
|
BlockDefinitionUtils,
|
|
9490
9636
|
BlockParsingUtils,
|
|
9491
9637
|
DTOBrand,
|
|
@@ -9516,6 +9662,8 @@ export {
|
|
|
9516
9662
|
DTODesignSystemVersionJobStatusResponse,
|
|
9517
9663
|
DTODesignSystemVersionJobsResponse,
|
|
9518
9664
|
DTODesignSystemVersionsListResponse,
|
|
9665
|
+
DTODocumentationDraftChangeType,
|
|
9666
|
+
DTODocumentationDraftState,
|
|
9519
9667
|
DTODocumentationGroupCreateActionInputV2,
|
|
9520
9668
|
DTODocumentationGroupCreateActionOutputV2,
|
|
9521
9669
|
DTODocumentationGroupDeleteActionInputV2,
|
|
@@ -9643,11 +9791,13 @@ export {
|
|
|
9643
9791
|
DocumentationHierarchySettings,
|
|
9644
9792
|
DocumentationPageEditorModel,
|
|
9645
9793
|
DocumentationPageV1DTO,
|
|
9794
|
+
FrontendVersionRoomYDoc,
|
|
9646
9795
|
ListTreeBuilder,
|
|
9647
9796
|
NpmRegistryInput,
|
|
9648
9797
|
ObjectMeta2 as ObjectMeta,
|
|
9649
9798
|
PageBlockEditorModel,
|
|
9650
9799
|
PageSectionEditorModel,
|
|
9800
|
+
VersionRoomBaseYDoc,
|
|
9651
9801
|
VersionSQSPayload,
|
|
9652
9802
|
WorkspaceConfigurationPayload,
|
|
9653
9803
|
applyPrivacyConfigurationToNestedItems,
|
|
@@ -9655,7 +9805,6 @@ export {
|
|
|
9655
9805
|
buildDocPagePublishPaths,
|
|
9656
9806
|
calculateElementParentChain,
|
|
9657
9807
|
documentationElementsToHierarchyDto,
|
|
9658
|
-
documentationHierarchyToYjs,
|
|
9659
9808
|
documentationItemConfigurationToDTOV1,
|
|
9660
9809
|
documentationItemConfigurationToDTOV2,
|
|
9661
9810
|
documentationPagesFixedConfigurationToDTOV1,
|