@apimatic/cli 1.0.2-alpha.2 → 1.1.0-alpha.10

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 (156) hide show
  1. package/README.md +220 -72
  2. package/bin/run.js +5 -0
  3. package/lib/actions/portal/generate.d.ts +7 -0
  4. package/lib/actions/portal/generate.js +54 -0
  5. package/lib/actions/portal/generate.js.map +1 -0
  6. package/lib/actions/portal/recipe/new-recipe.d.ts +24 -0
  7. package/lib/actions/portal/recipe/new-recipe.js +258 -0
  8. package/lib/actions/portal/recipe/new-recipe.js.map +1 -0
  9. package/lib/actions/portal/toc/new-toc.d.ts +17 -0
  10. package/lib/actions/portal/toc/new-toc.js +130 -0
  11. package/lib/actions/portal/toc/new-toc.js.map +1 -0
  12. package/lib/application/portal/recipe/portal-recipe.d.ts +8 -0
  13. package/lib/application/portal/recipe/portal-recipe.js +33 -0
  14. package/lib/application/portal/recipe/portal-recipe.js.map +1 -0
  15. package/lib/application/portal/recipe/recipe-generator.d.ts +16 -0
  16. package/lib/application/portal/recipe/recipe-generator.js +147 -0
  17. package/lib/application/portal/recipe/recipe-generator.js.map +1 -0
  18. package/lib/application/portal/toc/sdl-parser.d.ts +16 -0
  19. package/lib/application/portal/toc/sdl-parser.js +74 -0
  20. package/lib/application/portal/toc/sdl-parser.js.map +1 -0
  21. package/lib/application/portal/toc/toc-content-parser.d.ts +5 -0
  22. package/lib/application/portal/toc/toc-content-parser.js +44 -0
  23. package/lib/application/portal/toc/toc-content-parser.js.map +1 -0
  24. package/lib/application/portal/toc/toc-structure-generator.d.ts +6 -0
  25. package/lib/application/portal/toc/toc-structure-generator.js +84 -0
  26. package/lib/application/portal/toc/toc-structure-generator.js.map +1 -0
  27. package/lib/client-utils/auth-manager.d.ts +1 -1
  28. package/lib/client-utils/auth-manager.js +9 -13
  29. package/lib/client-utils/auth-manager.js.map +1 -0
  30. package/lib/client-utils/sdk-client.js +24 -23
  31. package/lib/client-utils/sdk-client.js.map +1 -0
  32. package/lib/commands/api/transform.d.ts +7 -7
  33. package/lib/commands/api/transform.js +44 -40
  34. package/lib/commands/api/transform.js.map +1 -0
  35. package/lib/commands/api/validate.d.ts +4 -4
  36. package/lib/commands/api/validate.js +33 -24
  37. package/lib/commands/api/validate.js.map +1 -0
  38. package/lib/commands/auth/login.d.ts +2 -2
  39. package/lib/commands/auth/login.js +33 -18
  40. package/lib/commands/auth/login.js.map +1 -0
  41. package/lib/commands/auth/logout.d.ts +1 -1
  42. package/lib/commands/auth/logout.js +6 -7
  43. package/lib/commands/auth/logout.js.map +1 -0
  44. package/lib/commands/auth/status.d.ts +1 -1
  45. package/lib/commands/auth/status.js +6 -7
  46. package/lib/commands/auth/status.js.map +1 -0
  47. package/lib/commands/portal/generate.d.ts +12 -7
  48. package/lib/commands/portal/generate.js +73 -79
  49. package/lib/commands/portal/generate.js.map +1 -0
  50. package/lib/commands/portal/quickstart.d.ts +10 -0
  51. package/lib/commands/portal/quickstart.js +77 -0
  52. package/lib/commands/portal/quickstart.js.map +1 -0
  53. package/lib/commands/portal/recipe/new.d.ts +12 -0
  54. package/lib/commands/portal/recipe/new.js +44 -0
  55. package/lib/commands/portal/recipe/new.js.map +1 -0
  56. package/lib/commands/portal/serve.d.ts +16 -0
  57. package/lib/commands/portal/serve.js +135 -0
  58. package/lib/commands/portal/serve.js.map +1 -0
  59. package/lib/commands/portal/toc/new.d.ts +15 -0
  60. package/lib/commands/portal/toc/new.js +63 -0
  61. package/lib/commands/portal/toc/new.js.map +1 -0
  62. package/lib/commands/sdk/generate.d.ts +8 -8
  63. package/lib/commands/sdk/generate.js +48 -41
  64. package/lib/commands/sdk/generate.js.map +1 -0
  65. package/lib/config/axios-config.d.ts +2 -0
  66. package/lib/config/axios-config.js +10 -0
  67. package/lib/config/axios-config.js.map +1 -0
  68. package/lib/config/env.d.ts +27 -1
  69. package/lib/config/env.js +28 -4
  70. package/lib/config/env.js.map +1 -0
  71. package/lib/controllers/api/transform.d.ts +1 -1
  72. package/lib/controllers/api/transform.js +23 -22
  73. package/lib/controllers/api/transform.js.map +1 -0
  74. package/lib/controllers/api/validate.d.ts +3 -3
  75. package/lib/controllers/api/validate.js +19 -12
  76. package/lib/controllers/api/validate.js.map +1 -0
  77. package/lib/controllers/portal/generate.d.ts +3 -2
  78. package/lib/controllers/portal/generate.js +105 -48
  79. package/lib/controllers/portal/generate.js.map +1 -0
  80. package/lib/controllers/portal/quickstart.d.ts +14 -0
  81. package/lib/controllers/portal/quickstart.js +253 -0
  82. package/lib/controllers/portal/quickstart.js.map +1 -0
  83. package/lib/controllers/portal/serve.d.ts +3 -0
  84. package/lib/controllers/portal/serve.js +133 -0
  85. package/lib/controllers/portal/serve.js.map +1 -0
  86. package/lib/controllers/sdk/generate.d.ts +4 -4
  87. package/lib/controllers/sdk/generate.js +23 -26
  88. package/lib/controllers/sdk/generate.js.map +1 -0
  89. package/lib/index.d.ts +1 -1
  90. package/lib/index.js +2 -4
  91. package/lib/index.js.map +1 -0
  92. package/lib/infrastructure/services/portal-service.d.ts +16 -0
  93. package/lib/infrastructure/services/portal-service.js +129 -0
  94. package/lib/infrastructure/services/portal-service.js.map +1 -0
  95. package/lib/prompts/portal/generate.d.ts +10 -0
  96. package/lib/prompts/portal/generate.js +57 -0
  97. package/lib/prompts/portal/generate.js.map +1 -0
  98. package/lib/prompts/portal/quickstart.d.ts +31 -0
  99. package/lib/prompts/portal/quickstart.js +212 -0
  100. package/lib/prompts/portal/quickstart.js.map +1 -0
  101. package/lib/prompts/portal/recipe/new-recipe.d.ts +23 -0
  102. package/lib/prompts/portal/recipe/new-recipe.js +193 -0
  103. package/lib/prompts/portal/recipe/new-recipe.js.map +1 -0
  104. package/lib/prompts/portal/serve.d.ts +7 -0
  105. package/lib/prompts/portal/serve.js +21 -0
  106. package/lib/prompts/portal/serve.js.map +1 -0
  107. package/lib/prompts/portal/toc/new-toc.d.ts +10 -0
  108. package/lib/prompts/portal/toc/new-toc.js +42 -0
  109. package/lib/prompts/portal/toc/new-toc.js.map +1 -0
  110. package/lib/services/portal/server.d.ts +14 -0
  111. package/lib/services/portal/server.js +97 -0
  112. package/lib/services/portal/server.js.map +1 -0
  113. package/lib/types/api/transform.d.ts +19 -8
  114. package/lib/types/api/transform.js +19 -4
  115. package/lib/types/api/transform.js.map +1 -0
  116. package/lib/types/api/validate.d.ts +3 -3
  117. package/lib/types/api/validate.js +2 -2
  118. package/lib/types/api/validate.js.map +1 -0
  119. package/lib/types/common/result.d.ts +17 -0
  120. package/lib/types/common/result.js +32 -0
  121. package/lib/types/common/result.js.map +1 -0
  122. package/lib/types/portal/generate.d.ts +26 -9
  123. package/lib/types/portal/generate.js +3 -2
  124. package/lib/types/portal/generate.js.map +1 -0
  125. package/lib/types/portal/quickstart.d.ts +17 -0
  126. package/lib/types/portal/quickstart.js +2 -0
  127. package/lib/types/portal/quickstart.js.map +1 -0
  128. package/lib/types/recipe/recipe.d.ts +37 -0
  129. package/lib/types/recipe/recipe.js +6 -0
  130. package/lib/types/recipe/recipe.js.map +1 -0
  131. package/lib/types/sdk/generate.d.ts +6 -5
  132. package/lib/types/sdk/generate.js +5 -6
  133. package/lib/types/sdk/generate.js.map +1 -0
  134. package/lib/types/sdl/sdl.d.ts +12 -0
  135. package/lib/types/sdl/sdl.js +2 -0
  136. package/lib/types/sdl/sdl.js.map +1 -0
  137. package/lib/types/toc/toc.d.ts +31 -0
  138. package/lib/types/toc/toc.js +9 -0
  139. package/lib/types/toc/toc.js.map +1 -0
  140. package/lib/types/utils.d.ts +6 -2
  141. package/lib/types/utils.js +2 -2
  142. package/lib/types/utils.js.map +1 -0
  143. package/lib/utils/utils.d.ts +31 -5
  144. package/lib/utils/utils.js +316 -74
  145. package/lib/utils/utils.js.map +1 -0
  146. package/lib/validators/common/directoryValidator.d.ts +9 -0
  147. package/lib/validators/common/directoryValidator.js +49 -0
  148. package/lib/validators/common/directoryValidator.js.map +1 -0
  149. package/lib/validators/common/portValidator.d.ts +5 -0
  150. package/lib/validators/common/portValidator.js +16 -0
  151. package/lib/validators/common/portValidator.js.map +1 -0
  152. package/lib/validators/portal/serveValidator.d.ts +6 -0
  153. package/lib/validators/portal/serveValidator.js +17 -0
  154. package/lib/validators/portal/serveValidator.js.map +1 -0
  155. package/package.json +86 -38
  156. package/bin/run +0 -5
