@supernova-studio/client 1.52.1 → 1.52.3
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 +926 -37
- package/dist/index.d.ts +926 -37
- package/dist/index.js +277 -182
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +534 -439
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -4541,9 +4541,33 @@ var UserMinified = z139.object({
|
|
|
4541
4541
|
var LiveblocksNotificationSettings = z140.object({
|
|
4542
4542
|
sendCommentNotificationEmails: z140.boolean()
|
|
4543
4543
|
});
|
|
4544
|
-
var
|
|
4545
|
-
|
|
4544
|
+
var NotificationType = z140.enum([
|
|
4545
|
+
"DesignDocumentComment",
|
|
4546
|
+
"ChatMention",
|
|
4547
|
+
"ProjectDocumentComment",
|
|
4548
|
+
"ProjectInvitation"
|
|
4549
|
+
]);
|
|
4550
|
+
var NotificationChannel = z140.enum(["Email", "InApp"]);
|
|
4551
|
+
var NotificationSettingOptions = z140.object({
|
|
4552
|
+
enabled: z140.boolean(),
|
|
4553
|
+
email: z140.boolean()
|
|
4554
|
+
});
|
|
4555
|
+
var NotificationSettings = z140.object({
|
|
4556
|
+
[NotificationType.enum.ChatMention]: NotificationSettingOptions,
|
|
4557
|
+
[NotificationType.enum.ProjectDocumentComment]: NotificationSettingOptions,
|
|
4558
|
+
[NotificationType.enum.ProjectInvitation]: NotificationSettingOptions,
|
|
4559
|
+
[NotificationType.enum.DesignDocumentComment]: NotificationSettingOptions.omit({
|
|
4560
|
+
enabled: true
|
|
4561
|
+
})
|
|
4546
4562
|
});
|
|
4563
|
+
var UserNotificationSettings = NotificationSettings.merge(
|
|
4564
|
+
z140.object({
|
|
4565
|
+
/**
|
|
4566
|
+
* @deprecated Use granular notification settings instead.
|
|
4567
|
+
*/
|
|
4568
|
+
liveblocksNotificationSettings: LiveblocksNotificationSettings
|
|
4569
|
+
})
|
|
4570
|
+
);
|
|
4547
4571
|
var UserOnboardingDepartment = z141.enum(["Design", "Engineering", "Product", "Brand", "Other"]);
|
|
4548
4572
|
var UserOnboardingJobLevel = z141.enum(["Executive", "Manager", "IndividualContributor", "Other"]);
|
|
4549
4573
|
var userThemePresets = [
|
|
@@ -7431,6 +7455,11 @@ var DTOWorkspaceResponse = z247.object({
|
|
|
7431
7455
|
workspace: DTOWorkspace
|
|
7432
7456
|
});
|
|
7433
7457
|
|
|
7458
|
+
// src/api/dto/notifications/settings.ts
|
|
7459
|
+
var DTOUserNotificationSettings = UserNotificationSettings;
|
|
7460
|
+
var DTONotificationType = NotificationType;
|
|
7461
|
+
var DTONotificationChannel = NotificationChannel;
|
|
7462
|
+
|
|
7434
7463
|
// src/api/dto/workspaces/membership.ts
|
|
7435
7464
|
var DTOUserWorkspaceMembership = z248.object({
|
|
7436
7465
|
/** Workspace the user is a member of */
|
|
@@ -7455,7 +7484,8 @@ var DTOWorkspaceMember = z248.object({
|
|
|
7455
7484
|
effectiveRole: DTOWorkspaceRole,
|
|
7456
7485
|
seatType: DTOWorkspaceSeatType,
|
|
7457
7486
|
effectiveSeatType: DTOWorkspaceSeatType,
|
|
7458
|
-
isDeactivated: z248.boolean()
|
|
7487
|
+
isDeactivated: z248.boolean(),
|
|
7488
|
+
notificationSettings: DTOUserNotificationSettings
|
|
7459
7489
|
});
|
|
7460
7490
|
var DTOUserWorkspaceMembershipsResponse = z248.object({
|
|
7461
7491
|
membership: z248.array(DTOUserWorkspaceMembership)
|
|
@@ -9282,6 +9312,182 @@ import z312 from "zod";
|
|
|
9282
9312
|
// src/api/dto/forge/project-member.ts
|
|
9283
9313
|
import { z as z311 } from "zod";
|
|
9284
9314
|
|
|
9315
|
+
// src/utils/figma.ts
|
|
9316
|
+
var figmaFileIdRegex = /^[0-9a-zA-Z]{22,128}$/;
|
|
9317
|
+
var nodeIdRegex = /^\d+-\d+$/;
|
|
9318
|
+
var nodeTypeRegex = /^[0-9a-zA-Z]^/;
|
|
9319
|
+
var ParsedFigmaFileURLError = /* @__PURE__ */ ((ParsedFigmaFileURLError2) => {
|
|
9320
|
+
ParsedFigmaFileURLError2["InvalidUrl"] = "InvalidUrl";
|
|
9321
|
+
ParsedFigmaFileURLError2["InvalidFigmaFileId"] = "InvalidFigmaFileId";
|
|
9322
|
+
return ParsedFigmaFileURLError2;
|
|
9323
|
+
})(ParsedFigmaFileURLError || {});
|
|
9324
|
+
var FigmaUtils = {
|
|
9325
|
+
tryParseFigmaFileURL(urlString) {
|
|
9326
|
+
if (!URL.canParse(urlString)) {
|
|
9327
|
+
return { status: "Error", error: "InvalidUrl" /* InvalidUrl */ };
|
|
9328
|
+
}
|
|
9329
|
+
const url = new URL(urlString);
|
|
9330
|
+
if (!url.hostname.endsWith("figma.com")) {
|
|
9331
|
+
return { status: "Error", error: "InvalidUrl" /* InvalidUrl */ };
|
|
9332
|
+
}
|
|
9333
|
+
const pathSegments = url.pathname.split("/");
|
|
9334
|
+
if (pathSegments[1] !== "design" && pathSegments[1] !== "file") {
|
|
9335
|
+
return { status: "Error", error: "InvalidUrl" /* InvalidUrl */ };
|
|
9336
|
+
}
|
|
9337
|
+
const fileId = pathSegments[2];
|
|
9338
|
+
if (!fileId || !fileId.match(figmaFileIdRegex)) {
|
|
9339
|
+
return { status: "Error", error: "InvalidFigmaFileId" /* InvalidFigmaFileId */ };
|
|
9340
|
+
}
|
|
9341
|
+
let fileName = null;
|
|
9342
|
+
const rawFileName = pathSegments[3];
|
|
9343
|
+
if (rawFileName) {
|
|
9344
|
+
fileName = rawFileName.replaceAll("-", " ");
|
|
9345
|
+
}
|
|
9346
|
+
let nodeId = null;
|
|
9347
|
+
const nodeIdRaw = url.searchParams.get("node-id");
|
|
9348
|
+
if (nodeIdRaw && nodeIdRaw.match(nodeIdRegex)) {
|
|
9349
|
+
nodeId = nodeIdRaw.replace("-", ":");
|
|
9350
|
+
}
|
|
9351
|
+
let nodeType = null;
|
|
9352
|
+
const nodeTypeRaw = url.searchParams.get("node-type");
|
|
9353
|
+
if (nodeTypeRaw && nodeTypeRaw.match(nodeTypeRegex)) {
|
|
9354
|
+
nodeType = nodeTypeRaw;
|
|
9355
|
+
}
|
|
9356
|
+
return { status: "Success", fileId, fileName, nodeId, nodeType };
|
|
9357
|
+
}
|
|
9358
|
+
};
|
|
9359
|
+
|
|
9360
|
+
// src/utils/hash.ts
|
|
9361
|
+
function hash(input) {
|
|
9362
|
+
return farmhash(input).toString(16);
|
|
9363
|
+
}
|
|
9364
|
+
function farmhash(input) {
|
|
9365
|
+
const seed = 2654435769;
|
|
9366
|
+
let hash2 = seed;
|
|
9367
|
+
for (let i = 0; i < input.length; i++) {
|
|
9368
|
+
const charCode = input.charCodeAt(i);
|
|
9369
|
+
hash2 ^= charCode;
|
|
9370
|
+
hash2 = Math.imul(hash2, 1540483477);
|
|
9371
|
+
hash2 ^= hash2 >>> 15;
|
|
9372
|
+
}
|
|
9373
|
+
hash2 = Math.imul(hash2, 1540483477);
|
|
9374
|
+
hash2 ^= hash2 >>> 13;
|
|
9375
|
+
hash2 = Math.imul(hash2, 1540483477);
|
|
9376
|
+
hash2 ^= hash2 >>> 15;
|
|
9377
|
+
return hash2 >>> 0;
|
|
9378
|
+
}
|
|
9379
|
+
function prepareObject(obj) {
|
|
9380
|
+
if (obj === null || typeof obj !== "object") {
|
|
9381
|
+
return obj;
|
|
9382
|
+
}
|
|
9383
|
+
if (Array.isArray(obj)) {
|
|
9384
|
+
return obj.map(prepareObject);
|
|
9385
|
+
}
|
|
9386
|
+
const sortedObj = {};
|
|
9387
|
+
for (const key of Object.keys(obj).sort()) {
|
|
9388
|
+
if (obj[key] === null || obj[key] === void 0) {
|
|
9389
|
+
continue;
|
|
9390
|
+
}
|
|
9391
|
+
sortedObj[key] = prepareObject(obj[key]);
|
|
9392
|
+
}
|
|
9393
|
+
return sortedObj;
|
|
9394
|
+
}
|
|
9395
|
+
function generateHash(input, debug = false) {
|
|
9396
|
+
if (typeof input === "object") {
|
|
9397
|
+
const sanitized = JSON.stringify(prepareObject(input));
|
|
9398
|
+
if (debug) {
|
|
9399
|
+
console.log("Hashing sanitized string:");
|
|
9400
|
+
console.log(sanitized);
|
|
9401
|
+
}
|
|
9402
|
+
return hash(sanitized);
|
|
9403
|
+
} else {
|
|
9404
|
+
try {
|
|
9405
|
+
const obj = JSON.parse(input);
|
|
9406
|
+
const sanitized = JSON.stringify(prepareObject(obj));
|
|
9407
|
+
if (debug) {
|
|
9408
|
+
console.log("Hashing sanitized string:");
|
|
9409
|
+
console.log(sanitized);
|
|
9410
|
+
}
|
|
9411
|
+
return hash(sanitized);
|
|
9412
|
+
} catch {
|
|
9413
|
+
return hash(input);
|
|
9414
|
+
}
|
|
9415
|
+
}
|
|
9416
|
+
}
|
|
9417
|
+
|
|
9418
|
+
// src/utils/redirect-validation.ts
|
|
9419
|
+
var exhaustiveInvalidUriPaths = {
|
|
9420
|
+
emptyPath: "",
|
|
9421
|
+
spacesInPath: "/invalid path/with spaces",
|
|
9422
|
+
specialCharacter1: "/path/with|invalid>characters",
|
|
9423
|
+
specialCharacter2: "/path/with<invalid*characters",
|
|
9424
|
+
specialCharacter3: "/path/{invalid}?characters",
|
|
9425
|
+
consecutiveSlashes: "/path//with///too/many/slashes",
|
|
9426
|
+
unencodedPercent: "/path/with/unencoded%percent",
|
|
9427
|
+
unencodedSpaces: "/path/with unencoded spaces",
|
|
9428
|
+
fragmentIdentifier: "/path/with#fragment",
|
|
9429
|
+
queryParameters: "/path/with?query=parameter",
|
|
9430
|
+
nullCharacter: "/path/with/\0nullcharacter",
|
|
9431
|
+
onlySlash: "/",
|
|
9432
|
+
controlCharacter: "/path/with/control\0character",
|
|
9433
|
+
extremelyLongPath: "/" + "a".repeat(2047),
|
|
9434
|
+
invalidStartCharacter: "///path/starting/with/slashes",
|
|
9435
|
+
invalidStartCharacterColon: ":/path/starting/with/colon",
|
|
9436
|
+
invalidTrailingDot: "/path/ending/with/dot.",
|
|
9437
|
+
invalidPercentEncoding1: "/path/with/%2",
|
|
9438
|
+
invalidPercentEncoding2: "/path/with/%ZZ",
|
|
9439
|
+
invalidPercentEncoding3: "/path/with/%G1",
|
|
9440
|
+
reservedCharacter1: "/path/with?<reserved>",
|
|
9441
|
+
reservedCharacter2: '/path/with/"quotes"',
|
|
9442
|
+
reservedCharacter3: "/path/with/[brackets]",
|
|
9443
|
+
reservedCharacter4: "/path/with/\\backslashes",
|
|
9444
|
+
nonAscii1: "/path/with/\u4F60\u597D",
|
|
9445
|
+
nonAscii2: "/path/with/emoji/\u{1F603}",
|
|
9446
|
+
mixedEncodingPath: "/path/%41A%42B%C3%28",
|
|
9447
|
+
directoryTraversal1: "/path/../../etc/passwd",
|
|
9448
|
+
directoryTraversal2: "/path/./././"
|
|
9449
|
+
};
|
|
9450
|
+
function isValidRedirectPath(path) {
|
|
9451
|
+
const trimmedPath = path.toLowerCase().trim();
|
|
9452
|
+
const url = "https://www.example.com" + trimmedPath;
|
|
9453
|
+
if (url.length > 2048) {
|
|
9454
|
+
return {
|
|
9455
|
+
isValid: false,
|
|
9456
|
+
reason: "TooLong"
|
|
9457
|
+
};
|
|
9458
|
+
}
|
|
9459
|
+
if (trimmedPath === "") {
|
|
9460
|
+
return {
|
|
9461
|
+
isValid: false,
|
|
9462
|
+
reason: "Empty"
|
|
9463
|
+
};
|
|
9464
|
+
}
|
|
9465
|
+
if (url === "/") {
|
|
9466
|
+
return {
|
|
9467
|
+
isValid: false,
|
|
9468
|
+
reason: "Empty"
|
|
9469
|
+
};
|
|
9470
|
+
}
|
|
9471
|
+
if (url.includes("?")) {
|
|
9472
|
+
return {
|
|
9473
|
+
isValid: false,
|
|
9474
|
+
reason: "ContainsQuery"
|
|
9475
|
+
};
|
|
9476
|
+
}
|
|
9477
|
+
if (url.includes("#")) {
|
|
9478
|
+
return {
|
|
9479
|
+
isValid: false,
|
|
9480
|
+
reason: "ContainsFragment"
|
|
9481
|
+
};
|
|
9482
|
+
}
|
|
9483
|
+
const regex = /^\/[A-Za-z0-9_-]+(\/[A-Za-z0-9_-]+)*$/;
|
|
9484
|
+
const isValid = regex.test(trimmedPath);
|
|
9485
|
+
return {
|
|
9486
|
+
isValid: regex.test(trimmedPath),
|
|
9487
|
+
reason: !isValid ? "InvalidURI" : void 0
|
|
9488
|
+
};
|
|
9489
|
+
}
|
|
9490
|
+
|
|
9285
9491
|
// src/api/dto/forge/project-invitation.ts
|
|
9286
9492
|
import { z as z310 } from "zod";
|
|
9287
9493
|
var DTOForgeProjectInvitation = ForgeProjectInvitation;
|
|
@@ -9324,6 +9530,9 @@ var DTOUpdateForgeProjectMember = DTOCreateForgeProjectMember;
|
|
|
9324
9530
|
var DTORemoveForgeProjectMember = DTOForgeProjectMember.pick({
|
|
9325
9531
|
userId: true
|
|
9326
9532
|
});
|
|
9533
|
+
var DTOForgeProjectMemberListQuery = z311.object({
|
|
9534
|
+
includeImplicitMembers: zodQueryBoolean().optional()
|
|
9535
|
+
});
|
|
9327
9536
|
var DTOForgeProjectMembersListResponse = z311.object({
|
|
9328
9537
|
members: z311.array(DTOForgeProjectMember),
|
|
9329
9538
|
invitations: z311.array(DTOForgeProjectInvitation)
|
|
@@ -9835,7 +10044,7 @@ var DTOFeatureIterationArtifactsDiff = z320.object({
|
|
|
9835
10044
|
deleted: z320.array(DTOFeatureArtifact.shape.key).optional().default([])
|
|
9836
10045
|
});
|
|
9837
10046
|
var DTOFeatureIterationState = z320.enum(["InProgress", "Success", "Error", "Timeout"]);
|
|
9838
|
-
var DTOFeatureIterationErrorType = z320.enum(["PackageInstall", "Build", "Compile", "Unknown"]);
|
|
10047
|
+
var DTOFeatureIterationErrorType = z320.enum(["PackageInstall", "Build", "Compile", "Unknown", "Runtime"]);
|
|
9839
10048
|
var DTOFeatureIterationError = z320.object({
|
|
9840
10049
|
description: z320.string(),
|
|
9841
10050
|
type: DTOFeatureIterationErrorType
|
|
@@ -10299,7 +10508,8 @@ var DTOThreadMessageFinalizeInput = z325.object({
|
|
|
10299
10508
|
creditsSpend: DTOBillingCreditsSpendInput.optional()
|
|
10300
10509
|
});
|
|
10301
10510
|
var DTOThreadMessageRetryInput = z325.object({
|
|
10302
|
-
agentMessageId: Id
|
|
10511
|
+
agentMessageId: Id,
|
|
10512
|
+
runtimeError: z325.string().optional()
|
|
10303
10513
|
});
|
|
10304
10514
|
var DTOThreadMessageUpdateInput = DTOThreadMessage.pick({
|
|
10305
10515
|
id: true
|
|
@@ -10880,145 +11090,197 @@ var DTOMCPStreamResponse = z340.object({
|
|
|
10880
11090
|
stream: DTOMCPStream
|
|
10881
11091
|
});
|
|
10882
11092
|
|
|
10883
|
-
// src/api/dto/
|
|
11093
|
+
// src/api/dto/notifications/notifications.ts
|
|
10884
11094
|
import { z as z341 } from "zod";
|
|
11095
|
+
var DTONotificationChatMentionPayload = z341.object({
|
|
11096
|
+
messageAuthorId: z341.string(),
|
|
11097
|
+
messageText: z341.string(),
|
|
11098
|
+
messageId: z341.string(),
|
|
11099
|
+
parentMessageId: z341.string().optional(),
|
|
11100
|
+
workspaceId: z341.string(),
|
|
11101
|
+
projectId: z341.string(),
|
|
11102
|
+
subjectType: z341.string(),
|
|
11103
|
+
threadSubjectId: z341.string(),
|
|
11104
|
+
subjectName: z341.string()
|
|
11105
|
+
});
|
|
11106
|
+
var DTONotificationProjectInvitationPayload = z341.object({
|
|
11107
|
+
workspaceId: z341.string(),
|
|
11108
|
+
projectId: z341.string(),
|
|
11109
|
+
projectTitle: z341.string(),
|
|
11110
|
+
invitedByUserId: z341.string(),
|
|
11111
|
+
invitationRole: z341.string()
|
|
11112
|
+
});
|
|
11113
|
+
var DTONotificationProjectDocumentCommentPayload = z341.object({
|
|
11114
|
+
documentId: z341.string(),
|
|
11115
|
+
entityTitle: z341.string(),
|
|
11116
|
+
projectId: z341.string(),
|
|
11117
|
+
workspaceId: z341.string(),
|
|
11118
|
+
threadId: z341.string(),
|
|
11119
|
+
commentId: z341.string(),
|
|
11120
|
+
commentCreatedAt: z341.string(),
|
|
11121
|
+
commentAuthorId: z341.string(),
|
|
11122
|
+
commentBody: z341.string()
|
|
11123
|
+
});
|
|
11124
|
+
var DTONotificationBase = z341.object({
|
|
11125
|
+
userId: z341.string(),
|
|
11126
|
+
subjectId: z341.string(),
|
|
11127
|
+
roomId: z341.string().optional(),
|
|
11128
|
+
workspaceId: z341.string()
|
|
11129
|
+
});
|
|
11130
|
+
var DTONotificationCreateInput = z341.discriminatedUnion("type", [
|
|
11131
|
+
z341.object({
|
|
11132
|
+
type: z341.literal(DTONotificationType.enum.ChatMention),
|
|
11133
|
+
activityData: DTONotificationChatMentionPayload
|
|
11134
|
+
}),
|
|
11135
|
+
z341.object({
|
|
11136
|
+
type: z341.literal(DTONotificationType.enum.ProjectInvitation),
|
|
11137
|
+
activityData: DTONotificationProjectInvitationPayload
|
|
11138
|
+
}),
|
|
11139
|
+
z341.object({
|
|
11140
|
+
type: z341.literal(DTONotificationType.enum.ProjectDocumentComment),
|
|
11141
|
+
activityData: DTONotificationProjectDocumentCommentPayload
|
|
11142
|
+
})
|
|
11143
|
+
]).and(DTONotificationBase);
|
|
11144
|
+
|
|
11145
|
+
// src/api/dto/portal/portal-settings.ts
|
|
11146
|
+
import { z as z342 } from "zod";
|
|
10885
11147
|
var DTOPortalSettingsTheme = PortalSettingsTheme;
|
|
10886
11148
|
var DTOPortalSettingsSidebarLink = PortalSettingsSidebarLink;
|
|
10887
11149
|
var DTOPortalSettingsSidebarSection = PortalSettingsSidebarSection;
|
|
10888
11150
|
var DTOPortalSettingsSidebar = PortalSettingsSidebar;
|
|
10889
|
-
var DTOPortalSettings =
|
|
10890
|
-
id:
|
|
10891
|
-
workspaceId:
|
|
10892
|
-
enabledDesignSystemIds:
|
|
10893
|
-
enabledBrandPersistentIds:
|
|
11151
|
+
var DTOPortalSettings = z342.object({
|
|
11152
|
+
id: z342.string(),
|
|
11153
|
+
workspaceId: z342.string(),
|
|
11154
|
+
enabledDesignSystemIds: z342.array(z342.string()),
|
|
11155
|
+
enabledBrandPersistentIds: z342.array(z342.string()),
|
|
10894
11156
|
theme: DTOPortalSettingsTheme.nullish(),
|
|
10895
11157
|
sidebar: DTOPortalSettingsSidebar.nullish(),
|
|
10896
|
-
createdAt:
|
|
10897
|
-
updatedAt:
|
|
11158
|
+
createdAt: z342.coerce.date(),
|
|
11159
|
+
updatedAt: z342.coerce.date()
|
|
10898
11160
|
});
|
|
10899
|
-
var DTOPortalSettingsGetResponse =
|
|
11161
|
+
var DTOPortalSettingsGetResponse = z342.object({
|
|
10900
11162
|
portalSettings: DTOPortalSettings
|
|
10901
11163
|
});
|
|
10902
|
-
var DTOPortalSettingsUpdatePayload =
|
|
10903
|
-
enabledDesignSystemIds:
|
|
10904
|
-
enabledBrandPersistentIds:
|
|
11164
|
+
var DTOPortalSettingsUpdatePayload = z342.object({
|
|
11165
|
+
enabledDesignSystemIds: z342.array(z342.string()).optional(),
|
|
11166
|
+
enabledBrandPersistentIds: z342.array(z342.string()).optional(),
|
|
10905
11167
|
theme: DTOPortalSettingsTheme.nullish(),
|
|
10906
11168
|
sidebar: DTOPortalSettingsSidebar.nullish()
|
|
10907
11169
|
});
|
|
10908
11170
|
|
|
10909
11171
|
// src/api/dto/sandboxes/template.ts
|
|
10910
|
-
import
|
|
10911
|
-
var DTOSandboxTemplateVersion =
|
|
10912
|
-
name:
|
|
10913
|
-
createdAt:
|
|
10914
|
-
createdByUserId:
|
|
10915
|
-
e2bTemplateId:
|
|
10916
|
-
});
|
|
10917
|
-
var DTOSandboxTemplate =
|
|
10918
|
-
id:
|
|
10919
|
-
name:
|
|
10920
|
-
workspaceId:
|
|
10921
|
-
designSystemId:
|
|
10922
|
-
createdAt:
|
|
11172
|
+
import z343 from "zod";
|
|
11173
|
+
var DTOSandboxTemplateVersion = z343.object({
|
|
11174
|
+
name: z343.string(),
|
|
11175
|
+
createdAt: z343.string(),
|
|
11176
|
+
createdByUserId: z343.string(),
|
|
11177
|
+
e2bTemplateId: z343.string()
|
|
11178
|
+
});
|
|
11179
|
+
var DTOSandboxTemplate = z343.object({
|
|
11180
|
+
id: z343.string(),
|
|
11181
|
+
name: z343.string(),
|
|
11182
|
+
workspaceId: z343.string(),
|
|
11183
|
+
designSystemId: z343.string(),
|
|
11184
|
+
createdAt: z343.string(),
|
|
10923
11185
|
versions: DTOSandboxTemplateVersion.array()
|
|
10924
11186
|
});
|
|
10925
|
-
var DTOSandboxTemplateBuild =
|
|
10926
|
-
id:
|
|
10927
|
-
workspaceId:
|
|
10928
|
-
designSystemId:
|
|
10929
|
-
name:
|
|
10930
|
-
version:
|
|
10931
|
-
createdAt:
|
|
10932
|
-
finishedAt:
|
|
10933
|
-
createdByUserId:
|
|
10934
|
-
dockerImagePath:
|
|
10935
|
-
error:
|
|
10936
|
-
state:
|
|
10937
|
-
});
|
|
10938
|
-
var DTOSandboxTemplateFile =
|
|
10939
|
-
key:
|
|
10940
|
-
fileId:
|
|
10941
|
-
filePath:
|
|
10942
|
-
url:
|
|
10943
|
-
});
|
|
10944
|
-
var DTOSandboxTemplateVersionDetail =
|
|
11187
|
+
var DTOSandboxTemplateBuild = z343.object({
|
|
11188
|
+
id: z343.string(),
|
|
11189
|
+
workspaceId: z343.string(),
|
|
11190
|
+
designSystemId: z343.string(),
|
|
11191
|
+
name: z343.string(),
|
|
11192
|
+
version: z343.string(),
|
|
11193
|
+
createdAt: z343.string(),
|
|
11194
|
+
finishedAt: z343.string().optional(),
|
|
11195
|
+
createdByUserId: z343.string(),
|
|
11196
|
+
dockerImagePath: z343.string(),
|
|
11197
|
+
error: z343.string().optional(),
|
|
11198
|
+
state: z343.enum(["PendingUpload", "Building", "Success", "Failure", "Timeout"])
|
|
11199
|
+
});
|
|
11200
|
+
var DTOSandboxTemplateFile = z343.object({
|
|
11201
|
+
key: z343.string(),
|
|
11202
|
+
fileId: z343.string(),
|
|
11203
|
+
filePath: z343.string(),
|
|
11204
|
+
url: z343.string()
|
|
11205
|
+
});
|
|
11206
|
+
var DTOSandboxTemplateVersionDetail = z343.object({
|
|
10945
11207
|
version: DTOSandboxTemplateVersion,
|
|
10946
11208
|
files: DTOSandboxTemplateFile.array()
|
|
10947
11209
|
});
|
|
10948
|
-
var DTOSandboxTemplateQuery =
|
|
10949
|
-
workspaceId:
|
|
10950
|
-
designSystemId:
|
|
11210
|
+
var DTOSandboxTemplateQuery = z343.object({
|
|
11211
|
+
workspaceId: z343.string(),
|
|
11212
|
+
designSystemId: z343.string().optional()
|
|
10951
11213
|
});
|
|
10952
|
-
var DTOSandboxTemplateListResponse =
|
|
11214
|
+
var DTOSandboxTemplateListResponse = z343.object({
|
|
10953
11215
|
templates: DTOSandboxTemplate.array()
|
|
10954
11216
|
});
|
|
10955
|
-
var DTOSandboxTemplateResponse =
|
|
11217
|
+
var DTOSandboxTemplateResponse = z343.object({
|
|
10956
11218
|
template: DTOSandboxTemplate
|
|
10957
11219
|
});
|
|
10958
|
-
var DTOSandboxTemplateBuildResponse =
|
|
11220
|
+
var DTOSandboxTemplateBuildResponse = z343.object({
|
|
10959
11221
|
build: DTOSandboxTemplateBuild
|
|
10960
11222
|
});
|
|
10961
|
-
var DTOSandboxTemplateBuildCreateInput =
|
|
10962
|
-
workspaceId:
|
|
10963
|
-
designSystemId:
|
|
10964
|
-
name:
|
|
10965
|
-
version:
|
|
10966
|
-
isExistingVersionUpdateAllowed:
|
|
11223
|
+
var DTOSandboxTemplateBuildCreateInput = z343.object({
|
|
11224
|
+
workspaceId: z343.string(),
|
|
11225
|
+
designSystemId: z343.string(),
|
|
11226
|
+
name: z343.string(),
|
|
11227
|
+
version: z343.string(),
|
|
11228
|
+
isExistingVersionUpdateAllowed: z343.boolean()
|
|
10967
11229
|
});
|
|
10968
|
-
var DTOSandboxTemplateBuildCreateResponse =
|
|
11230
|
+
var DTOSandboxTemplateBuildCreateResponse = z343.object({
|
|
10969
11231
|
/** @deprecated use domain + build.dockerImagePath */
|
|
10970
|
-
dockerUrl:
|
|
10971
|
-
dockerRegistryDomain:
|
|
11232
|
+
dockerUrl: z343.string().optional(),
|
|
11233
|
+
dockerRegistryDomain: z343.string(),
|
|
10972
11234
|
/** @deprecated use docker-login endpoint */
|
|
10973
|
-
dockerAccessToken:
|
|
11235
|
+
dockerAccessToken: z343.string().optional(),
|
|
10974
11236
|
build: DTOSandboxTemplateBuild
|
|
10975
11237
|
});
|
|
10976
|
-
var DTOSandboxTemplateBuildFinalizeResponse =
|
|
10977
|
-
ok:
|
|
11238
|
+
var DTOSandboxTemplateBuildFinalizeResponse = z343.object({
|
|
11239
|
+
ok: z343.boolean()
|
|
10978
11240
|
});
|
|
10979
11241
|
|
|
10980
11242
|
// src/api/dto/themes/override.ts
|
|
10981
|
-
import { z as
|
|
11243
|
+
import { z as z344 } from "zod";
|
|
10982
11244
|
var DTOThemeOverride = DesignTokenTypedData.and(
|
|
10983
|
-
|
|
10984
|
-
tokenPersistentId:
|
|
11245
|
+
z344.object({
|
|
11246
|
+
tokenPersistentId: z344.string(),
|
|
10985
11247
|
origin: ThemeOverrideOrigin.optional()
|
|
10986
11248
|
})
|
|
10987
11249
|
);
|
|
10988
11250
|
var DTOThemeOverrideCreatePayload = DesignTokenTypedData.and(
|
|
10989
|
-
|
|
10990
|
-
tokenPersistentId:
|
|
11251
|
+
z344.object({
|
|
11252
|
+
tokenPersistentId: z344.string()
|
|
10991
11253
|
})
|
|
10992
11254
|
);
|
|
10993
11255
|
|
|
10994
11256
|
// src/api/dto/themes/theme.ts
|
|
10995
|
-
import { z as
|
|
10996
|
-
var DTOTheme =
|
|
10997
|
-
id:
|
|
10998
|
-
persistentId:
|
|
10999
|
-
designSystemVersionId:
|
|
11000
|
-
brandId:
|
|
11257
|
+
import { z as z345 } from "zod";
|
|
11258
|
+
var DTOTheme = z345.object({
|
|
11259
|
+
id: z345.string(),
|
|
11260
|
+
persistentId: z345.string(),
|
|
11261
|
+
designSystemVersionId: z345.string(),
|
|
11262
|
+
brandId: z345.string(),
|
|
11001
11263
|
meta: ObjectMeta,
|
|
11002
|
-
codeName:
|
|
11264
|
+
codeName: z345.string(),
|
|
11003
11265
|
overrides: DTOThemeOverride.array()
|
|
11004
11266
|
});
|
|
11005
|
-
var DTOThemeResponse =
|
|
11267
|
+
var DTOThemeResponse = z345.object({
|
|
11006
11268
|
theme: DTOTheme
|
|
11007
11269
|
});
|
|
11008
|
-
var DTOThemeListResponse =
|
|
11270
|
+
var DTOThemeListResponse = z345.object({
|
|
11009
11271
|
themes: DTOTheme.array()
|
|
11010
11272
|
});
|
|
11011
|
-
var DTOThemeCreatePayload =
|
|
11273
|
+
var DTOThemeCreatePayload = z345.object({
|
|
11012
11274
|
meta: ObjectMeta,
|
|
11013
|
-
persistentId:
|
|
11014
|
-
brandId:
|
|
11015
|
-
codeName:
|
|
11275
|
+
persistentId: z345.string(),
|
|
11276
|
+
brandId: z345.string(),
|
|
11277
|
+
codeName: z345.string(),
|
|
11016
11278
|
overrides: DTOThemeOverride.array()
|
|
11017
11279
|
});
|
|
11018
11280
|
|
|
11019
11281
|
// src/api/dto/trail-events/trail-events.ts
|
|
11020
|
-
import { z as
|
|
11021
|
-
var DTOTrailEventType =
|
|
11282
|
+
import { z as z346 } from "zod";
|
|
11283
|
+
var DTOTrailEventType = z346.enum([
|
|
11022
11284
|
"IterationCreated",
|
|
11023
11285
|
"IterationBookmarked",
|
|
11024
11286
|
"FeatureCreated",
|
|
@@ -11034,288 +11296,112 @@ var DTOTrailEventType = z345.enum([
|
|
|
11034
11296
|
"ProjectContextCreated",
|
|
11035
11297
|
"ProjectContextArchived"
|
|
11036
11298
|
]);
|
|
11037
|
-
var DTOTrailEventBase =
|
|
11038
|
-
id:
|
|
11039
|
-
projectId:
|
|
11040
|
-
userId:
|
|
11041
|
-
createdAt:
|
|
11042
|
-
updatedAt:
|
|
11043
|
-
});
|
|
11044
|
-
var DTOTrailEventIterationCreatedPayload =
|
|
11045
|
-
iterationName:
|
|
11046
|
-
iterationId:
|
|
11047
|
-
featureId:
|
|
11048
|
-
});
|
|
11049
|
-
var DTOTrailEventIterationBookmarkedPayload =
|
|
11050
|
-
iterationId:
|
|
11051
|
-
featureId:
|
|
11052
|
-
iterationName:
|
|
11053
|
-
});
|
|
11054
|
-
var DTOTrailEventIterationPromotedPayload =
|
|
11055
|
-
iterationId:
|
|
11056
|
-
featureId:
|
|
11057
|
-
iterationName:
|
|
11058
|
-
});
|
|
11059
|
-
var DTOTrailEventFeatureCreatedPayload =
|
|
11060
|
-
featureId:
|
|
11061
|
-
name:
|
|
11062
|
-
description:
|
|
11063
|
-
});
|
|
11064
|
-
var DTOTrailEventFeatureDeletedPayload =
|
|
11065
|
-
featureId:
|
|
11066
|
-
name:
|
|
11067
|
-
});
|
|
11068
|
-
var DTOTrailEventFeatureArchivedPayload =
|
|
11069
|
-
featureId:
|
|
11070
|
-
name:
|
|
11071
|
-
});
|
|
11072
|
-
var DTOTrailEventDocumentCreatedPayload =
|
|
11073
|
-
documentId:
|
|
11074
|
-
title:
|
|
11075
|
-
sectionId:
|
|
11076
|
-
});
|
|
11077
|
-
var DTOTrailEventDocumentDeletedPayload =
|
|
11078
|
-
documentId:
|
|
11079
|
-
title:
|
|
11080
|
-
});
|
|
11081
|
-
var DTOTrailEventDocumentUpdatedPayload =
|
|
11082
|
-
documentId:
|
|
11083
|
-
title:
|
|
11084
|
-
sectionId:
|
|
11085
|
-
});
|
|
11086
|
-
var DTOTrailEventDocumentCommentSentPayload =
|
|
11087
|
-
documentId:
|
|
11088
|
-
title:
|
|
11089
|
-
sectionId:
|
|
11090
|
-
});
|
|
11091
|
-
var DTOTrailEventProjectCreatedPayload =
|
|
11092
|
-
name:
|
|
11093
|
-
description:
|
|
11094
|
-
});
|
|
11095
|
-
var DTOTrailEventProjectArchivedPayload =
|
|
11096
|
-
name:
|
|
11097
|
-
});
|
|
11098
|
-
var DTOTrailEventProjectContextCreatedPayload =
|
|
11099
|
-
contextId:
|
|
11100
|
-
name:
|
|
11101
|
-
description:
|
|
11102
|
-
});
|
|
11103
|
-
var DTOTrailEventProjectContextArchivedPayload =
|
|
11104
|
-
contextId:
|
|
11105
|
-
});
|
|
11106
|
-
var DTOTrailEventPayload =
|
|
11107
|
-
|
|
11108
|
-
|
|
11109
|
-
|
|
11110
|
-
|
|
11111
|
-
|
|
11112
|
-
|
|
11113
|
-
|
|
11114
|
-
|
|
11115
|
-
|
|
11116
|
-
|
|
11117
|
-
|
|
11118
|
-
|
|
11119
|
-
|
|
11120
|
-
|
|
11299
|
+
var DTOTrailEventBase = z346.object({
|
|
11300
|
+
id: z346.string(),
|
|
11301
|
+
projectId: z346.string(),
|
|
11302
|
+
userId: z346.string(),
|
|
11303
|
+
createdAt: z346.coerce.date(),
|
|
11304
|
+
updatedAt: z346.coerce.date()
|
|
11305
|
+
});
|
|
11306
|
+
var DTOTrailEventIterationCreatedPayload = z346.object({
|
|
11307
|
+
iterationName: z346.string(),
|
|
11308
|
+
iterationId: z346.string().uuid(),
|
|
11309
|
+
featureId: z346.string().uuid()
|
|
11310
|
+
});
|
|
11311
|
+
var DTOTrailEventIterationBookmarkedPayload = z346.object({
|
|
11312
|
+
iterationId: z346.string().uuid(),
|
|
11313
|
+
featureId: z346.string().uuid(),
|
|
11314
|
+
iterationName: z346.string()
|
|
11315
|
+
});
|
|
11316
|
+
var DTOTrailEventIterationPromotedPayload = z346.object({
|
|
11317
|
+
iterationId: z346.string().uuid(),
|
|
11318
|
+
featureId: z346.string().uuid(),
|
|
11319
|
+
iterationName: z346.string()
|
|
11320
|
+
});
|
|
11321
|
+
var DTOTrailEventFeatureCreatedPayload = z346.object({
|
|
11322
|
+
featureId: z346.string().uuid(),
|
|
11323
|
+
name: z346.string(),
|
|
11324
|
+
description: z346.string().optional()
|
|
11325
|
+
});
|
|
11326
|
+
var DTOTrailEventFeatureDeletedPayload = z346.object({
|
|
11327
|
+
featureId: z346.string().uuid(),
|
|
11328
|
+
name: z346.string()
|
|
11329
|
+
});
|
|
11330
|
+
var DTOTrailEventFeatureArchivedPayload = z346.object({
|
|
11331
|
+
featureId: z346.string().uuid(),
|
|
11332
|
+
name: z346.string()
|
|
11333
|
+
});
|
|
11334
|
+
var DTOTrailEventDocumentCreatedPayload = z346.object({
|
|
11335
|
+
documentId: z346.string().uuid(),
|
|
11336
|
+
title: z346.string(),
|
|
11337
|
+
sectionId: z346.string().uuid().optional()
|
|
11338
|
+
});
|
|
11339
|
+
var DTOTrailEventDocumentDeletedPayload = z346.object({
|
|
11340
|
+
documentId: z346.string().uuid(),
|
|
11341
|
+
title: z346.string()
|
|
11342
|
+
});
|
|
11343
|
+
var DTOTrailEventDocumentUpdatedPayload = z346.object({
|
|
11344
|
+
documentId: z346.string().uuid(),
|
|
11345
|
+
title: z346.string(),
|
|
11346
|
+
sectionId: z346.string().uuid().optional()
|
|
11347
|
+
});
|
|
11348
|
+
var DTOTrailEventDocumentCommentSentPayload = z346.object({
|
|
11349
|
+
documentId: z346.string().uuid(),
|
|
11350
|
+
title: z346.string(),
|
|
11351
|
+
sectionId: z346.string().uuid().optional()
|
|
11352
|
+
});
|
|
11353
|
+
var DTOTrailEventProjectCreatedPayload = z346.object({
|
|
11354
|
+
name: z346.string(),
|
|
11355
|
+
description: z346.string().optional()
|
|
11356
|
+
});
|
|
11357
|
+
var DTOTrailEventProjectArchivedPayload = z346.object({
|
|
11358
|
+
name: z346.string()
|
|
11359
|
+
});
|
|
11360
|
+
var DTOTrailEventProjectContextCreatedPayload = z346.object({
|
|
11361
|
+
contextId: z346.number(),
|
|
11362
|
+
name: z346.string(),
|
|
11363
|
+
description: z346.string().optional()
|
|
11364
|
+
});
|
|
11365
|
+
var DTOTrailEventProjectContextArchivedPayload = z346.object({
|
|
11366
|
+
contextId: z346.number()
|
|
11367
|
+
});
|
|
11368
|
+
var DTOTrailEventPayload = z346.discriminatedUnion("type", [
|
|
11369
|
+
z346.object({ type: z346.literal("IterationCreated"), payload: DTOTrailEventIterationCreatedPayload }),
|
|
11370
|
+
z346.object({ type: z346.literal("IterationBookmarked"), payload: DTOTrailEventIterationBookmarkedPayload }),
|
|
11371
|
+
z346.object({ type: z346.literal("FeatureCreated"), payload: DTOTrailEventFeatureCreatedPayload }),
|
|
11372
|
+
z346.object({ type: z346.literal("FeatureDeleted"), payload: DTOTrailEventFeatureDeletedPayload }),
|
|
11373
|
+
z346.object({ type: z346.literal("FeatureArchived"), payload: DTOTrailEventFeatureArchivedPayload }),
|
|
11374
|
+
z346.object({ type: z346.literal("DocumentCreated"), payload: DTOTrailEventDocumentCreatedPayload }),
|
|
11375
|
+
z346.object({ type: z346.literal("DocumentDeleted"), payload: DTOTrailEventDocumentDeletedPayload }),
|
|
11376
|
+
z346.object({ type: z346.literal("DocumentUpdated"), payload: DTOTrailEventDocumentUpdatedPayload }),
|
|
11377
|
+
z346.object({ type: z346.literal("DocumentCommentSent"), payload: DTOTrailEventDocumentCommentSentPayload }),
|
|
11378
|
+
z346.object({ type: z346.literal("ProjectCreated"), payload: DTOTrailEventProjectCreatedPayload }),
|
|
11379
|
+
z346.object({ type: z346.literal("ProjectArchived"), payload: DTOTrailEventProjectArchivedPayload }),
|
|
11380
|
+
z346.object({ type: z346.literal("IterationPromoted"), payload: DTOTrailEventIterationPromotedPayload }),
|
|
11381
|
+
z346.object({ type: z346.literal("ProjectContextCreated"), payload: DTOTrailEventProjectContextCreatedPayload }),
|
|
11382
|
+
z346.object({ type: z346.literal("ProjectContextArchived"), payload: DTOTrailEventProjectContextArchivedPayload })
|
|
11121
11383
|
]);
|
|
11122
11384
|
var DTOTrailEvent = DTOTrailEventPayload.and(DTOTrailEventBase);
|
|
11123
11385
|
var DTOTrailEventWithDetails = DTOTrailEvent.and(
|
|
11124
|
-
|
|
11125
|
-
projectName:
|
|
11126
|
-
userName:
|
|
11386
|
+
z346.object({
|
|
11387
|
+
projectName: z346.string().optional(),
|
|
11388
|
+
userName: z346.string().optional()
|
|
11127
11389
|
})
|
|
11128
11390
|
);
|
|
11129
|
-
var DTOTrailEventListInput =
|
|
11130
|
-
projectId:
|
|
11391
|
+
var DTOTrailEventListInput = z346.object({
|
|
11392
|
+
projectId: z346.string()
|
|
11131
11393
|
});
|
|
11132
|
-
var DTOTrailEventListResponse =
|
|
11133
|
-
events:
|
|
11394
|
+
var DTOTrailEventListResponse = z346.object({
|
|
11395
|
+
events: z346.array(DTOTrailEventWithDetails)
|
|
11134
11396
|
});
|
|
11135
11397
|
var DTOTrailEventCreate = DTOTrailEventPayload.and(
|
|
11136
11398
|
DTOTrailEventBase.omit({ id: true, createdAt: true, updatedAt: true })
|
|
11137
11399
|
);
|
|
11138
|
-
var DTOTrailEventClientCreate =
|
|
11139
|
-
|
|
11140
|
-
|
|
11400
|
+
var DTOTrailEventClientCreate = z346.discriminatedUnion("type", [
|
|
11401
|
+
z346.object({ type: z346.literal("DocumentUpdated"), payload: DTOTrailEventDocumentUpdatedPayload }),
|
|
11402
|
+
z346.object({ type: z346.literal("DocumentCommentSent"), payload: DTOTrailEventDocumentCommentSentPayload })
|
|
11141
11403
|
]).and(DTOTrailEventBase.omit({ id: true, createdAt: true, updatedAt: true }));
|
|
11142
11404
|
|
|
11143
|
-
// src/utils/figma.ts
|
|
11144
|
-
var figmaFileIdRegex = /^[0-9a-zA-Z]{22,128}$/;
|
|
11145
|
-
var nodeIdRegex = /^\d+-\d+$/;
|
|
11146
|
-
var nodeTypeRegex = /^[0-9a-zA-Z]^/;
|
|
11147
|
-
var ParsedFigmaFileURLError = /* @__PURE__ */ ((ParsedFigmaFileURLError2) => {
|
|
11148
|
-
ParsedFigmaFileURLError2["InvalidUrl"] = "InvalidUrl";
|
|
11149
|
-
ParsedFigmaFileURLError2["InvalidFigmaFileId"] = "InvalidFigmaFileId";
|
|
11150
|
-
return ParsedFigmaFileURLError2;
|
|
11151
|
-
})(ParsedFigmaFileURLError || {});
|
|
11152
|
-
var FigmaUtils = {
|
|
11153
|
-
tryParseFigmaFileURL(urlString) {
|
|
11154
|
-
if (!URL.canParse(urlString)) {
|
|
11155
|
-
return { status: "Error", error: "InvalidUrl" /* InvalidUrl */ };
|
|
11156
|
-
}
|
|
11157
|
-
const url = new URL(urlString);
|
|
11158
|
-
if (!url.hostname.endsWith("figma.com")) {
|
|
11159
|
-
return { status: "Error", error: "InvalidUrl" /* InvalidUrl */ };
|
|
11160
|
-
}
|
|
11161
|
-
const pathSegments = url.pathname.split("/");
|
|
11162
|
-
if (pathSegments[1] !== "design" && pathSegments[1] !== "file") {
|
|
11163
|
-
return { status: "Error", error: "InvalidUrl" /* InvalidUrl */ };
|
|
11164
|
-
}
|
|
11165
|
-
const fileId = pathSegments[2];
|
|
11166
|
-
if (!fileId || !fileId.match(figmaFileIdRegex)) {
|
|
11167
|
-
return { status: "Error", error: "InvalidFigmaFileId" /* InvalidFigmaFileId */ };
|
|
11168
|
-
}
|
|
11169
|
-
let fileName = null;
|
|
11170
|
-
const rawFileName = pathSegments[3];
|
|
11171
|
-
if (rawFileName) {
|
|
11172
|
-
fileName = rawFileName.replaceAll("-", " ");
|
|
11173
|
-
}
|
|
11174
|
-
let nodeId = null;
|
|
11175
|
-
const nodeIdRaw = url.searchParams.get("node-id");
|
|
11176
|
-
if (nodeIdRaw && nodeIdRaw.match(nodeIdRegex)) {
|
|
11177
|
-
nodeId = nodeIdRaw.replace("-", ":");
|
|
11178
|
-
}
|
|
11179
|
-
let nodeType = null;
|
|
11180
|
-
const nodeTypeRaw = url.searchParams.get("node-type");
|
|
11181
|
-
if (nodeTypeRaw && nodeTypeRaw.match(nodeTypeRegex)) {
|
|
11182
|
-
nodeType = nodeTypeRaw;
|
|
11183
|
-
}
|
|
11184
|
-
return { status: "Success", fileId, fileName, nodeId, nodeType };
|
|
11185
|
-
}
|
|
11186
|
-
};
|
|
11187
|
-
|
|
11188
|
-
// src/utils/hash.ts
|
|
11189
|
-
function hash(input) {
|
|
11190
|
-
return farmhash(input).toString(16);
|
|
11191
|
-
}
|
|
11192
|
-
function farmhash(input) {
|
|
11193
|
-
const seed = 2654435769;
|
|
11194
|
-
let hash2 = seed;
|
|
11195
|
-
for (let i = 0; i < input.length; i++) {
|
|
11196
|
-
const charCode = input.charCodeAt(i);
|
|
11197
|
-
hash2 ^= charCode;
|
|
11198
|
-
hash2 = Math.imul(hash2, 1540483477);
|
|
11199
|
-
hash2 ^= hash2 >>> 15;
|
|
11200
|
-
}
|
|
11201
|
-
hash2 = Math.imul(hash2, 1540483477);
|
|
11202
|
-
hash2 ^= hash2 >>> 13;
|
|
11203
|
-
hash2 = Math.imul(hash2, 1540483477);
|
|
11204
|
-
hash2 ^= hash2 >>> 15;
|
|
11205
|
-
return hash2 >>> 0;
|
|
11206
|
-
}
|
|
11207
|
-
function prepareObject(obj) {
|
|
11208
|
-
if (obj === null || typeof obj !== "object") {
|
|
11209
|
-
return obj;
|
|
11210
|
-
}
|
|
11211
|
-
if (Array.isArray(obj)) {
|
|
11212
|
-
return obj.map(prepareObject);
|
|
11213
|
-
}
|
|
11214
|
-
const sortedObj = {};
|
|
11215
|
-
for (const key of Object.keys(obj).sort()) {
|
|
11216
|
-
if (obj[key] === null || obj[key] === void 0) {
|
|
11217
|
-
continue;
|
|
11218
|
-
}
|
|
11219
|
-
sortedObj[key] = prepareObject(obj[key]);
|
|
11220
|
-
}
|
|
11221
|
-
return sortedObj;
|
|
11222
|
-
}
|
|
11223
|
-
function generateHash(input, debug = false) {
|
|
11224
|
-
if (typeof input === "object") {
|
|
11225
|
-
const sanitized = JSON.stringify(prepareObject(input));
|
|
11226
|
-
if (debug) {
|
|
11227
|
-
console.log("Hashing sanitized string:");
|
|
11228
|
-
console.log(sanitized);
|
|
11229
|
-
}
|
|
11230
|
-
return hash(sanitized);
|
|
11231
|
-
} else {
|
|
11232
|
-
try {
|
|
11233
|
-
const obj = JSON.parse(input);
|
|
11234
|
-
const sanitized = JSON.stringify(prepareObject(obj));
|
|
11235
|
-
if (debug) {
|
|
11236
|
-
console.log("Hashing sanitized string:");
|
|
11237
|
-
console.log(sanitized);
|
|
11238
|
-
}
|
|
11239
|
-
return hash(sanitized);
|
|
11240
|
-
} catch {
|
|
11241
|
-
return hash(input);
|
|
11242
|
-
}
|
|
11243
|
-
}
|
|
11244
|
-
}
|
|
11245
|
-
|
|
11246
|
-
// src/utils/redirect-validation.ts
|
|
11247
|
-
var exhaustiveInvalidUriPaths = {
|
|
11248
|
-
emptyPath: "",
|
|
11249
|
-
spacesInPath: "/invalid path/with spaces",
|
|
11250
|
-
specialCharacter1: "/path/with|invalid>characters",
|
|
11251
|
-
specialCharacter2: "/path/with<invalid*characters",
|
|
11252
|
-
specialCharacter3: "/path/{invalid}?characters",
|
|
11253
|
-
consecutiveSlashes: "/path//with///too/many/slashes",
|
|
11254
|
-
unencodedPercent: "/path/with/unencoded%percent",
|
|
11255
|
-
unencodedSpaces: "/path/with unencoded spaces",
|
|
11256
|
-
fragmentIdentifier: "/path/with#fragment",
|
|
11257
|
-
queryParameters: "/path/with?query=parameter",
|
|
11258
|
-
nullCharacter: "/path/with/\0nullcharacter",
|
|
11259
|
-
onlySlash: "/",
|
|
11260
|
-
controlCharacter: "/path/with/control\0character",
|
|
11261
|
-
extremelyLongPath: "/" + "a".repeat(2047),
|
|
11262
|
-
invalidStartCharacter: "///path/starting/with/slashes",
|
|
11263
|
-
invalidStartCharacterColon: ":/path/starting/with/colon",
|
|
11264
|
-
invalidTrailingDot: "/path/ending/with/dot.",
|
|
11265
|
-
invalidPercentEncoding1: "/path/with/%2",
|
|
11266
|
-
invalidPercentEncoding2: "/path/with/%ZZ",
|
|
11267
|
-
invalidPercentEncoding3: "/path/with/%G1",
|
|
11268
|
-
reservedCharacter1: "/path/with?<reserved>",
|
|
11269
|
-
reservedCharacter2: '/path/with/"quotes"',
|
|
11270
|
-
reservedCharacter3: "/path/with/[brackets]",
|
|
11271
|
-
reservedCharacter4: "/path/with/\\backslashes",
|
|
11272
|
-
nonAscii1: "/path/with/\u4F60\u597D",
|
|
11273
|
-
nonAscii2: "/path/with/emoji/\u{1F603}",
|
|
11274
|
-
mixedEncodingPath: "/path/%41A%42B%C3%28",
|
|
11275
|
-
directoryTraversal1: "/path/../../etc/passwd",
|
|
11276
|
-
directoryTraversal2: "/path/./././"
|
|
11277
|
-
};
|
|
11278
|
-
function isValidRedirectPath(path) {
|
|
11279
|
-
const trimmedPath = path.toLowerCase().trim();
|
|
11280
|
-
const url = "https://www.example.com" + trimmedPath;
|
|
11281
|
-
if (url.length > 2048) {
|
|
11282
|
-
return {
|
|
11283
|
-
isValid: false,
|
|
11284
|
-
reason: "TooLong"
|
|
11285
|
-
};
|
|
11286
|
-
}
|
|
11287
|
-
if (trimmedPath === "") {
|
|
11288
|
-
return {
|
|
11289
|
-
isValid: false,
|
|
11290
|
-
reason: "Empty"
|
|
11291
|
-
};
|
|
11292
|
-
}
|
|
11293
|
-
if (url === "/") {
|
|
11294
|
-
return {
|
|
11295
|
-
isValid: false,
|
|
11296
|
-
reason: "Empty"
|
|
11297
|
-
};
|
|
11298
|
-
}
|
|
11299
|
-
if (url.includes("?")) {
|
|
11300
|
-
return {
|
|
11301
|
-
isValid: false,
|
|
11302
|
-
reason: "ContainsQuery"
|
|
11303
|
-
};
|
|
11304
|
-
}
|
|
11305
|
-
if (url.includes("#")) {
|
|
11306
|
-
return {
|
|
11307
|
-
isValid: false,
|
|
11308
|
-
reason: "ContainsFragment"
|
|
11309
|
-
};
|
|
11310
|
-
}
|
|
11311
|
-
const regex = /^\/[A-Za-z0-9_-]+(\/[A-Za-z0-9_-]+)*$/;
|
|
11312
|
-
const isValid = regex.test(trimmedPath);
|
|
11313
|
-
return {
|
|
11314
|
-
isValid: regex.test(trimmedPath),
|
|
11315
|
-
reason: !isValid ? "InvalidURI" : void 0
|
|
11316
|
-
};
|
|
11317
|
-
}
|
|
11318
|
-
|
|
11319
11405
|
// src/api/endpoints/codegen/exporters.ts
|
|
11320
11406
|
var ExportersEndpoint = class {
|
|
11321
11407
|
constructor(requestExecutor) {
|
|
@@ -11358,13 +11444,13 @@ var ExportersEndpoint = class {
|
|
|
11358
11444
|
};
|
|
11359
11445
|
|
|
11360
11446
|
// src/api/endpoints/codegen/jobs.ts
|
|
11361
|
-
import { z as
|
|
11447
|
+
import { z as z347 } from "zod";
|
|
11362
11448
|
var ExporterJobsEndpoint = class {
|
|
11363
11449
|
constructor(requestExecutor) {
|
|
11364
11450
|
this.requestExecutor = requestExecutor;
|
|
11365
11451
|
}
|
|
11366
11452
|
list(workspaceId) {
|
|
11367
|
-
return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/jobs`,
|
|
11453
|
+
return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/jobs`, z347.any());
|
|
11368
11454
|
}
|
|
11369
11455
|
get(workspaceId, jobId) {
|
|
11370
11456
|
return this.requestExecutor.json(`/codegen/workspaces/${workspaceId}/jobs/${jobId}`, DTOExportJobResponseLegacy);
|
|
@@ -11422,7 +11508,7 @@ var CodegenEndpoint = class {
|
|
|
11422
11508
|
};
|
|
11423
11509
|
|
|
11424
11510
|
// src/api/endpoints/design-system/versions/brands.ts
|
|
11425
|
-
import { z as
|
|
11511
|
+
import { z as z348 } from "zod";
|
|
11426
11512
|
var BrandsEndpoint = class {
|
|
11427
11513
|
constructor(requestExecutor) {
|
|
11428
11514
|
this.requestExecutor = requestExecutor;
|
|
@@ -11456,7 +11542,7 @@ var BrandsEndpoint = class {
|
|
|
11456
11542
|
});
|
|
11457
11543
|
}
|
|
11458
11544
|
delete(dsId, vId, brandId) {
|
|
11459
|
-
return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/brands/${brandId}`,
|
|
11545
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/versions/${vId}/brands/${brandId}`, z348.any(), {
|
|
11460
11546
|
method: "DELETE"
|
|
11461
11547
|
});
|
|
11462
11548
|
}
|
|
@@ -11732,7 +11818,7 @@ var ImportJobsEndpoint = class {
|
|
|
11732
11818
|
};
|
|
11733
11819
|
|
|
11734
11820
|
// src/api/endpoints/design-system/versions/overrides.ts
|
|
11735
|
-
import { z as
|
|
11821
|
+
import { z as z349 } from "zod";
|
|
11736
11822
|
var OverridesEndpoint = class {
|
|
11737
11823
|
constructor(requestExecutor) {
|
|
11738
11824
|
this.requestExecutor = requestExecutor;
|
|
@@ -11740,7 +11826,7 @@ var OverridesEndpoint = class {
|
|
|
11740
11826
|
create(dsId, versionId, themeId, body) {
|
|
11741
11827
|
return this.requestExecutor.json(
|
|
11742
11828
|
`/design-systems/${dsId}/versions/${versionId}/themes/${themeId}/overrides`,
|
|
11743
|
-
|
|
11829
|
+
z349.any(),
|
|
11744
11830
|
{
|
|
11745
11831
|
method: "POST",
|
|
11746
11832
|
body
|
|
@@ -11750,7 +11836,7 @@ var OverridesEndpoint = class {
|
|
|
11750
11836
|
};
|
|
11751
11837
|
|
|
11752
11838
|
// src/api/endpoints/design-system/versions/property-definitions.ts
|
|
11753
|
-
import { z as
|
|
11839
|
+
import { z as z350 } from "zod";
|
|
11754
11840
|
var ElementPropertyDefinitionsEndpoint = class {
|
|
11755
11841
|
constructor(requestExecutor) {
|
|
11756
11842
|
this.requestExecutor = requestExecutor;
|
|
@@ -11778,7 +11864,7 @@ var ElementPropertyDefinitionsEndpoint = class {
|
|
|
11778
11864
|
delete(designSystemId, versionId, defId) {
|
|
11779
11865
|
return this.requestExecutor.json(
|
|
11780
11866
|
`/design-systems/${designSystemId}/versions/${versionId}/element-properties/definitions/${defId}`,
|
|
11781
|
-
|
|
11867
|
+
z350.any(),
|
|
11782
11868
|
{ method: "DELETE" }
|
|
11783
11869
|
);
|
|
11784
11870
|
}
|
|
@@ -11817,7 +11903,7 @@ var VersionStatsEndpoint = class {
|
|
|
11817
11903
|
};
|
|
11818
11904
|
|
|
11819
11905
|
// src/api/endpoints/design-system/versions/themes.ts
|
|
11820
|
-
import { z as
|
|
11906
|
+
import { z as z351 } from "zod";
|
|
11821
11907
|
var ThemesEndpoint = class {
|
|
11822
11908
|
constructor(requestExecutor) {
|
|
11823
11909
|
this.requestExecutor = requestExecutor;
|
|
@@ -11840,7 +11926,7 @@ var ThemesEndpoint = class {
|
|
|
11840
11926
|
});
|
|
11841
11927
|
}
|
|
11842
11928
|
delete(dsId, versionId, themeId) {
|
|
11843
|
-
return this.requestExecutor.json(`/design-systems/${dsId}/versions/${versionId}/themes/${themeId}`,
|
|
11929
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/versions/${versionId}/themes/${themeId}`, z351.any(), {
|
|
11844
11930
|
method: "DELETE"
|
|
11845
11931
|
});
|
|
11846
11932
|
}
|
|
@@ -12013,7 +12099,7 @@ var DesignSystemContactsEndpoint = class {
|
|
|
12013
12099
|
};
|
|
12014
12100
|
|
|
12015
12101
|
// src/api/endpoints/design-system/design-systems.ts
|
|
12016
|
-
import { z as
|
|
12102
|
+
import { z as z355 } from "zod";
|
|
12017
12103
|
|
|
12018
12104
|
// src/api/endpoints/design-system/figma-node-structures.ts
|
|
12019
12105
|
var FigmaNodeStructuresEndpoint = class {
|
|
@@ -12090,7 +12176,7 @@ var DesignSystemPageRedirectsEndpoint = class {
|
|
|
12090
12176
|
};
|
|
12091
12177
|
|
|
12092
12178
|
// src/api/endpoints/design-system/sources.ts
|
|
12093
|
-
import { z as
|
|
12179
|
+
import { z as z352 } from "zod";
|
|
12094
12180
|
var DesignSystemSourcesEndpoint = class {
|
|
12095
12181
|
constructor(requestExecutor) {
|
|
12096
12182
|
this.requestExecutor = requestExecutor;
|
|
@@ -12108,7 +12194,7 @@ var DesignSystemSourcesEndpoint = class {
|
|
|
12108
12194
|
return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, DTODataSourceResponse);
|
|
12109
12195
|
}
|
|
12110
12196
|
delete(dsId, sourceId) {
|
|
12111
|
-
return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`,
|
|
12197
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, z352.any(), { method: "DELETE" });
|
|
12112
12198
|
}
|
|
12113
12199
|
updateFigmaSource(dsId, sourceId, payload) {
|
|
12114
12200
|
return this.requestExecutor.json(`/design-systems/${dsId}/sources/${sourceId}`, DTODataSourceResponse, {
|
|
@@ -12151,7 +12237,7 @@ var DesignSystemSourcesEndpoint = class {
|
|
|
12151
12237
|
};
|
|
12152
12238
|
|
|
12153
12239
|
// src/api/endpoints/design-system/storybook.ts
|
|
12154
|
-
import { z as
|
|
12240
|
+
import { z as z353 } from "zod";
|
|
12155
12241
|
var StorybookEntriesEndpoint = class {
|
|
12156
12242
|
constructor(requestExecutor) {
|
|
12157
12243
|
this.requestExecutor = requestExecutor;
|
|
@@ -12169,14 +12255,14 @@ var StorybookEntriesEndpoint = class {
|
|
|
12169
12255
|
);
|
|
12170
12256
|
}
|
|
12171
12257
|
delete(dsId, entryId) {
|
|
12172
|
-
return this.requestExecutor.json(`/design-systems/${dsId}/versions/head/storybook/${entryId}`,
|
|
12258
|
+
return this.requestExecutor.json(`/design-systems/${dsId}/versions/head/storybook/${entryId}`, z353.any(), {
|
|
12173
12259
|
method: "DELETE"
|
|
12174
12260
|
});
|
|
12175
12261
|
}
|
|
12176
12262
|
};
|
|
12177
12263
|
|
|
12178
12264
|
// src/api/endpoints/design-system/storybook-hosting.ts
|
|
12179
|
-
import { z as
|
|
12265
|
+
import { z as z354 } from "zod";
|
|
12180
12266
|
var StorybookHostingEndpoint = class {
|
|
12181
12267
|
constructor(requestExecutor) {
|
|
12182
12268
|
this.requestExecutor = requestExecutor;
|
|
@@ -12190,7 +12276,7 @@ var StorybookHostingEndpoint = class {
|
|
|
12190
12276
|
delete(dsId, storybookUploadId) {
|
|
12191
12277
|
return this.requestExecutor.json(
|
|
12192
12278
|
`/design-systems/${dsId}/storybook/${storybookUploadId}`,
|
|
12193
|
-
|
|
12279
|
+
z354.object({ ok: z354.boolean() }),
|
|
12194
12280
|
{
|
|
12195
12281
|
method: "DELETE"
|
|
12196
12282
|
}
|
|
@@ -12248,7 +12334,7 @@ var DesignSystemsEndpoint = class {
|
|
|
12248
12334
|
return this.requestExecutor.json(`/design-systems/${dsId}`, DTODesignSystemResponse);
|
|
12249
12335
|
}
|
|
12250
12336
|
delete(dsId) {
|
|
12251
|
-
return this.requestExecutor.json(`/design-systems/${dsId}`,
|
|
12337
|
+
return this.requestExecutor.json(`/design-systems/${dsId}`, z355.any(), { method: "DELETE" });
|
|
12252
12338
|
}
|
|
12253
12339
|
update(dsId, body) {
|
|
12254
12340
|
return this.requestExecutor.json(`/design-systems/${dsId}`, DTODesignSystemResponse, {
|
|
@@ -12700,7 +12786,7 @@ var ForgeProjectMembersEndpoint = class {
|
|
|
12700
12786
|
};
|
|
12701
12787
|
|
|
12702
12788
|
// src/api/endpoints/forge/projects.ts
|
|
12703
|
-
import
|
|
12789
|
+
import z356 from "zod";
|
|
12704
12790
|
var ForgeProjectsEndpoint = class {
|
|
12705
12791
|
constructor(requestExecutor) {
|
|
12706
12792
|
this.requestExecutor = requestExecutor;
|
|
@@ -12737,7 +12823,7 @@ var ForgeProjectsEndpoint = class {
|
|
|
12737
12823
|
);
|
|
12738
12824
|
}
|
|
12739
12825
|
action(workspaceId, projectId, body) {
|
|
12740
|
-
return this.requestExecutor.json(`/workspaces/${workspaceId}/forge/projects/${projectId}/action`,
|
|
12826
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/forge/projects/${projectId}/action`, z356.any(), {
|
|
12741
12827
|
body,
|
|
12742
12828
|
method: "POST"
|
|
12743
12829
|
});
|
|
@@ -12909,7 +12995,7 @@ var WorkspaceBillingEndpoint = class {
|
|
|
12909
12995
|
};
|
|
12910
12996
|
|
|
12911
12997
|
// src/api/endpoints/workspaces/chat-threads.ts
|
|
12912
|
-
import { z as
|
|
12998
|
+
import { z as z357 } from "zod";
|
|
12913
12999
|
var WorkspaceChatThreadsEndpoint = class {
|
|
12914
13000
|
constructor(requestExecutor) {
|
|
12915
13001
|
this.requestExecutor = requestExecutor;
|
|
@@ -12941,7 +13027,7 @@ var WorkspaceChatThreadsEndpoint = class {
|
|
|
12941
13027
|
);
|
|
12942
13028
|
}
|
|
12943
13029
|
delete(workspaceId, threadId) {
|
|
12944
|
-
return this.requestExecutor.json(`/workspaces/${workspaceId}/forge/threads/${threadId}`,
|
|
13030
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/forge/threads/${threadId}`, z357.any(), {
|
|
12945
13031
|
method: "DELETE"
|
|
12946
13032
|
});
|
|
12947
13033
|
}
|
|
@@ -12973,7 +13059,7 @@ var ChatThreadMessagesEndpoint = class {
|
|
|
12973
13059
|
);
|
|
12974
13060
|
}
|
|
12975
13061
|
score(workspaceId, threadId, body) {
|
|
12976
|
-
return this.requestExecutor.json(`/workspaces/${workspaceId}/forge/threads/${threadId}/scores`,
|
|
13062
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/forge/threads/${threadId}/scores`, z357.any(), {
|
|
12977
13063
|
method: "POST",
|
|
12978
13064
|
body
|
|
12979
13065
|
});
|
|
@@ -12981,7 +13067,7 @@ var ChatThreadMessagesEndpoint = class {
|
|
|
12981
13067
|
};
|
|
12982
13068
|
|
|
12983
13069
|
// src/api/endpoints/workspaces/integrations.ts
|
|
12984
|
-
import { z as
|
|
13070
|
+
import { z as z358 } from "zod";
|
|
12985
13071
|
var WorkspaceIntegrationsEndpoint = class {
|
|
12986
13072
|
constructor(requestExecutor) {
|
|
12987
13073
|
this.requestExecutor = requestExecutor;
|
|
@@ -12990,7 +13076,7 @@ var WorkspaceIntegrationsEndpoint = class {
|
|
|
12990
13076
|
return this.requestExecutor.json(`/workspaces/${wsId}/integrations`, DTOIntegrationsGetListResponse);
|
|
12991
13077
|
}
|
|
12992
13078
|
delete(wsId, iId) {
|
|
12993
|
-
return this.requestExecutor.json(`/workspaces/${wsId}/integrations/${iId}`,
|
|
13079
|
+
return this.requestExecutor.json(`/workspaces/${wsId}/integrations/${iId}`, z358.unknown(), { method: "DELETE" });
|
|
12994
13080
|
}
|
|
12995
13081
|
};
|
|
12996
13082
|
|
|
@@ -13022,7 +13108,7 @@ var WorkspaceInvitationsEndpoint = class {
|
|
|
13022
13108
|
};
|
|
13023
13109
|
|
|
13024
13110
|
// src/api/endpoints/workspaces/members.ts
|
|
13025
|
-
import { z as
|
|
13111
|
+
import { z as z359 } from "zod";
|
|
13026
13112
|
var WorkspaceMembersEndpoint = class {
|
|
13027
13113
|
constructor(requestExecutor) {
|
|
13028
13114
|
this.requestExecutor = requestExecutor;
|
|
@@ -13039,7 +13125,7 @@ var WorkspaceMembersEndpoint = class {
|
|
|
13039
13125
|
});
|
|
13040
13126
|
}
|
|
13041
13127
|
invite(workspaceId, body) {
|
|
13042
|
-
return this.requestExecutor.json(`/workspaces/${workspaceId}/members`,
|
|
13128
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/members`, z359.any(), { method: "POST", body });
|
|
13043
13129
|
}
|
|
13044
13130
|
delete(workspaceId, userId) {
|
|
13045
13131
|
return this.requestExecutor.json(`/workspaces/${workspaceId}/members/${userId}`, DTOWorkspaceResponse, {
|
|
@@ -13068,7 +13154,7 @@ var WorkspaceNpmRegistryEndpoint = class {
|
|
|
13068
13154
|
};
|
|
13069
13155
|
|
|
13070
13156
|
// src/api/endpoints/workspaces/subscription.ts
|
|
13071
|
-
import { z as
|
|
13157
|
+
import { z as z360 } from "zod";
|
|
13072
13158
|
var WorkspaceSubscriptionEndpoint = class {
|
|
13073
13159
|
constructor(requestExecutor) {
|
|
13074
13160
|
this.requestExecutor = requestExecutor;
|
|
@@ -13079,7 +13165,7 @@ var WorkspaceSubscriptionEndpoint = class {
|
|
|
13079
13165
|
});
|
|
13080
13166
|
}
|
|
13081
13167
|
update(workspaceId, body) {
|
|
13082
|
-
return this.requestExecutor.json(`/workspaces/${workspaceId}/subscription`,
|
|
13168
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}/subscription`, z360.any(), {
|
|
13083
13169
|
method: "PUT",
|
|
13084
13170
|
body
|
|
13085
13171
|
});
|
|
@@ -13097,7 +13183,7 @@ var WorkspaceSubscriptionEndpoint = class {
|
|
|
13097
13183
|
};
|
|
13098
13184
|
|
|
13099
13185
|
// src/api/endpoints/workspaces/workspaces.ts
|
|
13100
|
-
import { z as
|
|
13186
|
+
import { z as z361 } from "zod";
|
|
13101
13187
|
var WorkspacesEndpoint = class {
|
|
13102
13188
|
constructor(requestExecutor) {
|
|
13103
13189
|
this.requestExecutor = requestExecutor;
|
|
@@ -13133,7 +13219,7 @@ var WorkspacesEndpoint = class {
|
|
|
13133
13219
|
return this.requestExecutor.json(`/workspaces/${workspaceId}`, DTOWorkspaceResponse, { method: "GET" });
|
|
13134
13220
|
}
|
|
13135
13221
|
delete(workspaceId) {
|
|
13136
|
-
return this.requestExecutor.json(`/workspaces/${workspaceId}`,
|
|
13222
|
+
return this.requestExecutor.json(`/workspaces/${workspaceId}`, z361.any(), { method: "DELETE" });
|
|
13137
13223
|
}
|
|
13138
13224
|
getPortalSettings(workspaceId) {
|
|
13139
13225
|
return this.requestExecutor.json(`/workspaces/${workspaceId}/portal/settings`, DTOPortalSettingsGetResponse, {
|
|
@@ -13291,9 +13377,9 @@ ${bodyText}`,
|
|
|
13291
13377
|
|
|
13292
13378
|
// src/api/transport/request-executor.ts
|
|
13293
13379
|
import fetch from "node-fetch";
|
|
13294
|
-
import { z as
|
|
13295
|
-
var ResponseWrapper =
|
|
13296
|
-
result:
|
|
13380
|
+
import { z as z362 } from "zod";
|
|
13381
|
+
var ResponseWrapper = z362.object({
|
|
13382
|
+
result: z362.record(z362.any())
|
|
13297
13383
|
});
|
|
13298
13384
|
var RequestExecutor = class {
|
|
13299
13385
|
constructor(testServerConfig) {
|
|
@@ -13383,25 +13469,25 @@ var SupernovaApiClient = class {
|
|
|
13383
13469
|
};
|
|
13384
13470
|
|
|
13385
13471
|
// src/events/design-system.ts
|
|
13386
|
-
import { z as
|
|
13387
|
-
var DTOEventFigmaNodesRendered =
|
|
13388
|
-
type:
|
|
13389
|
-
designSystemId:
|
|
13390
|
-
versionId:
|
|
13391
|
-
figmaNodePersistentIds:
|
|
13392
|
-
});
|
|
13393
|
-
var DTOEventDataSourcesImported =
|
|
13394
|
-
type:
|
|
13395
|
-
designSystemId:
|
|
13396
|
-
versionId:
|
|
13397
|
-
importJobId:
|
|
13472
|
+
import { z as z363 } from "zod";
|
|
13473
|
+
var DTOEventFigmaNodesRendered = z363.object({
|
|
13474
|
+
type: z363.literal("DesignSystem.FigmaNodesRendered"),
|
|
13475
|
+
designSystemId: z363.string(),
|
|
13476
|
+
versionId: z363.string(),
|
|
13477
|
+
figmaNodePersistentIds: z363.string().array()
|
|
13478
|
+
});
|
|
13479
|
+
var DTOEventDataSourcesImported = z363.object({
|
|
13480
|
+
type: z363.literal("DesignSystem.ImportJobFinished"),
|
|
13481
|
+
designSystemId: z363.string(),
|
|
13482
|
+
versionId: z363.string(),
|
|
13483
|
+
importJobId: z363.string(),
|
|
13398
13484
|
dataSourceType: DataSourceRemoteType,
|
|
13399
|
-
dataSourceIds:
|
|
13485
|
+
dataSourceIds: z363.string().array()
|
|
13400
13486
|
});
|
|
13401
13487
|
|
|
13402
13488
|
// src/events/event.ts
|
|
13403
|
-
import { z as
|
|
13404
|
-
var DTOEvent =
|
|
13489
|
+
import { z as z364 } from "zod";
|
|
13490
|
+
var DTOEvent = z364.discriminatedUnion("type", [DTOEventDataSourcesImported, DTOEventFigmaNodesRendered]);
|
|
13405
13491
|
|
|
13406
13492
|
// src/sync/docs-local-action-executor.ts
|
|
13407
13493
|
function applyActionsLocally(input) {
|
|
@@ -13697,7 +13783,7 @@ var LocalDocsElementActionExecutor = class {
|
|
|
13697
13783
|
import PQueue from "p-queue";
|
|
13698
13784
|
|
|
13699
13785
|
// src/yjs/design-system-content/documentation-hierarchy.ts
|
|
13700
|
-
import { z as
|
|
13786
|
+
import { z as z365 } from "zod";
|
|
13701
13787
|
|
|
13702
13788
|
// src/yjs/version-room/base.ts
|
|
13703
13789
|
var VersionRoomBaseYDoc = class {
|
|
@@ -14247,24 +14333,24 @@ var FrontendVersionRoomYDoc = class {
|
|
|
14247
14333
|
};
|
|
14248
14334
|
|
|
14249
14335
|
// src/yjs/design-system-content/documentation-hierarchy.ts
|
|
14250
|
-
var DocumentationHierarchySettings =
|
|
14251
|
-
routingVersion:
|
|
14252
|
-
isDraftFeatureAdopted:
|
|
14253
|
-
isApprovalFeatureEnabled:
|
|
14254
|
-
approvalRequiredForPublishing:
|
|
14336
|
+
var DocumentationHierarchySettings = z365.object({
|
|
14337
|
+
routingVersion: z365.string(),
|
|
14338
|
+
isDraftFeatureAdopted: z365.boolean(),
|
|
14339
|
+
isApprovalFeatureEnabled: z365.boolean(),
|
|
14340
|
+
approvalRequiredForPublishing: z365.boolean()
|
|
14255
14341
|
});
|
|
14256
14342
|
function yjsToDocumentationHierarchy(doc) {
|
|
14257
14343
|
return new FrontendVersionRoomYDoc(doc).getDocumentationHierarchy();
|
|
14258
14344
|
}
|
|
14259
14345
|
|
|
14260
14346
|
// src/yjs/design-system-content/item-configuration.ts
|
|
14261
|
-
import { z as
|
|
14262
|
-
var DTODocumentationPageRoomHeaderData =
|
|
14263
|
-
title:
|
|
14347
|
+
import { z as z366 } from "zod";
|
|
14348
|
+
var DTODocumentationPageRoomHeaderData = z366.object({
|
|
14349
|
+
title: z366.string(),
|
|
14264
14350
|
configuration: DTODocumentationItemConfigurationV2
|
|
14265
14351
|
});
|
|
14266
|
-
var DTODocumentationPageRoomHeaderDataUpdate =
|
|
14267
|
-
title:
|
|
14352
|
+
var DTODocumentationPageRoomHeaderDataUpdate = z366.object({
|
|
14353
|
+
title: z366.string().optional(),
|
|
14268
14354
|
configuration: DTODocumentationItemConfigurationV2.omit({ header: true }).extend({ header: DocumentationItemHeaderV2.partial() }).optional()
|
|
14269
14355
|
});
|
|
14270
14356
|
function itemConfigurationToYjs(yDoc, item) {
|
|
@@ -14299,9 +14385,9 @@ var PageBlockEditorModel = PageBlockEditorModelV2;
|
|
|
14299
14385
|
var PageSectionEditorModel = PageSectionEditorModelV2;
|
|
14300
14386
|
|
|
14301
14387
|
// src/yjs/docs-editor/model/page.ts
|
|
14302
|
-
import { z as
|
|
14303
|
-
var DocumentationPageEditorModel =
|
|
14304
|
-
blocks:
|
|
14388
|
+
import { z as z367 } from "zod";
|
|
14389
|
+
var DocumentationPageEditorModel = z367.object({
|
|
14390
|
+
blocks: z367.array(DocumentationPageContentItem)
|
|
14305
14391
|
});
|
|
14306
14392
|
|
|
14307
14393
|
// src/yjs/docs-editor/prosemirror/inner-editor-schema.ts
|
|
@@ -17978,7 +18064,7 @@ var blocks = [
|
|
|
17978
18064
|
|
|
17979
18065
|
// src/yjs/docs-editor/prosemirror-to-blocks.ts
|
|
17980
18066
|
import { yXmlFragmentToProsemirrorJSON } from "y-prosemirror";
|
|
17981
|
-
import { z as
|
|
18067
|
+
import { z as z368 } from "zod";
|
|
17982
18068
|
function yDocToPage(yDoc, definitions) {
|
|
17983
18069
|
return yXmlFragmentToPage(yDoc.getXmlFragment("default"), definitions);
|
|
17984
18070
|
}
|
|
@@ -18054,7 +18140,7 @@ function prosemirrorNodeToSectionItem(prosemirrorNode, definitionsMap) {
|
|
|
18054
18140
|
if (!id) return null;
|
|
18055
18141
|
return {
|
|
18056
18142
|
id,
|
|
18057
|
-
title: getProsemirrorAttribute(prosemirrorNode, "title",
|
|
18143
|
+
title: getProsemirrorAttribute(prosemirrorNode, "title", z368.string()) ?? "",
|
|
18058
18144
|
columns: (prosemirrorNode.content ?? []).filter((c) => c.type === "sectionItemColumn").map((c) => prosemirrorNodeToSectionColumns(c, definitionsMap)).filter(nonNullFilter)
|
|
18059
18145
|
};
|
|
18060
18146
|
}
|
|
@@ -18088,7 +18174,7 @@ function internalProsemirrorNodesToBlocks(prosemirrorNodes, definitionsMap, dept
|
|
|
18088
18174
|
});
|
|
18089
18175
|
}
|
|
18090
18176
|
function internalProsemirrorNodeToBlock(prosemirrorNode, definitionsMap, depth) {
|
|
18091
|
-
const definitionId = getProsemirrorAttribute(prosemirrorNode, "definitionId",
|
|
18177
|
+
const definitionId = getProsemirrorAttribute(prosemirrorNode, "definitionId", z368.string());
|
|
18092
18178
|
if (!definitionId) {
|
|
18093
18179
|
console.warn(`definitionId on ${prosemirrorNode.type} is required to be interpreted as a block, skipping node`);
|
|
18094
18180
|
return [];
|
|
@@ -18129,7 +18215,7 @@ function parseAsRichText(prosemirrorNode, definition, property) {
|
|
|
18129
18215
|
const id = getProsemirrorBlockId(prosemirrorNode);
|
|
18130
18216
|
if (!id) return null;
|
|
18131
18217
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
18132
|
-
const calloutType = parseCalloutType(getProsemirrorAttribute(prosemirrorNode, "type",
|
|
18218
|
+
const calloutType = parseCalloutType(getProsemirrorAttribute(prosemirrorNode, "type", z368.string().optional()));
|
|
18133
18219
|
return {
|
|
18134
18220
|
id,
|
|
18135
18221
|
type: "Block",
|
|
@@ -18252,9 +18338,9 @@ function parseRichTextAttribute(mark) {
|
|
|
18252
18338
|
return null;
|
|
18253
18339
|
}
|
|
18254
18340
|
function parseProsemirrorLink(mark) {
|
|
18255
|
-
const href = getProsemirrorAttribute(mark, "href",
|
|
18341
|
+
const href = getProsemirrorAttribute(mark, "href", z368.string().optional());
|
|
18256
18342
|
if (!href) return null;
|
|
18257
|
-
const target = getProsemirrorAttribute(mark, "target",
|
|
18343
|
+
const target = getProsemirrorAttribute(mark, "target", z368.string().optional());
|
|
18258
18344
|
const openInNewTab = target === "_blank";
|
|
18259
18345
|
if (href.startsWith("@")) {
|
|
18260
18346
|
return {
|
|
@@ -18273,9 +18359,9 @@ function parseProsemirrorLink(mark) {
|
|
|
18273
18359
|
}
|
|
18274
18360
|
}
|
|
18275
18361
|
function parseProsemirrorCommentHighlight(mark) {
|
|
18276
|
-
const highlightId = getProsemirrorAttribute(mark, "highlightId",
|
|
18362
|
+
const highlightId = getProsemirrorAttribute(mark, "highlightId", z368.string().optional());
|
|
18277
18363
|
if (!highlightId) return null;
|
|
18278
|
-
const isResolved = getProsemirrorAttribute(mark, "resolved",
|
|
18364
|
+
const isResolved = getProsemirrorAttribute(mark, "resolved", z368.boolean().optional()) ?? false;
|
|
18279
18365
|
return {
|
|
18280
18366
|
type: "Comment",
|
|
18281
18367
|
commentHighlightId: highlightId,
|
|
@@ -18286,7 +18372,7 @@ function parseAsTable(prosemirrorNode, definition, property) {
|
|
|
18286
18372
|
const id = getProsemirrorBlockId(prosemirrorNode);
|
|
18287
18373
|
if (!id) return null;
|
|
18288
18374
|
const variantId = getProsemirrorBlockVariantId(prosemirrorNode);
|
|
18289
|
-
const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder",
|
|
18375
|
+
const hasBorder = getProsemirrorAttribute(prosemirrorNode, "hasBorder", z368.boolean().optional()) !== false;
|
|
18290
18376
|
const tableChild = prosemirrorNode.content?.find((c) => c.type === "table");
|
|
18291
18377
|
if (!tableChild) {
|
|
18292
18378
|
return emptyTable(id, variantId, 0);
|
|
@@ -18332,9 +18418,9 @@ function parseAsTable(prosemirrorNode, definition, property) {
|
|
|
18332
18418
|
function parseAsTableCell(prosemirrorNode) {
|
|
18333
18419
|
const id = getProsemirrorBlockId(prosemirrorNode);
|
|
18334
18420
|
if (!id) return null;
|
|
18335
|
-
const textAlign = getProsemirrorAttribute(prosemirrorNode, "textAlign",
|
|
18421
|
+
const textAlign = getProsemirrorAttribute(prosemirrorNode, "textAlign", z368.string().optional());
|
|
18336
18422
|
let columnWidth;
|
|
18337
|
-
const columnWidthArray = getProsemirrorAttribute(prosemirrorNode, "colwidth",
|
|
18423
|
+
const columnWidthArray = getProsemirrorAttribute(prosemirrorNode, "colwidth", z368.array(z368.number()).nullish());
|
|
18338
18424
|
if (columnWidthArray) {
|
|
18339
18425
|
columnWidth = roundDimension(columnWidthArray[0]);
|
|
18340
18426
|
}
|
|
@@ -18370,7 +18456,7 @@ function parseAsTableNode(prosemirrorNode) {
|
|
|
18370
18456
|
value: parseRichText(prosemirrorNode.content ?? [])
|
|
18371
18457
|
};
|
|
18372
18458
|
case "image":
|
|
18373
|
-
const items = getProsemirrorAttribute(prosemirrorNode, "items",
|
|
18459
|
+
const items = getProsemirrorAttribute(prosemirrorNode, "items", z368.string());
|
|
18374
18460
|
if (!items) return null;
|
|
18375
18461
|
const parsedItems = PageBlockItemV2.array().safeParse(JSON.parse(items));
|
|
18376
18462
|
if (!parsedItems.success) return null;
|
|
@@ -18484,7 +18570,7 @@ function definitionExpectsPlaceholderItem(definition) {
|
|
|
18484
18570
|
);
|
|
18485
18571
|
}
|
|
18486
18572
|
function parseBlockItems(prosemirrorNode, definition) {
|
|
18487
|
-
const itemsString = getProsemirrorAttribute(prosemirrorNode, "items",
|
|
18573
|
+
const itemsString = getProsemirrorAttribute(prosemirrorNode, "items", z368.string());
|
|
18488
18574
|
if (!itemsString) return null;
|
|
18489
18575
|
const itemsJson = JSON.parse(itemsString);
|
|
18490
18576
|
if (!Array.isArray(itemsJson)) {
|
|
@@ -18495,18 +18581,18 @@ function parseBlockItems(prosemirrorNode, definition) {
|
|
|
18495
18581
|
}
|
|
18496
18582
|
function parseAppearance(prosemirrorNode) {
|
|
18497
18583
|
let appearance = {};
|
|
18498
|
-
const rawAppearanceString = getProsemirrorAttribute(prosemirrorNode, "appearance",
|
|
18584
|
+
const rawAppearanceString = getProsemirrorAttribute(prosemirrorNode, "appearance", z368.string().optional());
|
|
18499
18585
|
if (rawAppearanceString) {
|
|
18500
18586
|
const parsedAppearance = PageBlockAppearanceV2.safeParse(JSON.parse(rawAppearanceString));
|
|
18501
18587
|
if (parsedAppearance.success) {
|
|
18502
18588
|
appearance = parsedAppearance.data;
|
|
18503
18589
|
}
|
|
18504
18590
|
}
|
|
18505
|
-
const columns = getProsemirrorAttribute(prosemirrorNode, "columns",
|
|
18591
|
+
const columns = getProsemirrorAttribute(prosemirrorNode, "columns", z368.number().optional());
|
|
18506
18592
|
if (columns) {
|
|
18507
18593
|
appearance.numberOfColumns = columns;
|
|
18508
18594
|
}
|
|
18509
|
-
const backgroundColor = getProsemirrorAttribute(prosemirrorNode, "backgroundColor",
|
|
18595
|
+
const backgroundColor = getProsemirrorAttribute(prosemirrorNode, "backgroundColor", z368.string().optional());
|
|
18510
18596
|
if (backgroundColor) {
|
|
18511
18597
|
const parsedColor = PageBlockColorV2.safeParse(JSON.parse(backgroundColor));
|
|
18512
18598
|
if (parsedColor.success) {
|
|
@@ -18607,12 +18693,12 @@ function valueSchemaForPropertyType(type) {
|
|
|
18607
18693
|
}
|
|
18608
18694
|
}
|
|
18609
18695
|
function getProsemirrorBlockId(prosemirrorNode) {
|
|
18610
|
-
const id = getProsemirrorAttribute(prosemirrorNode, "id",
|
|
18696
|
+
const id = getProsemirrorAttribute(prosemirrorNode, "id", z368.string());
|
|
18611
18697
|
if (!id) console.warn(`Prosemirror attribute "id" on ${prosemirrorNode.type} is required`);
|
|
18612
18698
|
return id;
|
|
18613
18699
|
}
|
|
18614
18700
|
function getProsemirrorBlockVariantId(prosemirrorNode) {
|
|
18615
|
-
return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(
|
|
18701
|
+
return getProsemirrorAttribute(prosemirrorNode, "variantId", nullishToOptional(z368.string()));
|
|
18616
18702
|
}
|
|
18617
18703
|
function getProsemirrorAttribute(prosemirrorNode, attributeName, validationSchema) {
|
|
18618
18704
|
const parsedAttr = validationSchema.safeParse(prosemirrorNode.attrs?.[attributeName]);
|
|
@@ -20297,6 +20383,7 @@ export {
|
|
|
20297
20383
|
DTOForgeProjectMemberCreateResponse,
|
|
20298
20384
|
DTOForgeProjectMemberDeleted,
|
|
20299
20385
|
DTOForgeProjectMemberGetResponse,
|
|
20386
|
+
DTOForgeProjectMemberListQuery,
|
|
20300
20387
|
DTOForgeProjectMemberRemoveResponse,
|
|
20301
20388
|
DTOForgeProjectMemberRole,
|
|
20302
20389
|
DTOForgeProjectMemberUpdateResponse,
|
|
@@ -20351,6 +20438,13 @@ export {
|
|
|
20351
20438
|
DTOMCPStreamUpdateInput,
|
|
20352
20439
|
DTOMoveDocumentationGroupInput,
|
|
20353
20440
|
DTOMoveDocumentationPageInputV2,
|
|
20441
|
+
DTONotificationBase,
|
|
20442
|
+
DTONotificationChannel,
|
|
20443
|
+
DTONotificationChatMentionPayload,
|
|
20444
|
+
DTONotificationCreateInput,
|
|
20445
|
+
DTONotificationProjectDocumentCommentPayload,
|
|
20446
|
+
DTONotificationProjectInvitationPayload,
|
|
20447
|
+
DTONotificationType,
|
|
20354
20448
|
DTONpmRegistryAccessTokenResponse,
|
|
20355
20449
|
DTONpmRegistryConfig,
|
|
20356
20450
|
DTONpmRegistryConfigConstants,
|
|
@@ -20513,6 +20607,7 @@ export {
|
|
|
20513
20607
|
DTOUserEmailSettings,
|
|
20514
20608
|
DTOUserEmailSettingsUpdatePayload,
|
|
20515
20609
|
DTOUserGetResponse,
|
|
20610
|
+
DTOUserNotificationSettings,
|
|
20516
20611
|
DTOUserNotificationSettingsResponse,
|
|
20517
20612
|
DTOUserOnboarding,
|
|
20518
20613
|
DTOUserOnboardingDepartment,
|