@devkong/cli 0.0.43 → 0.0.44
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
|
@@ -81698,14 +81698,12 @@ var ManagementClient = class {
|
|
|
81698
81698
|
this.headerProvider = headerProvider2;
|
|
81699
81699
|
this.baseUrl = joinUrlAndPath(baseUrl, "/api/management");
|
|
81700
81700
|
}
|
|
81701
|
-
async
|
|
81702
|
-
const url2 = joinUrlAndPath(
|
|
81703
|
-
|
|
81704
|
-
|
|
81705
|
-
|
|
81706
|
-
|
|
81707
|
-
"snapshots"
|
|
81708
|
-
);
|
|
81701
|
+
async updateExtension(extension) {
|
|
81702
|
+
const url2 = joinUrlAndPath(this.baseUrl, "v1/extensions");
|
|
81703
|
+
await axios_default.put(url2, extension, await this.headerProvider());
|
|
81704
|
+
}
|
|
81705
|
+
async createExtensionSnapshot(extensionId, snapshot) {
|
|
81706
|
+
const url2 = joinUrlAndPath(this.baseUrl, "v1/extensions", extensionId, "snapshots");
|
|
81709
81707
|
await axios_default.post(url2, snapshot, await this.headerProvider());
|
|
81710
81708
|
}
|
|
81711
81709
|
async getExtensionSnapshot(extensionName, extensionSnapshotVersion) {
|
|
@@ -82063,9 +82061,21 @@ var PublishVersionCommand = class {
|
|
|
82063
82061
|
created: utcNow(DEFAULT_TIMEZONE),
|
|
82064
82062
|
createdBy: ""
|
|
82065
82063
|
};
|
|
82066
|
-
await this.managementClient.
|
|
82067
|
-
|
|
82068
|
-
|
|
82064
|
+
await this.managementClient.updateExtension({
|
|
82065
|
+
id: kongJson.id,
|
|
82066
|
+
name: kongJson.name,
|
|
82067
|
+
category: kongJson.category,
|
|
82068
|
+
deprecated: false,
|
|
82069
|
+
createdBy: "",
|
|
82070
|
+
created: utcNow(DEFAULT_TIMEZONE),
|
|
82071
|
+
updated: utcNow(DEFAULT_TIMEZONE),
|
|
82072
|
+
updatedBy: ""
|
|
82073
|
+
});
|
|
82074
|
+
await this.managementClient.createExtensionSnapshot(kongJson.id, snapshot);
|
|
82075
|
+
task.output = [
|
|
82076
|
+
`The version ${publishDetails.imageVersion} has been successfully published!`,
|
|
82077
|
+
joinUrlAndPath(this.profile.kongBaseUrl, "/extensions/aliases")
|
|
82078
|
+
].join("\n");
|
|
82069
82079
|
},
|
|
82070
82080
|
rendererOptions: this.defaultRendererOptions
|
|
82071
82081
|
};
|
|
@@ -82173,8 +82183,10 @@ var SetAliasCommand = class {
|
|
|
82173
82183
|
updatedBy: ""
|
|
82174
82184
|
};
|
|
82175
82185
|
await this.publicClient.assignExtensionAlias(ctx.kongJson.id, alias);
|
|
82176
|
-
task.output =
|
|
82177
|
-
|
|
82186
|
+
task.output = [
|
|
82187
|
+
"Please wait a moment for it to appear in the UI",
|
|
82188
|
+
joinUrlAndPath(this.profile.kongBaseUrl, "/extensions/aliases")
|
|
82189
|
+
].join("\n");
|
|
82178
82190
|
},
|
|
82179
82191
|
rendererOptions: { persistentOutput: true }
|
|
82180
82192
|
}
|
|
@@ -82203,7 +82215,7 @@ function getPresetVersion() {
|
|
|
82203
82215
|
}
|
|
82204
82216
|
|
|
82205
82217
|
// packages/kong-cli/src/index.ts
|
|
82206
|
-
import_dotenv_expand.default.expand(import_dotenv.default.config({ path: import_path5.default.join(__dirname, ".env") }));
|
|
82218
|
+
import_dotenv_expand.default.expand(import_dotenv.default.config({ path: import_path5.default.join(__dirname, ".env"), quiet: true }));
|
|
82207
82219
|
async function main() {
|
|
82208
82220
|
const generateCommand = new Command("generate").description("Generate new extension").argument("name", "Extension name").addOption(
|
|
82209
82221
|
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[]>;
|