@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.
Files changed (135) hide show
  1. package/dist/apierror/apierror.d.ts +52 -49
  2. package/dist/apierror/apierror.d.ts.map +1 -1
  3. package/dist/apierror/apierror.js +124 -172
  4. package/dist/apierror/apierror.js.map +1 -1
  5. package/dist/apierror/codes/codes.d.ts +113 -113
  6. package/dist/apierror/codes/codes.d.ts.map +1 -1
  7. package/dist/apierror/codes/codes.js +24 -115
  8. package/dist/apierror/codes/codes.js.map +1 -1
  9. package/dist/apierror/codes/index.d.ts +2 -7
  10. package/dist/apierror/codes/index.js +3 -7
  11. package/dist/apierror/details.d.ts +104 -101
  12. package/dist/apierror/details.d.ts.map +1 -1
  13. package/dist/apierror/details.js +151 -226
  14. package/dist/apierror/details.js.map +1 -1
  15. package/dist/apierror/index.d.ts +3 -8
  16. package/dist/apierror/index.js +3 -7
  17. package/dist/clientinfo/agent.d.ts +6 -3
  18. package/dist/clientinfo/agent.d.ts.map +1 -1
  19. package/dist/clientinfo/agent.js +134 -112
  20. package/dist/clientinfo/agent.js.map +1 -1
  21. package/dist/clientinfo/base.d.ts +13 -15
  22. package/dist/clientinfo/base.d.ts.map +1 -1
  23. package/dist/clientinfo/base.js +50 -50
  24. package/dist/clientinfo/base.js.map +1 -1
  25. package/dist/clientinfo/clientinfo.d.ts +40 -38
  26. package/dist/clientinfo/clientinfo.d.ts.map +1 -1
  27. package/dist/clientinfo/clientinfo.js +78 -88
  28. package/dist/clientinfo/clientinfo.js.map +1 -1
  29. package/dist/clientinfo/default.browser.d.ts +6 -10
  30. package/dist/clientinfo/default.browser.d.ts.map +1 -1
  31. package/dist/clientinfo/default.browser.js +24 -16
  32. package/dist/clientinfo/default.browser.js.map +1 -1
  33. package/dist/clientinfo/default.d.ts +8 -4
  34. package/dist/clientinfo/default.d.ts.map +1 -1
  35. package/dist/clientinfo/default.js +157 -102
  36. package/dist/clientinfo/default.js.map +1 -1
  37. package/dist/clientinfo/index.browser.d.ts +4 -5
  38. package/dist/clientinfo/index.browser.js +5 -4
  39. package/dist/clientinfo/index.d.ts +4 -5
  40. package/dist/clientinfo/index.js +5 -4
  41. package/dist/clientinfo/meta-harness.d.ts +6 -3
  42. package/dist/clientinfo/meta-harness.d.ts.map +1 -1
  43. package/dist/clientinfo/meta-harness.js +30 -46
  44. package/dist/clientinfo/meta-harness.js.map +1 -1
  45. package/dist/http/http.d.ts +25 -22
  46. package/dist/http/http.d.ts.map +1 -1
  47. package/dist/http/http.js +24 -34
  48. package/dist/http/http.js.map +1 -1
  49. package/dist/http/index.d.ts +2 -8
  50. package/dist/http/index.js +3 -7
  51. package/dist/index.d.ts +1 -6
  52. package/dist/index.js +7 -5
  53. package/dist/index.js.map +1 -1
  54. package/dist/logger/index.d.ts +2 -8
  55. package/dist/logger/index.js +3 -7
  56. package/dist/logger/logger.d.ts +26 -23
  57. package/dist/logger/logger.d.ts.map +1 -1
  58. package/dist/logger/logger.js +46 -60
  59. package/dist/logger/logger.js.map +1 -1
  60. package/dist/ops/execute.d.ts +7 -3
  61. package/dist/ops/execute.d.ts.map +1 -1
  62. package/dist/ops/execute.js +55 -67
  63. package/dist/ops/execute.js.map +1 -1
  64. package/dist/ops/index.d.ts +5 -12
  65. package/dist/ops/index.js +4 -9
  66. package/dist/ops/limiter.d.ts +5 -2
  67. package/dist/ops/limiter.d.ts.map +1 -1
  68. package/dist/ops/limiter.js +0 -2
  69. package/dist/ops/options.d.ts +23 -19
  70. package/dist/ops/options.d.ts.map +1 -1
  71. package/dist/ops/options.js +0 -2
  72. package/dist/ops/retrier.d.ts +34 -31
  73. package/dist/ops/retrier.d.ts.map +1 -1
  74. package/dist/ops/retrier.js +55 -66
  75. package/dist/ops/retrier.js.map +1 -1
  76. package/dist/package.js +6 -0
  77. package/dist/package.js.map +1 -0
  78. package/dist/profiles/errors.d.ts +7 -4
  79. package/dist/profiles/errors.d.ts.map +1 -1
  80. package/dist/profiles/errors.js +16 -17
  81. package/dist/profiles/errors.js.map +1 -1
  82. package/dist/profiles/index.browser.d.ts +4 -10
  83. package/dist/profiles/index.browser.js +4 -8
  84. package/dist/profiles/index.d.ts +5 -15
  85. package/dist/profiles/index.js +5 -13
  86. package/dist/profiles/ini.d.ts +6 -3
  87. package/dist/profiles/ini.d.ts.map +1 -1
  88. package/dist/profiles/ini.js +60 -108
  89. package/dist/profiles/ini.js.map +1 -1
  90. package/dist/profiles/profile.d.ts +66 -67
  91. package/dist/profiles/profile.d.ts.map +1 -1
  92. package/dist/profiles/profile.js +89 -84
  93. package/dist/profiles/profile.js.map +1 -1
  94. package/dist/profiles/resolve.d.ts +8 -9
  95. package/dist/profiles/resolve.d.ts.map +1 -1
  96. package/dist/profiles/resolve.js +140 -185
  97. package/dist/profiles/resolve.js.map +1 -1
  98. package/dist/profiles/secret.d.ts +15 -12
  99. package/dist/profiles/secret.d.ts.map +1 -1
  100. package/dist/profiles/secret.js +38 -35
  101. package/dist/profiles/secret.js.map +1 -1
  102. package/dist/wkt/fieldmask.d.ts +23 -20
  103. package/dist/wkt/fieldmask.d.ts.map +1 -1
  104. package/dist/wkt/fieldmask.js +53 -62
  105. package/dist/wkt/fieldmask.js.map +1 -1
  106. package/dist/wkt/index.d.ts +3 -4
  107. package/dist/wkt/index.js +3 -2
  108. package/dist/wkt/value.d.ts +6 -3
  109. package/dist/wkt/value.d.ts.map +1 -1
  110. package/dist/wkt/value.js +0 -2
  111. package/package.json +2 -2
  112. package/dist/apierror/codes/index.d.ts.map +0 -1
  113. package/dist/apierror/codes/index.js.map +0 -1
  114. package/dist/apierror/index.d.ts.map +0 -1
  115. package/dist/apierror/index.js.map +0 -1
  116. package/dist/clientinfo/index.browser.d.ts.map +0 -1
  117. package/dist/clientinfo/index.browser.js.map +0 -1
  118. package/dist/clientinfo/index.d.ts.map +0 -1
  119. package/dist/clientinfo/index.js.map +0 -1
  120. package/dist/http/index.d.ts.map +0 -1
  121. package/dist/http/index.js.map +0 -1
  122. package/dist/index.d.ts.map +0 -1
  123. package/dist/logger/index.d.ts.map +0 -1
  124. package/dist/logger/index.js.map +0 -1
  125. package/dist/ops/index.d.ts.map +0 -1
  126. package/dist/ops/index.js.map +0 -1
  127. package/dist/ops/limiter.js.map +0 -1
  128. package/dist/ops/options.js.map +0 -1
  129. package/dist/profiles/index.browser.d.ts.map +0 -1
  130. package/dist/profiles/index.browser.js.map +0 -1
  131. package/dist/profiles/index.d.ts.map +0 -1
  132. package/dist/profiles/index.js.map +0 -1
  133. package/dist/wkt/index.d.ts.map +0 -1
  134. package/dist/wkt/index.js.map +0 -1
  135. package/dist/wkt/value.js.map +0 -1
