@supernova-studio/client 0.59.16 → 0.59.18

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
@@ -4326,6 +4326,15 @@ var ExportDestinationsMap = z148.object({
4326
4326
  destinationGitlab: ExporterDestinationGitlab.optional(),
4327
4327
  destinationBitbucket: ExporterDestinationBitbucket.optional()
4328
4328
  });
4329
+ var ExportDestinationsMapUpdate = z148.object({
4330
+ webhookUrl: z148.string().nullish(),
4331
+ destinationSnDocs: ExporterDestinationDocs.nullish(),
4332
+ destinationS3: ExporterDestinationS3.nullish(),
4333
+ destinationGithub: ExporterDestinationGithub.nullish(),
4334
+ destinationAzure: ExporterDestinationAzure.nullish(),
4335
+ destinationGitlab: ExporterDestinationGitlab.nullish(),
4336
+ destinationBitbucket: ExporterDestinationBitbucket.nullish()
4337
+ });
4329
4338
  var PipelineEventType = z149.enum(["OnVersionReleased", "OnHeadChanged", "OnSourceUpdated", "None"]);
4330
4339
  var PipelineDestinationGitType = z149.enum(["Github", "Gitlab", "Bitbucket", "Azure"]);
4331
4340
  var PipelineDestinationExtraType = z149.enum(["WebhookUrl", "S3", "Documentation"]);
@@ -7503,6 +7512,79 @@ function serializeQuery(query) {
7503
7512
  return new URLSearchParams(queryWithStrings);
7504
7513
  }
7505
7514
 
7515
+ // src/utils/redirect-validation.ts
7516
+ var exhaustiveInvalidUriPaths = {
7517
+ emptyPath: "",
7518
+ spacesInPath: "/invalid path/with spaces",
7519
+ specialCharacter1: "/path/with|invalid>characters",
7520
+ specialCharacter2: "/path/with<invalid*characters",
7521
+ specialCharacter3: "/path/{invalid}?characters",
7522
+ consecutiveSlashes: "/path//with///too/many/slashes",
7523
+ unencodedPercent: "/path/with/unencoded%percent",
7524
+ unencodedSpaces: "/path/with unencoded spaces",
7525
+ fragmentIdentifier: "/path/with#fragment",
7526
+ queryParameters: "/path/with?query=parameter",
7527
+ nullCharacter: "/path/with/\0nullcharacter",
7528
+ onlySlash: "/",
7529
+ controlCharacter: "/path/with/control\0character",
7530
+ extremelyLongPath: "/" + "a".repeat(2047),
7531
+ invalidStartCharacter: "///path/starting/with/slashes",
7532
+ invalidStartCharacterColon: ":/path/starting/with/colon",
7533
+ invalidTrailingDot: "/path/ending/with/dot.",
7534
+ invalidPercentEncoding1: "/path/with/%2",
7535
+ invalidPercentEncoding2: "/path/with/%ZZ",
7536
+ invalidPercentEncoding3: "/path/with/%G1",
7537
+ reservedCharacter1: "/path/with?<reserved>",
7538
+ reservedCharacter2: '/path/with/"quotes"',
7539
+ reservedCharacter3: "/path/with/[brackets]",
7540
+ reservedCharacter4: "/path/with/\\backslashes",
7541
+ nonAscii1: "/path/with/\u4F60\u597D",
7542
+ nonAscii2: "/path/with/emoji/\u{1F603}",
7543
+ mixedEncodingPath: "/path/%41A%42B%C3%28",
7544
+ directoryTraversal1: "/path/../../etc/passwd",
7545
+ directoryTraversal2: "/path/./././"
7546
+ };
7547
+ function isValidRedirectPath(path) {
7548
+ const trimmedPath = path.toLowerCase().trim();
7549
+ const url = "https://www.example.com" + trimmedPath;
7550
+ if (url.length > 2048) {
7551
+ return {
7552
+ isValid: false,
7553
+ reason: "TooLong"
7554
+ };
7555
+ }
7556
+ if (trimmedPath === "") {
7557
+ return {
7558
+ isValid: false,
7559
+ reason: "Empty"
7560
+ };
7561
+ }
7562
+ if (url === "/") {
7563
+ return {
7564
+ isValid: false,
7565
+ reason: "Empty"
7566
+ };
7567
+ }
7568
+ if (url.includes("?")) {
7569
+ return {
7570
+ isValid: false,
7571
+ reason: "ContainsQuery"
7572
+ };
7573
+ }
7574
+ if (url.includes("#")) {
7575
+ return {
7576
+ isValid: false,
7577
+ reason: "ContainsFragment"
7578
+ };
7579
+ }
7580
+ const regex = /^\/[A-Za-z0-9_-]+(\/[A-Za-z0-9_-]+)*$/;
7581
+ const isValid = regex.test(trimmedPath);
7582
+ return {
7583
+ isValid: regex.test(trimmedPath),
7584
+ reason: !isValid ? "InvalidURI" : void 0
7585
+ };
7586
+ }
7587
+
7506
7588
  // src/api/endpoints/codegen/exporters.ts
7507
7589
  var ExportersEndpoint = class {
7508
7590
  constructor(requestExecutor) {
@@ -13757,6 +13839,7 @@ export {
13757
13839
  elementGroupsToDocumentationGroupFixedConfigurationDTOV1,
13758
13840
  elementGroupsToDocumentationGroupFixedConfigurationDTOV2,
13759
13841
  elementGroupsToDocumentationGroupStructureDTOV1,
13842
+ exhaustiveInvalidUriPaths,
13760
13843
  generateHash,
13761
13844
  generatePageContentHash,
13762
13845
  getDtoDefaultItemConfigurationV1,
@@ -13769,6 +13852,7 @@ export {
13769
13852
  innerEditorProsemirrorSchema,
13770
13853
  integrationCredentialToDto,
13771
13854
  integrationToDto,
13855
+ isValidRedirectPath,
13772
13856
  itemConfigurationToYjs,
13773
13857
  mainEditorProsemirrorSchema,
13774
13858
  pageToProsemirrorDoc,