ng-openapi 0.3.1 → 0.3.2-pr-119-fix-118-nullable-format-strings-12ffce1.0
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/cli.cjs +6 -9
- package/index.js +6 -9
- package/package.json +1 -1
package/cli.cjs
CHANGED
|
@@ -897,7 +897,7 @@ function isDataTypeInterface(type) {
|
|
|
897
897
|
__name(isDataTypeInterface, "isDataTypeInterface");
|
|
898
898
|
|
|
899
899
|
// ../shared/src/config/constants.ts
|
|
900
|
-
var disableLinting =
|
|
900
|
+
var disableLinting = `// @ts-nocheck
|
|
901
901
|
/* eslint-disable */
|
|
902
902
|
/* @noformat */
|
|
903
903
|
/* @formatter:off */
|
|
@@ -1093,10 +1093,7 @@ var TypeResolver = class {
|
|
|
1093
1093
|
const dateType = this.config.options.dateType === "Date" ? "Date" : "string";
|
|
1094
1094
|
return this.nullableType(dateType, isNullable);
|
|
1095
1095
|
}
|
|
1096
|
-
if (format === "binary") return "Blob";
|
|
1097
|
-
if (format === "uuid") return "string";
|
|
1098
|
-
if (format === "email") return "string";
|
|
1099
|
-
if (format === "uri") return "string";
|
|
1096
|
+
if (format === "binary") return this.nullableType("Blob", isNullable);
|
|
1100
1097
|
return this.nullableType("string", isNullable);
|
|
1101
1098
|
case "number":
|
|
1102
1099
|
case "integer":
|
|
@@ -1516,12 +1513,12 @@ var TypeGenerator = class {
|
|
|
1516
1513
|
};
|
|
1517
1514
|
}
|
|
1518
1515
|
applyBatchUpdates() {
|
|
1519
|
-
this.sourceFile.insertText(0, TYPE_GENERATOR_HEADER_COMMENT);
|
|
1520
1516
|
this.addSdkImports(this.sourceFile);
|
|
1521
1517
|
this.sourceFile.addStatements(this.statements);
|
|
1522
1518
|
}
|
|
1523
1519
|
async finalize() {
|
|
1524
1520
|
this.sourceFile.formatText();
|
|
1521
|
+
this.sourceFile.insertText(0, TYPE_GENERATOR_HEADER_COMMENT);
|
|
1525
1522
|
await this.sourceFile.save();
|
|
1526
1523
|
}
|
|
1527
1524
|
generatePerType(definitions) {
|
|
@@ -2111,7 +2108,6 @@ var ProviderGenerator = class {
|
|
|
2111
2108
|
const sourceFile = this.project.createSourceFile(filePath, "", {
|
|
2112
2109
|
overwrite: true
|
|
2113
2110
|
});
|
|
2114
|
-
sourceFile.insertText(0, PROVIDER_GENERATOR_HEADER_COMMENT);
|
|
2115
2111
|
const basePathTokenName = getBasePathTokenName(this.clientName);
|
|
2116
2112
|
const interceptorsTokenName = getInterceptorsTokenName(this.clientName);
|
|
2117
2113
|
const baseInterceptorClassName = `${this.capitalizeFirst(this.clientName)}BaseInterceptor`;
|
|
@@ -2198,6 +2194,7 @@ var ProviderGenerator = class {
|
|
|
2198
2194
|
properties: configProperties
|
|
2199
2195
|
});
|
|
2200
2196
|
this.addMainProviderFunction(sourceFile, basePathTokenName, interceptorsTokenName, baseInterceptorClassName);
|
|
2197
|
+
sourceFile.insertText(0, PROVIDER_GENERATOR_HEADER_COMMENT);
|
|
2201
2198
|
sourceFile.formatText();
|
|
2202
2199
|
sourceFile.saveSync();
|
|
2203
2200
|
}
|
|
@@ -2322,7 +2319,6 @@ var BaseInterceptorGenerator = class {
|
|
|
2322
2319
|
const sourceFile = this.#project.createSourceFile(filePath, "", {
|
|
2323
2320
|
overwrite: true
|
|
2324
2321
|
});
|
|
2325
|
-
sourceFile.insertText(0, BASE_INTERCEPTOR_HEADER_COMMENT(this.#clientName));
|
|
2326
2322
|
const interceptorsTokenName = getInterceptorsTokenName(this.#clientName);
|
|
2327
2323
|
const clientContextTokenName = getClientContextTokenName(this.#clientName);
|
|
2328
2324
|
sourceFile.addImportDeclarations([
|
|
@@ -2420,6 +2416,7 @@ var BaseInterceptorGenerator = class {
|
|
|
2420
2416
|
}
|
|
2421
2417
|
]
|
|
2422
2418
|
});
|
|
2419
|
+
sourceFile.insertText(0, BASE_INTERCEPTOR_HEADER_COMMENT(this.#clientName));
|
|
2423
2420
|
sourceFile.formatText();
|
|
2424
2421
|
sourceFile.saveSync();
|
|
2425
2422
|
}
|
|
@@ -3275,6 +3272,7 @@ var ServiceGenerator = class {
|
|
|
3275
3272
|
});
|
|
3276
3273
|
this.addServiceClass(sourceFile, controllerName, operations);
|
|
3277
3274
|
sourceFile.fixMissingImports().formatText();
|
|
3275
|
+
sourceFile.insertText(0, SERVICE_GENERATOR_HEADER_COMMENT(controllerName));
|
|
3278
3276
|
sourceFile.saveSync();
|
|
3279
3277
|
}
|
|
3280
3278
|
addServiceClass(sourceFile, controllerName, operations) {
|
|
@@ -3282,7 +3280,6 @@ var ServiceGenerator = class {
|
|
|
3282
3280
|
const basePathTokenName = getBasePathTokenName(this.config.clientName);
|
|
3283
3281
|
const clientContextTokenName = getClientContextTokenName(this.config.clientName);
|
|
3284
3282
|
const serviceDecorator = emitServiceDecorator(this.config.options);
|
|
3285
|
-
sourceFile.insertText(0, SERVICE_GENERATOR_HEADER_COMMENT(controllerName));
|
|
3286
3283
|
sourceFile.addImportDeclarations([
|
|
3287
3284
|
{
|
|
3288
3285
|
namedImports: [
|
package/index.js
CHANGED
|
@@ -1075,7 +1075,7 @@ function defineConfig(config) {
|
|
|
1075
1075
|
__name(defineConfig, "defineConfig");
|
|
1076
1076
|
|
|
1077
1077
|
// ../shared/src/config/constants.ts
|
|
1078
|
-
var disableLinting =
|
|
1078
|
+
var disableLinting = `// @ts-nocheck
|
|
1079
1079
|
/* eslint-disable */
|
|
1080
1080
|
/* @noformat */
|
|
1081
1081
|
/* @formatter:off */
|
|
@@ -1268,10 +1268,7 @@ var _TypeResolver = class _TypeResolver {
|
|
|
1268
1268
|
const dateType = this.config.options.dateType === "Date" ? "Date" : "string";
|
|
1269
1269
|
return this.nullableType(dateType, isNullable);
|
|
1270
1270
|
}
|
|
1271
|
-
if (format === "binary") return "Blob";
|
|
1272
|
-
if (format === "uuid") return "string";
|
|
1273
|
-
if (format === "email") return "string";
|
|
1274
|
-
if (format === "uri") return "string";
|
|
1271
|
+
if (format === "binary") return this.nullableType("Blob", isNullable);
|
|
1275
1272
|
return this.nullableType("string", isNullable);
|
|
1276
1273
|
case "number":
|
|
1277
1274
|
case "integer":
|
|
@@ -1697,13 +1694,13 @@ var _TypeGenerator = class _TypeGenerator {
|
|
|
1697
1694
|
};
|
|
1698
1695
|
}
|
|
1699
1696
|
applyBatchUpdates() {
|
|
1700
|
-
this.sourceFile.insertText(0, TYPE_GENERATOR_HEADER_COMMENT);
|
|
1701
1697
|
this.addSdkImports(this.sourceFile);
|
|
1702
1698
|
this.sourceFile.addStatements(this.statements);
|
|
1703
1699
|
}
|
|
1704
1700
|
finalize() {
|
|
1705
1701
|
return __async(this, null, function* () {
|
|
1706
1702
|
this.sourceFile.formatText();
|
|
1703
|
+
this.sourceFile.insertText(0, TYPE_GENERATOR_HEADER_COMMENT);
|
|
1707
1704
|
yield this.sourceFile.save();
|
|
1708
1705
|
});
|
|
1709
1706
|
}
|
|
@@ -2290,7 +2287,6 @@ var _ProviderGenerator = class _ProviderGenerator {
|
|
|
2290
2287
|
const sourceFile = this.project.createSourceFile(filePath, "", {
|
|
2291
2288
|
overwrite: true
|
|
2292
2289
|
});
|
|
2293
|
-
sourceFile.insertText(0, PROVIDER_GENERATOR_HEADER_COMMENT);
|
|
2294
2290
|
const basePathTokenName = getBasePathTokenName(this.clientName);
|
|
2295
2291
|
const interceptorsTokenName = getInterceptorsTokenName(this.clientName);
|
|
2296
2292
|
const baseInterceptorClassName = `${this.capitalizeFirst(this.clientName)}BaseInterceptor`;
|
|
@@ -2377,6 +2373,7 @@ var _ProviderGenerator = class _ProviderGenerator {
|
|
|
2377
2373
|
properties: configProperties
|
|
2378
2374
|
});
|
|
2379
2375
|
this.addMainProviderFunction(sourceFile, basePathTokenName, interceptorsTokenName, baseInterceptorClassName);
|
|
2376
|
+
sourceFile.insertText(0, PROVIDER_GENERATOR_HEADER_COMMENT);
|
|
2380
2377
|
sourceFile.formatText();
|
|
2381
2378
|
sourceFile.saveSync();
|
|
2382
2379
|
}
|
|
@@ -2501,7 +2498,6 @@ var _BaseInterceptorGenerator = class _BaseInterceptorGenerator {
|
|
|
2501
2498
|
const sourceFile = __privateGet(this, _project).createSourceFile(filePath, "", {
|
|
2502
2499
|
overwrite: true
|
|
2503
2500
|
});
|
|
2504
|
-
sourceFile.insertText(0, BASE_INTERCEPTOR_HEADER_COMMENT(__privateGet(this, _clientName)));
|
|
2505
2501
|
const interceptorsTokenName = getInterceptorsTokenName(__privateGet(this, _clientName));
|
|
2506
2502
|
const clientContextTokenName = getClientContextTokenName(__privateGet(this, _clientName));
|
|
2507
2503
|
sourceFile.addImportDeclarations([
|
|
@@ -2599,6 +2595,7 @@ var _BaseInterceptorGenerator = class _BaseInterceptorGenerator {
|
|
|
2599
2595
|
}
|
|
2600
2596
|
]
|
|
2601
2597
|
});
|
|
2598
|
+
sourceFile.insertText(0, BASE_INTERCEPTOR_HEADER_COMMENT(__privateGet(this, _clientName)));
|
|
2602
2599
|
sourceFile.formatText();
|
|
2603
2600
|
sourceFile.saveSync();
|
|
2604
2601
|
}
|
|
@@ -3458,6 +3455,7 @@ var _ServiceGenerator = class _ServiceGenerator {
|
|
|
3458
3455
|
});
|
|
3459
3456
|
this.addServiceClass(sourceFile, controllerName, operations);
|
|
3460
3457
|
sourceFile.fixMissingImports().formatText();
|
|
3458
|
+
sourceFile.insertText(0, SERVICE_GENERATOR_HEADER_COMMENT(controllerName));
|
|
3461
3459
|
sourceFile.saveSync();
|
|
3462
3460
|
});
|
|
3463
3461
|
}
|
|
@@ -3467,7 +3465,6 @@ var _ServiceGenerator = class _ServiceGenerator {
|
|
|
3467
3465
|
const basePathTokenName = getBasePathTokenName(this.config.clientName);
|
|
3468
3466
|
const clientContextTokenName = getClientContextTokenName(this.config.clientName);
|
|
3469
3467
|
const serviceDecorator = emitServiceDecorator(this.config.options);
|
|
3470
|
-
sourceFile.insertText(0, SERVICE_GENERATOR_HEADER_COMMENT(controllerName));
|
|
3471
3468
|
sourceFile.addImportDeclarations([
|
|
3472
3469
|
{
|
|
3473
3470
|
namedImports: [
|
package/package.json
CHANGED