package/package.json CHANGED
@@ -1,21 +1,21 @@
1
1
  {
2
2
  "name": "@apimatic/cli",
3
3
  "description": "The official CLI for APIMatic.",
4
- "version": "1.0.2-alpha.2",
4
+ "version": "1.1.0-alpha.10",
5
5
  "author": "APIMatic",
6
6
  "bin": {
7
- "apimatic": "./bin/run"
7
+ "apimatic": "./bin/run.js"
8
8
  },
9
9
  "bugs": "https://github.com/apimatic/apimatic-cli/issues",
10
10
  "publishConfig": {
11
11
  "access": "public"
12
12
  },
13
13
  "engines": {
14
- "node": ">=12.0.0"
14
+ "node": ">=20.0.0"
15
15
  },
16
16
  "files": [
17
- "/bin",
18
- "/lib",
17
+ "./bin",
18
+ "./lib",
19
19
  "/npm-shrinkwrap.json",
20
20
  "/oclif.manifest.json"
21
21
  ],
@@ -30,76 +30,124 @@
30
30
  "automation"
31
31
  ],
32
32
  "license": "MIT",
33
+ "type": "module",
33
34
  "main": "lib/index.js",
34
35
  "types": "lib/index.d.ts",
35
36
  "scripts": {
36
37
  "build": "tsc -b",
37
38
  "postpack": "rimraf oclif.manifest.json",
38
- "posttest": "eslint . --ext .ts --config .eslintrc",
39
- "test": "nyc --extension .ts mocha --forbid-only \"test/**/*.test.ts\"",
39
+ "posttest": "eslint . --ext .ts",
40
40
  "prettier": "prettier \"src/**/*.{js,ts}\"",
41
41
  "format": "prettier --write \"src/**/*.{js,ts}\"",
42
42
  "lint": "eslint \"src/**/*.{js,ts}\"",
43
- "lint:fix": "eslint --fix \"src/**/*.{js,ts}\" --quiet"
43
+ "lint:fix": "eslint --fix \"src/**/*.{js,ts}\" --quiet",
44
+ "test": "tsx node_modules/mocha/bin/_mocha --forbid-only \"test/**/*.test.ts\" --timeout 99999"
44
45
  },
