api 5.0.7 → 5.0.8

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.
@@ -61,6 +61,7 @@ cmd
61
61
  'js-esm',
62
62
  'ts',
63
63
  ]))
64
+ .addOption(new commander_1.Option('-y, --yes', 'Automatically answer "yes" to any prompts printed'))
64
65
  .action(function (uri, options) { return __awaiter(void 0, void 0, void 0, function () {
65
66
  var language, identifier, spinner, storage, oas, generator, sdkSource, err_1;
66
67
  return __generator(this, function (_a) {
@@ -183,12 +184,13 @@ cmd
183
184
  })];
184
185
  case 11:
185
186
  _a.sent();
186
- if (!generator.hasRequiredPackages()) return [3 /*break*/, 16];
187
+ if (!generator.hasRequiredPackages()) return [3 /*break*/, 17];
187
188
  (0, logger_1["default"])("".concat(figures_1["default"].warning, " This generator requires some packages to be installed alongside it:"));
188
189
  Object.entries(generator.requiredPackages).forEach(function (_a) {
189
190
  var pkg = _a[0], pkgInfo = _a[1];
190
191
  (0, logger_1["default"])(" ".concat(figures_1["default"].pointerSmall, " ").concat(pkg, ": ").concat(pkgInfo.reason, " ").concat(pkgInfo.url));
191
192
  });
193
+ if (!!options.yes) return [3 /*break*/, 13];
192
194
  return [4 /*yield*/, (0, prompt_1["default"])({
193
195
  type: 'confirm',
194
196
  name: 'value',
@@ -204,23 +206,25 @@ cmd
204
206
  })];
205
207
  case 12:
206
208
  _a.sent();
207
- spinner = (0, ora_1["default"])('Installing required packages').start();
208
209
  _a.label = 13;
209
210
  case 13:
210
- _a.trys.push([13, 15, , 16]);
211
- return [4 /*yield*/, generator.installer(storage)];
211
+ spinner = (0, ora_1["default"])('Installing required packages').start();
212
+ _a.label = 14;
212
213
  case 14:
214
+ _a.trys.push([14, 16, , 17]);
215
+ return [4 /*yield*/, generator.installer(storage)];
216
+ case 15:
213
217
  _a.sent();
214
218
  spinner.succeed(spinner.text);
215
- return [3 /*break*/, 16];
216
- case 15:
219
+ return [3 /*break*/, 17];
220
+ case 16:
217
221
  err_1 = _a.sent();
218
222
  // @todo cleanup installed files
219
223
  spinner.fail(spinner.text);
220
224
  (0, logger_1["default"])(err_1.message, true);
221
225
  process.exit(1);
222
- return [3 /*break*/, 16];
223
- case 16:
226
+ return [3 /*break*/, 17];
227
+ case 17:
224
228
  (0, logger_1["default"])('🚀 All done!');
225
229
  return [2 /*return*/];
226
230
  }
@@ -1,2 +1,2 @@
1
1
  export declare const PACKAGE_NAME = "api";
2
- export declare const PACKAGE_VERSION = "5.0.7";
2
+ export declare const PACKAGE_VERSION = "5.0.8";
@@ -3,4 +3,4 @@ exports.__esModule = true;
3
3
  exports.PACKAGE_VERSION = exports.PACKAGE_NAME = void 0;
4
4
  // This file is automatically updated by the build script.
5
5
  exports.PACKAGE_NAME = 'api';
6
- exports.PACKAGE_VERSION = '5.0.7';
6
+ exports.PACKAGE_VERSION = '5.0.8';
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "api",
3
- "version": "5.0.7",
3
+ "version": "5.0.8",
4
4
  "description": "Magical SDK generation from an OpenAPI definition 🪄",
5
5
  "main": "./dist/index.js",
6
6
  "types": "./dist/index.d.ts",
@@ -60,7 +60,7 @@
60
60
  "lodash.setwith": "^4.3.2",
61
61
  "lodash.startcase": "^4.4.0",
62
62
  "make-dir": "^3.1.0",
63
- "node-abort-controller": "^3.0.1",
63
+ "node-abort-controller": "^3.1.1",
64
64
  "oas": "^20.4.0",
65
65
  "ora": "^5.4.1",
66
66
  "prettier": "^2.8.3",
@@ -94,11 +94,11 @@
94
94
  "mocha": "^10.1.0",
95
95
  "mock-require": "^3.0.3",
96
96
  "nyc": "^15.1.0",
97
- "oas-normalize": "^8.3.1",
97
+ "oas-normalize": "^8.3.2",
98
98
  "sinon": "^15.0.0",
99
99
  "sinon-chai": "^3.7.0",
100
- "type-fest": "^3.5.3",
101
- "typescript": "^4.9.4",
100
+ "type-fest": "^3.5.4",
101
+ "typescript": "^4.9.5",
102
102
  "unique-temp-dir": "^1.0.0"
103
103
  },
104
104
  "prettier": "@readme/eslint-config/prettier",
@@ -108,5 +108,5 @@
108
108
  "test/"
109
109
  ]
110
110
  },
111
- "gitHead": "b003a05707215a4145a54fe28b98032b78742082"
111
+ "gitHead": "bd15ecccb3aadea9ee821056c41d7897638bbe9d"
112
112
  }
@@ -26,7 +26,8 @@ cmd
26
26
  'ts',
27
27
  ])
28
28
  )
29
- .action(async (uri: string, options: { lang: string }) => {
29
+ .addOption(new Option('-y, --yes', 'Automatically answer "yes" to any prompts printed'))
30
+ .action(async (uri: string, options: { lang: string; yes?: boolean }) => {
30
31
  let language: SupportedLanguages;
31
32
  if (options.lang) {
32
33
  language = options.lang as SupportedLanguages;
@@ -155,18 +156,20 @@ cmd
155
156
  logger(` ${figures.pointerSmall} ${pkg}: ${pkgInfo.reason} ${pkgInfo.url}`);
156
157
  });
157
158
 
158
- await promptTerminal({
159
- type: 'confirm',
160
- name: 'value',
161
- message: 'OK to proceed with package installation?',
162
- initial: true,
163
- }).then(({ value }) => {
164
- if (!value) {
165
- // @todo cleanup installed files
166
- logger('Installation cancelled.', true);
167
- process.exit(1);
168
- }
169
- });
159
+ if (!options.yes) {
160
+ await promptTerminal({
161
+ type: 'confirm',
162
+ name: 'value',
163
+ message: 'OK to proceed with package installation?',
164
+ initial: true,
165
+ }).then(({ value }) => {
166
+ if (!value) {
167
+ // @todo cleanup installed files
168
+ logger('Installation cancelled.', true);
169
+ process.exit(1);
170
+ }
171
+ });
172
+ }
170
173
 
171
174
  spinner = ora('Installing required packages').start();
172
175
  try {
@@ -1,3 +1,3 @@
1
1
  // This file is automatically updated by the build script.
2
2
  export const PACKAGE_NAME = 'api';
3
- export const PACKAGE_VERSION = '5.0.7';
3
+ export const PACKAGE_VERSION = '5.0.8';