kurtosis-sdk 0.63.0 → 0.63.2

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.
@@ -1,16 +1,8 @@
1
- import { ExecCommandArgs, GetServicesArgs, PartitionServices, PartitionConnections, PartitionConnectionInfo, RemoveServiceArgs, RepartitionArgs, WaitForHttpGetEndpointAvailabilityArgs, WaitForHttpPostEndpointAvailabilityArgs, LoadModuleArgs, UnloadModuleArgs, ExecuteModuleArgs, GetModulesArgs, Port, StoreWebFilesArtifactArgs, StoreFilesArtifactFromServiceArgs, UploadFilesArtifactArgs, PauseServiceArgs, UnpauseServiceArgs, ModuleInfo, ServiceInfo, ServiceConfig, RemoveServiceResponse, UnloadModuleResponse, GetModulesResponse, GetServicesResponse, StartServicesArgs, RenderTemplatesToFilesArtifactArgs } from '../kurtosis_core_rpc_api_bindings/api_container_service_pb';
1
+ import { ExecCommandArgs, GetServicesArgs, PartitionServices, PartitionConnections, PartitionConnectionInfo, RemoveServiceArgs, RepartitionArgs, WaitForHttpGetEndpointAvailabilityArgs, WaitForHttpPostEndpointAvailabilityArgs, Port, StoreWebFilesArtifactArgs, StoreFilesArtifactFromServiceArgs, UploadFilesArtifactArgs, PauseServiceArgs, UnpauseServiceArgs, ServiceInfo, ServiceConfig, RemoveServiceResponse, GetServicesResponse, StartServicesArgs, RenderTemplatesToFilesArtifactArgs } from '../kurtosis_core_rpc_api_bindings/api_container_service_pb';
2
2
  import { ServiceID } from './services/service';
3
- import { ModuleID } from "./modules/module_context";
4
3
  import TemplateAndData = RenderTemplatesToFilesArtifactArgs.TemplateAndData;
5
4
  export declare function newPort(number: number, transportProtocol: Port.TransportProtocol, maybeApplicationProtocol?: string): Port;
6
5
  export declare function newServiceConfig(containerImageName: string, privatePorts: Map<string, Port>, publicPorts: Map<string, Port>, entrypointOverrideArgs: string[], cmdOverrideArgs: string[], environmentVariableOverrides: Map<string, string>, filesArtifactMountDirpaths: Map<string, string>, cpuAllocationMillicpus: number, memoryAllocationMegabytes: number, privateIPAddrPlaceholder: string, subnetwork: string): ServiceConfig;
7
- export declare function newLoadModuleArgs(moduleId: ModuleID, image: string, serializedParams: string): LoadModuleArgs;
8
- export declare function newUnloadModuleArgs(moduleId: ModuleID): UnloadModuleArgs;
9
- export declare function newUnloadModuleResponse(moduleGuid: string): UnloadModuleResponse;
10
- export declare function newExecuteModuleArgs(moduleId: ModuleID, serializedParams: string): ExecuteModuleArgs;
11
- export declare function newGetModulesArgs(moduleIds: Map<string, boolean>): GetModulesArgs;
12
- export declare function newGetModulesResponse(moduleInfoMap: Map<string, ModuleInfo>): GetModulesResponse;
13
- export declare function newModuleInfo(guid: string, privateIpAddr: string, privateGrpcPort: Port, maybePublicIpAddr: string, maybePublicGrpcPort: Port): ModuleInfo;
14
6
  export declare function newStartServicesArgs(serviceConfigs: Map<ServiceID, ServiceConfig>): StartServicesArgs;
15
7
  export declare function newGetServicesArgs(serviceIds: Map<string, boolean>): GetServicesArgs;
16
8
  export declare function newGetServicesResponse(serviceInfoMap: Map<string, ServiceInfo>): GetServicesResponse;
@@ -4,7 +4,7 @@
4
4
  * All Rights Reserved.
5
5
  */
6
6
  Object.defineProperty(exports, "__esModule", { value: true });
