Skip to content

Commit 012d6f0

Browse files
authored
Merge pull request #172 from intersystems-community/servermanager
initial support for server's settings from intersystems.servers
2 parents bd02bf7 + b9050ab commit 012d6f0

22 files changed

+515
-265
lines changed

.vscode/launch.json

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,13 +39,15 @@
3939
"request": "launch",
4040
"runtimeExecutable": "${execPath}",
4141
"args": [
42+
"${workspaceFolder}/test-fixtures/test.code-workspace",
43+
"--disable-extensions",
4244
"--extensionDevelopmentPath=${workspaceFolder}",
4345
"--extensionTestsPath=${workspaceFolder}/out/test/suite/index"
4446
],
4547
"outFiles": [
4648
"${workspaceFolder}/out/test/**/*.js"
4749
],
48-
"preLaunchTask": "npm: watch"
50+
"preLaunchTask": "npm: test-compile"
4951
}
5052
]
5153
}

package-lock.json

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

package.json

Lines changed: 93 additions & 62 deletions
Original file line numberDiff line numberDiff line change
@@ -64,6 +64,9 @@
6464
"onDebugInitialConfigurations"
6565
],
6666
"main": "./dist/extension",
67+
"extensionDependencies": [
68+
"intersystems-community.servermanager"
69+
],
6770
"contributes": {
6871
"menus": {
6972
"commandPalette": [
@@ -502,70 +505,96 @@
502505
"objectscript.conn": {
503506
"type": "object",
504507
"description": "Server Access",
505-
"scope": "resource"
506-
},
507-
"objectscript.conn.active": {
508-
"description": "Active",
509-
"type": "boolean",
510-
"default": false
511-
},
512-
"objectscript.conn.host": {
513-
"description": "Hostname",
514-
"format": "hostname",
515-
"type": "string",
516-
"default": "localhost"
517-
},
518-
"objectscript.conn.port": {
519-
"description": "Port number",
520-
"type": "number",
521-
"default": 52773
522-
},
523-
"objectscript.conn.username": {
524-
"description": "Username",
525-
"type": "string",
526-
"default": "_SYSTEM"
527-
},
528-
"objectscript.conn.password": {
529-
"description": "User's Password",
530-
"type": "string",
531-
"default": "SYS"
532-
},
533-
"objectscript.conn.ns": {
534-
"description": "Server Namespace",
535-
"type": "string",
536-
"default": "USER"
537-
},
538-
"objectscript.conn.https": {
539-
"description": "Use SSL to access to API",
540-
"type": "boolean",
541-
"default": false
542-
},
543-
"objectscript.conn.docker-compose": {
544-
"description": "Connect to server running in docker-compose",
545-
"type": "object",
546-
"scope": "resource"
547-
},
548-
"objectscript.conn.docker-compose.service": {
549-
"description": "Name of service in docker-compose",
550-
"type": "string"
551-
},
552-
"objectscript.conn.docker-compose.internalPort": {
553-
"description": "Target port inside the service in docker-compose",
554-
"type": "number",
555-
"default": 52773
556-
},
557-
"objectscript.conn.docker-compose.file": {
558-
"description": "docker-compose file",
559-
"type": "string",
560-
"default": "docker-compose.yml"
561-
},
562-
"objectscript.conn.links": {
563-
"description": "Extra links for the server",
564-
"type": "object"
508+
"scope": "resource",
509+
"additionalProperties": false,
510+
"required": [
511+
"active"
512+
],
513+
"properties": {
514+
"active": {
515+
"type": "boolean",
516+
"description": "This connection is active.",
517+
"default": false
518+
},
519+
"server": {
520+
"type": "string",
521+
"pattern": "^[a-z0-9-._~]+$",
522+
"markdownDescription": "Server defined in `#intersystems.servers#`"
523+
},
524+
"host": {
525+
"type": "string",
526+
"description": "Hostname or IP address of the web server.",
527+
"anyOf": [
528+
{
529+
"format": "hostname"
530+
},
531+
{
532+
"format": "ipv4"
533+
},
534+
{
535+
"format": "ipv6"
536+
}
537+
],
538+
"default": "localhost"
539+
},
540+
"port": {
541+
"type": "integer",
542+
"description": "TCP port number the web server listens on.",
543+
"minimum": 1,
544+
"maximum": 65535
545+
},
546+
"ns": {
547+
"description": "Server namespace.",
548+
"type": "string",
549+
"default": "USER"
550+
},
551+
"username": {
552+
"type": "string",
553+
"description": "Username to connect as. If not set here it must be provided when connecting."
554+
},
555+
"password": {
556+
"type": "string",
557+
"description": "Password of username. If not set here it must be provided when connecting."
558+
},
559+
"https": {
560+
"description": "Use SSL/TLS to access the server.",
561+
"type": "boolean",
562+
"default": false
563+
},
564+
"links": {
565+
"description": "Extra links for the server.",
566+
"type": "object",
567+
"patternProperties": {
568+
".*": {
569+
"type": "string",
570+
"format": "uri"
571+
}
572+
}
573+
},
574+
"docker-compose": {
575+
"type": "object",
576+
"description": "Connect to server running in docker-compose.",
577+
"additionalProperties": false,
578+
"properties": {
579+
"service": {
580+
"description": "Name of service in docker-compose.",
581+
"type": "string"
582+
},
583+
"internalPort": {
584+
"description": "Target port inside the service in docker-compose.",
585+
"type": "number"
586+
},
587+
"file": {
588+
"description": "Name of docker-compose file.",
589+
"type": "string"
590+
}
591+
}
592+
}
593+
}
565594
},
566595
"objectscript.export": {
567596
"type": "object",
568-
"description": "Export only the necessary stuff ",
597+
"description": "Export only the necessary stuff.",
569598
"scope": "resource"
570599
},
571600
"objectscript.export.folder": {
@@ -778,8 +807,9 @@
778807
"webpack-dev": "webpack --mode development --watch",
779808
"package": "vsce package",
780809
"compile": "webpack --mode production && tsc -p ./",
810+
"test-compile": "webpack --mode development && tsc -p ./",
781811
"watch": "tsc -w -p ./tsconfig.json",
782-
"pretest": "npm run compile",
812+
"pretest": "npm run test-compile",
783813
"test": "node ./out/test/runTest.js",
784814
"lint": "eslint src/**",
785815
"lint-fix": "eslint --fix src/**",
@@ -808,6 +838,7 @@
808838
"extend": "^3.0.2",
809839
"minimist": ">=1.2.5",
810840
"mocha": "^8.0.1",
841+
"nock": "^13.0.0",
811842
"prettier": "^2.0.5",
812843
"tape": "^5.0.1",
813844
"ts-loader": "^7.0.5",

src/api/atelier.d.ts

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
1+
/**
2+
* Atelier API
3+
*/
4+
5+
interface ResponseStatus {
6+
errors: string[];
7+
summary: string;
8+
}
9+
10+
interface Content<T> {
11+
content: T;
12+
}
13+
14+
export interface Response<T = any> {
15+
status: ResponseStatus;
16+
console: string[];
17+
result: T;
18+
}
19+
20+
interface ServerInfoFeature {
21+
name: string;
22+
enabled: string;
23+
}
24+
25+
export interface Document {
26+
name: string;
27+
db: string;
28+
ts: string;
29+
upd: boolean;
30+
cat: "RTN" | "CLS" | "CSP" | "OTH";
31+
status: string;
32+
enc: boolean;
33+
flags: number;
34+
content: string[];
35+
ext: string;
36+
}
37+
38+
export interface ServerInfo {
39+
version: string;
40+
id: string;
41+
api: number;
42+
features: ServerInfoFeature[];
43+
namespaces: string[];
44+
}
45+
46+
export interface SearchMatch {
47+
text: string;
48+
line?: number;
49+
member?: string;
50+
attr?: string;
51+
attrline?: number;
52+
}
53+
54+
export interface SearchResult {
55+
doc: string;
56+
matches: SearchMatch[];
57+
}
58+
59+
export interface AtelierJob {
60+
pid: number;
61+
namespace: string;
62+
routine: string;
63+
state: string;
64+
device: string;
65+
}
66+
67+
export interface DeleteStatus {
68+
name: string;
69+
db: string;
70+
status: string;
71+
}

0 commit comments

Comments
 (0)