@tim-smart/openapi-gen 0.4.2 → 0.4.3
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/main.js +58 -12
- package/package.json +1 -1
package/main.js
CHANGED
|
@@ -7344,15 +7344,15 @@ var require_swagger2openapi = __commonJS({
|
|
|
7344
7344
|
scheme.scheme = "basic";
|
|
7345
7345
|
}
|
|
7346
7346
|
if (scheme.type === "oauth2") {
|
|
7347
|
-
let
|
|
7347
|
+
let flow2 = {};
|
|
7348
7348
|
let flowName = scheme.flow;
|
|
7349
7349
|
if (scheme.flow === "application") flowName = "clientCredentials";
|
|
7350
7350
|
if (scheme.flow === "accessCode") flowName = "authorizationCode";
|
|
7351
|
-
if (typeof scheme.authorizationUrl !== "undefined")
|
|
7352
|
-
if (typeof scheme.tokenUrl === "string")
|
|
7353
|
-
|
|
7351
|
+
if (typeof scheme.authorizationUrl !== "undefined") flow2.authorizationUrl = scheme.authorizationUrl.split("?")[0].trim() || "/";
|
|
7352
|
+
if (typeof scheme.tokenUrl === "string") flow2.tokenUrl = scheme.tokenUrl.split("?")[0].trim() || "/";
|
|
7353
|
+
flow2.scopes = scheme.scopes || {};
|
|
7354
7354
|
scheme.flows = {};
|
|
7355
|
-
scheme.flows[flowName] =
|
|
7355
|
+
scheme.flows[flowName] = flow2;
|
|
7356
7356
|
delete scheme.flow;
|
|
7357
7357
|
delete scheme.authorizationUrl;
|
|
7358
7358
|
delete scheme.tokenUrl;
|
|
@@ -8556,6 +8556,45 @@ function pipe(a, ab, bc, cd, de, ef, fg, gh, hi) {
|
|
|
8556
8556
|
}
|
|
8557
8557
|
}
|
|
8558
8558
|
}
|
|
8559
|
+
function flow(ab, bc, cd, de, ef, fg, gh, hi, ij) {
|
|
8560
|
+
switch (arguments.length) {
|
|
8561
|
+
case 1:
|
|
8562
|
+
return ab;
|
|
8563
|
+
case 2:
|
|
8564
|
+
return function() {
|
|
8565
|
+
return bc(ab.apply(this, arguments));
|
|
8566
|
+
};
|
|
8567
|
+
case 3:
|
|
8568
|
+
return function() {
|
|
8569
|
+
return cd(bc(ab.apply(this, arguments)));
|
|
8570
|
+
};
|
|
8571
|
+
case 4:
|
|
8572
|
+
return function() {
|
|
8573
|
+
return de(cd(bc(ab.apply(this, arguments))));
|
|
8574
|
+
};
|
|
8575
|
+
case 5:
|
|
8576
|
+
return function() {
|
|
8577
|
+
return ef(de(cd(bc(ab.apply(this, arguments)))));
|
|
8578
|
+
};
|
|
8579
|
+
case 6:
|
|
8580
|
+
return function() {
|
|
8581
|
+
return fg(ef(de(cd(bc(ab.apply(this, arguments))))));
|
|
8582
|
+
};
|
|
8583
|
+
case 7:
|
|
8584
|
+
return function() {
|
|
8585
|
+
return gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))));
|
|
8586
|
+
};
|
|
8587
|
+
case 8:
|
|
8588
|
+
return function() {
|
|
8589
|
+
return hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments))))))));
|
|
8590
|
+
};
|
|
8591
|
+
case 9:
|
|
8592
|
+
return function() {
|
|
8593
|
+
return ij(hi(gh(fg(ef(de(cd(bc(ab.apply(this, arguments)))))))));
|
|
8594
|
+
};
|
|
8595
|
+
}
|
|
8596
|
+
return;
|
|
8597
|
+
}
|
|
8559
8598
|
|
|
8560
8599
|
// node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/Equivalence.js
|
|
8561
8600
|
var make = (isEquivalent) => (self, that) => self === that || isEquivalent(self, that);
|
|
@@ -19317,6 +19356,8 @@ var capitalize = (self) => {
|
|
|
19317
19356
|
if (self.length === 0) return self;
|
|
19318
19357
|
return toUpperCase(self[0]) + self.slice(1);
|
|
19319
19358
|
};
|
|
19359
|
+
var trim = (self) => self.trim();
|
|
19360
|
+
var isNonEmpty5 = (self) => self.length > 0;
|
|
19320
19361
|
|
|
19321
19362
|
// node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/internal/schedule.js
|
|
19322
19363
|
var ScheduleSymbolKey = "effect/Schedule";
|
|
@@ -20624,10 +20665,10 @@ var formatUnknown = (u, checkCircular = true) => {
|
|
|
20624
20665
|
}
|
|
20625
20666
|
};
|
|
20626
20667
|
var formatPropertyKey = (name2) => typeof name2 === "string" ? JSON.stringify(name2) : String(name2);
|
|
20627
|
-
var
|
|
20668
|
+
var isNonEmpty6 = (x) => Array.isArray(x);
|
|
20628
20669
|
var isSingle = (x) => !Array.isArray(x);
|
|
20629
20670
|
var formatPathKey = (key) => `[${formatPropertyKey(key)}]`;
|
|
20630
|
-
var formatPath = (path2) =>
|
|
20671
|
+
var formatPath = (path2) => isNonEmpty6(path2) ? path2.map(formatPathKey).join("") : formatPathKey(path2);
|
|
20631
20672
|
|
|
20632
20673
|
// node_modules/.pnpm/effect@3.15.2/node_modules/effect/dist/esm/internal/schema/errors.js
|
|
20633
20674
|
var getErrorMessage = (reason, details, path2, ast) => {
|
|
@@ -22895,7 +22936,7 @@ var formatTree = (issue) => {
|
|
|
22895
22936
|
return right2(makeTree(message));
|
|
22896
22937
|
}
|
|
22897
22938
|
const parseIssueTitle = getParseIssueTitle(issue);
|
|
22898
|
-
return
|
|
22939
|
+
return isNonEmpty6(issue.issues) ? map18(forEach8(issue.issues, formatTree), (forest) => makeTree(parseIssueTitle, forest)) : map18(formatTree(issue.issues), (tree) => makeTree(parseIssueTitle, [tree]));
|
|
22899
22940
|
});
|
|
22900
22941
|
}
|
|
22901
22942
|
};
|
|
@@ -34868,7 +34909,7 @@ var make64 = gen2(function* () {
|
|
|
34868
34909
|
(source) => transformer.onTopLevel({
|
|
34869
34910
|
importName,
|
|
34870
34911
|
schema,
|
|
34871
|
-
description:
|
|
34912
|
+
description: nonEmptyString3(schema.description),
|
|
34872
34913
|
name: name2,
|
|
34873
34914
|
source,
|
|
34874
34915
|
isClass,
|
|
@@ -34916,7 +34957,7 @@ var make64 = gen2(function* () {
|
|
|
34916
34957
|
map2(
|
|
34917
34958
|
(source) => transformer.onProperty({
|
|
34918
34959
|
importName,
|
|
34919
|
-
description:
|
|
34960
|
+
description: nonEmptyString3(schema2.description),
|
|
34920
34961
|
key,
|
|
34921
34962
|
source,
|
|
34922
34963
|
isOptional,
|
|
@@ -35005,8 +35046,8 @@ var make64 = gen2(function* () {
|
|
|
35005
35046
|
(_) => toSource(importName, _, currentIdentifier + "Enum").pipe(
|
|
35006
35047
|
map2(
|
|
35007
35048
|
(source) => ({
|
|
35008
|
-
description:
|
|
35009
|
-
title:
|
|
35049
|
+
description: nonEmptyString3(_.description),
|
|
35050
|
+
title: nonEmptyString3(_.title),
|
|
35010
35051
|
source
|
|
35011
35052
|
})
|
|
35012
35053
|
)
|
|
@@ -35259,6 +35300,11 @@ export type ${name2} = (typeof ${name2})[keyof typeof ${name2}];` : `${toComment
|
|
|
35259
35300
|
}
|
|
35260
35301
|
})
|
|
35261
35302
|
);
|
|
35303
|
+
var nonEmptyString3 = flow(
|
|
35304
|
+
fromNullable,
|
|
35305
|
+
map2(trim),
|
|
35306
|
+
filter(isNonEmpty5)
|
|
35307
|
+
);
|
|
35262
35308
|
var toComment = match2({
|
|
35263
35309
|
onNone: () => "",
|
|
35264
35310
|
onSome: (description) => `/**
|