Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Extend intersystems.servers objects to contain optional superServer object #200

Merged
merged 3 commits into from
Jul 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 9 additions & 9 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

34 changes: 33 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@
"tough-cookie": "^4.1.3"
},
"devDependencies": {
"@intersystems-community/intersystems-servermanager": "latest",
"@intersystems-community/intersystems-servermanager": "^3.4.1",
"@types/vscode": "^1.75.0",
"@types/glob": "^7.1.1",
"@types/mocha": "^9.0.0",
Expand Down Expand Up @@ -181,6 +181,38 @@
],
"additionalProperties": false
},
"superServer": {
"type": "object",
"description": "InterSystems server's superserver.",
"properties": {
"host": {
"type": "string",
"description": "Hostname or IP address of the InterSystems server. If omitted, uses the value of 'webServer.host'.",
"anyOf": [
{
"format": "hostname"
},
{
"format": "ipv4"
},
{
"format": "ipv6"
}
]
},
"port": {
"type": "integer",
"description": "TCP port number the superserver listens on.",
"minimum": 1,
"maximum": 65535,
"default": 1972
}
},
"required": [
"port"
],
"additionalProperties": false
},
"username": {
"type": "string",
"description": "Username to connect as. If not set here it must be provided when connecting."
Expand Down
4 changes: 4 additions & 0 deletions src/api/getServerSpec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,10 @@ export async function getServerSpec(
server.webServer.scheme = server.webServer.scheme || "http";
server.webServer.port = server.webServer.port || (server.webServer.scheme === "https" ? 443 : 80);
server.webServer.pathPrefix = server.webServer.pathPrefix || "";
if (server.superServer) {
// Fall back to default if appropriate
server.superServer.host = server.superServer.host || server.webServer.host;
}


// When authentication provider is being used we should only have a password if it came from the deprecated
Expand Down
4 changes: 4 additions & 0 deletions types/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,10 @@ Package defining the interfaces used in the API that is published by the `inters

# Changelog

### v3.4.1

- Add optional `superServer` object.

### v3.0.4

- Export constants correctly.
Expand Down
6 changes: 6 additions & 0 deletions types/index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,14 @@ export interface IWebServerSpec {
pathPrefix?: string;
}

export interface ISuperServerSpec {
host?: string;
port: number;
}

export interface IJSONServerSpec {
webServer: IWebServerSpec;
superServer?: ISuperServerSpec;
username?: string;
password?: string;
description?: string;
Expand Down
2 changes: 1 addition & 1 deletion types/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@intersystems-community/intersystems-servermanager",
"version": "3.0.4",
"version": "3.4.1",
"description": "InterSystems Server Manager VS Code extension API interfaces and constants",
"types": "index.d.ts",
"main": "index.js",
Expand Down
Loading