@supernova-studio/client 0.59.17 → 0.59.19

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.mjs CHANGED
@@ -4420,9 +4420,7 @@ var RestoredDocumentationPage = z152.object({
4420
4420
  page: DocumentationPageV2,
4421
4421
  pageParent: ElementGroup,
4422
4422
  pageContent: DocumentationPageContentData,
4423
- contentHash: z152.string(),
4424
- snapshotId: z152.string(),
4425
- roomId: z152.string().optional()
4423
+ contentHash: z152.string()
4426
4424
  });
4427
4425
  var RestoredDocumentationGroup = z152.object({
4428
4426
  group: ElementGroup,
@@ -6472,12 +6470,18 @@ var DTOCreateDocumentationPageInputV2 = z227.object({
6472
6470
  afterPersistentId: z227.string().nullish()
6473
6471
  });
6474
6472
  var DTOUpdateDocumentationPageInputV2 = z227.object({
6475
- // Identifier of the group to update
6473
+ // Identifier of the page to update
6476
6474
  id: z227.string(),
6477
6475
  // Page properties
6478
6476
  title: z227.string().optional(),
6479
6477
  configuration: DTODocumentationItemConfigurationV2.partial().optional()
6480
6478
  });
6479
+ var DTOUpdateDocumentationPageDocumentInputV2 = z227.object({
6480
+ // Identifier of the page to update
6481
+ id: z227.string(),
6482
+ // Page properties
6483
+ documentItems: z227.array(DocumentationPageContentItem)
6484
+ });
6481
6485
  var DTOMoveDocumentationPageInputV2 = z227.object({
6482
6486
  // Identifier of the group to update
6483
6487
  id: z227.string(),
@@ -6954,6 +6958,10 @@ var DTODocumentationPageUpdateActionOutputV2 = z242.object({
6954
6958
  type: z242.literal("DocumentationPageUpdate"),
6955
6959
  output: SuccessPayload2
6956
6960
  });
6961
+ var DTODocumentationPageUpdateDocumentActionOutputV2 = z242.object({
6962
+ type: z242.literal("DocumentationPageUpdateDocument"),
6963
+ output: SuccessPayload2
6964
+ });
6957
6965
  var DTODocumentationPageMoveActionOutputV2 = z242.object({
6958
6966
  type: z242.literal("DocumentationPageMove"),
6959
6967
  output: SuccessPayload2
@@ -6986,6 +6994,10 @@ var DTODocumentationPageUpdateActionInputV2 = z242.object({
6986
6994
  type: z242.literal("DocumentationPageUpdate"),
6987
6995
  input: DTOUpdateDocumentationPageInputV2
6988
6996
  });
6997
+ var DTODocumentationPageUpdateDocumentActionInputV2 = z242.object({
6998
+ type: z242.literal("DocumentationPageUpdateDocument"),
6999
+ input: DTOUpdateDocumentationPageDocumentInputV2
7000
+ });
6989
7001
  var DTODocumentationPageMoveActionInputV2 = z242.object({
6990
7002
  type: z242.literal("DocumentationPageMove"),
6991
7003
  input: DTOMoveDocumentationPageInputV2
@@ -7264,6 +7276,7 @@ var DTOElementActionOutput = z253.discriminatedUnion("type", [
7264
7276
  // Documentation pages
7265
7277
  DTODocumentationPageCreateActionOutputV2,
7266
7278
  DTODocumentationPageUpdateActionOutputV2,
7279
+ DTODocumentationPageUpdateDocumentActionOutputV2,
7267
7280
  DTODocumentationPageMoveActionOutputV2,
7268
7281
  DTODocumentationPageDuplicateActionOutputV2,
7269
7282
  DTODocumentationPageDeleteActionOutputV2,
@@ -7288,6 +7301,7 @@ var DTOElementActionInput = z253.discriminatedUnion("type", [
7288
7301
  // Documentation pages
7289
7302
  DTODocumentationPageCreateActionInputV2,
7290
7303
  DTODocumentationPageUpdateActionInputV2,
7304
+ DTODocumentationPageUpdateDocumentActionInputV2,
7291
7305
  DTODocumentationPageMoveActionInputV2,
7292
7306
  DTODocumentationPageDuplicateActionInputV2,
7293
7307
  DTODocumentationPageDeleteActionInputV2,
@@ -7512,6 +7526,79 @@ function serializeQuery(query) {
7512
7526
  return new URLSearchParams(queryWithStrings);
7513
7527
  }
7514
7528
 
7529
+ // src/utils/redirect-validation.ts
7530
+ var exhaustiveInvalidUriPaths = {
7531
+ emptyPath: "",
7532
+ spacesInPath: "/invalid path/with spaces",
7533
+ specialCharacter1: "/path/with|invalid>characters",
7534
+ specialCharacter2: "/path/with<invalid*characters",
7535
+ specialCharacter3: "/path/{invalid}?characters",
7536
+ consecutiveSlashes: "/path//with///too/many/slashes",
7537
+ unencodedPercent: "/path/with/unencoded%percent",
7538
+ unencodedSpaces: "/path/with unencoded spaces",
7539
+ fragmentIdentifier: "/path/with#fragment",
7540
+ queryParameters: "/path/with?query=parameter",
7541
+ nullCharacter: "/path/with/\0nullcharacter",
7542
+ onlySlash: "/",
7543
+ controlCharacter: "/path/with/control\0character",
7544
+ extremelyLongPath: "/" + "a".repeat(2047),
7545
+ invalidStartCharacter: "///path/starting/with/slashes",
7546
+ invalidStartCharacterColon: ":/path/starting/with/colon",
7547
+ invalidTrailingDot: "/path/ending/with/dot.",
7548
+ invalidPercentEncoding1: "/path/with/%2",
7549
+ invalidPercentEncoding2: "/path/with/%ZZ",
7550
+ invalidPercentEncoding3: "/path/with/%G1",
7551
+ reservedCharacter1: "/path/with?<reserved>",
7552
+ reservedCharacter2: '/path/with/"quotes"',
7553
+ reservedCharacter3: "/path/with/[brackets]",
7554
+ reservedCharacter4: "/path/with/\\backslashes",
7555
+ nonAscii1: "/path/with/\u4F60\u597D",
7556
+ nonAscii2: "/path/with/emoji/\u{1F603}",
7557
+ mixedEncodingPath: "/path/%41A%42B%C3%28",
7558
+ directoryTraversal1: "/path/../../etc/passwd",
7559
+ directoryTraversal2: "/path/./././"
7560
+ };
7561
+ function isValidRedirectPath(path) {
7562
+ const trimmedPath = path.toLowerCase().trim();
7563
+ const url = "https://www.example.com" + trimmedPath;
7564
+ if (url.length > 2048) {
7565
+ return {
7566
+ isValid: false,
7567
+ reason: "TooLong"
7568
+ };
7569
+ }
7570
+ if (trimmedPath === "") {
7571
+ return {
7572
+ isValid: false,
7573
+ reason: "Empty"
7574
+ };
7575
+ }
7576
+ if (url === "/") {
7577
+ return {
7578
+ isValid: false,
7579
+ reason: "Empty"
7580
+ };
7581
+ }
7582
+ if (url.includes("?")) {
7583
+ return {
7584
+ isValid: false,
7585
+ reason: "ContainsQuery"
7586
+ };
7587
+ }
7588
+ if (url.includes("#")) {
7589
+ return {
7590
+ isValid: false,
7591
+ reason: "ContainsFragment"
7592
+ };
7593
+ }
7594
+ const regex = /^\/[A-Za-z0-9_-]+(\/[A-Za-z0-9_-]+)*$/;
7595
+ const isValid = regex.test(trimmedPath);
7596
+ return {
7597
+ isValid: regex.test(trimmedPath),
7598
+ reason: !isValid ? "InvalidURI" : void 0
7599
+ };
7600
+ }
7601
+
7515
7602
  // src/api/endpoints/codegen/exporters.ts
7516
7603
  var ExportersEndpoint = class {
7517
7604
  constructor(requestExecutor) {
@@ -13508,6 +13595,8 @@ export {
13508
13595
  DTODocumentationPageSnapshot,
13509
13596
  DTODocumentationPageUpdateActionInputV2,
13510
13597
  DTODocumentationPageUpdateActionOutputV2,
13598
+ DTODocumentationPageUpdateDocumentActionInputV2,
13599
+ DTODocumentationPageUpdateDocumentActionOutputV2,
13511
13600
  DTODocumentationPageV2,
13512
13601
  DTODocumentationPublishMetadata,
13513
13602
  DTODocumentationPublishTypeQueryParams,
@@ -13659,6 +13748,7 @@ export {
13659
13748
  DTOTokenCollectionsListReponse,
13660
13749
  DTOTransferOwnershipPayload,
13661
13750
  DTOUpdateDocumentationGroupInput,
13751
+ DTOUpdateDocumentationPageDocumentInputV2,
13662
13752
  DTOUpdateDocumentationPageInputV2,
13663
13753
  DTOUpdateUserNotificationSettingsPayload,
13664
13754
  DTOUpdateVersionInput,
@@ -13766,6 +13856,7 @@ export {
13766
13856
  elementGroupsToDocumentationGroupFixedConfigurationDTOV1,
13767
13857
  elementGroupsToDocumentationGroupFixedConfigurationDTOV2,
13768
13858
  elementGroupsToDocumentationGroupStructureDTOV1,
13859
+ exhaustiveInvalidUriPaths,
13769
13860
  generateHash,
13770
13861
  generatePageContentHash,
13771
13862
  getDtoDefaultItemConfigurationV1,
@@ -13778,6 +13869,7 @@ export {
13778
13869
  innerEditorProsemirrorSchema,
13779
13870
  integrationCredentialToDto,
13780
13871
  integrationToDto,
13872
+ isValidRedirectPath,
13781
13873
  itemConfigurationToYjs,
13782
13874
  mainEditorProsemirrorSchema,
13783
13875
  pageToProsemirrorDoc,