@supernova-studio/client 0.46.6 → 0.46.7
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 +10 -1
- package/dist/index.d.ts +10 -1
- package/dist/index.js +8 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +64 -57
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/dto/index.ts +1 -0
- package/src/api/dto/liveblocks/auth-response.ts +7 -0
- package/src/api/dto/liveblocks/index.ts +1 -0
package/dist/index.mjs
CHANGED
|
@@ -4873,64 +4873,70 @@ var DTOElementsGetOutput = z177.object({
|
|
|
4873
4873
|
figmaNodes: z177.array(DTOFigmaNode).optional()
|
|
4874
4874
|
});
|
|
4875
4875
|
|
|
4876
|
-
// src/api/dto/
|
|
4876
|
+
// src/api/dto/liveblocks/auth-response.ts
|
|
4877
4877
|
import { z as z178 } from "zod";
|
|
4878
|
-
var
|
|
4879
|
-
|
|
4880
|
-
|
|
4878
|
+
var DTOLiveblocksAuthResponse = z178.object({
|
|
4879
|
+
token: z178.string()
|
|
4880
|
+
});
|
|
4881
|
+
|
|
4882
|
+
// src/api/dto/workspaces/integrations.ts
|
|
4883
|
+
import { z as z179 } from "zod";
|
|
4884
|
+
var DTOIntegration = z179.object({
|
|
4885
|
+
id: z179.string(),
|
|
4886
|
+
workspaceId: z179.string(),
|
|
4881
4887
|
type: ExtendedIntegrationType,
|
|
4882
|
-
createdAt:
|
|
4883
|
-
integrationCredentials:
|
|
4884
|
-
integrationDesignSystems:
|
|
4888
|
+
createdAt: z179.coerce.date(),
|
|
4889
|
+
integrationCredentials: z179.array(IntegrationCredentials).optional(),
|
|
4890
|
+
integrationDesignSystems: z179.array(IntegrationDesignSystem).optional()
|
|
4885
4891
|
});
|
|
4886
|
-
var DTOIntegrationOAuthGetResponse =
|
|
4887
|
-
url:
|
|
4892
|
+
var DTOIntegrationOAuthGetResponse = z179.object({
|
|
4893
|
+
url: z179.string()
|
|
4888
4894
|
});
|
|
4889
|
-
var DTOIntegrationPostResponse =
|
|
4895
|
+
var DTOIntegrationPostResponse = z179.object({
|
|
4890
4896
|
integration: DTOIntegration
|
|
4891
4897
|
});
|
|
4892
|
-
var DTOIntegrationsGetListResponse =
|
|
4898
|
+
var DTOIntegrationsGetListResponse = z179.object({
|
|
4893
4899
|
integrations: DTOIntegration.array()
|
|
4894
4900
|
});
|
|
4895
4901
|
|
|
4896
4902
|
// src/api/dto/workspaces/membership.ts
|
|
4897
|
-
import { z as
|
|
4903
|
+
import { z as z182 } from "zod";
|
|
4898
4904
|
|
|
4899
4905
|
// src/api/dto/workspaces/workspace.ts
|
|
4900
|
-
import { z as
|
|
4906
|
+
import { z as z181 } from "zod";
|
|
4901
4907
|
|
|
4902
4908
|
// src/api/dto/workspaces/npm-registry.ts
|
|
4903
|
-
import { z as
|
|
4904
|
-
var DTONpmRegistryConfig =
|
|
4909
|
+
import { z as z180 } from "zod";
|
|
4910
|
+
var DTONpmRegistryConfig = z180.object({
|
|
4905
4911
|
// Registry basic configuration
|
|
4906
4912
|
registryType: NpmRegistryType,
|
|
4907
|
-
registryUrl:
|
|
4908
|
-
customRegistryUrl:
|
|
4913
|
+
registryUrl: z180.string(),
|
|
4914
|
+
customRegistryUrl: z180.string().optional(),
|
|
4909
4915
|
// URL of Supernova NPM packages proxy
|
|
4910
|
-
proxyUrl:
|
|
4916
|
+
proxyUrl: z180.string(),
|
|
4911
4917
|
// Auth configuration
|
|
4912
4918
|
authType: NpmRegistryAuthType,
|
|
4913
|
-
accessToken:
|
|
4914
|
-
username:
|
|
4915
|
-
password:
|
|
4919
|
+
accessToken: z180.literal("redacted").optional(),
|
|
4920
|
+
username: z180.string().optional(),
|
|
4921
|
+
password: z180.literal("redacted").optional(),
|
|
4916
4922
|
// NPM package scopes for whih the proxy should be enabled
|
|
4917
|
-
enabledScopes:
|
|
4923
|
+
enabledScopes: z180.array(z180.string()),
|
|
4918
4924
|
// True if client should bypass Supernova proxy and connect directly to the registry
|
|
4919
4925
|
// (e.g. when the NPM registry is behind a VPN or firewall which prevents Supernova from accessing it)
|
|
4920
|
-
bypassProxy:
|
|
4926
|
+
bypassProxy: z180.boolean()
|
|
4921
4927
|
});
|
|
4922
4928
|
|
|
4923
4929
|
// src/api/dto/workspaces/workspace.ts
|
|
4924
|
-
var DTOWorkspace =
|
|
4925
|
-
id:
|
|
4930
|
+
var DTOWorkspace = z181.object({
|
|
4931
|
+
id: z181.string(),
|
|
4926
4932
|
profile: WorkspaceProfile,
|
|
4927
4933
|
subscription: Subscription,
|
|
4928
4934
|
npmRegistry: DTONpmRegistryConfig.optional()
|
|
4929
4935
|
});
|
|
4930
4936
|
|
|
4931
4937
|
// src/api/dto/workspaces/membership.ts
|
|
4932
|
-
var DTOWorkspaceRole =
|
|
4933
|
-
var DTOUserWorkspaceMembership =
|
|
4938
|
+
var DTOWorkspaceRole = z182.enum(["Owner", "Admin", "Creator", "Viewer", "Billing"]);
|
|
4939
|
+
var DTOUserWorkspaceMembership = z182.object({
|
|
4934
4940
|
// Workspace the user is a member of
|
|
4935
4941
|
workspace: DTOWorkspace,
|
|
4936
4942
|
// Assigned role the user has in the workspace
|
|
@@ -4940,14 +4946,14 @@ var DTOUserWorkspaceMembership = z181.object({
|
|
|
4940
4946
|
// when a workspace's subscription is downgraded to free tier
|
|
4941
4947
|
effectiveRole: DTOWorkspaceRole
|
|
4942
4948
|
});
|
|
4943
|
-
var DTOUserWorkspaceMembershipsResponse =
|
|
4944
|
-
membership:
|
|
4949
|
+
var DTOUserWorkspaceMembershipsResponse = z182.object({
|
|
4950
|
+
membership: z182.array(DTOUserWorkspaceMembership)
|
|
4945
4951
|
});
|
|
4946
4952
|
|
|
4947
4953
|
// src/yjs/design-system-content/documentation-hierarchy.ts
|
|
4948
|
-
import { z as
|
|
4949
|
-
var DocumentationHierarchySettings =
|
|
4950
|
-
routingVersion:
|
|
4954
|
+
import { z as z183 } from "zod";
|
|
4955
|
+
var DocumentationHierarchySettings = z183.object({
|
|
4956
|
+
routingVersion: z183.string()
|
|
4951
4957
|
});
|
|
4952
4958
|
function documentationHierarchyToYjs(doc, transaction) {
|
|
4953
4959
|
doc.transact((trx) => {
|
|
@@ -5018,13 +5024,13 @@ function getInternalSettingsYMap(doc) {
|
|
|
5018
5024
|
}
|
|
5019
5025
|
|
|
5020
5026
|
// src/yjs/design-system-content/item-configuration.ts
|
|
5021
|
-
import { z as
|
|
5022
|
-
var DTODocumentationPageRoomHeaderData =
|
|
5023
|
-
title:
|
|
5027
|
+
import { z as z184 } from "zod";
|
|
5028
|
+
var DTODocumentationPageRoomHeaderData = z184.object({
|
|
5029
|
+
title: z184.string(),
|
|
5024
5030
|
configuration: DTODocumentationItemConfigurationV2
|
|
5025
5031
|
});
|
|
5026
|
-
var DTODocumentationPageRoomHeaderDataUpdate =
|
|
5027
|
-
title:
|
|
5032
|
+
var DTODocumentationPageRoomHeaderDataUpdate = z184.object({
|
|
5033
|
+
title: z184.string().optional(),
|
|
5028
5034
|
configuration: DTODocumentationItemConfigurationV2.omit({ header: true }).extend({ header: DocumentationItemHeaderV2.partial() }).optional()
|
|
5029
5035
|
});
|
|
5030
5036
|
function itemConfigurationToYjs(yDoc, item) {
|
|
@@ -5075,7 +5081,7 @@ function yjsToItemConfiguration(yDoc) {
|
|
|
5075
5081
|
header: rawHeader
|
|
5076
5082
|
};
|
|
5077
5083
|
return {
|
|
5078
|
-
title:
|
|
5084
|
+
title: z184.string().parse(title),
|
|
5079
5085
|
configuration: DTODocumentationItemConfigurationV2.parse(rawConfig)
|
|
5080
5086
|
};
|
|
5081
5087
|
}
|
|
@@ -5085,9 +5091,9 @@ var PageBlockEditorModel = PageBlockEditorModelV2;
|
|
|
5085
5091
|
var PageSectionEditorModel = PageSectionEditorModelV2;
|
|
5086
5092
|
|
|
5087
5093
|
// src/yjs/docs-editor/model/page.ts
|
|
5088
|
-
import { z as
|
|
5089
|
-
var DocumentationPageEditorModel =
|
|
5090
|
-
blocks:
|
|
5094
|
+
import { z as z185 } from "zod";
|
|
5095
|
+
var DocumentationPageEditorModel = z185.object({
|
|
5096
|
+
blocks: z185.array(PageBlockEditorModel.or(PageSectionEditorModel))
|
|
5091
5097
|
});
|
|
5092
5098
|
|
|
5093
5099
|
// src/yjs/docs-editor/prosemirror/schema.ts
|
|
@@ -8059,7 +8065,7 @@ var blocks = [
|
|
|
8059
8065
|
|
|
8060
8066
|
// src/yjs/docs-editor/prosemirror-to-blocks.ts
|
|
8061
8067
|
import { yXmlFragmentToProsemirrorJSON } from "y-prosemirror";
|
|
8062
|
-
import { z as
|
|
8068
|
+
import { z as z186 } from "zod";
|
|
8063
8069
|
function yDocToPage(yDoc, definitions) {
|
|
8064
8070
|
return yXmlFragmentToPage(yDoc.getXmlFragment("default"), definitions);
|
|
8065
8071
|
}
|
|
@@ -8102,7 +8108,7 @@ function prosemirrorNodeToSectionItem(prosemirrorNode, definitionsMap) {
|
|
|
8102
8108
|
return null;
|
|
8103
8109
|
return {
|
|
8104
8110
|
id,
|
|
8105
|
-
title: getProsemirrorAttribute(prosemirrorNode, "title",
|
|
8111
|
+
title: getProsemirrorAttribute(prosemirrorNode, "title", z186.string()) ?? "",
|
|
8106
8112
|
columns: (prosemirrorNode.content ?? []).filter((c) => c.type === "sectionItemColumn").map((c) => prosemirrorNodeToSectionColumns(c, definitionsMap)).filter(nonNullFilter)
|
|
8107
8113
|
};
|
|
8108
8114
|
}
|
|
@@ -8137,7 +8143,7 @@ function internalProsemirrorNodesToBlocks(prosemirrorNodes, definitionsMap, dept
|
|
|
8137
8143
|
});
|
|
8138
8144
|
}
|
|
8139
8145
|
function internalProsemirrorNodeToBlock(prosemirrorNode, definitionsMap, depth) {
|
|
8140
|
-
const definitionId = getProsemirrorAttribute(prosemirrorNode, "definitionId",
|
|
8146
|
+
const definitionId = getProsemirrorAttribute(prosemirrorNode, "definitionId", z186.string());
|
|
8141
8147
|
if (!definitionId) {
|
|
8142
8148
|
console.warn(`definitionId on ${prosemirrorNode.type} is required to be interpreted as a block, skipping node`);
|
|
8143
8149
|
return [];
|
|
@@ -8179,7 +8185,7 @@ function parseAsRichText(prosemirrorNode, definition, property) {
|
|
|
8179
8185
|
if (!id)
|
|
8180
8186
|
return null;
|
|
8181
8187
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
8182
|
-
const calloutType = parseCalloutType(getProsemirrorAttribute(prosemirrorNode, "type",
|
|
8188
|
+
const calloutType = parseCalloutType(getProsemirrorAttribute(prosemirrorNode, "type", z186.string().optional()));
|
|
8183
8189
|
return {
|
|
8184
8190
|
// TODO Artem: indent
|
|
8185
8191
|
id,
|
|
@@ -8306,10 +8312,10 @@ function parseRichTextAttribute(mark) {
|
|
|
8306
8312
|
return null;
|
|
8307
8313
|
}
|
|
8308
8314
|
function parseProsemirrorLink(mark) {
|
|
8309
|
-
const href = getProsemirrorAttribute(mark, "href",
|
|
8315
|
+
const href = getProsemirrorAttribute(mark, "href", z186.string().optional());
|
|
8310
8316
|
if (!href)
|
|
8311
8317
|
return null;
|
|
8312
|
-
const target = getProsemirrorAttribute(mark, "target",
|
|
8318
|
+
const target = getProsemirrorAttribute(mark, "target", z186.string().optional());
|
|
8313
8319
|
const openInNewTab = target === "_blank";
|
|
8314
8320
|
if (href.startsWith("@")) {
|
|
8315
8321
|
return {
|
|
@@ -8332,7 +8338,7 @@ function parseAsTable(prosemirrorNode, definition, property) {
|
|
|
8332
8338
|
if (!id)
|
|
8333
8339
|
return null;
|
|
8334
8340
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
8335
|
-
const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder",
|
|
8341
|
+
const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", z186.boolean().optional()) !== false;
|
|
8336
8342
|
const tableChild = prosemirrorNode.content?.find((c) => c.type === "table");
|
|
8337
8343
|
if (!tableChild) {
|
|
8338
8344
|
return emptyTable(id, variantId, 0);
|
|
@@ -8379,9 +8385,9 @@ function parseAsTableCell(prosemirrorNode) {
|
|
|
8379
8385
|
const id = getProsemirrorBlockId(prosemirrorNode);
|
|
8380
8386
|
if (!id)
|
|
8381
8387
|
return null;
|
|
8382
|
-
const textAlign = getProsemirrorAttribute(prosemirrorNode, "textAlign",
|
|
8388
|
+
const textAlign = getProsemirrorAttribute(prosemirrorNode, "textAlign", z186.string().optional());
|
|
8383
8389
|
let columnWidth;
|
|
8384
|
-
const columnWidthArray = getProsemirrorAttribute(prosemirrorNode, "colwidth",
|
|
8390
|
+
const columnWidthArray = getProsemirrorAttribute(prosemirrorNode, "colwidth", z186.array(z186.number()).optional());
|
|
8385
8391
|
if (columnWidthArray) {
|
|
8386
8392
|
columnWidth = columnWidthArray[0];
|
|
8387
8393
|
}
|
|
@@ -8419,7 +8425,7 @@ function parseAsTableNode(prosemirrorNode) {
|
|
|
8419
8425
|
value: parseRichText(prosemirrorNode.content ?? [])
|
|
8420
8426
|
};
|
|
8421
8427
|
case "image":
|
|
8422
|
-
const items = getProsemirrorAttribute(prosemirrorNode, "items",
|
|
8428
|
+
const items = getProsemirrorAttribute(prosemirrorNode, "items", z186.string());
|
|
8423
8429
|
if (!items)
|
|
8424
8430
|
return null;
|
|
8425
8431
|
const parsedItems = PageBlockItemV2.array().safeParse(JSON.parse(items));
|
|
@@ -8524,7 +8530,7 @@ function parseAsCustomBlock(prosemirrorNode, definition) {
|
|
|
8524
8530
|
};
|
|
8525
8531
|
}
|
|
8526
8532
|
function parseBlockItems(prosemirrorNode, definition) {
|
|
8527
|
-
const itemsString = getProsemirrorAttribute(prosemirrorNode, "items",
|
|
8533
|
+
const itemsString = getProsemirrorAttribute(prosemirrorNode, "items", z186.string());
|
|
8528
8534
|
if (!itemsString)
|
|
8529
8535
|
return null;
|
|
8530
8536
|
const itemsJson = JSON.parse(itemsString);
|
|
@@ -8536,18 +8542,18 @@ function parseBlockItems(prosemirrorNode, definition) {
|
|
|
8536
8542
|
}
|
|
8537
8543
|
function parseAppearance(prosemirrorNode) {
|
|
8538
8544
|
let appearance = {};
|
|
8539
|
-
const rawAppearanceString = getProsemirrorAttribute(prosemirrorNode, "appearance",
|
|
8545
|
+
const rawAppearanceString = getProsemirrorAttribute(prosemirrorNode, "appearance", z186.string().optional());
|
|
8540
8546
|
if (rawAppearanceString) {
|
|
8541
8547
|
const parsedAppearance = PageBlockAppearanceV2.safeParse(JSON.parse(rawAppearanceString));
|
|
8542
8548
|
if (parsedAppearance.success) {
|
|
8543
8549
|
appearance = parsedAppearance.data;
|
|
8544
8550
|
}
|
|
8545
8551
|
}
|
|
8546
|
-
const columns = getProsemirrorAttribute(prosemirrorNode, "columns",
|
|
8552
|
+
const columns = getProsemirrorAttribute(prosemirrorNode, "columns", z186.number().optional());
|
|
8547
8553
|
if (columns) {
|
|
8548
8554
|
appearance.numberOfColumns = columns;
|
|
8549
8555
|
}
|
|
8550
|
-
const backgroundColor = getProsemirrorAttribute(prosemirrorNode, "backgroundColor",
|
|
8556
|
+
const backgroundColor = getProsemirrorAttribute(prosemirrorNode, "backgroundColor", z186.string().optional());
|
|
8551
8557
|
if (backgroundColor) {
|
|
8552
8558
|
const parsedColor = PageBlockColorV2.safeParse(JSON.parse(backgroundColor));
|
|
8553
8559
|
if (parsedColor.success) {
|
|
@@ -8638,13 +8644,13 @@ function valueSchemaForPropertyType(type) {
|
|
|
8638
8644
|
}
|
|
8639
8645
|
}
|
|
8640
8646
|
function getProsemirrorBlockId(prosemirrorNode) {
|
|
8641
|
-
const id = getProsemirrorAttribute(prosemirrorNode, "id",
|
|
8647
|
+
const id = getProsemirrorAttribute(prosemirrorNode, "id", z186.string());
|
|
8642
8648
|
if (!id)
|
|
8643
8649
|
console.warn(`Prosemirror attribute "id" on ${prosemirrorNode.type} is required`);
|
|
8644
8650
|
return id;
|
|
8645
8651
|
}
|
|
8646
8652
|
function getProsemirrorBlockVariantId(prosemirrorNode) {
|
|
8647
|
-
return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(
|
|
8653
|
+
return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(z186.string()));
|
|
8648
8654
|
}
|
|
8649
8655
|
function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
|
|
8650
8656
|
const parsedAttr = validationSchema.safeParse(prosemirrorNode.attrs?.[attributeName]);
|
|
@@ -8764,6 +8770,7 @@ export {
|
|
|
8764
8770
|
DTOIntegrationPostResponse,
|
|
8765
8771
|
DTOIntegrationsGetListResponse,
|
|
8766
8772
|
DTOLiveblocksAuthRequest,
|
|
8773
|
+
DTOLiveblocksAuthResponse,
|
|
8767
8774
|
DTOMoveDocumentationGroupInput,
|
|
8768
8775
|
DTOMoveDocumentationPageInputV2,
|
|
8769
8776
|
DTONpmRegistryConfig,
|