@devkong/cli 0.0.67-alpha.0 → 0.0.67-alpha.10
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/assets/python-install.bat +28 -28
- package/assets/python-install.sh +10 -10
- package/index.js +211 -19519
- package/package.json +3 -2
- package/packages/kong-cli/src/commands/setAliasCommand.d.ts +7 -0
- package/packages/kong-cli/src/common/deployment.d.ts +18 -3
- package/packages/kong-cli/src/common/utils.d.ts +1 -3
- package/packages/kong-cli/src/services/managementClient.d.ts +3 -2
- package/packages/kong-spec/src/index.d.ts +3 -1
- package/packages/kong-spec/src/lib/kongSpec.d.ts +4 -1
- package/packages/kong-spec/src/lib/kongSpecDoc.d.ts +1 -0
- package/packages/kong-spec/src/lib/kongSpecFunctionContract.d.ts +26 -0
- package/packages/kong-spec/src/lib/kongSpecUtils.d.ts +1 -1
- package/packages/kong-ts-contract/src/lib/appAliasUse.d.ts +1 -1
- package/packages/kong-ts-contract/src/lib/appAliasUseDetails.d.ts +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@devkong/cli",
|
|
3
|
-
"version": "0.0.67-alpha.
|
|
3
|
+
"version": "0.0.67-alpha.10",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"main": "./index.js",
|
|
6
6
|
"typings": "./index.d.ts",
|
|
@@ -8,6 +8,7 @@
|
|
|
8
8
|
"kong": "./index.js"
|
|
9
9
|
},
|
|
10
10
|
"dependencies": {
|
|
11
|
-
"@napi-rs/keyring": "1.1.6"
|
|
11
|
+
"@napi-rs/keyring": "1.1.6",
|
|
12
|
+
"create-nx-workspace": "23.0.1"
|
|
12
13
|
}
|
|
13
14
|
}
|
|
@@ -5,4 +5,11 @@ export declare class SetAliasCommand {
|
|
|
5
5
|
private managementClient;
|
|
6
6
|
constructor(profile: Profile);
|
|
7
7
|
execute(aliasName: string, extensionVersion: number, timeoutSeconds: number): Promise<void>;
|
|
8
|
+
/**
|
|
9
|
+
* Poll the deployment audit log and settle one step per matching event. Runs
|
|
10
|
+
* detached from the task list; it settles a step as its event arrives and
|
|
11
|
+
* fails the rest on a failed/timed-out deployment, stopping on the failed or
|
|
12
|
+
* "deployment completed" event (poll terminal).
|
|
13
|
+
*/
|
|
14
|
+
private pollDeploymentSteps;
|
|
8
15
|
}
|
|
@@ -1,12 +1,19 @@
|
|
|
1
|
-
import { AppAuditLog
|
|
1
|
+
import { AppAuditLog } from "@kong/contract";
|
|
2
2
|
import { Loading } from "@kong/ts";
|
|
3
3
|
import { ManagementClient } from "../services/managementClient";
|
|
4
|
-
/**
|
|
5
|
-
|
|
4
|
+
/**
|
|
5
|
+
* Audit object types that carry a deployment trail. These are the management
|
|
6
|
+
* `AuditObjectType` JVM enum *constant names* (not the `extension_alias` JSON
|
|
7
|
+
* wire value): the `/v1/audit` `objectType` query param is resolved server-side
|
|
8
|
+
* via `Enum.valueOf`, which matches the constant name.
|
|
9
|
+
*/
|
|
10
|
+
export type DeployObjectType = "EXTENSION_ALIAS" | "PROCESS_ALIAS";
|
|
6
11
|
export interface DeploymentQuery {
|
|
7
12
|
objectType: DeployObjectType;
|
|
8
13
|
basedOnId: string;
|
|
9
14
|
aliasName: string;
|
|
15
|
+
/** Only fetch audit events created at/after this UTC timestamp (ISO-8601). */
|
|
16
|
+
createdAfter?: string;
|
|
10
17
|
}
|
|
11
18
|
export interface DeploymentResult {
|
|
12
19
|
/**
|
|
@@ -31,9 +38,17 @@ export declare function analyzeDeployment(events: AppAuditLog[]): DeploymentResu
|
|
|
31
38
|
* `basedOnId`, so both object ids are fetched and merged newest-first.
|
|
32
39
|
*/
|
|
33
40
|
export declare function getDeploymentLog(management: ManagementClient, query: DeploymentQuery): Promise<AppAuditLog[]>;
|
|
41
|
+
/**
|
|
42
|
+
* Best-effort human-readable reason for a failed deployment, pulled from the
|
|
43
|
+
* first failure event's `eventData` (falling back to its action label) so the
|
|
44
|
+
* actual backend error can be surfaced to the console.
|
|
45
|
+
*/
|
|
46
|
+
export declare function deploymentErrorMessage(events: AppAuditLog[]): string;
|
|
34
47
|
export interface PollProgress {
|
|
35
48
|
/** Latest analyzed deployment status. */
|
|
36
49
|
status: Loading;
|
|
50
|
+
/** Full deployment audit log analyzed so far, newest first. */
|
|
51
|
+
events: AppAuditLog[];
|
|
37
52
|
/** Seconds elapsed since polling started (capped at `timeoutSeconds`). */
|
|
38
53
|
elapsedSeconds: number;
|
|
39
54
|
/** The configured deploy-wait budget. */
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { Optional, ShortUUID } from "@kong/ts";
|
|
2
2
|
export interface ILogger {
|
|
3
3
|
info(message: string): void;
|
|
4
4
|
debug(message: string): void;
|
|
@@ -14,5 +14,3 @@ export declare function spawnCommand(commandText: string, logger?: ILogger | nul
|
|
|
14
14
|
export declare function spawnCommandWithArgs(command: string, commandArgs: string[], logger?: ILogger | null, shell?: boolean): Promise<string>;
|
|
15
15
|
export declare function printError(message: string, error: unknown): void;
|
|
16
16
|
export declare function escapePathSpaces(sourcePath: string): string;
|
|
17
|
-
/** Render a fixed-width textual progress bar for live task output. */
|
|
18
|
-
export declare function renderProgressBar(elapsedSeconds: number, timeoutSeconds: number, status: Loading): string;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import { AppAuditLog, AppExtension, AppExtensionAlias, AppSnapshot, AppSnapshotDetails
|
|
1
|
+
import { AppAuditLog, AppExtension, AppExtensionAlias, AppSnapshot, AppSnapshotDetails } from "@kong/contract";
|
|
2
2
|
import { Optional, UrlText } from "@kong/ts";
|
|
3
|
+
import { DeployObjectType } from "../common/deployment";
|
|
3
4
|
import { RequestConfigProvider } from "./api";
|
|
4
5
|
export declare class ManagementClient {
|
|
5
6
|
private requestConfigProvider;
|
|
@@ -10,5 +11,5 @@ export declare class ManagementClient {
|
|
|
10
11
|
getExtensionSnapshot(extensionId: AppExtension["id"], extensionSnapshotVersion: AppSnapshot["version"]): Promise<Optional<AppSnapshotDetails>>;
|
|
11
12
|
getExtensionSnapshotVersions(extensionId: AppExtension["id"]): Promise<AppSnapshot[]>;
|
|
12
13
|
getExtensionSnapshotAliases(extensionId: AppExtension["id"]): Promise<AppExtensionAlias[]>;
|
|
13
|
-
getAuditLog(objectType:
|
|
14
|
+
getAuditLog(objectType: DeployObjectType, objectId: string, createdAfter?: string): Promise<AppAuditLog[]>;
|
|
14
15
|
}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { makeServerlessJavaAppProps, serverlessFlowBuilder, stringifyServerlessFlow, } from "./lib/kongServerless";
|
|
2
2
|
export type { FloweyServerlessBuilder } from "./lib/kongServerless";
|
|
3
3
|
export type { KongSpecJobSession } from "./lib/kongSession";
|
|
4
|
-
export type { KongSpecAction, KongSpecActionCallFunction, KongSpecActionCallProcess, KongSpecActionDelay, KongSpecActionInject, KongSpecActionSendEvent, KongSpecAnnotation, KongSpecBranch, KongSpecCache, KongSpecCallModel, KongSpecCircuitBreaker, KongSpecCondition, KongSpecEffect, KongSpecEffectStatus, KongSpecError, KongSpecEventBroker, KongSpecEventConnection, KongSpecFeatureCompensation, KongSpecFlow, KongSpecFunctionRef, KongSpecHowToInvoke, KongSpecHowToOutput, KongSpecHowToStore, KongSpecOutputAppend, KongSpecProcessRef, KongSpecRecord, KongSpecRecordHeader, KongSpecRetry, KongSpecRule, KongSpecSecretRef, KongSpecSecretType, KongSpecState, KongSpecStateCallFunction, KongSpecStateCallProcess, KongSpecStateCompensate, KongSpecStateDelay, KongSpecStateExit, KongSpecStateFail, KongSpecStateForeach, KongSpecStateInject, KongSpecStateParallel, KongSpecStateResult, KongSpecStateRule, KongSpecStateSendEvent, KongSpecStateStart, KongSpecStateSucceed, KongSpecStateSwitch, KongSpecStateWaitEvent, KongSpecStoreRetryControl, KongSpecSupportsActions, KongSpecSupportsErrors, KongSpecSupportsInvoke, KongSpecSupportsOutputSample, KongSpecSupportsOutputStore, KongSpecSupportsTransition, } from "./lib/kongSpec";
|
|
4
|
+
export type { KongSpecAction, KongSpecActionCallFunction, KongSpecActionCallProcess, KongSpecActionDelay, KongSpecActionInject, KongSpecActionSendEvent, KongSpecAnnotation, KongSpecBranch, KongSpecCache, KongSpecCallModel, KongSpecCircuitBreaker, KongSpecCondition, KongSpecEffect, KongSpecEffectStatus, KongSpecError, KongSpecEventBroker, KongSpecEventConnection, KongSpecFeatureCompensation, KongSpecFlow, KongSpecFunctionRef, KongSpecHowToInvoke, KongSpecHowToOutput, KongSpecHowToStore, KongSpecOutputAppend, KongSpecProcessRef, KongSpecRecord, KongSpecRecordHeader, KongSpecRetry, KongSpecRule, KongSpecSecretRef, KongSpecSecretType, KongSpecState, KongSpecStateCallFunction, KongSpecStateCallProcess, KongSpecStateCompensate, KongSpecStateDelay, KongSpecStateExit, KongSpecStateFail, KongSpecStateForeach, KongSpecStateInject, KongSpecStateParallel, KongSpecStateResult, KongSpecStateRule, KongSpecStateSendEvent, KongSpecStateStart, KongSpecStateSucceed, KongSpecStateSwitch, KongSpecStateWaitEvent, KongSpecStoreRetryControl, KongSpecSupportsActions, KongSpecSupportsErrors, KongSpecSupportsInvoke, KongSpecSupportsOutputSample, KongSpecSupportsOutputStore, KongSpecSupportsTaskMode, KongSpecSupportsTransition, } from "./lib/kongSpec";
|
|
5
5
|
export { KongSpecBuild } from "./lib/kongSpecBuild";
|
|
6
6
|
export { KongSpecDoc } from "./lib/kongSpecDoc";
|
|
7
7
|
export { KongSpecEnv } from "./lib/kongSpecEnv";
|
|
@@ -14,5 +14,7 @@ export { KongSpecRef } from "./lib/kongSpecRef";
|
|
|
14
14
|
export type { KongSpecActionPath, KongSpecStatePath } from "./lib/kongSpecRef";
|
|
15
15
|
export { convertSpecToServerless } from "./lib/kongSpecToServerless";
|
|
16
16
|
export { findSourceState, getActions, getConnectedExitStates, getDependencies, outputAggregator, outputAggregatorUnsafe, parallelStateOutputAggregator, parallelStateOutputAggregatorUnsafe, quoteSecretReferences, traverseFlowUp, } from "./lib/kongSpecUtils";
|
|
17
|
+
export { getKongFunctionOperations, getKongFunctionOperationSchema, getKongSpecXUI, getKongSpecXUIComponentConfig, isKongFunctionContractSchema, } from "./lib/kongSpecFunctionContract";
|
|
18
|
+
export type { KongSpecXUIComponentConfig, KongSpecXUIConfig, KongSpecXUIFormConfig, KongSpecXUISecretConfig, } from "./lib/kongSpecFunctionContract";
|
|
17
19
|
export { validate } from "./lib/kongSpecValidate";
|
|
18
20
|
export type { KongSpecValidationIssue, KongSpecValidators } from "./lib/kongSpecValidate";
|
|
@@ -106,7 +106,10 @@ export interface KongSpecSupportsDataGuards {
|
|
|
106
106
|
export interface KongSpecSupportsOutputSample {
|
|
107
107
|
outputSample: Optional<JsonText>;
|
|
108
108
|
}
|
|
109
|
-
export interface
|
|
109
|
+
export interface KongSpecSupportsTaskMode {
|
|
110
|
+
mode: "blocking" | "non-blocking";
|
|
111
|
+
}
|
|
112
|
+
export interface KongSpecCallModel extends KongSpecSupportsInput, KongSpecSupportsOutputFilter, KongSpecSupportsOutputStore, KongSpecSupportsOutputAppend, KongSpecSupportsOutputSample, KongSpecSupportsDataGuards, KongSpecSupportsTaskMode, KongSpecSupportsInvoke {
|
|
110
113
|
}
|
|
111
114
|
export interface KongSpecSupportsErrors {
|
|
112
115
|
errors: KongSpecError[];
|
|
@@ -15,6 +15,7 @@ export declare class KongSpecDoc {
|
|
|
15
15
|
static aboutIdentify: string;
|
|
16
16
|
static aboutSizeLimit: (bytes: string) => string;
|
|
17
17
|
static aboutCallFunction: string;
|
|
18
|
+
static aboutMode: string;
|
|
18
19
|
static aboutCallProcess: string;
|
|
19
20
|
static aboutCompensate: string;
|
|
20
21
|
static aboutFail: string;
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { Optional } from "@kong/ts";
|
|
2
|
+
import { JSONSchema7 } from "json-schema";
|
|
3
|
+
import { KongSpecSecretType } from "./kongSpec";
|
|
4
|
+
export interface KongSpecXUISecretConfig {
|
|
5
|
+
purpose: string;
|
|
6
|
+
types: Array<KongSpecSecretType>;
|
|
7
|
+
}
|
|
8
|
+
export interface KongSpecXUIComponentConfig {
|
|
9
|
+
type: "TEXT_AREA";
|
|
10
|
+
}
|
|
11
|
+
export type KongSpecXUIFormConfig = Record<string, KongSpecXUIComponentConfig>;
|
|
12
|
+
export interface KongSpecXUIConfig {
|
|
13
|
+
version?: number;
|
|
14
|
+
secrets: Array<KongSpecXUISecretConfig>;
|
|
15
|
+
form: KongSpecXUIFormConfig;
|
|
16
|
+
}
|
|
17
|
+
/** Reads the `x-ui` block of a schema, if present. */
|
|
18
|
+
export declare function getKongSpecXUI(schema: Optional<JSONSchema7> | null): Optional<KongSpecXUIConfig>;
|
|
19
|
+
/** Reads the `x-ui.form` component config for a property path (e.g. `[".notes"]`). */
|
|
20
|
+
export declare function getKongSpecXUIComponentConfig(schema: Optional<JSONSchema7> | null, path: string[]): Optional<KongSpecXUIComponentConfig>;
|
|
21
|
+
/** True when the schema describes a KongFunctionContract (i.e. it exposes a `request` envelope). */
|
|
22
|
+
export declare function isKongFunctionContractSchema(schema: Optional<JSONSchema7> | null): boolean;
|
|
23
|
+
/** The operation names of a contract schema — all object properties except `request`. */
|
|
24
|
+
export declare function getKongFunctionOperations(schema: Optional<JSONSchema7> | null): string[];
|
|
25
|
+
/** The sub-schema describing the payload of a single operation. */
|
|
26
|
+
export declare function getKongFunctionOperationSchema(schema: Optional<JSONSchema7> | null, operation: string): Optional<JSONSchema7>;
|
|
@@ -8,7 +8,7 @@ interface TestItem {
|
|
|
8
8
|
interface Dependency {
|
|
9
9
|
type: "function" | "process";
|
|
10
10
|
tenant: SessionTenant;
|
|
11
|
-
basedOn: KongSpecFunctionRef["basedOn"] |
|
|
11
|
+
basedOn: KongSpecFunctionRef["basedOn"] | KongSpecProcessRef["basedOn"];
|
|
12
12
|
aliasName: KongSpecFunctionRef["aliasName"] | KongSpecProcessRef["aliasName"];
|
|
13
13
|
usage: Array<KongSpecAction["name"] | KongSpecState["name"]>;
|
|
14
14
|
}
|
|
@@ -3,7 +3,7 @@ import { AppAliasUse } from "./appAliasUse";
|
|
|
3
3
|
import { AppSnapshotDetails } from "./appSnapshotDetails";
|
|
4
4
|
export interface AppAliasUseDetails extends AppAliasUse {
|
|
5
5
|
snapshot: AppSnapshotDetails;
|
|
6
|
-
balance: number;
|
|
6
|
+
balance: number | null;
|
|
7
7
|
inputFilter?: JqFilter;
|
|
8
8
|
outputFilter?: JqFilter;
|
|
9
9
|
}
|