7
- exports.newRenderTemplatesToFilesArtifactArgs = exports.newTemplateAndData = exports.newUploadFilesArtifactArgs = exports.newStoreFilesArtifactFromServiceArgs = exports.newStoreWebFilesArtifactArgs = exports.newWaitForHttpPostEndpointAvailabilityArgs = exports.newWaitForHttpGetEndpointAvailabilityArgs = exports.newUnpauseServiceArgs = exports.newPauseServiceArgs = exports.newExecCommandArgs = exports.newPartitionConnectionInfo = exports.newPartitionConnections = exports.newPartitionServices = exports.newRepartitionArgs = exports.newRemoveServiceResponse = exports.newRemoveServiceArgs = exports.newServiceInfo = exports.newGetServicesResponse = exports.newGetServicesArgs = exports.newStartServicesArgs = exports.newModuleInfo = exports.newGetModulesResponse = exports.newGetModulesArgs = exports.newExecuteModuleArgs = exports.newUnloadModuleResponse = exports.newUnloadModuleArgs = exports.newLoadModuleArgs = exports.newServiceConfig = exports.newPort = void 0;
7
+ exports.newRenderTemplatesToFilesArtifactArgs = exports.newTemplateAndData = exports.newUploadFilesArtifactArgs = exports.newStoreFilesArtifactFromServiceArgs = exports.newStoreWebFilesArtifactArgs = exports.newWaitForHttpPostEndpointAvailabilityArgs = exports.newWaitForHttpGetEndpointAvailabilityArgs = exports.newUnpauseServiceArgs = exports.newPauseServiceArgs = exports.newExecCommandArgs = exports.newPartitionConnectionInfo = exports.newPartitionConnections = exports.newPartitionServices = exports.newRepartitionArgs = exports.newRemoveServiceResponse = exports.newRemoveServiceArgs = exports.newServiceInfo = exports.newGetServicesResponse = exports.newGetServicesArgs = exports.newStartServicesArgs = exports.newServiceConfig = exports.newPort = void 0;
8
8
  const api_container_service_pb_1 = require("../kurtosis_core_rpc_api_bindings/api_container_service_pb");
9
9
  var TemplateAndData = api_container_service_pb_1.RenderTemplatesToFilesArtifactArgs.TemplateAndData;
10
10
  // ==============================================================================================
@@ -57,73 +57,6 @@ function newServiceConfig(containerImageName, privatePorts, publicPorts, entrypo
57
57
  }
58
58
  exports.newServiceConfig = newServiceConfig;
59
59
  // ==============================================================================================
60
- // Load Module
61
- // ==============================================================================================
62
- function newLoadModuleArgs(moduleId, image, serializedParams) {
63
- const result = new api_container_service_pb_1.LoadModuleArgs();
64
- result.setModuleId(String(moduleId));
65
- result.setContainerImage(image);
66
- result.setSerializedParams(serializedParams);
67
- return result;
68
- }
69
- exports.newLoadModuleArgs = newLoadModuleArgs;
70
- // ==============================================================================================
71
- // Unload Module
72
- // ==============================================================================================
73
- function newUnloadModuleArgs(moduleId) {
74
- const result = new api_container_service_pb_1.UnloadModuleArgs();
75
- result.setModuleId(String(moduleId));
76
- return result;
77
- }
78
- exports.newUnloadModuleArgs = newUnloadModuleArgs;
79
- function newUnloadModuleResponse(moduleGuid) {
80
- const result = new api_container_service_pb_1.UnloadModuleResponse();
81
- result.setModuleGuid(moduleGuid);
82
- return result;
83
- }
84
- exports.newUnloadModuleResponse = newUnloadModuleResponse;
85
- // ==============================================================================================
86
- // Execute Module
87
- // ==============================================================================================
88
- function newExecuteModuleArgs(moduleId, serializedParams) {
89
- const result = new api_container_service_pb_1.ExecuteModuleArgs();
90
- result.setModuleId(String(moduleId));
91
- result.setSerializedParams(serializedParams);
92
- return result;
93
- }
94
- exports.newExecuteModuleArgs = newExecuteModuleArgs;
95
- // ==============================================================================================
96
- // Get Modules
97
- // ==============================================================================================
98
- function newGetModulesArgs(moduleIds) {
99
- const result = new api_container_service_pb_1.GetModulesArgs();
100
- const moduleMap = result.getIdsMap();
101
- for (const [moduleId, isModuleIncluded] of moduleIds) {
102
- moduleMap.set(moduleId, isModuleIncluded);
103
- }
104
- return result;
105
- }
106
- exports.newGetModulesArgs = newGetModulesArgs;
107
- function newGetModulesResponse(moduleInfoMap) {
108
- const result = new api_container_service_pb_1.GetModulesResponse();
109
- const resultModuleInfoMap = result.getModuleInfoMap();
110
- for (const [moduleId, moduleInfo] of moduleInfoMap) {
111
- resultModuleInfoMap.set(moduleId, moduleInfo);
112
- }
113
- return result;
114
- }
115
- exports.newGetModulesResponse = newGetModulesResponse;
116
- function newModuleInfo(guid, privateIpAddr, privateGrpcPort, maybePublicIpAddr, maybePublicGrpcPort) {
117
- const result = new api_container_service_pb_1.ModuleInfo();
118
- result.setGuid(guid);
119
- result.setPrivateIpAddr(privateIpAddr);
120
- result.setPrivateGrpcPort(privateGrpcPort);
121
- result.setMaybePublicIpAddr(maybePublicIpAddr);
122
- result.setMaybePublicGrpcPort(maybePublicGrpcPort);
123
- return result;
124
- }
125
- exports.newModuleInfo = newModuleInfo;
126
- // ==============================================================================================
127
60
  // Start Service
