bump-cli 2.8.4 → 2.9.1
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.
- package/README.md +12 -12
- package/bin/dev.cmd +3 -0
- package/bin/dev.js +6 -0
- package/bin/run.js +5 -0
- package/{lib → dist}/api/error.d.ts +6 -9
- package/dist/api/error.js +97 -0
- package/{lib → dist}/api/index.d.ts +13 -13
- package/dist/api/index.js +46 -0
- package/dist/api/models.js +1 -0
- package/{lib → dist}/api/vars.js +10 -14
- package/dist/args.d.ts +4 -0
- package/{lib → dist}/args.js +11 -15
- package/dist/base-command.d.ts +7 -0
- package/dist/base-command.js +18 -0
- package/dist/commands/deploy.d.ts +24 -0
- package/dist/commands/deploy.js +158 -0
- package/dist/commands/diff.d.ts +21 -0
- package/dist/commands/diff.js +110 -0
- package/dist/commands/overlay.d.ts +13 -0
- package/dist/commands/overlay.js +53 -0
- package/dist/commands/preview.d.ts +15 -0
- package/dist/commands/preview.js +83 -0
- package/{lib/core/definition_directory.d.ts → dist/core/definition-directory.d.ts} +10 -8
- package/dist/core/definition-directory.js +149 -0
- package/{lib → dist}/core/deploy.d.ts +7 -10
- package/{lib → dist}/core/deploy.js +39 -47
- package/{lib → dist}/core/diff.d.ts +12 -15
- package/{lib → dist}/core/diff.js +88 -98
- package/{lib → dist}/core/overlay.d.ts +2 -2
- package/{lib → dist}/core/overlay.js +36 -41
- package/{lib → dist}/core/utils/file.d.ts +4 -4
- package/dist/core/utils/file.js +36 -0
- package/dist/core/utils/prompts.d.ts +1 -0
- package/dist/core/utils/prompts.js +13 -0
- package/{lib → dist}/definition.d.ts +31 -30
- package/dist/definition.js +240 -0
- package/dist/flags.d.ts +48 -0
- package/dist/flags.js +120 -0
- package/dist/index.d.ts +16 -0
- package/dist/index.js +15 -0
- package/oclif.manifest.json +283 -1
- package/package.json +65 -57
- package/bin/run +0 -5
- package/lib/api/error.js +0 -96
- package/lib/api/index.js +0 -64
- package/lib/api/models.js +0 -2
- package/lib/args.d.ts +0 -15
- package/lib/cli/index.d.ts +0 -31
- package/lib/cli/index.js +0 -14
- package/lib/cli/styled/success.d.ts +0 -1
- package/lib/cli/styled/success.js +0 -11
- package/lib/command.d.ts +0 -9
- package/lib/command.js +0 -31
- package/lib/commands/deploy.d.ts +0 -27
- package/lib/commands/deploy.js +0 -164
- package/lib/commands/diff.d.ts +0 -24
- package/lib/commands/diff.js +0 -119
- package/lib/commands/overlay.d.ts +0 -16
- package/lib/commands/overlay.js +0 -56
- package/lib/commands/preview.d.ts +0 -19
- package/lib/commands/preview.js +0 -83
- package/lib/core/definition_directory.js +0 -138
- package/lib/core/utils/file.js +0 -41
- package/lib/core/utils/prompts.d.ts +0 -1
- package/lib/core/utils/prompts.js +0 -21
- package/lib/definition.js +0 -218
- package/lib/flags.d.ts +0 -20
- package/lib/flags.js +0 -116
- package/lib/index.d.ts +0 -7
- package/lib/index.js +0 -14
- package/{lib → dist}/api/models.d.ts +20 -20
- package/{lib → dist}/api/vars.d.ts +3 -3
package/oclif.manifest.json
CHANGED
|
@@ -1 +1,283 @@
|
|
|
1
|
-
{
|
|
1
|
+
{
|
|
2
|
+
"commands": {
|
|
3
|
+
"deploy": {
|
|
4
|
+
"aliases": [],
|
|
5
|
+
"args": {
|
|
6
|
+
"file": {
|
|
7
|
+
"description": "Path or URL to your API documentation file. OpenAPI (2.0 to 3.1.0) and AsyncAPI (2.x) specifications are currently supported.\nPath can also be a directory when deploying to a Hub.",
|
|
8
|
+
"name": "file",
|
|
9
|
+
"required": true
|
|
10
|
+
}
|
|
11
|
+
},
|
|
12
|
+
"description": "Create a new version of your documentation from the given file or URL.",
|
|
13
|
+
"examples": [
|
|
14
|
+
"Deploy a new version of an existing documentation\n\n$ bump deploy FILE --doc <your_doc_id_or_slug> --token <your_doc_token>\n* Let's deploy on Bump.sh... done\n* Your new documentation version will soon be ready\n",
|
|
15
|
+
"Deploy a new version of an existing documentation attached to a hub\n\n$ bump deploy FILE --doc <doc_slug> --hub <your_hub_id_or_slug> --token <your_doc_token>\n* Let's deploy on Bump.sh... done\n* Your new documentation version will soon be ready\n",
|
|
16
|
+
"Deploy a whole directory of API definitions files to a hub\n\n$ bump deploy DIR --filename-pattern *-{slug}-api --hub <hub_slug> --token <hub_token>\nWe've found 2 valid API definitions to deploy\n└─ DIR\n └─ source-my-service-api.yml (OpenAPI spec version 3.1.0)\n └─ source-my-jobs-service-api.yml (AsyncAPI spec version 2.6.0)\n\nLet's deploy those documentations to your <hub_slug> hub on Bump.sh\n\n* Your new documentation version will soon be ready\nLet's deploy a new version to your my-service documentation on Bump.sh... done\n\n* Your new documentation version will soon be ready\nLet's deploy a new version to your my-jobs-service documentation on Bump.sh... done\n",
|
|
17
|
+
"Validate a new documentation version before deploying it\n\n$ bump deploy FILE --dry-run --doc <doc_slug> --token <your_doc_token>\n* Let's validate on Bump.sh... done\n* Definition is valid\n"
|
|
18
|
+
],
|
|
19
|
+
"flags": {
|
|
20
|
+
"auto-create": {
|
|
21
|
+
"dependsOn": [
|
|
22
|
+
"hub"
|
|
23
|
+
],
|
|
24
|
+
"description": "Automatically create the documentation if needed (only available with a --hub flag). Documentation name can be provided with --doc-name flag. Default: false",
|
|
25
|
+
"name": "auto-create",
|
|
26
|
+
"allowNo": false,
|
|
27
|
+
"type": "boolean"
|
|
28
|
+
},
|
|
29
|
+
"branch": {
|
|
30
|
+
"char": "B",
|
|
31
|
+
"description": "Branch name. Can be provided via BUMP_BRANCH_NAME environment variable",
|
|
32
|
+
"name": "branch",
|
|
33
|
+
"hasDynamicHelp": false,
|
|
34
|
+
"multiple": false,
|
|
35
|
+
"type": "option"
|
|
36
|
+
},
|
|
37
|
+
"doc": {
|
|
38
|
+
"char": "d",
|
|
39
|
+
"description": "Documentation public id or slug. Can be provided via BUMP_ID environment variable",
|
|
40
|
+
"name": "doc",
|
|
41
|
+
"hasDynamicHelp": false,
|
|
42
|
+
"multiple": false,
|
|
43
|
+
"type": "option"
|
|
44
|
+
},
|
|
45
|
+
"doc-name": {
|
|
46
|
+
"char": "n",
|
|
47
|
+
"dependsOn": [
|
|
48
|
+
"auto-create"
|
|
49
|
+
],
|
|
50
|
+
"description": "Documentation name. Used with --auto-create flag.",
|
|
51
|
+
"name": "doc-name",
|
|
52
|
+
"hasDynamicHelp": false,
|
|
53
|
+
"multiple": false,
|
|
54
|
+
"type": "option"
|
|
55
|
+
},
|
|
56
|
+
"dry-run": {
|
|
57
|
+
"description": "Validate a new documentation version. Does everything a normal deploy would do except publishing the new version. Useful in automated environments such as test platforms or continuous integration. Default: false",
|
|
58
|
+
"name": "dry-run",
|
|
59
|
+
"allowNo": false,
|
|
60
|
+
"type": "boolean"
|
|
61
|
+
},
|
|
62
|
+
"filename-pattern": {
|
|
63
|
+
"description": "Pattern to extract the documentation slug from filenames when deploying a DIRECTORY. Pattern uses only '*' and '{slug}' as special characters to extract the slug from a filename without extension. Used with --hub flag only.",
|
|
64
|
+
"name": "filename-pattern",
|
|
65
|
+
"default": "{slug}-api",
|
|
66
|
+
"hasDynamicHelp": false,
|
|
67
|
+
"multiple": false,
|
|
68
|
+
"type": "option"
|
|
69
|
+
},
|
|
70
|
+
"hub": {
|
|
71
|
+
"char": "b",
|
|
72
|
+
"description": "Hub id or slug. Can be provided via BUMP_HUB_ID environment variable",
|
|
73
|
+
"name": "hub",
|
|
74
|
+
"hasDynamicHelp": false,
|
|
75
|
+
"multiple": false,
|
|
76
|
+
"type": "option"
|
|
77
|
+
},
|
|
78
|
+
"interactive": {
|
|
79
|
+
"dependsOn": [
|
|
80
|
+
"hub"
|
|
81
|
+
],
|
|
82
|
+
"description": "Interactively create a configuration file to deploy a Hub (only available with a --hub flag). This will start an interactive process if you don't have a CLI configuration file. Default: false",
|
|
83
|
+
"name": "interactive",
|
|
84
|
+
"allowNo": false,
|
|
85
|
+
"type": "boolean"
|
|
86
|
+
},
|
|
87
|
+
"overlay": {
|
|
88
|
+
"char": "o",
|
|
89
|
+
"description": "Path or URL of an overlay file to apply before deploying",
|
|
90
|
+
"name": "overlay",
|
|
91
|
+
"hasDynamicHelp": false,
|
|
92
|
+
"multiple": false,
|
|
93
|
+
"type": "option"
|
|
94
|
+
},
|
|
95
|
+
"token": {
|
|
96
|
+
"char": "t",
|
|
97
|
+
"description": "Documentation or Hub token. Can be provided via BUMP_TOKEN environment variable",
|
|
98
|
+
"name": "token",
|
|
99
|
+
"required": true,
|
|
100
|
+
"default": "99f52837852249b328c0a00249f846a3",
|
|
101
|
+
"hasDynamicHelp": false,
|
|
102
|
+
"multiple": false,
|
|
103
|
+
"type": "option"
|
|
104
|
+
}
|
|
105
|
+
},
|
|
106
|
+
"hasDynamicHelp": false,
|
|
107
|
+
"hiddenAliases": [],
|
|
108
|
+
"id": "deploy",
|
|
109
|
+
"pluginAlias": "bump-cli",
|
|
110
|
+
"pluginName": "bump-cli",
|
|
111
|
+
"pluginType": "core",
|
|
112
|
+
"strict": true
|
|
113
|
+
},
|
|
114
|
+
"diff": {
|
|
115
|
+
"aliases": [],
|
|
116
|
+
"args": {
|
|
117
|
+
"file": {
|
|
118
|
+
"description": "Path or URL to your API documentation file. OpenAPI (2.0 to 3.1.0) and AsyncAPI (2.x) specifications are currently supported.\nPath can also be a directory when deploying to a Hub.",
|
|
119
|
+
"name": "file",
|
|
120
|
+
"required": true
|
|
121
|
+
},
|
|
122
|
+
"otherFile": {
|
|
123
|
+
"description": "Path or URL to a second API documentation file to compute its diff",
|
|
124
|
+
"name": "otherFile"
|
|
125
|
+
}
|
|
126
|
+
},
|
|
127
|
+
"description": "Get a comparison diff with your documentation from the given file or URL.",
|
|
128
|
+
"examples": [
|
|
129
|
+
"Compare a potential new version with the currently published one:\n\n $ bump diff FILE --doc <your_doc_id_or_slug> --token <your_doc_token>\n * Comparing the given definition file with the currently deployed one... done\n Removed: GET /compare\n Added: GET /versions/{versionId}\n",
|
|
130
|
+
"Store the diff in a dedicated file:\n\n $ bump diff FILE --doc <doc_slug> --token <doc_token> > /tmp/my-saved-diff\n * Comparing the given definition file with the currently deployed one... done\n\n $ cat /tmp/my-saved-diff\n Removed: GET /compare\n Added: GET /versions/{versionId}\n",
|
|
131
|
+
"In case of a non modified definition FILE compared to your existing documentation, no changes are output:\n\n $ bump diff FILE --doc <doc_slug> --token <your_doc_token>\n * Comparing the given definition file with the currently deployed one... done\n › Warning: Your documentation has not changed\n",
|
|
132
|
+
"Compare two different input files or URL independently to the one published on bump.sh\n\n $ bump diff FILE FILE2 --doc <doc_slug> --token <your_doc_token>\n * Comparing the two given definition files... done\n Updated: POST /versions\n Body attribute added: previous_version_id\n"
|
|
133
|
+
],
|
|
134
|
+
"flags": {
|
|
135
|
+
"branch": {
|
|
136
|
+
"char": "B",
|
|
137
|
+
"description": "Branch name. Can be provided via BUMP_BRANCH_NAME environment variable",
|
|
138
|
+
"name": "branch",
|
|
139
|
+
"hasDynamicHelp": false,
|
|
140
|
+
"multiple": false,
|
|
141
|
+
"type": "option"
|
|
142
|
+
},
|
|
143
|
+
"doc": {
|
|
144
|
+
"char": "d",
|
|
145
|
+
"description": "Documentation public id or slug. Can be provided via BUMP_ID environment variable",
|
|
146
|
+
"name": "doc",
|
|
147
|
+
"hasDynamicHelp": false,
|
|
148
|
+
"multiple": false,
|
|
149
|
+
"type": "option"
|
|
150
|
+
},
|
|
151
|
+
"expires": {
|
|
152
|
+
"char": "e",
|
|
153
|
+
"description": "Specify a longer expiration date for public diffs (defaults to 1 day). Use iso8601 format to provide a date, or you can use `--expires 'never'` to keep the result live indefinitely.",
|
|
154
|
+
"name": "expires",
|
|
155
|
+
"hasDynamicHelp": false,
|
|
156
|
+
"multiple": false,
|
|
157
|
+
"type": "option"
|
|
158
|
+
},
|
|
159
|
+
"fail-on-breaking": {
|
|
160
|
+
"char": "F",
|
|
161
|
+
"description": "Fail when diff contains a breaking change",
|
|
162
|
+
"name": "fail-on-breaking",
|
|
163
|
+
"allowNo": false,
|
|
164
|
+
"type": "boolean"
|
|
165
|
+
},
|
|
166
|
+
"format": {
|
|
167
|
+
"char": "f",
|
|
168
|
+
"description": "Format in which to provide the diff result",
|
|
169
|
+
"name": "format",
|
|
170
|
+
"default": "text",
|
|
171
|
+
"hasDynamicHelp": false,
|
|
172
|
+
"multiple": false,
|
|
173
|
+
"options": [
|
|
174
|
+
"text",
|
|
175
|
+
"markdown",
|
|
176
|
+
"json",
|
|
177
|
+
"html"
|
|
178
|
+
],
|
|
179
|
+
"type": "option"
|
|
180
|
+
},
|
|
181
|
+
"hub": {
|
|
182
|
+
"char": "b",
|
|
183
|
+
"description": "Hub id or slug. Can be provided via BUMP_HUB_ID environment variable",
|
|
184
|
+
"name": "hub",
|
|
185
|
+
"hasDynamicHelp": false,
|
|
186
|
+
"multiple": false,
|
|
187
|
+
"type": "option"
|
|
188
|
+
},
|
|
189
|
+
"token": {
|
|
190
|
+
"char": "t",
|
|
191
|
+
"description": "Documentation or Hub token. Can be provided via BUMP_TOKEN environment variable",
|
|
192
|
+
"name": "token",
|
|
193
|
+
"required": false,
|
|
194
|
+
"default": "99f52837852249b328c0a00249f846a3",
|
|
195
|
+
"hasDynamicHelp": false,
|
|
196
|
+
"multiple": false,
|
|
197
|
+
"type": "option"
|
|
198
|
+
}
|
|
199
|
+
},
|
|
200
|
+
"hasDynamicHelp": false,
|
|
201
|
+
"hiddenAliases": [],
|
|
202
|
+
"id": "diff",
|
|
203
|
+
"pluginAlias": "bump-cli",
|
|
204
|
+
"pluginName": "bump-cli",
|
|
205
|
+
"pluginType": "core",
|
|
206
|
+
"strict": true
|
|
207
|
+
},
|
|
208
|
+
"overlay": {
|
|
209
|
+
"aliases": [],
|
|
210
|
+
"args": {
|
|
211
|
+
"file": {
|
|
212
|
+
"description": "Path or URL to your API documentation file. OpenAPI (2.0 to 3.1.0) and AsyncAPI (2.x) specifications are currently supported.\nPath can also be a directory when deploying to a Hub.",
|
|
213
|
+
"name": "file",
|
|
214
|
+
"required": true
|
|
215
|
+
},
|
|
216
|
+
"overlay": {
|
|
217
|
+
"description": "Path or URL to an overlay file",
|
|
218
|
+
"name": "overlay",
|
|
219
|
+
"required": true
|
|
220
|
+
}
|
|
221
|
+
},
|
|
222
|
+
"description": "Apply an OpenAPI specified overlay to your API definition.",
|
|
223
|
+
"examples": [
|
|
224
|
+
"Apply the OVERLAY_FILE to the existing DEFINITION_FILE. The resulting\ndefinition is output on stdout meaning you can redirect it to a new\nfile.\n\n$ bump overlay DEFINITION_FILE OVERLAY_FILE > destination/file.json\n* Let's apply the overlay to the main definition... done\n"
|
|
225
|
+
],
|
|
226
|
+
"flags": {
|
|
227
|
+
"out": {
|
|
228
|
+
"char": "o",
|
|
229
|
+
"description": "Output file path",
|
|
230
|
+
"name": "out",
|
|
231
|
+
"hasDynamicHelp": false,
|
|
232
|
+
"multiple": false,
|
|
233
|
+
"type": "option"
|
|
234
|
+
}
|
|
235
|
+
},
|
|
236
|
+
"hasDynamicHelp": false,
|
|
237
|
+
"hiddenAliases": [],
|
|
238
|
+
"id": "overlay",
|
|
239
|
+
"pluginAlias": "bump-cli",
|
|
240
|
+
"pluginName": "bump-cli",
|
|
241
|
+
"pluginType": "core",
|
|
242
|
+
"strict": true
|
|
243
|
+
},
|
|
244
|
+
"preview": {
|
|
245
|
+
"aliases": [],
|
|
246
|
+
"args": {
|
|
247
|
+
"file": {
|
|
248
|
+
"description": "Path or URL to your API documentation file. OpenAPI (2.0 to 3.1.0) and AsyncAPI (2.x) specifications are currently supported.\nPath can also be a directory when deploying to a Hub.",
|
|
249
|
+
"name": "file",
|
|
250
|
+
"required": true
|
|
251
|
+
}
|
|
252
|
+
},
|
|
253
|
+
"description": "Create a documentation preview from the given file or URL.",
|
|
254
|
+
"examples": [
|
|
255
|
+
"$ <%= config.bin %> <%= command.id %> FILE\n* Your preview is visible at: https://bump.sh/preview/45807371-9a32-48a7-b6e4-1cb7088b5b9b\n"
|
|
256
|
+
],
|
|
257
|
+
"flags": {
|
|
258
|
+
"live": {
|
|
259
|
+
"char": "l",
|
|
260
|
+
"description": "Generate a preview each time you save the given file",
|
|
261
|
+
"name": "live",
|
|
262
|
+
"allowNo": false,
|
|
263
|
+
"type": "boolean"
|
|
264
|
+
},
|
|
265
|
+
"open": {
|
|
266
|
+
"char": "o",
|
|
267
|
+
"description": "Open the generated preview URL in your browser",
|
|
268
|
+
"name": "open",
|
|
269
|
+
"allowNo": false,
|
|
270
|
+
"type": "boolean"
|
|
271
|
+
}
|
|
272
|
+
},
|
|
273
|
+
"hasDynamicHelp": false,
|
|
274
|
+
"hiddenAliases": [],
|
|
275
|
+
"id": "preview",
|
|
276
|
+
"pluginAlias": "bump-cli",
|
|
277
|
+
"pluginName": "bump-cli",
|
|
278
|
+
"pluginType": "core",
|
|
279
|
+
"strict": true
|
|
280
|
+
}
|
|
281
|
+
},
|
|
282
|
+
"version": "2.9.1"
|
|
283
|
+
}
|
package/package.json
CHANGED
|
@@ -1,44 +1,45 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bump-cli",
|
|
3
|
-
"description": "The Bump CLI is used to interact with your API documentation hosted on Bump by using the API of developers.bump.sh",
|
|
4
|
-
"version": "2.
|
|
3
|
+
"description": "The Bump CLI is used to interact with your API documentation hosted on Bump.sh by using the API of developers.bump.sh",
|
|
4
|
+
"version": "2.9.1",
|
|
5
5
|
"author": "Paul Bonaud <paulr@bump.sh>",
|
|
6
6
|
"bin": {
|
|
7
|
-
"bump": "./bin/run"
|
|
7
|
+
"bump": "./bin/run.js"
|
|
8
8
|
},
|
|
9
9
|
"bugs": "https://github.com/bump-sh/cli/issues",
|
|
10
10
|
"devDependencies": {
|
|
11
|
-
"@oclif/
|
|
12
|
-
"@oclif/test": "^
|
|
13
|
-
"@types/
|
|
11
|
+
"@oclif/prettier-config": "^0.2.1",
|
|
12
|
+
"@oclif/test": "^4",
|
|
13
|
+
"@types/chai": "^4",
|
|
14
|
+
"@types/debug": "^4.1.12",
|
|
14
15
|
"@types/jsonpath": "^0.2.4",
|
|
15
|
-
"@types/mocha": "^10
|
|
16
|
-
"@types/node": "^
|
|
17
|
-
"@
|
|
18
|
-
"@typescript-eslint/
|
|
19
|
-
"chai": "^4.
|
|
20
|
-
"
|
|
21
|
-
"eslint": "^
|
|
22
|
-
"eslint-config-
|
|
23
|
-
"eslint-
|
|
24
|
-
"
|
|
25
|
-
"mocha": "^10
|
|
26
|
-
"
|
|
27
|
-
"
|
|
28
|
-
"
|
|
29
|
-
"
|
|
30
|
-
"
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"
|
|
16
|
+
"@types/mocha": "^10",
|
|
17
|
+
"@types/node": "^18",
|
|
18
|
+
"@types/sinon": "^17.0.3",
|
|
19
|
+
"@typescript-eslint/eslint-plugin": "^8.13.0",
|
|
20
|
+
"chai": "^4.5.0",
|
|
21
|
+
"eslint": "^8",
|
|
22
|
+
"eslint-config-oclif": "^5",
|
|
23
|
+
"eslint-config-oclif-typescript": "^3",
|
|
24
|
+
"eslint-config-prettier": "^9.1.0",
|
|
25
|
+
"eslint-plugin-prettier": "^5.2.1",
|
|
26
|
+
"mocha": "^10",
|
|
27
|
+
"mock-stdin": "^1.0.0",
|
|
28
|
+
"nock": "^14.0.0-beta.16",
|
|
29
|
+
"np": "^10.1.0",
|
|
30
|
+
"nyc": "^17.1.0",
|
|
31
|
+
"oclif": "^4",
|
|
32
|
+
"shx": "^0.3.3",
|
|
33
|
+
"sinon": "^19.0.2",
|
|
34
|
+
"ts-node": "^10",
|
|
35
|
+
"typescript": "^5"
|
|
34
36
|
},
|
|
35
37
|
"engines": {
|
|
36
|
-
"node": ">=
|
|
38
|
+
"node": ">=20.0.0"
|
|
37
39
|
},
|
|
38
40
|
"files": [
|
|
39
41
|
"/bin",
|
|
40
|
-
"/
|
|
41
|
-
"/npm-shrinkwrap.json",
|
|
42
|
+
"/dist",
|
|
42
43
|
"/oclif.manifest.json"
|
|
43
44
|
],
|
|
44
45
|
"homepage": "https://bump.sh",
|
|
@@ -51,12 +52,19 @@
|
|
|
51
52
|
"cli"
|
|
52
53
|
],
|
|
53
54
|
"license": "MIT",
|
|
54
|
-
"main": "
|
|
55
|
+
"main": "dist/index.js",
|
|
56
|
+
"type": "module",
|
|
55
57
|
"oclif": {
|
|
56
|
-
"commands": "./lib/commands",
|
|
57
58
|
"bin": "bump",
|
|
59
|
+
"dirname": "bump",
|
|
60
|
+
"commands": {
|
|
61
|
+
"strategy": "explicit",
|
|
62
|
+
"target": "./dist/index.js",
|
|
63
|
+
"identifier": "COMMANDS"
|
|
64
|
+
},
|
|
58
65
|
"plugins": [
|
|
59
|
-
"@oclif/plugin-help"
|
|
66
|
+
"@oclif/plugin-help",
|
|
67
|
+
"@oclif/plugin-warn-if-update-available"
|
|
60
68
|
],
|
|
61
69
|
"warn-if-update-available": {
|
|
62
70
|
"timeoutInDays": 30,
|
|
@@ -65,36 +73,36 @@
|
|
|
65
73
|
},
|
|
66
74
|
"repository": "bump-sh/cli",
|
|
67
75
|
"scripts": {
|
|
68
|
-
"build": "tsc -b",
|
|
69
|
-
"clean": "rm -rf
|
|
70
|
-
"lint": "eslint . --ext .ts
|
|
71
|
-
"fmt": "eslint . --ext .ts
|
|
72
|
-
"
|
|
73
|
-
"
|
|
74
|
-
"prepack": "
|
|
75
|
-
"pretest": "npm run clean && npm run build
|
|
76
|
+
"build": "shx rm -rf dist && tsc -b",
|
|
77
|
+
"clean": "rm -rf dist/ oclif.manifest.json",
|
|
78
|
+
"lint": "eslint . --ext .ts",
|
|
79
|
+
"fmt": "eslint --fix . --ext .ts",
|
|
80
|
+
"postpack": "shx rm -f oclif.manifest.json",
|
|
81
|
+
"posttest": "npm run lint",
|
|
82
|
+
"prepack": "npm run clean && npm run build && oclif manifest && oclif readme",
|
|
83
|
+
"pretest": "npm run clean && npm run build",
|
|
76
84
|
"release": "np --no-release-draft",
|
|
77
|
-
"test": "mocha \"test/**/*.test.ts\"",
|
|
85
|
+
"test": "mocha --forbid-only \"test/**/*.test.ts\"",
|
|
78
86
|
"test-coverage": "nyc npm run test",
|
|
79
|
-
"test-integration": "node ./test/integration.
|
|
80
|
-
"version": "oclif
|
|
87
|
+
"test-integration": "node ./test/integration.cjs",
|
|
88
|
+
"version": "oclif readme && git add README.md"
|
|
81
89
|
},
|
|
82
|
-
"types": "
|
|
90
|
+
"types": "dist/index.d.ts",
|
|
83
91
|
"dependencies": {
|
|
84
|
-
"@apidevtools/json-schema-ref-parser": "^
|
|
85
|
-
"@asyncapi/specs": "^
|
|
86
|
-
"@clack/prompts": "^0.
|
|
87
|
-
"@oclif/
|
|
88
|
-
"@oclif/
|
|
89
|
-
"@oclif/
|
|
90
|
-
"@
|
|
91
|
-
"
|
|
92
|
-
"
|
|
93
|
-
"
|
|
94
|
-
"debug": "^4.3.
|
|
92
|
+
"@apidevtools/json-schema-ref-parser": "^11.7.2",
|
|
93
|
+
"@asyncapi/specs": "^6.8.0",
|
|
94
|
+
"@clack/prompts": "^0.7.0",
|
|
95
|
+
"@oclif/core": "^4",
|
|
96
|
+
"@oclif/plugin-help": "^6",
|
|
97
|
+
"@oclif/plugin-warn-if-update-available": "^3.1.20",
|
|
98
|
+
"@stoplight/yaml": "^4.3.0",
|
|
99
|
+
"async-mutex": "^0.5.0",
|
|
100
|
+
"axios": "^1.7.7",
|
|
101
|
+
"chalk": "^5.3.0",
|
|
102
|
+
"debug": "^4.3.7",
|
|
95
103
|
"jsonpath": "^1.1.1",
|
|
96
|
-
"mergician": "^
|
|
97
|
-
"oas-schemas": "git+https://git@github.com/OAI/OpenAPI-Specification.git#
|
|
98
|
-
"
|
|
104
|
+
"mergician": "^2.0.2",
|
|
105
|
+
"oas-schemas": "git+https://git@github.com/OAI/OpenAPI-Specification.git#882d1caedb0bff825a1fd10728e7e3dc43912d37",
|
|
106
|
+
"open": "^10.1.0"
|
|
99
107
|
}
|
|
100
108
|
}
|
package/bin/run
DELETED
package/lib/api/error.js
DELETED
|
@@ -1,96 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
const tslib_1 = require("tslib");
|
|
4
|
-
const errors_1 = require("@oclif/errors");
|
|
5
|
-
const chalk_1 = (0, tslib_1.__importDefault)(require("chalk"));
|
|
6
|
-
const debug_1 = (0, tslib_1.__importDefault)(require("debug"));
|
|
7
|
-
const debug = (0, debug_1.default)('bump-cli:api-client');
|
|
8
|
-
class APIError extends errors_1.CLIError {
|
|
9
|
-
constructor(httpError, info = [], exit = 100) {
|
|
10
|
-
var _a, _b;
|
|
11
|
-
const status = (_a = httpError === null || httpError === void 0 ? void 0 : httpError.response) === null || _a === void 0 ? void 0 : _a.status;
|
|
12
|
-
debug(httpError);
|
|
13
|
-
switch ((_b = httpError === null || httpError === void 0 ? void 0 : httpError.response) === null || _b === void 0 ? void 0 : _b.status) {
|
|
14
|
-
case 422:
|
|
15
|
-
[info, exit] = APIError.invalidDefinition(httpError.response.data);
|
|
16
|
-
break;
|
|
17
|
-
case 401:
|
|
18
|
-
[info, exit] = APIError.unauthenticated();
|
|
19
|
-
break;
|
|
20
|
-
case 404:
|
|
21
|
-
case 400:
|
|
22
|
-
[info, exit] = APIError.notFound(httpError.response.data);
|
|
23
|
-
break;
|
|
24
|
-
}
|
|
25
|
-
if (info.length) {
|
|
26
|
-
super(info.join('\n'));
|
|
27
|
-
}
|
|
28
|
-
else {
|
|
29
|
-
super(`Unhandled API error (status: ${status}) (error: ${httpError})`);
|
|
30
|
-
}
|
|
31
|
-
this.exitCode = exit;
|
|
32
|
-
this.http = httpError;
|
|
33
|
-
}
|
|
34
|
-
static is(error) {
|
|
35
|
-
return error instanceof errors_1.CLIError && 'http' in error;
|
|
36
|
-
}
|
|
37
|
-
static notFound(error) {
|
|
38
|
-
const genericMessage = error.message || "It seems the documentation provided doesn't exist.";
|
|
39
|
-
return [
|
|
40
|
-
[
|
|
41
|
-
genericMessage,
|
|
42
|
-
`In a hub context you might want to try the ${chalk_1.default.dim('--auto-create')} flag.\nOtherwise, please check the given ${chalk_1.default.dim('--doc')}, ${chalk_1.default.dim('--token')} or ${chalk_1.default.dim('--hub')} flags`,
|
|
43
|
-
],
|
|
44
|
-
104,
|
|
45
|
-
];
|
|
46
|
-
}
|
|
47
|
-
static invalidDefinition(error) {
|
|
48
|
-
let info = [];
|
|
49
|
-
const genericMessage = error.message || 'Invalid definition file';
|
|
50
|
-
const exit = 122;
|
|
51
|
-
if (error && 'errors' in error) {
|
|
52
|
-
for (const [attr, message] of Object.entries(error.errors)) {
|
|
53
|
-
info = info.concat(APIError.humanAttributeError(attr, message));
|
|
54
|
-
}
|
|
55
|
-
}
|
|
56
|
-
else {
|
|
57
|
-
info.push(genericMessage);
|
|
58
|
-
}
|
|
59
|
-
return [info, exit];
|
|
60
|
-
}
|
|
61
|
-
static humanAttributeError(attribute, messages) {
|
|
62
|
-
let info = [];
|
|
63
|
-
if (messages instanceof Array) {
|
|
64
|
-
const allMessages = messages
|
|
65
|
-
.map((message, idx) => {
|
|
66
|
-
if (message instanceof Object) {
|
|
67
|
-
return this.humanAttributeError(idx.toString(), message);
|
|
68
|
-
}
|
|
69
|
-
else {
|
|
70
|
-
return message;
|
|
71
|
-
}
|
|
72
|
-
})
|
|
73
|
-
.join(', ');
|
|
74
|
-
info.push(`${chalk_1.default.underline(attribute)} ${allMessages}`);
|
|
75
|
-
}
|
|
76
|
-
else if (messages instanceof Object) {
|
|
77
|
-
for (const [child, child_messages] of Object.entries(messages)) {
|
|
78
|
-
info = info.concat(this.humanAttributeError(`${attribute}.${child}`, child_messages));
|
|
79
|
-
}
|
|
80
|
-
}
|
|
81
|
-
else if (messages) {
|
|
82
|
-
info.push(`${chalk_1.default.underline(attribute)} ${messages}`);
|
|
83
|
-
}
|
|
84
|
-
return info;
|
|
85
|
-
}
|
|
86
|
-
static unauthenticated() {
|
|
87
|
-
return [
|
|
88
|
-
[
|
|
89
|
-
'You are not allowed to deploy to this documentation.',
|
|
90
|
-
'please check your --token flag or BUMP_TOKEN variable',
|
|
91
|
-
],
|
|
92
|
-
101,
|
|
93
|
-
];
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
exports.default = APIError;
|
package/lib/api/index.js
DELETED
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.APIError = exports.BumpApi = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const axios_1 = (0, tslib_1.__importDefault)(require("axios"));
|
|
6
|
-
const vars_1 = require("./vars");
|
|
7
|
-
const error_1 = (0, tslib_1.__importDefault)(require("./error"));
|
|
8
|
-
exports.APIError = error_1.default;
|
|
9
|
-
class BumpApi {
|
|
10
|
-
// Check https://oclif.io/docs/config for details about Config.IConfig
|
|
11
|
-
constructor(config) {
|
|
12
|
-
this.config = config;
|
|
13
|
-
this.getPing = () => {
|
|
14
|
-
return this.client.get('/ping');
|
|
15
|
-
};
|
|
16
|
-
this.getVersion = (versionId, token) => {
|
|
17
|
-
return this.client.get(`/versions/${versionId}`, {
|
|
18
|
-
headers: this.authorizationHeader(token),
|
|
19
|
-
});
|
|
20
|
-
};
|
|
21
|
-
this.postPreview = (body) => {
|
|
22
|
-
return this.client.post('/previews', body);
|
|
23
|
-
};
|
|
24
|
-
this.putPreview = (versionId, body) => {
|
|
25
|
-
return this.client.put(`/previews/${versionId}`, body);
|
|
26
|
-
};
|
|
27
|
-
this.postVersion = (body, token) => {
|
|
28
|
-
return this.client.post('/versions', body, {
|
|
29
|
-
headers: this.authorizationHeader(token),
|
|
30
|
-
});
|
|
31
|
-
};
|
|
32
|
-
this.postDiff = (body) => {
|
|
33
|
-
return this.client.post('/diffs', body);
|
|
34
|
-
};
|
|
35
|
-
this.getDiff = (diffId, format) => {
|
|
36
|
-
return this.client.get(`/diffs/${diffId}`, {
|
|
37
|
-
params: { formats: [format] },
|
|
38
|
-
});
|
|
39
|
-
};
|
|
40
|
-
this.postValidation = (body, token) => {
|
|
41
|
-
return this.client.post('/validations', body, {
|
|
42
|
-
headers: this.authorizationHeader(token),
|
|
43
|
-
});
|
|
44
|
-
};
|
|
45
|
-
this.initializeResponseInterceptor = () => {
|
|
46
|
-
this.client.interceptors.response.use((data) => data, this.handleError);
|
|
47
|
-
};
|
|
48
|
-
this.handleError = (error) => Promise.reject(new error_1.default(error));
|
|
49
|
-
this.authorizationHeader = (token) => {
|
|
50
|
-
return { Authorization: `Basic ${Buffer.from(token).toString('base64')}` };
|
|
51
|
-
};
|
|
52
|
-
const baseURL = `${vars_1.vars.apiUrl}${vars_1.vars.apiBasePath}`;
|
|
53
|
-
const headers = {
|
|
54
|
-
'User-Agent': vars_1.vars.apiUserAgent(config.userAgent),
|
|
55
|
-
};
|
|
56
|
-
this.client = axios_1.default.create({
|
|
57
|
-
baseURL,
|
|
58
|
-
headers,
|
|
59
|
-
});
|
|
60
|
-
this.initializeResponseInterceptor();
|
|
61
|
-
}
|
|
62
|
-
}
|
|
63
|
-
exports.BumpApi = BumpApi;
|
|
64
|
-
(0, tslib_1.__exportStar)(require("./models"), exports);
|
package/lib/api/models.js
DELETED
package/lib/args.d.ts
DELETED
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
declare const fileArg: {
|
|
2
|
-
name: string;
|
|
3
|
-
required: boolean;
|
|
4
|
-
description: string;
|
|
5
|
-
};
|
|
6
|
-
declare const otherFileArg: {
|
|
7
|
-
name: string;
|
|
8
|
-
description: string;
|
|
9
|
-
};
|
|
10
|
-
declare const overlayFileArg: {
|
|
11
|
-
name: string;
|
|
12
|
-
required: boolean;
|
|
13
|
-
description: string;
|
|
14
|
-
};
|
|
15
|
-
export { fileArg, otherFileArg, overlayFileArg };
|