@devkong/cli 0.0.26 → 0.0.27

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
@@ -17673,7 +17673,7 @@ var require_AnimationFrameAction = __commonJS({
17673
17673
  return _super.prototype.recycleAsyncId.call(this, scheduler, id, delay2);
17674
17674
  }
17675
17675
  var actions2 = scheduler.actions;
17676
- if (id != null && ((_a = actions2[actions2.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {
17676
+ if (id != null && id === scheduler._scheduled && ((_a = actions2[actions2.length - 1]) === null || _a === void 0 ? void 0 : _a.id) !== id) {
17677
17677
  animationFrameProvider_1.animationFrameProvider.cancelAnimationFrame(id);
17678
17678
  scheduler._scheduled = void 0;
17679
17679
  }
@@ -17720,8 +17720,13 @@ var require_AnimationFrameScheduler = __commonJS({
17720
17720
  }
17721
17721
  AnimationFrameScheduler2.prototype.flush = function(action) {
17722
17722
  this._active = true;
17723
- var flushId = this._scheduled;
17724
- this._scheduled = void 0;
17723
+ var flushId;
17724
+ if (action) {
17725
+ flushId = action.id;
17726
+ } else {
17727
+ flushId = this._scheduled;
17728
+ this._scheduled = void 0;
17729
+ }
17725
17730
  var actions2 = this.actions;
17726
17731
  var error;
17727
17732
  action = action || actions2.shift();
@@ -22307,7 +22312,6 @@ var require_merge2 = __commonJS({
22307
22312
  Object.defineProperty(exports2, "__esModule", { value: true });
22308
22313
  exports2.merge = void 0;
22309
22314
  var lift_1 = require_lift();
22310
- var argsOrArgArray_1 = require_argsOrArgArray();
22311
22315
  var mergeAll_1 = require_mergeAll();
22312
22316
  var args_1 = require_args();
22313
22317
  var from_1 = require_from();
@@ -22318,7 +22322,6 @@ var require_merge2 = __commonJS({
22318
22322
  }
22319
22323
  var scheduler = args_1.popScheduler(args);
22320
22324
  var concurrent = args_1.popNumber(args, Infinity);
22321
- args = argsOrArgArray_1.argsOrArgArray(args);
22322
22325
  return lift_1.operate(function(source, subscriber) {
22323
22326
  mergeAll_1.mergeAll(concurrent)(from_1.from(__spreadArray2([source], __read2(args)), scheduler)).subscribe(subscriber);
22324
22327
  });
@@ -34730,50 +34733,64 @@ var require_common = __commonJS({
34730
34733
  createDebug.namespaces = namespaces;
34731
34734
  createDebug.names = [];
34732
34735
  createDebug.skips = [];
34733
- let i;
34734
- const split2 = (typeof namespaces === "string" ? namespaces : "").split(/[\s,]+/);
34735
- const len = split2.length;
34736
- for (i = 0; i < len; i++) {
34737
- if (!split2[i]) {
34738
- continue;
34736
+ const split2 = (typeof namespaces === "string" ? namespaces : "").trim().replace(" ", ",").split(",").filter(Boolean);
34737
+ for (const ns of split2) {
34738
+ if (ns[0] === "-") {
34739
+ createDebug.skips.push(ns.slice(1));
34740
+ } else {
34741
+ createDebug.names.push(ns);
34739
34742
  }
34740
- namespaces = split2[i].replace(/\*/g, ".*?");
34741
- if (namespaces[0] === "-") {
34742
- createDebug.skips.push(new RegExp("^" + namespaces.slice(1) + "$"));
34743
+ }
34744
+ }
34745
+ function matchesTemplate(search, template2) {
34746
+ let searchIndex = 0;
34747
+ let templateIndex = 0;
34748
+ let starIndex = -1;
34749
+ let matchIndex = 0;
34750
+ while (searchIndex < search.length) {
34751
+ if (templateIndex < template2.length && (template2[templateIndex] === search[searchIndex] || template2[templateIndex] === "*")) {
34752
+ if (template2[templateIndex] === "*") {
34753
+ starIndex = templateIndex;
34754
+ matchIndex = searchIndex;
34755
+ templateIndex++;
34756
+ } else {
34757
+ searchIndex++;
34758
+ templateIndex++;
34759
+ }
34760
+ } else if (starIndex !== -1) {
34761
+ templateIndex = starIndex + 1;
34762
+ matchIndex++;
34763
+ searchIndex = matchIndex;
34743
34764
  } else {
34744
- createDebug.names.push(new RegExp("^" + namespaces + "$"));
34765
+ return false;
34745
34766
  }
34746
34767
  }
34768
+ while (templateIndex < template2.length && template2[templateIndex] === "*") {
34769
+ templateIndex++;
34770
+ }
34771
+ return templateIndex === template2.length;
34747
34772
  }
34748
34773
  function disable() {
34749
34774
  const namespaces = [
34750
- ...createDebug.names.map(toNamespace),
34751
- ...createDebug.skips.map(toNamespace).map((namespace) => "-" + namespace)
34775
+ ...createDebug.names,
34776
+ ...createDebug.skips.map((namespace) => "-" + namespace)
34752
34777
  ].join(",");
34753
34778
  createDebug.enable("");
34754
34779
  return namespaces;
34755
34780
  }
34756
34781
  function enabled(name) {
34757
- if (name[name.length - 1] === "*") {
34758
- return true;
34759
- }
34760
- let i;
34761
- let len;
34762
- for (i = 0, len = createDebug.skips.length; i < len; i++) {
34763
- if (createDebug.skips[i].test(name)) {
34782
+ for (const skip of createDebug.skips) {
34783
+ if (matchesTemplate(name, skip)) {
34764
34784
  return false;
34765
34785
  }
34766
34786
  }
34767
- for (i = 0, len = createDebug.names.length; i < len; i++) {
34768
- if (createDebug.names[i].test(name)) {
34787
+ for (const ns of createDebug.names) {
34788
+ if (matchesTemplate(name, ns)) {
34769
34789
  return true;
34770
34790
  }
34771
34791
  }
34772
34792
  return false;
34773
34793
  }
34774
- function toNamespace(regexp) {
34775
- return regexp.toString().substring(2, regexp.toString().length - 2).replace(/\.\*\?$/, "*");
34776
- }
34777
34794
  function coerce(val) {
34778
34795
  if (val instanceof Error) {
34779
34796
  return val.stack || val.message;
@@ -42687,7 +42704,7 @@ var require_nx_cloud = __commonJS({
42687
42704
  nxCloudSpinner.succeed("Nx Cloud has been set up successfully");
42688
42705
  return accessToken || nxCloudId;
42689
42706
  }
42690
- async function getOnboardingInfo(nxCloud, token, directory, useGithub) {
42707
+ async function getOnboardingInfo(nxCloud, token, directory, useGitHub) {
42691
42708
  const { createNxCloudOnboardingURL } = require(require.resolve(
42692
42709
  "nx/src/nx-cloud/utilities/url-shorten",
42693
42710
  {
@@ -42697,7 +42714,7 @@ var require_nx_cloud = __commonJS({
42697
42714
  ));
42698
42715
  const source = nxCloud === "yes" ? "create-nx-workspace-success-cache-setup" : "create-nx-workspace-success-ci-setup";
42699
42716
  const { code, createMessage } = (0, messages_1.getMessageFactory)(source);
42700
- const connectCloudUrl = await createNxCloudOnboardingURL(source, token, useGithub ?? (nxCloud === "yes" || nxCloud === "github" || nxCloud === "circleci"), code);
42717
+ const connectCloudUrl = await createNxCloudOnboardingURL(source, token, useGitHub ?? (nxCloud === "yes" || nxCloud === "github" || nxCloud === "circleci"), code);
42701
42718
  const out = new output_1.CLIOutput(false);
42702
42719
  const message2 = createMessage(connectCloudUrl);
42703
42720
  if (message2.type === "success") {
@@ -43048,12 +43065,12 @@ var require_package_manager = __commonJS({
43048
43065
  exports2.generatePackageManagerFiles = generatePackageManagerFiles;
43049
43066
  exports2.getPackageManagerVersion = getPackageManagerVersion;
43050
43067
  exports2.detectInvokedPackageManager = detectInvokedPackageManager;
43051
- var child_process_1 = require("child_process");
43052
- var fs_1 = require("fs");
43053
- var path_1 = require("path");
43068
+ var node_child_process_1 = require("node:child_process");
43069
+ var node_fs_1 = require("node:fs");
43070
+ var node_path_1 = require("node:path");
43054
43071
  exports2.packageManagerList = ["pnpm", "yarn", "npm", "bun"];
43055
43072
  function detectPackageManager(dir = "") {
43056
- return (0, fs_1.existsSync)((0, path_1.join)(dir, "bun.lockb")) ? "bun" : (0, fs_1.existsSync)((0, path_1.join)(dir, "yarn.lock")) ? "yarn" : (0, fs_1.existsSync)((0, path_1.join)(dir, "pnpm-lock.yaml")) ? "pnpm" : "npm";
43073
+ return (0, node_fs_1.existsSync)((0, node_path_1.join)(dir, "bun.lockb")) || (0, node_fs_1.existsSync)((0, node_path_1.join)(dir, "bun.lock")) ? "bun" : (0, node_fs_1.existsSync)((0, node_path_1.join)(dir, "yarn.lock")) ? "yarn" : (0, node_fs_1.existsSync)((0, node_path_1.join)(dir, "pnpm-lock.yaml")) ? "pnpm" : "npm";
43057
43074
  }
43058
43075
  function getPackageManagerCommand(packageManager = detectPackageManager()) {
43059
43076
  const pmVersion = getPackageManagerVersion(packageManager);
@@ -43101,8 +43118,8 @@ var require_package_manager = __commonJS({
43101
43118
  switch (packageManager) {
43102
43119
  case "yarn":
43103
43120
  if (+pmMajor >= 2) {
43104
- (0, fs_1.writeFileSync)((0, path_1.join)(root, ".yarnrc.yml"), "nodeLinker: node-modules\nenableScripts: false");
43105
- (0, fs_1.writeFileSync)((0, path_1.join)(root, "yarn.lock"), "");
43121
+ (0, node_fs_1.writeFileSync)((0, node_path_1.join)(root, ".yarnrc.yml"), "nodeLinker: node-modules\nenableScripts: false");
43122
+ (0, node_fs_1.writeFileSync)((0, node_path_1.join)(root, "yarn.lock"), "");
43106
43123
  }
43107
43124
  break;
43108
43125
  }
@@ -43112,7 +43129,7 @@ var require_package_manager = __commonJS({
43112
43129
  if (pmVersionCache.has(packageManager)) {
43113
43130
  return pmVersionCache.get(packageManager);
43114
43131
  }
43115
- const version = (0, child_process_1.execSync)(`${packageManager} --version`, {
43132
+ const version = (0, node_child_process_1.execSync)(`${packageManager} --version`, {
43116
43133
  cwd,
43117
43134
  encoding: "utf-8",
43118
43135
  windowsHide: false
@@ -43121,18 +43138,21 @@ var require_package_manager = __commonJS({
43121
43138
  return version;
43122
43139
  }
43123
43140
  function detectInvokedPackageManager() {
43124
- let detectedPackageManager = "npm";
43125
- const invoker = require.main || process["mainModule"];
43126
- if (!invoker) {
43127
- return detectedPackageManager;
43128
- }
43129
- for (const pkgManager of exports2.packageManagerList) {
43130
- if (invoker.path.includes(pkgManager)) {
43131
- detectedPackageManager = pkgManager;
43132
- break;
43141
+ if (process.env.npm_config_user_agent) {
43142
+ for (const pm of exports2.packageManagerList) {
43143
+ if (process.env.npm_config_user_agent.startsWith(`${pm}/`)) {
43144
+ return pm;
43145
+ }
43133
43146
  }
43134
43147
  }
43135
- return detectedPackageManager;
43148
+ if (process.env.npm_execpath) {
43149
+ for (const pm of exports2.packageManagerList) {
43150
+ if (process.env.npm_execpath.split(node_path_1.sep).includes(pm)) {
43151
+ return pm;
43152
+ }
43153
+ }
43154
+ }
43155
+ return "npm";
43136
43156
  }
43137
43157
  }
43138
43158
  });
@@ -43231,7 +43251,7 @@ var require_package2 = __commonJS({
43231
43251
  "node_modules/create-nx-workspace/package.json"(exports2, module2) {
43232
43252
  module2.exports = {
43233
43253
  name: "create-nx-workspace",
43234
- version: "20.4.6",
43254
+ version: "20.7.0",
43235
43255
  private: false,
43236
43256
  description: "Smart Monorepos \xB7 Fast CI",
43237
43257
  repository: {
@@ -43268,7 +43288,7 @@ var require_package2 = __commonJS({
43268
43288
  tmp: "~0.2.1",
43269
43289
  tslib: "^2.3.0",
43270
43290
  yargs: "^17.6.2",
43271
- axios: "^1.7.4"
43291
+ axios: "^1.8.3"
43272
43292
  },
43273
43293
  publishConfig: {
43274
43294
  access: "public"
@@ -43825,8 +43845,6 @@ var require_preset = __commonJS({
43825
43845
  Preset2["NuxtStandalone"] = "nuxt-standalone";
43826
43846
  Preset2["NextJs"] = "next";
43827
43847
  Preset2["NextJsStandalone"] = "nextjs-standalone";
43828
- Preset2["RemixMonorepo"] = "remix-monorepo";
43829
- Preset2["RemixStandalone"] = "remix-standalone";
43830
43848
  Preset2["ReactNative"] = "react-native";
43831
43849
  Preset2["Expo"] = "expo";
43832
43850
  Preset2["Nest"] = "nest";
@@ -43941,7 +43959,6 @@ var require_create_workspace = __commonJS({
43941
43959
  case preset_1.Preset.Nuxt:
43942
43960
  case preset_1.Preset.ReactNative:
43943
43961
  case preset_1.Preset.ReactMonorepo:
43944
- case preset_1.Preset.RemixMonorepo:
43945
43962
  case preset_1.Preset.VueMonorepo:
43946
43963
  case preset_1.Preset.WebComponents:
43947
43964
  return ["apps/*"];
@@ -67981,7 +67998,7 @@ var deepMerge = deepmergeCustom({
67981
67998
  // packages/kong-ts/src/lib/tenant.ts
67982
67999
  function parseTenant(url2) {
67983
68000
  const hostname = new URL(url2).hostname;
67984
- return hostname === "localhost" ? "dev" : hostname.split(".")[1];
68001
+ return hostname === "localhost" ? "dev" : hostname.split(".")[0];
67985
68002
  }
67986
68003
 
67987
68004
  // packages/kong-ts/src/lib/url.ts
@@ -68012,7 +68029,7 @@ var isDownKey = (key) => (
68012
68029
  );
68013
68030
  var isSpaceKey = (key) => key.name === "space";
68014
68031
  var isBackspaceKey = (key) => key.name === "backspace";
68015
- var isNumberKey = (key) => "123456789".includes(key.name);
68032
+ var isNumberKey = (key) => "1234567890".includes(key.name);
68016
68033
  var isEnterKey = (key) => key.name === "enter" || key.name === "return";
68017
68034
 
68018
68035
  // node_modules/@inquirer/core/dist/esm/lib/errors.js
@@ -68950,13 +68967,12 @@ function cursorDown(n) {
68950
68967
  return n > 0 ? import_ansi_escapes.default.cursorDown(n) : "";
68951
68968
  }
68952
68969
  var ScreenManager = class {
68953
- rl;
68954
68970
  // These variables are keeping information to allow correct prompt re-rendering
68955
68971
  height = 0;
68956
68972
  extraLinesUnderPrompt = 0;
68957
68973
  cursorPos;
68974
+ rl;
68958
68975
  constructor(rl) {
68959
- this.rl = rl;
68960
68976
  this.rl = rl;
68961
68977
  this.cursorPos = rl.getCursorPos();
68962
68978
  }
@@ -69025,22 +69041,22 @@ var PromisePolyfill = class extends Promise {
69025
69041
  // node_modules/@inquirer/core/dist/esm/lib/create-prompt.js
69026
69042
  function getCallSites() {
69027
69043
  const _prepareStackTrace = Error.prepareStackTrace;
69044
+ let result = [];
69028
69045
  try {
69029
- let result = [];
69030
69046
  Error.prepareStackTrace = (_2, callSites) => {
69031
69047
  const callSitesWithoutCurrent = callSites.slice(1);
69032
69048
  result = callSitesWithoutCurrent;
69033
69049
  return callSitesWithoutCurrent;
69034
69050
  };
69035
69051
  new Error().stack;
69052
+ } catch {
69036
69053
  return result;
69037
- } finally {
69038
- Error.prepareStackTrace = _prepareStackTrace;
69039
69054
  }
69055
+ Error.prepareStackTrace = _prepareStackTrace;
69056
+ return result;
69040
69057
  }
69041
69058
  function createPrompt(view) {
69042
69059
  const callSites = getCallSites();
69043
- const callerFilename = callSites[1]?.getFileName?.();
69044
69060
  const prompt2 = (config, context = {}) => {
69045
69061
  const { input = process.stdin, signal } = context;
69046
69062
  const cleanups = /* @__PURE__ */ new Set();
@@ -69079,6 +69095,7 @@ function createPrompt(view) {
69079
69095
  setImmediate(() => resolve2(value));
69080
69096
  });
69081
69097
  if (nextView === void 0) {
69098
+ const callerFilename = callSites[1]?.getFileName?.();
69082
69099
  throw new Error(`Prompt functions must return a string.
69083
69100
  at ${callerFilename}`);
69084
69101
  }
@@ -69955,7 +69972,8 @@ var selectTheme = {
69955
69972
  disabled: (text) => import_yoctocolors_cjs7.default.dim(`- ${text}`),
69956
69973
  description: (text) => import_yoctocolors_cjs7.default.cyan(text)
69957
69974
  },
69958
- helpMode: "auto"
69975
+ helpMode: "auto",
69976
+ indexMode: "hidden"
69959
69977
  };
69960
69978
  function isSelectable3(item) {
69961
69979
  return !Separator.isSeparator(item) && !item.disabled;
@@ -70020,13 +70038,15 @@ var esm_default11 = createPrompt((config, done) => {
70020
70038
  } while (!isSelectable3(items[next]));
70021
70039
  setActive(next);
70022
70040
  }
70023
- } else if (isNumberKey(key)) {
70024
- rl.clearLine(0);
70025
- const position = Number(key.name) - 1;
70041
+ } else if (isNumberKey(key) && !Number.isNaN(Number(rl.line))) {
70042
+ const position = Number(rl.line) - 1;
70026
70043
  const item = items[position];
70027
70044
  if (item != null && isSelectable3(item)) {
70028
70045
  setActive(position);
70029
70046
  }
70047
+ searchTimeoutRef.current = setTimeout(() => {
70048
+ rl.clearLine(0);
70049
+ }, 700);
70030
70050
  } else if (isBackspaceKey(key)) {
70031
70051
  rl.clearLine(0);
70032
70052
  } else {
@@ -70062,17 +70082,18 @@ ${theme.style.help("(Use arrow keys to reveal more choices)")}`;
70062
70082
  const page = usePagination({
70063
70083
  items,
70064
70084
  active,
70065
- renderItem({ item, isActive }) {
70085
+ renderItem({ item, isActive, index }) {
70066
70086
  if (Separator.isSeparator(item)) {
70067
70087
  return ` ${item.separator}`;
70068
70088
  }
70089
+ const indexLabel = theme.indexMode === "number" ? `${index + 1}. ` : "";
70069
70090
  if (item.disabled) {
70070
70091
  const disabledLabel = typeof item.disabled === "string" ? item.disabled : "(disabled)";
70071
- return theme.style.disabled(`${item.name} ${disabledLabel}`);
70092
+ return theme.style.disabled(`${indexLabel}${item.name} ${disabledLabel}`);
70072
70093
  }
70073
70094
  const color2 = isActive ? theme.style.highlight : (x) => x;
70074
70095
  const cursor = isActive ? theme.icon.cursor : ` `;
70075
- return color2(`${cursor} ${item.name}`);
70096
+ return color2(`${cursor} ${indexLabel}${item.name}`);
70076
70097
  },
70077
70098
  pageSize,
70078
70099
  loop
@@ -71624,7 +71645,7 @@ function combineURLs(baseURL, relativeURL) {
71624
71645
  // node_modules/axios/lib/core/buildFullPath.js
71625
71646
  function buildFullPath(baseURL, requestedURL, allowAbsoluteUrls) {
71626
71647
  let isRelativeUrl = !isAbsoluteURL(requestedURL);
71627
- if (baseURL && isRelativeUrl || allowAbsoluteUrls == false) {
71648
+ if (baseURL && (isRelativeUrl || allowAbsoluteUrls == false)) {
71628
71649
  return combineURLs(baseURL, requestedURL);
71629
71650
  }
71630
71651
  return requestedURL;
@@ -71639,7 +71660,7 @@ var import_follow_redirects = __toESM(require_follow_redirects(), 1);
71639
71660
  var import_zlib = __toESM(require("zlib"), 1);
71640
71661
 
71641
71662
  // node_modules/axios/lib/env/data.js
71642
- var VERSION = "1.8.1";
71663
+ var VERSION = "1.8.4";
71643
71664
 
71644
71665
  // node_modules/axios/lib/helpers/parseProtocol.js
71645
71666
  function parseProtocol(url2) {
@@ -72177,7 +72198,7 @@ var http_default = isHttpAdapterSupported && function httpAdapter(config) {
72177
72198
  config.signal.aborted ? abort() : config.signal.addEventListener("abort", abort);
72178
72199
  }
72179
72200
  }
72180
- const fullPath = buildFullPath(config.baseURL, config.url);
72201
+ const fullPath = buildFullPath(config.baseURL, config.url, config.allowAbsoluteUrls);
72181
72202
  const parsed = new URL(fullPath, platform_default.hasBrowserEnv ? platform_default.origin : void 0);
72182
72203
  const protocol = parsed.protocol || supportedProtocols[0];
72183
72204
  if (protocol === "data:") {
@@ -72669,7 +72690,7 @@ var resolveConfig_default = (config) => {
72669
72690
  const newConfig = mergeConfig({}, config);
72670
72691
  let { data, withXSRFToken, xsrfHeaderName, xsrfCookieName, headers: headers2, auth } = newConfig;
72671
72692
  newConfig.headers = headers2 = AxiosHeaders_default.from(headers2);
72672
- newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url), config.params, config.paramsSerializer);
72693
+ newConfig.url = buildURL(buildFullPath(newConfig.baseURL, newConfig.url, newConfig.allowAbsoluteUrls), config.params, config.paramsSerializer);
72673
72694
  if (auth) {
72674
72695
  headers2.set(
72675
72696
  "Authorization",
@@ -74635,12 +74656,6 @@ var KONG_JSON_SCHEMA = {
74635
74656
  name: {
74636
74657
  type: "string"
74637
74658
  },
74638
- ownership: {
74639
- type: "array",
74640
- items: {
74641
- type: "string"
74642
- }
74643
- },
74644
74659
  sdk: {
74645
74660
  type: "string",
74646
74661
  enum: ["python", "kotlin"]
@@ -74733,24 +74748,6 @@ var KONG_JSON_SCHEMA = {
74733
74748
  }
74734
74749
  },
74735
74750
  required: ["enabled", "requestVolumeThreshold", "failureRatio", "successThreshold"]
74736
- },
74737
- rateLimiter: {
74738
- type: "object",
74739
- properties: {
74740
- enabled: {
74741
- type: "boolean"
74742
- },
74743
- value: {
74744
- type: "number"
74745
- },
74746
- window: {
74747
- type: "string"
74748
- },
74749
- minSpacing: {
74750
- type: "string"
74751
- }
74752
- },
74753
- required: ["enabled", "value", "window", "minSpacing"]
74754
74751
  }
74755
74752
  }
74756
74753
  }
@@ -74759,7 +74756,7 @@ var KONG_JSON_SCHEMA = {
74759
74756
  }
74760
74757
  },
74761
74758
  additionalProperties: false,
74762
- required: ["id", "name", "ownership", "sdk"]
74759
+ required: ["id", "name", "sdk"]
74763
74760
  };
74764
74761
 
74765
74762
  // packages/kong-cli/src/common/kongJson.ts
@@ -74792,11 +74789,6 @@ function validateKongJson(kongJson) {
74792
74789
  "The `name` should only contain lowercase letters, digits, and dashes. Dashes can only appear between alphanumeric characters, and the name cannot start or end with a dash.Please provide a valid name in kong.json."
74793
74790
  );
74794
74791
  }
74795
- if (kongJson.ownership.length === 0) {
74796
- throw new AppError(
74797
- "The `ownership` field should contain at least one user name. Please provide valid ownership information in kong.json."
74798
- );
74799
- }
74800
74792
  const isValid2 = validate2(kongJson);
74801
74793
  if (!isValid2) {
74802
74794
  throw new AppError(
@@ -74827,7 +74819,6 @@ var GenerateCommand = class {
74827
74819
  id,
74828
74820
  sdk,
74829
74821
  name: extensionName,
74830
- ownership: ["devkong"],
74831
74822
  alias: {}
74832
74823
  });
74833
74824
  await (0, import_create_nx_workspace.createWorkspace)(`@devkong/cli-nx@${presetVersion}`, {
@@ -77744,7 +77735,7 @@ var PublishVersionCommand = class {
77744
77735
  version: Number(ctx.publishDetails.imageVersion),
77745
77736
  notes,
77746
77737
  created: utcNow(DEFAULT_TIMEZONE),
77747
- createdBy: kongJson.ownership.at(0)
77738
+ createdBy: ""
77748
77739
  };
77749
77740
  await this.managementClient.createExtensionSnapshot(kongJson.id, kongJson.name, snapshot);
77750
77741
  task.output = `The version ${ctx.publishDetails.imageVersion} has been successfully published!`;
@@ -77784,7 +77775,7 @@ var PublicClient = class {
77784
77775
  this.baseUrl = joinUrlAndPath(baseUrl, "/api/public");
77785
77776
  }
77786
77777
  async assignExtensionAlias(extensionId, alias) {
77787
- const url2 = joinUrlAndPath(this.baseUrl, "v1/extensions/aliases");
77778
+ const url2 = joinUrlAndPath(this.baseUrl, `v1/extensions/${extensionId}/aliases`);
77788
77779
  await axios_default.post(url2, alias, await this.headerProvider());
77789
77780
  }
77790
77781
  };
@@ -77827,7 +77818,6 @@ var SetAliasCommand = class {
77827
77818
  title: "Assign extension alias",
77828
77819
  task: async (ctx, task) => {
77829
77820
  const now = utcNow(DEFAULT_TIMEZONE);
77830
- const owner = ctx.kongJson.ownership[0];
77831
77821
  const aliasUse = {
77832
77822
  snapshot: ctx.snapshot,
77833
77823
  balance: 100,
@@ -77844,9 +77834,9 @@ var SetAliasCommand = class {
77844
77834
  outputSchema: ctx.kongJson.alias?.output?.schema,
77845
77835
  invoke: ctx.kongJson.alias?.invoke,
77846
77836
  created: now,
77847
- createdBy: owner,
77837
+ createdBy: "",
77848
77838
  updated: now,
77849
- updatedBy: owner
77839
+ updatedBy: ""
77850
77840
  };
77851
77841
  await this.publicClient.assignExtensionAlias(ctx.kongJson.id, alias);
77852
77842
  task.output = "Please wait a moment for it to appear in the UI.";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@devkong/cli",
3
- "version": "0.0.26",
3
+ "version": "0.0.27",
4
4
  "type": "commonjs",
5
5
  "main": "./index.js",
6
6
  "typings": "./index.d.ts",
@@ -1,3 +1,4 @@
1
+ import { AppExtension } from "@kong/contract";
1
2
  export declare class GenerateCommand {
2
- execute(extensionName: string, sdk: "kotlin" | "python", presetVersion: string): Promise<void>;
3
+ execute(extensionName: AppExtension["name"], sdk: "kotlin" | "python", presetVersion: string): Promise<void>;
3
4
  }
@@ -1,10 +1,8 @@
1
1
  import { AppExtension, AppExtensionSnapshotDetails, SdkExtensionAlias } from "@kong/contract";
2
- import { User } from "@kong/ts";
3
2
  export interface KongJson {
4
3
  id: AppExtension["id"];
5
4
  sdk: AppExtensionSnapshotDetails["sdk"];
6
5
  name: AppExtension["name"];
7
- ownership: [User["name"], ...Array<User["name"]>];
8
6
  alias?: SdkExtensionAlias;
9
7
  }
10
8
  export declare function validateKongJson(kongJson: KongJson): KongJson;
@@ -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, KongSpecActionSendEvent, KongSpecAppend, KongSpecBranch, KongSpecCache, KongSpecCallModel, KongSpecCircuitBreaker, KongSpecCondition, KongSpecError, KongSpecEventBroker, KongSpecEventConnection, KongSpecFeatureCompensation, KongSpecFlow, KongSpecFunctionRef, KongSpecHowToInvoke, KongSpecHowToOutput, KongSpecProcessRef, KongSpecRateLimiter, KongSpecRecord, KongSpecRecordHeader, KongSpecRetry, KongSpecState, KongSpecStateCallFunction, KongSpecStateCallProcess, KongSpecStateCompensate, KongSpecStateExit, KongSpecStateFail, KongSpecStateForeach, KongSpecStateInject, KongSpecStateParallel, KongSpecStateSendEvent, KongSpecStateStart, KongSpecStateSucceed, KongSpecStateSwitch, KongSpecStateWaitEvent, KongSpecSupportsActions, KongSpecSupportsErrors, KongSpecSupportsTransition, } from "./lib/kongSpec";
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, KongSpecState, KongSpecStateCallFunction, KongSpecStateCallProcess, KongSpecStateCompensate, KongSpecStateExit, KongSpecStateFail, KongSpecStateForeach, KongSpecStateInject, KongSpecStateParallel, 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";
@@ -1,11 +1,13 @@
1
+ import { SessionTenant } from "@kong/ts";
1
2
  import { Specification, workflowBuilder } from "@severlessworkflow/sdk-typescript";
2
3
  export type FloweyServerlessBuilder = ReturnType<typeof workflowBuilder>;
3
4
  export declare function serverlessFlowBuilder(): FloweyServerlessBuilder;
4
5
  export declare const copyServerlessFlow: (workflow: Specification.Workflow) => Specification.Workflow;
5
6
  export declare function stringifyServerlessFlow(workflow: Specification.Workflow): string;
6
7
  interface ServerlessJavaAppPropsGenerator {
8
+ tenant: SessionTenant;
7
9
  processName: string;
8
10
  events: Specification.Eventdef[];
9
11
  }
10
- export declare function makeServerlessJavaAppProps({ processName, events, }: ServerlessJavaAppPropsGenerator): string;
12
+ export declare function makeServerlessJavaAppProps({ tenant, processName, events, }: ServerlessJavaAppPropsGenerator): string;
11
13
  export {};
@@ -1,10 +1,11 @@
1
- import { BusinessKey, Distinct, RequestId, SessionTenant, UtcDateTime } from "@kong/ts";
1
+ import { BusinessKey, JsonObject, Optional, SessionTenant, TraceParent, UtcDateTime } from "@kong/ts";
2
2
  export declare enum KongSpecSessionAgent {
3
3
  JOB = "JOB"
4
4
  }
5
5
  interface KongSpecSession {
6
- id: Distinct<RequestId["traceId"], "KongSpecSessionId">;
7
6
  agent: KongSpecSessionAgent;
7
+ id: TraceParent;
8
+ parentId: Optional<KongSpecSession["id"]>;
8
9
  created: UtcDateTime;
9
10
  }
10
11
  export declare enum KongSpecJobSessionExecutionMode {
@@ -22,8 +23,9 @@ export interface KongSpecJobSession extends KongSpecSession {
22
23
  businessKey: BusinessKey;
23
24
  source: string;
24
25
  tenant: SessionTenant;
25
- topic: string;
26
26
  partition: number;
27
+ topic: string;
28
+ metadata: JsonObject;
27
29
  priority: KongSpecJobSessionPriority;
28
30
  executionMode: KongSpecJobSessionExecutionMode;
29
31
  deadline: UtcDateTime;
@@ -1,8 +1,16 @@
1
- import { Distinct, Duration8601, JqFilter, JqObject, JqText, JsonArray, JsonObject, Optional, ShortUUID } from "@kong/ts";
1
+ import { Distinct, Duration8601, JqFilter, JqObject, JqText, JsonArray, JsonObject, Optional, SessionTenant, ShortUUID } from "@kong/ts";
2
2
  import { JSONSchema7 } from "json-schema";
3
- export type KongSpecFunctionRef = Distinct<string, "KongSpecFunctionRef">;
4
- export type KongSpecProcessRef = Distinct<string, "KongSpecProcessRef">;
5
3
  export type KongSpecAppend = "list" | "last";
4
+ export interface KongSpecFunctionRef {
5
+ tenant: SessionTenant;
6
+ basedOn: Distinct<string, "KongSpecFunctionRefBasedOn">;
7
+ aliasName: Distinct<string, "KongSpecFunctionRefAliasName">;
8
+ }
9
+ export interface KongSpecProcessRef {
10
+ tenant: SessionTenant;
11
+ basedOn: Distinct<string, "KongSpecProcessRefBasedOn">;
12
+ aliasName: Distinct<string, "KongSpecProcessRefAliasName">;
13
+ }
6
14
  interface KongSpecStateBase {
7
15
  id: Distinct<string, "KongSpecStateId">;
8
16
  name: string;
@@ -34,18 +42,11 @@ export interface KongSpecCircuitBreaker {
34
42
  failureRatio: number;
35
43
  successThreshold: number;
36
44
  }
37
- export interface KongSpecRateLimiter {
38
- enabled: boolean;
39
- value: number;
40
- window: Duration8601;
41
- minSpacing: Duration8601;
42
- }
43
45
  export interface KongSpecHowToInvoke {
44
46
  prefix: string;
45
47
  retry: KongSpecRetry;
46
48
  cache: KongSpecCache;
47
49
  circuitBreaker: KongSpecCircuitBreaker;
48
- rateLimiter: KongSpecRateLimiter;
49
50
  }
50
51
  export interface KongSpecSupportsInvoke {
51
52
  invoke: KongSpecHowToInvoke;
@@ -61,6 +62,16 @@ export interface KongSpecEffectAck {
61
62
  producer: KongSpecEffectProducer;
62
63
  seqNum: number;
63
64
  }
65
+ export declare enum KongSpecEffectStatus {
66
+ FAILED = "FAILED",
67
+ SUCCEEDED = "SUCCEEDED"
68
+ }
69
+ export interface KongSpecEffect {
70
+ status: KongSpecEffectStatus;
71
+ ack: KongSpecEffectAck;
72
+ usage: Record<string, unknown>;
73
+ data: JsonObject | null;
74
+ }
64
75
  export interface KongSpecHowToOutput {
65
76
  ack: KongSpecEffectAck;
66
77
  filter: JqFilter;
@@ -1,4 +1,4 @@
1
- import { Duration8601, JqObject, SessionTenant, Timezone } from "@kong/ts";
1
+ import { JqObject, SessionTenant, Timezone } from "@kong/ts";
2
2
  import { KongSpecJobSession } from "./kongSession";
3
3
  import { KongSpecActionCallFunction, KongSpecActionSendEvent, KongSpecBranch, KongSpecCallModel, KongSpecCondition, KongSpecError, KongSpecEventBroker, KongSpecFlow, KongSpecFunctionRef, KongSpecHowToInvoke, KongSpecHowToOutput, KongSpecProcessRef, KongSpecRecordHeader, KongSpecStateCallFunction, KongSpecStateCallProcess, KongSpecStateCompensate, KongSpecStateFail, KongSpecStateForeach, KongSpecStateInject, KongSpecStateParallel, KongSpecStateSendEvent, KongSpecStateStart, KongSpecStateSucceed, KongSpecStateSwitch, KongSpecStateWaitEvent } from "./kongSpec";
4
4
  export declare class KongSpecBuild {
@@ -26,12 +26,6 @@ export declare class KongSpecBuild {
26
26
  invoke(overrides?: Partial<KongSpecHowToInvoke>): KongSpecHowToInvoke;
27
27
  retry(overrides?: Partial<KongSpecHowToInvoke["retry"]>): KongSpecHowToInvoke["retry"];
28
28
  circuitBreaker(overrides?: Partial<KongSpecHowToInvoke["circuitBreaker"]>): KongSpecHowToInvoke["circuitBreaker"];
29
- rateLimiter(overrides?: Partial<KongSpecHowToInvoke["rateLimiter"]>): {
30
- enabled: boolean;
31
- value: number;
32
- window: Duration8601;
33
- minSpacing: Duration8601;
34
- };
35
29
  cache(overrides?: Partial<KongSpecHowToInvoke["cache"]>): KongSpecHowToInvoke["cache"];
36
30
  callModel(payload: JqObject): KongSpecCallModel;
37
31
  session(tenant: SessionTenant, timezone: Timezone, overrides?: Partial<KongSpecJobSession>): KongSpecJobSession;
@@ -1,11 +1,13 @@
1
- import { Optional } from "@kong/ts";
2
- import { KongSpecAction, KongSpecBranch, KongSpecCondition, KongSpecError, KongSpecState } from "./kongSpec";
1
+ import { Optional, SessionTenant } from "@kong/ts";
2
+ import { KongSpecAction, KongSpecBranch, KongSpecCondition, KongSpecError, KongSpecFunctionRef, KongSpecProcessRef, KongSpecState } from "./kongSpec";
3
3
  export declare class KongSpecRef {
4
4
  static newStateId(): KongSpecState["id"];
5
5
  static newConditionId(): KongSpecCondition["id"];
6
6
  static newBranchId(): KongSpecBranch["id"];
7
7
  static newErrorId(): KongSpecError["id"];
8
8
  static newActionId(): KongSpecAction["id"];
9
+ static functionRef(tenant: SessionTenant, basedOn: string, aliasName: string): KongSpecFunctionRef;
10
+ static processRef(tenant: SessionTenant, basedOn: string, aliasName: string): KongSpecProcessRef;
9
11
  }
10
12
  export interface KongSpecStatePath {
11
13
  stateRef: KongSpecState["id"];
@@ -1,11 +1,11 @@
1
1
  import { SessionTenant } from "@kong/ts";
2
2
  import { Specification } from "@severlessworkflow/sdk-typescript";
3
3
  import { JSONSchema7 } from "json-schema";
4
- import { KongSpecFlow } from "./kongSpec";
4
+ import { KongSpecFlow, KongSpecProcessRef } from "./kongSpec";
5
5
  import { KongSpecEnv } from "./kongSpecEnv";
6
6
  interface ConvertSpecToServerlessResult {
7
7
  workflow: Specification.Workflow;
8
8
  inputSchema: JSONSchema7;
9
9
  }
10
- export declare function convertSpecToServerless(type: "main", tenant: SessionTenant, processName: string, specFlow: KongSpecFlow, env: KongSpecEnv): ConvertSpecToServerlessResult;
10
+ export declare function convertSpecToServerless(type: "main", tenant: SessionTenant, specFlow: KongSpecFlow, aliasName: KongSpecProcessRef["aliasName"], env: KongSpecEnv): ConvertSpecToServerlessResult;
11
11
  export {};
@@ -21,8 +21,8 @@ export { insertItem, moveItem, unique } from "./lib/list";
21
21
  export { deepMerge, deepMergeAll } from "./lib/merge";
22
22
  export { deepDeleteKeys } from "./lib/normalize";
23
23
  export { retry } from "./lib/retry";
24
- export { fromRequestId, newRequestId } from "./lib/telemetry";
25
- export type { RequestId } from "./lib/telemetry";
24
+ export { fromRequestId, generateTraceParent, newRequestId } from "./lib/telemetry";
25
+ export type { RequestId, TraceParent } from "./lib/telemetry";
26
26
  export { parseTenant } from "./lib/tenant";
27
27
  export type { SessionTenant } from "./lib/tenant";
28
28
  export { byteCount, camelize, escapeLikeText, escapeQuotes, escapeRegex, hashString, quote, removeOuterQuotes, replaceFirstOccurrence, splitToBlocks, trim, upperFirst, words, } from "./lib/text";
@@ -1,4 +1,5 @@
1
- import { CompactUUID16, CompactUUID32 } from "@kong/ts";
1
+ import { CompactUUID16, CompactUUID32, Distinct } from "@kong/ts";
2
+ export type TraceParent = Distinct<string, "TraceParent">;
2
3
  export interface RequestId {
3
4
  traceId: CompactUUID32;
4
5
  spanId: CompactUUID16;
@@ -6,3 +7,4 @@ export interface RequestId {
6
7
  }
7
8
  export declare function newRequestId(tags?: string[]): RequestId;
8
9
  export declare function fromRequestId(source: RequestId, tags?: string[]): RequestId;
10
+ export declare function generateTraceParent(sampled?: boolean): TraceParent;
@@ -22,3 +22,4 @@ export type { AppTestCaseMatchFeature } from "./lib/appTestCaseMatchFeature";
22
22
  export type { AppTestResult } from "./lib/appTestResult";
23
23
  export type { AppWorkspace } from "./lib/appWorkspace";
24
24
  export type { SdkExtensionAlias } from "./lib/sdkExtensionAlias";
25
+ export type { SdkConcurrencyQuota, SdkQuotaName, SdkRateLimiterQuota } from "./lib/sdkQuota";
@@ -1,9 +1,10 @@
1
+ import { KongSpecFunctionRef, KongSpecProcessRef } from "@kong/spec";
1
2
  import { Entity, ShortUUID, User, UtcDateTime } from "@kong/ts";
2
3
  export interface AppAlias<T> extends Entity {
3
- name: string;
4
- use: T[];
4
+ name: KongSpecProcessRef["aliasName"] | KongSpecFunctionRef["aliasName"];
5
5
  basedOnId: ShortUUID;
6
- basedOnName: string;
6
+ basedOnName: KongSpecProcessRef["basedOn"] | KongSpecFunctionRef["basedOn"];
7
+ use: T[];
7
8
  created: UtcDateTime;
8
9
  updated: UtcDateTime;
9
10
  createdBy: User["name"];
@@ -1,7 +1,8 @@
1
+ import { KongSpecFunctionRef } from "@kong/spec";
1
2
  import { Entity, ShortUUID, User, UtcDateTime } from "@kong/ts";
2
3
  export interface AppExtension extends Entity {
3
4
  id: ShortUUID;
4
- name: string;
5
+ name: KongSpecFunctionRef["basedOn"];
5
6
  deprecated: boolean;
6
7
  created: UtcDateTime;
7
8
  updated: UtcDateTime;
@@ -1,3 +1,10 @@
1
+ import { KongSpecFunctionRef } from "@kong/spec";
2
+ import { JsonObject } from "@kong/ts";
1
3
  import { AppAlias } from "./appAlias";
2
4
  import { AppExtensionAliasUse } from "./appExtensionAliasUse";
3
- export type AppExtensionAlias = AppAlias<AppExtensionAliasUse>;
5
+ import { SdkQuotaName } from "./sdkQuota";
6
+ export type AppExtensionAlias = AppAlias<AppExtensionAliasUse> & {
7
+ name: KongSpecFunctionRef["aliasName"];
8
+ basedOnName: KongSpecFunctionRef["basedOn"];
9
+ quotas?: Record<SdkQuotaName, JsonObject>;
10
+ };
@@ -1,8 +1,10 @@
1
- import { KongSpecHowToInvoke } from "@kong/spec";
1
+ import { KongSpecFunctionRef, KongSpecHowToInvoke } from "@kong/spec";
2
2
  import { AppAlias } from "./appAlias";
3
3
  import { AppExtensionAliasUseDetails } from "./appExtensionAliasUseDetails";
4
4
  import { SdkExtensionAlias } from "./sdkExtensionAlias";
5
5
  export interface AppExtensionAliasDetails extends AppAlias<AppExtensionAliasUseDetails> {
6
+ name: KongSpecFunctionRef["aliasName"];
7
+ basedOnName: KongSpecFunctionRef["basedOn"];
6
8
  inputSchema?: NonNullable<SdkExtensionAlias["input"]>["schema"];
7
9
  outputSchema?: NonNullable<SdkExtensionAlias["output"]>["schema"];
8
10
  invoke?: Partial<KongSpecHowToInvoke>;
@@ -1,3 +1,7 @@
1
+ import { KongSpecProcessRef } from "@kong/spec";
1
2
  import { AppAlias } from "./appAlias";
2
3
  import { AppProcessAliasUse } from "./appProcessAliasUse";
3
- export type AppProcessAlias = AppAlias<AppProcessAliasUse>;
4
+ export type AppProcessAlias = AppAlias<AppProcessAliasUse> & {
5
+ name: KongSpecProcessRef["aliasName"];
6
+ basedOnName: KongSpecProcessRef["basedOn"];
7
+ };
@@ -1,6 +1,7 @@
1
1
  import { KongSpecHowToInvoke } from "@kong/spec";
2
2
  import { JqFilter, JsonObject } from "@kong/ts";
3
3
  import { JSONSchema7 } from "json-schema";
4
+ import { SdkQuotaName } from "./sdkQuota";
4
5
  interface SdkExtensionAliasInput {
5
6
  filter: JqFilter;
6
7
  schema: JSONSchema7;
@@ -13,6 +14,7 @@ export interface SdkExtensionAlias {
13
14
  input?: SdkExtensionAliasInput;
14
15
  output?: SdkExtensionAliasOutput;
15
16
  invoke?: KongSpecHowToInvoke;
17
+ quotas?: Record<SdkQuotaName, JsonObject>;
16
18
  env?: JsonObject;
17
19
  }
18
20
  export {};
@@ -0,0 +1,11 @@
1
+ import { Distinct, Duration8601 } from "@kong/ts";
2
+ export type SdkQuotaName = Distinct<string, "SdkQuotaName">;
3
+ export interface SdkRateLimiterQuota {
4
+ value: number;
5
+ window: Duration8601;
6
+ minSpacing: Duration8601;
7
+ }
8
+ export interface SdkConcurrencyQuota {
9
+ minValue: number;
10
+ maxValue: number;
11
+ }