@databricks/sdk-core 0.34.0 → 0.36.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.
- package/dist/apierror/apierror.d.ts +52 -49
- package/dist/apierror/apierror.d.ts.map +1 -1
- package/dist/apierror/apierror.js +124 -172
- package/dist/apierror/apierror.js.map +1 -1
- package/dist/apierror/codes/codes.d.ts +113 -113
- package/dist/apierror/codes/codes.d.ts.map +1 -1
- package/dist/apierror/codes/codes.js +24 -115
- package/dist/apierror/codes/codes.js.map +1 -1
- package/dist/apierror/codes/index.d.ts +2 -7
- package/dist/apierror/codes/index.js +3 -7
- package/dist/apierror/details.d.ts +104 -101
- package/dist/apierror/details.d.ts.map +1 -1
- package/dist/apierror/details.js +151 -226
- package/dist/apierror/details.js.map +1 -1
- package/dist/apierror/index.d.ts +3 -8
- package/dist/apierror/index.js +3 -7
- package/dist/clientinfo/agent.d.ts +6 -3
- package/dist/clientinfo/agent.d.ts.map +1 -1
- package/dist/clientinfo/agent.js +134 -112
- package/dist/clientinfo/agent.js.map +1 -1
- package/dist/clientinfo/base.d.ts +13 -15
- package/dist/clientinfo/base.d.ts.map +1 -1
- package/dist/clientinfo/base.js +50 -50
- package/dist/clientinfo/base.js.map +1 -1
- package/dist/clientinfo/clientinfo.d.ts +40 -38
- package/dist/clientinfo/clientinfo.d.ts.map +1 -1
- package/dist/clientinfo/clientinfo.js +78 -88
- package/dist/clientinfo/clientinfo.js.map +1 -1
- package/dist/clientinfo/default.browser.d.ts +6 -10
- package/dist/clientinfo/default.browser.d.ts.map +1 -1
- package/dist/clientinfo/default.browser.js +24 -16
- package/dist/clientinfo/default.browser.js.map +1 -1
- package/dist/clientinfo/default.d.ts +8 -4
- package/dist/clientinfo/default.d.ts.map +1 -1
- package/dist/clientinfo/default.js +157 -102
- package/dist/clientinfo/default.js.map +1 -1
- package/dist/clientinfo/index.browser.d.ts +4 -5
- package/dist/clientinfo/index.browser.js +5 -4
- package/dist/clientinfo/index.d.ts +4 -5
- package/dist/clientinfo/index.js +5 -4
- package/dist/clientinfo/meta-harness.d.ts +6 -3
- package/dist/clientinfo/meta-harness.d.ts.map +1 -1
- package/dist/clientinfo/meta-harness.js +30 -46
- package/dist/clientinfo/meta-harness.js.map +1 -1
- package/dist/http/http.d.ts +25 -22
- package/dist/http/http.d.ts.map +1 -1
- package/dist/http/http.js +24 -34
- package/dist/http/http.js.map +1 -1
- package/dist/http/index.d.ts +2 -8
- package/dist/http/index.js +3 -7
- package/dist/index.d.ts +1 -6
- package/dist/index.js +7 -5
- package/dist/index.js.map +1 -1
- package/dist/logger/index.d.ts +2 -8
- package/dist/logger/index.js +3 -7
- package/dist/logger/logger.d.ts +26 -23
- package/dist/logger/logger.d.ts.map +1 -1
- package/dist/logger/logger.js +46 -60
- package/dist/logger/logger.js.map +1 -1
- package/dist/ops/execute.d.ts +7 -3
- package/dist/ops/execute.d.ts.map +1 -1
- package/dist/ops/execute.js +55 -67
- package/dist/ops/execute.js.map +1 -1
- package/dist/ops/index.d.ts +5 -12
- package/dist/ops/index.js +4 -9
- package/dist/ops/limiter.d.ts +5 -2
- package/dist/ops/limiter.d.ts.map +1 -1
- package/dist/ops/limiter.js +0 -2
- package/dist/ops/options.d.ts +23 -19
- package/dist/ops/options.d.ts.map +1 -1
- package/dist/ops/options.js +0 -2
- package/dist/ops/retrier.d.ts +34 -31
- package/dist/ops/retrier.d.ts.map +1 -1
- package/dist/ops/retrier.js +55 -66
- package/dist/ops/retrier.js.map +1 -1
- package/dist/package.js +6 -0
- package/dist/package.js.map +1 -0
- package/dist/profiles/errors.d.ts +7 -4
- package/dist/profiles/errors.d.ts.map +1 -1
- package/dist/profiles/errors.js +16 -17
- package/dist/profiles/errors.js.map +1 -1
- package/dist/profiles/index.browser.d.ts +4 -10
- package/dist/profiles/index.browser.js +4 -8
- package/dist/profiles/index.d.ts +5 -15
- package/dist/profiles/index.js +5 -13
- package/dist/profiles/ini.d.ts +6 -3
- package/dist/profiles/ini.d.ts.map +1 -1
- package/dist/profiles/ini.js +60 -108
- package/dist/profiles/ini.js.map +1 -1
- package/dist/profiles/profile.d.ts +66 -67
- package/dist/profiles/profile.d.ts.map +1 -1
- package/dist/profiles/profile.js +89 -84
- package/dist/profiles/profile.js.map +1 -1
- package/dist/profiles/resolve.d.ts +8 -9
- package/dist/profiles/resolve.d.ts.map +1 -1
- package/dist/profiles/resolve.js +140 -185
- package/dist/profiles/resolve.js.map +1 -1
- package/dist/profiles/secret.d.ts +15 -12
- package/dist/profiles/secret.d.ts.map +1 -1
- package/dist/profiles/secret.js +38 -35
- package/dist/profiles/secret.js.map +1 -1
- package/dist/wkt/fieldmask.d.ts +23 -20
- package/dist/wkt/fieldmask.d.ts.map +1 -1
- package/dist/wkt/fieldmask.js +53 -62
- package/dist/wkt/fieldmask.js.map +1 -1
- package/dist/wkt/index.d.ts +3 -4
- package/dist/wkt/index.js +3 -2
- package/dist/wkt/value.d.ts +6 -3
- package/dist/wkt/value.d.ts.map +1 -1
- package/dist/wkt/value.js +0 -2
- package/package.json +2 -2
- package/dist/apierror/codes/index.d.ts.map +0 -1
- package/dist/apierror/codes/index.js.map +0 -1
- package/dist/apierror/index.d.ts.map +0 -1
- package/dist/apierror/index.js.map +0 -1
- package/dist/clientinfo/index.browser.d.ts.map +0 -1
- package/dist/clientinfo/index.browser.js.map +0 -1
- package/dist/clientinfo/index.d.ts.map +0 -1
- package/dist/clientinfo/index.js.map +0 -1
- package/dist/http/index.d.ts.map +0 -1
- package/dist/http/index.js.map +0 -1
- package/dist/index.d.ts.map +0 -1
- package/dist/logger/index.d.ts.map +0 -1
- package/dist/logger/index.js.map +0 -1
- package/dist/ops/index.d.ts.map +0 -1
- package/dist/ops/index.js.map +0 -1
- package/dist/ops/limiter.js.map +0 -1
- package/dist/ops/options.js.map +0 -1
- package/dist/profiles/index.browser.d.ts.map +0 -1
- package/dist/profiles/index.browser.js.map +0 -1
- package/dist/profiles/index.d.ts.map +0 -1
- package/dist/profiles/index.js.map +0 -1
- package/dist/wkt/index.d.ts.map +0 -1
- package/dist/wkt/index.js.map +0 -1
- package/dist/wkt/value.js.map +0 -1
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export { createDefault
|
|
5
|
-
//# sourceMappingURL=index.browser.d.ts.map
|
|
1
|
+
import { ClientInfo, ClientInfoError, ClientInfoErrorCode } from "./clientinfo.js";
|
|
2
|
+
import { addToDefault, setPartner, setProduct } from "./base.js";
|
|
3
|
+
import { createDefault } from "./default.browser.js";
|
|
4
|
+
export { ClientInfo, ClientInfoError, type ClientInfoErrorCode, addToDefault, createDefault, setPartner, setProduct };
|
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ClientInfo, ClientInfoError } from "./clientinfo.js";
|
|
2
|
+
import { addToDefault, setPartner, setProduct } from "./base.js";
|
|
3
|
+
import { createDefault } from "./default.browser.js";
|
|
4
|
+
|
|
5
|
+
export { ClientInfo, ClientInfoError, addToDefault, createDefault, setPartner, setProduct };
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export { createDefault
|
|
5
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import { ClientInfo, ClientInfoError, ClientInfoErrorCode } from "./clientinfo.js";
|
|
2
|
+
import { addToDefault, setPartner, setProduct } from "./base.js";
|
|
3
|
+
import { createDefault } from "./default.js";
|
|
4
|
+
export { ClientInfo, ClientInfoError, type ClientInfoErrorCode, addToDefault, createDefault, setPartner, setProduct };
|
package/dist/clientinfo/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
import { ClientInfo, ClientInfoError } from "./clientinfo.js";
|
|
2
|
+
import { addToDefault, setPartner, setProduct } from "./base.js";
|
|
3
|
+
import { createDefault } from "./default.js";
|
|
4
|
+
|
|
5
|
+
export { ClientInfo, ClientInfoError, addToDefault, createDefault, setPartner, setProduct };
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region src/clientinfo/meta-harness.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* Detects the agent meta-harness (e.g. omnigent) running the current process.
|
|
3
4
|
* A meta-harness orchestrates AI coding agents rather than being one, so it is
|
|
@@ -13,15 +14,17 @@
|
|
|
13
14
|
* when none is set. Detection is by presence, so any value (including empty)
|
|
14
15
|
* counts.
|
|
15
16
|
*/
|
|
16
|
-
|
|
17
|
+
declare function lookupMetaHarnessProvider(): string;
|
|
17
18
|
/**
|
|
18
19
|
* Returns the detected meta-harness name, cached for the process lifetime.
|
|
19
20
|
*/
|
|
20
|
-
|
|
21
|
+
declare function metaHarnessProvider(): string;
|
|
21
22
|
/**
|
|
22
23
|
* Clears the cached meta-harness detection result so that the next call to
|
|
23
24
|
* {@link metaHarnessProvider} re-evaluates the environment. Exported for
|
|
24
25
|
* testing only.
|
|
25
26
|
*/
|
|
26
|
-
|
|
27
|
+
declare function clearMetaHarnessCache(): void;
|
|
28
|
+
//#endregion
|
|
29
|
+
export { clearMetaHarnessCache, lookupMetaHarnessProvider, metaHarnessProvider };
|
|
27
30
|
//# sourceMappingURL=meta-harness.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta-harness.d.ts","
|
|
1
|
+
{"version":3,"file":"meta-harness.d.ts","names":[],"sources":["../../src/clientinfo/meta-harness.ts"],"mappings":";;AA6BA;;;;;AAqBA;;;;;AAUA;;;;iBA/BgB,yBAAA,CAAA;;;;iBAqBA,mBAAA,CAAA;;;;;;iBAUA,qBAAA,CAAA"}
|
|
@@ -1,54 +1,38 @@
|
|
|
1
|
+
//#region src/clientinfo/meta-harness.ts
|
|
2
|
+
const KNOWN_META_HARNESSES = [{
|
|
3
|
+
envVar: "OMNIGENT",
|
|
4
|
+
product: "omnigent"
|
|
5
|
+
}];
|
|
1
6
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// OMNIGENT is set by the omnigent meta-harness
|
|
14
|
-
// (https://github.com/omnigent-ai/omnigent).
|
|
15
|
-
{ envVar: 'OMNIGENT', product: 'omnigent' },
|
|
16
|
-
];
|
|
17
|
-
/**
|
|
18
|
-
* Checks environment variables for known meta-harnesses. Returns the product
|
|
19
|
-
* name when exactly one is set, `"multiple"` when more than one is set, or `""`
|
|
20
|
-
* when none is set. Detection is by presence, so any value (including empty)
|
|
21
|
-
* counts.
|
|
22
|
-
*/
|
|
23
|
-
export function lookupMetaHarnessProvider() {
|
|
24
|
-
const matches = [];
|
|
25
|
-
for (const h of KNOWN_META_HARNESSES) {
|
|
26
|
-
if (h.envVar in process.env) {
|
|
27
|
-
matches.push(h.product);
|
|
28
|
-
}
|
|
29
|
-
}
|
|
30
|
-
if (matches.length === 1) {
|
|
31
|
-
return matches[0];
|
|
32
|
-
}
|
|
33
|
-
if (matches.length > 1) {
|
|
34
|
-
return 'multiple';
|
|
35
|
-
}
|
|
36
|
-
return '';
|
|
7
|
+
* Checks environment variables for known meta-harnesses. Returns the product
|
|
8
|
+
* name when exactly one is set, `"multiple"` when more than one is set, or `""`
|
|
9
|
+
* when none is set. Detection is by presence, so any value (including empty)
|
|
10
|
+
* counts.
|
|
11
|
+
*/
|
|
12
|
+
function lookupMetaHarnessProvider() {
|
|
13
|
+
const matches = [];
|
|
14
|
+
for (const h of KNOWN_META_HARNESSES) if (h.envVar in process.env) matches.push(h.product);
|
|
15
|
+
if (matches.length === 1) return matches[0];
|
|
16
|
+
if (matches.length > 1) return "multiple";
|
|
17
|
+
return "";
|
|
37
18
|
}
|
|
38
19
|
let cached;
|
|
39
20
|
/**
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
21
|
+
* Returns the detected meta-harness name, cached for the process lifetime.
|
|
22
|
+
*/
|
|
23
|
+
function metaHarnessProvider() {
|
|
24
|
+
cached ??= lookupMetaHarnessProvider();
|
|
25
|
+
return cached;
|
|
45
26
|
}
|
|
46
27
|
/**
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
28
|
+
* Clears the cached meta-harness detection result so that the next call to
|
|
29
|
+
* {@link metaHarnessProvider} re-evaluates the environment. Exported for
|
|
30
|
+
* testing only.
|
|
31
|
+
*/
|
|
32
|
+
function clearMetaHarnessCache() {
|
|
33
|
+
cached = void 0;
|
|
53
34
|
}
|
|
35
|
+
|
|
36
|
+
//#endregion
|
|
37
|
+
export { clearMetaHarnessCache, lookupMetaHarnessProvider, metaHarnessProvider };
|
|
54
38
|
//# sourceMappingURL=meta-harness.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"meta-harness.js","
|
|
1
|
+
{"version":3,"file":"meta-harness.js","names":[],"sources":["../../src/clientinfo/meta-harness.ts"],"sourcesContent":["/**\n * Detects the agent meta-harness (e.g. omnigent) running the current process.\n * A meta-harness orchestrates AI coding agents rather than being one, so it is\n * reported as an independent `meta-harness/<name>` user-agent dimension\n * alongside `agent/<name>`. Kept in sync across the Go, Java, Python, and\n * TypeScript SDKs.\n *\n * @module\n */\n\ninterface KnownMetaHarness {\n readonly envVar: string;\n readonly product: string;\n}\n\n// Canonical list of known meta-harnesses, detected by env var presence. Keep\n// in sync with the Go, Java, and Python SDKs.\nconst KNOWN_META_HARNESSES: readonly KnownMetaHarness[] = [\n // OMNIGENT is set by the omnigent meta-harness\n // (https://github.com/omnigent-ai/omnigent).\n {envVar: 'OMNIGENT', product: 'omnigent'},\n];\n\n/**\n * Checks environment variables for known meta-harnesses. Returns the product\n * name when exactly one is set, `\"multiple\"` when more than one is set, or `\"\"`\n * when none is set. Detection is by presence, so any value (including empty)\n * counts.\n */\nexport function lookupMetaHarnessProvider(): string {\n const matches: string[] = [];\n for (const h of KNOWN_META_HARNESSES) {\n if (h.envVar in process.env) {\n matches.push(h.product);\n }\n }\n if (matches.length === 1) {\n return matches[0];\n }\n if (matches.length > 1) {\n return 'multiple';\n }\n return '';\n}\n\nlet cached: string | undefined;\n\n/**\n * Returns the detected meta-harness name, cached for the process lifetime.\n */\nexport function metaHarnessProvider(): string {\n cached ??= lookupMetaHarnessProvider();\n return cached;\n}\n\n/**\n * Clears the cached meta-harness detection result so that the next call to\n * {@link metaHarnessProvider} re-evaluates the environment. Exported for\n * testing only.\n */\nexport function clearMetaHarnessCache(): void {\n cached = undefined;\n}\n"],"mappings":";AAiBA,MAAM,uBAAoD,CAGxD;CAAC,QAAQ;CAAY,SAAS;CAAW,CAC1C;;;;;;;AAQD,SAAgB,4BAAoC;CAClD,MAAM,UAAoB,EAAE;AAC5B,MAAK,MAAM,KAAK,qBACd,KAAI,EAAE,UAAU,QAAQ,IACtB,SAAQ,KAAK,EAAE,QAAQ;AAG3B,KAAI,QAAQ,WAAW,EACrB,QAAO,QAAQ;AAEjB,KAAI,QAAQ,SAAS,EACnB,QAAO;AAET,QAAO;;AAGT,IAAI;;;;AAKJ,SAAgB,sBAA8B;AAC5C,YAAW,2BAA2B;AACtC,QAAO;;;;;;;AAQT,SAAgB,wBAA8B;AAC5C,UAAS"}
|
package/dist/http/http.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
//#region src/http/http.d.ts
|
|
1
2
|
/**
|
|
2
3
|
* HTTP transport primitives. Defines the {@link HttpClient} interface and a
|
|
3
4
|
* {@link newFetchHttpClient} implementation backed by the Fetch API.
|
|
@@ -5,36 +6,38 @@
|
|
|
5
6
|
* @module
|
|
6
7
|
*/
|
|
7
8
|
/** HttpRequest represents an outgoing HTTP request. */
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
9
|
+
interface HttpRequest {
|
|
10
|
+
/** The URL to send the request to. */
|
|
11
|
+
url: string;
|
|
12
|
+
/** The HTTP method (GET, POST, etc.). */
|
|
13
|
+
method: string;
|
|
14
|
+
/** The request headers. */
|
|
15
|
+
headers: Headers;
|
|
16
|
+
/** The request body. */
|
|
17
|
+
body?: string | ArrayBuffer | Uint8Array | ReadableStream<Uint8Array> | null;
|
|
18
|
+
/** An optional signal to abort the request. */
|
|
19
|
+
signal?: AbortSignal;
|
|
19
20
|
}
|
|
20
21
|
/** HttpResponse represents the response from an HTTP request. */
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
22
|
+
interface HttpResponse {
|
|
23
|
+
/** The HTTP status code. */
|
|
24
|
+
statusCode: number;
|
|
25
|
+
/** The response headers. */
|
|
26
|
+
headers: Headers;
|
|
27
|
+
/** The raw response body stream. */
|
|
28
|
+
body: ReadableStream<Uint8Array> | null;
|
|
28
29
|
}
|
|
29
30
|
/**
|
|
30
31
|
* HttpClient sends HTTP requests and returns responses.
|
|
31
32
|
*/
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
33
|
+
interface HttpClient {
|
|
34
|
+
/** Sends an HTTP request and returns the response. */
|
|
35
|
+
send(request: HttpRequest): Promise<HttpResponse>;
|
|
35
36
|
}
|
|
36
37
|
/**
|
|
37
38
|
* Creates a new HttpClient that uses the Fetch API as its transport.
|
|
38
39
|
*/
|
|
39
|
-
|
|
40
|
+
declare function newFetchHttpClient(): HttpClient;
|
|
41
|
+
//#endregion
|
|
42
|
+
export { HttpClient, HttpRequest, HttpResponse, newFetchHttpClient };
|
|
40
43
|
//# sourceMappingURL=http.d.ts.map
|
package/dist/http/http.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.d.ts","
|
|
1
|
+
{"version":3,"file":"http.d.ts","names":[],"sources":["../../src/http/http.ts"],"mappings":";;AAQA;;;;;;UAAiB,WAAA;EAW4B;EAT3C,GAAA;EAYoB;EATpB,MAAA;EAHA;EAMA,OAAA,EAAS,OAAA;EAAT;EAGA,IAAA,YAAgB,WAAA,GAAc,UAAA,GAAa,cAAA,CAAe,UAAA;EAA1D;EAGA,MAAA,GAAS,WAAA;AAAA;;UAIM,YAAA;EAJf;EAMA,UAAA;EANoB;EASpB,OAAA,EAAS,OAAA;EALM;EAQf,IAAA,EAAM,cAAA,CAAe,UAAA;AAAA;;;;UAMN,UAAA;EANK;EAQpB,IAAA,CAAK,OAAA,EAAS,WAAA,GAAc,OAAA,CAAQ,YAAA;AAAA;;;;iBAMtB,kBAAA,CAAA,GAAsB,UAAA"}
|
package/dist/http/http.js
CHANGED
|
@@ -1,37 +1,27 @@
|
|
|
1
|
+
//#region src/http/http.ts
|
|
1
2
|
/**
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
init.duplex = 'half';
|
|
23
|
-
}
|
|
24
|
-
}
|
|
25
|
-
if (request.signal !== undefined) {
|
|
26
|
-
init.signal = request.signal;
|
|
27
|
-
}
|
|
28
|
-
const response = await fetch(request.url, init);
|
|
29
|
-
return {
|
|
30
|
-
statusCode: response.status,
|
|
31
|
-
headers: response.headers,
|
|
32
|
-
body: response.body,
|
|
33
|
-
};
|
|
34
|
-
},
|
|
35
|
-
};
|
|
3
|
+
* Creates a new HttpClient that uses the Fetch API as its transport.
|
|
4
|
+
*/
|
|
5
|
+
function newFetchHttpClient() {
|
|
6
|
+
return { async send(request) {
|
|
7
|
+
const init = {
|
|
8
|
+
method: request.method,
|
|
9
|
+
headers: request.headers
|
|
10
|
+
};
|
|
11
|
+
if (request.body !== void 0) {
|
|
12
|
+
init.body = request.body;
|
|
13
|
+
if (request.body instanceof ReadableStream) init.duplex = "half";
|
|
14
|
+
}
|
|
15
|
+
if (request.signal !== void 0) init.signal = request.signal;
|
|
16
|
+
const response = await fetch(request.url, init);
|
|
17
|
+
return {
|
|
18
|
+
statusCode: response.status,
|
|
19
|
+
headers: response.headers,
|
|
20
|
+
body: response.body
|
|
21
|
+
};
|
|
22
|
+
} };
|
|
36
23
|
}
|
|
24
|
+
|
|
25
|
+
//#endregion
|
|
26
|
+
export { newFetchHttpClient };
|
|
37
27
|
//# sourceMappingURL=http.js.map
|
package/dist/http/http.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"http.js","
|
|
1
|
+
{"version":3,"file":"http.js","names":[],"sources":["../../src/http/http.ts"],"sourcesContent":["/**\n * HTTP transport primitives. Defines the {@link HttpClient} interface and a\n * {@link newFetchHttpClient} implementation backed by the Fetch API.\n *\n * @module\n */\n\n/** HttpRequest represents an outgoing HTTP request. */\nexport interface HttpRequest {\n /** The URL to send the request to. */\n url: string;\n\n /** The HTTP method (GET, POST, etc.). */\n method: string;\n\n /** The request headers. */\n headers: Headers;\n\n /** The request body. */\n body?: string | ArrayBuffer | Uint8Array | ReadableStream<Uint8Array> | null;\n\n /** An optional signal to abort the request. */\n signal?: AbortSignal;\n}\n\n/** HttpResponse represents the response from an HTTP request. */\nexport interface HttpResponse {\n /** The HTTP status code. */\n statusCode: number;\n\n /** The response headers. */\n headers: Headers;\n\n /** The raw response body stream. */\n body: ReadableStream<Uint8Array> | null;\n}\n\n/**\n * HttpClient sends HTTP requests and returns responses.\n */\nexport interface HttpClient {\n /** Sends an HTTP request and returns the response. */\n send(request: HttpRequest): Promise<HttpResponse>;\n}\n\n/**\n * Creates a new HttpClient that uses the Fetch API as its transport.\n */\nexport function newFetchHttpClient(): HttpClient {\n return {\n async send(request: HttpRequest): Promise<HttpResponse> {\n const init: RequestInit = {\n method: request.method,\n headers: request.headers,\n };\n if (request.body !== undefined) {\n init.body = request.body;\n // The Fetch spec requires duplex: 'half' for streaming request bodies.\n // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.\n if (request.body instanceof ReadableStream) {\n init.duplex = 'half';\n }\n }\n if (request.signal !== undefined) {\n init.signal = request.signal;\n }\n const response = await fetch(request.url, init);\n return {\n statusCode: response.status,\n headers: response.headers,\n body: response.body,\n };\n },\n };\n}\n"],"mappings":";;;;AAgDA,SAAgB,qBAAiC;AAC/C,QAAO,EACL,MAAM,KAAK,SAA6C;EACtD,MAAM,OAAoB;GACxB,QAAQ,QAAQ;GAChB,SAAS,QAAQ;GAClB;AACD,MAAI,QAAQ,SAAS,QAAW;AAC9B,QAAK,OAAO,QAAQ;AAGpB,OAAI,QAAQ,gBAAgB,eAC1B,MAAK,SAAS;;AAGlB,MAAI,QAAQ,WAAW,OACrB,MAAK,SAAS,QAAQ;EAExB,MAAM,WAAW,MAAM,MAAM,QAAQ,KAAK,KAAK;AAC/C,SAAO;GACL,YAAY,SAAS;GACrB,SAAS,SAAS;GAClB,MAAM,SAAS;GAChB;IAEJ"}
|
package/dist/http/index.d.ts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* @packageDocumentation
|
|
5
|
-
*/
|
|
6
|
-
export { newFetchHttpClient } from './http';
|
|
7
|
-
export type { HttpClient, HttpRequest, HttpResponse } from './http';
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import { HttpClient, HttpRequest, HttpResponse, newFetchHttpClient } from "./http.js";
|
|
2
|
+
export { type HttpClient, type HttpRequest, type HttpResponse, newFetchHttpClient };
|
package/dist/http/index.js
CHANGED
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","
|
|
1
|
+
{"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * Databricks core library.\n *\n * @packageDocumentation\n */\n"],"mappings":""}
|
package/dist/logger/index.d.ts
CHANGED
|
@@ -1,8 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
*
|
|
4
|
-
* @packageDocumentation
|
|
5
|
-
*/
|
|
6
|
-
export type { Level, Logger } from './logger';
|
|
7
|
-
export { NoOpLogger, LogLevel } from './logger';
|
|
8
|
-
//# sourceMappingURL=index.d.ts.map
|
|
1
|
+
import { Level, LogLevel, Logger, NoOpLogger } from "./logger.js";
|
|
2
|
+
export { type Level, LogLevel, type Logger, NoOpLogger };
|
package/dist/logger/index.js
CHANGED
|
@@ -1,7 +1,3 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
* @packageDocumentation
|
|
5
|
-
*/
|
|
6
|
-
export { NoOpLogger, LogLevel } from './logger';
|
|
7
|
-
//# sourceMappingURL=index.js.map
|
|
1
|
+
import { LogLevel, NoOpLogger } from "./logger.js";
|
|
2
|
+
|
|
3
|
+
export { LogLevel, NoOpLogger };
|
package/dist/logger/logger.d.ts
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
|
+
//#region src/logger/logger.d.ts
|
|
1
2
|
/** Logger interface and built-in implementations. */
|
|
2
3
|
/** Supported log levels in order of increasing severity. */
|
|
3
|
-
|
|
4
|
+
type Level = 'debug' | 'info' | 'warn' | 'error' | 'off';
|
|
4
5
|
/**
|
|
5
6
|
* A logger that receives messages at different severity levels.
|
|
6
7
|
*
|
|
@@ -8,22 +9,22 @@ export type Level = 'debug' | 'info' | 'warn' | 'error' | 'off';
|
|
|
8
9
|
* {@link Console} object so that `console` can be used as a Logger when level
|
|
9
10
|
* filtering is not needed.
|
|
10
11
|
*/
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
12
|
+
interface Logger {
|
|
13
|
+
/** Logs a debug-level message. */
|
|
14
|
+
debug(message: string, ...args: unknown[]): void;
|
|
15
|
+
/** Logs an info-level message. */
|
|
16
|
+
info(message: string, ...args: unknown[]): void;
|
|
17
|
+
/** Logs a warn-level message. */
|
|
18
|
+
warn(message: string, ...args: unknown[]): void;
|
|
19
|
+
/** Logs an error-level message. */
|
|
20
|
+
error(message: string, ...args: unknown[]): void;
|
|
20
21
|
}
|
|
21
22
|
/** A logger that silently discards all messages. */
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
declare class NoOpLogger implements Logger {
|
|
24
|
+
debug(): void;
|
|
25
|
+
info(): void;
|
|
26
|
+
warn(): void;
|
|
27
|
+
error(): void;
|
|
27
28
|
}
|
|
28
29
|
/**
|
|
29
30
|
* A decorator that adds level filtering to any {@link Logger}.
|
|
@@ -37,13 +38,15 @@ export declare class NoOpLogger implements Logger {
|
|
|
37
38
|
* const logger = new LogLevel('warn');
|
|
38
39
|
* ```
|
|
39
40
|
*/
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
41
|
+
declare class LogLevel implements Logger {
|
|
42
|
+
private readonly threshold;
|
|
43
|
+
private readonly logger;
|
|
44
|
+
constructor(level: Level, logger?: Logger);
|
|
45
|
+
debug(message: string, ...args: unknown[]): void;
|
|
46
|
+
info(message: string, ...args: unknown[]): void;
|
|
47
|
+
warn(message: string, ...args: unknown[]): void;
|
|
48
|
+
error(message: string, ...args: unknown[]): void;
|
|
48
49
|
}
|
|
50
|
+
//#endregion
|
|
51
|
+
export { Level, LogLevel, Logger, NoOpLogger };
|
|
49
52
|
//# sourceMappingURL=logger.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.d.ts","
|
|
1
|
+
{"version":3,"file":"logger.d.ts","names":[],"sources":["../../src/logger/logger.ts"],"mappings":";;AAGA;AAAA,KAAY,KAAA;;;;AASZ;;;;UAAiB,MAAA;EAET;EAAN,KAAA,CAAM,OAAA,aAAoB,IAAA;EAG1B;EAAA,IAAA,CAAK,OAAA,aAAoB,IAAA;EAAA;EAGzB,IAAA,CAAK,OAAA,aAAoB,IAAA;EAApB;EAGL,KAAA,CAAM,OAAA,aAAoB,IAAA;AAAA;;cAIf,UAAA,YAAsB,MAAA;EACjC,KAAA,CAAA;EAIA,IAAA,CAAA;EAIA,IAAA,CAAA;EAIA,KAAA,CAAA;AAAA;;;;;;;;;AA0BF;;;;cAAa,QAAA,YAAoB,MAAA;EAAA,iBACd,SAAA;EAAA,iBACA,MAAA;cAEL,KAAA,EAAO,KAAA,EAAO,MAAA,GAAQ,MAAA;EAKlC,KAAA,CAAM,OAAA,aAAoB,IAAA;EAM1B,IAAA,CAAK,OAAA,aAAoB,IAAA;EAMzB,IAAA,CAAK,OAAA,aAAoB,IAAA;EAMzB,KAAA,CAAM,OAAA,aAAoB,IAAA;AAAA"}
|
package/dist/logger/logger.js
CHANGED
|
@@ -1,65 +1,51 @@
|
|
|
1
|
-
|
|
1
|
+
//#region src/logger/logger.ts
|
|
2
2
|
/** A logger that silently discards all messages. */
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
}
|
|
10
|
-
warn() {
|
|
11
|
-
// Intentionally empty.
|
|
12
|
-
}
|
|
13
|
-
error() {
|
|
14
|
-
// Intentionally empty.
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
// Numeric severity used by LogLevel to gate calls.
|
|
3
|
+
var NoOpLogger = class {
|
|
4
|
+
debug() {}
|
|
5
|
+
info() {}
|
|
6
|
+
warn() {}
|
|
7
|
+
error() {}
|
|
8
|
+
};
|
|
18
9
|
const LEVEL_SEVERITY = {
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
10
|
+
debug: 0,
|
|
11
|
+
info: 1,
|
|
12
|
+
warn: 2,
|
|
13
|
+
error: 3,
|
|
14
|
+
off: 4
|
|
24
15
|
};
|
|
25
16
|
/**
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
if (this.threshold <= LEVEL_SEVERITY.error) {
|
|
61
|
-
this.logger.error(message, ...args);
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
}
|
|
17
|
+
* A decorator that adds level filtering to any {@link Logger}.
|
|
18
|
+
*
|
|
19
|
+
* Only messages at or above the configured minimum level are forwarded to the
|
|
20
|
+
* underlying logger. The default underlying logger is `console`.
|
|
21
|
+
*
|
|
22
|
+
* @example
|
|
23
|
+
* ```typescript
|
|
24
|
+
* // Only warn and error go to console.
|
|
25
|
+
* const logger = new LogLevel('warn');
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
var LogLevel = class {
|
|
29
|
+
threshold;
|
|
30
|
+
logger;
|
|
31
|
+
constructor(level, logger = console) {
|
|
32
|
+
this.threshold = LEVEL_SEVERITY[level];
|
|
33
|
+
this.logger = logger;
|
|
34
|
+
}
|
|
35
|
+
debug(message, ...args) {
|
|
36
|
+
if (this.threshold <= LEVEL_SEVERITY.debug) this.logger.debug(message, ...args);
|
|
37
|
+
}
|
|
38
|
+
info(message, ...args) {
|
|
39
|
+
if (this.threshold <= LEVEL_SEVERITY.info) this.logger.info(message, ...args);
|
|
40
|
+
}
|
|
41
|
+
warn(message, ...args) {
|
|
42
|
+
if (this.threshold <= LEVEL_SEVERITY.warn) this.logger.warn(message, ...args);
|
|
43
|
+
}
|
|
44
|
+
error(message, ...args) {
|
|
45
|
+
if (this.threshold <= LEVEL_SEVERITY.error) this.logger.error(message, ...args);
|
|
46
|
+
}
|
|
47
|
+
};
|
|
48
|
+
|
|
49
|
+
//#endregion
|
|
50
|
+
export { LogLevel, NoOpLogger };
|
|
65
51
|
//# sourceMappingURL=logger.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"logger.js","
|
|
1
|
+
{"version":3,"file":"logger.js","names":[],"sources":["../../src/logger/logger.ts"],"sourcesContent":["/** Logger interface and built-in implementations. */\n\n/** Supported log levels in order of increasing severity. */\nexport type Level = 'debug' | 'info' | 'warn' | 'error' | 'off';\n\n/**\n * A logger that receives messages at different severity levels.\n *\n * The method signatures are intentionally compatible with the global\n * {@link Console} object so that `console` can be used as a Logger when level\n * filtering is not needed.\n */\nexport interface Logger {\n /** Logs a debug-level message. */\n debug(message: string, ...args: unknown[]): void;\n\n /** Logs an info-level message. */\n info(message: string, ...args: unknown[]): void;\n\n /** Logs a warn-level message. */\n warn(message: string, ...args: unknown[]): void;\n\n /** Logs an error-level message. */\n error(message: string, ...args: unknown[]): void;\n}\n\n/** A logger that silently discards all messages. */\nexport class NoOpLogger implements Logger {\n debug(): void {\n // Intentionally empty.\n }\n\n info(): void {\n // Intentionally empty.\n }\n\n warn(): void {\n // Intentionally empty.\n }\n\n error(): void {\n // Intentionally empty.\n }\n}\n\n// Numeric severity used by LogLevel to gate calls.\nconst LEVEL_SEVERITY: Record<Level, number> = {\n debug: 0,\n info: 1,\n warn: 2,\n error: 3,\n off: 4,\n};\n\n/**\n * A decorator that adds level filtering to any {@link Logger}.\n *\n * Only messages at or above the configured minimum level are forwarded to the\n * underlying logger. The default underlying logger is `console`.\n *\n * @example\n * ```typescript\n * // Only warn and error go to console.\n * const logger = new LogLevel('warn');\n * ```\n */\nexport class LogLevel implements Logger {\n private readonly threshold: number;\n private readonly logger: Logger;\n\n constructor(level: Level, logger: Logger = console) {\n this.threshold = LEVEL_SEVERITY[level];\n this.logger = logger;\n }\n\n debug(message: string, ...args: unknown[]): void {\n if (this.threshold <= LEVEL_SEVERITY.debug) {\n this.logger.debug(message, ...args);\n }\n }\n\n info(message: string, ...args: unknown[]): void {\n if (this.threshold <= LEVEL_SEVERITY.info) {\n this.logger.info(message, ...args);\n }\n }\n\n warn(message: string, ...args: unknown[]): void {\n if (this.threshold <= LEVEL_SEVERITY.warn) {\n this.logger.warn(message, ...args);\n }\n }\n\n error(message: string, ...args: unknown[]): void {\n if (this.threshold <= LEVEL_SEVERITY.error) {\n this.logger.error(message, ...args);\n }\n }\n}\n"],"mappings":";;AA2BA,IAAa,aAAb,MAA0C;CACxC,QAAc;CAId,OAAa;CAIb,OAAa;CAIb,QAAc;;AAMhB,MAAM,iBAAwC;CAC5C,OAAO;CACP,MAAM;CACN,MAAM;CACN,OAAO;CACP,KAAK;CACN;;;;;;;;;;;;;AAcD,IAAa,WAAb,MAAwC;CACtC,AAAiB;CACjB,AAAiB;CAEjB,YAAY,OAAc,SAAiB,SAAS;AAClD,OAAK,YAAY,eAAe;AAChC,OAAK,SAAS;;CAGhB,MAAM,SAAiB,GAAG,MAAuB;AAC/C,MAAI,KAAK,aAAa,eAAe,MACnC,MAAK,OAAO,MAAM,SAAS,GAAG,KAAK;;CAIvC,KAAK,SAAiB,GAAG,MAAuB;AAC9C,MAAI,KAAK,aAAa,eAAe,KACnC,MAAK,OAAO,KAAK,SAAS,GAAG,KAAK;;CAItC,KAAK,SAAiB,GAAG,MAAuB;AAC9C,MAAI,KAAK,aAAa,eAAe,KACnC,MAAK,OAAO,KAAK,SAAS,GAAG,KAAK;;CAItC,MAAM,SAAiB,GAAG,MAAuB;AAC/C,MAAI,KAAK,aAAa,eAAe,MACnC,MAAK,OAAO,MAAM,SAAS,GAAG,KAAK"}
|