windmill-cli 1.814.0 → 1.815.0

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.
Files changed (2) hide show
  1. package/esm/main.js +1050 -494
  2. package/package.json +2 -2
package/esm/main.js CHANGED
@@ -16766,7 +16766,7 @@ var init_OpenAPI = __esm(() => {
16766
16766
  PASSWORD: undefined,
16767
16767
  TOKEN: getEnv3("WM_TOKEN"),
16768
16768
  USERNAME: undefined,
16769
- VERSION: "1.814.0",
16769
+ VERSION: "1.815.0",
16770
16770
  WITH_CREDENTIALS: true,
16771
16771
  interceptors: {
16772
16772
  request: new Interceptors,
@@ -17387,6 +17387,16 @@ var getAuditLog = (data) => {
17387
17387
  body: data.requestBody,
17388
17388
  mediaType: "application/json"
17389
17389
  });
17390
+ }, editInstanceGroups = (data) => {
17391
+ return request(OpenAPI, {
17392
+ method: "POST",
17393
+ url: "/w/{workspace}/workspaces/edit_instance_groups",
17394
+ path: {
17395
+ workspace: data.workspace
17396
+ },
17397
+ body: data.requestBody,
17398
+ mediaType: "application/json"
17399
+ });
17390
17400
  }, editWebhook = (data) => {
17391
17401
  return request(OpenAPI, {
17392
17402
  method: "POST",
@@ -20002,7 +20012,7 @@ var init_auth = __esm(async () => {
20002
20012
  });
20003
20013
 
20004
20014
  // src/core/constants.ts
20005
- var WM_FORK_PREFIX = "wm-fork", VERSION = "1.814.0";
20015
+ var WM_FORK_PREFIX = "wm-fork", VERSION = "1.815.0";
20006
20016
 
20007
20017
  // src/utils/resource_folders.ts
20008
20018
  import { existsSync } from "node:fs";
@@ -28632,108 +28642,6 @@ async function resolveBindPort(requested, flagLabel, log) {
28632
28642
  var BIND_HOST = "0.0.0.0";
28633
28643
  var init_port_probe = () => {};
28634
28644
 
28635
- // node_modules/ws/lib/stream.js
28636
- var require_stream = __commonJS(function(exports, module) {
28637
- var { Duplex } = __require("stream");
28638
- function emitClose(stream) {
28639
- stream.emit("close");
28640
- }
28641
- function duplexOnEnd() {
28642
- if (!this.destroyed && this._writableState.finished) {
28643
- this.destroy();
28644
- }
28645
- }
28646
- function duplexOnError(err) {
28647
- this.removeListener("error", duplexOnError);
28648
- this.destroy();
28649
- if (this.listenerCount("error") === 0) {
28650
- this.emit("error", err);
28651
- }
28652
- }
28653
- function createWebSocketStream(ws, options) {
28654
- let terminateOnDestroy = true;
28655
- const duplex = new Duplex({
28656
- ...options,
28657
- autoDestroy: false,
28658
- emitClose: false,
28659
- objectMode: false,
28660
- writableObjectMode: false
28661
- });
28662
- ws.on("message", function message(msg, isBinary) {
28663
- const data = !isBinary && duplex._readableState.objectMode ? msg.toString() : msg;
28664
- if (!duplex.push(data))
28665
- ws.pause();
28666
- });
28667
- ws.once("error", function error(err) {
28668
- if (duplex.destroyed)
28669
- return;
28670
- terminateOnDestroy = false;
28671
- duplex.destroy(err);
28672
- });
28673
- ws.once("close", function close() {
28674
- if (duplex.destroyed)
28675
- return;
28676
- duplex.push(null);
28677
- });
28678
- duplex._destroy = function(err, callback) {
28679
- if (ws.readyState === ws.CLOSED) {
28680
- callback(err);
28681
- process.nextTick(emitClose, duplex);
28682
- return;
28683
- }
28684
- let called = false;
28685
- ws.once("error", function error(err) {
28686
- called = true;
28687
- callback(err);
28688
- });
28689
- ws.once("close", function close() {
28690
- if (!called)
28691
- callback(err);
28692
- process.nextTick(emitClose, duplex);
28693
- });
28694
- if (terminateOnDestroy)
28695
- ws.terminate();
28696
- };
28697
- duplex._final = function(callback) {
28698
- if (ws.readyState === ws.CONNECTING) {
28699
- ws.once("open", function open() {
28700
- duplex._final(callback);
28701
- });
28702
- return;
28703
- }
28704
- if (ws._socket === null)
28705
- return;
28706
- if (ws._socket._writableState.finished) {
28707
- callback();
28708
- if (duplex._readableState.endEmitted)
28709
- duplex.destroy();
28710
- } else {
28711
- ws._socket.once("finish", function finish() {
28712
- callback();
28713
- });
28714
- ws.close();
28715
- }
28716
- };
28717
- duplex._read = function() {
28718
- if (ws.isPaused)
28719
- ws.resume();
28720
- };
28721
- duplex._write = function(chunk, encoding, callback) {
28722
- if (ws.readyState === ws.CONNECTING) {
28723
- ws.once("open", function open() {
28724
- duplex._write(chunk, encoding, callback);
28725
- });
28726
- return;
28727
- }
28728
- ws.send(chunk, callback);
28729
- };
28730
- duplex.on("end", duplexOnEnd);
28731
- duplex.on("error", duplexOnError);
28732
- return duplex;
28733
- }
28734
- module.exports = createWebSocketStream;
28735
- });
28736
-
28737
28645
  // node_modules/ws/lib/constants.js
28738
28646
  var require_constants = __commonJS(function(exports, module) {
28739
28647
  var BINARY_TYPES = ["nodebuffer", "arraybuffer", "fragments"];
@@ -28742,6 +28650,7 @@ var require_constants = __commonJS(function(exports, module) {
28742
28650
  BINARY_TYPES.push("blob");
28743
28651
  module.exports = {
28744
28652
  BINARY_TYPES,
28653
+ CLOSE_TIMEOUT: 30000,
28745
28654
  EMPTY_BUFFER: Buffer.alloc(0),
28746
28655
  GUID: "258EAFA5-E914-47DA-95CA-C5AB0DC85B11",
28747
28656
  hasBlob,
@@ -28879,11 +28788,11 @@ var require_permessage_deflate = __commonJS(function(exports, module) {
28879
28788
  var zlibLimiter;
28880
28789
 
28881
28790
  class PerMessageDeflate {
28882
- constructor(options, isServer, maxPayload) {
28883
- this._maxPayload = maxPayload | 0;
28791
+ constructor(options) {
28884
28792
  this._options = options || {};
28885
28793
  this._threshold = this._options.threshold !== undefined ? this._options.threshold : 1024;
28886
- this._isServer = !!isServer;
28794
+ this._maxPayload = this._options.maxPayload | 0;
28795
+ this._isServer = !!this._options.isServer;
28887
28796
  this._deflate = null;
28888
28797
  this._inflate = null;
28889
28798
  this.params = null;
@@ -28935,7 +28844,7 @@ var require_permessage_deflate = __commonJS(function(exports, module) {
28935
28844
  acceptAsServer(offers) {
28936
28845
  const opts = this._options;
28937
28846
  const accepted = offers.find((params) => {
28938
- if (opts.serverNoContextTakeover === false && params.server_no_context_takeover || params.server_max_window_bits && (opts.serverMaxWindowBits === false || typeof opts.serverMaxWindowBits === "number" && opts.serverMaxWindowBits > params.server_max_window_bits) || typeof opts.clientMaxWindowBits === "number" && !params.client_max_window_bits) {
28847
+ if (opts.serverNoContextTakeover === false && params.server_no_context_takeover || params.server_max_window_bits && (opts.serverMaxWindowBits === false || typeof opts.serverMaxWindowBits === "number" && opts.serverMaxWindowBits > params.server_max_window_bits) || typeof opts.clientMaxWindowBits === "number" && (typeof params.client_max_window_bits === "number" ? opts.clientMaxWindowBits > params.client_max_window_bits : !params.client_max_window_bits)) {
28939
28848
  return false;
28940
28849
  }
28941
28850
  return true;
@@ -29118,6 +29027,10 @@ var require_permessage_deflate = __commonJS(function(exports, module) {
29118
29027
  }
29119
29028
  function inflateOnError(err) {
29120
29029
  this[kPerMessageDeflate]._inflate = null;
29030
+ if (this[kError]) {
29031
+ this[kCallback](this[kError]);
29032
+ return;
29033
+ }
29121
29034
  err[kStatusCode] = 1007;
29122
29035
  this[kCallback](err);
29123
29036
  }
@@ -29338,6 +29251,8 @@ var require_receiver = __commonJS(function(exports, module) {
29338
29251
  this._binaryType = options.binaryType || BINARY_TYPES[0];
29339
29252
  this._extensions = options.extensions || {};
29340
29253
  this._isServer = !!options.isServer;
29254
+ this._maxBufferedChunks = options.maxBufferedChunks | 0;
29255
+ this._maxFragments = options.maxFragments | 0;
29341
29256
  this._maxPayload = options.maxPayload | 0;
29342
29257
  this._skipUTF8Validation = !!options.skipUTF8Validation;
29343
29258
  this[kWebSocket] = undefined;
@@ -29352,6 +29267,7 @@ var require_receiver = __commonJS(function(exports, module) {
29352
29267
  this._opcode = 0;
29353
29268
  this._totalPayloadLength = 0;
29354
29269
  this._messageLength = 0;
29270
+ this._numFragments = 0;
29355
29271
  this._fragments = [];
29356
29272
  this._errored = false;
29357
29273
  this._loop = false;
@@ -29360,6 +29276,10 @@ var require_receiver = __commonJS(function(exports, module) {
29360
29276
  _write(chunk, encoding, cb) {
29361
29277
  if (this._opcode === 8 && this._state == GET_INFO)
29362
29278
  return cb();
29279
+ if (this._maxBufferedChunks > 0 && this._buffers.length >= this._maxBufferedChunks) {
29280
+ cb(this.createError(RangeError, "Too many buffered chunks", false, 1008, "WS_ERR_TOO_MANY_BUFFERED_PARTS"));
29281
+ return;
29282
+ }
29363
29283
  this._bufferedBytes += chunk.length;
29364
29284
  this._buffers.push(chunk);
29365
29285
  this.startLoop(cb);
@@ -29557,6 +29477,11 @@ var require_receiver = __commonJS(function(exports, module) {
29557
29477
  this.controlMessage(data, cb);
29558
29478
  return;
29559
29479
  }
29480
+ if (this._maxFragments > 0 && ++this._numFragments > this._maxFragments) {
29481
+ const error = this.createError(RangeError, "Too many message fragments", false, 1008, "WS_ERR_TOO_MANY_BUFFERED_PARTS");
29482
+ cb(error);
29483
+ return;
29484
+ }
29560
29485
  if (this._compressed) {
29561
29486
  this._state = INFLATING;
29562
29487
  this.decompress(data, cb);
@@ -29597,6 +29522,7 @@ var require_receiver = __commonJS(function(exports, module) {
29597
29522
  this._totalPayloadLength = 0;
29598
29523
  this._messageLength = 0;
29599
29524
  this._fragmented = 0;
29525
+ this._numFragments = 0;
29600
29526
  this._fragments = [];
29601
29527
  if (this._opcode === 2) {
29602
29528
  let data;
@@ -29695,6 +29621,9 @@ var require_receiver = __commonJS(function(exports, module) {
29695
29621
  var require_sender = __commonJS(function(exports, module) {
29696
29622
  var { Duplex } = __require("stream");
29697
29623
  var { randomFillSync } = __require("crypto");
29624
+ var {
29625
+ types: { isUint8Array }
29626
+ } = __require("util");
29698
29627
  var PerMessageDeflate = require_permessage_deflate();
29699
29628
  var { EMPTY_BUFFER, kWebSocket, NOOP } = require_constants();
29700
29629
  var { isBlob, isValidStatusCode } = require_validation();
@@ -29814,8 +29743,10 @@ var require_sender = __commonJS(function(exports, module) {
29814
29743
  buf.writeUInt16BE(code, 0);
29815
29744
  if (typeof data === "string") {
29816
29745
  buf.write(data, 2);
29817
- } else {
29746
+ } else if (isUint8Array(data)) {
29818
29747
  buf.set(data, 2);
29748
+ } else {
29749
+ throw new TypeError("Second argument must be a string or a Uint8Array");
29819
29750
  }
29820
29751
  }
29821
29752
  const options = {
@@ -30377,6 +30308,7 @@ var require_websocket = __commonJS(function(exports, module) {
30377
30308
  var { isBlob } = require_validation();
30378
30309
  var {
30379
30310
  BINARY_TYPES,
30311
+ CLOSE_TIMEOUT,
30380
30312
  EMPTY_BUFFER,
30381
30313
  GUID,
30382
30314
  kForOnEventAttribute,
@@ -30390,7 +30322,6 @@ var require_websocket = __commonJS(function(exports, module) {
30390
30322
  } = require_event_target();
30391
30323
  var { format, parse } = require_extension();
30392
30324
  var { toBuffer } = require_buffer_util();
30393
- var closeTimeout = 30 * 1000;
30394
30325
  var kAborted = Symbol("kAborted");
30395
30326
  var protocolVersions = [8, 13];
30396
30327
  var readyStates = ["CONNECTING", "OPEN", "CLOSING", "CLOSED"];
@@ -30430,6 +30361,7 @@ var require_websocket = __commonJS(function(exports, module) {
30430
30361
  initAsClient(this, address, protocols, options);
30431
30362
  } else {
30432
30363
  this._autoPong = options.autoPong;
30364
+ this._closeTimeout = options.closeTimeout;
30433
30365
  this._isServer = true;
30434
30366
  }
30435
30367
  }
@@ -30481,6 +30413,8 @@ var require_websocket = __commonJS(function(exports, module) {
30481
30413
  binaryType: this.binaryType,
30482
30414
  extensions: this._extensions,
30483
30415
  isServer: this._isServer,
30416
+ maxBufferedChunks: options.maxBufferedChunks,
30417
+ maxFragments: options.maxFragments,
30484
30418
  maxPayload: options.maxPayload,
30485
30419
  skipUTF8Validation: options.skipUTF8Validation
30486
30420
  });
@@ -30721,7 +30655,10 @@ var require_websocket = __commonJS(function(exports, module) {
30721
30655
  const opts = {
30722
30656
  allowSynchronousEvents: true,
30723
30657
  autoPong: true,
30658
+ closeTimeout: CLOSE_TIMEOUT,
30724
30659
  protocolVersion: protocolVersions[1],
30660
+ maxBufferedChunks: 256 * 1024,
30661
+ maxFragments: 16 * 1024,
30725
30662
  maxPayload: 100 * 1024 * 1024,
30726
30663
  skipUTF8Validation: false,
30727
30664
  perMessageDeflate: true,
@@ -30738,6 +30675,7 @@ var require_websocket = __commonJS(function(exports, module) {
30738
30675
  port: undefined
30739
30676
  };
30740
30677
  websocket._autoPong = opts.autoPong;
30678
+ websocket._closeTimeout = opts.closeTimeout;
30741
30679
  if (!protocolVersions.includes(opts.protocolVersion)) {
30742
30680
  throw new RangeError(`Unsupported protocol version: ${opts.protocolVersion} ` + `(supported versions: ${protocolVersions.join(", ")})`);
30743
30681
  }
@@ -30747,7 +30685,7 @@ var require_websocket = __commonJS(function(exports, module) {
30747
30685
  } else {
30748
30686
  try {
30749
30687
  parsedUrl = new URL2(address);
30750
- } catch (e) {
30688
+ } catch {
30751
30689
  throw new SyntaxError(`Invalid URL: ${address}`);
30752
30690
  }
30753
30691
  }
@@ -30761,7 +30699,7 @@ var require_websocket = __commonJS(function(exports, module) {
30761
30699
  const isIpcUrl = parsedUrl.protocol === "ws+unix:";
30762
30700
  let invalidUrlMessage;
30763
30701
  if (parsedUrl.protocol !== "ws:" && !isSecure && !isIpcUrl) {
30764
- invalidUrlMessage = `The URL's protocol must be one of "ws:", "wss:", ` + '"http:", "https", or "ws+unix:"';
30702
+ invalidUrlMessage = `The URL's protocol must be one of "ws:", "wss:", ` + '"http:", "https:", or "ws+unix:"';
30765
30703
  } else if (isIpcUrl && !parsedUrl.pathname) {
30766
30704
  invalidUrlMessage = "The URL's pathname is empty";
30767
30705
  } else if (parsedUrl.hash) {
@@ -30795,7 +30733,11 @@ var require_websocket = __commonJS(function(exports, module) {
30795
30733
  opts.path = parsedUrl.pathname + parsedUrl.search;
30796
30734
  opts.timeout = opts.handshakeTimeout;
30797
30735
  if (opts.perMessageDeflate) {
30798
- perMessageDeflate = new PerMessageDeflate(opts.perMessageDeflate !== true ? opts.perMessageDeflate : {}, false, opts.maxPayload);
30736
+ perMessageDeflate = new PerMessageDeflate({
30737
+ ...opts.perMessageDeflate,
30738
+ isServer: false,
30739
+ maxPayload: opts.maxPayload
30740
+ });
30799
30741
  opts.headers["Sec-WebSocket-Extensions"] = format({
30800
30742
  [PerMessageDeflate.extensionName]: perMessageDeflate.offer()
30801
30743
  });
@@ -30955,6 +30897,8 @@ var require_websocket = __commonJS(function(exports, module) {
30955
30897
  websocket.setSocket(socket, head, {
30956
30898
  allowSynchronousEvents: opts.allowSynchronousEvents,
30957
30899
  generateMask: opts.generateMask,
30900
+ maxBufferedChunks: opts.maxBufferedChunks,
30901
+ maxFragments: opts.maxFragments,
30958
30902
  maxPayload: opts.maxPayload,
30959
30903
  skipUTF8Validation: opts.skipUTF8Validation
30960
30904
  });
@@ -31076,7 +31020,7 @@ var require_websocket = __commonJS(function(exports, module) {
31076
31020
  }
31077
31021
  }
31078
31022
  function setCloseTimer(websocket) {
31079
- websocket._closeTimer = setTimeout(websocket._socket.destroy.bind(websocket._socket), closeTimeout);
31023
+ websocket._closeTimer = setTimeout(websocket._socket.destroy.bind(websocket._socket), websocket._closeTimeout);
31080
31024
  }
31081
31025
  function socketOnClose() {
31082
31026
  const websocket = this[kWebSocket];
@@ -31084,8 +31028,8 @@ var require_websocket = __commonJS(function(exports, module) {
31084
31028
  this.removeListener("data", socketOnData);
31085
31029
  this.removeListener("end", socketOnEnd);
31086
31030
  websocket._readyState = WebSocket.CLOSING;
31087
- let chunk;
31088
- if (!this._readableState.endEmitted && !websocket._closeFrameReceived && !websocket._receiver._writableState.errorEmitted && (chunk = websocket._socket.read()) !== null) {
31031
+ if (!this._readableState.endEmitted && !websocket._closeFrameReceived && !websocket._receiver._writableState.errorEmitted && this._readableState.length !== 0) {
31032
+ const chunk = this.read(this._readableState.length);
31089
31033
  websocket._receiver.write(chunk);
31090
31034
  }
31091
31035
  websocket._receiver.end();
@@ -31120,6 +31064,109 @@ var require_websocket = __commonJS(function(exports, module) {
31120
31064
  }
31121
31065
  });
31122
31066
 
31067
+ // node_modules/ws/lib/stream.js
31068
+ var require_stream = __commonJS(function(exports, module) {
31069
+ var WebSocket = require_websocket();
31070
+ var { Duplex } = __require("stream");
31071
+ function emitClose(stream) {
31072
+ stream.emit("close");
31073
+ }
31074
+ function duplexOnEnd() {
31075
+ if (!this.destroyed && this._writableState.finished) {
31076
+ this.destroy();
31077
+ }
31078
+ }
31079
+ function duplexOnError(err) {
31080
+ this.removeListener("error", duplexOnError);
31081
+ this.destroy();
31082
+ if (this.listenerCount("error") === 0) {
31083
+ this.emit("error", err);
31084
+ }
31085
+ }
31086
+ function createWebSocketStream(ws, options) {
31087
+ let terminateOnDestroy = true;
31088
+ const duplex = new Duplex({
31089
+ ...options,
31090
+ autoDestroy: false,
31091
+ emitClose: false,
31092
+ objectMode: false,
31093
+ writableObjectMode: false
31094
+ });
31095
+ ws.on("message", function message(msg, isBinary) {
31096
+ const data = !isBinary && duplex._readableState.objectMode ? msg.toString() : msg;
31097
+ if (!duplex.push(data))
31098
+ ws.pause();
31099
+ });
31100
+ ws.once("error", function error(err) {
31101
+ if (duplex.destroyed)
31102
+ return;
31103
+ terminateOnDestroy = false;
31104
+ duplex.destroy(err);
31105
+ });
31106
+ ws.once("close", function close() {
31107
+ if (duplex.destroyed)
31108
+ return;
31109
+ duplex.push(null);
31110
+ });
31111
+ duplex._destroy = function(err, callback) {
31112
+ if (ws.readyState === ws.CLOSED) {
31113
+ callback(err);
31114
+ process.nextTick(emitClose, duplex);
31115
+ return;
31116
+ }
31117
+ let called = false;
31118
+ ws.once("error", function error(err) {
31119
+ called = true;
31120
+ callback(err);
31121
+ });
31122
+ ws.once("close", function close() {
31123
+ if (!called)
31124
+ callback(err);
31125
+ process.nextTick(emitClose, duplex);
31126
+ });
31127
+ if (terminateOnDestroy)
31128
+ ws.terminate();
31129
+ };
31130
+ duplex._final = function(callback) {
31131
+ if (ws.readyState === ws.CONNECTING) {
31132
+ ws.once("open", function open() {
31133
+ duplex._final(callback);
31134
+ });
31135
+ return;
31136
+ }
31137
+ if (ws._socket === null)
31138
+ return;
31139
+ if (ws._socket._writableState.finished) {
31140
+ callback();
31141
+ if (duplex._readableState.endEmitted)
31142
+ duplex.destroy();
31143
+ } else {
31144
+ ws._socket.once("finish", function finish() {
31145
+ callback();
31146
+ });
31147
+ ws.close();
31148
+ }
31149
+ };
31150
+ duplex._read = function() {
31151
+ if (ws.isPaused)
31152
+ ws.resume();
31153
+ };
31154
+ duplex._write = function(chunk, encoding, callback) {
31155
+ if (ws.readyState === ws.CONNECTING) {
31156
+ ws.once("open", function open() {
31157
+ duplex._write(chunk, encoding, callback);
31158
+ });
31159
+ return;
31160
+ }
31161
+ ws.send(chunk, callback);
31162
+ };
31163
+ duplex.on("end", duplexOnEnd);
31164
+ duplex.on("error", duplexOnError);
31165
+ return duplex;
31166
+ }
31167
+ module.exports = createWebSocketStream;
31168
+ });
31169
+
31123
31170
  // node_modules/ws/lib/subprotocol.js
31124
31171
  var require_subprotocol = __commonJS(function(exports, module) {
31125
31172
  var { tokenChars } = require_validation();
@@ -31175,7 +31222,7 @@ var require_websocket_server = __commonJS(function(exports, module) {
31175
31222
  var PerMessageDeflate = require_permessage_deflate();
31176
31223
  var subprotocol = require_subprotocol();
31177
31224
  var WebSocket = require_websocket();
31178
- var { GUID, kWebSocket } = require_constants();
31225
+ var { CLOSE_TIMEOUT, GUID, kWebSocket } = require_constants();
31179
31226
  var keyRegex = /^[+/0-9A-Za-z]{22}==$/;
31180
31227
  var RUNNING = 0;
31181
31228
  var CLOSING = 1;
@@ -31187,11 +31234,14 @@ var require_websocket_server = __commonJS(function(exports, module) {
31187
31234
  options = {
31188
31235
  allowSynchronousEvents: true,
31189
31236
  autoPong: true,
31237
+ maxBufferedChunks: 256 * 1024,
31238
+ maxFragments: 16 * 1024,
31190
31239
  maxPayload: 100 * 1024 * 1024,
31191
31240
  skipUTF8Validation: false,
31192
31241
  perMessageDeflate: false,
31193
31242
  handleProtocols: null,
31194
31243
  clientTracking: true,
31244
+ closeTimeout: CLOSE_TIMEOUT,
31195
31245
  verifyClient: null,
31196
31246
  noServer: false,
31197
31247
  backlog: null,
@@ -31312,9 +31362,11 @@ var require_websocket_server = __commonJS(function(exports, module) {
31312
31362
  abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
31313
31363
  return;
31314
31364
  }
31315
- if (version !== 8 && version !== 13) {
31365
+ if (version !== 13 && version !== 8) {
31316
31366
  const message = "Missing or invalid Sec-WebSocket-Version header";
31317
- abortHandshakeOrEmitwsClientError(this, req, socket, 400, message);
31367
+ abortHandshakeOrEmitwsClientError(this, req, socket, 400, message, {
31368
+ "Sec-WebSocket-Version": "13, 8"
31369
+ });
31318
31370
  return;
31319
31371
  }
31320
31372
  if (!this.shouldHandle(req)) {
@@ -31335,7 +31387,11 @@ var require_websocket_server = __commonJS(function(exports, module) {
31335
31387
  const secWebSocketExtensions = req.headers["sec-websocket-extensions"];
31336
31388
  const extensions = {};
31337
31389
  if (this.options.perMessageDeflate && secWebSocketExtensions !== undefined) {
31338
- const perMessageDeflate = new PerMessageDeflate(this.options.perMessageDeflate, true, this.options.maxPayload);
31390
+ const perMessageDeflate = new PerMessageDeflate({
31391
+ ...this.options.perMessageDeflate,
31392
+ isServer: true,
31393
+ maxPayload: this.options.maxPayload
31394
+ });
31339
31395
  try {
31340
31396
  const offers = extension.parse(secWebSocketExtensions);
31341
31397
  if (offers[PerMessageDeflate.extensionName]) {
@@ -31406,6 +31462,8 @@ var require_websocket_server = __commonJS(function(exports, module) {
31406
31462
  socket.removeListener("error", socketOnError);
31407
31463
  ws.setSocket(socket, head, {
31408
31464
  allowSynchronousEvents: this.options.allowSynchronousEvents,
31465
+ maxBufferedChunks: this.options.maxBufferedChunks,
31466
+ maxFragments: this.options.maxFragments,
31409
31467
  maxPayload: this.options.maxPayload,
31410
31468
  skipUTF8Validation: this.options.skipUTF8Validation
31411
31469
  });
@@ -31453,23 +31511,26 @@ var require_websocket_server = __commonJS(function(exports, module) {
31453
31511
  \r
31454
31512
  ` + message);
31455
31513
  }
31456
- function abortHandshakeOrEmitwsClientError(server, req, socket, code, message) {
31514
+ function abortHandshakeOrEmitwsClientError(server, req, socket, code, message, headers) {
31457
31515
  if (server.listenerCount("wsClientError")) {
31458
31516
  const err = new Error(message);
31459
31517
  Error.captureStackTrace(err, abortHandshakeOrEmitwsClientError);
31460
31518
  server.emit("wsClientError", err, socket, req);
31461
31519
  } else {
31462
- abortHandshake(socket, code, message);
31520
+ abortHandshake(socket, code, message, headers);
31463
31521
  }
31464
31522
  }
31465
31523
  });
31466
31524
 
31467
31525
  // node_modules/ws/wrapper.mjs
31468
- var import_stream, import_receiver, import_sender, import_websocket, import_websocket_server;
31526
+ var import_stream, import_extension, import_permessage_deflate, import_receiver, import_sender, import_subprotocol, import_websocket, import_websocket_server;
31469
31527
  var init_wrapper = __esm(() => {
31470
31528
  import_stream = __toESM(require_stream(), 1);
31529
+ import_extension = __toESM(require_extension(), 1);
31530
+ import_permessage_deflate = __toESM(require_permessage_deflate(), 1);
31471
31531
  import_receiver = __toESM(require_receiver(), 1);
31472
31532
  import_sender = __toESM(require_sender(), 1);
31533
+ import_subprotocol = __toESM(require_subprotocol(), 1);
31473
31534
  import_websocket = __toESM(require_websocket(), 1);
31474
31535
  import_websocket_server = __toESM(require_websocket_server(), 1);
31475
31536
  });
@@ -34108,7 +34169,7 @@ function cacheDir() {
34108
34169
  return path5.join(os3.tmpdir(), "windmill");
34109
34170
  }
34110
34171
  }
34111
- var FALLBACK_VERSION = "0.28.0", cached, inFlight, extractCounter = 0;
34172
+ var FALLBACK_VERSION = "0.28.2", cached, inFlight, extractCounter = 0;
34112
34173
  var init_esbuild_loader = __esm(() => {
34113
34174
  init_tar_stream();
34114
34175
  init_log();
@@ -48317,265 +48378,518 @@ var require_data = __commonJS(function(exports, module) {
48317
48378
  };
48318
48379
  });
48319
48380
 
48320
- // ../windmill-yaml-validator/node_modules/fast-uri/lib/scopedChars.js
48321
- var require_scopedChars = __commonJS(function(exports, module) {
48322
- var HEX = {
48323
- 0: 0,
48324
- 1: 1,
48325
- 2: 2,
48326
- 3: 3,
48327
- 4: 4,
48328
- 5: 5,
48329
- 6: 6,
48330
- 7: 7,
48331
- 8: 8,
48332
- 9: 9,
48333
- a: 10,
48334
- A: 10,
48335
- b: 11,
48336
- B: 11,
48337
- c: 12,
48338
- C: 12,
48339
- d: 13,
48340
- D: 13,
48341
- e: 14,
48342
- E: 14,
48343
- f: 15,
48344
- F: 15
48345
- };
48346
- module.exports = {
48347
- HEX
48348
- };
48349
- });
48350
-
48351
48381
  // ../windmill-yaml-validator/node_modules/fast-uri/lib/utils.js
48352
48382
  var require_utils2 = __commonJS(function(exports, module) {
48353
- var { HEX } = require_scopedChars();
48354
- var IPV4_REG = /^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u;
48355
- function normalizeIPv4(host) {
48356
- if (findToken(host, ".") < 3) {
48357
- return { host, isIPV4: false };
48358
- }
48359
- const matches = host.match(IPV4_REG) || [];
48360
- const [address] = matches;
48361
- if (address) {
48362
- return { host: stripLeadingZeros(address, "."), isIPV4: true };
48363
- } else {
48364
- return { host, isIPV4: false };
48383
+ var isUUID = RegExp.prototype.test.bind(/^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu);
48384
+ var isIPv4 = RegExp.prototype.test.bind(/^(?:(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)\.){3}(?:25[0-5]|2[0-4]\d|1\d{2}|[1-9]\d|\d)$/u);
48385
+ var isPort = RegExp.prototype.test.bind(/^\d*$/u);
48386
+ var isHexPair = RegExp.prototype.test.bind(/^[\da-f]{2}$/iu);
48387
+ var isUnreserved = RegExp.prototype.test.bind(/^[\da-z\-._~]$/iu);
48388
+ var isPathCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/]$/u);
48389
+ var isQueryFragmentCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:@/?]$/u);
48390
+ var isUserinfoCharacter = RegExp.prototype.test.bind(/^[A-Za-z0-9\-._~!$&'()*+,;=:]$/u);
48391
+ var BYTE_HEX = new Array(256);
48392
+ {
48393
+ const HEX_DIGITS = "0123456789ABCDEF";
48394
+ for (let i = 0;i < 256; i++) {
48395
+ BYTE_HEX[i] = "%" + HEX_DIGITS[i >> 4] + HEX_DIGITS[i & 15];
48396
+ }
48397
+ }
48398
+ function percentEncodeNonAscii(cp) {
48399
+ if (cp < 2048) {
48400
+ return BYTE_HEX[192 | cp >> 6] + BYTE_HEX[128 | cp & 63];
48365
48401
  }
48402
+ if (cp < 65536) {
48403
+ return BYTE_HEX[224 | cp >> 12] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
48404
+ }
48405
+ return BYTE_HEX[240 | cp >> 18] + BYTE_HEX[128 | cp >> 12 & 63] + BYTE_HEX[128 | cp >> 6 & 63] + BYTE_HEX[128 | cp & 63];
48366
48406
  }
48367
- function stringArrayToHexStripped(input, keepZero = false) {
48407
+ function stringArrayToHexStripped(input) {
48368
48408
  let acc = "";
48369
- let strip = true;
48370
- for (const c of input) {
48371
- if (HEX[c] === undefined)
48372
- return;
48373
- if (c !== "0" && strip === true)
48374
- strip = false;
48375
- if (!strip)
48376
- acc += c;
48409
+ let code = 0;
48410
+ let i = 0;
48411
+ for (i = 0;i < input.length; i++) {
48412
+ code = input[i].charCodeAt(0);
48413
+ if (code === 48) {
48414
+ continue;
48415
+ }
48416
+ if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {
48417
+ return "";
48418
+ }
48419
+ acc += input[i];
48420
+ break;
48421
+ }
48422
+ for (i += 1;i < input.length; i++) {
48423
+ code = input[i].charCodeAt(0);
48424
+ if (!(code >= 48 && code <= 57 || code >= 65 && code <= 70 || code >= 97 && code <= 102)) {
48425
+ return "";
48426
+ }
48427
+ acc += input[i];
48377
48428
  }
48378
- if (keepZero && acc.length === 0)
48379
- acc = "0";
48380
48429
  return acc;
48381
48430
  }
48382
- function getIPV6(input) {
48383
- let tokenCount = 0;
48384
- const output = { error: false, address: "", zone: "" };
48385
- const address = [];
48386
- const buffer = [];
48387
- let isZone = false;
48388
- let endipv6Encountered = false;
48389
- let endIpv6 = false;
48390
- function consume() {
48391
- if (buffer.length) {
48392
- if (isZone === false) {
48393
- const hex = stringArrayToHexStripped(buffer);
48394
- if (hex !== undefined) {
48395
- address.push(hex);
48396
- } else {
48397
- output.error = true;
48398
- return false;
48399
- }
48431
+ var isHextet = RegExp.prototype.test.bind(/^[\dA-Fa-f]{1,4}$/);
48432
+ var isIPvFuture = RegExp.prototype.test.bind(/^[vV][\dA-Fa-f]+\.[A-Za-z\d\-._~!$&'()*+,;=:]+$/);
48433
+ var isZoneCharacter = RegExp.prototype.test.bind(/^[A-Za-z\d\-._~]$/);
48434
+ var nonSimpleDomain = RegExp.prototype.test.bind(/[^!"$&'()*+,\-.;=_`a-z{}~]/u);
48435
+ function isZoneIdentifier(zone) {
48436
+ if (zone.length === 0)
48437
+ return false;
48438
+ for (let i = 0;i < zone.length; i++) {
48439
+ if (isZoneCharacter(zone[i]))
48440
+ continue;
48441
+ if (zone[i] === "%" && i + 2 < zone.length && isHexPair(zone.slice(i + 1, i + 3))) {
48442
+ i += 2;
48443
+ continue;
48444
+ }
48445
+ return false;
48446
+ }
48447
+ return true;
48448
+ }
48449
+ function compressIPv6ZeroRun(hextets) {
48450
+ let bestStart = -1;
48451
+ let bestLength = 0;
48452
+ let runStart = -1;
48453
+ let runLength = 0;
48454
+ for (let i = 0;i < hextets.length; i++) {
48455
+ if (hextets[i] === "0") {
48456
+ if (runStart === -1)
48457
+ runStart = i;
48458
+ runLength++;
48459
+ if (runLength > bestLength) {
48460
+ bestLength = runLength;
48461
+ bestStart = runStart;
48400
48462
  }
48401
- buffer.length = 0;
48463
+ } else {
48464
+ runStart = -1;
48465
+ runLength = 0;
48402
48466
  }
48403
- return true;
48404
48467
  }
48405
- for (let i = 0;i < input.length; i++) {
48406
- const cursor = input[i];
48407
- if (cursor === "[" || cursor === "]") {
48468
+ if (bestLength < 2)
48469
+ return hextets.join(":");
48470
+ const head = hextets.slice(0, bestStart).join(":");
48471
+ const tail = hextets.slice(bestStart + bestLength).join(":");
48472
+ return head + "::" + tail;
48473
+ }
48474
+ function normalizeIPv6Address(input) {
48475
+ const compression = input.indexOf("::");
48476
+ if (compression !== -1 && input.indexOf("::", compression + 1) !== -1)
48477
+ return;
48478
+ const left = compression === -1 ? input.split(":") : input.slice(0, compression).split(":");
48479
+ const right = compression === -1 ? [] : input.slice(compression + 2).split(":");
48480
+ if (compression !== -1) {
48481
+ if (left.length === 1 && left[0] === "")
48482
+ left.length = 0;
48483
+ if (right.length === 1 && right[0] === "")
48484
+ right.length = 0;
48485
+ }
48486
+ const parts = left.concat(right);
48487
+ let hextetCount = 0;
48488
+ for (let i = 0;i < parts.length; i++) {
48489
+ const part = parts[i];
48490
+ if (part === "")
48491
+ return;
48492
+ if (part.indexOf(".") !== -1) {
48493
+ if (i !== parts.length - 1 || compression !== -1 && right.length === 0 || !isIPv4(part))
48494
+ return;
48495
+ hextetCount += 2;
48408
48496
  continue;
48409
48497
  }
48410
- if (cursor === ":") {
48411
- if (endipv6Encountered === true) {
48412
- endIpv6 = true;
48413
- }
48414
- if (!consume()) {
48498
+ if (!isHextet(part))
48499
+ return;
48500
+ parts[i] = parseInt(part, 16).toString(16);
48501
+ hextetCount++;
48502
+ }
48503
+ if (compression === -1) {
48504
+ if (hextetCount !== 8)
48505
+ return;
48506
+ return compressIPv6ZeroRun(parts);
48507
+ }
48508
+ if (hextetCount >= 8)
48509
+ return;
48510
+ const expanded = parts.slice(0, left.length);
48511
+ for (let i = hextetCount;i < 8; i++)
48512
+ expanded.push("0");
48513
+ for (let i = left.length;i < parts.length; i++)
48514
+ expanded.push(parts[i]);
48515
+ return compressIPv6ZeroRun(expanded);
48516
+ }
48517
+ function normalizeIPv6(host) {
48518
+ const bracketed = host[0] === "[" && host[host.length - 1] === "]";
48519
+ const hasBracket = host[0] === "[" || host[host.length - 1] === "]";
48520
+ if (hasBracket && !bracketed)
48521
+ return { host, isIPV6: false, error: true };
48522
+ let input = bracketed ? host.slice(1, -1) : host;
48523
+ if (bracketed && isIPvFuture(input)) {
48524
+ input = input.toLowerCase();
48525
+ return { host: `[${input}]`, escapedHost: input, isIPV6: false, isIPVFuture: true };
48526
+ }
48527
+ if (findToken(input, ":") < 2) {
48528
+ return { host, isIPV6: false, error: bracketed };
48529
+ }
48530
+ let zoneIdentifier = "";
48531
+ const zoneSeparator = input.indexOf("%");
48532
+ if (zoneSeparator !== -1) {
48533
+ const separatorLength = input.slice(zoneSeparator, zoneSeparator + 3).toLowerCase() === "%25" ? 3 : 1;
48534
+ zoneIdentifier = input.slice(zoneSeparator + separatorLength);
48535
+ if (!isZoneIdentifier(zoneIdentifier))
48536
+ return { host, isIPV6: false, error: true };
48537
+ input = input.slice(0, zoneSeparator);
48538
+ }
48539
+ const address = normalizeIPv6Address(input);
48540
+ if (address === undefined)
48541
+ return { host, isIPV6: false, error: true };
48542
+ return {
48543
+ host: address + (zoneIdentifier ? "%" + zoneIdentifier : ""),
48544
+ escapedHost: address + (zoneIdentifier ? "%25" + zoneIdentifier : ""),
48545
+ isIPV6: true
48546
+ };
48547
+ }
48548
+ function findToken(str, token) {
48549
+ let ind = 0;
48550
+ for (let i = 0;i < str.length; i++) {
48551
+ if (str[i] === token)
48552
+ ind++;
48553
+ }
48554
+ return ind;
48555
+ }
48556
+ function removeDotSegments(path) {
48557
+ let input = path;
48558
+ const output = [];
48559
+ let nextSlash = -1;
48560
+ let len = 0;
48561
+ while (len = input.length) {
48562
+ if (len === 1) {
48563
+ if (input === ".") {
48415
48564
  break;
48416
- }
48417
- tokenCount++;
48418
- address.push(":");
48419
- if (tokenCount > 7) {
48420
- output.error = true;
48565
+ } else if (input === "/") {
48566
+ output.push("/");
48567
+ break;
48568
+ } else {
48569
+ output.push(input);
48421
48570
  break;
48422
48571
  }
48423
- if (i - 1 >= 0 && input[i - 1] === ":") {
48424
- endipv6Encountered = true;
48572
+ } else if (len === 2) {
48573
+ if (input[0] === ".") {
48574
+ if (input[1] === ".") {
48575
+ break;
48576
+ } else if (input[1] === "/") {
48577
+ input = input.slice(2);
48578
+ continue;
48579
+ }
48580
+ } else if (input[0] === "/") {
48581
+ if (input[1] === "." || input[1] === "/") {
48582
+ output.push("/");
48583
+ break;
48584
+ }
48425
48585
  }
48426
- continue;
48427
- } else if (cursor === "%") {
48428
- if (!consume()) {
48586
+ } else if (len === 3) {
48587
+ if (input === "/..") {
48588
+ if (output.length !== 0) {
48589
+ output.pop();
48590
+ }
48591
+ output.push("/");
48429
48592
  break;
48430
48593
  }
48431
- isZone = true;
48594
+ }
48595
+ if (input[0] === ".") {
48596
+ if (input[1] === ".") {
48597
+ if (input[2] === "/") {
48598
+ input = input.slice(3);
48599
+ continue;
48600
+ }
48601
+ } else if (input[1] === "/") {
48602
+ input = input.slice(2);
48603
+ continue;
48604
+ }
48605
+ } else if (input[0] === "/") {
48606
+ if (input[1] === ".") {
48607
+ if (input[2] === "/") {
48608
+ input = input.slice(2);
48609
+ continue;
48610
+ } else if (input[2] === ".") {
48611
+ if (input[3] === "/") {
48612
+ input = input.slice(3);
48613
+ if (output.length !== 0) {
48614
+ output.pop();
48615
+ }
48616
+ continue;
48617
+ }
48618
+ }
48619
+ }
48620
+ }
48621
+ if ((nextSlash = input.indexOf("/", 1)) === -1) {
48622
+ output.push(input);
48623
+ break;
48432
48624
  } else {
48433
- buffer.push(cursor);
48434
- continue;
48625
+ output.push(input.slice(0, nextSlash));
48626
+ input = input.slice(nextSlash);
48435
48627
  }
48436
48628
  }
48437
- if (buffer.length) {
48438
- if (isZone) {
48439
- output.zone = buffer.join("");
48440
- } else if (endIpv6) {
48441
- address.push(buffer.join(""));
48442
- } else {
48443
- address.push(stringArrayToHexStripped(buffer));
48629
+ return output.join("");
48630
+ }
48631
+ var HOST_DELIMS = { "@": "%40", "/": "%2F", "?": "%3F", "#": "%23", ":": "%3A" };
48632
+ var HOST_DELIM_RE = /[@/?#:]/g;
48633
+ var HOST_DELIM_NO_COLON_RE = /[@/?#]/g;
48634
+ function reescapeHostDelimiters(host, isIP) {
48635
+ const re = isIP ? HOST_DELIM_NO_COLON_RE : HOST_DELIM_RE;
48636
+ re.lastIndex = 0;
48637
+ return host.replace(re, (ch) => HOST_DELIMS[ch]);
48638
+ }
48639
+ function normalizePercentEncoding(input, decodeUnreserved = false) {
48640
+ if (input.indexOf("%") === -1) {
48641
+ return input;
48642
+ }
48643
+ let output = "";
48644
+ for (let i = 0;i < input.length; i++) {
48645
+ if (input[i] === "%" && i + 2 < input.length) {
48646
+ const hex = input.slice(i + 1, i + 3);
48647
+ if (isHexPair(hex)) {
48648
+ const normalizedHex = hex.toUpperCase();
48649
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
48650
+ if (decodeUnreserved && isUnreserved(decoded)) {
48651
+ output += decoded;
48652
+ } else {
48653
+ output += "%" + normalizedHex;
48654
+ }
48655
+ i += 2;
48656
+ continue;
48657
+ }
48444
48658
  }
48659
+ output += input[i];
48445
48660
  }
48446
- output.address = address.join("");
48447
48661
  return output;
48448
48662
  }
48449
- function normalizeIPv6(host) {
48450
- if (findToken(host, ":") < 2) {
48451
- return { host, isIPV6: false };
48452
- }
48453
- const ipv6 = getIPV6(host);
48454
- if (!ipv6.error) {
48455
- let newHost = ipv6.address;
48456
- let escapedHost = ipv6.address;
48457
- if (ipv6.zone) {
48458
- newHost += "%" + ipv6.zone;
48459
- escapedHost += "%25" + ipv6.zone;
48460
- }
48461
- return { host: newHost, escapedHost, isIPV6: true };
48462
- } else {
48463
- return { host, isIPV6: false };
48663
+ function normalizePathEncoding(input) {
48664
+ let output = "";
48665
+ for (let i = 0;i < input.length; i++) {
48666
+ const ch = input[i];
48667
+ if (ch === "%" && i + 2 < input.length) {
48668
+ const hex = input.slice(i + 1, i + 3);
48669
+ if (isHexPair(hex)) {
48670
+ const normalizedHex = hex.toUpperCase();
48671
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
48672
+ if (decoded !== "." && isUnreserved(decoded)) {
48673
+ output += decoded;
48674
+ } else {
48675
+ output += "%" + normalizedHex;
48676
+ }
48677
+ i += 2;
48678
+ continue;
48679
+ }
48680
+ }
48681
+ if (isPathCharacter(ch)) {
48682
+ output += ch;
48683
+ } else {
48684
+ const code = input.charCodeAt(i);
48685
+ if (code < 128) {
48686
+ output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
48687
+ } else if (code < 55296 || code > 57343) {
48688
+ output += percentEncodeNonAscii(code);
48689
+ } else if (code <= 56319 && i + 1 < input.length) {
48690
+ const low = input.charCodeAt(i + 1);
48691
+ if (low >= 56320 && low <= 57343) {
48692
+ output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
48693
+ i++;
48694
+ } else {
48695
+ output += percentEncodeNonAscii(65533);
48696
+ }
48697
+ } else {
48698
+ output += percentEncodeNonAscii(65533);
48699
+ }
48700
+ }
48464
48701
  }
48702
+ return output;
48465
48703
  }
48466
- function stripLeadingZeros(str, token) {
48467
- let out = "";
48468
- let skip = true;
48469
- const l = str.length;
48470
- for (let i = 0;i < l; i++) {
48471
- const c = str[i];
48472
- if (c === "0" && skip) {
48473
- if (i + 1 <= l && str[i + 1] === token || i + 1 === l) {
48474
- out += c;
48475
- skip = false;
48704
+ function serializePathEncoding(input, pathNoScheme = false) {
48705
+ let output = "";
48706
+ let firstSegment = pathNoScheme && input[0] !== "/";
48707
+ for (let i = 0;i < input.length; i++) {
48708
+ const ch = input[i];
48709
+ if (ch === "%" && i + 2 < input.length) {
48710
+ const hex = input.slice(i + 1, i + 3);
48711
+ if (isHexPair(hex)) {
48712
+ output += "%" + hex.toUpperCase();
48713
+ i += 2;
48714
+ continue;
48476
48715
  }
48716
+ }
48717
+ if (ch === "/") {
48718
+ firstSegment = false;
48719
+ }
48720
+ if (isPathCharacter(ch) && (ch !== ":" || !firstSegment)) {
48721
+ output += ch;
48477
48722
  } else {
48478
- if (c === token) {
48479
- skip = true;
48723
+ const code = input.charCodeAt(i);
48724
+ if (code < 128) {
48725
+ output += BYTE_HEX[code];
48726
+ } else if (code < 55296 || code > 57343) {
48727
+ output += percentEncodeNonAscii(code);
48728
+ } else if (code <= 56319 && i + 1 < input.length) {
48729
+ const low = input.charCodeAt(i + 1);
48730
+ if (low >= 56320 && low <= 57343) {
48731
+ output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
48732
+ i++;
48733
+ } else {
48734
+ output += percentEncodeNonAscii(65533);
48735
+ }
48480
48736
  } else {
48481
- skip = false;
48737
+ output += percentEncodeNonAscii(65533);
48482
48738
  }
48483
- out += c;
48484
48739
  }
48485
48740
  }
48486
- return out;
48741
+ return output;
48487
48742
  }
48488
- function findToken(str, token) {
48489
- let ind = 0;
48490
- for (let i = 0;i < str.length; i++) {
48491
- if (str[i] === token)
48492
- ind++;
48743
+ function encodeComponent(input, isAllowed) {
48744
+ let output = "";
48745
+ for (let i = 0;i < input.length; i++) {
48746
+ const ch = input[i];
48747
+ if (ch === "%" && i + 2 < input.length) {
48748
+ const hex = input.slice(i + 1, i + 3);
48749
+ if (isHexPair(hex)) {
48750
+ output += "%" + hex.toUpperCase();
48751
+ i += 2;
48752
+ continue;
48753
+ }
48754
+ }
48755
+ if (isAllowed(ch)) {
48756
+ output += ch;
48757
+ } else {
48758
+ const code = input.charCodeAt(i);
48759
+ if (code < 128) {
48760
+ output += BYTE_HEX[code];
48761
+ } else if (code < 55296 || code > 57343) {
48762
+ output += percentEncodeNonAscii(code);
48763
+ } else if (code <= 56319 && i + 1 < input.length) {
48764
+ const low = input.charCodeAt(i + 1);
48765
+ if (low >= 56320 && low <= 57343) {
48766
+ output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
48767
+ i++;
48768
+ } else {
48769
+ output += percentEncodeNonAscii(65533);
48770
+ }
48771
+ } else {
48772
+ output += percentEncodeNonAscii(65533);
48773
+ }
48774
+ }
48493
48775
  }
48494
- return ind;
48776
+ return output;
48495
48777
  }
48496
- var RDS1 = /^\.\.?\//u;
48497
- var RDS2 = /^\/\.(?:\/|$)/u;
48498
- var RDS3 = /^\/\.\.(?:\/|$)/u;
48499
- var RDS5 = /^\/?(?:.|\n)*?(?=\/|$)/u;
48500
- function removeDotSegments(input) {
48501
- const output = [];
48502
- while (input.length) {
48503
- if (input.match(RDS1)) {
48504
- input = input.replace(RDS1, "");
48505
- } else if (input.match(RDS2)) {
48506
- input = input.replace(RDS2, "/");
48507
- } else if (input.match(RDS3)) {
48508
- input = input.replace(RDS3, "/");
48509
- output.pop();
48510
- } else if (input === "." || input === "..") {
48511
- input = "";
48778
+ function encodeUserinfo(input) {
48779
+ return encodeComponent(input, isUserinfoCharacter);
48780
+ }
48781
+ function encodeQuery(input) {
48782
+ return encodeComponent(input, isQueryFragmentCharacter);
48783
+ }
48784
+ function encodeFragment(input) {
48785
+ return encodeComponent(input, isQueryFragmentCharacter);
48786
+ }
48787
+ function isEscapeSafe(cp) {
48788
+ return cp >= 48 && cp <= 57 || cp >= 65 && cp <= 90 || cp >= 97 && cp <= 122 || cp === 42 || cp === 43 || cp === 45 || cp === 46 || cp === 47 || cp === 64 || cp === 95;
48789
+ }
48790
+ function normalizeQueryFragmentEncoding(input) {
48791
+ let output = "";
48792
+ for (let i = 0;i < input.length; i++) {
48793
+ const ch = input[i];
48794
+ if (ch === "%" && i + 2 < input.length) {
48795
+ const hex = input.slice(i + 1, i + 3);
48796
+ if (isHexPair(hex)) {
48797
+ const normalizedHex = hex.toUpperCase();
48798
+ const decoded = String.fromCharCode(parseInt(normalizedHex, 16));
48799
+ if (isUnreserved(decoded)) {
48800
+ output += decoded;
48801
+ } else {
48802
+ output += "%" + normalizedHex;
48803
+ }
48804
+ i += 2;
48805
+ continue;
48806
+ }
48807
+ }
48808
+ if (isQueryFragmentCharacter(ch)) {
48809
+ output += ch;
48512
48810
  } else {
48513
- const im = input.match(RDS5);
48514
- if (im) {
48515
- const s = im[0];
48516
- input = input.slice(s.length);
48517
- output.push(s);
48811
+ const code = input.charCodeAt(i);
48812
+ if (code < 128) {
48813
+ output += isEscapeSafe(code) ? ch : BYTE_HEX[code];
48814
+ } else if (code < 55296 || code > 57343) {
48815
+ output += percentEncodeNonAscii(code);
48816
+ } else if (code <= 56319 && i + 1 < input.length) {
48817
+ const low = input.charCodeAt(i + 1);
48818
+ if (low >= 56320 && low <= 57343) {
48819
+ output += percentEncodeNonAscii(65536 + (code - 55296 << 10) + (low - 56320));
48820
+ i++;
48821
+ } else {
48822
+ output += percentEncodeNonAscii(65533);
48823
+ }
48518
48824
  } else {
48519
- throw new Error("Unexpected dot segment condition");
48825
+ output += percentEncodeNonAscii(65533);
48520
48826
  }
48521
48827
  }
48522
48828
  }
48523
- return output.join("");
48829
+ return output;
48524
48830
  }
48525
- function normalizeComponentEncoding(components, esc) {
48526
- const func = esc !== true ? escape : unescape;
48527
- if (components.scheme !== undefined) {
48528
- components.scheme = func(components.scheme);
48529
- }
48530
- if (components.userinfo !== undefined) {
48531
- components.userinfo = func(components.userinfo);
48532
- }
48533
- if (components.host !== undefined) {
48534
- components.host = func(components.host);
48535
- }
48536
- if (components.path !== undefined) {
48537
- components.path = func(components.path);
48538
- }
48539
- if (components.query !== undefined) {
48540
- components.query = func(components.query);
48541
- }
48542
- if (components.fragment !== undefined) {
48543
- components.fragment = func(components.fragment);
48831
+ function escapePreservingEscapes(input) {
48832
+ let output = "";
48833
+ for (let i = 0;i < input.length; i++) {
48834
+ if (input[i] === "%" && i + 2 < input.length) {
48835
+ const hex = input.slice(i + 1, i + 3);
48836
+ if (isHexPair(hex)) {
48837
+ output += "%" + hex.toUpperCase();
48838
+ i += 2;
48839
+ continue;
48840
+ }
48841
+ }
48842
+ output += escape(input[i]);
48544
48843
  }
48545
- return components;
48844
+ return output;
48546
48845
  }
48547
- function recomposeAuthority(components) {
48846
+ function recomposeAuthority(component) {
48548
48847
  const uriTokens = [];
48549
- if (components.userinfo !== undefined) {
48550
- uriTokens.push(components.userinfo);
48848
+ if (component.userinfo !== undefined) {
48849
+ uriTokens.push(encodeUserinfo(component.userinfo));
48551
48850
  uriTokens.push("@");
48552
48851
  }
48553
- if (components.host !== undefined) {
48554
- let host = unescape(components.host);
48555
- const ipV4res = normalizeIPv4(host);
48556
- if (ipV4res.isIPV4) {
48557
- host = ipV4res.host;
48558
- } else {
48559
- const ipV6res = normalizeIPv6(ipV4res.host);
48560
- if (ipV6res.isIPV6 === true) {
48852
+ if (component.host !== undefined) {
48853
+ let host = component.host;
48854
+ if (!isIPv4(host)) {
48855
+ let ipV6res = normalizeIPv6(host);
48856
+ if (ipV6res.isIPV6 !== true && ipV6res.isIPVFuture !== true) {
48857
+ host = normalizePercentEncoding(host, true);
48858
+ ipV6res = normalizeIPv6(host);
48859
+ }
48860
+ if (ipV6res.isIPV6 === true || ipV6res.isIPVFuture === true) {
48561
48861
  host = `[${ipV6res.escapedHost}]`;
48562
48862
  } else {
48563
- host = components.host;
48863
+ host = reescapeHostDelimiters(host, false);
48564
48864
  }
48565
48865
  }
48566
48866
  uriTokens.push(host);
48567
48867
  }
48568
- if (typeof components.port === "number" || typeof components.port === "string") {
48868
+ if (typeof component.port === "number" || typeof component.port === "string") {
48869
+ const port = String(component.port);
48870
+ if (!isPort(port)) {
48871
+ throw new TypeError("URI port is malformed.");
48872
+ }
48569
48873
  uriTokens.push(":");
48570
- uriTokens.push(String(components.port));
48874
+ uriTokens.push(port);
48571
48875
  }
48572
48876
  return uriTokens.length ? uriTokens.join("") : undefined;
48573
48877
  }
48574
48878
  module.exports = {
48879
+ nonSimpleDomain,
48575
48880
  recomposeAuthority,
48576
- normalizeComponentEncoding,
48881
+ reescapeHostDelimiters,
48882
+ normalizePercentEncoding,
48883
+ normalizePathEncoding,
48884
+ serializePathEncoding,
48885
+ normalizeQueryFragmentEncoding,
48886
+ encodeUserinfo,
48887
+ encodeQuery,
48888
+ encodeFragment,
48889
+ escapePreservingEscapes,
48577
48890
  removeDotSegments,
48578
- normalizeIPv4,
48891
+ isIPv4,
48892
+ isUUID,
48579
48893
  normalizeIPv6,
48580
48894
  stringArrayToHexStripped
48581
48895
  };
@@ -48583,99 +48897,122 @@ var require_utils2 = __commonJS(function(exports, module) {
48583
48897
 
48584
48898
  // ../windmill-yaml-validator/node_modules/fast-uri/lib/schemes.js
48585
48899
  var require_schemes = __commonJS(function(exports, module) {
48586
- var UUID_REG = /^[\da-f]{8}-[\da-f]{4}-[\da-f]{4}-[\da-f]{4}-[\da-f]{12}$/iu;
48587
- var URN_REG = /([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-.:;=@]|%[\da-f]{2})+)/iu;
48588
- function isSecure(wsComponents) {
48589
- return typeof wsComponents.secure === "boolean" ? wsComponents.secure : String(wsComponents.scheme).toLowerCase() === "wss";
48590
- }
48591
- function httpParse(components) {
48592
- if (!components.host) {
48593
- components.error = components.error || "HTTP URIs must have a host.";
48594
- }
48595
- return components;
48596
- }
48597
- function httpSerialize(components) {
48598
- const secure = String(components.scheme).toLowerCase() === "https";
48599
- if (components.port === (secure ? 443 : 80) || components.port === "") {
48600
- components.port = undefined;
48601
- }
48602
- if (!components.path) {
48603
- components.path = "/";
48604
- }
48605
- return components;
48606
- }
48607
- function wsParse(wsComponents) {
48608
- wsComponents.secure = isSecure(wsComponents);
48609
- wsComponents.resourceName = (wsComponents.path || "/") + (wsComponents.query ? "?" + wsComponents.query : "");
48610
- wsComponents.path = undefined;
48611
- wsComponents.query = undefined;
48612
- return wsComponents;
48900
+ var { isUUID } = require_utils2();
48901
+ var URN_REG = /^([\da-z][\d\-a-z]{0,31}):((?:[\w!$'()*+,\-./:;=@]|%[\da-f]{2})+)$/iu;
48902
+ var supportedSchemeNames = [
48903
+ "http",
48904
+ "https",
48905
+ "ws",
48906
+ "wss",
48907
+ "urn",
48908
+ "urn:uuid"
48909
+ ];
48910
+ function isValidSchemeName(name) {
48911
+ return supportedSchemeNames.indexOf(name) !== -1;
48613
48912
  }
48614
- function wsSerialize(wsComponents) {
48615
- if (wsComponents.port === (isSecure(wsComponents) ? 443 : 80) || wsComponents.port === "") {
48616
- wsComponents.port = undefined;
48617
- }
48618
- if (typeof wsComponents.secure === "boolean") {
48619
- wsComponents.scheme = wsComponents.secure ? "wss" : "ws";
48620
- wsComponents.secure = undefined;
48621
- }
48622
- if (wsComponents.resourceName) {
48623
- const [path, query] = wsComponents.resourceName.split("?");
48624
- wsComponents.path = path && path !== "/" ? path : undefined;
48625
- wsComponents.query = query;
48626
- wsComponents.resourceName = undefined;
48913
+ function wsIsSecure(wsComponent) {
48914
+ if (wsComponent.secure === true) {
48915
+ return true;
48916
+ } else if (wsComponent.secure === false) {
48917
+ return false;
48918
+ } else if (wsComponent.scheme) {
48919
+ return wsComponent.scheme.length === 3 && (wsComponent.scheme[0] === "w" || wsComponent.scheme[0] === "W") && (wsComponent.scheme[1] === "s" || wsComponent.scheme[1] === "S") && (wsComponent.scheme[2] === "s" || wsComponent.scheme[2] === "S");
48920
+ } else {
48921
+ return false;
48627
48922
  }
48628
- wsComponents.fragment = undefined;
48629
- return wsComponents;
48630
48923
  }
48631
- function urnParse(urnComponents, options) {
48632
- if (!urnComponents.path) {
48633
- urnComponents.error = "URN can not be parsed";
48634
- return urnComponents;
48635
- }
48636
- const matches = urnComponents.path.match(URN_REG);
48637
- if (matches) {
48638
- const scheme = options.scheme || urnComponents.scheme || "urn";
48639
- urnComponents.nid = matches[1].toLowerCase();
48640
- urnComponents.nss = matches[2];
48641
- const urnScheme = `${scheme}:${options.nid || urnComponents.nid}`;
48642
- const schemeHandler = SCHEMES[urnScheme];
48643
- urnComponents.path = undefined;
48924
+ function httpParse(component) {
48925
+ if (!component.host) {
48926
+ component.error = component.error || "HTTP URIs must have a host.";
48927
+ }
48928
+ return component;
48929
+ }
48930
+ function httpSerialize(component) {
48931
+ const secure = String(component.scheme).toLowerCase() === "https";
48932
+ if (component.port === (secure ? 443 : 80) || component.port === "") {
48933
+ component.port = undefined;
48934
+ }
48935
+ if (!component.path) {
48936
+ component.path = "/";
48937
+ }
48938
+ return component;
48939
+ }
48940
+ function wsParse(wsComponent) {
48941
+ wsComponent.secure = wsIsSecure(wsComponent);
48942
+ wsComponent.resourceName = (wsComponent.path || "/") + (wsComponent.query ? "?" + wsComponent.query : "");
48943
+ wsComponent.path = undefined;
48944
+ wsComponent.query = undefined;
48945
+ return wsComponent;
48946
+ }
48947
+ function wsSerialize(wsComponent) {
48948
+ if (wsComponent.port === (wsIsSecure(wsComponent) ? 443 : 80) || wsComponent.port === "") {
48949
+ wsComponent.port = undefined;
48950
+ }
48951
+ if (typeof wsComponent.secure === "boolean") {
48952
+ wsComponent.scheme = wsComponent.secure ? "wss" : "ws";
48953
+ wsComponent.secure = undefined;
48954
+ }
48955
+ if (wsComponent.resourceName) {
48956
+ const queryIndex = wsComponent.resourceName.indexOf("?");
48957
+ const path = queryIndex === -1 ? wsComponent.resourceName : wsComponent.resourceName.slice(0, queryIndex);
48958
+ wsComponent.path = path && path !== "/" ? path : undefined;
48959
+ wsComponent.query = queryIndex === -1 ? undefined : wsComponent.resourceName.slice(queryIndex + 1);
48960
+ wsComponent.resourceName = undefined;
48961
+ }
48962
+ wsComponent.fragment = undefined;
48963
+ return wsComponent;
48964
+ }
48965
+ function urnParse(urnComponent, options) {
48966
+ if (!urnComponent.path) {
48967
+ urnComponent.error = "URN can not be parsed";
48968
+ return urnComponent;
48969
+ }
48970
+ const matches = urnComponent.path.match(URN_REG);
48971
+ if (matches && matches[0] === urnComponent.path) {
48972
+ const scheme = options.scheme || urnComponent.scheme || "urn";
48973
+ urnComponent.nid = matches[1].toLowerCase();
48974
+ urnComponent.nss = matches[2];
48975
+ const urnScheme = `${scheme}:${options.nid || urnComponent.nid}`;
48976
+ const schemeHandler = getSchemeHandler(urnScheme);
48977
+ urnComponent.path = undefined;
48644
48978
  if (schemeHandler) {
48645
- urnComponents = schemeHandler.parse(urnComponents, options);
48979
+ urnComponent = schemeHandler.parse(urnComponent, options);
48646
48980
  }
48647
48981
  } else {
48648
- urnComponents.error = urnComponents.error || "URN can not be parsed.";
48982
+ urnComponent.error = urnComponent.error || "URN can not be parsed.";
48649
48983
  }
48650
- return urnComponents;
48984
+ return urnComponent;
48651
48985
  }
48652
- function urnSerialize(urnComponents, options) {
48653
- const scheme = options.scheme || urnComponents.scheme || "urn";
48654
- const nid = urnComponents.nid.toLowerCase();
48986
+ function urnSerialize(urnComponent, options) {
48987
+ if (urnComponent.nid === undefined) {
48988
+ throw new Error("URN without nid cannot be serialized");
48989
+ }
48990
+ const scheme = options.scheme || urnComponent.scheme || "urn";
48991
+ const nid = urnComponent.nid.toLowerCase();
48655
48992
  const urnScheme = `${scheme}:${options.nid || nid}`;
48656
- const schemeHandler = SCHEMES[urnScheme];
48993
+ const schemeHandler = getSchemeHandler(urnScheme);
48657
48994
  if (schemeHandler) {
48658
- urnComponents = schemeHandler.serialize(urnComponents, options);
48995
+ urnComponent = schemeHandler.serialize(urnComponent, options);
48659
48996
  }
48660
- const uriComponents = urnComponents;
48661
- const nss = urnComponents.nss;
48662
- uriComponents.path = `${nid || options.nid}:${nss}`;
48997
+ const uriComponent = urnComponent;
48998
+ const nss = urnComponent.nss;
48999
+ uriComponent.path = `${nid || options.nid}:${nss}`;
48663
49000
  options.skipEscape = true;
48664
- return uriComponents;
49001
+ return uriComponent;
48665
49002
  }
48666
- function urnuuidParse(urnComponents, options) {
48667
- const uuidComponents = urnComponents;
48668
- uuidComponents.uuid = uuidComponents.nss;
48669
- uuidComponents.nss = undefined;
48670
- if (!options.tolerant && (!uuidComponents.uuid || !UUID_REG.test(uuidComponents.uuid))) {
48671
- uuidComponents.error = uuidComponents.error || "UUID is not valid.";
49003
+ function urnuuidParse(urnComponent, options) {
49004
+ const uuidComponent = urnComponent;
49005
+ uuidComponent.uuid = uuidComponent.nss;
49006
+ uuidComponent.nss = undefined;
49007
+ if (!options.tolerant && (!uuidComponent.uuid || !isUUID(uuidComponent.uuid))) {
49008
+ uuidComponent.error = uuidComponent.error || "UUID is not valid.";
48672
49009
  }
48673
- return uuidComponents;
49010
+ return uuidComponent;
48674
49011
  }
48675
- function urnuuidSerialize(uuidComponents) {
48676
- const urnComponents = uuidComponents;
48677
- urnComponents.nss = (uuidComponents.uuid || "").toLowerCase();
48678
- return urnComponents;
49012
+ function urnuuidSerialize(uuidComponent) {
49013
+ const urnComponent = uuidComponent;
49014
+ urnComponent.nss = (uuidComponent.uuid || "").toLowerCase();
49015
+ return urnComponent;
48679
49016
  }
48680
49017
  var http = {
48681
49018
  scheme: "http",
@@ -48721,27 +49058,73 @@ var require_schemes = __commonJS(function(exports, module) {
48721
49058
  urn,
48722
49059
  "urn:uuid": urnuuid
48723
49060
  };
48724
- module.exports = SCHEMES;
49061
+ Object.setPrototypeOf(SCHEMES, null);
49062
+ function getSchemeHandler(scheme) {
49063
+ return scheme && (SCHEMES[scheme] || SCHEMES[scheme.toLowerCase()]) || undefined;
49064
+ }
49065
+ module.exports = {
49066
+ wsIsSecure,
49067
+ SCHEMES,
49068
+ isValidSchemeName,
49069
+ getSchemeHandler
49070
+ };
48725
49071
  });
48726
49072
 
48727
49073
  // ../windmill-yaml-validator/node_modules/fast-uri/index.js
48728
49074
  var require_fast_uri = __commonJS(function(exports, module) {
48729
- var { normalizeIPv6, normalizeIPv4, removeDotSegments, recomposeAuthority, normalizeComponentEncoding } = require_utils2();
48730
- var SCHEMES = require_schemes();
49075
+ var { normalizeIPv6, removeDotSegments, recomposeAuthority, normalizePercentEncoding, normalizePathEncoding, serializePathEncoding, normalizeQueryFragmentEncoding, encodeQuery, encodeFragment, reescapeHostDelimiters, isIPv4, nonSimpleDomain } = require_utils2();
49076
+ var { SCHEMES, getSchemeHandler } = require_schemes();
49077
+ var VALID_SCHEME = /^[A-Za-z][A-Za-z0-9+.-]*$/u;
49078
+ var MALFORMED_SCHEME_ERROR = "URI scheme is malformed.";
49079
+ function decodeValidScheme(scheme) {
49080
+ const decodedScheme = unescape(String(scheme));
49081
+ if (!VALID_SCHEME.test(decodedScheme)) {
49082
+ throw new TypeError(MALFORMED_SCHEME_ERROR);
49083
+ }
49084
+ return decodedScheme;
49085
+ }
48731
49086
  function normalize(uri, options) {
48732
49087
  if (typeof uri === "string") {
48733
- uri = serialize(parse(uri, options), options);
49088
+ uri = normalizeString(uri, options);
48734
49089
  } else if (typeof uri === "object") {
48735
49090
  uri = parse(serialize(uri, options), options);
48736
49091
  }
48737
49092
  return uri;
48738
49093
  }
48739
49094
  function resolve(baseURI, relativeURI, options) {
48740
- const schemelessOptions = Object.assign({ scheme: "null" }, options);
48741
- const resolved = resolveComponents(parse(baseURI, schemelessOptions), parse(relativeURI, schemelessOptions), schemelessOptions, true);
48742
- return serialize(resolved, { ...schemelessOptions, skipEscape: true });
48743
- }
48744
- function resolveComponents(base, relative, options, skipNormalization) {
49095
+ const schemelessOptions = options ? Object.assign({ scheme: "null" }, options) : { scheme: "null" };
49096
+ const {
49097
+ parsed: baseParsed,
49098
+ malformedAuthorityOrPort: baseMalformed,
49099
+ malformedPercentEncoding: baseMalformedPercentEncoding,
49100
+ malformedSchemeSpecific: baseMalformedSchemeSpecific,
49101
+ malformedHost: baseMalformedHost,
49102
+ malformedScheme: baseMalformedScheme
49103
+ } = parseWithStatus(baseURI, schemelessOptions);
49104
+ const {
49105
+ parsed: relativeParsed,
49106
+ malformedAuthorityOrPort: relativeMalformed,
49107
+ malformedPercentEncoding: relativeMalformedPercentEncoding,
49108
+ malformedSchemeSpecific: relativeMalformedSchemeSpecific,
49109
+ malformedHost: relativeMalformedHost,
49110
+ malformedScheme: relativeMalformedScheme
49111
+ } = parseWithStatus(relativeURI, schemelessOptions);
49112
+ if (baseMalformed || relativeMalformed || baseMalformedPercentEncoding || relativeMalformedPercentEncoding || baseMalformedSchemeSpecific || relativeMalformedSchemeSpecific || baseMalformedHost || relativeMalformedHost || baseMalformedScheme || relativeMalformedScheme) {
49113
+ throw new Error(baseParsed.error || relativeParsed.error || "URI is malformed.");
49114
+ }
49115
+ const resolved = resolveComponent(baseParsed, relativeParsed, schemelessOptions, true);
49116
+ const resolvedSchemeHandler = getSchemeHandler(options && options.scheme || resolved.scheme);
49117
+ const resolvedHost = resolved.host;
49118
+ const resolvedHostIsIP = resolvedHost !== undefined && resolvedHost !== "" && (isIPv4(resolvedHost) || normalizeIPv6(resolvedHost).isIPV6);
49119
+ canonicalizeHost(resolved, options || {}, resolvedSchemeHandler, resolvedHostIsIP);
49120
+ const encodedASCIIHost = resolvedHost && resolvedHost.indexOf("%") !== -1 && !/\P{ASCII}/u.test(resolvedHost);
49121
+ if (resolved.error && !encodedASCIIHost) {
49122
+ throw new Error(resolved.error);
49123
+ }
49124
+ schemelessOptions.skipEscape = true;
49125
+ return serialize(resolved, schemelessOptions);
49126
+ }
49127
+ function resolveComponent(base, relative, options, skipNormalization) {
48745
49128
  const target = {};
48746
49129
  if (!skipNormalization) {
48747
49130
  base = parse(serialize(base, options), options);
@@ -48771,7 +49154,7 @@ var require_fast_uri = __commonJS(function(exports, module) {
48771
49154
  target.query = base.query;
48772
49155
  }
48773
49156
  } else {
48774
- if (relative.path.charAt(0) === "/") {
49157
+ if (relative.path[0] === "/") {
48775
49158
  target.path = removeDotSegments(relative.path);
48776
49159
  } else {
48777
49160
  if ((base.userinfo !== undefined || base.host !== undefined || base.port !== undefined) && !base.path) {
@@ -48795,22 +49178,12 @@ var require_fast_uri = __commonJS(function(exports, module) {
48795
49178
  return target;
48796
49179
  }
48797
49180
  function equal(uriA, uriB, options) {
48798
- if (typeof uriA === "string") {
48799
- uriA = unescape(uriA);
48800
- uriA = serialize(normalizeComponentEncoding(parse(uriA, options), true), { ...options, skipEscape: true });
48801
- } else if (typeof uriA === "object") {
48802
- uriA = serialize(normalizeComponentEncoding(uriA, true), { ...options, skipEscape: true });
48803
- }
48804
- if (typeof uriB === "string") {
48805
- uriB = unescape(uriB);
48806
- uriB = serialize(normalizeComponentEncoding(parse(uriB, options), true), { ...options, skipEscape: true });
48807
- } else if (typeof uriB === "object") {
48808
- uriB = serialize(normalizeComponentEncoding(uriB, true), { ...options, skipEscape: true });
48809
- }
48810
- return uriA.toLowerCase() === uriB.toLowerCase();
49181
+ const normalizedA = normalizeComparableURI(uriA, options);
49182
+ const normalizedB = normalizeComparableURI(uriB, options);
49183
+ return normalizedA !== undefined && normalizedB !== undefined && normalizedA === normalizedB;
48811
49184
  }
48812
49185
  function serialize(cmpts, opts) {
48813
- const components = {
49186
+ const component = {
48814
49187
  host: cmpts.host,
48815
49188
  scheme: cmpts.scheme,
48816
49189
  userinfo: cmpts.userinfo,
@@ -48828,63 +49201,99 @@ var require_fast_uri = __commonJS(function(exports, module) {
48828
49201
  };
48829
49202
  const options = Object.assign({}, opts);
48830
49203
  const uriTokens = [];
48831
- const schemeHandler = SCHEMES[(options.scheme || components.scheme || "").toLowerCase()];
49204
+ if (component.scheme) {
49205
+ component.scheme = decodeValidScheme(component.scheme);
49206
+ }
49207
+ const schemeHandler = getSchemeHandler(options.scheme || component.scheme);
48832
49208
  if (schemeHandler && schemeHandler.serialize)
48833
- schemeHandler.serialize(components, options);
48834
- if (components.path !== undefined) {
49209
+ schemeHandler.serialize(component, options);
49210
+ const hasAuthority = component.userinfo !== undefined || component.host !== undefined || component.port !== undefined;
49211
+ const pathNoScheme = !options.skipEscape && component.scheme === undefined && !hasAuthority;
49212
+ if (component.path !== undefined) {
48835
49213
  if (!options.skipEscape) {
48836
- components.path = escape(components.path);
48837
- if (components.scheme !== undefined) {
48838
- components.path = components.path.split("%3A").join(":");
48839
- }
49214
+ component.path = serializePathEncoding(component.path, pathNoScheme);
48840
49215
  } else {
48841
- components.path = unescape(components.path);
49216
+ component.path = normalizePercentEncoding(component.path);
48842
49217
  }
48843
49218
  }
48844
- if (options.reference !== "suffix" && components.scheme) {
48845
- uriTokens.push(components.scheme, ":");
49219
+ if (options.reference !== "suffix" && component.scheme) {
49220
+ component.scheme = decodeValidScheme(component.scheme);
49221
+ uriTokens.push(component.scheme, ":");
48846
49222
  }
48847
- const authority = recomposeAuthority(components);
49223
+ const authority = recomposeAuthority(component);
48848
49224
  if (authority !== undefined) {
48849
49225
  if (options.reference !== "suffix") {
48850
49226
  uriTokens.push("//");
48851
49227
  }
48852
49228
  uriTokens.push(authority);
48853
- if (components.path && components.path.charAt(0) !== "/") {
49229
+ if (component.path && component.path[0] !== "/") {
48854
49230
  uriTokens.push("/");
48855
49231
  }
48856
49232
  }
48857
- if (components.path !== undefined) {
48858
- let s = components.path;
49233
+ if (component.path !== undefined) {
49234
+ let s = component.path;
48859
49235
  if (!options.absolutePath && (!schemeHandler || !schemeHandler.absolutePath)) {
48860
49236
  s = removeDotSegments(s);
48861
49237
  }
48862
- if (authority === undefined) {
48863
- s = s.replace(/^\/\//u, "/%2F");
49238
+ if (pathNoScheme) {
49239
+ s = serializePathEncoding(s, true);
49240
+ }
49241
+ if (authority === undefined && s[0] === "/" && s[1] === "/") {
49242
+ s = "/%2F" + s.slice(2);
48864
49243
  }
48865
49244
  uriTokens.push(s);
48866
49245
  }
48867
- if (components.query !== undefined) {
48868
- uriTokens.push("?", components.query);
49246
+ if (component.query !== undefined) {
49247
+ uriTokens.push("?", encodeQuery(component.query));
48869
49248
  }
48870
- if (components.fragment !== undefined) {
48871
- uriTokens.push("#", components.fragment);
49249
+ if (component.fragment !== undefined) {
49250
+ uriTokens.push("#", encodeFragment(component.fragment));
48872
49251
  }
48873
49252
  return uriTokens.join("");
48874
49253
  }
48875
- var hexLookUp = Array.from({ length: 127 }, (_v, k) => /[^!"$&'()*+,\-.;=_`a-z{}~]/u.test(String.fromCharCode(k)));
48876
- function nonSimpleDomain(value) {
48877
- let code = 0;
48878
- for (let i = 0, len = value.length;i < len; ++i) {
48879
- code = value.charCodeAt(i);
48880
- if (code > 126 || hexLookUp[code]) {
49254
+ var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
49255
+ var AUTHORITY_PREFIX = /^(?:[^#/:?]+:)?\/\/([^/?#]*)/;
49256
+ var AUTHORITY_INTRODUCER_REGION = /^(?:[^#/:?]+:)?([/\\\t\n\r]*)/;
49257
+ function getParseError(parsed, matches) {
49258
+ if (matches[2] !== undefined && parsed.path && parsed.path[0] !== "/") {
49259
+ return 'URI path must start with "/" when authority is present.';
49260
+ }
49261
+ if (typeof parsed.port === "number" && (parsed.port < 0 || parsed.port > 65535)) {
49262
+ return "URI port is malformed.";
49263
+ }
49264
+ return;
49265
+ }
49266
+ function hasMalformedPercentEncoding(component) {
49267
+ if (component === undefined)
49268
+ return false;
49269
+ let percent = component.indexOf("%");
49270
+ while (percent !== -1) {
49271
+ if (percent + 2 >= component.length || !/^[\da-f]{2}$/iu.test(component.slice(percent + 1, percent + 3))) {
48881
49272
  return true;
48882
49273
  }
49274
+ percent = component.indexOf("%", percent + 3);
48883
49275
  }
48884
49276
  return false;
48885
49277
  }
48886
- var URI_PARSE = /^(?:([^#/:?]+):)?(?:\/\/((?:([^#/?@]*)@)?(\[[^#/?\]]+\]|[^#/:?]*)(?::(\d*))?))?([^#?]*)(?:\?([^#]*))?(?:#((?:.|[\n\r])*))?/u;
48887
- function parse(uri, opts) {
49278
+ function isIPLiteral(host) {
49279
+ return host[0] === "[" && host[host.length - 1] === "]";
49280
+ }
49281
+ function hasMalformedComponentPercentEncoding(matches) {
49282
+ const host = matches[4];
49283
+ return hasMalformedPercentEncoding(matches[3]) || host !== undefined && !isIPLiteral(host) && hasMalformedPercentEncoding(host) || hasMalformedPercentEncoding(matches[6]) || hasMalformedPercentEncoding(matches[7]) || hasMalformedPercentEncoding(matches[8]);
49284
+ }
49285
+ function canonicalizeHost(parsed, options, schemeHandler, isIP) {
49286
+ if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport) && parsed.host && !isIPLiteral(parsed.host) && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
49287
+ try {
49288
+ parsed.host = new URL("http://" + parsed.host).hostname;
49289
+ } catch (e) {
49290
+ parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
49291
+ return true;
49292
+ }
49293
+ }
49294
+ return false;
49295
+ }
49296
+ function parseWithStatus(uri, opts) {
48888
49297
  const options = Object.assign({}, opts);
48889
49298
  const parsed = {
48890
49299
  scheme: undefined,
@@ -48895,10 +49304,39 @@ var require_fast_uri = __commonJS(function(exports, module) {
48895
49304
  query: undefined,
48896
49305
  fragment: undefined
48897
49306
  };
48898
- const gotEncoding = uri.indexOf("%") !== -1;
49307
+ let malformedAuthorityOrPort = false;
49308
+ let malformedPercentEncoding = false;
49309
+ let malformedSchemeSpecific = false;
49310
+ let malformedHost = false;
49311
+ let malformedIPLiteral = false;
49312
+ let malformedScheme = false;
48899
49313
  let isIP = false;
48900
- if (options.reference === "suffix")
48901
- uri = (options.scheme ? options.scheme + ":" : "") + "//" + uri;
49314
+ if (options.reference === "suffix") {
49315
+ if (options.scheme) {
49316
+ uri = options.scheme + ":" + uri;
49317
+ } else {
49318
+ uri = "//" + uri;
49319
+ }
49320
+ }
49321
+ const authorityMatch = uri.match(AUTHORITY_PREFIX);
49322
+ if (authorityMatch !== null && authorityMatch[1].indexOf("\\") !== -1) {
49323
+ parsed.error = "URI authority must not contain a literal backslash.";
49324
+ malformedAuthorityOrPort = true;
49325
+ }
49326
+ const introducerMatch = uri.match(AUTHORITY_INTRODUCER_REGION);
49327
+ if (introducerMatch !== null) {
49328
+ const region = introducerMatch[1];
49329
+ const normalizedRegion = region.replace(/[\t\n\r]/g, "");
49330
+ if (normalizedRegion.length >= 2) {
49331
+ if (normalizedRegion.slice(0, 2) !== "//") {
49332
+ parsed.error = parsed.error || "URI authority must not contain a literal backslash.";
49333
+ malformedAuthorityOrPort = true;
49334
+ } else if (region.length !== normalizedRegion.length) {
49335
+ parsed.error = parsed.error || "URI authority introducer must not contain whitespace.";
49336
+ malformedAuthorityOrPort = true;
49337
+ }
49338
+ }
49339
+ }
48902
49340
  const matches = uri.match(URI_PARSE);
48903
49341
  if (matches) {
48904
49342
  parsed.scheme = matches[1];
@@ -48908,17 +49346,41 @@ var require_fast_uri = __commonJS(function(exports, module) {
48908
49346
  parsed.path = matches[6] || "";
48909
49347
  parsed.query = matches[7];
48910
49348
  parsed.fragment = matches[8];
49349
+ if (parsed.scheme !== undefined) {
49350
+ const decodedScheme = unescape(parsed.scheme);
49351
+ if (VALID_SCHEME.test(decodedScheme)) {
49352
+ parsed.scheme = decodedScheme.toLowerCase();
49353
+ } else {
49354
+ parsed.error = parsed.error || MALFORMED_SCHEME_ERROR;
49355
+ malformedScheme = true;
49356
+ }
49357
+ }
49358
+ malformedPercentEncoding = hasMalformedComponentPercentEncoding(matches);
49359
+ if (malformedPercentEncoding) {
49360
+ parsed.error = parsed.error || "URI contains malformed percent-encoding.";
49361
+ }
48911
49362
  if (isNaN(parsed.port)) {
48912
49363
  parsed.port = matches[5];
48913
49364
  }
49365
+ const parseError = getParseError(parsed, matches);
49366
+ if (parseError !== undefined) {
49367
+ parsed.error = parsed.error || parseError;
49368
+ malformedAuthorityOrPort = true;
49369
+ }
48914
49370
  if (parsed.host) {
48915
- const ipv4result = normalizeIPv4(parsed.host);
48916
- if (ipv4result.isIPV4 === false) {
48917
- const ipv6result = normalizeIPv6(ipv4result.host);
48918
- parsed.host = ipv6result.host.toLowerCase();
48919
- isIP = ipv6result.isIPV6;
49371
+ const ipv4result = isIPv4(parsed.host);
49372
+ if (ipv4result === false) {
49373
+ const bracketedIPLiteral = isIPLiteral(parsed.host);
49374
+ const hasIPLiteralBracket = parsed.host.indexOf("[") !== -1 || parsed.host.indexOf("]") !== -1;
49375
+ const ipv6result = normalizeIPv6(parsed.host);
49376
+ isIP = ipv6result.isIPV6 || ipv6result.isIPVFuture === true;
49377
+ malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true);
49378
+ parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase();
49379
+ if (malformedIPLiteral) {
49380
+ parsed.error = parsed.error || "URI host is malformed.";
49381
+ malformedAuthorityOrPort = true;
49382
+ }
48920
49383
  } else {
48921
- parsed.host = ipv4result.host;
48922
49384
  isIP = true;
48923
49385
  }
48924
49386
  }
@@ -48934,43 +49396,74 @@ var require_fast_uri = __commonJS(function(exports, module) {
48934
49396
  if (options.reference && options.reference !== "suffix" && options.reference !== parsed.reference) {
48935
49397
  parsed.error = parsed.error || "URI is not a " + options.reference + " reference.";
48936
49398
  }
48937
- const schemeHandler = SCHEMES[(options.scheme || parsed.scheme || "").toLowerCase()];
48938
- if (!options.unicodeSupport && (!schemeHandler || !schemeHandler.unicodeSupport)) {
48939
- if (parsed.host && (options.domainHost || schemeHandler && schemeHandler.domainHost) && isIP === false && nonSimpleDomain(parsed.host)) {
48940
- try {
48941
- parsed.host = URL.domainToASCII(parsed.host.toLowerCase());
48942
- } catch (e) {
48943
- parsed.error = parsed.error || "Host's domain name can not be converted to ASCII: " + e;
48944
- }
49399
+ const schemeHandler = getSchemeHandler(options.scheme || parsed.scheme);
49400
+ if (!malformedIPLiteral) {
49401
+ malformedHost = canonicalizeHost(parsed, options, schemeHandler, isIP);
49402
+ }
49403
+ if (uri.indexOf("%") !== -1 && parsed.host !== undefined && !malformedIPLiteral) {
49404
+ let host = isIP ? parsed.host : normalizePercentEncoding(parsed.host, true);
49405
+ if (!isIP) {
49406
+ host = normalizePercentEncoding(host.toLowerCase());
48945
49407
  }
49408
+ parsed.host = reescapeHostDelimiters(host, isIP);
48946
49409
  }
48947
49410
  if (!schemeHandler || schemeHandler && !schemeHandler.skipNormalize) {
48948
- if (gotEncoding && parsed.scheme !== undefined) {
48949
- parsed.scheme = unescape(parsed.scheme);
48950
- }
48951
- if (gotEncoding && parsed.host !== undefined) {
48952
- parsed.host = unescape(parsed.host);
48953
- }
48954
49411
  if (parsed.path) {
48955
- parsed.path = escape(unescape(parsed.path));
49412
+ parsed.path = normalizePathEncoding(parsed.path);
49413
+ }
49414
+ if (parsed.query) {
49415
+ parsed.query = normalizeQueryFragmentEncoding(parsed.query);
48956
49416
  }
48957
49417
  if (parsed.fragment) {
48958
- parsed.fragment = encodeURI(decodeURIComponent(parsed.fragment));
49418
+ parsed.fragment = normalizeQueryFragmentEncoding(parsed.fragment);
48959
49419
  }
48960
49420
  }
48961
49421
  if (schemeHandler && schemeHandler.parse) {
48962
49422
  schemeHandler.parse(parsed, options);
49423
+ if (schemeHandler === SCHEMES.urn && parsed.nid === undefined) {
49424
+ malformedSchemeSpecific = true;
49425
+ }
48963
49426
  }
48964
49427
  } else {
48965
49428
  parsed.error = parsed.error || "URI can not be parsed.";
48966
49429
  }
48967
- return parsed;
49430
+ return { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme };
49431
+ }
49432
+ function parse(uri, opts) {
49433
+ return parseWithStatus(uri, opts).parsed;
49434
+ }
49435
+ function normalizeString(uri, opts) {
49436
+ return normalizeStringWithStatus(uri, opts).normalized;
49437
+ }
49438
+ function normalizeStringWithStatus(uri, opts) {
49439
+ const { parsed, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = parseWithStatus(uri, opts);
49440
+ return {
49441
+ normalized: malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? uri : serialize(parsed, opts),
49442
+ malformedAuthorityOrPort,
49443
+ malformedPercentEncoding,
49444
+ malformedSchemeSpecific,
49445
+ malformedHost,
49446
+ malformedScheme
49447
+ };
49448
+ }
49449
+ function normalizeComparableURI(uri, opts) {
49450
+ if (typeof uri !== "string" && typeof uri !== "object") {
49451
+ return;
49452
+ }
49453
+ let value;
49454
+ try {
49455
+ value = typeof uri === "string" ? uri : serialize(uri, opts);
49456
+ } catch {
49457
+ return;
49458
+ }
49459
+ const { normalized, malformedAuthorityOrPort, malformedPercentEncoding, malformedSchemeSpecific, malformedHost, malformedScheme } = normalizeStringWithStatus(value, opts);
49460
+ return malformedAuthorityOrPort || malformedPercentEncoding || malformedSchemeSpecific || malformedHost || malformedScheme ? undefined : normalized;
48968
49461
  }
48969
49462
  var fastUri = {
48970
49463
  SCHEMES,
48971
49464
  normalize,
48972
49465
  resolve,
48973
- resolveComponents,
49466
+ resolveComponent,
48974
49467
  equal,
48975
49468
  serialize,
48976
49469
  parse
@@ -49099,7 +49592,7 @@ var require_core = __commonJS(function(exports) {
49099
49592
  constructor(opts = {}) {
49100
49593
  this.schemas = {};
49101
49594
  this.refs = {};
49102
- this.formats = {};
49595
+ this.formats = Object.create(null);
49103
49596
  this._compilations = new Set;
49104
49597
  this._loading = {};
49105
49598
  this._cache = new Map;
@@ -49840,6 +50333,7 @@ var require_limitLength = __commonJS(function(exports) {
49840
50333
  var require_pattern = __commonJS(function(exports) {
49841
50334
  Object.defineProperty(exports, "__esModule", { value: true });
49842
50335
  var code_1 = require_code2();
50336
+ var util_1 = require_util2();
49843
50337
  var codegen_1 = require_codegen();
49844
50338
  var error = {
49845
50339
  message: ({ schemaCode }) => (0, codegen_1.str)`must match pattern "${schemaCode}"`,
@@ -49852,10 +50346,18 @@ var require_pattern = __commonJS(function(exports) {
49852
50346
  $data: true,
49853
50347
  error,
49854
50348
  code(cxt) {
49855
- const { data, $data, schema, schemaCode, it } = cxt;
50349
+ const { gen, data, $data, schema, schemaCode, it } = cxt;
49856
50350
  const u = it.opts.unicodeRegExp ? "u" : "";
49857
- const regExp = $data ? (0, codegen_1._)`(new RegExp(${schemaCode}, ${u}))` : (0, code_1.usePattern)(cxt, schema);
49858
- cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
50351
+ if ($data) {
50352
+ const { regExp } = it.opts.code;
50353
+ const regExpCode = regExp.code === "new RegExp" ? (0, codegen_1._)`new RegExp` : (0, util_1.useFunc)(gen, regExp);
50354
+ const valid = gen.let("valid");
50355
+ gen.try(() => gen.assign(valid, (0, codegen_1._)`${regExpCode}(${schemaCode}, ${u}).test(${data})`), () => gen.assign(valid, false));
50356
+ cxt.fail$data((0, codegen_1._)`!${valid}`);
50357
+ } else {
50358
+ const regExp = (0, code_1.usePattern)(cxt, schema);
50359
+ cxt.fail$data((0, codegen_1._)`!${regExp}.test(${data})`);
50360
+ }
49859
50361
  }
49860
50362
  };
49861
50363
  exports.default = def;
@@ -56422,7 +56924,7 @@ var init_openflow = __esm(() => {
56422
56924
  openflow_default = {
56423
56925
  openapi: "3.0.3",
56424
56926
  info: {
56425
- version: "1.814.0",
56927
+ version: "1.815.0",
56426
56928
  title: "OpenFlow Spec",
56427
56929
  contact: {
56428
56930
  name: "Ruben Fiszel",
@@ -66348,6 +66850,22 @@ function stripUnappliedSettingsFields(local, remote) {
66348
66850
  delete local?.color;
66349
66851
  delete remote?.color;
66350
66852
  }
66853
+ if (local)
66854
+ local.auto_invite ??= {};
66855
+ if (remote)
66856
+ remote.auto_invite ??= {};
66857
+ const localInvite = local?.auto_invite;
66858
+ const remoteInvite = remote?.auto_invite;
66859
+ if (localInvite?.instance_groups == null) {
66860
+ for (const invite of [localInvite, remoteInvite]) {
66861
+ delete invite?.instance_groups;
66862
+ delete invite?.instance_groups_roles;
66863
+ }
66864
+ } else {
66865
+ localInvite.instance_groups_roles ??= {};
66866
+ if (remoteInvite)
66867
+ remoteInvite.instance_groups_roles ??= {};
66868
+ }
66351
66869
  }
66352
66870
  async function compareDynFSElement(els1, els2, ignore, json, skips, ignoreMetadataDeletion, codebases, ignoreCodebaseChanges, specificItems, branchOverride, isEls1Remote, caseInsensitiveFs, parentOwnsScheduleEnabled) {
66353
66871
  let [m1, m2] = els2 ? await Promise.all([
@@ -74382,7 +74900,17 @@ async function pushWorkspaceSettings(workspace, _path, settings, localSettings)
74382
74900
  }
74383
74901
  });
74384
74902
  }
74385
- if (!deepEqual(localSettings.auto_invite, settings.auto_invite)) {
74903
+ const {
74904
+ instance_groups: localGroups,
74905
+ instance_groups_roles: localGroupRoles,
74906
+ ...localDomainInvite
74907
+ } = localSettings.auto_invite ?? {};
74908
+ const {
74909
+ instance_groups: remoteGroups,
74910
+ instance_groups_roles: remoteGroupRoles,
74911
+ ...remoteDomainInvite
74912
+ } = settings.auto_invite ?? {};
74913
+ if (!deepEqual(localDomainInvite, remoteDomainInvite)) {
74386
74914
  debug(`Updating auto invite...`);
74387
74915
  const localAutoInvite = localSettings.auto_invite;
74388
74916
  if (localAutoInvite?.mode && !["add", "invite"].includes(localAutoInvite.mode)) {
@@ -74409,6 +74937,13 @@ async function pushWorkspaceSettings(workspace, _path, settings, localSettings)
74409
74937
  });
74410
74938
  }
74411
74939
  }
74940
+ if (localGroups != null && (!deepEqual(localGroups, remoteGroups) || !deepEqual(localGroupRoles ?? {}, remoteGroupRoles ?? {}))) {
74941
+ debug(`Updating instance groups...`);
74942
+ await editInstanceGroups({
74943
+ workspace,
74944
+ requestBody: { groups: localGroups, roles: localGroupRoles ?? {} }
74945
+ });
74946
+ }
74412
74947
  if (!deepEqual(localSettings.ai_config, settings.ai_config)) {
74413
74948
  debug(`Updating copilot settings...`);
74414
74949
  await editCopilotConfig({
@@ -74501,10 +75036,13 @@ async function pushWorkspaceSettings(workspace, _path, settings, localSettings)
74501
75036
  }
74502
75037
  if (!deepEqual(localSettings.datatable, settings.datatable)) {
74503
75038
  debug(`Updating datatable config...`);
74504
- await editDataTableConfig({
75039
+ const { stranded_references } = await editDataTableConfig({
74505
75040
  workspace,
74506
75041
  requestBody: { settings: localSettings.datatable ?? { datatables: {} } }
74507
75042
  });
75043
+ if (stranded_references?.length) {
75044
+ warn(`Removed data tables governed data tables in other workspaces, which no longer resolve: ${stranded_references.map((r) => `${r.workspace_id}/${r.datatable}`).join(", ")}. A superadmin can point them somewhere else.`);
75045
+ }
74508
75046
  }
74509
75047
  if (localSettings.slack_command_script != settings.slack_command_script) {
74510
75048
  debug(`Updating slack command script...`);
@@ -79757,6 +80295,8 @@ parseS3Object(s3Object: S3Object): S3ObjectRecord
79757
80295
  /**
79758
80296
  * Create a SQL template function for PostgreSQL/datatable queries
79759
80297
  * @param name - Database/datatable name (default: "main")
80298
+ * @param opts.role - Connect as this data table role instead of the data table's default one.
80299
+ * Only meaningful on a data table under roles, and only for a role you are a tenant of.
79760
80300
  * @returns SQL template function for building parameterized queries
79761
80301
  * @example
79762
80302
  * let sql = wmill.datatable()
@@ -79766,8 +80306,11 @@ parseS3Object(s3Object: S3Object): S3ObjectRecord
79766
80306
  * SELECT * FROM friends
79767
80307
  * WHERE name = \${name} AND age = \${age}::int
79768
80308
  * \`.fetch()
80309
+ * @example
80310
+ * // Read through a restricted role
80311
+ * let sql = wmill.datatable("main", { role: "analytics" })
79769
80312
  */
79770
- datatable(name: string = "main"): DatatableSqlTemplateFunction
80313
+ datatable(name: string = "main", opts?: DatatableOptions): DatatableSqlTemplateFunction
79771
80314
 
79772
80315
  /**
79773
80316
  * Create a SQL template function for DuckDB/ducklake queries
@@ -80548,6 +81091,8 @@ parseS3Object(s3Object: S3Object): S3ObjectRecord
80548
81091
  /**
80549
81092
  * Create a SQL template function for PostgreSQL/datatable queries
80550
81093
  * @param name - Database/datatable name (default: "main")
81094
+ * @param opts.role - Connect as this data table role instead of the data table's default one.
81095
+ * Only meaningful on a data table under roles, and only for a role you are a tenant of.
80551
81096
  * @returns SQL template function for building parameterized queries
80552
81097
  * @example
80553
81098
  * let sql = wmill.datatable()
@@ -80557,8 +81102,11 @@ parseS3Object(s3Object: S3Object): S3ObjectRecord
80557
81102
  * SELECT * FROM friends
80558
81103
  * WHERE name = \${name} AND age = \${age}::int
80559
81104
  * \`.fetch()
81105
+ * @example
81106
+ * // Read through a restricted role
81107
+ * let sql = wmill.datatable("main", { role: "analytics" })
80560
81108
  */
80561
- datatable(name: string = "main"): DatatableSqlTemplateFunction
81109
+ datatable(name: string = "main", opts?: DatatableOptions): DatatableSqlTemplateFunction
80562
81110
 
80563
81111
  /**
80564
81112
  * Create a SQL template function for DuckDB/ducklake queries
@@ -81433,6 +81981,8 @@ parseS3Object(s3Object: S3Object): S3ObjectRecord
81433
81981
  /**
81434
81982
  * Create a SQL template function for PostgreSQL/datatable queries
81435
81983
  * @param name - Database/datatable name (default: "main")
81984
+ * @param opts.role - Connect as this data table role instead of the data table's default one.
81985
+ * Only meaningful on a data table under roles, and only for a role you are a tenant of.
81436
81986
  * @returns SQL template function for building parameterized queries
81437
81987
  * @example
81438
81988
  * let sql = wmill.datatable()
@@ -81442,8 +81992,11 @@ parseS3Object(s3Object: S3Object): S3ObjectRecord
81442
81992
  * SELECT * FROM friends
81443
81993
  * WHERE name = \${name} AND age = \${age}::int
81444
81994
  * \`.fetch()
81995
+ * @example
81996
+ * // Read through a restricted role
81997
+ * let sql = wmill.datatable("main", { role: "analytics" })
81445
81998
  */
81446
- datatable(name: string = "main"): DatatableSqlTemplateFunction
81999
+ datatable(name: string = "main", opts?: DatatableOptions): DatatableSqlTemplateFunction
81447
82000
 
81448
82001
  /**
81449
82002
  * Create a SQL template function for DuckDB/ducklake queries
@@ -83052,10 +83605,13 @@ def send_teams_message(conversation_id: str, text: str, success: bool = True, ca
83052
83605
  #
83053
83606
  # Args:
83054
83607
  # name: Database name (default: "main")
83608
+ # role: Connect as this data table role instead of the data table's default one.
83609
+ # Only meaningful on a data table under roles, and only for a role you are a
83610
+ # tenant of.
83055
83611
  #
83056
83612
  # Returns:
83057
83613
  # DataTableClient instance
83058
- def datatable(name: str = 'main')
83614
+ def datatable(name: str = 'main', *, role: Optional[str] = None)
83059
83615
 
83060
83616
  # Get a DuckLake client for DuckDB queries.
83061
83617
  #
@@ -83273,7 +83829,7 @@ def parse_sql_client_name(name: str) -> tuple[str, Optional[str]]
83273
83829
  #
83274
83830
  # @task(retry={"attempts": 3, "delay": 30, "multiplier": 2})
83275
83831
  # async def call_api(payload: dict): ...
83276
- def task(_func = None, path: Optional[str] = None, tag: Optional[str] = None, timeout: Optional[int] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None, retry: Optional[dict] = None)
83832
+ def task(_func = None, *, path: Optional[str] = None, tag: Optional[str] = None, timeout: Optional[int] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None, retry: Optional[dict] = None)
83277
83833
 
83278
83834
  # Create a task that dispatches to a separate Windmill script.
83279
83835
  #
@@ -83286,7 +83842,7 @@ def task(_func = None, path: Optional[str] = None, tag: Optional[str] = None, ti
83286
83842
  # @workflow
83287
83843
  # async def main():
83288
83844
  # data = await extract(url="https://...")
83289
- def task_script(path: str, timeout: Optional[int] = None, tag: Optional[str] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None, retry: Optional[dict] = None)
83845
+ def task_script(path: str, *, timeout: Optional[int] = None, tag: Optional[str] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None, retry: Optional[dict] = None)
83290
83846
 
83291
83847
  # Create a task that dispatches to a separate Windmill flow.
83292
83848
  #
@@ -83299,7 +83855,7 @@ def task_script(path: str, timeout: Optional[int] = None, tag: Optional[str] = N
83299
83855
  # @workflow
83300
83856
  # async def main():
83301
83857
  # result = await pipeline(input=data)
83302
- def task_flow(path: str, timeout: Optional[int] = None, tag: Optional[str] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None, retry: Optional[dict] = None)
83858
+ def task_flow(path: str, *, timeout: Optional[int] = None, tag: Optional[str] = None, cache_ttl: Optional[int] = None, priority: Optional[int] = None, concurrency_limit: Optional[int] = None, concurrency_key: Optional[str] = None, concurrency_time_window_s: Optional[int] = None, retry: Optional[dict] = None)
83303
83859
 
83304
83860
  # Decorator marking an async function as a workflow-as-code entry point.
83305
83861
  #
@@ -83364,7 +83920,7 @@ async def wait_for_approval(timeout: int = 1800, form: dict | None = None, self_
83364
83920
  # ...
83365
83921
  #
83366
83922
  # results = await parallel(items, process, concurrency=5)
83367
- async def parallel(items, fn, concurrency: Optional[int] = None)
83923
+ async def parallel(items, fn, *, concurrency: Optional[int] = None)
83368
83924
 
83369
83925
  # Commit Kafka offsets for a trigger with auto_commit disabled.
83370
83926
  #