45
46
  "dependencies": {
46
- "@apimatic/sdk": "^0.0.1-alpha.8",
47
- "@oclif/command": "^1.8.0",
48
- "@oclif/config": "^1.17.0",
49
- "@oclif/plugin-autocomplete": "^0.3.0",
50
- "@oclif/plugin-help": "^3.2.3",
51
- "@oclif/plugin-not-found": "^1.2.4",
52
- "archiver": "^5.3.0",
53
- "axios": "^0.24.0",
47
+ "@apimatic/sdk": "^0.2.0-alpha.1",
48
+ "@clack/prompts": "1.0.0-alpha.1",
49
+ "@oclif/core": "^4.2.8",
50
+ "@oclif/plugin-autocomplete": "^3.2.24",
51
+ "@oclif/plugin-help": "^6.2.26",
52
+ "@oclif/plugin-not-found": "^3.2.44",
53
+ "adm-zip": "^0.5.14",
54
+ "archiver": "^7.0.1",
55
+ "axios": "^1.8.1",
54
56
  "base-64": "^1.0.0",
55
- "form-data": "^4.0.0",
56
- "fs-extra": "^10.0.0",
57
+ "chokidar": "^3.6.0",
58
+ "connect-livereload": "^0.6.1",
59
+ "execa": "^9.6.0",
60
+ "express": "^4.17.1",
61
+ "file-type": "^15.0.0",
62
+ "form-data": "^4.0.2",
63
+ "fs-extra": "^11.3.0",
64
+ "livereload": "^0.9.3",
65
+ "open": "^8.4.0",
66
+ "prettier": "^2.8.8",
67
+ "simple-git": "^3.27.0",
57
68
  "striptags": "^3.2.0",
58
- "tslib": "^1.14.1",
59
- "unzipper": "^0.10.11"
69
+ "treeify": "^1.1.0",
70
+ "tslib": "^2.8.1",
71
+ "unzipper": "^0.12.3",
72
+ "yaml": "^2.8.0"
60
73
  },
