bump-cli 2.9.8 → 2.9.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.
package/README.md CHANGED
@@ -88,7 +88,7 @@ $ bump --help
88
88
  The Bump.sh CLI is used to interact with your API documentation hosted on Bump.sh by using the API of developers.bump.sh
89
89
 
90
90
  VERSION
91
- bump-cli/2.9.5 linux-x64 node-v20.18.1
91
+ bump-cli/x.y.z linux-x64 node-v20+
92
92
 
93
93
  USAGE
94
94
  $ bump [COMMAND]
@@ -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, overlays?: string[] | undefined): Promise<DiffResponse | 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: string | undefined, overlays: string[] | undefined): Promise<DiffResponse | undefined>;
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, overlays) {
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, overlays);
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, overlays);
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, overlays) {
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, overlays);
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, overlays);
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, overlays);
114
+ diffVersion = await this.createVersion(file2, documentation, token, hub, branch, diffVersion && diffVersion.id, overlays2 || overlays1);
115
115
  }
116
116
  }
117
117
  if (diffVersion) {
@@ -0,0 +1,10 @@
1
+ import type { JSONSchema4, JSONSchema7 } from 'json-schema';
2
+ declare const _default: {
3
+ schemas: {
4
+ '2.0': JSONSchema4;
5
+ '3.0': JSONSchema4;
6
+ '3.1': JSONSchema7;
7
+ '3.2': JSONSchema7;
8
+ };
9
+ };
10
+ export default _default;
@@ -0,0 +1,14 @@
1
+ // All spec version definitions are copied from the official
2
+ // spec repo https://spec.openapis.org/oas/
3
+ import schemaV20 from './v2.0/schema.json' with { type: 'json' };
4
+ import schemaV30 from './v3.0/schema.json' with { type: 'json' };
5
+ import schemaV31 from './v3.1/schema.json' with { type: 'json' };
6
+ import schemaV32 from './v3.2/schema.json' with { type: 'json' };
7
+ export default {
8
+ schemas: {
9
+ '2.0': schemaV20,
10
+ '3.0': schemaV30,
11
+ '3.1': schemaV31,
12
+ '3.2': schemaV32,
13
+ },
14
+ };