@supernova-studio/client 0.21.0 → 0.22.0
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 +521 -27
- package/dist/index.d.ts +521 -27
- package/dist/index.js +80 -13
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +927 -860
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/dto/elements/documentation/group.ts +1 -1
- package/src/api/dto/elements/documentation/page-v2.ts +1 -1
- package/src/api/dto/elements/elements-action-v2.ts +7 -8
- package/src/api/dto/elements/figma-nodes/figma-node.ts +46 -0
- package/src/api/dto/elements/figma-nodes/index.ts +2 -0
- package/src/api/dto/elements/figma-nodes/node-actions-v2.ts +24 -0
- package/src/api/dto/elements/index.ts +1 -0
package/dist/index.js
CHANGED
|
@@ -127,6 +127,7 @@ var _zod = require('zod');
|
|
|
127
127
|
|
|
128
128
|
|
|
129
129
|
|
|
130
|
+
|
|
130
131
|
|
|
131
132
|
|
|
132
133
|
var _slugify = require('@sindresorhus/slugify'); var _slugify2 = _interopRequireDefault(_slugify);
|
|
@@ -341,7 +342,8 @@ var Asset = _zod.z.object({
|
|
|
341
342
|
filePath: _zod.z.string(),
|
|
342
343
|
scope: AssetScope,
|
|
343
344
|
properties: AssetProperties.nullish(),
|
|
344
|
-
origin: AssetOrigin.
|
|
345
|
+
origin: AssetOrigin.optional(),
|
|
346
|
+
originKey: _zod.z.string().optional()
|
|
345
347
|
});
|
|
346
348
|
var DataSourceRemoteType = _zod.z.enum(["Figma", "TokenStudio", "FigmaVariablesPlugin"]);
|
|
347
349
|
var DataSourceUploadRemoteSource = _zod.z.enum(["TokenStudio", "FigmaVariablesPlugin", "Custom"]);
|
|
@@ -427,7 +429,8 @@ var ImportJob = Entity.extend({
|
|
|
427
429
|
createdByUserId: _zod.z.string().optional(),
|
|
428
430
|
importContextId: _zod.z.string(),
|
|
429
431
|
error: _zod.z.string().optional(),
|
|
430
|
-
sourceType: DataSourceRemoteType
|
|
432
|
+
sourceType: DataSourceRemoteType,
|
|
433
|
+
importContextCleanedUp: _zod.z.boolean()
|
|
431
434
|
});
|
|
432
435
|
var TokenDataAliasSchema = _zod.z.object({
|
|
433
436
|
aliasTo: _zod.z.string().optional().nullable().transform((v) => _nullishCoalesce(v, () => ( void 0)))
|
|
@@ -561,7 +564,8 @@ var ShallowDesignElement = _zod.z.object({
|
|
|
561
564
|
parentPersistentId: _zod.z.string().optional(),
|
|
562
565
|
shortPersistentId: _zod.z.string().optional(),
|
|
563
566
|
childType: DesignElementType.optional(),
|
|
564
|
-
sortOrder: _zod.z.number()
|
|
567
|
+
sortOrder: _zod.z.number(),
|
|
568
|
+
origin: _zod.z.record(_zod.z.any()).optional()
|
|
565
569
|
});
|
|
566
570
|
var DesignElement = ShallowDesignElement.extend({
|
|
567
571
|
meta: ObjectMeta,
|
|
@@ -1215,11 +1219,13 @@ var FigmaNodeReferenceData = _zod.z.object({
|
|
|
1215
1219
|
nodeId: _zod.z.string(),
|
|
1216
1220
|
fileId: _zod.z.string().optional(),
|
|
1217
1221
|
valid: _zod.z.boolean(),
|
|
1222
|
+
// Asset data
|
|
1218
1223
|
assetId: _zod.z.string().optional(),
|
|
1219
1224
|
assetScale: _zod.z.number().optional(),
|
|
1220
1225
|
assetWidth: _zod.z.number().optional(),
|
|
1221
1226
|
assetHeight: _zod.z.number().optional(),
|
|
1222
|
-
assetUrl: _zod.z.string().optional()
|
|
1227
|
+
assetUrl: _zod.z.string().optional(),
|
|
1228
|
+
assetOriginKey: _zod.z.string().optional()
|
|
1223
1229
|
});
|
|
1224
1230
|
var FigmaNodeReferenceElementData = _zod.z.object({
|
|
1225
1231
|
value: FigmaNodeReferenceData
|
|
@@ -1411,8 +1417,12 @@ var FigmaFileStructure = DesignElementBase.extend({
|
|
|
1411
1417
|
origin: FigmaFileStructureOrigin,
|
|
1412
1418
|
data: FigmaFileStructureData
|
|
1413
1419
|
});
|
|
1420
|
+
var FigmaNodeReferenceOrigin = _zod.z.object({
|
|
1421
|
+
sourceId: _zod.z.string()
|
|
1422
|
+
});
|
|
1414
1423
|
var FigmaNodeReference = DesignElementBase.extend({
|
|
1415
|
-
data: FigmaNodeReferenceData
|
|
1424
|
+
data: FigmaNodeReferenceData,
|
|
1425
|
+
origin: FigmaNodeReferenceOrigin
|
|
1416
1426
|
});
|
|
1417
1427
|
var ElementGroup = DesignElementBase.extend(DesignElementGroupablePart.shape).extend(DesignElementSlugPart.shape).extend(DesignElementBrandedPart.partial().shape).extend({
|
|
1418
1428
|
shortPersistentId: _zod.z.string().optional(),
|
|
@@ -1666,7 +1676,7 @@ var UrlImageImportModel = ImageImportModelBase.extend({
|
|
|
1666
1676
|
type: _zod.z.literal(ImageImportModelType.enum.Url),
|
|
1667
1677
|
url: _zod.z.string(),
|
|
1668
1678
|
originKey: _zod.z.string(),
|
|
1669
|
-
extension: _zod.z.
|
|
1679
|
+
extension: _zod.z.string()
|
|
1670
1680
|
});
|
|
1671
1681
|
var FigmaRenderFormat = _zod.z.enum(["Svg", "Png"]);
|
|
1672
1682
|
var FigmaRenderBase = ImageImportModelBase.extend({
|
|
@@ -2204,7 +2214,12 @@ var CreateWorkspaceInput = _zod.z.object({
|
|
|
2204
2214
|
billingEmail: _zod.z.string().email().optional(),
|
|
2205
2215
|
handle: _zod.z.string().regex(slugRegex).min(HANDLE_MIN_LENGTH).max(HANDLE_MAX_LENGTH).refine((value) => _optionalChain([value, 'optionalAccess', _ => _.length]) > 0).optional(),
|
|
2206
2216
|
invites: UserInvites.optional(),
|
|
2207
|
-
promoCode: _zod.z.string().optional()
|
|
2217
|
+
promoCode: _zod.z.string().optional(),
|
|
2218
|
+
status: InternalStatusSchema.optional(),
|
|
2219
|
+
planInterval: BillingIntervalSchema.optional(),
|
|
2220
|
+
seats: _zod.z.number().optional(),
|
|
2221
|
+
seatLimit: _zod.z.number().optional(),
|
|
2222
|
+
card: CardSchema.optional()
|
|
2208
2223
|
});
|
|
2209
2224
|
var WorkspaceInvitation = _zod.z.object({
|
|
2210
2225
|
id: _zod.z.string(),
|
|
@@ -2723,6 +2738,9 @@ var SupernovaException = class _SupernovaException extends Error {
|
|
|
2723
2738
|
static accessDenied(message) {
|
|
2724
2739
|
return new _SupernovaException("AccessDenied", message);
|
|
2725
2740
|
}
|
|
2741
|
+
static tooMuchWork(message) {
|
|
2742
|
+
return new _SupernovaException("TooMuchWork", message);
|
|
2743
|
+
}
|
|
2726
2744
|
static notFound(message) {
|
|
2727
2745
|
return new _SupernovaException("ResourceNotFound", message);
|
|
2728
2746
|
}
|
|
@@ -3648,8 +3666,8 @@ var DTOMoveDocumentationGroupInput = _zod.z.object({
|
|
|
3648
3666
|
// Identifier of the group to update
|
|
3649
3667
|
id: _zod.z.string().uuid(),
|
|
3650
3668
|
// Group placement properties
|
|
3651
|
-
|
|
3652
|
-
|
|
3669
|
+
parentPersistentId: _zod.z.string().uuid(),
|
|
3670
|
+
afterPersistentId: _zod.z.string().uuid().optional()
|
|
3653
3671
|
});
|
|
3654
3672
|
var DTODuplicateDocumentationGroupInput = _zod.z.object({
|
|
3655
3673
|
// Identifier of the group to duplicate from
|
|
@@ -3783,7 +3801,7 @@ var DTOMoveDocumentationPageInputV2 = _zod.z.object({
|
|
|
3783
3801
|
id: _zod.z.string(),
|
|
3784
3802
|
// Page placement properties
|
|
3785
3803
|
parentPersistentId: _zod.z.string().uuid(),
|
|
3786
|
-
afterPersistentId: _zod.z.string().uuid()
|
|
3804
|
+
afterPersistentId: _zod.z.string().uuid().optional()
|
|
3787
3805
|
});
|
|
3788
3806
|
var DTODuplicateDocumentationPageInputV2 = _zod.z.object({
|
|
3789
3807
|
// Identifier of the page to duplicate from
|
|
@@ -3856,6 +3874,46 @@ var DocumentationPageV1DTO = DocumentationPageV1.omit({
|
|
|
3856
3874
|
path: _zod.z.string()
|
|
3857
3875
|
});
|
|
3858
3876
|
|
|
3877
|
+
// src/api/dto/elements/figma-nodes/node-actions-v2.ts
|
|
3878
|
+
|
|
3879
|
+
|
|
3880
|
+
// src/api/dto/elements/figma-nodes/figma-node.ts
|
|
3881
|
+
|
|
3882
|
+
var DTOFigmaNodeData = _zod.z.object({
|
|
3883
|
+
// Id of the node in the Figma file
|
|
3884
|
+
figmaNodeId: _zod.z.string(),
|
|
3885
|
+
// Validity
|
|
3886
|
+
isValid: _zod.z.boolean(),
|
|
3887
|
+
// Asset data
|
|
3888
|
+
assetId: _zod.z.string(),
|
|
3889
|
+
assetUrl: _zod.z.string(),
|
|
3890
|
+
// Asset metadata
|
|
3891
|
+
assetScale: _zod.z.number(),
|
|
3892
|
+
assetWidth: _zod.z.number().optional(),
|
|
3893
|
+
assetHeight: _zod.z.number().optional()
|
|
3894
|
+
});
|
|
3895
|
+
var DTOFigmaNode = FigmaFileStructure.omit({
|
|
3896
|
+
data: true
|
|
3897
|
+
}).extend({
|
|
3898
|
+
data: DTOFigmaNodeData
|
|
3899
|
+
});
|
|
3900
|
+
var DTOFigmaNodeCreateInput = _zod.z.object({
|
|
3901
|
+
// Id of a design system's data source representing a linked Figma file
|
|
3902
|
+
sourceId: _zod.z.string(),
|
|
3903
|
+
// Id of a node within the Figma file
|
|
3904
|
+
figmaFileNodeId: _zod.z.string()
|
|
3905
|
+
});
|
|
3906
|
+
|
|
3907
|
+
// src/api/dto/elements/figma-nodes/node-actions-v2.ts
|
|
3908
|
+
var DTOFigmaNodeActionOutput = _zod.z.object({
|
|
3909
|
+
type: _zod.z.literal("FigmaNodeRender"),
|
|
3910
|
+
figmaNodes: _zod.z.array(DTOFigmaNode)
|
|
3911
|
+
});
|
|
3912
|
+
var DTOFigmaNodeActionInput = _zod.z.object({
|
|
3913
|
+
type: _zod.z.literal("FigmaNodeRender"),
|
|
3914
|
+
input: DTOFigmaNodeCreateInput.array()
|
|
3915
|
+
});
|
|
3916
|
+
|
|
3859
3917
|
// src/api/dto/elements/elements-action-v2.ts
|
|
3860
3918
|
|
|
3861
3919
|
var DTOElementActionOutput = _zod.z.discriminatedUnion("type", [
|
|
@@ -3872,7 +3930,9 @@ var DTOElementActionOutput = _zod.z.discriminatedUnion("type", [
|
|
|
3872
3930
|
DTODocumentationGroupMoveActionOutputV2,
|
|
3873
3931
|
DTODocumentationGroupDuplicateActionOutputV2,
|
|
3874
3932
|
DTODocumentationGroupDeleteActionOutputV2,
|
|
3875
|
-
DTODocumentationTabGroupDeleteActionOutputV2
|
|
3933
|
+
DTODocumentationTabGroupDeleteActionOutputV2,
|
|
3934
|
+
// // Figma frames
|
|
3935
|
+
DTOFigmaNodeActionOutput
|
|
3876
3936
|
]);
|
|
3877
3937
|
var DTOElementActionInput = _zod.z.discriminatedUnion("type", [
|
|
3878
3938
|
// Documentation pages
|
|
@@ -3888,7 +3948,9 @@ var DTOElementActionInput = _zod.z.discriminatedUnion("type", [
|
|
|
3888
3948
|
DTODocumentationGroupMoveActionInputV2,
|
|
3889
3949
|
DTODocumentationGroupDuplicateActionInputV2,
|
|
3890
3950
|
DTODocumentationGroupDeleteActionInputV2,
|
|
3891
|
-
DTODocumentationTabGroupDeleteActionInputV2
|
|
3951
|
+
DTODocumentationTabGroupDeleteActionInputV2,
|
|
3952
|
+
// Figma frames
|
|
3953
|
+
DTOFigmaNodeActionInput
|
|
3892
3954
|
]);
|
|
3893
3955
|
|
|
3894
3956
|
// src/api/payloads/documentation/block-definitions.ts
|
|
@@ -8213,5 +8275,10 @@ function mapByUnique2(items, keyFn) {
|
|
|
8213
8275
|
|
|
8214
8276
|
|
|
8215
8277
|
|
|
8216
|
-
|
|
8278
|
+
|
|
8279
|
+
|
|
8280
|
+
|
|
8281
|
+
|
|
8282
|
+
|
|
8283
|
+
exports.BlockDefinitionUtils = BlockDefinitionUtils; exports.BlockParsingUtils = BlockParsingUtils; exports.DTOCreateDocumentationGroupInput = DTOCreateDocumentationGroupInput; exports.DTOCreateDocumentationPageInputV2 = DTOCreateDocumentationPageInputV2; exports.DTOCreateDocumentationTabGroupInput = DTOCreateDocumentationTabGroupInput; exports.DTODeleteDocumentationGroupInput = DTODeleteDocumentationGroupInput; exports.DTODeleteDocumentationPageInputV2 = DTODeleteDocumentationPageInputV2; exports.DTODeleteDocumentationTabGroupInput = DTODeleteDocumentationTabGroupInput; exports.DTODesignSystem = DTODesignSystem; exports.DTODocumentationGroupCreateActionInputV2 = DTODocumentationGroupCreateActionInputV2; exports.DTODocumentationGroupCreateActionOutputV2 = DTODocumentationGroupCreateActionOutputV2; exports.DTODocumentationGroupDeleteActionInputV2 = DTODocumentationGroupDeleteActionInputV2; exports.DTODocumentationGroupDeleteActionOutputV2 = DTODocumentationGroupDeleteActionOutputV2; exports.DTODocumentationGroupDuplicateActionInputV2 = DTODocumentationGroupDuplicateActionInputV2; exports.DTODocumentationGroupDuplicateActionOutputV2 = DTODocumentationGroupDuplicateActionOutputV2; exports.DTODocumentationGroupMoveActionInputV2 = DTODocumentationGroupMoveActionInputV2; exports.DTODocumentationGroupMoveActionOutputV2 = DTODocumentationGroupMoveActionOutputV2; exports.DTODocumentationGroupStructureV2 = DTODocumentationGroupStructureV2; exports.DTODocumentationGroupUpdateActionInputV2 = DTODocumentationGroupUpdateActionInputV2; exports.DTODocumentationGroupUpdateActionOutputV2 = DTODocumentationGroupUpdateActionOutputV2; exports.DTODocumentationGroupV2 = DTODocumentationGroupV2; exports.DTODocumentationHierarchyV2 = DTODocumentationHierarchyV2; exports.DTODocumentationPageCreateActionInputV2 = DTODocumentationPageCreateActionInputV2; exports.DTODocumentationPageCreateActionOutputV2 = DTODocumentationPageCreateActionOutputV2; exports.DTODocumentationPageDeleteActionInputV2 = DTODocumentationPageDeleteActionInputV2; exports.DTODocumentationPageDeleteActionOutputV2 = DTODocumentationPageDeleteActionOutputV2; exports.DTODocumentationPageDuplicateActionInputV2 = DTODocumentationPageDuplicateActionInputV2; exports.DTODocumentationPageDuplicateActionOutputV2 = DTODocumentationPageDuplicateActionOutputV2; exports.DTODocumentationPageMoveActionInputV2 = DTODocumentationPageMoveActionInputV2; exports.DTODocumentationPageMoveActionOutputV2 = DTODocumentationPageMoveActionOutputV2; exports.DTODocumentationPageRoomHeaderData = DTODocumentationPageRoomHeaderData; exports.DTODocumentationPageRoomHeaderDataUpdate = DTODocumentationPageRoomHeaderDataUpdate; exports.DTODocumentationPageStructureV2 = DTODocumentationPageStructureV2; exports.DTODocumentationPageUpdateActionInputV2 = DTODocumentationPageUpdateActionInputV2; exports.DTODocumentationPageUpdateActionOutputV2 = DTODocumentationPageUpdateActionOutputV2; exports.DTODocumentationPageV2 = DTODocumentationPageV2; exports.DTODocumentationTabGroupCreateActionInputV2 = DTODocumentationTabGroupCreateActionInputV2; exports.DTODocumentationTabGroupCreateActionOutputV2 = DTODocumentationTabGroupCreateActionOutputV2; exports.DTODocumentationTabGroupDeleteActionInputV2 = DTODocumentationTabGroupDeleteActionInputV2; exports.DTODocumentationTabGroupDeleteActionOutputV2 = DTODocumentationTabGroupDeleteActionOutputV2; exports.DTODuplicateDocumentationGroupInput = DTODuplicateDocumentationGroupInput; exports.DTODuplicateDocumentationPageInputV2 = DTODuplicateDocumentationPageInputV2; exports.DTOElementActionInput = DTOElementActionInput; exports.DTOElementActionOutput = DTOElementActionOutput; exports.DTOFigmaNode = DTOFigmaNode; exports.DTOFigmaNodeActionInput = DTOFigmaNodeActionInput; exports.DTOFigmaNodeActionOutput = DTOFigmaNodeActionOutput; exports.DTOFigmaNodeCreateInput = DTOFigmaNodeCreateInput; exports.DTOFigmaNodeData = DTOFigmaNodeData; exports.DTOGetBlockDefinitionsOutput = DTOGetBlockDefinitionsOutput; exports.DTOLiveblocksAuthRequest = DTOLiveblocksAuthRequest; exports.DTOMoveDocumentationGroupInput = DTOMoveDocumentationGroupInput; exports.DTOMoveDocumentationPageInputV2 = DTOMoveDocumentationPageInputV2; exports.DTOUpdateDocumentationGroupInput = DTOUpdateDocumentationGroupInput; exports.DTOUpdateDocumentationPageInputV2 = DTOUpdateDocumentationPageInputV2; exports.DocumentationPageEditorModel = DocumentationPageEditorModel; exports.DocumentationPageV1DTO = DocumentationPageV1DTO; exports.PageBlockEditorModel = PageBlockEditorModel2; exports.blockDefinitionForBlock = blockDefinitionForBlock; exports.blockToProsemirrorNode = blockToProsemirrorNode; exports.buildDocPagePublishPaths = buildDocPagePublishPaths; exports.calculateElementParentChain = calculateElementParentChain; exports.documentationElementsToHierarchyDto = documentationElementsToHierarchyDto; exports.documentationHierarchyToYjs = documentationHierarchyToYjs; exports.documentationPagesToDTOV1 = documentationPagesToDTOV1; exports.documentationPagesToDTOV2 = documentationPagesToDTOV2; exports.documentationPagesToStructureDTOV2 = documentationPagesToStructureDTOV2; exports.elementGroupsToDocumentationGroupDTO = elementGroupsToDocumentationGroupDTO; exports.elementGroupsToDocumentationGroupStructureDTO = elementGroupsToDocumentationGroupStructureDTO; exports.getMockPageBlockDefinitions = getMockPageBlockDefinitions; exports.itemConfigurationToYjs = itemConfigurationToYjs; exports.pageToProsemirrorDoc = pageToProsemirrorDoc; exports.pageToYXmlFragment = pageToYXmlFragment; exports.pmSchema = pmSchema; exports.prosemirrorDocToPage = prosemirrorDocToPage; exports.prosemirrorNodeToBlock = prosemirrorNodeToBlock; exports.serializeAsCustomBlock = serializeAsCustomBlock; exports.yDocToPage = yDocToPage; exports.yXmlFragmentToPage = yXmlFragmentToPage; exports.yjsToDocumentationHierarchy = yjsToDocumentationHierarchy; exports.yjsToItemConfiguration = yjsToItemConfiguration;
|
|
8217
8284
|
//# sourceMappingURL=index.js.map
|