@databricks/sdk-forecasting 0.1.0-dev.3 → 0.1.0-dev.5
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 +28 -0
- package/dist/v1/client.d.ts +3 -3
- package/dist/v1/client.d.ts.map +1 -1
- package/dist/v1/client.js +21 -21
- package/dist/v1/client.js.map +1 -1
- package/dist/v1/model.d.ts +8 -7
- package/dist/v1/model.d.ts.map +1 -1
- package/dist/v1/model.js +9 -10
- package/dist/v1/model.js.map +1 -1
- package/dist/v1/transport.d.ts +30 -2
- package/dist/v1/transport.d.ts.map +1 -1
- package/dist/v1/transport.js +33 -16
- package/dist/v1/transport.js.map +1 -1
- package/dist/v1/utils.d.ts.map +1 -1
- package/dist/v1/utils.js +2 -1
- package/dist/v1/utils.js.map +1 -1
- package/package.json +9 -5
- package/src/v1/client.ts +0 -217
- package/src/v1/index.ts +0 -12
- package/src/v1/model.ts +0 -146
- package/src/v1/transport.ts +0 -73
- package/src/v1/utils.ts +0 -180
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# @databricks/sdk-forecasting
|
|
2
|
+
|
|
3
|
+
> [!WARNING]
|
|
4
|
+
>
|
|
5
|
+
> ## PREVIEW - NOT FOR PRODUCTION USE
|
|
6
|
+
>
|
|
7
|
+
> **This SDK is in preview and is subject to change without notice.**
|
|
8
|
+
>
|
|
9
|
+
> - **Do NOT use in production environments**
|
|
10
|
+
> - **Breaking changes may occur at any time**
|
|
11
|
+
> - **APIs are experimental and unstable**
|
|
12
|
+
> - **Use for development and testing only**
|
|
13
|
+
|
|
14
|
+
## Installation
|
|
15
|
+
|
|
16
|
+
```bash
|
|
17
|
+
npm install @databricks/sdk-forecasting
|
|
18
|
+
```
|
|
19
|
+
|
|
20
|
+
## Usage
|
|
21
|
+
|
|
22
|
+
```typescript
|
|
23
|
+
import {ForecastingClient} from '@databricks/sdk-forecasting/v1';
|
|
24
|
+
|
|
25
|
+
const client = new ForecastingClient({});
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
For a full getting-started guide, see the [root README](../../README.md).
|
package/dist/v1/client.d.ts
CHANGED
|
@@ -3,12 +3,12 @@ import type { ClientOptions } from '@databricks/sdk-options/client';
|
|
|
3
3
|
import type { LroOptions } from '@databricks/sdk-options/lro';
|
|
4
4
|
import type { CreateForecastingExperimentRequest, ForecastingExperiment, GetForecastingExperimentRequest } from './model';
|
|
5
5
|
export declare class ForecastingClient {
|
|
6
|
-
private readonly
|
|
7
|
-
private readonly workspaceId;
|
|
8
|
-
private readonly httpClient;
|
|
6
|
+
private readonly options;
|
|
9
7
|
private readonly logger;
|
|
10
8
|
private readonly userAgent;
|
|
9
|
+
private config;
|
|
11
10
|
constructor(options: ClientOptions);
|
|
11
|
+
private resolveConfig;
|
|
12
12
|
/** Creates a serverless forecasting experiment. Returns the experiment ID. */
|
|
13
13
|
private createForecastingExperiment;
|
|
14
14
|
createForecastingExperimentWaiter(req: CreateForecastingExperimentRequest, options?: CallOptions): Promise<CreateForecastingExperimentWaiter>;
|
package/dist/v1/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/v1/client.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAa5D,OAAO,KAAK,EACV,kCAAkC,EAElC,qBAAqB,EACrB,+BAA+B,EAChC,MAAM,SAAS,CAAC;AAcjB,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/v1/client.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAC,WAAW,EAAC,MAAM,8BAA8B,CAAC;AAC9D,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAClE,OAAO,KAAK,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAa5D,OAAO,KAAK,EACV,kCAAkC,EAElC,qBAAqB,EACrB,+BAA+B,EAChC,MAAM,SAAS,CAAC;AAcjB,qBAAa,iBAAiB;IAC5B,OAAO,CAAC,QAAQ,CAAC,OAAO,CAAgB;IACxC,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAIhC,OAAO,CAAC,QAAQ,CAAC,SAAS,CAAS;IAInC,OAAO,CAAC,MAAM,CAA4C;gBAE9C,OAAO,EAAE,aAAa;IAUlC,OAAO,CAAC,aAAa;IAKrB,8EAA8E;YAChE,2BAA2B;IAmCnC,iCAAiC,CACrC,GAAG,EAAE,kCAAkC,EACvC,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,iCAAiC,CAAC;IAU7C,+CAA+C;IACzC,wBAAwB,CAC5B,GAAG,EAAE,+BAA+B,EACpC,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,qBAAqB,CAAC;CAwBlC;AAED,qBAAa,iCAAiC;IAE1C,OAAO,CAAC,QAAQ,CAAC,MAAM;IACvB,QAAQ,CAAC,YAAY,EAAE,MAAM;gBADZ,MAAM,EAAE,iBAAiB,EACjC,YAAY,EAAE,MAAM;IAG/B;;;;OAIG;IACG,IAAI,CAAC,OAAO,CAAC,EAAE,UAAU,GAAG,OAAO,CAAC,qBAAqB,CAAC;IAqChE,iEAAiE;IAC3D,IAAI,CAAC,OAAO,CAAC,EAAE,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;CAsBpD"}
|
package/dist/v1/client.js
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { VERSION as AUTH_VERSION } from '@databricks/sdk-auth';
|
|
3
3
|
import { createDefault } from '@databricks/sdk-core/clientinfo';
|
|
4
4
|
import { NoOpLogger } from '@databricks/sdk-core/logger';
|
|
5
|
-
import {
|
|
5
|
+
import { resolveClientConfig } from './transport';
|
|
6
6
|
import { buildHttpRequest, executeCall, executeHttpCall, marshalRequest, parseResponse, executeWait, StillRunningError, } from './utils';
|
|
7
7
|
import pkgJson from '../../package.json' with { type: 'json' };
|
|
8
8
|
import { ForecastingExperiment_State, marshalCreateForecastingExperimentRequestSchema, unmarshalCreateForecastingExperimentResponseSchema, unmarshalForecastingExperimentSchema, } from './model';
|
|
@@ -12,46 +12,45 @@ const PACKAGE_SEGMENT = {
|
|
|
12
12
|
value: pkgJson.version,
|
|
13
13
|
};
|
|
14
14
|
export class ForecastingClient {
|
|
15
|
-
|
|
16
|
-
// Workspace ID used to route workspace-level calls on unified hosts (SPOG).
|
|
17
|
-
// When set, workspace-level methods send X-Databricks-Org-Id on every
|
|
18
|
-
// request.
|
|
19
|
-
workspaceId;
|
|
20
|
-
httpClient;
|
|
15
|
+
options;
|
|
21
16
|
logger;
|
|
22
17
|
// User-Agent header value. Composed once at construction from
|
|
23
18
|
// createDefault() merged with this package's identity and the active
|
|
24
19
|
// credential's name.
|
|
25
20
|
userAgent;
|
|
21
|
+
// Memoized configuration. The profile is resolved once, lazily, on the first
|
|
22
|
+
// request, then reused; host, workspaceId/accountId, and credentials are
|
|
23
|
+
// filled from it when not set explicitly on the options.
|
|
24
|
+
config;
|
|
26
25
|
constructor(options) {
|
|
27
|
-
|
|
28
|
-
throw new Error('Host is required.');
|
|
29
|
-
}
|
|
30
|
-
this.host = options.host.replace(/\/$/, '');
|
|
31
|
-
this.workspaceId = options.workspaceId;
|
|
26
|
+
this.options = options;
|
|
32
27
|
this.logger = options.logger ?? new NoOpLogger();
|
|
33
28
|
const info = createDefault()
|
|
34
29
|
.with(PACKAGE_SEGMENT)
|
|
35
30
|
.with({ key: 'sdk-js-auth', value: AUTH_VERSION })
|
|
36
31
|
.with({ key: 'auth', value: options.credentials?.name() ?? 'default' });
|
|
37
32
|
this.userAgent = info.toString();
|
|
38
|
-
|
|
33
|
+
}
|
|
34
|
+
resolveConfig() {
|
|
35
|
+
this.config ??= resolveClientConfig(this.options);
|
|
36
|
+
return this.config;
|
|
39
37
|
}
|
|
40
38
|
/** Creates a serverless forecasting experiment. Returns the experiment ID. */
|
|
41
39
|
async createForecastingExperiment(req, options) {
|
|
42
|
-
const
|
|
40
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
41
|
+
const url = `${host}/api/2.0/automl/create-forecasting-experiment`;
|
|
43
42
|
const body = marshalRequest(req, marshalCreateForecastingExperimentRequestSchema);
|
|
44
43
|
let resp;
|
|
45
44
|
const call = async (callSignal) => {
|
|
46
45
|
const headers = new Headers({ 'Content-Type': 'application/json' });
|
|
47
|
-
if (
|
|
48
|
-
headers.set('X-Databricks-Org-Id',
|
|
46
|
+
if (workspaceId !== undefined) {
|
|
47
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
49
48
|
}
|
|
50
49
|
headers.set('User-Agent', this.userAgent);
|
|
51
50
|
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
52
51
|
const respBody = await executeHttpCall({
|
|
53
52
|
request: httpReq,
|
|
54
|
-
httpClient
|
|
53
|
+
httpClient,
|
|
55
54
|
logger: this.logger,
|
|
56
55
|
});
|
|
57
56
|
resp = parseResponse(respBody, unmarshalCreateForecastingExperimentResponseSchema);
|
|
@@ -71,18 +70,19 @@ export class ForecastingClient {
|
|
|
71
70
|
}
|
|
72
71
|
/** Public RPC to get forecasting experiment */
|
|
73
72
|
async getForecastingExperiment(req, options) {
|
|
74
|
-
const
|
|
73
|
+
const { host, workspaceId, httpClient } = await this.resolveConfig();
|
|
74
|
+
const url = `${host}/api/2.0/automl/get-forecasting-experiment/${req.experimentId ?? ''}`;
|
|
75
75
|
let resp;
|
|
76
76
|
const call = async (callSignal) => {
|
|
77
77
|
const headers = new Headers();
|
|
78
|
-
if (
|
|
79
|
-
headers.set('X-Databricks-Org-Id',
|
|
78
|
+
if (workspaceId !== undefined) {
|
|
79
|
+
headers.set('X-Databricks-Org-Id', workspaceId);
|
|
80
80
|
}
|
|
81
81
|
headers.set('User-Agent', this.userAgent);
|
|
82
82
|
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
83
83
|
const respBody = await executeHttpCall({
|
|
84
84
|
request: httpReq,
|
|
85
|
-
httpClient
|
|
85
|
+
httpClient,
|
|
86
86
|
logger: this.logger,
|
|
87
87
|
});
|
|
88
88
|
resp = parseResponse(respBody, unmarshalForecastingExperimentSchema);
|
package/dist/v1/client.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/v1/client.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAC,aAAa,EAAC,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAKvD,OAAO,EAAC,
|
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../src/v1/client.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,OAAO,IAAI,YAAY,EAAC,MAAM,sBAAsB,CAAC;AAC7D,OAAO,EAAC,aAAa,EAAC,MAAM,iCAAiC,CAAC;AAE9D,OAAO,EAAC,UAAU,EAAC,MAAM,6BAA6B,CAAC;AAKvD,OAAO,EAAC,mBAAmB,EAAC,MAAM,aAAa,CAAC;AAChD,OAAO,EACL,gBAAgB,EAChB,WAAW,EACX,eAAe,EACf,cAAc,EACd,aAAa,EACb,WAAW,EACX,iBAAiB,GAClB,MAAM,SAAS,CAAC;AACjB,OAAO,OAAO,MAAM,oBAAoB,CAAC,OAAM,IAAI,EAAE,MAAM,EAAC,CAAC;AAO7D,OAAO,EACL,2BAA2B,EAC3B,+CAA+C,EAC/C,kDAAkD,EAClD,oCAAoC,GACrC,MAAM,SAAS,CAAC;AA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AC,wBAAwB,CACzD;YACE,YAAY,EAAE,IAAI,CAAC,YAAY;SAChC,EACD,OAAO,CACR,CAAC;QAEF,MAAM,MAAM,GAAG,QAAQ,CAAC,KAAK,CAAC;QAC9B,IAAI,MAAM,KAAK,SAAS,EAAE,CAAC;YACzB,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAC;QAC5D,CAAC;QAED,QAAQ,MAAM,EAAE,CAAC;YACf,KAAK,2BAA2B,CAAC,SAAS,CAAC;YAC3C,KAAK,2BAA2B,CAAC,MAAM,CAAC;YACxC,KAAK,2BAA2B,CAAC,SAAS;gBACxC,OAAO,IAAI,CAAC;YACd;gBACE,OAAO,KAAK,CAAC;QACjB,CAAC;IACH,CAAC;CACF"}
|
package/dist/v1/model.d.ts
CHANGED
|
@@ -1,16 +1,17 @@
|
|
|
1
1
|
import { z } from 'zod';
|
|
2
|
-
export declare
|
|
2
|
+
export declare const ForecastingExperiment_State: {
|
|
3
3
|
/** The forecasting experiment is pending and has not started yet. */
|
|
4
|
-
PENDING
|
|
4
|
+
readonly PENDING: "PENDING";
|
|
5
5
|
/** The forecasting experiment is currently running. */
|
|
6
|
-
RUNNING
|
|
6
|
+
readonly RUNNING: "RUNNING";
|
|
7
7
|
/** The forecasting experiment has completed successfully. */
|
|
8
|
-
SUCCEEDED
|
|
8
|
+
readonly SUCCEEDED: "SUCCEEDED";
|
|
9
9
|
/** The forecasting experiment has failed. */
|
|
10
|
-
FAILED
|
|
10
|
+
readonly FAILED: "FAILED";
|
|
11
11
|
/** The forecasting experiment has been cancelled. */
|
|
12
|
-
CANCELLED
|
|
13
|
-
}
|
|
12
|
+
readonly CANCELLED: "CANCELLED";
|
|
13
|
+
};
|
|
14
|
+
export type ForecastingExperiment_State = (typeof ForecastingExperiment_State)[keyof typeof ForecastingExperiment_State] | (string & {});
|
|
14
15
|
export interface CreateForecastingExperimentRequest {
|
|
15
16
|
/** The fully qualified path of a Unity Catalog table, formatted as catalog_name.schema_name.table_name, used as training data for the forecasting model. */
|
|
16
17
|
trainDataPath?: string | undefined;
|
package/dist/v1/model.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,
|
|
1
|
+
{"version":3,"file":"model.d.ts","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAEA,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAGtB,eAAO,MAAM,2BAA2B;IACtC,qEAAqE;;IAErE,uDAAuD;;IAEvD,6DAA6D;;IAE7D,6CAA6C;;IAE7C,qDAAqD;;CAE7C,CAAC;AAEX,MAAM,MAAM,2BAA2B,GACnC,CAAC,OAAO,2BAA2B,CAAC,CAAC,MAAM,OAAO,2BAA2B,CAAC,GAC9E,CAAC,MAAM,GAAG,EAAE,CAAC,CAAC;AAElB,MAAM,WAAW,kCAAkC;IACjD,4JAA4J;IAC5J,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,0KAA0K;IAC1K,YAAY,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAClC,mFAAmF;IACnF,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC;;;OAGG;IACH,mBAAmB,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACzC,qLAAqL;IACrL,eAAe,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,oEAAoE;IACpE,aAAa,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACnC,yJAAyJ;IACzJ,kBAAkB,CAAC,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IAC1C,iEAAiE;IACjE,cAAc,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IACpC,uHAAuH;IACvH,UAAU,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;IAChC,sHAAsH;IACt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API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
2
|
import { z } from 'zod';
|
|
3
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention --
|
|
4
|
-
export
|
|
5
|
-
(function (ForecastingExperiment_State) {
|
|
3
|
+
// eslint-disable-next-line @typescript-eslint/naming-convention -- Enum-style const object.
|
|
4
|
+
export const ForecastingExperiment_State = {
|
|
6
5
|
/** The forecasting experiment is pending and has not started yet. */
|
|
7
|
-
|
|
6
|
+
PENDING: 'PENDING',
|
|
8
7
|
/** The forecasting experiment is currently running. */
|
|
9
|
-
|
|
8
|
+
RUNNING: 'RUNNING',
|
|
10
9
|
/** The forecasting experiment has completed successfully. */
|
|
11
|
-
|
|
10
|
+
SUCCEEDED: 'SUCCEEDED',
|
|
12
11
|
/** The forecasting experiment has failed. */
|
|
13
|
-
|
|
12
|
+
FAILED: 'FAILED',
|
|
14
13
|
/** The forecasting experiment has been cancelled. */
|
|
15
|
-
|
|
16
|
-
}
|
|
14
|
+
CANCELLED: 'CANCELLED',
|
|
15
|
+
};
|
|
17
16
|
export const unmarshalCreateForecastingExperimentResponseSchema = z
|
|
18
17
|
.object({
|
|
19
18
|
experiment_id: z.string().optional(),
|
|
@@ -25,7 +24,7 @@ export const unmarshalForecastingExperimentSchema = z
|
|
|
25
24
|
.object({
|
|
26
25
|
experiment_id: z.string().optional(),
|
|
27
26
|
experiment_page_url: z.string().optional(),
|
|
28
|
-
state: z.
|
|
27
|
+
state: z.string().optional(),
|
|
29
28
|
})
|
|
30
29
|
.transform(d => ({
|
|
31
30
|
experimentId: d.experiment_id,
|
package/dist/v1/model.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/v1/model.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAE/E,OAAO,EAAC,CAAC,EAAC,MAAM,KAAK,CAAC;AAEtB,
|
|
1
|
+
{"version":3,"file":"model.js","sourceRoot":"","sources":["../../src/v1/model.ts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AC,CAAC,mBAAmB;IAC3C,gBAAgB,EAAE,CAAC,CAAC,eAAe;IACnC,cAAc,EAAE,CAAC,CAAC,aAAa;IAC/B,mBAAmB,EAAE,CAAC,CAAC,kBAAkB;IACzC,eAAe,EAAE,CAAC,CAAC,cAAc;IACjC,WAAW,EAAE,CAAC,CAAC,UAAU;IACzB,YAAY,EAAE,CAAC,CAAC,WAAW;IAC3B,qBAAqB,EAAE,CAAC,CAAC,mBAAmB;IAC5C,WAAW,EAAE,CAAC,CAAC,UAAU;IACzB,eAAe,EAAE,CAAC,CAAC,cAAc;IACjC,6BAA6B,EAAE,CAAC,CAAC,2BAA2B;IAC5D,oBAAoB,EAAE,CAAC,CAAC,kBAAkB;IAC1C,gBAAgB,EAAE,CAAC,CAAC,eAAe;IACnC,wBAAwB,EAAE,CAAC,CAAC,qBAAqB;CAClD,CAAC,CAAC,CAAC"}
|
package/dist/v1/transport.d.ts
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
import type { HttpClient } from '@databricks/sdk-core/http';
|
|
2
2
|
import type { ClientOptions } from '@databricks/sdk-options/client';
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* The configuration a client needs to issue requests, resolved from
|
|
5
|
+
* {@link ClientOptions} and a configuration profile.
|
|
6
|
+
*/
|
|
7
|
+
export interface ResolvedClientConfig {
|
|
8
|
+
/** Host with any trailing slash removed. */
|
|
9
|
+
host: string;
|
|
10
|
+
/**
|
|
11
|
+
* Default account ID for account-level paths that contain an account_id
|
|
12
|
+
* segment. A request's own accountId still wins.
|
|
13
|
+
*/
|
|
14
|
+
accountId?: string;
|
|
15
|
+
/**
|
|
16
|
+
* Workspace ID used to route workspace-level calls on unified hosts (SPOG).
|
|
17
|
+
*/
|
|
18
|
+
workspaceId?: string;
|
|
19
|
+
/** HTTP client with authentication, and any configured timeout, applied. */
|
|
20
|
+
httpClient: HttpClient;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.
|
|
24
|
+
*
|
|
25
|
+
* A configuration profile is always resolved from the config file and
|
|
26
|
+
* environment variables (per options.profileOptions); it supplies host,
|
|
27
|
+
* accountId, workspaceId, and credentials wherever the caller did not set them
|
|
28
|
+
* explicitly. Explicit options always take precedence.
|
|
29
|
+
*
|
|
30
|
+
* @throws if host is neither provided nor present in the resolved profile.
|
|
31
|
+
*/
|
|
32
|
+
export declare function resolveClientConfig(options: ClientOptions): Promise<ResolvedClientConfig>;
|
|
5
33
|
//# sourceMappingURL=transport.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/v1/transport.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EAGX,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"transport.d.ts","sourceRoot":"","sources":["../../src/v1/transport.ts"],"names":[],"mappings":"AAIA,OAAO,KAAK,EACV,UAAU,EAGX,MAAM,2BAA2B,CAAC;AAInC,OAAO,KAAK,EAAC,aAAa,EAAC,MAAM,gCAAgC,CAAC;AAElE;;;GAGG;AACH,MAAM,WAAW,oBAAoB;IACnC,4CAA4C;IAC5C,IAAI,EAAE,MAAM,CAAC;IAEb;;;OAGG;IACH,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,4EAA4E;IAC5E,UAAU,EAAE,UAAU,CAAC;CACxB;AAED;;;;;;;;;GASG;AACH,wBAAsB,mBAAmB,CACvC,OAAO,EAAE,aAAa,GACrB,OAAO,CAAC,oBAAoB,CAAC,CA4B/B"}
|
package/dist/v1/transport.js
CHANGED
|
@@ -1,24 +1,41 @@
|
|
|
1
1
|
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
2
|
import { defaultCredentials } from '@databricks/sdk-auth/credentials';
|
|
3
3
|
import { newFetchHttpClient } from '@databricks/sdk-core/http';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
4
|
+
import { resolve } from '@databricks/sdk-core/profiles';
|
|
5
|
+
/**
|
|
6
|
+
* Resolves {@link ClientOptions} into a {@link ResolvedClientConfig}.
|
|
7
|
+
*
|
|
8
|
+
* A configuration profile is always resolved from the config file and
|
|
9
|
+
* environment variables (per options.profileOptions); it supplies host,
|
|
10
|
+
* accountId, workspaceId, and credentials wherever the caller did not set them
|
|
11
|
+
* explicitly. Explicit options always take precedence.
|
|
12
|
+
*
|
|
13
|
+
* @throws if host is neither provided nor present in the resolved profile.
|
|
14
|
+
*/
|
|
15
|
+
export async function resolveClientConfig(options) {
|
|
16
|
+
const profile = await resolve(options.profileOptions);
|
|
17
|
+
const host = options.host ?? profile.host;
|
|
18
|
+
if (host === undefined) {
|
|
19
|
+
throw new Error('Host is required.');
|
|
14
20
|
}
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
21
|
+
// The provided httpClient (or the default fetch client) is the base wire;
|
|
22
|
+
// authentication and the optional timeout are layered on top of it. The
|
|
23
|
+
// default credential chain reuses the profile resolved above so that the
|
|
24
|
+
// same profileOptions govern host and authentication alike.
|
|
25
|
+
const base = options.httpClient ?? newFetchHttpClient();
|
|
26
|
+
const credentials = options.credentials ?? defaultCredentials({ profile });
|
|
27
|
+
let httpClient = new AuthHttpClient(base, credentials);
|
|
28
|
+
if (options.timeout !== undefined) {
|
|
29
|
+
httpClient = new TimeoutHttpClient(httpClient, options.timeout);
|
|
20
30
|
}
|
|
21
|
-
|
|
31
|
+
const accountId = options.accountId ?? profile.accountId;
|
|
32
|
+
const workspaceId = options.workspaceId ?? profile.workspaceId;
|
|
33
|
+
return {
|
|
34
|
+
host: host.replace(/\/$/, ''),
|
|
35
|
+
httpClient,
|
|
36
|
+
...(accountId !== undefined && { accountId }),
|
|
37
|
+
...(workspaceId !== undefined && { workspaceId }),
|
|
38
|
+
};
|
|
22
39
|
}
|
|
23
40
|
/** Wraps an HttpClient and adds authentication headers to requests. */
|
|
24
41
|
class AuthHttpClient {
|
package/dist/v1/transport.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/v1/transport.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAG/E,OAAO,EAAC,kBAAkB,EAAC,MAAM,kCAAkC,CAAC;AAMpE,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;
|
|
1
|
+
{"version":3,"file":"transport.js","sourceRoot":"","sources":["../../src/v1/transport.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAG/E,OAAO,EAAC,kBAAkB,EAAC,MAAM,kCAAkC,CAAC;AAMpE,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAE7D,OAAO,EAAC,OAAO,EAAC,MAAM,+BAA+B,CAAC;AA0BtD;;;;;;;;;GASG;AACH,MAAM,CAAC,KAAK,UAAU,mBAAmB,CACvC,OAAsB;IAEtB,MAAM,OAAO,GAAY,MAAM,OAAO,CAAC,OAAO,CAAC,cAAc,CAAC,CAAC;IAE/D,MAAM,IAAI,GAAG,OAAO,CAAC,IAAI,IAAI,OAAO,CAAC,IAAI,CAAC;IAC1C,IAAI,IAAI,KAAK,SAAS,EAAE,CAAC;QACvB,MAAM,IAAI,KAAK,CAAC,mBAAmB,CAAC,CAAC;IACvC,CAAC;IAED,0EAA0E;IAC1E,wEAAwE;IACxE,yEAAyE;IACzE,4DAA4D;IAC5D,MAAM,IAAI,GAAG,OAAO,CAAC,UAAU,IAAI,kBAAkB,EAAE,CAAC;IACxD,MAAM,WAAW,GAAG,OAAO,CAAC,WAAW,IAAI,kBAAkB,CAAC,EAAC,OAAO,EAAC,CAAC,CAAC;IACzE,IAAI,UAAU,GA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AC;CACzB;AAED;;;;GAIG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,EAC7C,OAAO,CAAC,EAAE,WAAW,GACpB,OAAO,CAAC,IAAI,CAAC,CASf;AAED;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,KAAK;CAAG;AAE/C;;;GAGG;AACH,wBAAsB,WAAW,CAC/B,IAAI,EAAE,CAAC,MAAM,CAAC,EAAE,WAAW,KAAK,OAAO,CAAC,IAAI,CAAC,EAC7C,OAAO,CAAC,EAAE,UAAU,GACnB,OAAO,CAAC,IAAI,CAAC,CAOf;AA2BD,wBAAsB,eAAe,CACnC,IAAI,EAAE,eAAe,GACpB,OAAO,CAAC,UAAU,CAAC,CA2BrB;AAED,wBAAgB,gBAAgB,CAC9B,MAAM,EAAE,MAAM,EACd,GAAG,EAAE,MAAM,EACX,OAAO,EAAE,OAAO,EAChB,MAAM,CAAC,EAAE,WAAW,EACpB,IAAI,CAAC,EAAE,MAAM,GAAG,cAAc,CAAC,UAAU,CAAC,GACzC,WAAW,CASb;AAED,wBAAgB,aAAa,CAAC,CAAC,EAAE,IAAI,EAAE,UAAU,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,GAAG,CAAC,CAK1E;AAED,wBAAgB,cAAc,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,EAAE,CAAC,CAAC,OAAO,GAAG,MAAM,CAEvE;AAED,wBAAgB,kBAAkB,CAChC,MAAM,EAAE,MAAM,EACd,KAAK,EAAE,OAAO,EACd,MAAM,EAAE,eAAe,GACtB,IAAI,CAuBN"}
|
package/dist/v1/utils.js
CHANGED
|
@@ -97,7 +97,8 @@ export function buildHttpRequest(method, url, headers, signal, body) {
|
|
|
97
97
|
}
|
|
98
98
|
export function parseResponse(body, schema) {
|
|
99
99
|
const text = new TextDecoder().decode(body);
|
|
100
|
-
|
|
100
|
+
// 204 responses return an empty body; treat as `{}`.
|
|
101
|
+
const parsed = text === '' ? {} : jsonBigint.parse(text);
|
|
101
102
|
return schema.parse(parsed);
|
|
102
103
|
}
|
|
103
104
|
export function marshalRequest(data, schema) {
|
package/dist/v1/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../src/v1/utils.ts"],"names":[],"mappings":"AAAA,+EAA+E;AAG/E,OAAO,EAAC,OAAO,EAAE,OAAO,EAAC,MAAM,0BAA0B,CAAC;AAC1D,OAAO,EAAC,QAAQ,EAAC,MAAM,+BAA+B,CAAC;AASvD,OAAO,OAAO,MAAM,aAAa,CAAC;AAGlC,0EAA0E;AAC1E,6EAA6E;AAC7E,gEAAgE;AAChE,MAAM,UAAU,GAAG,OAAO,CAAC,EAAC,eAAe,EAAE,IAAI,EAAC,CAAC,CAAC;AAQpD;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAA6C,EAC7C,OAAqB;IAErB,MAAM,IAAI,GAAY;QACpB,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,SAAS,IAAI,EAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAC,CAAC;QACjE,GAAG,CAAC,OAAO,EAAE,WAAW,KAAK,SAAS,IAAI;YACxC,WAAW,EAAE,OAAO,CAAC,WAAW;SACjC,CAAC;QACF,GAAG,CAAC,OAAO,EAAE,OAAO,KAAK,SAAS,IAAI,EAAC,OAAO,EAAE,OAAO,CAAC,OAAO,EAAC,CAAC;KAClE,CAAC;IACF,OAAO,OAAO,CAAC,OAAO,EAAE,MAAM,EAAE,IAAI,EAAE,IAAI,CAAC,CAAC;AAC9C,CAAC;AAED;;;;GAIG;AACH,MAAM,OAAO,iBAAkB,SAAQ,KAAK;CAAG;AAE/C;;;GAGG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAC/B,IAA6C,EAC7C,OAAoB;IAEpB,MAAM,IAAI,GAAY;Q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AAM,IAAI,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;QACtD,CAAC;IACH,CAAC;SAAM,IACL,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,QAAQ;QACzB,OAAO,KAAK,KAAK,SAAS;QAC1B,OAAO,KAAK,KAAK,QAAQ,EACzB,CAAC;QACD,MAAM,CAAC,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,KAAK,CAAC,CAAC,CAAC;IACvC,CAAC;SAAM,CAAC;QACN,MAAM,IAAI,KAAK,CAAC,qCAAqC,OAAO,KAAK,EAAE,CAAC,CAAC;IACvE,CAAC;AACH,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@databricks/sdk-forecasting",
|
|
3
|
-
"version": "0.1.0-dev.
|
|
3
|
+
"version": "0.1.0-dev.5",
|
|
4
4
|
"description": "",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"exports": {
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
},
|
|
13
13
|
"files": [
|
|
14
14
|
"dist",
|
|
15
|
-
"src",
|
|
16
15
|
"LICENSE"
|
|
17
16
|
],
|
|
18
17
|
"scripts": {
|
|
@@ -28,10 +27,15 @@
|
|
|
28
27
|
},
|
|
29
28
|
"author": "Databricks",
|
|
30
29
|
"license": "Apache-2.0",
|
|
30
|
+
"repository": {
|
|
31
|
+
"type": "git",
|
|
32
|
+
"url": "https://github.com/databricks/sdk-js.git",
|
|
33
|
+
"directory": "packages/forecasting"
|
|
34
|
+
},
|
|
31
35
|
"dependencies": {
|
|
32
|
-
"@databricks/sdk-auth": ">=0.1.0-dev.
|
|
33
|
-
"@databricks/sdk-core": ">=0.1.0-dev.
|
|
34
|
-
"@databricks/sdk-options": ">=0.1.0-dev.
|
|
36
|
+
"@databricks/sdk-auth": ">=0.1.0-dev.6 <1.0.0",
|
|
37
|
+
"@databricks/sdk-core": ">=0.1.0-dev.7 <1.0.0",
|
|
38
|
+
"@databricks/sdk-options": ">=0.1.0-dev.6 <1.0.0",
|
|
35
39
|
"@js-temporal/polyfill": "^0.5.0",
|
|
36
40
|
"json-bigint": "^1.0.0",
|
|
37
41
|
"zod": "^4.3.6"
|
package/src/v1/client.ts
DELETED
|
@@ -1,217 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import {VERSION as AUTH_VERSION} from '@databricks/sdk-auth';
|
|
4
|
-
import {createDefault} from '@databricks/sdk-core/clientinfo';
|
|
5
|
-
import type {Logger} from '@databricks/sdk-core/logger';
|
|
6
|
-
import {NoOpLogger} from '@databricks/sdk-core/logger';
|
|
7
|
-
import type {CallOptions} from '@databricks/sdk-options/call';
|
|
8
|
-
import type {ClientOptions} from '@databricks/sdk-options/client';
|
|
9
|
-
import type {LroOptions} from '@databricks/sdk-options/lro';
|
|
10
|
-
import type {HttpClient} from '@databricks/sdk-core/http';
|
|
11
|
-
import {newHttpClient} from './transport';
|
|
12
|
-
import {
|
|
13
|
-
buildHttpRequest,
|
|
14
|
-
executeCall,
|
|
15
|
-
executeHttpCall,
|
|
16
|
-
marshalRequest,
|
|
17
|
-
parseResponse,
|
|
18
|
-
executeWait,
|
|
19
|
-
StillRunningError,
|
|
20
|
-
} from './utils';
|
|
21
|
-
import pkgJson from '../../package.json' with {type: 'json'};
|
|
22
|
-
import type {
|
|
23
|
-
CreateForecastingExperimentRequest,
|
|
24
|
-
CreateForecastingExperimentResponse,
|
|
25
|
-
ForecastingExperiment,
|
|
26
|
-
GetForecastingExperimentRequest,
|
|
27
|
-
} from './model';
|
|
28
|
-
import {
|
|
29
|
-
ForecastingExperiment_State,
|
|
30
|
-
marshalCreateForecastingExperimentRequestSchema,
|
|
31
|
-
unmarshalCreateForecastingExperimentResponseSchema,
|
|
32
|
-
unmarshalForecastingExperimentSchema,
|
|
33
|
-
} from './model';
|
|
34
|
-
|
|
35
|
-
// Package identity segment for this client to be used in the User-Agent header.
|
|
36
|
-
const PACKAGE_SEGMENT = {
|
|
37
|
-
key: 'sdk-js-' + pkgJson.name.replace(/^@[^/]+\/sdk-/, ''),
|
|
38
|
-
value: pkgJson.version,
|
|
39
|
-
};
|
|
40
|
-
|
|
41
|
-
export class ForecastingClient {
|
|
42
|
-
private readonly host: string;
|
|
43
|
-
// Workspace ID used to route workspace-level calls on unified hosts (SPOG).
|
|
44
|
-
// When set, workspace-level methods send X-Databricks-Org-Id on every
|
|
45
|
-
// request.
|
|
46
|
-
private readonly workspaceId: string | undefined;
|
|
47
|
-
private readonly httpClient: HttpClient;
|
|
48
|
-
private readonly logger: Logger;
|
|
49
|
-
// User-Agent header value. Composed once at construction from
|
|
50
|
-
// createDefault() merged with this package's identity and the active
|
|
51
|
-
// credential's name.
|
|
52
|
-
private readonly userAgent: string;
|
|
53
|
-
|
|
54
|
-
constructor(options: ClientOptions) {
|
|
55
|
-
if (options.host === undefined) {
|
|
56
|
-
throw new Error('Host is required.');
|
|
57
|
-
}
|
|
58
|
-
this.host = options.host.replace(/\/$/, '');
|
|
59
|
-
this.workspaceId = options.workspaceId;
|
|
60
|
-
this.logger = options.logger ?? new NoOpLogger();
|
|
61
|
-
const info = createDefault()
|
|
62
|
-
.with(PACKAGE_SEGMENT)
|
|
63
|
-
.with({key: 'sdk-js-auth', value: AUTH_VERSION})
|
|
64
|
-
.with({key: 'auth', value: options.credentials?.name() ?? 'default'});
|
|
65
|
-
this.userAgent = info.toString();
|
|
66
|
-
this.httpClient = newHttpClient(options);
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/** Creates a serverless forecasting experiment. Returns the experiment ID. */
|
|
70
|
-
private async createForecastingExperiment(
|
|
71
|
-
req: CreateForecastingExperimentRequest,
|
|
72
|
-
options?: CallOptions
|
|
73
|
-
): Promise<CreateForecastingExperimentResponse> {
|
|
74
|
-
const url = `${this.host}/api/2.0/automl/create-forecasting-experiment`;
|
|
75
|
-
const body = marshalRequest(
|
|
76
|
-
req,
|
|
77
|
-
marshalCreateForecastingExperimentRequestSchema
|
|
78
|
-
);
|
|
79
|
-
let resp: CreateForecastingExperimentResponse | undefined;
|
|
80
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
81
|
-
const headers = new Headers({'Content-Type': 'application/json'});
|
|
82
|
-
if (this.workspaceId !== undefined) {
|
|
83
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
84
|
-
}
|
|
85
|
-
headers.set('User-Agent', this.userAgent);
|
|
86
|
-
const httpReq = buildHttpRequest('POST', url, headers, callSignal, body);
|
|
87
|
-
const respBody = await executeHttpCall({
|
|
88
|
-
request: httpReq,
|
|
89
|
-
httpClient: this.httpClient,
|
|
90
|
-
logger: this.logger,
|
|
91
|
-
});
|
|
92
|
-
resp = parseResponse(
|
|
93
|
-
respBody,
|
|
94
|
-
unmarshalCreateForecastingExperimentResponseSchema
|
|
95
|
-
);
|
|
96
|
-
};
|
|
97
|
-
await executeCall(call, options);
|
|
98
|
-
if (resp === undefined) {
|
|
99
|
-
throw new Error('operation completed without a result.');
|
|
100
|
-
}
|
|
101
|
-
return resp;
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
async createForecastingExperimentWaiter(
|
|
105
|
-
req: CreateForecastingExperimentRequest,
|
|
106
|
-
options?: CallOptions
|
|
107
|
-
): Promise<CreateForecastingExperimentWaiter> {
|
|
108
|
-
const resp = await this.createForecastingExperiment(req, options);
|
|
109
|
-
if (resp.experimentId === undefined) {
|
|
110
|
-
throw new Error(
|
|
111
|
-
'response field experimentId required for polling is missing'
|
|
112
|
-
);
|
|
113
|
-
}
|
|
114
|
-
return new CreateForecastingExperimentWaiter(this, resp.experimentId);
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
/** Public RPC to get forecasting experiment */
|
|
118
|
-
async getForecastingExperiment(
|
|
119
|
-
req: GetForecastingExperimentRequest,
|
|
120
|
-
options?: CallOptions
|
|
121
|
-
): Promise<ForecastingExperiment> {
|
|
122
|
-
const url = `${this.host}/api/2.0/automl/get-forecasting-experiment/${req.experimentId ?? ''}`;
|
|
123
|
-
let resp: ForecastingExperiment | undefined;
|
|
124
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
125
|
-
const headers = new Headers();
|
|
126
|
-
if (this.workspaceId !== undefined) {
|
|
127
|
-
headers.set('X-Databricks-Org-Id', this.workspaceId);
|
|
128
|
-
}
|
|
129
|
-
headers.set('User-Agent', this.userAgent);
|
|
130
|
-
const httpReq = buildHttpRequest('GET', url, headers, callSignal);
|
|
131
|
-
const respBody = await executeHttpCall({
|
|
132
|
-
request: httpReq,
|
|
133
|
-
httpClient: this.httpClient,
|
|
134
|
-
logger: this.logger,
|
|
135
|
-
});
|
|
136
|
-
resp = parseResponse(respBody, unmarshalForecastingExperimentSchema);
|
|
137
|
-
};
|
|
138
|
-
await executeCall(call, options);
|
|
139
|
-
if (resp === undefined) {
|
|
140
|
-
throw new Error('operation completed without a result.');
|
|
141
|
-
}
|
|
142
|
-
return resp;
|
|
143
|
-
}
|
|
144
|
-
}
|
|
145
|
-
|
|
146
|
-
export class CreateForecastingExperimentWaiter {
|
|
147
|
-
constructor(
|
|
148
|
-
private readonly client: ForecastingClient,
|
|
149
|
-
readonly experimentId: string
|
|
150
|
-
) {}
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* Polls until the operation reaches a terminal state.
|
|
154
|
-
*
|
|
155
|
-
* Throws if a failure state is reached.
|
|
156
|
-
*/
|
|
157
|
-
async wait(options?: LroOptions): Promise<ForecastingExperiment> {
|
|
158
|
-
let result: ForecastingExperiment | undefined;
|
|
159
|
-
|
|
160
|
-
const call = async (callSignal?: AbortSignal): Promise<void> => {
|
|
161
|
-
const pollResp = await this.client.getForecastingExperiment(
|
|
162
|
-
{
|
|
163
|
-
experimentId: this.experimentId,
|
|
164
|
-
},
|
|
165
|
-
callSignal !== undefined ? {signal: callSignal} : undefined
|
|
166
|
-
);
|
|
167
|
-
|
|
168
|
-
const status = pollResp.state;
|
|
169
|
-
if (status === undefined) {
|
|
170
|
-
throw new Error('response missing required status field');
|
|
171
|
-
}
|
|
172
|
-
|
|
173
|
-
switch (status) {
|
|
174
|
-
case ForecastingExperiment_State.SUCCEEDED:
|
|
175
|
-
result = pollResp;
|
|
176
|
-
return;
|
|
177
|
-
case ForecastingExperiment_State.FAILED:
|
|
178
|
-
case ForecastingExperiment_State.CANCELLED: {
|
|
179
|
-
const msg = '(no message)';
|
|
180
|
-
throw new Error(`terminal state ${status}: ${msg}`);
|
|
181
|
-
}
|
|
182
|
-
default:
|
|
183
|
-
throw new StillRunningError();
|
|
184
|
-
}
|
|
185
|
-
};
|
|
186
|
-
|
|
187
|
-
await executeWait(call, options);
|
|
188
|
-
if (result === undefined) {
|
|
189
|
-
throw new Error('operation completed without a result.');
|
|
190
|
-
}
|
|
191
|
-
return result;
|
|
192
|
-
}
|
|
193
|
-
|
|
194
|
-
/** Checks whether the operation has reached a terminal state. */
|
|
195
|
-
async done(options?: CallOptions): Promise<boolean> {
|
|
196
|
-
const pollResp = await this.client.getForecastingExperiment(
|
|
197
|
-
{
|
|
198
|
-
experimentId: this.experimentId,
|
|
199
|
-
},
|
|
200
|
-
options
|
|
201
|
-
);
|
|
202
|
-
|
|
203
|
-
const status = pollResp.state;
|
|
204
|
-
if (status === undefined) {
|
|
205
|
-
throw new Error('response missing required status field');
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
switch (status) {
|
|
209
|
-
case ForecastingExperiment_State.SUCCEEDED:
|
|
210
|
-
case ForecastingExperiment_State.FAILED:
|
|
211
|
-
case ForecastingExperiment_State.CANCELLED:
|
|
212
|
-
return true;
|
|
213
|
-
default:
|
|
214
|
-
return false;
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
package/src/v1/index.ts
DELETED
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
export {ForecastingClient, CreateForecastingExperimentWaiter} from './client';
|
|
4
|
-
|
|
5
|
-
export {ForecastingExperiment_State} from './model';
|
|
6
|
-
|
|
7
|
-
export type {
|
|
8
|
-
CreateForecastingExperimentRequest,
|
|
9
|
-
CreateForecastingExperimentResponse,
|
|
10
|
-
ForecastingExperiment,
|
|
11
|
-
GetForecastingExperimentRequest,
|
|
12
|
-
} from './model';
|
package/src/v1/model.ts
DELETED
|
@@ -1,146 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import {z} from 'zod';
|
|
4
|
-
|
|
5
|
-
// eslint-disable-next-line @typescript-eslint/naming-convention -- Proto-style nested enum name.
|
|
6
|
-
export enum ForecastingExperiment_State {
|
|
7
|
-
/** The forecasting experiment is pending and has not started yet. */
|
|
8
|
-
PENDING = 'PENDING',
|
|
9
|
-
/** The forecasting experiment is currently running. */
|
|
10
|
-
RUNNING = 'RUNNING',
|
|
11
|
-
/** The forecasting experiment has completed successfully. */
|
|
12
|
-
SUCCEEDED = 'SUCCEEDED',
|
|
13
|
-
/** The forecasting experiment has failed. */
|
|
14
|
-
FAILED = 'FAILED',
|
|
15
|
-
/** The forecasting experiment has been cancelled. */
|
|
16
|
-
CANCELLED = 'CANCELLED',
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
export interface CreateForecastingExperimentRequest {
|
|
20
|
-
/** The fully qualified path of a Unity Catalog table, formatted as catalog_name.schema_name.table_name, used as training data for the forecasting model. */
|
|
21
|
-
trainDataPath?: string | undefined;
|
|
22
|
-
/** The column in the input training table used as the prediction target for model training. The values in this column are used as the ground truth for model training. */
|
|
23
|
-
targetColumn?: string | undefined;
|
|
24
|
-
/** The column in the input training table that represents each row's timestamp. */
|
|
25
|
-
timeColumn?: string | undefined;
|
|
26
|
-
/**
|
|
27
|
-
* The time interval between consecutive rows in the time series data.
|
|
28
|
-
* Possible values include: '1 second', '1 minute', '5 minutes', '10 minutes', '15 minutes', '30 minutes', 'Hourly', 'Daily', 'Weekly', 'Monthly', 'Quarterly', 'Yearly'.
|
|
29
|
-
*/
|
|
30
|
-
forecastGranularity?: string | undefined;
|
|
31
|
-
/** The number of time steps into the future to make predictions, calculated as a multiple of forecast_granularity. This value represents how far ahead the model should forecast. */
|
|
32
|
-
forecastHorizon?: bigint | undefined;
|
|
33
|
-
/** The evaluation metric used to optimize the forecasting model. */
|
|
34
|
-
primaryMetric?: string | undefined;
|
|
35
|
-
/** List of frameworks to include for model tuning. Possible values are 'Prophet', 'ARIMA', 'DeepAR'. An empty list includes all supported frameworks. */
|
|
36
|
-
trainingFrameworks?: string[] | undefined;
|
|
37
|
-
/** The path in the workspace to store the created experiment. */
|
|
38
|
-
experimentPath?: string | undefined;
|
|
39
|
-
/** The maximum duration for the experiment in minutes. The experiment stops automatically if it exceeds this limit. */
|
|
40
|
-
maxRuntime?: bigint | undefined;
|
|
41
|
-
/** // The column in the training table used for custom data splits. Values must be 'train', 'validate', or 'test'. */
|
|
42
|
-
splitColumn?: string | undefined;
|
|
43
|
-
/** The column in the training table used to customize weights for each time series. */
|
|
44
|
-
customWeightsColumn?: string | undefined;
|
|
45
|
-
/** The fully qualified path of a Unity Catalog model, formatted as catalog_name.schema_name.model_name, used to store the best model. */
|
|
46
|
-
registerTo?: string | undefined;
|
|
47
|
-
/** The region code(s) to automatically add holiday features. Currently supports only one region. */
|
|
48
|
-
holidayRegions?: string[] | undefined;
|
|
49
|
-
/** The column in the training table used to group the dataset for predicting individual time series. */
|
|
50
|
-
timeseriesIdentifierColumns?: string[] | undefined;
|
|
51
|
-
/** The fully qualified path of a Unity Catalog table, formatted as catalog_name.schema_name.table_name, used to store predictions. */
|
|
52
|
-
predictionDataPath?: string | undefined;
|
|
53
|
-
/**
|
|
54
|
-
* Specifies the list of feature columns to include in model training. These columns must exist
|
|
55
|
-
* in the training data and be of type string, numerical, or boolean. If not specified, no additional
|
|
56
|
-
* features will be included.
|
|
57
|
-
* Note: Certain columns are automatically handled:
|
|
58
|
-
* - Automatically excluded: split_column, target_column, custom_weights_column.
|
|
59
|
-
* - Automatically included: time_column.
|
|
60
|
-
*/
|
|
61
|
-
includeFeatures?: string[] | undefined;
|
|
62
|
-
/** The fully qualified path of a Unity Catalog table, formatted as catalog_name.schema_name.table_name, used to store future feature data for predictions. */
|
|
63
|
-
futureFeatureDataPath?: string | undefined;
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
export interface CreateForecastingExperimentResponse {
|
|
67
|
-
/** The unique ID of the created forecasting experiment */
|
|
68
|
-
experimentId?: string | undefined;
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
/** Represents a forecasting experiment with its unique identifier, URL, and state. */
|
|
72
|
-
export interface ForecastingExperiment {
|
|
73
|
-
/** The unique ID for the forecasting experiment. */
|
|
74
|
-
experimentId?: string | undefined;
|
|
75
|
-
/** The URL to the forecasting experiment page. */
|
|
76
|
-
experimentPageUrl?: string | undefined;
|
|
77
|
-
/** The current state of the forecasting experiment. */
|
|
78
|
-
state?: ForecastingExperiment_State | undefined;
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
export interface GetForecastingExperimentRequest {
|
|
82
|
-
/** The unique ID of a forecasting experiment */
|
|
83
|
-
experimentId?: string | undefined;
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
export const unmarshalCreateForecastingExperimentResponseSchema: z.ZodType<CreateForecastingExperimentResponse> =
|
|
87
|
-
z
|
|
88
|
-
.object({
|
|
89
|
-
experiment_id: z.string().optional(),
|
|
90
|
-
})
|
|
91
|
-
.transform(d => ({
|
|
92
|
-
experimentId: d.experiment_id,
|
|
93
|
-
}));
|
|
94
|
-
|
|
95
|
-
export const unmarshalForecastingExperimentSchema: z.ZodType<ForecastingExperiment> =
|
|
96
|
-
z
|
|
97
|
-
.object({
|
|
98
|
-
experiment_id: z.string().optional(),
|
|
99
|
-
experiment_page_url: z.string().optional(),
|
|
100
|
-
state: z.enum(ForecastingExperiment_State).optional(),
|
|
101
|
-
})
|
|
102
|
-
.transform(d => ({
|
|
103
|
-
experimentId: d.experiment_id,
|
|
104
|
-
experimentPageUrl: d.experiment_page_url,
|
|
105
|
-
state: d.state,
|
|
106
|
-
}));
|
|
107
|
-
|
|
108
|
-
export const marshalCreateForecastingExperimentRequestSchema: z.ZodType = z
|
|
109
|
-
.object({
|
|
110
|
-
trainDataPath: z.string().optional(),
|
|
111
|
-
targetColumn: z.string().optional(),
|
|
112
|
-
timeColumn: z.string().optional(),
|
|
113
|
-
forecastGranularity: z.string().optional(),
|
|
114
|
-
forecastHorizon: z.bigint().optional(),
|
|
115
|
-
primaryMetric: z.string().optional(),
|
|
116
|
-
trainingFrameworks: z.array(z.string()).optional(),
|
|
117
|
-
experimentPath: z.string().optional(),
|
|
118
|
-
maxRuntime: z.bigint().optional(),
|
|
119
|
-
splitColumn: z.string().optional(),
|
|
120
|
-
customWeightsColumn: z.string().optional(),
|
|
121
|
-
registerTo: z.string().optional(),
|
|
122
|
-
holidayRegions: z.array(z.string()).optional(),
|
|
123
|
-
timeseriesIdentifierColumns: z.array(z.string()).optional(),
|
|
124
|
-
predictionDataPath: z.string().optional(),
|
|
125
|
-
includeFeatures: z.array(z.string()).optional(),
|
|
126
|
-
futureFeatureDataPath: z.string().optional(),
|
|
127
|
-
})
|
|
128
|
-
.transform(d => ({
|
|
129
|
-
train_data_path: d.trainDataPath,
|
|
130
|
-
target_column: d.targetColumn,
|
|
131
|
-
time_column: d.timeColumn,
|
|
132
|
-
forecast_granularity: d.forecastGranularity,
|
|
133
|
-
forecast_horizon: d.forecastHorizon,
|
|
134
|
-
primary_metric: d.primaryMetric,
|
|
135
|
-
training_frameworks: d.trainingFrameworks,
|
|
136
|
-
experiment_path: d.experimentPath,
|
|
137
|
-
max_runtime: d.maxRuntime,
|
|
138
|
-
split_column: d.splitColumn,
|
|
139
|
-
custom_weights_column: d.customWeightsColumn,
|
|
140
|
-
register_to: d.registerTo,
|
|
141
|
-
holiday_regions: d.holidayRegions,
|
|
142
|
-
timeseries_identifier_columns: d.timeseriesIdentifierColumns,
|
|
143
|
-
prediction_data_path: d.predictionDataPath,
|
|
144
|
-
include_features: d.includeFeatures,
|
|
145
|
-
future_feature_data_path: d.futureFeatureDataPath,
|
|
146
|
-
}));
|
package/src/v1/transport.ts
DELETED
|
@@ -1,73 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import type {Credentials} from '@databricks/sdk-auth';
|
|
4
|
-
import {defaultCredentials} from '@databricks/sdk-auth/credentials';
|
|
5
|
-
import type {
|
|
6
|
-
HttpClient,
|
|
7
|
-
HttpRequest,
|
|
8
|
-
HttpResponse,
|
|
9
|
-
} from '@databricks/sdk-core/http';
|
|
10
|
-
import {newFetchHttpClient} from '@databricks/sdk-core/http';
|
|
11
|
-
import type {ClientOptions} from '@databricks/sdk-options/client';
|
|
12
|
-
|
|
13
|
-
/** Creates a new HTTP client with the given options. */
|
|
14
|
-
export function newHttpClient(options?: ClientOptions): HttpClient {
|
|
15
|
-
const opts = options ?? {};
|
|
16
|
-
|
|
17
|
-
// If an HTTP client is provided, use it as-is. Throw if other options are
|
|
18
|
-
// also set, since they would be silently ignored.
|
|
19
|
-
if (opts.httpClient !== undefined) {
|
|
20
|
-
if (opts.credentials !== undefined || opts.timeout !== undefined) {
|
|
21
|
-
throw new Error(
|
|
22
|
-
'httpClient cannot be combined with credentials or timeout'
|
|
23
|
-
);
|
|
24
|
-
}
|
|
25
|
-
return opts.httpClient;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
const credentials = opts.credentials ?? defaultCredentials();
|
|
29
|
-
|
|
30
|
-
const base = newFetchHttpClient();
|
|
31
|
-
let client: HttpClient = new AuthHttpClient(base, credentials);
|
|
32
|
-
|
|
33
|
-
if (opts.timeout !== undefined) {
|
|
34
|
-
client = new TimeoutHttpClient(client, opts.timeout);
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
return client;
|
|
38
|
-
}
|
|
39
|
-
|
|
40
|
-
/** Wraps an HttpClient and adds authentication headers to requests. */
|
|
41
|
-
class AuthHttpClient implements HttpClient {
|
|
42
|
-
constructor(
|
|
43
|
-
private readonly base: HttpClient,
|
|
44
|
-
private readonly credentials: Credentials
|
|
45
|
-
) {}
|
|
46
|
-
|
|
47
|
-
async send(request: HttpRequest): Promise<HttpResponse> {
|
|
48
|
-
const authHeaders = await this.credentials.authHeaders();
|
|
49
|
-
// Do not modify the original request.
|
|
50
|
-
const headers = new Headers(request.headers);
|
|
51
|
-
for (const h of authHeaders) {
|
|
52
|
-
headers.set(h.key, h.value);
|
|
53
|
-
}
|
|
54
|
-
return this.base.send({...request, headers});
|
|
55
|
-
}
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
/** Wraps an HttpClient and applies a default timeout to requests. */
|
|
59
|
-
class TimeoutHttpClient implements HttpClient {
|
|
60
|
-
constructor(
|
|
61
|
-
private readonly base: HttpClient,
|
|
62
|
-
private readonly timeout: number
|
|
63
|
-
) {}
|
|
64
|
-
|
|
65
|
-
async send(request: HttpRequest): Promise<HttpResponse> {
|
|
66
|
-
const timeoutSignal = AbortSignal.timeout(this.timeout);
|
|
67
|
-
const signal =
|
|
68
|
-
request.signal !== undefined
|
|
69
|
-
? AbortSignal.any([request.signal, timeoutSignal])
|
|
70
|
-
: timeoutSignal;
|
|
71
|
-
return this.base.send({...request, signal});
|
|
72
|
-
}
|
|
73
|
-
}
|
package/src/v1/utils.ts
DELETED
|
@@ -1,180 +0,0 @@
|
|
|
1
|
-
// Code generated from API definition by Databricks SDK Generator. DO NOT EDIT.
|
|
2
|
-
|
|
3
|
-
import type {Options} from '@databricks/sdk-core/ops';
|
|
4
|
-
import {execute, retryOn} from '@databricks/sdk-core/ops';
|
|
5
|
-
import {ApiError} from '@databricks/sdk-core/apierror';
|
|
6
|
-
import type {
|
|
7
|
-
HttpClient,
|
|
8
|
-
HttpRequest,
|
|
9
|
-
HttpResponse,
|
|
10
|
-
} from '@databricks/sdk-core/http';
|
|
11
|
-
import type {Logger} from '@databricks/sdk-core/logger';
|
|
12
|
-
import type {CallOptions} from '@databricks/sdk-options/call';
|
|
13
|
-
import type {LroOptions} from '@databricks/sdk-options/lro';
|
|
14
|
-
import JSONBig from 'json-bigint';
|
|
15
|
-
import type {z} from 'zod';
|
|
16
|
-
|
|
17
|
-
// JSON codec that preserves int64 precision. On the way in, large integer
|
|
18
|
-
// literals come back as bigint instead of being rounded to JS Number. On the
|
|
19
|
-
// way out, bigint values are emitted as raw JSON number digits.
|
|
20
|
-
const jsonBigint = JSONBig({useNativeBigInt: true});
|
|
21
|
-
|
|
22
|
-
export interface HttpCallOptions {
|
|
23
|
-
readonly request: HttpRequest;
|
|
24
|
-
readonly httpClient: HttpClient;
|
|
25
|
-
readonly logger: Logger;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
/**
|
|
29
|
-
* Translates public CallOptions to the internal Options shape accepted by
|
|
30
|
-
* execute(). Even though the shapes match today, this isolates the public
|
|
31
|
-
* API from the executor's internal type so they can diverge.
|
|
32
|
-
*/
|
|
33
|
-
export async function executeCall(
|
|
34
|
-
call: (signal?: AbortSignal) => Promise<void>,
|
|
35
|
-
options?: CallOptions
|
|
36
|
-
): Promise<void> {
|
|
37
|
-
const opts: Options = {
|
|
38
|
-
...(options?.retrier !== undefined && {retrier: options.retrier}),
|
|
39
|
-
...(options?.rateLimiter !== undefined && {
|
|
40
|
-
rateLimiter: options.rateLimiter,
|
|
41
|
-
}),
|
|
42
|
-
...(options?.timeout !== undefined && {timeout: options.timeout}),
|
|
43
|
-
};
|
|
44
|
-
return execute(options?.signal, call, opts);
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
/**
|
|
48
|
-
* Sentinel thrown by a polling call to signal that the operation has not
|
|
49
|
-
* yet reached a terminal state. {@link executeWait} treats this error as
|
|
50
|
-
* retriable; any other error aborts the wait.
|
|
51
|
-
*/
|
|
52
|
-
export class StillRunningError extends Error {}
|
|
53
|
-
|
|
54
|
-
/**
|
|
55
|
-
* Polls until the call returns without throwing {@link StillRunningError}.
|
|
56
|
-
* Abort and overall-deadline behavior come from the supplied LroOptions.
|
|
57
|
-
*/
|
|
58
|
-
export async function executeWait(
|
|
59
|
-
call: (signal?: AbortSignal) => Promise<void>,
|
|
60
|
-
options?: LroOptions
|
|
61
|
-
): Promise<void> {
|
|
62
|
-
const opts: Options = {
|
|
63
|
-
...(options?.timeout !== undefined && {timeout: options.timeout}),
|
|
64
|
-
retrier: () =>
|
|
65
|
-
retryOn({}, (err: Error) => err instanceof StillRunningError),
|
|
66
|
-
};
|
|
67
|
-
return execute(options?.signal, call, opts);
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
async function readAll(
|
|
71
|
-
body: ReadableStream<Uint8Array> | null
|
|
72
|
-
): Promise<Uint8Array> {
|
|
73
|
-
if (body === null) {
|
|
74
|
-
return new Uint8Array(0);
|
|
75
|
-
}
|
|
76
|
-
const reader = body.getReader();
|
|
77
|
-
const chunks: Uint8Array[] = [];
|
|
78
|
-
for (;;) {
|
|
79
|
-
const {done, value} = await reader.read();
|
|
80
|
-
if (done) {
|
|
81
|
-
break;
|
|
82
|
-
}
|
|
83
|
-
chunks.push(value);
|
|
84
|
-
}
|
|
85
|
-
const totalLength = chunks.reduce((acc, chunk) => acc + chunk.length, 0);
|
|
86
|
-
const result = new Uint8Array(totalLength);
|
|
87
|
-
let offset = 0;
|
|
88
|
-
for (const chunk of chunks) {
|
|
89
|
-
result.set(chunk, offset);
|
|
90
|
-
offset += chunk.length;
|
|
91
|
-
}
|
|
92
|
-
return result;
|
|
93
|
-
}
|
|
94
|
-
|
|
95
|
-
export async function executeHttpCall(
|
|
96
|
-
opts: HttpCallOptions
|
|
97
|
-
): Promise<Uint8Array> {
|
|
98
|
-
opts.logger.debug('HTTP request', {
|
|
99
|
-
method: opts.request.method,
|
|
100
|
-
url: opts.request.url,
|
|
101
|
-
});
|
|
102
|
-
|
|
103
|
-
let resp: HttpResponse;
|
|
104
|
-
try {
|
|
105
|
-
resp = await opts.httpClient.send(opts.request);
|
|
106
|
-
} catch (e: unknown) {
|
|
107
|
-
opts.logger.debug('HTTP request failed');
|
|
108
|
-
throw e;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
const body = await readAll(resp.body);
|
|
112
|
-
|
|
113
|
-
opts.logger.debug('HTTP response', {
|
|
114
|
-
statusCode: resp.statusCode,
|
|
115
|
-
body: new TextDecoder().decode(body),
|
|
116
|
-
});
|
|
117
|
-
|
|
118
|
-
const apiErr = ApiError.fromHttpError(resp.statusCode, resp.headers, body);
|
|
119
|
-
if (apiErr !== undefined) {
|
|
120
|
-
throw apiErr;
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
return body;
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
export function buildHttpRequest(
|
|
127
|
-
method: string,
|
|
128
|
-
url: string,
|
|
129
|
-
headers: Headers,
|
|
130
|
-
signal?: AbortSignal,
|
|
131
|
-
body?: string | ReadableStream<Uint8Array>
|
|
132
|
-
): HttpRequest {
|
|
133
|
-
const req: HttpRequest = {url, method, headers};
|
|
134
|
-
if (body !== undefined) {
|
|
135
|
-
req.body = body;
|
|
136
|
-
}
|
|
137
|
-
if (signal !== undefined) {
|
|
138
|
-
req.signal = signal;
|
|
139
|
-
}
|
|
140
|
-
return req;
|
|
141
|
-
}
|
|
142
|
-
|
|
143
|
-
export function parseResponse<T>(body: Uint8Array, schema: z.ZodType<T>): T {
|
|
144
|
-
const text = new TextDecoder().decode(body);
|
|
145
|
-
const parsed: unknown = jsonBigint.parse(text);
|
|
146
|
-
return schema.parse(parsed);
|
|
147
|
-
}
|
|
148
|
-
|
|
149
|
-
export function marshalRequest(data: unknown, schema: z.ZodType): string {
|
|
150
|
-
return jsonBigint.stringify(schema.parse(data));
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
export function flattenQueryParams(
|
|
154
|
-
prefix: string,
|
|
155
|
-
value: unknown,
|
|
156
|
-
params: URLSearchParams
|
|
157
|
-
): void {
|
|
158
|
-
if (value === null || value === undefined) {
|
|
159
|
-
return;
|
|
160
|
-
}
|
|
161
|
-
if (Array.isArray(value)) {
|
|
162
|
-
// arrays of objects are not yet supported
|
|
163
|
-
for (const item of value) {
|
|
164
|
-
params.append(prefix, String(item));
|
|
165
|
-
}
|
|
166
|
-
} else if (typeof value === 'object') {
|
|
167
|
-
for (const [key, val] of Object.entries(value as Record<string, unknown>)) {
|
|
168
|
-
flattenQueryParams(`${prefix}.${key}`, val, params);
|
|
169
|
-
}
|
|
170
|
-
} else if (
|
|
171
|
-
typeof value === 'string' ||
|
|
172
|
-
typeof value === 'number' ||
|
|
173
|
-
typeof value === 'boolean' ||
|
|
174
|
-
typeof value === 'bigint'
|
|
175
|
-
) {
|
|
176
|
-
params.append(prefix, String(value));
|
|
177
|
-
} else {
|
|
178
|
-
throw new Error(`Unsupported query parameter type: ${typeof value}`);
|
|
179
|
-
}
|
|
180
|
-
}
|