deepline 0.1.306 → 0.1.307
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/bundling-sources/sdk/src/client.ts +11 -24
- package/dist/bundling-sources/sdk/src/errors.ts +3 -1
- package/dist/bundling-sources/sdk/src/http.ts +16 -24
- package/dist/bundling-sources/sdk/src/release.ts +1 -1
- package/dist/cli/index.js +24 -32
- package/dist/cli/index.mjs +24 -32
- package/dist/index.d.mts +3 -1
- package/dist/index.d.ts +3 -1
- package/dist/index.js +23 -30
- package/dist/index.mjs +23 -30
- package/package.json +1 -1
|
@@ -1785,7 +1785,6 @@ export class DeeplineClient {
|
|
|
1785
1785
|
},
|
|
1786
1786
|
headers,
|
|
1787
1787
|
{
|
|
1788
|
-
forbiddenAsApiError: true,
|
|
1789
1788
|
timeout: options?.timeout ?? resolveToolExecuteTimeoutMs(toolId, input),
|
|
1790
1789
|
maxRetries: options?.maxRetries ?? 0,
|
|
1791
1790
|
exactUrlOnly: true,
|
|
@@ -1848,17 +1847,11 @@ export class DeeplineClient {
|
|
|
1848
1847
|
async repairIngestionStorage(input?: {
|
|
1849
1848
|
provider?: string;
|
|
1850
1849
|
}): Promise<IngestionStorageRepairResult> {
|
|
1851
|
-
// forbiddenAsApiError: the repair route returns a meaningful 403 for
|
|
1852
|
-
// non-org-admin callers. Without it, http.ts collapses 403 into a generic
|
|
1853
|
-
// AuthError (statusCode 401) and the CLI's "requires org admin" branch
|
|
1854
|
-
// could never fire.
|
|
1855
1850
|
return this.http.post<IngestionStorageRepairResult>(
|
|
1856
1851
|
'/api/v2/ingestion/repair',
|
|
1857
1852
|
{
|
|
1858
1853
|
...(input?.provider ? { provider: input.provider } : {}),
|
|
1859
1854
|
},
|
|
1860
|
-
undefined,
|
|
1861
|
-
{ forbiddenAsApiError: true },
|
|
1862
1855
|
);
|
|
1863
1856
|
}
|
|
1864
1857
|
|
|
@@ -2080,7 +2073,7 @@ export class DeeplineClient {
|
|
|
2080
2073
|
compilerManifest,
|
|
2081
2074
|
},
|
|
2082
2075
|
undefined,
|
|
2083
|
-
{
|
|
2076
|
+
{ retryApiErrors: true },
|
|
2084
2077
|
);
|
|
2085
2078
|
}
|
|
2086
2079
|
|
|
@@ -2124,7 +2117,7 @@ export class DeeplineClient {
|
|
|
2124
2117
|
'/api/v2/plays/artifacts',
|
|
2125
2118
|
{ artifacts },
|
|
2126
2119
|
undefined,
|
|
2127
|
-
{
|
|
2120
|
+
{ retryApiErrors: true },
|
|
2128
2121
|
);
|
|
2129
2122
|
}
|
|
2130
2123
|
const compiledArtifacts = await mapWithConcurrency(
|
|
@@ -2166,7 +2159,7 @@ export class DeeplineClient {
|
|
|
2166
2159
|
artifacts: chunk,
|
|
2167
2160
|
},
|
|
2168
2161
|
undefined,
|
|
2169
|
-
{
|
|
2162
|
+
{ retryApiErrors: true },
|
|
2170
2163
|
),
|
|
2171
2164
|
);
|
|
2172
2165
|
}
|
|
@@ -3612,8 +3605,6 @@ export class DeeplineClient {
|
|
|
3612
3605
|
return this.http.post<PublishPlayVersionResult>(
|
|
3613
3606
|
`/api/v2/plays/${encodedName}/live`,
|
|
3614
3607
|
request,
|
|
3615
|
-
undefined,
|
|
3616
|
-
{ forbiddenAsApiError: true },
|
|
3617
3608
|
);
|
|
3618
3609
|
}
|
|
3619
3610
|
|
|
@@ -3935,8 +3926,7 @@ export class DeeplineClient {
|
|
|
3935
3926
|
* `client.monitors.status()`.
|
|
3936
3927
|
*/
|
|
3937
3928
|
async getMonitorsAccess(): Promise<MonitorsAccessStatus> {
|
|
3938
|
-
//
|
|
3939
|
-
// denied cases, so a 403 would be a real auth failure, not a denial body.
|
|
3929
|
+
// The endpoint answers 200 in both the granted and denied cases.
|
|
3940
3930
|
const payload = await this.http.request<MonitorsAccessStatus>(
|
|
3941
3931
|
'/api/v2/monitors/access',
|
|
3942
3932
|
{ method: 'GET' },
|
|
@@ -3989,7 +3979,7 @@ export class DeeplineClient {
|
|
|
3989
3979
|
const suffix = query ? `?${query}` : '';
|
|
3990
3980
|
return this.http.request<MonitorsAvailableResult>(
|
|
3991
3981
|
`/api/v2/monitors/tools${suffix}`,
|
|
3992
|
-
{ method: 'GET'
|
|
3982
|
+
{ method: 'GET' },
|
|
3993
3983
|
);
|
|
3994
3984
|
}
|
|
3995
3985
|
|
|
@@ -4000,7 +3990,6 @@ export class DeeplineClient {
|
|
|
4000
3990
|
return this.http.request<MonitorCheckResult>('/api/v2/monitors/check', {
|
|
4001
3991
|
method: 'POST',
|
|
4002
3992
|
body: definition,
|
|
4003
|
-
forbiddenAsApiError: true,
|
|
4004
3993
|
});
|
|
4005
3994
|
}
|
|
4006
3995
|
|
|
@@ -4019,13 +4008,11 @@ export class DeeplineClient {
|
|
|
4019
4008
|
return this.http.request<MonitorDeployResult>('/api/v2/monitors/check', {
|
|
4020
4009
|
method: 'POST',
|
|
4021
4010
|
body: definition,
|
|
4022
|
-
forbiddenAsApiError: true,
|
|
4023
4011
|
});
|
|
4024
4012
|
}
|
|
4025
4013
|
return this.http.request<MonitorDeployResult>('/api/v2/monitors/deploy', {
|
|
4026
4014
|
method: 'POST',
|
|
4027
4015
|
body: definition,
|
|
4028
|
-
forbiddenAsApiError: true,
|
|
4029
4016
|
});
|
|
4030
4017
|
}
|
|
4031
4018
|
|
|
@@ -4045,7 +4032,7 @@ export class DeeplineClient {
|
|
|
4045
4032
|
const suffix = query ? `?${query}` : '';
|
|
4046
4033
|
return this.http.request<MonitorsListResult>(
|
|
4047
4034
|
`/api/v2/monitors/deployed${suffix}`,
|
|
4048
|
-
{ method: 'GET'
|
|
4035
|
+
{ method: 'GET' },
|
|
4049
4036
|
);
|
|
4050
4037
|
}
|
|
4051
4038
|
|
|
@@ -4053,7 +4040,7 @@ export class DeeplineClient {
|
|
|
4053
4040
|
async getMonitor(key: string): Promise<MonitorDetail> {
|
|
4054
4041
|
return this.http.request<MonitorDetail>(
|
|
4055
4042
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}`,
|
|
4056
|
-
{ method: 'GET'
|
|
4043
|
+
{ method: 'GET' },
|
|
4057
4044
|
);
|
|
4058
4045
|
}
|
|
4059
4046
|
|
|
@@ -4061,7 +4048,7 @@ export class DeeplineClient {
|
|
|
4061
4048
|
async getMonitorDependents(key: string): Promise<MonitorDependents> {
|
|
4062
4049
|
return this.http.request<MonitorDependents>(
|
|
4063
4050
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/dependents`,
|
|
4064
|
-
{ method: 'GET'
|
|
4051
|
+
{ method: 'GET' },
|
|
4065
4052
|
);
|
|
4066
4053
|
}
|
|
4067
4054
|
|
|
@@ -4072,7 +4059,7 @@ export class DeeplineClient {
|
|
|
4072
4059
|
): Promise<MonitorUpdateResult> {
|
|
4073
4060
|
return this.http.request<MonitorUpdateResult>(
|
|
4074
4061
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}`,
|
|
4075
|
-
{ method: 'PATCH', body: patch
|
|
4062
|
+
{ method: 'PATCH', body: patch },
|
|
4076
4063
|
);
|
|
4077
4064
|
}
|
|
4078
4065
|
|
|
@@ -4091,7 +4078,7 @@ export class DeeplineClient {
|
|
|
4091
4078
|
const query = params.toString();
|
|
4092
4079
|
return this.http.request<MonitorDeleteResult>(
|
|
4093
4080
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ''}`,
|
|
4094
|
-
{ method: 'DELETE'
|
|
4081
|
+
{ method: 'DELETE' },
|
|
4095
4082
|
);
|
|
4096
4083
|
}
|
|
4097
4084
|
|
|
@@ -4106,7 +4093,7 @@ export class DeeplineClient {
|
|
|
4106
4093
|
const query = options?.dryRun ? '?dry_run=true' : '';
|
|
4107
4094
|
return this.http.request<MonitorReactivateResult>(
|
|
4108
4095
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
|
|
4109
|
-
{ method: 'POST', body: {}
|
|
4096
|
+
{ method: 'POST', body: {} },
|
|
4110
4097
|
);
|
|
4111
4098
|
}
|
|
4112
4099
|
|
|
@@ -30,7 +30,9 @@ export {
|
|
|
30
30
|
/**
|
|
31
31
|
* Thrown when the API rejects the request due to an invalid or missing API key.
|
|
32
32
|
*
|
|
33
|
-
* This maps to HTTP 401
|
|
33
|
+
* This maps to HTTP 401 responses. HTTP 403 means the caller was authenticated
|
|
34
|
+
* but lacks permission, so the SDK preserves the server's API error instead.
|
|
35
|
+
* The SDK never retries auth errors —
|
|
34
36
|
* they fail immediately.
|
|
35
37
|
*
|
|
36
38
|
* Fix: run `deepline auth register` to obtain a valid key, or pass one via
|
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - **Max attempts**: `1 + maxRetries` (default: 4 total attempts)
|
|
10
10
|
* - **Backoff**: exponential — 1s, 2s, 4s, 8s, ... capped at 30s
|
|
11
11
|
* - **Retryable**: network errors, timeouts, HTTP 429 (rate limit)
|
|
12
|
-
* - **Not retryable**: HTTP 401
|
|
12
|
+
* - **Not retryable**: HTTP 401 (auth error), HTTP 403 and other 4xx API errors
|
|
13
13
|
*
|
|
14
14
|
* ## Localhost failover
|
|
15
15
|
*
|
|
@@ -61,14 +61,6 @@ interface RequestOptions {
|
|
|
61
61
|
headers?: Record<string, string>;
|
|
62
62
|
/** Per-request timeout override in milliseconds. */
|
|
63
63
|
timeout?: number;
|
|
64
|
-
/**
|
|
65
|
-
* Treat HTTP 403 as a regular API error instead of a generic {@link AuthError}.
|
|
66
|
-
* Use for endpoints that return 403 with a meaningful server error message
|
|
67
|
-
* (e.g. feature-flagged-off billing subscription checkout) so the server
|
|
68
|
-
* message is preserved and surfaced loudly. A provider-originated HTTP 401
|
|
69
|
-
* remains a regular API error when its response envelope says so.
|
|
70
|
-
*/
|
|
71
|
-
forbiddenAsApiError?: boolean;
|
|
72
64
|
/**
|
|
73
65
|
* Retry HTTP 408/425/5xx JSON API responses. Use only for idempotent requests;
|
|
74
66
|
* most mutating API calls must fail loudly after the first server response.
|
|
@@ -437,11 +429,10 @@ export class HttpClient {
|
|
|
437
429
|
}
|
|
438
430
|
|
|
439
431
|
if (
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
(response.status === 403 && !options?.forbiddenAsApiError)
|
|
432
|
+
response.status === 401 &&
|
|
433
|
+
!isProviderOriginatedHttpError(parsed)
|
|
443
434
|
) {
|
|
444
|
-
throw new AuthError();
|
|
435
|
+
throw new AuthError(apiErrorMessage(parsed, response.status));
|
|
445
436
|
}
|
|
446
437
|
if (!response.ok) {
|
|
447
438
|
const retryableApiError =
|
|
@@ -576,10 +567,17 @@ export class HttpClient {
|
|
|
576
567
|
* @typeParam T - Expected response body type
|
|
577
568
|
* @param path - API path (e.g. `"/api/v2/tools"`)
|
|
578
569
|
*/
|
|
579
|
-
async get<T = unknown>(
|
|
570
|
+
async get<T = unknown>(
|
|
571
|
+
path: string,
|
|
572
|
+
options?: Pick<
|
|
573
|
+
RequestOptions,
|
|
574
|
+
'retryApiErrors' | 'timeout' | 'maxRetries' | 'exactUrlOnly' | 'toolId'
|
|
575
|
+
>,
|
|
576
|
+
): Promise<T> {
|
|
580
577
|
return this.request<T>(path, {
|
|
581
578
|
method: 'GET',
|
|
582
579
|
retryApiErrors: true,
|
|
580
|
+
...options,
|
|
583
581
|
});
|
|
584
582
|
}
|
|
585
583
|
|
|
@@ -614,11 +612,10 @@ export class HttpClient {
|
|
|
614
612
|
const body = await response.text();
|
|
615
613
|
const parsed = parseResponseBody(body);
|
|
616
614
|
if (
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
response.status === 403
|
|
615
|
+
response.status === 401 &&
|
|
616
|
+
!isProviderOriginatedHttpError(parsed)
|
|
620
617
|
) {
|
|
621
|
-
throw new AuthError();
|
|
618
|
+
throw new AuthError(apiErrorMessage(parsed, response.status));
|
|
622
619
|
}
|
|
623
620
|
const htmlError = detectHtmlErrorBody(
|
|
624
621
|
body,
|
|
@@ -681,12 +678,7 @@ export class HttpClient {
|
|
|
681
678
|
headers?: Record<string, string>,
|
|
682
679
|
options?: Pick<
|
|
683
680
|
RequestOptions,
|
|
684
|
-
| '
|
|
685
|
-
| 'retryApiErrors'
|
|
686
|
-
| 'timeout'
|
|
687
|
-
| 'maxRetries'
|
|
688
|
-
| 'exactUrlOnly'
|
|
689
|
-
| 'toolId'
|
|
681
|
+
'retryApiErrors' | 'timeout' | 'maxRetries' | 'exactUrlOnly' | 'toolId'
|
|
690
682
|
>,
|
|
691
683
|
): Promise<T> {
|
|
692
684
|
return this.request<T>(path, {
|
|
@@ -157,7 +157,7 @@ export const SDK_RELEASE = {
|
|
|
157
157
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
158
158
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
159
159
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
160
|
-
version: '0.1.
|
|
160
|
+
version: '0.1.307',
|
|
161
161
|
contracts: {
|
|
162
162
|
api: {
|
|
163
163
|
name: 'sdk-http-api',
|
package/dist/cli/index.js
CHANGED
|
@@ -1037,7 +1037,7 @@ var SDK_RELEASE = {
|
|
|
1037
1037
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
1038
1038
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
1039
1039
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
1040
|
-
version: "0.1.
|
|
1040
|
+
version: "0.1.307",
|
|
1041
1041
|
contracts: {
|
|
1042
1042
|
api: {
|
|
1043
1043
|
name: "sdk-http-api",
|
|
@@ -1456,8 +1456,8 @@ var HttpClient = class {
|
|
|
1456
1456
|
}
|
|
1457
1457
|
throw lastError;
|
|
1458
1458
|
}
|
|
1459
|
-
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)
|
|
1460
|
-
throw new AuthError();
|
|
1459
|
+
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
1460
|
+
throw new AuthError(apiErrorMessage(parsed, response.status));
|
|
1461
1461
|
}
|
|
1462
1462
|
if (!response.ok) {
|
|
1463
1463
|
const retryableApiError = options?.retryApiErrors === true && isRetryableApiErrorResponse(response.status);
|
|
@@ -1556,10 +1556,11 @@ var HttpClient = class {
|
|
|
1556
1556
|
* @typeParam T - Expected response body type
|
|
1557
1557
|
* @param path - API path (e.g. `"/api/v2/tools"`)
|
|
1558
1558
|
*/
|
|
1559
|
-
async get(path) {
|
|
1559
|
+
async get(path, options) {
|
|
1560
1560
|
return this.request(path, {
|
|
1561
1561
|
method: "GET",
|
|
1562
|
-
retryApiErrors: true
|
|
1562
|
+
retryApiErrors: true,
|
|
1563
|
+
...options
|
|
1563
1564
|
});
|
|
1564
1565
|
}
|
|
1565
1566
|
async *streamSse(path, options) {
|
|
@@ -1584,8 +1585,8 @@ var HttpClient = class {
|
|
|
1584
1585
|
if (!response.ok) {
|
|
1585
1586
|
const body = await response.text();
|
|
1586
1587
|
const parsed = parseResponseBody(body);
|
|
1587
|
-
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)
|
|
1588
|
-
throw new AuthError();
|
|
1588
|
+
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
1589
|
+
throw new AuthError(apiErrorMessage(parsed, response.status));
|
|
1589
1590
|
}
|
|
1590
1591
|
const htmlError = detectHtmlErrorBody(
|
|
1591
1592
|
body,
|
|
@@ -3983,7 +3984,6 @@ var DeeplineClient = class {
|
|
|
3983
3984
|
},
|
|
3984
3985
|
headers,
|
|
3985
3986
|
{
|
|
3986
|
-
forbiddenAsApiError: true,
|
|
3987
3987
|
timeout: options?.timeout ?? resolveToolExecuteTimeoutMs(toolId, input2),
|
|
3988
3988
|
maxRetries: options?.maxRetries ?? 0,
|
|
3989
3989
|
exactUrlOnly: true,
|
|
@@ -4034,9 +4034,7 @@ var DeeplineClient = class {
|
|
|
4034
4034
|
"/api/v2/ingestion/repair",
|
|
4035
4035
|
{
|
|
4036
4036
|
...input2?.provider ? { provider: input2.provider } : {}
|
|
4037
|
-
}
|
|
4038
|
-
void 0,
|
|
4039
|
-
{ forbiddenAsApiError: true }
|
|
4037
|
+
}
|
|
4040
4038
|
);
|
|
4041
4039
|
}
|
|
4042
4040
|
// ——————————————————————————————————————————————————————————
|
|
@@ -4192,7 +4190,7 @@ var DeeplineClient = class {
|
|
|
4192
4190
|
compilerManifest
|
|
4193
4191
|
},
|
|
4194
4192
|
void 0,
|
|
4195
|
-
{
|
|
4193
|
+
{ retryApiErrors: true }
|
|
4196
4194
|
);
|
|
4197
4195
|
}
|
|
4198
4196
|
/**
|
|
@@ -4207,7 +4205,7 @@ var DeeplineClient = class {
|
|
|
4207
4205
|
"/api/v2/plays/artifacts",
|
|
4208
4206
|
{ artifacts },
|
|
4209
4207
|
void 0,
|
|
4210
|
-
{
|
|
4208
|
+
{ retryApiErrors: true }
|
|
4211
4209
|
);
|
|
4212
4210
|
}
|
|
4213
4211
|
const compiledArtifacts = await mapWithConcurrency(
|
|
@@ -4232,7 +4230,7 @@ var DeeplineClient = class {
|
|
|
4232
4230
|
artifacts: chunk
|
|
4233
4231
|
},
|
|
4234
4232
|
void 0,
|
|
4235
|
-
{
|
|
4233
|
+
{ retryApiErrors: true }
|
|
4236
4234
|
)
|
|
4237
4235
|
);
|
|
4238
4236
|
}
|
|
@@ -5361,9 +5359,7 @@ var DeeplineClient = class {
|
|
|
5361
5359
|
const encodedName = encodeURIComponent(name);
|
|
5362
5360
|
return this.http.post(
|
|
5363
5361
|
`/api/v2/plays/${encodedName}/live`,
|
|
5364
|
-
request
|
|
5365
|
-
void 0,
|
|
5366
|
-
{ forbiddenAsApiError: true }
|
|
5362
|
+
request
|
|
5367
5363
|
);
|
|
5368
5364
|
}
|
|
5369
5365
|
/**
|
|
@@ -5654,15 +5650,14 @@ var DeeplineClient = class {
|
|
|
5654
5650
|
const suffix = query ? `?${query}` : "";
|
|
5655
5651
|
return this.http.request(
|
|
5656
5652
|
`/api/v2/monitors/tools${suffix}`,
|
|
5657
|
-
{ method: "GET"
|
|
5653
|
+
{ method: "GET" }
|
|
5658
5654
|
);
|
|
5659
5655
|
}
|
|
5660
5656
|
/** Validate a monitor definition without deploying it. Prefer `client.monitors.check(...)`. */
|
|
5661
5657
|
async checkMonitor(definition) {
|
|
5662
5658
|
return this.http.request("/api/v2/monitors/check", {
|
|
5663
5659
|
method: "POST",
|
|
5664
|
-
body: definition
|
|
5665
|
-
forbiddenAsApiError: true
|
|
5660
|
+
body: definition
|
|
5666
5661
|
});
|
|
5667
5662
|
}
|
|
5668
5663
|
/**
|
|
@@ -5674,14 +5669,12 @@ var DeeplineClient = class {
|
|
|
5674
5669
|
if (options?.dryRun) {
|
|
5675
5670
|
return this.http.request("/api/v2/monitors/check", {
|
|
5676
5671
|
method: "POST",
|
|
5677
|
-
body: definition
|
|
5678
|
-
forbiddenAsApiError: true
|
|
5672
|
+
body: definition
|
|
5679
5673
|
});
|
|
5680
5674
|
}
|
|
5681
5675
|
return this.http.request("/api/v2/monitors/deploy", {
|
|
5682
5676
|
method: "POST",
|
|
5683
|
-
body: definition
|
|
5684
|
-
forbiddenAsApiError: true
|
|
5677
|
+
body: definition
|
|
5685
5678
|
});
|
|
5686
5679
|
}
|
|
5687
5680
|
/** List deployed monitors. Prefer `client.monitors.list(...)`. */
|
|
@@ -5696,28 +5689,28 @@ var DeeplineClient = class {
|
|
|
5696
5689
|
const suffix = query ? `?${query}` : "";
|
|
5697
5690
|
return this.http.request(
|
|
5698
5691
|
`/api/v2/monitors/deployed${suffix}`,
|
|
5699
|
-
{ method: "GET"
|
|
5692
|
+
{ method: "GET" }
|
|
5700
5693
|
);
|
|
5701
5694
|
}
|
|
5702
5695
|
/** Fetch one deployed monitor by public key. Prefer `client.monitors.get(...)`. */
|
|
5703
5696
|
async getMonitor(key) {
|
|
5704
5697
|
return this.http.request(
|
|
5705
5698
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}`,
|
|
5706
|
-
{ method: "GET"
|
|
5699
|
+
{ method: "GET" }
|
|
5707
5700
|
);
|
|
5708
5701
|
}
|
|
5709
5702
|
/** Published plays depending on one monitor. Prefer `client.monitors.dependents(...)`. */
|
|
5710
5703
|
async getMonitorDependents(key) {
|
|
5711
5704
|
return this.http.request(
|
|
5712
5705
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/dependents`,
|
|
5713
|
-
{ method: "GET"
|
|
5706
|
+
{ method: "GET" }
|
|
5714
5707
|
);
|
|
5715
5708
|
}
|
|
5716
5709
|
/** Update a deployed monitor by public key. Prefer `client.monitors.update(...)`. */
|
|
5717
5710
|
async updateMonitor(key, patch) {
|
|
5718
5711
|
return this.http.request(
|
|
5719
5712
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}`,
|
|
5720
|
-
{ method: "PATCH", body: patch
|
|
5713
|
+
{ method: "PATCH", body: patch }
|
|
5721
5714
|
);
|
|
5722
5715
|
}
|
|
5723
5716
|
/**
|
|
@@ -5732,7 +5725,7 @@ var DeeplineClient = class {
|
|
|
5732
5725
|
const query = params.toString();
|
|
5733
5726
|
return this.http.request(
|
|
5734
5727
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
|
|
5735
|
-
{ method: "DELETE"
|
|
5728
|
+
{ method: "DELETE" }
|
|
5736
5729
|
);
|
|
5737
5730
|
}
|
|
5738
5731
|
/**
|
|
@@ -5743,7 +5736,7 @@ var DeeplineClient = class {
|
|
|
5743
5736
|
const query = options?.dryRun ? "?dry_run=true" : "";
|
|
5744
5737
|
return this.http.request(
|
|
5745
5738
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
|
|
5746
|
-
{ method: "POST", body: {}
|
|
5739
|
+
{ method: "POST", body: {} }
|
|
5747
5740
|
);
|
|
5748
5741
|
}
|
|
5749
5742
|
/**
|
|
@@ -7866,8 +7859,7 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
7866
7859
|
"/api/v2/billing/subscription/checkout",
|
|
7867
7860
|
{
|
|
7868
7861
|
method: "POST",
|
|
7869
|
-
body: { plan_version_id: planVersionId }
|
|
7870
|
-
forbiddenAsApiError: true
|
|
7862
|
+
body: { plan_version_id: planVersionId }
|
|
7871
7863
|
}
|
|
7872
7864
|
);
|
|
7873
7865
|
const url = String(payload.checkout_url || "");
|
package/dist/cli/index.mjs
CHANGED
|
@@ -1022,7 +1022,7 @@ var SDK_RELEASE = {
|
|
|
1022
1022
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
1023
1023
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
1024
1024
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
1025
|
-
version: "0.1.
|
|
1025
|
+
version: "0.1.307",
|
|
1026
1026
|
contracts: {
|
|
1027
1027
|
api: {
|
|
1028
1028
|
name: "sdk-http-api",
|
|
@@ -1441,8 +1441,8 @@ var HttpClient = class {
|
|
|
1441
1441
|
}
|
|
1442
1442
|
throw lastError;
|
|
1443
1443
|
}
|
|
1444
|
-
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)
|
|
1445
|
-
throw new AuthError();
|
|
1444
|
+
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
1445
|
+
throw new AuthError(apiErrorMessage(parsed, response.status));
|
|
1446
1446
|
}
|
|
1447
1447
|
if (!response.ok) {
|
|
1448
1448
|
const retryableApiError = options?.retryApiErrors === true && isRetryableApiErrorResponse(response.status);
|
|
@@ -1541,10 +1541,11 @@ var HttpClient = class {
|
|
|
1541
1541
|
* @typeParam T - Expected response body type
|
|
1542
1542
|
* @param path - API path (e.g. `"/api/v2/tools"`)
|
|
1543
1543
|
*/
|
|
1544
|
-
async get(path) {
|
|
1544
|
+
async get(path, options) {
|
|
1545
1545
|
return this.request(path, {
|
|
1546
1546
|
method: "GET",
|
|
1547
|
-
retryApiErrors: true
|
|
1547
|
+
retryApiErrors: true,
|
|
1548
|
+
...options
|
|
1548
1549
|
});
|
|
1549
1550
|
}
|
|
1550
1551
|
async *streamSse(path, options) {
|
|
@@ -1569,8 +1570,8 @@ var HttpClient = class {
|
|
|
1569
1570
|
if (!response.ok) {
|
|
1570
1571
|
const body = await response.text();
|
|
1571
1572
|
const parsed = parseResponseBody(body);
|
|
1572
|
-
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)
|
|
1573
|
-
throw new AuthError();
|
|
1573
|
+
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
1574
|
+
throw new AuthError(apiErrorMessage(parsed, response.status));
|
|
1574
1575
|
}
|
|
1575
1576
|
const htmlError = detectHtmlErrorBody(
|
|
1576
1577
|
body,
|
|
@@ -3968,7 +3969,6 @@ var DeeplineClient = class {
|
|
|
3968
3969
|
},
|
|
3969
3970
|
headers,
|
|
3970
3971
|
{
|
|
3971
|
-
forbiddenAsApiError: true,
|
|
3972
3972
|
timeout: options?.timeout ?? resolveToolExecuteTimeoutMs(toolId, input2),
|
|
3973
3973
|
maxRetries: options?.maxRetries ?? 0,
|
|
3974
3974
|
exactUrlOnly: true,
|
|
@@ -4019,9 +4019,7 @@ var DeeplineClient = class {
|
|
|
4019
4019
|
"/api/v2/ingestion/repair",
|
|
4020
4020
|
{
|
|
4021
4021
|
...input2?.provider ? { provider: input2.provider } : {}
|
|
4022
|
-
}
|
|
4023
|
-
void 0,
|
|
4024
|
-
{ forbiddenAsApiError: true }
|
|
4022
|
+
}
|
|
4025
4023
|
);
|
|
4026
4024
|
}
|
|
4027
4025
|
// ——————————————————————————————————————————————————————————
|
|
@@ -4177,7 +4175,7 @@ var DeeplineClient = class {
|
|
|
4177
4175
|
compilerManifest
|
|
4178
4176
|
},
|
|
4179
4177
|
void 0,
|
|
4180
|
-
{
|
|
4178
|
+
{ retryApiErrors: true }
|
|
4181
4179
|
);
|
|
4182
4180
|
}
|
|
4183
4181
|
/**
|
|
@@ -4192,7 +4190,7 @@ var DeeplineClient = class {
|
|
|
4192
4190
|
"/api/v2/plays/artifacts",
|
|
4193
4191
|
{ artifacts },
|
|
4194
4192
|
void 0,
|
|
4195
|
-
{
|
|
4193
|
+
{ retryApiErrors: true }
|
|
4196
4194
|
);
|
|
4197
4195
|
}
|
|
4198
4196
|
const compiledArtifacts = await mapWithConcurrency(
|
|
@@ -4217,7 +4215,7 @@ var DeeplineClient = class {
|
|
|
4217
4215
|
artifacts: chunk
|
|
4218
4216
|
},
|
|
4219
4217
|
void 0,
|
|
4220
|
-
{
|
|
4218
|
+
{ retryApiErrors: true }
|
|
4221
4219
|
)
|
|
4222
4220
|
);
|
|
4223
4221
|
}
|
|
@@ -5346,9 +5344,7 @@ var DeeplineClient = class {
|
|
|
5346
5344
|
const encodedName = encodeURIComponent(name);
|
|
5347
5345
|
return this.http.post(
|
|
5348
5346
|
`/api/v2/plays/${encodedName}/live`,
|
|
5349
|
-
request
|
|
5350
|
-
void 0,
|
|
5351
|
-
{ forbiddenAsApiError: true }
|
|
5347
|
+
request
|
|
5352
5348
|
);
|
|
5353
5349
|
}
|
|
5354
5350
|
/**
|
|
@@ -5639,15 +5635,14 @@ var DeeplineClient = class {
|
|
|
5639
5635
|
const suffix = query ? `?${query}` : "";
|
|
5640
5636
|
return this.http.request(
|
|
5641
5637
|
`/api/v2/monitors/tools${suffix}`,
|
|
5642
|
-
{ method: "GET"
|
|
5638
|
+
{ method: "GET" }
|
|
5643
5639
|
);
|
|
5644
5640
|
}
|
|
5645
5641
|
/** Validate a monitor definition without deploying it. Prefer `client.monitors.check(...)`. */
|
|
5646
5642
|
async checkMonitor(definition) {
|
|
5647
5643
|
return this.http.request("/api/v2/monitors/check", {
|
|
5648
5644
|
method: "POST",
|
|
5649
|
-
body: definition
|
|
5650
|
-
forbiddenAsApiError: true
|
|
5645
|
+
body: definition
|
|
5651
5646
|
});
|
|
5652
5647
|
}
|
|
5653
5648
|
/**
|
|
@@ -5659,14 +5654,12 @@ var DeeplineClient = class {
|
|
|
5659
5654
|
if (options?.dryRun) {
|
|
5660
5655
|
return this.http.request("/api/v2/monitors/check", {
|
|
5661
5656
|
method: "POST",
|
|
5662
|
-
body: definition
|
|
5663
|
-
forbiddenAsApiError: true
|
|
5657
|
+
body: definition
|
|
5664
5658
|
});
|
|
5665
5659
|
}
|
|
5666
5660
|
return this.http.request("/api/v2/monitors/deploy", {
|
|
5667
5661
|
method: "POST",
|
|
5668
|
-
body: definition
|
|
5669
|
-
forbiddenAsApiError: true
|
|
5662
|
+
body: definition
|
|
5670
5663
|
});
|
|
5671
5664
|
}
|
|
5672
5665
|
/** List deployed monitors. Prefer `client.monitors.list(...)`. */
|
|
@@ -5681,28 +5674,28 @@ var DeeplineClient = class {
|
|
|
5681
5674
|
const suffix = query ? `?${query}` : "";
|
|
5682
5675
|
return this.http.request(
|
|
5683
5676
|
`/api/v2/monitors/deployed${suffix}`,
|
|
5684
|
-
{ method: "GET"
|
|
5677
|
+
{ method: "GET" }
|
|
5685
5678
|
);
|
|
5686
5679
|
}
|
|
5687
5680
|
/** Fetch one deployed monitor by public key. Prefer `client.monitors.get(...)`. */
|
|
5688
5681
|
async getMonitor(key) {
|
|
5689
5682
|
return this.http.request(
|
|
5690
5683
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}`,
|
|
5691
|
-
{ method: "GET"
|
|
5684
|
+
{ method: "GET" }
|
|
5692
5685
|
);
|
|
5693
5686
|
}
|
|
5694
5687
|
/** Published plays depending on one monitor. Prefer `client.monitors.dependents(...)`. */
|
|
5695
5688
|
async getMonitorDependents(key) {
|
|
5696
5689
|
return this.http.request(
|
|
5697
5690
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/dependents`,
|
|
5698
|
-
{ method: "GET"
|
|
5691
|
+
{ method: "GET" }
|
|
5699
5692
|
);
|
|
5700
5693
|
}
|
|
5701
5694
|
/** Update a deployed monitor by public key. Prefer `client.monitors.update(...)`. */
|
|
5702
5695
|
async updateMonitor(key, patch) {
|
|
5703
5696
|
return this.http.request(
|
|
5704
5697
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}`,
|
|
5705
|
-
{ method: "PATCH", body: patch
|
|
5698
|
+
{ method: "PATCH", body: patch }
|
|
5706
5699
|
);
|
|
5707
5700
|
}
|
|
5708
5701
|
/**
|
|
@@ -5717,7 +5710,7 @@ var DeeplineClient = class {
|
|
|
5717
5710
|
const query = params.toString();
|
|
5718
5711
|
return this.http.request(
|
|
5719
5712
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
|
|
5720
|
-
{ method: "DELETE"
|
|
5713
|
+
{ method: "DELETE" }
|
|
5721
5714
|
);
|
|
5722
5715
|
}
|
|
5723
5716
|
/**
|
|
@@ -5728,7 +5721,7 @@ var DeeplineClient = class {
|
|
|
5728
5721
|
const query = options?.dryRun ? "?dry_run=true" : "";
|
|
5729
5722
|
return this.http.request(
|
|
5730
5723
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
|
|
5731
|
-
{ method: "POST", body: {}
|
|
5724
|
+
{ method: "POST", body: {} }
|
|
5732
5725
|
);
|
|
5733
5726
|
}
|
|
5734
5727
|
/**
|
|
@@ -7863,8 +7856,7 @@ async function handleSubscribe(planVersionId, options) {
|
|
|
7863
7856
|
"/api/v2/billing/subscription/checkout",
|
|
7864
7857
|
{
|
|
7865
7858
|
method: "POST",
|
|
7866
|
-
body: { plan_version_id: planVersionId }
|
|
7867
|
-
forbiddenAsApiError: true
|
|
7859
|
+
body: { plan_version_id: planVersionId }
|
|
7868
7860
|
}
|
|
7869
7861
|
);
|
|
7870
7862
|
const url = String(payload.checkout_url || "");
|
package/dist/index.d.mts
CHANGED
|
@@ -3171,7 +3171,9 @@ declare const SDK_API_CONTRACT: string;
|
|
|
3171
3171
|
/**
|
|
3172
3172
|
* Thrown when the API rejects the request due to an invalid or missing API key.
|
|
3173
3173
|
*
|
|
3174
|
-
* This maps to HTTP 401
|
|
3174
|
+
* This maps to HTTP 401 responses. HTTP 403 means the caller was authenticated
|
|
3175
|
+
* but lacks permission, so the SDK preserves the server's API error instead.
|
|
3176
|
+
* The SDK never retries auth errors —
|
|
3175
3177
|
* they fail immediately.
|
|
3176
3178
|
*
|
|
3177
3179
|
* Fix: run `deepline auth register` to obtain a valid key, or pass one via
|
package/dist/index.d.ts
CHANGED
|
@@ -3171,7 +3171,9 @@ declare const SDK_API_CONTRACT: string;
|
|
|
3171
3171
|
/**
|
|
3172
3172
|
* Thrown when the API rejects the request due to an invalid or missing API key.
|
|
3173
3173
|
*
|
|
3174
|
-
* This maps to HTTP 401
|
|
3174
|
+
* This maps to HTTP 401 responses. HTTP 403 means the caller was authenticated
|
|
3175
|
+
* but lacks permission, so the SDK preserves the server's API error instead.
|
|
3176
|
+
* The SDK never retries auth errors —
|
|
3175
3177
|
* they fail immediately.
|
|
3176
3178
|
*
|
|
3177
3179
|
* Fix: run `deepline auth register` to obtain a valid key, or pass one via
|
package/dist/index.js
CHANGED
|
@@ -760,7 +760,7 @@ var SDK_RELEASE = {
|
|
|
760
760
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
761
761
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
762
762
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
763
|
-
version: "0.1.
|
|
763
|
+
version: "0.1.307",
|
|
764
764
|
contracts: {
|
|
765
765
|
api: {
|
|
766
766
|
name: "sdk-http-api",
|
|
@@ -1179,8 +1179,8 @@ var HttpClient = class {
|
|
|
1179
1179
|
}
|
|
1180
1180
|
throw lastError;
|
|
1181
1181
|
}
|
|
1182
|
-
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)
|
|
1183
|
-
throw new AuthError();
|
|
1182
|
+
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
1183
|
+
throw new AuthError(apiErrorMessage(parsed, response.status));
|
|
1184
1184
|
}
|
|
1185
1185
|
if (!response.ok) {
|
|
1186
1186
|
const retryableApiError = options?.retryApiErrors === true && isRetryableApiErrorResponse(response.status);
|
|
@@ -1279,10 +1279,11 @@ var HttpClient = class {
|
|
|
1279
1279
|
* @typeParam T - Expected response body type
|
|
1280
1280
|
* @param path - API path (e.g. `"/api/v2/tools"`)
|
|
1281
1281
|
*/
|
|
1282
|
-
async get(path) {
|
|
1282
|
+
async get(path, options) {
|
|
1283
1283
|
return this.request(path, {
|
|
1284
1284
|
method: "GET",
|
|
1285
|
-
retryApiErrors: true
|
|
1285
|
+
retryApiErrors: true,
|
|
1286
|
+
...options
|
|
1286
1287
|
});
|
|
1287
1288
|
}
|
|
1288
1289
|
async *streamSse(path, options) {
|
|
@@ -1307,8 +1308,8 @@ var HttpClient = class {
|
|
|
1307
1308
|
if (!response.ok) {
|
|
1308
1309
|
const body = await response.text();
|
|
1309
1310
|
const parsed = parseResponseBody(body);
|
|
1310
|
-
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)
|
|
1311
|
-
throw new AuthError();
|
|
1311
|
+
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
1312
|
+
throw new AuthError(apiErrorMessage(parsed, response.status));
|
|
1312
1313
|
}
|
|
1313
1314
|
const htmlError = detectHtmlErrorBody(
|
|
1314
1315
|
body,
|
|
@@ -3706,7 +3707,6 @@ var DeeplineClient = class {
|
|
|
3706
3707
|
},
|
|
3707
3708
|
headers,
|
|
3708
3709
|
{
|
|
3709
|
-
forbiddenAsApiError: true,
|
|
3710
3710
|
timeout: options?.timeout ?? resolveToolExecuteTimeoutMs(toolId, input),
|
|
3711
3711
|
maxRetries: options?.maxRetries ?? 0,
|
|
3712
3712
|
exactUrlOnly: true,
|
|
@@ -3757,9 +3757,7 @@ var DeeplineClient = class {
|
|
|
3757
3757
|
"/api/v2/ingestion/repair",
|
|
3758
3758
|
{
|
|
3759
3759
|
...input?.provider ? { provider: input.provider } : {}
|
|
3760
|
-
}
|
|
3761
|
-
void 0,
|
|
3762
|
-
{ forbiddenAsApiError: true }
|
|
3760
|
+
}
|
|
3763
3761
|
);
|
|
3764
3762
|
}
|
|
3765
3763
|
// ——————————————————————————————————————————————————————————
|
|
@@ -3915,7 +3913,7 @@ var DeeplineClient = class {
|
|
|
3915
3913
|
compilerManifest
|
|
3916
3914
|
},
|
|
3917
3915
|
void 0,
|
|
3918
|
-
{
|
|
3916
|
+
{ retryApiErrors: true }
|
|
3919
3917
|
);
|
|
3920
3918
|
}
|
|
3921
3919
|
/**
|
|
@@ -3930,7 +3928,7 @@ var DeeplineClient = class {
|
|
|
3930
3928
|
"/api/v2/plays/artifacts",
|
|
3931
3929
|
{ artifacts },
|
|
3932
3930
|
void 0,
|
|
3933
|
-
{
|
|
3931
|
+
{ retryApiErrors: true }
|
|
3934
3932
|
);
|
|
3935
3933
|
}
|
|
3936
3934
|
const compiledArtifacts = await mapWithConcurrency(
|
|
@@ -3955,7 +3953,7 @@ var DeeplineClient = class {
|
|
|
3955
3953
|
artifacts: chunk
|
|
3956
3954
|
},
|
|
3957
3955
|
void 0,
|
|
3958
|
-
{
|
|
3956
|
+
{ retryApiErrors: true }
|
|
3959
3957
|
)
|
|
3960
3958
|
);
|
|
3961
3959
|
}
|
|
@@ -5084,9 +5082,7 @@ var DeeplineClient = class {
|
|
|
5084
5082
|
const encodedName = encodeURIComponent(name);
|
|
5085
5083
|
return this.http.post(
|
|
5086
5084
|
`/api/v2/plays/${encodedName}/live`,
|
|
5087
|
-
request
|
|
5088
|
-
void 0,
|
|
5089
|
-
{ forbiddenAsApiError: true }
|
|
5085
|
+
request
|
|
5090
5086
|
);
|
|
5091
5087
|
}
|
|
5092
5088
|
/**
|
|
@@ -5377,15 +5373,14 @@ var DeeplineClient = class {
|
|
|
5377
5373
|
const suffix = query ? `?${query}` : "";
|
|
5378
5374
|
return this.http.request(
|
|
5379
5375
|
`/api/v2/monitors/tools${suffix}`,
|
|
5380
|
-
{ method: "GET"
|
|
5376
|
+
{ method: "GET" }
|
|
5381
5377
|
);
|
|
5382
5378
|
}
|
|
5383
5379
|
/** Validate a monitor definition without deploying it. Prefer `client.monitors.check(...)`. */
|
|
5384
5380
|
async checkMonitor(definition) {
|
|
5385
5381
|
return this.http.request("/api/v2/monitors/check", {
|
|
5386
5382
|
method: "POST",
|
|
5387
|
-
body: definition
|
|
5388
|
-
forbiddenAsApiError: true
|
|
5383
|
+
body: definition
|
|
5389
5384
|
});
|
|
5390
5385
|
}
|
|
5391
5386
|
/**
|
|
@@ -5397,14 +5392,12 @@ var DeeplineClient = class {
|
|
|
5397
5392
|
if (options?.dryRun) {
|
|
5398
5393
|
return this.http.request("/api/v2/monitors/check", {
|
|
5399
5394
|
method: "POST",
|
|
5400
|
-
body: definition
|
|
5401
|
-
forbiddenAsApiError: true
|
|
5395
|
+
body: definition
|
|
5402
5396
|
});
|
|
5403
5397
|
}
|
|
5404
5398
|
return this.http.request("/api/v2/monitors/deploy", {
|
|
5405
5399
|
method: "POST",
|
|
5406
|
-
body: definition
|
|
5407
|
-
forbiddenAsApiError: true
|
|
5400
|
+
body: definition
|
|
5408
5401
|
});
|
|
5409
5402
|
}
|
|
5410
5403
|
/** List deployed monitors. Prefer `client.monitors.list(...)`. */
|
|
@@ -5419,28 +5412,28 @@ var DeeplineClient = class {
|
|
|
5419
5412
|
const suffix = query ? `?${query}` : "";
|
|
5420
5413
|
return this.http.request(
|
|
5421
5414
|
`/api/v2/monitors/deployed${suffix}`,
|
|
5422
|
-
{ method: "GET"
|
|
5415
|
+
{ method: "GET" }
|
|
5423
5416
|
);
|
|
5424
5417
|
}
|
|
5425
5418
|
/** Fetch one deployed monitor by public key. Prefer `client.monitors.get(...)`. */
|
|
5426
5419
|
async getMonitor(key) {
|
|
5427
5420
|
return this.http.request(
|
|
5428
5421
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}`,
|
|
5429
|
-
{ method: "GET"
|
|
5422
|
+
{ method: "GET" }
|
|
5430
5423
|
);
|
|
5431
5424
|
}
|
|
5432
5425
|
/** Published plays depending on one monitor. Prefer `client.monitors.dependents(...)`. */
|
|
5433
5426
|
async getMonitorDependents(key) {
|
|
5434
5427
|
return this.http.request(
|
|
5435
5428
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/dependents`,
|
|
5436
|
-
{ method: "GET"
|
|
5429
|
+
{ method: "GET" }
|
|
5437
5430
|
);
|
|
5438
5431
|
}
|
|
5439
5432
|
/** Update a deployed monitor by public key. Prefer `client.monitors.update(...)`. */
|
|
5440
5433
|
async updateMonitor(key, patch) {
|
|
5441
5434
|
return this.http.request(
|
|
5442
5435
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}`,
|
|
5443
|
-
{ method: "PATCH", body: patch
|
|
5436
|
+
{ method: "PATCH", body: patch }
|
|
5444
5437
|
);
|
|
5445
5438
|
}
|
|
5446
5439
|
/**
|
|
@@ -5455,7 +5448,7 @@ var DeeplineClient = class {
|
|
|
5455
5448
|
const query = params.toString();
|
|
5456
5449
|
return this.http.request(
|
|
5457
5450
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
|
|
5458
|
-
{ method: "DELETE"
|
|
5451
|
+
{ method: "DELETE" }
|
|
5459
5452
|
);
|
|
5460
5453
|
}
|
|
5461
5454
|
/**
|
|
@@ -5466,7 +5459,7 @@ var DeeplineClient = class {
|
|
|
5466
5459
|
const query = options?.dryRun ? "?dry_run=true" : "";
|
|
5467
5460
|
return this.http.request(
|
|
5468
5461
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
|
|
5469
|
-
{ method: "POST", body: {}
|
|
5462
|
+
{ method: "POST", body: {} }
|
|
5470
5463
|
);
|
|
5471
5464
|
}
|
|
5472
5465
|
/**
|
package/dist/index.mjs
CHANGED
|
@@ -686,7 +686,7 @@ var SDK_RELEASE = {
|
|
|
686
686
|
// 0.1.253 makes play-page browser opening opt-in and retires --no-open.
|
|
687
687
|
// 0.1.254 removes the internal operations tree from the published SDK CLI.
|
|
688
688
|
// Operators use the checkout-local deepline-admin binary instead.
|
|
689
|
-
version: "0.1.
|
|
689
|
+
version: "0.1.307",
|
|
690
690
|
contracts: {
|
|
691
691
|
api: {
|
|
692
692
|
name: "sdk-http-api",
|
|
@@ -1105,8 +1105,8 @@ var HttpClient = class {
|
|
|
1105
1105
|
}
|
|
1106
1106
|
throw lastError;
|
|
1107
1107
|
}
|
|
1108
|
-
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)
|
|
1109
|
-
throw new AuthError();
|
|
1108
|
+
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
1109
|
+
throw new AuthError(apiErrorMessage(parsed, response.status));
|
|
1110
1110
|
}
|
|
1111
1111
|
if (!response.ok) {
|
|
1112
1112
|
const retryableApiError = options?.retryApiErrors === true && isRetryableApiErrorResponse(response.status);
|
|
@@ -1205,10 +1205,11 @@ var HttpClient = class {
|
|
|
1205
1205
|
* @typeParam T - Expected response body type
|
|
1206
1206
|
* @param path - API path (e.g. `"/api/v2/tools"`)
|
|
1207
1207
|
*/
|
|
1208
|
-
async get(path) {
|
|
1208
|
+
async get(path, options) {
|
|
1209
1209
|
return this.request(path, {
|
|
1210
1210
|
method: "GET",
|
|
1211
|
-
retryApiErrors: true
|
|
1211
|
+
retryApiErrors: true,
|
|
1212
|
+
...options
|
|
1212
1213
|
});
|
|
1213
1214
|
}
|
|
1214
1215
|
async *streamSse(path, options) {
|
|
@@ -1233,8 +1234,8 @@ var HttpClient = class {
|
|
|
1233
1234
|
if (!response.ok) {
|
|
1234
1235
|
const body = await response.text();
|
|
1235
1236
|
const parsed = parseResponseBody(body);
|
|
1236
|
-
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)
|
|
1237
|
-
throw new AuthError();
|
|
1237
|
+
if (response.status === 401 && !isProviderOriginatedHttpError(parsed)) {
|
|
1238
|
+
throw new AuthError(apiErrorMessage(parsed, response.status));
|
|
1238
1239
|
}
|
|
1239
1240
|
const htmlError = detectHtmlErrorBody(
|
|
1240
1241
|
body,
|
|
@@ -3632,7 +3633,6 @@ var DeeplineClient = class {
|
|
|
3632
3633
|
},
|
|
3633
3634
|
headers,
|
|
3634
3635
|
{
|
|
3635
|
-
forbiddenAsApiError: true,
|
|
3636
3636
|
timeout: options?.timeout ?? resolveToolExecuteTimeoutMs(toolId, input),
|
|
3637
3637
|
maxRetries: options?.maxRetries ?? 0,
|
|
3638
3638
|
exactUrlOnly: true,
|
|
@@ -3683,9 +3683,7 @@ var DeeplineClient = class {
|
|
|
3683
3683
|
"/api/v2/ingestion/repair",
|
|
3684
3684
|
{
|
|
3685
3685
|
...input?.provider ? { provider: input.provider } : {}
|
|
3686
|
-
}
|
|
3687
|
-
void 0,
|
|
3688
|
-
{ forbiddenAsApiError: true }
|
|
3686
|
+
}
|
|
3689
3687
|
);
|
|
3690
3688
|
}
|
|
3691
3689
|
// ——————————————————————————————————————————————————————————
|
|
@@ -3841,7 +3839,7 @@ var DeeplineClient = class {
|
|
|
3841
3839
|
compilerManifest
|
|
3842
3840
|
},
|
|
3843
3841
|
void 0,
|
|
3844
|
-
{
|
|
3842
|
+
{ retryApiErrors: true }
|
|
3845
3843
|
);
|
|
3846
3844
|
}
|
|
3847
3845
|
/**
|
|
@@ -3856,7 +3854,7 @@ var DeeplineClient = class {
|
|
|
3856
3854
|
"/api/v2/plays/artifacts",
|
|
3857
3855
|
{ artifacts },
|
|
3858
3856
|
void 0,
|
|
3859
|
-
{
|
|
3857
|
+
{ retryApiErrors: true }
|
|
3860
3858
|
);
|
|
3861
3859
|
}
|
|
3862
3860
|
const compiledArtifacts = await mapWithConcurrency(
|
|
@@ -3881,7 +3879,7 @@ var DeeplineClient = class {
|
|
|
3881
3879
|
artifacts: chunk
|
|
3882
3880
|
},
|
|
3883
3881
|
void 0,
|
|
3884
|
-
{
|
|
3882
|
+
{ retryApiErrors: true }
|
|
3885
3883
|
)
|
|
3886
3884
|
);
|
|
3887
3885
|
}
|
|
@@ -5010,9 +5008,7 @@ var DeeplineClient = class {
|
|
|
5010
5008
|
const encodedName = encodeURIComponent(name);
|
|
5011
5009
|
return this.http.post(
|
|
5012
5010
|
`/api/v2/plays/${encodedName}/live`,
|
|
5013
|
-
request
|
|
5014
|
-
void 0,
|
|
5015
|
-
{ forbiddenAsApiError: true }
|
|
5011
|
+
request
|
|
5016
5012
|
);
|
|
5017
5013
|
}
|
|
5018
5014
|
/**
|
|
@@ -5303,15 +5299,14 @@ var DeeplineClient = class {
|
|
|
5303
5299
|
const suffix = query ? `?${query}` : "";
|
|
5304
5300
|
return this.http.request(
|
|
5305
5301
|
`/api/v2/monitors/tools${suffix}`,
|
|
5306
|
-
{ method: "GET"
|
|
5302
|
+
{ method: "GET" }
|
|
5307
5303
|
);
|
|
5308
5304
|
}
|
|
5309
5305
|
/** Validate a monitor definition without deploying it. Prefer `client.monitors.check(...)`. */
|
|
5310
5306
|
async checkMonitor(definition) {
|
|
5311
5307
|
return this.http.request("/api/v2/monitors/check", {
|
|
5312
5308
|
method: "POST",
|
|
5313
|
-
body: definition
|
|
5314
|
-
forbiddenAsApiError: true
|
|
5309
|
+
body: definition
|
|
5315
5310
|
});
|
|
5316
5311
|
}
|
|
5317
5312
|
/**
|
|
@@ -5323,14 +5318,12 @@ var DeeplineClient = class {
|
|
|
5323
5318
|
if (options?.dryRun) {
|
|
5324
5319
|
return this.http.request("/api/v2/monitors/check", {
|
|
5325
5320
|
method: "POST",
|
|
5326
|
-
body: definition
|
|
5327
|
-
forbiddenAsApiError: true
|
|
5321
|
+
body: definition
|
|
5328
5322
|
});
|
|
5329
5323
|
}
|
|
5330
5324
|
return this.http.request("/api/v2/monitors/deploy", {
|
|
5331
5325
|
method: "POST",
|
|
5332
|
-
body: definition
|
|
5333
|
-
forbiddenAsApiError: true
|
|
5326
|
+
body: definition
|
|
5334
5327
|
});
|
|
5335
5328
|
}
|
|
5336
5329
|
/** List deployed monitors. Prefer `client.monitors.list(...)`. */
|
|
@@ -5345,28 +5338,28 @@ var DeeplineClient = class {
|
|
|
5345
5338
|
const suffix = query ? `?${query}` : "";
|
|
5346
5339
|
return this.http.request(
|
|
5347
5340
|
`/api/v2/monitors/deployed${suffix}`,
|
|
5348
|
-
{ method: "GET"
|
|
5341
|
+
{ method: "GET" }
|
|
5349
5342
|
);
|
|
5350
5343
|
}
|
|
5351
5344
|
/** Fetch one deployed monitor by public key. Prefer `client.monitors.get(...)`. */
|
|
5352
5345
|
async getMonitor(key) {
|
|
5353
5346
|
return this.http.request(
|
|
5354
5347
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}`,
|
|
5355
|
-
{ method: "GET"
|
|
5348
|
+
{ method: "GET" }
|
|
5356
5349
|
);
|
|
5357
5350
|
}
|
|
5358
5351
|
/** Published plays depending on one monitor. Prefer `client.monitors.dependents(...)`. */
|
|
5359
5352
|
async getMonitorDependents(key) {
|
|
5360
5353
|
return this.http.request(
|
|
5361
5354
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/dependents`,
|
|
5362
|
-
{ method: "GET"
|
|
5355
|
+
{ method: "GET" }
|
|
5363
5356
|
);
|
|
5364
5357
|
}
|
|
5365
5358
|
/** Update a deployed monitor by public key. Prefer `client.monitors.update(...)`. */
|
|
5366
5359
|
async updateMonitor(key, patch) {
|
|
5367
5360
|
return this.http.request(
|
|
5368
5361
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}`,
|
|
5369
|
-
{ method: "PATCH", body: patch
|
|
5362
|
+
{ method: "PATCH", body: patch }
|
|
5370
5363
|
);
|
|
5371
5364
|
}
|
|
5372
5365
|
/**
|
|
@@ -5381,7 +5374,7 @@ var DeeplineClient = class {
|
|
|
5381
5374
|
const query = params.toString();
|
|
5382
5375
|
return this.http.request(
|
|
5383
5376
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}${query ? `?${query}` : ""}`,
|
|
5384
|
-
{ method: "DELETE"
|
|
5377
|
+
{ method: "DELETE" }
|
|
5385
5378
|
);
|
|
5386
5379
|
}
|
|
5387
5380
|
/**
|
|
@@ -5392,7 +5385,7 @@ var DeeplineClient = class {
|
|
|
5392
5385
|
const query = options?.dryRun ? "?dry_run=true" : "";
|
|
5393
5386
|
return this.http.request(
|
|
5394
5387
|
`/api/v2/monitors/deployed/${encodeURIComponent(key)}/reactivate${query}`,
|
|
5395
|
-
{ method: "POST", body: {}
|
|
5388
|
+
{ method: "POST", body: {} }
|
|
5396
5389
|
);
|
|
5397
5390
|
}
|
|
5398
5391
|
/**
|