@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.mjs
CHANGED
|
@@ -151,8 +151,9 @@ import { z as z141 } from "zod";
|
|
|
151
151
|
import { z as z143 } from "zod";
|
|
152
152
|
import { z as z142 } from "zod";
|
|
153
153
|
import { z as z144 } from "zod";
|
|
154
|
-
import { z as z145 } from "zod";
|
|
155
154
|
import { z as z146 } from "zod";
|
|
155
|
+
import { z as z145 } from "zod";
|
|
156
|
+
import slugifyImplementation from "@sindresorhus/slugify";
|
|
156
157
|
import { z as z147 } from "zod";
|
|
157
158
|
import { z as z148 } from "zod";
|
|
158
159
|
import { z as z149 } from "zod";
|
|
@@ -162,7 +163,6 @@ import { z as z152 } from "zod";
|
|
|
162
163
|
import { z as z153 } from "zod";
|
|
163
164
|
import { z as z154 } from "zod";
|
|
164
165
|
import { z as z155 } from "zod";
|
|
165
|
-
import slugifyImplementation from "@sindresorhus/slugify";
|
|
166
166
|
var AssetDeleteScheduleStatus = z.enum(["InProgress", "Pending"]);
|
|
167
167
|
var AssetDeleteSchedule = z.object({
|
|
168
168
|
id: z.string(),
|
|
@@ -2774,9 +2774,12 @@ var ExportJobContext = z131.object({
|
|
|
2774
2774
|
apiUrl: z131.string(),
|
|
2775
2775
|
accessToken: z131.string(),
|
|
2776
2776
|
designSystemId: z131.string(),
|
|
2777
|
+
designSystemName: z131.string(),
|
|
2778
|
+
exporterId: z131.string(),
|
|
2777
2779
|
versionId: z131.string(),
|
|
2778
2780
|
brandId: z131.string().optional(),
|
|
2779
2781
|
themeId: z131.string().optional(),
|
|
2782
|
+
exporterName: z131.string(),
|
|
2780
2783
|
exporterPackageUrl: z131.string(),
|
|
2781
2784
|
exporterPropertyValues: ExporterPropertyValue.array(),
|
|
2782
2785
|
documentation: ExportJobDocumentationContext.optional()
|
|
@@ -2801,8 +2804,8 @@ var ExporterDestinationGithub = z133.object({
|
|
|
2801
2804
|
branch: z133.string(),
|
|
2802
2805
|
relativePath: nullishToOptional(z133.string()),
|
|
2803
2806
|
// Legacy deprecated fields. Use `credentialId` instead
|
|
2804
|
-
connectionId: z133.string()
|
|
2805
|
-
userId: z133.number()
|
|
2807
|
+
connectionId: nullishToOptional(z133.string()),
|
|
2808
|
+
userId: nullishToOptional(z133.number())
|
|
2806
2809
|
});
|
|
2807
2810
|
var ExporterDestinationAzure = z133.object({
|
|
2808
2811
|
credentialId: z133.string().optional(),
|
|
@@ -2816,8 +2819,8 @@ var ExporterDestinationAzure = z133.object({
|
|
|
2816
2819
|
// Maybe not needed
|
|
2817
2820
|
url: nullishToOptional(z133.string()),
|
|
2818
2821
|
// Legacy deprecated fields. Use `credentialId` instead
|
|
2819
|
-
connectionId: z133.string()
|
|
2820
|
-
userId: z133.number()
|
|
2822
|
+
connectionId: nullishToOptional(z133.string()),
|
|
2823
|
+
userId: nullishToOptional(z133.number())
|
|
2821
2824
|
});
|
|
2822
2825
|
var ExporterDestinationGitlab = z133.object({
|
|
2823
2826
|
credentialId: z133.string().optional(),
|
|
@@ -2829,8 +2832,8 @@ var ExporterDestinationGitlab = z133.object({
|
|
|
2829
2832
|
// Maybe not needed
|
|
2830
2833
|
url: nullishToOptional(z133.string()),
|
|
2831
2834
|
// Legacy deprecated fields. Use `credentialId` instead
|
|
2832
|
-
connectionId: z133.string()
|
|
2833
|
-
userId: z133.number()
|
|
2835
|
+
connectionId: nullishToOptional(z133.string()),
|
|
2836
|
+
userId: nullishToOptional(z133.number())
|
|
2834
2837
|
});
|
|
2835
2838
|
var ExporterDestinationBitbucket = z133.object({
|
|
2836
2839
|
credentialId: z133.string().optional(),
|
|
@@ -2842,8 +2845,8 @@ var ExporterDestinationBitbucket = z133.object({
|
|
|
2842
2845
|
branch: z133.string(),
|
|
2843
2846
|
relativePath: nullishToOptional(z133.string()),
|
|
2844
2847
|
// Legacy deprecated fields. Use `credentialId` instead
|
|
2845
|
-
connectionId: z133.string()
|
|
2846
|
-
userId: z133.number()
|
|
2848
|
+
connectionId: nullishToOptional(z133.string()),
|
|
2849
|
+
userId: nullishToOptional(z133.number())
|
|
2847
2850
|
});
|
|
2848
2851
|
var ExportDestinationsMap = z133.object({
|
|
2849
2852
|
webhookUrl: z133.string().optional(),
|
|
@@ -2878,7 +2881,9 @@ var ExportJobS3DestinationResult = z134.object({
|
|
|
2878
2881
|
bucket: z134.string(),
|
|
2879
2882
|
urlPrefix: z134.string().optional(),
|
|
2880
2883
|
path: z134.string(),
|
|
2881
|
-
files: z134.array(z134.string())
|
|
2884
|
+
files: z134.array(z134.string()),
|
|
2885
|
+
url: nullishToOptional(z134.string()),
|
|
2886
|
+
urls: nullishToOptional(z134.string().array())
|
|
2882
2887
|
});
|
|
2883
2888
|
var ExportJobDocsDestinationResult = z134.object({
|
|
2884
2889
|
url: z134.string()
|
|
@@ -2890,12 +2895,13 @@ var ExportJobResult = z134.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 = z134.object({
|
|
2896
2902
|
id: z134.string(),
|
|
2897
|
-
createdAt: z134.date(),
|
|
2898
|
-
finishedAt: z134.date().optional(),
|
|
2903
|
+
createdAt: z134.coerce.date(),
|
|
2904
|
+
finishedAt: z134.coerce.date().optional(),
|
|
2899
2905
|
designSystemId: z134.string(),
|
|
2900
2906
|
designSystemVersionId: z134.string(),
|
|
2901
2907
|
workspaceId: z134.string(),
|
|
@@ -2984,7 +2990,7 @@ var PulsarCustomBlock = z138.object({
|
|
|
2984
2990
|
});
|
|
2985
2991
|
var ExporterType = z139.enum(["code", "documentation"]);
|
|
2986
2992
|
var ExporterSource = z139.enum(["git", "upload"]);
|
|
2987
|
-
var ExporterTag = z139.string()
|
|
2993
|
+
var ExporterTag = z139.string();
|
|
2988
2994
|
var ExporterPulsarDetails = z139.object({
|
|
2989
2995
|
description: z139.string(),
|
|
2990
2996
|
version: z139.string(),
|
|
@@ -3076,220 +3082,31 @@ var GitObjectsQuery = z144.object({
|
|
|
3076
3082
|
var GitOrganization = z144.object({
|
|
3077
3083
|
id: z144.string(),
|
|
3078
3084
|
name: z144.string(),
|
|
3079
|
-
url: z144.string()
|
|
3085
|
+
url: z144.string(),
|
|
3086
|
+
slug: z144.string()
|
|
3080
3087
|
});
|
|
3081
3088
|
var GitProject = z144.object({
|
|
3082
3089
|
id: z144.string(),
|
|
3083
3090
|
name: z144.string(),
|
|
3084
|
-
url: z144.string()
|
|
3091
|
+
url: z144.string(),
|
|
3092
|
+
slug: z144.string()
|
|
3085
3093
|
});
|
|
3086
3094
|
var GitRepository = z144.object({
|
|
3087
3095
|
id: z144.string(),
|
|
3088
3096
|
name: z144.string(),
|
|
3089
3097
|
url: z144.string(),
|
|
3090
|
-
|
|
3098
|
+
slug: z144.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: z144.string().optional()
|
|
3091
3105
|
});
|
|
3092
3106
|
var GitBranch = z144.object({
|
|
3093
3107
|
name: z144.string(),
|
|
3094
3108
|
lastCommitId: z144.string()
|
|
3095
3109
|
});
|
|
3096
|
-
var IntegrationDesignSystem = z145.object({
|
|
3097
|
-
designSystemId: z145.string(),
|
|
3098
|
-
brandId: z145.string(),
|
|
3099
|
-
title: z145.string().optional(),
|
|
3100
|
-
userId: z145.string().optional(),
|
|
3101
|
-
date: z145.coerce.date().optional()
|
|
3102
|
-
});
|
|
3103
|
-
var IntegrationCredentialsType = z145.enum(["OAuth2", "PAT", "GithubApp"]);
|
|
3104
|
-
var IntegrationCredentialsProfile = z145.object({
|
|
3105
|
-
id: nullishToOptional(z145.string()),
|
|
3106
|
-
email: nullishToOptional(z145.string()),
|
|
3107
|
-
handle: nullishToOptional(z145.string()),
|
|
3108
|
-
type: nullishToOptional(z145.string()),
|
|
3109
|
-
avatarUrl: nullishToOptional(z145.string()),
|
|
3110
|
-
organization: nullishToOptional(z145.string())
|
|
3111
|
-
});
|
|
3112
|
-
var IntegrationCredentials = z145.object({
|
|
3113
|
-
id: z145.string(),
|
|
3114
|
-
type: IntegrationCredentialsType,
|
|
3115
|
-
integrationId: z145.string(),
|
|
3116
|
-
accessToken: z145.string(),
|
|
3117
|
-
userId: z145.string(),
|
|
3118
|
-
createdAt: z145.coerce.date(),
|
|
3119
|
-
refreshToken: z145.string().optional(),
|
|
3120
|
-
tokenName: z145.string().optional(),
|
|
3121
|
-
expiresAt: z145.coerce.date().optional(),
|
|
3122
|
-
refreshedAt: z145.coerce.date().optional(),
|
|
3123
|
-
username: z145.string().optional(),
|
|
3124
|
-
appInstallationId: z145.string().optional(),
|
|
3125
|
-
profile: IntegrationCredentialsProfile.optional(),
|
|
3126
|
-
customUrl: z145.string().optional(),
|
|
3127
|
-
user: UserMinified.optional()
|
|
3128
|
-
});
|
|
3129
|
-
var ExtendedIntegrationType = z145.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 = z145.object({
|
|
3141
|
-
id: z145.string(),
|
|
3142
|
-
workspaceId: z145.string(),
|
|
3143
|
-
type: IntegrationType,
|
|
3144
|
-
createdAt: z145.coerce.date(),
|
|
3145
|
-
integrationCredentials: z145.array(IntegrationCredentials).optional()
|
|
3146
|
-
});
|
|
3147
|
-
var forbiddenCustomUrldomainList = ["github.com", "gitlab.com", "bitbucket.org", "figma.com", "dev.azure.com"];
|
|
3148
|
-
var IntegrationToken = z145.object({
|
|
3149
|
-
access_token: z145.string(),
|
|
3150
|
-
refresh_token: z145.string().optional(),
|
|
3151
|
-
expires_in: z145.union([z145.number().optional(), z145.string().optional()]),
|
|
3152
|
-
token_type: z145.string().optional(),
|
|
3153
|
-
token_name: z145.string().optional(),
|
|
3154
|
-
token_azure_organization_name: z145.string().optional(),
|
|
3155
|
-
// Azure only
|
|
3156
|
-
token_bitbucket_username: z145.string().optional(),
|
|
3157
|
-
// Bitbucket only
|
|
3158
|
-
custom_url: z145.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 = z146.object({
|
|
3193
|
-
id: z146.string(),
|
|
3194
|
-
provider: OAuthProviderSchema,
|
|
3195
|
-
scope: z146.string(),
|
|
3196
|
-
userId: z146.string(),
|
|
3197
|
-
accessToken: z146.string(),
|
|
3198
|
-
refreshToken: z146.string(),
|
|
3199
|
-
expiresAt: z146.coerce.date(),
|
|
3200
|
-
externalUserId: z146.string().nullish()
|
|
3201
|
-
});
|
|
3202
|
-
var WorkspaceOAuthRequestSchema = z147.object({
|
|
3203
|
-
id: z147.string(),
|
|
3204
|
-
workspaceId: z147.string(),
|
|
3205
|
-
provider: OAuthProviderSchema,
|
|
3206
|
-
userId: z147.string(),
|
|
3207
|
-
createdAt: z147.coerce.date()
|
|
3208
|
-
});
|
|
3209
|
-
var DesignSystemVersionRoom = Entity.extend({
|
|
3210
|
-
designSystemVersionId: z148.string(),
|
|
3211
|
-
liveblocksId: z148.string()
|
|
3212
|
-
});
|
|
3213
|
-
var DesignSystemVersionRoomInternalSettings = z148.object({
|
|
3214
|
-
routingVersion: z148.string()
|
|
3215
|
-
});
|
|
3216
|
-
var DesignSystemVersionRoomInitialState = z148.object({
|
|
3217
|
-
pages: z148.array(DocumentationPageV2),
|
|
3218
|
-
groups: z148.array(ElementGroup),
|
|
3219
|
-
internalSettings: DesignSystemVersionRoomInternalSettings
|
|
3220
|
-
});
|
|
3221
|
-
var DesignSystemVersionRoomUpdate = z148.object({
|
|
3222
|
-
pages: z148.array(DocumentationPageV2),
|
|
3223
|
-
groups: z148.array(ElementGroup),
|
|
3224
|
-
deletedPageIds: z148.array(z148.string()),
|
|
3225
|
-
deletedGroupIds: z148.array(z148.string())
|
|
3226
|
-
});
|
|
3227
|
-
var DocumentationPageRoom = Entity.extend({
|
|
3228
|
-
designSystemVersionId: z149.string(),
|
|
3229
|
-
documentationPageId: z149.string(),
|
|
3230
|
-
liveblocksId: z149.string(),
|
|
3231
|
-
isDirty: z149.boolean()
|
|
3232
|
-
});
|
|
3233
|
-
var DocumentationPageRoomState = z149.object({
|
|
3234
|
-
pageItems: z149.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
|
|
3235
|
-
itemConfiguration: DocumentationItemConfigurationV2
|
|
3236
|
-
});
|
|
3237
|
-
var DocumentationPageRoomRoomUpdate = z149.object({
|
|
3238
|
-
page: DocumentationPageV2,
|
|
3239
|
-
pageParent: ElementGroup
|
|
3240
|
-
});
|
|
3241
|
-
var DocumentationPageRoomInitialStateUpdate = DocumentationPageRoomRoomUpdate.extend({
|
|
3242
|
-
pageItems: z149.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
|
|
3243
|
-
blockDefinitions: z149.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 = z150.nativeEnum(RoomTypeEnum);
|
|
3252
|
-
var RoomType = RoomTypeSchema.enum;
|
|
3253
|
-
var WorkspaceRoom = Entity.extend({
|
|
3254
|
-
workspaceId: z151.string(),
|
|
3255
|
-
liveblocksId: z151.string()
|
|
3256
|
-
});
|
|
3257
|
-
var AnyRecord = z152.record(z152.any());
|
|
3258
|
-
var NpmPackageVersionDist = AnyRecord.and(
|
|
3259
|
-
z152.object({
|
|
3260
|
-
tarball: z152.string()
|
|
3261
|
-
})
|
|
3262
|
-
);
|
|
3263
|
-
var NpmPackageVersion = AnyRecord.and(
|
|
3264
|
-
z152.object({
|
|
3265
|
-
dist: NpmPackageVersionDist
|
|
3266
|
-
})
|
|
3267
|
-
);
|
|
3268
|
-
var NpmPackage = AnyRecord.and(
|
|
3269
|
-
z152.object({
|
|
3270
|
-
_id: z152.string(),
|
|
3271
|
-
name: z152.string(),
|
|
3272
|
-
// e.g. "latest": "1.2.3"
|
|
3273
|
-
"dist-tags": z152.record(z152.string(), z152.string()),
|
|
3274
|
-
// "1.2.3": {...}
|
|
3275
|
-
versions: z152.record(NpmPackageVersion)
|
|
3276
|
-
})
|
|
3277
|
-
);
|
|
3278
|
-
var NpmProxyTokenPayload = z153.object({
|
|
3279
|
-
npmProxyRegistryConfigId: z153.string()
|
|
3280
|
-
});
|
|
3281
|
-
var PersonalAccessToken = z154.object({
|
|
3282
|
-
id: z154.string(),
|
|
3283
|
-
userId: z154.string(),
|
|
3284
|
-
workspaceId: z154.string().optional(),
|
|
3285
|
-
workspaceRole: WorkspaceRoleSchema.optional(),
|
|
3286
|
-
name: z154.string(),
|
|
3287
|
-
hidden: z154.boolean(),
|
|
3288
|
-
token: z154.string(),
|
|
3289
|
-
scope: z154.string().optional(),
|
|
3290
|
-
createdAt: z154.coerce.date(),
|
|
3291
|
-
expireAt: z154.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) {
|
|
@@ -3382,25 +3214,25 @@ function groupBy(items, keyFn) {
|
|
|
3382
3214
|
}
|
|
3383
3215
|
return result;
|
|
3384
3216
|
}
|
|
3385
|
-
var ContentLoadInstruction =
|
|
3386
|
-
from:
|
|
3387
|
-
to:
|
|
3388
|
-
authorizationHeaderKvsId:
|
|
3389
|
-
timeout:
|
|
3390
|
-
});
|
|
3391
|
-
var ContentLoaderPayload =
|
|
3392
|
-
type:
|
|
3217
|
+
var ContentLoadInstruction = z145.object({
|
|
3218
|
+
from: z145.string(),
|
|
3219
|
+
to: z145.string(),
|
|
3220
|
+
authorizationHeaderKvsId: z145.string().optional(),
|
|
3221
|
+
timeout: z145.number().optional()
|
|
3222
|
+
});
|
|
3223
|
+
var ContentLoaderPayload = z145.object({
|
|
3224
|
+
type: z145.literal("Single"),
|
|
3393
3225
|
instruction: ContentLoadInstruction
|
|
3394
3226
|
}).or(
|
|
3395
|
-
|
|
3396
|
-
type:
|
|
3397
|
-
loadingChunkSize:
|
|
3398
|
-
instructions:
|
|
3227
|
+
z145.object({
|
|
3228
|
+
type: z145.literal("Multiple"),
|
|
3229
|
+
loadingChunkSize: z145.number().optional(),
|
|
3230
|
+
instructions: z145.array(ContentLoadInstruction)
|
|
3399
3231
|
})
|
|
3400
3232
|
).or(
|
|
3401
|
-
|
|
3402
|
-
type:
|
|
3403
|
-
location:
|
|
3233
|
+
z145.object({
|
|
3234
|
+
type: z145.literal("S3"),
|
|
3235
|
+
location: z145.string()
|
|
3404
3236
|
})
|
|
3405
3237
|
);
|
|
3406
3238
|
function slugify(str, options) {
|
|
@@ -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 = z146.object({
|
|
3863
|
+
designSystemId: z146.string(),
|
|
3864
|
+
brandId: z146.string(),
|
|
3865
|
+
title: z146.string().optional(),
|
|
3866
|
+
userId: z146.string().optional(),
|
|
3867
|
+
date: z146.coerce.date().optional()
|
|
3868
|
+
});
|
|
3869
|
+
var IntegrationCredentialsType = z146.enum(["OAuth2", "PAT", "GithubApp"]);
|
|
3870
|
+
var IntegrationCredentialsState = z146.enum(["Active", "Inactive"]);
|
|
3871
|
+
var IntegrationCredentialsProfile = z146.object({
|
|
3872
|
+
id: nullishToOptional(z146.string()),
|
|
3873
|
+
email: nullishToOptional(z146.string()),
|
|
3874
|
+
handle: nullishToOptional(z146.string()),
|
|
3875
|
+
type: nullishToOptional(z146.string()),
|
|
3876
|
+
avatarUrl: nullishToOptional(z146.string()),
|
|
3877
|
+
organization: nullishToOptional(z146.string()),
|
|
3878
|
+
collection: nullishToOptional(z146.string())
|
|
3879
|
+
});
|
|
3880
|
+
var IntegrationCredentials = z146.object({
|
|
3881
|
+
id: z146.string(),
|
|
3882
|
+
type: IntegrationCredentialsType,
|
|
3883
|
+
integrationId: z146.string(),
|
|
3884
|
+
accessToken: z146.string(),
|
|
3885
|
+
userId: z146.string(),
|
|
3886
|
+
createdAt: z146.coerce.date(),
|
|
3887
|
+
refreshToken: z146.string().optional(),
|
|
3888
|
+
tokenName: z146.string().optional(),
|
|
3889
|
+
expiresAt: z146.coerce.date().optional(),
|
|
3890
|
+
refreshedAt: z146.coerce.date().optional(),
|
|
3891
|
+
username: z146.string().optional(),
|
|
3892
|
+
appInstallationId: z146.string().optional(),
|
|
3893
|
+
profile: IntegrationCredentialsProfile.optional(),
|
|
3894
|
+
customUrl: z146.string().optional(),
|
|
3895
|
+
state: IntegrationCredentialsState,
|
|
3896
|
+
user: UserMinified.optional()
|
|
3897
|
+
});
|
|
3898
|
+
var ExtendedIntegrationType = z146.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 = z146.object({
|
|
3910
|
+
id: z146.string(),
|
|
3911
|
+
workspaceId: z146.string(),
|
|
3912
|
+
type: IntegrationType,
|
|
3913
|
+
createdAt: z146.coerce.date(),
|
|
3914
|
+
integrationCredentials: z146.array(IntegrationCredentials).optional()
|
|
3915
|
+
});
|
|
3916
|
+
var IntegrationToken = z146.object({
|
|
3917
|
+
access_token: z146.string(),
|
|
3918
|
+
refresh_token: z146.string().optional(),
|
|
3919
|
+
expires_in: z146.union([z146.number().optional(), z146.string().optional()]),
|
|
3920
|
+
token_type: z146.string().optional(),
|
|
3921
|
+
token_name: z146.string().optional(),
|
|
3922
|
+
token_azure_organization_name: z146.string().optional(),
|
|
3923
|
+
// Azure Cloud PAT only
|
|
3924
|
+
token_azure_collection_name: z146.string().optional(),
|
|
3925
|
+
// Azure Server PAT only
|
|
3926
|
+
token_bitbucket_username: z146.string().optional(),
|
|
3927
|
+
// Bitbucket only
|
|
3928
|
+
custom_url: z146.string().optional().transform((value) => {
|
|
3929
|
+
if (!value?.trim())
|
|
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 = z147.object({
|
|
3965
|
+
id: z147.string(),
|
|
3966
|
+
provider: OAuthProviderSchema,
|
|
3967
|
+
scope: z147.string(),
|
|
3968
|
+
userId: z147.string(),
|
|
3969
|
+
accessToken: z147.string(),
|
|
3970
|
+
refreshToken: z147.string(),
|
|
3971
|
+
expiresAt: z147.coerce.date(),
|
|
3972
|
+
externalUserId: z147.string().nullish()
|
|
3973
|
+
});
|
|
3974
|
+
var WorkspaceOAuthRequestSchema = z148.object({
|
|
3975
|
+
id: z148.string(),
|
|
3976
|
+
workspaceId: z148.string(),
|
|
3977
|
+
provider: OAuthProviderSchema,
|
|
3978
|
+
userId: z148.string(),
|
|
3979
|
+
createdAt: z148.coerce.date()
|
|
3980
|
+
});
|
|
3981
|
+
var DesignSystemVersionRoom = Entity.extend({
|
|
3982
|
+
designSystemVersionId: z149.string(),
|
|
3983
|
+
liveblocksId: z149.string()
|
|
3984
|
+
});
|
|
3985
|
+
var DesignSystemVersionRoomInternalSettings = z149.object({
|
|
3986
|
+
routingVersion: z149.string()
|
|
3987
|
+
});
|
|
3988
|
+
var DesignSystemVersionRoomInitialState = z149.object({
|
|
3989
|
+
pages: z149.array(DocumentationPageV2),
|
|
3990
|
+
groups: z149.array(ElementGroup),
|
|
3991
|
+
internalSettings: DesignSystemVersionRoomInternalSettings
|
|
3992
|
+
});
|
|
3993
|
+
var DesignSystemVersionRoomUpdate = z149.object({
|
|
3994
|
+
pages: z149.array(DocumentationPageV2),
|
|
3995
|
+
groups: z149.array(ElementGroup),
|
|
3996
|
+
deletedPageIds: z149.array(z149.string()),
|
|
3997
|
+
deletedGroupIds: z149.array(z149.string())
|
|
3998
|
+
});
|
|
3999
|
+
var DocumentationPageRoom = Entity.extend({
|
|
4000
|
+
designSystemVersionId: z150.string(),
|
|
4001
|
+
documentationPageId: z150.string(),
|
|
4002
|
+
liveblocksId: z150.string(),
|
|
4003
|
+
isDirty: z150.boolean()
|
|
4004
|
+
});
|
|
4005
|
+
var DocumentationPageRoomState = z150.object({
|
|
4006
|
+
pageItems: z150.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
|
|
4007
|
+
itemConfiguration: DocumentationItemConfigurationV2
|
|
4008
|
+
});
|
|
4009
|
+
var DocumentationPageRoomRoomUpdate = z150.object({
|
|
4010
|
+
page: DocumentationPageV2,
|
|
4011
|
+
pageParent: ElementGroup
|
|
4012
|
+
});
|
|
4013
|
+
var DocumentationPageRoomInitialStateUpdate = DocumentationPageRoomRoomUpdate.extend({
|
|
4014
|
+
pageItems: z150.array(PageBlockEditorModelV2.or(PageSectionEditorModelV2)),
|
|
4015
|
+
blockDefinitions: z150.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 = z151.nativeEnum(RoomTypeEnum);
|
|
4024
|
+
var RoomType = RoomTypeSchema.enum;
|
|
4025
|
+
var WorkspaceRoom = Entity.extend({
|
|
4026
|
+
workspaceId: z152.string(),
|
|
4027
|
+
liveblocksId: z152.string()
|
|
4028
|
+
});
|
|
4029
|
+
var AnyRecord = z153.record(z153.any());
|
|
4030
|
+
var NpmPackageVersionDist = AnyRecord.and(
|
|
4031
|
+
z153.object({
|
|
4032
|
+
tarball: z153.string()
|
|
4033
|
+
})
|
|
4034
|
+
);
|
|
4035
|
+
var NpmPackageVersion = AnyRecord.and(
|
|
4036
|
+
z153.object({
|
|
4037
|
+
dist: NpmPackageVersionDist
|
|
4038
|
+
})
|
|
4039
|
+
);
|
|
4040
|
+
var NpmPackage = AnyRecord.and(
|
|
4041
|
+
z153.object({
|
|
4042
|
+
_id: z153.string(),
|
|
4043
|
+
name: z153.string(),
|
|
4044
|
+
// e.g. "latest": "1.2.3"
|
|
4045
|
+
"dist-tags": z153.record(z153.string(), z153.string()),
|
|
4046
|
+
// "1.2.3": {...}
|
|
4047
|
+
versions: z153.record(NpmPackageVersion)
|
|
4048
|
+
})
|
|
4049
|
+
);
|
|
4050
|
+
var NpmProxyTokenPayload = z154.object({
|
|
4051
|
+
npmProxyRegistryConfigId: z154.string()
|
|
4052
|
+
});
|
|
4053
|
+
var PersonalAccessToken = z155.object({
|
|
4054
|
+
id: z155.string(),
|
|
4055
|
+
userId: z155.string(),
|
|
4056
|
+
workspaceId: z155.string().optional(),
|
|
4057
|
+
workspaceRole: WorkspaceRoleSchema.optional(),
|
|
4058
|
+
name: z155.string(),
|
|
4059
|
+
hidden: z155.boolean(),
|
|
4060
|
+
token: z155.string(),
|
|
4061
|
+
scope: z155.string().optional(),
|
|
4062
|
+
createdAt: z155.coerce.date(),
|
|
4063
|
+
expireAt: z155.coerce.date().optional()
|
|
4064
|
+
});
|
|
4030
4065
|
|
|
4031
4066
|
// src/api/conversion/documentation/documentation-item-configuration-v2-to-dto.ts
|
|
4032
4067
|
var getDtoDefaultItemConfigurationV2 = () => ({
|
|
@@ -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
|
}
|
|
@@ -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 = z189.object({
|
|
|
5384
5423
|
});
|
|
5385
5424
|
var DTOExportJob = z189.object({
|
|
5386
5425
|
id: z189.string(),
|
|
5387
|
-
createdAt: z189.date(),
|
|
5388
|
-
finishedAt: z189.date().optional(),
|
|
5426
|
+
createdAt: z189.coerce.date(),
|
|
5427
|
+
finishedAt: z189.coerce.date().optional(),
|
|
5389
5428
|
index: z189.number().optional(),
|
|
5390
5429
|
status: ExportJobStatus,
|
|
5391
5430
|
estimatedExecutionTime: z189.number().optional(),
|
|
@@ -5436,18 +5475,21 @@ import { z as z193 } from "zod";
|
|
|
5436
5475
|
var DTOGitOrganization = z193.object({
|
|
5437
5476
|
id: z193.string(),
|
|
5438
5477
|
name: z193.string(),
|
|
5439
|
-
url: z193.string()
|
|
5478
|
+
url: z193.string(),
|
|
5479
|
+
slug: z193.string()
|
|
5440
5480
|
});
|
|
5441
5481
|
var DTOGitProject = z193.object({
|
|
5442
5482
|
id: z193.string(),
|
|
5443
5483
|
name: z193.string(),
|
|
5444
|
-
url: z193.string()
|
|
5484
|
+
url: z193.string(),
|
|
5485
|
+
slug: z193.string()
|
|
5445
5486
|
});
|
|
5446
5487
|
var DTOGitRepository = z193.object({
|
|
5447
5488
|
id: z193.string(),
|
|
5448
5489
|
name: z193.string(),
|
|
5449
5490
|
url: z193.string(),
|
|
5450
|
-
|
|
5491
|
+
slug: z193.string(),
|
|
5492
|
+
defaultBranch: z193.string().optional()
|
|
5451
5493
|
});
|
|
5452
5494
|
var DTOGitBranch = z193.object({
|
|
5453
5495
|
name: z193.string(),
|
|
@@ -8769,7 +8811,6 @@ function parseAsRichText(prosemirrorNode, definition, property) {
|
|
|
8769
8811
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
8770
8812
|
const calloutType = parseCalloutType(getProsemirrorAttribute(prosemirrorNode, "type", z201.string().optional()));
|
|
8771
8813
|
return {
|
|
8772
|
-
// TODO Artem: indent
|
|
8773
8814
|
id,
|
|
8774
8815
|
type: "Block",
|
|
8775
8816
|
...variantId && { variantId },
|