@scalar/snippetz 0.5.1 → 0.5.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.
@@ -6,20 +6,6 @@ export declare const csharp: {
6
6
  default: string;
7
7
  };
8
8
  clientsById: {
9
- httpclient: {
10
- info: {
11
- key: string;
12
- title: string;
13
- link: string;
14
- description: string;
15
- };
16
- convert: ({ allHeaders, postData, method, fullUrl }: {
17
- allHeaders: any;
18
- postData: any;
19
- method: any;
20
- fullUrl: any;
21
- }, options: any) => any;
22
- };
23
9
  restsharp: {
24
10
  info: {
25
11
  key: string;
@@ -1 +1 @@
1
- {"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/esm/targets/csharp/target.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAWlB,CAAA"}
1
+ {"version":3,"file":"target.d.ts","sourceRoot":"","sources":["../../../../../src/httpsnippet-lite/esm/targets/csharp/target.ts"],"names":[],"mappings":"AAGA,eAAO,MAAM,MAAM;;;;;;;;;;;;;;;;;;;;;;;;;CAUlB,CAAA"}
@@ -1,4 +1,3 @@
1
- import { httpclient } from "./httpclient/client.js";
2
1
  import { restsharp } from "./restsharp/client.js";
3
2
  const csharp = {
4
3
  info: {
@@ -8,7 +7,6 @@ const csharp = {
8
7
  default: "restsharp"
9
8
  },
10
9
  clientsById: {
11
- httpclient,
12
10
  restsharp
13
11
  }
14
12
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../../src/httpsnippet-lite/esm/targets/csharp/target.ts"],
4
- "sourcesContent": ["// @ts-nocheck\nimport { httpclient } from './httpclient/client.js'\nimport { restsharp } from './restsharp/client.js'\n\nexport const csharp = {\n info: {\n key: 'csharp',\n title: 'C#',\n extname: '.cs',\n default: 'restsharp',\n },\n clientsById: {\n httpclient,\n restsharp,\n },\n}\n"],
5
- "mappings": "AACA,SAAS,kBAAkB;AAC3B,SAAS,iBAAiB;AAEnB,MAAM,SAAS;AAAA,EACpB,MAAM;AAAA,IACJ,KAAK;AAAA,IACL,OAAO;AAAA,IACP,SAAS;AAAA,IACT,SAAS;AAAA,EACX;AAAA,EACA,aAAa;AAAA,IACX;AAAA,IACA;AAAA,EACF;AACF;",
4
+ "sourcesContent": ["// @ts-nocheck\nimport { restsharp } from './restsharp/client.js'\n\nexport const csharp = {\n info: {\n key: 'csharp',\n title: 'C#',\n extname: '.cs',\n default: 'restsharp',\n },\n clientsById: {\n restsharp,\n },\n}\n"],
5
+ "mappings": "AACA,SAAS,iBAAiB;AAEnB,MAAM,SAAS;AAAA,EACpB,MAAM;AAAA,IACJ,KAAK;AAAA,IACL,OAAO;AAAA,IACP,SAAS;AAAA,IACT,SAAS;AAAA,EACX;AAAA,EACA,aAAa;AAAA,IACX;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
@@ -1 +1 @@
1
- {"version":3,"file":"httpclient.d.ts","sourceRoot":"","sources":["../../../../src/plugins/csharp/httpclient/httpclient.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAEpD;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MAQ9B,CAAA"}
1
+ {"version":3,"file":"httpclient.d.ts","sourceRoot":"","sources":["../../../../src/plugins/csharp/httpclient/httpclient.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAuB,MAAM,wBAAwB,CAAA;AAKzE;;GAEG;AACH,eAAO,MAAM,gBAAgB,EAAE,MA4C9B,CAAA"}
@@ -1,13 +1,166 @@
1
- import { httpclient } from "../../../httpsnippet-lite/esm/targets/csharp/httpclient/client.js";
2
- import { convertWithHttpSnippetLite } from "../../../utils/convertWithHttpSnippetLite.js";
1
+ import { encode } from "js-base64";
2
+ import { createSearchParams } from "../../../utils/create-search-params.js";
3
3
  const csharpHttpclient = {
4
4
  target: "csharp",
5
5
  client: "httpclient",
6
6
  title: "HttpClient",
7
- generate(request) {
8
- return convertWithHttpSnippetLite(httpclient, request);
7
+ generate(request, configuration) {
8
+ const normalizedRequest = {
9
+ method: "GET",
10
+ url: "",
11
+ ...request
12
+ };
13
+ normalizedRequest.method = normalizedRequest.method.toUpperCase();
14
+ const searchParams = createSearchParams(normalizedRequest.queryString);
15
+ const queryString = searchParams.size ? `?${searchParams.toString()}` : "";
16
+ const url = `${normalizedRequest.url}${queryString}`;
17
+ const lines = [];
18
+ lines.push("using var client = new HttpClient();");
19
+ lines.push("");
20
+ const httpMethod = getHttpMethod(normalizedRequest.method);
21
+ lines.push(`var request = new HttpRequestMessage(${httpMethod}, "${url}");`);
22
+ addHeadersAndAuth(lines, normalizedRequest, configuration);
23
+ addBodyContent(lines, normalizedRequest);
24
+ lines.push("");
25
+ lines.push("using var response = await client.SendAsync(request);");
26
+ return lines.join("\n");
9
27
  }
10
28
  };
29
+ function getHttpMethod(method) {
30
+ switch (method) {
31
+ case "GET":
32
+ return "HttpMethod.Get";
33
+ case "POST":
34
+ return "HttpMethod.Post";
35
+ case "PUT":
36
+ return "HttpMethod.Put";
37
+ case "DELETE":
38
+ return "HttpMethod.Delete";
39
+ case "PATCH":
40
+ return "HttpMethod.Patch";
41
+ case "HEAD":
42
+ return "HttpMethod.Head";
43
+ case "OPTIONS":
44
+ return "HttpMethod.Options";
45
+ default:
46
+ return `new HttpMethod("${method}")`;
47
+ }
48
+ }
49
+ function addHeadersAndAuth(lines, request, configuration) {
50
+ const headers = request.headers || [];
51
+ const cookies = request.cookies || [];
52
+ const authHeader = headers.find((h) => h.name.toLowerCase() === "authorization");
53
+ if (authHeader) {
54
+ const [scheme, parameter] = authHeader.value.split(" ", 2);
55
+ if (scheme && parameter) {
56
+ lines.push(`request.Headers.Authorization = new AuthenticationHeaderValue("${scheme}", "${parameter}");`);
57
+ }
58
+ } else if (configuration?.auth?.username && configuration?.auth?.password) {
59
+ const credentials = encode(`${configuration.auth.username}:${configuration.auth.password}`);
60
+ lines.push(`request.Headers.Authorization = new AuthenticationHeaderValue("Basic", "${credentials}");`);
61
+ }
62
+ const processedHeaders = /* @__PURE__ */ new Map();
63
+ for (const header of headers) {
64
+ const name = header.name;
65
+ const value = header.value;
66
+ if (name.toLowerCase() === "authorization") {
67
+ continue;
68
+ }
69
+ processedHeaders.set(name, value);
70
+ }
71
+ for (const [name, value] of processedHeaders) {
72
+ if (name.toLowerCase() === "accept" && isMediaType(value)) {
73
+ lines.push(`request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue("${value}"));`);
74
+ } else if (name.toLowerCase() === "content-type" && request.postData) {
75
+ continue;
76
+ } else {
77
+ lines.push(`request.Headers.TryAddWithoutValidation("${name}", "${value}");`);
78
+ }
79
+ }
80
+ if (cookies.length > 0) {
81
+ const cookieString = cookies.map((cookie) => `${cookie.name}=${cookie.value}`).join("; ");
82
+ lines.push(`request.Headers.TryAddWithoutValidation("Cookie", "${cookieString}");`);
83
+ }
84
+ }
85
+ function addBodyContent(lines, request) {
86
+ if (!request.postData) {
87
+ return;
88
+ }
89
+ const { mimeType, text, params } = request.postData;
90
+ if (mimeType === "application/json" && text) {
91
+ try {
92
+ const jsonData = JSON.parse(text);
93
+ const prettyJson = JSON.stringify(jsonData, null, 2);
94
+ const rawStringLiteral = createRawStringLiteral(prettyJson);
95
+ lines.push("request.Content = new StringContent(");
96
+ lines.push(`${rawStringLiteral},`);
97
+ lines.push('System.Text.Encoding.UTF8, "application/json");');
98
+ } catch {
99
+ const rawStringLiteral = createRawStringLiteral(text);
100
+ lines.push("request.Content = new StringContent(");
101
+ lines.push(`${rawStringLiteral},`);
102
+ lines.push('System.Text.Encoding.UTF8, "application/json");');
103
+ }
104
+ } else if (mimeType === "application/x-www-form-urlencoded" && params) {
105
+ const fieldNames = params.map((p) => p.name);
106
+ const hasDuplicates = fieldNames.length !== new Set(fieldNames).size;
107
+ if (hasDuplicates) {
108
+ lines.push("var formParams = new List<KeyValuePair<string, string>>");
109
+ lines.push("{");
110
+ for (const param of params) {
111
+ lines.push(` new("${param.name}", "${param.value}"),`);
112
+ }
113
+ lines.push("};");
114
+ lines.push("request.Content = new FormUrlEncodedContent(formParams);");
115
+ } else {
116
+ lines.push("var formParams = new Dictionary<string, string>");
117
+ lines.push("{");
118
+ for (const param of params) {
119
+ lines.push(` ["${param.name}"] = "${param.value}",`);
120
+ }
121
+ lines.push("};");
122
+ lines.push("request.Content = new FormUrlEncodedContent(formParams);");
123
+ }
124
+ } else if (mimeType === "multipart/form-data" && params) {
125
+ lines.push("var content = new MultipartFormDataContent();");
126
+ for (const param of params) {
127
+ if (param.fileName !== void 0) {
128
+ lines.push(
129
+ `content.Add(new StreamContent(File.OpenRead("${param.fileName}")), "${param.name}", "${param.fileName}");`
130
+ );
131
+ } else {
132
+ lines.push(`content.Add(new StringContent("${param.value}"), "${param.name}");`);
133
+ }
134
+ }
135
+ lines.push("request.Content = content;");
136
+ } else if (mimeType === "application/octet-stream" && text) {
137
+ lines.push(
138
+ 'var content = new ByteArrayContent(System.Text.Encoding.UTF8.GetBytes("' + text.replace(/"/g, '\\"') + '"));'
139
+ );
140
+ lines.push('content.Headers.ContentType = new MediaTypeHeaderValue("application/octet-stream");');
141
+ lines.push("request.Content = content;");
142
+ } else if (text) {
143
+ const rawStringLiteral = createRawStringLiteral(text);
144
+ lines.push("request.Content = new StringContent(");
145
+ lines.push(`${rawStringLiteral},`);
146
+ lines.push(`System.Text.Encoding.UTF8, "${mimeType}");`);
147
+ }
148
+ }
149
+ function createRawStringLiteral(text) {
150
+ let quoteCount = 3;
151
+ while (text.includes('"'.repeat(quoteCount))) {
152
+ quoteCount++;
153
+ }
154
+ const quotes = '"'.repeat(quoteCount);
155
+ return `${quotes}
156
+ ${text}
157
+ ${quotes}`;
158
+ }
159
+ function isMediaType(value) {
160
+ return /^[a-zA-Z0-9][a-zA-Z0-9!#$&\-\^_]*\/[a-zA-Z0-9][a-zA-Z0-9!#$&\-\^_]*(\s*;\s*[a-zA-Z0-9][a-zA-Z0-9!#$&\-\^_]*=.*)?$/.test(
161
+ value
162
+ );
163
+ }
11
164
  export {
12
165
  csharpHttpclient
13
166
  };
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../../src/plugins/csharp/httpclient/httpclient.ts"],
4
- "sourcesContent": ["import { httpclient } from '@/httpsnippet-lite/esm/targets/csharp/httpclient/client'\nimport { convertWithHttpSnippetLite } from '@/utils/convertWithHttpSnippetLite'\nimport type { Plugin } from '@scalar/types/snippetz'\n\n/**\n * csharp/httpclient\n */\nexport const csharpHttpclient: Plugin = {\n target: 'csharp',\n client: 'httpclient',\n title: 'HttpClient',\n generate(request) {\n // TODO: Write an own converter\n return convertWithHttpSnippetLite(httpclient, request)\n },\n}\n"],
5
- "mappings": "AAAA,SAAS,kBAAkB;AAC3B,SAAS,kCAAkC;AAMpC,MAAM,mBAA2B;AAAA,EACtC,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS,SAAS;AAEhB,WAAO,2BAA2B,YAAY,OAAO;AAAA,EACvD;AACF;",
4
+ "sourcesContent": ["import type { Plugin, PluginConfiguration } from '@scalar/types/snippetz'\nimport { encode } from 'js-base64'\n\nimport { createSearchParams } from '@/utils/create-search-params'\n\n/**\n * csharp/httpclient\n */\nexport const csharpHttpclient: Plugin = {\n target: 'csharp',\n client: 'httpclient',\n title: 'HttpClient',\n generate(request, configuration) {\n // Defaults\n const normalizedRequest = {\n method: 'GET',\n url: '',\n ...request,\n }\n\n // Normalization\n normalizedRequest.method = normalizedRequest.method.toUpperCase()\n\n // Build URL with query string\n const searchParams = createSearchParams(normalizedRequest.queryString)\n const queryString = searchParams.size ? `?${searchParams.toString()}` : ''\n\n const url = `${normalizedRequest.url}${queryString}`\n\n // Start building the snippet\n const lines: string[] = []\n\n // HttpClient declaration\n lines.push('using var client = new HttpClient();')\n lines.push('')\n\n // HttpRequestMessage\n const httpMethod = getHttpMethod(normalizedRequest.method)\n lines.push(`var request = new HttpRequestMessage(${httpMethod}, \"${url}\");`)\n\n // Headers and auth\n addHeadersAndAuth(lines, normalizedRequest, configuration)\n\n // Body content\n addBodyContent(lines, normalizedRequest)\n\n // Send request and read response\n lines.push('')\n lines.push('using var response = await client.SendAsync(request);')\n\n return lines.join('\\n')\n },\n}\n\n/**\n * Convert HTTP method to HttpMethod constant\n */\nfunction getHttpMethod(method: string): string {\n switch (method) {\n case 'GET':\n return 'HttpMethod.Get'\n case 'POST':\n return 'HttpMethod.Post'\n case 'PUT':\n return 'HttpMethod.Put'\n case 'DELETE':\n return 'HttpMethod.Delete'\n case 'PATCH':\n return 'HttpMethod.Patch'\n case 'HEAD':\n return 'HttpMethod.Head'\n case 'OPTIONS':\n return 'HttpMethod.Options'\n default:\n return `new HttpMethod(\"${method}\")`\n }\n}\n\n/**\n * Add headers and authentication to the request\n */\nfunction addHeadersAndAuth(lines: string[], request: any, configuration?: PluginConfiguration): void {\n const headers = request.headers || []\n const cookies = request.cookies || []\n\n // Check for explicit Authorization header first\n const authHeader = headers.find((h: any) => h.name.toLowerCase() === 'authorization')\n\n if (authHeader) {\n const [scheme, parameter] = authHeader.value.split(' ', 2)\n if (scheme && parameter) {\n lines.push(`request.Headers.Authorization = new AuthenticationHeaderValue(\"${scheme}\", \"${parameter}\");`)\n }\n } else if (configuration?.auth?.username && configuration?.auth?.password) {\n // Use configuration auth if no explicit header\n const credentials = encode(`${configuration.auth.username}:${configuration.auth.password}`)\n lines.push(`request.Headers.Authorization = new AuthenticationHeaderValue(\"Basic\", \"${credentials}\");`)\n }\n\n // Process other headers (keep only the last value for duplicates)\n const processedHeaders = new Map<string, string>()\n for (const header of headers) {\n const name = header.name\n const value = header.value\n\n if (name.toLowerCase() === 'authorization') {\n // Already handled above\n continue\n }\n\n processedHeaders.set(name, value)\n }\n\n for (const [name, value] of processedHeaders) {\n if (name.toLowerCase() === 'accept' && isMediaType(value)) {\n lines.push(`request.Headers.Accept.Add(new MediaTypeWithQualityHeaderValue(\"${value}\"));`)\n } else if (name.toLowerCase() === 'content-type' && request.postData) {\n // Content-Type will be set on content object\n continue\n } else {\n lines.push(`request.Headers.TryAddWithoutValidation(\"${name}\", \"${value}\");`)\n }\n }\n\n // Add cookies\n if (cookies.length > 0) {\n const cookieString = cookies.map((cookie: any) => `${cookie.name}=${cookie.value}`).join('; ')\n lines.push(`request.Headers.TryAddWithoutValidation(\"Cookie\", \"${cookieString}\");`)\n }\n}\n\n/**\n * Add body content to the request\n */\nfunction addBodyContent(lines: string[], request: any): void {\n if (!request.postData) {\n return\n }\n\n const { mimeType, text, params } = request.postData\n\n if (mimeType === 'application/json' && text) {\n try {\n const jsonData = JSON.parse(text)\n const prettyJson = JSON.stringify(jsonData, null, 2)\n const rawStringLiteral = createRawStringLiteral(prettyJson)\n lines.push('request.Content = new StringContent(')\n lines.push(`${rawStringLiteral},`)\n lines.push('System.Text.Encoding.UTF8, \"application/json\");')\n } catch {\n const rawStringLiteral = createRawStringLiteral(text)\n lines.push('request.Content = new StringContent(')\n lines.push(`${rawStringLiteral},`)\n lines.push('System.Text.Encoding.UTF8, \"application/json\");')\n }\n } else if (mimeType === 'application/x-www-form-urlencoded' && params) {\n // Check for duplicate field names\n const fieldNames = params.map((p: any) => p.name)\n const hasDuplicates = fieldNames.length !== new Set(fieldNames).size\n\n if (hasDuplicates) {\n // Use List<KeyValuePair> for duplicates\n lines.push('var formParams = new List<KeyValuePair<string, string>>')\n lines.push('{')\n for (const param of params) {\n lines.push(` new(\"${param.name}\", \"${param.value}\"),`)\n }\n lines.push('};')\n lines.push('request.Content = new FormUrlEncodedContent(formParams);')\n } else {\n // Use Dictionary for clean syntax\n lines.push('var formParams = new Dictionary<string, string>')\n lines.push('{')\n for (const param of params) {\n lines.push(` [\"${param.name}\"] = \"${param.value}\",`)\n }\n lines.push('};')\n lines.push('request.Content = new FormUrlEncodedContent(formParams);')\n }\n } else if (mimeType === 'multipart/form-data' && params) {\n lines.push('var content = new MultipartFormDataContent();')\n for (const param of params) {\n if (param.fileName !== undefined) {\n lines.push(\n `content.Add(new StreamContent(File.OpenRead(\"${param.fileName}\")), \"${param.name}\", \"${param.fileName}\");`,\n )\n } else {\n lines.push(`content.Add(new StringContent(\"${param.value}\"), \"${param.name}\");`)\n }\n }\n lines.push('request.Content = content;')\n } else if (mimeType === 'application/octet-stream' && text) {\n lines.push(\n 'var content = new ByteArrayContent(System.Text.Encoding.UTF8.GetBytes(\"' + text.replace(/\"/g, '\\\\\"') + '\"));',\n )\n lines.push('content.Headers.ContentType = new MediaTypeHeaderValue(\"application/octet-stream\");')\n lines.push('request.Content = content;')\n } else if (text) {\n // Fallback for other content types\n const rawStringLiteral = createRawStringLiteral(text)\n lines.push('request.Content = new StringContent(')\n lines.push(`${rawStringLiteral},`)\n lines.push(`System.Text.Encoding.UTF8, \"${mimeType}\");`)\n }\n}\n\n/**\n * Create a C# raw string literal with minimal quote count\n */\nfunction createRawStringLiteral(text: string): string {\n // Find the minimum number of quotes needed\n let quoteCount = 3\n while (text.includes('\"'.repeat(quoteCount))) {\n quoteCount++\n }\n\n const quotes = '\"'.repeat(quoteCount)\n return `${quotes}\\n${text}\\n${quotes}`\n}\n\n/**\n * Check if a value looks like a media type\n */\nfunction isMediaType(value: string): boolean {\n return /^[a-zA-Z0-9][a-zA-Z0-9!#$&\\-\\^_]*\\/[a-zA-Z0-9][a-zA-Z0-9!#$&\\-\\^_]*(\\s*;\\s*[a-zA-Z0-9][a-zA-Z0-9!#$&\\-\\^_]*=.*)?$/.test(\n value,\n )\n}\n"],
5
+ "mappings": "AACA,SAAS,cAAc;AAEvB,SAAS,0BAA0B;AAK5B,MAAM,mBAA2B;AAAA,EACtC,QAAQ;AAAA,EACR,QAAQ;AAAA,EACR,OAAO;AAAA,EACP,SAAS,SAAS,eAAe;AAE/B,UAAM,oBAAoB;AAAA,MACxB,QAAQ;AAAA,MACR,KAAK;AAAA,MACL,GAAG;AAAA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AqF;AAChG,UAAM,KAAK,4BAA4B;AAAA,EACzC,WAAW,MAAM;AAEf,UAAM,mBAAmB,uBAAuB,IAAI;AACpD,UAAM,KAAK,sCAAsC;AACjD,UAAM,KAAK,GAAG,gBAAgB,GAAG;AACjC,UAAM,KAAK,+BAA+B,QAAQ,KAAK;AAAA,EACzD;AACF;AAKA,SAAS,uBAAuB,MAAsB;AAEpD,MAAI,aAAa;AACjB,SAAO,KAAK,SAAS,IAAI,OAAO,UAAU,CAAC,GAAG;AAC5C;AAAA,EACF;AAEA,QAAM,SAAS,IAAI,OAAO,UAAU;AACpC,SAAO,GAAG,MAAM;AAAA,EAAK,IAAI;AAAA,EAAK,MAAM;AACtC;AAKA,SAAS,YAAY,OAAwB;AAC3C,SAAO,oHAAoH;AAAA,IACzH;AAAA,EACF;AACF;",
6
6
  "names": []
7
7
  }
package/package.json CHANGED
@@ -9,7 +9,7 @@
9
9
  "url": "git+https://github.com/scalar/scalar.git",
10
10
  "directory": "packages/snippetz"
11
11
  },
12
- "version": "0.5.1",
12
+ "version": "0.5.2",
13
13
  "engines": {
14
14
  "node": ">=20"
15
15
  },
@@ -228,19 +228,21 @@
228
228
  ],
229
229
  "module": "./dist/index.js",
230
230
  "dependencies": {
231
+ "js-base64": "^3.7.8",
231
232
  "stringify-object": "^5.0.0",
232
- "@scalar/types": "0.3.2"
233
+ "@scalar/types": "0.4.0"
233
234
  },
234
235
  "devDependencies": {
235
- "vite": "7.1.5",
236
- "@scalar/build-tooling": "0.2.7"
236
+ "vite": "7.1.11",
237
+ "@scalar/build-tooling": "0.2.8"
237
238
  },
238
239
  "scripts": {
239
240
  "build": "scalar-build-esbuild",
240
241
  "generate:dotnet-enums": "vite-node scripts/generate-dotnet-enums.ts",
242
+ "generate:java-enums": "vite-node scripts/generate-java-enums.ts",
241
243
  "lint:check": "scalar-lint-check",
242
244
  "lint:fix": "scalar-lint-fix",
243
- "postbuild": "pnpm generate:dotnet-enums",
245
+ "postbuild": "pnpm generate:dotnet-enums && pnpm generate:java-enums",
244
246
  "test": "vitest",
245
247
  "types:build": "scalar-types-build",
246
248
  "types:check": "scalar-types-check"
@@ -1,15 +0,0 @@
1
- export declare const httpclient: {
2
- info: {
3
- key: string;
4
- title: string;
5
- link: string;
6
- description: string;
7
- };
8
- convert: ({ allHeaders, postData, method, fullUrl }: {
9
- allHeaders: any;
10
- postData: any;
11
- method: any;
12
- fullUrl: any;
13
- }, options: any) => any;
14
- };
15
- //# sourceMappingURL=client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../../../../../src/httpsnippet-lite/esm/targets/csharp/httpclient/client.ts"],"names":[],"mappings":"AA+BA,eAAO,MAAM,UAAU;;;;;;;;;;;;;CAoJtB,CAAA"}
@@ -1,172 +0,0 @@
1
- import { CodeBuilder } from "../../../helpers/code-builder.js";
2
- import { escapeForDoubleQuotes } from "../../../helpers/escape.js";
3
- import { getHeader } from "../../../helpers/headers.js";
4
- const getDecompressionMethods = (allHeaders) => {
5
- let acceptEncodings = getHeader(allHeaders, "accept-encoding");
6
- if (!acceptEncodings) {
7
- return [];
8
- }
9
- const supportedMethods = {
10
- gzip: "DecompressionMethods.GZip",
11
- deflate: "DecompressionMethods.Deflate"
12
- };
13
- const methods = [];
14
- if (typeof acceptEncodings === "string") {
15
- acceptEncodings = [acceptEncodings];
16
- }
17
- acceptEncodings.forEach((acceptEncoding) => {
18
- acceptEncoding.split(",").forEach((encoding) => {
19
- const match = /\s*([^;\s]+)/.exec(encoding);
20
- if (match) {
21
- const method = supportedMethods[match[1]];
22
- if (method) {
23
- methods.push(method);
24
- }
25
- }
26
- });
27
- });
28
- return methods;
29
- };
30
- const httpclient = {
31
- info: {
32
- key: "httpclient",
33
- title: "HttpClient",
34
- link: "https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient",
35
- description: ".NET Standard HTTP Client"
36
- },
37
- convert: ({ allHeaders, postData, method, fullUrl }, options) => {
38
- let _a, _b;
39
- const opts = {
40
- indent: " ",
41
- ...options
42
- };
43
- const { push, join } = new CodeBuilder({ indent: opts.indent });
44
- push("using System.Net.Http.Headers;");
45
- let clienthandler = "";
46
- const cookies = Boolean(allHeaders.cookie);
47
- const decompressionMethods = getDecompressionMethods(allHeaders);
48
- if (cookies || decompressionMethods.length) {
49
- clienthandler = "clientHandler";
50
- push("var clientHandler = new HttpClientHandler");
51
- push("{");
52
- if (cookies) {
53
- push("UseCookies = false,", 1);
54
- }
55
- if (decompressionMethods.length) {
56
- push(`AutomaticDecompression = ${decompressionMethods.join(" | ")},`, 1);
57
- }
58
- push("};");
59
- }
60
- push(`var client = new HttpClient(${clienthandler});`);
61
- push("var request = new HttpRequestMessage");
62
- push("{");
63
- const methods = [
64
- "GET",
65
- "POST",
66
- "PUT",
67
- "DELETE",
68
- "PATCH",
69
- "HEAD",
70
- "OPTIONS",
71
- "TRACE"
72
- ];
73
- method = method.toUpperCase();
74
- if (method && methods.includes(method)) {
75
- method = `HttpMethod.${method[0]}${method.substring(1).toLowerCase()}`;
76
- } else {
77
- method = `new HttpMethod("${method}")`;
78
- }
79
- push(`Method = ${method},`, 1);
80
- push(`RequestUri = new Uri("${fullUrl}"),`, 1);
81
- const headers = Object.keys(allHeaders).filter((header) => {
82
- switch (header.toLowerCase()) {
83
- case "content-type":
84
- case "content-length":
85
- case "accept-encoding":
86
- return false;
87
- default:
88
- return true;
89
- }
90
- });
91
- if (headers.length) {
92
- push("Headers =", 1);
93
- push("{", 1);
94
- headers.forEach((key) => {
95
- push(`{ "${key}", "${escapeForDoubleQuotes(allHeaders[key])}" },`, 2);
96
- });
97
- push("},", 1);
98
- }
99
- if (postData === null || postData === void 0 ? void 0 : postData.text) {
100
- const contentType = postData.mimeType;
101
- switch (contentType) {
102
- case "application/x-www-form-urlencoded":
103
- push(
104
- "Content = new FormUrlEncodedContent(new Dictionary<string, string>",
105
- 1
106
- );
107
- push("{", 1);
108
- (_a = postData.params) === null || _a === void 0 ? void 0 : _a.forEach((param) => {
109
- push(`{ "${param.name}", "${param.value}" },`, 2);
110
- });
111
- push("}),", 1);
112
- break;
113
- case "multipart/form-data":
114
- push("Content = new MultipartFormDataContent", 1);
115
- push("{", 1);
116
- (_b = postData.params) === null || _b === void 0 ? void 0 : _b.forEach((param) => {
117
- push(
118
- `new StringContent(${JSON.stringify(param.value || "")})`,
119
- 2
120
- );
121
- push("{", 2);
122
- push("Headers =", 3);
123
- push("{", 3);
124
- if (param.contentType) {
125
- push(
126
- `ContentType = new MediaTypeHeaderValue("${param.contentType}"),`,
127
- 4
128
- );
129
- }
130
- push(
131
- 'ContentDisposition = new ContentDispositionHeaderValue("form-data")',
132
- 4
133
- );
134
- push("{", 4);
135
- push(`Name = "${param.name}",`, 5);
136
- if (param.fileName) {
137
- push(`FileName = "${param.fileName}",`, 5);
138
- }
139
- push("}", 4);
140
- push("}", 3);
141
- push("},", 2);
142
- });
143
- push("},", 1);
144
- break;
145
- default:
146
- push(
147
- `Content = new StringContent(${JSON.stringify((postData === null || postData === void 0 ? void 0 : postData.text) || "")})`,
148
- 1
149
- );
150
- push("{", 1);
151
- push("Headers =", 2);
152
- push("{", 2);
153
- push(`ContentType = new MediaTypeHeaderValue("${contentType}")`, 3);
154
- push("}", 2);
155
- push("}", 1);
156
- break;
157
- }
158
- }
159
- push("};");
160
- push("using (var response = await client.SendAsync(request))");
161
- push("{");
162
- push("response.EnsureSuccessStatusCode();", 1);
163
- push("var body = await response.Content.ReadAsStringAsync();", 1);
164
- push("Console.WriteLine(body);", 1);
165
- push("}");
166
- return join();
167
- }
168
- };
169
- export {
170
- httpclient
171
- };
172
- //# sourceMappingURL=client.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": ["../../../../../../src/httpsnippet-lite/esm/targets/csharp/httpclient/client.ts"],
4
- "sourcesContent": ["// @ts-nocheck\nimport { CodeBuilder } from '../../../helpers/code-builder.js'\nimport { escapeForDoubleQuotes } from '../../../helpers/escape.js'\nimport { getHeader } from '../../../helpers/headers.js'\n\nconst getDecompressionMethods = (allHeaders) => {\n let acceptEncodings = getHeader(allHeaders, 'accept-encoding')\n if (!acceptEncodings) {\n return [] // no decompression\n }\n const supportedMethods = {\n gzip: 'DecompressionMethods.GZip',\n deflate: 'DecompressionMethods.Deflate',\n }\n const methods = []\n if (typeof acceptEncodings === 'string') {\n acceptEncodings = [acceptEncodings]\n }\n acceptEncodings.forEach((acceptEncoding) => {\n acceptEncoding.split(',').forEach((encoding) => {\n const match = /\\s*([^;\\s]+)/.exec(encoding)\n if (match) {\n const method = supportedMethods[match[1]]\n if (method) {\n methods.push(method)\n }\n }\n })\n })\n return methods\n}\nexport const httpclient = {\n info: {\n key: 'httpclient',\n title: 'HttpClient',\n link: 'https://docs.microsoft.com/en-us/dotnet/api/system.net.http.httpclient',\n description: '.NET Standard HTTP Client',\n },\n convert: ({ allHeaders, postData, method, fullUrl }, options) => {\n let _a, _b\n const opts = {\n indent: ' ',\n ...options,\n }\n const { push, join } = new CodeBuilder({ indent: opts.indent })\n push('using System.Net.Http.Headers;')\n let clienthandler = ''\n const cookies = Boolean(allHeaders.cookie)\n const decompressionMethods = getDecompressionMethods(allHeaders)\n if (cookies || decompressionMethods.length) {\n clienthandler = 'clientHandler'\n push('var clientHandler = new HttpClientHandler')\n push('{')\n if (cookies) {\n // enable setting the cookie header\n push('UseCookies = false,', 1)\n }\n if (decompressionMethods.length) {\n // enable decompression for supported methods\n push(`AutomaticDecompression = ${decompressionMethods.join(' | ')},`, 1)\n }\n push('};')\n }\n push(`var client = new HttpClient(${clienthandler});`)\n push('var request = new HttpRequestMessage')\n push('{')\n const methods = [\n 'GET',\n 'POST',\n 'PUT',\n 'DELETE',\n 'PATCH',\n 'HEAD',\n 'OPTIONS',\n 'TRACE',\n ]\n method = method.toUpperCase()\n if (method && methods.includes(method)) {\n // buildin method\n method = `HttpMethod.${method[0]}${method.substring(1).toLowerCase()}`\n } else {\n // custom method\n method = `new HttpMethod(\"${method}\")`\n }\n push(`Method = ${method},`, 1)\n push(`RequestUri = new Uri(\"${fullUrl}\"),`, 1)\n const headers = Object.keys(allHeaders).filter((header) => {\n switch (header.toLowerCase()) {\n case 'content-type':\n case 'content-length':\n case 'accept-encoding':\n // skip these headers\n return false\n default:\n return true\n }\n })\n if (headers.length) {\n push('Headers =', 1)\n push('{', 1)\n headers.forEach((key) => {\n push(`{ \"${key}\", \"${escapeForDoubleQuotes(allHeaders[key])}\" },`, 2)\n })\n push('},', 1)\n }\n if (postData === null || postData === void 0 ? void 0 : postData.text) {\n const contentType = postData.mimeType\n switch (contentType) {\n case 'application/x-www-form-urlencoded':\n push(\n 'Content = new FormUrlEncodedContent(new Dictionary<string, string>',\n 1,\n )\n push('{', 1)\n ;(_a = postData.params) === null || _a === void 0\n ? void 0\n : _a.forEach((param) => {\n push(`{ \"${param.name}\", \"${param.value}\" },`, 2)\n })\n push('}),', 1)\n break\n case 'multipart/form-data':\n push('Content = new MultipartFormDataContent', 1)\n push('{', 1)\n ;(_b = postData.params) === null || _b === void 0\n ? void 0\n : _b.forEach((param) => {\n push(\n `new StringContent(${JSON.stringify(param.value || '')})`,\n 2,\n )\n push('{', 2)\n push('Headers =', 3)\n push('{', 3)\n if (param.contentType) {\n push(\n `ContentType = new MediaTypeHeaderValue(\"${param.contentType}\"),`,\n 4,\n )\n }\n push(\n 'ContentDisposition = new ContentDispositionHeaderValue(\"form-data\")',\n 4,\n )\n push('{', 4)\n push(`Name = \"${param.name}\",`, 5)\n if (param.fileName) {\n push(`FileName = \"${param.fileName}\",`, 5)\n }\n push('}', 4)\n push('}', 3)\n push('},', 2)\n })\n push('},', 1)\n break\n default:\n push(\n `Content = new StringContent(${JSON.stringify((postData === null || postData === void 0 ? void 0 : postData.text) || '')})`,\n 1,\n )\n push('{', 1)\n push('Headers =', 2)\n push('{', 2)\n push(`ContentType = new MediaTypeHeaderValue(\"${contentType}\")`, 3)\n push('}', 2)\n push('}', 1)\n break\n }\n }\n push('};')\n // send and read response\n push('using (var response = await client.SendAsync(request))')\n push('{')\n push('response.EnsureSuccessStatusCode();', 1)\n push('var body = await response.Content.ReadAsStringAsync();', 1)\n push('Console.WriteLine(body);', 1)\n push('}')\n return join()\n },\n}\n"],
5
- "mappings": "AACA,SAAS,mBAAmB;AAC5B,SAAS,6BAA6B;AACtC,SAAS,iBAAiB;AAE1B,MAAM,0BAA0B,CAAC,eAAe;AAC9C,MAAI,kBAAkB,UAAU,YAAY,iBAAiB;AAC7D,MAAI,CAAC,iBAAiB;AACpB,WAAO,CAAC;AAAA,EACV;AACA,QAAM,mBAAmB;AAAA,IACvB,MAAM;AAAA,IACN,SAAS;AAAA,EACX;AACA,QAAM,UAAU,CAAC;AACjB,MAAI,OAAO,oBAAoB,UAAU;AACvC,sBAAkB,CAAC,eAAe;AAAA,EACpC;AACA,kBAAgB,QAAQ,CAAC,mBAAmB;AAC1C,mBAAe,MAAM,GAAG,EAAE,QAAQ,CAAC,aAAa;AAC9C,YAAM,QAAQ,eAAe,KAAK,QAAQ;AAC1C,UAAI,OAAO;AACT,cAAM,SAAS,iBAAiB,MAAM,CAAC,CAAC;AACxC,YAAI,QAAQ;AACV,kBAAQ,KAAK,MAAM;AAAA,QACrB;AAAA,MACF;AAAA,IACF,CAAC;AAAA,EACH,CAAC;AACD,SAAO;AACT;AACO,MAAM,aAAa;AAAA,EACxB,MAAM;AAAA,IACJ,KAAK;AAAA,IACL,OAAO;AAAA,IACP,MAAM;AAAA,IACN,aAAa;AAAA,EACf;AAAA,EACA,SAAS,CAAC,EAAE,YAAY,UAAU,QAAQ,QAAQ,GAAG,YAAY;AAC/D,QAAI,IAAI;AACR,UAAM,OAAO;AAAA,MACX,QAAQ;AAAA,MACR,GAAG;AAAA,IACL;AACA,UAAM,EAAE,MAAM,KAAK,IAAI,IAAI,YAAY,EAAE,QAAQ,KAAK,OAAO,CAAC;AAC9D,SAAK,gCAAgC;AACrC,QAAI,gBAAgB;AACpB,UAAM,UAAU,QAAQ,WAAW,MAAM;AACzC,U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AAC;AACX,eAAK,2CAA2C,WAAW,MAAM,CAAC;AAClE,eAAK,KAAK,CAAC;AACX,eAAK,KAAK,CAAC;AACX;AAAA,MACJ;AAAA,IACF;AACA,SAAK,IAAI;AAET,SAAK,wDAAwD;AAC7D,SAAK,GAAG;AACR,SAAK,uCAAuC,CAAC;AAC7C,SAAK,0DAA0D,CAAC;AAChE,SAAK,4BAA4B,CAAC;AAClC,SAAK,GAAG;AACR,WAAO,KAAK;AAAA,EACd;AACF;",
6
- "names": []
7
- }
@@ -1 +0,0 @@
1
- //# sourceMappingURL=client.d.js.map
@@ -1,7 +0,0 @@
1
- {
2
- "version": 3,
3
- "sources": [],
4
- "sourcesContent": [],
5
- "mappings": "",
6
- "names": []
7
- }