@databricks/sdk-core 0.0.0-dev → 0.1.0-dev.1
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/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 +120 -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 +61 -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 +80 -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 +131 -0
- package/src/clientinfo/base.ts +72 -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,40 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Obfuscated string type for secrets in configuration profiles.
|
|
3
|
+
*
|
|
4
|
+
* @module
|
|
5
|
+
*/
|
|
6
|
+
|
|
7
|
+
const OBFUSCATED = '********';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* A string value that is obfuscated in all string representations to prevent
|
|
11
|
+
* accidental secret leakage in logs, serialization, and debugging output.
|
|
12
|
+
*
|
|
13
|
+
* Use {@link Secret.value} for intentional access to the underlying value.
|
|
14
|
+
*/
|
|
15
|
+
export class Secret {
|
|
16
|
+
/**
|
|
17
|
+
* @param rawValue - The underlying secret string.
|
|
18
|
+
*/
|
|
19
|
+
constructor(private readonly rawValue: string) {}
|
|
20
|
+
|
|
21
|
+
/** Returns the underlying secret value. */
|
|
22
|
+
get value(): string {
|
|
23
|
+
return this.rawValue;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/** Returns the obfuscated placeholder instead of the secret. */
|
|
27
|
+
toString(): string {
|
|
28
|
+
return OBFUSCATED;
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/** Returns the obfuscated placeholder when serialized to JSON. */
|
|
32
|
+
toJSON(): string {
|
|
33
|
+
return OBFUSCATED;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Returns the obfuscated placeholder for Node.js `util.inspect` output. */
|
|
37
|
+
[Symbol.for('nodejs.util.inspect.custom')](): string {
|
|
38
|
+
return OBFUSCATED;
|
|
39
|
+
}
|
|
40
|
+
}
|
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
// Remove duplicates and paths subsumed by a parent (e.g. "config" subsumes "config.numWorkers").
|
|
2
|
+
function normalize(paths: string[]): string[] {
|
|
3
|
+
const unique = [...new Set(paths)].sort();
|
|
4
|
+
const result: string[] = [];
|
|
5
|
+
for (const path of unique) {
|
|
6
|
+
const isSubsumed = result.some(existing => path.startsWith(existing + '.'));
|
|
7
|
+
if (!isSubsumed) {
|
|
8
|
+
result.push(path);
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
return result;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
/**
|
|
15
|
+
* One field entry in a {@link FieldMaskSchema}: its wire-format name and, for message-typed fields, a lazy reference to the nested message's schema. Array, map, enum, and scalar fields omit `children`.
|
|
16
|
+
*/
|
|
17
|
+
export interface FieldMaskSchemaField {
|
|
18
|
+
readonly wire: string;
|
|
19
|
+
readonly children?: () => FieldMaskSchema;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* Structural description of one message's FieldMask-reachable fields. Maps each typescript field name to its wire-format name and, for message-typed fields, a lazy `() => FieldMaskSchema` reference that lets recursive and mutually-recursive messages describe themselves.
|
|
24
|
+
*/
|
|
25
|
+
export type FieldMaskSchema = Readonly<Record<string, FieldMaskSchemaField>>;
|
|
26
|
+
|
|
27
|
+
// Walk a dot-separated typescript field name path against a schema, returning the equivalent wire-format path. Returns `undefined` when any segment fails: a name that isn't a field of the current message, or a non-terminal segment that doesn't reference another message.
|
|
28
|
+
function walkFieldMaskPath(
|
|
29
|
+
schema: FieldMaskSchema,
|
|
30
|
+
path: string
|
|
31
|
+
): string | undefined {
|
|
32
|
+
const segments = path.split('.');
|
|
33
|
+
const wireSegments: string[] = [];
|
|
34
|
+
let current: FieldMaskSchema = schema;
|
|
35
|
+
for (let i = 0; i < segments.length; i++) {
|
|
36
|
+
const seg = segments[i];
|
|
37
|
+
// Existence check before lookup: `current[seg]` is typed as FieldMaskSchemaField without noUncheckedIndexedAccess, so an undefined check downstream would be flagged "unnecessary".
|
|
38
|
+
if (!(seg in current)) return undefined;
|
|
39
|
+
const field = current[seg];
|
|
40
|
+
wireSegments.push(field.wire);
|
|
41
|
+
if (i < segments.length - 1) {
|
|
42
|
+
if (field.children === undefined) return undefined;
|
|
43
|
+
current = field.children();
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return wireSegments.join('.');
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* A field mask implementing google.protobuf.FieldMask semantics.
|
|
51
|
+
*/
|
|
52
|
+
export class FieldMask<T = unknown> {
|
|
53
|
+
// Phantom marker: keeps `FieldMask<Alert>` and `FieldMask<Query>` compile-time distinct under TypeScript's otherwise-structural typing. Never set at runtime.
|
|
54
|
+
declare private readonly _tag: T;
|
|
55
|
+
|
|
56
|
+
// Stored post-translation, normalized wire-format paths.
|
|
57
|
+
private readonly paths: string[];
|
|
58
|
+
|
|
59
|
+
private constructor(paths: string[]) {
|
|
60
|
+
this.paths = paths;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* Build a FieldMask from typescript field name paths against the target message's schema. Validates every path by walking each segment through the schema and throws Error when any segment fails.
|
|
65
|
+
*
|
|
66
|
+
* Reserved for generated per-message factories; user code should call the factory (e.g. `alertFieldMask(...)`), which supplies the schema before delegating here.
|
|
67
|
+
*
|
|
68
|
+
* @internal
|
|
69
|
+
*/
|
|
70
|
+
static build<T>(paths: string[], schema: FieldMaskSchema): FieldMask<T> {
|
|
71
|
+
const normalized = normalize(paths);
|
|
72
|
+
const wire: string[] = [];
|
|
73
|
+
for (const p of normalized) {
|
|
74
|
+
const w = walkFieldMaskPath(schema, p);
|
|
75
|
+
if (w === undefined) {
|
|
76
|
+
throw new Error(`Unknown field path "${p}"`);
|
|
77
|
+
}
|
|
78
|
+
wire.push(w);
|
|
79
|
+
}
|
|
80
|
+
return new FieldMask<T>(wire);
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
/**
|
|
84
|
+
* Serialize the mask to the wire-format string.
|
|
85
|
+
*/
|
|
86
|
+
toString(): string {
|
|
87
|
+
return this.paths.join(',');
|
|
88
|
+
}
|
|
89
|
+
}
|
package/src/wkt/index.ts
ADDED
package/src/wkt/value.ts
ADDED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Represents any valid JSON value. Matches the JSON value space used by
|
|
3
|
+
* google.protobuf.Value.
|
|
4
|
+
*/
|
|
5
|
+
export type JsonValue =
|
|
6
|
+
| null
|
|
7
|
+
| number
|
|
8
|
+
| string
|
|
9
|
+
| boolean
|
|
10
|
+
| JsonObject
|
|
11
|
+
| JsonValue[];
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Represents a JSON object with string keys and JSON values. Matches the
|
|
15
|
+
* structure used by google.protobuf.Struct.
|
|
16
|
+
*/
|
|
17
|
+
export interface JsonObject {
|
|
18
|
+
[key: string]: JsonValue;
|
|
19
|
+
}
|
package/index.js
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
module.exports = {};
|