@databricks/sdk-core 0.0.0-dev → 0.1.0-dev.2
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/LICENSE +203 -0
- package/README.md +11 -1
- package/dist/api/execute.d.ts +12 -0
- package/dist/api/execute.d.ts.map +1 -0
- package/dist/api/execute.js +77 -0
- package/dist/api/execute.js.map +1 -0
- package/dist/api/index.d.ts +12 -0
- package/dist/api/index.d.ts.map +1 -0
- package/dist/api/index.js +8 -0
- package/dist/api/index.js.map +1 -0
- package/dist/api/limiter.d.ts +9 -0
- package/dist/api/limiter.d.ts.map +1 -0
- package/dist/api/limiter.js +2 -0
- package/dist/api/limiter.js.map +1 -0
- package/dist/api/options.d.ts +22 -0
- package/dist/api/options.d.ts.map +1 -0
- package/dist/api/options.js +2 -0
- package/dist/api/options.js.map +1 -0
- package/dist/api/retrier.d.ts +58 -0
- package/dist/api/retrier.d.ts.map +1 -0
- package/dist/api/retrier.js +70 -0
- package/dist/api/retrier.js.map +1 -0
- package/dist/apierror/apierror.d.ts +53 -0
- package/dist/apierror/apierror.d.ts.map +1 -0
- package/dist/apierror/apierror.js +217 -0
- package/dist/apierror/apierror.js.map +1 -0
- package/dist/apierror/codes/codes.d.ts +140 -0
- package/dist/apierror/codes/codes.d.ts.map +1 -0
- package/dist/apierror/codes/codes.js +167 -0
- package/dist/apierror/codes/codes.js.map +1 -0
- package/dist/apierror/codes/index.d.ts +7 -0
- package/dist/apierror/codes/index.d.ts.map +1 -0
- package/dist/apierror/codes/index.js +7 -0
- package/dist/apierror/codes/index.js.map +1 -0
- package/dist/apierror/details.d.ts +177 -0
- package/dist/apierror/details.d.ts.map +1 -0
- package/dist/apierror/details.js +250 -0
- package/dist/apierror/details.js.map +1 -0
- package/dist/apierror/index.d.ts +8 -0
- package/dist/apierror/index.d.ts.map +1 -0
- package/dist/apierror/index.js +7 -0
- package/dist/apierror/index.js.map +1 -0
- package/dist/clientinfo/agent.d.ts +56 -0
- package/dist/clientinfo/agent.d.ts.map +1 -0
- package/dist/clientinfo/agent.js +114 -0
- package/dist/clientinfo/agent.js.map +1 -0
- package/dist/clientinfo/base.d.ts +39 -0
- package/dist/clientinfo/base.d.ts.map +1 -0
- package/dist/clientinfo/base.js +62 -0
- package/dist/clientinfo/base.js.map +1 -0
- package/dist/clientinfo/clientinfo.d.ts +61 -0
- package/dist/clientinfo/clientinfo.d.ts.map +1 -0
- package/dist/clientinfo/clientinfo.js +96 -0
- package/dist/clientinfo/clientinfo.js.map +1 -0
- package/dist/clientinfo/default.browser.d.ts +17 -0
- package/dist/clientinfo/default.browser.d.ts.map +1 -0
- package/dist/clientinfo/default.browser.js +20 -0
- package/dist/clientinfo/default.browser.js.map +1 -0
- package/dist/clientinfo/default.d.ts +14 -0
- package/dist/clientinfo/default.d.ts.map +1 -0
- package/dist/clientinfo/default.js +104 -0
- package/dist/clientinfo/default.js.map +1 -0
- package/dist/clientinfo/index.browser.d.ts +5 -0
- package/dist/clientinfo/index.browser.d.ts.map +1 -0
- package/dist/clientinfo/index.browser.js +4 -0
- package/dist/clientinfo/index.browser.js.map +1 -0
- package/dist/clientinfo/index.d.ts +5 -0
- package/dist/clientinfo/index.d.ts.map +1 -0
- package/dist/clientinfo/index.js +4 -0
- package/dist/clientinfo/index.js.map +1 -0
- package/dist/http/http.d.ts +40 -0
- package/dist/http/http.d.ts.map +1 -0
- package/dist/http/http.js +37 -0
- package/dist/http/http.js.map +1 -0
- package/dist/http/index.d.ts +8 -0
- package/dist/http/index.d.ts.map +1 -0
- package/dist/http/index.js +7 -0
- package/dist/http/index.js.map +1 -0
- package/dist/index.d.ts +6 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +7 -0
- package/dist/index.js.map +1 -0
- package/dist/logger/index.d.ts +8 -0
- package/dist/logger/index.d.ts.map +1 -0
- package/dist/logger/index.js +7 -0
- package/dist/logger/index.js.map +1 -0
- package/dist/logger/logger.d.ts +49 -0
- package/dist/logger/logger.d.ts.map +1 -0
- package/dist/logger/logger.js +65 -0
- package/dist/logger/logger.js.map +1 -0
- package/dist/profiles/errors.d.ts +17 -0
- package/dist/profiles/errors.d.ts.map +1 -0
- package/dist/profiles/errors.js +19 -0
- package/dist/profiles/errors.js.map +1 -0
- package/dist/profiles/index.browser.d.ts +10 -0
- package/dist/profiles/index.browser.d.ts.map +1 -0
- package/dist/profiles/index.browser.js +8 -0
- package/dist/profiles/index.browser.js.map +1 -0
- package/dist/profiles/index.d.ts +15 -0
- package/dist/profiles/index.d.ts.map +1 -0
- package/dist/profiles/index.js +13 -0
- package/dist/profiles/index.js.map +1 -0
- package/dist/profiles/ini.d.ts +36 -0
- package/dist/profiles/ini.d.ts.map +1 -0
- package/dist/profiles/ini.js +113 -0
- package/dist/profiles/ini.js.map +1 -0
- package/dist/profiles/profile.d.ts +131 -0
- package/dist/profiles/profile.d.ts.map +1 -0
- package/dist/profiles/profile.js +307 -0
- package/dist/profiles/profile.js.map +1 -0
- package/dist/profiles/resolve.d.ts +29 -0
- package/dist/profiles/resolve.d.ts.map +1 -0
- package/dist/profiles/resolve.js +206 -0
- package/dist/profiles/resolve.js.map +1 -0
- package/dist/profiles/secret.d.ts +25 -0
- package/dist/profiles/secret.d.ts.map +1 -0
- package/dist/profiles/secret.js +38 -0
- package/dist/profiles/secret.js.map +1 -0
- package/dist/wkt/fieldmask.d.ts +32 -0
- package/dist/wkt/fieldmask.d.ts.map +1 -0
- package/dist/wkt/fieldmask.js +68 -0
- package/dist/wkt/fieldmask.js.map +1 -0
- package/dist/wkt/index.d.ts +4 -0
- package/dist/wkt/index.d.ts.map +1 -0
- package/dist/wkt/index.js +2 -0
- package/dist/wkt/index.js.map +1 -0
- package/dist/wkt/value.d.ts +13 -0
- package/dist/wkt/value.d.ts.map +1 -0
- package/dist/wkt/value.js +2 -0
- package/dist/wkt/value.js.map +1 -0
- package/package.json +82 -4
- package/src/api/execute.ts +102 -0
- package/src/api/index.ts +12 -0
- package/src/api/limiter.ts +8 -0
- package/src/api/options.ts +22 -0
- package/src/api/retrier.ts +108 -0
- package/src/apierror/apierror.ts +253 -0
- package/src/apierror/codes/codes.ts +189 -0
- package/src/apierror/codes/index.ts +7 -0
- package/src/apierror/details.ts +459 -0
- package/src/apierror/index.ts +24 -0
- package/src/clientinfo/agent.ts +125 -0
- package/src/clientinfo/base.ts +73 -0
- package/src/clientinfo/clientinfo.ts +129 -0
- package/src/clientinfo/default.browser.ts +24 -0
- package/src/clientinfo/default.ts +128 -0
- package/src/clientinfo/index.browser.ts +4 -0
- package/src/clientinfo/index.ts +4 -0
- package/src/http/http.ts +75 -0
- package/src/http/index.ts +8 -0
- package/src/index.ts +5 -0
- package/src/logger/index.ts +8 -0
- package/src/logger/logger.ts +99 -0
- package/src/profiles/errors.ts +28 -0
- package/src/profiles/index.browser.ts +10 -0
- package/src/profiles/index.ts +15 -0
- package/src/profiles/ini.ts +126 -0
- package/src/profiles/profile.ts +467 -0
- package/src/profiles/resolve.ts +251 -0
- package/src/profiles/secret.ts +40 -0
- package/src/wkt/fieldmask.ts +89 -0
- package/src/wkt/index.ts +3 -0
- package/src/wkt/value.ts +19 -0
- package/index.js +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/logger/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,YAAY,EAAC,KAAK,EAAE,MAAM,EAAC,MAAM,UAAU,CAAC;AAC5C,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/logger/index.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAGH,OAAO,EAAC,UAAU,EAAE,QAAQ,EAAC,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
/** Logger interface and built-in implementations. */
|
|
2
|
+
/** Supported log levels in order of increasing severity. */
|
|
3
|
+
export type Level = 'debug' | 'info' | 'warn' | 'error' | 'off';
|
|
4
|
+
/**
|
|
5
|
+
* A logger that receives messages at different severity levels.
|
|
6
|
+
*
|
|
7
|
+
* The method signatures are intentionally compatible with the global
|
|
8
|
+
* {@link Console} object so that `console` can be used as a Logger when level
|
|
9
|
+
* filtering is not needed.
|
|
10
|
+
*/
|
|
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;
|
|
20
|
+
}
|
|
21
|
+
/** 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;
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* A decorator that adds level filtering to any {@link Logger}.
|
|
30
|
+
*
|
|
31
|
+
* Only messages at or above the configured minimum level are forwarded to the
|
|
32
|
+
* underlying logger. The default underlying logger is `console`.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```typescript
|
|
36
|
+
* // Only warn and error go to console.
|
|
37
|
+
* const logger = new LogLevel('warn');
|
|
38
|
+
* ```
|
|
39
|
+
*/
|
|
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;
|
|
48
|
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AAE,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"}
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
/** Logger interface and built-in implementations. */
|
|
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.
|
|
18
|
+
const LEVEL_SEVERITY = {
|
|
19
|
+
debug: 0,
|
|
20
|
+
info: 1,
|
|
21
|
+
warn: 2,
|
|
22
|
+
error: 3,
|
|
23
|
+
off: 4,
|
|
24
|
+
};
|
|
25
|
+
/**
|
|
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
|
+
}
|
|
65
|
+
//# sourceMappingURL=logger.js.map
|
|
@@ -0,0 +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"}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error types for Databricks configuration profile operations.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
/** Discriminant codes for {@link ProfileError}. */
|
|
7
|
+
export type ProfileErrorCode = 'CONFIG_FILE_NOT_FOUND' | 'PROFILE_NOT_FOUND' | 'EMPTY_PATH' | 'EMPTY_PROFILE' | 'INVALID_PROFILE_NAME';
|
|
8
|
+
/**
|
|
9
|
+
* Error thrown by profile operations.
|
|
10
|
+
*
|
|
11
|
+
* Use the {@link ProfileError.code} field to distinguish between error causes.
|
|
12
|
+
*/
|
|
13
|
+
export declare class ProfileError extends Error {
|
|
14
|
+
readonly code: ProfileErrorCode;
|
|
15
|
+
constructor(code: ProfileErrorCode, message: string);
|
|
16
|
+
}
|
|
17
|
+
//# sourceMappingURL=errors.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.d.ts","sourceRoot":"","sources":["../../src/profiles/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,mDAAmD;AACnD,MAAM,MAAM,gBAAgB,GACxB,uBAAuB,GACvB,mBAAmB,GACnB,YAAY,GACZ,eAAe,GACf,sBAAsB,CAAC;AAE3B;;;;GAIG;AACH,qBAAa,YAAa,SAAQ,KAAK;IACrC,QAAQ,CAAC,IAAI,EAAE,gBAAgB,CAAC;gBAEpB,IAAI,EAAE,gBAAgB,EAAE,OAAO,EAAE,MAAM;CAKpD"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Error types for Databricks configuration profile operations.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
/**
|
|
7
|
+
* Error thrown by profile operations.
|
|
8
|
+
*
|
|
9
|
+
* Use the {@link ProfileError.code} field to distinguish between error causes.
|
|
10
|
+
*/
|
|
11
|
+
export class ProfileError extends Error {
|
|
12
|
+
code;
|
|
13
|
+
constructor(code, message) {
|
|
14
|
+
super(message);
|
|
15
|
+
this.name = 'ProfileError';
|
|
16
|
+
this.code = code;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
//# sourceMappingURL=errors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../src/profiles/errors.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAUH;;;;GAIG;AACH,MAAM,OAAO,YAAa,SAAQ,KAAK;IAC5B,IAAI,CAAmB;IAEhC,YAAY,IAAsB,EAAE,OAAe;QACjD,KAAK,CAAC,OAAO,CAAC,CAAC;QACf,IAAI,CAAC,IAAI,GAAG,cAAc,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Browser entry point for the profiles module.
|
|
3
|
+
*
|
|
4
|
+
* @packageDocumentation
|
|
5
|
+
*/
|
|
6
|
+
export { ProfileError } from './errors';
|
|
7
|
+
export type { ProfileErrorCode } from './errors';
|
|
8
|
+
export type { Profile, ResolveOptions } from './profile';
|
|
9
|
+
export { Secret } from './secret';
|
|
10
|
+
//# sourceMappingURL=index.browser.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.browser.d.ts","sourceRoot":"","sources":["../../src/profiles/index.browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC;AACtC,YAAY,EAAC,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAC/C,YAAY,EAAC,OAAO,EAAE,cAAc,EAAC,MAAM,WAAW,CAAC;AACvD,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.browser.js","sourceRoot":"","sources":["../../src/profiles/index.browser.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC;AAGtC,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility to resolve Databricks configuration profiles.
|
|
3
|
+
*
|
|
4
|
+
* A profile is a named collection of configuration values. It is typically
|
|
5
|
+
* stored in a file called ~/.databrickscfg. Profiles can be resolved from the
|
|
6
|
+
* file and/or environment variables using the {@link resolve} function.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
export { ProfileError } from './errors';
|
|
11
|
+
export type { ProfileErrorCode } from './errors';
|
|
12
|
+
export type { Profile, ResolveOptions } from './profile';
|
|
13
|
+
export { defaultConfigFile, listProfiles, resolve } from './resolve';
|
|
14
|
+
export { Secret } from './secret';
|
|
15
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../src/profiles/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC;AACtC,YAAY,EAAC,gBAAgB,EAAC,MAAM,UAAU,CAAC;AAC/C,YAAY,EAAC,OAAO,EAAE,cAAc,EAAC,MAAM,WAAW,CAAC;AACvD,OAAO,EAAC,iBAAiB,EAAE,YAAY,EAAE,OAAO,EAAC,MAAM,WAAW,CAAC;AACnE,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility to resolve Databricks configuration profiles.
|
|
3
|
+
*
|
|
4
|
+
* A profile is a named collection of configuration values. It is typically
|
|
5
|
+
* stored in a file called ~/.databrickscfg. Profiles can be resolved from the
|
|
6
|
+
* file and/or environment variables using the {@link resolve} function.
|
|
7
|
+
*
|
|
8
|
+
* @packageDocumentation
|
|
9
|
+
*/
|
|
10
|
+
export { ProfileError } from './errors';
|
|
11
|
+
export { defaultConfigFile, listProfiles, resolve } from './resolve';
|
|
12
|
+
export { Secret } from './secret';
|
|
13
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/profiles/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AAEH,OAAO,EAAC,YAAY,EAAC,MAAM,UAAU,CAAC;AAGtC,OAAO,EAAC,iBAAiB,EAAE,YAAY,EAAE,OAAO,EAAC,MAAM,WAAW,CAAC;AACnE,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC"}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal INI parser and writer for the Databricks config file format.
|
|
3
|
+
*
|
|
4
|
+
* This matches the behavior of {@link https://pkg.go.dev/gopkg.in/ini.v1 | go-ini}
|
|
5
|
+
* with `SpaceBeforeInlineComment: true`, which is how the Go SDK loads
|
|
6
|
+
* databrickscfg files. Key behavioral details:
|
|
7
|
+
*
|
|
8
|
+
* - Inline comments are only recognized when `#` or `;` is preceded by a
|
|
9
|
+
* space. The parser checks for `" #"` first; only if absent does it check
|
|
10
|
+
* for `" ;"`. This matches Go's `strings.Index` precedence.
|
|
11
|
+
* - Both `=` and `:` are key-value delimiters (Go default). Only the first
|
|
12
|
+
* delimiter on a line splits key from value.
|
|
13
|
+
* - Section names are the raw text between `[` and the last `]` on the line,
|
|
14
|
+
* with no trimming.
|
|
15
|
+
* - Keys and values are trimmed of surrounding whitespace.
|
|
16
|
+
* - Lines without a delimiter throw an error (matching go-ini default).
|
|
17
|
+
*
|
|
18
|
+
* @module
|
|
19
|
+
*/
|
|
20
|
+
/** Parsed INI data as an ordered map of section names to key-value maps. */
|
|
21
|
+
export type IniData = Map<string, Map<string, string>>;
|
|
22
|
+
/**
|
|
23
|
+
* Parses an INI-formatted string into structured data.
|
|
24
|
+
*
|
|
25
|
+
* Keys before any section header are assigned to the "DEFAULT" section.
|
|
26
|
+
*/
|
|
27
|
+
export declare function parseIni(content: string): IniData;
|
|
28
|
+
/**
|
|
29
|
+
* Formats structured INI data back into a string.
|
|
30
|
+
*
|
|
31
|
+
* Each section's keys are aligned so that all `=` signs appear in the same
|
|
32
|
+
* column, matching the output format of go-ini's `PrettyFormat` default.
|
|
33
|
+
* Sections are separated by blank lines (`PrettySection` default).
|
|
34
|
+
*/
|
|
35
|
+
export declare function formatIni(data: IniData): string;
|
|
36
|
+
//# sourceMappingURL=ini.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ini.d.ts","sourceRoot":"","sources":["../../src/profiles/ini.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH,4EAA4E;AAC5E,MAAM,MAAM,OAAO,GAAG,GAAG,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC,CAAC;AAEvD;;;;GAIG;AACH,wBAAgB,QAAQ,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAsEjD;AAED;;;;;;GAMG;AACH,wBAAgB,SAAS,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM,CAkB/C"}
|
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Minimal INI parser and writer for the Databricks config file format.
|
|
3
|
+
*
|
|
4
|
+
* This matches the behavior of {@link https://pkg.go.dev/gopkg.in/ini.v1 | go-ini}
|
|
5
|
+
* with `SpaceBeforeInlineComment: true`, which is how the Go SDK loads
|
|
6
|
+
* databrickscfg files. Key behavioral details:
|
|
7
|
+
*
|
|
8
|
+
* - Inline comments are only recognized when `#` or `;` is preceded by a
|
|
9
|
+
* space. The parser checks for `" #"` first; only if absent does it check
|
|
10
|
+
* for `" ;"`. This matches Go's `strings.Index` precedence.
|
|
11
|
+
* - Both `=` and `:` are key-value delimiters (Go default). Only the first
|
|
12
|
+
* delimiter on a line splits key from value.
|
|
13
|
+
* - Section names are the raw text between `[` and the last `]` on the line,
|
|
14
|
+
* with no trimming.
|
|
15
|
+
* - Keys and values are trimmed of surrounding whitespace.
|
|
16
|
+
* - Lines without a delimiter throw an error (matching go-ini default).
|
|
17
|
+
*
|
|
18
|
+
* @module
|
|
19
|
+
*/
|
|
20
|
+
/**
|
|
21
|
+
* Parses an INI-formatted string into structured data.
|
|
22
|
+
*
|
|
23
|
+
* Keys before any section header are assigned to the "DEFAULT" section.
|
|
24
|
+
*/
|
|
25
|
+
export function parseIni(content) {
|
|
26
|
+
const result = new Map();
|
|
27
|
+
let currentSection = 'DEFAULT';
|
|
28
|
+
result.set(currentSection, new Map());
|
|
29
|
+
for (const rawLine of content.split(/\r?\n/)) {
|
|
30
|
+
const line = rawLine.trim();
|
|
31
|
+
// Skip empty lines and full-line comments.
|
|
32
|
+
if (line === '' || line.startsWith('#') || line.startsWith(';')) {
|
|
33
|
+
continue;
|
|
34
|
+
}
|
|
35
|
+
// Section header: text between '[' and the last ']'.
|
|
36
|
+
if (line.startsWith('[')) {
|
|
37
|
+
const closeIdx = line.lastIndexOf(']');
|
|
38
|
+
if (closeIdx === -1) {
|
|
39
|
+
throw new Error(`unclosed section: ${line}`);
|
|
40
|
+
}
|
|
41
|
+
const name = line.slice(1, closeIdx);
|
|
42
|
+
if (name === '') {
|
|
43
|
+
throw new Error('empty section name');
|
|
44
|
+
}
|
|
45
|
+
currentSection = name;
|
|
46
|
+
if (!result.has(currentSection)) {
|
|
47
|
+
result.set(currentSection, new Map());
|
|
48
|
+
}
|
|
49
|
+
continue;
|
|
50
|
+
}
|
|
51
|
+
// Key-value pair: first '=' or ':' splits key from value.
|
|
52
|
+
const eqIdx = line.indexOf('=');
|
|
53
|
+
const colonIdx = line.indexOf(':');
|
|
54
|
+
let delimIdx;
|
|
55
|
+
if (eqIdx === -1 && colonIdx === -1) {
|
|
56
|
+
throw new Error(`key-value delimiter not found: ${line}`);
|
|
57
|
+
}
|
|
58
|
+
else if (eqIdx === -1) {
|
|
59
|
+
delimIdx = colonIdx;
|
|
60
|
+
}
|
|
61
|
+
else if (colonIdx === -1) {
|
|
62
|
+
delimIdx = eqIdx;
|
|
63
|
+
}
|
|
64
|
+
else {
|
|
65
|
+
delimIdx = Math.min(eqIdx, colonIdx);
|
|
66
|
+
}
|
|
67
|
+
const key = line.slice(0, delimIdx).trim();
|
|
68
|
+
if (key === '') {
|
|
69
|
+
throw new Error(`empty key name: ${line}`);
|
|
70
|
+
}
|
|
71
|
+
let value = line.slice(delimIdx + 1).trim();
|
|
72
|
+
// Strip inline comments matching go-ini's SpaceBeforeInlineComment
|
|
73
|
+
// precedence: try " #" first, then " ;" only if " #" is absent.
|
|
74
|
+
let commentIdx = value.indexOf(' #');
|
|
75
|
+
if (commentIdx === -1) {
|
|
76
|
+
commentIdx = value.indexOf(' ;');
|
|
77
|
+
}
|
|
78
|
+
if (commentIdx !== -1) {
|
|
79
|
+
value = value.slice(0, commentIdx).trimEnd();
|
|
80
|
+
}
|
|
81
|
+
if (!result.has(currentSection)) {
|
|
82
|
+
result.set(currentSection, new Map());
|
|
83
|
+
}
|
|
84
|
+
const section = result.get(currentSection);
|
|
85
|
+
if (section !== undefined) {
|
|
86
|
+
section.set(key, value);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
return result;
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* Formats structured INI data back into a string.
|
|
93
|
+
*
|
|
94
|
+
* Each section's keys are aligned so that all `=` signs appear in the same
|
|
95
|
+
* column, matching the output format of go-ini's `PrettyFormat` default.
|
|
96
|
+
* Sections are separated by blank lines (`PrettySection` default).
|
|
97
|
+
*/
|
|
98
|
+
export function formatIni(data) {
|
|
99
|
+
const sections = [];
|
|
100
|
+
for (const [name, keys] of data) {
|
|
101
|
+
const lines = [];
|
|
102
|
+
lines.push(`[${name}]`);
|
|
103
|
+
if (keys.size > 0) {
|
|
104
|
+
const maxKeyLen = Math.max(...[...keys.keys()].map(k => k.length));
|
|
105
|
+
for (const [key, value] of keys) {
|
|
106
|
+
lines.push(`${key.padEnd(maxKeyLen)} = ${value}`);
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
sections.push(lines.join('\n'));
|
|
110
|
+
}
|
|
111
|
+
return sections.join('\n\n') + '\n';
|
|
112
|
+
}
|
|
113
|
+
//# sourceMappingURL=ini.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ini.js","sourceRoot":"","sources":["../../src/profiles/ini.ts"],"names":[],"mapp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AG,IAAI,CAAC;AACtC,CAAC"}
|
|
@@ -0,0 +1,131 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Profile interface and property mapping for Databricks configuration.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
import { Secret } from './secret';
|
|
7
|
+
/**
|
|
8
|
+
* Holds configuration values resolved from a databrickscfg file and/or
|
|
9
|
+
* environment variables. All fields are optional; an absent field means the
|
|
10
|
+
* value was not configured.
|
|
11
|
+
*/
|
|
12
|
+
export interface Profile {
|
|
13
|
+
/** Profile name (INI section name). */
|
|
14
|
+
name?: string;
|
|
15
|
+
/** Databricks workspace or Accounts API endpoint URL. */
|
|
16
|
+
host?: string;
|
|
17
|
+
/** Databricks Workspace ID, used with unified hosts. */
|
|
18
|
+
workspaceId?: string;
|
|
19
|
+
/** Databricks Account ID for Accounts API. */
|
|
20
|
+
accountId?: string;
|
|
21
|
+
/** Personal access token for PAT authentication. */
|
|
22
|
+
token?: Secret;
|
|
23
|
+
/** Username for basic authentication. */
|
|
24
|
+
username?: string;
|
|
25
|
+
/** Password for basic authentication. */
|
|
26
|
+
password?: Secret;
|
|
27
|
+
/** Selects a specific auth method when multiple credentials are available. */
|
|
28
|
+
authType?: string;
|
|
29
|
+
/** OAuth client ID for M2M authentication. */
|
|
30
|
+
clientId?: string;
|
|
31
|
+
/** OAuth client secret for M2M authentication. */
|
|
32
|
+
clientSecret?: Secret;
|
|
33
|
+
/** Path to the Databricks CLI binary (>= 0.100.0) for CLI-based auth. */
|
|
34
|
+
databricksCliPath?: string;
|
|
35
|
+
/** URL of a metadata service that provides authentication credentials. */
|
|
36
|
+
metadataServiceUrl?: Secret;
|
|
37
|
+
/** GitHub Actions URL for requesting an OIDC token. */
|
|
38
|
+
actionsIdTokenRequestUrl?: string;
|
|
39
|
+
/** Bearer token for the GitHub Actions OIDC provider. */
|
|
40
|
+
actionsIdTokenRequestToken?: Secret;
|
|
41
|
+
/** Name of an environment variable containing an OIDC ID token. */
|
|
42
|
+
oidcTokenEnv?: string;
|
|
43
|
+
/** Path to a file containing an OIDC ID token. */
|
|
44
|
+
oidcTokenFilePath?: string;
|
|
45
|
+
/** Audience for Workload Identity Federation ID token requests. */
|
|
46
|
+
tokenAudience?: string;
|
|
47
|
+
/** OpenID Connect discovery URL override. */
|
|
48
|
+
discoveryUrl?: string;
|
|
49
|
+
/** Azure AD application (client) ID. */
|
|
50
|
+
azureClientId?: string;
|
|
51
|
+
/** Azure AD client secret. */
|
|
52
|
+
azureClientSecret?: Secret;
|
|
53
|
+
/** Azure AD tenant ID. */
|
|
54
|
+
azureTenantId?: string;
|
|
55
|
+
/** Azure Resource Manager ID for an Azure Databricks workspace. */
|
|
56
|
+
azureResourceId?: string;
|
|
57
|
+
/** Azure cloud environment (PUBLIC, USGOVERNMENT, CHINA). */
|
|
58
|
+
azureEnvironment?: string;
|
|
59
|
+
/**
|
|
60
|
+
* Azure Login Application ID.
|
|
61
|
+
*
|
|
62
|
+
* @deprecated This field no longer has any effect.
|
|
63
|
+
*/
|
|
64
|
+
azureLoginAppId?: string;
|
|
65
|
+
/** Whether to use Azure Managed Service Identity authentication. */
|
|
66
|
+
azureUseMsi?: boolean;
|
|
67
|
+
/** GCP service account credentials JSON. */
|
|
68
|
+
googleCredentials?: Secret;
|
|
69
|
+
/** GCP service account email for Google ID-based authentication. */
|
|
70
|
+
googleServiceAccount?: string;
|
|
71
|
+
/** Default Databricks cluster ID for compute operations. */
|
|
72
|
+
clusterId?: string;
|
|
73
|
+
/** Default Databricks SQL warehouse ID. */
|
|
74
|
+
warehouseId?: string;
|
|
75
|
+
/** Default serverless compute resource ID. */
|
|
76
|
+
serverlessComputeId?: string;
|
|
77
|
+
/**
|
|
78
|
+
* INI keys not mapped to a known field. Only populated when loading from a
|
|
79
|
+
* config file; environment variables do not contribute to extra.
|
|
80
|
+
*/
|
|
81
|
+
extra?: Record<string, string>;
|
|
82
|
+
}
|
|
83
|
+
/** Configures the behavior of {@link resolve}. */
|
|
84
|
+
export interface ResolveOptions {
|
|
85
|
+
/**
|
|
86
|
+
* Path to the databrickscfg file. If not set, reads
|
|
87
|
+
* DATABRICKS_CONFIG_FILE from the environment, falling back to
|
|
88
|
+
* ~/.databrickscfg. Setting this implies withFile: true.
|
|
89
|
+
*/
|
|
90
|
+
filePath?: string;
|
|
91
|
+
/**
|
|
92
|
+
* Profile name (INI section) to load. If not set, resolves from the
|
|
93
|
+
* DATABRICKS_CONFIG_PROFILE environment variable, then the default_profile
|
|
94
|
+
* key in the __settings__ section, then falls back to the DEFAULT section.
|
|
95
|
+
* Setting this implies withFile: true.
|
|
96
|
+
*/
|
|
97
|
+
profile?: string;
|
|
98
|
+
/** Whether to read from the config file. Default: true. */
|
|
99
|
+
withFile?: boolean;
|
|
100
|
+
/**
|
|
101
|
+
* Whether to overlay environment variables on top of config file values.
|
|
102
|
+
* When enabled, environment variables take precedence over file values.
|
|
103
|
+
* Default: true.
|
|
104
|
+
*/
|
|
105
|
+
withEnv?: boolean;
|
|
106
|
+
}
|
|
107
|
+
/**
|
|
108
|
+
* Reserved INI section name for SDK settings. It is never treated as a
|
|
109
|
+
* profile.
|
|
110
|
+
*/
|
|
111
|
+
export declare const SETTINGS_SECTION = "__settings__";
|
|
112
|
+
/**
|
|
113
|
+
* Maps a {@link Profile} field to its environment variable and INI key,
|
|
114
|
+
* with typed getter and setter closures. This avoids reflection while
|
|
115
|
+
* keeping the mapping declarative, matching the Go SDK's approach.
|
|
116
|
+
*/
|
|
117
|
+
export interface PropertyDef {
|
|
118
|
+
/** The Profile field name this property maps to. */
|
|
119
|
+
readonly field: keyof Profile;
|
|
120
|
+
readonly envVar: string;
|
|
121
|
+
readonly iniKey: string;
|
|
122
|
+
/** Sets the profile field from a raw INI/env string value. */
|
|
123
|
+
readonly set: (profile: Profile, raw: string) => void;
|
|
124
|
+
/** Returns the profile field as a string, or undefined if unset. */
|
|
125
|
+
readonly get: (profile: Profile) => string | undefined;
|
|
126
|
+
}
|
|
127
|
+
/**
|
|
128
|
+
* Declarative property mapping table for all known profile fields.
|
|
129
|
+
*/
|
|
130
|
+
export declare const PROPERTY_DEFS: readonly PropertyDef[];
|
|
131
|
+
//# sourceMappingURL=profile.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"profile.d.ts","sourceRoot":"","sources":["../../src/profiles/profile.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,MAAM,EAAC,MAAM,UAAU,CAAC;AAEhC;;;;GAIG;AACH,MAAM,WAAW,OAAO;IACtB,uCAAuC;IACvC,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,yDAAyD;IACzD,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd,wDAAwD;IACxD,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,8CAA8C;IAC9C,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,oDAAoD;IACpD,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,yCAAyC;IACzC,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,8EAA8E;IAC9E,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,8CAA8C;IAC9C,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,kDAAkD;IAClD,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,yEAAyE;IACzE,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,0EAA0E;IAC1E,kBAAkB,CAAC,EAAE,MAAM,CAAC;IAE5B,uDAAuD;IACvD,wBAAwB,CAAC,EAAE,MAAM,CAAC;IAElC,yDAAyD;IACzD,0BAA0B,CAAC,EAAE,MAAM,CAAC;IAEpC,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,kDAAkD;IAClD,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B,mEAAmE;IACnE,aAAa,CAAC,EAAE,MAAM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