@stoplight/elements-core 9.0.0 → 9.0.2
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/index.esm.js +8 -1
- package/index.js +8 -1
- package/index.mjs +8 -1
- package/package.json +1 -1
package/index.esm.js
CHANGED
|
@@ -693,6 +693,7 @@ const persistAtom = (key, atomInstance) => {
|
|
|
693
693
|
};
|
|
694
694
|
|
|
695
695
|
const convertRequestToSample = (language, library, request) => __awaiter(void 0, void 0, void 0, function* () {
|
|
696
|
+
var _a;
|
|
696
697
|
if (!isValidTargetId(language))
|
|
697
698
|
return null;
|
|
698
699
|
try {
|
|
@@ -706,6 +707,12 @@ const convertRequestToSample = (language, library, request) => __awaiter(void 0,
|
|
|
706
707
|
}
|
|
707
708
|
if (typeof converted === 'string') {
|
|
708
709
|
converted = converted.replace(/%7B/g, '{').replace(/%7D/g, '}');
|
|
710
|
+
if (language === 'shell' && library === 'curl') {
|
|
711
|
+
const isUrlEncoded = (_a = request === null || request === void 0 ? void 0 : request.headers) === null || _a === void 0 ? void 0 : _a.some(header => header.name.toLowerCase() === 'content-type' && header.value === 'application/x-www-form-urlencoded');
|
|
712
|
+
if (isUrlEncoded) {
|
|
713
|
+
converted = converted.replace(/--data\b/g, '--data-urlencode');
|
|
714
|
+
}
|
|
715
|
+
}
|
|
709
716
|
}
|
|
710
717
|
return converted;
|
|
711
718
|
}
|
|
@@ -3971,7 +3978,7 @@ const queryClient = new QueryClient({
|
|
|
3971
3978
|
defaultOptions: {
|
|
3972
3979
|
queries: {
|
|
3973
3980
|
retry: false,
|
|
3974
|
-
staleTime:
|
|
3981
|
+
staleTime: 5 * 60 * 1000,
|
|
3975
3982
|
},
|
|
3976
3983
|
},
|
|
3977
3984
|
});
|
package/index.js
CHANGED
|
@@ -715,6 +715,7 @@ const persistAtom = (key, atomInstance) => {
|
|
|
715
715
|
};
|
|
716
716
|
|
|
717
717
|
const convertRequestToSample = (language, library, request) => tslib.__awaiter(void 0, void 0, void 0, function* () {
|
|
718
|
+
var _a;
|
|
718
719
|
if (!httpsnippetLite.isValidTargetId(language))
|
|
719
720
|
return null;
|
|
720
721
|
try {
|
|
@@ -728,6 +729,12 @@ const convertRequestToSample = (language, library, request) => tslib.__awaiter(v
|
|
|
728
729
|
}
|
|
729
730
|
if (typeof converted === 'string') {
|
|
730
731
|
converted = converted.replace(/%7B/g, '{').replace(/%7D/g, '}');
|
|
732
|
+
if (language === 'shell' && library === 'curl') {
|
|
733
|
+
const isUrlEncoded = (_a = request === null || request === void 0 ? void 0 : request.headers) === null || _a === void 0 ? void 0 : _a.some(header => header.name.toLowerCase() === 'content-type' && header.value === 'application/x-www-form-urlencoded');
|
|
734
|
+
if (isUrlEncoded) {
|
|
735
|
+
converted = converted.replace(/--data\b/g, '--data-urlencode');
|
|
736
|
+
}
|
|
737
|
+
}
|
|
731
738
|
}
|
|
732
739
|
return converted;
|
|
733
740
|
}
|
|
@@ -3993,7 +4000,7 @@ const queryClient = new reactQuery.QueryClient({
|
|
|
3993
4000
|
defaultOptions: {
|
|
3994
4001
|
queries: {
|
|
3995
4002
|
retry: false,
|
|
3996
|
-
staleTime:
|
|
4003
|
+
staleTime: 5 * 60 * 1000,
|
|
3997
4004
|
},
|
|
3998
4005
|
},
|
|
3999
4006
|
});
|
package/index.mjs
CHANGED
|
@@ -693,6 +693,7 @@ const persistAtom = (key, atomInstance) => {
|
|
|
693
693
|
};
|
|
694
694
|
|
|
695
695
|
const convertRequestToSample = (language, library, request) => __awaiter(void 0, void 0, void 0, function* () {
|
|
696
|
+
var _a;
|
|
696
697
|
if (!isValidTargetId(language))
|
|
697
698
|
return null;
|
|
698
699
|
try {
|
|
@@ -706,6 +707,12 @@ const convertRequestToSample = (language, library, request) => __awaiter(void 0,
|
|
|
706
707
|
}
|
|
707
708
|
if (typeof converted === 'string') {
|
|
708
709
|
converted = converted.replace(/%7B/g, '{').replace(/%7D/g, '}');
|
|
710
|
+
if (language === 'shell' && library === 'curl') {
|
|
711
|
+
const isUrlEncoded = (_a = request === null || request === void 0 ? void 0 : request.headers) === null || _a === void 0 ? void 0 : _a.some(header => header.name.toLowerCase() === 'content-type' && header.value === 'application/x-www-form-urlencoded');
|
|
712
|
+
if (isUrlEncoded) {
|
|
713
|
+
converted = converted.replace(/--data\b/g, '--data-urlencode');
|
|
714
|
+
}
|
|
715
|
+
}
|
|
709
716
|
}
|
|
710
717
|
return converted;
|
|
711
718
|
}
|
|
@@ -3971,7 +3978,7 @@ const queryClient = new QueryClient({
|
|
|
3971
3978
|
defaultOptions: {
|
|
3972
3979
|
queries: {
|
|
3973
3980
|
retry: false,
|
|
3974
|
-
staleTime:
|
|
3981
|
+
staleTime: 5 * 60 * 1000,
|
|
3975
3982
|
},
|
|
3976
3983
|
},
|
|
3977
3984
|
});
|