@supernova-studio/client 0.59.17 → 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.d.mts +38 -1
- package/dist/index.d.ts +38 -1
- package/dist/index.js +76 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +75 -0
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
- package/src/utils/index.ts +1 -0
- package/src/utils/redirect-validation.ts +76 -0
package/dist/index.mjs
CHANGED
|
@@ -7512,6 +7512,79 @@ function serializeQuery(query) {
|
|
|
7512
7512
|
return new URLSearchParams(queryWithStrings);
|
|
7513
7513
|
}
|
|
7514
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
|
+
|
|
7515
7588
|
// src/api/endpoints/codegen/exporters.ts
|
|
7516
7589
|
var ExportersEndpoint = class {
|
|
7517
7590
|
constructor(requestExecutor) {
|
|
@@ -13766,6 +13839,7 @@ export {
|
|
|
13766
13839
|
elementGroupsToDocumentationGroupFixedConfigurationDTOV1,
|
|
13767
13840
|
elementGroupsToDocumentationGroupFixedConfigurationDTOV2,
|
|
13768
13841
|
elementGroupsToDocumentationGroupStructureDTOV1,
|
|
13842
|
+
exhaustiveInvalidUriPaths,
|
|
13769
13843
|
generateHash,
|
|
13770
13844
|
generatePageContentHash,
|
|
13771
13845
|
getDtoDefaultItemConfigurationV1,
|
|
@@ -13778,6 +13852,7 @@ export {
|
|
|
13778
13852
|
innerEditorProsemirrorSchema,
|
|
13779
13853
|
integrationCredentialToDto,
|
|
13780
13854
|
integrationToDto,
|
|
13855
|
+
isValidRedirectPath,
|
|
13781
13856
|
itemConfigurationToYjs,
|
|
13782
13857
|
mainEditorProsemirrorSchema,
|
|
13783
13858
|
pageToProsemirrorDoc,
|