@apimatic/cli 1.1.0-alpha.2 → 1.1.0-alpha.21

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.
Files changed (269) hide show
  1. package/README.md +257 -101
  2. package/bin/run.js +5 -0
  3. package/lib/actions/action-result.d.ts +8 -0
  4. package/lib/actions/action-result.js +25 -0
  5. package/lib/actions/action-result.js.map +1 -0
  6. package/lib/actions/auth/login.d.ts +12 -0
  7. package/lib/actions/auth/login.js +63 -0
  8. package/lib/actions/auth/login.js.map +1 -0
  9. package/lib/actions/portal/copilot.d.ts +14 -0
  10. package/lib/actions/portal/copilot.js +79 -0
  11. package/lib/actions/portal/copilot.js.map +1 -0
  12. package/lib/actions/portal/generate.d.ts +14 -0
  13. package/lib/actions/portal/generate.js +66 -0
  14. package/lib/actions/portal/generate.js.map +1 -0
  15. package/lib/actions/portal/recipe/new-recipe.d.ts +24 -0
  16. package/lib/actions/portal/recipe/new-recipe.js +250 -0
  17. package/lib/actions/portal/recipe/new-recipe.js.map +1 -0
  18. package/lib/actions/portal/serve.d.ts +14 -0
  19. package/lib/actions/portal/serve.js +24 -0
  20. package/lib/actions/portal/serve.js.map +1 -0
  21. package/lib/actions/portal/toc/new-toc.d.ts +20 -0
  22. package/lib/actions/portal/toc/new-toc.js +133 -0
  23. package/lib/actions/portal/toc/new-toc.js.map +1 -0
  24. package/lib/actions/sdk/generate.d.ts +14 -0
  25. package/lib/actions/sdk/generate.js +72 -0
  26. package/lib/actions/sdk/generate.js.map +1 -0
  27. package/lib/application/portal/recipe/portal-recipe.d.ts +8 -0
  28. package/lib/application/portal/recipe/portal-recipe.js +33 -0
  29. package/lib/application/portal/recipe/portal-recipe.js.map +1 -0
  30. package/lib/application/portal/recipe/recipe-generator.d.ts +16 -0
  31. package/lib/application/portal/recipe/recipe-generator.js +147 -0
  32. package/lib/application/portal/recipe/recipe-generator.js.map +1 -0
  33. package/lib/application/portal/serve/portal-watcher.d.ts +11 -0
  34. package/lib/application/portal/serve/portal-watcher.js +64 -0
  35. package/lib/application/portal/serve/portal-watcher.js.map +1 -0
  36. package/lib/application/portal/serve/serve-handler.d.ts +16 -0
  37. package/lib/application/portal/serve/serve-handler.js +91 -0
  38. package/lib/application/portal/serve/serve-handler.js.map +1 -0
  39. package/lib/application/portal/serve/watcher-handler.d.ts +10 -0
  40. package/lib/application/portal/serve/watcher-handler.js +51 -0
  41. package/lib/application/portal/serve/watcher-handler.js.map +1 -0
  42. package/lib/application/portal/toc/sdl-parser.d.ts +19 -0
  43. package/lib/application/portal/toc/sdl-parser.js +90 -0
  44. package/lib/application/portal/toc/sdl-parser.js.map +1 -0
  45. package/lib/application/portal/toc/toc-content-parser.d.ts +5 -0
  46. package/lib/application/portal/toc/toc-content-parser.js +44 -0
  47. package/lib/application/portal/toc/toc-content-parser.js.map +1 -0
  48. package/lib/application/portal/toc/toc-structure-generator.d.ts +6 -0
  49. package/lib/application/portal/toc/toc-structure-generator.js +84 -0
  50. package/lib/application/portal/toc/toc-structure-generator.js.map +1 -0
  51. package/lib/client-utils/auth-manager.d.ts +8 -3
  52. package/lib/client-utils/auth-manager.js +23 -10
  53. package/lib/client-utils/auth-manager.js.map +1 -0
  54. package/lib/client-utils/sdk-client.d.ts +4 -9
  55. package/lib/client-utils/sdk-client.js +9 -87
  56. package/lib/client-utils/sdk-client.js.map +1 -0
  57. package/lib/commands/api/transform.d.ts +7 -7
  58. package/lib/commands/api/transform.js +46 -51
  59. package/lib/commands/api/transform.js.map +1 -0
  60. package/lib/commands/api/validate.d.ts +4 -4
  61. package/lib/commands/api/validate.js +35 -36
  62. package/lib/commands/api/validate.js.map +1 -0
  63. package/lib/commands/auth/login.d.ts +3 -2
  64. package/lib/commands/auth/login.js +22 -53
  65. package/lib/commands/auth/login.js.map +1 -0
  66. package/lib/commands/auth/logout.d.ts +1 -1
  67. package/lib/commands/auth/logout.js +8 -13
  68. package/lib/commands/auth/logout.js.map +1 -0
  69. package/lib/commands/auth/status.d.ts +1 -1
  70. package/lib/commands/auth/status.js +9 -13
  71. package/lib/commands/auth/status.js.map +1 -0
  72. package/lib/commands/portal/copilot.d.ts +13 -0
  73. package/lib/commands/portal/copilot.js +32 -0
  74. package/lib/commands/portal/copilot.js.map +1 -0
  75. package/lib/commands/portal/generate.d.ts +10 -8
  76. package/lib/commands/portal/generate.js +28 -107
  77. package/lib/commands/portal/generate.js.map +1 -0
  78. package/lib/commands/portal/quickstart.d.ts +10 -0
  79. package/lib/commands/portal/quickstart.js +114 -0
  80. package/lib/commands/portal/quickstart.js.map +1 -0
  81. package/lib/commands/portal/recipe/new.d.ts +10 -0
  82. package/lib/commands/portal/recipe/new.js +38 -0
  83. package/lib/commands/portal/recipe/new.js.map +1 -0
  84. package/lib/commands/portal/serve.d.ts +16 -0
  85. package/lib/commands/portal/serve.js +80 -0
  86. package/lib/commands/portal/serve.js.map +1 -0
  87. package/lib/commands/portal/toc/new.d.ts +14 -0
  88. package/lib/commands/portal/toc/new.js +52 -0
  89. package/lib/commands/portal/toc/new.js.map +1 -0
  90. package/lib/commands/sdk/generate.d.ts +9 -8
  91. package/lib/commands/sdk/generate.js +39 -128
  92. package/lib/commands/sdk/generate.js.map +1 -0
  93. package/lib/config/axios-config.d.ts +2 -0
  94. package/lib/config/axios-config.js +10 -0
  95. package/lib/config/axios-config.js.map +1 -0
  96. package/lib/config/env.d.ts +26 -1
  97. package/lib/config/env.js +27 -4
  98. package/lib/config/env.js.map +1 -0
  99. package/lib/controllers/api/transform.d.ts +1 -1
  100. package/lib/controllers/api/transform.js +23 -22
  101. package/lib/controllers/api/transform.js.map +1 -0
  102. package/lib/controllers/api/validate.d.ts +3 -3
  103. package/lib/controllers/api/validate.js +19 -12
  104. package/lib/controllers/api/validate.js.map +1 -0
  105. package/lib/controllers/portal/quickstart.d.ts +13 -0
  106. package/lib/controllers/portal/quickstart.js +214 -0
  107. package/lib/controllers/portal/quickstart.js.map +1 -0
  108. package/lib/hooks/not-found.d.ts +3 -0
  109. package/lib/hooks/not-found.js +52 -0
  110. package/lib/hooks/not-found.js.map +1 -0
  111. package/lib/hooks/utils.d.ts +5 -0
  112. package/lib/hooks/utils.js +51 -0
  113. package/lib/hooks/utils.js.map +1 -0
  114. package/lib/index.d.ts +1 -1
  115. package/lib/index.js +2 -4
  116. package/lib/index.js.map +1 -0
  117. package/lib/infrastructure/api-client-utils.d.ts +6 -0
  118. package/lib/infrastructure/api-client-utils.js +34 -0
  119. package/lib/infrastructure/api-client-utils.js.map +1 -0
  120. package/lib/infrastructure/api-utils.d.ts +9 -0
  121. package/lib/infrastructure/api-utils.js +33 -0
  122. package/lib/infrastructure/api-utils.js.map +1 -0
  123. package/lib/infrastructure/env-info.d.ts +12 -0
  124. package/lib/infrastructure/env-info.js +58 -0
  125. package/lib/infrastructure/env-info.js.map +1 -0
  126. package/lib/infrastructure/file-service.d.ts +18 -0
  127. package/lib/infrastructure/file-service.js +76 -0
  128. package/lib/infrastructure/file-service.js.map +1 -0
  129. package/lib/infrastructure/launcher-service.d.ts +5 -0
  130. package/lib/infrastructure/launcher-service.js +47 -0
  131. package/lib/infrastructure/launcher-service.js.map +1 -0
  132. package/lib/infrastructure/services/api-service.d.ts +10 -0
  133. package/lib/infrastructure/services/api-service.js +55 -0
  134. package/lib/infrastructure/services/api-service.js.map +1 -0
  135. package/lib/infrastructure/services/auth-service.d.ts +11 -0
  136. package/lib/infrastructure/services/auth-service.js +35 -0
  137. package/lib/infrastructure/services/auth-service.js.map +1 -0
  138. package/lib/infrastructure/services/portal-service.d.ts +23 -0
  139. package/lib/infrastructure/services/portal-service.js +186 -0
  140. package/lib/infrastructure/services/portal-service.js.map +1 -0
  141. package/lib/infrastructure/services/telemetry-service.d.ts +8 -0
  142. package/lib/infrastructure/services/telemetry-service.js +40 -0
  143. package/lib/infrastructure/services/telemetry-service.js.map +1 -0
  144. package/lib/infrastructure/tmp-extensions.d.ts +2 -0
  145. package/lib/infrastructure/tmp-extensions.js +6 -0
  146. package/lib/infrastructure/tmp-extensions.js.map +1 -0
  147. package/lib/infrastructure/zip-service.d.ts +6 -0
  148. package/lib/infrastructure/zip-service.js +39 -0
  149. package/lib/infrastructure/zip-service.js.map +1 -0
  150. package/lib/prompts/auth/login.d.ts +5 -0
  151. package/lib/prompts/auth/login.js +13 -0
  152. package/lib/prompts/auth/login.js.map +1 -0
  153. package/lib/prompts/portal/common/base-prompts.d.ts +7 -0
  154. package/lib/prompts/portal/common/base-prompts.js +19 -0
  155. package/lib/prompts/portal/common/base-prompts.js.map +1 -0
  156. package/lib/prompts/portal/copilot.d.ts +14 -0
  157. package/lib/prompts/portal/copilot.js +71 -0
  158. package/lib/prompts/portal/copilot.js.map +1 -0
  159. package/lib/prompts/portal/generate.d.ts +11 -0
  160. package/lib/prompts/portal/generate.js +42 -0
  161. package/lib/prompts/portal/generate.js.map +1 -0
  162. package/lib/prompts/portal/quickstart.d.ts +30 -0
  163. package/lib/prompts/portal/quickstart.js +240 -0
  164. package/lib/prompts/portal/quickstart.js.map +1 -0
  165. package/lib/prompts/portal/recipe/new-recipe.d.ts +24 -0
  166. package/lib/prompts/portal/recipe/new-recipe.js +203 -0
  167. package/lib/prompts/portal/recipe/new-recipe.js.map +1 -0
  168. package/lib/prompts/portal/serve.d.ts +4 -0
  169. package/lib/prompts/portal/serve.js +14 -0
  170. package/lib/prompts/portal/serve.js.map +1 -0
  171. package/lib/prompts/portal/toc/new-toc.d.ts +11 -0
  172. package/lib/prompts/portal/toc/new-toc.js +39 -0
  173. package/lib/prompts/portal/toc/new-toc.js.map +1 -0
  174. package/lib/prompts/sdk/generate.d.ts +11 -0
  175. package/lib/prompts/sdk/generate.js +42 -0
  176. package/lib/prompts/sdk/generate.js.map +1 -0
  177. package/lib/types/api/account.d.ts +10 -0
  178. package/lib/types/api/account.js +2 -0
  179. package/lib/types/api/account.js.map +1 -0
  180. package/lib/types/api/transform.d.ts +19 -4
  181. package/lib/types/api/transform.js +19 -4
  182. package/lib/types/api/transform.js.map +1 -0
  183. package/lib/types/api/validate.d.ts +3 -3
  184. package/lib/types/api/validate.js +2 -2
  185. package/lib/types/api/validate.js.map +1 -0
  186. package/lib/types/build/build.d.ts +14 -0
  187. package/lib/types/build/build.js +4 -0
  188. package/lib/types/build/build.js.map +1 -0
  189. package/lib/types/build-context.d.ts +13 -0
  190. package/lib/types/build-context.js +30 -0
  191. package/lib/types/build-context.js.map +1 -0
  192. package/lib/types/common/result.d.ts +17 -0
  193. package/lib/types/common/result.js +32 -0
  194. package/lib/types/common/result.js.map +1 -0
  195. package/lib/types/events/domain-event.d.ts +8 -0
  196. package/lib/types/events/domain-event.js +11 -0
  197. package/lib/types/events/domain-event.js.map +1 -0
  198. package/lib/types/events/quickstart-completed.d.ts +7 -0
  199. package/lib/types/events/quickstart-completed.js +10 -0
  200. package/lib/types/events/quickstart-completed.js.map +1 -0
  201. package/lib/types/events/quickstart-initiated.d.ts +7 -0
  202. package/lib/types/events/quickstart-initiated.js +10 -0
  203. package/lib/types/events/quickstart-initiated.js.map +1 -0
  204. package/lib/types/events/recipe-creation-failed.d.ts +5 -0
  205. package/lib/types/events/recipe-creation-failed.js +8 -0
  206. package/lib/types/events/recipe-creation-failed.js.map +1 -0
  207. package/lib/types/events/toc-creation-failed.d.ts +5 -0
  208. package/lib/types/events/toc-creation-failed.js +8 -0
  209. package/lib/types/events/toc-creation-failed.js.map +1 -0
  210. package/lib/types/file/directoryPath.d.ts +7 -0
  211. package/lib/types/file/directoryPath.js +16 -0
  212. package/lib/types/file/directoryPath.js.map +1 -0
  213. package/lib/types/file/fileName.d.ts +5 -0
  214. package/lib/types/file/fileName.js +9 -0
  215. package/lib/types/file/fileName.js.map +1 -0
  216. package/lib/types/file/filePath.d.ts +8 -0
  217. package/lib/types/file/filePath.js +11 -0
  218. package/lib/types/file/filePath.js.map +1 -0
  219. package/lib/types/flags-provider.d.ts +15 -0
  220. package/lib/types/flags-provider.js +34 -0
  221. package/lib/types/flags-provider.js.map +1 -0
  222. package/lib/types/portal/generate.d.ts +13 -9
  223. package/lib/types/portal/generate.js +3 -2
  224. package/lib/types/portal/generate.js.map +1 -0
  225. package/lib/types/portal/quickstart.d.ts +17 -0
  226. package/lib/types/portal/quickstart.js +2 -0
  227. package/lib/types/portal/quickstart.js.map +1 -0
  228. package/lib/types/portal/serve.d.ts +12 -0
  229. package/lib/types/portal/serve.js +2 -0
  230. package/lib/types/portal/serve.js.map +1 -0
  231. package/lib/types/portal-context.d.ts +11 -0
  232. package/lib/types/portal-context.js +28 -0
  233. package/lib/types/portal-context.js.map +1 -0
  234. package/lib/types/recipe/recipe.d.ts +37 -0
  235. package/lib/types/recipe/recipe.js +6 -0
  236. package/lib/types/recipe/recipe.js.map +1 -0
  237. package/lib/types/sdk/generate.d.ts +11 -10
  238. package/lib/types/sdk/generate.js +11 -12
  239. package/lib/types/sdk/generate.js.map +1 -0
  240. package/lib/types/sdk-context.d.ts +13 -0
  241. package/lib/types/sdk-context.js +28 -0
  242. package/lib/types/sdk-context.js.map +1 -0
  243. package/lib/types/sdl/sdl.d.ts +12 -0
  244. package/lib/types/sdl/sdl.js +2 -0
  245. package/lib/types/sdl/sdl.js.map +1 -0
  246. package/lib/types/spec-context.d.ts +7 -0
  247. package/lib/types/spec-context.js +12 -0
  248. package/lib/types/spec-context.js.map +1 -0
  249. package/lib/types/toc/toc.d.ts +31 -0
  250. package/lib/types/toc/toc.js +9 -0
  251. package/lib/types/toc/toc.js.map +1 -0
  252. package/lib/types/utils.d.ts +3 -3
  253. package/lib/types/utils.js +2 -2
  254. package/lib/types/utils.js.map +1 -0
  255. package/lib/utils/utils.d.ts +16 -7
  256. package/lib/utils/utils.js +142 -86
  257. package/lib/utils/utils.js.map +1 -0
  258. package/lib/validators/common/directoryValidator.d.ts +5 -0
  259. package/lib/validators/common/directoryValidator.js +22 -0
  260. package/lib/validators/common/directoryValidator.js.map +1 -0
  261. package/lib/validators/portal/serve-validator.d.ts +6 -0
  262. package/lib/validators/portal/serve-validator.js +15 -0
  263. package/lib/validators/portal/serve-validator.js.map +1 -0
  264. package/package.json +100 -43
  265. package/bin/run +0 -5
  266. package/lib/controllers/portal/generate.d.ts +0 -2
  267. package/lib/controllers/portal/generate.js +0 -49
  268. package/lib/controllers/sdk/generate.d.ts +0 -4
  269. package/lib/controllers/sdk/generate.js +0 -64
