@supernova-studio/client 0.47.29 → 0.47.30
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 +77 -1
- package/dist/index.d.ts +77 -1
- package/dist/index.js +253 -232
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +238 -217
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/yjs/docs-editor/prosemirror-to-blocks.ts +0 -1
package/dist/index.js
CHANGED
|
@@ -153,6 +153,7 @@ var _ipcidr = require('ip-cidr'); var _ipcidr2 = _interopRequireDefault(_ipcidr)
|
|
|
153
153
|
|
|
154
154
|
|
|
155
155
|
|
|
156
|
+
var _slugify = require('@sindresorhus/slugify'); var _slugify2 = _interopRequireDefault(_slugify);
|
|
156
157
|
|
|
157
158
|
|
|
158
159
|
|
|
@@ -162,7 +163,6 @@ var _ipcidr = require('ip-cidr'); var _ipcidr2 = _interopRequireDefault(_ipcidr)
|
|
|
162
163
|
|
|
163
164
|
|
|
164
165
|
|
|
165
|
-
var _slugify = require('@sindresorhus/slugify'); var _slugify2 = _interopRequireDefault(_slugify);
|
|
166
166
|
var AssetDeleteScheduleStatus = _zod.z.enum(["InProgress", "Pending"]);
|
|
167
167
|
var AssetDeleteSchedule = _zod.z.object({
|
|
168
168
|
id: _zod.z.string(),
|
|
@@ -2774,10 +2774,12 @@ var ExportJobContext = _zod.z.object({
|
|
|
2774
2774
|
apiUrl: _zod.z.string(),
|
|
2775
2775
|
accessToken: _zod.z.string(),
|
|
2776
2776
|
designSystemId: _zod.z.string(),
|
|
2777
|
+
designSystemName: _zod.z.string(),
|
|
2777
2778
|
exporterId: _zod.z.string(),
|
|
2778
2779
|
versionId: _zod.z.string(),
|
|
2779
2780
|
brandId: _zod.z.string().optional(),
|
|
2780
2781
|
themeId: _zod.z.string().optional(),
|
|
2782
|
+
exporterName: _zod.z.string(),
|
|
2781
2783
|
exporterPackageUrl: _zod.z.string(),
|
|
2782
2784
|
exporterPropertyValues: ExporterPropertyValue.array(),
|
|
2783
2785
|
documentation: ExportJobDocumentationContext.optional()
|
|
@@ -2879,7 +2881,9 @@ var ExportJobS3DestinationResult = _zod.z.object({
|
|
|
2879
2881
|
bucket: _zod.z.string(),
|
|
2880
2882
|
urlPrefix: _zod.z.string().optional(),
|
|
2881
2883
|
path: _zod.z.string(),
|
|
2882
|
-
files: _zod.z.array(_zod.z.string())
|
|
2884
|
+
files: _zod.z.array(_zod.z.string()),
|
|
2885
|
+
url: nullishToOptional(_zod.z.string()),
|
|
2886
|
+
urls: nullishToOptional(_zod.z.string().array())
|
|
2883
2887
|
});
|
|
2884
2888
|
var ExportJobDocsDestinationResult = _zod.z.object({
|
|
2885
2889
|
url: _zod.z.string()
|
|
@@ -2986,7 +2990,7 @@ var PulsarCustomBlock = _zod.z.object({
|
|
|
2986
2990
|
});
|
|
2987
2991
|
var ExporterType = _zod.z.enum(["code", "documentation"]);
|
|
2988
2992
|
var ExporterSource = _zod.z.enum(["git", "upload"]);
|
|
2989
|
-
var ExporterTag = _zod.z.string()
|
|
2993
|
+
var ExporterTag = _zod.z.string();
|
|
2990
2994
|
var ExporterPulsarDetails = _zod.z.object({
|
|
2991
2995
|
description: _zod.z.string(),
|
|
2992
2996
|
version: _zod.z.string(),
|
|
@@ -3103,203 +3107,6 @@ var GitBranch = _zod.z.object({
|
|
|
3103
3107
|
name: _zod.z.string(),
|
|
3104
3108
|
lastCommitId: _zod.z.string()
|
|
3105
3109
|
});
|
|
3106
|
-
var IntegrationDesignSystem = _zod.z.object({
|
|
3107
|
-
designSystemId: _zod.z.string(),
|
|
3108
|
-
brandId: _zod.z.string(),
|
|
3109
|
-
title: _zod.z.string().optional(),
|
|
3110
|
-
userId: _zod.z.string().optional(),
|
|
3111
|
-
date: _zod.z.coerce.date().optional()
|
|
3112
|
-
});
|
|
3113
|
-
var IntegrationCredentialsType = _zod.z.enum(["OAuth2", "PAT", "GithubApp"]);
|
|
3114
|
-
var IntegrationCredentialsState = _zod.z.enum(["Active", "Inactive"]);
|
|
3115
|
-
var IntegrationCredentialsProfile = _zod.z.object({
|
|
3116
|
-
id: nullishToOptional(_zod.z.string()),
|
|
3117
|
-
email: nullishToOptional(_zod.z.string()),
|
|
3118
|
-
handle: nullishToOptional(_zod.z.string()),
|
|
3119
|
-
type: nullishToOptional(_zod.z.string()),
|
|
3120
|
-
avatarUrl: nullishToOptional(_zod.z.string()),
|
|
3121
|
-
organization: nullishToOptional(_zod.z.string()),
|
|
3122
|
-
collection: nullishToOptional(_zod.z.string())
|
|
3123
|
-
});
|
|
3124
|
-
var IntegrationCredentials = _zod.z.object({
|
|
3125
|
-
id: _zod.z.string(),
|
|
3126
|
-
type: IntegrationCredentialsType,
|
|
3127
|
-
integrationId: _zod.z.string(),
|
|
3128
|
-
accessToken: _zod.z.string(),
|
|
3129
|
-
userId: _zod.z.string(),
|
|
3130
|
-
createdAt: _zod.z.coerce.date(),
|
|
3131
|
-
refreshToken: _zod.z.string().optional(),
|
|
3132
|
-
tokenName: _zod.z.string().optional(),
|
|
3133
|
-
expiresAt: _zod.z.coerce.date().optional(),
|
|
3134
|
-
refreshedAt: _zod.z.coerce.date().optional(),
|
|
3135
|
-
username: _zod.z.string().optional(),
|
|
3136
|
-
appInstallationId: _zod.z.string().optional(),
|
|
3137
|
-
profile: IntegrationCredentialsProfile.optional(),
|
|
3138
|
-
customUrl: _zod.z.string().optional(),
|
|
3139
|
-
state: IntegrationCredentialsState,
|
|
3140
|
-
user: UserMinified.optional()
|
|
3141
|
-
});
|
|
3142
|
-
var ExtendedIntegrationType = _zod.z.enum([
|
|
3143
|
-
"Figma",
|
|
3144
|
-
"Github",
|
|
3145
|
-
"Gitlab",
|
|
3146
|
-
"Bitbucket",
|
|
3147
|
-
"Azure",
|
|
3148
|
-
"TokenStudio",
|
|
3149
|
-
"FigmaVariablesPlugin"
|
|
3150
|
-
]);
|
|
3151
|
-
var IntegrationType = ExtendedIntegrationType.exclude(["TokenStudio", "FigmaVariablesPlugin"]);
|
|
3152
|
-
var GitIntegrationType = IntegrationType.exclude(["Figma"]);
|
|
3153
|
-
var Integration = _zod.z.object({
|
|
3154
|
-
id: _zod.z.string(),
|
|
3155
|
-
workspaceId: _zod.z.string(),
|
|
3156
|
-
type: IntegrationType,
|
|
3157
|
-
createdAt: _zod.z.coerce.date(),
|
|
3158
|
-
integrationCredentials: _zod.z.array(IntegrationCredentials).optional()
|
|
3159
|
-
});
|
|
3160
|
-
var IntegrationToken = _zod.z.object({
|
|
3161
|
-
access_token: _zod.z.string(),
|
|
3162
|
-
refresh_token: _zod.z.string().optional(),
|
|
3163
|
-
expires_in: _zod.z.union([_zod.z.number().optional(), _zod.z.string().optional()]),
|
|
3164
|
-
token_type: _zod.z.string().optional(),
|
|
3165
|
-
token_name: _zod.z.string().optional(),
|
|
3166
|
-
token_azure_organization_name: _zod.z.string().optional(),
|
|
3167
|
-
// Azure Cloud PAT only
|
|
3168
|
-
token_azure_collection_name: _zod.z.string().optional(),
|
|
3169
|
-
// Azure Server PAT only
|
|
3170
|
-
token_bitbucket_username: _zod.z.string().optional(),
|
|
3171
|
-
// Bitbucket only
|
|
3172
|
-
custom_url: _zod.z.string().url().optional().transform((value) => value && formatCustomUrl(value))
|
|
3173
|
-
}).refine((data) => {
|
|
3174
|
-
if (data.custom_url && data.token_azure_organization_name) {
|
|
3175
|
-
return false;
|
|
3176
|
-
}
|
|
3177
|
-
return true;
|
|
3178
|
-
}, "Custom URL and Azure organization name cannot be present at the same time").transform((data) => {
|
|
3179
|
-
return {
|
|
3180
|
-
accessToken: data.access_token,
|
|
3181
|
-
refreshToken: data.refresh_token,
|
|
3182
|
-
expiresIn: typeof data.expires_in === "string" ? Number(data.expires_in) : data.expires_in,
|
|
3183
|
-
tokenType: data.token_type,
|
|
3184
|
-
tokenName: data.token_name,
|
|
3185
|
-
tokenBitbucketUsername: data.token_bitbucket_username,
|
|
3186
|
-
tokenAzureOrganizationName: data.token_azure_organization_name,
|
|
3187
|
-
tokenAzureCollection: data.token_azure_collection_name,
|
|
3188
|
-
customUrl: data.custom_url
|
|
3189
|
-
};
|
|
3190
|
-
});
|
|
3191
|
-
var forbiddenCustomUrlDomainList = ["github.com", "gitlab.com", "bitbucket.org", "figma.com", "dev.azure.com"];
|
|
3192
|
-
function formatCustomUrl(url) {
|
|
3193
|
-
let formattedUrl = url.trim().toLowerCase();
|
|
3194
|
-
if (!formattedUrl.startsWith("http://") && !formattedUrl.startsWith("https://")) {
|
|
3195
|
-
formattedUrl = "https://" + formattedUrl;
|
|
3196
|
-
}
|
|
3197
|
-
if (formattedUrl.endsWith("/")) {
|
|
3198
|
-
formattedUrl = formattedUrl.slice(0, -1);
|
|
3199
|
-
}
|
|
3200
|
-
return forbiddenCustomUrlDomainList.some((domain) => formattedUrl.includes(domain)) ? void 0 : formattedUrl;
|
|
3201
|
-
}
|
|
3202
|
-
var IntegrationTokenSchemaOld = _zod.z.object({
|
|
3203
|
-
id: _zod.z.string(),
|
|
3204
|
-
provider: OAuthProviderSchema,
|
|
3205
|
-
scope: _zod.z.string(),
|
|
3206
|
-
userId: _zod.z.string(),
|
|
3207
|
-
accessToken: _zod.z.string(),
|
|
3208
|
-
refreshToken: _zod.z.string(),
|
|
3209
|
-
expiresAt: _zod.z.coerce.date(),
|
|
3210
|
-
externalUserId: _zod.z.string().nullish()
|
|
3211
|
-
});
|
|
3212
|
-
var WorkspaceOAuthRequestSchema = _zod.z.object({
|
|
3213
|
-
id: _zod.z.string(),
|
|
3214
|
-
workspaceId: _zod.z.string(),
|
|
3215
|
-
provider: OAuthProviderSchema,
|
|
3216
|
-
userId: _zod.z.string(),
|
|
3217
|
-
createdAt: _zod.z.coerce.date()
|
|
3218
|
-
});
|
|
3219
|
-
var DesignSystemVersionRoom = Entity.extend({
|
|
3220
|
-
designSystemVersionId: _zod.z.string(),
|
|
3221
|
-
liveblocksId: _zod.z.string()
|
|
3222
|
-
});
|
|
3223
|
-
var DesignSystemVersionRoomInternalSettings = _zod.z.object({
|
|
3224
|
-
routingVersion: _zod.z.string()
|
|
3225
|
-
});
|
|
3226
|
-
var DesignSystemVersionRoomInitialState = _zod.z.object({
|
|
3227
|
-
pages: _zod.z.array(DocumentationPageV2),
|
|
3228
|
-
groups: _zod.z.array(ElementGroup),
|
|
3229
|
-
internalSettings: DesignSystemVersionRoomInternalSettings
|
|
3230
|
-
});
|
|
3231
|
-
var DesignSystemVersionRoomUpdate = _zod.z.object({
|
|
3232
|
-
pages: _zod.z.array(DocumentationPageV2),
|
|
3233
|
-
groups: _zod.z.array(ElementGroup),
|
|
3234
|
-
deletedPageIds: _zod.z.array(_zod.z.string()),
|
|
3235
|
-
deletedGroupIds: _zod.z.array(_zod.z.string())
|
|
3236
|
-
});
|
|
3237
|
-
var DocumentationPageRoom = Entity.extend({
|
|
3238
|
-
designSystemVersionId: _zod.z.string(),
|
|
3239
|
-
documentationPageId: _zod.z.string(),
|
|
3240
|
-
liveblocksId: _zod.z.string(),
|
|
3241
|
-
isDirty: _zod.z.boolean()
|
|
3242
|
-
});
|
|
3243
|
-
var DocumentationPageRoomState = _zod.z.object({
|
|
3244
|
-
pageItems: _zod.z.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
|
|
3245
|
-
itemConfiguration: DocumentationItemConfigurationV2
|
|
3246
|
-
});
|
|
3247
|
-
var DocumentationPageRoomRoomUpdate = _zod.z.object({
|
|
3248
|
-
page: DocumentationPageV2,
|
|
3249
|
-
pageParent: ElementGroup
|
|
3250
|
-
});
|
|
3251
|
-
var DocumentationPageRoomInitialStateUpdate = DocumentationPageRoomRoomUpdate.extend({
|
|
3252
|
-
pageItems: _zod.z.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
|
|
3253
|
-
blockDefinitions: _zod.z.array(PageBlockDefinition)
|
|
3254
|
-
});
|
|
3255
|
-
var RoomTypeEnum = /* @__PURE__ */ ((RoomTypeEnum2) => {
|
|
3256
|
-
RoomTypeEnum2["DocumentationPage"] = "documentation-page";
|
|
3257
|
-
RoomTypeEnum2["DesignSystemVersion"] = "design-system-version";
|
|
3258
|
-
RoomTypeEnum2["Workspace"] = "workspace";
|
|
3259
|
-
return RoomTypeEnum2;
|
|
3260
|
-
})(RoomTypeEnum || {});
|
|
3261
|
-
var RoomTypeSchema = _zod.z.nativeEnum(RoomTypeEnum);
|
|
3262
|
-
var RoomType = RoomTypeSchema.enum;
|
|
3263
|
-
var WorkspaceRoom = Entity.extend({
|
|
3264
|
-
workspaceId: _zod.z.string(),
|
|
3265
|
-
liveblocksId: _zod.z.string()
|
|
3266
|
-
});
|
|
3267
|
-
var AnyRecord = _zod.z.record(_zod.z.any());
|
|
3268
|
-
var NpmPackageVersionDist = AnyRecord.and(
|
|
3269
|
-
_zod.z.object({
|
|
3270
|
-
tarball: _zod.z.string()
|
|
3271
|
-
})
|
|
3272
|
-
);
|
|
3273
|
-
var NpmPackageVersion = AnyRecord.and(
|
|
3274
|
-
_zod.z.object({
|
|
3275
|
-
dist: NpmPackageVersionDist
|
|
3276
|
-
})
|
|
3277
|
-
);
|
|
3278
|
-
var NpmPackage = AnyRecord.and(
|
|
3279
|
-
_zod.z.object({
|
|
3280
|
-
_id: _zod.z.string(),
|
|
3281
|
-
name: _zod.z.string(),
|
|
3282
|
-
// e.g. "latest": "1.2.3"
|
|
3283
|
-
"dist-tags": _zod.z.record(_zod.z.string(), _zod.z.string()),
|
|
3284
|
-
// "1.2.3": {...}
|
|
3285
|
-
versions: _zod.z.record(NpmPackageVersion)
|
|
3286
|
-
})
|
|
3287
|
-
);
|
|
3288
|
-
var NpmProxyTokenPayload = _zod.z.object({
|
|
3289
|
-
npmProxyRegistryConfigId: _zod.z.string()
|
|
3290
|
-
});
|
|
3291
|
-
var PersonalAccessToken = _zod.z.object({
|
|
3292
|
-
id: _zod.z.string(),
|
|
3293
|
-
userId: _zod.z.string(),
|
|
3294
|
-
workspaceId: _zod.z.string().optional(),
|
|
3295
|
-
workspaceRole: WorkspaceRoleSchema.optional(),
|
|
3296
|
-
name: _zod.z.string(),
|
|
3297
|
-
hidden: _zod.z.boolean(),
|
|
3298
|
-
token: _zod.z.string(),
|
|
3299
|
-
scope: _zod.z.string().optional(),
|
|
3300
|
-
createdAt: _zod.z.coerce.date(),
|
|
3301
|
-
expireAt: _zod.z.coerce.date().optional()
|
|
3302
|
-
});
|
|
3303
3110
|
var SupernovaException = class _SupernovaException extends Error {
|
|
3304
3111
|
//
|
|
3305
3112
|
// Properties
|
|
@@ -3375,6 +3182,18 @@ var SupernovaException = class _SupernovaException extends Error {
|
|
|
3375
3182
|
return new _SupernovaException("BadRequest", message);
|
|
3376
3183
|
}
|
|
3377
3184
|
};
|
|
3185
|
+
function tryParseUrl(url) {
|
|
3186
|
+
try {
|
|
3187
|
+
return parseUrl(url);
|
|
3188
|
+
} catch (e) {
|
|
3189
|
+
console.error(`Error parsing URL ${url}`);
|
|
3190
|
+
console.error(e);
|
|
3191
|
+
return null;
|
|
3192
|
+
}
|
|
3193
|
+
}
|
|
3194
|
+
function parseUrl(url) {
|
|
3195
|
+
return new URL(url.startsWith("https://") || url.startsWith("http://") ? url : `https://${url}`);
|
|
3196
|
+
}
|
|
3378
3197
|
function mapByUnique(items, keyFn) {
|
|
3379
3198
|
const result = /* @__PURE__ */ new Map();
|
|
3380
3199
|
for (const item of items) {
|
|
@@ -4040,6 +3859,209 @@ var RESERVED_SLUGS = [
|
|
|
4040
3859
|
"super-nova"
|
|
4041
3860
|
];
|
|
4042
3861
|
var RESERVED_SLUGS_SET = new Set(RESERVED_SLUGS);
|
|
3862
|
+
var IntegrationDesignSystem = _zod.z.object({
|
|
3863
|
+
designSystemId: _zod.z.string(),
|
|
3864
|
+
brandId: _zod.z.string(),
|
|
3865
|
+
title: _zod.z.string().optional(),
|
|
3866
|
+
userId: _zod.z.string().optional(),
|
|
3867
|
+
date: _zod.z.coerce.date().optional()
|
|
3868
|
+
});
|
|
3869
|
+
var IntegrationCredentialsType = _zod.z.enum(["OAuth2", "PAT", "GithubApp"]);
|
|
3870
|
+
var IntegrationCredentialsState = _zod.z.enum(["Active", "Inactive"]);
|
|
3871
|
+
var IntegrationCredentialsProfile = _zod.z.object({
|
|
3872
|
+
id: nullishToOptional(_zod.z.string()),
|
|
3873
|
+
email: nullishToOptional(_zod.z.string()),
|
|
3874
|
+
handle: nullishToOptional(_zod.z.string()),
|
|
3875
|
+
type: nullishToOptional(_zod.z.string()),
|
|
3876
|
+
avatarUrl: nullishToOptional(_zod.z.string()),
|
|
3877
|
+
organization: nullishToOptional(_zod.z.string()),
|
|
3878
|
+
collection: nullishToOptional(_zod.z.string())
|
|
3879
|
+
});
|
|
3880
|
+
var IntegrationCredentials = _zod.z.object({
|
|
3881
|
+
id: _zod.z.string(),
|
|
3882
|
+
type: IntegrationCredentialsType,
|
|
3883
|
+
integrationId: _zod.z.string(),
|
|
3884
|
+
accessToken: _zod.z.string(),
|
|
3885
|
+
userId: _zod.z.string(),
|
|
3886
|
+
createdAt: _zod.z.coerce.date(),
|
|
3887
|
+
refreshToken: _zod.z.string().optional(),
|
|
3888
|
+
tokenName: _zod.z.string().optional(),
|
|
3889
|
+
expiresAt: _zod.z.coerce.date().optional(),
|
|
3890
|
+
refreshedAt: _zod.z.coerce.date().optional(),
|
|
3891
|
+
username: _zod.z.string().optional(),
|
|
3892
|
+
appInstallationId: _zod.z.string().optional(),
|
|
3893
|
+
profile: IntegrationCredentialsProfile.optional(),
|
|
3894
|
+
customUrl: _zod.z.string().optional(),
|
|
3895
|
+
state: IntegrationCredentialsState,
|
|
3896
|
+
user: UserMinified.optional()
|
|
3897
|
+
});
|
|
3898
|
+
var ExtendedIntegrationType = _zod.z.enum([
|
|
3899
|
+
"Figma",
|
|
3900
|
+
"Github",
|
|
3901
|
+
"Gitlab",
|
|
3902
|
+
"Bitbucket",
|
|
3903
|
+
"Azure",
|
|
3904
|
+
"TokenStudio",
|
|
3905
|
+
"FigmaVariablesPlugin"
|
|
3906
|
+
]);
|
|
3907
|
+
var IntegrationType = ExtendedIntegrationType.exclude(["TokenStudio", "FigmaVariablesPlugin"]);
|
|
3908
|
+
var GitIntegrationType = IntegrationType.exclude(["Figma"]);
|
|
3909
|
+
var Integration = _zod.z.object({
|
|
3910
|
+
id: _zod.z.string(),
|
|
3911
|
+
workspaceId: _zod.z.string(),
|
|
3912
|
+
type: IntegrationType,
|
|
3913
|
+
createdAt: _zod.z.coerce.date(),
|
|
3914
|
+
integrationCredentials: _zod.z.array(IntegrationCredentials).optional()
|
|
3915
|
+
});
|
|
3916
|
+
var IntegrationToken = _zod.z.object({
|
|
3917
|
+
access_token: _zod.z.string(),
|
|
3918
|
+
refresh_token: _zod.z.string().optional(),
|
|
3919
|
+
expires_in: _zod.z.union([_zod.z.number().optional(), _zod.z.string().optional()]),
|
|
3920
|
+
token_type: _zod.z.string().optional(),
|
|
3921
|
+
token_name: _zod.z.string().optional(),
|
|
3922
|
+
token_azure_organization_name: _zod.z.string().optional(),
|
|
3923
|
+
// Azure Cloud PAT only
|
|
3924
|
+
token_azure_collection_name: _zod.z.string().optional(),
|
|
3925
|
+
// Azure Server PAT only
|
|
3926
|
+
token_bitbucket_username: _zod.z.string().optional(),
|
|
3927
|
+
// Bitbucket only
|
|
3928
|
+
custom_url: _zod.z.string().optional().transform((value) => {
|
|
3929
|
+
if (!_optionalChain([value, 'optionalAccess', _3 => _3.trim, 'call', _4 => _4()]))
|
|
3930
|
+
return void 0;
|
|
3931
|
+
return formatCustomUrl(value);
|
|
3932
|
+
})
|
|
3933
|
+
}).refine((data) => {
|
|
3934
|
+
return !data.custom_url || tryParseUrl(data.custom_url);
|
|
3935
|
+
}, "Custom URL must be a valid URL").refine((data) => {
|
|
3936
|
+
if (data.custom_url && data.token_azure_organization_name) {
|
|
3937
|
+
return false;
|
|
3938
|
+
}
|
|
3939
|
+
return true;
|
|
3940
|
+
}, "Custom URL and Azure organization name cannot be present at the same time").transform((data) => {
|
|
3941
|
+
return {
|
|
3942
|
+
accessToken: data.access_token,
|
|
3943
|
+
refreshToken: data.refresh_token,
|
|
3944
|
+
expiresIn: typeof data.expires_in === "string" ? Number(data.expires_in) : data.expires_in,
|
|
3945
|
+
tokenType: data.token_type,
|
|
3946
|
+
tokenName: data.token_name,
|
|
3947
|
+
tokenBitbucketUsername: data.token_bitbucket_username,
|
|
3948
|
+
tokenAzureOrganizationName: data.token_azure_organization_name,
|
|
3949
|
+
tokenAzureCollection: data.token_azure_collection_name,
|
|
3950
|
+
customUrl: data.custom_url
|
|
3951
|
+
};
|
|
3952
|
+
});
|
|
3953
|
+
var forbiddenCustomUrlDomainList = ["github.com", "gitlab.com", "bitbucket.org", "figma.com", "dev.azure.com"];
|
|
3954
|
+
function formatCustomUrl(url) {
|
|
3955
|
+
let formattedUrl = url.trim().toLowerCase();
|
|
3956
|
+
if (!formattedUrl.startsWith("http://") && !formattedUrl.startsWith("https://")) {
|
|
3957
|
+
formattedUrl = "https://" + formattedUrl;
|
|
3958
|
+
}
|
|
3959
|
+
if (formattedUrl.endsWith("/")) {
|
|
3960
|
+
formattedUrl = formattedUrl.slice(0, -1);
|
|
3961
|
+
}
|
|
3962
|
+
return forbiddenCustomUrlDomainList.some((domain) => formattedUrl.includes(domain)) ? void 0 : formattedUrl;
|
|
3963
|
+
}
|
|
3964
|
+
var IntegrationTokenSchemaOld = _zod.z.object({
|
|
3965
|
+
id: _zod.z.string(),
|
|
3966
|
+
provider: OAuthProviderSchema,
|
|
3967
|
+
scope: _zod.z.string(),
|
|
3968
|
+
userId: _zod.z.string(),
|
|
3969
|
+
accessToken: _zod.z.string(),
|
|
3970
|
+
refreshToken: _zod.z.string(),
|
|
3971
|
+
expiresAt: _zod.z.coerce.date(),
|
|
3972
|
+
externalUserId: _zod.z.string().nullish()
|
|
3973
|
+
});
|
|
3974
|
+
var WorkspaceOAuthRequestSchema = _zod.z.object({
|
|
3975
|
+
id: _zod.z.string(),
|
|
3976
|
+
workspaceId: _zod.z.string(),
|
|
3977
|
+
provider: OAuthProviderSchema,
|
|
3978
|
+
userId: _zod.z.string(),
|
|
3979
|
+
createdAt: _zod.z.coerce.date()
|
|
3980
|
+
});
|
|
3981
|
+
var DesignSystemVersionRoom = Entity.extend({
|
|
3982
|
+
designSystemVersionId: _zod.z.string(),
|
|
3983
|
+
liveblocksId: _zod.z.string()
|
|
3984
|
+
});
|
|
3985
|
+
var DesignSystemVersionRoomInternalSettings = _zod.z.object({
|
|
3986
|
+
routingVersion: _zod.z.string()
|
|
3987
|
+
});
|
|
3988
|
+
var DesignSystemVersionRoomInitialState = _zod.z.object({
|
|
3989
|
+
pages: _zod.z.array(DocumentationPageV2),
|
|
3990
|
+
groups: _zod.z.array(ElementGroup),
|
|
3991
|
+
internalSettings: DesignSystemVersionRoomInternalSettings
|
|
3992
|
+
});
|
|
3993
|
+
var DesignSystemVersionRoomUpdate = _zod.z.object({
|
|
3994
|
+
pages: _zod.z.array(DocumentationPageV2),
|
|
3995
|
+
groups: _zod.z.array(ElementGroup),
|
|
3996
|
+
deletedPageIds: _zod.z.array(_zod.z.string()),
|
|
3997
|
+
deletedGroupIds: _zod.z.array(_zod.z.string())
|
|
3998
|
+
});
|
|
3999
|
+
var DocumentationPageRoom = Entity.extend({
|
|
4000
|
+
designSystemVersionId: _zod.z.string(),
|
|
4001
|
+
documentationPageId: _zod.z.string(),
|
|
4002
|
+
liveblocksId: _zod.z.string(),
|
|
4003
|
+
isDirty: _zod.z.boolean()
|
|
4004
|
+
});
|
|
4005
|
+
var DocumentationPageRoomState = _zod.z.object({
|
|
4006
|
+
pageItems: _zod.z.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
|
|
4007
|
+
itemConfiguration: DocumentationItemConfigurationV2
|
|
4008
|
+
});
|
|
4009
|
+
var DocumentationPageRoomRoomUpdate = _zod.z.object({
|
|
4010
|
+
page: DocumentationPageV2,
|
|
4011
|
+
pageParent: ElementGroup
|
|
4012
|
+
});
|
|
4013
|
+
var DocumentationPageRoomInitialStateUpdate = DocumentationPageRoomRoomUpdate.extend({
|
|
4014
|
+
pageItems: _zod.z.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
|
|
4015
|
+
blockDefinitions: _zod.z.array(PageBlockDefinition)
|
|
4016
|
+
});
|
|
4017
|
+
var RoomTypeEnum = /* @__PURE__ */ ((RoomTypeEnum2) => {
|
|
4018
|
+
RoomTypeEnum2["DocumentationPage"] = "documentation-page";
|
|
4019
|
+
RoomTypeEnum2["DesignSystemVersion"] = "design-system-version";
|
|
4020
|
+
RoomTypeEnum2["Workspace"] = "workspace";
|
|
4021
|
+
return RoomTypeEnum2;
|
|
4022
|
+
})(RoomTypeEnum || {});
|
|
4023
|
+
var RoomTypeSchema = _zod.z.nativeEnum(RoomTypeEnum);
|
|
4024
|
+
var RoomType = RoomTypeSchema.enum;
|
|
4025
|
+
var WorkspaceRoom = Entity.extend({
|
|
4026
|
+
workspaceId: _zod.z.string(),
|
|
4027
|
+
liveblocksId: _zod.z.string()
|
|
4028
|
+
});
|
|
4029
|
+
var AnyRecord = _zod.z.record(_zod.z.any());
|
|
4030
|
+
var NpmPackageVersionDist = AnyRecord.and(
|
|
4031
|
+
_zod.z.object({
|
|
4032
|
+
tarball: _zod.z.string()
|
|
4033
|
+
})
|
|
4034
|
+
);
|
|
4035
|
+
var NpmPackageVersion = AnyRecord.and(
|
|
4036
|
+
_zod.z.object({
|
|
4037
|
+
dist: NpmPackageVersionDist
|
|
4038
|
+
})
|
|
4039
|
+
);
|
|
4040
|
+
var NpmPackage = AnyRecord.and(
|
|
4041
|
+
_zod.z.object({
|
|
4042
|
+
_id: _zod.z.string(),
|
|
4043
|
+
name: _zod.z.string(),
|
|
4044
|
+
// e.g. "latest": "1.2.3"
|
|
4045
|
+
"dist-tags": _zod.z.record(_zod.z.string(), _zod.z.string()),
|
|
4046
|
+
// "1.2.3": {...}
|
|
4047
|
+
versions: _zod.z.record(NpmPackageVersion)
|
|
4048
|
+
})
|
|
4049
|
+
);
|
|
4050
|
+
var NpmProxyTokenPayload = _zod.z.object({
|
|
4051
|
+
npmProxyRegistryConfigId: _zod.z.string()
|
|
4052
|
+
});
|
|
4053
|
+
var PersonalAccessToken = _zod.z.object({
|
|
4054
|
+
id: _zod.z.string(),
|
|
4055
|
+
userId: _zod.z.string(),
|
|
4056
|
+
workspaceId: _zod.z.string().optional(),
|
|
4057
|
+
workspaceRole: WorkspaceRoleSchema.optional(),
|
|
4058
|
+
name: _zod.z.string(),
|
|
4059
|
+
hidden: _zod.z.boolean(),
|
|
4060
|
+
token: _zod.z.string(),
|
|
4061
|
+
scope: _zod.z.string().optional(),
|
|
4062
|
+
createdAt: _zod.z.coerce.date(),
|
|
4063
|
+
expireAt: _zod.z.coerce.date().optional()
|
|
4064
|
+
});
|
|
4043
4065
|
|
|
4044
4066
|
// src/api/conversion/documentation/documentation-item-configuration-v2-to-dto.ts
|
|
4045
4067
|
var getDtoDefaultItemConfigurationV2 = () => ({
|
|
@@ -4097,7 +4119,7 @@ function calculateElementParentChain(elementParentPersistentId, groupPersistentI
|
|
|
4097
4119
|
const parent = groupPersistentIdToGroupMap.get(parentId);
|
|
4098
4120
|
if (parent)
|
|
4099
4121
|
result.push(parent);
|
|
4100
|
-
parentId = _optionalChain([parent, 'optionalAccess',
|
|
4122
|
+
parentId = _optionalChain([parent, 'optionalAccess', _5 => _5.parentPersistentId]);
|
|
4101
4123
|
}
|
|
4102
4124
|
return result;
|
|
4103
4125
|
}
|
|
@@ -4106,7 +4128,7 @@ function applyPrivacyConfigurationToNestedItems(pages, groups, getDefaultItemCon
|
|
|
4106
4128
|
...group,
|
|
4107
4129
|
data: {
|
|
4108
4130
|
...group.data,
|
|
4109
|
-
configuration: _nullishCoalesce(_optionalChain([group, 'access',
|
|
4131
|
+
configuration: _nullishCoalesce(_optionalChain([group, 'access', _6 => _6.data, 'optionalAccess', _7 => _7.configuration]), () => ( getDefaultItemConfiguration()))
|
|
4110
4132
|
}
|
|
4111
4133
|
}));
|
|
4112
4134
|
const groupPersistentIdToGroupMap = mapByUnique(fixedGroups, (group) => group.persistentId);
|
|
@@ -4118,8 +4140,8 @@ function applyPrivacyConfigurationToNestedItems(pages, groups, getDefaultItemCon
|
|
|
4118
4140
|
const parent = groupPersistentIdToGroupMap.get(nextParentId);
|
|
4119
4141
|
if (!parent)
|
|
4120
4142
|
break;
|
|
4121
|
-
isHidden = isHidden || _optionalChain([parent, 'access',
|
|
4122
|
-
isPrivate = isPrivate || _optionalChain([parent, 'access',
|
|
4143
|
+
isHidden = isHidden || _optionalChain([parent, 'access', _8 => _8.data, 'optionalAccess', _9 => _9.configuration, 'optionalAccess', _10 => _10.isHidden]) || false;
|
|
4144
|
+
isPrivate = isPrivate || _optionalChain([parent, 'access', _11 => _11.data, 'optionalAccess', _12 => _12.configuration, 'optionalAccess', _13 => _13.isPrivate]) || false;
|
|
4123
4145
|
nextParentId = parent.parentPersistentId;
|
|
4124
4146
|
}
|
|
4125
4147
|
groupToFix.data.configuration.isHidden = isHidden;
|
|
@@ -4127,7 +4149,7 @@ function applyPrivacyConfigurationToNestedItems(pages, groups, getDefaultItemCon
|
|
|
4127
4149
|
}
|
|
4128
4150
|
const fixedPages = [];
|
|
4129
4151
|
for (const page of pages) {
|
|
4130
|
-
const configuration = _nullishCoalesce(_optionalChain([page, 'access',
|
|
4152
|
+
const configuration = _nullishCoalesce(_optionalChain([page, 'access', _14 => _14.data, 'optionalAccess', _15 => _15.configuration]), () => ( getDefaultItemConfiguration()));
|
|
4131
4153
|
const parent = groupPersistentIdToGroupMap.get(page.parentPersistentId);
|
|
4132
4154
|
fixedPages.push({
|
|
4133
4155
|
...page,
|
|
@@ -4135,8 +4157,8 @@ function applyPrivacyConfigurationToNestedItems(pages, groups, getDefaultItemCon
|
|
|
4135
4157
|
...page.data,
|
|
4136
4158
|
configuration: {
|
|
4137
4159
|
...configuration,
|
|
4138
|
-
isHidden: configuration.isHidden || _optionalChain([parent, 'optionalAccess',
|
|
4139
|
-
isPrivate: configuration.isPrivate || _optionalChain([parent, 'optionalAccess',
|
|
4160
|
+
isHidden: configuration.isHidden || _optionalChain([parent, 'optionalAccess', _16 => _16.data, 'optionalAccess', _17 => _17.configuration, 'optionalAccess', _18 => _18.isHidden]) || false,
|
|
4161
|
+
isPrivate: configuration.isPrivate || _optionalChain([parent, 'optionalAccess', _19 => _19.data, 'optionalAccess', _20 => _20.configuration, 'optionalAccess', _21 => _21.isPrivate]) || false
|
|
4140
4162
|
}
|
|
4141
4163
|
}
|
|
4142
4164
|
});
|
|
@@ -4172,10 +4194,10 @@ function elementGroupToDocumentationGroupStructureDTOV2(group, childrenIdsMap) {
|
|
|
4172
4194
|
createdAt: group.createdAt,
|
|
4173
4195
|
updatedAt: group.updatedAt,
|
|
4174
4196
|
title: group.meta.name,
|
|
4175
|
-
configuration: documentationItemConfigurationToDTOV2(_optionalChain([group, 'optionalAccess',
|
|
4197
|
+
configuration: documentationItemConfigurationToDTOV2(_optionalChain([group, 'optionalAccess', _22 => _22.data, 'optionalAccess', _23 => _23.configuration])),
|
|
4176
4198
|
childrenIds,
|
|
4177
4199
|
isRoot: !group.parentPersistentId,
|
|
4178
|
-
groupBehavior: _nullishCoalesce(_optionalChain([group, 'access',
|
|
4200
|
+
groupBehavior: _nullishCoalesce(_optionalChain([group, 'access', _24 => _24.data, 'optionalAccess', _25 => _25.behavior]), () => ( "Group")),
|
|
4179
4201
|
shortPersistentId: group.shortPersistentId,
|
|
4180
4202
|
type: "Group"
|
|
4181
4203
|
};
|
|
@@ -4292,7 +4314,7 @@ function elementGroupsToDocumentationGroupDTOV1(groups, pages) {
|
|
|
4292
4314
|
return groups.map((group) => {
|
|
4293
4315
|
return {
|
|
4294
4316
|
...elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap),
|
|
4295
|
-
configuration: documentationItemConfigurationToDTOV1(_optionalChain([group, 'access',
|
|
4317
|
+
configuration: documentationItemConfigurationToDTOV1(_optionalChain([group, 'access', _26 => _26.data, 'optionalAccess', _27 => _27.configuration]))
|
|
4296
4318
|
};
|
|
4297
4319
|
});
|
|
4298
4320
|
}
|
|
@@ -4302,7 +4324,7 @@ function elementGroupsToDocumentationGroupFixedConfigurationDTOV1(groups, pages)
|
|
|
4302
4324
|
return fixedGroups.map((group) => {
|
|
4303
4325
|
return {
|
|
4304
4326
|
...elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap),
|
|
4305
|
-
configuration: documentationItemConfigurationToDTOV1(_optionalChain([group, 'access',
|
|
4327
|
+
configuration: documentationItemConfigurationToDTOV1(_optionalChain([group, 'access', _28 => _28.data, 'optionalAccess', _29 => _29.configuration]))
|
|
4306
4328
|
};
|
|
4307
4329
|
});
|
|
4308
4330
|
}
|
|
@@ -4322,7 +4344,7 @@ function elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap) {
|
|
|
4322
4344
|
title: group.meta.name,
|
|
4323
4345
|
childrenIds,
|
|
4324
4346
|
isRoot: !group.parentPersistentId,
|
|
4325
|
-
groupBehavior: _nullishCoalesce(_optionalChain([group, 'access',
|
|
4347
|
+
groupBehavior: _nullishCoalesce(_optionalChain([group, 'access', _30 => _30.data, 'optionalAccess', _31 => _31.behavior]), () => ( "Group")),
|
|
4326
4348
|
shortPersistentId: group.shortPersistentId,
|
|
4327
4349
|
type: "Group"
|
|
4328
4350
|
};
|
|
@@ -4437,7 +4459,7 @@ function integrationToDto(integration) {
|
|
|
4437
4459
|
workspaceId: integration.workspaceId,
|
|
4438
4460
|
type: integration.type,
|
|
4439
4461
|
createdAt: integration.createdAt,
|
|
4440
|
-
integrationCredentials: _optionalChain([integration, 'access',
|
|
4462
|
+
integrationCredentials: _optionalChain([integration, 'access', _32 => _32.integrationCredentials, 'optionalAccess', _33 => _33.map, 'call', _34 => _34(integrationCredentialToDto)]),
|
|
4441
4463
|
integrationDesignSystems: _nullishCoalesce(integration.integrationDesignSystems, () => ( void 0))
|
|
4442
4464
|
};
|
|
4443
4465
|
}
|
|
@@ -5638,7 +5660,7 @@ var DTODocumentationPageRoomHeaderDataUpdate = _zod.z.object({
|
|
|
5638
5660
|
function itemConfigurationToYjs(yDoc, item) {
|
|
5639
5661
|
yDoc.transact((trx) => {
|
|
5640
5662
|
const { title, configuration } = item;
|
|
5641
|
-
const header = _optionalChain([configuration, 'optionalAccess',
|
|
5663
|
+
const header = _optionalChain([configuration, 'optionalAccess', _35 => _35.header]);
|
|
5642
5664
|
if (title !== void 0) {
|
|
5643
5665
|
const headerYMap = trx.doc.getMap("itemTitle");
|
|
5644
5666
|
headerYMap.set("title", title);
|
|
@@ -5656,9 +5678,9 @@ function itemConfigurationToYjs(yDoc, item) {
|
|
|
5656
5678
|
header.minHeight !== void 0 && headerYMap.set("minHeight", header.minHeight);
|
|
5657
5679
|
}
|
|
5658
5680
|
const configYMap = trx.doc.getMap("itemConfiguration");
|
|
5659
|
-
_optionalChain([configuration, 'optionalAccess',
|
|
5660
|
-
_optionalChain([configuration, 'optionalAccess',
|
|
5661
|
-
_optionalChain([configuration, 'optionalAccess',
|
|
5681
|
+
_optionalChain([configuration, 'optionalAccess', _36 => _36.showSidebar]) !== void 0 && configYMap.set("showSidebar", configuration.showSidebar);
|
|
5682
|
+
_optionalChain([configuration, 'optionalAccess', _37 => _37.isHidden]) !== void 0 && configYMap.set("isHidden", configuration.isHidden);
|
|
5683
|
+
_optionalChain([configuration, 'optionalAccess', _38 => _38.isPrivate]) !== void 0 && configYMap.set("isPrivate", configuration.isPrivate);
|
|
5662
5684
|
});
|
|
5663
5685
|
}
|
|
5664
5686
|
function yjsToItemConfiguration(yDoc) {
|
|
@@ -6450,7 +6472,7 @@ var ListTreeBuilder = class {
|
|
|
6450
6472
|
}
|
|
6451
6473
|
addWithProperty(block, multiRichTextProperty) {
|
|
6452
6474
|
const parsedOptions = PageBlockDefinitionMutiRichTextOptions.optional().parse(multiRichTextProperty.options);
|
|
6453
|
-
return this.add(block, multiRichTextProperty.id, _optionalChain([parsedOptions, 'optionalAccess',
|
|
6475
|
+
return this.add(block, multiRichTextProperty.id, _optionalChain([parsedOptions, 'optionalAccess', _39 => _39.multiRichTextStyle]) || "OL");
|
|
6454
6476
|
}
|
|
6455
6477
|
add(block, multiRichTextPropertyId, multiRichTextPropertyStyle) {
|
|
6456
6478
|
const list = this.createList(block, multiRichTextPropertyId, multiRichTextPropertyStyle);
|
|
@@ -6470,7 +6492,7 @@ var ListTreeBuilder = class {
|
|
|
6470
6492
|
}
|
|
6471
6493
|
const listParent = this.getParentOfDepth(block.data.indentLevel);
|
|
6472
6494
|
const lastChild = listParent.children[listParent.children.length - 1];
|
|
6473
|
-
if (_optionalChain([lastChild, 'optionalAccess',
|
|
6495
|
+
if (_optionalChain([lastChild, 'optionalAccess', _40 => _40.type]) === "List") {
|
|
6474
6496
|
lastChild.children.push(...list.leadingChildren);
|
|
6475
6497
|
return;
|
|
6476
6498
|
} else {
|
|
@@ -6654,7 +6676,7 @@ function serializeAsRichTextBlock(input) {
|
|
|
6654
6676
|
const textPropertyValue = BlockParsingUtils.richTextPropertyValue(blockItem, richTextProperty.id);
|
|
6655
6677
|
const enrichedInput = { ...input, richTextPropertyValue: textPropertyValue };
|
|
6656
6678
|
const parsedOptions = PageBlockDefinitionRichTextOptions.optional().parse(richTextProperty.options);
|
|
6657
|
-
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess',
|
|
6679
|
+
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess', _41 => _41.richTextStyle]), () => ( "Default"));
|
|
6658
6680
|
switch (style) {
|
|
6659
6681
|
case "Callout":
|
|
6660
6682
|
return serializeAsCallout(enrichedInput);
|
|
@@ -6875,7 +6897,7 @@ function serializeBlockNodeAttributes(block) {
|
|
|
6875
6897
|
};
|
|
6876
6898
|
}
|
|
6877
6899
|
function richTextHeadingLevel(property) {
|
|
6878
|
-
const style = _optionalChain([property, 'access',
|
|
6900
|
+
const style = _optionalChain([property, 'access', _42 => _42.options, 'optionalAccess', _43 => _43.richTextStyle]);
|
|
6879
6901
|
if (!style)
|
|
6880
6902
|
return void 0;
|
|
6881
6903
|
switch (style) {
|
|
@@ -6988,7 +7010,7 @@ function serializeAsCustomBlock(block, definition) {
|
|
|
6988
7010
|
linksTo: i.linksTo
|
|
6989
7011
|
};
|
|
6990
7012
|
});
|
|
6991
|
-
const columns = _optionalChain([block, 'access',
|
|
7013
|
+
const columns = _optionalChain([block, 'access', _44 => _44.data, 'access', _45 => _45.appearance, 'optionalAccess', _46 => _46.numberOfColumns]);
|
|
6992
7014
|
return {
|
|
6993
7015
|
type: serializeCustomBlockNodeType(block, definition),
|
|
6994
7016
|
attrs: {
|
|
@@ -8789,7 +8811,6 @@ function parseAsRichText(prosemirrorNode, definition, property) {
|
|
|
8789
8811
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
8790
8812
|
const calloutType = parseCalloutType(getProsemirrorAttribute(prosemirrorNode, "type", _zod.z.string().optional()));
|
|
8791
8813
|
return {
|
|
8792
|
-
// TODO Artem: indent
|
|
8793
8814
|
id,
|
|
8794
8815
|
type: "Block",
|
|
8795
8816
|
...variantId && { variantId },
|
|
@@ -8835,10 +8856,10 @@ function parseAsMultiRichText(prosemirrorNode, definition, property, definitions
|
|
|
8835
8856
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
8836
8857
|
const result = [];
|
|
8837
8858
|
const listItems = [];
|
|
8838
|
-
_optionalChain([prosemirrorNode, 'access',
|
|
8859
|
+
_optionalChain([prosemirrorNode, 'access', _47 => _47.content, 'optionalAccess', _48 => _48.forEach, 'call', _49 => _49((c) => {
|
|
8839
8860
|
if (c.type !== "listItem")
|
|
8840
8861
|
return;
|
|
8841
|
-
_optionalChain([c, 'access',
|
|
8862
|
+
_optionalChain([c, 'access', _50 => _50.content, 'optionalAccess', _51 => _51.forEach, 'call', _52 => _52((cc) => {
|
|
8842
8863
|
listItems.push(cc);
|
|
8843
8864
|
})]);
|
|
8844
8865
|
})]);
|
|
@@ -8941,17 +8962,17 @@ function parseAsTable(prosemirrorNode, definition, property) {
|
|
|
8941
8962
|
return null;
|
|
8942
8963
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
8943
8964
|
const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", _zod.z.boolean().optional()) !== false;
|
|
8944
|
-
const tableChild = _optionalChain([prosemirrorNode, 'access',
|
|
8965
|
+
const tableChild = _optionalChain([prosemirrorNode, 'access', _53 => _53.content, 'optionalAccess', _54 => _54.find, 'call', _55 => _55((c) => c.type === "table")]);
|
|
8945
8966
|
if (!tableChild) {
|
|
8946
8967
|
return emptyTable(id, variantId, 0);
|
|
8947
8968
|
}
|
|
8948
|
-
const rows = _nullishCoalesce(_optionalChain([tableChild, 'access',
|
|
8969
|
+
const rows = _nullishCoalesce(_optionalChain([tableChild, 'access', _56 => _56.content, 'optionalAccess', _57 => _57.filter, 'call', _58 => _58((c) => c.type === "tableRow" && !!_optionalChain([c, 'access', _59 => _59.content, 'optionalAccess', _60 => _60.length]))]), () => ( []));
|
|
8949
8970
|
if (!rows.length) {
|
|
8950
8971
|
return emptyTable(id, variantId, 0);
|
|
8951
8972
|
}
|
|
8952
|
-
const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access',
|
|
8953
|
-
const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access',
|
|
8954
|
-
const hasHeaderRow = _optionalChain([rows, 'access',
|
|
8973
|
+
const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access', _61 => _61[0], 'access', _62 => _62.content, 'optionalAccess', _63 => _63.filter, 'call', _64 => _64((c) => c.type === "tableHeader"), 'access', _65 => _65.length]), () => ( 0));
|
|
8974
|
+
const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access', _66 => _66.content, 'optionalAccess', _67 => _67[0], 'optionalAccess', _68 => _68.type]) === "tableHeader").length;
|
|
8975
|
+
const hasHeaderRow = _optionalChain([rows, 'access', _69 => _69[0], 'access', _70 => _70.content, 'optionalAccess', _71 => _71.length]) === rowHeaderCells;
|
|
8955
8976
|
const hasHeaderColumn = rows.length === columnHeaderCells;
|
|
8956
8977
|
const tableValue = {
|
|
8957
8978
|
showBorder: hasBorder,
|
|
@@ -9033,7 +9054,7 @@ function parseAsTableNode(prosemirrorNode) {
|
|
|
9033
9054
|
const parsedItems = PageBlockItemV2.array().safeParse(JSON.parse(items));
|
|
9034
9055
|
if (!parsedItems.success)
|
|
9035
9056
|
return null;
|
|
9036
|
-
const rawImagePropertyValue = _optionalChain([parsedItems, 'access',
|
|
9057
|
+
const rawImagePropertyValue = _optionalChain([parsedItems, 'access', _72 => _72.data, 'access', _73 => _73[0], 'optionalAccess', _74 => _74.props, 'access', _75 => _75.image]);
|
|
9037
9058
|
if (!rawImagePropertyValue)
|
|
9038
9059
|
return null;
|
|
9039
9060
|
const imagePropertyValueParseResult = PageBlockItemImageValue.safeParse(rawImagePropertyValue);
|
|
@@ -9257,7 +9278,7 @@ function getProsemirrorBlockVariantId(prosemirrorNode) {
|
|
|
9257
9278
|
return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(_zod.z.string()));
|
|
9258
9279
|
}
|
|
9259
9280
|
function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
|
|
9260
|
-
const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access',
|
|
9281
|
+
const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access', _76 => _76.attrs, 'optionalAccess', _77 => _77[attributeName]]));
|
|
9261
9282
|
if (parsedAttr.success) {
|
|
9262
9283
|
return parsedAttr.data;
|
|
9263
9284
|
} else {
|