@@ -1,5 +1,4 @@
1
- export type { ClientInfoErrorCode } from './clientinfo';
2
- export { ClientInfo, ClientInfoError } from './clientinfo';
3
- export { addToDefault, setPartner, setProduct } from './base';
4
- export { createDefault } from './default.browser';
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
- export { ClientInfo, ClientInfoError } from './clientinfo';
2
- export { addToDefault, setPartner, setProduct } from './base';
3
- export { createDefault } from './default.browser';
4
- //# sourceMappingURL=index.browser.js.map
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
- export type { ClientInfoErrorCode } from './clientinfo';
2
- export { ClientInfo, ClientInfoError } from './clientinfo';
3
- export { addToDefault, setPartner, setProduct } from './base';
4
- export { createDefault } from './default';
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 };
@@ -1,4 +1,5 @@
1
- export { ClientInfo, ClientInfoError } from './clientinfo';
2
- export { addToDefault, setPartner, setProduct } from './base';
3
- export { createDefault } from './default';
4
- //# sourceMappingURL=index.js.map
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
- export declare function lookupMetaHarnessProvider(): string;
17
+ declare function lookupMetaHarnessProvider(): string;
17
18
  /**
18
19
  * Returns the detected meta-harness name, cached for the process lifetime.
19
20
  */
