@devkong/cli 0.0.67-alpha.27 → 0.0.67-alpha.28

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devkong/cli",
3
- "version": "0.0.67-alpha.27",
3
+ "version": "0.0.67-alpha.28",
4
4
  "type": "commonjs",
5
5
  "main": "./index.js",
6
6
  "typings": "./index.d.ts",
@@ -11,4 +11,4 @@
11
11
  "@napi-rs/keyring": "1.1.6",
12
12
  "create-nx-workspace": "23.0.1"
13
13
  }
14
- }
14
+ }
@@ -3,14 +3,14 @@ export declare class ConnectCommand {
3
3
  private profileName;
4
4
  private profile;
5
5
  private readonly isWin;
6
- private readonly registryClient;
7
- private readonly managementClient;
8
6
  private readonly deployments;
7
+ private readonly templates;
8
+ private lock;
9
9
  constructor(profileName: ProfileName, profile: Profile);
10
10
  execute(): Promise<void>;
11
11
  private handle;
12
12
  private profileInfo;
13
- /** Runs only src/main_test.py in a fresh venv and returns the raw output. */
13
+ /** Scaffolds the template, installs its deps and runs src/main_test.py. */
14
14
  private runTests;
15
15
  /**
16
16
  * Deployments are asynchronous: the ui polls GET /v1/deployments/{id} and
@@ -18,15 +18,23 @@ export declare class ConnectCommand {
18
18
  */
19
19
  private startDeployment;
20
20
  /**
21
- * The client-side twin of the kong-build pipeline: docker build + push from
22
- * this machine (requirements.txt applied), schema generated locally with
23
- * `main.py --schema`, then the snapshot registered in kong-management.
21
+ * Scaffolds the cli template, swaps in the bundle and reuses kong install +
22
+ * kong publish-version (docker build/push + schema + snapshot save), mirroring
23
+ * their progress into the deployment status the ui polls.
24
24
  */
25
25
  private deploy;
26
- private snapshotFor;
27
- /** Writes the bundle to a fresh temp folder, decoding binary entries. */
28
- private materialize;
29
- private prepareVenv;
26
+ /**
27
+ * Returns the (cached) scaffolded template for the extension, generating it
28
+ * once with `kong generate` and only swapping in the ui bundle's src folder
29
+ * and requirements.txt on subsequent calls. kong.json is patched so the
30
+ * publish saves the snapshot under the real extension.
31
+ */
32
+ private prepareTemplate;
33
+ /** Runs `kong generate` into a fresh temp workspace and locates its root. */
34
+ private scaffold;
35
+ private cleanupTemplates;
36
+ private setStep;
37
+ private runExclusive;
30
38
  private pythonBin;
31
39
  private venvPython;
32
40
  private run;
@@ -1,5 +1,11 @@
1
1
  import { ListrTask } from "listr2";
2
2
  import { Profile } from "../common/profile";
3
+ import { PublishDetails } from "../services/registryClient";
4
+ interface PublishContext {
5
+ contractText: string;
6
+ publishDetails?: PublishDetails;
7
+ fullImageName?: string;
8
+ }
3
9
  export declare class PublishVersionCommand {
4
10
  private profile;
5
11
  private verbose;
@@ -11,8 +17,8 @@ export declare class PublishVersionCommand {
11
17
  private defaultRendererOptions;
12
18
  private get wslPrefix();
13
19
  constructor(profile: Profile, verbose?: boolean, contractPath?: string | null);
14
- execute(appName: string, notes: string): Promise<void>;
15
- flowFactory(appName: string, notes: string): Generator<ListrTask>;
20
+ execute(appName: string, notes: string, onStep?: (step: string, status: "pending" | "succeeded" | "failed") => void): Promise<number>;
21
+ flowFactory(appName: string, notes: string): Generator<ListrTask<PublishContext>>;
16
22
  private resolveRegistryUrl;
17
23
  private dockerBuildCmdText;
18
24
  private dockerPushCmdText;
@@ -21,3 +27,4 @@ export declare class PublishVersionCommand {
21
27
  private getKotlinBuildCmdTask;
22
28
  private getKotlinSchemaCmdTask;
23
29
  }
30
+ export {};
@@ -4,8 +4,6 @@ export type { BusinessKey } from "./lib/businessKey";
4
4
  export { CloudEvent } from "./lib/cloudEvent";
5
5
  export { textToBackground, textToColor, textToMonoGradient } from "./lib/color";
6
6
  export { deepEquals, prepareTextForComparison, sameText, shadowEquals } from "./lib/compare";
7
- export { KONG_CONNECT_BASE_URL, KONG_CONNECT_PORT } from "./lib/connect";
8
- export type { KongConnectDeployRequest, KongConnectDeployStart, KongConnectDeployStatus, KongConnectDeployStep, KongConnectFile, KongConnectProfile, KongConnectStepStatus, KongConnectTestRequest, KongConnectTestResult, } from "./lib/connect";
9
7
  export { cronToText, isCron } from "./lib/cron";
10
8
  export type { Cron } from "./lib/cron";
11
9
  export { DataGuardType } from "./lib/dataGuard";
@@ -15,7 +13,7 @@ export type { Duration8601 } from "./lib/duration";
15
13
  export type { Entity } from "./lib/entity";
16
14
  export { AppError, DataError, errorToPrettyString } from "./lib/error";
17
15
  export { ensureIsDuration, ensureIsDurationOrCron, ensureMinLength, nonNegative, nonRecursiveCall, notBlank, notNull, } from "./lib/guard";
18
- export { generateEmbeddedId, guid, stableUUID, uuidc16, uuidc32, uuidStableSequence, } from "./lib/id";
16
+ export { generateShortId, guid, stableUUID, uuidc16, uuidc32, uuidStableSequence, } from "./lib/id";
19
17
  export type { CompactUUID16, CompactUUID32, GUID, ShortUUID } from "./lib/id";
20
18
  export { intervalToString, millisToShortString } from "./lib/interval";
21
19
  export { applyJqFilterReplacements, applyJqObjectReplacements, applyJqTextReplacements, containsJqExpression, convertToJqFilter, extractJqTextContent, jqFilter, JqObjectSerializer, jqText, sanitizeJqFilter, wrapWithJqTextMarkers, } from "./lib/jq";
@@ -8,6 +8,6 @@ export declare function guid(): GUID;
8
8
  export declare function uuidc32(): CompactUUID32;
9
9
  export declare function uuidc16(): CompactUUID16;
10
10
  export declare function uuidc8(): CompactUUID8;
11
- export declare function generateEmbeddedId(): ShortUUID;
11
+ export declare function generateShortId(): ShortUUID;
12
12
  export declare function stableUUID<T extends string>(based: T): T;
13
13
  export declare function uuidStableSequence<T extends string>(based: T): () => T;
@@ -1,3 +1,4 @@
1
1
  export interface User {
2
2
  name: string;
3
+ roles: string[];
3
4
  }
@@ -8,6 +8,9 @@ export type { AppAuditLog } from "./lib/appAuditLog";
8
8
  export type { AppBroadcastData } from "./lib/appBroadcastData";
9
9
  export type { AppCheckpoint } from "./lib/appCheckpoint";
10
10
  export type { AppComponentStartRequest } from "./lib/appComponentStartRequest";
11
+ export type { AppArtifact, AppArtifactDetails, AppCodeTemplateData, AppCodeTemplateFile, } from "./lib/appArtifact";
12
+ export { APP_CONNECT_BASE_URL, APP_CONNECT_PORT } from "./lib/appConnect";
13
+ export type { AppConnectDeployRequest, AppConnectDeployStart, AppConnectDeployStatus, AppConnectDeployStep, AppConnectFile, AppConnectProfile, AppConnectTestRequest, AppConnectTestResult, } from "./lib/appConnect";
11
14
  export type { AppDependency } from "./lib/appDependency";
12
15
  export type { AppDocument } from "./lib/appDocument";
13
16
  export type { AppDocumentPublish } from "./lib/appDocumentPublish";
@@ -0,0 +1,18 @@
1
+ export interface AppArtifact {
2
+ id: string;
3
+ name: string;
4
+ category: "code-template";
5
+ type: string;
6
+ description: string;
7
+ }
8
+ export interface AppArtifactDetails extends AppArtifact {
9
+ data: unknown;
10
+ }
11
+ export interface AppCodeTemplateFile {
12
+ name: string;
13
+ content: string;
14
+ binary?: boolean;
15
+ }
16
+ export interface AppCodeTemplateData {
17
+ files: AppCodeTemplateFile[];
18
+ }
@@ -0,0 +1,44 @@
1
+ import { Loading } from "@kong/ts";
2
+ export declare const APP_CONNECT_PORT = 41321;
3
+ export declare const APP_CONNECT_BASE_URL = "http://localhost:41321";
4
+ export interface AppConnectProfile {
5
+ profile: string;
6
+ baseUrl: string;
7
+ userName: string;
8
+ docker: boolean;
9
+ python: boolean;
10
+ }
11
+ export interface AppConnectFile {
12
+ name: string;
13
+ content: string;
14
+ binary?: boolean;
15
+ }
16
+ export interface AppConnectTestRequest {
17
+ extensionId: string;
18
+ extensionName: string;
19
+ files: AppConnectFile[];
20
+ }
21
+ export interface AppConnectTestResult {
22
+ passed: boolean;
23
+ output: string;
24
+ }
25
+ export interface AppConnectDeployRequest {
26
+ extensionId: string;
27
+ extensionName: string;
28
+ files: AppConnectFile[];
29
+ notes?: string;
30
+ }
31
+ export interface AppConnectDeployStart {
32
+ deploymentId: string;
33
+ }
34
+ export interface AppConnectDeployStep {
35
+ name: string;
36
+ status: Loading;
37
+ }
38
+ export interface AppConnectDeployStatus {
39
+ status: "pending" | "succeeded" | "failed";
40
+ steps: AppConnectDeployStep[];
41
+ output: string;
42
+ version?: number;
43
+ error?: string;
44
+ }
@@ -1,42 +0,0 @@
1
- export declare const KONG_CONNECT_PORT = 41321;
2
- export declare const KONG_CONNECT_BASE_URL = "http://localhost:41321";
3
- export interface KongConnectProfile {
4
- profile: string;
5
- baseUrl: string;
6
- userName: string;
7
- docker: boolean;
8
- python: boolean;
9
- }
10
- export interface KongConnectFile {
11
- name: string;
12
- content: string;
13
- binary?: boolean;
14
- }
15
- export interface KongConnectTestRequest {
16
- files: KongConnectFile[];
17
- }
18
- export interface KongConnectTestResult {
19
- passed: boolean;
20
- output: string;
21
- }
22
- export interface KongConnectDeployRequest {
23
- extensionId: string;
24
- extensionName: string;
25
- files: KongConnectFile[];
26
- notes?: string;
27
- }
28
- export interface KongConnectDeployStart {
29
- deploymentId: string;
30
- }
31
- export type KongConnectStepStatus = "idle" | "pending" | "succeeded" | "failed";
32
- export interface KongConnectDeployStep {
33
- name: string;
34
- status: KongConnectStepStatus;
35
- }
36
- export interface KongConnectDeployStatus {
37
- status: "pending" | "succeeded" | "failed";
38
- steps: KongConnectDeployStep[];
39
- output: string;
40
- version?: number;
41
- error?: string;
42
- }