61
74
  "devDependencies": {
62
75
  "@commitlint/cli": "^15.0.0",
63
76
  "@commitlint/config-conventional": "^15.0.0",
64
- "@oclif/dev-cli": "^1.26.0",
65
- "@oclif/test": "^1.2.8",
66
- "@semantic-release/changelog": "^6.0.1",
77
+ "@oclif/test": "^4.1.13",
78
+ "@semantic-release/changelog": "^6.0.3",
67
79
  "@semantic-release/git": "^10.0.1",
80
+ "@types/adm-zip": "^0.5.5",
68
81
  "@types/archiver": "^5.1.1",
69
- "@types/axios": "^0.14.0",
70
82
  "@types/base-64": "^1.0.0",
71
- "@types/chai": "^4.2.22",
83
+ "@types/chai": "^4.3.20",
84
+ "@types/connect-livereload": "^0.5.1",
85
+ "@types/express": "^4.17.13",
72
86
  "@types/fs-extra": "^9.0.13",
87
+ "@types/livereload": "^0.9.2",
73
88
  "@types/mocha": "^5.2.7",
74
- "@types/node": "^10.17.60",
89
+ "@types/mock-fs": "^4.13.4",
90
+ "@types/node": "^20.17.50",
91
+ "@types/prettier": "^2.7.3",
92
+ "@types/sinon": "^17.0.4",
93
+ "@types/treeify": "^1.0.3",
75
94
  "@types/unzipper": "^0.10.4",
76
- "@typescript-eslint/eslint-plugin": "^5.0.0",
77
- "@typescript-eslint/parser": "^5.0.0",
78
- "chai": "^4.3.4",
79
- "eslint": "^7.32.0",
95
+ "@typescript-eslint/eslint-plugin": "^8.0.0",
96
+ "@typescript-eslint/parser": "^8.0.0",
97
+ "chai": "^4.5.0",
98
+ "eslint": "^9.21.0",
80
99
  "eslint-config-prettier": "^8.3.0",
81
100
  "eslint-plugin-import": "^2.25.2",
82
- "globby": "^10.0.2",
83
101
  "husky": "^7.0.4",
84
102
  "lint-staged": "^11.2.6",
85
- "mocha": "^5.2.0",
86
- "nyc": "^14.1.1",
87
- "prettier": "^2.4.1",
88
- "rimraf": "^3.0.2",
89
- "ts-node": "^8.10.2",
90
- "typescript": "^3.9.10"
103
+ "mocha": "^11.7.1",
104
+ "mock-fs": "^5.5.0",
105
+ "nock": "^14.0.4",
106
+ "nyc": "^17.1.0",
107
+ "oclif": "^4.17.34",
108
+ "rimraf": "^6.0.1",
109
+ "sinon": "^21.0.0",
110
+ "tmp-promise": "^3.0.3",
111
+ "ts-node": "^10.9.2",
112
+ "tsx": "^4.20.3",
113
+ "typescript": "^5.2.2"
91
114
  },
