@rivetkit/engine-api-full 2.3.0-rc.3 → 2.3.0-rc.4
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 +295 -22
- package/dist/browser/cjs/serialization.js +42 -0
- package/dist/browser/esm/index.js +295 -22
- package/dist/browser/esm/serialization.js +42 -0
- package/dist/node/cjs/index.js +295 -22
- package/dist/node/cjs/serialization.js +48 -0
- package/dist/node/esm/index.js +295 -22
- package/dist/node/esm/serialization.js +42 -0
- package/package.json +1 -1
- package/types/Client.d.ts +31 -0
- package/types/api/client/requests/ActorsCreateRequest.d.ts +1 -0
- package/types/api/client/requests/ActorsRescheduleRequest.d.ts +17 -0
- package/types/api/client/requests/ActorsSleepRequest.d.ts +17 -0
- package/types/api/client/requests/index.d.ts +2 -0
- package/types/api/resources/envoys/client/Client.d.ts +39 -0
- package/types/api/resources/envoys/client/index.d.ts +1 -0
- package/types/api/resources/envoys/client/requests/EnvoysListRequest.d.ts +16 -0
- package/types/api/resources/envoys/client/requests/index.d.ts +1 -0
- package/types/api/resources/envoys/index.d.ts +1 -0
- package/types/api/resources/index.d.ts +2 -0
- package/types/api/types/ActorsRescheduleBody.d.ts +4 -0
- package/types/api/types/ActorsRescheduleResponse.d.ts +4 -0
- package/types/api/types/ActorsSleepBody.d.ts +4 -0
- package/types/api/types/ActorsSleepResponse.d.ts +4 -0
- package/types/api/types/Envoy.d.ts +18 -0
- package/types/api/types/EnvoysListResponse.d.ts +8 -0
- package/types/api/types/RunnerConfigKindServerlessServerless.d.ts +1 -0
- package/types/api/types/RunnerConfigServerless.d.ts +1 -0
- package/types/api/types/index.d.ts +6 -0
- package/types/serialization/types/ActorsRescheduleBody.d.ts +10 -0
- package/types/serialization/types/ActorsRescheduleResponse.d.ts +10 -0
- package/types/serialization/types/ActorsSleepBody.d.ts +10 -0
- package/types/serialization/types/ActorsSleepResponse.d.ts +10 -0
- package/types/serialization/types/Envoy.d.ts +24 -0
- package/types/serialization/types/EnvoysListResponse.d.ts +15 -0
- package/types/serialization/types/RunnerConfigKindServerlessServerless.d.ts +1 -0
- package/types/serialization/types/RunnerConfigServerless.d.ts +1 -0
- package/types/serialization/types/index.d.ts +6 -0
package/dist/node/esm/index.js
CHANGED
|
@@ -555,6 +555,7 @@ __export(api_exports, {
|
|
|
555
555
|
HealthStatus: () => HealthStatus,
|
|
556
556
|
RunnerConfigVariant: () => RunnerConfigVariant,
|
|
557
557
|
datacenters: () => datacenters_exports,
|
|
558
|
+
envoys: () => envoys_exports,
|
|
558
559
|
health: () => health_exports,
|
|
559
560
|
metadata: () => metadata_exports,
|
|
560
561
|
namespaces: () => namespaces_exports,
|
|
@@ -583,6 +584,9 @@ var RunnerConfigVariant = {
|
|
|
583
584
|
// src/api/resources/datacenters/index.ts
|
|
584
585
|
var datacenters_exports = {};
|
|
585
586
|
|
|
587
|
+
// src/api/resources/envoys/index.ts
|
|
588
|
+
var envoys_exports = {};
|
|
589
|
+
|
|
586
590
|
// src/api/resources/health/index.ts
|
|
587
591
|
var health_exports = {};
|
|
588
592
|
|
|
@@ -2321,10 +2325,16 @@ __export(serialization_exports, {
|
|
|
2321
2325
|
ActorsKvGetResponse: () => ActorsKvGetResponse,
|
|
2322
2326
|
ActorsListNamesResponse: () => ActorsListNamesResponse,
|
|
2323
2327
|
ActorsListResponse: () => ActorsListResponse,
|
|
2328
|
+
ActorsRescheduleBody: () => ActorsRescheduleBody,
|
|
2329
|
+
ActorsRescheduleResponse: () => ActorsRescheduleResponse,
|
|
2330
|
+
ActorsSleepBody: () => ActorsSleepBody,
|
|
2331
|
+
ActorsSleepResponse: () => ActorsSleepResponse,
|
|
2324
2332
|
CrashPolicy: () => CrashPolicy2,
|
|
2325
2333
|
Datacenter: () => Datacenter,
|
|
2326
2334
|
DatacenterHealth: () => DatacenterHealth,
|
|
2327
2335
|
DatacentersListResponse: () => DatacentersListResponse,
|
|
2336
|
+
Envoy: () => Envoy,
|
|
2337
|
+
EnvoysListResponse: () => EnvoysListResponse,
|
|
2328
2338
|
HealthFanoutResponse: () => HealthFanoutResponse,
|
|
2329
2339
|
HealthResponse: () => HealthResponse,
|
|
2330
2340
|
HealthStatus: () => HealthStatus2,
|
|
@@ -2439,6 +2449,18 @@ var ActorsListResponse = schemas_exports.object({
|
|
|
2439
2449
|
pagination: Pagination
|
|
2440
2450
|
});
|
|
2441
2451
|
|
|
2452
|
+
// src/serialization/types/ActorsRescheduleBody.ts
|
|
2453
|
+
var ActorsRescheduleBody = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2454
|
+
|
|
2455
|
+
// src/serialization/types/ActorsRescheduleResponse.ts
|
|
2456
|
+
var ActorsRescheduleResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2457
|
+
|
|
2458
|
+
// src/serialization/types/ActorsSleepBody.ts
|
|
2459
|
+
var ActorsSleepBody = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2460
|
+
|
|
2461
|
+
// src/serialization/types/ActorsSleepResponse.ts
|
|
2462
|
+
var ActorsSleepResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2463
|
+
|
|
2442
2464
|
// src/serialization/types/Datacenter.ts
|
|
2443
2465
|
var Datacenter = schemas_exports.object({
|
|
2444
2466
|
label: schemas_exports.number(),
|
|
@@ -2472,6 +2494,28 @@ var DatacentersListResponse = schemas_exports.object({
|
|
|
2472
2494
|
pagination: Pagination
|
|
2473
2495
|
});
|
|
2474
2496
|
|
|
2497
|
+
// src/serialization/types/Envoy.ts
|
|
2498
|
+
var Envoy = schemas_exports.object({
|
|
2499
|
+
createTs: schemas_exports.property("create_ts", schemas_exports.number()),
|
|
2500
|
+
datacenter: schemas_exports.string(),
|
|
2501
|
+
envoyKey: schemas_exports.property("envoy_key", schemas_exports.string()),
|
|
2502
|
+
lastConnectedTs: schemas_exports.property("last_connected_ts", schemas_exports.number().optional()),
|
|
2503
|
+
lastPingTs: schemas_exports.property("last_ping_ts", schemas_exports.number()),
|
|
2504
|
+
lastRtt: schemas_exports.property("last_rtt", schemas_exports.number()),
|
|
2505
|
+
metadata: schemas_exports.record(schemas_exports.string(), schemas_exports.unknown()).optional(),
|
|
2506
|
+
namespaceId: schemas_exports.property("namespace_id", RivetId),
|
|
2507
|
+
poolName: schemas_exports.property("pool_name", schemas_exports.string()),
|
|
2508
|
+
slots: schemas_exports.number(),
|
|
2509
|
+
stopTs: schemas_exports.property("stop_ts", schemas_exports.number().optional()),
|
|
2510
|
+
version: schemas_exports.number()
|
|
2511
|
+
});
|
|
2512
|
+
|
|
2513
|
+
// src/serialization/types/EnvoysListResponse.ts
|
|
2514
|
+
var EnvoysListResponse = schemas_exports.object({
|
|
2515
|
+
envoys: schemas_exports.list(Envoy),
|
|
2516
|
+
pagination: Pagination
|
|
2517
|
+
});
|
|
2518
|
+
|
|
2475
2519
|
// src/serialization/types/HealthFanoutResponse.ts
|
|
2476
2520
|
var HealthFanoutResponse = schemas_exports.object({
|
|
2477
2521
|
datacenters: schemas_exports.list(DatacenterHealth)
|
|
@@ -2530,6 +2574,7 @@ var Runner = schemas_exports.object({
|
|
|
2530
2574
|
// src/serialization/types/RunnerConfigServerless.ts
|
|
2531
2575
|
var RunnerConfigServerless = schemas_exports.object({
|
|
2532
2576
|
headers: schemas_exports.record(schemas_exports.string(), schemas_exports.string()).optional(),
|
|
2577
|
+
maxConcurrentActors: schemas_exports.property("max_concurrent_actors", schemas_exports.number().optional()),
|
|
2533
2578
|
maxRunners: schemas_exports.property("max_runners", schemas_exports.number()),
|
|
2534
2579
|
metadataPollInterval: schemas_exports.property("metadata_poll_interval", schemas_exports.number().optional()),
|
|
2535
2580
|
minRunners: schemas_exports.property("min_runners", schemas_exports.number().optional()),
|
|
@@ -2558,6 +2603,7 @@ var RunnerConfigKindNormal = schemas_exports.object({
|
|
|
2558
2603
|
// src/serialization/types/RunnerConfigKindServerlessServerless.ts
|
|
2559
2604
|
var RunnerConfigKindServerlessServerless = schemas_exports.object({
|
|
2560
2605
|
headers: schemas_exports.record(schemas_exports.string(), schemas_exports.string()).optional(),
|
|
2606
|
+
maxConcurrentActors: schemas_exports.property("max_concurrent_actors", schemas_exports.number().optional()),
|
|
2561
2607
|
maxRunners: schemas_exports.property("max_runners", schemas_exports.number()),
|
|
2562
2608
|
metadataPollInterval: schemas_exports.property("metadata_poll_interval", schemas_exports.number().optional()),
|
|
2563
2609
|
minRunners: schemas_exports.property("min_runners", schemas_exports.number().optional()),
|
|
@@ -2771,7 +2817,7 @@ var NamespacesCreateRequest = schemas_exports.object({
|
|
|
2771
2817
|
});
|
|
2772
2818
|
|
|
2773
2819
|
// src/Client.ts
|
|
2774
|
-
import
|
|
2820
|
+
import urlJoin7 from "url-join";
|
|
2775
2821
|
|
|
2776
2822
|
// src/errors/RivetError.ts
|
|
2777
2823
|
var RivetError = class _RivetError extends Error {
|
|
@@ -2880,8 +2926,97 @@ var Datacenters = class {
|
|
|
2880
2926
|
}
|
|
2881
2927
|
};
|
|
2882
2928
|
|
|
2883
|
-
// src/api/resources/
|
|
2929
|
+
// src/api/resources/envoys/client/Client.ts
|
|
2884
2930
|
import urlJoin2 from "url-join";
|
|
2931
|
+
var Envoys = class {
|
|
2932
|
+
constructor(_options) {
|
|
2933
|
+
this._options = _options;
|
|
2934
|
+
}
|
|
2935
|
+
/**
|
|
2936
|
+
* @param {Rivet.EnvoysListRequest} request
|
|
2937
|
+
* @param {Envoys.RequestOptions} requestOptions - Request-specific configuration.
|
|
2938
|
+
*
|
|
2939
|
+
* @example
|
|
2940
|
+
* await client.envoys.list({
|
|
2941
|
+
* namespace: "namespace"
|
|
2942
|
+
* })
|
|
2943
|
+
*/
|
|
2944
|
+
async list(request, requestOptions) {
|
|
2945
|
+
const { namespace, name, envoyKey, limit, cursor } = request;
|
|
2946
|
+
const _queryParams = {};
|
|
2947
|
+
_queryParams["namespace"] = namespace;
|
|
2948
|
+
if (name != null) {
|
|
2949
|
+
_queryParams["name"] = name;
|
|
2950
|
+
}
|
|
2951
|
+
if (envoyKey != null) {
|
|
2952
|
+
if (Array.isArray(envoyKey)) {
|
|
2953
|
+
_queryParams["envoy_key"] = envoyKey.map((item) => item);
|
|
2954
|
+
} else {
|
|
2955
|
+
_queryParams["envoy_key"] = envoyKey;
|
|
2956
|
+
}
|
|
2957
|
+
}
|
|
2958
|
+
if (limit != null) {
|
|
2959
|
+
_queryParams["limit"] = limit.toString();
|
|
2960
|
+
}
|
|
2961
|
+
if (cursor != null) {
|
|
2962
|
+
_queryParams["cursor"] = cursor;
|
|
2963
|
+
}
|
|
2964
|
+
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2965
|
+
url: urlJoin2(
|
|
2966
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2967
|
+
"envoys"
|
|
2968
|
+
),
|
|
2969
|
+
method: "GET",
|
|
2970
|
+
headers: {
|
|
2971
|
+
Authorization: await this._getAuthorizationHeader(),
|
|
2972
|
+
"X-Fern-Language": "JavaScript",
|
|
2973
|
+
"X-Fern-Runtime": RUNTIME.type,
|
|
2974
|
+
"X-Fern-Runtime-Version": RUNTIME.version,
|
|
2975
|
+
...requestOptions == null ? void 0 : requestOptions.headers
|
|
2976
|
+
},
|
|
2977
|
+
contentType: "application/json",
|
|
2978
|
+
queryParameters: _queryParams,
|
|
2979
|
+
requestType: "json",
|
|
2980
|
+
timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
2981
|
+
maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries,
|
|
2982
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal
|
|
2983
|
+
});
|
|
2984
|
+
if (_response.ok) {
|
|
2985
|
+
return EnvoysListResponse.parseOrThrow(_response.body, {
|
|
2986
|
+
unrecognizedObjectKeys: "passthrough",
|
|
2987
|
+
allowUnrecognizedUnionMembers: true,
|
|
2988
|
+
allowUnrecognizedEnumValues: true,
|
|
2989
|
+
skipValidation: true,
|
|
2990
|
+
breadcrumbsPrefix: ["response"]
|
|
2991
|
+
});
|
|
2992
|
+
}
|
|
2993
|
+
if (_response.error.reason === "status-code") {
|
|
2994
|
+
throw new RivetError({
|
|
2995
|
+
statusCode: _response.error.statusCode,
|
|
2996
|
+
body: _response.error.body
|
|
2997
|
+
});
|
|
2998
|
+
}
|
|
2999
|
+
switch (_response.error.reason) {
|
|
3000
|
+
case "non-json":
|
|
3001
|
+
throw new RivetError({
|
|
3002
|
+
statusCode: _response.error.statusCode,
|
|
3003
|
+
body: _response.error.rawBody
|
|
3004
|
+
});
|
|
3005
|
+
case "timeout":
|
|
3006
|
+
throw new RivetTimeoutError("Timeout exceeded when calling GET /envoys.");
|
|
3007
|
+
case "unknown":
|
|
3008
|
+
throw new RivetError({
|
|
3009
|
+
message: _response.error.errorMessage
|
|
3010
|
+
});
|
|
3011
|
+
}
|
|
3012
|
+
}
|
|
3013
|
+
async _getAuthorizationHeader() {
|
|
3014
|
+
return `Bearer ${await Supplier.get(this._options.token)}`;
|
|
3015
|
+
}
|
|
3016
|
+
};
|
|
3017
|
+
|
|
3018
|
+
// src/api/resources/health/client/Client.ts
|
|
3019
|
+
import urlJoin3 from "url-join";
|
|
2885
3020
|
var Health = class {
|
|
2886
3021
|
constructor(_options) {
|
|
2887
3022
|
this._options = _options;
|
|
@@ -2894,7 +3029,7 @@ var Health = class {
|
|
|
2894
3029
|
*/
|
|
2895
3030
|
async fanout(requestOptions) {
|
|
2896
3031
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2897
|
-
url:
|
|
3032
|
+
url: urlJoin3(
|
|
2898
3033
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2899
3034
|
"health/fanout"
|
|
2900
3035
|
),
|
|
@@ -2947,7 +3082,7 @@ var Health = class {
|
|
|
2947
3082
|
};
|
|
2948
3083
|
|
|
2949
3084
|
// src/api/resources/metadata/client/Client.ts
|
|
2950
|
-
import
|
|
3085
|
+
import urlJoin4 from "url-join";
|
|
2951
3086
|
var Metadata = class {
|
|
2952
3087
|
constructor(_options) {
|
|
2953
3088
|
this._options = _options;
|
|
@@ -2960,7 +3095,7 @@ var Metadata = class {
|
|
|
2960
3095
|
*/
|
|
2961
3096
|
async get(requestOptions) {
|
|
2962
3097
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2963
|
-
url:
|
|
3098
|
+
url: urlJoin4(
|
|
2964
3099
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2965
3100
|
"metadata"
|
|
2966
3101
|
),
|
|
@@ -3013,7 +3148,7 @@ var Metadata = class {
|
|
|
3013
3148
|
};
|
|
3014
3149
|
|
|
3015
3150
|
// src/api/resources/namespaces/client/Client.ts
|
|
3016
|
-
import
|
|
3151
|
+
import urlJoin5 from "url-join";
|
|
3017
3152
|
var Namespaces = class {
|
|
3018
3153
|
constructor(_options) {
|
|
3019
3154
|
this._options = _options;
|
|
@@ -3050,7 +3185,7 @@ var Namespaces = class {
|
|
|
3050
3185
|
}
|
|
3051
3186
|
}
|
|
3052
3187
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3053
|
-
url:
|
|
3188
|
+
url: urlJoin5(
|
|
3054
3189
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3055
3190
|
"namespaces"
|
|
3056
3191
|
),
|
|
@@ -3110,7 +3245,7 @@ var Namespaces = class {
|
|
|
3110
3245
|
*/
|
|
3111
3246
|
async create(request, requestOptions) {
|
|
3112
3247
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3113
|
-
url:
|
|
3248
|
+
url: urlJoin5(
|
|
3114
3249
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3115
3250
|
"namespaces"
|
|
3116
3251
|
),
|
|
@@ -3164,7 +3299,7 @@ var Namespaces = class {
|
|
|
3164
3299
|
};
|
|
3165
3300
|
|
|
3166
3301
|
// src/api/resources/runners/client/Client.ts
|
|
3167
|
-
import
|
|
3302
|
+
import urlJoin6 from "url-join";
|
|
3168
3303
|
var Runners = class {
|
|
3169
3304
|
constructor(_options) {
|
|
3170
3305
|
this._options = _options;
|
|
@@ -3207,7 +3342,7 @@ var Runners = class {
|
|
|
3207
3342
|
_queryParams["cursor"] = cursor;
|
|
3208
3343
|
}
|
|
3209
3344
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3210
|
-
url:
|
|
3345
|
+
url: urlJoin6(
|
|
3211
3346
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3212
3347
|
"runners"
|
|
3213
3348
|
),
|
|
@@ -3280,7 +3415,7 @@ var Runners = class {
|
|
|
3280
3415
|
_queryParams["cursor"] = cursor;
|
|
3281
3416
|
}
|
|
3282
3417
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3283
|
-
url:
|
|
3418
|
+
url: urlJoin6(
|
|
3284
3419
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3285
3420
|
"runners/names"
|
|
3286
3421
|
),
|
|
@@ -3339,6 +3474,7 @@ var RivetClient = class {
|
|
|
3339
3474
|
this._options = _options;
|
|
3340
3475
|
}
|
|
3341
3476
|
_datacenters;
|
|
3477
|
+
_envoys;
|
|
3342
3478
|
_health;
|
|
3343
3479
|
_metadata;
|
|
3344
3480
|
_namespaces;
|
|
@@ -3346,6 +3482,9 @@ var RivetClient = class {
|
|
|
3346
3482
|
get datacenters() {
|
|
3347
3483
|
return this._datacenters ?? (this._datacenters = new Datacenters(this._options));
|
|
3348
3484
|
}
|
|
3485
|
+
get envoys() {
|
|
3486
|
+
return this._envoys ?? (this._envoys = new Envoys(this._options));
|
|
3487
|
+
}
|
|
3349
3488
|
get health() {
|
|
3350
3489
|
return this._health ?? (this._health = new Health(this._options));
|
|
3351
3490
|
}
|
|
@@ -3422,7 +3561,7 @@ var RivetClient = class {
|
|
|
3422
3561
|
_queryParams["cursor"] = cursor;
|
|
3423
3562
|
}
|
|
3424
3563
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3425
|
-
url:
|
|
3564
|
+
url: urlJoin7(
|
|
3426
3565
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3427
3566
|
"actors"
|
|
3428
3567
|
),
|
|
@@ -3504,7 +3643,7 @@ var RivetClient = class {
|
|
|
3504
3643
|
const _queryParams = {};
|
|
3505
3644
|
_queryParams["namespace"] = namespace;
|
|
3506
3645
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3507
|
-
url:
|
|
3646
|
+
url: urlJoin7(
|
|
3508
3647
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3509
3648
|
"actors"
|
|
3510
3649
|
),
|
|
@@ -3597,7 +3736,7 @@ var RivetClient = class {
|
|
|
3597
3736
|
const _queryParams = {};
|
|
3598
3737
|
_queryParams["namespace"] = namespace;
|
|
3599
3738
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3600
|
-
url:
|
|
3739
|
+
url: urlJoin7(
|
|
3601
3740
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3602
3741
|
"actors"
|
|
3603
3742
|
),
|
|
@@ -3671,7 +3810,7 @@ var RivetClient = class {
|
|
|
3671
3810
|
_queryParams["cursor"] = cursor;
|
|
3672
3811
|
}
|
|
3673
3812
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3674
|
-
url:
|
|
3813
|
+
url: urlJoin7(
|
|
3675
3814
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3676
3815
|
"actors/names"
|
|
3677
3816
|
),
|
|
@@ -3739,7 +3878,7 @@ var RivetClient = class {
|
|
|
3739
3878
|
const _queryParams = {};
|
|
3740
3879
|
_queryParams["namespace"] = namespace;
|
|
3741
3880
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3742
|
-
url:
|
|
3881
|
+
url: urlJoin7(
|
|
3743
3882
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3744
3883
|
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}`
|
|
3745
3884
|
),
|
|
@@ -3803,7 +3942,7 @@ var RivetClient = class {
|
|
|
3803
3942
|
const _queryParams = {};
|
|
3804
3943
|
_queryParams["namespace"] = namespace;
|
|
3805
3944
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3806
|
-
url:
|
|
3945
|
+
url: urlJoin7(
|
|
3807
3946
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3808
3947
|
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}/kv/keys/${encodeURIComponent(key)}`
|
|
3809
3948
|
),
|
|
@@ -3853,6 +3992,140 @@ var RivetClient = class {
|
|
|
3853
3992
|
});
|
|
3854
3993
|
}
|
|
3855
3994
|
}
|
|
3995
|
+
/**
|
|
3996
|
+
* @param {Rivet.RivetId} actorId
|
|
3997
|
+
* @param {Rivet.ActorsRescheduleRequest} request
|
|
3998
|
+
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3999
|
+
*
|
|
4000
|
+
* @example
|
|
4001
|
+
* await client.actorsReschedule("actor_id", {
|
|
4002
|
+
* namespace: "namespace",
|
|
4003
|
+
* body: {
|
|
4004
|
+
* "key": "value"
|
|
4005
|
+
* }
|
|
4006
|
+
* })
|
|
4007
|
+
*/
|
|
4008
|
+
async actorsReschedule(actorId, request, requestOptions) {
|
|
4009
|
+
const { namespace, body: _body } = request;
|
|
4010
|
+
const _queryParams = {};
|
|
4011
|
+
_queryParams["namespace"] = namespace;
|
|
4012
|
+
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4013
|
+
url: urlJoin7(
|
|
4014
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4015
|
+
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}/reschedule`
|
|
4016
|
+
),
|
|
4017
|
+
method: "POST",
|
|
4018
|
+
headers: {
|
|
4019
|
+
Authorization: await this._getAuthorizationHeader(),
|
|
4020
|
+
"X-Fern-Language": "JavaScript",
|
|
4021
|
+
"X-Fern-Runtime": RUNTIME.type,
|
|
4022
|
+
"X-Fern-Runtime-Version": RUNTIME.version,
|
|
4023
|
+
...requestOptions == null ? void 0 : requestOptions.headers
|
|
4024
|
+
},
|
|
4025
|
+
contentType: "application/json",
|
|
4026
|
+
queryParameters: _queryParams,
|
|
4027
|
+
requestType: "json",
|
|
4028
|
+
body: ActorsRescheduleBody.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
4029
|
+
timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
4030
|
+
maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries,
|
|
4031
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal
|
|
4032
|
+
});
|
|
4033
|
+
if (_response.ok) {
|
|
4034
|
+
return ActorsRescheduleResponse.parseOrThrow(_response.body, {
|
|
4035
|
+
unrecognizedObjectKeys: "passthrough",
|
|
4036
|
+
allowUnrecognizedUnionMembers: true,
|
|
4037
|
+
allowUnrecognizedEnumValues: true,
|
|
4038
|
+
skipValidation: true,
|
|
4039
|
+
breadcrumbsPrefix: ["response"]
|
|
4040
|
+
});
|
|
4041
|
+
}
|
|
4042
|
+
if (_response.error.reason === "status-code") {
|
|
4043
|
+
throw new RivetError({
|
|
4044
|
+
statusCode: _response.error.statusCode,
|
|
4045
|
+
body: _response.error.body
|
|
4046
|
+
});
|
|
4047
|
+
}
|
|
4048
|
+
switch (_response.error.reason) {
|
|
4049
|
+
case "non-json":
|
|
4050
|
+
throw new RivetError({
|
|
4051
|
+
statusCode: _response.error.statusCode,
|
|
4052
|
+
body: _response.error.rawBody
|
|
4053
|
+
});
|
|
4054
|
+
case "timeout":
|
|
4055
|
+
throw new RivetTimeoutError("Timeout exceeded when calling POST /actors/{actor_id}/reschedule.");
|
|
4056
|
+
case "unknown":
|
|
4057
|
+
throw new RivetError({
|
|
4058
|
+
message: _response.error.errorMessage
|
|
4059
|
+
});
|
|
4060
|
+
}
|
|
4061
|
+
}
|
|
4062
|
+
/**
|
|
4063
|
+
* @param {Rivet.RivetId} actorId
|
|
4064
|
+
* @param {Rivet.ActorsSleepRequest} request
|
|
4065
|
+
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4066
|
+
*
|
|
4067
|
+
* @example
|
|
4068
|
+
* await client.actorsSleep("actor_id", {
|
|
4069
|
+
* namespace: "namespace",
|
|
4070
|
+
* body: {
|
|
4071
|
+
* "key": "value"
|
|
4072
|
+
* }
|
|
4073
|
+
* })
|
|
4074
|
+
*/
|
|
4075
|
+
async actorsSleep(actorId, request, requestOptions) {
|
|
4076
|
+
const { namespace, body: _body } = request;
|
|
4077
|
+
const _queryParams = {};
|
|
4078
|
+
_queryParams["namespace"] = namespace;
|
|
4079
|
+
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4080
|
+
url: urlJoin7(
|
|
4081
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4082
|
+
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}/sleep`
|
|
4083
|
+
),
|
|
4084
|
+
method: "POST",
|
|
4085
|
+
headers: {
|
|
4086
|
+
Authorization: await this._getAuthorizationHeader(),
|
|
4087
|
+
"X-Fern-Language": "JavaScript",
|
|
4088
|
+
"X-Fern-Runtime": RUNTIME.type,
|
|
4089
|
+
"X-Fern-Runtime-Version": RUNTIME.version,
|
|
4090
|
+
...requestOptions == null ? void 0 : requestOptions.headers
|
|
4091
|
+
},
|
|
4092
|
+
contentType: "application/json",
|
|
4093
|
+
queryParameters: _queryParams,
|
|
4094
|
+
requestType: "json",
|
|
4095
|
+
body: ActorsSleepBody.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
4096
|
+
timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
4097
|
+
maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries,
|
|
4098
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal
|
|
4099
|
+
});
|
|
4100
|
+
if (_response.ok) {
|
|
4101
|
+
return ActorsSleepResponse.parseOrThrow(_response.body, {
|
|
4102
|
+
unrecognizedObjectKeys: "passthrough",
|
|
4103
|
+
allowUnrecognizedUnionMembers: true,
|
|
4104
|
+
allowUnrecognizedEnumValues: true,
|
|
4105
|
+
skipValidation: true,
|
|
4106
|
+
breadcrumbsPrefix: ["response"]
|
|
4107
|
+
});
|
|
4108
|
+
}
|
|
4109
|
+
if (_response.error.reason === "status-code") {
|
|
4110
|
+
throw new RivetError({
|
|
4111
|
+
statusCode: _response.error.statusCode,
|
|
4112
|
+
body: _response.error.body
|
|
4113
|
+
});
|
|
4114
|
+
}
|
|
4115
|
+
switch (_response.error.reason) {
|
|
4116
|
+
case "non-json":
|
|
4117
|
+
throw new RivetError({
|
|
4118
|
+
statusCode: _response.error.statusCode,
|
|
4119
|
+
body: _response.error.rawBody
|
|
4120
|
+
});
|
|
4121
|
+
case "timeout":
|
|
4122
|
+
throw new RivetTimeoutError("Timeout exceeded when calling POST /actors/{actor_id}/sleep.");
|
|
4123
|
+
case "unknown":
|
|
4124
|
+
throw new RivetError({
|
|
4125
|
+
message: _response.error.errorMessage
|
|
4126
|
+
});
|
|
4127
|
+
}
|
|
4128
|
+
}
|
|
3856
4129
|
/**
|
|
3857
4130
|
* @param {Rivet.RunnerConfigsListRequest} request
|
|
3858
4131
|
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -3888,7 +4161,7 @@ var RivetClient = class {
|
|
|
3888
4161
|
}
|
|
3889
4162
|
}
|
|
3890
4163
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3891
|
-
url:
|
|
4164
|
+
url: urlJoin7(
|
|
3892
4165
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3893
4166
|
"runner-configs"
|
|
3894
4167
|
),
|
|
@@ -3951,7 +4224,7 @@ var RivetClient = class {
|
|
|
3951
4224
|
const _queryParams = {};
|
|
3952
4225
|
_queryParams["namespace"] = namespace;
|
|
3953
4226
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3954
|
-
url:
|
|
4227
|
+
url: urlJoin7(
|
|
3955
4228
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3956
4229
|
"runner-configs/serverless-health-check"
|
|
3957
4230
|
),
|
|
@@ -4022,7 +4295,7 @@ var RivetClient = class {
|
|
|
4022
4295
|
const _queryParams = {};
|
|
4023
4296
|
_queryParams["namespace"] = namespace;
|
|
4024
4297
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4025
|
-
url:
|
|
4298
|
+
url: urlJoin7(
|
|
4026
4299
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4027
4300
|
`runner-configs/${encodeURIComponent(runnerName)}`
|
|
4028
4301
|
),
|
|
@@ -4086,7 +4359,7 @@ var RivetClient = class {
|
|
|
4086
4359
|
const _queryParams = {};
|
|
4087
4360
|
_queryParams["namespace"] = namespace;
|
|
4088
4361
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4089
|
-
url:
|
|
4362
|
+
url: urlJoin7(
|
|
4090
4363
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4091
4364
|
`runner-configs/${encodeURIComponent(runnerName)}`
|
|
4092
4365
|
),
|
|
@@ -4154,7 +4427,7 @@ var RivetClient = class {
|
|
|
4154
4427
|
const _queryParams = {};
|
|
4155
4428
|
_queryParams["namespace"] = namespace;
|
|
4156
4429
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4157
|
-
url:
|
|
4430
|
+
url: urlJoin7(
|
|
4158
4431
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4159
4432
|
`runner-configs/${encodeURIComponent(runnerName)}/refresh-metadata`
|
|
4160
4433
|
),
|
|
@@ -1534,6 +1534,18 @@ var ActorsListResponse = schemas_exports.object({
|
|
|
1534
1534
|
pagination: Pagination
|
|
1535
1535
|
});
|
|
1536
1536
|
|
|
1537
|
+
// src/serialization/types/ActorsRescheduleBody.ts
|
|
1538
|
+
var ActorsRescheduleBody = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
1539
|
+
|
|
1540
|
+
// src/serialization/types/ActorsRescheduleResponse.ts
|
|
1541
|
+
var ActorsRescheduleResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
1542
|
+
|
|
1543
|
+
// src/serialization/types/ActorsSleepBody.ts
|
|
1544
|
+
var ActorsSleepBody = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
1545
|
+
|
|
1546
|
+
// src/serialization/types/ActorsSleepResponse.ts
|
|
1547
|
+
var ActorsSleepResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
1548
|
+
|
|
1537
1549
|
// src/serialization/types/Datacenter.ts
|
|
1538
1550
|
var Datacenter = schemas_exports.object({
|
|
1539
1551
|
label: schemas_exports.number(),
|
|
@@ -1567,6 +1579,28 @@ var DatacentersListResponse = schemas_exports.object({
|
|
|
1567
1579
|
pagination: Pagination
|
|
1568
1580
|
});
|
|
1569
1581
|
|
|
1582
|
+
// src/serialization/types/Envoy.ts
|
|
1583
|
+
var Envoy = schemas_exports.object({
|
|
1584
|
+
createTs: schemas_exports.property("create_ts", schemas_exports.number()),
|
|
1585
|
+
datacenter: schemas_exports.string(),
|
|
1586
|
+
envoyKey: schemas_exports.property("envoy_key", schemas_exports.string()),
|
|
1587
|
+
lastConnectedTs: schemas_exports.property("last_connected_ts", schemas_exports.number().optional()),
|
|
1588
|
+
lastPingTs: schemas_exports.property("last_ping_ts", schemas_exports.number()),
|
|
1589
|
+
lastRtt: schemas_exports.property("last_rtt", schemas_exports.number()),
|
|
1590
|
+
metadata: schemas_exports.record(schemas_exports.string(), schemas_exports.unknown()).optional(),
|
|
1591
|
+
namespaceId: schemas_exports.property("namespace_id", RivetId),
|
|
1592
|
+
poolName: schemas_exports.property("pool_name", schemas_exports.string()),
|
|
1593
|
+
slots: schemas_exports.number(),
|
|
1594
|
+
stopTs: schemas_exports.property("stop_ts", schemas_exports.number().optional()),
|
|
1595
|
+
version: schemas_exports.number()
|
|
1596
|
+
});
|
|
1597
|
+
|
|
1598
|
+
// src/serialization/types/EnvoysListResponse.ts
|
|
1599
|
+
var EnvoysListResponse = schemas_exports.object({
|
|
1600
|
+
envoys: schemas_exports.list(Envoy),
|
|
1601
|
+
pagination: Pagination
|
|
1602
|
+
});
|
|
1603
|
+
|
|
1570
1604
|
// src/serialization/types/HealthFanoutResponse.ts
|
|
1571
1605
|
var HealthFanoutResponse = schemas_exports.object({
|
|
1572
1606
|
datacenters: schemas_exports.list(DatacenterHealth)
|
|
@@ -1625,6 +1659,7 @@ var Runner = schemas_exports.object({
|
|
|
1625
1659
|
// src/serialization/types/RunnerConfigServerless.ts
|
|
1626
1660
|
var RunnerConfigServerless = schemas_exports.object({
|
|
1627
1661
|
headers: schemas_exports.record(schemas_exports.string(), schemas_exports.string()).optional(),
|
|
1662
|
+
maxConcurrentActors: schemas_exports.property("max_concurrent_actors", schemas_exports.number().optional()),
|
|
1628
1663
|
maxRunners: schemas_exports.property("max_runners", schemas_exports.number()),
|
|
1629
1664
|
metadataPollInterval: schemas_exports.property("metadata_poll_interval", schemas_exports.number().optional()),
|
|
1630
1665
|
minRunners: schemas_exports.property("min_runners", schemas_exports.number().optional()),
|
|
@@ -1653,6 +1688,7 @@ var RunnerConfigKindNormal = schemas_exports.object({
|
|
|
1653
1688
|
// src/serialization/types/RunnerConfigKindServerlessServerless.ts
|
|
1654
1689
|
var RunnerConfigKindServerlessServerless = schemas_exports.object({
|
|
1655
1690
|
headers: schemas_exports.record(schemas_exports.string(), schemas_exports.string()).optional(),
|
|
1691
|
+
maxConcurrentActors: schemas_exports.property("max_concurrent_actors", schemas_exports.number().optional()),
|
|
1656
1692
|
maxRunners: schemas_exports.property("max_runners", schemas_exports.number()),
|
|
1657
1693
|
metadataPollInterval: schemas_exports.property("metadata_poll_interval", schemas_exports.number().optional()),
|
|
1658
1694
|
minRunners: schemas_exports.property("min_runners", schemas_exports.number().optional()),
|
|
@@ -1875,10 +1911,16 @@ export {
|
|
|
1875
1911
|
ActorsKvGetResponse,
|
|
1876
1912
|
ActorsListNamesResponse,
|
|
1877
1913
|
ActorsListResponse,
|
|
1914
|
+
ActorsRescheduleBody,
|
|
1915
|
+
ActorsRescheduleResponse,
|
|
1916
|
+
ActorsSleepBody,
|
|
1917
|
+
ActorsSleepResponse,
|
|
1878
1918
|
CrashPolicy,
|
|
1879
1919
|
Datacenter,
|
|
1880
1920
|
DatacenterHealth,
|
|
1881
1921
|
DatacentersListResponse,
|
|
1922
|
+
Envoy,
|
|
1923
|
+
EnvoysListResponse,
|
|
1882
1924
|
HealthFanoutResponse,
|
|
1883
1925
|
HealthResponse,
|
|
1884
1926
|
HealthStatus,
|
package/package.json
CHANGED
package/types/Client.d.ts
CHANGED
|
@@ -4,6 +4,7 @@
|
|
|
4
4
|
import * as core from "./core";
|
|
5
5
|
import * as Rivet from "./api/index";
|
|
6
6
|
import { Datacenters } from "./api/resources/datacenters/client/Client";
|
|
7
|
+
import { Envoys } from "./api/resources/envoys/client/Client";
|
|
7
8
|
import { Health } from "./api/resources/health/client/Client";
|
|
8
9
|
import { Metadata } from "./api/resources/metadata/client/Client";
|
|
9
10
|
import { Namespaces } from "./api/resources/namespaces/client/Client";
|
|
@@ -30,12 +31,14 @@ export declare namespace RivetClient {
|
|
|
30
31
|
export declare class RivetClient {
|
|
31
32
|
protected readonly _options: RivetClient.Options;
|
|
32
33
|
protected _datacenters: Datacenters | undefined;
|
|
34
|
+
protected _envoys: Envoys | undefined;
|
|
33
35
|
protected _health: Health | undefined;
|
|
34
36
|
protected _metadata: Metadata | undefined;
|
|
35
37
|
protected _namespaces: Namespaces | undefined;
|
|
36
38
|
protected _runners: Runners | undefined;
|
|
37
39
|
constructor(_options: RivetClient.Options);
|
|
38
40
|
get datacenters(): Datacenters;
|
|
41
|
+
get envoys(): Envoys;
|
|
39
42
|
get health(): Health;
|
|
40
43
|
get metadata(): Metadata;
|
|
41
44
|
get namespaces(): Namespaces;
|
|
@@ -186,6 +189,34 @@ export declare class RivetClient {
|
|
|
186
189
|
* })
|
|
187
190
|
*/
|
|
188
191
|
actorsKvGet(actorId: Rivet.RivetId, key: string, request: Rivet.ActorsKvGetRequest, requestOptions?: RivetClient.RequestOptions): Promise<Rivet.ActorsKvGetResponse>;
|
|
192
|
+
/**
|
|
193
|
+
* @param {Rivet.RivetId} actorId
|
|
194
|
+
* @param {Rivet.ActorsRescheduleRequest} request
|
|
195
|
+
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
196
|
+
*
|
|
197
|
+
* @example
|
|
198
|
+
* await client.actorsReschedule("actor_id", {
|
|
199
|
+
* namespace: "namespace",
|
|
200
|
+
* body: {
|
|
201
|
+
* "key": "value"
|
|
202
|
+
* }
|
|
203
|
+
* })
|
|
204
|
+
*/
|
|
205
|
+
actorsReschedule(actorId: Rivet.RivetId, request: Rivet.ActorsRescheduleRequest, requestOptions?: RivetClient.RequestOptions): Promise<Rivet.ActorsRescheduleResponse>;
|
|
206
|
+
/**
|
|
207
|
+
* @param {Rivet.RivetId} actorId
|
|
208
|
+
* @param {Rivet.ActorsSleepRequest} request
|
|
209
|
+
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
210
|
+
*
|
|
211
|
+
* @example
|
|
212
|
+
* await client.actorsSleep("actor_id", {
|
|
213
|
+
* namespace: "namespace",
|
|
214
|
+
* body: {
|
|
215
|
+
* "key": "value"
|
|
216
|
+
* }
|
|
217
|
+
* })
|
|
218
|
+
*/
|
|
219
|
+
actorsSleep(actorId: Rivet.RivetId, request: Rivet.ActorsSleepRequest, requestOptions?: RivetClient.RequestOptions): Promise<Rivet.ActorsSleepResponse>;
|
|
189
220
|
/**
|
|
190
221
|
* @param {Rivet.RunnerConfigsListRequest} request
|
|
191
222
|
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|