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

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 (251) hide show
  1. package/README.md +249 -99
  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 +11 -0
  10. package/lib/actions/portal/copilot.js +49 -0
  11. package/lib/actions/portal/copilot.js.map +1 -0
  12. package/lib/actions/portal/generate.d.ts +13 -0
  13. package/lib/actions/portal/generate.js +61 -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 +0 -1
  55. package/lib/client-utils/sdk-client.js +25 -55
  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 +43 -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 +26 -33
  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 +12 -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 +105 -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 +15 -0
  106. package/lib/controllers/portal/quickstart.js +217 -0
  107. package/lib/controllers/portal/quickstart.js.map +1 -0
  108. package/lib/index.d.ts +1 -1
  109. package/lib/index.js +2 -4
  110. package/lib/index.js.map +1 -0
  111. package/lib/infrastructure/api-utils.d.ts +9 -0
  112. package/lib/infrastructure/api-utils.js +33 -0
  113. package/lib/infrastructure/api-utils.js.map +1 -0
  114. package/lib/infrastructure/env-info.d.ts +8 -0
  115. package/lib/infrastructure/env-info.js +37 -0
  116. package/lib/infrastructure/env-info.js.map +1 -0
  117. package/lib/infrastructure/file-service.d.ts +18 -0
  118. package/lib/infrastructure/file-service.js +76 -0
  119. package/lib/infrastructure/file-service.js.map +1 -0
  120. package/lib/infrastructure/services/api-service.d.ts +10 -0
  121. package/lib/infrastructure/services/api-service.js +54 -0
  122. package/lib/infrastructure/services/api-service.js.map +1 -0
  123. package/lib/infrastructure/services/auth-service.d.ts +11 -0
  124. package/lib/infrastructure/services/auth-service.js +33 -0
  125. package/lib/infrastructure/services/auth-service.js.map +1 -0
  126. package/lib/infrastructure/services/portal-service.d.ts +20 -0
  127. package/lib/infrastructure/services/portal-service.js +163 -0
  128. package/lib/infrastructure/services/portal-service.js.map +1 -0
  129. package/lib/infrastructure/services/telemetry-service.d.ts +8 -0
  130. package/lib/infrastructure/services/telemetry-service.js +40 -0
  131. package/lib/infrastructure/services/telemetry-service.js.map +1 -0
  132. package/lib/infrastructure/tmp-extensions.d.ts +2 -0
  133. package/lib/infrastructure/tmp-extensions.js +6 -0
  134. package/lib/infrastructure/tmp-extensions.js.map +1 -0
  135. package/lib/infrastructure/zip-service.d.ts +6 -0
  136. package/lib/infrastructure/zip-service.js +39 -0
  137. package/lib/infrastructure/zip-service.js.map +1 -0
  138. package/lib/prompts/auth/login.d.ts +5 -0
  139. package/lib/prompts/auth/login.js +13 -0
  140. package/lib/prompts/auth/login.js.map +1 -0
  141. package/lib/prompts/portal/common/base-prompts.d.ts +7 -0
  142. package/lib/prompts/portal/common/base-prompts.js +19 -0
  143. package/lib/prompts/portal/common/base-prompts.js.map +1 -0
  144. package/lib/prompts/portal/copilot.d.ts +8 -0
  145. package/lib/prompts/portal/copilot.js +54 -0
  146. package/lib/prompts/portal/copilot.js.map +1 -0
  147. package/lib/prompts/portal/generate.d.ts +11 -0
  148. package/lib/prompts/portal/generate.js +42 -0
  149. package/lib/prompts/portal/generate.js.map +1 -0
  150. package/lib/prompts/portal/quickstart.d.ts +30 -0
  151. package/lib/prompts/portal/quickstart.js +240 -0
  152. package/lib/prompts/portal/quickstart.js.map +1 -0
  153. package/lib/prompts/portal/recipe/new-recipe.d.ts +24 -0
  154. package/lib/prompts/portal/recipe/new-recipe.js +203 -0
  155. package/lib/prompts/portal/recipe/new-recipe.js.map +1 -0
  156. package/lib/prompts/portal/serve.d.ts +4 -0
  157. package/lib/prompts/portal/serve.js +14 -0
  158. package/lib/prompts/portal/serve.js.map +1 -0
  159. package/lib/prompts/portal/toc/new-toc.d.ts +11 -0
  160. package/lib/prompts/portal/toc/new-toc.js +39 -0
  161. package/lib/prompts/portal/toc/new-toc.js.map +1 -0
  162. package/lib/prompts/sdk/generate.d.ts +11 -0
  163. package/lib/prompts/sdk/generate.js +42 -0
  164. package/lib/prompts/sdk/generate.js.map +1 -0
  165. package/lib/types/api/account.d.ts +10 -0
  166. package/lib/types/api/account.js +2 -0
  167. package/lib/types/api/account.js.map +1 -0
  168. package/lib/types/api/transform.d.ts +19 -4
  169. package/lib/types/api/transform.js +19 -4
  170. package/lib/types/api/transform.js.map +1 -0
  171. package/lib/types/api/validate.d.ts +3 -3
  172. package/lib/types/api/validate.js +2 -2
  173. package/lib/types/api/validate.js.map +1 -0
  174. package/lib/types/build/build.d.ts +14 -0
  175. package/lib/types/build/build.js +4 -0
  176. package/lib/types/build/build.js.map +1 -0
  177. package/lib/types/build-context.d.ts +13 -0
  178. package/lib/types/build-context.js +30 -0
  179. package/lib/types/build-context.js.map +1 -0
  180. package/lib/types/common/result.d.ts +17 -0
  181. package/lib/types/common/result.js +32 -0
  182. package/lib/types/common/result.js.map +1 -0
  183. package/lib/types/events/domain-event.d.ts +8 -0
  184. package/lib/types/events/domain-event.js +11 -0
  185. package/lib/types/events/domain-event.js.map +1 -0
  186. package/lib/types/events/recipe-creation-failed.d.ts +5 -0
  187. package/lib/types/events/recipe-creation-failed.js +8 -0
  188. package/lib/types/events/recipe-creation-failed.js.map +1 -0
  189. package/lib/types/events/toc-creation-failed.d.ts +5 -0
  190. package/lib/types/events/toc-creation-failed.js +8 -0
  191. package/lib/types/events/toc-creation-failed.js.map +1 -0
  192. package/lib/types/file/directoryPath.d.ts +7 -0
  193. package/lib/types/file/directoryPath.js +16 -0
  194. package/lib/types/file/directoryPath.js.map +1 -0
  195. package/lib/types/file/fileName.d.ts +5 -0
  196. package/lib/types/file/fileName.js +9 -0
  197. package/lib/types/file/fileName.js.map +1 -0
  198. package/lib/types/file/filePath.d.ts +8 -0
  199. package/lib/types/file/filePath.js +11 -0
  200. package/lib/types/file/filePath.js.map +1 -0
  201. package/lib/types/flags-provider.d.ts +15 -0
  202. package/lib/types/flags-provider.js +34 -0
  203. package/lib/types/flags-provider.js.map +1 -0
  204. package/lib/types/portal/generate.d.ts +13 -9
  205. package/lib/types/portal/generate.js +3 -2
  206. package/lib/types/portal/generate.js.map +1 -0
  207. package/lib/types/portal/quickstart.d.ts +17 -0
  208. package/lib/types/portal/quickstart.js +2 -0
  209. package/lib/types/portal/quickstart.js.map +1 -0
  210. package/lib/types/portal/serve.d.ts +12 -0
  211. package/lib/types/portal/serve.js +2 -0
  212. package/lib/types/portal/serve.js.map +1 -0
  213. package/lib/types/portal-context.d.ts +11 -0
  214. package/lib/types/portal-context.js +28 -0
  215. package/lib/types/portal-context.js.map +1 -0
  216. package/lib/types/recipe/recipe.d.ts +37 -0
  217. package/lib/types/recipe/recipe.js +6 -0
  218. package/lib/types/recipe/recipe.js.map +1 -0
  219. package/lib/types/sdk/generate.d.ts +11 -10
  220. package/lib/types/sdk/generate.js +11 -12
  221. package/lib/types/sdk/generate.js.map +1 -0
  222. package/lib/types/sdk-context.d.ts +13 -0
  223. package/lib/types/sdk-context.js +28 -0
  224. package/lib/types/sdk-context.js.map +1 -0
  225. package/lib/types/sdl/sdl.d.ts +12 -0
  226. package/lib/types/sdl/sdl.js +2 -0
  227. package/lib/types/sdl/sdl.js.map +1 -0
  228. package/lib/types/spec-context.d.ts +7 -0
  229. package/lib/types/spec-context.js +12 -0
  230. package/lib/types/spec-context.js.map +1 -0
  231. package/lib/types/toc/toc.d.ts +31 -0
  232. package/lib/types/toc/toc.js +9 -0
  233. package/lib/types/toc/toc.js.map +1 -0
  234. package/lib/types/utils.d.ts +3 -3
  235. package/lib/types/utils.js +2 -2
  236. package/lib/types/utils.js.map +1 -0
  237. package/lib/utils/utils.d.ts +16 -7
  238. package/lib/utils/utils.js +142 -86
  239. package/lib/utils/utils.js.map +1 -0
  240. package/lib/validators/common/directoryValidator.d.ts +5 -0
  241. package/lib/validators/common/directoryValidator.js +22 -0
  242. package/lib/validators/common/directoryValidator.js.map +1 -0
  243. package/lib/validators/portal/serve-validator.d.ts +6 -0
  244. package/lib/validators/portal/serve-validator.js +15 -0
  245. package/lib/validators/portal/serve-validator.js.map +1 -0
  246. package/package.json +96 -40
  247. package/bin/run +0 -5
  248. package/lib/controllers/portal/generate.d.ts +0 -2
  249. package/lib/controllers/portal/generate.js +0 -49
  250. package/lib/controllers/sdk/generate.d.ts +0 -4
  251. package/lib/controllers/sdk/generate.js +0 -64
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/types/portal/generate.ts"],"names":[],"mappings":"AAMC,CAAC"}
@@ -0,0 +1,17 @@
1
+ export type LoginCredentials = {
2
+ email: string;
3
+ password: string;
4
+ };
5
+ export type SpecFile = {
6
+ localPath: string;
7
+ url: string;
8
+ };
9
+ export type PortalServerConfig = {
10
+ generatedPortalPath: string;
11
+ sourceDirectoryPath: string;
12
+ configDir: string;
13
+ authKey: string | null;
14
+ ignoredPaths?: string[];
15
+ port?: number;
16
+ openInBrowser?: boolean;
17
+ };
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=quickstart.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"quickstart.js","sourceRoot":"","sources":["../../../src/types/portal/quickstart.ts"],"names":[],"mappings":""}
@@ -0,0 +1,12 @@
1
+ export interface ServeFlags {
2
+ readonly port: number;
3
+ readonly folder: string;
4
+ readonly destination: string;
5
+ readonly open: boolean;
6
+ readonly "auth-key": string | undefined;
7
+ readonly "no-reload": boolean;
8
+ }
9
+ export interface ServePaths {
10
+ readonly sourceDirectoryPath: string;
11
+ readonly destinationDirectoryPath: string;
12
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=serve.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"serve.js","sourceRoot":"","sources":["../../../src/types/portal/serve.ts"],"names":[],"mappings":""}
@@ -0,0 +1,11 @@
1
+ import { DirectoryPath } from "./file/directoryPath.js";
2
+ import { FilePath } from "./file/filePath.js";
3
+ export declare class PortalContext {
4
+ private readonly portalDirectory;
5
+ private readonly fileService;
6
+ private readonly zipService;
7
+ constructor(portalDirectory: DirectoryPath);
8
+ get ZipPath(): FilePath;
9
+ exists(): Promise<boolean>;
10
+ save(tempPortalFilePath: FilePath, zipPortal: boolean): Promise<void>;
11
+ }
@@ -0,0 +1,28 @@
1
+ import { FileService } from "../infrastructure/file-service.js";
2
+ import { FilePath } from "./file/filePath.js";
3
+ import { FileName } from "./file/fileName.js";
4
+ import { ZipService } from "../infrastructure/zip-service.js";
5
+ export class PortalContext {
6
+ constructor(portalDirectory) {
7
+ this.portalDirectory = portalDirectory;
8
+ this.fileService = new FileService();
9
+ this.zipService = new ZipService();
10
+ }
11
+ get ZipPath() {
12
+ // TODO: add checks for build file path
13
+ return new FilePath(this.portalDirectory, new FileName("portal.zip"));
14
+ }
15
+ async exists() {
16
+ return !await this.fileService.directoryEmpty(this.portalDirectory);
17
+ }
18
+ async save(tempPortalFilePath, zipPortal) {
19
+ await this.fileService.cleanDirectory(this.portalDirectory);
20
+ if (zipPortal) {
21
+ await this.fileService.copy(tempPortalFilePath, this.ZipPath);
22
+ }
23
+ else {
24
+ await this.zipService.unArchive(tempPortalFilePath, this.portalDirectory);
25
+ }
26
+ }
27
+ }
28
+ //# sourceMappingURL=portal-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"portal-context.js","sourceRoot":"","sources":["../../src/types/portal-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAE9D,MAAM,OAAO,aAAa;IAKxB,YAA6B,eAA8B;QAA9B,oBAAe,GAAf,eAAe,CAAe;QAH1C,gBAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAChC,eAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IAG/C,CAAC;IAED,IAAW,OAAO;QAChB,uCAAuC;QACvC,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,eAAe,EAAE,IAAI,QAAQ,CAAC,YAAY,CAAC,CAAC,CAAC;IACxE,CAAC;IAEM,KAAK,CAAC,MAAM;QACjB,OAAO,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;IACtE,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,kBAA4B,EAAE,SAAkB;QAChE,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC;QAC5D,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAChE,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,kBAAkB,EAAE,IAAI,CAAC,eAAe,CAAC,CAAC;QAC5E,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,37 @@
1
+ export declare enum StepType {
2
+ Content = "content",
3
+ Endpoint = "endpoint"
4
+ }
5
+ export interface RecipeContext {
6
+ showContent(content: string): Promise<any>;
7
+ showEndpoint(config: EndpointConfig): Promise<any>;
8
+ }
9
+ export interface EndpointConfig {
10
+ description: string;
11
+ endpointPermalink: string;
12
+ }
13
+ export interface StepConfig {
14
+ name: string;
15
+ stepCallback: () => Promise<any>;
16
+ }
17
+ export interface RecipeDefinition {
18
+ [stepKey: string]: StepConfig;
19
+ }
20
+ export interface SerializableRecipe {
21
+ name: string;
22
+ steps: SerializableStep[];
23
+ }
24
+ export interface SerializableStep {
25
+ key: string;
26
+ name: string;
27
+ type: "content" | "endpoint";
28
+ config: ContentStepConfig | EndpointStepConfig;
29
+ }
30
+ export interface ContentStepConfig {
31
+ content: string;
32
+ }
33
+ export interface EndpointStepConfig extends EndpointConfig {
34
+ }
35
+ export interface DirectoryNode {
36
+ [key: string]: DirectoryNode | string | null | undefined;
37
+ }
@@ -0,0 +1,6 @@
1
+ export var StepType;
2
+ (function (StepType) {
3
+ StepType["Content"] = "content";
4
+ StepType["Endpoint"] = "endpoint";
5
+ })(StepType || (StepType = {}));
6
+ //# sourceMappingURL=recipe.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"recipe.js","sourceRoot":"","sources":["../../../src/types/recipe/recipe.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,IAAY,QAGX;AAHD,WAAY,QAAQ;IAClB,+BAAmB,CAAA;IACnB,iCAAqB,CAAA;AACvB,CAAC,EAHW,QAAQ,KAAR,QAAQ,QAGnB"}
@@ -1,22 +1,23 @@
1
- export declare type GenerationIdParams = {
1
+ export type GenerationIdParams = {
2
2
  file: string;
3
3
  url: string;
4
4
  platform: string;
5
5
  };
6
- export declare type DownloadSDKParams = {
6
+ export type DownloadSDKParams = {
7
7
  codeGenId: string;
8
8
  zip: boolean;
9
9
  zippedSDKPath: string;
10
10
  sdkFolderPath: string;
11
11
  };
12
- export declare type SDKGenerateUnprocessableError = {
12
+ export type SDKGenerateUnprocessableError = {
13
13
  message: string;
14
14
  };
15
- export declare enum SimplePlatforms {
16
- CSHARP = "CS_NET_STANDARD_LIB",
17
- JAVA = "JAVA_ECLIPSE_JRE_LIB",
18
- PHP = "PHP_GENERIC_LIB",
19
- PYTHON = "PYTHON_GENERIC_LIB",
20
- RUBY = "RUBY_GENERIC_LIB",
21
- TYPESCRIPT = "TS_GENERIC_LIB"
15
+ export declare enum LanguagePlatform {
16
+ CSHARP = "csharp",
17
+ JAVA = "java",
18
+ PHP = "php",
19
+ PYTHON = "python",
20
+ RUBY = "ruby",
21
+ TYPESCRIPT = "typescript",
22
+ GO = "go"
22
23
  }
@@ -1,12 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.SimplePlatforms = void 0;
4
- var SimplePlatforms;
5
- (function (SimplePlatforms) {
6
- SimplePlatforms["CSHARP"] = "CS_NET_STANDARD_LIB";
7
- SimplePlatforms["JAVA"] = "JAVA_ECLIPSE_JRE_LIB";
8
- SimplePlatforms["PHP"] = "PHP_GENERIC_LIB";
9
- SimplePlatforms["PYTHON"] = "PYTHON_GENERIC_LIB";
10
- SimplePlatforms["RUBY"] = "RUBY_GENERIC_LIB";
11
- SimplePlatforms["TYPESCRIPT"] = "TS_GENERIC_LIB";
12
- })(SimplePlatforms = exports.SimplePlatforms || (exports.SimplePlatforms = {}));
1
+ export var LanguagePlatform;
2
+ (function (LanguagePlatform) {
3
+ LanguagePlatform["CSHARP"] = "csharp";
4
+ LanguagePlatform["JAVA"] = "java";
5
+ LanguagePlatform["PHP"] = "php";
6
+ LanguagePlatform["PYTHON"] = "python";
7
+ LanguagePlatform["RUBY"] = "ruby";
8
+ LanguagePlatform["TYPESCRIPT"] = "typescript";
9
+ LanguagePlatform["GO"] = "go";
10
+ })(LanguagePlatform || (LanguagePlatform = {}));
11
+ //# sourceMappingURL=generate.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"generate.js","sourceRoot":"","sources":["../../../src/types/sdk/generate.ts"],"names":[],"mappings":"AAiBA,MAAM,CAAN,IAAY,gBAQX;AARD,WAAY,gBAAgB;IAC1B,qCAAiB,CAAA;IACjB,iCAAa,CAAA;IACb,+BAAW,CAAA;IACX,qCAAiB,CAAA;IACjB,iCAAa,CAAA;IACb,6CAAyB,CAAA;IACzB,6BAAS,CAAA;AACX,CAAC,EARW,gBAAgB,KAAhB,gBAAgB,QAQ3B"}
@@ -0,0 +1,13 @@
1
+ import { DirectoryPath } from "./file/directoryPath.js";
2
+ import { FilePath } from "./file/filePath.js";
3
+ import { LanguagePlatform } from "./sdk/generate.js";
4
+ export declare class SdkContext {
5
+ private readonly sdkDirectory;
6
+ private readonly platform;
7
+ private readonly fileService;
8
+ private readonly zipService;
9
+ constructor(sdkDirectory: DirectoryPath, platform: LanguagePlatform);
10
+ get ZipPath(): FilePath;
11
+ exists(): Promise<boolean>;
12
+ save(tempPortalFilePath: FilePath, zipPortal: boolean): Promise<void>;
13
+ }
@@ -0,0 +1,28 @@
1
+ import { FileService } from "../infrastructure/file-service.js";
2
+ import { FilePath } from "./file/filePath.js";
3
+ import { FileName } from "./file/fileName.js";
4
+ import { ZipService } from "../infrastructure/zip-service.js";
5
+ export class SdkContext {
6
+ constructor(sdkDirectory, platform) {
7
+ this.sdkDirectory = sdkDirectory;
8
+ this.platform = platform;
9
+ this.fileService = new FileService();
10
+ this.zipService = new ZipService();
11
+ }
12
+ get ZipPath() {
13
+ return new FilePath(this.sdkDirectory, new FileName(`${this.platform}.zip`));
14
+ }
15
+ async exists() {
16
+ return !await this.fileService.directoryEmpty(this.sdkDirectory);
17
+ }
18
+ async save(tempPortalFilePath, zipPortal) {
19
+ await this.fileService.cleanDirectory(this.sdkDirectory);
20
+ if (zipPortal) {
21
+ await this.fileService.copy(tempPortalFilePath, this.ZipPath);
22
+ }
23
+ else {
24
+ await this.zipService.unArchive(tempPortalFilePath, this.sdkDirectory);
25
+ }
26
+ }
27
+ }
28
+ //# sourceMappingURL=sdk-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdk-context.js","sourceRoot":"","sources":["../../src/types/sdk-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAEhE,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,MAAM,kCAAkC,CAAC;AAG9D,MAAM,OAAO,UAAU;IAKrB,YAA6B,YAA2B,EACrC,QAA0B;QADhB,iBAAY,GAAZ,YAAY,CAAe;QACrC,aAAQ,GAAR,QAAQ,CAAkB;QAJ5B,gBAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAChC,eAAU,GAAG,IAAI,UAAU,EAAE,CAAC;IAI/C,CAAC;IAED,IAAW,OAAO;QAChB,OAAO,IAAI,QAAQ,CAAC,IAAI,CAAC,YAAY,EAAE,IAAI,QAAQ,CAAC,GAAG,IAAI,CAAC,QAAQ,MAAM,CAAC,CAAC,CAAC;IAC/E,CAAC;IAEM,KAAK,CAAC,MAAM;QACjB,OAAO,CAAC,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;IACnE,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,kBAA4B,EAAE,SAAkB;QAChE,MAAM,IAAI,CAAC,WAAW,CAAC,cAAc,CAAC,IAAI,CAAC,YAAY,CAAC,CAAC;QACzD,IAAI,SAAS,EAAE,CAAC;YACd,MAAM,IAAI,CAAC,WAAW,CAAC,IAAI,CAAC,kBAAkB,EAAE,IAAI,CAAC,OAAO,CAAC,CAAC;QAChE,CAAC;aAAM,CAAC;YACN,MAAM,IAAI,CAAC,UAAU,CAAC,SAAS,CAAC,kBAAkB,EAAE,IAAI,CAAC,YAAY,CAAC,CAAC;QACzE,CAAC;IACH,CAAC;CACF"}
@@ -0,0 +1,12 @@
1
+ export interface Sdl {
2
+ readonly Endpoints: SdlEndpoint[];
3
+ readonly CustomTypes: SdlModel[];
4
+ }
5
+ export interface SdlEndpoint {
6
+ readonly Name: string;
7
+ readonly Description: string;
8
+ readonly Group: string;
9
+ }
10
+ export interface SdlModel {
11
+ readonly Name: string;
12
+ }
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=sdl.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"sdl.js","sourceRoot":"","sources":["../../../src/types/sdl/sdl.ts"],"names":[],"mappings":""}
@@ -0,0 +1,7 @@
1
+ import { DirectoryPath } from "./file/directoryPath.js";
2
+ export declare class SpecContext {
3
+ private readonly fileService;
4
+ private readonly specDirectory;
5
+ constructor(specDirectory: DirectoryPath);
6
+ validate(): Promise<boolean>;
7
+ }
@@ -0,0 +1,12 @@
1
+ import { FileService } from "../infrastructure/file-service.js";
2
+ export class SpecContext {
3
+ constructor(specDirectory) {
4
+ this.fileService = new FileService();
5
+ this.specDirectory = specDirectory;
6
+ }
7
+ async validate() {
8
+ // TODO: add more checks here
9
+ return await this.fileService.directoryExists(this.specDirectory);
10
+ }
11
+ }
12
+ //# sourceMappingURL=spec-context.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"spec-context.js","sourceRoot":"","sources":["../../src/types/spec-context.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,WAAW,EAAE,MAAM,mCAAmC,CAAC;AAGhE,MAAM,OAAO,WAAW;IAItB,YAAY,aAA4B;QAHvB,gBAAW,GAAG,IAAI,WAAW,EAAE,CAAC;QAI/C,IAAI,CAAC,aAAa,GAAG,aAAa,CAAC;IACrC,CAAC;IAEM,KAAK,CAAC,QAAQ;QACnB,6BAA6B;QAC7B,OAAO,MAAM,IAAI,CAAC,WAAW,CAAC,eAAe,CAAC,IAAI,CAAC,aAAa,CAAC,CAAA;IACnE,CAAC;CACF"}
@@ -0,0 +1,31 @@
1
+ export interface Toc {
2
+ toc: Array<TocGroup | TocGenerated>;
3
+ }
4
+ export interface TocGroup {
5
+ readonly group: string;
6
+ readonly items: Array<TocGroup | TocGenerated | TocEndpoint | TocEndpointGroupOverview | TocModel | TocCustomPage>;
7
+ }
8
+ export interface TocGenerated {
9
+ readonly generate: string;
10
+ readonly from: string;
11
+ }
12
+ export interface TocEndpointGroupOverview {
13
+ readonly generate: null;
14
+ readonly from: "endpoint-group-overview";
15
+ readonly endpointGroup: string;
16
+ }
17
+ export interface TocEndpoint {
18
+ readonly generate: null;
19
+ readonly from: "endpoint";
20
+ readonly endpointName: string;
21
+ readonly endpointGroup: string;
22
+ }
23
+ export interface TocModel {
24
+ readonly generate: null;
25
+ readonly from: "model";
26
+ readonly modelName: string;
27
+ }
28
+ export interface TocCustomPage {
29
+ readonly page: string;
30
+ readonly file: string;
31
+ }
@@ -0,0 +1,9 @@
1
+ ;
2
+ ;
3
+ ;
4
+ ;
5
+ ;
6
+ ;
7
+ ;
8
+ export {};
9
+ //# sourceMappingURL=toc.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"toc.js","sourceRoot":"","sources":["../../../src/types/toc/toc.ts"],"names":[],"mappings":"AAEC,CAAC;AAKD,CAAC;AAKD,CAAC;AAMD,CAAC;AAOD,CAAC;AAMD,CAAC;AAKD,CAAC"}
@@ -1,14 +1,14 @@
1
- export declare type ValidationMessages = {
1
+ export type ValidationMessages = {
2
2
  messages: string[];
3
3
  warnings: string[];
4
4
  errors: string[];
5
5
  };
6
- export declare type loggers = {
6
+ export type loggers = {
7
7
  log: (message: string) => void;
8
8
  warn: (message: string) => void;
9
9
  error: (message: string) => void;
10
10
  };
11
- export declare type AuthenticationError = {
11
+ export type AuthenticationError = {
12
12
  statusCode: number;
13
13
  body: string;
14
14
  };
@@ -1,2 +1,2 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
2
+ //# sourceMappingURL=utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/types/utils.ts"],"names":[],"mappings":""}
@@ -1,7 +1,11 @@
1
- /// <reference types="node" />
2
- /// <reference types="mocha" />
3
- import { loggers, ValidationMessages } from "../types/utils";
4
- export declare const unzipFile: (stream: NodeJS.ReadableStream, destination: string) => Promise<unknown>;
1
+ import { loggers, ValidationMessages } from "../types/utils.js";
2
+ export declare const createTempDirectory: () => Promise<string>;
3
+ export declare const clearDirectory: (folderPath: string) => Promise<void>;
4
+ interface DirectoryNode {
5
+ [key: string]: DirectoryNode | string | null | undefined;
6
+ }
7
+ export declare const directoryToJson: (dirPath: string, parentPath?: string) => DirectoryNode;
8
+ export declare const isValidUrl: (input: string) => boolean;
5
9
  export declare const deleteFile: (filePath: string) => Promise<void>;
6
10
  export declare const writeFileUsingReadableStream: (stream: NodeJS.ReadableStream, destinationPath: string) => Promise<unknown>;
7
11
  /**
@@ -12,9 +16,14 @@ export declare const writeFileUsingReadableStream: (stream: NodeJS.ReadableStrea
12
16
  * return {string}
13
17
  */
14
18
  export declare const zipDirectory: (sourcePath: string, destinationPath: string) => Promise<string>;
15
- export declare const startProgress: (title: string) => void;
16
- export declare const stopProgress: (isError?: boolean) => void | null;
17
19
  export declare const replaceHTML: (string: string) => string;
18
- export declare const isJSONParsable: (json: string) => boolean;
19
20
  export declare const getFileNameFromPath: (filePath: string) => string;
20
21
  export declare const printValidationMessages: ({ warnings, errors, messages }: ValidationMessages, { log, warn, error }: loggers) => void;
22
+ export declare function parseStreamBodyToJson(body: NodeJS.ReadableStream): Promise<any>;
23
+ export declare const getMessageInOrangeColor: (message: string) => string;
24
+ export declare const getMessageInBlueColor: (message: string) => string;
25
+ export declare const getMessageInCyanColor: (message: string) => string;
26
+ export declare const getMessageInGreenColor: (message: string) => string;
27
+ export declare const getMessageInMagentaColor: (message: string) => string;
28
+ export declare const getMessageInRedColor: (message: string) => string;
29
+ export {};