bump-cli 2.9.10 → 2.9.11

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/dist/api/index.js CHANGED
@@ -21,7 +21,7 @@ class BumpApi {
21
21
  });
22
22
  putPreview = (versionId, body) => this.client.put(`/previews/${versionId}`, body);
23
23
  authorizationHeader = (token) => ({
24
- Authorization: `Basic ${Buffer.from(token).toString('base64')}`,
24
+ Authorization: `Token ${token}`,
25
25
  });
26
26
  handleError = (error) => Promise.reject(new APIError(error));
27
27
  initializeResponseInterceptor = () => {
@@ -4,6 +4,7 @@ export declare class Overlay {
4
4
  run(spec: APIDefinition, overlay: OpenAPIOverlay): APIDefinition;
5
5
  private executeAction;
6
6
  private humanName;
7
+ private pathEntryToKey;
7
8
  private remove;
8
9
  private update;
9
10
  }
@@ -76,12 +76,7 @@ export class Overlay {
76
76
  explodedPath.shift();
77
77
  // Take last element from path (which is the thing to act
78
78
  // upon)
79
- let thingToActUpon = explodedPath.pop();
80
- // The last element (e.g. '"price"]' or '0]') contains a final ']'
81
- // so we need to remove it AND we need to parse the element to
82
- // transform the string in either a string or a number
83
- thingToActUpon =
84
- thingToActUpon === undefined ? '$' : (thingToActUpon = JSON.parse(thingToActUpon.slice(0, -1)));
79
+ const thingToActUpon = this.pathEntryToKey(explodedPath.pop());
85
80
  // Reconstruct the stringified path expression targeting the parent
86
81
  const parentPath = explodedPath.join('][');
87
82
  const parent = parentPath.length > 0 ? jsonpath.query(spec, `$[${parentPath}]`) : spec;
@@ -103,6 +98,16 @@ export class Overlay {
103
98
  humanName(action) {
104
99
  return action.description ? `Action '${action.description}'` : 'Action';
105
100
  }
101
+ // The last path entry (e.g. "'price']" or '0]') contains a final
102
+ // ']' so we need to remove it AND we need to replace single quotes
103
+ // to double quotes AND FINALLY parse the element to transform the
104
+ // string in either a string or a number.
105
+ pathEntryToKey(pathEntry) {
106
+ if (pathEntry === undefined) {
107
+ return '$';
108
+ }
109
+ return JSON.parse(pathEntry.slice(0, -1).replaceAll(/(^'|'$)/g, '"'));
110
+ }
106
111
  remove(parent, property_or_index) {
107
112
  if (Array.isArray(parent)) {
108
113
  parent.splice(property_or_index, 1);
@@ -294,5 +294,5 @@
294
294
  "strict": true
295
295
  }
296
296
  },
297
- "version": "2.9.10"
297
+ "version": "2.9.11"
298
298
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "bump-cli",
3
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.10",
4
+ "version": "2.9.11",
5
5
  "author": "Paul Bonaud <paulr@bump.sh>",
6
6
  "bin": {
7
7
  "bump": "./bin/run.js"
@@ -17,7 +17,7 @@
17
17
  "@types/node": "^24",
18
18
  "@types/sinon": "^17.0.3",
19
19
  "@typescript-eslint/eslint-plugin": "^8.13.0",
20
- "chai": "^5.1.2",
20
+ "chai": "^6.2.2",
21
21
  "eslint": "^8",
22
22
  "eslint-config-oclif": "^5",
23
23
  "eslint-config-oclif-typescript": "^3",
@@ -26,11 +26,11 @@
26
26
  "mocha": "^11",
27
27
  "mock-stdin": "^1.0.0",
28
28
  "nock": "^14.0.0-beta.16",
29
- "np": "^10.1.0",
29
+ "np": "^11.0.2",
30
30
  "nyc": "^17.1.0",
31
31
  "oclif": "^4",
32
32
  "shx": "^0.4.0",
33
- "sinon": "^19.0.2",
33
+ "sinon": "^21.0.1",
34
34
  "ts-node": "^10",
35
35
  "typescript": "^5"
36
36
  },
@@ -101,7 +101,7 @@
101
101
  "axios": "^1.7.7",
102
102
  "chalk": "^5.3.0",
103
103
  "debug": "^4.3.7",
104
- "jsonpathly": "^2.0.2",
104
+ "jsonpathly": "^3.0.0",
105
105
  "mergician": "^2.0.2",
106
106
  "open": "^10.1.0"
107
107
  }