20
- export declare function metaHarnessProvider(): string;
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
- export declare function clearMetaHarnessCache(): void;
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","sourceRoot":"","sources":["../../src/clientinfo/meta-harness.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAeH;;;;;GAKG;AACH,wBAAgB,yBAAyB,IAAI,MAAM,CAclD;AAID;;GAEG;AACH,wBAAgB,mBAAmB,IAAI,MAAM,CAG5C;AAED;;;;GAIG;AACH,wBAAgB,qBAAqB,IAAI,IAAI,CAE5C"}
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
- * Detects the agent meta-harness (e.g. omnigent) running the current process.
3
- * A meta-harness orchestrates AI coding agents rather than being one, so it is
4
- * reported as an independent `meta-harness/<name>` user-agent dimension
5
- * alongside `agent/<name>`. Kept in sync across the Go, Java, Python, and
6
- * TypeScript SDKs.
7
- *
8
- * @module
9
- */
10
- // Canonical list of known meta-harnesses, detected by env var presence. Keep
11
- // in sync with the Go, Java, and Python SDKs.
12
- const KNOWN_META_HARNESSES = [
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
- * Returns the detected meta-harness name, cached for the process lifetime.
41
- */
42
- export function metaHarnessProvider() {
43
- cached ??= lookupMetaHarnessProvider();
44
- return cached;
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
- * Clears the cached meta-harness detection result so that the next call to
48
- * {@link metaHarnessProvider} re-evaluates the environment. Exported for
49
- * testing only.
50
- */
51
- export function clearMetaHarnessCache() {
52
- cached = undefined;
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","sourceRoot":"","sources":["../../src/clientinfo/meta-harness.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAOH,6EAA6E;AAC7E,8CAA8C;AAC9C,MAAM,oBAAoB,GAAgC;IACxD,+CAA+C;IAC/C,6CAA6C;IAC7C,EAAC,MAAM,EAAE,UAAU,EAAE,OAAO,EAAE,UAAU,EAAC;CAC1C,CAAC;AAEF;;;;;GAKG;AACH,MAAM,UAAU,yBAAyB;IACvC,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,KAAK,MAAM,CAAC,IAAI,oBAAoB,EAAE,CAAC;QACrC,IAAI,CAAC,CAAC,MAAM,IAAI,OAAO,CAAC,GAAG,EAAE,CAAC;YAC5B,OAAO,CAAC,IAAI,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC;QAC1B,CAAC;IACH,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;QACzB,OAAO,OAAO,CAAC,CAAC,CAAC,CAAC;IACpB,CAAC;IACD,IAAI,OAAO,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QACvB,OAAO,UAAU,CAAC;IACpB,CAAC;IACD,OAAO,EAAE,CAAC;AACZ,CAAC;AAED,IAAI,MAA0B,CAAC;AAE/B;;GAEG;AACH,MAAM,UAAU,mBAAmB;IACjC,MAAM,KAAK,yBAAyB,EAAE,CAAC;IACvC,OAAO,MAAM,CAAC;AAChB,CAAC;AAED;;;;GAIG;AACH,MAAM,UAAU,qBAAqB;IACnC,MAAM,GAAG,SAAS,CAAC;AACrB,CAAC"}
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"}
@@ -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
- export interface HttpRequest {
9
- /** The URL to send the request to. */
10
- url: string;
11
- /** The HTTP method (GET, POST, etc.). */
12
- method: string;
13
- /** The request headers. */
14
- headers: Headers;
15
- /** The request body. */
16
- body?: string | ArrayBuffer | Uint8Array | ReadableStream<Uint8Array> | null;
17
- /** An optional signal to abort the request. */
18
- signal?: AbortSignal;
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
- export interface HttpResponse {
22
- /** The HTTP status code. */
23
- statusCode: number;
24
- /** The response headers. */
25
- headers: Headers;
26
- /** The raw response body stream. */
27
- body: ReadableStream<Uint8Array> | null;
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
- export interface HttpClient {
33
- /** Sends an HTTP request and returns the response. */
34
- send(request: HttpRequest): Promise<HttpResponse>;
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
- export declare function newFetchHttpClient(): HttpClient;
40
+ declare function newFetchHttpClient(): HttpClient;
41
+ //#endregion
42
+ export { HttpClient, HttpRequest, HttpResponse, newFetchHttpClient };
40
43
  //# sourceMappingURL=http.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"http.d.ts","sourceRoot":"","sources":["../../src/http/http.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAEH,uDAAuD;AACvD,MAAM,WAAW,WAAW;IAC1B,sCAAsC;IACtC,GAAG,EAAE,MAAM,CAAC;IAEZ,yCAAyC;IACzC,MAAM,EAAE,MAAM,CAAC;IAEf,2BAA2B;IAC3B,OAAO,EAAE,OAAO,CAAC;IAEjB,wBAAwB;IACxB,IAAI,CAAC,EAAE,MAAM,GAAG,WAAW,GAAG,UAAU,GAAG,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;IAE7E,+CAA+C;IAC/C,MAAM,CAAC,EAAE,WAAW,CAAC;CACtB;AAED,iEAAiE;AACjE,MAAM,WAAW,YAAY;IAC3B,4BAA4B;IAC5B,UAAU,EAAE,MAAM,CAAC;IAEnB,4BAA4B;IAC5B,OAAO,EAAE,OAAO,CAAC;IAEjB,oCAAoC;IACpC,IAAI,EAAE,cAAc,CAAC,UAAU,CAAC,GAAG,IAAI,CAAC;CACzC;AAED;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,sDAAsD;IACtD,IAAI,CAAC,OAAO,EAAE,WAAW,GAAG,OAAO,CAAC,YAAY,CAAC,CAAC;CACnD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,IAAI,UAAU,CA0B/C"}
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
- * HTTP transport primitives. Defines the {@link HttpClient} interface and a
3
- * {@link newFetchHttpClient} implementation backed by the Fetch API.
4
- *
5
- * @module
6
- */
7
- /**
8
- * Creates a new HttpClient that uses the Fetch API as its transport.
9
- */
10
- export function newFetchHttpClient() {
11
- return {
12
- async send(request) {
13
- const init = {
14
- method: request.method,
15
- headers: request.headers,
16
- };
17
- if (request.body !== undefined) {
18
- init.body = request.body;
19
- // The Fetch spec requires duplex: 'half' for streaming request bodies.
20
- // See https://fetch.spec.whatwg.org/#dom-requestinit-duplex.
21
- if (request.body instanceof ReadableStream) {
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
@@ -1 +1 @@
1
- {"version":3,"file":"http.js","sourceRoot":"","sources":["../../src/http/http.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAwCH;;GAEG;AACH,MAAM,UAAU,kBAAkB;IAChC,OAAO;QACL,KAAK,CAAC,IAAI,CAAC,OAAoB;YAC7B,MAAM,IAAI,GAAgB;gBACxB,MAAM,EAAE,OAAO,CAAC,MAAM;gBACtB,OAAO,EAAE,OAAO,CAAC,OAAO;aACzB,CAAC;YACF,IAAI,OAAO,CAAC,IAAI,KAAK,SAAS,EAAE,CAAC;gBAC/B,IAAI,CAAC,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;gBACzB,uEAAuE;gBACvE,6DAA6D;gBAC7D,IAAI,OAAO,CAAC,IAAI,YAAY,cAAc,EAAE,CAAC;oBAC3C,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;gBACvB,CAAC;YACH,CAAC;YACD,IAAI,OAAO,CAAC,MAAM,KAAK,SAAS,EAAE,CAAC;gBACjC,IAAI,CAAC,MAAM,GAAG,OAAO,CAAC,MAAM,CAAC;YAC/B,CAAC;YACD,MAAM,QAAQ,GAAG,MAAM,KAAK,CAAC,OAAO,CAAC,GAAG,EAAE,IAAI,CAAC,CAAC;YAChD,OAAO;gBACL,UAAU,EAAE,QAAQ,CAAC,MAAM;gBAC3B,OAAO,EAAE,QAAQ,CAAC,OAAO;gBACzB,IAAI,EAAE,QAAQ,CAAC,IAAI;aACpB,CAAC;QACJ,CAAC;KACF,CAAC;AACJ,CAAC"}
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"}
@@ -1,8 +1,2 @@
1
- /**
2
- * HTTP transport primitives.
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 };
@@ -1,7 +1,3 @@
1
- /**
2
- * HTTP transport primitives.
3
- *
4
- * @packageDocumentation
5
- */
6
- export { newFetchHttpClient } from './http';
7
- //# sourceMappingURL=index.js.map
1
+ import { newFetchHttpClient } from "./http.js";
2
+
3
+ export { newFetchHttpClient };
package/dist/index.d.ts CHANGED
@@ -1,6 +1 @@
1
- /**
2
- * Databricks core library.
3
- *
4
- * @packageDocumentation
5
- */
6
- //# sourceMappingURL=index.d.ts.map
1
+ export { };
package/dist/index.js CHANGED
@@ -1,7 +1,9 @@
1
- "use strict";
1
+ //#region src/index.ts
2
2
  /**
3
- * Databricks core library.
4
- *
5
- * @packageDocumentation
6
- */
3
+ * Databricks core library.
4
+ *
5
+ * @packageDocumentation
6
+ */
7
+
8
+ //#endregion
7
9
  //# sourceMappingURL=index.js.map
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAAA;;;;GAIG"}
1
+ {"version":3,"file":"index.js","names":[],"sources":["../src/index.ts"],"sourcesContent":["/**\n * Databricks core library.\n *\n * @packageDocumentation\n */\n"],"mappings":""}
@@ -1,8 +1,2 @@
1
- /**
2
- * Logger interface and built-in implementations.
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 };
@@ -1,7 +1,3 @@
1
- /**
2
- * Logger interface and built-in implementations.
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 };
@@ -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
- export type Level = 'debug' | 'info' | 'warn' | 'error' | 'off';
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
- export interface Logger {
12
- /** Logs a debug-level message. */
13
- debug(message: string, ...args: unknown[]): void;
14
- /** Logs an info-level message. */
15
- info(message: string, ...args: unknown[]): void;
16
- /** Logs a warn-level message. */
17
- warn(message: string, ...args: unknown[]): void;
18
- /** Logs an error-level message. */
19
- error(message: string, ...args: unknown[]): void;
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
- export declare class NoOpLogger implements Logger {
23
- debug(): void;
24
- info(): void;
25
- warn(): void;
26
- error(): void;
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
- export declare class LogLevel implements Logger {
41
- private readonly threshold;
42
- private readonly logger;
43
- constructor(level: Level, logger?: Logger);
44
- debug(message: string, ...args: unknown[]): void;
45
- info(message: string, ...args: unknown[]): void;
46
- warn(message: string, ...args: unknown[]): void;
47
- error(message: string, ...args: unknown[]): void;
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","sourceRoot":"","sources":["../../src/logger/logger.ts"],"names":[],"mappings":"AAAA,qDAAqD;AAErD,4DAA4D;AAC5D,MAAM,MAAM,KAAK,GAAG,OAAO,GAAG,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,KAAK,CAAC;AAEhE;;;;;;GAMG;AACH,MAAM,WAAW,MAAM;IACrB,kCAAkC;IAClC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAEjD,kCAAkC;IAClC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAEhD,iCAAiC;IACjC,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;IAEhD,mCAAmC;IACnC,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI,CAAC;CAClD;AAED,oDAAoD;AACpD,qBAAa,UAAW,YAAW,MAAM;IACvC,KAAK,IAAI,IAAI;IAIb,IAAI,IAAI,IAAI;IAIZ,IAAI,IAAI,IAAI;IAIZ,KAAK,IAAI,IAAI;CAGd;AAWD;;;;;;;;;;;GAWG;AACH,qBAAa,QAAS,YAAW,MAAM;IACrC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IACnC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;gBAEpB,KAAK,EAAE,KAAK,EAAE,MAAM,GAAE,MAAgB;IAKlD,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAMhD,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM/C,IAAI,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;IAM/C,KAAK,CAAC,OAAO,EAAE,MAAM,EAAE,GAAG,IAAI,EAAE,OAAO,EAAE,GAAG,IAAI;CAKjD"}
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"}
@@ -1,65 +1,51 @@
1
- /** Logger interface and built-in implementations. */
1
+ //#region src/logger/logger.ts
2
2
  /** A logger that silently discards all messages. */
3
- export class NoOpLogger {
4
- debug() {
5
- // Intentionally empty.
6
- }
7
- info() {
8
- // Intentionally empty.
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
- debug: 0,
20
- info: 1,
21
- warn: 2,
22
- error: 3,
23
- off: 4,
10
+ debug: 0,
11
+ info: 1,
12
+ warn: 2,
13
+ error: 3,
14
+ off: 4
24
15
  };
25
16
  /**
26
- * A decorator that adds level filtering to any {@link Logger}.
27
- *
28
- * Only messages at or above the configured minimum level are forwarded to the
29
- * underlying logger. The default underlying logger is `console`.
30
- *
31
- * @example
32
- * ```typescript
33
- * // Only warn and error go to console.
34
- * const logger = new LogLevel('warn');
35
- * ```
36
- */
37
- export class LogLevel {
38
- threshold;
39
- logger;
40
- constructor(level, logger = console) {
41
- this.threshold = LEVEL_SEVERITY[level];
42
- this.logger = logger;
43
- }
44
- debug(message, ...args) {
45
- if (this.threshold <= LEVEL_SEVERITY.debug) {
46
- this.logger.debug(message, ...args);
47
- }
48
- }
49
- info(message, ...args) {
50
- if (this.threshold <= LEVEL_SEVERITY.info) {
51
- this.logger.info(message, ...args);
52
- }
53
- }
54
- warn(message, ...args) {
55
- if (this.threshold <= LEVEL_SEVERITY.warn) {
56
- this.logger.warn(message, ...args);
57
- }
58
- }
59
- error(message, ...args) {
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","sourceRoot":"","sources":["../../src/logger/logger.ts"],"names":[],"mappings":"AAAA,qDAAqD;AA0BrD,oDAAoD;AACpD,MAAM,OAAO,UAAU;IACrB,KAAK;QACH,uBAAuB;IACzB,CAAC;IAED,IAAI;QACF,uBAAuB;IACzB,CAAC;IAED,IAAI;QACF,uBAAuB;IACzB,CAAC;IAED,KAAK;QACH,uBAAuB;IACzB,CAAC;CACF;AAED,mDAAmD;AACnD,MAAM,cAAc,GAA0B;IAC5C,KAAK,EAAE,CAAC;IACR,IAAI,EAAE,CAAC;IACP,IAAI,EAAE,CAAC;IACP,KAAK,EAAE,CAAC;IACR,GAAG,EAAE,CAAC;CACP,CAAC;AAEF;;;;;;;;;;;GAWG;AACH,MAAM,OAAO,QAAQ;IACF,SAAS,CAAS;IAClB,MAAM,CAAS;IAEhC,YAAY,KAAY,EAAE,SAAiB,OAAO;QAChD,IAAI,CAAC,SAAS,GAAG,cAAc,CAAC,KAAK,CAAC,CAAC;QACvC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,GAAG,IAAe;QACvC,IAAI,IAAI,CAAC,SAAS,IAAI,cAAc,CAAC,KAAK,EAAE,CAAC;YAC3C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,GAAG,IAAe;QACtC,IAAI,IAAI,CAAC,SAAS,IAAI,cAAc,CAAC,IAAI,EAAE,CAAC;YAC1C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,IAAI,CAAC,OAAe,EAAE,GAAG,IAAe;QACtC,IAAI,IAAI,CAAC,SAAS,IAAI,cAAc,CAAC,IAAI,EAAE,CAAC;YAC1C,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QACrC,CAAC;IACH,CAAC;IAED,KAAK,CAAC,OAAe,EAAE,GAAG,IAAe;QACvC,IAAI,IAAI,CAAC,SAAS,IAAI,cAAc,CAAC,KAAK,EAAE,CAAC;YAC3C,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,OAAO,EAAE,GAAG,IAAI,CAAC,CAAC;QACtC,CAAC;IACH,CAAC;CACF"}
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"}