92
115
  "oclif": {
93
116
  "commands": "./lib/commands",
117
+ "dirname": "apimatic",
94
118
  "bin": "apimatic",
119
+ "description": "The official CLI for APIMatic. \nTo get started with APIMatic's CLI using a step by step wizard, run 'apimatic portal:quickstart'.",
95
120
  "plugins": [
96
121
  "@oclif/plugin-autocomplete",
97
122
  "@oclif/plugin-help",
98
123
  "@oclif/plugin-not-found"
99
- ]
124
+ ],
125
+ "topics": {
126
+ "api": {
127
+ "description": "Transform & Validate your API specifications."
128
+ },
129
+ "auth": {
130
+ "description": "Login using your APIMatic credentials, or view your authentication status."
131
+ },
132
+ "portal": {
133
+ "description": "Generate, download and serve an API Documentation portal for your APIs."
134
+ },
135
+ "sdk": {
136
+ "description": "Generate SDKs for your APIs in multiple languages."
137
+ }
138
+ },
139
+ "state": "Alpha"
100
140
  },
101
141
  "lint-staged": {
102
142
  "*.js": "eslint --cache --fix",
103
143
  "*.{js,ts}": "prettier --write"
144
+ },
145
+ "overrides": {
146
+ "inflight": "npm:lru-cache@^7.14.1",
147
+ "lodash.get": "npm:lodash@^4.17.21",
148
+ "@humanwhocodes/config-array": "npm:@eslint/config-array@latest",
149
+ "rimraf": "^6.0.1",
150
+ "glob": "^10.4.5",
151
+ "q": "npm:promise@^8.3.0"
104
152
  }
105
153
  }
package/bin/run DELETED
@@ -1,5 +0,0 @@
1
- #!/usr/bin/env node
2
- /* eslint-disable no-undef */
3
- /* eslint-disable @typescript-eslint/no-var-requires */
4
-
5
- require("@oclif/command").run().then(require("@oclif/command/flush")).catch(require("@oclif/errors/handle"));