@rivetkit/engine-api-full 0.0.0-active-actors-fix-active-count.253e406 → 0.0.0-bisect-sync-sqlite-1.910d1c7
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 +551 -850
- package/dist/browser/cjs/package.json +3 -0
- package/dist/browser/cjs/serialization.js +155 -287
- package/dist/browser/esm/index.js +551 -850
- package/dist/browser/esm/package.json +3 -0
- package/dist/browser/esm/serialization.js +155 -287
- package/dist/node/cjs/index.js +551 -850
- package/dist/node/cjs/package.json +3 -0
- package/dist/node/cjs/serialization.js +175 -322
- package/dist/node/esm/index.js +551 -850
- package/dist/node/esm/package.json +3 -0
- package/dist/node/esm/serialization.js +155 -287
- package/package.json +7 -2
- package/types/Client.d.ts +16 -83
- 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/ActorsForkRequest.d.ts +14 -0
- 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 +2 -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 +12 -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 +23 -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/ActorsForkResponse.d.ts +4 -0
- 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 -10
- package/types/api/types/Namespace.d.ts +13 -6
- package/types/api/types/NamespaceForkedFrom.d.ts +14 -0
- package/types/api/types/NamespaceListResponse.d.ts +1 -4
- package/types/api/types/NamespaceSkippedActor.d.ts +14 -0
- package/types/api/types/NamespaceStatus.d.ts +18 -0
- package/types/api/types/{HealthFanoutResponse.d.ts → NamespacesArchiveResponse.d.ts} +2 -2
- package/types/api/types/NamespacesCreateResponse.d.ts +0 -3
- package/types/api/types/Node.d.ts +20 -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 +19 -33
- package/types/serialization/client/requests/ActorsCreateRequest.d.ts +1 -4
- package/types/serialization/client/requests/ActorsForkRequest.d.ts +10 -0
- package/types/serialization/client/requests/ActorsGetOrCreateRequest.d.ts +2 -5
- package/types/serialization/client/requests/index.d.ts +1 -2
- package/types/serialization/resources/namespaces/client/requests/NamespacesCreateRequest.d.ts +0 -1
- package/types/serialization/types/Actor.d.ts +11 -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/ActorsForkResponse.d.ts +10 -0
- 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 -10
- package/types/serialization/types/Namespace.d.ts +9 -7
- package/types/serialization/types/NamespaceForkedFrom.d.ts +14 -0
- package/types/serialization/types/NamespaceListResponse.d.ts +1 -4
- package/types/serialization/types/NamespaceSkippedActor.d.ts +14 -0
- package/types/serialization/types/NamespaceStatus.d.ts +10 -0
- package/types/serialization/types/NamespacesArchiveResponse.d.ts +13 -0
- package/types/serialization/types/NamespacesCreateResponse.d.ts +0 -3
- package/types/serialization/types/Node.d.ts +17 -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 +19 -33
- 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/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 -10
- package/types/api/types/RunnerConfigKind.d.ts +0 -5
- package/types/api/types/RunnerConfigKindNormal.d.ts +0 -6
- package/types/api/types/RunnerConfigKindServerless.d.ts +0 -7
- package/types/api/types/RunnerConfigKindServerlessServerless.d.ts +0 -22
- package/types/api/types/RunnerConfigResponse.d.ts +0 -8
- package/types/api/types/RunnerConfigServerless.d.ts +0 -22
- 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 -16
- package/types/serialization/types/RunnerConfigKind.d.ts +0 -12
- package/types/serialization/types/RunnerConfigKindNormal.d.ts +0 -12
- package/types/serialization/types/RunnerConfigKindServerless.d.ts +0 -13
- package/types/serialization/types/RunnerConfigKindServerlessServerless.d.ts +0 -21
- package/types/serialization/types/RunnerConfigResponse.d.ts +0 -14
- package/types/serialization/types/RunnerConfigServerless.d.ts +0 -21
- 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,29 @@ var init_NodePre18StreamWrapper = __esm({
|
|
|
547
547
|
// src/api/index.ts
|
|
548
548
|
var api_exports = {};
|
|
549
549
|
__export(api_exports, {
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
RunnerConfigVariant: () => RunnerConfigVariant,
|
|
550
|
+
NamespaceStatus: () => NamespaceStatus,
|
|
551
|
+
authTokens: () => authTokens_exports,
|
|
553
552
|
datacenters: () => datacenters_exports,
|
|
554
|
-
envoys: () => envoys_exports,
|
|
555
|
-
health: () => health_exports,
|
|
556
553
|
metadata: () => metadata_exports,
|
|
557
|
-
namespaces: () =>
|
|
558
|
-
|
|
554
|
+
namespaces: () => namespaces_exports2,
|
|
555
|
+
pools: () => pools_exports
|
|
559
556
|
});
|
|
560
557
|
|
|
561
|
-
// src/api/types/
|
|
562
|
-
var
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
558
|
+
// src/api/types/NamespaceStatus.ts
|
|
559
|
+
var NamespaceStatus = {
|
|
560
|
+
Creating: "creating",
|
|
561
|
+
Forking: "forking",
|
|
562
|
+
Live: "live",
|
|
563
|
+
Archiving: "archiving",
|
|
564
|
+
Archived: "archived",
|
|
565
|
+
Failed: "failed"
|
|
566
566
|
};
|
|
567
567
|
|
|
568
|
-
// src/api/
|
|
569
|
-
var
|
|
570
|
-
|
|
571
|
-
|
|
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 = {};
|
|
568
|
+
// src/api/resources/authTokens/index.ts
|
|
569
|
+
var authTokens_exports = {};
|
|
570
|
+
__export(authTokens_exports, {
|
|
571
|
+
AuthTokens: () => AuthTokens
|
|
572
|
+
});
|
|
597
573
|
|
|
598
574
|
// src/core/json.ts
|
|
599
575
|
var toJson = (value, replacer, space) => {
|
|
@@ -2307,6 +2283,9 @@ function transformAndValidateUnion({
|
|
|
2307
2283
|
};
|
|
2308
2284
|
}
|
|
2309
2285
|
|
|
2286
|
+
// src/api/resources/authTokens/client/Client.ts
|
|
2287
|
+
import urlJoin from "url-join";
|
|
2288
|
+
|
|
2310
2289
|
// src/serialization/index.ts
|
|
2311
2290
|
var serialization_exports = {};
|
|
2312
2291
|
__export(serialization_exports, {
|
|
@@ -2315,82 +2294,62 @@ __export(serialization_exports, {
|
|
|
2315
2294
|
ActorsCreateRequest: () => ActorsCreateRequest,
|
|
2316
2295
|
ActorsCreateResponse: () => ActorsCreateResponse,
|
|
2317
2296
|
ActorsDeleteResponse: () => ActorsDeleteResponse,
|
|
2297
|
+
ActorsForkRequest: () => ActorsForkRequest,
|
|
2298
|
+
ActorsForkResponse: () => ActorsForkResponse,
|
|
2318
2299
|
ActorsGetOrCreateRequest: () => ActorsGetOrCreateRequest,
|
|
2319
2300
|
ActorsGetOrCreateResponse: () => ActorsGetOrCreateResponse,
|
|
2320
|
-
|
|
2301
|
+
ActorsGetResponse: () => ActorsGetResponse,
|
|
2321
2302
|
ActorsListNamesResponse: () => ActorsListNamesResponse,
|
|
2322
2303
|
ActorsListResponse: () => ActorsListResponse,
|
|
2323
|
-
ActorsRescheduleRequestBody: () => ActorsRescheduleRequestBody,
|
|
2324
2304
|
ActorsRescheduleResponse: () => ActorsRescheduleResponse,
|
|
2325
|
-
ActorsSleepRequestBody: () => ActorsSleepRequestBody,
|
|
2326
2305
|
ActorsSleepResponse: () => ActorsSleepResponse,
|
|
2327
|
-
|
|
2306
|
+
AuthOperationKind: () => AuthOperationKind,
|
|
2307
|
+
AuthResourceKind: () => AuthResourceKind,
|
|
2308
|
+
AuthTargetScope: () => AuthTargetScope,
|
|
2309
|
+
AuthTokenCreateResponse: () => AuthTokenCreateResponse,
|
|
2310
|
+
AuthTokenGrant: () => AuthTokenGrant,
|
|
2311
|
+
AuthTokenInspectResponse: () => AuthTokenInspectResponse,
|
|
2328
2312
|
Datacenter: () => Datacenter,
|
|
2329
|
-
DatacenterHealth: () => DatacenterHealth,
|
|
2330
2313
|
DatacentersListResponse: () => DatacentersListResponse,
|
|
2331
|
-
|
|
2332
|
-
EnvoysListResponse: () => EnvoysListResponse,
|
|
2333
|
-
HealthFanoutResponse: () => HealthFanoutResponse,
|
|
2334
|
-
HealthResponse: () => HealthResponse,
|
|
2335
|
-
HealthStatus: () => HealthStatus2,
|
|
2314
|
+
ErrorResponse: () => ErrorResponse,
|
|
2336
2315
|
MetadataGetResponse: () => MetadataGetResponse,
|
|
2337
2316
|
Namespace: () => Namespace,
|
|
2317
|
+
NamespaceForkedFrom: () => NamespaceForkedFrom,
|
|
2338
2318
|
NamespaceListResponse: () => NamespaceListResponse,
|
|
2319
|
+
NamespaceSkippedActor: () => NamespaceSkippedActor,
|
|
2320
|
+
NamespaceStatus: () => NamespaceStatus2,
|
|
2321
|
+
NamespacesArchiveResponse: () => NamespacesArchiveResponse,
|
|
2339
2322
|
NamespacesCreateRequest: () => NamespacesCreateRequest,
|
|
2340
2323
|
NamespacesCreateResponse: () => NamespacesCreateResponse,
|
|
2324
|
+
Node: () => Node,
|
|
2341
2325
|
Pagination: () => Pagination,
|
|
2326
|
+
Pool: () => Pool,
|
|
2327
|
+
PoolResponse: () => PoolResponse,
|
|
2328
|
+
PoolsDeleteResponse: () => PoolsDeleteResponse,
|
|
2329
|
+
PoolsListNodesResponse: () => PoolsListNodesResponse,
|
|
2330
|
+
PoolsListResponse: () => PoolsListResponse,
|
|
2342
2331
|
RivetId: () => RivetId,
|
|
2343
|
-
|
|
2344
|
-
RunnerConfig: () => RunnerConfig,
|
|
2345
|
-
RunnerConfigKind: () => RunnerConfigKind,
|
|
2346
|
-
RunnerConfigKindNormal: () => RunnerConfigKindNormal,
|
|
2347
|
-
RunnerConfigKindServerless: () => RunnerConfigKindServerless,
|
|
2348
|
-
RunnerConfigKindServerlessServerless: () => RunnerConfigKindServerlessServerless,
|
|
2349
|
-
RunnerConfigResponse: () => RunnerConfigResponse,
|
|
2350
|
-
RunnerConfigServerless: () => RunnerConfigServerless,
|
|
2351
|
-
RunnerConfigVariant: () => RunnerConfigVariant2,
|
|
2352
|
-
RunnerConfigsDeleteResponse: () => RunnerConfigsDeleteResponse,
|
|
2353
|
-
RunnerConfigsListResponse: () => RunnerConfigsListResponse,
|
|
2354
|
-
RunnerConfigsListResponseRunnerConfigsValue: () => RunnerConfigsListResponseRunnerConfigsValue,
|
|
2355
|
-
RunnerConfigsRefreshMetadataRequestBody: () => RunnerConfigsRefreshMetadataRequestBody,
|
|
2356
|
-
RunnerConfigsRefreshMetadataResponse: () => RunnerConfigsRefreshMetadataResponse,
|
|
2357
|
-
RunnerConfigsServerlessHealthCheckRequest: () => RunnerConfigsServerlessHealthCheckRequest,
|
|
2358
|
-
RunnerConfigsServerlessHealthCheckResponse: () => RunnerConfigsServerlessHealthCheckResponse,
|
|
2359
|
-
RunnerConfigsServerlessHealthCheckResponseFailure: () => RunnerConfigsServerlessHealthCheckResponseFailure,
|
|
2360
|
-
RunnerConfigsServerlessHealthCheckResponseFailureFailure: () => RunnerConfigsServerlessHealthCheckResponseFailureFailure,
|
|
2361
|
-
RunnerConfigsServerlessHealthCheckResponseSuccess: () => RunnerConfigsServerlessHealthCheckResponseSuccess,
|
|
2362
|
-
RunnerConfigsServerlessHealthCheckResponseSuccessSuccess: () => RunnerConfigsServerlessHealthCheckResponseSuccessSuccess,
|
|
2363
|
-
RunnerConfigsServerlessMetadataError: () => RunnerConfigsServerlessMetadataError,
|
|
2364
|
-
RunnerConfigsUpsertRequestBody: () => RunnerConfigsUpsertRequestBody,
|
|
2365
|
-
RunnerConfigsUpsertResponse: () => RunnerConfigsUpsertResponse,
|
|
2366
|
-
RunnersListNamesResponse: () => RunnersListNamesResponse,
|
|
2367
|
-
RunnersListResponse: () => RunnersListResponse,
|
|
2368
|
-
namespaces: () => namespaces_exports2
|
|
2332
|
+
namespaces: () => namespaces_exports
|
|
2369
2333
|
});
|
|
2370
2334
|
|
|
2371
2335
|
// src/serialization/types/RivetId.ts
|
|
2372
2336
|
var RivetId = schemas_exports.string();
|
|
2373
2337
|
|
|
2374
|
-
// src/serialization/types/CrashPolicy.ts
|
|
2375
|
-
var CrashPolicy2 = schemas_exports.enum_(["restart", "sleep", "destroy"]);
|
|
2376
|
-
|
|
2377
2338
|
// src/serialization/types/Actor.ts
|
|
2378
2339
|
var Actor = schemas_exports.object({
|
|
2379
2340
|
actorId: schemas_exports.property("actor_id", RivetId),
|
|
2380
|
-
connectableTs: schemas_exports.property("connectable_ts", schemas_exports.number().optional()),
|
|
2381
|
-
crashPolicy: schemas_exports.property("crash_policy", CrashPolicy2),
|
|
2382
|
-
createTs: schemas_exports.property("create_ts", schemas_exports.number()),
|
|
2383
|
-
datacenter: schemas_exports.string(),
|
|
2384
|
-
destroyTs: schemas_exports.property("destroy_ts", schemas_exports.number().optional()),
|
|
2385
|
-
error: schemas_exports.record(schemas_exports.string(), schemas_exports.unknown()).optional(),
|
|
2386
|
-
key: schemas_exports.string().optional(),
|
|
2387
2341
|
name: schemas_exports.string(),
|
|
2388
|
-
|
|
2389
|
-
|
|
2390
|
-
|
|
2391
|
-
|
|
2392
|
-
|
|
2393
|
-
|
|
2342
|
+
key: schemas_exports.string(),
|
|
2343
|
+
namespace: schemas_exports.string(),
|
|
2344
|
+
pool: schemas_exports.string(),
|
|
2345
|
+
createTs: schemas_exports.property("create_ts", schemas_exports.number()),
|
|
2346
|
+
startTs: schemas_exports.property("start_ts", schemas_exports.number().nullable()),
|
|
2347
|
+
pendingAllocationTs: schemas_exports.property("pending_allocation_ts", schemas_exports.number().nullable()),
|
|
2348
|
+
connectableTs: schemas_exports.property("connectable_ts", schemas_exports.number().nullable()),
|
|
2349
|
+
sleepTs: schemas_exports.property("sleep_ts", schemas_exports.number().nullable()),
|
|
2350
|
+
rescheduleTs: schemas_exports.property("reschedule_ts", schemas_exports.number().nullable()),
|
|
2351
|
+
destroyTs: schemas_exports.property("destroy_ts", schemas_exports.number().nullable()),
|
|
2352
|
+
forkedFrom: schemas_exports.property("forked_from", RivetId.nullable().optional())
|
|
2394
2353
|
});
|
|
2395
2354
|
|
|
2396
2355
|
// src/serialization/types/ActorName.ts
|
|
@@ -2400,11 +2359,17 @@ var ActorName = schemas_exports.object({
|
|
|
2400
2359
|
|
|
2401
2360
|
// src/serialization/types/ActorsCreateResponse.ts
|
|
2402
2361
|
var ActorsCreateResponse = schemas_exports.object({
|
|
2403
|
-
actor: Actor
|
|
2362
|
+
actor: Actor,
|
|
2363
|
+
created: schemas_exports.boolean()
|
|
2404
2364
|
});
|
|
2405
2365
|
|
|
2406
2366
|
// src/serialization/types/ActorsDeleteResponse.ts
|
|
2407
|
-
var ActorsDeleteResponse = schemas_exports.
|
|
2367
|
+
var ActorsDeleteResponse = schemas_exports.object({});
|
|
2368
|
+
|
|
2369
|
+
// src/serialization/types/ActorsForkResponse.ts
|
|
2370
|
+
var ActorsForkResponse = schemas_exports.object({
|
|
2371
|
+
actor: Actor
|
|
2372
|
+
});
|
|
2408
2373
|
|
|
2409
2374
|
// src/serialization/types/ActorsGetOrCreateResponse.ts
|
|
2410
2375
|
var ActorsGetOrCreateResponse = schemas_exports.object({
|
|
@@ -2412,21 +2377,19 @@ var ActorsGetOrCreateResponse = schemas_exports.object({
|
|
|
2412
2377
|
created: schemas_exports.boolean()
|
|
2413
2378
|
});
|
|
2414
2379
|
|
|
2415
|
-
// src/serialization/types/
|
|
2416
|
-
var
|
|
2417
|
-
|
|
2418
|
-
value: schemas_exports.string()
|
|
2419
|
-
});
|
|
2420
|
-
|
|
2421
|
-
// src/serialization/types/Pagination.ts
|
|
2422
|
-
var Pagination = schemas_exports.object({
|
|
2423
|
-
cursor: schemas_exports.string().optional()
|
|
2380
|
+
// src/serialization/types/ActorsGetResponse.ts
|
|
2381
|
+
var ActorsGetResponse = schemas_exports.object({
|
|
2382
|
+
actor: Actor
|
|
2424
2383
|
});
|
|
2425
2384
|
|
|
2426
2385
|
// src/serialization/types/ActorsListNamesResponse.ts
|
|
2427
2386
|
var ActorsListNamesResponse = schemas_exports.object({
|
|
2428
|
-
names: schemas_exports.record(schemas_exports.string(), ActorName)
|
|
2429
|
-
|
|
2387
|
+
names: schemas_exports.record(schemas_exports.string(), ActorName)
|
|
2388
|
+
});
|
|
2389
|
+
|
|
2390
|
+
// src/serialization/types/Pagination.ts
|
|
2391
|
+
var Pagination = schemas_exports.object({
|
|
2392
|
+
cursor: schemas_exports.string().nullable()
|
|
2430
2393
|
});
|
|
2431
2394
|
|
|
2432
2395
|
// src/serialization/types/ActorsListResponse.ts
|
|
@@ -2435,96 +2398,98 @@ var ActorsListResponse = schemas_exports.object({
|
|
|
2435
2398
|
pagination: Pagination
|
|
2436
2399
|
});
|
|
2437
2400
|
|
|
2438
|
-
// src/serialization/types/ActorsRescheduleRequestBody.ts
|
|
2439
|
-
var ActorsRescheduleRequestBody = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2440
|
-
|
|
2441
2401
|
// src/serialization/types/ActorsRescheduleResponse.ts
|
|
2442
|
-
var ActorsRescheduleResponse = schemas_exports.
|
|
2443
|
-
|
|
2444
|
-
// src/serialization/types/ActorsSleepRequestBody.ts
|
|
2445
|
-
var ActorsSleepRequestBody = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2402
|
+
var ActorsRescheduleResponse = schemas_exports.object({});
|
|
2446
2403
|
|
|
2447
2404
|
// src/serialization/types/ActorsSleepResponse.ts
|
|
2448
|
-
var ActorsSleepResponse = schemas_exports.
|
|
2405
|
+
var ActorsSleepResponse = schemas_exports.object({});
|
|
2449
2406
|
|
|
2450
|
-
// src/serialization/types/
|
|
2451
|
-
var
|
|
2452
|
-
|
|
2453
|
-
|
|
2454
|
-
|
|
2407
|
+
// src/serialization/types/AuthOperationKind.ts
|
|
2408
|
+
var AuthOperationKind = schemas_exports.enum_(["read", "update", "list", "create", "delete", "fork"]);
|
|
2409
|
+
|
|
2410
|
+
// src/serialization/types/AuthResourceKind.ts
|
|
2411
|
+
var AuthResourceKind = schemas_exports.enum_(["namespace", "actor", "node", "pool", "datacenter", "actor_gateway", "actor_kv"]);
|
|
2412
|
+
|
|
2413
|
+
// src/serialization/types/AuthTargetScope.ts
|
|
2414
|
+
var AuthTargetScope = schemas_exports.undiscriminatedUnion([schemas_exports.stringLiteral("any"), schemas_exports.object({
|
|
2415
|
+
id: RivetId
|
|
2416
|
+
})]);
|
|
2417
|
+
|
|
2418
|
+
// src/serialization/types/AuthTokenCreateResponse.ts
|
|
2419
|
+
var AuthTokenCreateResponse = schemas_exports.object({
|
|
2420
|
+
token: schemas_exports.string(),
|
|
2421
|
+
issuedTs: schemas_exports.property("issued_ts", schemas_exports.number()),
|
|
2422
|
+
expiresTs: schemas_exports.property("expires_ts", schemas_exports.number())
|
|
2455
2423
|
});
|
|
2456
2424
|
|
|
2457
|
-
// src/serialization/types/
|
|
2458
|
-
var
|
|
2459
|
-
|
|
2460
|
-
|
|
2461
|
-
|
|
2425
|
+
// src/serialization/types/AuthTokenGrant.ts
|
|
2426
|
+
var AuthTokenGrant = schemas_exports.object({
|
|
2427
|
+
resource: AuthResourceKind,
|
|
2428
|
+
target: AuthTargetScope,
|
|
2429
|
+
operations: schemas_exports.list(AuthOperationKind)
|
|
2462
2430
|
});
|
|
2463
2431
|
|
|
2464
|
-
// src/serialization/types/
|
|
2465
|
-
var
|
|
2432
|
+
// src/serialization/types/AuthTokenInspectResponse.ts
|
|
2433
|
+
var AuthTokenInspectResponse = schemas_exports.object({
|
|
2434
|
+
namespace: schemas_exports.string(),
|
|
2435
|
+
subject: schemas_exports.string().nullable(),
|
|
2436
|
+
grants: schemas_exports.list(AuthTokenGrant),
|
|
2437
|
+
issuedTs: schemas_exports.property("issued_ts", schemas_exports.number()),
|
|
2438
|
+
expiresTs: schemas_exports.property("expires_ts", schemas_exports.number())
|
|
2439
|
+
});
|
|
2466
2440
|
|
|
2467
|
-
// src/serialization/types/
|
|
2468
|
-
var
|
|
2469
|
-
|
|
2470
|
-
datacenterName: schemas_exports.property("datacenter_name", schemas_exports.string()),
|
|
2471
|
-
error: schemas_exports.string().optional(),
|
|
2472
|
-
response: HealthResponse.optional(),
|
|
2473
|
-
rttMs: schemas_exports.property("rtt_ms", schemas_exports.number().optional()),
|
|
2474
|
-
status: HealthStatus2
|
|
2441
|
+
// src/serialization/types/Datacenter.ts
|
|
2442
|
+
var Datacenter = schemas_exports.object({
|
|
2443
|
+
name: schemas_exports.string()
|
|
2475
2444
|
});
|
|
2476
2445
|
|
|
2477
2446
|
// src/serialization/types/DatacentersListResponse.ts
|
|
2478
2447
|
var DatacentersListResponse = schemas_exports.object({
|
|
2479
|
-
datacenters: schemas_exports.list(Datacenter)
|
|
2480
|
-
pagination: Pagination
|
|
2448
|
+
datacenters: schemas_exports.list(Datacenter)
|
|
2481
2449
|
});
|
|
2482
2450
|
|
|
2483
|
-
// src/serialization/types/
|
|
2484
|
-
var
|
|
2485
|
-
|
|
2486
|
-
|
|
2487
|
-
|
|
2488
|
-
|
|
2489
|
-
lastPingTs: schemas_exports.property("last_ping_ts", schemas_exports.number()),
|
|
2490
|
-
lastRtt: schemas_exports.property("last_rtt", schemas_exports.number()),
|
|
2491
|
-
metadata: schemas_exports.record(schemas_exports.string(), schemas_exports.unknown()).optional(),
|
|
2492
|
-
namespaceId: schemas_exports.property("namespace_id", RivetId),
|
|
2493
|
-
poolName: schemas_exports.property("pool_name", schemas_exports.string()),
|
|
2494
|
-
slots: schemas_exports.number(),
|
|
2495
|
-
stopTs: schemas_exports.property("stop_ts", schemas_exports.number().optional()),
|
|
2496
|
-
version: schemas_exports.number()
|
|
2451
|
+
// src/serialization/types/ErrorResponse.ts
|
|
2452
|
+
var ErrorResponse = schemas_exports.object({
|
|
2453
|
+
group: schemas_exports.string(),
|
|
2454
|
+
code: schemas_exports.string(),
|
|
2455
|
+
message: schemas_exports.string(),
|
|
2456
|
+
metadata: schemas_exports.unknown().optional()
|
|
2497
2457
|
});
|
|
2498
2458
|
|
|
2499
|
-
// src/serialization/types/
|
|
2500
|
-
var
|
|
2501
|
-
|
|
2502
|
-
|
|
2459
|
+
// src/serialization/types/MetadataGetResponse.ts
|
|
2460
|
+
var MetadataGetResponse = schemas_exports.object({
|
|
2461
|
+
runtime: schemas_exports.stringLiteral("engine"),
|
|
2462
|
+
version: schemas_exports.string(),
|
|
2463
|
+
envoyProtocolVersion: schemas_exports.number(),
|
|
2464
|
+
actorNames: schemas_exports.record(schemas_exports.string(), ActorName).optional()
|
|
2503
2465
|
});
|
|
2504
2466
|
|
|
2505
|
-
// src/serialization/types/
|
|
2506
|
-
var
|
|
2507
|
-
|
|
2467
|
+
// src/serialization/types/NamespaceStatus.ts
|
|
2468
|
+
var NamespaceStatus2 = schemas_exports.enum_(["creating", "forking", "live", "archiving", "archived", "failed"]);
|
|
2469
|
+
|
|
2470
|
+
// src/serialization/types/NamespaceForkedFrom.ts
|
|
2471
|
+
var NamespaceForkedFrom = schemas_exports.object({
|
|
2472
|
+
namespace: schemas_exports.string(),
|
|
2473
|
+
forkNumber: schemas_exports.property("fork_number", schemas_exports.number()),
|
|
2474
|
+
forkedTs: schemas_exports.property("forked_ts", schemas_exports.number())
|
|
2508
2475
|
});
|
|
2509
2476
|
|
|
2510
|
-
// src/serialization/types/
|
|
2511
|
-
var
|
|
2512
|
-
|
|
2513
|
-
|
|
2514
|
-
|
|
2515
|
-
gitSha: schemas_exports.property("git_sha", schemas_exports.string()),
|
|
2516
|
-
runtime: schemas_exports.string(),
|
|
2517
|
-
rustcHost: schemas_exports.property("rustc_host", schemas_exports.string()),
|
|
2518
|
-
rustcVersion: schemas_exports.property("rustc_version", schemas_exports.string()),
|
|
2519
|
-
version: schemas_exports.string()
|
|
2477
|
+
// src/serialization/types/NamespaceSkippedActor.ts
|
|
2478
|
+
var NamespaceSkippedActor = schemas_exports.object({
|
|
2479
|
+
actorId: schemas_exports.property("actor_id", schemas_exports.string()),
|
|
2480
|
+
name: schemas_exports.string(),
|
|
2481
|
+
key: schemas_exports.string().nullable()
|
|
2520
2482
|
});
|
|
2521
2483
|
|
|
2522
2484
|
// src/serialization/types/Namespace.ts
|
|
2523
2485
|
var Namespace = schemas_exports.object({
|
|
2524
|
-
createTs: schemas_exports.property("create_ts", schemas_exports.number()),
|
|
2525
|
-
displayName: schemas_exports.property("display_name", schemas_exports.string()),
|
|
2526
2486
|
name: schemas_exports.string(),
|
|
2527
|
-
|
|
2487
|
+
createTs: schemas_exports.property("create_ts", schemas_exports.number()),
|
|
2488
|
+
status: NamespaceStatus2,
|
|
2489
|
+
forkedFrom: schemas_exports.property("forked_from", NamespaceForkedFrom.nullable()),
|
|
2490
|
+
archivedTs: schemas_exports.property("archived_ts", schemas_exports.number().nullable()),
|
|
2491
|
+
skipped: schemas_exports.list(NamespaceSkippedActor).optional(),
|
|
2492
|
+
skippedCount: schemas_exports.property("skipped_count", schemas_exports.number().optional())
|
|
2528
2493
|
});
|
|
2529
2494
|
|
|
2530
2495
|
// src/serialization/types/NamespaceListResponse.ts
|
|
@@ -2538,208 +2503,87 @@ var NamespacesCreateResponse = schemas_exports.object({
|
|
|
2538
2503
|
namespace: Namespace
|
|
2539
2504
|
});
|
|
2540
2505
|
|
|
2541
|
-
// src/serialization/types/
|
|
2542
|
-
var
|
|
2543
|
-
|
|
2544
|
-
datacenter: schemas_exports.string(),
|
|
2545
|
-
drainTs: schemas_exports.property("drain_ts", schemas_exports.number().optional()),
|
|
2546
|
-
key: schemas_exports.string(),
|
|
2547
|
-
lastConnectedTs: schemas_exports.property("last_connected_ts", schemas_exports.number().optional()),
|
|
2548
|
-
lastPingTs: schemas_exports.property("last_ping_ts", schemas_exports.number()),
|
|
2549
|
-
lastRtt: schemas_exports.property("last_rtt", schemas_exports.number()),
|
|
2550
|
-
metadata: schemas_exports.record(schemas_exports.string(), schemas_exports.unknown()).optional(),
|
|
2551
|
-
name: schemas_exports.string(),
|
|
2552
|
-
namespaceId: schemas_exports.property("namespace_id", RivetId),
|
|
2553
|
-
remainingSlots: schemas_exports.property("remaining_slots", schemas_exports.number()),
|
|
2554
|
-
runnerId: schemas_exports.property("runner_id", RivetId),
|
|
2555
|
-
stopTs: schemas_exports.property("stop_ts", schemas_exports.number().optional()),
|
|
2556
|
-
totalSlots: schemas_exports.property("total_slots", schemas_exports.number()),
|
|
2557
|
-
version: schemas_exports.number()
|
|
2558
|
-
});
|
|
2559
|
-
|
|
2560
|
-
// src/serialization/types/RunnerConfigServerless.ts
|
|
2561
|
-
var RunnerConfigServerless = schemas_exports.object({
|
|
2562
|
-
drainGracePeriod: schemas_exports.property("drain_grace_period", schemas_exports.number().optional()),
|
|
2563
|
-
headers: schemas_exports.record(schemas_exports.string(), schemas_exports.string()).optional(),
|
|
2564
|
-
maxConcurrentActors: schemas_exports.property("max_concurrent_actors", schemas_exports.number().optional()),
|
|
2565
|
-
maxRunners: schemas_exports.property("max_runners", schemas_exports.number()),
|
|
2566
|
-
metadataPollInterval: schemas_exports.property("metadata_poll_interval", schemas_exports.number().optional()),
|
|
2567
|
-
minRunners: schemas_exports.property("min_runners", schemas_exports.number().optional()),
|
|
2568
|
-
requestLifespan: schemas_exports.property("request_lifespan", schemas_exports.number()),
|
|
2569
|
-
runnersMargin: schemas_exports.property("runners_margin", schemas_exports.number().optional()),
|
|
2570
|
-
slotsPerRunner: schemas_exports.property("slots_per_runner", schemas_exports.number()),
|
|
2571
|
-
url: schemas_exports.string()
|
|
2572
|
-
});
|
|
2573
|
-
|
|
2574
|
-
// src/serialization/types/RunnerConfig.ts
|
|
2575
|
-
var RunnerConfig = schemas_exports.object({
|
|
2576
|
-
normal: schemas_exports.record(schemas_exports.string(), schemas_exports.unknown()).optional(),
|
|
2577
|
-
serverless: RunnerConfigServerless.optional(),
|
|
2578
|
-
drainOnVersionUpgrade: schemas_exports.property(
|
|
2579
|
-
"drain_on_version_upgrade",
|
|
2580
|
-
schemas_exports.boolean().optional()
|
|
2581
|
-
),
|
|
2582
|
-
metadata: schemas_exports.unknown().optional()
|
|
2583
|
-
});
|
|
2584
|
-
|
|
2585
|
-
// src/serialization/types/RunnerConfigKindNormal.ts
|
|
2586
|
-
var RunnerConfigKindNormal = schemas_exports.object({
|
|
2587
|
-
normal: schemas_exports.record(schemas_exports.string(), schemas_exports.unknown())
|
|
2588
|
-
});
|
|
2589
|
-
|
|
2590
|
-
// src/serialization/types/RunnerConfigKindServerlessServerless.ts
|
|
2591
|
-
var RunnerConfigKindServerlessServerless = schemas_exports.object({
|
|
2592
|
-
drainGracePeriod: schemas_exports.property("drain_grace_period", schemas_exports.number().optional()),
|
|
2593
|
-
headers: schemas_exports.record(schemas_exports.string(), schemas_exports.string()).optional(),
|
|
2594
|
-
maxConcurrentActors: schemas_exports.property("max_concurrent_actors", schemas_exports.number().optional()),
|
|
2595
|
-
maxRunners: schemas_exports.property("max_runners", schemas_exports.number()),
|
|
2596
|
-
metadataPollInterval: schemas_exports.property("metadata_poll_interval", schemas_exports.number().optional()),
|
|
2597
|
-
minRunners: schemas_exports.property("min_runners", schemas_exports.number().optional()),
|
|
2598
|
-
requestLifespan: schemas_exports.property("request_lifespan", schemas_exports.number()),
|
|
2599
|
-
runnersMargin: schemas_exports.property("runners_margin", schemas_exports.number().optional()),
|
|
2600
|
-
slotsPerRunner: schemas_exports.property("slots_per_runner", schemas_exports.number()),
|
|
2601
|
-
url: schemas_exports.string()
|
|
2602
|
-
});
|
|
2603
|
-
|
|
2604
|
-
// src/serialization/types/RunnerConfigKindServerless.ts
|
|
2605
|
-
var RunnerConfigKindServerless = schemas_exports.object({
|
|
2606
|
-
serverless: RunnerConfigKindServerlessServerless
|
|
2607
|
-
});
|
|
2608
|
-
|
|
2609
|
-
// src/serialization/types/RunnerConfigKind.ts
|
|
2610
|
-
var RunnerConfigKind = schemas_exports.undiscriminatedUnion([RunnerConfigKindNormal, RunnerConfigKindServerless]);
|
|
2611
|
-
|
|
2612
|
-
// src/serialization/types/RunnerConfigResponse.ts
|
|
2613
|
-
var RunnerConfigResponse = schemas_exports.object({
|
|
2614
|
-
protocolVersion: schemas_exports.property("protocol_version", schemas_exports.number().optional()),
|
|
2615
|
-
runnerPoolError: schemas_exports.property(
|
|
2616
|
-
"runner_pool_error",
|
|
2617
|
-
schemas_exports.record(schemas_exports.string(), schemas_exports.unknown()).optional()
|
|
2618
|
-
)
|
|
2619
|
-
}).extend(RunnerConfig);
|
|
2620
|
-
|
|
2621
|
-
// src/serialization/types/RunnerConfigVariant.ts
|
|
2622
|
-
var RunnerConfigVariant2 = schemas_exports.enum_(["serverless", "normal"]);
|
|
2623
|
-
|
|
2624
|
-
// src/serialization/types/RunnerConfigsDeleteResponse.ts
|
|
2625
|
-
var RunnerConfigsDeleteResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2626
|
-
|
|
2627
|
-
// src/serialization/types/RunnerConfigsListResponseRunnerConfigsValue.ts
|
|
2628
|
-
var RunnerConfigsListResponseRunnerConfigsValue = schemas_exports.object({
|
|
2629
|
-
datacenters: schemas_exports.record(schemas_exports.string(), RunnerConfigResponse)
|
|
2630
|
-
});
|
|
2631
|
-
|
|
2632
|
-
// src/serialization/types/RunnerConfigsListResponse.ts
|
|
2633
|
-
var RunnerConfigsListResponse = schemas_exports.object({
|
|
2634
|
-
pagination: Pagination,
|
|
2635
|
-
runnerConfigs: schemas_exports.property(
|
|
2636
|
-
"runner_configs",
|
|
2637
|
-
schemas_exports.record(schemas_exports.string(), RunnerConfigsListResponseRunnerConfigsValue)
|
|
2638
|
-
)
|
|
2639
|
-
});
|
|
2640
|
-
|
|
2641
|
-
// src/serialization/types/RunnerConfigsRefreshMetadataRequestBody.ts
|
|
2642
|
-
var RunnerConfigsRefreshMetadataRequestBody = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2643
|
-
|
|
2644
|
-
// src/serialization/types/RunnerConfigsRefreshMetadataResponse.ts
|
|
2645
|
-
var RunnerConfigsRefreshMetadataResponse = schemas_exports.record(schemas_exports.string(), schemas_exports.unknown());
|
|
2646
|
-
|
|
2647
|
-
// src/serialization/types/RunnerConfigsServerlessHealthCheckResponseSuccessSuccess.ts
|
|
2648
|
-
var RunnerConfigsServerlessHealthCheckResponseSuccessSuccess = schemas_exports.object({
|
|
2649
|
-
version: schemas_exports.string()
|
|
2650
|
-
});
|
|
2651
|
-
|
|
2652
|
-
// src/serialization/types/RunnerConfigsServerlessHealthCheckResponseSuccess.ts
|
|
2653
|
-
var RunnerConfigsServerlessHealthCheckResponseSuccess = schemas_exports.object({
|
|
2654
|
-
success: RunnerConfigsServerlessHealthCheckResponseSuccessSuccess
|
|
2506
|
+
// src/serialization/types/NamespacesArchiveResponse.ts
|
|
2507
|
+
var NamespacesArchiveResponse = schemas_exports.object({
|
|
2508
|
+
namespace: Namespace
|
|
2655
2509
|
});
|
|
2656
2510
|
|
|
2657
|
-
// src/serialization/types/
|
|
2658
|
-
var
|
|
2659
|
-
|
|
2660
|
-
|
|
2661
|
-
|
|
2511
|
+
// src/serialization/types/Node.ts
|
|
2512
|
+
var Node = schemas_exports.object({
|
|
2513
|
+
key: schemas_exports.string(),
|
|
2514
|
+
pool: schemas_exports.string(),
|
|
2515
|
+
namespace: schemas_exports.string(),
|
|
2516
|
+
datacenter: schemas_exports.string(),
|
|
2517
|
+
version: schemas_exports.number(),
|
|
2518
|
+
createTs: schemas_exports.property("create_ts", schemas_exports.number()),
|
|
2519
|
+
lastPingTs: schemas_exports.property("last_ping_ts", schemas_exports.number()),
|
|
2520
|
+
connected: schemas_exports.boolean(),
|
|
2521
|
+
stopping: schemas_exports.boolean()
|
|
2662
2522
|
});
|
|
2663
2523
|
|
|
2664
|
-
// src/serialization/types/
|
|
2665
|
-
var
|
|
2666
|
-
|
|
2524
|
+
// src/serialization/types/Pool.ts
|
|
2525
|
+
var Pool = schemas_exports.object({
|
|
2526
|
+
name: schemas_exports.string(),
|
|
2527
|
+
drainOnVersionUpgrade: schemas_exports.property("drain_on_version_upgrade", schemas_exports.boolean()),
|
|
2528
|
+
actorEvictionDelay: schemas_exports.property("actor_eviction_delay", schemas_exports.number()),
|
|
2529
|
+
actorEvictionPeriod: schemas_exports.property("actor_eviction_period", schemas_exports.number()),
|
|
2530
|
+
actorEvictionRate: schemas_exports.property("actor_eviction_rate", schemas_exports.number()),
|
|
2531
|
+
metadata: schemas_exports.unknown()
|
|
2667
2532
|
});
|
|
2668
2533
|
|
|
2669
|
-
// src/serialization/types/
|
|
2670
|
-
var
|
|
2671
|
-
|
|
2534
|
+
// src/serialization/types/PoolResponse.ts
|
|
2535
|
+
var PoolResponse = schemas_exports.object({
|
|
2536
|
+
pool: Pool
|
|
2672
2537
|
});
|
|
2673
2538
|
|
|
2674
|
-
// src/serialization/types/
|
|
2675
|
-
var
|
|
2676
|
-
RunnerConfigsServerlessHealthCheckResponseSuccess,
|
|
2677
|
-
RunnerConfigsServerlessHealthCheckResponseFailure
|
|
2678
|
-
]);
|
|
2679
|
-
|
|
2680
|
-
// src/serialization/types/RunnerConfigsUpsertResponse.ts
|
|
2681
|
-
var RunnerConfigsUpsertResponse = schemas_exports.object({
|
|
2682
|
-
endpointConfigChanged: schemas_exports.property("endpoint_config_changed", schemas_exports.boolean())
|
|
2683
|
-
});
|
|
2539
|
+
// src/serialization/types/PoolsDeleteResponse.ts
|
|
2540
|
+
var PoolsDeleteResponse = schemas_exports.object({});
|
|
2684
2541
|
|
|
2685
|
-
// src/serialization/types/
|
|
2686
|
-
var
|
|
2687
|
-
|
|
2542
|
+
// src/serialization/types/PoolsListNodesResponse.ts
|
|
2543
|
+
var PoolsListNodesResponse = schemas_exports.object({
|
|
2544
|
+
nodes: schemas_exports.list(Node),
|
|
2688
2545
|
pagination: Pagination
|
|
2689
2546
|
});
|
|
2690
2547
|
|
|
2691
|
-
// src/serialization/types/
|
|
2692
|
-
var
|
|
2548
|
+
// src/serialization/types/PoolsListResponse.ts
|
|
2549
|
+
var PoolsListResponse = schemas_exports.object({
|
|
2693
2550
|
pagination: Pagination,
|
|
2694
|
-
|
|
2551
|
+
pools: schemas_exports.list(Pool)
|
|
2695
2552
|
});
|
|
2696
2553
|
|
|
2697
2554
|
// src/serialization/client/requests/ActorsCreateRequest.ts
|
|
2698
2555
|
var ActorsCreateRequest = schemas_exports.object({
|
|
2699
|
-
crashPolicy: schemas_exports.property("crash_policy", CrashPolicy2),
|
|
2700
|
-
datacenter: schemas_exports.string().optional(),
|
|
2701
2556
|
input: schemas_exports.string().optional(),
|
|
2702
2557
|
key: schemas_exports.string().optional(),
|
|
2703
2558
|
name: schemas_exports.string(),
|
|
2704
|
-
|
|
2559
|
+
pool: schemas_exports.string().optional()
|
|
2705
2560
|
});
|
|
2706
2561
|
|
|
2707
2562
|
// src/serialization/client/requests/ActorsGetOrCreateRequest.ts
|
|
2708
2563
|
var ActorsGetOrCreateRequest = schemas_exports.object({
|
|
2709
|
-
crashPolicy: schemas_exports.property("crash_policy", CrashPolicy2),
|
|
2710
|
-
datacenter: schemas_exports.string().optional(),
|
|
2711
2564
|
input: schemas_exports.string().optional(),
|
|
2712
|
-
key: schemas_exports.string(),
|
|
2565
|
+
key: schemas_exports.string().optional(),
|
|
2713
2566
|
name: schemas_exports.string(),
|
|
2714
|
-
|
|
2715
|
-
});
|
|
2716
|
-
|
|
2717
|
-
// src/serialization/client/requests/RunnerConfigsServerlessHealthCheckRequest.ts
|
|
2718
|
-
var RunnerConfigsServerlessHealthCheckRequest = schemas_exports.object({
|
|
2719
|
-
headers: schemas_exports.record(schemas_exports.string(), schemas_exports.string()).optional(),
|
|
2720
|
-
url: schemas_exports.string()
|
|
2567
|
+
pool: schemas_exports.string().optional()
|
|
2721
2568
|
});
|
|
2722
2569
|
|
|
2723
|
-
// src/serialization/client/requests/
|
|
2724
|
-
var
|
|
2725
|
-
|
|
2570
|
+
// src/serialization/client/requests/ActorsForkRequest.ts
|
|
2571
|
+
var ActorsForkRequest = schemas_exports.object({
|
|
2572
|
+
key: schemas_exports.string().optional(),
|
|
2573
|
+
input: schemas_exports.string().optional()
|
|
2726
2574
|
});
|
|
2727
2575
|
|
|
2728
2576
|
// src/serialization/resources/namespaces/index.ts
|
|
2729
|
-
var
|
|
2730
|
-
__export(
|
|
2577
|
+
var namespaces_exports = {};
|
|
2578
|
+
__export(namespaces_exports, {
|
|
2731
2579
|
NamespacesCreateRequest: () => NamespacesCreateRequest
|
|
2732
2580
|
});
|
|
2733
2581
|
|
|
2734
2582
|
// src/serialization/resources/namespaces/client/requests/NamespacesCreateRequest.ts
|
|
2735
2583
|
var NamespacesCreateRequest = schemas_exports.object({
|
|
2736
|
-
displayName: schemas_exports.property("display_name", schemas_exports.string()),
|
|
2737
2584
|
name: schemas_exports.string()
|
|
2738
2585
|
});
|
|
2739
2586
|
|
|
2740
|
-
// src/Client.ts
|
|
2741
|
-
import urlJoin7 from "url-join";
|
|
2742
|
-
|
|
2743
2587
|
// src/errors/RivetError.ts
|
|
2744
2588
|
var RivetError = class _RivetError extends Error {
|
|
2745
2589
|
statusCode;
|
|
@@ -2781,25 +2625,18 @@ var RivetTimeoutError = class _RivetTimeoutError extends Error {
|
|
|
2781
2625
|
}
|
|
2782
2626
|
};
|
|
2783
2627
|
|
|
2784
|
-
// src/api/resources/
|
|
2785
|
-
|
|
2786
|
-
var Datacenters = class {
|
|
2628
|
+
// src/api/resources/authTokens/client/Client.ts
|
|
2629
|
+
var AuthTokens = class {
|
|
2787
2630
|
constructor(_options) {
|
|
2788
2631
|
this._options = _options;
|
|
2789
2632
|
}
|
|
2790
|
-
|
|
2791
|
-
* @param {Datacenters.RequestOptions} requestOptions - Request-specific configuration.
|
|
2792
|
-
*
|
|
2793
|
-
* @example
|
|
2794
|
-
* await client.datacenters.list()
|
|
2795
|
-
*/
|
|
2796
|
-
async list(requestOptions) {
|
|
2633
|
+
async create(request, requestOptions) {
|
|
2797
2634
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2798
2635
|
url: urlJoin(
|
|
2799
2636
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2800
|
-
"
|
|
2637
|
+
"auth/tokens"
|
|
2801
2638
|
),
|
|
2802
|
-
method: "
|
|
2639
|
+
method: "POST",
|
|
2803
2640
|
headers: {
|
|
2804
2641
|
Authorization: await this._getAuthorizationHeader(),
|
|
2805
2642
|
"X-Fern-Language": "JavaScript",
|
|
@@ -2809,12 +2646,18 @@ var Datacenters = class {
|
|
|
2809
2646
|
},
|
|
2810
2647
|
contentType: "application/json",
|
|
2811
2648
|
requestType: "json",
|
|
2649
|
+
body: {
|
|
2650
|
+
namespace: request.namespace,
|
|
2651
|
+
duration: request.duration,
|
|
2652
|
+
subject: request.subject,
|
|
2653
|
+
grants: request.grants.map((grant) => AuthTokenGrant.jsonOrThrow(grant))
|
|
2654
|
+
},
|
|
2812
2655
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
2813
2656
|
maxRetries: requestOptions?.maxRetries,
|
|
2814
2657
|
abortSignal: requestOptions?.abortSignal
|
|
2815
2658
|
});
|
|
2816
2659
|
if (_response.ok) {
|
|
2817
|
-
return
|
|
2660
|
+
return AuthTokenCreateResponse.parseOrThrow(_response.body, {
|
|
2818
2661
|
unrecognizedObjectKeys: "passthrough",
|
|
2819
2662
|
allowUnrecognizedUnionMembers: true,
|
|
2820
2663
|
allowUnrecognizedEnumValues: true,
|
|
@@ -2835,57 +2678,18 @@ var Datacenters = class {
|
|
|
2835
2678
|
body: _response.error.rawBody
|
|
2836
2679
|
});
|
|
2837
2680
|
case "timeout":
|
|
2838
|
-
throw new RivetTimeoutError("Timeout exceeded when calling
|
|
2681
|
+
throw new RivetTimeoutError("Timeout exceeded when calling POST /auth/tokens.");
|
|
2839
2682
|
case "unknown":
|
|
2840
2683
|
throw new RivetError({
|
|
2841
2684
|
message: _response.error.errorMessage
|
|
2842
2685
|
});
|
|
2843
2686
|
}
|
|
2844
2687
|
}
|
|
2845
|
-
async
|
|
2846
|
-
return `Bearer ${await Supplier.get(this._options.token)}`;
|
|
2847
|
-
}
|
|
2848
|
-
};
|
|
2849
|
-
|
|
2850
|
-
// src/api/resources/envoys/client/Client.ts
|
|
2851
|
-
import urlJoin2 from "url-join";
|
|
2852
|
-
var Envoys = class {
|
|
2853
|
-
constructor(_options) {
|
|
2854
|
-
this._options = _options;
|
|
2855
|
-
}
|
|
2856
|
-
/**
|
|
2857
|
-
* @param {Rivet.EnvoysListRequest} request
|
|
2858
|
-
* @param {Envoys.RequestOptions} requestOptions - Request-specific configuration.
|
|
2859
|
-
*
|
|
2860
|
-
* @example
|
|
2861
|
-
* await client.envoys.list({
|
|
2862
|
-
* namespace: "namespace"
|
|
2863
|
-
* })
|
|
2864
|
-
*/
|
|
2865
|
-
async list(request, requestOptions) {
|
|
2866
|
-
const { namespace, name, envoyKey, limit, cursor } = request;
|
|
2867
|
-
const _queryParams = {};
|
|
2868
|
-
_queryParams["namespace"] = namespace;
|
|
2869
|
-
if (name != null) {
|
|
2870
|
-
_queryParams["name"] = name;
|
|
2871
|
-
}
|
|
2872
|
-
if (envoyKey != null) {
|
|
2873
|
-
if (Array.isArray(envoyKey)) {
|
|
2874
|
-
_queryParams["envoy_key"] = envoyKey.map((item) => item);
|
|
2875
|
-
} else {
|
|
2876
|
-
_queryParams["envoy_key"] = envoyKey;
|
|
2877
|
-
}
|
|
2878
|
-
}
|
|
2879
|
-
if (limit != null) {
|
|
2880
|
-
_queryParams["limit"] = limit.toString();
|
|
2881
|
-
}
|
|
2882
|
-
if (cursor != null) {
|
|
2883
|
-
_queryParams["cursor"] = cursor;
|
|
2884
|
-
}
|
|
2688
|
+
async inspect(requestOptions) {
|
|
2885
2689
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2886
|
-
url:
|
|
2690
|
+
url: urlJoin(
|
|
2887
2691
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2888
|
-
"
|
|
2692
|
+
"auth/tokens/inspect"
|
|
2889
2693
|
),
|
|
2890
2694
|
method: "GET",
|
|
2891
2695
|
headers: {
|
|
@@ -2896,14 +2700,13 @@ var Envoys = class {
|
|
|
2896
2700
|
...requestOptions?.headers
|
|
2897
2701
|
},
|
|
2898
2702
|
contentType: "application/json",
|
|
2899
|
-
queryParameters: _queryParams,
|
|
2900
2703
|
requestType: "json",
|
|
2901
2704
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
2902
2705
|
maxRetries: requestOptions?.maxRetries,
|
|
2903
2706
|
abortSignal: requestOptions?.abortSignal
|
|
2904
2707
|
});
|
|
2905
2708
|
if (_response.ok) {
|
|
2906
|
-
return
|
|
2709
|
+
return AuthTokenInspectResponse.parseOrThrow(_response.body, {
|
|
2907
2710
|
unrecognizedObjectKeys: "passthrough",
|
|
2908
2711
|
allowUnrecognizedUnionMembers: true,
|
|
2909
2712
|
allowUnrecognizedEnumValues: true,
|
|
@@ -2924,7 +2727,7 @@ var Envoys = class {
|
|
|
2924
2727
|
body: _response.error.rawBody
|
|
2925
2728
|
});
|
|
2926
2729
|
case "timeout":
|
|
2927
|
-
throw new RivetTimeoutError("Timeout exceeded when calling GET /
|
|
2730
|
+
throw new RivetTimeoutError("Timeout exceeded when calling GET /auth/tokens/inspect.");
|
|
2928
2731
|
case "unknown":
|
|
2929
2732
|
throw new RivetError({
|
|
2930
2733
|
message: _response.error.errorMessage
|
|
@@ -2936,23 +2739,38 @@ var Envoys = class {
|
|
|
2936
2739
|
}
|
|
2937
2740
|
};
|
|
2938
2741
|
|
|
2939
|
-
// src/api/resources/
|
|
2940
|
-
|
|
2941
|
-
|
|
2742
|
+
// src/api/resources/datacenters/index.ts
|
|
2743
|
+
var datacenters_exports = {};
|
|
2744
|
+
|
|
2745
|
+
// src/api/resources/metadata/index.ts
|
|
2746
|
+
var metadata_exports = {};
|
|
2747
|
+
|
|
2748
|
+
// src/api/resources/namespaces/index.ts
|
|
2749
|
+
var namespaces_exports2 = {};
|
|
2750
|
+
|
|
2751
|
+
// src/api/resources/pools/index.ts
|
|
2752
|
+
var pools_exports = {};
|
|
2753
|
+
|
|
2754
|
+
// src/Client.ts
|
|
2755
|
+
import urlJoin6 from "url-join";
|
|
2756
|
+
|
|
2757
|
+
// src/api/resources/datacenters/client/Client.ts
|
|
2758
|
+
import urlJoin2 from "url-join";
|
|
2759
|
+
var Datacenters = class {
|
|
2942
2760
|
constructor(_options) {
|
|
2943
2761
|
this._options = _options;
|
|
2944
2762
|
}
|
|
2945
2763
|
/**
|
|
2946
|
-
* @param {
|
|
2764
|
+
* @param {Datacenters.RequestOptions} requestOptions - Request-specific configuration.
|
|
2947
2765
|
*
|
|
2948
2766
|
* @example
|
|
2949
|
-
* await client.
|
|
2767
|
+
* await client.datacenters.list()
|
|
2950
2768
|
*/
|
|
2951
|
-
async
|
|
2769
|
+
async list(requestOptions) {
|
|
2952
2770
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
2953
|
-
url:
|
|
2771
|
+
url: urlJoin2(
|
|
2954
2772
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
2955
|
-
"
|
|
2773
|
+
"datacenters"
|
|
2956
2774
|
),
|
|
2957
2775
|
method: "GET",
|
|
2958
2776
|
headers: {
|
|
@@ -2969,7 +2787,7 @@ var Health = class {
|
|
|
2969
2787
|
abortSignal: requestOptions?.abortSignal
|
|
2970
2788
|
});
|
|
2971
2789
|
if (_response.ok) {
|
|
2972
|
-
return
|
|
2790
|
+
return DatacentersListResponse.parseOrThrow(_response.body, {
|
|
2973
2791
|
unrecognizedObjectKeys: "passthrough",
|
|
2974
2792
|
allowUnrecognizedUnionMembers: true,
|
|
2975
2793
|
allowUnrecognizedEnumValues: true,
|
|
@@ -2990,7 +2808,7 @@ var Health = class {
|
|
|
2990
2808
|
body: _response.error.rawBody
|
|
2991
2809
|
});
|
|
2992
2810
|
case "timeout":
|
|
2993
|
-
throw new RivetTimeoutError("Timeout exceeded when calling GET /
|
|
2811
|
+
throw new RivetTimeoutError("Timeout exceeded when calling GET /datacenters.");
|
|
2994
2812
|
case "unknown":
|
|
2995
2813
|
throw new RivetError({
|
|
2996
2814
|
message: _response.error.errorMessage
|
|
@@ -3003,7 +2821,7 @@ var Health = class {
|
|
|
3003
2821
|
};
|
|
3004
2822
|
|
|
3005
2823
|
// src/api/resources/metadata/client/Client.ts
|
|
3006
|
-
import
|
|
2824
|
+
import urlJoin3 from "url-join";
|
|
3007
2825
|
var Metadata = class {
|
|
3008
2826
|
constructor(_options) {
|
|
3009
2827
|
this._options = _options;
|
|
@@ -3016,7 +2834,7 @@ var Metadata = class {
|
|
|
3016
2834
|
*/
|
|
3017
2835
|
async get(requestOptions) {
|
|
3018
2836
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3019
|
-
url:
|
|
2837
|
+
url: urlJoin3(
|
|
3020
2838
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3021
2839
|
"metadata"
|
|
3022
2840
|
),
|
|
@@ -3069,7 +2887,7 @@ var Metadata = class {
|
|
|
3069
2887
|
};
|
|
3070
2888
|
|
|
3071
2889
|
// src/api/resources/namespaces/client/Client.ts
|
|
3072
|
-
import
|
|
2890
|
+
import urlJoin4 from "url-join";
|
|
3073
2891
|
var Namespaces = class {
|
|
3074
2892
|
constructor(_options) {
|
|
3075
2893
|
this._options = _options;
|
|
@@ -3082,7 +2900,7 @@ var Namespaces = class {
|
|
|
3082
2900
|
* await client.namespaces.list()
|
|
3083
2901
|
*/
|
|
3084
2902
|
async list(request = {}, requestOptions) {
|
|
3085
|
-
const { limit, cursor, name
|
|
2903
|
+
const { limit, cursor, name } = request;
|
|
3086
2904
|
const _queryParams = {};
|
|
3087
2905
|
if (limit != null) {
|
|
3088
2906
|
_queryParams["limit"] = limit.toString();
|
|
@@ -3093,20 +2911,8 @@ var Namespaces = class {
|
|
|
3093
2911
|
if (name != null) {
|
|
3094
2912
|
_queryParams["name"] = name;
|
|
3095
2913
|
}
|
|
3096
|
-
if (namespaceIds != null) {
|
|
3097
|
-
_queryParams["namespace_ids"] = namespaceIds;
|
|
3098
|
-
}
|
|
3099
|
-
if (namespaceId != null) {
|
|
3100
|
-
if (Array.isArray(namespaceId)) {
|
|
3101
|
-
_queryParams["namespace_id"] = namespaceId.map(
|
|
3102
|
-
(item) => RivetId.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" })
|
|
3103
|
-
);
|
|
3104
|
-
} else {
|
|
3105
|
-
_queryParams["namespace_id"] = namespaceId;
|
|
3106
|
-
}
|
|
3107
|
-
}
|
|
3108
2914
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3109
|
-
url:
|
|
2915
|
+
url: urlJoin4(
|
|
3110
2916
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3111
2917
|
"namespaces"
|
|
3112
2918
|
),
|
|
@@ -3160,13 +2966,14 @@ var Namespaces = class {
|
|
|
3160
2966
|
*
|
|
3161
2967
|
* @example
|
|
3162
2968
|
* await client.namespaces.create({
|
|
3163
|
-
* displayName: "display_name",
|
|
3164
2969
|
* name: "name"
|
|
3165
2970
|
* })
|
|
3166
2971
|
*/
|
|
3167
2972
|
async create(request, requestOptions) {
|
|
2973
|
+
const _body = request;
|
|
2974
|
+
const _queryParams = {};
|
|
3168
2975
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3169
|
-
url:
|
|
2976
|
+
url: urlJoin4(
|
|
3170
2977
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3171
2978
|
"namespaces"
|
|
3172
2979
|
),
|
|
@@ -3179,8 +2986,9 @@ var Namespaces = class {
|
|
|
3179
2986
|
...requestOptions?.headers
|
|
3180
2987
|
},
|
|
3181
2988
|
contentType: "application/json",
|
|
2989
|
+
queryParameters: _queryParams,
|
|
3182
2990
|
requestType: "json",
|
|
3183
|
-
body: NamespacesCreateRequest.jsonOrThrow(
|
|
2991
|
+
body: NamespacesCreateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
3184
2992
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
3185
2993
|
maxRetries: requestOptions?.maxRetries,
|
|
3186
2994
|
abortSignal: requestOptions?.abortSignal
|
|
@@ -3214,60 +3022,24 @@ var Namespaces = class {
|
|
|
3214
3022
|
});
|
|
3215
3023
|
}
|
|
3216
3024
|
}
|
|
3217
|
-
async _getAuthorizationHeader() {
|
|
3218
|
-
return `Bearer ${await Supplier.get(this._options.token)}`;
|
|
3219
|
-
}
|
|
3220
|
-
};
|
|
3221
|
-
|
|
3222
|
-
// src/api/resources/runners/client/Client.ts
|
|
3223
|
-
import urlJoin6 from "url-join";
|
|
3224
|
-
var Runners = class {
|
|
3225
|
-
constructor(_options) {
|
|
3226
|
-
this._options = _options;
|
|
3227
|
-
}
|
|
3228
3025
|
/**
|
|
3229
|
-
*
|
|
3230
|
-
*
|
|
3026
|
+
* Archives a namespace: refuses new work for it, stops what its nodes host, then closes its
|
|
3027
|
+
* storage. Archiving is final. Answers at once with the namespace at status `archiving`, or
|
|
3028
|
+
* `archived` when it already is.
|
|
3029
|
+
*
|
|
3030
|
+
* @param {string} name - The namespace to archive.
|
|
3031
|
+
* @param {Namespaces.RequestOptions} requestOptions - Request-specific configuration.
|
|
3231
3032
|
*
|
|
3232
3033
|
* @example
|
|
3233
|
-
* await client.
|
|
3234
|
-
* namespace: "namespace"
|
|
3235
|
-
* })
|
|
3034
|
+
* await client.namespaces.archive("staging")
|
|
3236
3035
|
*/
|
|
3237
|
-
async
|
|
3238
|
-
const { namespace, name, runnerIds, runnerId, includeStopped, limit, cursor } = request;
|
|
3239
|
-
const _queryParams = {};
|
|
3240
|
-
_queryParams["namespace"] = namespace;
|
|
3241
|
-
if (name != null) {
|
|
3242
|
-
_queryParams["name"] = name;
|
|
3243
|
-
}
|
|
3244
|
-
if (runnerIds != null) {
|
|
3245
|
-
_queryParams["runner_ids"] = runnerIds;
|
|
3246
|
-
}
|
|
3247
|
-
if (runnerId != null) {
|
|
3248
|
-
if (Array.isArray(runnerId)) {
|
|
3249
|
-
_queryParams["runner_id"] = runnerId.map(
|
|
3250
|
-
(item) => RivetId.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" })
|
|
3251
|
-
);
|
|
3252
|
-
} else {
|
|
3253
|
-
_queryParams["runner_id"] = runnerId;
|
|
3254
|
-
}
|
|
3255
|
-
}
|
|
3256
|
-
if (includeStopped != null) {
|
|
3257
|
-
_queryParams["include_stopped"] = includeStopped.toString();
|
|
3258
|
-
}
|
|
3259
|
-
if (limit != null) {
|
|
3260
|
-
_queryParams["limit"] = limit.toString();
|
|
3261
|
-
}
|
|
3262
|
-
if (cursor != null) {
|
|
3263
|
-
_queryParams["cursor"] = cursor;
|
|
3264
|
-
}
|
|
3036
|
+
async archive(name, requestOptions) {
|
|
3265
3037
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3266
|
-
url:
|
|
3038
|
+
url: urlJoin4(
|
|
3267
3039
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3268
|
-
|
|
3040
|
+
`namespaces/${encodeURIComponent(name)}/archive`
|
|
3269
3041
|
),
|
|
3270
|
-
method: "
|
|
3042
|
+
method: "POST",
|
|
3271
3043
|
headers: {
|
|
3272
3044
|
Authorization: await this._getAuthorizationHeader(),
|
|
3273
3045
|
"X-Fern-Language": "JavaScript",
|
|
@@ -3276,14 +3048,13 @@ var Runners = class {
|
|
|
3276
3048
|
...requestOptions?.headers
|
|
3277
3049
|
},
|
|
3278
3050
|
contentType: "application/json",
|
|
3279
|
-
queryParameters: _queryParams,
|
|
3280
3051
|
requestType: "json",
|
|
3281
3052
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
3282
3053
|
maxRetries: requestOptions?.maxRetries,
|
|
3283
3054
|
abortSignal: requestOptions?.abortSignal
|
|
3284
3055
|
});
|
|
3285
3056
|
if (_response.ok) {
|
|
3286
|
-
return
|
|
3057
|
+
return NamespacesArchiveResponse.parseOrThrow(_response.body, {
|
|
3287
3058
|
unrecognizedObjectKeys: "passthrough",
|
|
3288
3059
|
allowUnrecognizedUnionMembers: true,
|
|
3289
3060
|
allowUnrecognizedEnumValues: true,
|
|
@@ -3304,31 +3075,40 @@ var Runners = class {
|
|
|
3304
3075
|
body: _response.error.rawBody
|
|
3305
3076
|
});
|
|
3306
3077
|
case "timeout":
|
|
3307
|
-
throw new RivetTimeoutError("Timeout exceeded when calling
|
|
3078
|
+
throw new RivetTimeoutError("Timeout exceeded when calling POST /namespaces.");
|
|
3308
3079
|
case "unknown":
|
|
3309
3080
|
throw new RivetError({
|
|
3310
3081
|
message: _response.error.errorMessage
|
|
3311
3082
|
});
|
|
3312
3083
|
}
|
|
3313
3084
|
}
|
|
3085
|
+
async _getAuthorizationHeader() {
|
|
3086
|
+
return `Bearer ${await Supplier.get(this._options.token)}`;
|
|
3087
|
+
}
|
|
3088
|
+
};
|
|
3089
|
+
|
|
3090
|
+
// src/api/resources/pools/client/Client.ts
|
|
3091
|
+
import urlJoin5 from "url-join";
|
|
3092
|
+
var Pools = class {
|
|
3093
|
+
constructor(_options) {
|
|
3094
|
+
this._options = _options;
|
|
3095
|
+
}
|
|
3314
3096
|
/**
|
|
3315
|
-
*
|
|
3097
|
+
* Lists the namespace's pools by name. Changes apply on each node's next connection.
|
|
3316
3098
|
*
|
|
3317
|
-
*
|
|
3318
|
-
* -
|
|
3319
|
-
*
|
|
3320
|
-
* @param {Rivet.RunnersListNamesRequest} request
|
|
3321
|
-
* @param {Runners.RequestOptions} requestOptions - Request-specific configuration.
|
|
3099
|
+
* @param {Rivet.PoolsListRequest} request
|
|
3100
|
+
* @param {Pools.RequestOptions} requestOptions - Request-specific configuration.
|
|
3322
3101
|
*
|
|
3323
3102
|
* @example
|
|
3324
|
-
* await client.
|
|
3103
|
+
* await client.pools.list({
|
|
3325
3104
|
* namespace: "namespace"
|
|
3326
3105
|
* })
|
|
3327
3106
|
*/
|
|
3328
|
-
async
|
|
3107
|
+
async list(request, requestOptions) {
|
|
3329
3108
|
const { namespace, limit, cursor } = request;
|
|
3330
3109
|
const _queryParams = {};
|
|
3331
|
-
|
|
3110
|
+
if (namespace != null)
|
|
3111
|
+
_queryParams["namespace"] = namespace;
|
|
3332
3112
|
if (limit != null) {
|
|
3333
3113
|
_queryParams["limit"] = limit.toString();
|
|
3334
3114
|
}
|
|
@@ -3336,9 +3116,9 @@ var Runners = class {
|
|
|
3336
3116
|
_queryParams["cursor"] = cursor;
|
|
3337
3117
|
}
|
|
3338
3118
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3339
|
-
url:
|
|
3119
|
+
url: urlJoin5(
|
|
3340
3120
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3341
|
-
"
|
|
3121
|
+
"pools"
|
|
3342
3122
|
),
|
|
3343
3123
|
method: "GET",
|
|
3344
3124
|
headers: {
|
|
@@ -3356,7 +3136,7 @@ var Runners = class {
|
|
|
3356
3136
|
abortSignal: requestOptions?.abortSignal
|
|
3357
3137
|
});
|
|
3358
3138
|
if (_response.ok) {
|
|
3359
|
-
return
|
|
3139
|
+
return PoolsListResponse.parseOrThrow(_response.body, {
|
|
3360
3140
|
unrecognizedObjectKeys: "passthrough",
|
|
3361
3141
|
allowUnrecognizedUnionMembers: true,
|
|
3362
3142
|
allowUnrecognizedEnumValues: true,
|
|
@@ -3377,104 +3157,30 @@ var Runners = class {
|
|
|
3377
3157
|
body: _response.error.rawBody
|
|
3378
3158
|
});
|
|
3379
3159
|
case "timeout":
|
|
3380
|
-
throw new RivetTimeoutError("Timeout exceeded when calling GET /
|
|
3160
|
+
throw new RivetTimeoutError("Timeout exceeded when calling GET /pools.");
|
|
3381
3161
|
case "unknown":
|
|
3382
3162
|
throw new RivetError({
|
|
3383
3163
|
message: _response.error.errorMessage
|
|
3384
3164
|
});
|
|
3385
3165
|
}
|
|
3386
3166
|
}
|
|
3387
|
-
async _getAuthorizationHeader() {
|
|
3388
|
-
return `Bearer ${await Supplier.get(this._options.token)}`;
|
|
3389
|
-
}
|
|
3390
|
-
};
|
|
3391
|
-
|
|
3392
|
-
// src/Client.ts
|
|
3393
|
-
var RivetClient = class {
|
|
3394
|
-
constructor(_options) {
|
|
3395
|
-
this._options = _options;
|
|
3396
|
-
}
|
|
3397
|
-
_datacenters;
|
|
3398
|
-
_envoys;
|
|
3399
|
-
_health;
|
|
3400
|
-
_metadata;
|
|
3401
|
-
_namespaces;
|
|
3402
|
-
_runners;
|
|
3403
|
-
get datacenters() {
|
|
3404
|
-
return this._datacenters ??= new Datacenters(this._options);
|
|
3405
|
-
}
|
|
3406
|
-
get envoys() {
|
|
3407
|
-
return this._envoys ??= new Envoys(this._options);
|
|
3408
|
-
}
|
|
3409
|
-
get health() {
|
|
3410
|
-
return this._health ??= new Health(this._options);
|
|
3411
|
-
}
|
|
3412
|
-
get metadata() {
|
|
3413
|
-
return this._metadata ??= new Metadata(this._options);
|
|
3414
|
-
}
|
|
3415
|
-
get namespaces() {
|
|
3416
|
-
return this._namespaces ??= new Namespaces(this._options);
|
|
3417
|
-
}
|
|
3418
|
-
get runners() {
|
|
3419
|
-
return this._runners ??= new Runners(this._options);
|
|
3420
|
-
}
|
|
3421
3167
|
/**
|
|
3422
|
-
*
|
|
3423
|
-
*
|
|
3424
|
-
* 2 round trips:
|
|
3425
|
-
*
|
|
3426
|
-
* - namespace::ops::resolve_for_name_global
|
|
3427
|
-
* - GET /actors (multiple DCs based on actor IDs)
|
|
3428
|
-
*
|
|
3429
|
-
* This path is optimized because we can read the actor IDs fro the key directly from Epoxy with
|
|
3430
|
-
* stale consistency to determine which datacenter the actor lives in. Under most circumstances,
|
|
3431
|
-
* this means we don't need to fan out to all datacenters (like normal list does).
|
|
3432
|
-
*
|
|
3433
|
-
* The reason `include_destroyed` has to be false is Epoxy only stores currently active actors. If
|
|
3434
|
-
* `include_destroyed` is true, we show all previous iterations of actors with the same key.
|
|
3435
|
-
*
|
|
3436
|
-
* **Otherwise**
|
|
3437
|
-
*
|
|
3438
|
-
* 2 round trips:
|
|
3439
|
-
*
|
|
3440
|
-
* - namespace::ops::resolve_for_name_global
|
|
3441
|
-
* - GET /actors (fanout)
|
|
3168
|
+
* Lists the live nodes of a pool in node key order.
|
|
3442
3169
|
*
|
|
3443
|
-
*
|
|
3444
|
-
*
|
|
3445
|
-
* @param {
|
|
3446
|
-
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3170
|
+
* @param {string} pool
|
|
3171
|
+
* @param {Rivet.PoolsListNodesRequest} request
|
|
3172
|
+
* @param {Pools.RequestOptions} requestOptions - Request-specific configuration.
|
|
3447
3173
|
*
|
|
3448
3174
|
* @example
|
|
3449
|
-
* await client.
|
|
3175
|
+
* await client.pools.listNodes("pool", {
|
|
3450
3176
|
* namespace: "namespace"
|
|
3451
3177
|
* })
|
|
3452
3178
|
*/
|
|
3453
|
-
async
|
|
3454
|
-
const { namespace,
|
|
3179
|
+
async listNodes(pool, request, requestOptions) {
|
|
3180
|
+
const { namespace, limit, cursor } = request;
|
|
3455
3181
|
const _queryParams = {};
|
|
3456
|
-
|
|
3457
|
-
|
|
3458
|
-
_queryParams["name"] = name;
|
|
3459
|
-
}
|
|
3460
|
-
if (key != null) {
|
|
3461
|
-
_queryParams["key"] = key;
|
|
3462
|
-
}
|
|
3463
|
-
if (actorIds != null) {
|
|
3464
|
-
_queryParams["actor_ids"] = actorIds;
|
|
3465
|
-
}
|
|
3466
|
-
if (actorId != null) {
|
|
3467
|
-
if (Array.isArray(actorId)) {
|
|
3468
|
-
_queryParams["actor_id"] = actorId.map(
|
|
3469
|
-
(item) => RivetId.jsonOrThrow(item, { unrecognizedObjectKeys: "strip" })
|
|
3470
|
-
);
|
|
3471
|
-
} else {
|
|
3472
|
-
_queryParams["actor_id"] = actorId;
|
|
3473
|
-
}
|
|
3474
|
-
}
|
|
3475
|
-
if (includeDestroyed != null) {
|
|
3476
|
-
_queryParams["include_destroyed"] = includeDestroyed.toString();
|
|
3477
|
-
}
|
|
3182
|
+
if (namespace != null)
|
|
3183
|
+
_queryParams["namespace"] = namespace;
|
|
3478
3184
|
if (limit != null) {
|
|
3479
3185
|
_queryParams["limit"] = limit.toString();
|
|
3480
3186
|
}
|
|
@@ -3482,9 +3188,9 @@ var RivetClient = class {
|
|
|
3482
3188
|
_queryParams["cursor"] = cursor;
|
|
3483
3189
|
}
|
|
3484
3190
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3485
|
-
url:
|
|
3191
|
+
url: urlJoin5(
|
|
3486
3192
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3487
|
-
|
|
3193
|
+
`pools/${encodeURIComponent(pool)}/nodes`
|
|
3488
3194
|
),
|
|
3489
3195
|
method: "GET",
|
|
3490
3196
|
headers: {
|
|
@@ -3502,7 +3208,7 @@ var RivetClient = class {
|
|
|
3502
3208
|
abortSignal: requestOptions?.abortSignal
|
|
3503
3209
|
});
|
|
3504
3210
|
if (_response.ok) {
|
|
3505
|
-
return
|
|
3211
|
+
return PoolsListNodesResponse.parseOrThrow(_response.body, {
|
|
3506
3212
|
unrecognizedObjectKeys: "passthrough",
|
|
3507
3213
|
allowUnrecognizedUnionMembers: true,
|
|
3508
3214
|
allowUnrecognizedEnumValues: true,
|
|
@@ -3523,52 +3229,23 @@ var RivetClient = class {
|
|
|
3523
3229
|
body: _response.error.rawBody
|
|
3524
3230
|
});
|
|
3525
3231
|
case "timeout":
|
|
3526
|
-
throw new RivetTimeoutError("Timeout exceeded when calling GET /
|
|
3232
|
+
throw new RivetTimeoutError("Timeout exceeded when calling GET /pools/{pool}/nodes.");
|
|
3527
3233
|
case "unknown":
|
|
3528
3234
|
throw new RivetError({
|
|
3529
3235
|
message: _response.error.errorMessage
|
|
3530
3236
|
});
|
|
3531
3237
|
}
|
|
3532
3238
|
}
|
|
3533
|
-
|
|
3534
|
-
* **If actor is created in the current datacenter:**
|
|
3535
|
-
*
|
|
3536
|
-
* 2 round trips:
|
|
3537
|
-
*
|
|
3538
|
-
* - namespace::ops::resolve_for_name_global
|
|
3539
|
-
* - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
|
|
3540
|
-
*
|
|
3541
|
-
* **If actor is created in a different datacenter:**
|
|
3542
|
-
*
|
|
3543
|
-
* 3 round trips:
|
|
3544
|
-
*
|
|
3545
|
-
* - namespace::ops::resolve_for_name_global
|
|
3546
|
-
* - POST /actors to remote datacenter
|
|
3547
|
-
* - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
|
|
3548
|
-
*
|
|
3549
|
-
* actor::get will always be in the same datacenter.
|
|
3550
|
-
*
|
|
3551
|
-
* @param {Rivet.ActorsCreateRequest} request
|
|
3552
|
-
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3553
|
-
*
|
|
3554
|
-
* @example
|
|
3555
|
-
* await client.actorsCreate({
|
|
3556
|
-
* namespace: "namespace",
|
|
3557
|
-
* crashPolicy: "restart",
|
|
3558
|
-
* name: "name",
|
|
3559
|
-
* runnerNameSelector: "runner_name_selector"
|
|
3560
|
-
* })
|
|
3561
|
-
*/
|
|
3562
|
-
async actorsCreate(request, requestOptions) {
|
|
3563
|
-
const { namespace, ..._body } = request;
|
|
3239
|
+
async get(name, request = {}, requestOptions) {
|
|
3564
3240
|
const _queryParams = {};
|
|
3565
|
-
|
|
3241
|
+
if (request.namespace != null)
|
|
3242
|
+
_queryParams["namespace"] = request.namespace;
|
|
3566
3243
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3567
|
-
url:
|
|
3244
|
+
url: urlJoin5(
|
|
3568
3245
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3569
|
-
|
|
3246
|
+
`pools/${encodeURIComponent(name)}`
|
|
3570
3247
|
),
|
|
3571
|
-
method: "
|
|
3248
|
+
method: "GET",
|
|
3572
3249
|
headers: {
|
|
3573
3250
|
Authorization: await this._getAuthorizationHeader(),
|
|
3574
3251
|
"X-Fern-Language": "JavaScript",
|
|
@@ -3579,13 +3256,12 @@ var RivetClient = class {
|
|
|
3579
3256
|
contentType: "application/json",
|
|
3580
3257
|
queryParameters: _queryParams,
|
|
3581
3258
|
requestType: "json",
|
|
3582
|
-
body: ActorsCreateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
3583
3259
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
3584
3260
|
maxRetries: requestOptions?.maxRetries,
|
|
3585
3261
|
abortSignal: requestOptions?.abortSignal
|
|
3586
3262
|
});
|
|
3587
3263
|
if (_response.ok) {
|
|
3588
|
-
return
|
|
3264
|
+
return PoolResponse.parseOrThrow(_response.body, {
|
|
3589
3265
|
unrecognizedObjectKeys: "passthrough",
|
|
3590
3266
|
allowUnrecognizedUnionMembers: true,
|
|
3591
3267
|
allowUnrecognizedEnumValues: true,
|
|
@@ -3606,60 +3282,21 @@ var RivetClient = class {
|
|
|
3606
3282
|
body: _response.error.rawBody
|
|
3607
3283
|
});
|
|
3608
3284
|
case "timeout":
|
|
3609
|
-
throw new RivetTimeoutError("Timeout exceeded when calling
|
|
3285
|
+
throw new RivetTimeoutError("Timeout exceeded when calling GET /pools/{pool}.");
|
|
3610
3286
|
case "unknown":
|
|
3611
3287
|
throw new RivetError({
|
|
3612
3288
|
message: _response.error.errorMessage
|
|
3613
3289
|
});
|
|
3614
3290
|
}
|
|
3615
3291
|
}
|
|
3616
|
-
|
|
3617
|
-
* **If actor exists**
|
|
3618
|
-
*
|
|
3619
|
-
* 2 round trips:
|
|
3620
|
-
*
|
|
3621
|
-
* - namespace::ops::resolve_for_name_global
|
|
3622
|
-
* - GET /actors/{}
|
|
3623
|
-
*
|
|
3624
|
-
* **If actor does not exist and is created in the current datacenter:**
|
|
3625
|
-
*
|
|
3626
|
-
* 2 round trips:
|
|
3627
|
-
*
|
|
3628
|
-
* - namespace::ops::resolve_for_name_global
|
|
3629
|
-
* - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
|
|
3630
|
-
*
|
|
3631
|
-
* **If actor does not exist and is created in a different datacenter:**
|
|
3632
|
-
*
|
|
3633
|
-
* 3 round trips:
|
|
3634
|
-
*
|
|
3635
|
-
* - namespace::ops::resolve_for_name_global
|
|
3636
|
-
* - POST /actors to remote datacenter
|
|
3637
|
-
* - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
|
|
3638
|
-
*
|
|
3639
|
-
* actor::get will always be in the same datacenter.
|
|
3640
|
-
*
|
|
3641
|
-
* ## Optimized Alternative Routes
|
|
3642
|
-
*
|
|
3643
|
-
* @param {Rivet.ActorsGetOrCreateRequest} request
|
|
3644
|
-
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3645
|
-
*
|
|
3646
|
-
* @example
|
|
3647
|
-
* await client.actorsGetOrCreate({
|
|
3648
|
-
* namespace: "namespace",
|
|
3649
|
-
* crashPolicy: "restart",
|
|
3650
|
-
* key: "key",
|
|
3651
|
-
* name: "name",
|
|
3652
|
-
* runnerNameSelector: "runner_name_selector"
|
|
3653
|
-
* })
|
|
3654
|
-
*/
|
|
3655
|
-
async actorsGetOrCreate(request, requestOptions) {
|
|
3656
|
-
const { namespace, ..._body } = request;
|
|
3292
|
+
async upsert(name, request, requestOptions) {
|
|
3657
3293
|
const _queryParams = {};
|
|
3658
|
-
|
|
3294
|
+
if (request.namespace != null)
|
|
3295
|
+
_queryParams["namespace"] = request.namespace;
|
|
3659
3296
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3660
|
-
url:
|
|
3297
|
+
url: urlJoin5(
|
|
3661
3298
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3662
|
-
|
|
3299
|
+
`pools/${encodeURIComponent(name)}`
|
|
3663
3300
|
),
|
|
3664
3301
|
method: "PUT",
|
|
3665
3302
|
headers: {
|
|
@@ -3672,13 +3309,19 @@ var RivetClient = class {
|
|
|
3672
3309
|
contentType: "application/json",
|
|
3673
3310
|
queryParameters: _queryParams,
|
|
3674
3311
|
requestType: "json",
|
|
3675
|
-
body:
|
|
3312
|
+
body: {
|
|
3313
|
+
drain_on_version_upgrade: request.drainOnVersionUpgrade,
|
|
3314
|
+
actor_eviction_delay: request.actorEvictionDelay,
|
|
3315
|
+
actor_eviction_period: request.actorEvictionPeriod,
|
|
3316
|
+
actor_eviction_rate: request.actorEvictionRate,
|
|
3317
|
+
metadata: request.metadata
|
|
3318
|
+
},
|
|
3676
3319
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
3677
3320
|
maxRetries: requestOptions?.maxRetries,
|
|
3678
3321
|
abortSignal: requestOptions?.abortSignal
|
|
3679
3322
|
});
|
|
3680
3323
|
if (_response.ok) {
|
|
3681
|
-
return
|
|
3324
|
+
return PoolResponse.parseOrThrow(_response.body, {
|
|
3682
3325
|
unrecognizedObjectKeys: "passthrough",
|
|
3683
3326
|
allowUnrecognizedUnionMembers: true,
|
|
3684
3327
|
allowUnrecognizedEnumValues: true,
|
|
@@ -3699,43 +3342,23 @@ var RivetClient = class {
|
|
|
3699
3342
|
body: _response.error.rawBody
|
|
3700
3343
|
});
|
|
3701
3344
|
case "timeout":
|
|
3702
|
-
throw new RivetTimeoutError("Timeout exceeded when calling PUT /
|
|
3345
|
+
throw new RivetTimeoutError("Timeout exceeded when calling PUT /pools/{pool}.");
|
|
3703
3346
|
case "unknown":
|
|
3704
3347
|
throw new RivetError({
|
|
3705
3348
|
message: _response.error.errorMessage
|
|
3706
3349
|
});
|
|
3707
3350
|
}
|
|
3708
3351
|
}
|
|
3709
|
-
|
|
3710
|
-
* 2 round trips:
|
|
3711
|
-
*
|
|
3712
|
-
* - GET /actors/names (fanout)
|
|
3713
|
-
* - [api-peer] namespace::ops::resolve_for_name_global
|
|
3714
|
-
*
|
|
3715
|
-
* @param {Rivet.ActorsListNamesRequest} request
|
|
3716
|
-
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3717
|
-
*
|
|
3718
|
-
* @example
|
|
3719
|
-
* await client.actorsListNames({
|
|
3720
|
-
* namespace: "namespace"
|
|
3721
|
-
* })
|
|
3722
|
-
*/
|
|
3723
|
-
async actorsListNames(request, requestOptions) {
|
|
3724
|
-
const { namespace, limit, cursor } = request;
|
|
3352
|
+
async delete(name, request = {}, requestOptions) {
|
|
3725
3353
|
const _queryParams = {};
|
|
3726
|
-
|
|
3727
|
-
|
|
3728
|
-
_queryParams["limit"] = limit.toString();
|
|
3729
|
-
}
|
|
3730
|
-
if (cursor != null) {
|
|
3731
|
-
_queryParams["cursor"] = cursor;
|
|
3732
|
-
}
|
|
3354
|
+
if (request.namespace != null)
|
|
3355
|
+
_queryParams["namespace"] = request.namespace;
|
|
3733
3356
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3734
|
-
url:
|
|
3357
|
+
url: urlJoin5(
|
|
3735
3358
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3736
|
-
|
|
3359
|
+
`pools/${encodeURIComponent(name)}`
|
|
3737
3360
|
),
|
|
3738
|
-
method: "
|
|
3361
|
+
method: "DELETE",
|
|
3739
3362
|
headers: {
|
|
3740
3363
|
Authorization: await this._getAuthorizationHeader(),
|
|
3741
3364
|
"X-Fern-Language": "JavaScript",
|
|
@@ -3751,13 +3374,7 @@ var RivetClient = class {
|
|
|
3751
3374
|
abortSignal: requestOptions?.abortSignal
|
|
3752
3375
|
});
|
|
3753
3376
|
if (_response.ok) {
|
|
3754
|
-
return
|
|
3755
|
-
unrecognizedObjectKeys: "passthrough",
|
|
3756
|
-
allowUnrecognizedUnionMembers: true,
|
|
3757
|
-
allowUnrecognizedEnumValues: true,
|
|
3758
|
-
skipValidation: true,
|
|
3759
|
-
breadcrumbsPrefix: ["response"]
|
|
3760
|
-
});
|
|
3377
|
+
return PoolsDeleteResponse.parseOrThrow(_response.body, { skipValidation: true });
|
|
3761
3378
|
}
|
|
3762
3379
|
if (_response.error.reason === "status-code") {
|
|
3763
3380
|
throw new RivetError({
|
|
@@ -3772,38 +3389,106 @@ var RivetClient = class {
|
|
|
3772
3389
|
body: _response.error.rawBody
|
|
3773
3390
|
});
|
|
3774
3391
|
case "timeout":
|
|
3775
|
-
throw new RivetTimeoutError("Timeout exceeded when calling
|
|
3392
|
+
throw new RivetTimeoutError("Timeout exceeded when calling DELETE /pools/{pool}.");
|
|
3776
3393
|
case "unknown":
|
|
3777
3394
|
throw new RivetError({
|
|
3778
3395
|
message: _response.error.errorMessage
|
|
3779
3396
|
});
|
|
3780
3397
|
}
|
|
3781
3398
|
}
|
|
3399
|
+
async _getAuthorizationHeader() {
|
|
3400
|
+
return `Bearer ${await Supplier.get(this._options.token)}`;
|
|
3401
|
+
}
|
|
3402
|
+
};
|
|
3403
|
+
|
|
3404
|
+
// src/Client.ts
|
|
3405
|
+
var RivetClient = class {
|
|
3406
|
+
constructor(_options) {
|
|
3407
|
+
this._options = _options;
|
|
3408
|
+
}
|
|
3409
|
+
_authTokens;
|
|
3410
|
+
_datacenters;
|
|
3411
|
+
_metadata;
|
|
3412
|
+
_namespaces;
|
|
3413
|
+
_pools;
|
|
3414
|
+
get authTokens() {
|
|
3415
|
+
return this._authTokens ??= new AuthTokens(this._options);
|
|
3416
|
+
}
|
|
3417
|
+
get datacenters() {
|
|
3418
|
+
return this._datacenters ??= new Datacenters(this._options);
|
|
3419
|
+
}
|
|
3420
|
+
get metadata() {
|
|
3421
|
+
return this._metadata ??= new Metadata(this._options);
|
|
3422
|
+
}
|
|
3423
|
+
get namespaces() {
|
|
3424
|
+
return this._namespaces ??= new Namespaces(this._options);
|
|
3425
|
+
}
|
|
3426
|
+
get pools() {
|
|
3427
|
+
return this._pools ??= new Pools(this._options);
|
|
3428
|
+
}
|
|
3782
3429
|
/**
|
|
3783
|
-
*
|
|
3430
|
+
* **If key is some & `include_destroyed` is false**
|
|
3784
3431
|
*
|
|
3785
|
-
*
|
|
3786
|
-
* - [api-peer] namespace::ops::resolve_for_name_global
|
|
3432
|
+
* 2 round trips:
|
|
3787
3433
|
*
|
|
3788
|
-
*
|
|
3789
|
-
*
|
|
3434
|
+
* - namespace::ops::resolve_for_name_global
|
|
3435
|
+
* - GET /actors (multiple DCs based on actor IDs)
|
|
3436
|
+
*
|
|
3437
|
+
* This path is optimized because we can read the actor IDs fro the key directly from Epoxy with
|
|
3438
|
+
* stale consistency to determine which datacenter the actor lives in. Under most circumstances,
|
|
3439
|
+
* this means we don't need to fan out to all datacenters (like normal list does).
|
|
3440
|
+
*
|
|
3441
|
+
* The reason `include_destroyed` has to be false is Epoxy only stores currently active actors. If
|
|
3442
|
+
* `include_destroyed` is true, we show all previous iterations of actors with the same key.
|
|
3443
|
+
*
|
|
3444
|
+
* **Otherwise**
|
|
3445
|
+
*
|
|
3446
|
+
* 2 round trips:
|
|
3447
|
+
*
|
|
3448
|
+
* - namespace::ops::resolve_for_name_global
|
|
3449
|
+
* - GET /actors (fanout)
|
|
3450
|
+
*
|
|
3451
|
+
* ## Optimized Alternative Routes
|
|
3452
|
+
*
|
|
3453
|
+
* @param {Rivet.ActorsListRequest} request
|
|
3790
3454
|
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3791
3455
|
*
|
|
3792
3456
|
* @example
|
|
3793
|
-
* await client.
|
|
3457
|
+
* await client.actorsList({
|
|
3794
3458
|
* namespace: "namespace"
|
|
3795
3459
|
* })
|
|
3796
3460
|
*/
|
|
3797
|
-
async
|
|
3798
|
-
const { namespace } = request;
|
|
3461
|
+
async actorsList(request, requestOptions) {
|
|
3462
|
+
const { namespace, name, key, actorIds, actorId, includeDestroyed, limit, cursor } = request;
|
|
3799
3463
|
const _queryParams = {};
|
|
3800
|
-
|
|
3464
|
+
if (namespace != null)
|
|
3465
|
+
_queryParams["namespace"] = namespace;
|
|
3466
|
+
if (name != null) {
|
|
3467
|
+
_queryParams["name"] = name;
|
|
3468
|
+
}
|
|
3469
|
+
if (key != null) {
|
|
3470
|
+
_queryParams["key"] = key;
|
|
3471
|
+
}
|
|
3472
|
+
if (actorIds != null) {
|
|
3473
|
+
_queryParams["actor_ids"] = actorIds;
|
|
3474
|
+
}
|
|
3475
|
+
if (actorId != null)
|
|
3476
|
+
_queryParams["actor_id"] = actorId;
|
|
3477
|
+
if (includeDestroyed != null) {
|
|
3478
|
+
_queryParams["include_destroyed"] = includeDestroyed.toString();
|
|
3479
|
+
}
|
|
3480
|
+
if (limit != null) {
|
|
3481
|
+
_queryParams["limit"] = limit.toString();
|
|
3482
|
+
}
|
|
3483
|
+
if (cursor != null) {
|
|
3484
|
+
_queryParams["cursor"] = cursor;
|
|
3485
|
+
}
|
|
3801
3486
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3802
|
-
url:
|
|
3487
|
+
url: urlJoin6(
|
|
3803
3488
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3804
|
-
|
|
3489
|
+
"actors"
|
|
3805
3490
|
),
|
|
3806
|
-
method: "
|
|
3491
|
+
method: "GET",
|
|
3807
3492
|
headers: {
|
|
3808
3493
|
Authorization: await this._getAuthorizationHeader(),
|
|
3809
3494
|
"X-Fern-Language": "JavaScript",
|
|
@@ -3819,7 +3504,7 @@ var RivetClient = class {
|
|
|
3819
3504
|
abortSignal: requestOptions?.abortSignal
|
|
3820
3505
|
});
|
|
3821
3506
|
if (_response.ok) {
|
|
3822
|
-
return
|
|
3507
|
+
return ActorsListResponse.parseOrThrow(_response.body, {
|
|
3823
3508
|
unrecognizedObjectKeys: "passthrough",
|
|
3824
3509
|
allowUnrecognizedUnionMembers: true,
|
|
3825
3510
|
allowUnrecognizedEnumValues: true,
|
|
@@ -3840,7 +3525,7 @@ var RivetClient = class {
|
|
|
3840
3525
|
body: _response.error.rawBody
|
|
3841
3526
|
});
|
|
3842
3527
|
case "timeout":
|
|
3843
|
-
throw new RivetTimeoutError("Timeout exceeded when calling
|
|
3528
|
+
throw new RivetTimeoutError("Timeout exceeded when calling GET /actors.");
|
|
3844
3529
|
case "unknown":
|
|
3845
3530
|
throw new RivetError({
|
|
3846
3531
|
message: _response.error.errorMessage
|
|
@@ -3848,26 +3533,44 @@ var RivetClient = class {
|
|
|
3848
3533
|
}
|
|
3849
3534
|
}
|
|
3850
3535
|
/**
|
|
3851
|
-
*
|
|
3852
|
-
*
|
|
3853
|
-
*
|
|
3536
|
+
* **If actor is created in the current datacenter:**
|
|
3537
|
+
*
|
|
3538
|
+
* 2 round trips:
|
|
3539
|
+
*
|
|
3540
|
+
* - namespace::ops::resolve_for_name_global
|
|
3541
|
+
* - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
|
|
3542
|
+
*
|
|
3543
|
+
* **If actor is created in a different datacenter:**
|
|
3544
|
+
*
|
|
3545
|
+
* 3 round trips:
|
|
3546
|
+
*
|
|
3547
|
+
* - namespace::ops::resolve_for_name_global
|
|
3548
|
+
* - POST /actors to remote datacenter
|
|
3549
|
+
* - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
|
|
3550
|
+
*
|
|
3551
|
+
* actor::get will always be in the same datacenter.
|
|
3552
|
+
*
|
|
3553
|
+
* @param {Rivet.ActorsCreateRequest} request
|
|
3854
3554
|
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3855
3555
|
*
|
|
3856
3556
|
* @example
|
|
3857
|
-
* await client.
|
|
3858
|
-
* namespace: "namespace"
|
|
3557
|
+
* await client.actorsCreate({
|
|
3558
|
+
* namespace: "namespace",
|
|
3559
|
+
* name: "name",
|
|
3560
|
+
* pool: "pool"
|
|
3859
3561
|
* })
|
|
3860
3562
|
*/
|
|
3861
|
-
async
|
|
3862
|
-
const { namespace } = request;
|
|
3563
|
+
async actorsCreate(request, requestOptions) {
|
|
3564
|
+
const { namespace, ..._body } = request;
|
|
3863
3565
|
const _queryParams = {};
|
|
3864
|
-
|
|
3566
|
+
if (namespace != null)
|
|
3567
|
+
_queryParams["namespace"] = namespace;
|
|
3865
3568
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3866
|
-
url:
|
|
3569
|
+
url: urlJoin6(
|
|
3867
3570
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3868
|
-
|
|
3571
|
+
"actors"
|
|
3869
3572
|
),
|
|
3870
|
-
method: "
|
|
3573
|
+
method: "POST",
|
|
3871
3574
|
headers: {
|
|
3872
3575
|
Authorization: await this._getAuthorizationHeader(),
|
|
3873
3576
|
"X-Fern-Language": "JavaScript",
|
|
@@ -3878,12 +3581,13 @@ var RivetClient = class {
|
|
|
3878
3581
|
contentType: "application/json",
|
|
3879
3582
|
queryParameters: _queryParams,
|
|
3880
3583
|
requestType: "json",
|
|
3584
|
+
body: ActorsCreateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
3881
3585
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
3882
3586
|
maxRetries: requestOptions?.maxRetries,
|
|
3883
3587
|
abortSignal: requestOptions?.abortSignal
|
|
3884
3588
|
});
|
|
3885
3589
|
if (_response.ok) {
|
|
3886
|
-
return
|
|
3590
|
+
return ActorsCreateResponse.parseOrThrow(_response.body, {
|
|
3887
3591
|
unrecognizedObjectKeys: "passthrough",
|
|
3888
3592
|
allowUnrecognizedUnionMembers: true,
|
|
3889
3593
|
allowUnrecognizedEnumValues: true,
|
|
@@ -3904,9 +3608,7 @@ var RivetClient = class {
|
|
|
3904
3608
|
body: _response.error.rawBody
|
|
3905
3609
|
});
|
|
3906
3610
|
case "timeout":
|
|
3907
|
-
throw new RivetTimeoutError(
|
|
3908
|
-
"Timeout exceeded when calling GET /actors/{actor_id}/kv/keys/{key}."
|
|
3909
|
-
);
|
|
3611
|
+
throw new RivetTimeoutError("Timeout exceeded when calling POST /actors.");
|
|
3910
3612
|
case "unknown":
|
|
3911
3613
|
throw new RivetError({
|
|
3912
3614
|
message: _response.error.errorMessage
|
|
@@ -3914,28 +3616,54 @@ var RivetClient = class {
|
|
|
3914
3616
|
}
|
|
3915
3617
|
}
|
|
3916
3618
|
/**
|
|
3917
|
-
*
|
|
3918
|
-
*
|
|
3619
|
+
* **If actor exists**
|
|
3620
|
+
*
|
|
3621
|
+
* 2 round trips:
|
|
3622
|
+
*
|
|
3623
|
+
* - namespace::ops::resolve_for_name_global
|
|
3624
|
+
* - GET /actors/{}
|
|
3625
|
+
*
|
|
3626
|
+
* **If actor does not exist and is created in the current datacenter:**
|
|
3627
|
+
*
|
|
3628
|
+
* 2 round trips:
|
|
3629
|
+
*
|
|
3630
|
+
* - namespace::ops::resolve_for_name_global
|
|
3631
|
+
* - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
|
|
3632
|
+
*
|
|
3633
|
+
* **If actor does not exist and is created in a different datacenter:**
|
|
3634
|
+
*
|
|
3635
|
+
* 3 round trips:
|
|
3636
|
+
*
|
|
3637
|
+
* - namespace::ops::resolve_for_name_global
|
|
3638
|
+
* - POST /actors to remote datacenter
|
|
3639
|
+
* - [pegboard::workflows::actor] Create actor workflow (includes Epoxy key allocation)
|
|
3640
|
+
*
|
|
3641
|
+
* actor::get will always be in the same datacenter.
|
|
3642
|
+
*
|
|
3643
|
+
* ## Optimized Alternative Routes
|
|
3644
|
+
*
|
|
3645
|
+
* @param {Rivet.ActorsGetOrCreateRequest} request
|
|
3919
3646
|
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3920
3647
|
*
|
|
3921
3648
|
* @example
|
|
3922
|
-
* await client.
|
|
3649
|
+
* await client.actorsGetOrCreate({
|
|
3923
3650
|
* namespace: "namespace",
|
|
3924
|
-
*
|
|
3925
|
-
*
|
|
3926
|
-
*
|
|
3651
|
+
* key: "key",
|
|
3652
|
+
* name: "name",
|
|
3653
|
+
* pool: "pool"
|
|
3927
3654
|
* })
|
|
3928
3655
|
*/
|
|
3929
|
-
async
|
|
3930
|
-
const { namespace,
|
|
3656
|
+
async actorsGetOrCreate(request, requestOptions) {
|
|
3657
|
+
const { namespace, ..._body } = request;
|
|
3931
3658
|
const _queryParams = {};
|
|
3932
|
-
|
|
3659
|
+
if (namespace != null)
|
|
3660
|
+
_queryParams["namespace"] = namespace;
|
|
3933
3661
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
3934
|
-
url:
|
|
3662
|
+
url: urlJoin6(
|
|
3935
3663
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
3936
|
-
|
|
3664
|
+
"actors"
|
|
3937
3665
|
),
|
|
3938
|
-
method: "
|
|
3666
|
+
method: "PUT",
|
|
3939
3667
|
headers: {
|
|
3940
3668
|
Authorization: await this._getAuthorizationHeader(),
|
|
3941
3669
|
"X-Fern-Language": "JavaScript",
|
|
@@ -3946,13 +3674,13 @@ var RivetClient = class {
|
|
|
3946
3674
|
contentType: "application/json",
|
|
3947
3675
|
queryParameters: _queryParams,
|
|
3948
3676
|
requestType: "json",
|
|
3949
|
-
body:
|
|
3677
|
+
body: ActorsGetOrCreateRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
3950
3678
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
3951
3679
|
maxRetries: requestOptions?.maxRetries,
|
|
3952
3680
|
abortSignal: requestOptions?.abortSignal
|
|
3953
3681
|
});
|
|
3954
3682
|
if (_response.ok) {
|
|
3955
|
-
return
|
|
3683
|
+
return ActorsGetOrCreateResponse.parseOrThrow(_response.body, {
|
|
3956
3684
|
unrecognizedObjectKeys: "passthrough",
|
|
3957
3685
|
allowUnrecognizedUnionMembers: true,
|
|
3958
3686
|
allowUnrecognizedEnumValues: true,
|
|
@@ -3973,7 +3701,7 @@ var RivetClient = class {
|
|
|
3973
3701
|
body: _response.error.rawBody
|
|
3974
3702
|
});
|
|
3975
3703
|
case "timeout":
|
|
3976
|
-
throw new RivetTimeoutError("Timeout exceeded when calling
|
|
3704
|
+
throw new RivetTimeoutError("Timeout exceeded when calling PUT /actors.");
|
|
3977
3705
|
case "unknown":
|
|
3978
3706
|
throw new RivetError({
|
|
3979
3707
|
message: _response.error.errorMessage
|
|
@@ -3981,28 +3709,36 @@ var RivetClient = class {
|
|
|
3981
3709
|
}
|
|
3982
3710
|
}
|
|
3983
3711
|
/**
|
|
3984
|
-
*
|
|
3985
|
-
*
|
|
3712
|
+
* 2 round trips:
|
|
3713
|
+
*
|
|
3714
|
+
* - GET /actors/names (fanout)
|
|
3715
|
+
* - [api-peer] namespace::ops::resolve_for_name_global
|
|
3716
|
+
*
|
|
3717
|
+
* @param {Rivet.ActorsListNamesRequest} request
|
|
3986
3718
|
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
3987
3719
|
*
|
|
3988
3720
|
* @example
|
|
3989
|
-
* await client.
|
|
3990
|
-
* namespace: "namespace"
|
|
3991
|
-
* body: {
|
|
3992
|
-
* "key": "value"
|
|
3993
|
-
* }
|
|
3721
|
+
* await client.actorsListNames({
|
|
3722
|
+
* namespace: "namespace"
|
|
3994
3723
|
* })
|
|
3995
3724
|
*/
|
|
3996
|
-
async
|
|
3997
|
-
const { namespace,
|
|
3725
|
+
async actorsListNames(request, requestOptions) {
|
|
3726
|
+
const { namespace, limit, cursor } = request;
|
|
3998
3727
|
const _queryParams = {};
|
|
3999
|
-
|
|
3728
|
+
if (namespace != null)
|
|
3729
|
+
_queryParams["namespace"] = namespace;
|
|
3730
|
+
if (limit != null) {
|
|
3731
|
+
_queryParams["limit"] = limit.toString();
|
|
3732
|
+
}
|
|
3733
|
+
if (cursor != null) {
|
|
3734
|
+
_queryParams["cursor"] = cursor;
|
|
3735
|
+
}
|
|
4000
3736
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4001
|
-
url:
|
|
3737
|
+
url: urlJoin6(
|
|
4002
3738
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4003
|
-
|
|
3739
|
+
"actors/names"
|
|
4004
3740
|
),
|
|
4005
|
-
method: "
|
|
3741
|
+
method: "GET",
|
|
4006
3742
|
headers: {
|
|
4007
3743
|
Authorization: await this._getAuthorizationHeader(),
|
|
4008
3744
|
"X-Fern-Language": "JavaScript",
|
|
@@ -4013,13 +3749,12 @@ var RivetClient = class {
|
|
|
4013
3749
|
contentType: "application/json",
|
|
4014
3750
|
queryParameters: _queryParams,
|
|
4015
3751
|
requestType: "json",
|
|
4016
|
-
body: ActorsSleepRequestBody.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
4017
3752
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
4018
3753
|
maxRetries: requestOptions?.maxRetries,
|
|
4019
3754
|
abortSignal: requestOptions?.abortSignal
|
|
4020
3755
|
});
|
|
4021
3756
|
if (_response.ok) {
|
|
4022
|
-
return
|
|
3757
|
+
return ActorsListNamesResponse.parseOrThrow(_response.body, {
|
|
4023
3758
|
unrecognizedObjectKeys: "passthrough",
|
|
4024
3759
|
allowUnrecognizedUnionMembers: true,
|
|
4025
3760
|
allowUnrecognizedEnumValues: true,
|
|
@@ -4040,7 +3775,7 @@ var RivetClient = class {
|
|
|
4040
3775
|
body: _response.error.rawBody
|
|
4041
3776
|
});
|
|
4042
3777
|
case "timeout":
|
|
4043
|
-
throw new RivetTimeoutError("Timeout exceeded when calling
|
|
3778
|
+
throw new RivetTimeoutError("Timeout exceeded when calling GET /actors/names.");
|
|
4044
3779
|
case "unknown":
|
|
4045
3780
|
throw new RivetError({
|
|
4046
3781
|
message: _response.error.errorMessage
|
|
@@ -4048,43 +3783,30 @@ var RivetClient = class {
|
|
|
4048
3783
|
}
|
|
4049
3784
|
}
|
|
4050
3785
|
/**
|
|
4051
|
-
*
|
|
3786
|
+
* 2 round trip:
|
|
3787
|
+
*
|
|
3788
|
+
* - DELETE /actors/{}
|
|
3789
|
+
* - [api-peer] namespace::ops::resolve_for_name_global
|
|
3790
|
+
*
|
|
3791
|
+
* @param {Rivet.RivetId} actorId
|
|
3792
|
+
* @param {Rivet.ActorsDeleteRequest} request
|
|
4052
3793
|
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4053
3794
|
*
|
|
4054
3795
|
* @example
|
|
4055
|
-
* await client.
|
|
3796
|
+
* await client.actorsDelete("actor_id", {
|
|
4056
3797
|
* namespace: "namespace"
|
|
4057
3798
|
* })
|
|
4058
3799
|
*/
|
|
4059
|
-
|
|
4060
|
-
|
|
3800
|
+
/** Returns one actor by ID. */
|
|
3801
|
+
async actorsGet(actorId, request, requestOptions) {
|
|
3802
|
+
const { namespace } = request;
|
|
4061
3803
|
const _queryParams = {};
|
|
4062
|
-
|
|
4063
|
-
|
|
4064
|
-
_queryParams["limit"] = limit.toString();
|
|
4065
|
-
}
|
|
4066
|
-
if (cursor != null) {
|
|
4067
|
-
_queryParams["cursor"] = cursor;
|
|
4068
|
-
}
|
|
4069
|
-
if (variant != null) {
|
|
4070
|
-
_queryParams["variant"] = RunnerConfigVariant2.jsonOrThrow(variant, {
|
|
4071
|
-
unrecognizedObjectKeys: "strip"
|
|
4072
|
-
});
|
|
4073
|
-
}
|
|
4074
|
-
if (runnerNames != null) {
|
|
4075
|
-
_queryParams["runner_names"] = runnerNames;
|
|
4076
|
-
}
|
|
4077
|
-
if (runnerName != null) {
|
|
4078
|
-
if (Array.isArray(runnerName)) {
|
|
4079
|
-
_queryParams["runner_name"] = runnerName.map((item) => item);
|
|
4080
|
-
} else {
|
|
4081
|
-
_queryParams["runner_name"] = runnerName;
|
|
4082
|
-
}
|
|
4083
|
-
}
|
|
3804
|
+
if (namespace != null)
|
|
3805
|
+
_queryParams["namespace"] = namespace;
|
|
4084
3806
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4085
|
-
url:
|
|
3807
|
+
url: urlJoin6(
|
|
4086
3808
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4087
|
-
|
|
3809
|
+
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}`
|
|
4088
3810
|
),
|
|
4089
3811
|
method: "GET",
|
|
4090
3812
|
headers: {
|
|
@@ -4102,7 +3824,7 @@ var RivetClient = class {
|
|
|
4102
3824
|
abortSignal: requestOptions?.abortSignal
|
|
4103
3825
|
});
|
|
4104
3826
|
if (_response.ok) {
|
|
4105
|
-
return
|
|
3827
|
+
return ActorsGetResponse.parseOrThrow(_response.body, {
|
|
4106
3828
|
unrecognizedObjectKeys: "passthrough",
|
|
4107
3829
|
allowUnrecognizedUnionMembers: true,
|
|
4108
3830
|
allowUnrecognizedEnumValues: true,
|
|
@@ -4123,33 +3845,24 @@ var RivetClient = class {
|
|
|
4123
3845
|
body: _response.error.rawBody
|
|
4124
3846
|
});
|
|
4125
3847
|
case "timeout":
|
|
4126
|
-
throw new RivetTimeoutError("Timeout exceeded when calling GET /
|
|
3848
|
+
throw new RivetTimeoutError("Timeout exceeded when calling GET /actors/{actor_id}.");
|
|
4127
3849
|
case "unknown":
|
|
4128
3850
|
throw new RivetError({
|
|
4129
3851
|
message: _response.error.errorMessage
|
|
4130
3852
|
});
|
|
4131
3853
|
}
|
|
4132
3854
|
}
|
|
4133
|
-
|
|
4134
|
-
|
|
4135
|
-
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4136
|
-
*
|
|
4137
|
-
* @example
|
|
4138
|
-
* await client.runnerConfigsServerlessHealthCheck({
|
|
4139
|
-
* namespace: "namespace",
|
|
4140
|
-
* url: "url"
|
|
4141
|
-
* })
|
|
4142
|
-
*/
|
|
4143
|
-
async runnerConfigsServerlessHealthCheck(request, requestOptions) {
|
|
4144
|
-
const { namespace, ..._body } = request;
|
|
3855
|
+
async actorsDelete(actorId, request, requestOptions) {
|
|
3856
|
+
const { namespace } = request;
|
|
4145
3857
|
const _queryParams = {};
|
|
4146
|
-
|
|
3858
|
+
if (namespace != null)
|
|
3859
|
+
_queryParams["namespace"] = namespace;
|
|
4147
3860
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4148
|
-
url:
|
|
3861
|
+
url: urlJoin6(
|
|
4149
3862
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4150
|
-
|
|
3863
|
+
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}`
|
|
4151
3864
|
),
|
|
4152
|
-
method: "
|
|
3865
|
+
method: "DELETE",
|
|
4153
3866
|
headers: {
|
|
4154
3867
|
Authorization: await this._getAuthorizationHeader(),
|
|
4155
3868
|
"X-Fern-Language": "JavaScript",
|
|
@@ -4160,15 +3873,12 @@ var RivetClient = class {
|
|
|
4160
3873
|
contentType: "application/json",
|
|
4161
3874
|
queryParameters: _queryParams,
|
|
4162
3875
|
requestType: "json",
|
|
4163
|
-
body: RunnerConfigsServerlessHealthCheckRequest.jsonOrThrow(_body, {
|
|
4164
|
-
unrecognizedObjectKeys: "strip"
|
|
4165
|
-
}),
|
|
4166
3876
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
4167
3877
|
maxRetries: requestOptions?.maxRetries,
|
|
4168
3878
|
abortSignal: requestOptions?.abortSignal
|
|
4169
3879
|
});
|
|
4170
3880
|
if (_response.ok) {
|
|
4171
|
-
return
|
|
3881
|
+
return ActorsDeleteResponse.parseOrThrow(_response.body, {
|
|
4172
3882
|
unrecognizedObjectKeys: "passthrough",
|
|
4173
3883
|
allowUnrecognizedUnionMembers: true,
|
|
4174
3884
|
allowUnrecognizedEnumValues: true,
|
|
@@ -4189,9 +3899,7 @@ var RivetClient = class {
|
|
|
4189
3899
|
body: _response.error.rawBody
|
|
4190
3900
|
});
|
|
4191
3901
|
case "timeout":
|
|
4192
|
-
throw new RivetTimeoutError(
|
|
4193
|
-
"Timeout exceeded when calling POST /runner-configs/serverless-health-check."
|
|
4194
|
-
);
|
|
3902
|
+
throw new RivetTimeoutError("Timeout exceeded when calling DELETE /actors/{actor_id}.");
|
|
4195
3903
|
case "unknown":
|
|
4196
3904
|
throw new RivetError({
|
|
4197
3905
|
message: _response.error.errorMessage
|
|
@@ -4199,28 +3907,26 @@ var RivetClient = class {
|
|
|
4199
3907
|
}
|
|
4200
3908
|
}
|
|
4201
3909
|
/**
|
|
4202
|
-
* @param {
|
|
4203
|
-
* @param {Rivet.
|
|
3910
|
+
* @param {Rivet.RivetId} actorId
|
|
3911
|
+
* @param {Rivet.ActorsRescheduleRequest} request
|
|
4204
3912
|
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4205
3913
|
*
|
|
4206
3914
|
* @example
|
|
4207
|
-
* await client.
|
|
3915
|
+
* await client.actorsReschedule("actor_id", {
|
|
4208
3916
|
* namespace: "namespace",
|
|
4209
|
-
* datacenters: {
|
|
4210
|
-
* "key": {}
|
|
4211
|
-
* }
|
|
4212
3917
|
* })
|
|
4213
3918
|
*/
|
|
4214
|
-
async
|
|
4215
|
-
const { namespace
|
|
3919
|
+
async actorsReschedule(actorId, request, requestOptions) {
|
|
3920
|
+
const { namespace } = request;
|
|
4216
3921
|
const _queryParams = {};
|
|
4217
|
-
|
|
3922
|
+
if (namespace != null)
|
|
3923
|
+
_queryParams["namespace"] = namespace;
|
|
4218
3924
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4219
|
-
url:
|
|
3925
|
+
url: urlJoin6(
|
|
4220
3926
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4221
|
-
`
|
|
3927
|
+
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}/reschedule`
|
|
4222
3928
|
),
|
|
4223
|
-
method: "
|
|
3929
|
+
method: "POST",
|
|
4224
3930
|
headers: {
|
|
4225
3931
|
Authorization: await this._getAuthorizationHeader(),
|
|
4226
3932
|
"X-Fern-Language": "JavaScript",
|
|
@@ -4231,13 +3937,12 @@ var RivetClient = class {
|
|
|
4231
3937
|
contentType: "application/json",
|
|
4232
3938
|
queryParameters: _queryParams,
|
|
4233
3939
|
requestType: "json",
|
|
4234
|
-
body: RunnerConfigsUpsertRequestBody.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
4235
3940
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
4236
3941
|
maxRetries: requestOptions?.maxRetries,
|
|
4237
3942
|
abortSignal: requestOptions?.abortSignal
|
|
4238
3943
|
});
|
|
4239
3944
|
if (_response.ok) {
|
|
4240
|
-
return
|
|
3945
|
+
return ActorsRescheduleResponse.parseOrThrow(_response.body, {
|
|
4241
3946
|
unrecognizedObjectKeys: "passthrough",
|
|
4242
3947
|
allowUnrecognizedUnionMembers: true,
|
|
4243
3948
|
allowUnrecognizedEnumValues: true,
|
|
@@ -4258,7 +3963,7 @@ var RivetClient = class {
|
|
|
4258
3963
|
body: _response.error.rawBody
|
|
4259
3964
|
});
|
|
4260
3965
|
case "timeout":
|
|
4261
|
-
throw new RivetTimeoutError("Timeout exceeded when calling
|
|
3966
|
+
throw new RivetTimeoutError("Timeout exceeded when calling POST /actors/{actor_id}/reschedule.");
|
|
4262
3967
|
case "unknown":
|
|
4263
3968
|
throw new RivetError({
|
|
4264
3969
|
message: _response.error.errorMessage
|
|
@@ -4266,25 +3971,26 @@ var RivetClient = class {
|
|
|
4266
3971
|
}
|
|
4267
3972
|
}
|
|
4268
3973
|
/**
|
|
4269
|
-
* @param {
|
|
4270
|
-
* @param {Rivet.
|
|
3974
|
+
* @param {Rivet.RivetId} actorId
|
|
3975
|
+
* @param {Rivet.ActorsSleepRequest} request
|
|
4271
3976
|
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4272
3977
|
*
|
|
4273
3978
|
* @example
|
|
4274
|
-
* await client.
|
|
4275
|
-
* namespace: "namespace"
|
|
3979
|
+
* await client.actorsSleep("actor_id", {
|
|
3980
|
+
* namespace: "namespace",
|
|
4276
3981
|
* })
|
|
4277
3982
|
*/
|
|
4278
|
-
async
|
|
3983
|
+
async actorsSleep(actorId, request, requestOptions) {
|
|
4279
3984
|
const { namespace } = request;
|
|
4280
3985
|
const _queryParams = {};
|
|
4281
|
-
|
|
3986
|
+
if (namespace != null)
|
|
3987
|
+
_queryParams["namespace"] = namespace;
|
|
4282
3988
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4283
|
-
url:
|
|
3989
|
+
url: urlJoin6(
|
|
4284
3990
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4285
|
-
`
|
|
3991
|
+
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}/sleep`
|
|
4286
3992
|
),
|
|
4287
|
-
method: "
|
|
3993
|
+
method: "POST",
|
|
4288
3994
|
headers: {
|
|
4289
3995
|
Authorization: await this._getAuthorizationHeader(),
|
|
4290
3996
|
"X-Fern-Language": "JavaScript",
|
|
@@ -4300,7 +4006,7 @@ var RivetClient = class {
|
|
|
4300
4006
|
abortSignal: requestOptions?.abortSignal
|
|
4301
4007
|
});
|
|
4302
4008
|
if (_response.ok) {
|
|
4303
|
-
return
|
|
4009
|
+
return ActorsSleepResponse.parseOrThrow(_response.body, {
|
|
4304
4010
|
unrecognizedObjectKeys: "passthrough",
|
|
4305
4011
|
allowUnrecognizedUnionMembers: true,
|
|
4306
4012
|
allowUnrecognizedEnumValues: true,
|
|
@@ -4321,9 +4027,7 @@ var RivetClient = class {
|
|
|
4321
4027
|
body: _response.error.rawBody
|
|
4322
4028
|
});
|
|
4323
4029
|
case "timeout":
|
|
4324
|
-
throw new RivetTimeoutError(
|
|
4325
|
-
"Timeout exceeded when calling DELETE /runner-configs/{runner_name}."
|
|
4326
|
-
);
|
|
4030
|
+
throw new RivetTimeoutError("Timeout exceeded when calling POST /actors/{actor_id}/sleep.");
|
|
4327
4031
|
case "unknown":
|
|
4328
4032
|
throw new RivetError({
|
|
4329
4033
|
message: _response.error.errorMessage
|
|
@@ -4331,26 +4035,27 @@ var RivetClient = class {
|
|
|
4331
4035
|
}
|
|
4332
4036
|
}
|
|
4333
4037
|
/**
|
|
4334
|
-
*
|
|
4335
|
-
*
|
|
4038
|
+
* Forks an actor: creates a new actor in the same namespace, with the source's name and pool,
|
|
4039
|
+
* whose database is a copy of the source's, and starts it.
|
|
4040
|
+
*
|
|
4041
|
+
* @param {Rivet.RivetId} actorId
|
|
4042
|
+
* @param {Rivet.ActorsForkRequest} request
|
|
4336
4043
|
* @param {RivetClient.RequestOptions} requestOptions - Request-specific configuration.
|
|
4337
4044
|
*
|
|
4338
4045
|
* @example
|
|
4339
|
-
* await client.
|
|
4046
|
+
* await client.actorsFork("actor_id", {
|
|
4340
4047
|
* namespace: "namespace",
|
|
4341
|
-
* body: {
|
|
4342
|
-
* "key": "value"
|
|
4343
|
-
* }
|
|
4344
4048
|
* })
|
|
4345
4049
|
*/
|
|
4346
|
-
async
|
|
4347
|
-
const { namespace,
|
|
4050
|
+
async actorsFork(actorId, request, requestOptions) {
|
|
4051
|
+
const { namespace, ..._body } = request;
|
|
4348
4052
|
const _queryParams = {};
|
|
4349
|
-
|
|
4053
|
+
if (namespace != null)
|
|
4054
|
+
_queryParams["namespace"] = namespace;
|
|
4350
4055
|
const _response = await (this._options.fetcher ?? fetcher)({
|
|
4351
|
-
url:
|
|
4056
|
+
url: urlJoin6(
|
|
4352
4057
|
await Supplier.get(this._options.baseUrl) ?? await Supplier.get(this._options.environment),
|
|
4353
|
-
`
|
|
4058
|
+
`actors/${encodeURIComponent(RivetId.jsonOrThrow(actorId))}/fork`
|
|
4354
4059
|
),
|
|
4355
4060
|
method: "POST",
|
|
4356
4061
|
headers: {
|
|
@@ -4363,15 +4068,13 @@ var RivetClient = class {
|
|
|
4363
4068
|
contentType: "application/json",
|
|
4364
4069
|
queryParameters: _queryParams,
|
|
4365
4070
|
requestType: "json",
|
|
4366
|
-
body:
|
|
4367
|
-
unrecognizedObjectKeys: "strip"
|
|
4368
|
-
}),
|
|
4071
|
+
body: ActorsForkRequest.jsonOrThrow(_body, { unrecognizedObjectKeys: "strip" }),
|
|
4369
4072
|
timeoutMs: requestOptions?.timeoutInSeconds != null ? requestOptions.timeoutInSeconds * 1e3 : 18e4,
|
|
4370
4073
|
maxRetries: requestOptions?.maxRetries,
|
|
4371
4074
|
abortSignal: requestOptions?.abortSignal
|
|
4372
4075
|
});
|
|
4373
4076
|
if (_response.ok) {
|
|
4374
|
-
return
|
|
4077
|
+
return ActorsForkResponse.parseOrThrow(_response.body, {
|
|
4375
4078
|
unrecognizedObjectKeys: "passthrough",
|
|
4376
4079
|
allowUnrecognizedUnionMembers: true,
|
|
4377
4080
|
allowUnrecognizedEnumValues: true,
|
|
@@ -4392,9 +4095,7 @@ var RivetClient = class {
|
|
|
4392
4095
|
body: _response.error.rawBody
|
|
4393
4096
|
});
|
|
4394
4097
|
case "timeout":
|
|
4395
|
-
throw new RivetTimeoutError(
|
|
4396
|
-
"Timeout exceeded when calling POST /runner-configs/{runner_name}/refresh-metadata."
|
|
4397
|
-
);
|
|
4098
|
+
throw new RivetTimeoutError("Timeout exceeded when calling POST /actors/{actor_id}/fork.");
|
|
4398
4099
|
case "unknown":
|
|
4399
4100
|
throw new RivetError({
|
|
4400
4101
|
message: _response.error.errorMessage
|