@devkong/cli 0.0.33 → 0.0.35
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 +13430 -9507
- package/package.json +1 -1
- package/packages/kong-cli/src/common/extensionContract.d.ts +7 -1
- package/packages/kong-cli/src/common/profile.d.ts +6 -5
- package/packages/kong-cli/src/common/utils.d.ts +2 -2
- package/packages/kong-spec/src/index.d.ts +3 -2
- package/packages/kong-spec/src/lib/kongServerless.d.ts +2 -1
- package/packages/kong-spec/src/lib/kongSession.d.ts +2 -1
- package/packages/kong-spec/src/lib/kongSpec.d.ts +38 -17
- package/packages/kong-spec/src/lib/kongSpecBuild.d.ts +7 -5
- package/packages/kong-spec/src/lib/kongSpecDoc.d.ts +1 -0
- package/packages/kong-spec/src/lib/kongSpecLayout.d.ts +2 -2
- package/packages/kong-spec/src/lib/kongSpecMigrate.d.ts +2 -0
- package/packages/kong-spec/src/lib/kongSpecRef.d.ts +2 -1
- package/packages/kong-spec/src/lib/kongSpecToServerless.d.ts +4 -5
- package/packages/kong-spec/src/lib/kongSpecUtils.d.ts +6 -3
- package/packages/kong-ts/src/index.d.ts +4 -2
- package/packages/kong-ts/src/lib/dataGuard.d.ts +11 -0
- package/packages/kong-ts/src/lib/jq.d.ts +1 -1
- package/packages/kong-ts/src/lib/keyGenerator.d.ts +0 -1
- package/packages/kong-ts/src/lib/list.d.ts +1 -0
- package/packages/kong-ts/src/lib/utils.d.ts +1 -0
- package/packages/kong-ts-contract/src/index.d.ts +5 -4
- package/packages/kong-ts-contract/src/lib/appAlias.d.ts +5 -3
- package/packages/kong-ts-contract/src/lib/appAliasDetails.d.ts +0 -2
- package/packages/kong-ts-contract/src/lib/appBroadcastData.d.ts +7 -0
- package/packages/kong-ts-contract/src/lib/appDocument.d.ts +2 -0
- package/packages/kong-ts-contract/src/lib/appDocumentPublish.d.ts +7 -0
- package/packages/kong-ts-contract/src/lib/appExtensionSnapshotDetails.d.ts +1 -3
- package/packages/kong-ts-contract/src/lib/appSnapshotDetails.d.ts +1 -0
- package/packages/kong-ts-contract/src/lib/{appProcessStartRequest.d.ts → appTaskStartRequest.d.ts} +1 -1
- package/packages/kong-ts-contract/src/lib/sdkQuota.d.ts +1 -0
- package/packages/kong-ts-contract/src/lib/types.d.ts +2 -0
- package/packages/kong-ts-contract/src/lib/appAliasEditorMode.d.ts +0 -1
- package/packages/kong-ts-contract/src/lib/appDevRequest.d.ts +0 -8
- package/packages/kong-ts-contract/src/lib/appDocumentBuild.d.ts +0 -7
package/package.json
CHANGED
|
@@ -1 +1,7 @@
|
|
|
1
|
-
|
|
1
|
+
import { JSONSchema7 } from "json-schema";
|
|
2
|
+
interface ExtensionContract {
|
|
3
|
+
input: JSONSchema7;
|
|
4
|
+
output: JSONSchema7;
|
|
5
|
+
}
|
|
6
|
+
export declare function getExtensionContract(filePath: string): ExtensionContract;
|
|
7
|
+
export {};
|
|
@@ -4,8 +4,9 @@ export interface Profile {
|
|
|
4
4
|
userName: string;
|
|
5
5
|
}
|
|
6
6
|
export type ProfileName = "default" | string;
|
|
7
|
-
export type
|
|
8
|
-
export declare function
|
|
9
|
-
export declare function
|
|
10
|
-
export declare function
|
|
11
|
-
export declare function
|
|
7
|
+
export type ProfileMap = Record<ProfileName, Profile>;
|
|
8
|
+
export declare function createEmptyProfile(): Profile;
|
|
9
|
+
export declare function loadProfiles(): ProfileMap;
|
|
10
|
+
export declare function saveProfiles(profiles: ProfileMap): void;
|
|
11
|
+
export declare function getProfile(name: ProfileName): Profile;
|
|
12
|
+
export declare function printProfile(name: ProfileName): void;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ShortUUID } from "@kong/ts";
|
|
1
|
+
import { Optional, ShortUUID } from "@kong/ts";
|
|
2
2
|
export interface ILogger {
|
|
3
3
|
info(message: string): any;
|
|
4
4
|
debug(message: string): any;
|
|
@@ -6,7 +6,7 @@ export interface ILogger {
|
|
|
6
6
|
warn(message: string): any;
|
|
7
7
|
}
|
|
8
8
|
export declare function env(key: string): string;
|
|
9
|
-
export declare function optionalEnv(key: string): string
|
|
9
|
+
export declare function optionalEnv(key: string): Optional<string>;
|
|
10
10
|
export declare function loadJsonFile<T>(filePath: string): T;
|
|
11
11
|
export declare function resolveProjectPath(fileName: string): string;
|
|
12
12
|
export declare function generateShortId(): ShortUUID;
|
|
@@ -1,17 +1,18 @@
|
|
|
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, KongSpecActionSendEvent, KongSpecAppend, KongSpecBranch, KongSpecCache, KongSpecCallModel, KongSpecCircuitBreaker, KongSpecCondition, KongSpecEffect, KongSpecEffectStatus, KongSpecError, KongSpecEventBroker, KongSpecEventConnection, KongSpecFeatureCompensation, KongSpecFlow, KongSpecFunctionRef, KongSpecHowToInvoke, KongSpecHowToOutput, KongSpecProcessRef, KongSpecRecord, KongSpecRecordHeader, KongSpecRetry, KongSpecRule, KongSpecState, KongSpecStateCallFunction, KongSpecStateCallProcess, KongSpecStateCompensate, KongSpecStateExit, KongSpecStateFail, KongSpecStateForeach, KongSpecStateInject, KongSpecStateParallel, KongSpecStateRule, KongSpecStateSendEvent, KongSpecStateStart, KongSpecStateSucceed, KongSpecStateSwitch, KongSpecStateWaitEvent, KongSpecSupportsActions, KongSpecSupportsErrors, KongSpecSupportsTransition, } from "./lib/kongSpec";
|
|
4
|
+
export type { KongSpecAction, KongSpecActionCallFunction, KongSpecActionCallProcess, KongSpecActionSendEvent, KongSpecAnnotation, KongSpecAppend, KongSpecBranch, KongSpecCache, KongSpecCallModel, KongSpecCircuitBreaker, KongSpecCondition, KongSpecEffect, KongSpecEffectStatus, KongSpecError, KongSpecEventBroker, KongSpecEventConnection, KongSpecFeatureCompensation, KongSpecFlow, KongSpecFunctionRef, KongSpecHowToInvoke, KongSpecHowToOutput, KongSpecProcessRef, KongSpecRecord, KongSpecRecordHeader, KongSpecRetry, KongSpecRule, KongSpecState, KongSpecStateCallFunction, KongSpecStateCallProcess, KongSpecStateCompensate, KongSpecStateDelay, KongSpecStateExit, KongSpecStateFail, KongSpecStateForeach, KongSpecStateInject, KongSpecStateParallel, KongSpecStateRule, KongSpecStateSendEvent, KongSpecStateStart, KongSpecStateSucceed, KongSpecStateSwitch, KongSpecStateWaitEvent, KongSpecSupportsActions, KongSpecSupportsErrors, 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
9
|
export type { KongSpecLayout, KongSpecLayoutPosition, KongSpecLayoutPositionKey, } from "./lib/kongSpecLayout";
|
|
10
|
+
export { migrate } from "./lib/kongSpecMigrate";
|
|
10
11
|
export { nameGenerator } from "./lib/kongSpecName";
|
|
11
12
|
export { normalizeName } from "./lib/kongSpecNormalize";
|
|
12
13
|
export { KongSpecRef } from "./lib/kongSpecRef";
|
|
13
14
|
export type { KongSpecActionPath, KongSpecStatePath } from "./lib/kongSpecRef";
|
|
14
15
|
export { convertSpecToServerless } from "./lib/kongSpecToServerless";
|
|
15
|
-
export { findSourceState, getActions, outputAggregator, traverseFlowUp } from "./lib/kongSpecUtils";
|
|
16
|
+
export { findSourceState, getActions, outputAggregator, parallelStateOutputAggregator, traverseFlowUp, } from "./lib/kongSpecUtils";
|
|
16
17
|
export { validate } from "./lib/kongSpecValidate";
|
|
17
18
|
export type { KongSpecValidationIssue, KongSpecValidators } from "./lib/kongSpecValidate";
|
|
@@ -6,8 +6,9 @@ export declare const copyServerlessFlow: (workflow: Specification.Workflow) => S
|
|
|
6
6
|
export declare function stringifyServerlessFlow(workflow: Specification.Workflow): string;
|
|
7
7
|
interface ServerlessJavaAppPropsGenerator {
|
|
8
8
|
tenant: SessionTenant;
|
|
9
|
+
processTitle: string;
|
|
9
10
|
processName: string;
|
|
10
11
|
events: Specification.Eventdef[];
|
|
11
12
|
}
|
|
12
|
-
export declare function makeServerlessJavaAppProps({ tenant, processName, events, }: ServerlessJavaAppPropsGenerator): string;
|
|
13
|
+
export declare function makeServerlessJavaAppProps({ tenant, processTitle, processName, events, }: ServerlessJavaAppPropsGenerator): string;
|
|
13
14
|
export {};
|
|
@@ -5,7 +5,9 @@ export declare enum KongSpecSessionAgent {
|
|
|
5
5
|
interface KongSpecSession {
|
|
6
6
|
agent: KongSpecSessionAgent;
|
|
7
7
|
id: TraceParent;
|
|
8
|
+
rootId: Optional<KongSpecSession["id"]>;
|
|
8
9
|
parentId: Optional<KongSpecSession["id"]>;
|
|
10
|
+
rootCreated: UtcDateTime;
|
|
9
11
|
created: UtcDateTime;
|
|
10
12
|
}
|
|
11
13
|
export declare enum KongSpecJobSessionExecutionMode {
|
|
@@ -23,7 +25,6 @@ export interface KongSpecJobSession extends KongSpecSession {
|
|
|
23
25
|
businessKey: BusinessKey;
|
|
24
26
|
source: string;
|
|
25
27
|
tenant: SessionTenant;
|
|
26
|
-
partition: number;
|
|
27
28
|
topic: string;
|
|
28
29
|
metadata: JsonObject;
|
|
29
30
|
priority: KongSpecJobSessionPriority;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Distinct, Duration8601, JqFilter, JqObject, JqText,
|
|
1
|
+
import { DataGuard, Distinct, Duration8601, JqFilter, JqObject, JqText, JsonObject, JsonText, Optional, SessionTenant, ShortUUID } from "@kong/ts";
|
|
2
2
|
import { JSONSchema7 } from "json-schema";
|
|
3
3
|
export type KongSpecAppend = "list" | "last";
|
|
4
4
|
export interface KongSpecFunctionRef {
|
|
@@ -8,13 +8,13 @@ export interface KongSpecFunctionRef {
|
|
|
8
8
|
}
|
|
9
9
|
export interface KongSpecProcessRef {
|
|
10
10
|
tenant: SessionTenant;
|
|
11
|
-
basedOn:
|
|
11
|
+
basedOn: KongSpecFlow["id"];
|
|
12
12
|
aliasName: Distinct<string, "KongSpecProcessRefAliasName">;
|
|
13
13
|
}
|
|
14
14
|
interface KongSpecStateBase {
|
|
15
15
|
id: Distinct<string, "KongSpecStateId">;
|
|
16
16
|
name: string;
|
|
17
|
-
type: "start" | "succeed" | "fail" | "inject" | "compensate" | "foreach" | "callFunction" | "parallel" | "rule" | "switch" | "sendEvent" | "waitEvent" | "callProcess";
|
|
17
|
+
type: "start" | "succeed" | "fail" | "inject" | "compensate" | "foreach" | "callFunction" | "delay" | "parallel" | "rule" | "switch" | "sendEvent" | "waitEvent" | "callProcess";
|
|
18
18
|
}
|
|
19
19
|
export interface KongSpecSupportsTransition {
|
|
20
20
|
next: KongSpecStateBase["id"] | null;
|
|
@@ -27,6 +27,7 @@ export interface KongSpecError extends KongSpecSupportsTransition {
|
|
|
27
27
|
export interface KongSpecCache {
|
|
28
28
|
enabled: boolean;
|
|
29
29
|
key: JqFilter;
|
|
30
|
+
failOnMiss: JqFilter;
|
|
30
31
|
ttl: Duration8601;
|
|
31
32
|
onFailure: "RETRY" | "SKIP";
|
|
32
33
|
}
|
|
@@ -58,35 +59,35 @@ export interface KongSpecEffectProducer {
|
|
|
58
59
|
id: string;
|
|
59
60
|
type: string;
|
|
60
61
|
}
|
|
61
|
-
export interface KongSpecEffectAck {
|
|
62
|
-
producer: KongSpecEffectProducer;
|
|
63
|
-
seqNum: number;
|
|
64
|
-
}
|
|
65
62
|
export declare enum KongSpecEffectStatus {
|
|
66
63
|
FAILED = "FAILED",
|
|
67
64
|
SUCCEEDED = "SUCCEEDED"
|
|
68
65
|
}
|
|
69
66
|
export interface KongSpecEffect {
|
|
70
67
|
status: KongSpecEffectStatus;
|
|
71
|
-
ack: KongSpecEffectAck;
|
|
72
68
|
usage: Record<string, unknown>;
|
|
73
69
|
data: JsonObject | null;
|
|
74
70
|
}
|
|
75
71
|
export interface KongSpecHowToOutput {
|
|
76
|
-
ack: KongSpecEffectAck;
|
|
77
72
|
filter: JqFilter;
|
|
78
73
|
destinations: string[];
|
|
79
74
|
}
|
|
75
|
+
export interface KongSpecSupportsInputFilter {
|
|
76
|
+
inputFilter: JqFilter;
|
|
77
|
+
}
|
|
80
78
|
export interface KongSpecSupportsOutputFilter {
|
|
81
79
|
outputFilter: JqFilter;
|
|
82
80
|
}
|
|
83
81
|
export interface KongSpecSupportsOutputAppend {
|
|
84
82
|
outputAppend: Array<KongSpecAppend>;
|
|
85
83
|
}
|
|
84
|
+
export interface KongSpecSupportsDataGuards {
|
|
85
|
+
guards: DataGuard[];
|
|
86
|
+
}
|
|
86
87
|
export interface KongSpecSupportsOutputSample {
|
|
87
|
-
outputSample: Optional<
|
|
88
|
+
outputSample: Optional<JsonText>;
|
|
88
89
|
}
|
|
89
|
-
export interface KongSpecCallModel extends KongSpecSupportsInput, KongSpecSupportsOutputFilter, KongSpecSupportsOutputAppend, KongSpecSupportsOutputSample, KongSpecSupportsInvoke {
|
|
90
|
+
export interface KongSpecCallModel extends KongSpecSupportsInput, KongSpecSupportsOutputFilter, KongSpecSupportsOutputAppend, KongSpecSupportsOutputSample, KongSpecSupportsDataGuards, KongSpecSupportsInvoke {
|
|
90
91
|
}
|
|
91
92
|
export interface KongSpecSupportsErrors {
|
|
92
93
|
errors: KongSpecError[];
|
|
@@ -106,7 +107,7 @@ export interface KongSpecCanBeUsedForCompensation {
|
|
|
106
107
|
export interface KongSpecStateStart extends KongSpecStateBase, KongSpecSupportsTransition, KongSpecSupportsTimeout {
|
|
107
108
|
type: "start";
|
|
108
109
|
inputSchema: JSONSchema7;
|
|
109
|
-
inputSample:
|
|
110
|
+
inputSample: JsonText;
|
|
110
111
|
}
|
|
111
112
|
export interface KongSpecStateSucceed extends KongSpecStateBase, KongSpecSupportsOutputFilter {
|
|
112
113
|
type: "succeed";
|
|
@@ -170,13 +171,17 @@ export interface KongSpecStateCallProcess extends KongSpecStateBase, KongSpecSup
|
|
|
170
171
|
type: "callProcess";
|
|
171
172
|
ref: KongSpecProcessRef;
|
|
172
173
|
}
|
|
174
|
+
export interface KongSpecStateDelay extends KongSpecStateBase, KongSpecSupportsTransition {
|
|
175
|
+
type: "delay";
|
|
176
|
+
value: Duration8601;
|
|
177
|
+
}
|
|
173
178
|
export interface KongSpecStateCallFunction extends KongSpecStateBase, KongSpecSupportsTransition, KongSpecSupportsErrors, KongSpecFeatureCompensation, KongSpecCanBeUsedForCompensation, KongSpecSupportsCompensatedBy, KongSpecCallModel {
|
|
174
179
|
type: "callFunction";
|
|
175
180
|
ref: KongSpecFunctionRef;
|
|
176
181
|
}
|
|
177
182
|
export interface KongSpecActionBase {
|
|
178
183
|
id: Distinct<string, "KongSpecActionId">;
|
|
179
|
-
type: "callFunction" | "sendEvent" | "callProcess";
|
|
184
|
+
type: "callFunction" | "sendEvent" | "callProcess" | "inject";
|
|
180
185
|
name: string;
|
|
181
186
|
}
|
|
182
187
|
export interface KongSpecActionCallFunction extends KongSpecActionBase, KongSpecCallModel {
|
|
@@ -185,13 +190,17 @@ export interface KongSpecActionCallFunction extends KongSpecActionBase, KongSpec
|
|
|
185
190
|
}
|
|
186
191
|
export interface KongSpecActionCallProcess extends KongSpecActionBase, KongSpecCallModel {
|
|
187
192
|
type: "callProcess";
|
|
193
|
+
ref: KongSpecProcessRef;
|
|
188
194
|
}
|
|
189
195
|
export interface KongSpecActionSendEvent extends KongSpecActionBase {
|
|
190
196
|
type: "sendEvent";
|
|
191
197
|
connection: KongSpecEventConnection;
|
|
192
198
|
record: KongSpecRecord;
|
|
193
199
|
}
|
|
194
|
-
export
|
|
200
|
+
export interface KongSpecActionInject extends KongSpecActionBase, KongSpecSupportsOutputFilter, KongSpecSupportsOutputAppend {
|
|
201
|
+
type: "inject";
|
|
202
|
+
}
|
|
203
|
+
export type KongSpecAction = KongSpecActionCallFunction | KongSpecActionCallProcess | KongSpecActionSendEvent | KongSpecActionInject;
|
|
195
204
|
export interface KongSpecSupportsActions {
|
|
196
205
|
actions: KongSpecAction[];
|
|
197
206
|
}
|
|
@@ -206,16 +215,28 @@ export interface KongSpecStateForeach extends KongSpecStateBase, KongSpecSupport
|
|
|
206
215
|
outputCollection: JqFilter;
|
|
207
216
|
actions: KongSpecAction[];
|
|
208
217
|
}
|
|
209
|
-
export interface KongSpecStateParallel extends KongSpecStateBase, KongSpecSupportsTransition, KongSpecCanBeUsedForCompensation, KongSpecFeatureCompensation, KongSpecSupportsCompensatedBy, KongSpecSupportsErrors {
|
|
218
|
+
export interface KongSpecStateParallel extends KongSpecStateBase, KongSpecSupportsTransition, KongSpecCanBeUsedForCompensation, KongSpecFeatureCompensation, KongSpecSupportsCompensatedBy, KongSpecSupportsInputFilter, KongSpecSupportsOutputFilter, KongSpecSupportsOutputAppend, KongSpecSupportsErrors, KongSpecSupportsInput {
|
|
210
219
|
type: "parallel";
|
|
211
220
|
branches: KongSpecBranch[];
|
|
212
221
|
completionType: "allOf" | "atLeast";
|
|
213
222
|
}
|
|
214
|
-
export type KongSpecState =
|
|
223
|
+
export type KongSpecState = KongSpecStateCallFunction | KongSpecStateCallProcess | KongSpecStateCompensate | KongSpecStateDelay | KongSpecStateFail | KongSpecStateForeach | KongSpecStateInject | KongSpecStateParallel | KongSpecStateRule | KongSpecStateSendEvent | KongSpecStateStart | KongSpecStateSucceed | KongSpecStateSwitch | KongSpecStateWaitEvent;
|
|
215
224
|
export type KongSpecStateExit = KongSpecStateFail | KongSpecStateSucceed;
|
|
225
|
+
interface KongSpecAnnotationBase {
|
|
226
|
+
id: Distinct<string, "KongSpecAnnotationId">;
|
|
227
|
+
}
|
|
228
|
+
export interface KongSpecNoteAnnotation extends KongSpecAnnotationBase {
|
|
229
|
+
type: "note";
|
|
230
|
+
content: string;
|
|
231
|
+
size: [number, number];
|
|
232
|
+
fill: string;
|
|
233
|
+
stroke: string;
|
|
234
|
+
}
|
|
235
|
+
export type KongSpecAnnotation = KongSpecNoteAnnotation;
|
|
216
236
|
export interface KongSpecFlow {
|
|
217
237
|
id: Distinct<ShortUUID, "KongSpecFlowId">;
|
|
218
|
-
version: "1
|
|
238
|
+
version: "1";
|
|
219
239
|
states: KongSpecState[];
|
|
240
|
+
annotations: KongSpecAnnotation[];
|
|
220
241
|
}
|
|
221
242
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
|
-
import { JqObject,
|
|
2
|
-
import {
|
|
3
|
-
import { KongSpecActionCallFunction, KongSpecActionSendEvent, KongSpecBranch, KongSpecCallModel, KongSpecCondition, KongSpecError, KongSpecEventBroker, KongSpecFlow, KongSpecFunctionRef, KongSpecHowToInvoke, KongSpecHowToOutput, KongSpecProcessRef, KongSpecRecordHeader, KongSpecRule, KongSpecStateCallFunction, KongSpecStateCallProcess, KongSpecStateCompensate, KongSpecStateFail, KongSpecStateForeach, KongSpecStateInject, KongSpecStateParallel, KongSpecStateRule, KongSpecStateSendEvent, KongSpecStateStart, KongSpecStateSucceed, KongSpecStateSwitch, KongSpecStateWaitEvent } from "./kongSpec";
|
|
1
|
+
import { JqObject, Optional } from "@kong/ts";
|
|
2
|
+
import { KongSpecActionCallFunction, KongSpecActionCallProcess, KongSpecActionInject, KongSpecActionSendEvent, KongSpecAnnotation, KongSpecBranch, KongSpecCallModel, KongSpecCondition, KongSpecError, KongSpecEventBroker, KongSpecFlow, KongSpecFunctionRef, KongSpecHowToInvoke, KongSpecHowToOutput, KongSpecProcessRef, KongSpecRecordHeader, KongSpecRule, KongSpecState, KongSpecStateCallFunction, KongSpecStateCallProcess, KongSpecStateCompensate, KongSpecStateDelay, KongSpecStateFail, KongSpecStateForeach, KongSpecStateInject, KongSpecStateParallel, KongSpecStateRule, KongSpecStateSendEvent, KongSpecStateStart, KongSpecStateSucceed, KongSpecStateSwitch, KongSpecStateWaitEvent } from "./kongSpec";
|
|
4
3
|
export declare class KongSpecBuild {
|
|
5
4
|
flow(id: KongSpecFlow["id"]): KongSpecFlow;
|
|
6
5
|
startState(overrides?: Partial<KongSpecStateStart>): KongSpecStateStart;
|
|
@@ -9,10 +8,13 @@ export declare class KongSpecBuild {
|
|
|
9
8
|
callFunctionState(ref: KongSpecFunctionRef, overrides?: Partial<KongSpecStateCallFunction>): KongSpecStateCallFunction;
|
|
10
9
|
callFunctionAction(ref: KongSpecFunctionRef, overrides?: Partial<KongSpecActionCallFunction>): KongSpecActionCallFunction;
|
|
11
10
|
callProcessState(ref: KongSpecProcessRef, overrides?: Partial<KongSpecStateCallProcess>): KongSpecStateCallProcess;
|
|
11
|
+
callProcessAction(ref: KongSpecProcessRef, overrides?: Partial<KongSpecActionCallProcess>): KongSpecActionCallProcess;
|
|
12
|
+
delayState(overrides?: Partial<KongSpecStateDelay>): KongSpecStateDelay;
|
|
12
13
|
compensateState(overrides?: Partial<KongSpecStateCompensate>): KongSpecStateCompensate;
|
|
13
14
|
failState(overrides?: Partial<KongSpecStateFail>): KongSpecStateFail;
|
|
14
15
|
injectState(overrides?: Partial<KongSpecStateInject>): KongSpecStateInject;
|
|
15
|
-
|
|
16
|
+
injectAction(overrides?: Partial<KongSpecActionInject>): KongSpecActionInject;
|
|
17
|
+
succeedState(afterState: Optional<KongSpecState["name"]>, overrides?: Partial<KongSpecStateSucceed>): KongSpecStateSucceed;
|
|
16
18
|
sendEventState(overrides?: Partial<KongSpecStateSendEvent>): KongSpecStateSendEvent;
|
|
17
19
|
sendEventAction(overrides?: Partial<KongSpecActionSendEvent>): KongSpecActionSendEvent;
|
|
18
20
|
waitEventState(overrides?: Partial<KongSpecStateWaitEvent>): KongSpecStateWaitEvent;
|
|
@@ -30,5 +32,5 @@ export declare class KongSpecBuild {
|
|
|
30
32
|
circuitBreaker(overrides?: Partial<KongSpecHowToInvoke["circuitBreaker"]>): KongSpecHowToInvoke["circuitBreaker"];
|
|
31
33
|
cache(overrides?: Partial<KongSpecHowToInvoke["cache"]>): KongSpecHowToInvoke["cache"];
|
|
32
34
|
callModel(payload: JqObject): KongSpecCallModel;
|
|
33
|
-
|
|
35
|
+
note(overrides?: Partial<KongSpecAnnotation>): KongSpecAnnotation;
|
|
34
36
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { KongSpecAction, KongSpecState } from "./kongSpec";
|
|
2
|
-
export type KongSpecLayoutPositionKey = KongSpecState["id"] | KongSpecAction["id"];
|
|
1
|
+
import { KongSpecAction, KongSpecAnnotation, KongSpecState } from "./kongSpec";
|
|
2
|
+
export type KongSpecLayoutPositionKey = KongSpecState["id"] | KongSpecAction["id"] | KongSpecAnnotation["id"];
|
|
3
3
|
export type KongSpecLayoutPosition = [number, number];
|
|
4
4
|
export type KongSpecLayout = Record<KongSpecLayoutPositionKey, KongSpecLayoutPosition>;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Optional, SessionTenant } from "@kong/ts";
|
|
2
|
-
import { KongSpecAction, KongSpecBranch, KongSpecCondition, KongSpecError, KongSpecFunctionRef, KongSpecProcessRef, KongSpecRule, KongSpecState } from "./kongSpec";
|
|
2
|
+
import { KongSpecAction, KongSpecAnnotation, KongSpecBranch, KongSpecCondition, KongSpecError, KongSpecFunctionRef, KongSpecProcessRef, KongSpecRule, KongSpecState } from "./kongSpec";
|
|
3
3
|
export declare class KongSpecRef {
|
|
4
4
|
static newStateId(): KongSpecState["id"];
|
|
5
5
|
static newConditionId(): KongSpecCondition["id"];
|
|
@@ -7,6 +7,7 @@ export declare class KongSpecRef {
|
|
|
7
7
|
static newBranchId(): KongSpecBranch["id"];
|
|
8
8
|
static newErrorId(): KongSpecError["id"];
|
|
9
9
|
static newActionId(): KongSpecAction["id"];
|
|
10
|
+
static newAnnotationId(): KongSpecAnnotation["id"];
|
|
10
11
|
static functionRef(tenant: SessionTenant, basedOn: string, aliasName: string): KongSpecFunctionRef;
|
|
11
12
|
static processRef(tenant: SessionTenant, basedOn: string, aliasName: string): KongSpecProcessRef;
|
|
12
13
|
}
|
|
@@ -1,11 +1,10 @@
|
|
|
1
|
-
import { SessionTenant } from "@kong/ts";
|
|
1
|
+
import { Optional, SessionTenant } from "@kong/ts";
|
|
2
2
|
import { Specification } from "@severlessworkflow/sdk-typescript";
|
|
3
3
|
import { JSONSchema7 } from "json-schema";
|
|
4
|
-
import { KongSpecFlow
|
|
5
|
-
import { KongSpecEnv } from "./kongSpecEnv";
|
|
4
|
+
import { KongSpecFlow } from "./kongSpec";
|
|
6
5
|
interface ConvertSpecToServerlessResult {
|
|
7
6
|
workflow: Specification.Workflow;
|
|
8
|
-
inputSchema: JSONSchema7
|
|
7
|
+
inputSchema: Optional<JSONSchema7>;
|
|
9
8
|
}
|
|
10
|
-
export declare function convertSpecToServerless(
|
|
9
|
+
export declare function convertSpecToServerless(tenant: SessionTenant, specFlow: KongSpecFlow, processName: string, parentProcessName?: string): ConvertSpecToServerlessResult[];
|
|
11
10
|
export {};
|
|
@@ -1,11 +1,14 @@
|
|
|
1
|
-
import { JqFilter,
|
|
2
|
-
import { KongSpecAction, KongSpecFlow, KongSpecState } from "./kongSpec";
|
|
1
|
+
import { JqFilter, JsonText } from "@kong/ts";
|
|
2
|
+
import { KongSpecAction, KongSpecFlow, KongSpecState, KongSpecStateParallel, KongSpecSupportsTransition } from "./kongSpec";
|
|
3
|
+
import { KongSpecActionPath, KongSpecStatePath } from "./kongSpecRef";
|
|
3
4
|
interface FloweyTraverseStateTestItem {
|
|
4
5
|
id: KongSpecState["id"] | KongSpecAction["id"];
|
|
5
6
|
source: "initial" | "errors" | "transition" | "noMatchedRule" | "conditions" | "compensateBy" | "actions" | "branches";
|
|
6
7
|
}
|
|
7
8
|
export declare function traverseFlowUp(id: KongSpecState["id"] | KongSpecAction["id"], states: KongSpecFlow["states"], test: (current: FloweyTraverseStateTestItem) => boolean): boolean;
|
|
8
|
-
export declare function outputAggregator(jq: (sample:
|
|
9
|
+
export declare function outputAggregator(jq: (sample: string, filter: JqFilter) => Promise<string>): (flow: KongSpecFlow, path: KongSpecStatePath | KongSpecActionPath, includeTarget?: boolean) => Promise<JsonText>;
|
|
9
10
|
export declare function getActions(state: KongSpecState): KongSpecAction[];
|
|
10
11
|
export declare function findSourceState(states: KongSpecState[], targetRef: KongSpecState["id"]): import("@kong/ts").Distinct<string, "KongSpecStateId">;
|
|
12
|
+
export declare function convertActionToState(action: KongSpecAction): KongSpecState & KongSpecSupportsTransition;
|
|
13
|
+
export declare function parallelStateOutputAggregator(jq: (sample: string, filter: JqFilter) => Promise<string>): (state: KongSpecStateParallel, flow: KongSpecFlow) => Promise<JsonText>;
|
|
11
14
|
export {};
|
|
@@ -4,6 +4,8 @@ export type { BusinessKey } from "./lib/businessKey";
|
|
|
4
4
|
export { CloudEvent } from "./lib/cloudEvent";
|
|
5
5
|
export { textToColor } from "./lib/color";
|
|
6
6
|
export { deepEquals, prepareTextForComparison, sameText, shadowEquals } from "./lib/compare";
|
|
7
|
+
export { DataGuardType } from "./lib/dataGuard";
|
|
8
|
+
export type { DataGuard } from "./lib/dataGuard";
|
|
7
9
|
export { isDuration } from "./lib/duration";
|
|
8
10
|
export type { Duration8601 } from "./lib/duration";
|
|
9
11
|
export type { Entity } from "./lib/entity";
|
|
@@ -17,7 +19,7 @@ export type { JqArray, JqFilter, JqObject, JqSerializer, JqText, RefactorReplace
|
|
|
17
19
|
export { generateFakeJsonObject, jsonToHumanReadable, prettyJson, safeJsonParse } from "./lib/json";
|
|
18
20
|
export type { JsonArray, JsonObject, JsonSchemaUrl, JsonText } from "./lib/json";
|
|
19
21
|
export { KeyGenerator } from "./lib/keyGenerator";
|
|
20
|
-
export { insertItem, moveItem, unique } from "./lib/list";
|
|
22
|
+
export { findLastIndex, insertItem, moveItem, unique } from "./lib/list";
|
|
21
23
|
export { deepMerge, deepMergeAll } from "./lib/merge";
|
|
22
24
|
export { deepDeleteKeys } from "./lib/normalize";
|
|
23
25
|
export { retry } from "./lib/retry";
|
|
@@ -36,4 +38,4 @@ export type { UrlText } from "./lib/url";
|
|
|
36
38
|
export type { User } from "./lib/user";
|
|
37
39
|
export { dateToUtc, utcNow, utcToZonedDate, utcToZonedText } from "./lib/utc";
|
|
38
40
|
export type { UtcDateTime } from "./lib/utc";
|
|
39
|
-
export { assignDefined, clone, coalesce, getFirstObjectValue, isEmpty, isFunction, isNumber, isString, jitter, no, noop, reinterpret, safeCall, yes, } from "./lib/utils";
|
|
41
|
+
export { assignDefined, clone, coalesce, getFirstObjectValue, isEmpty, isFunction, isNumber, isString, jitter, no, noop, reinterpret, safeCall, toAlphabetic, yes, } from "./lib/utils";
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare enum DataGuardType {
|
|
2
|
+
NULL = "NULL",
|
|
3
|
+
EMPTY_TEXT = "EMPTY_TEXT",
|
|
4
|
+
WHITESPACES = "WHITESPACES",
|
|
5
|
+
EMPTY_OBJECT = "EMPTY_OBJECT",
|
|
6
|
+
EMPTY_ARRAY = "EMPTY_ARRAY"
|
|
7
|
+
}
|
|
8
|
+
export interface DataGuard {
|
|
9
|
+
type: DataGuardType;
|
|
10
|
+
arguments: Array<unknown>;
|
|
11
|
+
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { Distinct, Primitive } from "./types";
|
|
2
|
-
export type JqFilter = Distinct<Primitive, "
|
|
2
|
+
export type JqFilter = Distinct<Primitive, "JqFilter">;
|
|
3
3
|
export type JqText = Distinct<string, "JqText">;
|
|
4
4
|
export interface JqObject {
|
|
5
5
|
[key: string]: Primitive | JqText | JqObject | Array<JqObject> | null;
|
|
@@ -1,3 +1,4 @@
|
|
|
1
1
|
export declare function insertItem<T>(list: ReadonlyArray<T>, item: T, index: number): T[];
|
|
2
2
|
export declare function moveItem<T>(list: ReadonlyArray<T>, from: number, to: number): T[];
|
|
3
3
|
export declare function unique<T>(list: T[]): T[];
|
|
4
|
+
export declare function findLastIndex<T>(list: ReadonlyArray<T>, predicate: (value: T, index: number, array: ReadonlyArray<T>) => boolean): number;
|
|
@@ -13,3 +13,4 @@ export declare function coalesce<T>(...values: (T | undefined | null)[]): T;
|
|
|
13
13
|
export declare function safeCall(action: Action): Optional<Error>;
|
|
14
14
|
export declare function getFirstObjectValue<T extends JsonObject>(instance: T): Optional<T[keyof T]>;
|
|
15
15
|
export declare function jitter(bottom: number, up: number): number;
|
|
16
|
+
export declare function toAlphabetic(index: number): string;
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
+
export type { AppAlias } from "./lib/appAlias";
|
|
1
2
|
export type { AppAliasDetails } from "./lib/appAliasDetails";
|
|
2
|
-
export type { AppAliasEditorMode } from "./lib/appAliasEditorMode";
|
|
3
3
|
export type { AppAliasUse } from "./lib/appAliasUse";
|
|
4
4
|
export type { AppAliasUseDetails } from "./lib/appAliasUseDetails";
|
|
5
|
+
export type { AppBroadcastData } from "./lib/appBroadcastData";
|
|
5
6
|
export type { AppCheckpoint } from "./lib/appCheckpoint";
|
|
6
|
-
export type { AppDevRequest } from "./lib/appDevRequest";
|
|
7
7
|
export type { AppDocument } from "./lib/appDocument";
|
|
8
|
-
export type {
|
|
8
|
+
export type { AppDocumentPublish } from "./lib/appDocumentPublish";
|
|
9
9
|
export type { AppDocumentSnapshot } from "./lib/appDocumentSnapshot";
|
|
10
10
|
export type { AppExtension } from "./lib/appExtension";
|
|
11
11
|
export type { AppExtensionAlias } from "./lib/appExtensionAlias";
|
|
@@ -20,9 +20,9 @@ export type { AppProcessAliasDetails } from "./lib/appProcessAliasDetails";
|
|
|
20
20
|
export type { AppProcessAliasUse } from "./lib/appProcessAliasUse";
|
|
21
21
|
export type { AppProcessAliasUseDetails } from "./lib/appProcessAliasUseDetails";
|
|
22
22
|
export type { AppProcessInstanceId } from "./lib/appProcessInstanceId";
|
|
23
|
-
export type { AppProcessStartRequest } from "./lib/appProcessStartRequest";
|
|
24
23
|
export type { AppProject } from "./lib/appProject";
|
|
25
24
|
export type { AppSnapshotDetails } from "./lib/appSnapshotDetails";
|
|
25
|
+
export type { AppTaskStartRequest } from "./lib/appTaskStartRequest";
|
|
26
26
|
export type { AppTestCase } from "./lib/appTestCase";
|
|
27
27
|
export type { AppTestCaseDetails } from "./lib/appTestCaseDetails";
|
|
28
28
|
export type { AppTestCaseMatchFeature } from "./lib/appTestCaseMatchFeature";
|
|
@@ -31,3 +31,4 @@ export type { AppWorkspace } from "./lib/appWorkspace";
|
|
|
31
31
|
export type { SdkAlias, SdkAliasInput, SdkAliasOutput } from "./lib/sdkAlias";
|
|
32
32
|
export type { SdkExtensionAlias } from "./lib/sdkExtensionAlias";
|
|
33
33
|
export type { SdkConcurrencyQuota, SdkQuotaName, SdkRateLimiterQuota } from "./lib/sdkQuota";
|
|
34
|
+
export type { FQIN } from "./lib/types";
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { KongSpecFunctionRef, KongSpecProcessRef } from "@kong/spec";
|
|
2
|
-
import { Entity,
|
|
2
|
+
import { Entity, User, UtcDateTime } from "@kong/ts";
|
|
3
|
+
import { AppDocument } from "./appDocument";
|
|
4
|
+
import { AppExtension } from "./appExtension";
|
|
3
5
|
export interface AppAlias<T> extends Entity {
|
|
4
6
|
name: KongSpecProcessRef["aliasName"] | KongSpecFunctionRef["aliasName"];
|
|
5
|
-
basedOnId:
|
|
6
|
-
basedOnName:
|
|
7
|
+
basedOnId: AppDocument["id"] | AppExtension["id"];
|
|
8
|
+
basedOnName: AppDocument["title"] | AppExtension["name"];
|
|
7
9
|
use: T[];
|
|
8
10
|
created: UtcDateTime;
|
|
9
11
|
updated: UtcDateTime;
|
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import { KongSpecHowToInvoke } from "@kong/spec";
|
|
2
1
|
import { AppAlias } from "./appAlias";
|
|
3
2
|
import { SdkAlias } from "./sdkAlias";
|
|
4
3
|
export interface AppAliasDetails<T> extends AppAlias<T> {
|
|
5
4
|
inputSchema?: NonNullable<SdkAlias["input"]>["schema"];
|
|
6
5
|
outputSchema?: NonNullable<SdkAlias["input"]>["schema"];
|
|
7
|
-
invoke?: Partial<KongSpecHowToInvoke>;
|
|
8
6
|
}
|
|
@@ -2,8 +2,10 @@ import { KongSpecFlow } from "@kong/spec";
|
|
|
2
2
|
import { Entity, Optional, User, UtcDateTime } from "@kong/ts";
|
|
3
3
|
import { AppCheckpoint } from "./appCheckpoint";
|
|
4
4
|
import { AppProject } from "./appProject";
|
|
5
|
+
import { AppWorkspace } from "./appWorkspace";
|
|
5
6
|
export interface AppDocument extends Entity {
|
|
6
7
|
id: KongSpecFlow["id"];
|
|
8
|
+
workspaceId: AppWorkspace["id"];
|
|
7
9
|
projectId: AppProject["id"];
|
|
8
10
|
title: string;
|
|
9
11
|
checkpoint: Optional<AppCheckpoint["id"]>;
|
|
@@ -2,6 +2,7 @@ import { JsonObject } from "@kong/ts";
|
|
|
2
2
|
import { JSONSchema7 } from "json-schema";
|
|
3
3
|
import { AppSnapshot } from "./appSnapshot";
|
|
4
4
|
export interface AppSnapshotDetails extends AppSnapshot {
|
|
5
|
+
sdk: string;
|
|
5
6
|
inputSchema: JSONSchema7;
|
|
6
7
|
outputSchema: JSONSchema7;
|
|
7
8
|
metadata: JsonObject;
|
package/packages/kong-ts-contract/src/lib/{appProcessStartRequest.d.ts → appTaskStartRequest.d.ts}
RENAMED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { KongSpecJobSession } from "@kong/spec";
|
|
2
2
|
import { JsonObject } from "@kong/ts";
|
|
3
|
-
export interface
|
|
3
|
+
export interface AppTaskStartRequest {
|
|
4
4
|
session: {
|
|
5
5
|
businessKey: KongSpecJobSession["businessKey"];
|
|
6
6
|
priority: KongSpecJobSession["priority"];
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export type AppAliasEditorMode = "add" | "edit";
|