Permalink
Browse files

feat(api): add metadata call to detect ticketer config support

  • Loading branch information...
RangerRick committed Aug 10, 2017
1 parent a948c04 commit bf0255babb434d83734b7176214cc2fd2288d664
Showing with 12 additions and 1 deletion.
  1. +1 −1 src/Client.ts
  2. +11 −0 src/api/ServerMetadata.ts
View
@@ -84,7 +84,7 @@ export class Client implements IHasHTTP {
metadata.type = ServerTypes.MERIDIAN;
}
}
if (version.ge('21.0.0')) {
if (metadata.ticketer()) {
metadata.ticketerConfig = new TicketerConfig();
metadata.ticketerConfig.enabled = false;
if (response.data.ticketerConfig) {
View
@@ -64,6 +64,15 @@ export class ServerMetadata {
}
}
/** Does this server support ticketer configuration metadata? */
public ticketer() {
if (this.type && this.type === ServerTypes.MERIDIAN) {
return this.version.ge('2017.0.0');
} else {
return this.version.ge('21.0.0');
}
}
/** What version of the ReST API does this server support? */
public apiVersion() {
if (this.type && this.type === ServerTypes.MERIDIAN) {
@@ -81,6 +90,7 @@ export class ServerMetadata {
graphs: this.graphs(),
outageSummaries: this.outageSummaries(),
setNodeLocation: this.setNodeLocation(),
ticketer: this.ticketer(),
type: (this.type === ServerTypes.MERIDIAN ? 'Meridian' : 'Horizon'),
};
}
@@ -94,6 +104,7 @@ export class ServerMetadata {
+ ',graphs=' + this.graphs()
+ ',outageSummaries=' + this.outageSummaries()
+ ',setNodeLocation=' + this.setNodeLocation()
+ ',ticketer=' + this.ticketer()
+ ']';
}

0 comments on commit bf0255b

Please sign in to comment.