@apimatic/cli 2.0.0-beta.2 → 2.0.0-beta.3

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 (81) hide show
  1. package/README.md +19 -6
  2. package/lib/actions/plugin/generate.d.ts +0 -2
  3. package/lib/actions/plugin/generate.js +5 -8
  4. package/lib/actions/plugin/generate.js.map +1 -1
  5. package/lib/actions/portal/serve.js +4 -3
  6. package/lib/actions/portal/serve.js.map +1 -1
  7. package/lib/actions/sdk/generate.js +16 -3
  8. package/lib/actions/sdk/generate.js.map +1 -1
  9. package/lib/actions/sdk/publish.js +6 -2
  10. package/lib/actions/sdk/publish.js.map +1 -1
  11. package/lib/infrastructure/services/portal-artifacts-service.js +6 -5
  12. package/lib/infrastructure/services/portal-artifacts-service.js.map +1 -1
  13. package/lib/infrastructure/zip-service.d.ts +6 -2
  14. package/lib/infrastructure/zip-service.js +42 -24
  15. package/lib/infrastructure/zip-service.js.map +1 -1
  16. package/lib/prompts/plugin/generate.d.ts +3 -3
  17. package/lib/prompts/plugin/generate.js +19 -11
  18. package/lib/prompts/plugin/generate.js.map +1 -1
  19. package/lib/prompts/portal/serve.js +1 -1
  20. package/lib/prompts/portal/serve.js.map +1 -1
  21. package/lib/prompts/portal/source.d.ts +4 -2
  22. package/lib/prompts/portal/source.js +42 -8
  23. package/lib/prompts/portal/source.js.map +1 -1
  24. package/lib/prompts/sdk/generate.d.ts +5 -0
  25. package/lib/prompts/sdk/generate.js +10 -0
  26. package/lib/prompts/sdk/generate.js.map +1 -1
  27. package/lib/prompts/sdk/publish.d.ts +3 -0
  28. package/lib/prompts/sdk/publish.js +3 -0
  29. package/lib/prompts/sdk/publish.js.map +1 -1
  30. package/lib/types/file/file-problem.d.ts +4 -0
  31. package/lib/types/file/file-problem.js +2 -0
  32. package/lib/types/file/file-problem.js.map +1 -0
  33. package/lib/types/plugin/generation-problem.d.ts +10 -0
  34. package/lib/types/plugin/generation-problem.js +2 -0
  35. package/lib/types/plugin/generation-problem.js.map +1 -0
  36. package/lib/types/plugin-config-context.js +2 -1
  37. package/lib/types/plugin-config-context.js.map +1 -1
  38. package/lib/types/plugin-context.d.ts +3 -1
  39. package/lib/types/plugin-context.js +2 -1
  40. package/lib/types/plugin-context.js.map +1 -1
  41. package/lib/types/portal/content-notices.d.ts +11 -3
  42. package/lib/types/portal/content-tree.d.ts +4 -2
  43. package/lib/types/portal/content-tree.js +42 -12
  44. package/lib/types/portal/content-tree.js.map +1 -1
  45. package/lib/types/portal/generated-pages.d.ts +6 -6
  46. package/lib/types/portal/generated-pages.js +3 -3
  47. package/lib/types/portal/generated-pages.js.map +1 -1
  48. package/lib/types/portal/portal-navigation.d.ts +83 -12
  49. package/lib/types/portal/portal-navigation.js +276 -100
  50. package/lib/types/portal/portal-navigation.js.map +1 -1
  51. package/lib/types/portal/preview-content.js +15 -2
  52. package/lib/types/portal/preview-content.js.map +1 -1
  53. package/lib/types/portal-context.d.ts +1 -0
  54. package/lib/types/portal-context.js +17 -12
  55. package/lib/types/portal-context.js.map +1 -1
  56. package/lib/types/portal-source-context.js +7 -4
  57. package/lib/types/portal-source-context.js.map +1 -1
  58. package/lib/types/project-context.d.ts +2 -1
  59. package/lib/types/project-context.js +2 -2
  60. package/lib/types/project-context.js.map +1 -1
  61. package/lib/types/sdk-context.d.ts +7 -2
  62. package/lib/types/sdk-context.js +8 -6
  63. package/lib/types/sdk-context.js.map +1 -1
  64. package/lib/types/spec-context.d.ts +3 -1
  65. package/lib/types/spec-context.js +5 -4
  66. package/lib/types/spec-context.js.map +1 -1
  67. package/lib/types/temp-context.d.ts +5 -3
  68. package/lib/types/temp-context.js +7 -7
  69. package/lib/types/temp-context.js.map +1 -1
  70. package/oclif.manifest.json +164 -164
  71. package/package.json +7 -6
  72. package/portal-template/src/components/api-page.tsx +2 -6
  73. package/portal-template/src/components/example-layout.tsx +7 -7
  74. package/portal-template/src/components/usage-tabs.tsx +16 -36
  75. package/portal-template/src/lib/media-adapters.ts +3 -3
  76. package/portal-template/src/lib/navigation-schema.ts +13 -0
  77. package/portal-template/src/lib/navigation.ts +60 -117
  78. package/portal-template/src/lib/request-examples.ts +12 -28
  79. package/portal-template/src/lib/source.ts +3 -2
  80. package/portal-template/src/lib/tabs.ts +3 -2
  81. package/portal-template/src/components/code-block.tsx +0 -9
