@naturali/cli 0.229.0 → 0.229.1
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.mjs +13 -6
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -17,7 +17,7 @@ var __exportAll = (all, no_symbols) => {
|
|
|
17
17
|
};
|
|
18
18
|
//#endregion
|
|
19
19
|
//#region package.json
|
|
20
|
-
var version = "0.229.
|
|
20
|
+
var version = "0.229.1";
|
|
21
21
|
//#endregion
|
|
22
22
|
//#region ../sdk/src/generated/core/bodySerializer.gen.ts
|
|
23
23
|
const serializeFormDataPair = (data, key, value) => {
|
|
@@ -7359,6 +7359,13 @@ const findRootBodyFlag = (route) => {
|
|
|
7359
7359
|
return flag.in === "body-root";
|
|
7360
7360
|
});
|
|
7361
7361
|
};
|
|
7362
|
+
const keepText = (value) => {
|
|
7363
|
+
return value;
|
|
7364
|
+
};
|
|
7365
|
+
const scalarCoercer = (flag) => {
|
|
7366
|
+
if (flag?.type !== "string") return parseFlagValue;
|
|
7367
|
+
return flag.in === "query" ? keepText : parseStringFlagValue;
|
|
7368
|
+
};
|
|
7362
7369
|
const placeFlags = (args) => {
|
|
7363
7370
|
const { route, parsedFlags, call } = args;
|
|
7364
7371
|
const fileErrors = [];
|
|
@@ -7377,13 +7384,13 @@ const placeFlags = (args) => {
|
|
|
7377
7384
|
return resolved.fromFile ? resolved.value : coerce(resolved.value);
|
|
7378
7385
|
};
|
|
7379
7386
|
const rootBodyFlag = findRootBodyFlag(route);
|
|
7380
|
-
const
|
|
7381
|
-
return [toCanonical(flag.name), flag
|
|
7387
|
+
const flagByCanonical = new Map(route.flags.map((flag) => {
|
|
7388
|
+
return [toCanonical(flag.name), flag];
|
|
7382
7389
|
}));
|
|
7383
7390
|
for (const [flagKey, rawValue] of Object.entries(parsedFlags.single)) {
|
|
7384
7391
|
const canonical = toCanonical(flagKey);
|
|
7385
|
-
const
|
|
7386
|
-
const value =
|
|
7392
|
+
const declared = flagByCanonical.get(canonical);
|
|
7393
|
+
const value = declared?.type === "array" ? buildArrayFlagValue((parsedFlags.repeated[flagKey] ?? [rawValue]).map((item) => {
|
|
7387
7394
|
return readValue({
|
|
7388
7395
|
flagKey,
|
|
7389
7396
|
raw: item,
|
|
@@ -7392,7 +7399,7 @@ const placeFlags = (args) => {
|
|
|
7392
7399
|
})) : readValue({
|
|
7393
7400
|
flagKey,
|
|
7394
7401
|
raw: rawValue,
|
|
7395
|
-
coerce:
|
|
7402
|
+
coerce: scalarCoercer(declared)
|
|
7396
7403
|
});
|
|
7397
7404
|
const pathParam = route.pathParams.find((param) => {
|
|
7398
7405
|
return toCanonical(param) === canonical;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@naturali/cli",
|
|
3
|
-
"version": "0.229.
|
|
3
|
+
"version": "0.229.1",
|
|
4
4
|
"description": "Command-line interface for the naturali.ai API, generated from its OpenAPI specs",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"naturali",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"yaml": "^2.9.1"
|
|
32
32
|
},
|
|
33
33
|
"devDependencies": {
|
|
34
|
-
"@naturali/sdk": "0.229.
|
|
34
|
+
"@naturali/sdk": "0.229.1",
|
|
35
35
|
"@ttoss/openapi-codegen": "^0.10.0",
|
|
36
36
|
"@types/node": "^26.5.1",
|
|
37
37
|
"tsdown": "^0.23.0",
|