@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/cjs/index.js
CHANGED
|
@@ -588,6 +588,7 @@ __export(api_exports, {
|
|
|
588
588
|
HealthStatus: () => HealthStatus,
|
|
589
589
|
RunnerConfigVariant: () => RunnerConfigVariant,
|
|
590
590
|
datacenters: () => datacenters_exports,
|
|
591
|
+
envoys: () => envoys_exports,
|
|
591
592
|
health: () => health_exports,
|
|
592
593
|
metadata: () => metadata_exports,
|
|
593
594
|
namespaces: () => namespaces_exports,
|
|
@@ -616,6 +617,9 @@ var RunnerConfigVariant = {
|
|
|
616
617
|
// src/api/resources/datacenters/index.ts
|
|
617
618
|
var datacenters_exports = {};
|
|
618
619
|
|
|
620
|
+
// src/api/resources/envoys/index.ts
|
|
621
|
+
var envoys_exports = {};
|
|
622
|
+
|
|
619
623
|
// src/api/resources/health/index.ts
|
|
620
624
|
var health_exports = {};
|
|
621
625
|
|
|
@@ -2354,10 +2358,16 @@ __export(serialization_exports, {
|
|
|
2354
2358
|
ActorsKvGetResponse: () => ActorsKvGetResponse,
|
|
2355
2359
|
ActorsListNamesResponse: () => ActorsListNamesResponse,
|
|
2356
2360
|
ActorsListResponse: () => ActorsListResponse,
|
|
2361
|
+
ActorsRescheduleBody: () => ActorsRescheduleBody,
|
|
2362
|
+
ActorsRescheduleResponse: () => ActorsRescheduleResponse,
|
|
2363
|
+
ActorsSleepBody: () => ActorsSleepBody,
|
|
2364
|
+
ActorsSleepResponse: () => ActorsSleepResponse,
|
|
2357
2365
|
CrashPolicy: () => CrashPolicy2,
|
|
2358
2366
|
Datacenter: () => Datacenter,
|
|
2359
2367
|
DatacenterHealth: () => DatacenterHealth,
|
|
2360
2368
|
DatacentersListResponse: () => DatacentersListResponse,
|
|
2369
|
+
Envoy: () => Envoy,
|
|
2370
|
+
EnvoysListResponse: () => EnvoysListResponse,
|
|
2361
2371
|
HealthFanoutResponse: () => HealthFanoutResponse,
|
|
2362
2372
|
HealthResponse: () => HealthResponse,
|
|
2363
2373
|
HealthStatus: () => HealthStatus2,
|
|
@@ -2472,6 +2482,18 @@ var ActorsListResponse = schemas_exports.object({
|
|
|
2472
2482
|
pagination: Pagination
|
|
2473
2483
|
});
|
|
2474
2484
|
|
|
2485
|
+
// src/serialization/types/ActorsRescheduleBody.ts
|
|
2486
|
+
var ActorsRescheduleBody = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2487
|
+
|
|
2488
|
+
// src/serialization/types/ActorsRescheduleResponse.ts
|
|
2489
|
+
var ActorsRescheduleResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2490
|
+
|
|
2491
|
+
// src/serialization/types/ActorsSleepBody.ts
|
|
2492
|
+
var ActorsSleepBody = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2493
|
+
|
|
2494
|
+
// src/serialization/types/ActorsSleepResponse.ts
|
|
2495
|
+
var ActorsSleepResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2496
|
+
|
|
2475
2497
|
// src/serialization/types/Datacenter.ts
|
|
2476
2498
|
var Datacenter = schemas_exports.object({
|
|
2477
2499
|
label: schemas_exports.number(),
|
|
@@ -2505,6 +2527,28 @@ var DatacentersListResponse = schemas_exports.object({
|
|
|
2505
2527
|
pagination: Pagination
|
|
2506
2528
|
});
|
|
2507
2529
|
|
|
2530
|
+
// src/serialization/types/Envoy.ts
|
|
2531
|
+
var Envoy = schemas_exports.object({
|
|
2532
|
+
createTs: schemas_exports.property("create_ts", schemas_exports.number()),
|
|
2533
|
+
datacenter: schemas_exports.string(),
|
|
2534
|
+
envoyKey: schemas_exports.property("envoy_key", schemas_exports.string()),
|
|
2535
|
+
lastConnectedTs: schemas_exports.property("last_connected_ts", schemas_exports.number().optional()),
|
|
2536
|
+
lastPingTs: schemas_exports.property("last_ping_ts", schemas_exports.number()),
|
|
2537
|
+
lastRtt: schemas_exports.property("last_rtt", schemas_exports.number()),
|
|
2538
|
+
metadata: schemas_exports.record(schemas_exports.string(), schemas_exports.unknown()).optional(),
|
|
2539
|
+
namespaceId: schemas_exports.property("namespace_id", RivetId),
|
|
2540
|
+
poolName: schemas_exports.property("pool_name", schemas_exports.string()),
|
|
2541
|
+
slots: schemas_exports.number(),
|
|
2542
|
+
stopTs: schemas_exports.property("stop_ts", schemas_exports.number().optional()),
|
|
2543
|
+
version: schemas_exports.number()
|
|
2544
|
+
});
|
|
2545
|
+
|
|
2546
|
+
// src/serialization/types/EnvoysListResponse.ts
|
|
2547
|
+
var EnvoysListResponse = schemas_exports.object({
|
|
2548
|
+
envoys: schemas_exports.list(Envoy),
|
|
2549
|
+
pagination: Pagination
|
|
2550
|
+
});
|
|
2551
|
+
|
|
2508
2552
|
// src/serialization/types/HealthFanoutResponse.ts
|
|
2509
2553
|
var HealthFanoutResponse = schemas_exports.object({
|
|
2510
2554
|
datacenters: schemas_exports.list(DatacenterHealth)
|
|
@@ -2563,6 +2607,7 @@ var Runner = schemas_exports.object({
|
|
|
2563
2607
|
// src/serialization/types/RunnerConfigServerless.ts
|
|
2564
2608
|
var RunnerConfigServerless = schemas_exports.object({
|
|
2565
2609
|
headers: schemas_exports.record(schemas_exports.string(), schemas_exports.string()).optional(),
|
|
2610
|
+
maxConcurrentActors: schemas_exports.property("max_concurrent_actors", schemas_exports.number().optional()),
|
|
2566
2611
|
maxRunners: schemas_exports.property("max_runners", schemas_exports.number()),
|
|
2567
2612
|
metadataPollInterval: schemas_exports.property("metadata_poll_interval", schemas_exports.number().optional()),
|
|
2568
2613
|
minRunners: schemas_exports.property("min_runners", schemas_exports.number().optional()),
|
|
@@ -2591,6 +2636,7 @@ var RunnerConfigKindNormal = schemas_exports.object({
|
|
|
2591
2636
|
// src/serialization/types/RunnerConfigKindServerlessServerless.ts
|
|
2592
2637
|
var RunnerConfigKindServerlessServerless = schemas_exports.object({
|
|
2593
2638
|
headers: schemas_exports.record(schemas_exports.string(), schemas_exports.string()).optional(),
|
|
2639
|
+
maxConcurrentActors: schemas_exports.property("max_concurrent_actors", schemas_exports.number().optional()),
|
|
2594
2640
|
maxRunners: schemas_exports.property("max_runners", schemas_exports.number()),
|
|
2595
2641
|
metadataPollInterval: schemas_exports.property("metadata_poll_interval", schemas_exports.number().optional()),
|
|
2596
2642
|
minRunners: schemas_exports.property("min_runners", schemas_exports.number().optional()),
|
|
@@ -2804,7 +2850,7 @@ var NamespacesCreateRequest = schemas_exports.object({
|
|
|
2804
2850
|
});
|
|
2805
2851
|
|
|
2806
2852
|
// src/Client.ts
|
|
2807
|
-
var
|
|
2853
|
+
var import_url_join7 = __toESM(require("url-join"));
|
|
2808
2854
|
|
|
2809
2855
|
// src/errors/RivetError.ts
|
|
2810
2856
|
var RivetError = class _RivetError extends Error {
|
|
@@ -2913,8 +2959,97 @@ var Datacenters = class {
|
|
|
2913
2959
|
}
|
|
2914
2960
|
};
|
|
2915
2961
|
|
|
2916
|
-
// src/api/resources/
|
|
2962
|
+
// src/api/resources/envoys/client/Client.ts
|
|
2917
2963
|
var import_url_join2 = __toESM(require("url-join"));
|
|
2964
|
+
var Envoys = class {
|
|
2965
|
+
constructor(_options) {
|
|
2966
|
+
this._options = _options;
|
|
2967
|
+
}
|
|
2968
|
+
/**
|
|
2969
|
+
* @param {Rivet.EnvoysListRequest} request
|
|
2970
|
+
* @param {Envoys.RequestOptions} requestOptions - Request-specific configuration.
|
|
2971
|
+
*
|
|
2972
|
+
* @example
|
|
2973
|
+
* await client.envoys.list({
|
|
2974
|
+
* namespace: "namespace"
|
|
2975
|
+
* })
|
|
2976
|
+
*/
|
|
2977
|
+
async list(request, requestOptions) {
|
|
2978
|
+
const { namespace, name, envoyKey, limit, cursor } = request;
|
|
2979
|
+
const _queryParams = {};
|
|
2980
|
+
_queryParams["namespace"] = namespace;
|
|
2981
|
+
if (name != null) {
|
|
2982
|
+
_queryParams["name"] = name;
|
|
2983
|
+
}
|
|
2984
|
+
if (envoyKey != null) {
|
|
2985
|
+
if (Array.isArray(envoyKey)) {
|
|
2986
|
+
_queryParams["envoy_key"] = envoyKey.map((item) => item);
|
|
2987
|
+
} else {
|
|
2988
|
+
_queryParams["envoy_key"] = envoyKey;
|
|
2989
|
+
}
|
|
2990
|
+
}
|
|
2991
|
+
if (limit != null) {
|
|
2992
|
+
_queryParams["limit"] = limit.toString();
|
|
2993
|
+
}
|
|
2994
|
+
if (cursor != null) {
|
|
2995
|
+
_queryParams["cursor"] = cursor;
|
|
2996
|
+
}
|
|
2997
|
+
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2998
|
+
url: (0, import_url_join2.default)(
|
|
2999
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3000
|
+
"envoys"
|
|
3001
|
+
),
|
|
3002
|
+
method: "GET",
|
|
3003
|
+
headers: {
|
|
3004
|
+
Authorization: await this._getAuthorizationHeader(),
|
|
3005
|
+
"X-Fern-Language": "JavaScript",
|
|
3006
|
+
"X-Fern-Runtime": RUNTIME.type,
|
|
3007
|
+
"X-Fern-Runtime-Version": RUNTIME.version,
|
|
3008
|
+
...requestOptions == null ? void 0 : requestOptions.headers
|
|
3009
|
+
},
|
|
3010
|
+
contentType: "application/json",
|
|
3011
|
+
queryParameters: _queryParams,
|
|
3012
|
+
requestType: "json",
|
|
3013
|
+
timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
3014
|
+
maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries,
|
|
3015
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal
|
|
3016
|
+
});
|
|
3017
|
+
if (_response.ok) {
|
|
3018
|
+
return EnvoysListResponse.parseOrThrow(_response.body, {
|
|
3019
|
+
unrecognizedObjectKeys: "passthrough",
|
|
3020
|
+
allowUnrecognizedUnionMembers: true,
|
|
3021
|
+
allowUnrecognizedEnumValues: true,
|
|
3022
|
+
skipValidation: true,
|
|
3023
|
+
breadcrumbsPrefix: ["response"]
|
|
3024
|
+
});
|
|
3025
|
+
}
|
|
3026
|
+
if (_response.error.reason === "status-code") {
|
|
3027
|
+
throw new RivetError({
|
|
3028
|
+
statusCode: _response.error.statusCode,
|
|
3029
|
+
body: _response.error.body
|
|
3030
|
+
});
|
|
3031
|
+
}
|
|
3032
|
+
switch (_response.error.reason) {
|
|
3033
|
+
case "non-json":
|
|
3034
|
+
throw new RivetError({
|
|
3035
|
+
statusCode: _response.error.statusCode,
|
|
3036
|
+
body: _response.error.rawBody
|
|
3037
|
+
});
|
|
3038
|
+
case "timeout":
|
|
3039
|
+
throw new RivetTimeoutError("Timeout exceeded when calling GET /envoys.");
|
|
3040
|
+
case "unknown":
|
|
3041
|
+
throw new RivetError({
|
|
3042
|
+
message: _response.error.errorMessage
|
|
3043
|
+
});
|
|
3044
|
+
}
|
|
3045
|
+
}
|
|
3046
|
+
async _getAuthorizationHeader() {
|
|
3047
|
+
return `Bearer ${await Supplier.get(this._options.token)}`;
|
|
3048
|
+
}
|
|
3049
|
+
};
|
|
3050
|
+
|
|
3051
|
+
// src/api/resources/health/client/Client.ts
|
|
3052
|
+
var import_url_join3 = __toESM(require("url-join"));
|
|
2918
3053
|
var Health = class {
|
|
2919
3054
|
constructor(_options) {
|
|
2920
3055
|
this._options = _options;
|
|
@@ -2927,7 +3062,7 @@ var Health = class {
|
|
|
2927
3062
|
*/
|
|
2928
3063
|
async fanout(requestOptions) {
|
|
2929
3064
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2930
|
-
url: (0,
|
|
3065
|
+
url: (0, import_url_join3.default)(
|
|
2931
3066
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2932
3067
|
"health/fanout"
|
|
2933
3068
|
),
|
|
@@ -2980,7 +3115,7 @@ var Health = class {
|
|
|
2980
3115
|
};
|
|
2981
3116
|
|
|
2982
3117
|
// src/api/resources/metadata/client/Client.ts
|
|
2983
|
-
var
|
|
3118
|
+
var import_url_join4 = __toESM(require("url-join"));
|
|
2984
3119
|
var Metadata = class {
|
|
2985
3120
|
constructor(_options) {
|
|
2986
3121
|
this._options = _options;
|
|
@@ -2993,7 +3128,7 @@ var Metadata = class {
|
|
|
2993
3128
|
*/
|
|
2994
3129
|
async get(requestOptions) {
|
|
2995
3130
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2996
|
-
url: (0,
|
|
3131
|
+
url: (0, import_url_join4.default)(
|
|
2997
3132
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2998
3133
|
"metadata"
|
|
2999
3134
|
),
|
|
@@ -3046,7 +3181,7 @@ var Metadata = class {
|
|
|
3046
3181
|
};
|
|
3047
3182
|
|
|
3048
3183
|
// src/api/resources/namespaces/client/Client.ts
|
|
3049
|
-
var
|
|
3184
|
+
var import_url_join5 = __toESM(require("url-join"));
|
|
3050
3185
|
var Namespaces = class {
|
|
3051
3186
|
constructor(_options) {
|
|
3052
3187
|
this._options = _options;
|
|
@@ -3083,7 +3218,7 @@ var Namespaces = class {
|
|
|
3083
3218
|
}
|
|
3084
3219
|
}
|
|
3085
3220
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3086
|
-
url: (0,
|
|
3221
|
+
url: (0, import_url_join5.default)(
|
|
3087
3222
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3088
3223
|
"namespaces"
|
|
3089
3224
|
),
|
|
@@ -3143,7 +3278,7 @@ var Namespaces = class {
|
|
|
3143
3278
|
*/
|
|
3144
3279
|
async create(request, requestOptions) {
|
|
3145
3280
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3146
|
-
url: (0,
|
|
3281
|
+
url: (0, import_url_join5.default)(
|
|
3147
3282
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3148
3283
|
"namespaces"
|
|
3149
3284
|
),
|
|
@@ -3197,7 +3332,7 @@ var Namespaces = class {
|
|
|
3197
3332
|
};
|
|
3198
3333
|
|
|
3199
3334
|
// src/api/resources/runners/client/Client.ts
|
|
3200
|
-
var
|
|
3335
|
+
var import_url_join6 = __toESM(require("url-join"));
|
|
3201
3336
|
var Runners = class {
|
|
3202
3337
|
constructor(_options) {
|
|
3203
3338
|
this._options = _options;
|
|
@@ -3240,7 +3375,7 @@ var Runners = class {
|
|
|
3240
3375
|
_queryParams["cursor"] = cursor;
|
|
3241
3376
|
}
|
|
3242
3377
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3243
|
-
url: (0,
|
|
3378
|
+
url: (0, import_url_join6.default)(
|
|
3244
3379
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3245
3380
|
"runners"
|
|
3246
3381
|
),
|
|
@@ -3313,7 +3448,7 @@ var Runners = class {
|
|
|
3313
3448
|
_queryParams["cursor"] = cursor;
|
|
3314
3449
|
}
|
|
3315
3450
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3316
|
-
url: (0,
|
|
3451
|
+
url: (0, import_url_join6.default)(
|
|
3317
3452
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3318
3453
|
"runners/names"
|
|
3319
3454
|
),
|
|
@@ -3372,6 +3507,7 @@ var RivetClient = class {
|
|
|
3372
3507
|
this._options = _options;
|
|
3373
3508
|
}
|
|
3374
3509
|
_datacenters;
|
|
3510
|
+
_envoys;
|
|
3375
3511
|
_health;
|
|
3376
3512
|
_metadata;
|
|
3377
3513
|
_namespaces;
|
|
@@ -3379,6 +3515,9 @@ var RivetClient = class {
|
|
|
3379
3515
|
get datacenters() {
|
|
3380
3516
|
return this._datacenters ?? (this._datacenters = new Datacenters(this._options));
|
|
3381
3517
|
}
|
|
3518
|
+
get envoys() {
|
|
3519
|
+
return this._envoys ?? (this._envoys = new Envoys(this._options));
|
|
3520
|
+
}
|
|
3382
3521
|
get health() {
|
|
3383
3522
|
return this._health ?? (this._health = new Health(this._options));
|
|
3384
3523
|
}
|
|
@@ -3455,7 +3594,7 @@ var RivetClient = class {
|
|
|
3455
3594
|
_queryParams["cursor"] = cursor;
|
|
3456
3595
|
}
|
|
3457
3596
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3458
|
-
url: (0,
|
|
3597
|
+
url: (0, import_url_join7.default)(
|
|
3459
3598
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3460
3599
|
"actors"
|
|
3461
3600
|
),
|
|
@@ -3537,7 +3676,7 @@ var RivetClient = class {
|
|
|
3537
3676
|
const _queryParams = {};
|
|
3538
3677
|
_queryParams["namespace"] = namespace;
|
|
3539
3678
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3540
|
-
url: (0,
|
|
3679
|
+
url: (0, import_url_join7.default)(
|
|
3541
3680
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3542
3681
|
"actors"
|
|
3543
3682
|
),
|
|
@@ -3630,7 +3769,7 @@ var RivetClient = class {
|
|
|
3630
3769
|
const _queryParams = {};
|
|
3631
3770
|
_queryParams["namespace"] = namespace;
|
|
3632
3771
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3633
|
-
url: (0,
|
|
3772
|
+
url: (0, import_url_join7.default)(
|
|
3634
3773
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3635
3774
|
"actors"
|
|
3636
3775
|
),
|
|
@@ -3704,7 +3843,7 @@ var RivetClient = class {
|
|
|
3704
3843
|
_queryParams["cursor"] = cursor;
|
|
3705
3844
|
}
|
|
3706
3845
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3707
|
-
url: (0,
|
|
3846
|
+
url: (0, import_url_join7.default)(
|
|
3708
3847
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3709
3848
|
"actors/names"
|
|
3710
3849
|
),
|
|
@@ -3772,7 +3911,7 @@ var RivetClient = class {
|
|
|
3772
3911
|
const _queryParams = {};
|
|
3773
3912
|
_queryParams["namespace"] = namespace;
|
|
3774
3913
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3775
|
-
url: (0,
|
|
3914
|
+
url: (0, import_url_join7.default)(
|
|
3776
3915
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3777
3916
|
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}`
|
|
3778
3917
|
),
|
|
@@ -3836,7 +3975,7 @@ var RivetClient = class {
|
|
|
3836
3975
|
const _queryParams = {};
|
|
3837
3976
|
_queryParams["namespace"] = namespace;
|
|
3838
3977
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3839
|
-
url: (0,
|
|
3978
|
+
url: (0, import_url_join7.default)(
|
|
3840
3979
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3841
3980
|
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}/kv/keys/${encodeURIComponent(key)}`
|
|
3842
3981
|
),
|
|
@@ -3886,6 +4025,140 @@ var RivetClient = class {
|
|
|
3886
4025
|
});
|
|
3887
4026
|
}
|
|
3888
4027
|
}
|
|
4028
|
+
/**
|
|
4029
|
+
* @param {Rivet.RivetId} actorId
|
|
4030
|
+
* @param {Rivet.ActorsRescheduleRequest} request
|
|
4031
|
+
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4032
|
+
*
|
|
4033
|
+
* @example
|
|
4034
|
+
* await client.actorsReschedule("actor_id", {
|
|
4035
|
+
* namespace: "namespace",
|
|
4036
|
+
* body: {
|
|
4037
|
+
* "key": "value"
|
|
4038
|
+
* }
|
|
4039
|
+
* })
|
|
4040
|
+
*/
|
|
4041
|
+
async actorsReschedule(actorId, request, requestOptions) {
|
|
4042
|
+
const { namespace, body: _body } = request;
|
|
4043
|
+
const _queryParams = {};
|
|
4044
|
+
_queryParams["namespace"] = namespace;
|
|
4045
|
+
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4046
|
+
url: (0, import_url_join7.default)(
|
|
4047
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4048
|
+
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}/reschedule`
|
|
4049
|
+
),
|
|
4050
|
+
method: "POST",
|
|
4051
|
+
headers: {
|
|
4052
|
+
Authorization: await this._getAuthorizationHeader(),
|
|
4053
|
+
"X-Fern-Language": "JavaScript",
|
|
4054
|
+
"X-Fern-Runtime": RUNTIME.type,
|
|
4055
|
+
"X-Fern-Runtime-Version": RUNTIME.version,
|
|
4056
|
+
...requestOptions == null ? void 0 : requestOptions.headers
|
|
4057
|
+
},
|
|
4058
|
+
contentType: "application/json",
|
|
4059
|
+
queryParameters: _queryParams,
|
|
4060
|
+
requestType: "json",
|
|
4061
|
+
body: ActorsRescheduleBody.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
4062
|
+
timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
4063
|
+
maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries,
|
|
4064
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal
|
|
4065
|
+
});
|
|
4066
|
+
if (_response.ok) {
|
|
4067
|
+
return ActorsRescheduleResponse.parseOrThrow(_response.body, {
|
|
4068
|
+
unrecognizedObjectKeys: "passthrough",
|
|
4069
|
+
allowUnrecognizedUnionMembers: true,
|
|
4070
|
+
allowUnrecognizedEnumValues: true,
|
|
4071
|
+
skipValidation: true,
|
|
4072
|
+
breadcrumbsPrefix: ["response"]
|
|
4073
|
+
});
|
|
4074
|
+
}
|
|
4075
|
+
if (_response.error.reason === "status-code") {
|
|
4076
|
+
throw new RivetError({
|
|
4077
|
+
statusCode: _response.error.statusCode,
|
|
4078
|
+
body: _response.error.body
|
|
4079
|
+
});
|
|
4080
|
+
}
|
|
4081
|
+
switch (_response.error.reason) {
|
|
4082
|
+
case "non-json":
|
|
4083
|
+
throw new RivetError({
|
|
4084
|
+
statusCode: _response.error.statusCode,
|
|
4085
|
+
body: _response.error.rawBody
|
|
4086
|
+
});
|
|
4087
|
+
case "timeout":
|
|
4088
|
+
throw new RivetTimeoutError("Timeout exceeded when calling POST /actors/{actor_id}/reschedule.");
|
|
4089
|
+
case "unknown":
|
|
4090
|
+
throw new RivetError({
|
|
4091
|
+
message: _response.error.errorMessage
|
|
4092
|
+
});
|
|
4093
|
+
}
|
|
4094
|
+
}
|
|
4095
|
+
/**
|
|
4096
|
+
* @param {Rivet.RivetId} actorId
|
|
4097
|
+
* @param {Rivet.ActorsSleepRequest} request
|
|
4098
|
+
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4099
|
+
*
|
|
4100
|
+
* @example
|
|
4101
|
+
* await client.actorsSleep("actor_id", {
|
|
4102
|
+
* namespace: "namespace",
|
|
4103
|
+
* body: {
|
|
4104
|
+
* "key": "value"
|
|
4105
|
+
* }
|
|
4106
|
+
* })
|
|
4107
|
+
*/
|
|
4108
|
+
async actorsSleep(actorId, request, requestOptions) {
|
|
4109
|
+
const { namespace, body: _body } = request;
|
|
4110
|
+
const _queryParams = {};
|
|
4111
|
+
_queryParams["namespace"] = namespace;
|
|
4112
|
+
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4113
|
+
url: (0, import_url_join7.default)(
|
|
4114
|
+
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4115
|
+
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}/sleep`
|
|
4116
|
+
),
|
|
4117
|
+
method: "POST",
|
|
4118
|
+
headers: {
|
|
4119
|
+
Authorization: await this._getAuthorizationHeader(),
|
|
4120
|
+
"X-Fern-Language": "JavaScript",
|
|
4121
|
+
"X-Fern-Runtime": RUNTIME.type,
|
|
4122
|
+
"X-Fern-Runtime-Version": RUNTIME.version,
|
|
4123
|
+
...requestOptions == null ? void 0 : requestOptions.headers
|
|
4124
|
+
},
|
|
4125
|
+
contentType: "application/json",
|
|
4126
|
+
queryParameters: _queryParams,
|
|
4127
|
+
requestType: "json",
|
|
4128
|
+
body: ActorsSleepBody.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
4129
|
+
timeoutMs: (requestOptions == null ? void 0 : requestOptions.timeoutInSeconds) != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
4130
|
+
maxRetries: requestOptions == null ? void 0 : requestOptions.maxRetries,
|
|
4131
|
+
abortSignal: requestOptions == null ? void 0 : requestOptions.abortSignal
|
|
4132
|
+
});
|
|
4133
|
+
if (_response.ok) {
|
|
4134
|
+
return ActorsSleepResponse.parseOrThrow(_response.body, {
|
|
4135
|
+
unrecognizedObjectKeys: "passthrough",
|
|
4136
|
+
allowUnrecognizedUnionMembers: true,
|
|
4137
|
+
allowUnrecognizedEnumValues: true,
|
|
4138
|
+
skipValidation: true,
|
|
4139
|
+
breadcrumbsPrefix: ["response"]
|
|
4140
|
+
});
|
|
4141
|
+
}
|
|
4142
|
+
if (_response.error.reason === "status-code") {
|
|
4143
|
+
throw new RivetError({
|
|
4144
|
+
statusCode: _response.error.statusCode,
|
|
4145
|
+
body: _response.error.body
|
|
4146
|
+
});
|
|
4147
|
+
}
|
|
4148
|
+
switch (_response.error.reason) {
|
|
4149
|
+
case "non-json":
|
|
4150
|
+
throw new RivetError({
|
|
4151
|
+
statusCode: _response.error.statusCode,
|
|
4152
|
+
body: _response.error.rawBody
|
|
4153
|
+
});
|
|
4154
|
+
case "timeout":
|
|
4155
|
+
throw new RivetTimeoutError("Timeout exceeded when calling POST /actors/{actor_id}/sleep.");
|
|
4156
|
+
case "unknown":
|
|
4157
|
+
throw new RivetError({
|
|
4158
|
+
message: _response.error.errorMessage
|
|
4159
|
+
});
|
|
4160
|
+
}
|
|
4161
|
+
}
|
|
3889
4162
|
/**
|
|
3890
4163
|
* @param {Rivet.RunnerConfigsListRequest} request
|
|
3891
4164
|
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
@@ -3921,7 +4194,7 @@ var RivetClient = class {
|
|
|
3921
4194
|
}
|
|
3922
4195
|
}
|
|
3923
4196
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3924
|
-
url: (0,
|
|
4197
|
+
url: (0, import_url_join7.default)(
|
|
3925
4198
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3926
4199
|
"runner-configs"
|
|
3927
4200
|
),
|
|
@@ -3984,7 +4257,7 @@ var RivetClient = class {
|
|
|
3984
4257
|
const _queryParams = {};
|
|
3985
4258
|
_queryParams["namespace"] = namespace;
|
|
3986
4259
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3987
|
-
url: (0,
|
|
4260
|
+
url: (0, import_url_join7.default)(
|
|
3988
4261
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3989
4262
|
"runner-configs/serverless-health-check"
|
|
3990
4263
|
),
|
|
@@ -4055,7 +4328,7 @@ var RivetClient = class {
|
|
|
4055
4328
|
const _queryParams = {};
|
|
4056
4329
|
_queryParams["namespace"] = namespace;
|
|
4057
4330
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4058
|
-
url: (0,
|
|
4331
|
+
url: (0, import_url_join7.default)(
|
|
4059
4332
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4060
4333
|
`runner-configs/${encodeURIComponent(runnerName)}`
|
|
4061
4334
|
),
|
|
@@ -4119,7 +4392,7 @@ var RivetClient = class {
|
|
|
4119
4392
|
const _queryParams = {};
|
|
4120
4393
|
_queryParams["namespace"] = namespace;
|
|
4121
4394
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4122
|
-
url: (0,
|
|
4395
|
+
url: (0, import_url_join7.default)(
|
|
4123
4396
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4124
4397
|
`runner-configs/${encodeURIComponent(runnerName)}`
|
|
4125
4398
|
),
|
|
@@ -4187,7 +4460,7 @@ var RivetClient = class {
|
|
|
4187
4460
|
const _queryParams = {};
|
|
4188
4461
|
_queryParams["namespace"] = namespace;
|
|
4189
4462
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4190
|
-
url: (0,
|
|
4463
|
+
url: (0, import_url_join7.default)(
|
|
4191
4464
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4192
4465
|
`runner-configs/${encodeURIComponent(runnerName)}/refresh-metadata`
|
|
4193
4466
|
),
|
|
@@ -40,10 +40,16 @@ __export(serialization_exports, {
|
|
|
40
40
|
ActorsKvGetResponse: () => ActorsKvGetResponse,
|
|
41
41
|
ActorsListNamesResponse: () => ActorsListNamesResponse,
|
|
42
42
|
ActorsListResponse: () => ActorsListResponse,
|
|
43
|
+
ActorsRescheduleBody: () => ActorsRescheduleBody,
|
|
44
|
+
ActorsRescheduleResponse: () => ActorsRescheduleResponse,
|
|
45
|
+
ActorsSleepBody: () => ActorsSleepBody,
|
|
46
|
+
ActorsSleepResponse: () => ActorsSleepResponse,
|
|
43
47
|
CrashPolicy: () => CrashPolicy,
|
|
44
48
|
Datacenter: () => Datacenter,
|
|
45
49
|
DatacenterHealth: () => DatacenterHealth,
|
|
46
50
|
DatacentersListResponse: () => DatacentersListResponse,
|
|
51
|
+
Envoy: () => Envoy,
|
|
52
|
+
EnvoysListResponse: () => EnvoysListResponse,
|
|
47
53
|
HealthFanoutResponse: () => HealthFanoutResponse,
|
|
48
54
|
HealthResponse: () => HealthResponse,
|
|
49
55
|
HealthStatus: () => HealthStatus,
|
|
@@ -1622,6 +1628,18 @@ var ActorsListResponse = schemas_exports.object({
|
|
|
1622
1628
|
pagination: Pagination
|
|
1623
1629
|
});
|
|
1624
1630
|
|
|
1631
|
+
// src/serialization/types/ActorsRescheduleBody.ts
|
|
1632
|
+
var ActorsRescheduleBody = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
1633
|
+
|
|
1634
|
+
// src/serialization/types/ActorsRescheduleResponse.ts
|
|
1635
|
+
var ActorsRescheduleResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
1636
|
+
|
|
1637
|
+
// src/serialization/types/ActorsSleepBody.ts
|
|
1638
|
+
var ActorsSleepBody = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
1639
|
+
|
|
1640
|
+
// src/serialization/types/ActorsSleepResponse.ts
|
|
1641
|
+
var ActorsSleepResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
1642
|
+
|
|
1625
1643
|
// src/serialization/types/Datacenter.ts
|
|
1626
1644
|
var Datacenter = schemas_exports.object({
|
|
1627
1645
|
label: schemas_exports.number(),
|
|
@@ -1655,6 +1673,28 @@ var DatacentersListResponse = schemas_exports.object({
|
|
|
1655
1673
|
pagination: Pagination
|
|
1656
1674
|
});
|
|
1657
1675
|
|
|
1676
|
+
// src/serialization/types/Envoy.ts
|
|
1677
|
+
var Envoy = schemas_exports.object({
|
|
1678
|
+
createTs: schemas_exports.property("create_ts", schemas_exports.number()),
|
|
1679
|
+
datacenter: schemas_exports.string(),
|
|
1680
|
+
envoyKey: schemas_exports.property("envoy_key", schemas_exports.string()),
|
|
1681
|
+
lastConnectedTs: schemas_exports.property("last_connected_ts", schemas_exports.number().optional()),
|
|
1682
|
+
lastPingTs: schemas_exports.property("last_ping_ts", schemas_exports.number()),
|
|
1683
|
+
lastRtt: schemas_exports.property("last_rtt", schemas_exports.number()),
|
|
1684
|
+
metadata: schemas_exports.record(schemas_exports.string(), schemas_exports.unknown()).optional(),
|
|
1685
|
+
namespaceId: schemas_exports.property("namespace_id", RivetId),
|
|
1686
|
+
poolName: schemas_exports.property("pool_name", schemas_exports.string()),
|
|
1687
|
+
slots: schemas_exports.number(),
|
|
1688
|
+
stopTs: schemas_exports.property("stop_ts", schemas_exports.number().optional()),
|
|
1689
|
+
version: schemas_exports.number()
|
|
1690
|
+
});
|
|
1691
|
+
|
|
1692
|
+
// src/serialization/types/EnvoysListResponse.ts
|
|
1693
|
+
var EnvoysListResponse = schemas_exports.object({
|
|
1694
|
+
envoys: schemas_exports.list(Envoy),
|
|
1695
|
+
pagination: Pagination
|
|
1696
|
+
});
|
|
1697
|
+
|
|
1658
1698
|
// src/serialization/types/HealthFanoutResponse.ts
|
|
1659
1699
|
var HealthFanoutResponse = schemas_exports.object({
|
|
1660
1700
|
datacenters: schemas_exports.list(DatacenterHealth)
|
|
@@ -1713,6 +1753,7 @@ var Runner = schemas_exports.object({
|
|
|
1713
1753
|
// src/serialization/types/RunnerConfigServerless.ts
|
|
1714
1754
|
var RunnerConfigServerless = schemas_exports.object({
|
|
1715
1755
|
headers: schemas_exports.record(schemas_exports.string(), schemas_exports.string()).optional(),
|
|
1756
|
+
maxConcurrentActors: schemas_exports.property("max_concurrent_actors", schemas_exports.number().optional()),
|
|
1716
1757
|
maxRunners: schemas_exports.property("max_runners", schemas_exports.number()),
|
|
1717
1758
|
metadataPollInterval: schemas_exports.property("metadata_poll_interval", schemas_exports.number().optional()),
|
|
1718
1759
|
minRunners: schemas_exports.property("min_runners", schemas_exports.number().optional()),
|
|
@@ -1741,6 +1782,7 @@ var RunnerConfigKindNormal = schemas_exports.object({
|
|
|
1741
1782
|
// src/serialization/types/RunnerConfigKindServerlessServerless.ts
|
|
1742
1783
|
var RunnerConfigKindServerlessServerless = schemas_exports.object({
|
|
1743
1784
|
headers: schemas_exports.record(schemas_exports.string(), schemas_exports.string()).optional(),
|
|
1785
|
+
maxConcurrentActors: schemas_exports.property("max_concurrent_actors", schemas_exports.number().optional()),
|
|
1744
1786
|
maxRunners: schemas_exports.property("max_runners", schemas_exports.number()),
|
|
1745
1787
|
metadataPollInterval: schemas_exports.property("metadata_poll_interval", schemas_exports.number().optional()),
|
|
1746
1788
|
minRunners: schemas_exports.property("min_runners", schemas_exports.number().optional()),
|
|
@@ -1964,10 +2006,16 @@ var NamespacesCreateRequest = schemas_exports.object({
|
|
|
1964
2006
|
ActorsKvGetResponse,
|
|
1965
2007
|
ActorsListNamesResponse,
|
|
1966
2008
|
ActorsListResponse,
|
|
2009
|
+
ActorsRescheduleBody,
|
|
2010
|
+
ActorsRescheduleResponse,
|
|
2011
|
+
ActorsSleepBody,
|
|
2012
|
+
ActorsSleepResponse,
|
|
1967
2013
|
CrashPolicy,
|
|
1968
2014
|
Datacenter,
|
|
1969
2015
|
DatacenterHealth,
|
|
1970
2016
|
DatacentersListResponse,
|
|
2017
|
+
Envoy,
|
|
2018
|
+
EnvoysListResponse,
|
|
1971
2019
|
HealthFanoutResponse,
|
|
1972
2020
|
HealthResponse,
|
|
1973
2021
|
HealthStatus,
|