@devkong/cli 0.0.8 → 0.0.11
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 +2 -2
- package/assets/python-install.sh +1 -1
- package/index.js +20 -27
- package/package.json +1 -1
- package/packages/kong-cli/src/commands/generateCommand.d.ts +0 -2
- package/packages/kong-cli/src/commands/{publishCommand.d.ts → publishVersionCommand.d.ts} +1 -1
- package/assets/kong-json-schema.json +0 -136
package/README.md
CHANGED
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
3. Build kong-cli: `npx nx run-many -t build -p kong-cli kong-cli-nx`
|
|
6
6
|
4. Publish kong-cli: `npx nx release publish --git-commit=false`
|
|
7
7
|
5. Install kong-cli: `npm i -g @devkong/cli@latest --registry="http://localhost:4873/"`
|
|
8
|
-
6. Generate test template: `kong generate
|
|
8
|
+
6. Generate test template: `kong generate <extension-name>`
|
|
9
9
|
|
|
10
10
|
## Publish to the @devkong
|
|
11
11
|
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
3. Build kong-cli: `npx nx run-many -t build -p kong-cli kong-cli-nx`
|
|
15
15
|
4. Publish kong-cli: `npx nx release publish --git-commit=false --access=public`
|
|
16
16
|
5. Install kong-cli: `npm i -g @devkong/cli@latest`
|
|
17
|
-
6. Generate test template: `kong generate
|
|
17
|
+
6. Generate test template: `kong generate <extension-name>`
|
|
18
18
|
|
|
19
19
|
## Publish to the Nexus
|
|
20
20
|
|
package/assets/python-install.sh
CHANGED
package/index.js
CHANGED
|
@@ -66959,6 +66959,18 @@ var ConfigureCommand = class {
|
|
|
66959
66959
|
|
|
66960
66960
|
// packages/kong-cli/src/commands/generateCommand.ts
|
|
66961
66961
|
var import_create_nx_workspace = __toESM(require_create_nx_workspace());
|
|
66962
|
+
var GenerateCommand = class {
|
|
66963
|
+
async execute(extensionName, sdk, presetVersion) {
|
|
66964
|
+
const id = generateShortId();
|
|
66965
|
+
await (0, import_create_nx_workspace.createWorkspace)(`@devkong/cli-nx@${presetVersion}`, {
|
|
66966
|
+
name: extensionName,
|
|
66967
|
+
id,
|
|
66968
|
+
platform: sdk,
|
|
66969
|
+
nxCloud: "skip",
|
|
66970
|
+
packageManager: "npm"
|
|
66971
|
+
});
|
|
66972
|
+
}
|
|
66973
|
+
};
|
|
66962
66974
|
|
|
66963
66975
|
// node_modules/listr2/node_modules/eventemitter3/index.mjs
|
|
66964
66976
|
var import_index2 = __toESM(require_eventemitter3(), 1);
|
|
@@ -69501,24 +69513,6 @@ var InstallCommand = class {
|
|
|
69501
69513
|
}
|
|
69502
69514
|
};
|
|
69503
69515
|
|
|
69504
|
-
// packages/kong-cli/src/commands/generateCommand.ts
|
|
69505
|
-
var GenerateCommand = class {
|
|
69506
|
-
constructor(verbose = false) {
|
|
69507
|
-
this.verbose = verbose;
|
|
69508
|
-
}
|
|
69509
|
-
async execute(extensionName, sdk, presetVersion) {
|
|
69510
|
-
const id = generateShortId();
|
|
69511
|
-
const workspace = await (0, import_create_nx_workspace.createWorkspace)(`@devkong/cli-nx@${presetVersion}`, {
|
|
69512
|
-
name: extensionName,
|
|
69513
|
-
id,
|
|
69514
|
-
platform: sdk,
|
|
69515
|
-
nxCloud: "skip",
|
|
69516
|
-
packageManager: "npm"
|
|
69517
|
-
});
|
|
69518
|
-
await new InstallCommand(this.verbose).execute(workspace.directory);
|
|
69519
|
-
}
|
|
69520
|
-
};
|
|
69521
|
-
|
|
69522
69516
|
// packages/kong-cli/src/common/kongJson.ts
|
|
69523
69517
|
var import_fs3 = __toESM(require("fs"));
|
|
69524
69518
|
var import_json_schema = __toESM(require_validate());
|
|
@@ -69771,7 +69765,9 @@ var ListExtensionSnapshotCommand = class {
|
|
|
69771
69765
|
} else {
|
|
69772
69766
|
const result = [];
|
|
69773
69767
|
for (const ver of versions) {
|
|
69774
|
-
result.push(
|
|
69768
|
+
result.push(
|
|
69769
|
+
`${ver.version}, ${ver.created}, ${ver.createdBy}, ${ver.notes || "no notes"}`
|
|
69770
|
+
);
|
|
69775
69771
|
}
|
|
69776
69772
|
task.output = result.join("\n");
|
|
69777
69773
|
}
|
|
@@ -69804,8 +69800,8 @@ var RegistryClient = class {
|
|
|
69804
69800
|
}
|
|
69805
69801
|
};
|
|
69806
69802
|
|
|
69807
|
-
// packages/kong-cli/src/commands/
|
|
69808
|
-
var
|
|
69803
|
+
// packages/kong-cli/src/commands/publishVersionCommand.ts
|
|
69804
|
+
var PublishVersionCommand = class {
|
|
69809
69805
|
constructor(profile, verbose = false) {
|
|
69810
69806
|
this.verbose = verbose;
|
|
69811
69807
|
this.isWin = process.platform === "win32";
|
|
@@ -69928,10 +69924,7 @@ var PublishCommand = class {
|
|
|
69928
69924
|
return `${this.wslPrefix} /bin/bash -c 'echo ${password} |docker login -u ${username} --password-stdin ${registry3}'`;
|
|
69929
69925
|
}
|
|
69930
69926
|
getSchemaCmdText() {
|
|
69931
|
-
|
|
69932
|
-
if (process.platform !== "win32") {
|
|
69933
|
-
engine = "./.venv/bin/python";
|
|
69934
|
-
}
|
|
69927
|
+
const engine = this.isWin ? ".\\.venv\\Scripts\\python.exe" : "./.venv/bin/python";
|
|
69935
69928
|
const mainPyPath = resolveProjectPath("src/main.py");
|
|
69936
69929
|
return `${engine} ${mainPyPath} --schema`;
|
|
69937
69930
|
}
|
|
@@ -70032,7 +70025,7 @@ async function main() {
|
|
|
70032
70025
|
).addOption(new Option("--verbose", "Show full logs during command execution")).action(async (name, options) => {
|
|
70033
70026
|
try {
|
|
70034
70027
|
const presetVersion = getPresetVersion();
|
|
70035
|
-
await new GenerateCommand(
|
|
70028
|
+
await new GenerateCommand().execute(name, options.sdk, presetVersion);
|
|
70036
70029
|
} catch (ex) {
|
|
70037
70030
|
printError("generate command failed", ex);
|
|
70038
70031
|
}
|
|
@@ -70054,7 +70047,7 @@ async function main() {
|
|
|
70054
70047
|
).addOption(new Option("--profile <name>", "Configured Kong profile to use").default("default")).addOption(new Option("--verbose", "Show full logs during command execution")).addOption(new Option("--notes [text]", "Optional version notes").default("")).action(async (options) => {
|
|
70055
70048
|
try {
|
|
70056
70049
|
const kongJson = getKongJson();
|
|
70057
|
-
await new
|
|
70050
|
+
await new PublishVersionCommand(getProfile(options.profile), options.verbose).execute(
|
|
70058
70051
|
kongJson.name,
|
|
70059
70052
|
options.notes
|
|
70060
70053
|
);
|
package/package.json
CHANGED
|
@@ -1,136 +0,0 @@
|
|
|
1
|
-
{
|
|
2
|
-
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
-
"type": "object",
|
|
4
|
-
"properties": {
|
|
5
|
-
"id": {
|
|
6
|
-
"type": "string"
|
|
7
|
-
},
|
|
8
|
-
"name": {
|
|
9
|
-
"type": "string"
|
|
10
|
-
},
|
|
11
|
-
"ownership": {
|
|
12
|
-
"type": "array",
|
|
13
|
-
"items": {
|
|
14
|
-
"type": "string"
|
|
15
|
-
}
|
|
16
|
-
},
|
|
17
|
-
"sdk": {
|
|
18
|
-
"type": "string",
|
|
19
|
-
"enum": ["python", "kotlin"]
|
|
20
|
-
},
|
|
21
|
-
"alias": {
|
|
22
|
-
"type": "object",
|
|
23
|
-
"properties": {
|
|
24
|
-
"env": {
|
|
25
|
-
"type": "object",
|
|
26
|
-
"additionalProperties": true
|
|
27
|
-
},
|
|
28
|
-
"input": {
|
|
29
|
-
"type": "object",
|
|
30
|
-
"properties": {
|
|
31
|
-
"filter": {
|
|
32
|
-
"type": "string"
|
|
33
|
-
},
|
|
34
|
-
"schema": {
|
|
35
|
-
"$ref": "https://json-schema.org/draft-07/schema#"
|
|
36
|
-
}
|
|
37
|
-
},
|
|
38
|
-
"required": ["schema", "filter"]
|
|
39
|
-
},
|
|
40
|
-
"output": {
|
|
41
|
-
"type": "object",
|
|
42
|
-
"properties": {
|
|
43
|
-
"filter": {
|
|
44
|
-
"type": "string"
|
|
45
|
-
},
|
|
46
|
-
"schema": {
|
|
47
|
-
"$ref": "https://json-schema.org/draft-07/schema#"
|
|
48
|
-
}
|
|
49
|
-
},
|
|
50
|
-
"required": ["schema", "filter"]
|
|
51
|
-
},
|
|
52
|
-
"invoke": {
|
|
53
|
-
"type": "object",
|
|
54
|
-
"properties": {
|
|
55
|
-
"prefix": {
|
|
56
|
-
"type": "string"
|
|
57
|
-
},
|
|
58
|
-
"cache": {
|
|
59
|
-
"type": "object",
|
|
60
|
-
"properties": {
|
|
61
|
-
"enabled": {
|
|
62
|
-
"type": "boolean"
|
|
63
|
-
},
|
|
64
|
-
"key": {
|
|
65
|
-
"type": ["string"]
|
|
66
|
-
},
|
|
67
|
-
"ttl": {
|
|
68
|
-
"type": "string"
|
|
69
|
-
},
|
|
70
|
-
"onFailure": {
|
|
71
|
-
"type": "string",
|
|
72
|
-
"enum": ["skip", "retry"]
|
|
73
|
-
}
|
|
74
|
-
},
|
|
75
|
-
"required": ["enabled", "key", "ttl", "onFailure"]
|
|
76
|
-
},
|
|
77
|
-
"retry": {
|
|
78
|
-
"type": "object",
|
|
79
|
-
"properties": {
|
|
80
|
-
"maxAttempts": {
|
|
81
|
-
"type": "number"
|
|
82
|
-
},
|
|
83
|
-
"attemptDelay": {
|
|
84
|
-
"type": "string"
|
|
85
|
-
},
|
|
86
|
-
"attemptTimeout": {
|
|
87
|
-
"type": "string"
|
|
88
|
-
}
|
|
89
|
-
},
|
|
90
|
-
"required": ["maxAttempts", "attemptDelay", "attemptTimeout"]
|
|
91
|
-
},
|
|
92
|
-
"circuitBreaker": {
|
|
93
|
-
"type": "object",
|
|
94
|
-
"properties": {
|
|
95
|
-
"enabled": {
|
|
96
|
-
"type": "boolean"
|
|
97
|
-
},
|
|
98
|
-
"requestVolumeThreshold": {
|
|
99
|
-
"type": "number"
|
|
100
|
-
},
|
|
101
|
-
"failureRatio": {
|
|
102
|
-
"type": "number"
|
|
103
|
-
},
|
|
104
|
-
"successThreshold": {
|
|
105
|
-
"type": "number"
|
|
106
|
-
}
|
|
107
|
-
},
|
|
108
|
-
"required": ["enabled", "requestVolumeThreshold", "failureRatio", "successThreshold"]
|
|
109
|
-
},
|
|
110
|
-
"rateLimiter": {
|
|
111
|
-
"type": "object",
|
|
112
|
-
"properties": {
|
|
113
|
-
"enabled": {
|
|
114
|
-
"type": "boolean"
|
|
115
|
-
},
|
|
116
|
-
"value": {
|
|
117
|
-
"type": "number"
|
|
118
|
-
},
|
|
119
|
-
"window": {
|
|
120
|
-
"type": "string"
|
|
121
|
-
},
|
|
122
|
-
"minSpacing": {
|
|
123
|
-
"type": "string"
|
|
124
|
-
}
|
|
125
|
-
},
|
|
126
|
-
"required": ["enabled", "value", "window", "minSpacing"]
|
|
127
|
-
}
|
|
128
|
-
}
|
|
129
|
-
}
|
|
130
|
-
},
|
|
131
|
-
"additionalProperties": false
|
|
132
|
-
}
|
|
133
|
-
},
|
|
134
|
-
"additionalProperties": false,
|
|
135
|
-
"required": ["id", "name", "ownership", "sdk"]
|
|
136
|
-
}
|