Skip to content

Commit 74230fb

Browse files
committed
A slightly more faithful alternative approach
1 parent 9f1d783 commit 74230fb

File tree

4 files changed

+91
-54
lines changed

4 files changed

+91
-54
lines changed

output/openapi/elasticsearch-openapi.json

Lines changed: 33 additions & 14 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/schema/schema.json

Lines changed: 42 additions & 25 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

output/typescript/types.ts

Lines changed: 5 additions & 6 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

specification/ingest/_types/Database.ts

Lines changed: 11 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -19,19 +19,21 @@
1919

2020
import { Id, Name } from '@_types/common'
2121

22-
export class DatabaseConfiguration {
22+
specification / ingest / _types / Database.ts
23+
24+
/** The configuration necessary to identify which IP geolocation provider to use to download the database, as well as any provider-specific configuration necessary for such downloading.
25+
* At present, the only supported providers are maxmind and ipinfo, and the maxmind provider requires that an account_id (string) is configured.
26+
* A provider (either maxmind or ipinfo) must be specified.
27+
*/
28+
export type DatabaseConfiguration = Maxmind | Ipinfo
29+
30+
export class DatabaseConfigurationBase {
2331
/** The provider-assigned name of the IP geolocation database to download. */
2432
name: Name
25-
/** The configuration necessary to identify which IP geolocation provider to use to download the database, as well as any provider-specific configuration necessary for such downloading.
26-
* At present, the only supported providers are maxmind and ipinfo, and the maxmind provider requires that an account_id (string) is configured.
27-
* A provider (either maxmind or ipinfo) must be specified.
28-
*/
29-
maxmind?: Maxmind
30-
ipinfo?: Ipinfo
3133
}
3234

33-
export class Maxmind {
35+
export class Maxmind extends DatabaseConfigurationBase {
3436
account_id: Id
3537
}
3638

37-
export class Ipinfo {}
39+
export class Ipinfo extends DatabaseConfigurationBase {}

0 commit comments

Comments
 (0)