@@ -25,18 +25,72 @@
25
25
  "quickstart.js"
26
26
  ]
27
27
  },
28
- "auth:login": {
28
+ "api:transform": {
29
29
  "aliases": [],
30
30
  "args": {},
31
- "description": "Login using your APIMatic credentials or an API Key",
31
+ "description": "Transform API specifications from one format to another.\nSupports multiple formats including OpenAPI/Swagger, RAML, WSDL, and Postman Collections.",
32
32
  "examples": [
33
- "\u001b[94mapimatic\u001b[39m \u001b[2mauth\u001b[22m \u001b[2mlogin\u001b[22m",
34
- "\u001b[94mapimatic\u001b[39m \u001b[2mauth\u001b[22m \u001b[2mlogin\u001b[22m \u001b[32m--auth-key\u001b[39m=\u001b[2m{api-key}\u001b[22m"
33
+ "\u001b[94mapimatic\u001b[39m \u001b[2mapi\u001b[22m \u001b[2mtransform\u001b[22m \u001b[32m--format\u001b[39m=\u001b[2mopenapi3yaml\u001b[22m \u001b[32m--file\u001b[39m=\u001b[2m./specs/sample.json\u001b[22m \u001b[32m--destination\u001b[39m=\u001b[2m./\u001b[22m",
34
+ "\u001b[94mapimatic\u001b[39m \u001b[2mapi\u001b[22m \u001b[2mtransform\u001b[22m \u001b[32m--format\u001b[39m=\u001b[2mraml\u001b[22m \u001b[32m--url\u001b[39m=\u001b[2m\"https://petstore.swagger.io/v2/swagger.json\"\u001b[22m \u001b[32m--destination\u001b[39m=\u001b[2m./\u001b[22m"
35
35
  ],
36
36
  "flags": {
37
+ "format": {
38
+ "description": "Specification format to transform API specification into",
39
+ "name": "format",
40
+ "required": true,
41
+ "hasDynamicHelp": false,
42
+ "multiple": false,
43
+ "options": [
44
+ "apimatic",
45
+ "wadl2009",
46
+ "wsdl",
47
+ "swagger10",
48
+ "swagger20",
49
+ "swaggeryaml",
50
+ "oas3",
51
+ "openapi3yaml",
52
+ "apiblueprint",
53
+ "raml",
54
+ "raml10",
55
+ "postman10",
56
+ "postman20",
57
+ "graphqlschema"
58
+ ],
59
+ "type": "option"
60
+ },
61
+ "file": {
62
+ "description": "Path to the API specification file to transform",
63
+ "name": "file",
64
+ "hasDynamicHelp": false,
65
+ "multiple": false,
66
+ "type": "option"
67
+ },
68
+ "url": {
69
+ "description": "URL to the API specification file to transform (publicly accessible)",
70
+ "name": "url",
71
+ "hasDynamicHelp": false,
72
+ "multiple": false,
73
+ "type": "option"
74
+ },
75
+ "destination": {
76
+ "char": "d",
77
+ "description": "Directory to save the transformed file to",
78
+ "name": "destination",
79
+ "default": "./",
80
+ "hasDynamicHelp": false,
81
+ "multiple": false,
82
+ "type": "option"
83
+ },
84
+ "force": {
85
+ "char": "f",
86
+ "description": "overwrite changes without asking for user consent.",
87
+ "name": "force",
88
+ "allowNo": false,
89
+ "type": "boolean"
90
+ },
37
91
  "auth-key": {
38
92
  "char": "k",
39
- "description": "Sets authentication key for all commands.",
93
+ "description": "override current authentication state with an authentication key.",
40
94
  "name": "auth-key",
41
95
  "hasDynamicHelp": false,
42
96
  "multiple": false,
@@ -45,174 +99,157 @@
45
99
  },
46
100
  "hasDynamicHelp": false,
47
101
  "hiddenAliases": [],
48
- "id": "auth:login",
102
+ "id": "api:transform",
49
103
  "pluginAlias": "@apimatic/cli",
50
104
  "pluginName": "@apimatic/cli",
51
105
  "pluginType": "core",
52
106
  "strict": true,
53
- "summary": "Login to your APIMatic account",
107
+ "summary": "Transform API specifications between different formats",
54
108
  "enableJsonFlag": false,
55
- "cmdTxt": "\u001b[94mapimatic\u001b[39m \u001b[2mauth\u001b[22m \u001b[2mlogin\u001b[22m",
109
+ "cmdTxt": "\u001b[94mapimatic\u001b[39m \u001b[2mapi\u001b[22m \u001b[2mtransform\u001b[22m",
56
110
  "isESM": true,
57
111
  "relativePath": [
58
112
  "lib",
59
113
  "commands",
60
- "auth",
61
- "login.js"
114
+ "api",
115
+ "transform.js"
62
116
  ]
63
117
  },
64
- "auth:logout": {
118
+ "api:validate": {
65
119
  "aliases": [],
66
120
  "args": {},
67
- "description": "Clears the local login credentials. This will also clear any cached credentials from the CLI.",
121
+ "description": "Validate your API specification to ensure it adheres to syntactic and semantic standards.",
68
122
  "examples": [
69
- "\u001b[94mapimatic\u001b[39m \u001b[2mauth\u001b[22m \u001b[2mlogout\u001b[22m"
123
+ "\u001b[94mapimatic\u001b[39m \u001b[2mapi\u001b[22m \u001b[2mvalidate\u001b[22m \u001b[32m--file\u001b[39m=\u001b[2m./specs/sample.json\u001b[22m",
124
+ "\u001b[94mapimatic\u001b[39m \u001b[2mapi\u001b[22m \u001b[2mvalidate\u001b[22m \u001b[32m--url\u001b[39m=\u001b[2m\"https://petstore.swagger.io/v2/swagger.json\"\u001b[22m"
70
125
  ],
71
- "flags": {},
126
+ "flags": {
127
+ "file": {
128
+ "description": "Path to the API specification file to validate",
129
+ "name": "file",
130
+ "hasDynamicHelp": false,
131
+ "multiple": false,
132
+ "type": "option"
133
+ },
134
+ "url": {
135
+ "description": "URL to the API specification file to validate (publicly accessible)",
136
+ "name": "url",
137
+ "hasDynamicHelp": false,
138
+ "multiple": false,
139
+ "type": "option"
140
+ },
141
+ "auth-key": {
142
+ "char": "k",
143
+ "description": "override current authentication state with an authentication key.",
144
+ "name": "auth-key",
145
+ "hasDynamicHelp": false,
146
+ "multiple": false,
147
+ "type": "option"
148
+ }
149
+ },
72
150
  "hasDynamicHelp": false,
73
151
  "hiddenAliases": [],
74
- "id": "auth:logout",
152
+ "id": "api:validate",
75
153
  "pluginAlias": "@apimatic/cli",
76
154
  "pluginName": "@apimatic/cli",
77
155
  "pluginType": "core",
78
156
  "strict": true,
79
- "summary": "Clears the local login credentials.",
157
+ "summary": "Validate API specification for syntactic and semantic correctness",
80
158
  "enableJsonFlag": false,
81
- "cmdTxt": "\u001b[94mapimatic\u001b[39m \u001b[2mauth\u001b[22m \u001b[2mlogout\u001b[22m",
159
+ "cmdTxt": "\u001b[94mapimatic\u001b[39m \u001b[2mapi\u001b[22m \u001b[2mvalidate\u001b[22m",
82
160
  "isESM": true,
83
161
  "relativePath": [
84
162
  "lib",
85
163
  "commands",
86
- "auth",
87
- "logout.js"
164
+ "api",
165
+ "validate.js"
88
166
  ]
89
167
  },
90
- "auth:status": {
168
+ "auth:login": {
91
169
  "aliases": [],
92
170
  "args": {},
93
- "description": "View the currently logged in user.",
171
+ "description": "Login using your APIMatic credentials or an API Key",
94
172
  "examples": [
95
- "\u001b[94mapimatic\u001b[39m \u001b[2mauth\u001b[22m \u001b[2mstatus\u001b[22m"
173
+ "\u001b[94mapimatic\u001b[39m \u001b[2mauth\u001b[22m \u001b[2mlogin\u001b[22m",
174
+ "\u001b[94mapimatic\u001b[39m \u001b[2mauth\u001b[22m \u001b[2mlogin\u001b[22m \u001b[32m--auth-key\u001b[39m=\u001b[2m{api-key}\u001b[22m"
96
175
  ],
97
- "flags": {},
176
+ "flags": {
177
+ "auth-key": {
178
+ "char": "k",
179
+ "description": "Sets authentication key for all commands.",
180
+ "name": "auth-key",
181
+ "hasDynamicHelp": false,
182
+ "multiple": false,
183
+ "type": "option"
184
+ }
185
+ },
98
186
  "hasDynamicHelp": false,
99
187
  "hiddenAliases": [],
100
- "id": "auth:status",
188
+ "id": "auth:login",
101
189
  "pluginAlias": "@apimatic/cli",
102
190
  "pluginName": "@apimatic/cli",
103
191
  "pluginType": "core",
104
192
  "strict": true,
193
+ "summary": "Login to your APIMatic account",
105
194
  "enableJsonFlag": false,
106
- "cmdTxt": "\u001b[94mapimatic\u001b[39m \u001b[2mauth\u001b[22m \u001b[2mstatus\u001b[22m",
195
+ "cmdTxt": "\u001b[94mapimatic\u001b[39m \u001b[2mauth\u001b[22m \u001b[2mlogin\u001b[22m",
107
196
  "isESM": true,
108
197
  "relativePath": [
109
198
  "lib",
110
199
  "commands",
111
200
  "auth",
112
- "status.js"
201
+ "login.js"
113
202
  ]
114
203
  },
115
- "plugin:generate": {
204
+ "auth:logout": {
116
205
  "aliases": [],
117
206
  "args": {},
118
- "description": "Generate a context plugin that teaches an AI coding assistant how to use your SDKs. Requires an input directory containing a `src` directory with your API specification — `apimatic.json` is created if it is not there. It asks for the plugin's name on the first run, and for its languages only when `apimatic.json` records none (`sdk publish` records them). Later runs read both from `apimatic.json` without asking.",
207
+ "description": "Clears the local login credentials. This will also clear any cached credentials from the CLI.",
119
208
  "examples": [
120
- "\u001b[94mapimatic\u001b[39m \u001b[2mplugin\u001b[22m \u001b[2mgenerate\u001b[22m",
121
- "\u001b[94mapimatic\u001b[39m \u001b[2mplugin\u001b[22m \u001b[2mgenerate\u001b[22m \u001b[32m--input\u001b[39m=\u001b[2m\"./\"\u001b[22m \u001b[32m--destination\u001b[39m=\u001b[2m\"./plugin\"\u001b[22m"
209
+ "\u001b[94mapimatic\u001b[39m \u001b[2mauth\u001b[22m \u001b[2mlogout\u001b[22m"
122
210
  ],
123
- "flags": {
124
- "input": {
125
- "char": "i",
126
- "description": "[default: ./] path to the parent directory containing the 'src' directory, which includes API specifications and configuration files.",
127
- "name": "input",
128
- "hasDynamicHelp": false,
129
- "multiple": false,
130
- "type": "option"
131
- },
132
- "destination": {
133
- "char": "d",
134
- "description": "[default: <input>/plugin] path where the plugin will be generated.",
135
- "name": "destination",
136
- "hasDynamicHelp": false,
137
- "multiple": false,
138
- "type": "option"
139
- },
140
- "force": {
141
- "char": "f",
142
- "description": "overwrite changes without asking for user consent.",
143
- "name": "force",
144
- "allowNo": false,
145
- "type": "boolean"
146
- },
147
- "auth-key": {
148
- "char": "k",
149
- "description": "override current authentication state with an authentication key.",
150
- "name": "auth-key",
151
- "hasDynamicHelp": false,
152
- "multiple": false,
153
- "type": "option"
154
- }
155
- },
211
+ "flags": {},
156
212
  "hasDynamicHelp": false,
157
213
  "hiddenAliases": [],
158
- "id": "plugin:generate",
214
+ "id": "auth:logout",
159
215
  "pluginAlias": "@apimatic/cli",
160
216
  "pluginName": "@apimatic/cli",
161
217
  "pluginType": "core",
162
218
  "strict": true,
163
- "summary": "Generate a context plugin for your SDKs.",
219
+ "summary": "Clears the local login credentials.",
164
220
  "enableJsonFlag": false,
165
- "cmdTxt": "\u001b[94mapimatic\u001b[39m \u001b[2mplugin\u001b[22m \u001b[2mgenerate\u001b[22m",
221
+ "cmdTxt": "\u001b[94mapimatic\u001b[39m \u001b[2mauth\u001b[22m \u001b[2mlogout\u001b[22m",
166
222
  "isESM": true,
167
223
  "relativePath": [
168
224
  "lib",
169
225
  "commands",
170
- "plugin",
171
- "generate.js"
226
+ "auth",
227
+ "logout.js"
172
228
  ]
173
229
  },
174
- "plugin:publish": {
230
+ "auth:status": {
175
231
  "aliases": [],
176
232
  "args": {},
177
- "description": "Print the commands that publish a generated context plugin to a GitHub repository. The commands are printed for you to run — this command never touches your repository.",
233
+ "description": "View the currently logged in user.",
178
234
  "examples": [
179
- "\u001b[94mapimatic\u001b[39m \u001b[2mplugin\u001b[22m \u001b[2mpublish\u001b[22m",
180
- "\u001b[94mapimatic\u001b[39m \u001b[2mplugin\u001b[22m \u001b[2mpublish\u001b[22m \u001b[32m--input\u001b[39m=\u001b[2m\"./\"\u001b[22m \u001b[32m--destination\u001b[39m=\u001b[2m\"./plugin\"\u001b[22m"
235
+ "\u001b[94mapimatic\u001b[39m \u001b[2mauth\u001b[22m \u001b[2mstatus\u001b[22m"
181
236
  ],
182
- "flags": {
183
- "input": {
184
- "char": "i",
185
- "description": "[default: ./] path to the parent directory containing the 'src' directory, which includes API specifications and configuration files.",
186
- "name": "input",
187
- "hasDynamicHelp": false,
188
- "multiple": false,
189
- "type": "option"
190
- },
191
- "destination": {
192
- "char": "d",
193
- "description": "[default: <input>/plugin] path where the plugin was generated.",
194
- "name": "destination",
195
- "hasDynamicHelp": false,
196
- "multiple": false,
197
- "type": "option"
198
- }
199
- },
237
+ "flags": {},
200
238
  "hasDynamicHelp": false,
201
239
  "hiddenAliases": [],
202
- "id": "plugin:publish",
240
+ "id": "auth:status",
203
241
  "pluginAlias": "@apimatic/cli",
204
242
  "pluginName": "@apimatic/cli",
205
243
  "pluginType": "core",
206
244
  "strict": true,
207
- "summary": "Print the git commands for publishing your context plugin to GitHub.",
208
245
  "enableJsonFlag": false,
209
- "cmdTxt": "\u001b[94mapimatic\u001b[39m \u001b[2mplugin\u001b[22m \u001b[2mpublish\u001b[22m",
246
+ "cmdTxt": "\u001b[94mapimatic\u001b[39m \u001b[2mauth\u001b[22m \u001b[2mstatus\u001b[22m",
210
247
  "isESM": true,
211
248
  "relativePath": [
212
249
  "lib",
213
250
  "commands",
214
- "plugin",
215
- "publish.js"
251
+ "auth",
252
+ "status.js"
216
253
  ]
217
254
  },
218
255
  "portal:generate": {
@@ -342,58 +379,27 @@
342
379
  "serve.js"
343
380
  ]
344
381
  },
345
- "api:transform": {
382
+ "plugin:generate": {
346
383
  "aliases": [],
347
384
  "args": {},
348
- "description": "Transform API specifications from one format to another.\nSupports multiple formats including OpenAPI/Swagger, RAML, WSDL, and Postman Collections.",
385
+ "description": "Generate a context plugin that teaches an AI coding assistant how to use your SDKs. Requires an input directory containing a `src` directory with your API specification — `apimatic.json` is created if it is not there. It asks for the plugin's name on the first run, and for its languages only when `apimatic.json` records none (`sdk publish` records them). Later runs read both from `apimatic.json` without asking.",
349
386
  "examples": [
350
- "\u001b[94mapimatic\u001b[39m \u001b[2mapi\u001b[22m \u001b[2mtransform\u001b[22m \u001b[32m--format\u001b[39m=\u001b[2mopenapi3yaml\u001b[22m \u001b[32m--file\u001b[39m=\u001b[2m./specs/sample.json\u001b[22m \u001b[32m--destination\u001b[39m=\u001b[2m./\u001b[22m",
351
- "\u001b[94mapimatic\u001b[39m \u001b[2mapi\u001b[22m \u001b[2mtransform\u001b[22m \u001b[32m--format\u001b[39m=\u001b[2mraml\u001b[22m \u001b[32m--url\u001b[39m=\u001b[2m\"https://petstore.swagger.io/v2/swagger.json\"\u001b[22m \u001b[32m--destination\u001b[39m=\u001b[2m./\u001b[22m"
387
+ "\u001b[94mapimatic\u001b[39m \u001b[2mplugin\u001b[22m \u001b[2mgenerate\u001b[22m",
388
+ "\u001b[94mapimatic\u001b[39m \u001b[2mplugin\u001b[22m \u001b[2mgenerate\u001b[22m \u001b[32m--input\u001b[39m=\u001b[2m\"./\"\u001b[22m \u001b[32m--destination\u001b[39m=\u001b[2m\"./plugin\"\u001b[22m"
352
389
  ],
353
390
  "flags": {
354
- "format": {
355
- "description": "Specification format to transform API specification into",
356
- "name": "format",
357
- "required": true,
358
- "hasDynamicHelp": false,
359
- "multiple": false,
360
- "options": [
361
- "apimatic",
362
- "wadl2009",
363
- "wsdl",
364
- "swagger10",
365
- "swagger20",
366
- "swaggeryaml",
367
- "oas3",
368
- "openapi3yaml",
369
- "apiblueprint",
370
- "raml",
371
- "raml10",
372
- "postman10",
373
- "postman20",
374
- "graphqlschema"
375
- ],
376
- "type": "option"
377
- },
378
- "file": {
379
- "description": "Path to the API specification file to transform",
380
- "name": "file",
381
- "hasDynamicHelp": false,
382
- "multiple": false,
383
- "type": "option"
384
- },
385
- "url": {
386
- "description": "URL to the API specification file to transform (publicly accessible)",
387
- "name": "url",
391
+ "input": {
392
+ "char": "i",
393
+ "description": "[default: ./] path to the parent directory containing the 'src' directory, which includes API specifications and configuration files.",
394
+ "name": "input",
388
395
  "hasDynamicHelp": false,
389
396
  "multiple": false,
390
397
  "type": "option"
391
398
  },
392
399
  "destination": {
393
400
  "char": "d",
394
- "description": "Directory to save the transformed file to",
401
+ "description": "[default: <input>/plugin] path where the plugin will be generated.",
395
402
  "name": "destination",
396
- "default": "./",
397
403
  "hasDynamicHelp": false,
398
404
  "multiple": false,
399
405
  "type": "option"
@@ -416,49 +422,43 @@
416
422
  },
417
423
  "hasDynamicHelp": false,
418
424
  "hiddenAliases": [],
419
- "id": "api:transform",
425
+ "id": "plugin:generate",
420
426
  "pluginAlias": "@apimatic/cli",
421
427
  "pluginName": "@apimatic/cli",
422
428
  "pluginType": "core",
423
429
  "strict": true,
424
- "summary": "Transform API specifications between different formats",
430
+ "summary": "Generate a context plugin for your SDKs.",
425
431
  "enableJsonFlag": false,
426
- "cmdTxt": "\u001b[94mapimatic\u001b[39m \u001b[2mapi\u001b[22m \u001b[2mtransform\u001b[22m",
432
+ "cmdTxt": "\u001b[94mapimatic\u001b[39m \u001b[2mplugin\u001b[22m \u001b[2mgenerate\u001b[22m",
427
433
  "isESM": true,
428
434
  "relativePath": [
429
435
  "lib",
430
436
  "commands",
431
- "api",
432
- "transform.js"
437
+ "plugin",
438
+ "generate.js"
433
439
  ]
434
440
  },
435
- "api:validate": {
441
+ "plugin:publish": {
436
442
  "aliases": [],
437
443
  "args": {},
438
- "description": "Validate your API specification to ensure it adheres to syntactic and semantic standards.",
444
+ "description": "Print the commands that publish a generated context plugin to a GitHub repository. The commands are printed for you to run — this command never touches your repository.",
439
445
  "examples": [
440
- "\u001b[94mapimatic\u001b[39m \u001b[2mapi\u001b[22m \u001b[2mvalidate\u001b[22m \u001b[32m--file\u001b[39m=\u001b[2m./specs/sample.json\u001b[22m",
441
- "\u001b[94mapimatic\u001b[39m \u001b[2mapi\u001b[22m \u001b[2mvalidate\u001b[22m \u001b[32m--url\u001b[39m=\u001b[2m\"https://petstore.swagger.io/v2/swagger.json\"\u001b[22m"
446
+ "\u001b[94mapimatic\u001b[39m \u001b[2mplugin\u001b[22m \u001b[2mpublish\u001b[22m",
447
+ "\u001b[94mapimatic\u001b[39m \u001b[2mplugin\u001b[22m \u001b[2mpublish\u001b[22m \u001b[32m--input\u001b[39m=\u001b[2m\"./\"\u001b[22m \u001b[32m--destination\u001b[39m=\u001b[2m\"./plugin\"\u001b[22m"
442
448
  ],
443
449
  "flags": {
444
- "file": {
445
- "description": "Path to the API specification file to validate",
446
- "name": "file",
447
- "hasDynamicHelp": false,
448
- "multiple": false,
449
- "type": "option"
450
- },
451
- "url": {
452
- "description": "URL to the API specification file to validate (publicly accessible)",
453
- "name": "url",
450
+ "input": {
451
+ "char": "i",
452
+ "description": "[default: ./] path to the parent directory containing the 'src' directory, which includes API specifications and configuration files.",
453
+ "name": "input",
454
454
  "hasDynamicHelp": false,
455
455
  "multiple": false,
456
456
  "type": "option"
457
457
  },
458
- "auth-key": {
459
- "char": "k",
460
- "description": "override current authentication state with an authentication key.",
461
- "name": "auth-key",
458
+ "destination": {
459
+ "char": "d",
460
+ "description": "[default: <input>/plugin] path where the plugin was generated.",
461
+ "name": "destination",
462
462
  "hasDynamicHelp": false,
463
463
  "multiple": false,
464
464
  "type": "option"
@@ -466,20 +466,20 @@
466
466
  },
467
467
  "hasDynamicHelp": false,
468
468
  "hiddenAliases": [],
469
- "id": "api:validate",
469
+ "id": "plugin:publish",
470
470
  "pluginAlias": "@apimatic/cli",
471
471
  "pluginName": "@apimatic/cli",
472
472
  "pluginType": "core",
473
473
  "strict": true,
474
- "summary": "Validate API specification for syntactic and semantic correctness",
474
+ "summary": "Print the git commands for publishing your context plugin to GitHub.",
475
475
  "enableJsonFlag": false,
476
- "cmdTxt": "\u001b[94mapimatic\u001b[39m \u001b[2mapi\u001b[22m \u001b[2mvalidate\u001b[22m",
476
+ "cmdTxt": "\u001b[94mapimatic\u001b[39m \u001b[2mplugin\u001b[22m \u001b[2mpublish\u001b[22m",
477
477
  "isESM": true,
478
478
  "relativePath": [
479
479
  "lib",
480
480
  "commands",
481
- "api",
482
- "validate.js"
481
+ "plugin",
482
+ "publish.js"
483
483
  ]
484
484
  },
485
485
  "sdk:generate": {
@@ -748,5 +748,5 @@
748
748
  ]
749
749
  }
750
750
  },
751
- "version": "2.0.0-beta.2"
751
+ "version": "2.0.0-beta.3"
752
752
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@apimatic/cli",
3
3
  "description": "The official CLI for APIMatic.",
4
- "version": "2.0.0-beta.2",
4
+ "version": "2.0.0-beta.3",
5
5
  "author": "APIMatic",
6
6
  "bin": {
7
7
  "apimatic": "./bin/run.js"
@@ -77,10 +77,10 @@
77
77
  "fast-levenshtein": "^3.0.0",
78
78
  "form-data": "^4.0.2",
79
79
  "fs-extra": "^11.3.0",
80
- "fumadocs-core": "16.15.15",
80
+ "fumadocs-core": "16.15.17",
81
81
  "fumadocs-mdx": "15.4.0",
82
- "fumadocs-openapi": "11.4.1",
83
- "fumadocs-ui": "16.15.15",
82
+ "fumadocs-openapi": "12.1.1",
83
+ "fumadocs-ui": "16.15.17",
84
84
  "get-port": "^7.1.0",
85
85
  "is-in-ci": "^2.0.0",
86
86
  "isomorphic-git": "^1.37.2",
@@ -111,8 +111,8 @@
111
111
  "@commitlint/config-conventional": "^20.5.3",
112
112
  "@eslint/js": "^9.34.0",
113
113
  "@oclif/test": "^4.1.13",
114
- "@semantic-release/changelog": "^6.0.3",
115
- "@semantic-release/git": "^10.0.1",
114
+ "@semantic-release/commit-analyzer": "^13.0.1",
115
+ "@semantic-release/release-notes-generator": "^14.1.1",
116
116
  "@types/adm-zip": "^0.5.8",
117
117
  "@types/base-64": "^1.0.0",
118
118
  "@types/chai": "^4.3.20",
@@ -134,6 +134,7 @@
134
134
  "@typescript/native": "npm:typescript@^7.0.2",
135
135
  "ajv": "^8.20.0",
136
136
  "chai": "^4.5.0",
137
+ "conventional-changelog-conventionalcommits": "^9.3.1",
137
138
  "eslint": "^9.21.0",
138
139
  "eslint-config-prettier": "^8.3.0",
139
140
  "eslint-plugin-import": "^2.25.2",
@@ -1,15 +1,11 @@
1
1
  import { createOpenAPIPage } from 'fumadocs-openapi/ui';
2
- import { createCodeUsageGeneratorRegistry } from 'fumadocs-openapi/requests/generators';
3
2
  import { mediaAdapters } from '@/lib/media-adapters';
4
- import { CodeBlock } from './code-block';
5
3
  import { renderExampleLayout } from './example-layout';
6
- import { renderUsageTabs } from './usage-tabs';
4
+ import { codeUsages, renderUsageTabs } from './usage-tabs';
7
5
 
8
6
  export const OpenAPIPage = createOpenAPIPage({
9
- // Without a registry of its own, Fumadocs registers and bundles every request generator it has.
10
- codeUsages: createCodeUsageGeneratorRegistry(),
7
+ codeUsages,
11
8
  generateTypeScriptDefinitions: false,
12
- components: { CodeBlock },
13
9
  content: { renderAPIExampleLayout: renderExampleLayout, renderAPIExampleUsageTabs: renderUsageTabs },
14
10
  mediaAdapters
15
11
  });
@@ -1,6 +1,7 @@
1
1
  import { createContext, useContext, useMemo, useState, type ReactNode } from 'react';
2
2
  import { Select, SelectContent, SelectItem, SelectTrigger, SelectValue } from '@fumadocs/api-docs/components/select';
3
- import { useOperationContext, useRenderContext } from 'fumadocs-openapi/ui';
3
+ import { useOpenAPI } from 'fumadocs-openapi';
4
+ import { useExampleRequests, useOperation } from 'fumadocs-openapi/operation';
4
5
  import { CodeSample } from '@/lib/code-samples';
5
6
  import { Parameter, requestExamples, type RequestExample } from '@/lib/request-examples';
6
7
 
@@ -32,17 +33,16 @@ export function renderExampleLayout(slots: Readonly<LayoutSlots>): ReactNode {
32
33
 
33
34
  // Fumadocs passes a null selector for an operation with `x-exclusiveCodeSample`.
34
35
  function ExampleLayout({ selector, usageTabs, responseTabs }: Readonly<LayoutSlots>) {
35
- const { schema } = useRenderContext();
36
- const { route, examples: bodyExamples, example: defaultId, setExample } = useOperationContext();
37
- const pathItem = schema.resolve(schema.dereferenced.paths?.[route]);
38
- const operation = pathItem?.[bodyExamples[0].data.method];
36
+ const { resolve } = useOpenAPI().doc;
37
+ const { operation, parameters } = useOperation();
38
+ const { items: bodyExamples, selected: defaultId, select: setExample } = useExampleRequests();
39
39
  // Only SDK samples follow a parameter's example ids; fumadocs' cURL and playground ignore them.
40
40
  const examples = useMemo(
41
41
  () =>
42
42
  CodeSample.listIn(operation).length === 0
43
43
  ? bodyExamples
44
- : requestExamples(bodyExamples, Parameter.listIn(operation, pathItem, schema.resolve)),
45
- [bodyExamples, operation, pathItem, schema]
44
+ : requestExamples(bodyExamples, Parameter.listIn(parameters, resolve)),
45
+ [bodyExamples, operation, parameters, resolve]
46
46
  );
47
47
  const [selectedId, setSelectedId] = useState(defaultId);
48
48