@rivetkit/engine-api-full 0.0.0-sqlite-profiling-compat.87d61c0 → 0.0.0-sqlite-sync-3x-release.a00b07f
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 +439 -966
- package/dist/browser/cjs/package.json +3 -0
- package/dist/browser/cjs/serialization.js +112 -330
- package/dist/browser/esm/index.js +439 -966
- package/dist/browser/esm/package.json +3 -0
- package/dist/browser/esm/serialization.js +112 -330
- package/dist/node/cjs/index.js +439 -966
- package/dist/node/cjs/package.json +3 -0
- package/dist/node/cjs/serialization.js +126 -367
- package/dist/node/esm/index.js +439 -966
- package/dist/node/esm/package.json +3 -0
- package/dist/node/esm/serialization.js +112 -330
- package/package.json +3 -2
- package/types/Client.d.ts +10 -91
- package/types/api/client/requests/ActorsCreateRequest.d.ts +3 -7
- package/types/api/client/requests/ActorsDeleteRequest.d.ts +1 -1
- package/types/api/client/requests/ActorsGetOrCreateRequest.d.ts +4 -8
- package/types/api/client/requests/ActorsGetRequest.d.ts +3 -0
- package/types/api/client/requests/ActorsListNamesRequest.d.ts +1 -1
- package/types/api/client/requests/ActorsListRequest.d.ts +2 -5
- package/types/api/client/requests/ActorsRescheduleRequest.d.ts +1 -5
- package/types/api/client/requests/ActorsSleepRequest.d.ts +1 -5
- package/types/api/client/requests/index.d.ts +1 -6
- package/types/api/resources/{health → authTokens}/client/Client.d.ts +6 -11
- package/types/api/resources/authTokens/client/index.d.ts +2 -0
- package/types/api/resources/authTokens/client/requests/AuthTokenCreateRequest.d.ts +25 -0
- package/types/api/resources/authTokens/client/requests/index.d.ts +1 -0
- package/types/api/resources/index.d.ts +4 -5
- package/types/api/resources/namespaces/client/Client.d.ts +0 -1
- package/types/api/resources/namespaces/client/requests/NamespacesCreateRequest.d.ts +0 -2
- package/types/api/resources/namespaces/client/requests/NamespacesListRequest.d.ts +0 -6
- package/types/api/resources/pools/client/Client.d.ts +57 -0
- package/types/api/resources/pools/client/requests/PoolsDeleteRequest.d.ts +3 -0
- package/types/api/resources/pools/client/requests/PoolsGetRequest.d.ts +3 -0
- package/types/api/resources/{runners/client/requests/RunnersListNamesRequest.d.ts → pools/client/requests/PoolsListNodesRequest.d.ts} +2 -2
- package/types/api/resources/{envoys/client/requests/EnvoysListRequest.d.ts → pools/client/requests/PoolsListRequest.d.ts} +2 -4
- package/types/api/resources/pools/client/requests/PoolsUpsertRequest.d.ts +8 -0
- package/types/api/resources/pools/client/requests/index.d.ts +5 -0
- package/types/api/types/Actor.d.ts +21 -27
- package/types/api/types/ActorName.d.ts +1 -3
- package/types/api/types/ActorsCreateResponse.d.ts +2 -3
- package/types/api/types/ActorsDeleteResponse.d.ts +1 -4
- package/types/api/types/ActorsGetOrCreateResponse.d.ts +1 -3
- package/types/api/types/ActorsGetResponse.d.ts +4 -0
- package/types/api/types/ActorsListNamesResponse.d.ts +1 -4
- package/types/api/types/ActorsListResponse.d.ts +1 -4
- package/types/api/types/ActorsRescheduleResponse.d.ts +1 -4
- package/types/api/types/ActorsSleepResponse.d.ts +1 -4
- package/types/api/types/AuthOperationKind.d.ts +1 -0
- package/types/api/types/AuthResourceKind.d.ts +1 -0
- package/types/api/types/AuthTargetScope.d.ts +4 -0
- package/types/api/types/AuthTokenCreateResponse.d.ts +8 -0
- package/types/api/types/AuthTokenGrant.d.ts +7 -0
- package/types/api/types/AuthTokenInspectResponse.d.ts +13 -0
- package/types/api/types/Datacenter.d.ts +1 -5
- package/types/api/types/DatacentersListResponse.d.ts +1 -5
- package/types/api/types/ErrorResponse.d.ts +10 -0
- package/types/api/types/MetadataGetResponse.d.ts +8 -12
- package/types/api/types/Namespace.d.ts +3 -7
- package/types/api/types/NamespaceListResponse.d.ts +1 -4
- package/types/api/types/NamespacesCreateResponse.d.ts +0 -3
- package/types/api/types/Node.d.ts +18 -0
- package/types/api/types/Pagination.d.ts +2 -4
- package/types/api/types/Pool.d.ts +14 -0
- package/types/api/types/PoolResponse.d.ts +4 -0
- package/types/api/types/PoolsDeleteResponse.d.ts +1 -0
- package/types/api/types/PoolsListNodesResponse.d.ts +5 -0
- package/types/api/types/PoolsListResponse.d.ts +5 -0
- package/types/api/types/RivetId.d.ts +0 -3
- package/types/api/types/index.d.ts +14 -35
- package/types/serialization/client/requests/ActorsCreateRequest.d.ts +1 -4
- package/types/serialization/client/requests/ActorsGetOrCreateRequest.d.ts +2 -5
- package/types/serialization/client/requests/index.d.ts +0 -2
- package/types/serialization/resources/namespaces/client/requests/NamespacesCreateRequest.d.ts +0 -1
- package/types/serialization/types/Actor.d.ts +10 -17
- package/types/serialization/types/ActorName.d.ts +0 -3
- package/types/serialization/types/ActorsCreateResponse.d.ts +1 -3
- package/types/serialization/types/ActorsDeleteResponse.d.ts +1 -4
- package/types/serialization/types/ActorsGetOrCreateResponse.d.ts +0 -3
- package/types/serialization/types/ActorsGetResponse.d.ts +10 -0
- package/types/serialization/types/ActorsListNamesResponse.d.ts +0 -5
- package/types/serialization/types/ActorsListResponse.d.ts +1 -4
- package/types/serialization/types/ActorsRescheduleResponse.d.ts +1 -4
- package/types/serialization/types/ActorsSleepResponse.d.ts +1 -4
- package/types/serialization/types/AuthOperationKind.d.ts +7 -0
- package/types/serialization/types/AuthResourceKind.d.ts +7 -0
- package/types/serialization/types/AuthTargetScope.d.ts +10 -0
- package/types/serialization/types/AuthTokenCreateResponse.d.ts +11 -0
- package/types/serialization/types/AuthTokenGrant.d.ts +14 -0
- package/types/serialization/types/AuthTokenInspectResponse.d.ts +14 -0
- package/types/serialization/types/Datacenter.d.ts +0 -5
- package/types/serialization/types/DatacentersListResponse.d.ts +1 -6
- package/types/serialization/types/ErrorResponse.d.ts +12 -0
- package/types/serialization/types/MetadataGetResponse.d.ts +4 -12
- package/types/serialization/types/Namespace.d.ts +1 -7
- package/types/serialization/types/NamespaceListResponse.d.ts +1 -4
- package/types/serialization/types/NamespacesCreateResponse.d.ts +0 -3
- package/types/serialization/types/Node.d.ts +16 -0
- package/types/serialization/types/Pagination.d.ts +1 -4
- package/types/serialization/types/Pool.d.ts +14 -0
- package/types/serialization/types/PoolResponse.d.ts +10 -0
- package/types/serialization/types/PoolsDeleteResponse.d.ts +7 -0
- package/types/serialization/types/PoolsListNodesResponse.d.ts +12 -0
- package/types/serialization/types/PoolsListResponse.d.ts +12 -0
- package/types/serialization/types/RivetId.d.ts +0 -3
- package/types/serialization/types/index.d.ts +14 -35
- package/types/api/client/requests/ActorsKvGetRequest.d.ts +0 -12
- package/types/api/client/requests/RunnerConfigsDeleteRequest.d.ts +0 -12
- package/types/api/client/requests/RunnerConfigsListRequest.d.ts +0 -21
- package/types/api/client/requests/RunnerConfigsRefreshMetadataRequest.d.ts +0 -17
- package/types/api/client/requests/RunnerConfigsServerlessHealthCheckRequest.d.ts +0 -15
- package/types/api/client/requests/RunnerConfigsUpsertRequestBody.d.ts +0 -17
- package/types/api/resources/envoys/client/Client.d.ts +0 -39
- package/types/api/resources/envoys/client/requests/index.d.ts +0 -1
- package/types/api/resources/health/client/index.d.ts +0 -1
- package/types/api/resources/runners/client/Client.d.ts +0 -54
- package/types/api/resources/runners/client/index.d.ts +0 -1
- package/types/api/resources/runners/client/requests/RunnersListRequest.d.ts +0 -22
- package/types/api/resources/runners/client/requests/index.d.ts +0 -2
- package/types/api/resources/runners/index.d.ts +0 -1
- package/types/api/types/ActorsKvGetResponse.d.ts +0 -7
- package/types/api/types/ActorsRescheduleRequestBody.d.ts +0 -4
- package/types/api/types/ActorsSleepRequestBody.d.ts +0 -4
- package/types/api/types/CrashPolicy.d.ts +0 -9
- package/types/api/types/DatacenterHealth.d.ts +0 -12
- package/types/api/types/Envoy.d.ts +0 -18
- package/types/api/types/EnvoysListResponse.d.ts +0 -8
- package/types/api/types/HealthFanoutResponse.d.ts +0 -7
- package/types/api/types/HealthResponse.d.ts +0 -8
- package/types/api/types/HealthStatus.d.ts +0 -8
- package/types/api/types/Runner.d.ts +0 -21
- package/types/api/types/RunnerConfig.d.ts +0 -11
- package/types/api/types/RunnerConfigKind.d.ts +0 -5
- package/types/api/types/RunnerConfigKindNormal.d.ts +0 -7
- package/types/api/types/RunnerConfigKindNormalNormal.d.ts +0 -12
- package/types/api/types/RunnerConfigKindServerless.d.ts +0 -7
- package/types/api/types/RunnerConfigKindServerlessServerless.d.ts +0 -29
- package/types/api/types/RunnerConfigNormal.d.ts +0 -12
- package/types/api/types/RunnerConfigResponse.d.ts +0 -8
- package/types/api/types/RunnerConfigServerless.d.ts +0 -29
- package/types/api/types/RunnerConfigVariant.d.ts +0 -8
- package/types/api/types/RunnerConfigsDeleteResponse.d.ts +0 -4
- package/types/api/types/RunnerConfigsListResponse.d.ts +0 -8
- package/types/api/types/RunnerConfigsListResponseRunnerConfigsValue.d.ts +0 -7
- package/types/api/types/RunnerConfigsRefreshMetadataRequestBody.d.ts +0 -4
- package/types/api/types/RunnerConfigsRefreshMetadataResponse.d.ts +0 -4
- package/types/api/types/RunnerConfigsServerlessHealthCheckResponse.d.ts +0 -5
- package/types/api/types/RunnerConfigsServerlessHealthCheckResponseFailure.d.ts +0 -7
- package/types/api/types/RunnerConfigsServerlessHealthCheckResponseFailureFailure.d.ts +0 -7
- package/types/api/types/RunnerConfigsServerlessHealthCheckResponseSuccess.d.ts +0 -7
- package/types/api/types/RunnerConfigsServerlessHealthCheckResponseSuccessSuccess.d.ts +0 -6
- package/types/api/types/RunnerConfigsServerlessMetadataError.d.ts +0 -16
- package/types/api/types/RunnerConfigsUpsertResponse.d.ts +0 -6
- package/types/api/types/RunnersListNamesResponse.d.ts +0 -8
- package/types/api/types/RunnersListResponse.d.ts +0 -8
- package/types/serialization/client/requests/RunnerConfigsServerlessHealthCheckRequest.d.ts +0 -13
- package/types/serialization/client/requests/RunnerConfigsUpsertRequestBody.d.ts +0 -13
- package/types/serialization/types/ActorsKvGetResponse.d.ts +0 -13
- package/types/serialization/types/ActorsRescheduleRequestBody.d.ts +0 -10
- package/types/serialization/types/ActorsSleepRequestBody.d.ts +0 -10
- package/types/serialization/types/CrashPolicy.d.ts +0 -10
- package/types/serialization/types/DatacenterHealth.d.ts +0 -19
- package/types/serialization/types/Envoy.d.ts +0 -24
- package/types/serialization/types/EnvoysListResponse.d.ts +0 -15
- package/types/serialization/types/HealthFanoutResponse.d.ts +0 -13
- package/types/serialization/types/HealthResponse.d.ts +0 -14
- package/types/serialization/types/HealthStatus.d.ts +0 -10
- package/types/serialization/types/Runner.d.ts +0 -27
- package/types/serialization/types/RunnerConfig.d.ts +0 -17
- package/types/serialization/types/RunnerConfigKind.d.ts +0 -12
- package/types/serialization/types/RunnerConfigKindNormal.d.ts +0 -13
- package/types/serialization/types/RunnerConfigKindNormalNormal.d.ts +0 -15
- package/types/serialization/types/RunnerConfigKindServerless.d.ts +0 -13
- package/types/serialization/types/RunnerConfigKindServerlessServerless.d.ts +0 -25
- package/types/serialization/types/RunnerConfigNormal.d.ts +0 -15
- package/types/serialization/types/RunnerConfigResponse.d.ts +0 -14
- package/types/serialization/types/RunnerConfigServerless.d.ts +0 -25
- package/types/serialization/types/RunnerConfigVariant.d.ts +0 -10
- package/types/serialization/types/RunnerConfigsDeleteResponse.d.ts +0 -10
- package/types/serialization/types/RunnerConfigsListResponse.d.ts +0 -15
- package/types/serialization/types/RunnerConfigsListResponseRunnerConfigsValue.d.ts +0 -13
- package/types/serialization/types/RunnerConfigsRefreshMetadataRequestBody.d.ts +0 -10
- package/types/serialization/types/RunnerConfigsRefreshMetadataResponse.d.ts +0 -10
- package/types/serialization/types/RunnerConfigsServerlessHealthCheckResponse.d.ts +0 -12
- package/types/serialization/types/RunnerConfigsServerlessHealthCheckResponseFailure.d.ts +0 -13
- package/types/serialization/types/RunnerConfigsServerlessHealthCheckResponseFailureFailure.d.ts +0 -13
- package/types/serialization/types/RunnerConfigsServerlessHealthCheckResponseSuccess.d.ts +0 -13
- package/types/serialization/types/RunnerConfigsServerlessHealthCheckResponseSuccessSuccess.d.ts +0 -12
- package/types/serialization/types/RunnerConfigsServerlessMetadataError.d.ts +0 -14
- package/types/serialization/types/RunnerConfigsUpsertResponse.d.ts +0 -12
- package/types/serialization/types/RunnersListNamesResponse.d.ts +0 -14
- package/types/serialization/types/RunnersListResponse.d.ts +0 -15
- /package/types/api/resources/{envoys → authTokens}/index.d.ts +0 -0
- /package/types/api/resources/{envoys → pools}/client/index.d.ts +0 -0
- /package/types/api/resources/{health → pools}/index.d.ts +0 -0
|
@@ -547,53 +547,18 @@ var init_NodePre18StreamWrapper = __esm({
|
|
|
547
547
|
// src/api/index.ts
|
|
548
548
|
var api_exports = {};
|
|
549
549
|
__export(api_exports, {
|
|
550
|
-
|
|
551
|
-
HealthStatus: () => HealthStatus,
|
|
552
|
-
RunnerConfigVariant: () => RunnerConfigVariant,
|
|
550
|
+
authTokens: () => authTokens_exports,
|
|
553
551
|
datacenters: () => datacenters_exports,
|
|
554
|
-
envoys: () => envoys_exports,
|
|
555
|
-
health: () => health_exports,
|
|
556
552
|
metadata: () => metadata_exports,
|
|
557
|
-
namespaces: () =>
|
|
558
|
-
|
|
553
|
+
namespaces: () => namespaces_exports2,
|
|
554
|
+
pools: () => pools_exports
|
|
559
555
|
});
|
|
560
556
|
|
|
561
|
-
// src/api/
|
|
562
|
-
var
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
};
|
|
567
|
-
|
|
568
|
-
// src/api/types/HealthStatus.ts
|
|
569
|
-
var HealthStatus = {
|
|
570
|
-
Ok: "ok",
|
|
571
|
-
Error: "error"
|
|
572
|
-
};
|
|
573
|
-
|
|
574
|
-
// src/api/types/RunnerConfigVariant.ts
|
|
575
|
-
var RunnerConfigVariant = {
|
|
576
|
-
Serverless: "serverless",
|
|
577
|
-
Normal: "normal"
|
|
578
|
-
};
|
|
579
|
-
|
|
580
|
-
// src/api/resources/datacenters/index.ts
|
|
581
|
-
var datacenters_exports = {};
|
|
582
|
-
|
|
583
|
-
// src/api/resources/envoys/index.ts
|
|
584
|
-
var envoys_exports = {};
|
|
585
|
-
|
|
586
|
-
// src/api/resources/health/index.ts
|
|
587
|
-
var health_exports = {};
|
|
588
|
-
|
|
589
|
-
// src/api/resources/metadata/index.ts
|
|
590
|
-
var metadata_exports = {};
|
|
591
|
-
|
|
592
|
-
// src/api/resources/namespaces/index.ts
|
|
593
|
-
var namespaces_exports = {};
|
|
594
|
-
|
|
595
|
-
// src/api/resources/runners/index.ts
|
|
596
|
-
var runners_exports = {};
|
|
557
|
+
// src/api/resources/authTokens/index.ts
|
|
558
|
+
var authTokens_exports = {};
|
|
559
|
+
__export(authTokens_exports, {
|
|
560
|
+
AuthTokens: () => AuthTokens
|
|
561
|
+
});
|
|
597
562
|
|
|
598
563
|
// src/core/json.ts
|
|
599
564
|
var toJson = (value, replacer, space) => {
|
|
@@ -2307,6 +2272,9 @@ function transformAndValidateUnion({
|
|
|
2307
2272
|
};
|
|
2308
2273
|
}
|
|
2309
2274
|
|
|
2275
|
+
// src/api/resources/authTokens/client/Client.ts
|
|
2276
|
+
import urlJoin from "url-join";
|
|
2277
|
+
|
|
2310
2278
|
// src/serialization/index.ts
|
|
2311
2279
|
var serialization_exports = {};
|
|
2312
2280
|
__export(serialization_exports, {
|
|
@@ -2317,82 +2285,53 @@ __export(serialization_exports, {
|
|
|
2317
2285
|
ActorsDeleteResponse: () => ActorsDeleteResponse,
|
|
2318
2286
|
ActorsGetOrCreateRequest: () => ActorsGetOrCreateRequest,
|
|
2319
2287
|
ActorsGetOrCreateResponse: () => ActorsGetOrCreateResponse,
|
|
2320
|
-
|
|
2288
|
+
ActorsGetResponse: () => ActorsGetResponse,
|
|
2321
2289
|
ActorsListNamesResponse: () => ActorsListNamesResponse,
|
|
2322
2290
|
ActorsListResponse: () => ActorsListResponse,
|
|
2323
|
-
ActorsRescheduleRequestBody: () => ActorsRescheduleRequestBody,
|
|
2324
2291
|
ActorsRescheduleResponse: () => ActorsRescheduleResponse,
|
|
2325
|
-
ActorsSleepRequestBody: () => ActorsSleepRequestBody,
|
|
2326
2292
|
ActorsSleepResponse: () => ActorsSleepResponse,
|
|
2327
|
-
|
|
2293
|
+
AuthOperationKind: () => AuthOperationKind,
|
|
2294
|
+
AuthResourceKind: () => AuthResourceKind,
|
|
2295
|
+
AuthTargetScope: () => AuthTargetScope,
|
|
2296
|
+
AuthTokenCreateResponse: () => AuthTokenCreateResponse,
|
|
2297
|
+
AuthTokenGrant: () => AuthTokenGrant,
|
|
2298
|
+
AuthTokenInspectResponse: () => AuthTokenInspectResponse,
|
|
2328
2299
|
Datacenter: () => Datacenter,
|
|
2329
|
-
DatacenterHealth: () => DatacenterHealth,
|
|
2330
2300
|
DatacentersListResponse: () => DatacentersListResponse,
|
|
2331
|
-
|
|
2332
|
-
EnvoysListResponse: () => EnvoysListResponse,
|
|
2333
|
-
HealthFanoutResponse: () => HealthFanoutResponse,
|
|
2334
|
-
HealthResponse: () => HealthResponse,
|
|
2335
|
-
HealthStatus: () => HealthStatus2,
|
|
2301
|
+
ErrorResponse: () => ErrorResponse,
|
|
2336
2302
|
MetadataGetResponse: () => MetadataGetResponse,
|
|
2337
2303
|
Namespace: () => Namespace,
|
|
2338
2304
|
NamespaceListResponse: () => NamespaceListResponse,
|
|
2339
2305
|
NamespacesCreateRequest: () => NamespacesCreateRequest,
|
|
2340
2306
|
NamespacesCreateResponse: () => NamespacesCreateResponse,
|
|
2307
|
+
Node: () => Node,
|
|
2341
2308
|
Pagination: () => Pagination,
|
|
2309
|
+
Pool: () => Pool,
|
|
2310
|
+
PoolResponse: () => PoolResponse,
|
|
2311
|
+
PoolsDeleteResponse: () => PoolsDeleteResponse,
|
|
2312
|
+
PoolsListNodesResponse: () => PoolsListNodesResponse,
|
|
2313
|
+
PoolsListResponse: () => PoolsListResponse,
|
|
2342
2314
|
RivetId: () => RivetId,
|
|
2343
|
-
|
|
2344
|
-
RunnerConfig: () => RunnerConfig,
|
|
2345
|
-
RunnerConfigKind: () => RunnerConfigKind,
|
|
2346
|
-
RunnerConfigKindNormal: () => RunnerConfigKindNormal,
|
|
2347
|
-
RunnerConfigKindNormalNormal: () => RunnerConfigKindNormalNormal,
|
|
2348
|
-
RunnerConfigKindServerless: () => RunnerConfigKindServerless,
|
|
2349
|
-
RunnerConfigKindServerlessServerless: () => RunnerConfigKindServerlessServerless,
|
|
2350
|
-
RunnerConfigNormal: () => RunnerConfigNormal,
|
|
2351
|
-
RunnerConfigResponse: () => RunnerConfigResponse,
|
|
2352
|
-
RunnerConfigServerless: () => RunnerConfigServerless,
|
|
2353
|
-
RunnerConfigVariant: () => RunnerConfigVariant2,
|
|
2354
|
-
RunnerConfigsDeleteResponse: () => RunnerConfigsDeleteResponse,
|
|
2355
|
-
RunnerConfigsListResponse: () => RunnerConfigsListResponse,
|
|
2356
|
-
RunnerConfigsListResponseRunnerConfigsValue: () => RunnerConfigsListResponseRunnerConfigsValue,
|
|
2357
|
-
RunnerConfigsRefreshMetadataRequestBody: () => RunnerConfigsRefreshMetadataRequestBody,
|
|
2358
|
-
RunnerConfigsRefreshMetadataResponse: () => RunnerConfigsRefreshMetadataResponse,
|
|
2359
|
-
RunnerConfigsServerlessHealthCheckRequest: () => RunnerConfigsServerlessHealthCheckRequest,
|
|
2360
|
-
RunnerConfigsServerlessHealthCheckResponse: () => RunnerConfigsServerlessHealthCheckResponse,
|
|
2361
|
-
RunnerConfigsServerlessHealthCheckResponseFailure: () => RunnerConfigsServerlessHealthCheckResponseFailure,
|
|
2362
|
-
RunnerConfigsServerlessHealthCheckResponseFailureFailure: () => RunnerConfigsServerlessHealthCheckResponseFailureFailure,
|
|
2363
|
-
RunnerConfigsServerlessHealthCheckResponseSuccess: () => RunnerConfigsServerlessHealthCheckResponseSuccess,
|
|
2364
|
-
RunnerConfigsServerlessHealthCheckResponseSuccessSuccess: () => RunnerConfigsServerlessHealthCheckResponseSuccessSuccess,
|
|
2365
|
-
RunnerConfigsServerlessMetadataError: () => RunnerConfigsServerlessMetadataError,
|
|
2366
|
-
RunnerConfigsUpsertRequestBody: () => RunnerConfigsUpsertRequestBody,
|
|
2367
|
-
RunnerConfigsUpsertResponse: () => RunnerConfigsUpsertResponse,
|
|
2368
|
-
RunnersListNamesResponse: () => RunnersListNamesResponse,
|
|
2369
|
-
RunnersListResponse: () => RunnersListResponse,
|
|
2370
|
-
namespaces: () => namespaces_exports2
|
|
2315
|
+
namespaces: () => namespaces_exports
|
|
2371
2316
|
});
|
|
2372
2317
|
|
|
2373
2318
|
// src/serialization/types/RivetId.ts
|
|
2374
2319
|
var RivetId = schemas_exports.string();
|
|
2375
2320
|
|
|
2376
|
-
// src/serialization/types/CrashPolicy.ts
|
|
2377
|
-
var CrashPolicy2 = schemas_exports.enum_(["restart", "sleep", "destroy"]);
|
|
2378
|
-
|
|
2379
2321
|
// src/serialization/types/Actor.ts
|
|
2380
2322
|
var Actor = schemas_exports.object({
|
|
2381
2323
|
actorId: schemas_exports.property("actor_id", RivetId),
|
|
2382
|
-
connectableTs: schemas_exports.property("connectable_ts", schemas_exports.number().optional()),
|
|
2383
|
-
crashPolicy: schemas_exports.property("crash_policy", CrashPolicy2),
|
|
2384
|
-
createTs: schemas_exports.property("create_ts", schemas_exports.number()),
|
|
2385
|
-
datacenter: schemas_exports.string(),
|
|
2386
|
-
destroyTs: schemas_exports.property("destroy_ts", schemas_exports.number().optional()),
|
|
2387
|
-
error: schemas_exports.record(schemas_exports.string(), schemas_exports.unknown()).optional(),
|
|
2388
|
-
key: schemas_exports.string().optional(),
|
|
2389
2324
|
name: schemas_exports.string(),
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2394
|
-
|
|
2395
|
-
|
|
2325
|
+
key: schemas_exports.string(),
|
|
2326
|
+
namespace: schemas_exports.string(),
|
|
2327
|
+
pool: schemas_exports.string(),
|
|
2328
|
+
createTs: schemas_exports.property("create_ts", schemas_exports.number()),
|
|
2329
|
+
startTs: schemas_exports.property("start_ts", schemas_exports.number().nullable()),
|
|
2330
|
+
pendingAllocationTs: schemas_exports.property("pending_allocation_ts", schemas_exports.number().nullable()),
|
|
2331
|
+
connectableTs: schemas_exports.property("connectable_ts", schemas_exports.number().nullable()),
|
|
2332
|
+
sleepTs: schemas_exports.property("sleep_ts", schemas_exports.number().nullable()),
|
|
2333
|
+
rescheduleTs: schemas_exports.property("reschedule_ts", schemas_exports.number().nullable()),
|
|
2334
|
+
destroyTs: schemas_exports.property("destroy_ts", schemas_exports.number().nullable())
|
|
2396
2335
|
});
|
|
2397
2336
|
|
|
2398
2337
|
// src/serialization/types/ActorName.ts
|
|
@@ -2402,11 +2341,12 @@ var ActorName = schemas_exports.object({
|
|
|
2402
2341
|
|
|
2403
2342
|
// src/serialization/types/ActorsCreateResponse.ts
|
|
2404
2343
|
var ActorsCreateResponse = schemas_exports.object({
|
|
2405
|
-
actor: Actor
|
|
2344
|
+
actor: Actor,
|
|
2345
|
+
created: schemas_exports.boolean()
|
|
2406
2346
|
});
|
|
2407
2347
|
|
|
2408
2348
|
// src/serialization/types/ActorsDeleteResponse.ts
|
|
2409
|
-
var ActorsDeleteResponse = schemas_exports.
|
|
2349
|
+
var ActorsDeleteResponse = schemas_exports.object({});
|
|
2410
2350
|
|
|
2411
2351
|
// src/serialization/types/ActorsGetOrCreateResponse.ts
|
|
2412
2352
|
var ActorsGetOrCreateResponse = schemas_exports.object({
|
|
@@ -2414,21 +2354,19 @@ var ActorsGetOrCreateResponse = schemas_exports.object({
|
|
|
2414
2354
|
created: schemas_exports.boolean()
|
|
2415
2355
|
});
|
|
2416
2356
|
|
|
2417
|
-
// src/serialization/types/
|
|
2418
|
-
var
|
|
2419
|
-
|
|
2420
|
-
value: schemas_exports.string()
|
|
2421
|
-
});
|
|
2422
|
-
|
|
2423
|
-
// src/serialization/types/Pagination.ts
|
|
2424
|
-
var Pagination = schemas_exports.object({
|
|
2425
|
-
cursor: schemas_exports.string().optional()
|
|
2357
|
+
// src/serialization/types/ActorsGetResponse.ts
|
|
2358
|
+
var ActorsGetResponse = schemas_exports.object({
|
|
2359
|
+
actor: Actor
|
|
2426
2360
|
});
|
|
2427
2361
|
|
|
2428
2362
|
// src/serialization/types/ActorsListNamesResponse.ts
|
|
2429
2363
|
var ActorsListNamesResponse = schemas_exports.object({
|
|
2430
|
-
names: schemas_exports.record(schemas_exports.string(), ActorName)
|
|
2431
|
-
|
|
2364
|
+
names: schemas_exports.record(schemas_exports.string(), ActorName)
|
|
2365
|
+
});
|
|
2366
|
+
|
|
2367
|
+
// src/serialization/types/Pagination.ts
|
|
2368
|
+
var Pagination = schemas_exports.object({
|
|
2369
|
+
cursor: schemas_exports.string().nullable()
|
|
2432
2370
|
});
|
|
2433
2371
|
|
|
2434
2372
|
// src/serialization/types/ActorsListResponse.ts
|
|
@@ -2437,98 +2375,76 @@ var ActorsListResponse = schemas_exports.object({
|
|
|
2437
2375
|
pagination: Pagination
|
|
2438
2376
|
});
|
|
2439
2377
|
|
|
2440
|
-
// src/serialization/types/ActorsRescheduleRequestBody.ts
|
|
2441
|
-
var ActorsRescheduleRequestBody = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2442
|
-
|
|
2443
2378
|
// src/serialization/types/ActorsRescheduleResponse.ts
|
|
2444
|
-
var ActorsRescheduleResponse = schemas_exports.
|
|
2445
|
-
|
|
2446
|
-
// src/serialization/types/ActorsSleepRequestBody.ts
|
|
2447
|
-
var ActorsSleepRequestBody = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2379
|
+
var ActorsRescheduleResponse = schemas_exports.object({});
|
|
2448
2380
|
|
|
2449
2381
|
// src/serialization/types/ActorsSleepResponse.ts
|
|
2450
|
-
var ActorsSleepResponse = schemas_exports.
|
|
2382
|
+
var ActorsSleepResponse = schemas_exports.object({});
|
|
2451
2383
|
|
|
2452
|
-
// src/serialization/types/
|
|
2453
|
-
var
|
|
2454
|
-
label: schemas_exports.number(),
|
|
2455
|
-
name: schemas_exports.string(),
|
|
2456
|
-
url: schemas_exports.string()
|
|
2457
|
-
});
|
|
2384
|
+
// src/serialization/types/AuthOperationKind.ts
|
|
2385
|
+
var AuthOperationKind = schemas_exports.enum_(["read", "update", "list", "create", "delete"]);
|
|
2458
2386
|
|
|
2459
|
-
// src/serialization/types/
|
|
2460
|
-
var
|
|
2461
|
-
runtime: schemas_exports.string(),
|
|
2462
|
-
status: schemas_exports.string(),
|
|
2463
|
-
version: schemas_exports.string()
|
|
2464
|
-
});
|
|
2387
|
+
// src/serialization/types/AuthResourceKind.ts
|
|
2388
|
+
var AuthResourceKind = schemas_exports.enum_(["namespace", "actor", "node", "pool", "datacenter", "actor_gateway", "actor_kv"]);
|
|
2465
2389
|
|
|
2466
|
-
// src/serialization/types/
|
|
2467
|
-
var
|
|
2390
|
+
// src/serialization/types/AuthTargetScope.ts
|
|
2391
|
+
var AuthTargetScope = schemas_exports.undiscriminatedUnion([schemas_exports.stringLiteral("any"), schemas_exports.object({
|
|
2392
|
+
id: RivetId
|
|
2393
|
+
})]);
|
|
2468
2394
|
|
|
2469
|
-
// src/serialization/types/
|
|
2470
|
-
var
|
|
2471
|
-
|
|
2472
|
-
|
|
2473
|
-
|
|
2474
|
-
response: HealthResponse.optional(),
|
|
2475
|
-
rttMs: schemas_exports.property("rtt_ms", schemas_exports.number().optional()),
|
|
2476
|
-
status: HealthStatus2
|
|
2395
|
+
// src/serialization/types/AuthTokenCreateResponse.ts
|
|
2396
|
+
var AuthTokenCreateResponse = schemas_exports.object({
|
|
2397
|
+
token: schemas_exports.string(),
|
|
2398
|
+
issuedTs: schemas_exports.property("issued_ts", schemas_exports.number()),
|
|
2399
|
+
expiresTs: schemas_exports.property("expires_ts", schemas_exports.number())
|
|
2477
2400
|
});
|
|
2478
2401
|
|
|
2479
|
-
// src/serialization/types/
|
|
2480
|
-
var
|
|
2481
|
-
|
|
2482
|
-
|
|
2402
|
+
// src/serialization/types/AuthTokenGrant.ts
|
|
2403
|
+
var AuthTokenGrant = schemas_exports.object({
|
|
2404
|
+
resource: AuthResourceKind,
|
|
2405
|
+
target: AuthTargetScope,
|
|
2406
|
+
operations: schemas_exports.list(AuthOperationKind)
|
|
2483
2407
|
});
|
|
2484
2408
|
|
|
2485
|
-
// src/serialization/types/
|
|
2486
|
-
var
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
|
|
2490
|
-
|
|
2491
|
-
|
|
2492
|
-
lastRtt: schemas_exports.property("last_rtt", schemas_exports.number()),
|
|
2493
|
-
metadata: schemas_exports.record(schemas_exports.string(), schemas_exports.unknown()).optional(),
|
|
2494
|
-
namespaceId: schemas_exports.property("namespace_id", RivetId),
|
|
2495
|
-
poolName: schemas_exports.property("pool_name", schemas_exports.string()),
|
|
2496
|
-
slots: schemas_exports.number(),
|
|
2497
|
-
stopTs: schemas_exports.property("stop_ts", schemas_exports.number().optional()),
|
|
2498
|
-
version: schemas_exports.number()
|
|
2409
|
+
// src/serialization/types/AuthTokenInspectResponse.ts
|
|
2410
|
+
var AuthTokenInspectResponse = schemas_exports.object({
|
|
2411
|
+
namespace: schemas_exports.string(),
|
|
2412
|
+
subject: schemas_exports.string().nullable(),
|
|
2413
|
+
grants: schemas_exports.list(AuthTokenGrant),
|
|
2414
|
+
issuedTs: schemas_exports.property("issued_ts", schemas_exports.number()),
|
|
2415
|
+
expiresTs: schemas_exports.property("expires_ts", schemas_exports.number())
|
|
2499
2416
|
});
|
|
2500
2417
|
|
|
2501
|
-
// src/serialization/types/
|
|
2502
|
-
var
|
|
2503
|
-
|
|
2504
|
-
pagination: Pagination
|
|
2418
|
+
// src/serialization/types/Datacenter.ts
|
|
2419
|
+
var Datacenter = schemas_exports.object({
|
|
2420
|
+
name: schemas_exports.string()
|
|
2505
2421
|
});
|
|
2506
2422
|
|
|
2507
|
-
// src/serialization/types/
|
|
2508
|
-
var
|
|
2509
|
-
datacenters: schemas_exports.list(
|
|
2423
|
+
// src/serialization/types/DatacentersListResponse.ts
|
|
2424
|
+
var DatacentersListResponse = schemas_exports.object({
|
|
2425
|
+
datacenters: schemas_exports.list(Datacenter)
|
|
2426
|
+
});
|
|
2427
|
+
|
|
2428
|
+
// src/serialization/types/ErrorResponse.ts
|
|
2429
|
+
var ErrorResponse = schemas_exports.object({
|
|
2430
|
+
group: schemas_exports.string(),
|
|
2431
|
+
code: schemas_exports.string(),
|
|
2432
|
+
message: schemas_exports.string(),
|
|
2433
|
+
metadata: schemas_exports.unknown().optional()
|
|
2510
2434
|
});
|
|
2511
2435
|
|
|
2512
2436
|
// src/serialization/types/MetadataGetResponse.ts
|
|
2513
2437
|
var MetadataGetResponse = schemas_exports.object({
|
|
2514
|
-
|
|
2515
|
-
|
|
2516
|
-
|
|
2517
|
-
|
|
2518
|
-
epoxyProtocolVersion: schemas_exports.property("epoxy_protocol_version", schemas_exports.number()),
|
|
2519
|
-
gitSha: schemas_exports.property("git_sha", schemas_exports.string()),
|
|
2520
|
-
runtime: schemas_exports.string(),
|
|
2521
|
-
rustcHost: schemas_exports.property("rustc_host", schemas_exports.string()),
|
|
2522
|
-
rustcVersion: schemas_exports.property("rustc_version", schemas_exports.string()),
|
|
2523
|
-
version: schemas_exports.string()
|
|
2438
|
+
runtime: schemas_exports.stringLiteral("engine"),
|
|
2439
|
+
version: schemas_exports.string(),
|
|
2440
|
+
envoyProtocolVersion: schemas_exports.number(),
|
|
2441
|
+
actorNames: schemas_exports.record(schemas_exports.string(), ActorName).optional()
|
|
2524
2442
|
});
|
|
2525
2443
|
|
|
2526
2444
|
// src/serialization/types/Namespace.ts
|
|
2527
2445
|
var Namespace = schemas_exports.object({
|
|
2528
|
-
createTs: schemas_exports.property("create_ts", schemas_exports.number()),
|
|
2529
|
-
displayName: schemas_exports.property("display_name", schemas_exports.string()),
|
|
2530
2446
|
name: schemas_exports.string(),
|
|
2531
|
-
|
|
2447
|
+
createTs: schemas_exports.property("create_ts", schemas_exports.number())
|
|
2532
2448
|
});
|
|
2533
2449
|
|
|
2534
2450
|
// src/serialization/types/NamespaceListResponse.ts
|
|
@@ -2542,244 +2458,75 @@ var NamespacesCreateResponse = schemas_exports.object({
|
|
|
2542
2458
|
namespace: Namespace
|
|
2543
2459
|
});
|
|
2544
2460
|
|
|
2545
|
-
// src/serialization/types/
|
|
2546
|
-
var
|
|
2547
|
-
createTs: schemas_exports.property("create_ts", schemas_exports.number()),
|
|
2548
|
-
datacenter: schemas_exports.string(),
|
|
2549
|
-
drainTs: schemas_exports.property("drain_ts", schemas_exports.number().optional()),
|
|
2461
|
+
// src/serialization/types/Node.ts
|
|
2462
|
+
var Node = schemas_exports.object({
|
|
2550
2463
|
key: schemas_exports.string(),
|
|
2551
|
-
|
|
2464
|
+
pool: schemas_exports.string(),
|
|
2465
|
+
namespace: schemas_exports.string(),
|
|
2466
|
+
datacenter: schemas_exports.string(),
|
|
2467
|
+
createTs: schemas_exports.property("create_ts", schemas_exports.number()),
|
|
2552
2468
|
lastPingTs: schemas_exports.property("last_ping_ts", schemas_exports.number()),
|
|
2553
|
-
|
|
2554
|
-
|
|
2555
|
-
name: schemas_exports.string(),
|
|
2556
|
-
namespaceId: schemas_exports.property("namespace_id", RivetId),
|
|
2557
|
-
remainingSlots: schemas_exports.property("remaining_slots", schemas_exports.number()),
|
|
2558
|
-
runnerId: schemas_exports.property("runner_id", RivetId),
|
|
2559
|
-
stopTs: schemas_exports.property("stop_ts", schemas_exports.number().optional()),
|
|
2560
|
-
totalSlots: schemas_exports.property("total_slots", schemas_exports.number()),
|
|
2561
|
-
version: schemas_exports.number()
|
|
2562
|
-
});
|
|
2563
|
-
|
|
2564
|
-
// src/serialization/types/RunnerConfigNormal.ts
|
|
2565
|
-
var RunnerConfigNormal = schemas_exports.object({
|
|
2566
|
-
actorEvictionDelay: schemas_exports.property("actor_eviction_delay", schemas_exports.number().optional()),
|
|
2567
|
-
actorEvictionPeriod: schemas_exports.property("actor_eviction_period", schemas_exports.number().optional()),
|
|
2568
|
-
actorEvictionRate: schemas_exports.property("actor_eviction_rate", schemas_exports.number().optional()),
|
|
2569
|
-
drainOnVersionUpgrade: schemas_exports.property(
|
|
2570
|
-
"drain_on_version_upgrade",
|
|
2571
|
-
schemas_exports.boolean().optional()
|
|
2572
|
-
)
|
|
2573
|
-
});
|
|
2574
|
-
|
|
2575
|
-
// src/serialization/types/RunnerConfigServerless.ts
|
|
2576
|
-
var RunnerConfigServerless = schemas_exports.object({
|
|
2577
|
-
actorEvictionDelay: schemas_exports.property("actor_eviction_delay", schemas_exports.number().optional()),
|
|
2578
|
-
actorEvictionPeriod: schemas_exports.property("actor_eviction_period", schemas_exports.number().optional()),
|
|
2579
|
-
actorEvictionRate: schemas_exports.property("actor_eviction_rate", schemas_exports.number().optional()),
|
|
2580
|
-
drainGracePeriod: schemas_exports.property("drain_grace_period", schemas_exports.number().optional()),
|
|
2581
|
-
drainOnVersionUpgrade: schemas_exports.property(
|
|
2582
|
-
"drain_on_version_upgrade",
|
|
2583
|
-
schemas_exports.boolean().optional()
|
|
2584
|
-
),
|
|
2585
|
-
headers: schemas_exports.record(schemas_exports.string(), schemas_exports.string()).optional(),
|
|
2586
|
-
maxConcurrentActors: schemas_exports.property("max_concurrent_actors", schemas_exports.number().optional()),
|
|
2587
|
-
maxRunners: schemas_exports.property("max_runners", schemas_exports.number().optional()),
|
|
2588
|
-
metadataPollInterval: schemas_exports.property("metadata_poll_interval", schemas_exports.number().optional()),
|
|
2589
|
-
minRunners: schemas_exports.property("min_runners", schemas_exports.number().optional()),
|
|
2590
|
-
requestLifespan: schemas_exports.property("request_lifespan", schemas_exports.number()),
|
|
2591
|
-
runnersMargin: schemas_exports.property("runners_margin", schemas_exports.number().optional()),
|
|
2592
|
-
slotsPerRunner: schemas_exports.property("slots_per_runner", schemas_exports.number().optional()),
|
|
2593
|
-
url: schemas_exports.string()
|
|
2594
|
-
});
|
|
2595
|
-
|
|
2596
|
-
// src/serialization/types/RunnerConfig.ts
|
|
2597
|
-
var RunnerConfig = schemas_exports.object({
|
|
2598
|
-
normal: RunnerConfigNormal.optional(),
|
|
2599
|
-
serverless: RunnerConfigServerless.optional(),
|
|
2600
|
-
drainOnVersionUpgrade: schemas_exports.property(
|
|
2601
|
-
"drain_on_version_upgrade",
|
|
2602
|
-
schemas_exports.boolean().optional()
|
|
2603
|
-
),
|
|
2604
|
-
metadata: schemas_exports.unknown().optional()
|
|
2605
|
-
});
|
|
2606
|
-
|
|
2607
|
-
// src/serialization/types/RunnerConfigKindNormalNormal.ts
|
|
2608
|
-
var RunnerConfigKindNormalNormal = schemas_exports.object({
|
|
2609
|
-
actorEvictionDelay: schemas_exports.property("actor_eviction_delay", schemas_exports.number().optional()),
|
|
2610
|
-
actorEvictionPeriod: schemas_exports.property("actor_eviction_period", schemas_exports.number().optional()),
|
|
2611
|
-
actorEvictionRate: schemas_exports.property("actor_eviction_rate", schemas_exports.number().optional()),
|
|
2612
|
-
drainOnVersionUpgrade: schemas_exports.property(
|
|
2613
|
-
"drain_on_version_upgrade",
|
|
2614
|
-
schemas_exports.boolean().optional()
|
|
2615
|
-
)
|
|
2616
|
-
});
|
|
2617
|
-
|
|
2618
|
-
// src/serialization/types/RunnerConfigKindNormal.ts
|
|
2619
|
-
var RunnerConfigKindNormal = schemas_exports.object({
|
|
2620
|
-
normal: RunnerConfigKindNormalNormal
|
|
2621
|
-
});
|
|
2622
|
-
|
|
2623
|
-
// src/serialization/types/RunnerConfigKindServerlessServerless.ts
|
|
2624
|
-
var RunnerConfigKindServerlessServerless = schemas_exports.object({
|
|
2625
|
-
actorEvictionDelay: schemas_exports.property("actor_eviction_delay", schemas_exports.number().optional()),
|
|
2626
|
-
actorEvictionPeriod: schemas_exports.property("actor_eviction_period", schemas_exports.number().optional()),
|
|
2627
|
-
actorEvictionRate: schemas_exports.property("actor_eviction_rate", schemas_exports.number().optional()),
|
|
2628
|
-
drainGracePeriod: schemas_exports.property("drain_grace_period", schemas_exports.number().optional()),
|
|
2629
|
-
drainOnVersionUpgrade: schemas_exports.property(
|
|
2630
|
-
"drain_on_version_upgrade",
|
|
2631
|
-
schemas_exports.boolean().optional()
|
|
2632
|
-
),
|
|
2633
|
-
headers: schemas_exports.record(schemas_exports.string(), schemas_exports.string()).optional(),
|
|
2634
|
-
maxConcurrentActors: schemas_exports.property("max_concurrent_actors", schemas_exports.number().optional()),
|
|
2635
|
-
maxRunners: schemas_exports.property("max_runners", schemas_exports.number().optional()),
|
|
2636
|
-
metadataPollInterval: schemas_exports.property("metadata_poll_interval", schemas_exports.number().optional()),
|
|
2637
|
-
minRunners: schemas_exports.property("min_runners", schemas_exports.number().optional()),
|
|
2638
|
-
requestLifespan: schemas_exports.property("request_lifespan", schemas_exports.number()),
|
|
2639
|
-
runnersMargin: schemas_exports.property("runners_margin", schemas_exports.number().optional()),
|
|
2640
|
-
slotsPerRunner: schemas_exports.property("slots_per_runner", schemas_exports.number().optional()),
|
|
2641
|
-
url: schemas_exports.string()
|
|
2642
|
-
});
|
|
2643
|
-
|
|
2644
|
-
// src/serialization/types/RunnerConfigKindServerless.ts
|
|
2645
|
-
var RunnerConfigKindServerless = schemas_exports.object({
|
|
2646
|
-
serverless: RunnerConfigKindServerlessServerless
|
|
2647
|
-
});
|
|
2648
|
-
|
|
2649
|
-
// src/serialization/types/RunnerConfigKind.ts
|
|
2650
|
-
var RunnerConfigKind = schemas_exports.undiscriminatedUnion([RunnerConfigKindNormal, RunnerConfigKindServerless]);
|
|
2651
|
-
|
|
2652
|
-
// src/serialization/types/RunnerConfigResponse.ts
|
|
2653
|
-
var RunnerConfigResponse = schemas_exports.object({
|
|
2654
|
-
protocolVersion: schemas_exports.property("protocol_version", schemas_exports.number().optional()),
|
|
2655
|
-
runnerPoolError: schemas_exports.property(
|
|
2656
|
-
"runner_pool_error",
|
|
2657
|
-
schemas_exports.record(schemas_exports.string(), schemas_exports.unknown()).optional()
|
|
2658
|
-
)
|
|
2659
|
-
}).extend(RunnerConfig);
|
|
2660
|
-
|
|
2661
|
-
// src/serialization/types/RunnerConfigVariant.ts
|
|
2662
|
-
var RunnerConfigVariant2 = schemas_exports.enum_(["serverless", "normal"]);
|
|
2663
|
-
|
|
2664
|
-
// src/serialization/types/RunnerConfigsDeleteResponse.ts
|
|
2665
|
-
var RunnerConfigsDeleteResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2666
|
-
|
|
2667
|
-
// src/serialization/types/RunnerConfigsListResponseRunnerConfigsValue.ts
|
|
2668
|
-
var RunnerConfigsListResponseRunnerConfigsValue = schemas_exports.object({
|
|
2669
|
-
datacenters: schemas_exports.record(schemas_exports.string(), RunnerConfigResponse)
|
|
2670
|
-
});
|
|
2671
|
-
|
|
2672
|
-
// src/serialization/types/RunnerConfigsListResponse.ts
|
|
2673
|
-
var RunnerConfigsListResponse = schemas_exports.object({
|
|
2674
|
-
pagination: Pagination,
|
|
2675
|
-
runnerConfigs: schemas_exports.property(
|
|
2676
|
-
"runner_configs",
|
|
2677
|
-
schemas_exports.record(schemas_exports.string(), RunnerConfigsListResponseRunnerConfigsValue)
|
|
2678
|
-
)
|
|
2679
|
-
});
|
|
2680
|
-
|
|
2681
|
-
// src/serialization/types/RunnerConfigsRefreshMetadataRequestBody.ts
|
|
2682
|
-
var RunnerConfigsRefreshMetadataRequestBody = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2683
|
-
|
|
2684
|
-
// src/serialization/types/RunnerConfigsRefreshMetadataResponse.ts
|
|
2685
|
-
var RunnerConfigsRefreshMetadataResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2686
|
-
|
|
2687
|
-
// src/serialization/types/RunnerConfigsServerlessHealthCheckResponseSuccessSuccess.ts
|
|
2688
|
-
var RunnerConfigsServerlessHealthCheckResponseSuccessSuccess = schemas_exports.object({
|
|
2689
|
-
version: schemas_exports.string()
|
|
2469
|
+
connected: schemas_exports.boolean(),
|
|
2470
|
+
stopping: schemas_exports.boolean()
|
|
2690
2471
|
});
|
|
2691
2472
|
|
|
2692
|
-
// src/serialization/types/
|
|
2693
|
-
var
|
|
2694
|
-
|
|
2695
|
-
|
|
2696
|
-
|
|
2697
|
-
|
|
2698
|
-
|
|
2699
|
-
|
|
2700
|
-
message: schemas_exports.string(),
|
|
2701
|
-
metadata: schemas_exports.unknown().optional()
|
|
2702
|
-
});
|
|
2703
|
-
|
|
2704
|
-
// src/serialization/types/RunnerConfigsServerlessHealthCheckResponseFailureFailure.ts
|
|
2705
|
-
var RunnerConfigsServerlessHealthCheckResponseFailureFailure = schemas_exports.object({
|
|
2706
|
-
error: RunnerConfigsServerlessMetadataError
|
|
2473
|
+
// src/serialization/types/Pool.ts
|
|
2474
|
+
var Pool = schemas_exports.object({
|
|
2475
|
+
name: schemas_exports.string(),
|
|
2476
|
+
drainOnVersionUpgrade: schemas_exports.property("drain_on_version_upgrade", schemas_exports.boolean()),
|
|
2477
|
+
actorEvictionDelay: schemas_exports.property("actor_eviction_delay", schemas_exports.number()),
|
|
2478
|
+
actorEvictionPeriod: schemas_exports.property("actor_eviction_period", schemas_exports.number()),
|
|
2479
|
+
actorEvictionRate: schemas_exports.property("actor_eviction_rate", schemas_exports.number()),
|
|
2480
|
+
metadata: schemas_exports.unknown()
|
|
2707
2481
|
});
|
|
2708
2482
|
|
|
2709
|
-
// src/serialization/types/
|
|
2710
|
-
var
|
|
2711
|
-
|
|
2483
|
+
// src/serialization/types/PoolResponse.ts
|
|
2484
|
+
var PoolResponse = schemas_exports.object({
|
|
2485
|
+
pool: Pool
|
|
2712
2486
|
});
|
|
2713
2487
|
|
|
2714
|
-
// src/serialization/types/
|
|
2715
|
-
var
|
|
2716
|
-
RunnerConfigsServerlessHealthCheckResponseSuccess,
|
|
2717
|
-
RunnerConfigsServerlessHealthCheckResponseFailure
|
|
2718
|
-
]);
|
|
2719
|
-
|
|
2720
|
-
// src/serialization/types/RunnerConfigsUpsertResponse.ts
|
|
2721
|
-
var RunnerConfigsUpsertResponse = schemas_exports.object({
|
|
2722
|
-
endpointConfigChanged: schemas_exports.property("endpoint_config_changed", schemas_exports.boolean())
|
|
2723
|
-
});
|
|
2488
|
+
// src/serialization/types/PoolsDeleteResponse.ts
|
|
2489
|
+
var PoolsDeleteResponse = schemas_exports.object({});
|
|
2724
2490
|
|
|
2725
|
-
// src/serialization/types/
|
|
2726
|
-
var
|
|
2727
|
-
|
|
2491
|
+
// src/serialization/types/PoolsListNodesResponse.ts
|
|
2492
|
+
var PoolsListNodesResponse = schemas_exports.object({
|
|
2493
|
+
nodes: schemas_exports.list(Node),
|
|
2728
2494
|
pagination: Pagination
|
|
2729
2495
|
});
|
|
2730
2496
|
|
|
2731
|
-
// src/serialization/types/
|
|
2732
|
-
var
|
|
2497
|
+
// src/serialization/types/PoolsListResponse.ts
|
|
2498
|
+
var PoolsListResponse = schemas_exports.object({
|
|
2733
2499
|
pagination: Pagination,
|
|
2734
|
-
|
|
2500
|
+
pools: schemas_exports.list(Pool)
|
|
2735
2501
|
});
|
|
2736
2502
|
|
|
2737
2503
|
// src/serialization/client/requests/ActorsCreateRequest.ts
|
|
2738
2504
|
var ActorsCreateRequest = schemas_exports.object({
|
|
2739
|
-
crashPolicy: schemas_exports.property("crash_policy", CrashPolicy2),
|
|
2740
|
-
datacenter: schemas_exports.string().optional(),
|
|
2741
2505
|
input: schemas_exports.string().optional(),
|
|
2742
2506
|
key: schemas_exports.string().optional(),
|
|
2743
2507
|
name: schemas_exports.string(),
|
|
2744
|
-
|
|
2508
|
+
pool: schemas_exports.string().optional()
|
|
2745
2509
|
});
|
|
2746
2510
|
|
|
2747
2511
|
// src/serialization/client/requests/ActorsGetOrCreateRequest.ts
|
|
2748
2512
|
var ActorsGetOrCreateRequest = schemas_exports.object({
|
|
2749
|
-
crashPolicy: schemas_exports.property("crash_policy", CrashPolicy2),
|
|
2750
|
-
datacenter: schemas_exports.string().optional(),
|
|
2751
2513
|
input: schemas_exports.string().optional(),
|
|
2752
|
-
key: schemas_exports.string(),
|
|
2514
|
+
key: schemas_exports.string().optional(),
|
|
2753
2515
|
name: schemas_exports.string(),
|
|
2754
|
-
|
|
2755
|
-
});
|
|
2756
|
-
|
|
2757
|
-
// src/serialization/client/requests/RunnerConfigsServerlessHealthCheckRequest.ts
|
|
2758
|
-
var RunnerConfigsServerlessHealthCheckRequest = schemas_exports.object({
|
|
2759
|
-
headers: schemas_exports.record(schemas_exports.string(), schemas_exports.string()).optional(),
|
|
2760
|
-
url: schemas_exports.string()
|
|
2761
|
-
});
|
|
2762
|
-
|
|
2763
|
-
// src/serialization/client/requests/RunnerConfigsUpsertRequestBody.ts
|
|
2764
|
-
var RunnerConfigsUpsertRequestBody = schemas_exports.object({
|
|
2765
|
-
datacenters: schemas_exports.record(schemas_exports.string(), RunnerConfig)
|
|
2516
|
+
pool: schemas_exports.string().optional()
|
|
2766
2517
|
});
|
|
2767
2518
|
|
|
2768
2519
|
// src/serialization/resources/namespaces/index.ts
|
|
2769
|
-
var
|
|
2770
|
-
__export(
|
|
2520
|
+
var namespaces_exports = {};
|
|
2521
|
+
__export(namespaces_exports, {
|
|
2771
2522
|
NamespacesCreateRequest: () => NamespacesCreateRequest
|
|
2772
2523
|
});
|
|
2773
2524
|
|
|
2774
2525
|
// src/serialization/resources/namespaces/client/requests/NamespacesCreateRequest.ts
|
|
2775
2526
|
var NamespacesCreateRequest = schemas_exports.object({
|
|
2776
|
-
displayName: schemas_exports.property("display_name", schemas_exports.string()),
|
|
2777
2527
|
name: schemas_exports.string()
|
|
2778
2528
|
});
|
|
2779
2529
|
|
|
2780
|
-
// src/Client.ts
|
|
2781
|
-
import urlJoin7 from "url-join";
|
|
2782
|
-
|
|
2783
2530
|
// src/errors/RivetError.ts
|
|
2784
2531
|
var RivetError = class _RivetError extends Error {
|
|
2785
2532
|
statusCode;
|
|
@@ -2821,25 +2568,18 @@ var RivetTimeoutError = class _RivetTimeoutError extends Error {
|
|
|
2821
2568
|
}
|
|
2822
2569
|
};
|
|
2823
2570
|
|
|
2824
|
-
// src/api/resources/
|
|
2825
|
-
|
|
2826
|
-
var Datacenters = class {
|
|
2571
|
+
// src/api/resources/authTokens/client/Client.ts
|
|
2572
|
+
var AuthTokens = class {
|
|
2827
2573
|
constructor(_options) {
|
|
2828
2574
|
this._options = _options;
|
|
2829
2575
|
}
|
|
2830
|
-
|
|
2831
|
-
* @param {Datacenters.RequestOptions} requestOptions - Request-specific configuration.
|
|
2832
|
-
*
|
|
2833
|
-
* @example
|
|
2834
|
-
* await client.datacenters.list()
|
|
2835
|
-
*/
|
|
2836
|
-
async list(requestOptions) {
|
|
2576
|
+
async create(request, requestOptions) {
|
|
2837
2577
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2838
2578
|
url: urlJoin(
|
|
2839
2579
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2840
|
-
"
|
|
2580
|
+
"auth/tokens"
|
|
2841
2581
|
),
|
|
2842
|
-
method: "
|
|
2582
|
+
method: "POST",
|
|
2843
2583
|
headers: {
|
|
2844
2584
|
Authorization: await this._getAuthorizationHeader(),
|
|
2845
2585
|
"X-Fern-Language": "JavaScript",
|
|
@@ -2849,12 +2589,18 @@ var Datacenters = class {
|
|
|
2849
2589
|
},
|
|
2850
2590
|
contentType: "application/json",
|
|
2851
2591
|
requestType: "json",
|
|
2592
|
+
body: {
|
|
2593
|
+
namespace: request.namespace,
|
|
2594
|
+
duration: request.duration,
|
|
2595
|
+
subject: request.subject,
|
|
2596
|
+
grants: request.grants.map((grant) => AuthTokenGrant.jsonOrThrow(grant))
|
|
2597
|
+
},
|
|
2852
2598
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
2853
2599
|
maxRetries: requestOptions?.maxRetries,
|
|
2854
2600
|
abortSignal: requestOptions?.abortSignal
|
|
2855
2601
|
});
|
|
2856
2602
|
if (_response.ok) {
|
|
2857
|
-
return
|
|
2603
|
+
return AuthTokenCreateResponse.parseOrThrow(_response.body, {
|
|
2858
2604
|
unrecognizedObjectKeys: "passthrough",
|
|
2859
2605
|
allowUnrecognizedUnionMembers: true,
|
|
2860
2606
|
allowUnrecognizedEnumValues: true,
|
|
@@ -2875,57 +2621,18 @@ var Datacenters = class {
|
|
|
2875
2621
|
body: _response.error.rawBody
|
|
2876
2622
|
});
|
|
2877
2623
|
case "timeout":
|
|
2878
|
-
throw new RivetTimeoutError("Timeout exceeded when calling
|
|
2624
|
+
throw new RivetTimeoutError("Timeout exceeded when calling POST /auth/tokens.");
|
|
2879
2625
|
case "unknown":
|
|
2880
2626
|
throw new RivetError({
|
|
2881
2627
|
message: _response.error.errorMessage
|
|
2882
2628
|
});
|
|
2883
2629
|
}
|
|
2884
2630
|
}
|
|
2885
|
-
async
|
|
2886
|
-
return `Bearer ${await Supplier.get(this._options.token)}`;
|
|
2887
|
-
}
|
|
2888
|
-
};
|
|
2889
|
-
|
|
2890
|
-
// src/api/resources/envoys/client/Client.ts
|
|
2891
|
-
import urlJoin2 from "url-join";
|
|
2892
|
-
var Envoys = class {
|
|
2893
|
-
constructor(_options) {
|
|
2894
|
-
this._options = _options;
|
|
2895
|
-
}
|
|
2896
|
-
/**
|
|
2897
|
-
* @param {Rivet.EnvoysListRequest} request
|
|
2898
|
-
* @param {Envoys.RequestOptions} requestOptions - Request-specific configuration.
|
|
2899
|
-
*
|
|
2900
|
-
* @example
|
|
2901
|
-
* await client.envoys.list({
|
|
2902
|
-
* namespace: "namespace"
|
|
2903
|
-
* })
|
|
2904
|
-
*/
|
|
2905
|
-
async list(request, requestOptions) {
|
|
2906
|
-
const { namespace, name, envoyKey, limit, cursor } = request;
|
|
2907
|
-
const _queryParams = {};
|
|
2908
|
-
_queryParams["namespace"] = namespace;
|
|
2909
|
-
if (name != null) {
|
|
2910
|
-
_queryParams["name"] = name;
|
|
2911
|
-
}
|
|
2912
|
-
if (envoyKey != null) {
|
|
2913
|
-
if (Array.isArray(envoyKey)) {
|
|
2914
|
-
_queryParams["envoy_key"] = envoyKey.map((item) => item);
|
|
2915
|
-
} else {
|
|
2916
|
-
_queryParams["envoy_key"] = envoyKey;
|
|
2917
|
-
}
|
|
2918
|
-
}
|
|
2919
|
-
if (limit != null) {
|
|
2920
|
-
_queryParams["limit"] = limit.toString();
|
|
2921
|
-
}
|
|
2922
|
-
if (cursor != null) {
|
|
2923
|
-
_queryParams["cursor"] = cursor;
|
|
2924
|
-
}
|
|
2631
|
+
async inspect(requestOptions) {
|
|
2925
2632
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2926
|
-
url:
|
|
2633
|
+
url: urlJoin(
|
|
2927
2634
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2928
|
-
"
|
|
2635
|
+
"auth/tokens/inspect"
|
|
2929
2636
|
),
|
|
2930
2637
|
method: "GET",
|
|
2931
2638
|
headers: {
|
|
@@ -2936,14 +2643,13 @@ var Envoys = class {
|
|
|
2936
2643
|
...requestOptions?.headers
|
|
2937
2644
|
},
|
|
2938
2645
|
contentType: "application/json",
|
|
2939
|
-
queryParameters: _queryParams,
|
|
2940
2646
|
requestType: "json",
|
|
2941
2647
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
2942
2648
|
maxRetries: requestOptions?.maxRetries,
|
|
2943
2649
|
abortSignal: requestOptions?.abortSignal
|
|
2944
2650
|
});
|
|
2945
2651
|
if (_response.ok) {
|
|
2946
|
-
return
|
|
2652
|
+
return AuthTokenInspectResponse.parseOrThrow(_response.body, {
|
|
2947
2653
|
unrecognizedObjectKeys: "passthrough",
|
|
2948
2654
|
allowUnrecognizedUnionMembers: true,
|
|
2949
2655
|
allowUnrecognizedEnumValues: true,
|
|
@@ -2964,7 +2670,7 @@ var Envoys = class {
|
|
|
2964
2670
|
body: _response.error.rawBody
|
|
2965
2671
|
});
|
|
2966
2672
|
case "timeout":
|
|
2967
|
-
throw new RivetTimeoutError("Timeout exceeded when calling GET /
|
|
2673
|
+
throw new RivetTimeoutError("Timeout exceeded when calling GET /auth/tokens/inspect.");
|
|
2968
2674
|
case "unknown":
|
|
2969
2675
|
throw new RivetError({
|
|
2970
2676
|
message: _response.error.errorMessage
|
|
@@ -2976,23 +2682,38 @@ var Envoys = class {
|
|
|
2976
2682
|
}
|
|
2977
2683
|
};
|
|
2978
2684
|
|
|
2979
|
-
// src/api/resources/
|
|
2980
|
-
|
|
2981
|
-
|
|
2685
|
+
// src/api/resources/datacenters/index.ts
|
|
2686
|
+
var datacenters_exports = {};
|
|
2687
|
+
|
|
2688
|
+
// src/api/resources/metadata/index.ts
|
|
2689
|
+
var metadata_exports = {};
|
|
2690
|
+
|
|
2691
|
+
// src/api/resources/namespaces/index.ts
|
|
2692
|
+
var namespaces_exports2 = {};
|
|
2693
|
+
|
|
2694
|
+
// src/api/resources/pools/index.ts
|
|
2695
|
+
var pools_exports = {};
|
|
2696
|
+
|
|
2697
|
+
// src/Client.ts
|
|
2698
|
+
import urlJoin6 from "url-join";
|
|
2699
|
+
|
|
2700
|
+
// src/api/resources/datacenters/client/Client.ts
|
|
2701
|
+
import urlJoin2 from "url-join";
|
|
2702
|
+
var Datacenters = class {
|
|
2982
2703
|
constructor(_options) {
|
|
2983
2704
|
this._options = _options;
|
|
2984
2705
|
}
|
|
2985
2706
|
/**
|
|
2986
|
-
* @param {
|
|
2707
|
+
* @param {Datacenters.RequestOptions} requestOptions - Request-specific configuration.
|
|
2987
2708
|
*
|
|
2988
2709
|
* @example
|
|
2989
|
-
* await client.
|
|
2710
|
+
* await client.datacenters.list()
|
|
2990
2711
|
*/
|
|
2991
|
-
async
|
|
2712
|
+
async list(requestOptions) {
|
|
2992
2713
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2993
|
-
url:
|
|
2714
|
+
url: urlJoin2(
|
|
2994
2715
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2995
|
-
"
|
|
2716
|
+
"datacenters"
|
|
2996
2717
|
),
|
|
2997
2718
|
method: "GET",
|
|
2998
2719
|
headers: {
|
|
@@ -3009,7 +2730,7 @@ var Health = class {
|
|
|
3009
2730
|
abortSignal: requestOptions?.abortSignal
|
|
3010
2731
|
});
|
|
3011
2732
|
if (_response.ok) {
|
|
3012
|
-
return
|
|
2733
|
+
return DatacentersListResponse.parseOrThrow(_response.body, {
|
|
3013
2734
|
unrecognizedObjectKeys: "passthrough",
|
|
3014
2735
|
allowUnrecognizedUnionMembers: true,
|
|
3015
2736
|
allowUnrecognizedEnumValues: true,
|
|
@@ -3030,7 +2751,7 @@ var Health = class {
|
|
|
3030
2751
|
body: _response.error.rawBody
|
|
3031
2752
|
});
|
|
3032
2753
|
case "timeout":
|
|
3033
|
-
throw new RivetTimeoutError("Timeout exceeded when calling GET /
|
|
2754
|
+
throw new RivetTimeoutError("Timeout exceeded when calling GET /datacenters.");
|
|
3034
2755
|
case "unknown":
|
|
3035
2756
|
throw new RivetError({
|
|
3036
2757
|
message: _response.error.errorMessage
|
|
@@ -3043,7 +2764,7 @@ var Health = class {
|
|
|
3043
2764
|
};
|
|
3044
2765
|
|
|
3045
2766
|
// src/api/resources/metadata/client/Client.ts
|
|
3046
|
-
import
|
|
2767
|
+
import urlJoin3 from "url-join";
|
|
3047
2768
|
var Metadata = class {
|
|
3048
2769
|
constructor(_options) {
|
|
3049
2770
|
this._options = _options;
|
|
@@ -3056,7 +2777,7 @@ var Metadata = class {
|
|
|
3056
2777
|
*/
|
|
3057
2778
|
async get(requestOptions) {
|
|
3058
2779
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3059
|
-
url:
|
|
2780
|
+
url: urlJoin3(
|
|
3060
2781
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3061
2782
|
"metadata"
|
|
3062
2783
|
),
|
|
@@ -3109,7 +2830,7 @@ var Metadata = class {
|
|
|
3109
2830
|
};
|
|
3110
2831
|
|
|
3111
2832
|
// src/api/resources/namespaces/client/Client.ts
|
|
3112
|
-
import
|
|
2833
|
+
import urlJoin4 from "url-join";
|
|
3113
2834
|
var Namespaces = class {
|
|
3114
2835
|
constructor(_options) {
|
|
3115
2836
|
this._options = _options;
|
|
@@ -3122,7 +2843,7 @@ var Namespaces = class {
|
|
|
3122
2843
|
* await client.namespaces.list()
|
|
3123
2844
|
*/
|
|
3124
2845
|
async list(request = {}, requestOptions) {
|
|
3125
|
-
const { limit, cursor, name
|
|
2846
|
+
const { limit, cursor, name } = request;
|
|
3126
2847
|
const _queryParams = {};
|
|
3127
2848
|
if (limit != null) {
|
|
3128
2849
|
_queryParams["limit"] = limit.toString();
|
|
@@ -3133,20 +2854,8 @@ var Namespaces = class {
|
|
|
3133
2854
|
if (name != null) {
|
|
3134
2855
|
_queryParams["name"] = name;
|
|
3135
2856
|
}
|
|
3136
|
-
if (namespaceIds != null) {
|
|
3137
|
-
_queryParams["namespace_ids"] = namespaceIds;
|
|
3138
|
-
}
|
|
3139
|
-
if (namespaceId != null) {
|
|
3140
|
-
if (Array.isArray(namespaceId)) {
|
|
3141
|
-
_queryParams["namespace_id"] = namespaceId.map(
|
|
3142
|
-
(item) => RivetId.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" })
|
|
3143
|
-
);
|
|
3144
|
-
} else {
|
|
3145
|
-
_queryParams["namespace_id"] = namespaceId;
|
|
3146
|
-
}
|
|
3147
|
-
}
|
|
3148
2857
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3149
|
-
url:
|
|
2858
|
+
url: urlJoin4(
|
|
3150
2859
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3151
2860
|
"namespaces"
|
|
3152
2861
|
),
|
|
@@ -3200,13 +2909,12 @@ var Namespaces = class {
|
|
|
3200
2909
|
*
|
|
3201
2910
|
* @example
|
|
3202
2911
|
* await client.namespaces.create({
|
|
3203
|
-
* displayName: "display_name",
|
|
3204
2912
|
* name: "name"
|
|
3205
2913
|
* })
|
|
3206
2914
|
*/
|
|
3207
2915
|
async create(request, requestOptions) {
|
|
3208
2916
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3209
|
-
url:
|
|
2917
|
+
url: urlJoin4(
|
|
3210
2918
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3211
2919
|
"namespaces"
|
|
3212
2920
|
),
|
|
@@ -3259,43 +2967,28 @@ var Namespaces = class {
|
|
|
3259
2967
|
}
|
|
3260
2968
|
};
|
|
3261
2969
|
|
|
3262
|
-
// src/api/resources/
|
|
3263
|
-
import
|
|
3264
|
-
var
|
|
2970
|
+
// src/api/resources/pools/client/Client.ts
|
|
2971
|
+
import urlJoin5 from "url-join";
|
|
2972
|
+
var Pools = class {
|
|
3265
2973
|
constructor(_options) {
|
|
3266
2974
|
this._options = _options;
|
|
3267
2975
|
}
|
|
3268
2976
|
/**
|
|
3269
|
-
*
|
|
3270
|
-
*
|
|
2977
|
+
* Lists the namespace's pools by name. Changes apply on each node's next connection.
|
|
2978
|
+
*
|
|
2979
|
+
* @param {Rivet.PoolsListRequest} request
|
|
2980
|
+
* @param {Pools.RequestOptions} requestOptions - Request-specific configuration.
|
|
3271
2981
|
*
|
|
3272
2982
|
* @example
|
|
3273
|
-
* await client.
|
|
2983
|
+
* await client.pools.list({
|
|
3274
2984
|
* namespace: "namespace"
|
|
3275
2985
|
* })
|
|
3276
2986
|
*/
|
|
3277
2987
|
async list(request, requestOptions) {
|
|
3278
|
-
const { namespace,
|
|
2988
|
+
const { namespace, limit, cursor } = request;
|
|
3279
2989
|
const _queryParams = {};
|
|
3280
|
-
|
|
3281
|
-
|
|
3282
|
-
_queryParams["name"] = name;
|
|
3283
|
-
}
|
|
3284
|
-
if (runnerIds != null) {
|
|
3285
|
-
_queryParams["runner_ids"] = runnerIds;
|
|
3286
|
-
}
|
|
3287
|
-
if (runnerId != null) {
|
|
3288
|
-
if (Array.isArray(runnerId)) {
|
|
3289
|
-
_queryParams["runner_id"] = runnerId.map(
|
|
3290
|
-
(item) => RivetId.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" })
|
|
3291
|
-
);
|
|
3292
|
-
} else {
|
|
3293
|
-
_queryParams["runner_id"] = runnerId;
|
|
3294
|
-
}
|
|
3295
|
-
}
|
|
3296
|
-
if (includeStopped != null) {
|
|
3297
|
-
_queryParams["include_stopped"] = includeStopped.toString();
|
|
3298
|
-
}
|
|
2990
|
+
if (namespace != null)
|
|
2991
|
+
_queryParams["namespace"] = namespace;
|
|
3299
2992
|
if (limit != null) {
|
|
3300
2993
|
_queryParams["limit"] = limit.toString();
|
|
3301
2994
|
}
|
|
@@ -3303,9 +2996,9 @@ var Runners = class {
|
|
|
3303
2996
|
_queryParams["cursor"] = cursor;
|
|
3304
2997
|
}
|
|
3305
2998
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3306
|
-
url:
|
|
2999
|
+
url: urlJoin5(
|
|
3307
3000
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3308
|
-
"
|
|
3001
|
+
"pools"
|
|
3309
3002
|
),
|
|
3310
3003
|
method: "GET",
|
|
3311
3004
|
headers: {
|
|
@@ -3323,7 +3016,7 @@ var Runners = class {
|
|
|
3323
3016
|
abortSignal: requestOptions?.abortSignal
|
|
3324
3017
|
});
|
|
3325
3018
|
if (_response.ok) {
|
|
3326
|
-
return
|
|
3019
|
+
return PoolsListResponse.parseOrThrow(_response.body, {
|
|
3327
3020
|
unrecognizedObjectKeys: "passthrough",
|
|
3328
3021
|
allowUnrecognizedUnionMembers: true,
|
|
3329
3022
|
allowUnrecognizedEnumValues: true,
|
|
@@ -3344,7 +3037,7 @@ var Runners = class {
|
|
|
3344
3037
|
body: _response.error.rawBody
|
|
3345
3038
|
});
|
|
3346
3039
|
case "timeout":
|
|
3347
|
-
throw new RivetTimeoutError("Timeout exceeded when calling GET /
|
|
3040
|
+
throw new RivetTimeoutError("Timeout exceeded when calling GET /pools.");
|
|
3348
3041
|
case "unknown":
|
|
3349
3042
|
throw new RivetError({
|
|
3350
3043
|
message: _response.error.errorMessage
|
|
@@ -3352,23 +3045,22 @@ var Runners = class {
|
|
|
3352
3045
|
}
|
|
3353
3046
|
}
|
|
3354
3047
|
/**
|
|
3355
|
-
*
|
|
3356
|
-
*
|
|
3357
|
-
* - GET /runners/names (fanout)
|
|
3358
|
-
* - [api-peer] namespace::ops::resolve_for_name_global
|
|
3048
|
+
* Lists the live nodes of a pool in node key order.
|
|
3359
3049
|
*
|
|
3360
|
-
* @param {
|
|
3361
|
-
* @param {
|
|
3050
|
+
* @param {string} pool
|
|
3051
|
+
* @param {Rivet.PoolsListNodesRequest} request
|
|
3052
|
+
* @param {Pools.RequestOptions} requestOptions - Request-specific configuration.
|
|
3362
3053
|
*
|
|
3363
3054
|
* @example
|
|
3364
|
-
* await client.
|
|
3055
|
+
* await client.pools.listNodes("pool", {
|
|
3365
3056
|
* namespace: "namespace"
|
|
3366
3057
|
* })
|
|
3367
3058
|
*/
|
|
3368
|
-
async
|
|
3059
|
+
async listNodes(pool, request, requestOptions) {
|
|
3369
3060
|
const { namespace, limit, cursor } = request;
|
|
3370
3061
|
const _queryParams = {};
|
|
3371
|
-
|
|
3062
|
+
if (namespace != null)
|
|
3063
|
+
_queryParams["namespace"] = namespace;
|
|
3372
3064
|
if (limit != null) {
|
|
3373
3065
|
_queryParams["limit"] = limit.toString();
|
|
3374
3066
|
}
|
|
@@ -3376,9 +3068,9 @@ var Runners = class {
|
|
|
3376
3068
|
_queryParams["cursor"] = cursor;
|
|
3377
3069
|
}
|
|
3378
3070
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3379
|
-
url:
|
|
3071
|
+
url: urlJoin5(
|
|
3380
3072
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3381
|
-
|
|
3073
|
+
`pools/${encodeURIComponent(pool)}/nodes`
|
|
3382
3074
|
),
|
|
3383
3075
|
method: "GET",
|
|
3384
3076
|
headers: {
|
|
@@ -3396,7 +3088,7 @@ var Runners = class {
|
|
|
3396
3088
|
abortSignal: requestOptions?.abortSignal
|
|
3397
3089
|
});
|
|
3398
3090
|
if (_response.ok) {
|
|
3399
|
-
return
|
|
3091
|
+
return PoolsListNodesResponse.parseOrThrow(_response.body, {
|
|
3400
3092
|
unrecognizedObjectKeys: "passthrough",
|
|
3401
3093
|
allowUnrecognizedUnionMembers: true,
|
|
3402
3094
|
allowUnrecognizedEnumValues: true,
|
|
@@ -3417,114 +3109,21 @@ var Runners = class {
|
|
|
3417
3109
|
body: _response.error.rawBody
|
|
3418
3110
|
});
|
|
3419
3111
|
case "timeout":
|
|
3420
|
-
throw new RivetTimeoutError("Timeout exceeded when calling GET /
|
|
3112
|
+
throw new RivetTimeoutError("Timeout exceeded when calling GET /pools/{pool}/nodes.");
|
|
3421
3113
|
case "unknown":
|
|
3422
3114
|
throw new RivetError({
|
|
3423
3115
|
message: _response.error.errorMessage
|
|
3424
3116
|
});
|
|
3425
3117
|
}
|
|
3426
3118
|
}
|
|
3427
|
-
async
|
|
3428
|
-
return `Bearer ${await Supplier.get(this._options.token)}`;
|
|
3429
|
-
}
|
|
3430
|
-
};
|
|
3431
|
-
|
|
3432
|
-
// src/Client.ts
|
|
3433
|
-
var RivetClient = class {
|
|
3434
|
-
constructor(_options) {
|
|
3435
|
-
this._options = _options;
|
|
3436
|
-
}
|
|
3437
|
-
_datacenters;
|
|
3438
|
-
_envoys;
|
|
3439
|
-
_health;
|
|
3440
|
-
_metadata;
|
|
3441
|
-
_namespaces;
|
|
3442
|
-
_runners;
|
|
3443
|
-
get datacenters() {
|
|
3444
|
-
return this._datacenters ??= new Datacenters(this._options);
|
|
3445
|
-
}
|
|
3446
|
-
get envoys() {
|
|
3447
|
-
return this._envoys ??= new Envoys(this._options);
|
|
3448
|
-
}
|
|
3449
|
-
get health() {
|
|
3450
|
-
return this._health ??= new Health(this._options);
|
|
3451
|
-
}
|
|
3452
|
-
get metadata() {
|
|
3453
|
-
return this._metadata ??= new Metadata(this._options);
|
|
3454
|
-
}
|
|
3455
|
-
get namespaces() {
|
|
3456
|
-
return this._namespaces ??= new Namespaces(this._options);
|
|
3457
|
-
}
|
|
3458
|
-
get runners() {
|
|
3459
|
-
return this._runners ??= new Runners(this._options);
|
|
3460
|
-
}
|
|
3461
|
-
/**
|
|
3462
|
-
* **If key is some & `include_destroyed` is false**
|
|
3463
|
-
*
|
|
3464
|
-
* 2 round trips:
|
|
3465
|
-
*
|
|
3466
|
-
* - namespace::ops::resolve_for_name_global
|
|
3467
|
-
* - GET /actors (multiple DCs based on actor IDs)
|
|
3468
|
-
*
|
|
3469
|
-
* This path is optimized because we can read the actor IDs fro the key directly from Epoxy with
|
|
3470
|
-
* stale consistency to determine which datacenter the actor lives in. Under most circumstances,
|
|
3471
|
-
* this means we don't need to fan out to all datacenters (like normal list does).
|
|
3472
|
-
*
|
|
3473
|
-
* The reason `include_destroyed` has to be false is Epoxy only stores currently active actors. If
|
|
3474
|
-
* `include_destroyed` is true, we show all previous iterations of actors with the same key.
|
|
3475
|
-
*
|
|
3476
|
-
* **Otherwise**
|
|
3477
|
-
*
|
|
3478
|
-
* 2 round trips:
|
|
3479
|
-
*
|
|
3480
|
-
* - namespace::ops::resolve_for_name_global
|
|
3481
|
-
* - GET /actors (fanout)
|
|
3482
|
-
*
|
|
3483
|
-
* ## Optimized Alternative Routes
|
|
3484
|
-
*
|
|
3485
|
-
* @param {Rivet.ActorsListRequest} request
|
|
3486
|
-
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3487
|
-
*
|
|
3488
|
-
* @example
|
|
3489
|
-
* await client.actorsList({
|
|
3490
|
-
* namespace: "namespace"
|
|
3491
|
-
* })
|
|
3492
|
-
*/
|
|
3493
|
-
async actorsList(request, requestOptions) {
|
|
3494
|
-
const { namespace, name, key, actorIds, actorId, includeDestroyed, limit, cursor } = request;
|
|
3119
|
+
async get(name, request = {}, requestOptions) {
|
|
3495
3120
|
const _queryParams = {};
|
|
3496
|
-
|
|
3497
|
-
|
|
3498
|
-
_queryParams["name"] = name;
|
|
3499
|
-
}
|
|
3500
|
-
if (key != null) {
|
|
3501
|
-
_queryParams["key"] = key;
|
|
3502
|
-
}
|
|
3503
|
-
if (actorIds != null) {
|
|
3504
|
-
_queryParams["actor_ids"] = actorIds;
|
|
3505
|
-
}
|
|
3506
|
-
if (actorId != null) {
|
|
3507
|
-
if (Array.isArray(actorId)) {
|
|
3508
|
-
_queryParams["actor_id"] = actorId.map(
|
|
3509
|
-
(item) => RivetId.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" })
|
|
3510
|
-
);
|
|
3511
|
-
} else {
|
|
3512
|
-
_queryParams["actor_id"] = actorId;
|
|
3513
|
-
}
|
|
3514
|
-
}
|
|
3515
|
-
if (includeDestroyed != null) {
|
|
3516
|
-
_queryParams["include_destroyed"] = includeDestroyed.toString();
|
|
3517
|
-
}
|
|
3518
|
-
if (limit != null) {
|
|
3519
|
-
_queryParams["limit"] = limit.toString();
|
|
3520
|
-
}
|
|
3521
|
-
if (cursor != null) {
|
|
3522
|
-
_queryParams["cursor"] = cursor;
|
|
3523
|
-
}
|
|
3121
|
+
if (request.namespace != null)
|
|
3122
|
+
_queryParams["namespace"] = request.namespace;
|
|
3524
3123
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3525
|
-
url:
|
|
3124
|
+
url: urlJoin5(
|
|
3526
3125
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3527
|
-
|
|
3126
|
+
`pools/${encodeURIComponent(name)}`
|
|
3528
3127
|
),
|
|
3529
3128
|
method: "GET",
|
|
3530
3129
|
headers: {
|
|
@@ -3542,7 +3141,7 @@ var RivetClient = class {
|
|
|
3542
3141
|
abortSignal: requestOptions?.abortSignal
|
|
3543
3142
|
});
|
|
3544
3143
|
if (_response.ok) {
|
|
3545
|
-
return
|
|
3144
|
+
return PoolResponse.parseOrThrow(_response.body, {
|
|
3546
3145
|
unrecognizedObjectKeys: "passthrough",
|
|
3547
3146
|
allowUnrecognizedUnionMembers: true,
|
|
3548
3147
|
allowUnrecognizedEnumValues: true,
|
|
@@ -3563,52 +3162,23 @@ var RivetClient = class {
|
|
|
3563
3162
|
body: _response.error.rawBody
|
|
3564
3163
|
});
|
|
3565
3164
|
case "timeout":
|
|
3566
|
-
throw new RivetTimeoutError("Timeout exceeded when calling GET /
|
|
3165
|
+
throw new RivetTimeoutError("Timeout exceeded when calling GET /pools/{pool}.");
|
|
3567
3166
|
case "unknown":
|
|
3568
3167
|
throw new RivetError({
|
|
3569
3168
|
message: _response.error.errorMessage
|
|
3570
3169
|
});
|
|
3571
3170
|
}
|
|
3572
3171
|
}
|
|
3573
|
-
|
|
3574
|
-
* **If actor is created in the current datacenter:**
|
|
3575
|
-
*
|
|
3576
|
-
* 2 round trips:
|
|
3577
|
-
*
|
|
3578
|
-
* - namespace::ops::resolve_for_name_global
|
|
3579
|
-
* - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
|
|
3580
|
-
*
|
|
3581
|
-
* **If actor is created in a different datacenter:**
|
|
3582
|
-
*
|
|
3583
|
-
* 3 round trips:
|
|
3584
|
-
*
|
|
3585
|
-
* - namespace::ops::resolve_for_name_global
|
|
3586
|
-
* - POST /actors to remote datacenter
|
|
3587
|
-
* - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
|
|
3588
|
-
*
|
|
3589
|
-
* actor::get will always be in the same datacenter.
|
|
3590
|
-
*
|
|
3591
|
-
* @param {Rivet.ActorsCreateRequest} request
|
|
3592
|
-
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3593
|
-
*
|
|
3594
|
-
* @example
|
|
3595
|
-
* await client.actorsCreate({
|
|
3596
|
-
* namespace: "namespace",
|
|
3597
|
-
* crashPolicy: "restart",
|
|
3598
|
-
* name: "name",
|
|
3599
|
-
* runnerNameSelector: "runner_name_selector"
|
|
3600
|
-
* })
|
|
3601
|
-
*/
|
|
3602
|
-
async actorsCreate(request, requestOptions) {
|
|
3603
|
-
const { namespace, ..._body } = request;
|
|
3172
|
+
async upsert(name, request, requestOptions) {
|
|
3604
3173
|
const _queryParams = {};
|
|
3605
|
-
|
|
3174
|
+
if (request.namespace != null)
|
|
3175
|
+
_queryParams["namespace"] = request.namespace;
|
|
3606
3176
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3607
|
-
url:
|
|
3177
|
+
url: urlJoin5(
|
|
3608
3178
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3609
|
-
|
|
3179
|
+
`pools/${encodeURIComponent(name)}`
|
|
3610
3180
|
),
|
|
3611
|
-
method: "
|
|
3181
|
+
method: "PUT",
|
|
3612
3182
|
headers: {
|
|
3613
3183
|
Authorization: await this._getAuthorizationHeader(),
|
|
3614
3184
|
"X-Fern-Language": "JavaScript",
|
|
@@ -3619,13 +3189,19 @@ var RivetClient = class {
|
|
|
3619
3189
|
contentType: "application/json",
|
|
3620
3190
|
queryParameters: _queryParams,
|
|
3621
3191
|
requestType: "json",
|
|
3622
|
-
body:
|
|
3192
|
+
body: {
|
|
3193
|
+
drain_on_version_upgrade: request.drainOnVersionUpgrade,
|
|
3194
|
+
actor_eviction_delay: request.actorEvictionDelay,
|
|
3195
|
+
actor_eviction_period: request.actorEvictionPeriod,
|
|
3196
|
+
actor_eviction_rate: request.actorEvictionRate,
|
|
3197
|
+
metadata: request.metadata
|
|
3198
|
+
},
|
|
3623
3199
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
3624
3200
|
maxRetries: requestOptions?.maxRetries,
|
|
3625
3201
|
abortSignal: requestOptions?.abortSignal
|
|
3626
3202
|
});
|
|
3627
3203
|
if (_response.ok) {
|
|
3628
|
-
return
|
|
3204
|
+
return PoolResponse.parseOrThrow(_response.body, {
|
|
3629
3205
|
unrecognizedObjectKeys: "passthrough",
|
|
3630
3206
|
allowUnrecognizedUnionMembers: true,
|
|
3631
3207
|
allowUnrecognizedEnumValues: true,
|
|
@@ -3646,62 +3222,23 @@ var RivetClient = class {
|
|
|
3646
3222
|
body: _response.error.rawBody
|
|
3647
3223
|
});
|
|
3648
3224
|
case "timeout":
|
|
3649
|
-
throw new RivetTimeoutError("Timeout exceeded when calling
|
|
3225
|
+
throw new RivetTimeoutError("Timeout exceeded when calling PUT /pools/{pool}.");
|
|
3650
3226
|
case "unknown":
|
|
3651
3227
|
throw new RivetError({
|
|
3652
3228
|
message: _response.error.errorMessage
|
|
3653
3229
|
});
|
|
3654
3230
|
}
|
|
3655
3231
|
}
|
|
3656
|
-
|
|
3657
|
-
* **If actor exists**
|
|
3658
|
-
*
|
|
3659
|
-
* 2 round trips:
|
|
3660
|
-
*
|
|
3661
|
-
* - namespace::ops::resolve_for_name_global
|
|
3662
|
-
* - GET /actors/{}
|
|
3663
|
-
*
|
|
3664
|
-
* **If actor does not exist and is created in the current datacenter:**
|
|
3665
|
-
*
|
|
3666
|
-
* 2 round trips:
|
|
3667
|
-
*
|
|
3668
|
-
* - namespace::ops::resolve_for_name_global
|
|
3669
|
-
* - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
|
|
3670
|
-
*
|
|
3671
|
-
* **If actor does not exist and is created in a different datacenter:**
|
|
3672
|
-
*
|
|
3673
|
-
* 3 round trips:
|
|
3674
|
-
*
|
|
3675
|
-
* - namespace::ops::resolve_for_name_global
|
|
3676
|
-
* - POST /actors to remote datacenter
|
|
3677
|
-
* - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
|
|
3678
|
-
*
|
|
3679
|
-
* actor::get will always be in the same datacenter.
|
|
3680
|
-
*
|
|
3681
|
-
* ## Optimized Alternative Routes
|
|
3682
|
-
*
|
|
3683
|
-
* @param {Rivet.ActorsGetOrCreateRequest} request
|
|
3684
|
-
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3685
|
-
*
|
|
3686
|
-
* @example
|
|
3687
|
-
* await client.actorsGetOrCreate({
|
|
3688
|
-
* namespace: "namespace",
|
|
3689
|
-
* crashPolicy: "restart",
|
|
3690
|
-
* key: "key",
|
|
3691
|
-
* name: "name",
|
|
3692
|
-
* runnerNameSelector: "runner_name_selector"
|
|
3693
|
-
* })
|
|
3694
|
-
*/
|
|
3695
|
-
async actorsGetOrCreate(request, requestOptions) {
|
|
3696
|
-
const { namespace, ..._body } = request;
|
|
3232
|
+
async delete(name, request = {}, requestOptions) {
|
|
3697
3233
|
const _queryParams = {};
|
|
3698
|
-
|
|
3234
|
+
if (request.namespace != null)
|
|
3235
|
+
_queryParams["namespace"] = request.namespace;
|
|
3699
3236
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3700
|
-
url:
|
|
3237
|
+
url: urlJoin5(
|
|
3701
3238
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3702
|
-
|
|
3239
|
+
`pools/${encodeURIComponent(name)}`
|
|
3703
3240
|
),
|
|
3704
|
-
method: "
|
|
3241
|
+
method: "DELETE",
|
|
3705
3242
|
headers: {
|
|
3706
3243
|
Authorization: await this._getAuthorizationHeader(),
|
|
3707
3244
|
"X-Fern-Language": "JavaScript",
|
|
@@ -3712,19 +3249,12 @@ var RivetClient = class {
|
|
|
3712
3249
|
contentType: "application/json",
|
|
3713
3250
|
queryParameters: _queryParams,
|
|
3714
3251
|
requestType: "json",
|
|
3715
|
-
body: ActorsGetOrCreateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
3716
3252
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
3717
3253
|
maxRetries: requestOptions?.maxRetries,
|
|
3718
3254
|
abortSignal: requestOptions?.abortSignal
|
|
3719
3255
|
});
|
|
3720
3256
|
if (_response.ok) {
|
|
3721
|
-
return
|
|
3722
|
-
unrecognizedObjectKeys: "passthrough",
|
|
3723
|
-
allowUnrecognizedUnionMembers: true,
|
|
3724
|
-
allowUnrecognizedEnumValues: true,
|
|
3725
|
-
skipValidation: true,
|
|
3726
|
-
breadcrumbsPrefix: ["response"]
|
|
3727
|
-
});
|
|
3257
|
+
return PoolsDeleteResponse.parseOrThrow(_response.body, { skipValidation: true });
|
|
3728
3258
|
}
|
|
3729
3259
|
if (_response.error.reason === "status-code") {
|
|
3730
3260
|
throw new RivetError({
|
|
@@ -3739,31 +3269,94 @@ var RivetClient = class {
|
|
|
3739
3269
|
body: _response.error.rawBody
|
|
3740
3270
|
});
|
|
3741
3271
|
case "timeout":
|
|
3742
|
-
throw new RivetTimeoutError("Timeout exceeded when calling
|
|
3272
|
+
throw new RivetTimeoutError("Timeout exceeded when calling DELETE /pools/{pool}.");
|
|
3743
3273
|
case "unknown":
|
|
3744
3274
|
throw new RivetError({
|
|
3745
3275
|
message: _response.error.errorMessage
|
|
3746
3276
|
});
|
|
3747
3277
|
}
|
|
3748
3278
|
}
|
|
3279
|
+
async _getAuthorizationHeader() {
|
|
3280
|
+
return `Bearer ${await Supplier.get(this._options.token)}`;
|
|
3281
|
+
}
|
|
3282
|
+
};
|
|
3283
|
+
|
|
3284
|
+
// src/Client.ts
|
|
3285
|
+
var RivetClient = class {
|
|
3286
|
+
constructor(_options) {
|
|
3287
|
+
this._options = _options;
|
|
3288
|
+
}
|
|
3289
|
+
_authTokens;
|
|
3290
|
+
_datacenters;
|
|
3291
|
+
_metadata;
|
|
3292
|
+
_namespaces;
|
|
3293
|
+
_pools;
|
|
3294
|
+
get authTokens() {
|
|
3295
|
+
return this._authTokens ??= new AuthTokens(this._options);
|
|
3296
|
+
}
|
|
3297
|
+
get datacenters() {
|
|
3298
|
+
return this._datacenters ??= new Datacenters(this._options);
|
|
3299
|
+
}
|
|
3300
|
+
get metadata() {
|
|
3301
|
+
return this._metadata ??= new Metadata(this._options);
|
|
3302
|
+
}
|
|
3303
|
+
get namespaces() {
|
|
3304
|
+
return this._namespaces ??= new Namespaces(this._options);
|
|
3305
|
+
}
|
|
3306
|
+
get pools() {
|
|
3307
|
+
return this._pools ??= new Pools(this._options);
|
|
3308
|
+
}
|
|
3749
3309
|
/**
|
|
3310
|
+
* **If key is some & `include_destroyed` is false**
|
|
3311
|
+
*
|
|
3750
3312
|
* 2 round trips:
|
|
3751
3313
|
*
|
|
3752
|
-
* -
|
|
3753
|
-
* -
|
|
3314
|
+
* - namespace::ops::resolve_for_name_global
|
|
3315
|
+
* - GET /actors (multiple DCs based on actor IDs)
|
|
3754
3316
|
*
|
|
3755
|
-
*
|
|
3317
|
+
* This path is optimized because we can read the actor IDs fro the key directly from Epoxy with
|
|
3318
|
+
* stale consistency to determine which datacenter the actor lives in. Under most circumstances,
|
|
3319
|
+
* this means we don't need to fan out to all datacenters (like normal list does).
|
|
3320
|
+
*
|
|
3321
|
+
* The reason `include_destroyed` has to be false is Epoxy only stores currently active actors. If
|
|
3322
|
+
* `include_destroyed` is true, we show all previous iterations of actors with the same key.
|
|
3323
|
+
*
|
|
3324
|
+
* **Otherwise**
|
|
3325
|
+
*
|
|
3326
|
+
* 2 round trips:
|
|
3327
|
+
*
|
|
3328
|
+
* - namespace::ops::resolve_for_name_global
|
|
3329
|
+
* - GET /actors (fanout)
|
|
3330
|
+
*
|
|
3331
|
+
* ## Optimized Alternative Routes
|
|
3332
|
+
*
|
|
3333
|
+
* @param {Rivet.ActorsListRequest} request
|
|
3756
3334
|
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3757
3335
|
*
|
|
3758
3336
|
* @example
|
|
3759
|
-
* await client.
|
|
3337
|
+
* await client.actorsList({
|
|
3760
3338
|
* namespace: "namespace"
|
|
3761
3339
|
* })
|
|
3762
3340
|
*/
|
|
3763
|
-
async
|
|
3764
|
-
const { namespace, limit, cursor } = request;
|
|
3341
|
+
async actorsList(request, requestOptions) {
|
|
3342
|
+
const { namespace, name, key, actorIds, actorId, includeDestroyed, limit, cursor } = request;
|
|
3765
3343
|
const _queryParams = {};
|
|
3766
|
-
|
|
3344
|
+
if (namespace != null)
|
|
3345
|
+
_queryParams["namespace"] = namespace;
|
|
3346
|
+
if (name != null) {
|
|
3347
|
+
_queryParams["name"] = name;
|
|
3348
|
+
}
|
|
3349
|
+
if (key != null) {
|
|
3350
|
+
_queryParams["key"] = key;
|
|
3351
|
+
}
|
|
3352
|
+
if (actorIds != null) {
|
|
3353
|
+
_queryParams["actor_ids"] = actorIds;
|
|
3354
|
+
}
|
|
3355
|
+
if (actorId != null)
|
|
3356
|
+
_queryParams["actor_id"] = actorId;
|
|
3357
|
+
if (includeDestroyed != null) {
|
|
3358
|
+
_queryParams["include_destroyed"] = includeDestroyed.toString();
|
|
3359
|
+
}
|
|
3767
3360
|
if (limit != null) {
|
|
3768
3361
|
_queryParams["limit"] = limit.toString();
|
|
3769
3362
|
}
|
|
@@ -3771,9 +3364,9 @@ var RivetClient = class {
|
|
|
3771
3364
|
_queryParams["cursor"] = cursor;
|
|
3772
3365
|
}
|
|
3773
3366
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3774
|
-
url:
|
|
3367
|
+
url: urlJoin6(
|
|
3775
3368
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3776
|
-
"actors
|
|
3369
|
+
"actors"
|
|
3777
3370
|
),
|
|
3778
3371
|
method: "GET",
|
|
3779
3372
|
headers: {
|
|
@@ -3791,7 +3384,7 @@ var RivetClient = class {
|
|
|
3791
3384
|
abortSignal: requestOptions?.abortSignal
|
|
3792
3385
|
});
|
|
3793
3386
|
if (_response.ok) {
|
|
3794
|
-
return
|
|
3387
|
+
return ActorsListResponse.parseOrThrow(_response.body, {
|
|
3795
3388
|
unrecognizedObjectKeys: "passthrough",
|
|
3796
3389
|
allowUnrecognizedUnionMembers: true,
|
|
3797
3390
|
allowUnrecognizedEnumValues: true,
|
|
@@ -3812,7 +3405,7 @@ var RivetClient = class {
|
|
|
3812
3405
|
body: _response.error.rawBody
|
|
3813
3406
|
});
|
|
3814
3407
|
case "timeout":
|
|
3815
|
-
throw new RivetTimeoutError("Timeout exceeded when calling GET /actors
|
|
3408
|
+
throw new RivetTimeoutError("Timeout exceeded when calling GET /actors.");
|
|
3816
3409
|
case "unknown":
|
|
3817
3410
|
throw new RivetError({
|
|
3818
3411
|
message: _response.error.errorMessage
|
|
@@ -3820,160 +3413,42 @@ var RivetClient = class {
|
|
|
3820
3413
|
}
|
|
3821
3414
|
}
|
|
3822
3415
|
/**
|
|
3823
|
-
*
|
|
3416
|
+
* **If actor is created in the current datacenter:**
|
|
3824
3417
|
*
|
|
3825
|
-
*
|
|
3826
|
-
* - [api-peer] namespace::ops::resolve_for_name_global
|
|
3418
|
+
* 2 round trips:
|
|
3827
3419
|
*
|
|
3828
|
-
*
|
|
3829
|
-
*
|
|
3830
|
-
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3420
|
+
* - namespace::ops::resolve_for_name_global
|
|
3421
|
+
* - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
|
|
3831
3422
|
*
|
|
3832
|
-
*
|
|
3833
|
-
* await client.actorsDelete("actor_id", {
|
|
3834
|
-
* namespace: "namespace"
|
|
3835
|
-
* })
|
|
3836
|
-
*/
|
|
3837
|
-
async actorsDelete(actorId, request, requestOptions) {
|
|
3838
|
-
const { namespace } = request;
|
|
3839
|
-
const _queryParams = {};
|
|
3840
|
-
_queryParams["namespace"] = namespace;
|
|
3841
|
-
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3842
|
-
url: urlJoin7(
|
|
3843
|
-
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3844
|
-
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}`
|
|
3845
|
-
),
|
|
3846
|
-
method: "DELETE",
|
|
3847
|
-
headers: {
|
|
3848
|
-
Authorization: await this._getAuthorizationHeader(),
|
|
3849
|
-
"X-Fern-Language": "JavaScript",
|
|
3850
|
-
"X-Fern-Runtime": RUNTIME.type,
|
|
3851
|
-
"X-Fern-Runtime-Version": RUNTIME.version,
|
|
3852
|
-
...requestOptions?.headers
|
|
3853
|
-
},
|
|
3854
|
-
contentType: "application/json",
|
|
3855
|
-
queryParameters: _queryParams,
|
|
3856
|
-
requestType: "json",
|
|
3857
|
-
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
3858
|
-
maxRetries: requestOptions?.maxRetries,
|
|
3859
|
-
abortSignal: requestOptions?.abortSignal
|
|
3860
|
-
});
|
|
3861
|
-
if (_response.ok) {
|
|
3862
|
-
return ActorsDeleteResponse.parseOrThrow(_response.body, {
|
|
3863
|
-
unrecognizedObjectKeys: "passthrough",
|
|
3864
|
-
allowUnrecognizedUnionMembers: true,
|
|
3865
|
-
allowUnrecognizedEnumValues: true,
|
|
3866
|
-
skipValidation: true,
|
|
3867
|
-
breadcrumbsPrefix: ["response"]
|
|
3868
|
-
});
|
|
3869
|
-
}
|
|
3870
|
-
if (_response.error.reason === "status-code") {
|
|
3871
|
-
throw new RivetError({
|
|
3872
|
-
statusCode: _response.error.statusCode,
|
|
3873
|
-
body: _response.error.body
|
|
3874
|
-
});
|
|
3875
|
-
}
|
|
3876
|
-
switch (_response.error.reason) {
|
|
3877
|
-
case "non-json":
|
|
3878
|
-
throw new RivetError({
|
|
3879
|
-
statusCode: _response.error.statusCode,
|
|
3880
|
-
body: _response.error.rawBody
|
|
3881
|
-
});
|
|
3882
|
-
case "timeout":
|
|
3883
|
-
throw new RivetTimeoutError("Timeout exceeded when calling DELETE /actors/{actor_id}.");
|
|
3884
|
-
case "unknown":
|
|
3885
|
-
throw new RivetError({
|
|
3886
|
-
message: _response.error.errorMessage
|
|
3887
|
-
});
|
|
3888
|
-
}
|
|
3889
|
-
}
|
|
3890
|
-
/**
|
|
3891
|
-
* @param {Rivet.RivetId} actorId
|
|
3892
|
-
* @param {string} key
|
|
3893
|
-
* @param {Rivet.ActorsKvGetRequest} request
|
|
3894
|
-
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3423
|
+
* **If actor is created in a different datacenter:**
|
|
3895
3424
|
*
|
|
3896
|
-
*
|
|
3897
|
-
*
|
|
3898
|
-
*
|
|
3899
|
-
*
|
|
3900
|
-
|
|
3901
|
-
|
|
3902
|
-
|
|
3903
|
-
|
|
3904
|
-
|
|
3905
|
-
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3906
|
-
url: urlJoin7(
|
|
3907
|
-
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3908
|
-
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}/kv/keys/${encodeURIComponent(key)}`
|
|
3909
|
-
),
|
|
3910
|
-
method: "GET",
|
|
3911
|
-
headers: {
|
|
3912
|
-
Authorization: await this._getAuthorizationHeader(),
|
|
3913
|
-
"X-Fern-Language": "JavaScript",
|
|
3914
|
-
"X-Fern-Runtime": RUNTIME.type,
|
|
3915
|
-
"X-Fern-Runtime-Version": RUNTIME.version,
|
|
3916
|
-
...requestOptions?.headers
|
|
3917
|
-
},
|
|
3918
|
-
contentType: "application/json",
|
|
3919
|
-
queryParameters: _queryParams,
|
|
3920
|
-
requestType: "json",
|
|
3921
|
-
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
3922
|
-
maxRetries: requestOptions?.maxRetries,
|
|
3923
|
-
abortSignal: requestOptions?.abortSignal
|
|
3924
|
-
});
|
|
3925
|
-
if (_response.ok) {
|
|
3926
|
-
return ActorsKvGetResponse.parseOrThrow(_response.body, {
|
|
3927
|
-
unrecognizedObjectKeys: "passthrough",
|
|
3928
|
-
allowUnrecognizedUnionMembers: true,
|
|
3929
|
-
allowUnrecognizedEnumValues: true,
|
|
3930
|
-
skipValidation: true,
|
|
3931
|
-
breadcrumbsPrefix: ["response"]
|
|
3932
|
-
});
|
|
3933
|
-
}
|
|
3934
|
-
if (_response.error.reason === "status-code") {
|
|
3935
|
-
throw new RivetError({
|
|
3936
|
-
statusCode: _response.error.statusCode,
|
|
3937
|
-
body: _response.error.body
|
|
3938
|
-
});
|
|
3939
|
-
}
|
|
3940
|
-
switch (_response.error.reason) {
|
|
3941
|
-
case "non-json":
|
|
3942
|
-
throw new RivetError({
|
|
3943
|
-
statusCode: _response.error.statusCode,
|
|
3944
|
-
body: _response.error.rawBody
|
|
3945
|
-
});
|
|
3946
|
-
case "timeout":
|
|
3947
|
-
throw new RivetTimeoutError(
|
|
3948
|
-
"Timeout exceeded when calling GET /actors/{actor_id}/kv/keys/{key}."
|
|
3949
|
-
);
|
|
3950
|
-
case "unknown":
|
|
3951
|
-
throw new RivetError({
|
|
3952
|
-
message: _response.error.errorMessage
|
|
3953
|
-
});
|
|
3954
|
-
}
|
|
3955
|
-
}
|
|
3956
|
-
/**
|
|
3957
|
-
* @param {Rivet.RivetId} actorId
|
|
3958
|
-
* @param {Rivet.ActorsRescheduleRequest} request
|
|
3425
|
+
* 3 round trips:
|
|
3426
|
+
*
|
|
3427
|
+
* - namespace::ops::resolve_for_name_global
|
|
3428
|
+
* - POST /actors to remote datacenter
|
|
3429
|
+
* - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
|
|
3430
|
+
*
|
|
3431
|
+
* actor::get will always be in the same datacenter.
|
|
3432
|
+
*
|
|
3433
|
+
* @param {Rivet.ActorsCreateRequest} request
|
|
3959
3434
|
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3960
3435
|
*
|
|
3961
3436
|
* @example
|
|
3962
|
-
* await client.
|
|
3437
|
+
* await client.actorsCreate({
|
|
3963
3438
|
* namespace: "namespace",
|
|
3964
|
-
*
|
|
3965
|
-
*
|
|
3966
|
-
* }
|
|
3439
|
+
* name: "name",
|
|
3440
|
+
* pool: "pool"
|
|
3967
3441
|
* })
|
|
3968
3442
|
*/
|
|
3969
|
-
async
|
|
3970
|
-
const { namespace,
|
|
3443
|
+
async actorsCreate(request, requestOptions) {
|
|
3444
|
+
const { namespace, ..._body } = request;
|
|
3971
3445
|
const _queryParams = {};
|
|
3972
|
-
|
|
3446
|
+
if (namespace != null)
|
|
3447
|
+
_queryParams["namespace"] = namespace;
|
|
3973
3448
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3974
|
-
url:
|
|
3449
|
+
url: urlJoin6(
|
|
3975
3450
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3976
|
-
|
|
3451
|
+
"actors"
|
|
3977
3452
|
),
|
|
3978
3453
|
method: "POST",
|
|
3979
3454
|
headers: {
|
|
@@ -3986,13 +3461,13 @@ var RivetClient = class {
|
|
|
3986
3461
|
contentType: "application/json",
|
|
3987
3462
|
queryParameters: _queryParams,
|
|
3988
3463
|
requestType: "json",
|
|
3989
|
-
body:
|
|
3464
|
+
body: ActorsCreateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
3990
3465
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
3991
3466
|
maxRetries: requestOptions?.maxRetries,
|
|
3992
3467
|
abortSignal: requestOptions?.abortSignal
|
|
3993
3468
|
});
|
|
3994
3469
|
if (_response.ok) {
|
|
3995
|
-
return
|
|
3470
|
+
return ActorsCreateResponse.parseOrThrow(_response.body, {
|
|
3996
3471
|
unrecognizedObjectKeys: "passthrough",
|
|
3997
3472
|
allowUnrecognizedUnionMembers: true,
|
|
3998
3473
|
allowUnrecognizedEnumValues: true,
|
|
@@ -4013,7 +3488,7 @@ var RivetClient = class {
|
|
|
4013
3488
|
body: _response.error.rawBody
|
|
4014
3489
|
});
|
|
4015
3490
|
case "timeout":
|
|
4016
|
-
throw new RivetTimeoutError("Timeout exceeded when calling POST /actors
|
|
3491
|
+
throw new RivetTimeoutError("Timeout exceeded when calling POST /actors.");
|
|
4017
3492
|
case "unknown":
|
|
4018
3493
|
throw new RivetError({
|
|
4019
3494
|
message: _response.error.errorMessage
|
|
@@ -4021,28 +3496,54 @@ var RivetClient = class {
|
|
|
4021
3496
|
}
|
|
4022
3497
|
}
|
|
4023
3498
|
/**
|
|
4024
|
-
*
|
|
4025
|
-
*
|
|
3499
|
+
* **If actor exists**
|
|
3500
|
+
*
|
|
3501
|
+
* 2 round trips:
|
|
3502
|
+
*
|
|
3503
|
+
* - namespace::ops::resolve_for_name_global
|
|
3504
|
+
* - GET /actors/{}
|
|
3505
|
+
*
|
|
3506
|
+
* **If actor does not exist and is created in the current datacenter:**
|
|
3507
|
+
*
|
|
3508
|
+
* 2 round trips:
|
|
3509
|
+
*
|
|
3510
|
+
* - namespace::ops::resolve_for_name_global
|
|
3511
|
+
* - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
|
|
3512
|
+
*
|
|
3513
|
+
* **If actor does not exist and is created in a different datacenter:**
|
|
3514
|
+
*
|
|
3515
|
+
* 3 round trips:
|
|
3516
|
+
*
|
|
3517
|
+
* - namespace::ops::resolve_for_name_global
|
|
3518
|
+
* - POST /actors to remote datacenter
|
|
3519
|
+
* - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
|
|
3520
|
+
*
|
|
3521
|
+
* actor::get will always be in the same datacenter.
|
|
3522
|
+
*
|
|
3523
|
+
* ## Optimized Alternative Routes
|
|
3524
|
+
*
|
|
3525
|
+
* @param {Rivet.ActorsGetOrCreateRequest} request
|
|
4026
3526
|
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4027
3527
|
*
|
|
4028
3528
|
* @example
|
|
4029
|
-
* await client.
|
|
3529
|
+
* await client.actorsGetOrCreate({
|
|
4030
3530
|
* namespace: "namespace",
|
|
4031
|
-
*
|
|
4032
|
-
*
|
|
4033
|
-
*
|
|
3531
|
+
* key: "key",
|
|
3532
|
+
* name: "name",
|
|
3533
|
+
* pool: "pool"
|
|
4034
3534
|
* })
|
|
4035
3535
|
*/
|
|
4036
|
-
async
|
|
4037
|
-
const { namespace,
|
|
3536
|
+
async actorsGetOrCreate(request, requestOptions) {
|
|
3537
|
+
const { namespace, ..._body } = request;
|
|
4038
3538
|
const _queryParams = {};
|
|
4039
|
-
|
|
3539
|
+
if (namespace != null)
|
|
3540
|
+
_queryParams["namespace"] = namespace;
|
|
4040
3541
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4041
|
-
url:
|
|
3542
|
+
url: urlJoin6(
|
|
4042
3543
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4043
|
-
|
|
3544
|
+
"actors"
|
|
4044
3545
|
),
|
|
4045
|
-
method: "
|
|
3546
|
+
method: "PUT",
|
|
4046
3547
|
headers: {
|
|
4047
3548
|
Authorization: await this._getAuthorizationHeader(),
|
|
4048
3549
|
"X-Fern-Language": "JavaScript",
|
|
@@ -4053,13 +3554,13 @@ var RivetClient = class {
|
|
|
4053
3554
|
contentType: "application/json",
|
|
4054
3555
|
queryParameters: _queryParams,
|
|
4055
3556
|
requestType: "json",
|
|
4056
|
-
body:
|
|
3557
|
+
body: ActorsGetOrCreateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
4057
3558
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
4058
3559
|
maxRetries: requestOptions?.maxRetries,
|
|
4059
3560
|
abortSignal: requestOptions?.abortSignal
|
|
4060
3561
|
});
|
|
4061
3562
|
if (_response.ok) {
|
|
4062
|
-
return
|
|
3563
|
+
return ActorsGetOrCreateResponse.parseOrThrow(_response.body, {
|
|
4063
3564
|
unrecognizedObjectKeys: "passthrough",
|
|
4064
3565
|
allowUnrecognizedUnionMembers: true,
|
|
4065
3566
|
allowUnrecognizedEnumValues: true,
|
|
@@ -4080,7 +3581,7 @@ var RivetClient = class {
|
|
|
4080
3581
|
body: _response.error.rawBody
|
|
4081
3582
|
});
|
|
4082
3583
|
case "timeout":
|
|
4083
|
-
throw new RivetTimeoutError("Timeout exceeded when calling
|
|
3584
|
+
throw new RivetTimeoutError("Timeout exceeded when calling PUT /actors.");
|
|
4084
3585
|
case "unknown":
|
|
4085
3586
|
throw new RivetError({
|
|
4086
3587
|
message: _response.error.errorMessage
|
|
@@ -4088,43 +3589,34 @@ var RivetClient = class {
|
|
|
4088
3589
|
}
|
|
4089
3590
|
}
|
|
4090
3591
|
/**
|
|
4091
|
-
*
|
|
3592
|
+
* 2 round trips:
|
|
3593
|
+
*
|
|
3594
|
+
* - GET /actors/names (fanout)
|
|
3595
|
+
* - [api-peer] namespace::ops::resolve_for_name_global
|
|
3596
|
+
*
|
|
3597
|
+
* @param {Rivet.ActorsListNamesRequest} request
|
|
4092
3598
|
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4093
3599
|
*
|
|
4094
3600
|
* @example
|
|
4095
|
-
* await client.
|
|
3601
|
+
* await client.actorsListNames({
|
|
4096
3602
|
* namespace: "namespace"
|
|
4097
3603
|
* })
|
|
4098
3604
|
*/
|
|
4099
|
-
async
|
|
4100
|
-
const { namespace, limit, cursor
|
|
3605
|
+
async actorsListNames(request, requestOptions) {
|
|
3606
|
+
const { namespace, limit, cursor } = request;
|
|
4101
3607
|
const _queryParams = {};
|
|
4102
|
-
|
|
3608
|
+
if (namespace != null)
|
|
3609
|
+
_queryParams["namespace"] = namespace;
|
|
4103
3610
|
if (limit != null) {
|
|
4104
3611
|
_queryParams["limit"] = limit.toString();
|
|
4105
3612
|
}
|
|
4106
3613
|
if (cursor != null) {
|
|
4107
3614
|
_queryParams["cursor"] = cursor;
|
|
4108
3615
|
}
|
|
4109
|
-
if (variant != null) {
|
|
4110
|
-
_queryParams["variant"] = RunnerConfigVariant2.jsonOrThrow(variant, {
|
|
4111
|
-
unrecognizedObjectKeys: "strip"
|
|
4112
|
-
});
|
|
4113
|
-
}
|
|
4114
|
-
if (runnerNames != null) {
|
|
4115
|
-
_queryParams["runner_names"] = runnerNames;
|
|
4116
|
-
}
|
|
4117
|
-
if (runnerName != null) {
|
|
4118
|
-
if (Array.isArray(runnerName)) {
|
|
4119
|
-
_queryParams["runner_name"] = runnerName.map((item) => item);
|
|
4120
|
-
} else {
|
|
4121
|
-
_queryParams["runner_name"] = runnerName;
|
|
4122
|
-
}
|
|
4123
|
-
}
|
|
4124
3616
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4125
|
-
url:
|
|
3617
|
+
url: urlJoin6(
|
|
4126
3618
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4127
|
-
"
|
|
3619
|
+
"actors/names"
|
|
4128
3620
|
),
|
|
4129
3621
|
method: "GET",
|
|
4130
3622
|
headers: {
|
|
@@ -4142,7 +3634,7 @@ var RivetClient = class {
|
|
|
4142
3634
|
abortSignal: requestOptions?.abortSignal
|
|
4143
3635
|
});
|
|
4144
3636
|
if (_response.ok) {
|
|
4145
|
-
return
|
|
3637
|
+
return ActorsListNamesResponse.parseOrThrow(_response.body, {
|
|
4146
3638
|
unrecognizedObjectKeys: "passthrough",
|
|
4147
3639
|
allowUnrecognizedUnionMembers: true,
|
|
4148
3640
|
allowUnrecognizedEnumValues: true,
|
|
@@ -4163,7 +3655,7 @@ var RivetClient = class {
|
|
|
4163
3655
|
body: _response.error.rawBody
|
|
4164
3656
|
});
|
|
4165
3657
|
case "timeout":
|
|
4166
|
-
throw new RivetTimeoutError("Timeout exceeded when calling GET /
|
|
3658
|
+
throw new RivetTimeoutError("Timeout exceeded when calling GET /actors/names.");
|
|
4167
3659
|
case "unknown":
|
|
4168
3660
|
throw new RivetError({
|
|
4169
3661
|
message: _response.error.errorMessage
|
|
@@ -4171,25 +3663,32 @@ var RivetClient = class {
|
|
|
4171
3663
|
}
|
|
4172
3664
|
}
|
|
4173
3665
|
/**
|
|
4174
|
-
*
|
|
3666
|
+
* 2 round trip:
|
|
3667
|
+
*
|
|
3668
|
+
* - DELETE /actors/{}
|
|
3669
|
+
* - [api-peer] namespace::ops::resolve_for_name_global
|
|
3670
|
+
*
|
|
3671
|
+
* @param {Rivet.RivetId} actorId
|
|
3672
|
+
* @param {Rivet.ActorsDeleteRequest} request
|
|
4175
3673
|
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4176
3674
|
*
|
|
4177
3675
|
* @example
|
|
4178
|
-
* await client.
|
|
4179
|
-
* namespace: "namespace"
|
|
4180
|
-
* url: "url"
|
|
3676
|
+
* await client.actorsDelete("actor_id", {
|
|
3677
|
+
* namespace: "namespace"
|
|
4181
3678
|
* })
|
|
4182
3679
|
*/
|
|
4183
|
-
|
|
4184
|
-
|
|
3680
|
+
/** Returns one actor by ID. */
|
|
3681
|
+
async actorsGet(actorId, request, requestOptions) {
|
|
3682
|
+
const { namespace } = request;
|
|
4185
3683
|
const _queryParams = {};
|
|
4186
|
-
|
|
3684
|
+
if (namespace != null)
|
|
3685
|
+
_queryParams["namespace"] = namespace;
|
|
4187
3686
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4188
|
-
url:
|
|
3687
|
+
url: urlJoin6(
|
|
4189
3688
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4190
|
-
|
|
3689
|
+
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}`
|
|
4191
3690
|
),
|
|
4192
|
-
method: "
|
|
3691
|
+
method: "GET",
|
|
4193
3692
|
headers: {
|
|
4194
3693
|
Authorization: await this._getAuthorizationHeader(),
|
|
4195
3694
|
"X-Fern-Language": "JavaScript",
|
|
@@ -4200,15 +3699,12 @@ var RivetClient = class {
|
|
|
4200
3699
|
contentType: "application/json",
|
|
4201
3700
|
queryParameters: _queryParams,
|
|
4202
3701
|
requestType: "json",
|
|
4203
|
-
body: RunnerConfigsServerlessHealthCheckRequest.jsonOrThrow(_body, {
|
|
4204
|
-
unrecognizedObjectKeys: "strip"
|
|
4205
|
-
}),
|
|
4206
3702
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
4207
3703
|
maxRetries: requestOptions?.maxRetries,
|
|
4208
3704
|
abortSignal: requestOptions?.abortSignal
|
|
4209
3705
|
});
|
|
4210
3706
|
if (_response.ok) {
|
|
4211
|
-
return
|
|
3707
|
+
return ActorsGetResponse.parseOrThrow(_response.body, {
|
|
4212
3708
|
unrecognizedObjectKeys: "passthrough",
|
|
4213
3709
|
allowUnrecognizedUnionMembers: true,
|
|
4214
3710
|
allowUnrecognizedEnumValues: true,
|
|
@@ -4229,38 +3725,24 @@ var RivetClient = class {
|
|
|
4229
3725
|
body: _response.error.rawBody
|
|
4230
3726
|
});
|
|
4231
3727
|
case "timeout":
|
|
4232
|
-
throw new RivetTimeoutError(
|
|
4233
|
-
"Timeout exceeded when calling POST /runner-configs/serverless-health-check."
|
|
4234
|
-
);
|
|
3728
|
+
throw new RivetTimeoutError("Timeout exceeded when calling GET /actors/{actor_id}.");
|
|
4235
3729
|
case "unknown":
|
|
4236
3730
|
throw new RivetError({
|
|
4237
3731
|
message: _response.error.errorMessage
|
|
4238
3732
|
});
|
|
4239
3733
|
}
|
|
4240
3734
|
}
|
|
4241
|
-
|
|
4242
|
-
|
|
4243
|
-
* @param {Rivet.RunnerConfigsUpsertRequestBody} request
|
|
4244
|
-
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4245
|
-
*
|
|
4246
|
-
* @example
|
|
4247
|
-
* await client.runnerConfigsUpsert("runner_name", {
|
|
4248
|
-
* namespace: "namespace",
|
|
4249
|
-
* datacenters: {
|
|
4250
|
-
* "key": {}
|
|
4251
|
-
* }
|
|
4252
|
-
* })
|
|
4253
|
-
*/
|
|
4254
|
-
async runnerConfigsUpsert(runnerName, request, requestOptions) {
|
|
4255
|
-
const { namespace, ..._body } = request;
|
|
3735
|
+
async actorsDelete(actorId, request, requestOptions) {
|
|
3736
|
+
const { namespace } = request;
|
|
4256
3737
|
const _queryParams = {};
|
|
4257
|
-
|
|
3738
|
+
if (namespace != null)
|
|
3739
|
+
_queryParams["namespace"] = namespace;
|
|
4258
3740
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4259
|
-
url:
|
|
3741
|
+
url: urlJoin6(
|
|
4260
3742
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4261
|
-
`
|
|
3743
|
+
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}`
|
|
4262
3744
|
),
|
|
4263
|
-
method: "
|
|
3745
|
+
method: "DELETE",
|
|
4264
3746
|
headers: {
|
|
4265
3747
|
Authorization: await this._getAuthorizationHeader(),
|
|
4266
3748
|
"X-Fern-Language": "JavaScript",
|
|
@@ -4271,13 +3753,12 @@ var RivetClient = class {
|
|
|
4271
3753
|
contentType: "application/json",
|
|
4272
3754
|
queryParameters: _queryParams,
|
|
4273
3755
|
requestType: "json",
|
|
4274
|
-
body: RunnerConfigsUpsertRequestBody.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
4275
3756
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
4276
3757
|
maxRetries: requestOptions?.maxRetries,
|
|
4277
3758
|
abortSignal: requestOptions?.abortSignal
|
|
4278
3759
|
});
|
|
4279
3760
|
if (_response.ok) {
|
|
4280
|
-
return
|
|
3761
|
+
return ActorsDeleteResponse.parseOrThrow(_response.body, {
|
|
4281
3762
|
unrecognizedObjectKeys: "passthrough",
|
|
4282
3763
|
allowUnrecognizedUnionMembers: true,
|
|
4283
3764
|
allowUnrecognizedEnumValues: true,
|
|
@@ -4298,7 +3779,7 @@ var RivetClient = class {
|
|
|
4298
3779
|
body: _response.error.rawBody
|
|
4299
3780
|
});
|
|
4300
3781
|
case "timeout":
|
|
4301
|
-
throw new RivetTimeoutError("Timeout exceeded when calling
|
|
3782
|
+
throw new RivetTimeoutError("Timeout exceeded when calling DELETE /actors/{actor_id}.");
|
|
4302
3783
|
case "unknown":
|
|
4303
3784
|
throw new RivetError({
|
|
4304
3785
|
message: _response.error.errorMessage
|
|
@@ -4306,25 +3787,26 @@ var RivetClient = class {
|
|
|
4306
3787
|
}
|
|
4307
3788
|
}
|
|
4308
3789
|
/**
|
|
4309
|
-
* @param {
|
|
4310
|
-
* @param {Rivet.
|
|
3790
|
+
* @param {Rivet.RivetId} actorId
|
|
3791
|
+
* @param {Rivet.ActorsRescheduleRequest} request
|
|
4311
3792
|
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4312
3793
|
*
|
|
4313
3794
|
* @example
|
|
4314
|
-
* await client.
|
|
4315
|
-
* namespace: "namespace"
|
|
3795
|
+
* await client.actorsReschedule("actor_id", {
|
|
3796
|
+
* namespace: "namespace",
|
|
4316
3797
|
* })
|
|
4317
3798
|
*/
|
|
4318
|
-
async
|
|
3799
|
+
async actorsReschedule(actorId, request, requestOptions) {
|
|
4319
3800
|
const { namespace } = request;
|
|
4320
3801
|
const _queryParams = {};
|
|
4321
|
-
|
|
3802
|
+
if (namespace != null)
|
|
3803
|
+
_queryParams["namespace"] = namespace;
|
|
4322
3804
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4323
|
-
url:
|
|
3805
|
+
url: urlJoin6(
|
|
4324
3806
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4325
|
-
`
|
|
3807
|
+
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}/reschedule`
|
|
4326
3808
|
),
|
|
4327
|
-
method: "
|
|
3809
|
+
method: "POST",
|
|
4328
3810
|
headers: {
|
|
4329
3811
|
Authorization: await this._getAuthorizationHeader(),
|
|
4330
3812
|
"X-Fern-Language": "JavaScript",
|
|
@@ -4340,7 +3822,7 @@ var RivetClient = class {
|
|
|
4340
3822
|
abortSignal: requestOptions?.abortSignal
|
|
4341
3823
|
});
|
|
4342
3824
|
if (_response.ok) {
|
|
4343
|
-
return
|
|
3825
|
+
return ActorsRescheduleResponse.parseOrThrow(_response.body, {
|
|
4344
3826
|
unrecognizedObjectKeys: "passthrough",
|
|
4345
3827
|
allowUnrecognizedUnionMembers: true,
|
|
4346
3828
|
allowUnrecognizedEnumValues: true,
|
|
@@ -4361,9 +3843,7 @@ var RivetClient = class {
|
|
|
4361
3843
|
body: _response.error.rawBody
|
|
4362
3844
|
});
|
|
4363
3845
|
case "timeout":
|
|
4364
|
-
throw new RivetTimeoutError(
|
|
4365
|
-
"Timeout exceeded when calling DELETE /runner-configs/{runner_name}."
|
|
4366
|
-
);
|
|
3846
|
+
throw new RivetTimeoutError("Timeout exceeded when calling POST /actors/{actor_id}/reschedule.");
|
|
4367
3847
|
case "unknown":
|
|
4368
3848
|
throw new RivetError({
|
|
4369
3849
|
message: _response.error.errorMessage
|
|
@@ -4371,26 +3851,24 @@ var RivetClient = class {
|
|
|
4371
3851
|
}
|
|
4372
3852
|
}
|
|
4373
3853
|
/**
|
|
4374
|
-
* @param {
|
|
4375
|
-
* @param {Rivet.
|
|
3854
|
+
* @param {Rivet.RivetId} actorId
|
|
3855
|
+
* @param {Rivet.ActorsSleepRequest} request
|
|
4376
3856
|
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4377
3857
|
*
|
|
4378
3858
|
* @example
|
|
4379
|
-
* await client.
|
|
3859
|
+
* await client.actorsSleep("actor_id", {
|
|
4380
3860
|
* namespace: "namespace",
|
|
4381
|
-
* body: {
|
|
4382
|
-
* "key": "value"
|
|
4383
|
-
* }
|
|
4384
3861
|
* })
|
|
4385
3862
|
*/
|
|
4386
|
-
async
|
|
4387
|
-
const { namespace
|
|
3863
|
+
async actorsSleep(actorId, request, requestOptions) {
|
|
3864
|
+
const { namespace } = request;
|
|
4388
3865
|
const _queryParams = {};
|
|
4389
|
-
|
|
3866
|
+
if (namespace != null)
|
|
3867
|
+
_queryParams["namespace"] = namespace;
|
|
4390
3868
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4391
|
-
url:
|
|
3869
|
+
url: urlJoin6(
|
|
4392
3870
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4393
|
-
`
|
|
3871
|
+
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}/sleep`
|
|
4394
3872
|
),
|
|
4395
3873
|
method: "POST",
|
|
4396
3874
|
headers: {
|
|
@@ -4403,15 +3881,12 @@ var RivetClient = class {
|
|
|
4403
3881
|
contentType: "application/json",
|
|
4404
3882
|
queryParameters: _queryParams,
|
|
4405
3883
|
requestType: "json",
|
|
4406
|
-
body: RunnerConfigsRefreshMetadataRequestBody.jsonOrThrow(_body, {
|
|
4407
|
-
unrecognizedObjectKeys: "strip"
|
|
4408
|
-
}),
|
|
4409
3884
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
4410
3885
|
maxRetries: requestOptions?.maxRetries,
|
|
4411
3886
|
abortSignal: requestOptions?.abortSignal
|
|
4412
3887
|
});
|
|
4413
3888
|
if (_response.ok) {
|
|
4414
|
-
return
|
|
3889
|
+
return ActorsSleepResponse.parseOrThrow(_response.body, {
|
|
4415
3890
|
unrecognizedObjectKeys: "passthrough",
|
|
4416
3891
|
allowUnrecognizedUnionMembers: true,
|
|
4417
3892
|
allowUnrecognizedEnumValues: true,
|
|
@@ -4432,9 +3907,7 @@ var RivetClient = class {
|
|
|
4432
3907
|
body: _response.error.rawBody
|
|
4433
3908
|
});
|
|
4434
3909
|
case "timeout":
|
|
4435
|
-
throw new RivetTimeoutError(
|
|
4436
|
-
"Timeout exceeded when calling POST /runner-configs/{runner_name}/refresh-metadata."
|
|
4437
|
-
);
|
|
3910
|
+
throw new RivetTimeoutError("Timeout exceeded when calling POST /actors/{actor_id}/sleep.");
|
|
4438
3911
|
case "unknown":
|
|
4439
3912
|
throw new RivetError({
|
|
4440
3913
|
message: _response.error.errorMessage
|