@rivetkit/engine-api-full 25.6.1 → 25.7.1-rc.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/browser/cjs/index.js +340 -44
- package/dist/browser/cjs/serialization.js +42 -30
- package/dist/browser/esm/index.js +340 -44
- package/dist/browser/esm/serialization.js +42 -30
- package/dist/node/index.js +340 -44
- package/dist/node/serialization.js +50 -36
- package/package.json +1 -1
- package/types/Client.d.ts +3 -0
- package/types/api/resources/index.d.ts +2 -0
- package/types/api/resources/namespaces/client/requests/NamespacesListRequest.d.ts +2 -0
- package/types/api/resources/namespacesRunnerConfigs/client/Client.d.ts +73 -0
- package/types/api/resources/namespacesRunnerConfigs/client/index.d.ts +1 -0
- package/types/api/resources/namespacesRunnerConfigs/client/requests/NamespacesRunnerConfigsListRequest.d.ts +13 -0
- package/types/api/resources/namespacesRunnerConfigs/client/requests/index.d.ts +1 -0
- package/types/api/resources/namespacesRunnerConfigs/index.d.ts +1 -0
- package/types/api/types/ActorLifecycle.d.ts +7 -0
- package/types/api/types/Datacenter.d.ts +0 -1
- package/types/api/types/NamespacesRunnerConfig.d.ts +7 -0
- package/types/api/types/NamespacesRunnerConfigServerless.d.ts +12 -0
- package/types/api/types/NamespacesRunnerConfigVariant.d.ts +4 -0
- package/types/api/types/NamespacesRunnerConfigsDeleteResponse.d.ts +4 -0
- package/types/api/types/NamespacesRunnerConfigsGetResponse.d.ts +7 -0
- package/types/api/types/NamespacesRunnerConfigsListResponse.d.ts +8 -0
- package/types/api/types/NamespacesRunnerConfigsUpsertRequest.d.ts +5 -0
- package/types/api/types/NamespacesRunnerConfigsUpsertResponse.d.ts +4 -0
- package/types/api/types/Runner.d.ts +0 -3
- package/types/api/types/index.d.ts +8 -6
- package/types/serialization/types/ActorLifecycle.d.ts +13 -0
- package/types/serialization/types/Datacenter.d.ts +0 -1
- package/types/serialization/types/NamespacesRunnerConfig.d.ts +13 -0
- package/types/serialization/types/NamespacesRunnerConfigServerless.d.ts +17 -0
- package/types/serialization/types/NamespacesRunnerConfigVariant.d.ts +10 -0
- package/types/serialization/types/NamespacesRunnerConfigsDeleteResponse.d.ts +10 -0
- package/types/serialization/types/NamespacesRunnerConfigsGetResponse.d.ts +13 -0
- package/types/serialization/types/NamespacesRunnerConfigsListResponse.d.ts +15 -0
- package/types/serialization/types/NamespacesRunnerConfigsUpsertRequest.d.ts +11 -0
- package/types/serialization/types/NamespacesRunnerConfigsUpsertResponse.d.ts +10 -0
- package/types/serialization/types/Runner.d.ts +0 -6
- package/types/serialization/types/index.d.ts +8 -6
|
@@ -550,6 +550,7 @@ __export(api_exports, {
|
|
|
550
550
|
CrashPolicy: () => CrashPolicy,
|
|
551
551
|
datacenters: () => datacenters_exports,
|
|
552
552
|
namespaces: () => namespaces_exports,
|
|
553
|
+
namespacesRunnerConfigs: () => namespacesRunnerConfigs_exports,
|
|
553
554
|
runners: () => runners_exports
|
|
554
555
|
});
|
|
555
556
|
|
|
@@ -566,6 +567,9 @@ var datacenters_exports = {};
|
|
|
566
567
|
// src/api/resources/namespaces/index.ts
|
|
567
568
|
var namespaces_exports = {};
|
|
568
569
|
|
|
570
|
+
// src/api/resources/namespacesRunnerConfigs/index.ts
|
|
571
|
+
var namespacesRunnerConfigs_exports = {};
|
|
572
|
+
|
|
569
573
|
// src/api/resources/runners/index.ts
|
|
570
574
|
var runners_exports = {};
|
|
571
575
|
|
|
@@ -2279,7 +2283,7 @@ function transformAndValidateUnion({
|
|
|
2279
2283
|
}
|
|
2280
2284
|
|
|
2281
2285
|
// src/Client.ts
|
|
2282
|
-
import
|
|
2286
|
+
import urlJoin5 from "url-join";
|
|
2283
2287
|
|
|
2284
2288
|
// src/serialization/index.ts
|
|
2285
2289
|
var serialization_exports = {};
|
|
@@ -2305,18 +2309,20 @@ __export(serialization_exports, {
|
|
|
2305
2309
|
NamespacesCreateResponse: () => NamespacesCreateResponse,
|
|
2306
2310
|
NamespacesGetResponse: () => NamespacesGetResponse,
|
|
2307
2311
|
NamespacesListResponse: () => NamespacesListResponse,
|
|
2312
|
+
NamespacesRunnerConfig: () => NamespacesRunnerConfig,
|
|
2313
|
+
NamespacesRunnerConfigServerless: () => NamespacesRunnerConfigServerless,
|
|
2314
|
+
NamespacesRunnerConfigVariant: () => NamespacesRunnerConfigVariant,
|
|
2315
|
+
NamespacesRunnerConfigsDeleteResponse: () => NamespacesRunnerConfigsDeleteResponse,
|
|
2316
|
+
NamespacesRunnerConfigsGetResponse: () => NamespacesRunnerConfigsGetResponse,
|
|
2317
|
+
NamespacesRunnerConfigsListResponse: () => NamespacesRunnerConfigsListResponse,
|
|
2318
|
+
NamespacesRunnerConfigsUpsertRequest: () => NamespacesRunnerConfigsUpsertRequest,
|
|
2319
|
+
NamespacesRunnerConfigsUpsertResponse: () => NamespacesRunnerConfigsUpsertResponse,
|
|
2308
2320
|
Pagination: () => Pagination,
|
|
2309
2321
|
RivetId: () => RivetId,
|
|
2310
2322
|
Runner: () => Runner,
|
|
2311
2323
|
RunnersGetResponse: () => RunnersGetResponse,
|
|
2312
2324
|
RunnersListNamesResponse: () => RunnersListNamesResponse,
|
|
2313
2325
|
RunnersListResponse: () => RunnersListResponse,
|
|
2314
|
-
StringHttpAddressHashableMap: () => StringHttpAddressHashableMap,
|
|
2315
|
-
StringHttpAddressHashableMapValue: () => StringHttpAddressHashableMapValue,
|
|
2316
|
-
StringTcpAddressHashableMap: () => StringTcpAddressHashableMap,
|
|
2317
|
-
StringTcpAddressHashableMapValue: () => StringTcpAddressHashableMapValue,
|
|
2318
|
-
StringUdpAddressHashableMap: () => StringUdpAddressHashableMap,
|
|
2319
|
-
StringUdpAddressHashableMapValue: () => StringUdpAddressHashableMapValue,
|
|
2320
2326
|
namespaces: () => namespaces_exports2
|
|
2321
2327
|
});
|
|
2322
2328
|
|
|
@@ -2398,8 +2404,7 @@ var ActorsListResponse = schemas_exports.object({
|
|
|
2398
2404
|
// src/serialization/types/Datacenter.ts
|
|
2399
2405
|
var Datacenter = schemas_exports.object({
|
|
2400
2406
|
datacenterLabel: schemas_exports.property("datacenter_label", schemas_exports.number()),
|
|
2401
|
-
name: schemas_exports.string()
|
|
2402
|
-
url: schemas_exports.string()
|
|
2407
|
+
name: schemas_exports.string()
|
|
2403
2408
|
});
|
|
2404
2409
|
|
|
2405
2410
|
// src/serialization/types/DatacentersListResponse.ts
|
|
@@ -2432,38 +2437,49 @@ var NamespacesListResponse = schemas_exports.object({
|
|
|
2432
2437
|
pagination: Pagination
|
|
2433
2438
|
});
|
|
2434
2439
|
|
|
2435
|
-
// src/serialization/types/
|
|
2436
|
-
var
|
|
2437
|
-
|
|
2438
|
-
|
|
2440
|
+
// src/serialization/types/NamespacesRunnerConfigServerless.ts
|
|
2441
|
+
var NamespacesRunnerConfigServerless = schemas_exports.object({
|
|
2442
|
+
maxRunners: schemas_exports.property("max_runners", schemas_exports.number()),
|
|
2443
|
+
minRunners: schemas_exports.property("min_runners", schemas_exports.number()),
|
|
2444
|
+
requestLifespan: schemas_exports.property("request_lifespan", schemas_exports.number()),
|
|
2445
|
+
runnersMargin: schemas_exports.property("runners_margin", schemas_exports.number()),
|
|
2446
|
+
slotsPerRunner: schemas_exports.property("slots_per_runner", schemas_exports.number()),
|
|
2447
|
+
url: schemas_exports.string()
|
|
2439
2448
|
});
|
|
2440
2449
|
|
|
2441
|
-
// src/serialization/types/
|
|
2442
|
-
var
|
|
2443
|
-
|
|
2444
|
-
// src/serialization/types/StringTcpAddressHashableMapValue.ts
|
|
2445
|
-
var StringTcpAddressHashableMapValue = schemas_exports.object({
|
|
2446
|
-
hostname: schemas_exports.string(),
|
|
2447
|
-
port: schemas_exports.number()
|
|
2450
|
+
// src/serialization/types/NamespacesRunnerConfig.ts
|
|
2451
|
+
var NamespacesRunnerConfig = schemas_exports.object({
|
|
2452
|
+
serverless: NamespacesRunnerConfigServerless
|
|
2448
2453
|
});
|
|
2449
2454
|
|
|
2450
|
-
// src/serialization/types/
|
|
2451
|
-
var
|
|
2455
|
+
// src/serialization/types/NamespacesRunnerConfigVariant.ts
|
|
2456
|
+
var NamespacesRunnerConfigVariant = schemas_exports.stringLiteral("serverless");
|
|
2457
|
+
|
|
2458
|
+
// src/serialization/types/NamespacesRunnerConfigsDeleteResponse.ts
|
|
2459
|
+
var NamespacesRunnerConfigsDeleteResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2452
2460
|
|
|
2453
|
-
// src/serialization/types/
|
|
2454
|
-
var
|
|
2455
|
-
|
|
2456
|
-
port: schemas_exports.number()
|
|
2461
|
+
// src/serialization/types/NamespacesRunnerConfigsGetResponse.ts
|
|
2462
|
+
var NamespacesRunnerConfigsGetResponse = schemas_exports.object({
|
|
2463
|
+
runnerConfig: schemas_exports.property("runner_config", NamespacesRunnerConfig)
|
|
2457
2464
|
});
|
|
2458
2465
|
|
|
2459
|
-
// src/serialization/types/
|
|
2460
|
-
var
|
|
2466
|
+
// src/serialization/types/NamespacesRunnerConfigsListResponse.ts
|
|
2467
|
+
var NamespacesRunnerConfigsListResponse = schemas_exports.object({
|
|
2468
|
+
pagination: Pagination,
|
|
2469
|
+
runnerConfigs: schemas_exports.property(
|
|
2470
|
+
"runner_configs",
|
|
2471
|
+
schemas_exports.record(schemas_exports.string(), NamespacesRunnerConfig)
|
|
2472
|
+
)
|
|
2473
|
+
});
|
|
2474
|
+
|
|
2475
|
+
// src/serialization/types/NamespacesRunnerConfigsUpsertRequest.ts
|
|
2476
|
+
var NamespacesRunnerConfigsUpsertRequest = NamespacesRunnerConfig;
|
|
2477
|
+
|
|
2478
|
+
// src/serialization/types/NamespacesRunnerConfigsUpsertResponse.ts
|
|
2479
|
+
var NamespacesRunnerConfigsUpsertResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2461
2480
|
|
|
2462
2481
|
// src/serialization/types/Runner.ts
|
|
2463
2482
|
var Runner = schemas_exports.object({
|
|
2464
|
-
addressesHttp: schemas_exports.property("addresses_http", StringHttpAddressHashableMap),
|
|
2465
|
-
addressesTcp: schemas_exports.property("addresses_tcp", StringTcpAddressHashableMap),
|
|
2466
|
-
addressesUdp: schemas_exports.property("addresses_udp", StringUdpAddressHashableMap),
|
|
2467
2483
|
createTs: schemas_exports.property("create_ts", schemas_exports.number()),
|
|
2468
2484
|
datacenter: schemas_exports.string(),
|
|
2469
2485
|
drainTs: schemas_exports.property("drain_ts", schemas_exports.number().optional()),
|
|
@@ -2654,7 +2670,7 @@ var Namespaces = class {
|
|
|
2654
2670
|
* await client.namespaces.list()
|
|
2655
2671
|
*/
|
|
2656
2672
|
async list(request = {}, requestOptions) {
|
|
2657
|
-
const { limit, cursor, name } = request;
|
|
2673
|
+
const { limit, cursor, name, namespaceId } = request;
|
|
2658
2674
|
const _queryParams = {};
|
|
2659
2675
|
if (limit != null) {
|
|
2660
2676
|
_queryParams["limit"] = limit.toString();
|
|
@@ -2665,6 +2681,15 @@ var Namespaces = class {
|
|
|
2665
2681
|
if (name != null) {
|
|
2666
2682
|
_queryParams["name"] = name;
|
|
2667
2683
|
}
|
|
2684
|
+
if (namespaceId != null) {
|
|
2685
|
+
if (Array.isArray(namespaceId)) {
|
|
2686
|
+
_queryParams["namespace_id"] = namespaceId.map(
|
|
2687
|
+
(item) => RivetId.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" })
|
|
2688
|
+
);
|
|
2689
|
+
} else {
|
|
2690
|
+
_queryParams["namespace_id"] = namespaceId;
|
|
2691
|
+
}
|
|
2692
|
+
}
|
|
2668
2693
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2669
2694
|
url: urlJoin2(
|
|
2670
2695
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
@@ -2829,8 +2854,275 @@ var Namespaces = class {
|
|
|
2829
2854
|
}
|
|
2830
2855
|
};
|
|
2831
2856
|
|
|
2832
|
-
// src/api/resources/
|
|
2857
|
+
// src/api/resources/namespacesRunnerConfigs/client/Client.ts
|
|
2833
2858
|
import urlJoin3 from "url-join";
|
|
2859
|
+
var NamespacesRunnerConfigs = class {
|
|
2860
|
+
constructor(_options) {
|
|
2861
|
+
this._options = _options;
|
|
2862
|
+
}
|
|
2863
|
+
/**
|
|
2864
|
+
* @param {Rivet.RivetId} namespaceId
|
|
2865
|
+
* @param {Rivet.NamespacesRunnerConfigsListRequest} request
|
|
2866
|
+
* @param {NamespacesRunnerConfigs.RequestOptions} requestOptions - Request-specific configuration.
|
|
2867
|
+
*
|
|
2868
|
+
* @example
|
|
2869
|
+
* await client.namespacesRunnerConfigs.list("namespace_id")
|
|
2870
|
+
*/
|
|
2871
|
+
async list(namespaceId, request = {}, requestOptions) {
|
|
2872
|
+
const { limit, cursor, variant } = request;
|
|
2873
|
+
const _queryParams = {};
|
|
2874
|
+
if (limit != null) {
|
|
2875
|
+
_queryParams["limit"] = limit.toString();
|
|
2876
|
+
}
|
|
2877
|
+
if (cursor != null) {
|
|
2878
|
+
_queryParams["cursor"] = cursor;
|
|
2879
|
+
}
|
|
2880
|
+
if (variant != null) {
|
|
2881
|
+
_queryParams["variant"] = NamespacesRunnerConfigVariant.jsonOrThrow(variant, {
|
|
2882
|
+
unrecognizedObjectKeys: "strip"
|
|
2883
|
+
});
|
|
2884
|
+
}
|
|
2885
|
+
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2886
|
+
url: urlJoin3(
|
|
2887
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2888
|
+
`namespaces/${encodeURIComponent(RivetId.jsonOrThrow(namespaceId))}/runner-configs`
|
|
2889
|
+
),
|
|
2890
|
+
method: "GET",
|
|
2891
|
+
headers: {
|
|
2892
|
+
"X-Fern-Language": "JavaScript",
|
|
2893
|
+
"X-Fern-Runtime": RUNTIME.type,
|
|
2894
|
+
"X-Fern-Runtime-Version": RUNTIME.version,
|
|
2895
|
+
...requestOptions?.headers
|
|
2896
|
+
},
|
|
2897
|
+
contentType: "application/json",
|
|
2898
|
+
queryParameters: _queryParams,
|
|
2899
|
+
requestType: "json",
|
|
2900
|
+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
2901
|
+
maxRetries: requestOptions?.maxRetries,
|
|
2902
|
+
abortSignal: requestOptions?.abortSignal
|
|
2903
|
+
});
|
|
2904
|
+
if (_response.ok) {
|
|
2905
|
+
return NamespacesRunnerConfigsListResponse.parseOrThrow(_response.body, {
|
|
2906
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2907
|
+
allowUnrecognizedUnionMembers: true,
|
|
2908
|
+
allowUnrecognizedEnumValues: true,
|
|
2909
|
+
skipValidation: true,
|
|
2910
|
+
breadcrumbsPrefix: ["response"]
|
|
2911
|
+
});
|
|
2912
|
+
}
|
|
2913
|
+
if (_response.error.reason === "status-code") {
|
|
2914
|
+
throw new RivetError({
|
|
2915
|
+
statusCode: _response.error.statusCode,
|
|
2916
|
+
body: _response.error.body
|
|
2917
|
+
});
|
|
2918
|
+
}
|
|
2919
|
+
switch (_response.error.reason) {
|
|
2920
|
+
case "non-json":
|
|
2921
|
+
throw new RivetError({
|
|
2922
|
+
statusCode: _response.error.statusCode,
|
|
2923
|
+
body: _response.error.rawBody
|
|
2924
|
+
});
|
|
2925
|
+
case "timeout":
|
|
2926
|
+
throw new RivetTimeoutError(
|
|
2927
|
+
"Timeout exceeded when calling GET /namespaces/{namespace_id}/runner-configs."
|
|
2928
|
+
);
|
|
2929
|
+
case "unknown":
|
|
2930
|
+
throw new RivetError({
|
|
2931
|
+
message: _response.error.errorMessage
|
|
2932
|
+
});
|
|
2933
|
+
}
|
|
2934
|
+
}
|
|
2935
|
+
/**
|
|
2936
|
+
* @param {Rivet.RivetId} namespaceId
|
|
2937
|
+
* @param {string} runnerName
|
|
2938
|
+
* @param {NamespacesRunnerConfigs.RequestOptions} requestOptions - Request-specific configuration.
|
|
2939
|
+
*
|
|
2940
|
+
* @example
|
|
2941
|
+
* await client.namespacesRunnerConfigs.get("namespace_id", "runner_name")
|
|
2942
|
+
*/
|
|
2943
|
+
async get(namespaceId, runnerName, requestOptions) {
|
|
2944
|
+
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2945
|
+
url: urlJoin3(
|
|
2946
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2947
|
+
`namespaces/${encodeURIComponent(RivetId.jsonOrThrow(namespaceId))}/runner-configs/${encodeURIComponent(runnerName)}`
|
|
2948
|
+
),
|
|
2949
|
+
method: "GET",
|
|
2950
|
+
headers: {
|
|
2951
|
+
"X-Fern-Language": "JavaScript",
|
|
2952
|
+
"X-Fern-Runtime": RUNTIME.type,
|
|
2953
|
+
"X-Fern-Runtime-Version": RUNTIME.version,
|
|
2954
|
+
...requestOptions?.headers
|
|
2955
|
+
},
|
|
2956
|
+
contentType: "application/json",
|
|
2957
|
+
requestType: "json",
|
|
2958
|
+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
2959
|
+
maxRetries: requestOptions?.maxRetries,
|
|
2960
|
+
abortSignal: requestOptions?.abortSignal
|
|
2961
|
+
});
|
|
2962
|
+
if (_response.ok) {
|
|
2963
|
+
return NamespacesRunnerConfigsGetResponse.parseOrThrow(_response.body, {
|
|
2964
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2965
|
+
allowUnrecognizedUnionMembers: true,
|
|
2966
|
+
allowUnrecognizedEnumValues: true,
|
|
2967
|
+
skipValidation: true,
|
|
2968
|
+
breadcrumbsPrefix: ["response"]
|
|
2969
|
+
});
|
|
2970
|
+
}
|
|
2971
|
+
if (_response.error.reason === "status-code") {
|
|
2972
|
+
throw new RivetError({
|
|
2973
|
+
statusCode: _response.error.statusCode,
|
|
2974
|
+
body: _response.error.body
|
|
2975
|
+
});
|
|
2976
|
+
}
|
|
2977
|
+
switch (_response.error.reason) {
|
|
2978
|
+
case "non-json":
|
|
2979
|
+
throw new RivetError({
|
|
2980
|
+
statusCode: _response.error.statusCode,
|
|
2981
|
+
body: _response.error.rawBody
|
|
2982
|
+
});
|
|
2983
|
+
case "timeout":
|
|
2984
|
+
throw new RivetTimeoutError(
|
|
2985
|
+
"Timeout exceeded when calling GET /namespaces/{namespace_id}/runner-configs/{runner_name}."
|
|
2986
|
+
);
|
|
2987
|
+
case "unknown":
|
|
2988
|
+
throw new RivetError({
|
|
2989
|
+
message: _response.error.errorMessage
|
|
2990
|
+
});
|
|
2991
|
+
}
|
|
2992
|
+
}
|
|
2993
|
+
/**
|
|
2994
|
+
* @param {Rivet.RivetId} namespaceId
|
|
2995
|
+
* @param {string} runnerName
|
|
2996
|
+
* @param {Rivet.NamespacesRunnerConfigsUpsertRequest} request
|
|
2997
|
+
* @param {NamespacesRunnerConfigs.RequestOptions} requestOptions - Request-specific configuration.
|
|
2998
|
+
*
|
|
2999
|
+
* @example
|
|
3000
|
+
* await client.namespacesRunnerConfigs.upsert("namespace_id", "runner_name", {
|
|
3001
|
+
* serverless: {
|
|
3002
|
+
* maxRunners: 1,
|
|
3003
|
+
* minRunners: 1,
|
|
3004
|
+
* requestLifespan: 1,
|
|
3005
|
+
* runnersMargin: 1,
|
|
3006
|
+
* slotsPerRunner: 1,
|
|
3007
|
+
* url: "url"
|
|
3008
|
+
* }
|
|
3009
|
+
* })
|
|
3010
|
+
*/
|
|
3011
|
+
async upsert(namespaceId, runnerName, request, requestOptions) {
|
|
3012
|
+
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3013
|
+
url: urlJoin3(
|
|
3014
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3015
|
+
`namespaces/${encodeURIComponent(RivetId.jsonOrThrow(namespaceId))}/runner-configs/${encodeURIComponent(runnerName)}`
|
|
3016
|
+
),
|
|
3017
|
+
method: "PUT",
|
|
3018
|
+
headers: {
|
|
3019
|
+
"X-Fern-Language": "JavaScript",
|
|
3020
|
+
"X-Fern-Runtime": RUNTIME.type,
|
|
3021
|
+
"X-Fern-Runtime-Version": RUNTIME.version,
|
|
3022
|
+
...requestOptions?.headers
|
|
3023
|
+
},
|
|
3024
|
+
contentType: "application/json",
|
|
3025
|
+
requestType: "json",
|
|
3026
|
+
body: NamespacesRunnerConfigsUpsertRequest.jsonOrThrow(request, {
|
|
3027
|
+
unrecognizedObjectKeys: "strip"
|
|
3028
|
+
}),
|
|
3029
|
+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
3030
|
+
maxRetries: requestOptions?.maxRetries,
|
|
3031
|
+
abortSignal: requestOptions?.abortSignal
|
|
3032
|
+
});
|
|
3033
|
+
if (_response.ok) {
|
|
3034
|
+
return NamespacesRunnerConfigsUpsertResponse.parseOrThrow(_response.body, {
|
|
3035
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3036
|
+
allowUnrecognizedUnionMembers: true,
|
|
3037
|
+
allowUnrecognizedEnumValues: true,
|
|
3038
|
+
skipValidation: true,
|
|
3039
|
+
breadcrumbsPrefix: ["response"]
|
|
3040
|
+
});
|
|
3041
|
+
}
|
|
3042
|
+
if (_response.error.reason === "status-code") {
|
|
3043
|
+
throw new RivetError({
|
|
3044
|
+
statusCode: _response.error.statusCode,
|
|
3045
|
+
body: _response.error.body
|
|
3046
|
+
});
|
|
3047
|
+
}
|
|
3048
|
+
switch (_response.error.reason) {
|
|
3049
|
+
case "non-json":
|
|
3050
|
+
throw new RivetError({
|
|
3051
|
+
statusCode: _response.error.statusCode,
|
|
3052
|
+
body: _response.error.rawBody
|
|
3053
|
+
});
|
|
3054
|
+
case "timeout":
|
|
3055
|
+
throw new RivetTimeoutError(
|
|
3056
|
+
"Timeout exceeded when calling PUT /namespaces/{namespace_id}/runner-configs/{runner_name}."
|
|
3057
|
+
);
|
|
3058
|
+
case "unknown":
|
|
3059
|
+
throw new RivetError({
|
|
3060
|
+
message: _response.error.errorMessage
|
|
3061
|
+
});
|
|
3062
|
+
}
|
|
3063
|
+
}
|
|
3064
|
+
/**
|
|
3065
|
+
* @param {Rivet.RivetId} namespaceId
|
|
3066
|
+
* @param {string} runnerName
|
|
3067
|
+
* @param {NamespacesRunnerConfigs.RequestOptions} requestOptions - Request-specific configuration.
|
|
3068
|
+
*
|
|
3069
|
+
* @example
|
|
3070
|
+
* await client.namespacesRunnerConfigs.delete("namespace_id", "runner_name")
|
|
3071
|
+
*/
|
|
3072
|
+
async delete(namespaceId, runnerName, requestOptions) {
|
|
3073
|
+
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3074
|
+
url: urlJoin3(
|
|
3075
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3076
|
+
`namespaces/${encodeURIComponent(RivetId.jsonOrThrow(namespaceId))}/runner-configs/${encodeURIComponent(runnerName)}`
|
|
3077
|
+
),
|
|
3078
|
+
method: "DELETE",
|
|
3079
|
+
headers: {
|
|
3080
|
+
"X-Fern-Language": "JavaScript",
|
|
3081
|
+
"X-Fern-Runtime": RUNTIME.type,
|
|
3082
|
+
"X-Fern-Runtime-Version": RUNTIME.version,
|
|
3083
|
+
...requestOptions?.headers
|
|
3084
|
+
},
|
|
3085
|
+
contentType: "application/json",
|
|
3086
|
+
requestType: "json",
|
|
3087
|
+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
3088
|
+
maxRetries: requestOptions?.maxRetries,
|
|
3089
|
+
abortSignal: requestOptions?.abortSignal
|
|
3090
|
+
});
|
|
3091
|
+
if (_response.ok) {
|
|
3092
|
+
return NamespacesRunnerConfigsDeleteResponse.parseOrThrow(_response.body, {
|
|
3093
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3094
|
+
allowUnrecognizedUnionMembers: true,
|
|
3095
|
+
allowUnrecognizedEnumValues: true,
|
|
3096
|
+
skipValidation: true,
|
|
3097
|
+
breadcrumbsPrefix: ["response"]
|
|
3098
|
+
});
|
|
3099
|
+
}
|
|
3100
|
+
if (_response.error.reason === "status-code") {
|
|
3101
|
+
throw new RivetError({
|
|
3102
|
+
statusCode: _response.error.statusCode,
|
|
3103
|
+
body: _response.error.body
|
|
3104
|
+
});
|
|
3105
|
+
}
|
|
3106
|
+
switch (_response.error.reason) {
|
|
3107
|
+
case "non-json":
|
|
3108
|
+
throw new RivetError({
|
|
3109
|
+
statusCode: _response.error.statusCode,
|
|
3110
|
+
body: _response.error.rawBody
|
|
3111
|
+
});
|
|
3112
|
+
case "timeout":
|
|
3113
|
+
throw new RivetTimeoutError(
|
|
3114
|
+
"Timeout exceeded when calling DELETE /namespaces/{namespace_id}/runner-configs/{runner_name}."
|
|
3115
|
+
);
|
|
3116
|
+
case "unknown":
|
|
3117
|
+
throw new RivetError({
|
|
3118
|
+
message: _response.error.errorMessage
|
|
3119
|
+
});
|
|
3120
|
+
}
|
|
3121
|
+
}
|
|
3122
|
+
};
|
|
3123
|
+
|
|
3124
|
+
// src/api/resources/runners/client/Client.ts
|
|
3125
|
+
import urlJoin4 from "url-join";
|
|
2834
3126
|
var Runners = class {
|
|
2835
3127
|
constructor(_options) {
|
|
2836
3128
|
this._options = _options;
|
|
@@ -2861,7 +3153,7 @@ var Runners = class {
|
|
|
2861
3153
|
_queryParams["cursor"] = cursor;
|
|
2862
3154
|
}
|
|
2863
3155
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2864
|
-
url:
|
|
3156
|
+
url: urlJoin4(
|
|
2865
3157
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2866
3158
|
"runners"
|
|
2867
3159
|
),
|
|
@@ -2933,7 +3225,7 @@ var Runners = class {
|
|
|
2933
3225
|
_queryParams["cursor"] = cursor;
|
|
2934
3226
|
}
|
|
2935
3227
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2936
|
-
url:
|
|
3228
|
+
url: urlJoin4(
|
|
2937
3229
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2938
3230
|
"runners/names"
|
|
2939
3231
|
),
|
|
@@ -2995,7 +3287,7 @@ var Runners = class {
|
|
|
2995
3287
|
_queryParams["namespace"] = namespace;
|
|
2996
3288
|
}
|
|
2997
3289
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2998
|
-
url:
|
|
3290
|
+
url: urlJoin4(
|
|
2999
3291
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3000
3292
|
`runners/${encodeURIComponent(RivetId.jsonOrThrow(runnerId))}`
|
|
3001
3293
|
),
|
|
@@ -3051,6 +3343,7 @@ var RivetClient = class {
|
|
|
3051
3343
|
}
|
|
3052
3344
|
_datacenters;
|
|
3053
3345
|
_namespaces;
|
|
3346
|
+
_namespacesRunnerConfigs;
|
|
3054
3347
|
_runners;
|
|
3055
3348
|
get datacenters() {
|
|
3056
3349
|
return this._datacenters ??= new Datacenters(this._options);
|
|
@@ -3058,6 +3351,9 @@ var RivetClient = class {
|
|
|
3058
3351
|
get namespaces() {
|
|
3059
3352
|
return this._namespaces ??= new Namespaces(this._options);
|
|
3060
3353
|
}
|
|
3354
|
+
get namespacesRunnerConfigs() {
|
|
3355
|
+
return this._namespacesRunnerConfigs ??= new NamespacesRunnerConfigs(this._options);
|
|
3356
|
+
}
|
|
3061
3357
|
get runners() {
|
|
3062
3358
|
return this._runners ??= new Runners(this._options);
|
|
3063
3359
|
}
|
|
@@ -3119,7 +3415,7 @@ var RivetClient = class {
|
|
|
3119
3415
|
_queryParams["cursor"] = cursor;
|
|
3120
3416
|
}
|
|
3121
3417
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3122
|
-
url:
|
|
3418
|
+
url: urlJoin5(
|
|
3123
3419
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3124
3420
|
"actors"
|
|
3125
3421
|
),
|
|
@@ -3203,7 +3499,7 @@ var RivetClient = class {
|
|
|
3203
3499
|
_queryParams["datacenter"] = datacenter;
|
|
3204
3500
|
}
|
|
3205
3501
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3206
|
-
url:
|
|
3502
|
+
url: urlJoin5(
|
|
3207
3503
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3208
3504
|
"actors"
|
|
3209
3505
|
),
|
|
@@ -3301,7 +3597,7 @@ var RivetClient = class {
|
|
|
3301
3597
|
_queryParams["datacenter"] = datacenter;
|
|
3302
3598
|
}
|
|
3303
3599
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3304
|
-
url:
|
|
3600
|
+
url: urlJoin5(
|
|
3305
3601
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3306
3602
|
"actors"
|
|
3307
3603
|
),
|
|
@@ -3373,7 +3669,7 @@ var RivetClient = class {
|
|
|
3373
3669
|
_queryParams["name"] = name;
|
|
3374
3670
|
_queryParams["key"] = key;
|
|
3375
3671
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3376
|
-
url:
|
|
3672
|
+
url: urlJoin5(
|
|
3377
3673
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3378
3674
|
"actors/by-id"
|
|
3379
3675
|
),
|
|
@@ -3462,7 +3758,7 @@ var RivetClient = class {
|
|
|
3462
3758
|
_queryParams["datacenter"] = datacenter;
|
|
3463
3759
|
}
|
|
3464
3760
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3465
|
-
url:
|
|
3761
|
+
url: urlJoin5(
|
|
3466
3762
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3467
3763
|
"actors/by-id"
|
|
3468
3764
|
),
|
|
@@ -3535,7 +3831,7 @@ var RivetClient = class {
|
|
|
3535
3831
|
_queryParams["cursor"] = cursor;
|
|
3536
3832
|
}
|
|
3537
3833
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3538
|
-
url:
|
|
3834
|
+
url: urlJoin5(
|
|
3539
3835
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3540
3836
|
"actors/names"
|
|
3541
3837
|
),
|
|
@@ -3602,7 +3898,7 @@ var RivetClient = class {
|
|
|
3602
3898
|
_queryParams["namespace"] = namespace;
|
|
3603
3899
|
}
|
|
3604
3900
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3605
|
-
url:
|
|
3901
|
+
url: urlJoin5(
|
|
3606
3902
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3607
3903
|
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}`
|
|
3608
3904
|
),
|
|
@@ -3669,7 +3965,7 @@ var RivetClient = class {
|
|
|
3669
3965
|
_queryParams["namespace"] = namespace;
|
|
3670
3966
|
}
|
|
3671
3967
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3672
|
-
url:
|
|
3968
|
+
url: urlJoin5(
|
|
3673
3969
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3674
3970
|
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}`
|
|
3675
3971
|
),
|
|
@@ -1541,8 +1541,7 @@ var ActorsListResponse = schemas_exports.object({
|
|
|
1541
1541
|
// src/serialization/types/Datacenter.ts
|
|
1542
1542
|
var Datacenter = schemas_exports.object({
|
|
1543
1543
|
datacenterLabel: schemas_exports.property("datacenter_label", schemas_exports.number()),
|
|
1544
|
-
name: schemas_exports.string()
|
|
1545
|
-
url: schemas_exports.string()
|
|
1544
|
+
name: schemas_exports.string()
|
|
1546
1545
|
});
|
|
1547
1546
|
|
|
1548
1547
|
// src/serialization/types/DatacentersListResponse.ts
|
|
@@ -1575,38 +1574,49 @@ var NamespacesListResponse = schemas_exports.object({
|
|
|
1575
1574
|
pagination: Pagination
|
|
1576
1575
|
});
|
|
1577
1576
|
|
|
1578
|
-
// src/serialization/types/
|
|
1579
|
-
var
|
|
1580
|
-
|
|
1581
|
-
|
|
1577
|
+
// src/serialization/types/NamespacesRunnerConfigServerless.ts
|
|
1578
|
+
var NamespacesRunnerConfigServerless = schemas_exports.object({
|
|
1579
|
+
maxRunners: schemas_exports.property("max_runners", schemas_exports.number()),
|
|
1580
|
+
minRunners: schemas_exports.property("min_runners", schemas_exports.number()),
|
|
1581
|
+
requestLifespan: schemas_exports.property("request_lifespan", schemas_exports.number()),
|
|
1582
|
+
runnersMargin: schemas_exports.property("runners_margin", schemas_exports.number()),
|
|
1583
|
+
slotsPerRunner: schemas_exports.property("slots_per_runner", schemas_exports.number()),
|
|
1584
|
+
url: schemas_exports.string()
|
|
1582
1585
|
});
|
|
1583
1586
|
|
|
1584
|
-
// src/serialization/types/
|
|
1585
|
-
var
|
|
1586
|
-
|
|
1587
|
-
// src/serialization/types/StringTcpAddressHashableMapValue.ts
|
|
1588
|
-
var StringTcpAddressHashableMapValue = schemas_exports.object({
|
|
1589
|
-
hostname: schemas_exports.string(),
|
|
1590
|
-
port: schemas_exports.number()
|
|
1587
|
+
// src/serialization/types/NamespacesRunnerConfig.ts
|
|
1588
|
+
var NamespacesRunnerConfig = schemas_exports.object({
|
|
1589
|
+
serverless: NamespacesRunnerConfigServerless
|
|
1591
1590
|
});
|
|
1592
1591
|
|
|
1593
|
-
// src/serialization/types/
|
|
1594
|
-
var
|
|
1592
|
+
// src/serialization/types/NamespacesRunnerConfigVariant.ts
|
|
1593
|
+
var NamespacesRunnerConfigVariant = schemas_exports.stringLiteral("serverless");
|
|
1595
1594
|
|
|
1596
|
-
// src/serialization/types/
|
|
1597
|
-
var
|
|
1598
|
-
|
|
1599
|
-
|
|
1595
|
+
// src/serialization/types/NamespacesRunnerConfigsDeleteResponse.ts
|
|
1596
|
+
var NamespacesRunnerConfigsDeleteResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
1597
|
+
|
|
1598
|
+
// src/serialization/types/NamespacesRunnerConfigsGetResponse.ts
|
|
1599
|
+
var NamespacesRunnerConfigsGetResponse = schemas_exports.object({
|
|
1600
|
+
runnerConfig: schemas_exports.property("runner_config", NamespacesRunnerConfig)
|
|
1600
1601
|
});
|
|
1601
1602
|
|
|
1602
|
-
// src/serialization/types/
|
|
1603
|
-
var
|
|
1603
|
+
// src/serialization/types/NamespacesRunnerConfigsListResponse.ts
|
|
1604
|
+
var NamespacesRunnerConfigsListResponse = schemas_exports.object({
|
|
1605
|
+
pagination: Pagination,
|
|
1606
|
+
runnerConfigs: schemas_exports.property(
|
|
1607
|
+
"runner_configs",
|
|
1608
|
+
schemas_exports.record(schemas_exports.string(), NamespacesRunnerConfig)
|
|
1609
|
+
)
|
|
1610
|
+
});
|
|
1611
|
+
|
|
1612
|
+
// src/serialization/types/NamespacesRunnerConfigsUpsertRequest.ts
|
|
1613
|
+
var NamespacesRunnerConfigsUpsertRequest = NamespacesRunnerConfig;
|
|
1614
|
+
|
|
1615
|
+
// src/serialization/types/NamespacesRunnerConfigsUpsertResponse.ts
|
|
1616
|
+
var NamespacesRunnerConfigsUpsertResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
1604
1617
|
|
|
1605
1618
|
// src/serialization/types/Runner.ts
|
|
1606
1619
|
var Runner = schemas_exports.object({
|
|
1607
|
-
addressesHttp: schemas_exports.property("addresses_http", StringHttpAddressHashableMap),
|
|
1608
|
-
addressesTcp: schemas_exports.property("addresses_tcp", StringTcpAddressHashableMap),
|
|
1609
|
-
addressesUdp: schemas_exports.property("addresses_udp", StringUdpAddressHashableMap),
|
|
1610
1620
|
createTs: schemas_exports.property("create_ts", schemas_exports.number()),
|
|
1611
1621
|
datacenter: schemas_exports.string(),
|
|
1612
1622
|
drainTs: schemas_exports.property("drain_ts", schemas_exports.number().optional()),
|
|
@@ -1701,17 +1711,19 @@ export {
|
|
|
1701
1711
|
NamespacesCreateResponse,
|
|
1702
1712
|
NamespacesGetResponse,
|
|
1703
1713
|
NamespacesListResponse,
|
|
1714
|
+
NamespacesRunnerConfig,
|
|
1715
|
+
NamespacesRunnerConfigServerless,
|
|
1716
|
+
NamespacesRunnerConfigVariant,
|
|
1717
|
+
NamespacesRunnerConfigsDeleteResponse,
|
|
1718
|
+
NamespacesRunnerConfigsGetResponse,
|
|
1719
|
+
NamespacesRunnerConfigsListResponse,
|
|
1720
|
+
NamespacesRunnerConfigsUpsertRequest,
|
|
1721
|
+
NamespacesRunnerConfigsUpsertResponse,
|
|
1704
1722
|
Pagination,
|
|
1705
1723
|
RivetId,
|
|
1706
1724
|
Runner,
|
|
1707
1725
|
RunnersGetResponse,
|
|
1708
1726
|
RunnersListNamesResponse,
|
|
1709
1727
|
RunnersListResponse,
|
|
1710
|
-
StringHttpAddressHashableMap,
|
|
1711
|
-
StringHttpAddressHashableMapValue,
|
|
1712
|
-
StringTcpAddressHashableMap,
|
|
1713
|
-
StringTcpAddressHashableMapValue,
|
|
1714
|
-
StringUdpAddressHashableMap,
|
|
1715
|
-
StringUdpAddressHashableMapValue,
|
|
1716
1728
|
namespaces_exports as namespaces
|
|
1717
1729
|
};
|