@rivetkit/engine-api-full 25.5.3 → 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
|
@@ -583,6 +583,7 @@ __export(api_exports, {
|
|
|
583
583
|
CrashPolicy: () => CrashPolicy,
|
|
584
584
|
datacenters: () => datacenters_exports,
|
|
585
585
|
namespaces: () => namespaces_exports,
|
|
586
|
+
namespacesRunnerConfigs: () => namespacesRunnerConfigs_exports,
|
|
586
587
|
runners: () => runners_exports
|
|
587
588
|
});
|
|
588
589
|
|
|
@@ -599,6 +600,9 @@ var datacenters_exports = {};
|
|
|
599
600
|
// src/api/resources/namespaces/index.ts
|
|
600
601
|
var namespaces_exports = {};
|
|
601
602
|
|
|
603
|
+
// src/api/resources/namespacesRunnerConfigs/index.ts
|
|
604
|
+
var namespacesRunnerConfigs_exports = {};
|
|
605
|
+
|
|
602
606
|
// src/api/resources/runners/index.ts
|
|
603
607
|
var runners_exports = {};
|
|
604
608
|
|
|
@@ -2312,7 +2316,7 @@ function transformAndValidateUnion({
|
|
|
2312
2316
|
}
|
|
2313
2317
|
|
|
2314
2318
|
// src/Client.ts
|
|
2315
|
-
var
|
|
2319
|
+
var import_url_join5 = __toESM(require("url-join"));
|
|
2316
2320
|
|
|
2317
2321
|
// src/serialization/index.ts
|
|
2318
2322
|
var serialization_exports = {};
|
|
@@ -2338,18 +2342,20 @@ __export(serialization_exports, {
|
|
|
2338
2342
|
NamespacesCreateResponse: () => NamespacesCreateResponse,
|
|
2339
2343
|
NamespacesGetResponse: () => NamespacesGetResponse,
|
|
2340
2344
|
NamespacesListResponse: () => NamespacesListResponse,
|
|
2345
|
+
NamespacesRunnerConfig: () => NamespacesRunnerConfig,
|
|
2346
|
+
NamespacesRunnerConfigServerless: () => NamespacesRunnerConfigServerless,
|
|
2347
|
+
NamespacesRunnerConfigVariant: () => NamespacesRunnerConfigVariant,
|
|
2348
|
+
NamespacesRunnerConfigsDeleteResponse: () => NamespacesRunnerConfigsDeleteResponse,
|
|
2349
|
+
NamespacesRunnerConfigsGetResponse: () => NamespacesRunnerConfigsGetResponse,
|
|
2350
|
+
NamespacesRunnerConfigsListResponse: () => NamespacesRunnerConfigsListResponse,
|
|
2351
|
+
NamespacesRunnerConfigsUpsertRequest: () => NamespacesRunnerConfigsUpsertRequest,
|
|
2352
|
+
NamespacesRunnerConfigsUpsertResponse: () => NamespacesRunnerConfigsUpsertResponse,
|
|
2341
2353
|
Pagination: () => Pagination,
|
|
2342
2354
|
RivetId: () => RivetId,
|
|
2343
2355
|
Runner: () => Runner,
|
|
2344
2356
|
RunnersGetResponse: () => RunnersGetResponse,
|
|
2345
2357
|
RunnersListNamesResponse: () => RunnersListNamesResponse,
|
|
2346
2358
|
RunnersListResponse: () => RunnersListResponse,
|
|
2347
|
-
StringHttpAddressHashableMap: () => StringHttpAddressHashableMap,
|
|
2348
|
-
StringHttpAddressHashableMapValue: () => StringHttpAddressHashableMapValue,
|
|
2349
|
-
StringTcpAddressHashableMap: () => StringTcpAddressHashableMap,
|
|
2350
|
-
StringTcpAddressHashableMapValue: () => StringTcpAddressHashableMapValue,
|
|
2351
|
-
StringUdpAddressHashableMap: () => StringUdpAddressHashableMap,
|
|
2352
|
-
StringUdpAddressHashableMapValue: () => StringUdpAddressHashableMapValue,
|
|
2353
2359
|
namespaces: () => namespaces_exports2
|
|
2354
2360
|
});
|
|
2355
2361
|
|
|
@@ -2431,8 +2437,7 @@ var ActorsListResponse = schemas_exports.object({
|
|
|
2431
2437
|
// src/serialization/types/Datacenter.ts
|
|
2432
2438
|
var Datacenter = schemas_exports.object({
|
|
2433
2439
|
datacenterLabel: schemas_exports.property("datacenter_label", schemas_exports.number()),
|
|
2434
|
-
name: schemas_exports.string()
|
|
2435
|
-
url: schemas_exports.string()
|
|
2440
|
+
name: schemas_exports.string()
|
|
2436
2441
|
});
|
|
2437
2442
|
|
|
2438
2443
|
// src/serialization/types/DatacentersListResponse.ts
|
|
@@ -2465,38 +2470,49 @@ var NamespacesListResponse = schemas_exports.object({
|
|
|
2465
2470
|
pagination: Pagination
|
|
2466
2471
|
});
|
|
2467
2472
|
|
|
2468
|
-
// src/serialization/types/
|
|
2469
|
-
var
|
|
2470
|
-
|
|
2471
|
-
|
|
2473
|
+
// src/serialization/types/NamespacesRunnerConfigServerless.ts
|
|
2474
|
+
var NamespacesRunnerConfigServerless = schemas_exports.object({
|
|
2475
|
+
maxRunners: schemas_exports.property("max_runners", schemas_exports.number()),
|
|
2476
|
+
minRunners: schemas_exports.property("min_runners", schemas_exports.number()),
|
|
2477
|
+
requestLifespan: schemas_exports.property("request_lifespan", schemas_exports.number()),
|
|
2478
|
+
runnersMargin: schemas_exports.property("runners_margin", schemas_exports.number()),
|
|
2479
|
+
slotsPerRunner: schemas_exports.property("slots_per_runner", schemas_exports.number()),
|
|
2480
|
+
url: schemas_exports.string()
|
|
2472
2481
|
});
|
|
2473
2482
|
|
|
2474
|
-
// src/serialization/types/
|
|
2475
|
-
var
|
|
2476
|
-
|
|
2477
|
-
// src/serialization/types/StringTcpAddressHashableMapValue.ts
|
|
2478
|
-
var StringTcpAddressHashableMapValue = schemas_exports.object({
|
|
2479
|
-
hostname: schemas_exports.string(),
|
|
2480
|
-
port: schemas_exports.number()
|
|
2483
|
+
// src/serialization/types/NamespacesRunnerConfig.ts
|
|
2484
|
+
var NamespacesRunnerConfig = schemas_exports.object({
|
|
2485
|
+
serverless: NamespacesRunnerConfigServerless
|
|
2481
2486
|
});
|
|
2482
2487
|
|
|
2483
|
-
// src/serialization/types/
|
|
2484
|
-
var
|
|
2488
|
+
// src/serialization/types/NamespacesRunnerConfigVariant.ts
|
|
2489
|
+
var NamespacesRunnerConfigVariant = schemas_exports.stringLiteral("serverless");
|
|
2490
|
+
|
|
2491
|
+
// src/serialization/types/NamespacesRunnerConfigsDeleteResponse.ts
|
|
2492
|
+
var NamespacesRunnerConfigsDeleteResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2485
2493
|
|
|
2486
|
-
// src/serialization/types/
|
|
2487
|
-
var
|
|
2488
|
-
|
|
2489
|
-
port: schemas_exports.number()
|
|
2494
|
+
// src/serialization/types/NamespacesRunnerConfigsGetResponse.ts
|
|
2495
|
+
var NamespacesRunnerConfigsGetResponse = schemas_exports.object({
|
|
2496
|
+
runnerConfig: schemas_exports.property("runner_config", NamespacesRunnerConfig)
|
|
2490
2497
|
});
|
|
2491
2498
|
|
|
2492
|
-
// src/serialization/types/
|
|
2493
|
-
var
|
|
2499
|
+
// src/serialization/types/NamespacesRunnerConfigsListResponse.ts
|
|
2500
|
+
var NamespacesRunnerConfigsListResponse = schemas_exports.object({
|
|
2501
|
+
pagination: Pagination,
|
|
2502
|
+
runnerConfigs: schemas_exports.property(
|
|
2503
|
+
"runner_configs",
|
|
2504
|
+
schemas_exports.record(schemas_exports.string(), NamespacesRunnerConfig)
|
|
2505
|
+
)
|
|
2506
|
+
});
|
|
2507
|
+
|
|
2508
|
+
// src/serialization/types/NamespacesRunnerConfigsUpsertRequest.ts
|
|
2509
|
+
var NamespacesRunnerConfigsUpsertRequest = NamespacesRunnerConfig;
|
|
2510
|
+
|
|
2511
|
+
// src/serialization/types/NamespacesRunnerConfigsUpsertResponse.ts
|
|
2512
|
+
var NamespacesRunnerConfigsUpsertResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2494
2513
|
|
|
2495
2514
|
// src/serialization/types/Runner.ts
|
|
2496
2515
|
var Runner = schemas_exports.object({
|
|
2497
|
-
addressesHttp: schemas_exports.property("addresses_http", StringHttpAddressHashableMap),
|
|
2498
|
-
addressesTcp: schemas_exports.property("addresses_tcp", StringTcpAddressHashableMap),
|
|
2499
|
-
addressesUdp: schemas_exports.property("addresses_udp", StringUdpAddressHashableMap),
|
|
2500
2516
|
createTs: schemas_exports.property("create_ts", schemas_exports.number()),
|
|
2501
2517
|
datacenter: schemas_exports.string(),
|
|
2502
2518
|
drainTs: schemas_exports.property("drain_ts", schemas_exports.number().optional()),
|
|
@@ -2687,7 +2703,7 @@ var Namespaces = class {
|
|
|
2687
2703
|
* await client.namespaces.list()
|
|
2688
2704
|
*/
|
|
2689
2705
|
async list(request = {}, requestOptions) {
|
|
2690
|
-
const { limit, cursor, name } = request;
|
|
2706
|
+
const { limit, cursor, name, namespaceId } = request;
|
|
2691
2707
|
const _queryParams = {};
|
|
2692
2708
|
if (limit != null) {
|
|
2693
2709
|
_queryParams["limit"] = limit.toString();
|
|
@@ -2698,6 +2714,15 @@ var Namespaces = class {
|
|
|
2698
2714
|
if (name != null) {
|
|
2699
2715
|
_queryParams["name"] = name;
|
|
2700
2716
|
}
|
|
2717
|
+
if (namespaceId != null) {
|
|
2718
|
+
if (Array.isArray(namespaceId)) {
|
|
2719
|
+
_queryParams["namespace_id"] = namespaceId.map(
|
|
2720
|
+
(item) => RivetId.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" })
|
|
2721
|
+
);
|
|
2722
|
+
} else {
|
|
2723
|
+
_queryParams["namespace_id"] = namespaceId;
|
|
2724
|
+
}
|
|
2725
|
+
}
|
|
2701
2726
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2702
2727
|
url: (0, import_url_join2.default)(
|
|
2703
2728
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
@@ -2862,8 +2887,275 @@ var Namespaces = class {
|
|
|
2862
2887
|
}
|
|
2863
2888
|
};
|
|
2864
2889
|
|
|
2865
|
-
// src/api/resources/
|
|
2890
|
+
// src/api/resources/namespacesRunnerConfigs/client/Client.ts
|
|
2866
2891
|
var import_url_join3 = __toESM(require("url-join"));
|
|
2892
|
+
var NamespacesRunnerConfigs = class {
|
|
2893
|
+
constructor(_options) {
|
|
2894
|
+
this._options = _options;
|
|
2895
|
+
}
|
|
2896
|
+
/**
|
|
2897
|
+
* @param {Rivet.RivetId} namespaceId
|
|
2898
|
+
* @param {Rivet.NamespacesRunnerConfigsListRequest} request
|
|
2899
|
+
* @param {NamespacesRunnerConfigs.RequestOptions} requestOptions - Request-specific configuration.
|
|
2900
|
+
*
|
|
2901
|
+
* @example
|
|
2902
|
+
* await client.namespacesRunnerConfigs.list("namespace_id")
|
|
2903
|
+
*/
|
|
2904
|
+
async list(namespaceId, request = {}, requestOptions) {
|
|
2905
|
+
const { limit, cursor, variant } = request;
|
|
2906
|
+
const _queryParams = {};
|
|
2907
|
+
if (limit != null) {
|
|
2908
|
+
_queryParams["limit"] = limit.toString();
|
|
2909
|
+
}
|
|
2910
|
+
if (cursor != null) {
|
|
2911
|
+
_queryParams["cursor"] = cursor;
|
|
2912
|
+
}
|
|
2913
|
+
if (variant != null) {
|
|
2914
|
+
_queryParams["variant"] = NamespacesRunnerConfigVariant.jsonOrThrow(variant, {
|
|
2915
|
+
unrecognizedObjectKeys: "strip"
|
|
2916
|
+
});
|
|
2917
|
+
}
|
|
2918
|
+
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2919
|
+
url: (0, import_url_join3.default)(
|
|
2920
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2921
|
+
`namespaces/${encodeURIComponent(RivetId.jsonOrThrow(namespaceId))}/runner-configs`
|
|
2922
|
+
),
|
|
2923
|
+
method: "GET",
|
|
2924
|
+
headers: {
|
|
2925
|
+
"X-Fern-Language": "JavaScript",
|
|
2926
|
+
"X-Fern-Runtime": RUNTIME.type,
|
|
2927
|
+
"X-Fern-Runtime-Version": RUNTIME.version,
|
|
2928
|
+
...requestOptions?.headers
|
|
2929
|
+
},
|
|
2930
|
+
contentType: "application/json",
|
|
2931
|
+
queryParameters: _queryParams,
|
|
2932
|
+
requestType: "json",
|
|
2933
|
+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
2934
|
+
maxRetries: requestOptions?.maxRetries,
|
|
2935
|
+
abortSignal: requestOptions?.abortSignal
|
|
2936
|
+
});
|
|
2937
|
+
if (_response.ok) {
|
|
2938
|
+
return NamespacesRunnerConfigsListResponse.parseOrThrow(_response.body, {
|
|
2939
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2940
|
+
allowUnrecognizedUnionMembers: true,
|
|
2941
|
+
allowUnrecognizedEnumValues: true,
|
|
2942
|
+
skipValidation: true,
|
|
2943
|
+
breadcrumbsPrefix: ["response"]
|
|
2944
|
+
});
|
|
2945
|
+
}
|
|
2946
|
+
if (_response.error.reason === "status-code") {
|
|
2947
|
+
throw new RivetError({
|
|
2948
|
+
statusCode: _response.error.statusCode,
|
|
2949
|
+
body: _response.error.body
|
|
2950
|
+
});
|
|
2951
|
+
}
|
|
2952
|
+
switch (_response.error.reason) {
|
|
2953
|
+
case "non-json":
|
|
2954
|
+
throw new RivetError({
|
|
2955
|
+
statusCode: _response.error.statusCode,
|
|
2956
|
+
body: _response.error.rawBody
|
|
2957
|
+
});
|
|
2958
|
+
case "timeout":
|
|
2959
|
+
throw new RivetTimeoutError(
|
|
2960
|
+
"Timeout exceeded when calling GET /namespaces/{namespace_id}/runner-configs."
|
|
2961
|
+
);
|
|
2962
|
+
case "unknown":
|
|
2963
|
+
throw new RivetError({
|
|
2964
|
+
message: _response.error.errorMessage
|
|
2965
|
+
});
|
|
2966
|
+
}
|
|
2967
|
+
}
|
|
2968
|
+
/**
|
|
2969
|
+
* @param {Rivet.RivetId} namespaceId
|
|
2970
|
+
* @param {string} runnerName
|
|
2971
|
+
* @param {NamespacesRunnerConfigs.RequestOptions} requestOptions - Request-specific configuration.
|
|
2972
|
+
*
|
|
2973
|
+
* @example
|
|
2974
|
+
* await client.namespacesRunnerConfigs.get("namespace_id", "runner_name")
|
|
2975
|
+
*/
|
|
2976
|
+
async get(namespaceId, runnerName, requestOptions) {
|
|
2977
|
+
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2978
|
+
url: (0, import_url_join3.default)(
|
|
2979
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2980
|
+
`namespaces/${encodeURIComponent(RivetId.jsonOrThrow(namespaceId))}/runner-configs/${encodeURIComponent(runnerName)}`
|
|
2981
|
+
),
|
|
2982
|
+
method: "GET",
|
|
2983
|
+
headers: {
|
|
2984
|
+
"X-Fern-Language": "JavaScript",
|
|
2985
|
+
"X-Fern-Runtime": RUNTIME.type,
|
|
2986
|
+
"X-Fern-Runtime-Version": RUNTIME.version,
|
|
2987
|
+
...requestOptions?.headers
|
|
2988
|
+
},
|
|
2989
|
+
contentType: "application/json",
|
|
2990
|
+
requestType: "json",
|
|
2991
|
+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
2992
|
+
maxRetries: requestOptions?.maxRetries,
|
|
2993
|
+
abortSignal: requestOptions?.abortSignal
|
|
2994
|
+
});
|
|
2995
|
+
if (_response.ok) {
|
|
2996
|
+
return NamespacesRunnerConfigsGetResponse.parseOrThrow(_response.body, {
|
|
2997
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2998
|
+
allowUnrecognizedUnionMembers: true,
|
|
2999
|
+
allowUnrecognizedEnumValues: true,
|
|
3000
|
+
skipValidation: true,
|
|
3001
|
+
breadcrumbsPrefix: ["response"]
|
|
3002
|
+
});
|
|
3003
|
+
}
|
|
3004
|
+
if (_response.error.reason === "status-code") {
|
|
3005
|
+
throw new RivetError({
|
|
3006
|
+
statusCode: _response.error.statusCode,
|
|
3007
|
+
body: _response.error.body
|
|
3008
|
+
});
|
|
3009
|
+
}
|
|
3010
|
+
switch (_response.error.reason) {
|
|
3011
|
+
case "non-json":
|
|
3012
|
+
throw new RivetError({
|
|
3013
|
+
statusCode: _response.error.statusCode,
|
|
3014
|
+
body: _response.error.rawBody
|
|
3015
|
+
});
|
|
3016
|
+
case "timeout":
|
|
3017
|
+
throw new RivetTimeoutError(
|
|
3018
|
+
"Timeout exceeded when calling GET /namespaces/{namespace_id}/runner-configs/{runner_name}."
|
|
3019
|
+
);
|
|
3020
|
+
case "unknown":
|
|
3021
|
+
throw new RivetError({
|
|
3022
|
+
message: _response.error.errorMessage
|
|
3023
|
+
});
|
|
3024
|
+
}
|
|
3025
|
+
}
|
|
3026
|
+
/**
|
|
3027
|
+
* @param {Rivet.RivetId} namespaceId
|
|
3028
|
+
* @param {string} runnerName
|
|
3029
|
+
* @param {Rivet.NamespacesRunnerConfigsUpsertRequest} request
|
|
3030
|
+
* @param {NamespacesRunnerConfigs.RequestOptions} requestOptions - Request-specific configuration.
|
|
3031
|
+
*
|
|
3032
|
+
* @example
|
|
3033
|
+
* await client.namespacesRunnerConfigs.upsert("namespace_id", "runner_name", {
|
|
3034
|
+
* serverless: {
|
|
3035
|
+
* maxRunners: 1,
|
|
3036
|
+
* minRunners: 1,
|
|
3037
|
+
* requestLifespan: 1,
|
|
3038
|
+
* runnersMargin: 1,
|
|
3039
|
+
* slotsPerRunner: 1,
|
|
3040
|
+
* url: "url"
|
|
3041
|
+
* }
|
|
3042
|
+
* })
|
|
3043
|
+
*/
|
|
3044
|
+
async upsert(namespaceId, runnerName, request, requestOptions) {
|
|
3045
|
+
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3046
|
+
url: (0, import_url_join3.default)(
|
|
3047
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3048
|
+
`namespaces/${encodeURIComponent(RivetId.jsonOrThrow(namespaceId))}/runner-configs/${encodeURIComponent(runnerName)}`
|
|
3049
|
+
),
|
|
3050
|
+
method: "PUT",
|
|
3051
|
+
headers: {
|
|
3052
|
+
"X-Fern-Language": "JavaScript",
|
|
3053
|
+
"X-Fern-Runtime": RUNTIME.type,
|
|
3054
|
+
"X-Fern-Runtime-Version": RUNTIME.version,
|
|
3055
|
+
...requestOptions?.headers
|
|
3056
|
+
},
|
|
3057
|
+
contentType: "application/json",
|
|
3058
|
+
requestType: "json",
|
|
3059
|
+
body: NamespacesRunnerConfigsUpsertRequest.jsonOrThrow(request, {
|
|
3060
|
+
unrecognizedObjectKeys: "strip"
|
|
3061
|
+
}),
|
|
3062
|
+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
3063
|
+
maxRetries: requestOptions?.maxRetries,
|
|
3064
|
+
abortSignal: requestOptions?.abortSignal
|
|
3065
|
+
});
|
|
3066
|
+
if (_response.ok) {
|
|
3067
|
+
return NamespacesRunnerConfigsUpsertResponse.parseOrThrow(_response.body, {
|
|
3068
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3069
|
+
allowUnrecognizedUnionMembers: true,
|
|
3070
|
+
allowUnrecognizedEnumValues: true,
|
|
3071
|
+
skipValidation: true,
|
|
3072
|
+
breadcrumbsPrefix: ["response"]
|
|
3073
|
+
});
|
|
3074
|
+
}
|
|
3075
|
+
if (_response.error.reason === "status-code") {
|
|
3076
|
+
throw new RivetError({
|
|
3077
|
+
statusCode: _response.error.statusCode,
|
|
3078
|
+
body: _response.error.body
|
|
3079
|
+
});
|
|
3080
|
+
}
|
|
3081
|
+
switch (_response.error.reason) {
|
|
3082
|
+
case "non-json":
|
|
3083
|
+
throw new RivetError({
|
|
3084
|
+
statusCode: _response.error.statusCode,
|
|
3085
|
+
body: _response.error.rawBody
|
|
3086
|
+
});
|
|
3087
|
+
case "timeout":
|
|
3088
|
+
throw new RivetTimeoutError(
|
|
3089
|
+
"Timeout exceeded when calling PUT /namespaces/{namespace_id}/runner-configs/{runner_name}."
|
|
3090
|
+
);
|
|
3091
|
+
case "unknown":
|
|
3092
|
+
throw new RivetError({
|
|
3093
|
+
message: _response.error.errorMessage
|
|
3094
|
+
});
|
|
3095
|
+
}
|
|
3096
|
+
}
|
|
3097
|
+
/**
|
|
3098
|
+
* @param {Rivet.RivetId} namespaceId
|
|
3099
|
+
* @param {string} runnerName
|
|
3100
|
+
* @param {NamespacesRunnerConfigs.RequestOptions} requestOptions - Request-specific configuration.
|
|
3101
|
+
*
|
|
3102
|
+
* @example
|
|
3103
|
+
* await client.namespacesRunnerConfigs.delete("namespace_id", "runner_name")
|
|
3104
|
+
*/
|
|
3105
|
+
async delete(namespaceId, runnerName, requestOptions) {
|
|
3106
|
+
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3107
|
+
url: (0, import_url_join3.default)(
|
|
3108
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3109
|
+
`namespaces/${encodeURIComponent(RivetId.jsonOrThrow(namespaceId))}/runner-configs/${encodeURIComponent(runnerName)}`
|
|
3110
|
+
),
|
|
3111
|
+
method: "DELETE",
|
|
3112
|
+
headers: {
|
|
3113
|
+
"X-Fern-Language": "JavaScript",
|
|
3114
|
+
"X-Fern-Runtime": RUNTIME.type,
|
|
3115
|
+
"X-Fern-Runtime-Version": RUNTIME.version,
|
|
3116
|
+
...requestOptions?.headers
|
|
3117
|
+
},
|
|
3118
|
+
contentType: "application/json",
|
|
3119
|
+
requestType: "json",
|
|
3120
|
+
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
3121
|
+
maxRetries: requestOptions?.maxRetries,
|
|
3122
|
+
abortSignal: requestOptions?.abortSignal
|
|
3123
|
+
});
|
|
3124
|
+
if (_response.ok) {
|
|
3125
|
+
return NamespacesRunnerConfigsDeleteResponse.parseOrThrow(_response.body, {
|
|
3126
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3127
|
+
allowUnrecognizedUnionMembers: true,
|
|
3128
|
+
allowUnrecognizedEnumValues: true,
|
|
3129
|
+
skipValidation: true,
|
|
3130
|
+
breadcrumbsPrefix: ["response"]
|
|
3131
|
+
});
|
|
3132
|
+
}
|
|
3133
|
+
if (_response.error.reason === "status-code") {
|
|
3134
|
+
throw new RivetError({
|
|
3135
|
+
statusCode: _response.error.statusCode,
|
|
3136
|
+
body: _response.error.body
|
|
3137
|
+
});
|
|
3138
|
+
}
|
|
3139
|
+
switch (_response.error.reason) {
|
|
3140
|
+
case "non-json":
|
|
3141
|
+
throw new RivetError({
|
|
3142
|
+
statusCode: _response.error.statusCode,
|
|
3143
|
+
body: _response.error.rawBody
|
|
3144
|
+
});
|
|
3145
|
+
case "timeout":
|
|
3146
|
+
throw new RivetTimeoutError(
|
|
3147
|
+
"Timeout exceeded when calling DELETE /namespaces/{namespace_id}/runner-configs/{runner_name}."
|
|
3148
|
+
);
|
|
3149
|
+
case "unknown":
|
|
3150
|
+
throw new RivetError({
|
|
3151
|
+
message: _response.error.errorMessage
|
|
3152
|
+
});
|
|
3153
|
+
}
|
|
3154
|
+
}
|
|
3155
|
+
};
|
|
3156
|
+
|
|
3157
|
+
// src/api/resources/runners/client/Client.ts
|
|
3158
|
+
var import_url_join4 = __toESM(require("url-join"));
|
|
2867
3159
|
var Runners = class {
|
|
2868
3160
|
constructor(_options) {
|
|
2869
3161
|
this._options = _options;
|
|
@@ -2894,7 +3186,7 @@ var Runners = class {
|
|
|
2894
3186
|
_queryParams["cursor"] = cursor;
|
|
2895
3187
|
}
|
|
2896
3188
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2897
|
-
url: (0,
|
|
3189
|
+
url: (0, import_url_join4.default)(
|
|
2898
3190
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2899
3191
|
"runners"
|
|
2900
3192
|
),
|
|
@@ -2966,7 +3258,7 @@ var Runners = class {
|
|
|
2966
3258
|
_queryParams["cursor"] = cursor;
|
|
2967
3259
|
}
|
|
2968
3260
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2969
|
-
url: (0,
|
|
3261
|
+
url: (0, import_url_join4.default)(
|
|
2970
3262
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2971
3263
|
"runners/names"
|
|
2972
3264
|
),
|
|
@@ -3028,7 +3320,7 @@ var Runners = class {
|
|
|
3028
3320
|
_queryParams["namespace"] = namespace;
|
|
3029
3321
|
}
|
|
3030
3322
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3031
|
-
url: (0,
|
|
3323
|
+
url: (0, import_url_join4.default)(
|
|
3032
3324
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3033
3325
|
`runners/${encodeURIComponent(RivetId.jsonOrThrow(runnerId))}`
|
|
3034
3326
|
),
|
|
@@ -3084,6 +3376,7 @@ var RivetClient = class {
|
|
|
3084
3376
|
}
|
|
3085
3377
|
_datacenters;
|
|
3086
3378
|
_namespaces;
|
|
3379
|
+
_namespacesRunnerConfigs;
|
|
3087
3380
|
_runners;
|
|
3088
3381
|
get datacenters() {
|
|
3089
3382
|
return this._datacenters ??= new Datacenters(this._options);
|
|
@@ -3091,6 +3384,9 @@ var RivetClient = class {
|
|
|
3091
3384
|
get namespaces() {
|
|
3092
3385
|
return this._namespaces ??= new Namespaces(this._options);
|
|
3093
3386
|
}
|
|
3387
|
+
get namespacesRunnerConfigs() {
|
|
3388
|
+
return this._namespacesRunnerConfigs ??= new NamespacesRunnerConfigs(this._options);
|
|
3389
|
+
}
|
|
3094
3390
|
get runners() {
|
|
3095
3391
|
return this._runners ??= new Runners(this._options);
|
|
3096
3392
|
}
|
|
@@ -3152,7 +3448,7 @@ var RivetClient = class {
|
|
|
3152
3448
|
_queryParams["cursor"] = cursor;
|
|
3153
3449
|
}
|
|
3154
3450
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3155
|
-
url: (0,
|
|
3451
|
+
url: (0, import_url_join5.default)(
|
|
3156
3452
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3157
3453
|
"actors"
|
|
3158
3454
|
),
|
|
@@ -3236,7 +3532,7 @@ var RivetClient = class {
|
|
|
3236
3532
|
_queryParams["datacenter"] = datacenter;
|
|
3237
3533
|
}
|
|
3238
3534
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3239
|
-
url: (0,
|
|
3535
|
+
url: (0, import_url_join5.default)(
|
|
3240
3536
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3241
3537
|
"actors"
|
|
3242
3538
|
),
|
|
@@ -3334,7 +3630,7 @@ var RivetClient = class {
|
|
|
3334
3630
|
_queryParams["datacenter"] = datacenter;
|
|
3335
3631
|
}
|
|
3336
3632
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3337
|
-
url: (0,
|
|
3633
|
+
url: (0, import_url_join5.default)(
|
|
3338
3634
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3339
3635
|
"actors"
|
|
3340
3636
|
),
|
|
@@ -3406,7 +3702,7 @@ var RivetClient = class {
|
|
|
3406
3702
|
_queryParams["name"] = name;
|
|
3407
3703
|
_queryParams["key"] = key;
|
|
3408
3704
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3409
|
-
url: (0,
|
|
3705
|
+
url: (0, import_url_join5.default)(
|
|
3410
3706
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3411
3707
|
"actors/by-id"
|
|
3412
3708
|
),
|
|
@@ -3495,7 +3791,7 @@ var RivetClient = class {
|
|
|
3495
3791
|
_queryParams["datacenter"] = datacenter;
|
|
3496
3792
|
}
|
|
3497
3793
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3498
|
-
url: (0,
|
|
3794
|
+
url: (0, import_url_join5.default)(
|
|
3499
3795
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3500
3796
|
"actors/by-id"
|
|
3501
3797
|
),
|
|
@@ -3568,7 +3864,7 @@ var RivetClient = class {
|
|
|
3568
3864
|
_queryParams["cursor"] = cursor;
|
|
3569
3865
|
}
|
|
3570
3866
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3571
|
-
url: (0,
|
|
3867
|
+
url: (0, import_url_join5.default)(
|
|
3572
3868
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3573
3869
|
"actors/names"
|
|
3574
3870
|
),
|
|
@@ -3635,7 +3931,7 @@ var RivetClient = class {
|
|
|
3635
3931
|
_queryParams["namespace"] = namespace;
|
|
3636
3932
|
}
|
|
3637
3933
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3638
|
-
url: (0,
|
|
3934
|
+
url: (0, import_url_join5.default)(
|
|
3639
3935
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3640
3936
|
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}`
|
|
3641
3937
|
),
|
|
@@ -3702,7 +3998,7 @@ var RivetClient = class {
|
|
|
3702
3998
|
_queryParams["namespace"] = namespace;
|
|
3703
3999
|
}
|
|
3704
4000
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3705
|
-
url: (0,
|
|
4001
|
+
url: (0, import_url_join5.default)(
|
|
3706
4002
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3707
4003
|
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}`
|
|
3708
4004
|
),
|
|
@@ -51,18 +51,20 @@ __export(serialization_exports, {
|
|
|
51
51
|
NamespacesCreateResponse: () => NamespacesCreateResponse,
|
|
52
52
|
NamespacesGetResponse: () => NamespacesGetResponse,
|
|
53
53
|
NamespacesListResponse: () => NamespacesListResponse,
|
|
54
|
+
NamespacesRunnerConfig: () => NamespacesRunnerConfig,
|
|
55
|
+
NamespacesRunnerConfigServerless: () => NamespacesRunnerConfigServerless,
|
|
56
|
+
NamespacesRunnerConfigVariant: () => NamespacesRunnerConfigVariant,
|
|
57
|
+
NamespacesRunnerConfigsDeleteResponse: () => NamespacesRunnerConfigsDeleteResponse,
|
|
58
|
+
NamespacesRunnerConfigsGetResponse: () => NamespacesRunnerConfigsGetResponse,
|
|
59
|
+
NamespacesRunnerConfigsListResponse: () => NamespacesRunnerConfigsListResponse,
|
|
60
|
+
NamespacesRunnerConfigsUpsertRequest: () => NamespacesRunnerConfigsUpsertRequest,
|
|
61
|
+
NamespacesRunnerConfigsUpsertResponse: () => NamespacesRunnerConfigsUpsertResponse,
|
|
54
62
|
Pagination: () => Pagination,
|
|
55
63
|
RivetId: () => RivetId,
|
|
56
64
|
Runner: () => Runner,
|
|
57
65
|
RunnersGetResponse: () => RunnersGetResponse,
|
|
58
66
|
RunnersListNamesResponse: () => RunnersListNamesResponse,
|
|
59
67
|
RunnersListResponse: () => RunnersListResponse,
|
|
60
|
-
StringHttpAddressHashableMap: () => StringHttpAddressHashableMap,
|
|
61
|
-
StringHttpAddressHashableMapValue: () => StringHttpAddressHashableMapValue,
|
|
62
|
-
StringTcpAddressHashableMap: () => StringTcpAddressHashableMap,
|
|
63
|
-
StringTcpAddressHashableMapValue: () => StringTcpAddressHashableMapValue,
|
|
64
|
-
StringUdpAddressHashableMap: () => StringUdpAddressHashableMap,
|
|
65
|
-
StringUdpAddressHashableMapValue: () => StringUdpAddressHashableMapValue,
|
|
66
68
|
namespaces: () => namespaces_exports
|
|
67
69
|
});
|
|
68
70
|
module.exports = __toCommonJS(serialization_exports);
|
|
@@ -1604,8 +1606,7 @@ var ActorsListResponse = schemas_exports.object({
|
|
|
1604
1606
|
// src/serialization/types/Datacenter.ts
|
|
1605
1607
|
var Datacenter = schemas_exports.object({
|
|
1606
1608
|
datacenterLabel: schemas_exports.property("datacenter_label", schemas_exports.number()),
|
|
1607
|
-
name: schemas_exports.string()
|
|
1608
|
-
url: schemas_exports.string()
|
|
1609
|
+
name: schemas_exports.string()
|
|
1609
1610
|
});
|
|
1610
1611
|
|
|
1611
1612
|
// src/serialization/types/DatacentersListResponse.ts
|
|
@@ -1638,38 +1639,49 @@ var NamespacesListResponse = schemas_exports.object({
|
|
|
1638
1639
|
pagination: Pagination
|
|
1639
1640
|
});
|
|
1640
1641
|
|
|
1641
|
-
// src/serialization/types/
|
|
1642
|
-
var
|
|
1643
|
-
|
|
1644
|
-
|
|
1642
|
+
// src/serialization/types/NamespacesRunnerConfigServerless.ts
|
|
1643
|
+
var NamespacesRunnerConfigServerless = schemas_exports.object({
|
|
1644
|
+
maxRunners: schemas_exports.property("max_runners", schemas_exports.number()),
|
|
1645
|
+
minRunners: schemas_exports.property("min_runners", schemas_exports.number()),
|
|
1646
|
+
requestLifespan: schemas_exports.property("request_lifespan", schemas_exports.number()),
|
|
1647
|
+
runnersMargin: schemas_exports.property("runners_margin", schemas_exports.number()),
|
|
1648
|
+
slotsPerRunner: schemas_exports.property("slots_per_runner", schemas_exports.number()),
|
|
1649
|
+
url: schemas_exports.string()
|
|
1645
1650
|
});
|
|
1646
1651
|
|
|
1647
|
-
// src/serialization/types/
|
|
1648
|
-
var
|
|
1649
|
-
|
|
1650
|
-
// src/serialization/types/StringTcpAddressHashableMapValue.ts
|
|
1651
|
-
var StringTcpAddressHashableMapValue = schemas_exports.object({
|
|
1652
|
-
hostname: schemas_exports.string(),
|
|
1653
|
-
port: schemas_exports.number()
|
|
1652
|
+
// src/serialization/types/NamespacesRunnerConfig.ts
|
|
1653
|
+
var NamespacesRunnerConfig = schemas_exports.object({
|
|
1654
|
+
serverless: NamespacesRunnerConfigServerless
|
|
1654
1655
|
});
|
|
1655
1656
|
|
|
1656
|
-
// src/serialization/types/
|
|
1657
|
-
var
|
|
1657
|
+
// src/serialization/types/NamespacesRunnerConfigVariant.ts
|
|
1658
|
+
var NamespacesRunnerConfigVariant = schemas_exports.stringLiteral("serverless");
|
|
1658
1659
|
|
|
1659
|
-
// src/serialization/types/
|
|
1660
|
-
var
|
|
1661
|
-
|
|
1662
|
-
|
|
1660
|
+
// src/serialization/types/NamespacesRunnerConfigsDeleteResponse.ts
|
|
1661
|
+
var NamespacesRunnerConfigsDeleteResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
1662
|
+
|
|
1663
|
+
// src/serialization/types/NamespacesRunnerConfigsGetResponse.ts
|
|
1664
|
+
var NamespacesRunnerConfigsGetResponse = schemas_exports.object({
|
|
1665
|
+
runnerConfig: schemas_exports.property("runner_config", NamespacesRunnerConfig)
|
|
1663
1666
|
});
|
|
1664
1667
|
|
|
1665
|
-
// src/serialization/types/
|
|
1666
|
-
var
|
|
1668
|
+
// src/serialization/types/NamespacesRunnerConfigsListResponse.ts
|
|
1669
|
+
var NamespacesRunnerConfigsListResponse = schemas_exports.object({
|
|
1670
|
+
pagination: Pagination,
|
|
1671
|
+
runnerConfigs: schemas_exports.property(
|
|
1672
|
+
"runner_configs",
|
|
1673
|
+
schemas_exports.record(schemas_exports.string(), NamespacesRunnerConfig)
|
|
1674
|
+
)
|
|
1675
|
+
});
|
|
1676
|
+
|
|
1677
|
+
// src/serialization/types/NamespacesRunnerConfigsUpsertRequest.ts
|
|
1678
|
+
var NamespacesRunnerConfigsUpsertRequest = NamespacesRunnerConfig;
|
|
1679
|
+
|
|
1680
|
+
// src/serialization/types/NamespacesRunnerConfigsUpsertResponse.ts
|
|
1681
|
+
var NamespacesRunnerConfigsUpsertResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
1667
1682
|
|
|
1668
1683
|
// src/serialization/types/Runner.ts
|
|
1669
1684
|
var Runner = schemas_exports.object({
|
|
1670
|
-
addressesHttp: schemas_exports.property("addresses_http", StringHttpAddressHashableMap),
|
|
1671
|
-
addressesTcp: schemas_exports.property("addresses_tcp", StringTcpAddressHashableMap),
|
|
1672
|
-
addressesUdp: schemas_exports.property("addresses_udp", StringUdpAddressHashableMap),
|
|
1673
1685
|
createTs: schemas_exports.property("create_ts", schemas_exports.number()),
|
|
1674
1686
|
datacenter: schemas_exports.string(),
|
|
1675
1687
|
drainTs: schemas_exports.property("drain_ts", schemas_exports.number().optional()),
|