@rivetkit/engine-api-full 25.6.1 → 25.7.2-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/LICENSE +203 -0
- 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 +7 -8
- 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
package/dist/node/index.js
CHANGED
|
@@ -587,6 +587,7 @@ __export(api_exports, {
|
|
|
587
587
|
CrashPolicy: () => CrashPolicy,
|
|
588
588
|
datacenters: () => datacenters_exports,
|
|
589
589
|
namespaces: () => namespaces_exports,
|
|
590
|
+
namespacesRunnerConfigs: () => namespacesRunnerConfigs_exports,
|
|
590
591
|
runners: () => runners_exports
|
|
591
592
|
});
|
|
592
593
|
|
|
@@ -603,6 +604,9 @@ var datacenters_exports = {};
|
|
|
603
604
|
// src/api/resources/namespaces/index.ts
|
|
604
605
|
var namespaces_exports = {};
|
|
605
606
|
|
|
607
|
+
// src/api/resources/namespacesRunnerConfigs/index.ts
|
|
608
|
+
var namespacesRunnerConfigs_exports = {};
|
|
609
|
+
|
|
606
610
|
// src/api/resources/runners/index.ts
|
|
607
611
|
var runners_exports = {};
|
|
608
612
|
|
|
@@ -2317,7 +2321,7 @@ function transformAndValidateUnion({
|
|
|
2317
2321
|
}
|
|
2318
2322
|
|
|
2319
2323
|
// src/Client.ts
|
|
2320
|
-
var
|
|
2324
|
+
var import_url_join5 = __toESM(require("url-join"));
|
|
2321
2325
|
|
|
2322
2326
|
// src/serialization/index.ts
|
|
2323
2327
|
var serialization_exports = {};
|
|
@@ -2343,18 +2347,20 @@ __export(serialization_exports, {
|
|
|
2343
2347
|
NamespacesCreateResponse: () => NamespacesCreateResponse,
|
|
2344
2348
|
NamespacesGetResponse: () => NamespacesGetResponse,
|
|
2345
2349
|
NamespacesListResponse: () => NamespacesListResponse,
|
|
2350
|
+
NamespacesRunnerConfig: () => NamespacesRunnerConfig,
|
|
2351
|
+
NamespacesRunnerConfigServerless: () => NamespacesRunnerConfigServerless,
|
|
2352
|
+
NamespacesRunnerConfigVariant: () => NamespacesRunnerConfigVariant,
|
|
2353
|
+
NamespacesRunnerConfigsDeleteResponse: () => NamespacesRunnerConfigsDeleteResponse,
|
|
2354
|
+
NamespacesRunnerConfigsGetResponse: () => NamespacesRunnerConfigsGetResponse,
|
|
2355
|
+
NamespacesRunnerConfigsListResponse: () => NamespacesRunnerConfigsListResponse,
|
|
2356
|
+
NamespacesRunnerConfigsUpsertRequest: () => NamespacesRunnerConfigsUpsertRequest,
|
|
2357
|
+
NamespacesRunnerConfigsUpsertResponse: () => NamespacesRunnerConfigsUpsertResponse,
|
|
2346
2358
|
Pagination: () => Pagination,
|
|
2347
2359
|
RivetId: () => RivetId,
|
|
2348
2360
|
Runner: () => Runner,
|
|
2349
2361
|
RunnersGetResponse: () => RunnersGetResponse,
|
|
2350
2362
|
RunnersListNamesResponse: () => RunnersListNamesResponse,
|
|
2351
2363
|
RunnersListResponse: () => RunnersListResponse,
|
|
2352
|
-
StringHttpAddressHashableMap: () => StringHttpAddressHashableMap,
|
|
2353
|
-
StringHttpAddressHashableMapValue: () => StringHttpAddressHashableMapValue,
|
|
2354
|
-
StringTcpAddressHashableMap: () => StringTcpAddressHashableMap,
|
|
2355
|
-
StringTcpAddressHashableMapValue: () => StringTcpAddressHashableMapValue,
|
|
2356
|
-
StringUdpAddressHashableMap: () => StringUdpAddressHashableMap,
|
|
2357
|
-
StringUdpAddressHashableMapValue: () => StringUdpAddressHashableMapValue,
|
|
2358
2364
|
namespaces: () => namespaces_exports2
|
|
2359
2365
|
});
|
|
2360
2366
|
|
|
@@ -2436,8 +2442,7 @@ var ActorsListResponse = schemas_exports.object({
|
|
|
2436
2442
|
// src/serialization/types/Datacenter.ts
|
|
2437
2443
|
var Datacenter = schemas_exports.object({
|
|
2438
2444
|
datacenterLabel: schemas_exports.property("datacenter_label", schemas_exports.number()),
|
|
2439
|
-
name: schemas_exports.string()
|
|
2440
|
-
url: schemas_exports.string()
|
|
2445
|
+
name: schemas_exports.string()
|
|
2441
2446
|
});
|
|
2442
2447
|
|
|
2443
2448
|
// src/serialization/types/DatacentersListResponse.ts
|
|
@@ -2470,38 +2475,49 @@ var NamespacesListResponse = schemas_exports.object({
|
|
|
2470
2475
|
pagination: Pagination
|
|
2471
2476
|
});
|
|
2472
2477
|
|
|
2473
|
-
// src/serialization/types/
|
|
2474
|
-
var
|
|
2475
|
-
|
|
2476
|
-
|
|
2478
|
+
// src/serialization/types/NamespacesRunnerConfigServerless.ts
|
|
2479
|
+
var NamespacesRunnerConfigServerless = schemas_exports.object({
|
|
2480
|
+
maxRunners: schemas_exports.property("max_runners", schemas_exports.number()),
|
|
2481
|
+
minRunners: schemas_exports.property("min_runners", schemas_exports.number()),
|
|
2482
|
+
requestLifespan: schemas_exports.property("request_lifespan", schemas_exports.number()),
|
|
2483
|
+
runnersMargin: schemas_exports.property("runners_margin", schemas_exports.number()),
|
|
2484
|
+
slotsPerRunner: schemas_exports.property("slots_per_runner", schemas_exports.number()),
|
|
2485
|
+
url: schemas_exports.string()
|
|
2477
2486
|
});
|
|
2478
2487
|
|
|
2479
|
-
// src/serialization/types/
|
|
2480
|
-
var
|
|
2481
|
-
|
|
2482
|
-
// src/serialization/types/StringTcpAddressHashableMapValue.ts
|
|
2483
|
-
var StringTcpAddressHashableMapValue = schemas_exports.object({
|
|
2484
|
-
hostname: schemas_exports.string(),
|
|
2485
|
-
port: schemas_exports.number()
|
|
2488
|
+
// src/serialization/types/NamespacesRunnerConfig.ts
|
|
2489
|
+
var NamespacesRunnerConfig = schemas_exports.object({
|
|
2490
|
+
serverless: NamespacesRunnerConfigServerless
|
|
2486
2491
|
});
|
|
2487
2492
|
|
|
2488
|
-
// src/serialization/types/
|
|
2489
|
-
var
|
|
2493
|
+
// src/serialization/types/NamespacesRunnerConfigVariant.ts
|
|
2494
|
+
var NamespacesRunnerConfigVariant = schemas_exports.stringLiteral("serverless");
|
|
2495
|
+
|
|
2496
|
+
// src/serialization/types/NamespacesRunnerConfigsDeleteResponse.ts
|
|
2497
|
+
var NamespacesRunnerConfigsDeleteResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2490
2498
|
|
|
2491
|
-
// src/serialization/types/
|
|
2492
|
-
var
|
|
2493
|
-
|
|
2494
|
-
port: schemas_exports.number()
|
|
2499
|
+
// src/serialization/types/NamespacesRunnerConfigsGetResponse.ts
|
|
2500
|
+
var NamespacesRunnerConfigsGetResponse = schemas_exports.object({
|
|
2501
|
+
runnerConfig: schemas_exports.property("runner_config", NamespacesRunnerConfig)
|
|
2495
2502
|
});
|
|
2496
2503
|
|
|
2497
|
-
// src/serialization/types/
|
|
2498
|
-
var
|
|
2504
|
+
// src/serialization/types/NamespacesRunnerConfigsListResponse.ts
|
|
2505
|
+
var NamespacesRunnerConfigsListResponse = schemas_exports.object({
|
|
2506
|
+
pagination: Pagination,
|
|
2507
|
+
runnerConfigs: schemas_exports.property(
|
|
2508
|
+
"runner_configs",
|
|
2509
|
+
schemas_exports.record(schemas_exports.string(), NamespacesRunnerConfig)
|
|
2510
|
+
)
|
|
2511
|
+
});
|
|
2512
|
+
|
|
2513
|
+
// src/serialization/types/NamespacesRunnerConfigsUpsertRequest.ts
|
|
2514
|
+
var NamespacesRunnerConfigsUpsertRequest = NamespacesRunnerConfig;
|
|
2515
|
+
|
|
2516
|
+
// src/serialization/types/NamespacesRunnerConfigsUpsertResponse.ts
|
|
2517
|
+
var NamespacesRunnerConfigsUpsertResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2499
2518
|
|
|
2500
2519
|
// src/serialization/types/Runner.ts
|
|
2501
2520
|
var Runner = schemas_exports.object({
|
|
2502
|
-
addressesHttp: schemas_exports.property("addresses_http", StringHttpAddressHashableMap),
|
|
2503
|
-
addressesTcp: schemas_exports.property("addresses_tcp", StringTcpAddressHashableMap),
|
|
2504
|
-
addressesUdp: schemas_exports.property("addresses_udp", StringUdpAddressHashableMap),
|
|
2505
2521
|
createTs: schemas_exports.property("create_ts", schemas_exports.number()),
|
|
2506
2522
|
datacenter: schemas_exports.string(),
|
|
2507
2523
|
drainTs: schemas_exports.property("drain_ts", schemas_exports.number().optional()),
|
|
@@ -2692,7 +2708,7 @@ var Namespaces = class {
|
|
|
2692
2708
|
* await client.namespaces.list()
|
|
2693
2709
|
*/
|
|
2694
2710
|
async list(request = {}, requestOptions) {
|
|
2695
|
-
const { limit, cursor, name } = request;
|
|
2711
|
+
const { limit, cursor, name, namespaceId } = request;
|
|
2696
2712
|
const _queryParams = {};
|
|
2697
2713
|
if (limit != null) {
|
|
2698
2714
|
_queryParams["limit"] = limit.toString();
|
|
@@ -2703,6 +2719,15 @@ var Namespaces = class {
|
|
|
2703
2719
|
if (name != null) {
|
|
2704
2720
|
_queryParams["name"] = name;
|
|
2705
2721
|
}
|
|
2722
|
+
if (namespaceId != null) {
|
|
2723
|
+
if (Array.isArray(namespaceId)) {
|
|
2724
|
+
_queryParams["namespace_id"] = namespaceId.map(
|
|
2725
|
+
(item) => RivetId.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" })
|
|
2726
|
+
);
|
|
2727
|
+
} else {
|
|
2728
|
+
_queryParams["namespace_id"] = namespaceId;
|
|
2729
|
+
}
|
|
2730
|
+
}
|
|
2706
2731
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2707
2732
|
url: (0, import_url_join2.default)(
|
|
2708
2733
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
@@ -2867,8 +2892,275 @@ var Namespaces = class {
|
|
|
2867
2892
|
}
|
|
2868
2893
|
};
|
|
2869
2894
|
|
|
2870
|
-
// src/api/resources/
|
|
2895
|
+
// src/api/resources/namespacesRunnerConfigs/client/Client.ts
|
|
2871
2896
|
var import_url_join3 = __toESM(require("url-join"));
|
|
2897
|
+
var NamespacesRunnerConfigs = class {
|
|
2898
|
+
constructor(_options) {
|
|
2899
|
+
this._options = _options;
|
|
2900
|
+
}
|
|
2901
|
+
/**
|
|
2902
|
+
* @param {Rivet.RivetId} namespaceId
|
|
2903
|
+
* @param {Rivet.NamespacesRunnerConfigsListRequest} request
|
|
2904
|
+
* @param {NamespacesRunnerConfigs.RequestOptions} requestOptions - Request-specific configuration.
|
|
2905
|
+
*
|
|
2906
|
+
* @example
|
|
2907
|
+
* await client.namespacesRunnerConfigs.list("namespace_id")
|
|
2908
|
+
*/
|
|
2909
|
+
async list(namespaceId, request = {}, requestOptions) {
|
|
2910
|
+
const { limit, cursor, variant } = request;
|
|
2911
|
+
const _queryParams = {};
|
|
2912
|
+
if (limit != null) {
|
|
2913
|
+
_queryParams["limit"] = limit.toString();
|
|
2914
|
+
}
|
|
2915
|
+
if (cursor != null) {
|
|
2916
|
+
_queryParams["cursor"] = cursor;
|
|
2917
|
+
}
|
|
2918
|
+
if (variant != null) {
|
|
2919
|
+
_queryParams["variant"] = NamespacesRunnerConfigVariant.jsonOrThrow(variant, {
|
|
2920
|
+
unrecognizedObjectKeys: "strip"
|
|
2921
|
+
});
|
|
2922
|
+
}
|
|
2923
|
+
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2924
|
+
url: (0, import_url_join3.default)(
|
|
2925
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2926
|
+
`namespaces/${encodeURIComponent(RivetId.jsonOrThrow(namespaceId))}/runner-configs`
|
|
2927
|
+
),
|
|
2928
|
+
method: "GET",
|
|
2929
|
+
headers: {
|
|
2930
|
+
"X-Fern-Language": "JavaScript",
|
|
2931
|
+
"X-Fern-Runtime": RUNTIME.type,
|
|
2932
|
+
"X-Fern-Runtime-Version": RUNTIME.version,
|
|
2933
|
+
...requestOptions == null ? void 0 : requestOptions.headers
|
|
2934
|
+
},
|
|
2935
|
+
contentType: "application/json",
|
|
2936
|
+
queryParameters: _queryParams,
|
|
2937
|
+
requestType: "json",
|
|
2938
|
+
timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
2939
|
+
maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries,
|
|
2940
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal
|
|
2941
|
+
});
|
|
2942
|
+
if (_response.ok) {
|
|
2943
|
+
return NamespacesRunnerConfigsListResponse.parseOrThrow(_response.body, {
|
|
2944
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2945
|
+
allowUnrecognizedUnionMembers: true,
|
|
2946
|
+
allowUnrecognizedEnumValues: true,
|
|
2947
|
+
skipValidation: true,
|
|
2948
|
+
breadcrumbsPrefix: ["response"]
|
|
2949
|
+
});
|
|
2950
|
+
}
|
|
2951
|
+
if (_response.error.reason === "status-code") {
|
|
2952
|
+
throw new RivetError({
|
|
2953
|
+
statusCode: _response.error.statusCode,
|
|
2954
|
+
body: _response.error.body
|
|
2955
|
+
});
|
|
2956
|
+
}
|
|
2957
|
+
switch (_response.error.reason) {
|
|
2958
|
+
case "non-json":
|
|
2959
|
+
throw new RivetError({
|
|
2960
|
+
statusCode: _response.error.statusCode,
|
|
2961
|
+
body: _response.error.rawBody
|
|
2962
|
+
});
|
|
2963
|
+
case "timeout":
|
|
2964
|
+
throw new RivetTimeoutError(
|
|
2965
|
+
"Timeout exceeded when calling GET /namespaces/{namespace_id}/runner-configs."
|
|
2966
|
+
);
|
|
2967
|
+
case "unknown":
|
|
2968
|
+
throw new RivetError({
|
|
2969
|
+
message: _response.error.errorMessage
|
|
2970
|
+
});
|
|
2971
|
+
}
|
|
2972
|
+
}
|
|
2973
|
+
/**
|
|
2974
|
+
* @param {Rivet.RivetId} namespaceId
|
|
2975
|
+
* @param {string} runnerName
|
|
2976
|
+
* @param {NamespacesRunnerConfigs.RequestOptions} requestOptions - Request-specific configuration.
|
|
2977
|
+
*
|
|
2978
|
+
* @example
|
|
2979
|
+
* await client.namespacesRunnerConfigs.get("namespace_id", "runner_name")
|
|
2980
|
+
*/
|
|
2981
|
+
async get(namespaceId, runnerName, requestOptions) {
|
|
2982
|
+
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2983
|
+
url: (0, import_url_join3.default)(
|
|
2984
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2985
|
+
`namespaces/${encodeURIComponent(RivetId.jsonOrThrow(namespaceId))}/runner-configs/${encodeURIComponent(runnerName)}`
|
|
2986
|
+
),
|
|
2987
|
+
method: "GET",
|
|
2988
|
+
headers: {
|
|
2989
|
+
"X-Fern-Language": "JavaScript",
|
|
2990
|
+
"X-Fern-Runtime": RUNTIME.type,
|
|
2991
|
+
"X-Fern-Runtime-Version": RUNTIME.version,
|
|
2992
|
+
...requestOptions == null ? void 0 : requestOptions.headers
|
|
2993
|
+
},
|
|
2994
|
+
contentType: "application/json",
|
|
2995
|
+
requestType: "json",
|
|
2996
|
+
timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
2997
|
+
maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries,
|
|
2998
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal
|
|
2999
|
+
});
|
|
3000
|
+
if (_response.ok) {
|
|
3001
|
+
return NamespacesRunnerConfigsGetResponse.parseOrThrow(_response.body, {
|
|
3002
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3003
|
+
allowUnrecognizedUnionMembers: true,
|
|
3004
|
+
allowUnrecognizedEnumValues: true,
|
|
3005
|
+
skipValidation: true,
|
|
3006
|
+
breadcrumbsPrefix: ["response"]
|
|
3007
|
+
});
|
|
3008
|
+
}
|
|
3009
|
+
if (_response.error.reason === "status-code") {
|
|
3010
|
+
throw new RivetError({
|
|
3011
|
+
statusCode: _response.error.statusCode,
|
|
3012
|
+
body: _response.error.body
|
|
3013
|
+
});
|
|
3014
|
+
}
|
|
3015
|
+
switch (_response.error.reason) {
|
|
3016
|
+
case "non-json":
|
|
3017
|
+
throw new RivetError({
|
|
3018
|
+
statusCode: _response.error.statusCode,
|
|
3019
|
+
body: _response.error.rawBody
|
|
3020
|
+
});
|
|
3021
|
+
case "timeout":
|
|
3022
|
+
throw new RivetTimeoutError(
|
|
3023
|
+
"Timeout exceeded when calling GET /namespaces/{namespace_id}/runner-configs/{runner_name}."
|
|
3024
|
+
);
|
|
3025
|
+
case "unknown":
|
|
3026
|
+
throw new RivetError({
|
|
3027
|
+
message: _response.error.errorMessage
|
|
3028
|
+
});
|
|
3029
|
+
}
|
|
3030
|
+
}
|
|
3031
|
+
/**
|
|
3032
|
+
* @param {Rivet.RivetId} namespaceId
|
|
3033
|
+
* @param {string} runnerName
|
|
3034
|
+
* @param {Rivet.NamespacesRunnerConfigsUpsertRequest} request
|
|
3035
|
+
* @param {NamespacesRunnerConfigs.RequestOptions} requestOptions - Request-specific configuration.
|
|
3036
|
+
*
|
|
3037
|
+
* @example
|
|
3038
|
+
* await client.namespacesRunnerConfigs.upsert("namespace_id", "runner_name", {
|
|
3039
|
+
* serverless: {
|
|
3040
|
+
* maxRunners: 1,
|
|
3041
|
+
* minRunners: 1,
|
|
3042
|
+
* requestLifespan: 1,
|
|
3043
|
+
* runnersMargin: 1,
|
|
3044
|
+
* slotsPerRunner: 1,
|
|
3045
|
+
* url: "url"
|
|
3046
|
+
* }
|
|
3047
|
+
* })
|
|
3048
|
+
*/
|
|
3049
|
+
async upsert(namespaceId, runnerName, request, requestOptions) {
|
|
3050
|
+
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3051
|
+
url: (0, import_url_join3.default)(
|
|
3052
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3053
|
+
`namespaces/${encodeURIComponent(RivetId.jsonOrThrow(namespaceId))}/runner-configs/${encodeURIComponent(runnerName)}`
|
|
3054
|
+
),
|
|
3055
|
+
method: "PUT",
|
|
3056
|
+
headers: {
|
|
3057
|
+
"X-Fern-Language": "JavaScript",
|
|
3058
|
+
"X-Fern-Runtime": RUNTIME.type,
|
|
3059
|
+
"X-Fern-Runtime-Version": RUNTIME.version,
|
|
3060
|
+
...requestOptions == null ? void 0 : requestOptions.headers
|
|
3061
|
+
},
|
|
3062
|
+
contentType: "application/json",
|
|
3063
|
+
requestType: "json",
|
|
3064
|
+
body: NamespacesRunnerConfigsUpsertRequest.jsonOrThrow(request, {
|
|
3065
|
+
unrecognizedObjectKeys: "strip"
|
|
3066
|
+
}),
|
|
3067
|
+
timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
3068
|
+
maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries,
|
|
3069
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal
|
|
3070
|
+
});
|
|
3071
|
+
if (_response.ok) {
|
|
3072
|
+
return NamespacesRunnerConfigsUpsertResponse.parseOrThrow(_response.body, {
|
|
3073
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3074
|
+
allowUnrecognizedUnionMembers: true,
|
|
3075
|
+
allowUnrecognizedEnumValues: true,
|
|
3076
|
+
skipValidation: true,
|
|
3077
|
+
breadcrumbsPrefix: ["response"]
|
|
3078
|
+
});
|
|
3079
|
+
}
|
|
3080
|
+
if (_response.error.reason === "status-code") {
|
|
3081
|
+
throw new RivetError({
|
|
3082
|
+
statusCode: _response.error.statusCode,
|
|
3083
|
+
body: _response.error.body
|
|
3084
|
+
});
|
|
3085
|
+
}
|
|
3086
|
+
switch (_response.error.reason) {
|
|
3087
|
+
case "non-json":
|
|
3088
|
+
throw new RivetError({
|
|
3089
|
+
statusCode: _response.error.statusCode,
|
|
3090
|
+
body: _response.error.rawBody
|
|
3091
|
+
});
|
|
3092
|
+
case "timeout":
|
|
3093
|
+
throw new RivetTimeoutError(
|
|
3094
|
+
"Timeout exceeded when calling PUT /namespaces/{namespace_id}/runner-configs/{runner_name}."
|
|
3095
|
+
);
|
|
3096
|
+
case "unknown":
|
|
3097
|
+
throw new RivetError({
|
|
3098
|
+
message: _response.error.errorMessage
|
|
3099
|
+
});
|
|
3100
|
+
}
|
|
3101
|
+
}
|
|
3102
|
+
/**
|
|
3103
|
+
* @param {Rivet.RivetId} namespaceId
|
|
3104
|
+
* @param {string} runnerName
|
|
3105
|
+
* @param {NamespacesRunnerConfigs.RequestOptions} requestOptions - Request-specific configuration.
|
|
3106
|
+
*
|
|
3107
|
+
* @example
|
|
3108
|
+
* await client.namespacesRunnerConfigs.delete("namespace_id", "runner_name")
|
|
3109
|
+
*/
|
|
3110
|
+
async delete(namespaceId, runnerName, requestOptions) {
|
|
3111
|
+
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3112
|
+
url: (0, import_url_join3.default)(
|
|
3113
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3114
|
+
`namespaces/${encodeURIComponent(RivetId.jsonOrThrow(namespaceId))}/runner-configs/${encodeURIComponent(runnerName)}`
|
|
3115
|
+
),
|
|
3116
|
+
method: "DELETE",
|
|
3117
|
+
headers: {
|
|
3118
|
+
"X-Fern-Language": "JavaScript",
|
|
3119
|
+
"X-Fern-Runtime": RUNTIME.type,
|
|
3120
|
+
"X-Fern-Runtime-Version": RUNTIME.version,
|
|
3121
|
+
...requestOptions == null ? void 0 : requestOptions.headers
|
|
3122
|
+
},
|
|
3123
|
+
contentType: "application/json",
|
|
3124
|
+
requestType: "json",
|
|
3125
|
+
timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
3126
|
+
maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries,
|
|
3127
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal
|
|
3128
|
+
});
|
|
3129
|
+
if (_response.ok) {
|
|
3130
|
+
return NamespacesRunnerConfigsDeleteResponse.parseOrThrow(_response.body, {
|
|
3131
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3132
|
+
allowUnrecognizedUnionMembers: true,
|
|
3133
|
+
allowUnrecognizedEnumValues: true,
|
|
3134
|
+
skipValidation: true,
|
|
3135
|
+
breadcrumbsPrefix: ["response"]
|
|
3136
|
+
});
|
|
3137
|
+
}
|
|
3138
|
+
if (_response.error.reason === "status-code") {
|
|
3139
|
+
throw new RivetError({
|
|
3140
|
+
statusCode: _response.error.statusCode,
|
|
3141
|
+
body: _response.error.body
|
|
3142
|
+
});
|
|
3143
|
+
}
|
|
3144
|
+
switch (_response.error.reason) {
|
|
3145
|
+
case "non-json":
|
|
3146
|
+
throw new RivetError({
|
|
3147
|
+
statusCode: _response.error.statusCode,
|
|
3148
|
+
body: _response.error.rawBody
|
|
3149
|
+
});
|
|
3150
|
+
case "timeout":
|
|
3151
|
+
throw new RivetTimeoutError(
|
|
3152
|
+
"Timeout exceeded when calling DELETE /namespaces/{namespace_id}/runner-configs/{runner_name}."
|
|
3153
|
+
);
|
|
3154
|
+
case "unknown":
|
|
3155
|
+
throw new RivetError({
|
|
3156
|
+
message: _response.error.errorMessage
|
|
3157
|
+
});
|
|
3158
|
+
}
|
|
3159
|
+
}
|
|
3160
|
+
};
|
|
3161
|
+
|
|
3162
|
+
// src/api/resources/runners/client/Client.ts
|
|
3163
|
+
var import_url_join4 = __toESM(require("url-join"));
|
|
2872
3164
|
var Runners = class {
|
|
2873
3165
|
constructor(_options) {
|
|
2874
3166
|
this._options = _options;
|
|
@@ -2899,7 +3191,7 @@ var Runners = class {
|
|
|
2899
3191
|
_queryParams["cursor"] = cursor;
|
|
2900
3192
|
}
|
|
2901
3193
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2902
|
-
url: (0,
|
|
3194
|
+
url: (0, import_url_join4.default)(
|
|
2903
3195
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2904
3196
|
"runners"
|
|
2905
3197
|
),
|
|
@@ -2971,7 +3263,7 @@ var Runners = class {
|
|
|
2971
3263
|
_queryParams["cursor"] = cursor;
|
|
2972
3264
|
}
|
|
2973
3265
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2974
|
-
url: (0,
|
|
3266
|
+
url: (0, import_url_join4.default)(
|
|
2975
3267
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2976
3268
|
"runners/names"
|
|
2977
3269
|
),
|
|
@@ -3033,7 +3325,7 @@ var Runners = class {
|
|
|
3033
3325
|
_queryParams["namespace"] = namespace;
|
|
3034
3326
|
}
|
|
3035
3327
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3036
|
-
url: (0,
|
|
3328
|
+
url: (0, import_url_join4.default)(
|
|
3037
3329
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3038
3330
|
`runners/${encodeURIComponent(RivetId.jsonOrThrow(runnerId))}`
|
|
3039
3331
|
),
|
|
@@ -3089,6 +3381,7 @@ var RivetClient = class {
|
|
|
3089
3381
|
}
|
|
3090
3382
|
_datacenters;
|
|
3091
3383
|
_namespaces;
|
|
3384
|
+
_namespacesRunnerConfigs;
|
|
3092
3385
|
_runners;
|
|
3093
3386
|
get datacenters() {
|
|
3094
3387
|
return this._datacenters ?? (this._datacenters = new Datacenters(this._options));
|
|
@@ -3096,6 +3389,9 @@ var RivetClient = class {
|
|
|
3096
3389
|
get namespaces() {
|
|
3097
3390
|
return this._namespaces ?? (this._namespaces = new Namespaces(this._options));
|
|
3098
3391
|
}
|
|
3392
|
+
get namespacesRunnerConfigs() {
|
|
3393
|
+
return this._namespacesRunnerConfigs ?? (this._namespacesRunnerConfigs = new NamespacesRunnerConfigs(this._options));
|
|
3394
|
+
}
|
|
3099
3395
|
get runners() {
|
|
3100
3396
|
return this._runners ?? (this._runners = new Runners(this._options));
|
|
3101
3397
|
}
|
|
@@ -3157,7 +3453,7 @@ var RivetClient = class {
|
|
|
3157
3453
|
_queryParams["cursor"] = cursor;
|
|
3158
3454
|
}
|
|
3159
3455
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3160
|
-
url: (0,
|
|
3456
|
+
url: (0, import_url_join5.default)(
|
|
3161
3457
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3162
3458
|
"actors"
|
|
3163
3459
|
),
|
|
@@ -3241,7 +3537,7 @@ var RivetClient = class {
|
|
|
3241
3537
|
_queryParams["datacenter"] = datacenter;
|
|
3242
3538
|
}
|
|
3243
3539
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3244
|
-
url: (0,
|
|
3540
|
+
url: (0, import_url_join5.default)(
|
|
3245
3541
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3246
3542
|
"actors"
|
|
3247
3543
|
),
|
|
@@ -3339,7 +3635,7 @@ var RivetClient = class {
|
|
|
3339
3635
|
_queryParams["datacenter"] = datacenter;
|
|
3340
3636
|
}
|
|
3341
3637
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3342
|
-
url: (0,
|
|
3638
|
+
url: (0, import_url_join5.default)(
|
|
3343
3639
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3344
3640
|
"actors"
|
|
3345
3641
|
),
|
|
@@ -3411,7 +3707,7 @@ var RivetClient = class {
|
|
|
3411
3707
|
_queryParams["name"] = name;
|
|
3412
3708
|
_queryParams["key"] = key;
|
|
3413
3709
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3414
|
-
url: (0,
|
|
3710
|
+
url: (0, import_url_join5.default)(
|
|
3415
3711
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3416
3712
|
"actors/by-id"
|
|
3417
3713
|
),
|
|
@@ -3500,7 +3796,7 @@ var RivetClient = class {
|
|
|
3500
3796
|
_queryParams["datacenter"] = datacenter;
|
|
3501
3797
|
}
|
|
3502
3798
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3503
|
-
url: (0,
|
|
3799
|
+
url: (0, import_url_join5.default)(
|
|
3504
3800
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3505
3801
|
"actors/by-id"
|
|
3506
3802
|
),
|
|
@@ -3573,7 +3869,7 @@ var RivetClient = class {
|
|
|
3573
3869
|
_queryParams["cursor"] = cursor;
|
|
3574
3870
|
}
|
|
3575
3871
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3576
|
-
url: (0,
|
|
3872
|
+
url: (0, import_url_join5.default)(
|
|
3577
3873
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3578
3874
|
"actors/names"
|
|
3579
3875
|
),
|
|
@@ -3640,7 +3936,7 @@ var RivetClient = class {
|
|
|
3640
3936
|
_queryParams["namespace"] = namespace;
|
|
3641
3937
|
}
|
|
3642
3938
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3643
|
-
url: (0,
|
|
3939
|
+
url: (0, import_url_join5.default)(
|
|
3644
3940
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3645
3941
|
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}`
|
|
3646
3942
|
),
|
|
@@ -3707,7 +4003,7 @@ var RivetClient = class {
|
|
|
3707
4003
|
_queryParams["namespace"] = namespace;
|
|
3708
4004
|
}
|
|
3709
4005
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3710
|
-
url: (0,
|
|
4006
|
+
url: (0, import_url_join5.default)(
|
|
3711
4007
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3712
4008
|
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}`
|
|
3713
4009
|
),
|
|
@@ -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);
|
|
@@ -1605,8 +1607,7 @@ var ActorsListResponse = schemas_exports.object({
|
|
|
1605
1607
|
// src/serialization/types/Datacenter.ts
|
|
1606
1608
|
var Datacenter = schemas_exports.object({
|
|
1607
1609
|
datacenterLabel: schemas_exports.property("datacenter_label", schemas_exports.number()),
|
|
1608
|
-
name: schemas_exports.string()
|
|
1609
|
-
url: schemas_exports.string()
|
|
1610
|
+
name: schemas_exports.string()
|
|
1610
1611
|
});
|
|
1611
1612
|
|
|
1612
1613
|
// src/serialization/types/DatacentersListResponse.ts
|
|
@@ -1639,38 +1640,49 @@ var NamespacesListResponse = schemas_exports.object({
|
|
|
1639
1640
|
pagination: Pagination
|
|
1640
1641
|
});
|
|
1641
1642
|
|
|
1642
|
-
// src/serialization/types/
|
|
1643
|
-
var
|
|
1644
|
-
|
|
1645
|
-
|
|
1643
|
+
// src/serialization/types/NamespacesRunnerConfigServerless.ts
|
|
1644
|
+
var NamespacesRunnerConfigServerless = schemas_exports.object({
|
|
1645
|
+
maxRunners: schemas_exports.property("max_runners", schemas_exports.number()),
|
|
1646
|
+
minRunners: schemas_exports.property("min_runners", schemas_exports.number()),
|
|
1647
|
+
requestLifespan: schemas_exports.property("request_lifespan", schemas_exports.number()),
|
|
1648
|
+
runnersMargin: schemas_exports.property("runners_margin", schemas_exports.number()),
|
|
1649
|
+
slotsPerRunner: schemas_exports.property("slots_per_runner", schemas_exports.number()),
|
|
1650
|
+
url: schemas_exports.string()
|
|
1646
1651
|
});
|
|
1647
1652
|
|
|
1648
|
-
// src/serialization/types/
|
|
1649
|
-
var
|
|
1650
|
-
|
|
1651
|
-
// src/serialization/types/StringTcpAddressHashableMapValue.ts
|
|
1652
|
-
var StringTcpAddressHashableMapValue = schemas_exports.object({
|
|
1653
|
-
hostname: schemas_exports.string(),
|
|
1654
|
-
port: schemas_exports.number()
|
|
1653
|
+
// src/serialization/types/NamespacesRunnerConfig.ts
|
|
1654
|
+
var NamespacesRunnerConfig = schemas_exports.object({
|
|
1655
|
+
serverless: NamespacesRunnerConfigServerless
|
|
1655
1656
|
});
|
|
1656
1657
|
|
|
1657
|
-
// src/serialization/types/
|
|
1658
|
-
var
|
|
1658
|
+
// src/serialization/types/NamespacesRunnerConfigVariant.ts
|
|
1659
|
+
var NamespacesRunnerConfigVariant = schemas_exports.stringLiteral("serverless");
|
|
1659
1660
|
|
|
1660
|
-
// src/serialization/types/
|
|
1661
|
-
var
|
|
1662
|
-
|
|
1663
|
-
|
|
1661
|
+
// src/serialization/types/NamespacesRunnerConfigsDeleteResponse.ts
|
|
1662
|
+
var NamespacesRunnerConfigsDeleteResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
1663
|
+
|
|
1664
|
+
// src/serialization/types/NamespacesRunnerConfigsGetResponse.ts
|
|
1665
|
+
var NamespacesRunnerConfigsGetResponse = schemas_exports.object({
|
|
1666
|
+
runnerConfig: schemas_exports.property("runner_config", NamespacesRunnerConfig)
|
|
1664
1667
|
});
|
|
1665
1668
|
|
|
1666
|
-
// src/serialization/types/
|
|
1667
|
-
var
|
|
1669
|
+
// src/serialization/types/NamespacesRunnerConfigsListResponse.ts
|
|
1670
|
+
var NamespacesRunnerConfigsListResponse = schemas_exports.object({
|
|
1671
|
+
pagination: Pagination,
|
|
1672
|
+
runnerConfigs: schemas_exports.property(
|
|
1673
|
+
"runner_configs",
|
|
1674
|
+
schemas_exports.record(schemas_exports.string(), NamespacesRunnerConfig)
|
|
1675
|
+
)
|
|
1676
|
+
});
|
|
1677
|
+
|
|
1678
|
+
// src/serialization/types/NamespacesRunnerConfigsUpsertRequest.ts
|
|
1679
|
+
var NamespacesRunnerConfigsUpsertRequest = NamespacesRunnerConfig;
|
|
1680
|
+
|
|
1681
|
+
// src/serialization/types/NamespacesRunnerConfigsUpsertResponse.ts
|
|
1682
|
+
var NamespacesRunnerConfigsUpsertResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
1668
1683
|
|
|
1669
1684
|
// src/serialization/types/Runner.ts
|
|
1670
1685
|
var Runner = schemas_exports.object({
|
|
1671
|
-
addressesHttp: schemas_exports.property("addresses_http", StringHttpAddressHashableMap),
|
|
1672
|
-
addressesTcp: schemas_exports.property("addresses_tcp", StringTcpAddressHashableMap),
|
|
1673
|
-
addressesUdp: schemas_exports.property("addresses_udp", StringUdpAddressHashableMap),
|
|
1674
1686
|
createTs: schemas_exports.property("create_ts", schemas_exports.number()),
|
|
1675
1687
|
datacenter: schemas_exports.string(),
|
|
1676
1688
|
drainTs: schemas_exports.property("drain_ts", schemas_exports.number().optional()),
|
|
@@ -1766,17 +1778,19 @@ var NamespacesCreateRequest = schemas_exports.object({
|
|
|
1766
1778
|
NamespacesCreateResponse,
|
|
1767
1779
|
NamespacesGetResponse,
|
|
1768
1780
|
NamespacesListResponse,
|
|
1781
|
+
NamespacesRunnerConfig,
|
|
1782
|
+
NamespacesRunnerConfigServerless,
|
|
1783
|
+
NamespacesRunnerConfigVariant,
|
|
1784
|
+
NamespacesRunnerConfigsDeleteResponse,
|
|
1785
|
+
NamespacesRunnerConfigsGetResponse,
|
|
1786
|
+
NamespacesRunnerConfigsListResponse,
|
|
1787
|
+
NamespacesRunnerConfigsUpsertRequest,
|
|
1788
|
+
NamespacesRunnerConfigsUpsertResponse,
|
|
1769
1789
|
Pagination,
|
|
1770
1790
|
RivetId,
|
|
1771
1791
|
Runner,
|
|
1772
1792
|
RunnersGetResponse,
|
|
1773
1793
|
RunnersListNamesResponse,
|
|
1774
1794
|
RunnersListResponse,
|
|
1775
|
-
StringHttpAddressHashableMap,
|
|
1776
|
-
StringHttpAddressHashableMapValue,
|
|
1777
|
-
StringTcpAddressHashableMap,
|
|
1778
|
-
StringTcpAddressHashableMapValue,
|
|
1779
|
-
StringUdpAddressHashableMap,
|
|
1780
|
-
StringUdpAddressHashableMapValue,
|
|
1781
1795
|
namespaces
|
|
1782
1796
|
});
|