bump-cli 2.9.9 → 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 +1 -1
- package/dist/core/diff.d.ts +2 -2
- package/dist/core/diff.js +7 -7
- package/dist/core/overlay.d.ts +1 -0
- package/dist/core/overlay.js +11 -6
- package/oclif.manifest.json +1 -1
- package/package.json +6 -6
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: `
|
|
24
|
+
Authorization: `Token ${token}`,
|
|
25
25
|
});
|
|
26
26
|
handleError = (error) => Promise.reject(new APIError(error));
|
|
27
27
|
initializeResponseInterceptor = () => {
|
package/dist/core/diff.d.ts
CHANGED
|
@@ -8,14 +8,14 @@ export declare class Diff {
|
|
|
8
8
|
constructor(config?: Config);
|
|
9
9
|
get bumpClient(): BumpApi;
|
|
10
10
|
get pollingPeriod(): number;
|
|
11
|
-
createDiff(file1: string, file2: string, expires: string | undefined,
|
|
11
|
+
createDiff(file1: string, file2: string, expires: string | undefined, overlays1?: string[] | undefined, overlays2?: string[] | undefined): Promise<DiffResponse | undefined>;
|
|
12
12
|
createVersion(file: string, documentation: string, token: string, hub: string | undefined, branch_name: string | undefined, previous_version_id?: string | undefined, overlays?: string[] | undefined): Promise<VersionResponse | undefined>;
|
|
13
13
|
d(formatter: any, ...args: any[]): void;
|
|
14
14
|
extractDiff(versionWithDiff: VersionResponse & WithDiff): DiffResponse;
|
|
15
15
|
isVersion(result: DiffResponse | VersionResponse): result is VersionResponse;
|
|
16
16
|
isVersionWithDiff(result: DiffResponse | (VersionResponse & WithDiff)): result is VersionResponse & WithDiff;
|
|
17
17
|
pollingDelay(): Promise<void>;
|
|
18
|
-
run(file1: string, file2: string | undefined, documentation: string | undefined, hub: string | undefined, branch: string | undefined, token: string | undefined, format: string, expires
|
|
18
|
+
run(file1: string, file2: string | undefined, documentation: string | undefined, hub: string | undefined, branch: string | undefined, token: string | undefined, format: string, expires?: string | undefined, overlays1?: string[] | undefined, overlays2?: string[] | undefined): Promise<DiffResponse | undefined>;
|
|
19
19
|
waitResult(result: DiffResponse | VersionResponse, token: string | undefined, opts: {
|
|
20
20
|
format: string;
|
|
21
21
|
timeout: number;
|
package/dist/core/diff.js
CHANGED
|
@@ -22,11 +22,11 @@ export class Diff {
|
|
|
22
22
|
get pollingPeriod() {
|
|
23
23
|
return process.env.BUMP_POLLING_PERIOD ? Number(process.env.BUMP_POLLING_PERIOD) : 1000;
|
|
24
24
|
}
|
|
25
|
-
async createDiff(file1, file2, expires,
|
|
25
|
+
async createDiff(file1, file2, expires, overlays1, overlays2) {
|
|
26
26
|
const api = await API.load(file1);
|
|
27
|
-
const [previous_definition, previous_references] = await api.extractDefinition(undefined,
|
|
27
|
+
const [previous_definition, previous_references] = await api.extractDefinition(undefined, overlays1);
|
|
28
28
|
const api2 = await API.load(file2);
|
|
29
|
-
const [definition, references] = await api2.extractDefinition(undefined,
|
|
29
|
+
const [definition, references] = await api2.extractDefinition(undefined, overlays2 || overlays1);
|
|
30
30
|
const request = {
|
|
31
31
|
definition,
|
|
32
32
|
expires_at: expires,
|
|
@@ -98,20 +98,20 @@ export class Diff {
|
|
|
98
98
|
async pollingDelay() {
|
|
99
99
|
await this.delay(this.pollingPeriod);
|
|
100
100
|
}
|
|
101
|
-
async run(file1, file2, documentation, hub, branch, token, format, expires,
|
|
101
|
+
async run(file1, file2, documentation, hub, branch, token, format, expires, overlays1, overlays2) {
|
|
102
102
|
if (!this._config)
|
|
103
103
|
this._config = await Config.load(resolve(import.meta.dirname, './../../'));
|
|
104
104
|
let diffVersion;
|
|
105
105
|
if (file2 && (!documentation || !token)) {
|
|
106
|
-
diffVersion = await this.createDiff(file1, file2, expires,
|
|
106
|
+
diffVersion = await this.createDiff(file1, file2, expires, overlays1, overlays2);
|
|
107
107
|
}
|
|
108
108
|
else {
|
|
109
109
|
if (!documentation || !token) {
|
|
110
110
|
throw new Error('Please login to bump (with documentation & token) when using a single file argument');
|
|
111
111
|
}
|
|
112
|
-
diffVersion = await this.createVersion(file1, documentation, token, hub, branch, undefined,
|
|
112
|
+
diffVersion = await this.createVersion(file1, documentation, token, hub, branch, undefined, overlays1);
|
|
113
113
|
if (file2) {
|
|
114
|
-
diffVersion = await this.createVersion(file2, documentation, token, hub, branch, diffVersion && diffVersion.id,
|
|
114
|
+
diffVersion = await this.createVersion(file2, documentation, token, hub, branch, diffVersion && diffVersion.id, overlays2 || overlays1);
|
|
115
115
|
}
|
|
116
116
|
}
|
|
117
117
|
if (diffVersion) {
|
package/dist/core/overlay.d.ts
CHANGED
package/dist/core/overlay.js
CHANGED
|
@@ -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
|
-
|
|
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);
|
package/oclif.manifest.json
CHANGED
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.
|
|
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": "^
|
|
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": "^
|
|
29
|
+
"np": "^11.0.2",
|
|
30
30
|
"nyc": "^17.1.0",
|
|
31
31
|
"oclif": "^4",
|
|
32
32
|
"shx": "^0.4.0",
|
|
33
|
-
"sinon": "^
|
|
33
|
+
"sinon": "^21.0.1",
|
|
34
34
|
"ts-node": "^10",
|
|
35
35
|
"typescript": "^5"
|
|
36
36
|
},
|
|
@@ -92,7 +92,7 @@
|
|
|
92
92
|
"dependencies": {
|
|
93
93
|
"@apidevtools/json-schema-ref-parser": "^11.7.2",
|
|
94
94
|
"@asyncapi/specs": "^6.8.0",
|
|
95
|
-
"@clack/prompts": "^0.
|
|
95
|
+
"@clack/prompts": "^0.11.0",
|
|
96
96
|
"@oclif/core": "^4",
|
|
97
97
|
"@oclif/plugin-help": "^6",
|
|
98
98
|
"@oclif/plugin-warn-if-update-available": "^3.1.20",
|
|
@@ -101,7 +101,7 @@
|
|
|
101
101
|
"axios": "^1.7.7",
|
|
102
102
|
"chalk": "^5.3.0",
|
|
103
103
|
"debug": "^4.3.7",
|
|
104
|
-
"jsonpathly": "^
|
|
104
|
+
"jsonpathly": "^3.0.0",
|
|
105
105
|
"mergician": "^2.0.2",
|
|
106
106
|
"open": "^10.1.0"
|
|
107
107
|
}
|