@@ -1,135 +1,46 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const path = require("path");
4
- const fs = require("fs-extra");
5
- const command_1 = require("@oclif/command");
6
- const sdk_client_1 = require("../../client-utils/sdk-client");
7
- const sdk_1 = require("@apimatic/sdk");
8
- const utils_1 = require("../../utils/utils");
9
- const generate_1 = require("../../controllers/sdk/generate");
10
- class SdkGenerate extends command_1.Command {
1
+ import { Command, Flags } from "@oclif/core";
2
+ import { DirectoryPath } from "../../types/file/directoryPath.js";
3
+ import { FlagsProvider } from "../../types/flags-provider.js";
4
+ import { SdkGeneratePrompts } from "../../prompts/sdk/generate.js";
5
+ import { GenerateAction } from "../../actions/sdk/generate.js";
6
+ import { LanguagePlatform } from "../../types/sdk/generate.js";
7
+ const DEFAULT_WORKING_DIRECTORY = "./";
8
+ class SdkGenerate extends Command {
9
+ constructor() {
10
+ super(...arguments);
11
+ this.prompts = new SdkGeneratePrompts();
12
+ this.getConfigDir = () => {
13
+ return new DirectoryPath(this.config.configDir);
14
+ };
15
+ }
11
16
  async run() {
12
- const { flags } = this.parse(SdkGenerate);
13
- const zip = flags.zip;
14
- const fileName = flags.file ? utils_1.getFileNameFromPath(flags.file) : utils_1.getFileNameFromPath(flags.url);
15
- const sdkFolderPath = path.join(flags.destination, `${fileName}_sdk_${flags.platform}`.toLowerCase());
16
- const zippedSDKPath = path.join(flags.destination, `${fileName}_sdk_${flags.platform}.zip`.toLowerCase());
17
- // Check if at destination, SDK already exists and throw error if force flag is not set for both zip and extracted
18
- if (fs.existsSync(sdkFolderPath) && !flags.force && !zip) {
19
- throw new Error(`Can't download SDK to path ${sdkFolderPath}, because it already exists`);
20
- }
21
- else if (fs.existsSync(zippedSDKPath) && !flags.force && zip) {
22
- throw new Error(`Can't download SDK to path ${zippedSDKPath}, because it already exists`);
23
- }
24
- try {
25
- if (!(await fs.pathExists(path.resolve(flags.destination)))) {
26
- throw new Error(`Destination path ${flags.destination} does not exist`);
27
- }
28
- else if (!(await fs.pathExists(path.resolve(flags.file)))) {
29
- throw new Error(`Specification file ${flags.file} does not exist`);
30
- }
31
- const overrideAuthKey = flags["auth-key"] ? flags["auth-key"] : null;
32
- const client = await sdk_client_1.SDKClient.getInstance().getClient(overrideAuthKey, this.config.configDir);
33
- const sdkGenerationController = new sdk_1.CodeGenerationExternalApisController(client);
34
- // Get generation id for the specification and platform
35
- const codeGenId = await generate_1.getSDKGenerationId(flags, sdkGenerationController);
36
- // If user wanted to download the SDK as well
37
- const sdkDownloadParams = {
38
- codeGenId,
39
- zippedSDKPath,
40
- sdkFolderPath,
41
- zip
42
- };
43
- const sdkPath = await generate_1.downloadGeneratedSDK(sdkDownloadParams, sdkGenerationController);
44
- this.log(`Success! Your SDK is located at ${sdkPath}`);
45
- }
46
- catch (error) {
47
- if (error.result) {
48
- const apiError = error;
49
- const result = apiError.result;
50
- if (apiError.statusCode === 400 && utils_1.isJSONParsable(result.message)) {
51
- const errors = JSON.parse(result.message);
52
- if (Array.isArray(errors.Errors) && apiError.statusCode === 400) {
53
- this.error(utils_1.replaceHTML(`${JSON.parse(result.message).Errors[0]}`));
54
- }
55
- }
56
- else if (apiError.statusCode === 401 && apiError.body && typeof apiError.body === "string") {
57
- this.error("You are not authorized to perform this action");
58
- }
59
- else if (apiError.statusCode === 500 &&
60
- apiError.body &&
61
- typeof apiError.body === "string" &&
62
- utils_1.isJSONParsable(apiError.body)) {
63
- this.error(JSON.parse(apiError.body).message);
64
- }
65
- else if (apiError.statusCode === 422 &&
66
- apiError.body &&
67
- typeof apiError.body === "string" &&
68
- utils_1.isJSONParsable(apiError.body)) {
69
- this.error(JSON.parse(apiError.body)["dto.Url"][0]);
70
- }
71
- else {
72
- this.error(utils_1.replaceHTML(result.message));
73
- }
74
- }
75
- else if (error.statusCode === 401) {
76
- this.error("You are not authorized to perform this action");
77
- }
78
- else if (error.statusCode === 402 &&
79
- error.body &&
80
- typeof error.body === "string") {
81
- this.error(utils_1.replaceHTML(error.body));
82
- }
83
- else {
84
- this.error(`${error.message}`);
85
- }
86
- }
17
+ const { flags: { platform, spec, destination, force, zip: zipSdk, "auth-key": authKey } } = await this.parse(SdkGenerate);
18
+ const workingDirectory = new DirectoryPath(DEFAULT_WORKING_DIRECTORY);
19
+ const specDirectory = new DirectoryPath(spec);
20
+ const sdkDirectory = destination ? new DirectoryPath(destination) : workingDirectory.join("sdk").join(platform);
21
+ var action = new GenerateAction(this.getConfigDir(), authKey);
22
+ const result = await action.execute(specDirectory, sdkDirectory, platform, SdkGenerate.id, force, zipSdk);
23
+ result.mapAll(() => this.prompts.displayOutroMessage(sdkDirectory), (message) => this.prompts.logError(message));
87
24
  }
88
25
  }
89
- exports.default = SdkGenerate;
90
- SdkGenerate.description = "Generate SDK for your APIs";
91
- SdkGenerate.flags = {
92
- platform: command_1.flags.string({
93
- parse: (input) => input.toUpperCase(),
26
+ SdkGenerate.description = "Generate an SDK for your API";
27
+ SdkGenerate.flags = Object.assign(Object.assign(Object.assign({ platform: Flags.string({
94
28
  required: true,
95
- description: `language platform for sdk
96
- Simple: CSHARP|JAVA|PYTHON|RUBY|PHP|TYPESCRIPT
97
- Legacy: CS_NET_STANDARD_LIB|JAVA_ECLIPSE_JRE_LIB|PHP_GENERIC_LIB|PYTHON_GENERIC_LIB|RUBY_GENERIC_LIB|TS_GENERIC_LIB`
98
- }),
99
- file: command_1.flags.string({
100
- parse: (input) => path.resolve(input),
101
- default: "",
102
- description: "path to the API specification to generate SDKs for"
103
- }),
104
- url: command_1.flags.string({
105
- default: "",
106
- description: "URL to the API specification to generate SDKs for. Can be used in place of the --file option if the API specification is publicly available."
107
- }),
108
- destination: command_1.flags.string({
109
- parse: (input) => path.resolve(input),
110
- default: path.resolve("./"),
111
- description: "directory to download the generated SDK to"
112
- }),
113
- force: command_1.flags.boolean({
114
- char: "f",
29
+ options: Object.values(LanguagePlatform).map((p) => p.toString()),
30
+ description: `language platform for sdk`
31
+ }), spec: Flags.string({
32
+ description: "path to the folder containing the API specification file.",
33
+ default: "./src/spec"
34
+ }), destination: Flags.string({
35
+ char: "d",
36
+ description: `[default: ./sdk/<platform>] path where the sdk will be generated.`
37
+ }) }, FlagsProvider.force), { zip: Flags.boolean({
115
38
  default: false,
116
- description: "overwrite if an SDK already exists in the destination"
117
- }),
118
- zip: command_1.flags.boolean({ default: false, description: "download the generated SDK as a .zip archive" }),
119
- "auth-key": command_1.flags.string({
120
- default: "",
121
- description: "override current authentication state with an authentication key"
122
- })
123
- };
39
+ description: "download the generated SDK as a .zip archive"
40
+ }) }), FlagsProvider.authKey);
124
41
  SdkGenerate.examples = [
125
- `$ apimatic sdk:generate --platform="CSHARP" --file="./specs/sample.json"
126
- Generating SDK... done
127
- Downloading SDK... done
128
- Success! Your SDK is located at swagger_sdk_csharp`,
129
- `
130
- $ apimatic sdk:generate --platform="CSHARP" --url=https://petstore.swagger.io/v2/swagger.json
131
- Generating SDK... done
132
- Downloading SDK... done
133
- Success! Your SDK is located at swagger_sdk_csharp
134
- `
42
+ `apimatic sdk:generate --platform=java`,
43
+ `apimatic sdk:generate --platform=csharp --spec="./src/spec"`
135
44
  ];
45
+ export default SdkGenerate;
46
+ //# sourceMappingURL=generate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/commands/sdk/generate.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,EAAE,aAAa,EAAE,MAAM,mCAAmC,CAAC;AAClE,OAAO,EAAE,aAAa,EAAE,MAAM,+BAA+B,CAAC;AAC9D,OAAO,EAAE,kBAAkB,EAAE,MAAM,+BAA+B,CAAC;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AC,OAAO,EAAE,EAAE,CAAC,IAAI,CAAC,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAC,CAC5C,CAAC;IACJ,CAAC;;AA9CM,uBAAW,GAAG,8BAA8B,AAAjC,CAAkC;AAC7C,iBAAK,+CACV,QAAQ,EAAE,KAAK,CAAC,MAAM,CAAC;QACrB,QAAQ,EAAE,IAAI;QACd,OAAO,EAAE,MAAM,CAAC,MAAM,CAAC,gBAAgB,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,QAAQ,EAAE,CAAC;QACjE,WAAW,EAAE,2BAA2B;KACzC,CAAC,EACF,IAAI,EAAE,KAAK,CAAC,MAAM,CAAC;QACjB,WAAW,EAAE,2DAA2D;QACxE,OAAO,EAAE,YAAY;KACtB,CAAC,EACF,WAAW,EAAE,KAAK,CAAC,MAAM,CAAC;QACxB,IAAI,EAAE,GAAG;QACT,WAAW,EAAE,mEAAmE;KACjF,CAAC,IACC,aAAa,CAAC,KAAK,KACtB,GAAG,EAAE,KAAK,CAAC,OAAO,CAAC;QACjB,OAAO,EAAE,KAAK;QACd,WAAW,EAAE,8CAA8C;KAC5D,CAAC,KACC,aAAa,CAAC,OAAO,CAnBd,CAoBV;AAEK,oBAAQ,GAAG;IAChB,uCAAuC;IACvC,6DAA6D;CAC9D,AAHc,CAGb;eA3BiB,WAAW"}
@@ -0,0 +1,2 @@
1
+ declare const axiosInstance: import("axios").AxiosInstance;
2
+ export default axiosInstance;
@@ -0,0 +1,10 @@
1
+ import axios from "axios";
2
+ const fiftyMBsInBytes = 50 * 1024 * 1024;
3
+ const fiveMinutesInMilliseconds = 5 * 60 * 1000;
4
+ const axiosInstance = axios.create({
5
+ maxContentLength: fiftyMBsInBytes,
6
+ maxBodyLength: fiftyMBsInBytes,
7
+ timeout: fiveMinutesInMilliseconds
8
+ });
9
+ export default axiosInstance;
10
+ //# sourceMappingURL=axios-config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"axios-config.js","sourceRoot":"","sources":["../../src/config/axios-config.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAE1B,MAAM,eAAe,GAAG,EAAE,GAAG,IAAI,GAAG,IAAI,CAAC;AACzC,MAAM,yBAAyB,GAAG,CAAC,GAAG,EAAE,GAAG,IAAI,CAAC;AAEhD,MAAM,aAAa,GAAG,KAAK,CAAC,MAAM,CAAC;IACjC,gBAAgB,EAAE,eAAe;IACjC,aAAa,EAAE,eAAe;IAC9B,OAAO,EAAE,yBAAyB;CACnC,CAAC,CAAC;AAEH,eAAe,aAAa,CAAC"}
@@ -1 +1,26 @@
1
- export declare const baseURL = "https://www.apimatic.io/api";
1
+ export declare const baseURL = "https://api.apimatic.io";
2
+ export declare const metadataFileContent: {
3
+ ImportSettings: {
4
+ AutoGenerateTestCases: boolean;
5
+ ImportAdditionalHeader: boolean;
6
+ ImportAdditionalTypeCombinatorModels: boolean;
7
+ ImportTypeCombinatorsWithOnlyOneType: boolean;
8
+ };
9
+ CodeGenSettings: {
10
+ Timeout: number;
11
+ ValidateRequiredParameters: boolean;
12
+ AddSingleAuthDeprecatedCode: boolean;
13
+ EnableGlobalUserAgent: boolean;
14
+ UserAgent: string;
15
+ EnableLogging: boolean;
16
+ EnableModelKeywordArgsInRuby: boolean;
17
+ SymbolizeHashKeysInRuby: boolean;
18
+ ReturnCompleteHttpResponse: boolean;
19
+ UserConfigurableRetries: boolean;
20
+ UseEnumPrefix: boolean;
21
+ ExtendedAdditionalPropertiesSupport: boolean;
22
+ EnforceStandardizedCasing: boolean;
23
+ ControllerPostfix: string;
24
+ DoNotSplitWords: string[];
25
+ };
26
+ };
package/lib/config/env.js CHANGED
@@ -1,4 +1,27 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.baseURL = void 0;
4
- exports.baseURL = "https://www.apimatic.io/api";
1
+ export const baseURL = "https://api.apimatic.io";
2
+ export const metadataFileContent = {
3
+ ImportSettings: {
4
+ AutoGenerateTestCases: false,
5
+ ImportAdditionalHeader: false,
6
+ ImportAdditionalTypeCombinatorModels: false,
7
+ ImportTypeCombinatorsWithOnlyOneType: false
8
+ },
9
+ CodeGenSettings: {
10
+ Timeout: 30,
11
+ ValidateRequiredParameters: true,
12
+ AddSingleAuthDeprecatedCode: false,
13
+ EnableGlobalUserAgent: true,
14
+ UserAgent: "{language}-SDK/{version} (OS: {os-info}, Engine: {engine}/{engine-version})",
15
+ EnableLogging: true,
16
+ EnableModelKeywordArgsInRuby: true,
17
+ SymbolizeHashKeysInRuby: true,
18
+ ReturnCompleteHttpResponse: true,
19
+ UserConfigurableRetries: true,
20
+ UseEnumPrefix: false,
21
+ ExtendedAdditionalPropertiesSupport: true,
22
+ EnforceStandardizedCasing: true,
23
+ ControllerPostfix: "Api",
24
+ DoNotSplitWords: ["oauth"]
25
+ }
26
+ };
27
+ //# sourceMappingURL=env.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"env.js","sourceRoot":"","sources":["../../src/config/env.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,yBAAyB,CAAC;AACjD,MAAM,CAAC,MAAM,mBAAmB,GAAG;IACjC,cAAc,EAAE;QACd,qBAAqB,EAAE,KAAK;QAC5B,sBAAsB,EAAE,KAAK;QAC7B,oCAAoC,EAAE,KAAK;QAC3C,oCAAoC,EAAE,KAAK;KAC5C;IACD,eAAe,EAAE;QACf,OAAO,EAAE,EAAE;QACX,0BAA0B,EAAE,IAAI;QAChC,2BAA2B,EAAE,KAAK;QAClC,qBAAqB,EAAE,IAAI;QAC3B,SAAS,EAAE,6EAA6E;QACxF,aAAa,EAAE,IAAI;QACnB,4BAA4B,EAAE,IAAI;QAClC,uBAAuB,EAAE,IAAI;QAC7B,0BAA0B,EAAE,IAAI;QAChC,uBAAuB,EAAE,IAAI;QAC7B,aAAa,EAAE,KAAK;QACpB,mCAAmC,EAAE,IAAI;QACzC,yBAAyB,EAAE,IAAI;QAC/B,iBAAiB,EAAE,KAAK;QACxB,eAAe,EAAE,CAAC,OAAO,CAAC;KAC3B;CACF,CAAC"}
@@ -1,4 +1,4 @@
1
- import { DownloadTransformationParams, TransformationIdParams } from "../../types/api/transform";
1
+ import { DownloadTransformationParams, TransformationIdParams } from "../../types/api/transform.js";
2
2
  import { ExportFormats, Transformation, TransformationController } from "@apimatic/sdk";
3
3
  export declare const getTransformationId: ({ file, url, format }: TransformationIdParams, transformationController: TransformationController) => Promise<Transformation>;
4
4
  export declare const downloadTransformationFile: ({ id, destinationFilePath, transformationController }: DownloadTransformationParams) => Promise<string>;
@@ -1,49 +1,50 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getValidFormat = exports.downloadTransformationFile = exports.getTransformationId = void 0;
4
- const cli_ux_1 = require("cli-ux");
5
- const fs = require("fs-extra");
6
- const utils_1 = require("../../utils/utils");
7
- const sdk_1 = require("@apimatic/sdk");
8
- exports.getTransformationId = async ({ file, url, format }, transformationController) => {
9
- cli_ux_1.default.action.start("Transforming API specification");
1
+ import { ux } from "@oclif/core";
2
+ import fsExtra from "fs-extra";
3
+ import { writeFileUsingReadableStream } from "../../utils/utils.js";
4
+ import { TransformationFormats } from "../../types/api/transform.js";
5
+ import { ContentType, ExportFormats, FileWrapper } from "@apimatic/sdk";
6
+ export const getTransformationId = async ({ file, url, format }, transformationController) => {
7
+ ux.action.start("Transforming API specification");
10
8
  let generation;
11
9
  if (file) {
12
- const fileDescriptor = new sdk_1.FileWrapper(fs.createReadStream(file));
13
- generation = await transformationController.transformViaFile(fileDescriptor, format);
10
+ const fileDescriptor = new FileWrapper(fsExtra.createReadStream(file));
11
+ generation = await transformationController.transformViaFile(ContentType.EnumMultipartformdata, fileDescriptor, format);
14
12
  }
15
13
  else if (url) {
16
14
  const body = {
17
15
  url: url,
18
16
  exportFormat: format
19
17
  };
20
- generation = await transformationController.transformViaURL(body);
18
+ generation = await transformationController.transformViaUrl(body);
21
19
  }
22
20
  else {
23
21
  throw new Error("Please provide a specification file");
24
22
  }
25
- cli_ux_1.default.action.stop();
23
+ ux.action.stop();
26
24
  return generation.result;
27
25
  };
28
- exports.downloadTransformationFile = async ({ id, destinationFilePath, transformationController }) => {
29
- cli_ux_1.default.action.start("Downloading Transformed file");
26
+ export const downloadTransformationFile = async ({ id, destinationFilePath, transformationController }) => {
27
+ ux.action.start("Downloading Transformed file");
30
28
  const { result } = await transformationController.downloadTransformedFile(id);
31
29
  if (result.readable) {
32
- await utils_1.writeFileUsingReadableStream(result, destinationFilePath);
30
+ await writeFileUsingReadableStream(result, destinationFilePath);
33
31
  }
34
32
  else {
35
33
  throw new Error("Couldn't save transformation file");
36
34
  }
37
- cli_ux_1.default.action.stop();
35
+ ux.action.stop();
38
36
  return destinationFilePath;
39
37
  };
40
38
  // Get valid platform from user's input, convert simple platform to valid Platforms enum value
41
- exports.getValidFormat = (format) => {
42
- if (Object.keys(sdk_1.ExportFormats).find((exportFormat) => exportFormat === format)) {
43
- return sdk_1.ExportFormats[format];
39
+ export const getValidFormat = (format) => {
40
+ const key = Object.keys(TransformationFormats).find((value) => value === format);
41
+ if (key) {
42
+ const transformationFormat = TransformationFormats[key];
43
+ return ExportFormats[transformationFormat];
44
44
  }
45
45
  else {
46
- const formats = Object.keys(sdk_1.ExportFormats).join("|");
47
- throw new Error(`Please provide a valid platform i.e. ${formats}`);
46
+ const formats = Object.keys(TransformationFormats).join("|");
47
+ throw new Error(`Please provide a valid platform, e.g. ${formats}`);
48
48
  }
49
49
  };
50
+ //# sourceMappingURL=transform.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"transform.js","sourceRoot":"","sources":["../../../src/controllers/api/transform.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,EAAE,EAAE,MAAM,aAAa,CAAC;AACjC,OAAO,OAAO,MAAM,UAAU,CAAC;AAE/B,OAAO,EAAE,4BAA4B,EAAE,MAAM,sBAAsB,CAAC;AACpE,OAAO,EAGL,qBAAq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AC;QAC/C,MAAM,4BAA4B,CAAC,MAA+B,EAAE,mBAAmB,CAAC,CAAC;IAC3F,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,mCAAmC,CAAC,CAAC;IACvD,CAAC;IACD,EAAE,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IACjB,OAAO,mBAAmB,CAAC;AAC7B,CAAC,CAAC;AACF,8FAA8F;AAC9F,MAAM,CAAC,MAAM,cAAc,GAAG,CAAC,MAAc,EAAE,EAAE;IAC/C,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,CAAC,KAAK,EAAE,EAAE,CAAC,KAAK,KAAK,MAAM,CAElE,CAAC;IACd,IAAI,GAAG,EAAE,CAAC;QACR,MAAM,oBAAoB,GAAG,qBAAqB,CAAC,GAAG,CAA+B,CAAC;QACtF,OAAO,aAAa,CAAC,oBAAoB,CAAC,CAAC;IAC7C,CAAC;SAAM,CAAC;QACN,MAAM,OAAO,GAAG,MAAM,CAAC,IAAI,CAAC,qBAAqB,CAAC,CAAC,IAAI,CAAC,GAAG,CAAC,CAAC;QAC7D,MAAM,IAAI,KAAK,CAAC,yCAAyC,OAAO,EAAE,CAAC,CAAC;IACtE,CAAC;AACH,CAAC,CAAC"}
@@ -1,3 +1,3 @@
1
- import { GetValidationParams } from "../../types/api/validate";
2
- import { APIValidationExternalApisController, ApiValidationSummary } from "@apimatic/sdk";
3
- export declare const getValidation: ({ file, url }: GetValidationParams, apiValidationController: APIValidationExternalApisController) => Promise<ApiValidationSummary>;
1
+ import { ApiValidationExternalApisController, ApiValidationSummary } from "@apimatic/sdk";
2
+ import { GetValidationParams } from "../../types/api/validate.js";
3
+ export declare const getValidationSummary: ({ file, url }: GetValidationParams, apiValidationController: ApiValidationExternalApisController) => Promise<ApiValidationSummary>;
@@ -1,22 +1,29 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getValidation = void 0;
4
- const cli_ux_1 = require("cli-ux");
5
- const fs = require("fs-extra");
6
- const core_1 = require("@apimatic/core");
7
- exports.getValidation = async ({ file, url }, apiValidationController) => {
1
+ import fsExtra from "fs-extra";
2
+ import { ContentType, FileWrapper } from "@apimatic/sdk";
3
+ import { createTempDirectory, deleteFile, zipDirectory } from "../../utils/utils.js";
4
+ export const getValidationSummary = async ({ file, url }, apiValidationController) => {
8
5
  let validation;
9
- cli_ux_1.default.action.start("Validating specification file");
10
6
  if (file) {
11
- const fileDescriptor = new core_1.FileWrapper(fs.createReadStream(file));
12
- validation = await apiValidationController.validateAPIViaFile(fileDescriptor);
7
+ const fileStatus = fsExtra.statSync(file);
8
+ if (fileStatus.isDirectory()) {
9
+ const tempDir = await createTempDirectory();
10
+ const zipPath = await zipDirectory(file, tempDir);
11
+ const zipFile = new FileWrapper(fsExtra.createReadStream(zipPath));
12
+ validation = await apiValidationController.validateApiViaFile(ContentType.EnumMultipartformdata, zipFile);
13
+ await deleteFile(zipPath);
14
+ await fsExtra.remove(tempDir);
15
+ }
16
+ else {
17
+ const fileDescriptor = new FileWrapper(fsExtra.createReadStream(file));
18
+ validation = await apiValidationController.validateApiViaFile(ContentType.EnumMultipartformdata, fileDescriptor);
19
+ }
13
20
  }
14
21
  else if (url) {
15
- validation = await apiValidationController.validateAPIViaURL(url);
22
+ validation = await apiValidationController.validateApiViaUrl(url);
16
23
  }
17
24
  else {
18
25
  throw new Error("Please provide a specification file");
19
26
  }
20
- cli_ux_1.default.action.stop();
21
27
  return validation.result;
22
28
  };
29
+ //# sourceMappingURL=validate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"validate.js","sourceRoot":"","sources":["../../../src/controllers/api/validate.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,UAAU,CAAC;AAC/B,OAAO,EAA0E,WAAW,EAAE,WAAW,EAAE,MAAM,eAAe,CAAC;AAEjI,OAAO,EAAE,mBAAmB,EAAE,UAAU,EAAE,YAAY,EAAE,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Controller, ApiValidationSummary } from "@apimatic/sdk";
2
+ import { SpecFile } from "../../types/portal/quickstart.js";
3
+ import { PortalQuickstartPrompts } from "../../prompts/portal/quickstart.js";
4
+ export declare class PortalQuickstartController {
5
+ private readonly zipService;
6
+ private readonly fileService;
7
+ private readonly specUrl;
8
+ isUserAuthenticated(configDir: string): Promise<boolean>;
9
+ getSpecFile(spec: string): Promise<SpecFile>;
10
+ getSpecValidationSummary(prompts: PortalQuickstartPrompts, specFile: SpecFile, apiValidationController: ApiValidationExternalApisController): Promise<ApiValidationSummary>;
11
+ private downloadRepositoryFromGitHub;
12
+ setupBuildDirectory(prompts: PortalQuickstartPrompts, targetFolder: string, specFile: SpecFile, validationSummary: ApiValidationSummary, languages: string[]): Promise<void>;
13
+ }