@devkong/cli 0.0.43 → 0.0.45
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/index.js
CHANGED
|
@@ -72017,6 +72017,18 @@ var globalThisPolyfill = (function() {
|
|
|
72017
72017
|
}
|
|
72018
72018
|
})();
|
|
72019
72019
|
|
|
72020
|
+
// packages/kong-ts/src/lib/jsonSchema.ts
|
|
72021
|
+
function createEmptyJsonSchema() {
|
|
72022
|
+
return {
|
|
72023
|
+
$id: "classpath:/META-INF/schemaJson/main.json",
|
|
72024
|
+
type: "object",
|
|
72025
|
+
title: "Input",
|
|
72026
|
+
$schema: "http://json-schema.org/draft-07/schema#",
|
|
72027
|
+
required: [],
|
|
72028
|
+
properties: {}
|
|
72029
|
+
};
|
|
72030
|
+
}
|
|
72031
|
+
|
|
72020
72032
|
// node_modules/deepmerge-ts/dist/index.mjs
|
|
72021
72033
|
var actions = {
|
|
72022
72034
|
defaultMerge: Symbol("deepmerge-ts: default merge"),
|
|
@@ -81698,14 +81710,12 @@ var ManagementClient = class {
|
|
|
81698
81710
|
this.headerProvider = headerProvider2;
|
|
81699
81711
|
this.baseUrl = joinUrlAndPath(baseUrl, "/api/management");
|
|
81700
81712
|
}
|
|
81701
|
-
async
|
|
81702
|
-
const url2 = joinUrlAndPath(
|
|
81703
|
-
|
|
81704
|
-
|
|
81705
|
-
|
|
81706
|
-
|
|
81707
|
-
"snapshots"
|
|
81708
|
-
);
|
|
81713
|
+
async updateExtension(extension) {
|
|
81714
|
+
const url2 = joinUrlAndPath(this.baseUrl, "v1/extensions");
|
|
81715
|
+
await axios_default.put(url2, extension, await this.headerProvider());
|
|
81716
|
+
}
|
|
81717
|
+
async createExtensionSnapshot(extensionId, snapshot) {
|
|
81718
|
+
const url2 = joinUrlAndPath(this.baseUrl, "v1/extensions", extensionId, "snapshots");
|
|
81709
81719
|
await axios_default.post(url2, snapshot, await this.headerProvider());
|
|
81710
81720
|
}
|
|
81711
81721
|
async getExtensionSnapshot(extensionName, extensionSnapshotVersion) {
|
|
@@ -82063,9 +82073,21 @@ var PublishVersionCommand = class {
|
|
|
82063
82073
|
created: utcNow(DEFAULT_TIMEZONE),
|
|
82064
82074
|
createdBy: ""
|
|
82065
82075
|
};
|
|
82066
|
-
await this.managementClient.
|
|
82067
|
-
|
|
82068
|
-
|
|
82076
|
+
await this.managementClient.updateExtension({
|
|
82077
|
+
id: kongJson.id,
|
|
82078
|
+
name: kongJson.name,
|
|
82079
|
+
category: kongJson.category,
|
|
82080
|
+
deprecated: false,
|
|
82081
|
+
createdBy: "",
|
|
82082
|
+
created: utcNow(DEFAULT_TIMEZONE),
|
|
82083
|
+
updated: utcNow(DEFAULT_TIMEZONE),
|
|
82084
|
+
updatedBy: ""
|
|
82085
|
+
});
|
|
82086
|
+
await this.managementClient.createExtensionSnapshot(kongJson.id, snapshot);
|
|
82087
|
+
task.output = [
|
|
82088
|
+
`The version ${publishDetails.imageVersion} has been successfully published!`,
|
|
82089
|
+
joinUrlAndPath(this.profile.kongBaseUrl, "/extensions/aliases")
|
|
82090
|
+
].join("\n");
|
|
82069
82091
|
},
|
|
82070
82092
|
rendererOptions: this.defaultRendererOptions
|
|
82071
82093
|
};
|
|
@@ -82164,8 +82186,8 @@ var SetAliasCommand = class {
|
|
|
82164
82186
|
targetKey: `/extensions/${ctx.kongJson.id}/aliases/${aliasName}`
|
|
82165
82187
|
},
|
|
82166
82188
|
use: [aliasUse],
|
|
82167
|
-
inputSchema:
|
|
82168
|
-
outputSchema:
|
|
82189
|
+
inputSchema: createEmptyJsonSchema(),
|
|
82190
|
+
outputSchema: createEmptyJsonSchema(),
|
|
82169
82191
|
invoke: void 0,
|
|
82170
82192
|
created: now,
|
|
82171
82193
|
createdBy: "",
|
|
@@ -82173,8 +82195,10 @@ var SetAliasCommand = class {
|
|
|
82173
82195
|
updatedBy: ""
|
|
82174
82196
|
};
|
|
82175
82197
|
await this.publicClient.assignExtensionAlias(ctx.kongJson.id, alias);
|
|
82176
|
-
task.output =
|
|
82177
|
-
|
|
82198
|
+
task.output = [
|
|
82199
|
+
"Please wait a moment for it to appear in the UI",
|
|
82200
|
+
joinUrlAndPath(this.profile.kongBaseUrl, "/extensions/aliases")
|
|
82201
|
+
].join("\n");
|
|
82178
82202
|
},
|
|
82179
82203
|
rendererOptions: { persistentOutput: true }
|
|
82180
82204
|
}
|
|
@@ -82203,7 +82227,7 @@ function getPresetVersion() {
|
|
|
82203
82227
|
}
|
|
82204
82228
|
|
|
82205
82229
|
// packages/kong-cli/src/index.ts
|
|
82206
|
-
import_dotenv_expand.default.expand(import_dotenv.default.config({ path: import_path5.default.join(__dirname, ".env") }));
|
|
82230
|
+
import_dotenv_expand.default.expand(import_dotenv.default.config({ path: import_path5.default.join(__dirname, ".env"), quiet: true }));
|
|
82207
82231
|
async function main() {
|
|
82208
82232
|
const generateCommand = new Command("generate").description("Generate new extension").argument("name", "Extension name").addOption(
|
|
82209
82233
|
new Option("--sdk <name>", "Target sdk platform for extension").choices(["python", "kotlin"]).default("python")
|
package/package.json
CHANGED
|
@@ -5,7 +5,8 @@ export declare class ManagementClient {
|
|
|
5
5
|
private headerProvider;
|
|
6
6
|
private readonly baseUrl;
|
|
7
7
|
constructor(baseUrl: UrlText, headerProvider: HeaderProvider);
|
|
8
|
-
|
|
8
|
+
updateExtension(extension: AppExtension): Promise<void>;
|
|
9
|
+
createExtensionSnapshot(extensionId: AppExtension["id"], snapshot: Omit<AppSnapshotDetails, "id">): Promise<void>;
|
|
9
10
|
getExtensionSnapshot(extensionName: AppExtension["name"], extensionSnapshotVersion: AppSnapshot["version"]): Promise<Optional<AppSnapshotDetails>>;
|
|
10
11
|
getExtensionSnapshotVersions(extensionId: AppExtension["id"]): Promise<AppSnapshot[]>;
|
|
11
12
|
getExtensionSnapshotAliases(extensionId: AppExtension["id"]): Promise<AppExtensionAlias[]>;
|
|
@@ -18,7 +18,7 @@ export { applyJqFilterReplacements, applyJqObjectReplacements, applyJqTextReplac
|
|
|
18
18
|
export type { JqArray, JqFilter, JqObject, JqSerializer, JqText, RefactorReplacement, } from "./lib/jq";
|
|
19
19
|
export { generateFakeJsonObject, jsonToHumanReadable, prettyJson, safeJsonParse } from "./lib/json";
|
|
20
20
|
export type { JsonArray, JsonObject, JsonSchemaUrl, JsonText } from "./lib/json";
|
|
21
|
-
export { buildExampleObject } from "./lib/jsonSchema";
|
|
21
|
+
export { buildExampleObject, createEmptyJsonSchema } from "./lib/jsonSchema";
|
|
22
22
|
export { KeyGenerator } from "./lib/keyGenerator";
|
|
23
23
|
export { findLastIndex, insertItem, moveItem, unique } from "./lib/list";
|
|
24
24
|
export { deepMerge, deepMergeAll } from "./lib/merge";
|