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