128
61
  // ==============================================================================================
129
62
  function newStartServicesArgs(serviceConfigs) {
@@ -1,11 +1,9 @@
1
1
  /// <reference types="node" />
2
2
  import { Result } from "neverthrow";
3
- import { ModuleContext, ModuleID } from "../modules/module_context";
4
3
  import type { ContainerConfig, FilesArtifactUUID } from "../services/container_config";
5
4
  import type { ServiceID, ServiceGUID } from "../services/service";
6
5
  import { ServiceContext } from "../services/service_context";
7
6
  import type { PartitionConnection } from "./partition_connection";
8
- import { TemplateAndData } from "./template_and_data";
9
7
  import { Readable } from "stream";
10
8
  import { StarlarkRunResult } from "./starlark_run_blocking";
11
9
  export declare type EnclaveID = string;
@@ -19,9 +17,6 @@ export declare class EnclaveContext {
19
17
  static newGrpcWebEnclaveContext(ipAddress: string, apiContainerGrpcProxyPortNum: number, enclaveId: string): Promise<Result<EnclaveContext, Error>>;
20
18
  static newGrpcNodeEnclaveContext(ipAddress: string, apiContainerGrpcPortNum: number, enclaveId: string): Promise<Result<EnclaveContext, Error>>;
21
19
  getEnclaveId(): EnclaveID;
22
- loadModule(moduleId: ModuleID, image: string, serializedParams: string): Promise<Result<ModuleContext, Error>>;
23
- unloadModule(moduleId: ModuleID): Promise<Result<null, Error>>;
24
- getModuleContext(moduleId: ModuleID): Promise<Result<ModuleContext, Error>>;
25
20
  runStarlarkScript(serializedStartosisScript: string, serializedParams: string, dryRun: boolean): Promise<Result<Readable, Error>>;
26
21
  runStarlarkScriptBlocking(serializedStartosisScript: string, serializedParams: string, dryRun: boolean): Promise<Result<StarlarkRunResult, Error>>;
27
22
  runStarlarkPackage(packageRootPath: string, serializedParams: string, dryRun: boolean): Promise<Result<Readable, Error>>;
@@ -29,22 +24,15 @@ export declare class EnclaveContext {
29
24
  runStarlarkRemotePackage(moduleId: string, serializedParams: string, dryRun: boolean): Promise<Result<Readable, Error>>;
30
25
  runStarlarkRemotePackageBlocking(moduleId: string, serializedParams: string, dryRun: boolean): Promise<Result<StarlarkRunResult, Error>>;
31
26
  addService(serviceId: ServiceID, containerConfig: ContainerConfig): Promise<Result<ServiceContext, Error>>;
32
- addServices(containerConfigs: Map<ServiceID, ContainerConfig>): Promise<Result<[Map<ServiceID, ServiceContext>, Map<ServiceID, Error>], Error>>;
33
27
  addServiceToPartition(serviceId: ServiceID, partitionId: PartitionID, containerConfig: ContainerConfig): Promise<Result<ServiceContext, Error>>;
34
28
  addServicesToPartition(containerConfigs: Map<ServiceID, ContainerConfig>, partitionID: PartitionID): Promise<Result<[Map<ServiceID, ServiceContext>, Map<ServiceID, Error>], Error>>;
35
29
  getServiceContext(serviceId: ServiceID): Promise<Result<ServiceContext, Error>>;
36
- removeService(serviceId: ServiceID): Promise<Result<null, Error>>;
37
30
  repartitionNetwork(partitionServices: Map<PartitionID, Set<ServiceID>>, partitionConnections: Map<PartitionID, Map<PartitionID, PartitionConnection>>, defaultConnection: PartitionConnection): Promise<Result<null, Error>>;
38
31
  waitForHttpGetEndpointAvailability(serviceId: ServiceID, port: number, path: string, initialDelayMilliseconds: number, retries: number, retriesDelayMilliseconds: number, bodyText: string): Promise<Result<null, Error>>;
39
32
  waitForHttpPostEndpointAvailability(serviceId: ServiceID, port: number, path: string, requestBody: string, initialDelayMilliseconds: number, retries: number, retriesDelayMilliseconds: number, bodyText: string): Promise<Result<null, Error>>;
40
33
  getServices(): Promise<Result<Map<ServiceID, ServiceGUID>, Error>>;
41
- getModules(): Promise<Result<Set<ModuleID>, Error>>;
42
34
  uploadFiles(pathToArchive: string): Promise<Result<FilesArtifactUUID, Error>>;
43
35
  storeWebFiles(url: string): Promise<Result<FilesArtifactUUID, Error>>;
44
- storeServiceFiles(serviceId: ServiceID, absoluteFilepathOnServiceContainer: string): Promise<Result<FilesArtifactUUID, Error>>;
45
- pauseService(serviceId: string): Promise<Result<null, Error>>;
46
- unpauseService(serviceId: string): Promise<Result<null, Error>>;
47
- renderTemplates(templateAndDataByDestinationRelFilepath: Map<string, TemplateAndData>): Promise<Result<FilesArtifactUUID, Error>>;
48
36
  private static convertApiPortsToServiceContextPorts;
49
37
  private assembleRunStarlarkPackageArg;
50
38
  }
@@ -19,7 +19,6 @@ const loglevel_1 = require("loglevel");
19
19
  const browser_or_node_1 = require("browser-or-node");
20
20
  const grpc_node_api_container_client_1 = require("./grpc_node_api_container_client");
21
21
  const grpc_web_api_container_client_1 = require("./grpc_web_api_container_client");
22
- const module_context_1 = require("../modules/module_context");
23
22
  const constructor_calls_1 = require("../constructor_calls");
24
23
  const service_context_1 = require("../services/service_context");
25
24
  const port_spec_1 = require("../services/port_spec");
@@ -98,48 +97,6 @@ class EnclaveContext {
98
97
  getEnclaveId() {
99
98
  return this.backend.getEnclaveId();
100
99
  }
101
- // Docs available at https://docs.kurtosis.com/sdk/#loadmodulestring-moduleid-string-image-string-serializedparams---modulecontext-modulecontext
102
- loadModule(moduleId, image, serializedParams) {
103
- return __awaiter(this, void 0, void 0, function* () {
104
- const loadModuleArgs = (0, constructor_calls_1.newLoadModuleArgs)(moduleId, image, serializedParams);
105
- const loadModuleResult = yield this.backend.loadModule(loadModuleArgs);
106
- if (loadModuleResult.isErr()) {
107
- return (0, neverthrow_1.err)(loadModuleResult.error);
108
- }
109
- const moduleContext = new module_context_1.ModuleContext(this.backend, moduleId);
110
- return (0, neverthrow_1.ok)(moduleContext);
111
- });
112
- }
113
- // Docs available at https://docs.kurtosis.com/sdk/#unloadmodulestring-moduleid
114
- unloadModule(moduleId) {
115
- return __awaiter(this, void 0, void 0, function* () {
116
- const unloadModuleArgs = (0, constructor_calls_1.newUnloadModuleArgs)(moduleId);
117
- const unloadModuleResult = yield this.backend.unloadModule(unloadModuleArgs);
118
- if (unloadModuleResult.isErr()) {
119
- return (0, neverthrow_1.err)(unloadModuleResult.error);
120
- }
121
- // We discard the module GUID
122
- return (0, neverthrow_1.ok)(null);
123
- });
124
- }
125
- // Docs available at https://docs.kurtosis.com/sdk/#getmodulecontextstring-moduleid---modulecontext-modulecontext
126
- getModuleContext(moduleId) {
127
- return __awaiter(this, void 0, void 0, function* () {
128
- const moduleMapForArgs = new Map();
129
- moduleMapForArgs.set(moduleId, true);
130
- const args = (0, constructor_calls_1.newGetModulesArgs)(moduleMapForArgs);
131
- const getModuleInfoResult = yield this.backend.getModules(args);
132
- if (getModuleInfoResult.isErr()) {
133
- return (0, neverthrow_1.err)(getModuleInfoResult.error);
134
- }
135
- const resp = getModuleInfoResult.value;
136
- if (!resp.getModuleInfoMap().has(moduleId)) {
137
- return (0, neverthrow_1.err)(new Error(`Module '${moduleId}' does not exist`));
138
- }
139
- const moduleCtx = new module_context_1.ModuleContext(this.backend, moduleId);
140
- return (0, neverthrow_1.ok)(moduleCtx);
141
- });
142
- }
143
100
  // Docs available at https://docs.kurtosis.com/sdk/#runstarlarkscriptstring-serializedstarlarkscript-boolean-dryrun---streamstarlarkrunresponseline-responselines-error-error
144
101
  runStarlarkScript(serializedStartosisScript, serializedParams, dryRun) {
145
102
  return __awaiter(this, void 0, void 0, function* () {
@@ -237,16 +194,6 @@ class EnclaveContext {
237
194
  return (0, neverthrow_1.ok)(serviceCtx);
238
195
  });
239
196
  }
240
- // Docs available at https://docs.kurtosis.com/sdk/#addservicesmapserviceid-containerconfig-containerconfigs---mapserviceid-servicecontext-successfulservices-mapserviceid-error-failedservices
241
- addServices(containerConfigs) {
242
- return __awaiter(this, void 0, void 0, function* () {
243
- const resultAddServicesToPartition = yield this.addServicesToPartition(containerConfigs, DEFAULT_PARTITION_ID);
244
- if (resultAddServicesToPartition.isErr()) {
245
- return (0, neverthrow_1.err)(resultAddServicesToPartition.error);
246
- }
247
- return (0, neverthrow_1.ok)(resultAddServicesToPartition.value);
248
- });
249
- }
250
197
  // Docs available at https://docs.kurtosis.com/sdk/#addservicetopartitionserviceid-serviceid-partitionid-partitionid-containerconfig-containerconfig---servicecontext-servicecontext
251
198
  addServiceToPartition(serviceId, partitionId, containerConfig) {
252
199
  return __awaiter(this, void 0, void 0, function* () {
@@ -376,19 +323,6 @@ class EnclaveContext {
376
323
  return (0, neverthrow_1.ok)(serviceContext);
377
324
  });
378
325
  }
379
- // Docs available at https://docs.kurtosis.com/sdk/#removeserviceserviceid-serviceid-uint64-containerstoptimeoutseconds
380
- removeService(serviceId) {
381
- return __awaiter(this, void 0, void 0, function* () {
382
- loglevel_1.default.debug("Removing service '" + serviceId + "'...");
383
- const removeServiceArgs = (0, constructor_calls_1.newRemoveServiceArgs)(serviceId);
384
- const removeServiceResult = yield this.backend.removeService(removeServiceArgs);
385
- if (removeServiceResult.isErr()) {
386
- return (0, neverthrow_1.err)(removeServiceResult.error);
387
- }
388
- loglevel_1.default.debug("Successfully removed service ID " + serviceId);
389
- return (0, neverthrow_1.ok)(null);
390
- });
391
- }
392
326
  // Docs available at https://docs.kurtosis.com/sdk/#repartitionnetworkmappartitionid-setserviceid-partitionservices-mappartitionid-mappartitionid-partitionconnection-partitionconnections-partitionconnection-defaultconnection
393
327
  repartitionNetwork(partitionServices, partitionConnections, defaultConnection) {
394
328
  return __awaiter(this, void 0, void 0, function* () {
@@ -463,23 +397,6 @@ class EnclaveContext {
463
397
  return (0, neverthrow_1.ok)(serviceInfos);
464
398
  });
465
399
  }
466
- // Docs available at https://docs.kurtosis.com/sdk/#getmodules---setmoduleid-moduleids
467
- getModules() {
468
- return __awaiter(this, void 0, void 0, function* () {
469
- const getAllModulesArgMap = new Map();
470
- const emptyGetModulesArg = (0, constructor_calls_1.newGetModulesArgs)(getAllModulesArgMap);
471
- const getModulesResponseResult = yield this.backend.getModules(emptyGetModulesArg);
472
- if (getModulesResponseResult.isErr()) {
473
- return (0, neverthrow_1.err)(getModulesResponseResult.error);
474
- }
475
- const modulesResponse = getModulesResponseResult.value;
476
- const moduleIds = new Set();
477
- modulesResponse.getModuleInfoMap().forEach((value, key) => {
478
- moduleIds.add(key);
479
- });
480
- return (0, neverthrow_1.ok)(moduleIds);
481
- });
482
- }
483
400
  // Docs available at https://docs.kurtosis.com/sdk/#uploadfilesstring-pathtoupload
484
401
  uploadFiles(pathToArchive) {
485
402
  return __awaiter(this, void 0, void 0, function* () {
@@ -507,62 +424,6 @@ class EnclaveContext {
507
424
  return (0, neverthrow_1.ok)(storeWebFilesArtifactResponse.getUuid());
508
425
  });
509
426
  }
510
- // Docs available at https://docs.kurtosis.com/sdk/#storeservicefilesserviceid-serviceid-string-absolutefilepathonservicecontainer
511
- storeServiceFiles(serviceId, absoluteFilepathOnServiceContainer) {
512
- return __awaiter(this, void 0, void 0, function* () {
513
- const args = (0, constructor_calls_1.newStoreFilesArtifactFromServiceArgs)(serviceId, absoluteFilepathOnServiceContainer);
514
- const storeFilesArtifactFromServiceResponseResult = yield this.backend.storeFilesArtifactFromService(args);
515
- if (storeFilesArtifactFromServiceResponseResult.isErr()) {
516
- return (0, neverthrow_1.err)(storeFilesArtifactFromServiceResponseResult.error);
517
- }
518
- const storeFilesArtifactFromServiceResponse = storeFilesArtifactFromServiceResponseResult.value;
519
- return (0, neverthrow_1.ok)(storeFilesArtifactFromServiceResponse.getUuid());
520
- });
521
- }
522
- // Docs available at https://docs.kurtosis.com/sdk/#pauseserviceserviceid-serviceid
523
- pauseService(serviceId) {
524
- return __awaiter(this, void 0, void 0, function* () {
525
- const pauseServiceArgs = (0, constructor_calls_1.newPauseServiceArgs)(serviceId);
526
- const pauseServiceResult = yield this.backend.pauseService(pauseServiceArgs);
527
- if (pauseServiceResult.isErr()) {
528
- return (0, neverthrow_1.err)(pauseServiceResult.error);
529
- }
530
- const pauseServiceResponse = pauseServiceResult.value;
531
- return (0, neverthrow_1.ok)(null);
532
- });
533
- }
534
- // Docs available at https://docs.kurtosis.com/sdk/#unpauseserviceserviceid-serviceid
535
- unpauseService(serviceId) {
536
- return __awaiter(this, void 0, void 0, function* () {
537
- const unpauseServiceArgs = (0, constructor_calls_1.newUnpauseServiceArgs)(serviceId);
538
- const unpauseServiceResult = yield this.backend.unpauseService(unpauseServiceArgs);
539
- if (unpauseServiceResult.isErr()) {
540
- return (0, neverthrow_1.err)(unpauseServiceResult.error);
541
- }
542
- const pauseServiceResponse = unpauseServiceResult.value;
543
- return (0, neverthrow_1.ok)(null);
544
- });
545
- }
546
- // Docs available at https://docs.kurtosis.com/sdk/#rendertemplatesmapstring-templateanddata-templateanddatabydestinationrelfilepaths
547
- renderTemplates(templateAndDataByDestinationRelFilepath) {
548
- return __awaiter(this, void 0, void 0, function* () {
549
- if (templateAndDataByDestinationRelFilepath.size === 0) {
550
- return (0, neverthrow_1.err)(new Error("Expected at least one template got 0"));
551
- }
552
- let renderTemplatesToFilesArtifactArgs = (0, constructor_calls_1.newRenderTemplatesToFilesArtifactArgs)();
553
- let templateAndDataByRelDestinationFilepath = renderTemplatesToFilesArtifactArgs.getTemplatesAndDataByDestinationRelFilepathMap();
554
- for (let [destinationRelFilepath, templateAndData] of templateAndDataByDestinationRelFilepath) {
555
- const templateDataAsJsonString = JSON.stringify(templateAndData.templateData);
556
- const templateAndDataAsJson = (0, constructor_calls_1.newTemplateAndData)(templateAndData.template, templateDataAsJsonString);
557
- templateAndDataByRelDestinationFilepath.set(destinationRelFilepath, templateAndDataAsJson);
558
- }
559
- const renderTemplatesToFilesArtifactResult = yield this.backend.renderTemplatesToFilesArtifact(renderTemplatesToFilesArtifactArgs);
560
- if (renderTemplatesToFilesArtifactResult.isErr()) {
561
- return (0, neverthrow_1.err)(renderTemplatesToFilesArtifactResult.error);
562
- }
563
- return (0, neverthrow_1.ok)(renderTemplatesToFilesArtifactResult.value.getUuid());
564
- });
565
- }
566
427
  // ====================================================================================================
567
428
  // Private helper functions
568
429
  // ====================================================================================================
package/build/index.d.ts CHANGED
@@ -7,9 +7,7 @@ export { PortSpec, TransportProtocol } from "./core/lib/services/port_spec";
7
7
  export { EnclaveContext } from "./core/lib/enclaves/enclave_context";
8
8
  export type { EnclaveID, PartitionID } from "./core/lib/enclaves/enclave_context";
9
9
  export { UnblockedPartitionConnection, BlockedPartitionConnection, SoftPartitionConnection } from "./core/lib/enclaves/partition_connection";
10
- export type { ModuleID } from "./core/lib/modules/module_context";
11
- export { ModuleContext } from "./core/lib/modules/module_context";
12
- export { newExecCommandArgs, newLoadModuleArgs, newStartServicesArgs, newGetServicesArgs, newRemoveServiceArgs, newPartitionServices, newRepartitionArgs, newPartitionConnections, newPartitionConnectionInfo, newWaitForHttpGetEndpointAvailabilityArgs, newWaitForHttpPostEndpointAvailabilityArgs, newExecuteModuleArgs, newGetModulesArgs } from "./core/lib/constructor_calls";
10
+ export { newExecCommandArgs, newStartServicesArgs, newGetServicesArgs, newRemoveServiceArgs, newPartitionServices, newRepartitionArgs, newPartitionConnections, newPartitionConnectionInfo, newWaitForHttpGetEndpointAvailabilityArgs, newWaitForHttpPostEndpointAvailabilityArgs } from "./core/lib/constructor_calls";
13
11
  export { ModuleContainerArgs } from "./core/module_launch_api/module_container_args";
14
12
  export { getArgsFromEnv } from "./core/module_launch_api/args_io";
15
13
  export { PartitionConnections } from "./core/kurtosis_core_rpc_api_bindings/api_container_service_pb";
package/build/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.EnclaveAPIContainerHostMachineInfo = exports.LogLineFilter = exports.ServiceLog = exports.ServiceLogsStreamContent = exports.DEFAULT_GRPC_ENGINE_SERVER_PORT_NUM = exports.DEFAULT_GRPC_PROXY_ENGINE_SERVER_PORT_NUM = exports.KurtosisContext = exports.ExecuteResponse = exports.ExecuteArgs = exports.PartitionConnections = exports.getArgsFromEnv = exports.ModuleContainerArgs = exports.newGetModulesArgs = exports.newExecuteModuleArgs = exports.newWaitForHttpPostEndpointAvailabilityArgs = exports.newWaitForHttpGetEndpointAvailabilityArgs = exports.newPartitionConnectionInfo = exports.newPartitionConnections = exports.newRepartitionArgs = exports.newPartitionServices = exports.newRemoveServiceArgs = exports.newGetServicesArgs = exports.newStartServicesArgs = exports.newLoadModuleArgs = exports.newExecCommandArgs = exports.ModuleContext = exports.SoftPartitionConnection = exports.BlockedPartitionConnection = exports.UnblockedPartitionConnection = exports.EnclaveContext = exports.TransportProtocol = exports.PortSpec = exports.ServiceContext = exports.ContainerConfigBuilder = exports.KURTOSIS_VERSION = void 0;
3
+ exports.EnclaveAPIContainerHostMachineInfo = exports.LogLineFilter = exports.ServiceLog = exports.ServiceLogsStreamContent = exports.DEFAULT_GRPC_ENGINE_SERVER_PORT_NUM = exports.DEFAULT_GRPC_PROXY_ENGINE_SERVER_PORT_NUM = exports.KurtosisContext = exports.ExecuteResponse = exports.ExecuteArgs = exports.PartitionConnections = exports.getArgsFromEnv = exports.ModuleContainerArgs = exports.newWaitForHttpPostEndpointAvailabilityArgs = exports.newWaitForHttpGetEndpointAvailabilityArgs = exports.newPartitionConnectionInfo = exports.newPartitionConnections = exports.newRepartitionArgs = exports.newPartitionServices = exports.newRemoveServiceArgs = exports.newGetServicesArgs = exports.newStartServicesArgs = exports.newExecCommandArgs = exports.SoftPartitionConnection = exports.BlockedPartitionConnection = exports.UnblockedPartitionConnection = exports.EnclaveContext = exports.TransportProtocol = exports.PortSpec = exports.ServiceContext = exports.ContainerConfigBuilder = exports.KURTOSIS_VERSION = void 0;
4
4
  // Own Version
5
5
  var kurtosis_version_1 = require("./kurtosis_version/kurtosis_version");
6
6
  Object.defineProperty(exports, "KURTOSIS_VERSION", { enumerable: true, get: function () { return kurtosis_version_1.KURTOSIS_VERSION; } });
@@ -18,12 +18,9 @@ var partition_connection_1 = require("./core/lib/enclaves/partition_connection")
18
18
  Object.defineProperty(exports, "UnblockedPartitionConnection", { enumerable: true, get: function () { return partition_connection_1.UnblockedPartitionConnection; } });
19
19
  Object.defineProperty(exports, "BlockedPartitionConnection", { enumerable: true, get: function () { return partition_connection_1.BlockedPartitionConnection; } });
20
20
  Object.defineProperty(exports, "SoftPartitionConnection", { enumerable: true, get: function () { return partition_connection_1.SoftPartitionConnection; } });
21
- var module_context_1 = require("./core/lib/modules/module_context");
22
- Object.defineProperty(exports, "ModuleContext", { enumerable: true, get: function () { return module_context_1.ModuleContext; } });
23
21
  // Constructor Calls
24
22
  var constructor_calls_1 = require("./core/lib/constructor_calls");
25
23
  Object.defineProperty(exports, "newExecCommandArgs", { enumerable: true, get: function () { return constructor_calls_1.newExecCommandArgs; } });
26
- Object.defineProperty(exports, "newLoadModuleArgs", { enumerable: true, get: function () { return constructor_calls_1.newLoadModuleArgs; } });
27
24
  Object.defineProperty(exports, "newStartServicesArgs", { enumerable: true, get: function () { return constructor_calls_1.newStartServicesArgs; } });
28
25
  Object.defineProperty(exports, "newGetServicesArgs", { enumerable: true, get: function () { return constructor_calls_1.newGetServicesArgs; } });
29
26
  Object.defineProperty(exports, "newRemoveServiceArgs", { enumerable: true, get: function () { return constructor_calls_1.newRemoveServiceArgs; } });
@@ -33,8 +30,6 @@ Object.defineProperty(exports, "newPartitionConnections", { enumerable: true, ge
33
30
  Object.defineProperty(exports, "newPartitionConnectionInfo", { enumerable: true, get: function () { return constructor_calls_1.newPartitionConnectionInfo; } });
34
31
  Object.defineProperty(exports, "newWaitForHttpGetEndpointAvailabilityArgs", { enumerable: true, get: function () { return constructor_calls_1.newWaitForHttpGetEndpointAvailabilityArgs; } });
35
32
  Object.defineProperty(exports, "newWaitForHttpPostEndpointAvailabilityArgs", { enumerable: true, get: function () { return constructor_calls_1.newWaitForHttpPostEndpointAvailabilityArgs; } });
36
- Object.defineProperty(exports, "newExecuteModuleArgs", { enumerable: true, get: function () { return constructor_calls_1.newExecuteModuleArgs; } });
37
- Object.defineProperty(exports, "newGetModulesArgs", { enumerable: true, get: function () { return constructor_calls_1.newGetModulesArgs; } });
38
33
  // Module Launch API
39
34
  var module_container_args_1 = require("./core/module_launch_api/module_container_args");
40
35
  Object.defineProperty(exports, "ModuleContainerArgs", { enumerable: true, get: function () { return module_container_args_1.ModuleContainerArgs; } });
@@ -4,5 +4,5 @@ exports.KURTOSIS_VERSION = void 0;
4
4
  // !!!!!!!!!!! DO NOT UPDATE! WILL BE MANUALLY UPDATED DURING THE RELEASE PROCESS !!!!!!!!!!!!!!!!!!!!!!
5
5
  // This is necessary so that Kurt Core consumers (e.g. modules) will know if they're compatible with the currently-running
6
6
  // API container
7
- exports.KURTOSIS_VERSION = "0.63.0";
7
+ exports.KURTOSIS_VERSION = "0.63.2";
8
8
  // !!!!!!!!!!! DO NOT UPDATE! WILL BE MANUALLY UPDATED DURING THE RELEASE PROCESS !!!!!!!!!!!!!!!!!!!!!!
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "kurtosis-sdk",
3
3
  "//": "NOTE: DO NOT UPDATE THIS VERSION MANUALLY - IT WILL BE UPDATED DURING THE RELEASE PROCESS!",
4
- "version": "0.63.0",
4
+ "version": "0.63.2",
5
5
  "main": "./build/index",
6
6
  "description": "This repo contains a Typescript client for communicating with the Kurtosis Engine server, which is responsible for creating, managing and destroying Kurtosis Enclaves.",
7
7
  "types": "./build/index",
@@ -1,9 +0,0 @@
1
- import { Result } from "neverthrow";
2
- import { GenericApiContainerClient } from "../enclaves/generic_api_container_client";
3
- export declare type ModuleID = string;
4
- export declare class ModuleContext {
5
- private readonly client;
6
- private readonly moduleId;
7
- constructor(client: GenericApiContainerClient, moduleId: ModuleID);
8
- execute(serializedParams: string): Promise<Result<string, Error>>;
9
- }
@@ -1,34 +0,0 @@
1
- "use strict";
2
- var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
3
- function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
4
- return new (P || (P = Promise))(function (resolve, reject) {
5
- function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
6
- function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
7
- function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
8
- step((generator = generator.apply(thisArg, _arguments || [])).next());
9
- });
10
- };
11
- Object.defineProperty(exports, "__esModule", { value: true });
12
- exports.ModuleContext = void 0;
13
- const neverthrow_1 = require("neverthrow");
14
- const constructor_calls_1 = require("../constructor_calls");
15
- // Docs available at https://docs.kurtosis.com/sdk/#modulecontext
16
- class ModuleContext {
17
- constructor(client, moduleId) {
18
- this.moduleId = moduleId;
19
- this.client = client;
20
- }
21
- // Docs available at https://docs.kurtosis.com/sdk/#executestring-serializedparams---string-serializedresult
22
- execute(serializedParams) {
23
- return __awaiter(this, void 0, void 0, function* () {
24
- const executeModuleArgs = (0, constructor_calls_1.newExecuteModuleArgs)(this.moduleId, serializedParams);
25
- const executeResponseResult = yield this.client.executeModule(executeModuleArgs);
26
- if (executeResponseResult.isErr()) {
27
- return (0, neverthrow_1.err)(executeResponseResult.error);
28
- }
29
- const executeResponse = executeResponseResult.value;
30
- return (0, neverthrow_1.ok)(executeResponse.getSerializedResult());
31
- });
32
- }
33
- }
34
- exports.ModuleContext = ModuleContext;