@scalar/snippetz 0.2.7 → 0.2.8
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/_virtual/client.js +133 -0
- package/dist/_virtual/client10.js +121 -0
- package/dist/_virtual/client11.js +128 -0
- package/dist/_virtual/client12.js +64 -0
- package/dist/_virtual/client13.js +128 -0
- package/dist/_virtual/client14.js +71 -0
- package/dist/_virtual/client15.js +81 -0
- package/dist/_virtual/client16.js +76 -0
- package/dist/_virtual/client17.js +81 -0
- package/dist/_virtual/client18.js +87 -0
- package/dist/_virtual/client19.js +45 -0
- package/dist/_virtual/client2.js +52 -0
- package/dist/_virtual/client20.js +44 -0
- package/dist/_virtual/client21.js +71 -0
- package/dist/_virtual/client22.js +45 -0
- package/dist/_virtual/client23.js +71 -0
- package/dist/_virtual/client24.js +122 -0
- package/dist/_virtual/client25.js +37 -0
- package/dist/_virtual/client26.js +154 -0
- package/dist/_virtual/client27.js +181 -0
- package/dist/_virtual/client28.js +43 -0
- package/dist/_virtual/client3.js +113 -0
- package/dist/_virtual/client4.js +70 -0
- package/dist/_virtual/client5.js +123 -0
- package/dist/_virtual/client6.js +166 -0
- package/dist/_virtual/client7.js +91 -0
- package/dist/_virtual/client8.js +13 -0
- package/dist/_virtual/client9.js +13 -0
- package/dist/core/utils/convertWithHttpSnippetLite.d.ts +1 -1
- package/dist/core/utils/convertWithHttpSnippetLite.d.ts.map +1 -1
- package/dist/httpsnippet-lite/dist/esm/helpers/code-builder.js +60 -0
- package/dist/httpsnippet-lite/dist/esm/helpers/escape.js +72 -0
- package/dist/httpsnippet-lite/dist/esm/helpers/headers.js +20 -0
- package/dist/httpsnippet-lite/dist/esm/helpers/shell.js +16 -0
- package/dist/httpsnippet-lite/dist/esm/targets/objc/helpers.js +56 -0
- package/dist/httpsnippet-lite/dist/esm/targets/php/helpers.js +35 -0
- package/dist/httpsnippet-lite/dist/esm/targets/powershell/common.js +51 -0
- package/dist/httpsnippet-lite/dist/esm/targets/python/helpers.js +61 -0
- package/dist/httpsnippet-lite/dist/esm/targets/swift/helpers.js +74 -0
- package/dist/plugins/c/libcurl/libcurl.js +1 -1
- package/dist/plugins/clojure/clj_http/clj_http.js +1 -1
- package/dist/plugins/csharp/httpclient/httpclient.js +1 -1
- package/dist/plugins/csharp/restsharp/restsharp.js +1 -1
- package/dist/plugins/go/native/native.js +1 -1
- package/dist/plugins/http/http11/http11.js +1 -1
- package/dist/plugins/java/asynchttp/asynchttp.js +1 -1
- package/dist/plugins/java/nethttp/nethttp.js +1 -1
- package/dist/plugins/java/okhttp/okhttp.js +1 -1
- package/dist/plugins/java/unirest/unirest.js +1 -1
- package/dist/plugins/js/axios/axios.js +1 -1
- package/dist/plugins/js/jquery/jquery.js +1 -1
- package/dist/plugins/js/xhr/xhr.js +1 -1
- package/dist/plugins/kotlin/okhttp/okhttp.js +1 -1
- package/dist/plugins/node/axios/axios.js +1 -1
- package/dist/plugins/objc/nsurlsession/nsurlsession.js +1 -1
- package/dist/plugins/ocaml/cohttp/cohttp.js +1 -1
- package/dist/plugins/php/curl/curl.js +1 -1
- package/dist/plugins/php/guzzle/guzzle.js +1 -1
- package/dist/plugins/powershell/restmethod/restmethod.js +1 -1
- package/dist/plugins/powershell/webrequest/webrequest.js +1 -1
- package/dist/plugins/python/python3/python3.js +1 -1
- package/dist/plugins/python/requests/requests.js +1 -1
- package/dist/plugins/r/httr/httr.js +1 -1
- package/dist/plugins/ruby/native/native.js +1 -1
- package/dist/plugins/shell/httpie/httpie.js +1 -1
- package/dist/plugins/shell/wget/wget.js +1 -1
- package/dist/plugins/swift/nsurlsession/nsurlsession.js +1 -1
- package/package.json +1 -2
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a string corresponding to a valid declaration and initialization of an Objective-C object literal.
|
|
3
|
+
*
|
|
4
|
+
* @param nsClass Class of the litteral
|
|
5
|
+
* @param name Desired name of the instance
|
|
6
|
+
* @param parameters Key-value object of parameters to translate to an Objective-C object litearal
|
|
7
|
+
* @param indent If true, will declare the litteral by indenting each new key/value pair.
|
|
8
|
+
* @return A valid Objective-C declaration and initialization of an Objective-C object litteral.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* nsDeclaration('NSDictionary', 'params', {a: 'b', c: 'd'}, true)
|
|
12
|
+
* // returns:
|
|
13
|
+
* NSDictionary *params = @{ @"a": @"b",
|
|
14
|
+
* @"c": @"d" };
|
|
15
|
+
*
|
|
16
|
+
* nsDeclaration('NSDictionary', 'params', {a: 'b', c: 'd'})
|
|
17
|
+
* // returns:
|
|
18
|
+
* NSDictionary *params = @{ @"a": @"b", @"c": @"d" };
|
|
19
|
+
*/
|
|
20
|
+
const nsDeclaration = (nsClass, name, parameters, indent) => {
|
|
21
|
+
const opening = `${nsClass} *${name} = `;
|
|
22
|
+
const literal = literalRepresentation(parameters, indent ? opening.length : undefined);
|
|
23
|
+
return `${opening}${literal};`;
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
26
|
+
* Create a valid Objective-C string of a literal value according to its type.
|
|
27
|
+
*
|
|
28
|
+
* @param value Any JavaScript literal
|
|
29
|
+
*/
|
|
30
|
+
const literalRepresentation = (value, indentation) => {
|
|
31
|
+
const join = indentation === undefined ? ', ' : `,\n ${' '.repeat(indentation)}`;
|
|
32
|
+
switch (Object.prototype.toString.call(value)) {
|
|
33
|
+
case '[object Number]':
|
|
34
|
+
return `@${value}`;
|
|
35
|
+
case '[object Array]': {
|
|
36
|
+
const valuesRepresentation = value.map((value) => literalRepresentation(value));
|
|
37
|
+
return `@[ ${valuesRepresentation.join(join)} ]`;
|
|
38
|
+
}
|
|
39
|
+
case '[object Object]': {
|
|
40
|
+
const keyValuePairs = [];
|
|
41
|
+
for (const key in value) {
|
|
42
|
+
keyValuePairs.push(`@"${key}": ${literalRepresentation(value[key])}`);
|
|
43
|
+
}
|
|
44
|
+
return `@{ ${keyValuePairs.join(join)} }`;
|
|
45
|
+
}
|
|
46
|
+
case '[object Boolean]':
|
|
47
|
+
return value ? '@YES' : '@NO';
|
|
48
|
+
default:
|
|
49
|
+
if (value === null || value === undefined) {
|
|
50
|
+
return '';
|
|
51
|
+
}
|
|
52
|
+
return `@"${value.toString().replace(/"/g, '\\"')}"`;
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export { literalRepresentation, nsDeclaration };
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import { escapeString } from '../../helpers/escape.js';
|
|
2
|
+
|
|
3
|
+
const convertType = (obj, indent, lastIndent) => {
|
|
4
|
+
lastIndent = lastIndent || '';
|
|
5
|
+
indent = indent || '';
|
|
6
|
+
switch (Object.prototype.toString.call(obj)) {
|
|
7
|
+
case '[object Null]':
|
|
8
|
+
return 'null';
|
|
9
|
+
case '[object Undefined]':
|
|
10
|
+
return 'null';
|
|
11
|
+
case '[object String]':
|
|
12
|
+
return `'${escapeString(obj, { delimiter: "'", escapeNewlines: false })}'`;
|
|
13
|
+
case '[object Number]':
|
|
14
|
+
return obj.toString();
|
|
15
|
+
case '[object Array]': {
|
|
16
|
+
const contents = obj
|
|
17
|
+
.map((item) => convertType(item, `${indent}${indent}`, indent))
|
|
18
|
+
.join(`,\n${indent}`);
|
|
19
|
+
return `[\n${indent}${contents}\n${lastIndent}]`;
|
|
20
|
+
}
|
|
21
|
+
case '[object Object]': {
|
|
22
|
+
const result = [];
|
|
23
|
+
for (const i in obj) {
|
|
24
|
+
if (Object.prototype.hasOwnProperty.call(obj, i)) {
|
|
25
|
+
result.push(`${convertType(i, indent)} => ${convertType(obj[i], `${indent}${indent}`, indent)}`);
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
return `[\n${indent}${result.join(`,\n${indent}`)}\n${lastIndent}]`;
|
|
29
|
+
}
|
|
30
|
+
default:
|
|
31
|
+
return 'null';
|
|
32
|
+
}
|
|
33
|
+
};
|
|
34
|
+
|
|
35
|
+
export { convertType };
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { CodeBuilder } from '../../helpers/code-builder.js';
|
|
2
|
+
import { escapeString } from '../../helpers/escape.js';
|
|
3
|
+
import { getHeader } from '../../helpers/headers.js';
|
|
4
|
+
|
|
5
|
+
const generatePowershellConvert = (command) => {
|
|
6
|
+
const convert = ({ method, headersObj, cookies, uriObj, fullUrl, postData, allHeaders, }) => {
|
|
7
|
+
const { push, join } = new CodeBuilder();
|
|
8
|
+
const methods = ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'HEAD', 'OPTIONS'];
|
|
9
|
+
if (!methods.includes(method.toUpperCase())) {
|
|
10
|
+
return 'Method not supported';
|
|
11
|
+
}
|
|
12
|
+
const commandOptions = [];
|
|
13
|
+
// Add headers, including the cookies
|
|
14
|
+
const headers = Object.keys(headersObj);
|
|
15
|
+
// construct headers
|
|
16
|
+
if (headers.length) {
|
|
17
|
+
push('$headers=@{}');
|
|
18
|
+
headers.forEach(key => {
|
|
19
|
+
if (key !== 'connection') {
|
|
20
|
+
// Not allowed
|
|
21
|
+
push(`$headers.Add("${key}", "${escapeString(headersObj[key], { escapeChar: '`' })}")`);
|
|
22
|
+
}
|
|
23
|
+
});
|
|
24
|
+
commandOptions.push('-Headers $headers');
|
|
25
|
+
}
|
|
26
|
+
// construct cookies
|
|
27
|
+
if (cookies.length) {
|
|
28
|
+
push('$session = New-Object Microsoft.PowerShell.Commands.WebRequestSession');
|
|
29
|
+
cookies.forEach(cookie => {
|
|
30
|
+
push('$cookie = New-Object System.Net.Cookie');
|
|
31
|
+
push(`$cookie.Name = '${cookie.name}'`);
|
|
32
|
+
push(`$cookie.Value = '${cookie.value}'`);
|
|
33
|
+
push(`$cookie.Domain = '${uriObj.host}'`);
|
|
34
|
+
push('$session.Cookies.Add($cookie)');
|
|
35
|
+
});
|
|
36
|
+
commandOptions.push('-WebSession $session');
|
|
37
|
+
}
|
|
38
|
+
if (postData === null || postData === void 0 ? void 0 : postData.text) {
|
|
39
|
+
commandOptions.push(`-ContentType '${escapeString(getHeader(allHeaders, 'content-type'), {
|
|
40
|
+
delimiter: "'",
|
|
41
|
+
escapeChar: '`',
|
|
42
|
+
})}'`);
|
|
43
|
+
commandOptions.push(`-Body '${postData.text}'`);
|
|
44
|
+
}
|
|
45
|
+
push(`$response = ${command} -Uri '${fullUrl}' -Method ${method} ${commandOptions.join(' ')}`);
|
|
46
|
+
return join();
|
|
47
|
+
};
|
|
48
|
+
return convert;
|
|
49
|
+
};
|
|
50
|
+
|
|
51
|
+
export { generatePowershellConvert };
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create a string corresponding to a Dictionary or Array literal representation with pretty option
|
|
3
|
+
* and indentation.
|
|
4
|
+
*/
|
|
5
|
+
function concatValues(concatType, values, pretty, indentation, indentLevel) {
|
|
6
|
+
const currentIndent = indentation.repeat(indentLevel);
|
|
7
|
+
const closingBraceIndent = indentation.repeat(indentLevel - 1);
|
|
8
|
+
const join = pretty ? `,\n${currentIndent}` : ', ';
|
|
9
|
+
const openingBrace = concatType === 'object' ? '{' : '[';
|
|
10
|
+
const closingBrace = concatType === 'object' ? '}' : ']';
|
|
11
|
+
if (pretty) {
|
|
12
|
+
return `${openingBrace}\n${currentIndent}${values.join(join)}\n${closingBraceIndent}${closingBrace}`;
|
|
13
|
+
}
|
|
14
|
+
if (concatType === 'object' && values.length > 0) {
|
|
15
|
+
return `${openingBrace} ${values.join(join)} ${closingBrace}`;
|
|
16
|
+
}
|
|
17
|
+
return `${openingBrace}${values.join(join)}${closingBrace}`;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Create a valid Python string of a literal value according to its type.
|
|
21
|
+
*
|
|
22
|
+
* @param {*} value Any JavaScript literal
|
|
23
|
+
* @param {Object} opts Target options
|
|
24
|
+
* @return {string}
|
|
25
|
+
*/
|
|
26
|
+
const literalRepresentation = (value, opts, indentLevel) => {
|
|
27
|
+
indentLevel = indentLevel === undefined ? 1 : indentLevel + 1;
|
|
28
|
+
switch (Object.prototype.toString.call(value)) {
|
|
29
|
+
case '[object Number]':
|
|
30
|
+
return value;
|
|
31
|
+
case '[object Array]': {
|
|
32
|
+
let pretty = false;
|
|
33
|
+
const valuesRepresentation = value.map(v => {
|
|
34
|
+
// Switch to prettify if the value is a dictionary with multiple keys
|
|
35
|
+
if (Object.prototype.toString.call(v) === '[object Object]') {
|
|
36
|
+
pretty = Object.keys(v).length > 1;
|
|
37
|
+
}
|
|
38
|
+
return literalRepresentation(v, opts, indentLevel);
|
|
39
|
+
});
|
|
40
|
+
return concatValues('array', valuesRepresentation, pretty, opts.indent, indentLevel);
|
|
41
|
+
}
|
|
42
|
+
case '[object Object]': {
|
|
43
|
+
const keyValuePairs = [];
|
|
44
|
+
for (const key in value) {
|
|
45
|
+
keyValuePairs.push(`"${key}": ${literalRepresentation(value[key], opts, indentLevel)}`);
|
|
46
|
+
}
|
|
47
|
+
return concatValues('object', keyValuePairs, opts.pretty && keyValuePairs.length > 1, opts.indent, indentLevel);
|
|
48
|
+
}
|
|
49
|
+
case '[object Null]':
|
|
50
|
+
return 'None';
|
|
51
|
+
case '[object Boolean]':
|
|
52
|
+
return value ? 'True' : 'False';
|
|
53
|
+
default:
|
|
54
|
+
if (value === null || value === undefined) {
|
|
55
|
+
return '';
|
|
56
|
+
}
|
|
57
|
+
return `"${value.toString().replace(/"/g, '\\"')}"`;
|
|
58
|
+
}
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export { literalRepresentation };
|
|
@@ -0,0 +1,74 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Create an string of given length filled with blank spaces
|
|
3
|
+
*
|
|
4
|
+
* @param length Length of the array to return
|
|
5
|
+
* @param str String to pad out with
|
|
6
|
+
*/
|
|
7
|
+
const buildString = (length, str) => str.repeat(length);
|
|
8
|
+
/**
|
|
9
|
+
* Create a string corresponding to a Dictionary or Array literal representation with pretty option and indentation.
|
|
10
|
+
*/
|
|
11
|
+
const concatArray = (arr, pretty, indentation, indentLevel) => {
|
|
12
|
+
const currentIndent = buildString(indentLevel, indentation);
|
|
13
|
+
const closingBraceIndent = buildString(indentLevel - 1, indentation);
|
|
14
|
+
const join = pretty ? `,\n${currentIndent}` : ', ';
|
|
15
|
+
if (pretty) {
|
|
16
|
+
return `[\n${currentIndent}${arr.join(join)}\n${closingBraceIndent}]`;
|
|
17
|
+
}
|
|
18
|
+
return `[${arr.join(join)}]`;
|
|
19
|
+
};
|
|
20
|
+
/**
|
|
21
|
+
* Create a string corresponding to a valid declaration and initialization of a Swift array or dictionary literal
|
|
22
|
+
*
|
|
23
|
+
* @param name Desired name of the instance
|
|
24
|
+
* @param parameters Key-value object of parameters to translate to a Swift object litearal
|
|
25
|
+
* @param opts Target options
|
|
26
|
+
* @return {string}
|
|
27
|
+
*/
|
|
28
|
+
const literalDeclaration = (name, parameters, opts) => `let ${name} = ${literalRepresentation(parameters, opts)}`;
|
|
29
|
+
/**
|
|
30
|
+
* Create a valid Swift string of a literal value according to its type.
|
|
31
|
+
*
|
|
32
|
+
* @param value Any JavaScript literal
|
|
33
|
+
* @param opts Target options
|
|
34
|
+
*/
|
|
35
|
+
const literalRepresentation = (value, opts, indentLevel) => {
|
|
36
|
+
indentLevel = indentLevel === undefined ? 1 : indentLevel + 1;
|
|
37
|
+
switch (Object.prototype.toString.call(value)) {
|
|
38
|
+
case '[object Number]':
|
|
39
|
+
return value;
|
|
40
|
+
case '[object Array]': {
|
|
41
|
+
// Don't prettify arrays nto not take too much space
|
|
42
|
+
let pretty = false;
|
|
43
|
+
const valuesRepresentation = value.map((v) => {
|
|
44
|
+
// Switch to prettify if the value is a dictionary with multiple keys
|
|
45
|
+
if (Object.prototype.toString.call(v) === '[object Object]') {
|
|
46
|
+
pretty = Object.keys(v).length > 1;
|
|
47
|
+
}
|
|
48
|
+
return literalRepresentation(v, opts, indentLevel);
|
|
49
|
+
});
|
|
50
|
+
// @ts-expect-error needs better types
|
|
51
|
+
return concatArray(valuesRepresentation, pretty, opts.indent, indentLevel);
|
|
52
|
+
}
|
|
53
|
+
case '[object Object]': {
|
|
54
|
+
const keyValuePairs = [];
|
|
55
|
+
for (const key in value) {
|
|
56
|
+
keyValuePairs.push(`"${key}": ${literalRepresentation(value[key], opts, indentLevel)}`);
|
|
57
|
+
}
|
|
58
|
+
return concatArray(keyValuePairs,
|
|
59
|
+
// @ts-expect-error needs better types
|
|
60
|
+
opts.pretty && keyValuePairs.length > 1,
|
|
61
|
+
// @ts-expect-error needs better types
|
|
62
|
+
opts.indent, indentLevel);
|
|
63
|
+
}
|
|
64
|
+
case '[object Boolean]':
|
|
65
|
+
return value.toString();
|
|
66
|
+
default:
|
|
67
|
+
if (value === null || value === undefined) {
|
|
68
|
+
return '';
|
|
69
|
+
}
|
|
70
|
+
return `"${value.toString().replace(/"/g, '\\"')}"`;
|
|
71
|
+
}
|
|
72
|
+
};
|
|
73
|
+
|
|
74
|
+
export { literalDeclaration, literalRepresentation };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { libcurl } from '
|
|
2
|
+
import { libcurl } from '../../../_virtual/client28.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* c/libcurl
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { clj_http } from '
|
|
2
|
+
import { clj_http } from '../../../_virtual/client27.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* clojure/clj_http
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { httpclient } from '
|
|
2
|
+
import { httpclient } from '../../../_virtual/client26.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* csharp/httpclient
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { restsharp } from '
|
|
2
|
+
import { restsharp } from '../../../_virtual/client25.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* csharp/restsharp
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { native } from '
|
|
2
|
+
import { native } from '../../../_virtual/client24.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* go/native
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { http11 } from '
|
|
2
|
+
import { http11 } from '../../../_virtual/client23.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* http/http1.1
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { asynchttp } from '
|
|
2
|
+
import { asynchttp } from '../../../_virtual/client22.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* java/asynchttp
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { nethttp } from '
|
|
2
|
+
import { nethttp } from '../../../_virtual/client20.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* java/nethttp
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { okhttp } from '
|
|
2
|
+
import { okhttp } from '../../../_virtual/client21.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* java/okhttp
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { unirest } from '
|
|
2
|
+
import { unirest } from '../../../_virtual/client19.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* java/unirest
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { axios } from '
|
|
2
|
+
import { axios } from '../../../_virtual/client18.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* js/axios
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { jquery } from '
|
|
2
|
+
import { jquery } from '../../../_virtual/client17.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* js/jquery
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { xhr } from '
|
|
2
|
+
import { xhr } from '../../../_virtual/client15.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* js/xhr
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { okhttp } from '
|
|
2
|
+
import { okhttp } from '../../../_virtual/client14.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* kotlin/okhttp
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { axios } from '
|
|
2
|
+
import { axios } from '../../../_virtual/client16.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* node/axios
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { nsurlsession } from '
|
|
2
|
+
import { nsurlsession } from '../../../_virtual/client13.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* objc/nsurlsession
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { cohttp } from '
|
|
2
|
+
import { cohttp } from '../../../_virtual/client12.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* ocaml/cohttp
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { curl } from '
|
|
2
|
+
import { curl } from '../../../_virtual/client11.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* php/curl
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { guzzle } from '
|
|
2
|
+
import { guzzle } from '../../../_virtual/client10.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* php/guzzle
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { restmethod } from '
|
|
2
|
+
import { restmethod } from '../../../_virtual/client9.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* powershell/restmethod
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { webrequest } from '
|
|
2
|
+
import { webrequest } from '../../../_virtual/client8.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* powershell/webrequest
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { python3 } from '
|
|
2
|
+
import { python3 } from '../../../_virtual/client7.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* python/python3
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { requests } from '
|
|
2
|
+
import { requests } from '../../../_virtual/client6.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* python/requests
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { httr } from '
|
|
2
|
+
import { httr } from '../../../_virtual/client5.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* r/httr
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { native } from '
|
|
2
|
+
import { native } from '../../../_virtual/client4.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* ruby/native
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { httpie } from '
|
|
2
|
+
import { httpie } from '../../../_virtual/client3.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* shell/httpie
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { wget } from '
|
|
2
|
+
import { wget } from '../../../_virtual/client2.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* shell/wget
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { convertWithHttpSnippetLite } from '../../../core/utils/convertWithHttpSnippetLite.js';
|
|
2
|
-
import { nsurlsession } from '
|
|
2
|
+
import { nsurlsession } from '../../../_virtual/client.js';
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* swift/nsurlsession
|
package/package.json
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
"url": "https://github.com/scalar/scalar.git",
|
|
10
10
|
"directory": "packages/snippetz"
|
|
11
11
|
},
|
|
12
|
-
"version": "0.2.
|
|
12
|
+
"version": "0.2.8",
|
|
13
13
|
"engines": {
|
|
14
14
|
"node": ">=18"
|
|
15
15
|
},
|
|
@@ -203,7 +203,6 @@
|
|
|
203
203
|
],
|
|
204
204
|
"module": "./dist/index.js",
|
|
205
205
|
"dependencies": {
|
|
206
|
-
"httpsnippet-lite": "^3.0.5",
|
|
207
206
|
"stringify-object": "^5.0.0"
|
|
208
207
|
},
|
|
209
208
|
"devDependencies": {
|