@devkong/cli 0.0.67-alpha.24 → 0.0.67-alpha.25
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 +8 -3
- package/package.json +1 -1
- package/packages/kong-cli/src/commands/generateCommand.d.ts +1 -1
- package/packages/kong-spec/src/index.d.ts +4 -4
- package/packages/kong-spec/src/lib/kongSpec.d.ts +2 -3
- package/packages/kong-spec/src/lib/kongSpecUtils.d.ts +2 -10
- package/packages/kong-ts/src/index.d.ts +2 -2
- package/packages/kong-ts/src/lib/jq.d.ts +1 -0
- package/packages/kong-ts/src/lib/jsonSchema.d.ts +13 -0
- package/packages/kong-ts-contract/src/index.d.ts +2 -1
- package/packages/kong-ts-contract/src/lib/appAuditLog.d.ts +2 -1
- package/packages/kong-ts-contract/src/lib/appDependency.d.ts +10 -0
- package/packages/kong-ts-contract/src/lib/appSecret.d.ts +4 -3
package/index.js
CHANGED
|
@@ -61104,8 +61104,12 @@ var GenerateCommand = class {
|
|
|
61104
61104
|
choices: [
|
|
61105
61105
|
{ name: "basic - a single operation", value: "basic" },
|
|
61106
61106
|
{
|
|
61107
|
-
name: "
|
|
61108
|
-
value: "
|
|
61107
|
+
name: "with-secret - multiple operations with a secret example",
|
|
61108
|
+
value: "with-secret"
|
|
61109
|
+
},
|
|
61110
|
+
{
|
|
61111
|
+
name: "with-s3 - download a file from S3 using an s3 secret",
|
|
61112
|
+
value: "with-s3"
|
|
61109
61113
|
}
|
|
61110
61114
|
]
|
|
61111
61115
|
});
|
|
@@ -63758,7 +63762,8 @@ async function main() {
|
|
|
63758
63762
|
).addOption(
|
|
63759
63763
|
new Option("--template <name>", "Starter template to scaffold (python only)").choices([
|
|
63760
63764
|
"basic",
|
|
63761
|
-
"
|
|
63765
|
+
"with-secret",
|
|
63766
|
+
"with-s3"
|
|
63762
63767
|
])
|
|
63763
63768
|
).addOption(new Option("--verbose", "Show full logs during command execution")).action(async (name, options) => {
|
|
63764
63769
|
try {
|
package/package.json
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AppExtension } from "@kong/contract";
|
|
2
|
-
export type ExtensionTemplate = "basic" | "
|
|
2
|
+
export type ExtensionTemplate = "basic" | "with-secret" | "with-s3";
|
|
3
3
|
export declare class GenerateCommand {
|
|
4
4
|
execute(extensionName: AppExtension["name"], sdk: "kotlin" | "python", presetVersion: string, template?: ExtensionTemplate): Promise<void>;
|
|
5
5
|
private promptTemplate;
|
|
@@ -1,11 +1,13 @@
|
|
|
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,
|
|
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, 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";
|
|
8
8
|
export type { KongSpecFile } from "./lib/kongSpecFile";
|
|
9
|
+
export { getKongFunctionOperations, getKongFunctionOperationSchema, getKongSpecXUI, getKongSpecXUIComponentConfig, isKongFunctionContractSchema, } from "./lib/kongSpecFunctionContract";
|
|
10
|
+
export type { KongSpecXUIComponentConfig, KongSpecXUIConfig, KongSpecXUIFormConfig, KongSpecXUISecretConfig, } from "./lib/kongSpecFunctionContract";
|
|
9
11
|
export type { KongSpecLayout, KongSpecLayoutPosition, KongSpecLayoutPositionKey, } from "./lib/kongSpecLayout";
|
|
10
12
|
export { migrate } from "./lib/kongSpecMigrate";
|
|
11
13
|
export { nameGenerator } from "./lib/kongSpecName";
|
|
@@ -13,8 +15,6 @@ export { normalizeName } from "./lib/kongSpecNormalize";
|
|
|
13
15
|
export { KongSpecRef } from "./lib/kongSpecRef";
|
|
14
16
|
export type { KongSpecActionPath, KongSpecStatePath } from "./lib/kongSpecRef";
|
|
15
17
|
export { convertSpecToServerless } from "./lib/kongSpecToServerless";
|
|
16
|
-
export { findSourceState, getActions, getConnectedExitStates,
|
|
17
|
-
export { getKongFunctionOperations, getKongFunctionOperationSchema, getKongSpecXUI, getKongSpecXUIComponentConfig, isKongFunctionContractSchema, } from "./lib/kongSpecFunctionContract";
|
|
18
|
-
export type { KongSpecXUIComponentConfig, KongSpecXUIConfig, KongSpecXUIFormConfig, KongSpecXUISecretConfig, } from "./lib/kongSpecFunctionContract";
|
|
18
|
+
export { findSourceState, getActions, getConnectedExitStates, outputAggregator, outputAggregatorUnsafe, parallelStateOutputAggregator, parallelStateOutputAggregatorUnsafe, quoteSecretReferences, traverseFlowUp, } from "./lib/kongSpecUtils";
|
|
19
19
|
export { validate } from "./lib/kongSpecValidate";
|
|
20
20
|
export type { KongSpecValidationIssue, KongSpecValidators } from "./lib/kongSpecValidate";
|
|
@@ -10,7 +10,6 @@ export interface KongSpecProcessRef {
|
|
|
10
10
|
basedOn: KongSpecFlow["id"];
|
|
11
11
|
aliasName: Distinct<string, "KongSpecProcessRefAliasName">;
|
|
12
12
|
}
|
|
13
|
-
export type KongSpecSecretRef = Distinct<string, "KongSpecSecretRef">;
|
|
14
13
|
export type KongSpecSecretType = Distinct<string, "KongSpecSecretType">;
|
|
15
14
|
interface KongSpecStateBase {
|
|
16
15
|
id: Distinct<string, "KongSpecStateId">;
|
|
@@ -46,7 +45,7 @@ export interface KongSpecCircuitBreaker {
|
|
|
46
45
|
}
|
|
47
46
|
export interface KongSpecHowToInvoke {
|
|
48
47
|
prefix: string;
|
|
49
|
-
secretRefs: Record<string,
|
|
48
|
+
secretRefs: Record<string, JqFilter | null>;
|
|
50
49
|
retry: KongSpecRetry;
|
|
51
50
|
cache: KongSpecCache;
|
|
52
51
|
circuitBreaker: KongSpecCircuitBreaker;
|
|
@@ -79,7 +78,7 @@ export interface KongSpecHowToStore {
|
|
|
79
78
|
type: "CONTEXT" | "EXTERNAL" | "CONTEXT_AND_EXTERNAL";
|
|
80
79
|
onFailure: "RETRY" | "SKIP";
|
|
81
80
|
retry: KongSpecStoreRetryControl;
|
|
82
|
-
secretRef:
|
|
81
|
+
secretRef: JqFilter | null;
|
|
83
82
|
}
|
|
84
83
|
export interface KongSpecHowToOutput {
|
|
85
84
|
filter: JqFilter;
|
|
@@ -1,17 +1,10 @@
|
|
|
1
|
-
import { JqFilter, JsonObject, JsonText, Optional
|
|
2
|
-
import { KongSpecAction, KongSpecFlow,
|
|
1
|
+
import { JqFilter, JsonObject, JsonText, Optional } from "@kong/ts";
|
|
2
|
+
import { KongSpecAction, KongSpecFlow, KongSpecState, KongSpecStateExit, KongSpecStateParallel, KongSpecSupportsTransition } from "./kongSpec";
|
|
3
3
|
import { KongSpecActionPath, KongSpecStatePath } from "./kongSpecRef";
|
|
4
4
|
interface TestItem {
|
|
5
5
|
id: KongSpecState["id"] | KongSpecAction["id"];
|
|
6
6
|
source: "initial" | "errors" | "transition" | "noMatchedRule" | "conditions" | "compensateBy" | "actions" | "branches";
|
|
7
7
|
}
|
|
8
|
-
interface Dependency {
|
|
9
|
-
type: "function" | "process";
|
|
10
|
-
tenant: SessionTenant;
|
|
11
|
-
basedOn: KongSpecFunctionRef["basedOn"] | KongSpecProcessRef["basedOn"];
|
|
12
|
-
aliasName: KongSpecFunctionRef["aliasName"] | KongSpecProcessRef["aliasName"];
|
|
13
|
-
usage: Array<KongSpecAction["name"] | KongSpecState["name"]>;
|
|
14
|
-
}
|
|
15
8
|
export declare function quoteSecretReferences(filter: JqFilter): JqFilter;
|
|
16
9
|
export declare function traverseFlowUp(id: KongSpecState["id"] | KongSpecAction["id"], states: KongSpecFlow["states"], test: (current: TestItem) => boolean): boolean;
|
|
17
10
|
export declare function getConnectedExitStates(states: KongSpecFlow["states"], stateRef: KongSpecState["id"]): KongSpecStateExit[];
|
|
@@ -22,5 +15,4 @@ export declare function findSourceState(states: KongSpecState[], targetRef: Kong
|
|
|
22
15
|
export declare function convertActionToState(action: KongSpecAction): KongSpecState & KongSpecSupportsTransition;
|
|
23
16
|
export declare function parallelStateOutputAggregatorUnsafe(jq: (sample: string, filter: JqFilter) => Promise<string>): (state: KongSpecStateParallel, flow: KongSpecFlow) => Promise<JsonObject>;
|
|
24
17
|
export declare function parallelStateOutputAggregator(jq: (sample: string, filter: JqFilter) => Promise<string>): (state: KongSpecStateParallel, flow: KongSpecFlow) => Promise<JsonObject>;
|
|
25
|
-
export declare function getDependencies(flow: KongSpecFlow): Dependency[];
|
|
26
18
|
export {};
|
|
@@ -16,11 +16,11 @@ export { ensureIsDuration, ensureIsDurationOrCron, ensureMinLength, nonNegative,
|
|
|
16
16
|
export { guid, stableUUID, uuidc16, uuidc32, uuidStableSequence } from "./lib/id";
|
|
17
17
|
export type { CompactUUID16, CompactUUID32, GUID, ShortUUID } from "./lib/id";
|
|
18
18
|
export { intervalToString, millisToShortString } from "./lib/interval";
|
|
19
|
-
export { applyJqFilterReplacements, applyJqObjectReplacements, applyJqTextReplacements, convertToJqFilter, extractJqTextContent, jqFilter, JqObjectSerializer, jqText, sanitizeJqFilter, wrapWithJqTextMarkers, } from "./lib/jq";
|
|
19
|
+
export { applyJqFilterReplacements, applyJqObjectReplacements, applyJqTextReplacements, containsJqExpression, convertToJqFilter, extractJqTextContent, jqFilter, JqObjectSerializer, jqText, sanitizeJqFilter, wrapWithJqTextMarkers, } from "./lib/jq";
|
|
20
20
|
export type { JqArray, JqFilter, JqObject, JqSerializer, JqText, RefactorReplacement, } from "./lib/jq";
|
|
21
21
|
export { generateFakeJsonObject, jsonToHumanReadable, prettyJsonObject, prettyJsonText, safeJsonParse, } from "./lib/json";
|
|
22
22
|
export type { JsonArray, JsonObject, JsonSchemaUrl, JsonText } from "./lib/json";
|
|
23
|
-
export { buildExampleObject, buildJSONSchemaType, createEmptyJsonSchema, getNestedValue, getPropertyType, hasJSONSchemaType, isRequired, normalizeNullableUnions, updateNestedValue, } from "./lib/jsonSchema";
|
|
23
|
+
export { buildExampleObject, buildJSONSchemaType, createEmptyJsonSchema, getNestedValue, getPropertyType, hasJSONSchemaType, inferJsonSchema, isLikelyJsonSchema, isRequired, normalizeNullableUnions, updateNestedValue, } from "./lib/jsonSchema";
|
|
24
24
|
export { KeyGenerator } from "./lib/keyGenerator";
|
|
25
25
|
export { findLastIndex, insertItem, moveItem, unique } from "./lib/list";
|
|
26
26
|
export { deepMerge, deepMergeAll } from "./lib/merge";
|
|
@@ -11,6 +11,7 @@ export interface JqSerializer<T = JqObject | JqArray | JqText> {
|
|
|
11
11
|
}
|
|
12
12
|
export declare function jqFilter(value: Primitive): JqFilter;
|
|
13
13
|
export declare function jqText(value: string): JqText;
|
|
14
|
+
export declare function containsJqExpression(value: unknown): value is JqText;
|
|
14
15
|
export declare function sanitizeJqFilter(value: JqFilter): JqFilter;
|
|
15
16
|
export declare function convertToJqFilter(value: JqText): JqFilter;
|
|
16
17
|
export declare function applyJqFilterReplacements(value: JqFilter, replacements: RefactorReplacement[]): JqFilter;
|
|
@@ -19,4 +19,17 @@ export declare function getNestedValue(obj: any, path: string[]): any;
|
|
|
19
19
|
export declare function updateNestedValue(obj: any, path: string[], value: any): any;
|
|
20
20
|
export declare function buildJSONSchemaType(type: JSONSchema7["type"], nullable: boolean): JSONSchema7["type"];
|
|
21
21
|
export declare function buildExampleObject(schema: JSONSchema7): Optional<JsonObject>;
|
|
22
|
+
/**
|
|
23
|
+
* Heuristically decides whether a parsed JSON object is itself a JSON Schema rather than a plain
|
|
24
|
+
* data sample. A `properties` key alone is ambiguous (data can have one too), so it only counts
|
|
25
|
+
* when every property value is an object — i.e. could be a subschema.
|
|
26
|
+
*/
|
|
27
|
+
export declare function isLikelyJsonSchema(value: unknown): boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Derives a draft-07 schema from a plain JSON sample. Primitives keep the sampled value as
|
|
30
|
+
* `examples`, nulls become nullable strings (the sample carries no type information), array
|
|
31
|
+
* item schemas are inferred from the first element, and object properties with a non-null
|
|
32
|
+
* sampled value are marked required.
|
|
33
|
+
*/
|
|
34
|
+
export declare function inferJsonSchema(value: unknown): JSONSchema7;
|
|
22
35
|
export declare function createEmptyJsonSchema(): JSONSchema7;
|
|
@@ -8,6 +8,7 @@ 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 { AppDependency } from "./lib/appDependency";
|
|
11
12
|
export type { AppDocument } from "./lib/appDocument";
|
|
12
13
|
export type { AppDocumentPublish } from "./lib/appDocumentPublish";
|
|
13
14
|
export type { AppDocumentSnapshot } from "./lib/appDocumentSnapshot";
|
|
@@ -20,7 +21,7 @@ export type { AppProcessData } from "./lib/appProcessData";
|
|
|
20
21
|
export type { AppProcessInstanceId } from "./lib/appProcessInstanceId";
|
|
21
22
|
export type { AppProcessStats, AppProcessStatsBucket, AppProcessStatsSeries, } from "./lib/appProcessStats";
|
|
22
23
|
export type { AppProject } from "./lib/appProject";
|
|
23
|
-
export type { AppSecret } from "./lib/appSecret";
|
|
24
|
+
export type { AppSecret, AppSecretKey } from "./lib/appSecret";
|
|
24
25
|
export type { AppSecretDetails } from "./lib/appSecretDetails";
|
|
25
26
|
export type { AppSecretType } from "./lib/appSecretType";
|
|
26
27
|
export type { AppSnapshot } from "./lib/appSnapshot";
|
|
@@ -5,7 +5,8 @@ export declare enum AuditObjectType {
|
|
|
5
5
|
EXTENSION_ALIAS = "extension_alias",
|
|
6
6
|
EXTENSION_SNAPSHOT = "extension_snapshot",
|
|
7
7
|
DOCUMENT_SNAPSHOT = "document_snapshot",
|
|
8
|
-
EXTENSION = "extension"
|
|
8
|
+
EXTENSION = "extension",
|
|
9
|
+
SECRET = "secret"
|
|
9
10
|
}
|
|
10
11
|
export interface AppAuditLog {
|
|
11
12
|
objectType: AuditObjectType;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { KongSpecAction, KongSpecFunctionRef, KongSpecProcessRef, KongSpecState } from "@kong/spec";
|
|
2
|
+
import { SessionTenant } from "@kong/ts";
|
|
3
|
+
import { AppSecretKey } from "./appSecret";
|
|
4
|
+
export interface AppDependency {
|
|
5
|
+
type: "function" | "process" | "secret";
|
|
6
|
+
tenant: SessionTenant;
|
|
7
|
+
basedOn: KongSpecFunctionRef["basedOn"] | KongSpecProcessRef["basedOn"] | undefined;
|
|
8
|
+
name: KongSpecFunctionRef["aliasName"] | KongSpecProcessRef["aliasName"] | AppSecretKey;
|
|
9
|
+
usage: Array<KongSpecAction["name"] | KongSpecState["name"]>;
|
|
10
|
+
}
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import { Entity, Loading, Optional, ShortUUID, User, UtcDateTime } from "@kong/ts";
|
|
1
|
+
import { KongSpecSecretType } from "@kong/spec";
|
|
2
|
+
import { Distinct, Entity, Loading, Optional, ShortUUID, User, UtcDateTime } from "@kong/ts";
|
|
3
|
+
export type AppSecretKey = Distinct<string, "AppSecretKey">;
|
|
3
4
|
export interface AppSecret extends Entity {
|
|
4
|
-
key:
|
|
5
|
+
key: AppSecretKey;
|
|
5
6
|
typeId: ShortUUID;
|
|
6
7
|
type: KongSpecSecretType;
|
|
7
8
|
typeCategory: string;
|