dbx-tools-node-runtime 0.9.54__tar.gz → 0.9.58__tar.gz
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.
- {dbx_tools_node_runtime-0.9.54 → dbx_tools_node_runtime-0.9.58}/PKG-INFO +1 -1
- {dbx_tools_node_runtime-0.9.54 → dbx_tools_node_runtime-0.9.58}/pyproject.toml +1 -1
- {dbx_tools_node_runtime-0.9.54 → dbx_tools_node_runtime-0.9.58}/pyproject.toml.orig +1 -1
- {dbx_tools_node_runtime-0.9.54 → dbx_tools_node_runtime-0.9.58}/src/dbx_tools/node_runtime/runtime.js +475 -41
- {dbx_tools_node_runtime-0.9.54 → dbx_tools_node_runtime-0.9.58}/LICENSE +0 -0
- {dbx_tools_node_runtime-0.9.54 → dbx_tools_node_runtime-0.9.58}/README.md +0 -0
- {dbx_tools_node_runtime-0.9.54 → dbx_tools_node_runtime-0.9.58}/src/dbx_tools/node_runtime/__init__.py +0 -0
- {dbx_tools_node_runtime-0.9.54 → dbx_tools_node_runtime-0.9.58}/src/dbx_tools/node_runtime/__main__.py +0 -0
- {dbx_tools_node_runtime-0.9.54 → dbx_tools_node_runtime-0.9.58}/src/dbx_tools/node_runtime/bootstrap.py +0 -0
- {dbx_tools_node_runtime-0.9.54 → dbx_tools_node_runtime-0.9.58}/src/dbx_tools/node_runtime/py.typed +0 -0
- {dbx_tools_node_runtime-0.9.54 → dbx_tools_node_runtime-0.9.58}/src/dbx_tools/node_runtime/runtime.py +0 -0
|
@@ -4198,7 +4198,7 @@ var require_URLSearchParams = __commonJS((exports2) => {
|
|
|
4198
4198
|
}
|
|
4199
4199
|
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
|
4200
4200
|
|
|
4201
|
-
class
|
|
4201
|
+
class URLSearchParams2 {
|
|
4202
4202
|
constructor() {
|
|
4203
4203
|
const args = [];
|
|
4204
4204
|
{
|
|
@@ -4477,7 +4477,7 @@ var require_URLSearchParams = __commonJS((exports2) => {
|
|
|
4477
4477
|
return esValue[implSymbol]["size"];
|
|
4478
4478
|
}
|
|
4479
4479
|
}
|
|
4480
|
-
Object.defineProperties(
|
|
4480
|
+
Object.defineProperties(URLSearchParams2.prototype, {
|
|
4481
4481
|
append: { enumerable: true },
|
|
4482
4482
|
delete: { enumerable: true },
|
|
4483
4483
|
get: { enumerable: true },
|
|
@@ -4492,9 +4492,9 @@ var require_URLSearchParams = __commonJS((exports2) => {
|
|
|
4492
4492
|
forEach: { enumerable: true },
|
|
4493
4493
|
size: { enumerable: true },
|
|
4494
4494
|
[Symbol.toStringTag]: { value: "URLSearchParams", configurable: true },
|
|
4495
|
-
[Symbol.iterator]: { value:
|
|
4495
|
+
[Symbol.iterator]: { value: URLSearchParams2.prototype.entries, configurable: true, writable: true }
|
|
4496
4496
|
});
|
|
4497
|
-
ctorRegistry[interfaceName] =
|
|
4497
|
+
ctorRegistry[interfaceName] = URLSearchParams2;
|
|
4498
4498
|
ctorRegistry["URLSearchParams Iterator"] = Object.create(ctorRegistry["%IteratorPrototype%"], {
|
|
4499
4499
|
[Symbol.toStringTag]: {
|
|
4500
4500
|
configurable: true,
|
|
@@ -4521,7 +4521,7 @@ var require_URLSearchParams = __commonJS((exports2) => {
|
|
|
4521
4521
|
Object.defineProperty(globalObject, interfaceName, {
|
|
4522
4522
|
configurable: true,
|
|
4523
4523
|
writable: true,
|
|
4524
|
-
value:
|
|
4524
|
+
value: URLSearchParams2
|
|
4525
4525
|
});
|
|
4526
4526
|
};
|
|
4527
4527
|
var Impl = require_URLSearchParams_impl();
|
|
@@ -4531,7 +4531,7 @@ var require_URLSearchParams = __commonJS((exports2) => {
|
|
|
4531
4531
|
var require_URL_impl = __commonJS((exports2) => {
|
|
4532
4532
|
var usm = require_url_state_machine();
|
|
4533
4533
|
var urlencoded = require_urlencoded();
|
|
4534
|
-
var
|
|
4534
|
+
var URLSearchParams2 = require_URLSearchParams();
|
|
4535
4535
|
exports2.implementation = class URLImpl {
|
|
4536
4536
|
constructor(globalObject, [url, base]) {
|
|
4537
4537
|
let parsedBase = null;
|
|
@@ -4547,7 +4547,7 @@ var require_URL_impl = __commonJS((exports2) => {
|
|
|
4547
4547
|
}
|
|
4548
4548
|
const query = parsedURL.query !== null ? parsedURL.query : "";
|
|
4549
4549
|
this._url = parsedURL;
|
|
4550
|
-
this._query =
|
|
4550
|
+
this._query = URLSearchParams2.createImpl(globalObject, [query], { doNotStripQMark: true });
|
|
4551
4551
|
this._query._url = this;
|
|
4552
4552
|
}
|
|
4553
4553
|
static parse(globalObject, input, base) {
|
|
@@ -4780,7 +4780,7 @@ var require_URL = __commonJS((exports2) => {
|
|
|
4780
4780
|
}
|
|
4781
4781
|
const ctorRegistry = utils.initCtorRegistry(globalObject);
|
|
4782
4782
|
|
|
4783
|
-
class
|
|
4783
|
+
class URL2 {
|
|
4784
4784
|
constructor(url) {
|
|
4785
4785
|
if (arguments.length < 1) {
|
|
4786
4786
|
throw new globalObject.TypeError(`Failed to construct 'URL': 1 argument required, but only ${arguments.length} present.`);
|
|
@@ -5067,7 +5067,7 @@ var require_URL = __commonJS((exports2) => {
|
|
|
5067
5067
|
return Impl.implementation.canParse(...args);
|
|
5068
5068
|
}
|
|
5069
5069
|
}
|
|
5070
|
-
Object.defineProperties(
|
|
5070
|
+
Object.defineProperties(URL2.prototype, {
|
|
5071
5071
|
toJSON: { enumerable: true },
|
|
5072
5072
|
href: { enumerable: true },
|
|
5073
5073
|
toString: { enumerable: true },
|
|
@@ -5084,18 +5084,18 @@ var require_URL = __commonJS((exports2) => {
|
|
|
5084
5084
|
hash: { enumerable: true },
|
|
5085
5085
|
[Symbol.toStringTag]: { value: "URL", configurable: true }
|
|
5086
5086
|
});
|
|
5087
|
-
Object.defineProperties(
|
|
5088
|
-
ctorRegistry[interfaceName] =
|
|
5087
|
+
Object.defineProperties(URL2, { parse: { enumerable: true }, canParse: { enumerable: true } });
|
|
5088
|
+
ctorRegistry[interfaceName] = URL2;
|
|
5089
5089
|
Object.defineProperty(globalObject, interfaceName, {
|
|
5090
5090
|
configurable: true,
|
|
5091
5091
|
writable: true,
|
|
5092
|
-
value:
|
|
5092
|
+
value: URL2
|
|
5093
5093
|
});
|
|
5094
5094
|
if (globalNames.includes("Window")) {
|
|
5095
5095
|
Object.defineProperty(globalObject, "webkitURL", {
|
|
5096
5096
|
configurable: true,
|
|
5097
5097
|
writable: true,
|
|
5098
|
-
value:
|
|
5098
|
+
value: URL2
|
|
5099
5099
|
});
|
|
5100
5100
|
}
|
|
5101
5101
|
};
|
|
@@ -5104,20 +5104,20 @@ var require_URL = __commonJS((exports2) => {
|
|
|
5104
5104
|
|
|
5105
5105
|
// node_modules/whatwg-url/webidl2js-wrapper.js
|
|
5106
5106
|
var require_webidl2js_wrapper = __commonJS((exports2) => {
|
|
5107
|
-
var
|
|
5108
|
-
var
|
|
5109
|
-
exports2.URL =
|
|
5110
|
-
exports2.URLSearchParams =
|
|
5107
|
+
var URL2 = require_URL();
|
|
5108
|
+
var URLSearchParams2 = require_URLSearchParams();
|
|
5109
|
+
exports2.URL = URL2;
|
|
5110
|
+
exports2.URLSearchParams = URLSearchParams2;
|
|
5111
5111
|
});
|
|
5112
5112
|
|
|
5113
5113
|
// node_modules/whatwg-url/index.js
|
|
5114
5114
|
var require_whatwg_url = __commonJS((exports2) => {
|
|
5115
|
-
var { URL, URLSearchParams } = require_webidl2js_wrapper();
|
|
5115
|
+
var { URL: URL2, URLSearchParams: URLSearchParams2 } = require_webidl2js_wrapper();
|
|
5116
5116
|
var urlStateMachine = require_url_state_machine();
|
|
5117
5117
|
var percentEncoding = require_percent_encoding();
|
|
5118
5118
|
var sharedGlobalObject = { Array, Object, Promise, String, TypeError };
|
|
5119
|
-
|
|
5120
|
-
|
|
5119
|
+
URL2.install(sharedGlobalObject, ["Window"]);
|
|
5120
|
+
URLSearchParams2.install(sharedGlobalObject, ["Window"]);
|
|
5121
5121
|
exports2.URL = sharedGlobalObject.URL;
|
|
5122
5122
|
exports2.URLSearchParams = sharedGlobalObject.URLSearchParams;
|
|
5123
5123
|
exports2.parseURL = urlStateMachine.parseURL;
|
|
@@ -6518,7 +6518,7 @@ var require_for_each = __commonJS((exports2, module2) => {
|
|
|
6518
6518
|
function isArray(x) {
|
|
6519
6519
|
return toStr.call(x) === "[object Array]";
|
|
6520
6520
|
}
|
|
6521
|
-
module2.exports = function
|
|
6521
|
+
module2.exports = function forEach2(list, iterator, thisArg) {
|
|
6522
6522
|
if (!isCallable(iterator)) {
|
|
6523
6523
|
throw new TypeError("iterator must be a function");
|
|
6524
6524
|
}
|
|
@@ -6701,7 +6701,7 @@ var require_call_bind = __commonJS((exports2, module2) => {
|
|
|
6701
6701
|
|
|
6702
6702
|
// node_modules/which-typed-array/index.js
|
|
6703
6703
|
var require_which_typed_array = __commonJS((exports2, module2) => {
|
|
6704
|
-
var
|
|
6704
|
+
var forEach2 = require_for_each();
|
|
6705
6705
|
var availableTypedArrays = require_available_typed_arrays();
|
|
6706
6706
|
var callBind = require_call_bind();
|
|
6707
6707
|
var callBound = require_call_bound();
|
|
@@ -6722,7 +6722,7 @@ var require_which_typed_array = __commonJS((exports2, module2) => {
|
|
|
6722
6722
|
};
|
|
6723
6723
|
var cache = { __proto__: null };
|
|
6724
6724
|
if (hasToStringTag && gOPD && getProto) {
|
|
6725
|
-
|
|
6725
|
+
forEach2(typedArrays, function(typedArray) {
|
|
6726
6726
|
var arr = new g[typedArray];
|
|
6727
6727
|
if (Symbol.toStringTag in arr && getProto) {
|
|
6728
6728
|
var proto = getProto(arr);
|
|
@@ -6738,7 +6738,7 @@ var require_which_typed_array = __commonJS((exports2, module2) => {
|
|
|
6738
6738
|
}
|
|
6739
6739
|
});
|
|
6740
6740
|
} else {
|
|
6741
|
-
|
|
6741
|
+
forEach2(typedArrays, function(typedArray) {
|
|
6742
6742
|
var arr = new g[typedArray];
|
|
6743
6743
|
var fn = arr.slice || arr.set;
|
|
6744
6744
|
if (fn) {
|
|
@@ -6749,7 +6749,7 @@ var require_which_typed_array = __commonJS((exports2, module2) => {
|
|
|
6749
6749
|
}
|
|
6750
6750
|
function tryTypedArrays(value) {
|
|
6751
6751
|
var found = false;
|
|
6752
|
-
|
|
6752
|
+
forEach2(cache, function(getter, typedArray) {
|
|
6753
6753
|
if (!found) {
|
|
6754
6754
|
try {
|
|
6755
6755
|
if ("$" + getter(value) === typedArray) {
|
|
@@ -6762,7 +6762,7 @@ var require_which_typed_array = __commonJS((exports2, module2) => {
|
|
|
6762
6762
|
}
|
|
6763
6763
|
function trySlices(value) {
|
|
6764
6764
|
var found = false;
|
|
6765
|
-
|
|
6765
|
+
forEach2(cache, function(getter, name) {
|
|
6766
6766
|
if (!found) {
|
|
6767
6767
|
try {
|
|
6768
6768
|
getter(value);
|
|
@@ -7733,7 +7733,7 @@ var require_buffer_list = __commonJS((exports2, module2) => {
|
|
|
7733
7733
|
}
|
|
7734
7734
|
}, {
|
|
7735
7735
|
key: "concat",
|
|
7736
|
-
value: function
|
|
7736
|
+
value: function concat2(n) {
|
|
7737
7737
|
if (this.length === 0)
|
|
7738
7738
|
return Buffer2.alloc(0);
|
|
7739
7739
|
var ret = Buffer2.allocUnsafe(n >>> 0);
|
|
@@ -10673,17 +10673,17 @@ function installPythonGlobals() {
|
|
|
10673
10673
|
globals.global = globalThis;
|
|
10674
10674
|
globals.self = globalThis;
|
|
10675
10675
|
globals.window = globalThis;
|
|
10676
|
-
globals.process ??= {
|
|
10677
|
-
|
|
10678
|
-
|
|
10679
|
-
|
|
10680
|
-
|
|
10681
|
-
|
|
10682
|
-
|
|
10683
|
-
|
|
10684
|
-
|
|
10685
|
-
|
|
10686
|
-
};
|
|
10676
|
+
const processGlobals = globals.process ??= {};
|
|
10677
|
+
processGlobals.arch ??= String(evaluate("__import__('platform').machine")()).replace("aarch64", "arm64").replace("x86_64", "x64");
|
|
10678
|
+
processGlobals.argv ??= [];
|
|
10679
|
+
processGlobals.browser ??= true;
|
|
10680
|
+
processGlobals.cwd ??= evaluate("__import__('os').getcwd");
|
|
10681
|
+
const environment = evaluate("lambda: dict(__import__('os').environ)")();
|
|
10682
|
+
processGlobals.env = Object.fromEntries(Object.entries(environment).map(([name, value]) => [name, String(value)]));
|
|
10683
|
+
processGlobals.nextTick ??= (callback, ...args) => Promise.resolve().then(() => callback(...args));
|
|
10684
|
+
processGlobals.platform ??= { Darwin: "darwin", Linux: "linux", Windows: "win32" }[String(evaluate("__import__('platform').system")())];
|
|
10685
|
+
processGlobals.version ??= "v22.0.0";
|
|
10686
|
+
processGlobals.versions ??= {};
|
|
10687
10687
|
}
|
|
10688
10688
|
installPythonGlobals();
|
|
10689
10689
|
function pythonHost() {
|
|
@@ -10739,12 +10739,19 @@ globals.URLSearchParams ??= WhatwgURLSearchParams;
|
|
|
10739
10739
|
globals.fetch ??= async (input, init = {}) => {
|
|
10740
10740
|
const request = typeof input === "object" && "url" in input ? input : undefined;
|
|
10741
10741
|
const headers = init.headers ?? request?.headers;
|
|
10742
|
-
const response = await pythonHost().http.fetch(request?.url ?? String(input), init.method ?? request?.method, headers ? Object.fromEntries(new Headers(headers).entries()) : undefined,
|
|
10742
|
+
const response = await pythonHost().http.fetch(request?.url ?? String(input), init.method ?? request?.method, headers ? Object.fromEntries(new Headers(headers).entries()) : undefined, requestBody(init.body));
|
|
10743
10743
|
return new Response(Uint8Array.from(response.body), {
|
|
10744
10744
|
status: response.status,
|
|
10745
10745
|
headers: response.headers
|
|
10746
10746
|
});
|
|
10747
10747
|
};
|
|
10748
|
+
function requestBody(body) {
|
|
10749
|
+
if (typeof body === "string")
|
|
10750
|
+
return body;
|
|
10751
|
+
if (body instanceof URLSearchParams)
|
|
10752
|
+
return body.toString();
|
|
10753
|
+
return;
|
|
10754
|
+
}
|
|
10748
10755
|
function cloneStructured(value, seen = new Map) {
|
|
10749
10756
|
if (value === null || typeof value !== "object")
|
|
10750
10757
|
return value;
|
|
@@ -10770,15 +10777,442 @@ function cloneStructured(value, seen = new Map) {
|
|
|
10770
10777
|
throw new TypeError(`PythonMonkey structuredClone does not support ${value.constructor.name}`);
|
|
10771
10778
|
}
|
|
10772
10779
|
|
|
10780
|
+
// packages/js/shared/core/src/net.ts
|
|
10781
|
+
var LOCAL_HOST_URL = new URL("http://localhost");
|
|
10782
|
+
var MAX_TCP_PORT = 65535;
|
|
10783
|
+
|
|
10784
|
+
// packages/js/shared/core/src/object.ts
|
|
10785
|
+
function isCollection(value) {
|
|
10786
|
+
return Array.isArray(value) || value instanceof Set || value instanceof Map;
|
|
10787
|
+
}
|
|
10788
|
+
function isEmpty(collection, options) {
|
|
10789
|
+
function visit(value, seen) {
|
|
10790
|
+
if (value == null) {
|
|
10791
|
+
return true;
|
|
10792
|
+
} else if (typeof value === "object") {
|
|
10793
|
+
if (seen?.has(value))
|
|
10794
|
+
return true;
|
|
10795
|
+
seen?.add(value);
|
|
10796
|
+
if (Array.isArray(value)) {
|
|
10797
|
+
return value.length === 0 || (seen ? value.every((item) => visit(item, seen)) : false);
|
|
10798
|
+
}
|
|
10799
|
+
if (value instanceof Set) {
|
|
10800
|
+
return value.size === 0 || (seen ? [...value].every((item) => visit(item, seen)) : false);
|
|
10801
|
+
}
|
|
10802
|
+
if (value instanceof Map) {
|
|
10803
|
+
return value.size === 0 || (seen ? [...value.values()].every((item) => visit(item, seen)) : false);
|
|
10804
|
+
}
|
|
10805
|
+
const keys = Object.keys(value);
|
|
10806
|
+
if (keys.length === 0) {
|
|
10807
|
+
return true;
|
|
10808
|
+
} else if (seen) {
|
|
10809
|
+
return keys.every((key) => visit(value[key], seen));
|
|
10810
|
+
} else {
|
|
10811
|
+
return false;
|
|
10812
|
+
}
|
|
10813
|
+
} else {
|
|
10814
|
+
return false;
|
|
10815
|
+
}
|
|
10816
|
+
}
|
|
10817
|
+
return visit(collection, options?.recursive ? new Set : undefined);
|
|
10818
|
+
}
|
|
10819
|
+
function values(source) {
|
|
10820
|
+
return source instanceof Map ? source.values() : source;
|
|
10821
|
+
}
|
|
10822
|
+
function isContainer(value) {
|
|
10823
|
+
return value != null && typeof value !== "string" && !(value instanceof String) && !(value instanceof RegExp) && typeof value !== "function" && typeof value[Symbol.iterator] === "function";
|
|
10824
|
+
}
|
|
10825
|
+
function sequenceSources(...sources) {
|
|
10826
|
+
const sourceIterables = [];
|
|
10827
|
+
for (const source of sources) {
|
|
10828
|
+
if (source == null || isCollection(source) && isEmpty(source))
|
|
10829
|
+
continue;
|
|
10830
|
+
sourceIterables.push(isContainer(source) ? values(source) : [source]);
|
|
10831
|
+
}
|
|
10832
|
+
return sourceIterables;
|
|
10833
|
+
}
|
|
10834
|
+
function flattenValue(value, depth) {
|
|
10835
|
+
if (depth > 0 && Array.isArray(value)) {
|
|
10836
|
+
const nextDepth = Number.isFinite(depth) ? depth - 1 : depth;
|
|
10837
|
+
return {
|
|
10838
|
+
*[Symbol.iterator]() {
|
|
10839
|
+
for (const item of value)
|
|
10840
|
+
yield* flattenValue(item, nextDepth);
|
|
10841
|
+
}
|
|
10842
|
+
};
|
|
10843
|
+
}
|
|
10844
|
+
return [value];
|
|
10845
|
+
}
|
|
10846
|
+
function derive(source, fn) {
|
|
10847
|
+
return sequence({
|
|
10848
|
+
*[Symbol.iterator]() {
|
|
10849
|
+
let index = 0;
|
|
10850
|
+
for (const value of source)
|
|
10851
|
+
yield* fn(value, index++);
|
|
10852
|
+
}
|
|
10853
|
+
});
|
|
10854
|
+
}
|
|
10855
|
+
function deriveOne(source, fn) {
|
|
10856
|
+
return sequence({
|
|
10857
|
+
*[Symbol.iterator]() {
|
|
10858
|
+
let index = 0;
|
|
10859
|
+
for (const value of source)
|
|
10860
|
+
yield fn(value, index++);
|
|
10861
|
+
}
|
|
10862
|
+
});
|
|
10863
|
+
}
|
|
10864
|
+
function map(source, callback) {
|
|
10865
|
+
return deriveOne(sequence(source), callback);
|
|
10866
|
+
}
|
|
10867
|
+
function filter(source, predicate) {
|
|
10868
|
+
return derive(sequence(source), function* (value, index) {
|
|
10869
|
+
if (predicate(value, index))
|
|
10870
|
+
yield value;
|
|
10871
|
+
});
|
|
10872
|
+
}
|
|
10873
|
+
function nonNull(...sources) {
|
|
10874
|
+
return filter(sequence(...sources), (value) => value != null);
|
|
10875
|
+
}
|
|
10876
|
+
function flatMap(source, callback) {
|
|
10877
|
+
return derive(sequence(source), function* (value, index) {
|
|
10878
|
+
const result = callback(value, index);
|
|
10879
|
+
if (Array.isArray(result))
|
|
10880
|
+
yield* result;
|
|
10881
|
+
else
|
|
10882
|
+
yield result;
|
|
10883
|
+
});
|
|
10884
|
+
}
|
|
10885
|
+
function flat(depth, ...sources) {
|
|
10886
|
+
const src = sequence(...sources);
|
|
10887
|
+
if (depth < 1)
|
|
10888
|
+
return src;
|
|
10889
|
+
return derive(src, (value) => flattenValue(value, depth));
|
|
10890
|
+
}
|
|
10891
|
+
function distinct(...sources) {
|
|
10892
|
+
const src = sequence(...sources);
|
|
10893
|
+
return sequence({
|
|
10894
|
+
*[Symbol.iterator]() {
|
|
10895
|
+
const seen = new Set;
|
|
10896
|
+
for (const value of src) {
|
|
10897
|
+
if (seen.has(value))
|
|
10898
|
+
continue;
|
|
10899
|
+
seen.add(value);
|
|
10900
|
+
yield value;
|
|
10901
|
+
}
|
|
10902
|
+
}
|
|
10903
|
+
});
|
|
10904
|
+
}
|
|
10905
|
+
function concat(source, ...items) {
|
|
10906
|
+
const src = sequence(source);
|
|
10907
|
+
if (items.length === 0)
|
|
10908
|
+
return src;
|
|
10909
|
+
return sequence({
|
|
10910
|
+
*[Symbol.iterator]() {
|
|
10911
|
+
yield* src;
|
|
10912
|
+
for (const item of items) {
|
|
10913
|
+
if (Array.isArray(item))
|
|
10914
|
+
yield* item;
|
|
10915
|
+
else
|
|
10916
|
+
yield item;
|
|
10917
|
+
}
|
|
10918
|
+
}
|
|
10919
|
+
});
|
|
10920
|
+
}
|
|
10921
|
+
function take(count, ...sources) {
|
|
10922
|
+
if (count <= 0)
|
|
10923
|
+
return emptySequence;
|
|
10924
|
+
const src = sequence(...sources);
|
|
10925
|
+
return sequence({
|
|
10926
|
+
*[Symbol.iterator]() {
|
|
10927
|
+
let taken = 0;
|
|
10928
|
+
for (const value of src) {
|
|
10929
|
+
yield value;
|
|
10930
|
+
if (++taken >= count)
|
|
10931
|
+
return;
|
|
10932
|
+
}
|
|
10933
|
+
}
|
|
10934
|
+
});
|
|
10935
|
+
}
|
|
10936
|
+
function group(predicates, ...sources) {
|
|
10937
|
+
const keys = Object.keys(predicates);
|
|
10938
|
+
const buckets = new Map(keys.map((key) => [key, []]));
|
|
10939
|
+
let index = 0;
|
|
10940
|
+
for (const value of sequence(...sources)) {
|
|
10941
|
+
const i = index++;
|
|
10942
|
+
for (const key of keys) {
|
|
10943
|
+
if (predicates[key](value, i)) {
|
|
10944
|
+
buckets.get(key).push(value);
|
|
10945
|
+
break;
|
|
10946
|
+
}
|
|
10947
|
+
}
|
|
10948
|
+
}
|
|
10949
|
+
const result = {};
|
|
10950
|
+
for (const key of keys) {
|
|
10951
|
+
result[key] = buckets.get(key);
|
|
10952
|
+
}
|
|
10953
|
+
return result;
|
|
10954
|
+
}
|
|
10955
|
+
function find(source, predicate) {
|
|
10956
|
+
let index = 0;
|
|
10957
|
+
for (const value of sequence(source)) {
|
|
10958
|
+
if (predicate(value, index++))
|
|
10959
|
+
return value;
|
|
10960
|
+
}
|
|
10961
|
+
return;
|
|
10962
|
+
}
|
|
10963
|
+
function findLast(source, predicate) {
|
|
10964
|
+
let index = 0;
|
|
10965
|
+
let match;
|
|
10966
|
+
for (const value of sequence(source)) {
|
|
10967
|
+
if (predicate(value, index++))
|
|
10968
|
+
match = value;
|
|
10969
|
+
}
|
|
10970
|
+
return match;
|
|
10971
|
+
}
|
|
10972
|
+
function findIndex(source, predicate) {
|
|
10973
|
+
let index = 0;
|
|
10974
|
+
for (const value of sequence(source)) {
|
|
10975
|
+
if (predicate(value, index))
|
|
10976
|
+
return index;
|
|
10977
|
+
index++;
|
|
10978
|
+
}
|
|
10979
|
+
return -1;
|
|
10980
|
+
}
|
|
10981
|
+
function findLastIndex(source, predicate) {
|
|
10982
|
+
let index = 0;
|
|
10983
|
+
let match = -1;
|
|
10984
|
+
for (const value of sequence(source)) {
|
|
10985
|
+
if (predicate(value, index))
|
|
10986
|
+
match = index;
|
|
10987
|
+
index++;
|
|
10988
|
+
}
|
|
10989
|
+
return match;
|
|
10990
|
+
}
|
|
10991
|
+
function some(source, predicate) {
|
|
10992
|
+
let index = 0;
|
|
10993
|
+
for (const value of sequence(source))
|
|
10994
|
+
if (predicate(value, index++))
|
|
10995
|
+
return true;
|
|
10996
|
+
return false;
|
|
10997
|
+
}
|
|
10998
|
+
function every(source, predicate) {
|
|
10999
|
+
let index = 0;
|
|
11000
|
+
for (const value of sequence(source))
|
|
11001
|
+
if (!predicate(value, index++))
|
|
11002
|
+
return false;
|
|
11003
|
+
return true;
|
|
11004
|
+
}
|
|
11005
|
+
function forEach(source, callback) {
|
|
11006
|
+
let index = 0;
|
|
11007
|
+
for (const value of sequence(source))
|
|
11008
|
+
callback(value, index++);
|
|
11009
|
+
}
|
|
11010
|
+
function at(index, ...sources) {
|
|
11011
|
+
const src = sequence(...sources);
|
|
11012
|
+
if (index < 0)
|
|
11013
|
+
return toArray(src).at(index);
|
|
11014
|
+
let i = 0;
|
|
11015
|
+
for (const value of src) {
|
|
11016
|
+
if (i++ === index)
|
|
11017
|
+
return value;
|
|
11018
|
+
}
|
|
11019
|
+
return;
|
|
11020
|
+
}
|
|
11021
|
+
function toArray(...sources) {
|
|
11022
|
+
return [...sequence(...sources)];
|
|
11023
|
+
}
|
|
11024
|
+
|
|
11025
|
+
class SequenceImpl {
|
|
11026
|
+
source;
|
|
11027
|
+
buffer;
|
|
11028
|
+
iterator;
|
|
11029
|
+
exhausted;
|
|
11030
|
+
constructor(source, buffer, state = {}) {
|
|
11031
|
+
this.source = source;
|
|
11032
|
+
this.buffer = buffer;
|
|
11033
|
+
this.exhausted = state.exhausted ?? false;
|
|
11034
|
+
}
|
|
11035
|
+
get caching() {
|
|
11036
|
+
return this.buffer !== undefined;
|
|
11037
|
+
}
|
|
11038
|
+
pull() {
|
|
11039
|
+
this.iterator ??= this.source[Symbol.iterator]();
|
|
11040
|
+
return this.iterator.next();
|
|
11041
|
+
}
|
|
11042
|
+
*[Symbol.iterator]() {
|
|
11043
|
+
if (!this.caching) {
|
|
11044
|
+
if (this.exhausted)
|
|
11045
|
+
return;
|
|
11046
|
+
for (let next = this.pull();!next.done; next = this.pull()) {
|
|
11047
|
+
yield next.value;
|
|
11048
|
+
}
|
|
11049
|
+
this.exhausted = true;
|
|
11050
|
+
} else {
|
|
11051
|
+
const buffer = this.buffer;
|
|
11052
|
+
let index = 0;
|
|
11053
|
+
for (;; ) {
|
|
11054
|
+
if (index < buffer.length) {
|
|
11055
|
+
yield buffer[index++];
|
|
11056
|
+
continue;
|
|
11057
|
+
}
|
|
11058
|
+
if (this.exhausted)
|
|
11059
|
+
return;
|
|
11060
|
+
const next = this.pull();
|
|
11061
|
+
if (next.done) {
|
|
11062
|
+
this.exhausted = true;
|
|
11063
|
+
return;
|
|
11064
|
+
}
|
|
11065
|
+
buffer.push(next.value);
|
|
11066
|
+
yield next.value;
|
|
11067
|
+
index++;
|
|
11068
|
+
}
|
|
11069
|
+
}
|
|
11070
|
+
}
|
|
11071
|
+
map(callback) {
|
|
11072
|
+
return map(this, callback);
|
|
11073
|
+
}
|
|
11074
|
+
filter(predicate) {
|
|
11075
|
+
return filter(this, predicate);
|
|
11076
|
+
}
|
|
11077
|
+
nonNull() {
|
|
11078
|
+
return nonNull(this);
|
|
11079
|
+
}
|
|
11080
|
+
flatMap(callback) {
|
|
11081
|
+
return flatMap(this, callback);
|
|
11082
|
+
}
|
|
11083
|
+
flat(depth = 1) {
|
|
11084
|
+
return flat(depth, this);
|
|
11085
|
+
}
|
|
11086
|
+
distinct() {
|
|
11087
|
+
return distinct(this);
|
|
11088
|
+
}
|
|
11089
|
+
concat(...items) {
|
|
11090
|
+
return concat(this, ...items);
|
|
11091
|
+
}
|
|
11092
|
+
join(...sources) {
|
|
11093
|
+
const sourceIterables = sequenceSources(this, ...sources);
|
|
11094
|
+
return sourceIterables.length === 1 ? this : sequence(...sourceIterables);
|
|
11095
|
+
}
|
|
11096
|
+
take(count) {
|
|
11097
|
+
return take(count, this);
|
|
11098
|
+
}
|
|
11099
|
+
group(predicates) {
|
|
11100
|
+
return group(predicates, this);
|
|
11101
|
+
}
|
|
11102
|
+
cache() {
|
|
11103
|
+
return this.caching ? this : new SequenceImpl(this, []);
|
|
11104
|
+
}
|
|
11105
|
+
find(predicate) {
|
|
11106
|
+
return find(this, predicate);
|
|
11107
|
+
}
|
|
11108
|
+
findLast(predicate) {
|
|
11109
|
+
return findLast(this, predicate);
|
|
11110
|
+
}
|
|
11111
|
+
findIndex(predicate) {
|
|
11112
|
+
return findIndex(this, predicate);
|
|
11113
|
+
}
|
|
11114
|
+
findLastIndex(predicate) {
|
|
11115
|
+
return findLastIndex(this, predicate);
|
|
11116
|
+
}
|
|
11117
|
+
some(predicate) {
|
|
11118
|
+
return some(this, predicate);
|
|
11119
|
+
}
|
|
11120
|
+
every(predicate) {
|
|
11121
|
+
return every(this, predicate);
|
|
11122
|
+
}
|
|
11123
|
+
forEach(callback) {
|
|
11124
|
+
forEach(this, callback);
|
|
11125
|
+
}
|
|
11126
|
+
at(index) {
|
|
11127
|
+
return at(index, this);
|
|
11128
|
+
}
|
|
11129
|
+
toArray() {
|
|
11130
|
+
if (this.caching && this.exhausted)
|
|
11131
|
+
return [...this.buffer];
|
|
11132
|
+
return toArray(this);
|
|
11133
|
+
}
|
|
11134
|
+
}
|
|
11135
|
+
var emptySequence = new SequenceImpl([], undefined, {
|
|
11136
|
+
exhausted: true
|
|
11137
|
+
});
|
|
11138
|
+
function sequence(...sources) {
|
|
11139
|
+
const sourceIterables = sequenceSources(...sources);
|
|
11140
|
+
if (sourceIterables.length === 0)
|
|
11141
|
+
return emptySequence;
|
|
11142
|
+
if (sourceIterables.length === 1) {
|
|
11143
|
+
const only = sourceIterables[0];
|
|
11144
|
+
return only instanceof SequenceImpl ? only : new SequenceImpl(only, undefined);
|
|
11145
|
+
}
|
|
11146
|
+
return new SequenceImpl({
|
|
11147
|
+
*[Symbol.iterator]() {
|
|
11148
|
+
for (const source of sourceIterables)
|
|
11149
|
+
yield* source;
|
|
11150
|
+
}
|
|
11151
|
+
}, undefined);
|
|
11152
|
+
}
|
|
11153
|
+
function toBoolean(value) {
|
|
11154
|
+
if (typeof value === "boolean") {
|
|
11155
|
+
return value;
|
|
11156
|
+
} else if (typeof value === "string") {
|
|
11157
|
+
value = value.trim().toLowerCase();
|
|
11158
|
+
if (value === "true" || value == "t" || value === "on" || value === "1" || value === "yes" || value === "y") {
|
|
11159
|
+
return true;
|
|
11160
|
+
} else if (value === "false" || value == "f" || value === "off" || value === "0" || value === "no" || value === "n") {
|
|
11161
|
+
return false;
|
|
11162
|
+
}
|
|
11163
|
+
} else if (typeof value === "number") {
|
|
11164
|
+
if (value === 1)
|
|
11165
|
+
return true;
|
|
11166
|
+
else if (value === 0)
|
|
11167
|
+
return false;
|
|
11168
|
+
}
|
|
11169
|
+
return;
|
|
11170
|
+
}
|
|
11171
|
+
var DURATION_UNITS = [
|
|
11172
|
+
[1, ["ms", "msec", "millisecond", "milli"]],
|
|
11173
|
+
[1000, ["s", "sec", "second"]],
|
|
11174
|
+
[60000, ["m", "min", "minute"]],
|
|
11175
|
+
[3600000, ["h", "hr", "hour"]],
|
|
11176
|
+
[86400000, ["d", "day"]],
|
|
11177
|
+
[604800000, ["w", "wk", "week"]],
|
|
11178
|
+
[2592000000, ["mo", "mon", "month"]],
|
|
11179
|
+
[31536000000, ["y", "yr", "year"]]
|
|
11180
|
+
];
|
|
11181
|
+
var DURATION_UNIT_MS = new Map(DURATION_UNITS.flatMap(([ms, aliases]) => aliases.map((alias) => [alias, ms])));
|
|
11182
|
+
|
|
11183
|
+
// packages/js/shared/core/src/environment-utils.ts
|
|
11184
|
+
function runtimeEnvironment() {
|
|
11185
|
+
return globalThis.process?.env ?? {};
|
|
11186
|
+
}
|
|
11187
|
+
function isDatabricksAppEnv(source = runtimeEnvironment()) {
|
|
11188
|
+
const override = toBoolean(source.DBX_TOOLS_DATABRICKS_APP_ENV);
|
|
11189
|
+
if (override !== undefined)
|
|
11190
|
+
return override;
|
|
11191
|
+
const name = source.DATABRICKS_APP_NAME?.trim();
|
|
11192
|
+
const host2 = source.DATABRICKS_HOST?.trim();
|
|
11193
|
+
const port = source.DATABRICKS_APP_PORT?.trim();
|
|
11194
|
+
if (name && /\$\{[^}]+\}/.test(name) || !host2 || !port || !/^\d+$/.test(port))
|
|
11195
|
+
return false;
|
|
11196
|
+
const parsedPort = Number(port);
|
|
11197
|
+
if (!Number.isInteger(parsedPort) || parsedPort < 1 || parsedPort > MAX_TCP_PORT)
|
|
11198
|
+
return false;
|
|
11199
|
+
try {
|
|
11200
|
+
const url = new URL(host2);
|
|
11201
|
+
return (url.protocol === "http:" || url.protocol === "https:") && Boolean(url.hostname);
|
|
11202
|
+
} catch {
|
|
11203
|
+
return false;
|
|
11204
|
+
}
|
|
11205
|
+
}
|
|
11206
|
+
|
|
10773
11207
|
// packages/py/node-runtime/shims/databricks-runtime-auth.ts
|
|
10774
11208
|
var createWorkspaceClient = evaluatePython("lambda: __import__('databricks.sdk', fromlist=['WorkspaceClient']).WorkspaceClient()");
|
|
10775
|
-
var isDatabricksRuntime = evaluatePython("lambda: bool(__import__('os').environ.get('DATABRICKS_RUNTIME_VERSION'))");
|
|
10776
11209
|
var runtimeMetadata = evaluatePython("lambda client: {'host': client.config.host, 'workspaceId': getattr(client.config, 'workspace_id', None), 'principal': getattr(client.config, 'client_id', None) or getattr(client.config, 'username', None) or getattr(client.config, 'auth_type', None)}");
|
|
10777
11210
|
var configuredToken = evaluatePython("lambda client: client.config.token");
|
|
10778
11211
|
var authenticationHeaders = evaluatePython("lambda client: dict(client.config.authenticate())");
|
|
10779
11212
|
async function databricksRuntimeAuthClient() {
|
|
10780
|
-
if (!
|
|
11213
|
+
if (isDatabricksAppEnv(process.env) || !process.env.DATABRICKS_RUNTIME_VERSION?.trim()) {
|
|
10781
11214
|
return;
|
|
11215
|
+
}
|
|
10782
11216
|
const client = await runPythonInThread(createWorkspaceClient);
|
|
10783
11217
|
const metadata = await runPythonInThread(runtimeMetadata, client);
|
|
10784
11218
|
return {
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
{dbx_tools_node_runtime-0.9.54 → dbx_tools_node_runtime-0.9.58}/src/dbx_tools/node_runtime/py.typed
RENAMED
|
File without changes
|
|
File without changes
|