@supernova-studio/client 0.47.28 → 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 +533 -228
- package/dist/index.d.ts +533 -228
- package/dist/index.js +295 -254
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +280 -239
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/api/conversion/integrations/git.ts +3 -0
- package/src/api/conversion/integrations/integration.ts +1 -0
- package/src/api/dto/export/job.ts +2 -2
- package/src/api/dto/workspaces/git.ts +4 -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,9 +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(),
|
|
2778
|
+
exporterId: _zod.z.string(),
|
|
2777
2779
|
versionId: _zod.z.string(),
|
|
2778
2780
|
brandId: _zod.z.string().optional(),
|
|
2779
2781
|
themeId: _zod.z.string().optional(),
|
|
2782
|
+
exporterName: _zod.z.string(),
|
|
2780
2783
|
exporterPackageUrl: _zod.z.string(),
|
|
2781
2784
|
exporterPropertyValues: ExporterPropertyValue.array(),
|
|
2782
2785
|
documentation: ExportJobDocumentationContext.optional()
|
|
@@ -2801,8 +2804,8 @@ var ExporterDestinationGithub = _zod.z.object({
|
|
|
2801
2804
|
branch: _zod.z.string(),
|
|
2802
2805
|
relativePath: nullishToOptional(_zod.z.string()),
|
|
2803
2806
|
// Legacy deprecated fields. Use `credentialId` instead
|
|
2804
|
-
connectionId: _zod.z.string()
|
|
2805
|
-
userId: _zod.z.number()
|
|
2807
|
+
connectionId: nullishToOptional(_zod.z.string()),
|
|
2808
|
+
userId: nullishToOptional(_zod.z.number())
|
|
2806
2809
|
});
|
|
2807
2810
|
var ExporterDestinationAzure = _zod.z.object({
|
|
2808
2811
|
credentialId: _zod.z.string().optional(),
|
|
@@ -2816,8 +2819,8 @@ var ExporterDestinationAzure = _zod.z.object({
|
|
|
2816
2819
|
// Maybe not needed
|
|
2817
2820
|
url: nullishToOptional(_zod.z.string()),
|
|
2818
2821
|
// Legacy deprecated fields. Use `credentialId` instead
|
|
2819
|
-
connectionId: _zod.z.string()
|
|
2820
|
-
userId: _zod.z.number()
|
|
2822
|
+
connectionId: nullishToOptional(_zod.z.string()),
|
|
2823
|
+
userId: nullishToOptional(_zod.z.number())
|
|
2821
2824
|
});
|
|
2822
2825
|
var ExporterDestinationGitlab = _zod.z.object({
|
|
2823
2826
|
credentialId: _zod.z.string().optional(),
|
|
@@ -2829,8 +2832,8 @@ var ExporterDestinationGitlab = _zod.z.object({
|
|
|
2829
2832
|
// Maybe not needed
|
|
2830
2833
|
url: nullishToOptional(_zod.z.string()),
|
|
2831
2834
|
// Legacy deprecated fields. Use `credentialId` instead
|
|
2832
|
-
connectionId: _zod.z.string()
|
|
2833
|
-
userId: _zod.z.number()
|
|
2835
|
+
connectionId: nullishToOptional(_zod.z.string()),
|
|
2836
|
+
userId: nullishToOptional(_zod.z.number())
|
|
2834
2837
|
});
|
|
2835
2838
|
var ExporterDestinationBitbucket = _zod.z.object({
|
|
2836
2839
|
credentialId: _zod.z.string().optional(),
|
|
@@ -2842,8 +2845,8 @@ var ExporterDestinationBitbucket = _zod.z.object({
|
|
|
2842
2845
|
branch: _zod.z.string(),
|
|
2843
2846
|
relativePath: nullishToOptional(_zod.z.string()),
|
|
2844
2847
|
// Legacy deprecated fields. Use `credentialId` instead
|
|
2845
|
-
connectionId: _zod.z.string()
|
|
2846
|
-
userId: _zod.z.number()
|
|
2848
|
+
connectionId: nullishToOptional(_zod.z.string()),
|
|
2849
|
+
userId: nullishToOptional(_zod.z.number())
|
|
2847
2850
|
});
|
|
2848
2851
|
var ExportDestinationsMap = _zod.z.object({
|
|
2849
2852
|
webhookUrl: _zod.z.string().optional(),
|
|
@@ -2878,7 +2881,9 @@ var ExportJobS3DestinationResult = _zod.z.object({
|
|
|
2878
2881
|
bucket: _zod.z.string(),
|
|
2879
2882
|
urlPrefix: _zod.z.string().optional(),
|
|
2880
2883
|
path: _zod.z.string(),
|
|
2881
|
-
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())
|
|
2882
2887
|
});
|
|
2883
2888
|
var ExportJobDocsDestinationResult = _zod.z.object({
|
|
2884
2889
|
url: _zod.z.string()
|
|
@@ -2890,12 +2895,13 @@ var ExportJobResult = _zod.z.object({
|
|
|
2890
2895
|
azure: nullishToOptional(ExportJobPullRequestDestinationResult),
|
|
2891
2896
|
gitlab: nullishToOptional(ExportJobPullRequestDestinationResult),
|
|
2892
2897
|
bitbucket: nullishToOptional(ExportJobPullRequestDestinationResult),
|
|
2893
|
-
sndocs: nullishToOptional(ExportJobDocsDestinationResult)
|
|
2898
|
+
sndocs: nullishToOptional(ExportJobDocsDestinationResult),
|
|
2899
|
+
logs: nullishToOptional(ExportJobLogEntry.array())
|
|
2894
2900
|
});
|
|
2895
2901
|
var ExportJob = _zod.z.object({
|
|
2896
2902
|
id: _zod.z.string(),
|
|
2897
|
-
createdAt: _zod.z.date(),
|
|
2898
|
-
finishedAt: _zod.z.date().optional(),
|
|
2903
|
+
createdAt: _zod.z.coerce.date(),
|
|
2904
|
+
finishedAt: _zod.z.coerce.date().optional(),
|
|
2899
2905
|
designSystemId: _zod.z.string(),
|
|
2900
2906
|
designSystemVersionId: _zod.z.string(),
|
|
2901
2907
|
workspaceId: _zod.z.string(),
|
|
@@ -2984,7 +2990,7 @@ var PulsarCustomBlock = _zod.z.object({
|
|
|
2984
2990
|
});
|
|
2985
2991
|
var ExporterType = _zod.z.enum(["code", "documentation"]);
|
|
2986
2992
|
var ExporterSource = _zod.z.enum(["git", "upload"]);
|
|
2987
|
-
var ExporterTag = _zod.z.string()
|
|
2993
|
+
var ExporterTag = _zod.z.string();
|
|
2988
2994
|
var ExporterPulsarDetails = _zod.z.object({
|
|
2989
2995
|
description: _zod.z.string(),
|
|
2990
2996
|
version: _zod.z.string(),
|
|
@@ -3076,220 +3082,31 @@ var GitObjectsQuery = _zod.z.object({
|
|
|
3076
3082
|
var GitOrganization = _zod.z.object({
|
|
3077
3083
|
id: _zod.z.string(),
|
|
3078
3084
|
name: _zod.z.string(),
|
|
3079
|
-
url: _zod.z.string()
|
|
3085
|
+
url: _zod.z.string(),
|
|
3086
|
+
slug: _zod.z.string()
|
|
3080
3087
|
});
|
|
3081
3088
|
var GitProject = _zod.z.object({
|
|
3082
3089
|
id: _zod.z.string(),
|
|
3083
3090
|
name: _zod.z.string(),
|
|
3084
|
-
url: _zod.z.string()
|
|
3091
|
+
url: _zod.z.string(),
|
|
3092
|
+
slug: _zod.z.string()
|
|
3085
3093
|
});
|
|
3086
3094
|
var GitRepository = _zod.z.object({
|
|
3087
3095
|
id: _zod.z.string(),
|
|
3088
3096
|
name: _zod.z.string(),
|
|
3089
3097
|
url: _zod.z.string(),
|
|
3090
|
-
|
|
3098
|
+
slug: _zod.z.string(),
|
|
3099
|
+
/**
|
|
3100
|
+
* Can be undefined when:
|
|
3101
|
+
* - there are no branches in the repository yet
|
|
3102
|
+
* - Git provider doesn't expose this information on a repository via their API
|
|
3103
|
+
*/
|
|
3104
|
+
defaultBranch: _zod.z.string().optional()
|
|
3091
3105
|
});
|
|
3092
3106
|
var GitBranch = _zod.z.object({
|
|
3093
3107
|
name: _zod.z.string(),
|
|
3094
3108
|
lastCommitId: _zod.z.string()
|
|
3095
3109
|
});
|
|
3096
|
-
var IntegrationDesignSystem = _zod.z.object({
|
|
3097
|
-
designSystemId: _zod.z.string(),
|
|
3098
|
-
brandId: _zod.z.string(),
|
|
3099
|
-
title: _zod.z.string().optional(),
|
|
3100
|
-
userId: _zod.z.string().optional(),
|
|
3101
|
-
date: _zod.z.coerce.date().optional()
|
|
3102
|
-
});
|
|
3103
|
-
var IntegrationCredentialsType = _zod.z.enum(["OAuth2", "PAT", "GithubApp"]);
|
|
3104
|
-
var IntegrationCredentialsProfile = _zod.z.object({
|
|
3105
|
-
id: nullishToOptional(_zod.z.string()),
|
|
3106
|
-
email: nullishToOptional(_zod.z.string()),
|
|
3107
|
-
handle: nullishToOptional(_zod.z.string()),
|
|
3108
|
-
type: nullishToOptional(_zod.z.string()),
|
|
3109
|
-
avatarUrl: nullishToOptional(_zod.z.string()),
|
|
3110
|
-
organization: nullishToOptional(_zod.z.string())
|
|
3111
|
-
});
|
|
3112
|
-
var IntegrationCredentials = _zod.z.object({
|
|
3113
|
-
id: _zod.z.string(),
|
|
3114
|
-
type: IntegrationCredentialsType,
|
|
3115
|
-
integrationId: _zod.z.string(),
|
|
3116
|
-
accessToken: _zod.z.string(),
|
|
3117
|
-
userId: _zod.z.string(),
|
|
3118
|
-
createdAt: _zod.z.coerce.date(),
|
|
3119
|
-
refreshToken: _zod.z.string().optional(),
|
|
3120
|
-
tokenName: _zod.z.string().optional(),
|
|
3121
|
-
expiresAt: _zod.z.coerce.date().optional(),
|
|
3122
|
-
refreshedAt: _zod.z.coerce.date().optional(),
|
|
3123
|
-
username: _zod.z.string().optional(),
|
|
3124
|
-
appInstallationId: _zod.z.string().optional(),
|
|
3125
|
-
profile: IntegrationCredentialsProfile.optional(),
|
|
3126
|
-
customUrl: _zod.z.string().optional(),
|
|
3127
|
-
user: UserMinified.optional()
|
|
3128
|
-
});
|
|
3129
|
-
var ExtendedIntegrationType = _zod.z.enum([
|
|
3130
|
-
"Figma",
|
|
3131
|
-
"Github",
|
|
3132
|
-
"Gitlab",
|
|
3133
|
-
"Bitbucket",
|
|
3134
|
-
"Azure",
|
|
3135
|
-
"TokenStudio",
|
|
3136
|
-
"FigmaVariablesPlugin"
|
|
3137
|
-
]);
|
|
3138
|
-
var IntegrationType = ExtendedIntegrationType.exclude(["TokenStudio", "FigmaVariablesPlugin"]);
|
|
3139
|
-
var GitIntegrationType = IntegrationType.exclude(["Figma"]);
|
|
3140
|
-
var Integration = _zod.z.object({
|
|
3141
|
-
id: _zod.z.string(),
|
|
3142
|
-
workspaceId: _zod.z.string(),
|
|
3143
|
-
type: IntegrationType,
|
|
3144
|
-
createdAt: _zod.z.coerce.date(),
|
|
3145
|
-
integrationCredentials: _zod.z.array(IntegrationCredentials).optional()
|
|
3146
|
-
});
|
|
3147
|
-
var forbiddenCustomUrldomainList = ["github.com", "gitlab.com", "bitbucket.org", "figma.com", "dev.azure.com"];
|
|
3148
|
-
var IntegrationToken = _zod.z.object({
|
|
3149
|
-
access_token: _zod.z.string(),
|
|
3150
|
-
refresh_token: _zod.z.string().optional(),
|
|
3151
|
-
expires_in: _zod.z.union([_zod.z.number().optional(), _zod.z.string().optional()]),
|
|
3152
|
-
token_type: _zod.z.string().optional(),
|
|
3153
|
-
token_name: _zod.z.string().optional(),
|
|
3154
|
-
token_azure_organization_name: _zod.z.string().optional(),
|
|
3155
|
-
// Azure only
|
|
3156
|
-
token_bitbucket_username: _zod.z.string().optional(),
|
|
3157
|
-
// Bitbucket only
|
|
3158
|
-
custom_url: _zod.z.string().optional().refine((value) => {
|
|
3159
|
-
if (!value)
|
|
3160
|
-
return true;
|
|
3161
|
-
if (forbiddenCustomUrldomainList.some((domain) => value.includes(domain)))
|
|
3162
|
-
return false;
|
|
3163
|
-
return true;
|
|
3164
|
-
}, "Custom URL validation failed")
|
|
3165
|
-
}).refine((data) => {
|
|
3166
|
-
if (data.custom_url && data.token_azure_organization_name) {
|
|
3167
|
-
return false;
|
|
3168
|
-
}
|
|
3169
|
-
return true;
|
|
3170
|
-
}, "Custom URL and Azure organization name cannot be present at the same time").transform((data) => {
|
|
3171
|
-
return {
|
|
3172
|
-
accessToken: data.access_token,
|
|
3173
|
-
refreshToken: data.refresh_token,
|
|
3174
|
-
expiresIn: typeof data.expires_in === "string" ? Number(data.expires_in) : data.expires_in,
|
|
3175
|
-
tokenType: data.token_type,
|
|
3176
|
-
tokenName: data.token_name,
|
|
3177
|
-
tokenBitbucketUsername: data.token_bitbucket_username,
|
|
3178
|
-
tokenAzureOrganizationName: data.token_azure_organization_name,
|
|
3179
|
-
customUrl: data.custom_url ? formatCustomUrl(data.custom_url) : void 0
|
|
3180
|
-
};
|
|
3181
|
-
function formatCustomUrl(url) {
|
|
3182
|
-
let formattedUrl = url.trim();
|
|
3183
|
-
if (!formattedUrl.startsWith("http://") && !formattedUrl.startsWith("https://")) {
|
|
3184
|
-
formattedUrl = "http://" + formattedUrl;
|
|
3185
|
-
}
|
|
3186
|
-
if (formattedUrl.endsWith("/")) {
|
|
3187
|
-
formattedUrl = formattedUrl.slice(0, -1);
|
|
3188
|
-
}
|
|
3189
|
-
return formattedUrl;
|
|
3190
|
-
}
|
|
3191
|
-
});
|
|
3192
|
-
var IntegrationTokenSchemaOld = _zod.z.object({
|
|
3193
|
-
id: _zod.z.string(),
|
|
3194
|
-
provider: OAuthProviderSchema,
|
|
3195
|
-
scope: _zod.z.string(),
|
|
3196
|
-
userId: _zod.z.string(),
|
|
3197
|
-
accessToken: _zod.z.string(),
|
|
3198
|
-
refreshToken: _zod.z.string(),
|
|
3199
|
-
expiresAt: _zod.z.coerce.date(),
|
|
3200
|
-
externalUserId: _zod.z.string().nullish()
|
|
3201
|
-
});
|
|
3202
|
-
var WorkspaceOAuthRequestSchema = _zod.z.object({
|
|
3203
|
-
id: _zod.z.string(),
|
|
3204
|
-
workspaceId: _zod.z.string(),
|
|
3205
|
-
provider: OAuthProviderSchema,
|
|
3206
|
-
userId: _zod.z.string(),
|
|
3207
|
-
createdAt: _zod.z.coerce.date()
|
|
3208
|
-
});
|
|
3209
|
-
var DesignSystemVersionRoom = Entity.extend({
|
|
3210
|
-
designSystemVersionId: _zod.z.string(),
|
|
3211
|
-
liveblocksId: _zod.z.string()
|
|
3212
|
-
});
|
|
3213
|
-
var DesignSystemVersionRoomInternalSettings = _zod.z.object({
|
|
3214
|
-
routingVersion: _zod.z.string()
|
|
3215
|
-
});
|
|
3216
|
-
var DesignSystemVersionRoomInitialState = _zod.z.object({
|
|
3217
|
-
pages: _zod.z.array(DocumentationPageV2),
|
|
3218
|
-
groups: _zod.z.array(ElementGroup),
|
|
3219
|
-
internalSettings: DesignSystemVersionRoomInternalSettings
|
|
3220
|
-
});
|
|
3221
|
-
var DesignSystemVersionRoomUpdate = _zod.z.object({
|
|
3222
|
-
pages: _zod.z.array(DocumentationPageV2),
|
|
3223
|
-
groups: _zod.z.array(ElementGroup),
|
|
3224
|
-
deletedPageIds: _zod.z.array(_zod.z.string()),
|
|
3225
|
-
deletedGroupIds: _zod.z.array(_zod.z.string())
|
|
3226
|
-
});
|
|
3227
|
-
var DocumentationPageRoom = Entity.extend({
|
|
3228
|
-
designSystemVersionId: _zod.z.string(),
|
|
3229
|
-
documentationPageId: _zod.z.string(),
|
|
3230
|
-
liveblocksId: _zod.z.string(),
|
|
3231
|
-
isDirty: _zod.z.boolean()
|
|
3232
|
-
});
|
|
3233
|
-
var DocumentationPageRoomState = _zod.z.object({
|
|
3234
|
-
pageItems: _zod.z.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
|
|
3235
|
-
itemConfiguration: DocumentationItemConfigurationV2
|
|
3236
|
-
});
|
|
3237
|
-
var DocumentationPageRoomRoomUpdate = _zod.z.object({
|
|
3238
|
-
page: DocumentationPageV2,
|
|
3239
|
-
pageParent: ElementGroup
|
|
3240
|
-
});
|
|
3241
|
-
var DocumentationPageRoomInitialStateUpdate = DocumentationPageRoomRoomUpdate.extend({
|
|
3242
|
-
pageItems: _zod.z.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
|
|
3243
|
-
blockDefinitions: _zod.z.array(PageBlockDefinition)
|
|
3244
|
-
});
|
|
3245
|
-
var RoomTypeEnum = /* @__PURE__ */ ((RoomTypeEnum2) => {
|
|
3246
|
-
RoomTypeEnum2["DocumentationPage"] = "documentation-page";
|
|
3247
|
-
RoomTypeEnum2["DesignSystemVersion"] = "design-system-version";
|
|
3248
|
-
RoomTypeEnum2["Workspace"] = "workspace";
|
|
3249
|
-
return RoomTypeEnum2;
|
|
3250
|
-
})(RoomTypeEnum || {});
|
|
3251
|
-
var RoomTypeSchema = _zod.z.nativeEnum(RoomTypeEnum);
|
|
3252
|
-
var RoomType = RoomTypeSchema.enum;
|
|
3253
|
-
var WorkspaceRoom = Entity.extend({
|
|
3254
|
-
workspaceId: _zod.z.string(),
|
|
3255
|
-
liveblocksId: _zod.z.string()
|
|
3256
|
-
});
|
|
3257
|
-
var AnyRecord = _zod.z.record(_zod.z.any());
|
|
3258
|
-
var NpmPackageVersionDist = AnyRecord.and(
|
|
3259
|
-
_zod.z.object({
|
|
3260
|
-
tarball: _zod.z.string()
|
|
3261
|
-
})
|
|
3262
|
-
);
|
|
3263
|
-
var NpmPackageVersion = AnyRecord.and(
|
|
3264
|
-
_zod.z.object({
|
|
3265
|
-
dist: NpmPackageVersionDist
|
|
3266
|
-
})
|
|
3267
|
-
);
|
|
3268
|
-
var NpmPackage = AnyRecord.and(
|
|
3269
|
-
_zod.z.object({
|
|
3270
|
-
_id: _zod.z.string(),
|
|
3271
|
-
name: _zod.z.string(),
|
|
3272
|
-
// e.g. "latest": "1.2.3"
|
|
3273
|
-
"dist-tags": _zod.z.record(_zod.z.string(), _zod.z.string()),
|
|
3274
|
-
// "1.2.3": {...}
|
|
3275
|
-
versions: _zod.z.record(NpmPackageVersion)
|
|
3276
|
-
})
|
|
3277
|
-
);
|
|
3278
|
-
var NpmProxyTokenPayload = _zod.z.object({
|
|
3279
|
-
npmProxyRegistryConfigId: _zod.z.string()
|
|
3280
|
-
});
|
|
3281
|
-
var PersonalAccessToken = _zod.z.object({
|
|
3282
|
-
id: _zod.z.string(),
|
|
3283
|
-
userId: _zod.z.string(),
|
|
3284
|
-
workspaceId: _zod.z.string().optional(),
|
|
3285
|
-
workspaceRole: WorkspaceRoleSchema.optional(),
|
|
3286
|
-
name: _zod.z.string(),
|
|
3287
|
-
hidden: _zod.z.boolean(),
|
|
3288
|
-
token: _zod.z.string(),
|
|
3289
|
-
scope: _zod.z.string().optional(),
|
|
3290
|
-
createdAt: _zod.z.coerce.date(),
|
|
3291
|
-
expireAt: _zod.z.coerce.date().optional()
|
|
3292
|
-
});
|
|
3293
3110
|
var SupernovaException = class _SupernovaException extends Error {
|
|
3294
3111
|
//
|
|
3295
3112
|
// Properties
|
|
@@ -3346,6 +3163,9 @@ var SupernovaException = class _SupernovaException extends Error {
|
|
|
3346
3163
|
static missingIntegration(message) {
|
|
3347
3164
|
return new _SupernovaException("MissingIntegration", message);
|
|
3348
3165
|
}
|
|
3166
|
+
static missingIntegrationAccess(message) {
|
|
3167
|
+
return new _SupernovaException("MissingIntegrationAccess", message);
|
|
3168
|
+
}
|
|
3349
3169
|
static noAccess(message) {
|
|
3350
3170
|
return new _SupernovaException("NoAccess", message);
|
|
3351
3171
|
}
|
|
@@ -3362,6 +3182,18 @@ var SupernovaException = class _SupernovaException extends Error {
|
|
|
3362
3182
|
return new _SupernovaException("BadRequest", message);
|
|
3363
3183
|
}
|
|
3364
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
|
+
}
|
|
3365
3197
|
function mapByUnique(items, keyFn) {
|
|
3366
3198
|
const result = /* @__PURE__ */ new Map();
|
|
3367
3199
|
for (const item of items) {
|
|
@@ -4027,6 +3859,209 @@ var RESERVED_SLUGS = [
|
|
|
4027
3859
|
"super-nova"
|
|
4028
3860
|
];
|
|
4029
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
|
+
});
|
|
4030
4065
|
|
|
4031
4066
|
// src/api/conversion/documentation/documentation-item-configuration-v2-to-dto.ts
|
|
4032
4067
|
var getDtoDefaultItemConfigurationV2 = () => ({
|
|
@@ -4084,7 +4119,7 @@ function calculateElementParentChain(elementParentPersistentId, groupPersistentI
|
|
|
4084
4119
|
const parent = groupPersistentIdToGroupMap.get(parentId);
|
|
4085
4120
|
if (parent)
|
|
4086
4121
|
result.push(parent);
|
|
4087
|
-
parentId = _optionalChain([parent, 'optionalAccess',
|
|
4122
|
+
parentId = _optionalChain([parent, 'optionalAccess', _5 => _5.parentPersistentId]);
|
|
4088
4123
|
}
|
|
4089
4124
|
return result;
|
|
4090
4125
|
}
|
|
@@ -4093,7 +4128,7 @@ function applyPrivacyConfigurationToNestedItems(pages, groups, getDefaultItemCon
|
|
|
4093
4128
|
...group,
|
|
4094
4129
|
data: {
|
|
4095
4130
|
...group.data,
|
|
4096
|
-
configuration: _nullishCoalesce(_optionalChain([group, 'access',
|
|
4131
|
+
configuration: _nullishCoalesce(_optionalChain([group, 'access', _6 => _6.data, 'optionalAccess', _7 => _7.configuration]), () => ( getDefaultItemConfiguration()))
|
|
4097
4132
|
}
|
|
4098
4133
|
}));
|
|
4099
4134
|
const groupPersistentIdToGroupMap = mapByUnique(fixedGroups, (group) => group.persistentId);
|
|
@@ -4105,8 +4140,8 @@ function applyPrivacyConfigurationToNestedItems(pages, groups, getDefaultItemCon
|
|
|
4105
4140
|
const parent = groupPersistentIdToGroupMap.get(nextParentId);
|
|
4106
4141
|
if (!parent)
|
|
4107
4142
|
break;
|
|
4108
|
-
isHidden = isHidden || _optionalChain([parent, 'access',
|
|
4109
|
-
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;
|
|
4110
4145
|
nextParentId = parent.parentPersistentId;
|
|
4111
4146
|
}
|
|
4112
4147
|
groupToFix.data.configuration.isHidden = isHidden;
|
|
@@ -4114,7 +4149,7 @@ function applyPrivacyConfigurationToNestedItems(pages, groups, getDefaultItemCon
|
|
|
4114
4149
|
}
|
|
4115
4150
|
const fixedPages = [];
|
|
4116
4151
|
for (const page of pages) {
|
|
4117
|
-
const configuration = _nullishCoalesce(_optionalChain([page, 'access',
|
|
4152
|
+
const configuration = _nullishCoalesce(_optionalChain([page, 'access', _14 => _14.data, 'optionalAccess', _15 => _15.configuration]), () => ( getDefaultItemConfiguration()));
|
|
4118
4153
|
const parent = groupPersistentIdToGroupMap.get(page.parentPersistentId);
|
|
4119
4154
|
fixedPages.push({
|
|
4120
4155
|
...page,
|
|
@@ -4122,8 +4157,8 @@ function applyPrivacyConfigurationToNestedItems(pages, groups, getDefaultItemCon
|
|
|
4122
4157
|
...page.data,
|
|
4123
4158
|
configuration: {
|
|
4124
4159
|
...configuration,
|
|
4125
|
-
isHidden: configuration.isHidden || _optionalChain([parent, 'optionalAccess',
|
|
4126
|
-
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
|
|
4127
4162
|
}
|
|
4128
4163
|
}
|
|
4129
4164
|
});
|
|
@@ -4159,10 +4194,10 @@ function elementGroupToDocumentationGroupStructureDTOV2(group, childrenIdsMap) {
|
|
|
4159
4194
|
createdAt: group.createdAt,
|
|
4160
4195
|
updatedAt: group.updatedAt,
|
|
4161
4196
|
title: group.meta.name,
|
|
4162
|
-
configuration: documentationItemConfigurationToDTOV2(_optionalChain([group, 'optionalAccess',
|
|
4197
|
+
configuration: documentationItemConfigurationToDTOV2(_optionalChain([group, 'optionalAccess', _22 => _22.data, 'optionalAccess', _23 => _23.configuration])),
|
|
4163
4198
|
childrenIds,
|
|
4164
4199
|
isRoot: !group.parentPersistentId,
|
|
4165
|
-
groupBehavior: _nullishCoalesce(_optionalChain([group, 'access',
|
|
4200
|
+
groupBehavior: _nullishCoalesce(_optionalChain([group, 'access', _24 => _24.data, 'optionalAccess', _25 => _25.behavior]), () => ( "Group")),
|
|
4166
4201
|
shortPersistentId: group.shortPersistentId,
|
|
4167
4202
|
type: "Group"
|
|
4168
4203
|
};
|
|
@@ -4279,7 +4314,7 @@ function elementGroupsToDocumentationGroupDTOV1(groups, pages) {
|
|
|
4279
4314
|
return groups.map((group) => {
|
|
4280
4315
|
return {
|
|
4281
4316
|
...elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap),
|
|
4282
|
-
configuration: documentationItemConfigurationToDTOV1(_optionalChain([group, 'access',
|
|
4317
|
+
configuration: documentationItemConfigurationToDTOV1(_optionalChain([group, 'access', _26 => _26.data, 'optionalAccess', _27 => _27.configuration]))
|
|
4283
4318
|
};
|
|
4284
4319
|
});
|
|
4285
4320
|
}
|
|
@@ -4289,7 +4324,7 @@ function elementGroupsToDocumentationGroupFixedConfigurationDTOV1(groups, pages)
|
|
|
4289
4324
|
return fixedGroups.map((group) => {
|
|
4290
4325
|
return {
|
|
4291
4326
|
...elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap),
|
|
4292
|
-
configuration: documentationItemConfigurationToDTOV1(_optionalChain([group, 'access',
|
|
4327
|
+
configuration: documentationItemConfigurationToDTOV1(_optionalChain([group, 'access', _28 => _28.data, 'optionalAccess', _29 => _29.configuration]))
|
|
4293
4328
|
};
|
|
4294
4329
|
});
|
|
4295
4330
|
}
|
|
@@ -4309,7 +4344,7 @@ function elementGroupToDocumentationGroupStructureDTOV1(group, childrenIdsMap) {
|
|
|
4309
4344
|
title: group.meta.name,
|
|
4310
4345
|
childrenIds,
|
|
4311
4346
|
isRoot: !group.parentPersistentId,
|
|
4312
|
-
groupBehavior: _nullishCoalesce(_optionalChain([group, 'access',
|
|
4347
|
+
groupBehavior: _nullishCoalesce(_optionalChain([group, 'access', _30 => _30.data, 'optionalAccess', _31 => _31.behavior]), () => ( "Group")),
|
|
4313
4348
|
shortPersistentId: group.shortPersistentId,
|
|
4314
4349
|
type: "Group"
|
|
4315
4350
|
};
|
|
@@ -4389,14 +4424,16 @@ function gitOrganizationToDto(org) {
|
|
|
4389
4424
|
return {
|
|
4390
4425
|
id: org.id,
|
|
4391
4426
|
name: org.name,
|
|
4392
|
-
url: org.url
|
|
4427
|
+
url: org.url,
|
|
4428
|
+
slug: org.slug
|
|
4393
4429
|
};
|
|
4394
4430
|
}
|
|
4395
4431
|
function gitProjectToDto(project) {
|
|
4396
4432
|
return {
|
|
4397
4433
|
id: project.id,
|
|
4398
4434
|
name: project.name,
|
|
4399
|
-
url: project.url
|
|
4435
|
+
url: project.url,
|
|
4436
|
+
slug: project.slug
|
|
4400
4437
|
};
|
|
4401
4438
|
}
|
|
4402
4439
|
function gitRepositoryToDto(repo) {
|
|
@@ -4404,6 +4441,7 @@ function gitRepositoryToDto(repo) {
|
|
|
4404
4441
|
id: repo.id,
|
|
4405
4442
|
name: repo.name,
|
|
4406
4443
|
url: repo.url,
|
|
4444
|
+
slug: repo.slug,
|
|
4407
4445
|
defaultBranch: repo.defaultBranch
|
|
4408
4446
|
};
|
|
4409
4447
|
}
|
|
@@ -4421,7 +4459,7 @@ function integrationToDto(integration) {
|
|
|
4421
4459
|
workspaceId: integration.workspaceId,
|
|
4422
4460
|
type: integration.type,
|
|
4423
4461
|
createdAt: integration.createdAt,
|
|
4424
|
-
integrationCredentials: _optionalChain([integration, 'access',
|
|
4462
|
+
integrationCredentials: _optionalChain([integration, 'access', _32 => _32.integrationCredentials, 'optionalAccess', _33 => _33.map, 'call', _34 => _34(integrationCredentialToDto)]),
|
|
4425
4463
|
integrationDesignSystems: _nullishCoalesce(integration.integrationDesignSystems, () => ( void 0))
|
|
4426
4464
|
};
|
|
4427
4465
|
}
|
|
@@ -4439,7 +4477,8 @@ function integrationCredentialToDto(credential) {
|
|
|
4439
4477
|
profile: credential.profile,
|
|
4440
4478
|
tokenName: credential.tokenName,
|
|
4441
4479
|
username: credential.username,
|
|
4442
|
-
appInstallationId: credential.appInstallationId
|
|
4480
|
+
appInstallationId: credential.appInstallationId,
|
|
4481
|
+
state: credential.state
|
|
4443
4482
|
};
|
|
4444
4483
|
}
|
|
4445
4484
|
|
|
@@ -5384,8 +5423,8 @@ var DTOExportJobDestinations = _zod.z.object({
|
|
|
5384
5423
|
});
|
|
5385
5424
|
var DTOExportJob = _zod.z.object({
|
|
5386
5425
|
id: _zod.z.string(),
|
|
5387
|
-
createdAt: _zod.z.date(),
|
|
5388
|
-
finishedAt: _zod.z.date().optional(),
|
|
5426
|
+
createdAt: _zod.z.coerce.date(),
|
|
5427
|
+
finishedAt: _zod.z.coerce.date().optional(),
|
|
5389
5428
|
index: _zod.z.number().optional(),
|
|
5390
5429
|
status: ExportJobStatus,
|
|
5391
5430
|
estimatedExecutionTime: _zod.z.number().optional(),
|
|
@@ -5436,18 +5475,21 @@ var DTOUserProfileUpdateResponse = _zod.z.object({
|
|
|
5436
5475
|
var DTOGitOrganization = _zod.z.object({
|
|
5437
5476
|
id: _zod.z.string(),
|
|
5438
5477
|
name: _zod.z.string(),
|
|
5439
|
-
url: _zod.z.string()
|
|
5478
|
+
url: _zod.z.string(),
|
|
5479
|
+
slug: _zod.z.string()
|
|
5440
5480
|
});
|
|
5441
5481
|
var DTOGitProject = _zod.z.object({
|
|
5442
5482
|
id: _zod.z.string(),
|
|
5443
5483
|
name: _zod.z.string(),
|
|
5444
|
-
url: _zod.z.string()
|
|
5484
|
+
url: _zod.z.string(),
|
|
5485
|
+
slug: _zod.z.string()
|
|
5445
5486
|
});
|
|
5446
5487
|
var DTOGitRepository = _zod.z.object({
|
|
5447
5488
|
id: _zod.z.string(),
|
|
5448
5489
|
name: _zod.z.string(),
|
|
5449
5490
|
url: _zod.z.string(),
|
|
5450
|
-
|
|
5491
|
+
slug: _zod.z.string(),
|
|
5492
|
+
defaultBranch: _zod.z.string().optional()
|
|
5451
5493
|
});
|
|
5452
5494
|
var DTOGitBranch = _zod.z.object({
|
|
5453
5495
|
name: _zod.z.string(),
|
|
@@ -5618,7 +5660,7 @@ var DTODocumentationPageRoomHeaderDataUpdate = _zod.z.object({
|
|
|
5618
5660
|
function itemConfigurationToYjs(yDoc, item) {
|
|
5619
5661
|
yDoc.transact((trx) => {
|
|
5620
5662
|
const { title, configuration } = item;
|
|
5621
|
-
const header = _optionalChain([configuration, 'optionalAccess',
|
|
5663
|
+
const header = _optionalChain([configuration, 'optionalAccess', _35 => _35.header]);
|
|
5622
5664
|
if (title !== void 0) {
|
|
5623
5665
|
const headerYMap = trx.doc.getMap("itemTitle");
|
|
5624
5666
|
headerYMap.set("title", title);
|
|
@@ -5636,9 +5678,9 @@ function itemConfigurationToYjs(yDoc, item) {
|
|
|
5636
5678
|
header.minHeight !== void 0 && headerYMap.set("minHeight", header.minHeight);
|
|
5637
5679
|
}
|
|
5638
5680
|
const configYMap = trx.doc.getMap("itemConfiguration");
|
|
5639
|
-
_optionalChain([configuration, 'optionalAccess',
|
|
5640
|
-
_optionalChain([configuration, 'optionalAccess',
|
|
5641
|
-
_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);
|
|
5642
5684
|
});
|
|
5643
5685
|
}
|
|
5644
5686
|
function yjsToItemConfiguration(yDoc) {
|
|
@@ -6430,7 +6472,7 @@ var ListTreeBuilder = class {
|
|
|
6430
6472
|
}
|
|
6431
6473
|
addWithProperty(block, multiRichTextProperty) {
|
|
6432
6474
|
const parsedOptions = PageBlockDefinitionMutiRichTextOptions.optional().parse(multiRichTextProperty.options);
|
|
6433
|
-
return this.add(block, multiRichTextProperty.id, _optionalChain([parsedOptions, 'optionalAccess',
|
|
6475
|
+
return this.add(block, multiRichTextProperty.id, _optionalChain([parsedOptions, 'optionalAccess', _39 => _39.multiRichTextStyle]) || "OL");
|
|
6434
6476
|
}
|
|
6435
6477
|
add(block, multiRichTextPropertyId, multiRichTextPropertyStyle) {
|
|
6436
6478
|
const list = this.createList(block, multiRichTextPropertyId, multiRichTextPropertyStyle);
|
|
@@ -6450,7 +6492,7 @@ var ListTreeBuilder = class {
|
|
|
6450
6492
|
}
|
|
6451
6493
|
const listParent = this.getParentOfDepth(block.data.indentLevel);
|
|
6452
6494
|
const lastChild = listParent.children[listParent.children.length - 1];
|
|
6453
|
-
if (_optionalChain([lastChild, 'optionalAccess',
|
|
6495
|
+
if (_optionalChain([lastChild, 'optionalAccess', _40 => _40.type]) === "List") {
|
|
6454
6496
|
lastChild.children.push(...list.leadingChildren);
|
|
6455
6497
|
return;
|
|
6456
6498
|
} else {
|
|
@@ -6634,7 +6676,7 @@ function serializeAsRichTextBlock(input) {
|
|
|
6634
6676
|
const textPropertyValue = BlockParsingUtils.richTextPropertyValue(blockItem, richTextProperty.id);
|
|
6635
6677
|
const enrichedInput = { ...input, richTextPropertyValue: textPropertyValue };
|
|
6636
6678
|
const parsedOptions = PageBlockDefinitionRichTextOptions.optional().parse(richTextProperty.options);
|
|
6637
|
-
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess',
|
|
6679
|
+
const style = _nullishCoalesce(_optionalChain([parsedOptions, 'optionalAccess', _41 => _41.richTextStyle]), () => ( "Default"));
|
|
6638
6680
|
switch (style) {
|
|
6639
6681
|
case "Callout":
|
|
6640
6682
|
return serializeAsCallout(enrichedInput);
|
|
@@ -6855,7 +6897,7 @@ function serializeBlockNodeAttributes(block) {
|
|
|
6855
6897
|
};
|
|
6856
6898
|
}
|
|
6857
6899
|
function richTextHeadingLevel(property) {
|
|
6858
|
-
const style = _optionalChain([property, 'access',
|
|
6900
|
+
const style = _optionalChain([property, 'access', _42 => _42.options, 'optionalAccess', _43 => _43.richTextStyle]);
|
|
6859
6901
|
if (!style)
|
|
6860
6902
|
return void 0;
|
|
6861
6903
|
switch (style) {
|
|
@@ -6968,7 +7010,7 @@ function serializeAsCustomBlock(block, definition) {
|
|
|
6968
7010
|
linksTo: i.linksTo
|
|
6969
7011
|
};
|
|
6970
7012
|
});
|
|
6971
|
-
const columns = _optionalChain([block, 'access',
|
|
7013
|
+
const columns = _optionalChain([block, 'access', _44 => _44.data, 'access', _45 => _45.appearance, 'optionalAccess', _46 => _46.numberOfColumns]);
|
|
6972
7014
|
return {
|
|
6973
7015
|
type: serializeCustomBlockNodeType(block, definition),
|
|
6974
7016
|
attrs: {
|
|
@@ -8769,7 +8811,6 @@ function parseAsRichText(prosemirrorNode, definition, property) {
|
|
|
8769
8811
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
8770
8812
|
const calloutType = parseCalloutType(getProsemirrorAttribute(prosemirrorNode, "type", _zod.z.string().optional()));
|
|
8771
8813
|
return {
|
|
8772
|
-
// TODO Artem: indent
|
|
8773
8814
|
id,
|
|
8774
8815
|
type: "Block",
|
|
8775
8816
|
...variantId && { variantId },
|
|
@@ -8815,10 +8856,10 @@ function parseAsMultiRichText(prosemirrorNode, definition, property, definitions
|
|
|
8815
8856
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
8816
8857
|
const result = [];
|
|
8817
8858
|
const listItems = [];
|
|
8818
|
-
_optionalChain([prosemirrorNode, 'access',
|
|
8859
|
+
_optionalChain([prosemirrorNode, 'access', _47 => _47.content, 'optionalAccess', _48 => _48.forEach, 'call', _49 => _49((c) => {
|
|
8819
8860
|
if (c.type !== "listItem")
|
|
8820
8861
|
return;
|
|
8821
|
-
_optionalChain([c, 'access',
|
|
8862
|
+
_optionalChain([c, 'access', _50 => _50.content, 'optionalAccess', _51 => _51.forEach, 'call', _52 => _52((cc) => {
|
|
8822
8863
|
listItems.push(cc);
|
|
8823
8864
|
})]);
|
|
8824
8865
|
})]);
|
|
@@ -8921,17 +8962,17 @@ function parseAsTable(prosemirrorNode, definition, property) {
|
|
|
8921
8962
|
return null;
|
|
8922
8963
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
8923
8964
|
const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", _zod.z.boolean().optional()) !== false;
|
|
8924
|
-
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")]);
|
|
8925
8966
|
if (!tableChild) {
|
|
8926
8967
|
return emptyTable(id, variantId, 0);
|
|
8927
8968
|
}
|
|
8928
|
-
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]))]), () => ( []));
|
|
8929
8970
|
if (!rows.length) {
|
|
8930
8971
|
return emptyTable(id, variantId, 0);
|
|
8931
8972
|
}
|
|
8932
|
-
const rowHeaderCells = _nullishCoalesce(_optionalChain([rows, 'access',
|
|
8933
|
-
const columnHeaderCells = rows.filter((r) => _optionalChain([r, 'access',
|
|
8934
|
-
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;
|
|
8935
8976
|
const hasHeaderColumn = rows.length === columnHeaderCells;
|
|
8936
8977
|
const tableValue = {
|
|
8937
8978
|
showBorder: hasBorder,
|
|
@@ -9013,7 +9054,7 @@ function parseAsTableNode(prosemirrorNode) {
|
|
|
9013
9054
|
const parsedItems = PageBlockItemV2.array().safeParse(JSON.parse(items));
|
|
9014
9055
|
if (!parsedItems.success)
|
|
9015
9056
|
return null;
|
|
9016
|
-
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]);
|
|
9017
9058
|
if (!rawImagePropertyValue)
|
|
9018
9059
|
return null;
|
|
9019
9060
|
const imagePropertyValueParseResult = PageBlockItemImageValue.safeParse(rawImagePropertyValue);
|
|
@@ -9237,7 +9278,7 @@ function getProsemirrorBlockVariantId(prosemirrorNode) {
|
|
|
9237
9278
|
return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(_zod.z.string()));
|
|
9238
9279
|
}
|
|
9239
9280
|
function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
|
|
9240
|
-
const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access',
|
|
9281
|
+
const parsedAttr = validationSchema.safeParse(_optionalChain([prosemirrorNode, 'access', _76 => _76.attrs, 'optionalAccess', _77 => _77[attributeName]]));
|
|
9241
9282
|
if (parsedAttr.success) {
|
|
9242
9283
|
return parsedAttr.data;
|
|
9243
9284
|
} else {
|