@zimic/http 0.2.0-canary.0 → 0.2.0-canary.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/README.md +1 -1
- package/dist/{chunk-2YBKARBY.js → chunk-2P56ILG3.js} +7 -7
- package/dist/{chunk-2YBKARBY.js.map → chunk-2P56ILG3.js.map} +1 -1
- package/dist/{chunk-ZIEAUQAZ.mjs → chunk-5GJI2ESI.mjs} +6 -6
- package/dist/{chunk-ZIEAUQAZ.mjs.map → chunk-5GJI2ESI.mjs.map} +1 -1
- package/dist/cli.js +10 -10
- package/dist/cli.js.map +1 -1
- package/dist/cli.mjs +4 -4
- package/dist/cli.mjs.map +1 -1
- package/dist/typegen.js +2 -2
- package/dist/typegen.mjs +1 -1
- package/package.json +5 -5
- package/src/cli/cli.ts +3 -3
- package/src/typegen/openapi/transform/filters.ts +2 -2
- package/src/typegen/openapi/transform/methods.ts +2 -2
- package/src/utils/console.ts +2 -2
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import filesystem from 'fs/promises';
|
|
2
2
|
import path from 'path';
|
|
3
3
|
import ts3 from 'typescript';
|
|
4
|
-
import
|
|
4
|
+
import color from 'picocolors';
|
|
5
5
|
|
|
6
6
|
var __defProp = Object.defineProperty;
|
|
7
7
|
var __name = (target, value) => __defProp(target, "name", { value, configurable: true });
|
|
@@ -52,7 +52,7 @@ __name(createImportDeclaration, "createImportDeclaration");
|
|
|
52
52
|
var HTTP_METHODS = Object.freeze(["GET", "POST", "PUT", "PATCH", "DELETE", "HEAD", "OPTIONS"]);
|
|
53
53
|
function logWithPrefix(message, options) {
|
|
54
54
|
const { method } = options;
|
|
55
|
-
console[method](
|
|
55
|
+
console[method](color.cyan("[@zimic/http]"), message);
|
|
56
56
|
}
|
|
57
57
|
__name(logWithPrefix, "logWithPrefix");
|
|
58
58
|
function createOperationsIdentifierText(serviceName) {
|
|
@@ -396,7 +396,7 @@ function normalizeResponse(response, context, options = {}) {
|
|
|
396
396
|
const mappedType = NON_NUMERIC_RESPONSE_STATUS_TO_MAPPED_TYPE[statusCode];
|
|
397
397
|
if (!mappedType) {
|
|
398
398
|
logWithPrefix(
|
|
399
|
-
`Warning: Response has a non-standard status code: ${
|
|
399
|
+
`Warning: Response has a non-standard status code: ${color.yellow(response.name.text)}. Consider replacing it with a number (e.g. '200'), a pattern ('1xx', '2xx', '3xx', '4xx', or '5xx'), or 'default'.`,
|
|
400
400
|
{ method: "warn" }
|
|
401
401
|
);
|
|
402
402
|
return void 0;
|
|
@@ -1072,7 +1072,7 @@ function parseRawFilter(rawFilter) {
|
|
|
1072
1072
|
const { modifier: filterModifier, method: filteredMethodsOrWildcard, path: filteredPath } = filterMatch?.groups ?? {};
|
|
1073
1073
|
const isValidFilter = !filteredMethodsOrWildcard || !filteredPath;
|
|
1074
1074
|
if (isValidFilter) {
|
|
1075
|
-
logWithPrefix(`Warning: Filter could not be parsed and was ignored: ${
|
|
1075
|
+
logWithPrefix(`Warning: Filter could not be parsed and was ignored: ${color.yellow(rawFilter)}`, {
|
|
1076
1076
|
method: "warn"
|
|
1077
1077
|
});
|
|
1078
1078
|
return void 0;
|
|
@@ -1326,5 +1326,5 @@ var generate_default = generateTypesFromOpenAPI;
|
|
|
1326
1326
|
* The root import module is defined at build time. The fallback is not expected to be used. */
|
|
1327
1327
|
|
|
1328
1328
|
export { __name, generate_default, logWithPrefix };
|
|
1329
|
-
//# sourceMappingURL=chunk-
|
|
1330
|
-
//# sourceMappingURL=chunk-
|
|
1329
|
+
//# sourceMappingURL=chunk-5GJI2ESI.mjs.map
|
|
1330
|
+
//# sourceMappingURL=chunk-5GJI2ESI.mjs.map
|