@gadgetinc/dateilager 0.6.1 → 0.7.0

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.
@@ -5,7 +5,7 @@ export interface DateiLagerBinaryClientOptions {
5
5
  /**
6
6
  * The address of the dateilager server.
7
7
  */
8
- server: string | {
8
+ server: {
9
9
  /**
10
10
  * The host of the dateilager server.
11
11
  */
@@ -13,7 +13,11 @@ export interface DateiLagerBinaryClientOptions {
13
13
  /**
14
14
  * The port of the dateilager server.
15
15
  */
16
- port: number;
16
+ port?: number;
17
+ /**
18
+ * The GRPC headless service hostname, used for load balancing across multiple servers.
19
+ */
20
+ headlessHost?: string;
17
21
  };
18
22
  /**
19
23
  * The token that will be sent as authorization metadata to the dateilager server.
@@ -27,7 +27,9 @@ class DateiLagerBinaryClient {
27
27
  value: void 0
28
28
  });
29
29
  this._options = {
30
- server: typeof options.server === "string" ? options.server : `${options.server.host}:${options.server.port}`,
30
+ host: options.server.host,
31
+ port: options.server.port ?? 5051,
32
+ headlessHost: options.server.headlessHost,
31
33
  token: typeof options.token === "string" ? () => Promise.resolve(options.token) : options.token,
32
34
  command: options.command ?? "dateilager-client",
33
35
  timeout: typeof options.timeout === "number"
@@ -186,10 +188,13 @@ class DateiLagerBinaryClient {
186
188
  }
187
189
  /** @internal */
188
190
  async _call(method, args, cwd, options) {
189
- const baseArgs = [method, "--server", this._options.server, "--log-encoding", "json"];
191
+ const baseArgs = [method, "--host", this._options.host, "--port", String(this._options.port), "--log-encoding", "json"];
190
192
  if (this._options.logger) {
191
193
  baseArgs.push("--log-level", this._options.logger.level);
192
194
  }
195
+ if (this._options.headlessHost) {
196
+ baseArgs.push("--headless-host", this._options.headlessHost);
197
+ }
193
198
  if (this._options.tracing) {
194
199
  const carrier = {};
195
200
  api_1.propagation.inject(api_1.context.active(), carrier);
@@ -1 +1 @@
1
- {"version":3,"file":"binary-client.js","sourceRoot":"","sources":["../../src/binary-client.ts"],"names":[],"mappings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ry/api\";\nimport type { ExecaReturnValue } from \"execa\";\nimport execa from \"execa\";\nimport fs from \"fs/promises\";\nimport readline from \"readline\";\nimport { trace } from \"./internal/telemetry\";\n\n/**\n * Options for {@link DateiLagerBinaryClient}.\n */\nexport interface DateiLagerBinaryClientOptions {\n /**\n * The address of the dateilager server.\n */\n server:\n | string\n | {\n /**\n * The host of the dateilager server.\n */\n host: string;\n\n /**\n * The port of the dateilager server.\n */\n port: number;\n };\n\n /**\n * The token that will be sent as authorization metadata to the dateilager server.\n */\n token: string | (() => Promise<string>);\n\n /**\n * The path to the dateilager-client executable.\n *\n * @default \"dateilager-client\"\n */\n command?: string;\n\n /**\n * The default number of milliseconds to wait before terminating any command.\n *\n * @default 0 No timeout.\n */\n timeout?:\n | number\n | {\n /**\n * The default number of milliseconds to wait before terminating the update command.\n *\n * @default 0 No timeout.\n */\n update?: number;\n\n /**\n * The default number of milliseconds to wait before terminating the rebuild command.\n *\n * @default 0 No timeout.\n */\n rebuild?: number;\n\n /**\n * The default number of milliseconds to wait before terminating the gc command.\n *\n * @default 0 No timeout.\n */\n gc?: number;\n };\n\n /**\n * Whether the dateilager binary client should enable tracing.\n *\n * @default false\n */\n tracing?: boolean;\n\n /**\n * Logging configuration.\n */\n logger?: {\n /**\n * The log level to pass to the dateilager binary client.\n */\n level: \"debug\" | \"info\" | \"warn\" | \"error\";\n\n /**\n * The function that will be called when the dateilager binary client logs something.\n */\n log: (level: \"debug\" | \"info\" | \"warn\" | \"error\", msg: string, fields: Record<string, unknown>) => void;\n };\n}\n\n/**\n * The version of the filesystem after the call to rebuild.\n *\n * If a file pattern was included then patternDetected can be used to know if that filepattern was seen while rebuilding.\n */\nexport interface RebuildResult {\n /**\n * Filesystem version.\n */\n version: bigint;\n /**\n * Files updated by the rebuild operation.\n */\n count: number;\n /**\n * Whether or not the file match was detected.\n */\n fileMatch: boolean;\n}\n\n/**\n * The Result from calling the Dateilager Garbage Compiler\n */\nexport interface GCResult {\n /**\n * The number of records garbage collected\n */\n count: number;\n}\n\n/**\n * A version of the DateiLager client that uses the compiled binary client instead of the Javascript one.\n *\n * Useful for working directly with a real filesystem instead of in memory objects.\n */\nexport class DateiLagerBinaryClient {\n /** @internal */\n private readonly _options;\n\n /**\n * @param options An object with {@link DateiLagerBinaryClientOptions options}.\n */\n public constructor(options: DateiLagerBinaryClientOptions) {\n this._options = {\n server: typeof options.server === \"string\" ? options.server : `${options.server.host}:${options.server.port}`,\n token: typeof options.token === \"string\" ? () => Promise.resolve(options.token as string) : options.token,\n command: options.command ?? \"dateilager-client\",\n timeout:\n typeof options.timeout === \"number\"\n ? {\n update: options.timeout,\n rebuild: options.timeout,\n }\n : {\n update: 0,\n rebuild: 0,\n ...options.timeout,\n },\n tracing: options.tracing ?? false,\n logger: options.logger,\n };\n }\n\n /**\n * Update objects in a project based on the differences in a local directory.\n *\n * @param project The id of the project.\n * @param directory The path of the directory to send updates from.\n * @param options Object of options.\n * @param options.timeout Number of milliseconds to wait before terminating the process.\n * @returns The latest project version or `null` if something went wrong.\n */\n public async update(project: bigint, directory: string, options?: { timeout?: number }): Promise<bigint | null> {\n return await trace(\n \"dateilager-binary-client.update\",\n {\n attributes: {\n \"dl.project\": String(project),\n \"dl.directory\": directory,\n },\n },\n async () => {\n const args = [\"--dir\", String(directory), \"--project\", String(project)];\n const result = await this._call(\"update\", args, directory, options);\n\n if (result.stdout == \"-1\") {\n return null;\n }\n\n return BigInt(result.stdout);\n }\n );\n }\n\n /**\n * Rebuild the local filesystem.\n *\n * @param project The id of the project.\n * @param to The version of the project to rebuild the filesystem to.\n * @param directory The path of the directory to rebuild the filesystem at.\n * @param options Object of options.\n * @param options.timeout Number of milliseconds to wait before terminating the process.\n * @param options.ignores The paths to ignore when rebuilding the FS.\n * @param options.summarize Should produce the summary file after rebuilding.\n * @param options.cacheDir Path where the cache directory is mounted.\n * @param options.matchInclude Set fileMatch to true if the written files are matched by this glob pattern\n * @param options.matchExclude Set fileMatch to false if the written files are matched by this glob pattern\n * @returns The latest project version or `null` if something went wrong.\n */\n public async rebuild(\n project: bigint,\n to: bigint | null,\n directory: string,\n options?: {\n timeout?: number;\n ignores?: string[];\n summarize?: boolean;\n cacheDir?: string;\n matchInclude?: string;\n matchExclude?: string;\n }\n ): Promise<RebuildResult> {\n return await trace(\n \"dateilager-binary-client.rebuild\",\n {\n attributes: {\n \"dl.project\": String(project),\n \"dl.to\": String(to),\n \"dl.directory\": directory,\n },\n },\n async () => {\n await fs.mkdir(directory, { recursive: true });\n\n const args = [\"--dir\", directory];\n if (to) {\n args.push(\"--to\", String(to));\n }\n\n if (options?.ignores) {\n args.push(\"--ignores\", options.ignores.join(\",\"));\n }\n\n if (options?.summarize === false) {\n args.push(\"--summarize=false\");\n }\n\n if (options?.cacheDir) {\n args.push(`--cachedir=${options.cacheDir}`);\n }\n\n if (options?.matchInclude) {\n args.push(`--matchinclude=${options.matchInclude}`);\n }\n\n if (options?.matchExclude) {\n args.push(`--matchexclude=${options.matchExclude}`);\n }\n\n args.push(\"--project\", String(project), \"--dir\", directory);\n const result = await this._call(\"rebuild\", args, directory, options);\n const parsed = JSON.parse(result.stdout) as { version: number; count: number; fileMatch: boolean };\n return { version: BigInt(parsed.version), count: parsed.count, fileMatch: parsed.fileMatch };\n }\n );\n }\n\n /**\n * @param sample sample size of cleanup\n * @param keep The amount of records to keep\n * @param from Where to start cleanup\n * @param options dict options passed\n * @param options.timeout timeout limit for the request\n */\n public async gcRandomProjects(sample: number, keep: number, from?: number, options?: { timeout?: number }): Promise<GCResult> {\n return await trace(\n \"dateilager-binary-client.gc\",\n {\n attributes: {\n \"db.mode\": \"random-projects\",\n \"dl.keep\": String(keep),\n \"dl.from\": String(from),\n \"dl.sample\": String(sample),\n },\n },\n async () => {\n const args = [\"--mode\", \"random-projects\", \"--keep\", String(keep), \"--sample\", String(sample)];\n\n if (from) args.push(\"--from\", String(from));\n\n const result = await this._call(\"gc\", args, undefined, options);\n const parsed = JSON.parse(result.stdout) as { count: number };\n return { count: parsed.count };\n }\n );\n }\n\n /**\n *\n * @param project The selected project to cleanup\n * @param keep The amount of records to keep\n * @param from Where to start cleanup\n * @param options dict options passed\n * @param options.timeout timeout limit for the request\n */\n public async gcProject(project: number, keep: number, from?: number, options?: { timeout?: number }): Promise<GCResult> {\n return await trace(\n \"dateilager-binary-client.gc\",\n {\n attributes: {\n \"db.mode\": \"project\",\n \"dl.keep\": String(keep),\n \"dl.from\": String(from),\n },\n },\n async () => {\n const args = [\"--mode\", \"project\", \"--keep\", String(keep), \"--project\", String(project)];\n\n if (from) args.push(\"--from\", String(from));\n\n const result = await this._call(\"gc\", args, undefined, options);\n const parsed = JSON.parse(result.stdout) as { count: number };\n return { count: parsed.count };\n }\n );\n }\n\n /**\n *\n * @param sample sample size of cleanup\n * @param options dict options passed\n * @param options.timeout timeout limit for the request\n */\n public async gcContents(sample: number, options?: { timeout?: number }): Promise<GCResult> {\n return await trace(\n \"dateilager-binary-client.gc\",\n {\n attributes: {\n \"db.mode\": \"contents\",\n \"dl.sample\": String(sample),\n },\n },\n async () => {\n const args = [\"--mode\", \"contents\", \"--sample\", String(sample)];\n\n const result = await this._call(\"gc\", args, undefined, options);\n const parsed = JSON.parse(result.stdout) as { count: number };\n return { count: parsed.count };\n }\n );\n }\n\n /** @internal */\n private async _call(\n method: \"update\" | \"rebuild\" | \"gc\",\n args: string[],\n cwd?: string,\n options?: { timeout?: number }\n ): Promise<ExecaReturnValue> {\n const baseArgs = [method, \"--server\", this._options.server, \"--log-encoding\", \"json\"];\n\n if (this._options.logger) {\n baseArgs.push(\"--log-level\", this._options.logger.level);\n }\n\n if (this._options.tracing) {\n const carrier = {};\n propagation.inject(context.active(), carrier);\n const otelContext = JSON.stringify(carrier);\n\n baseArgs.push(\"--tracing\", \"--otel-context\", otelContext);\n }\n const subprocess = execa(this._options.command, baseArgs.concat(args), {\n cwd,\n timeout: options?.timeout ?? this._options.timeout[method],\n env: { DL_TOKEN: await this._options.token() },\n });\n\n if (this._options.logger && subprocess.stderr) {\n readline.createInterface(subprocess.stderr).on(\"line\", (line) => {\n try {\n // we purposefully extract and ignore the `ts` field\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { level, msg, ts, ...fields } = JSON.parse(line) as {\n [key: string]: unknown;\n level: \"debug\" | \"info\" | \"warn\" | \"error\";\n msg: string;\n ts: string | number;\n };\n\n this._options.logger?.log(level, msg, fields);\n } catch (error) {\n this._options.logger?.log(\"warn\", \"failed to log line\", { error, line });\n }\n });\n }\n\n return subprocess;\n }\n}\n"]}
1
+ {"version":3,"file":"binary-client.js","sourceRoot":"","sources":["../../src/binary-client.ts"],"names":[],"mappings":";;;;;;AAAA,4CAA0D;AAE1D,kDAA0B;AAC1B,2DAA6B;AAC7B,wDAAgC;AAChC,oDAA6C;AAyH7C;;;;GAIG;AACH,MAAa,sBAAsB;IAIjC;;OAEG;IACH,YAAmB,OAAsC;QANzD,gBAAgB;QAChB;;;;;WAA0B;QAMxB,IAAI,CAAC,QAAQ,GAAG;YACd,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI;YACzB,IAAI,EAAE,OAAO,CAAC,MAAM,CAAC,IAAI,IAAI,IAAI;YACjC,YAAY,EAAE,OAAO,CAAC,MAAM,CAAC,YAAY;YACzC,KAAK,EAAE,OAAO,OAAO,CAAC,KAAK,KAAK,QAAQ,CAAC,CAAC,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,OAAO,CAAC,OAAO,CAAC,KAAe,CAAC,CAAC,CAAC,CAAC,OAAO,CAAC,KAAK;YACzG,OAAO,EAAE,OAAO,CAAC,OAAO,IAAI,mBAAmB;YAC/C,OAAO,EACL,OAAO,OAAO,CAAC,OAAO,KAAK,QAAQ;gBACjC,CAAC,CAAC;oBACE,MAAM,EAAE,OAAO,CAAC,OAAO;oBACvB,OAAO,EAAE,OAAO,CAAC,OAAO;iBACzB;gBACH,CAAC,CAAC;oBACE,MAAM,EAAE,CAAC;oBACT,OAAO,EAAE,CAAC;oBACV,GAAG,OAAO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E,CAAC,IAAI,EAAE,EAAE;gBAC9D,IAAI;oBACF,oDAAoD;oBACpD,6DAA6D;oBAC7D,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,EAAE,EAAE,GAAG,MAAM,EAAE,GAAG,IAAI,CAAC,KAAK,CAAC,IAAI,CAKpD,CAAC;oBAEF,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,KAAK,EAAE,GAAG,EAAE,MAAM,CAAC,CAAC;iBAC/C;gBAAC,OAAO,KAAK,EAAE;oBACd,IAAI,CAAC,QAAQ,CAAC,MAAM,EAAE,GAAG,CAAC,MAAM,EAAE,oBAAoB,EAAE,EAAE,KAAK,EAAE,IAAI,EAAE,CAAC,CAAC;iBAC1E;YACH,CAAC,CAAC,CAAC;SACJ;QAED,OAAO,UAAU,CAAC;IACpB,CAAC;CACF;AA9QD,wDA8QC","sourcesContent":["import { context, propagation } from \"@opentelemetry/api\";\nimport type { ExecaReturnValue } from \"execa\";\nimport execa from \"execa\";\nimport fs from \"fs/promises\";\nimport readline from \"readline\";\nimport { trace } from \"./internal/telemetry\";\n\n/**\n * Options for {@link DateiLagerBinaryClient}.\n */\nexport interface DateiLagerBinaryClientOptions {\n /**\n * The address of the dateilager server.\n */\n server: {\n /**\n * The host of the dateilager server.\n */\n host: string;\n\n /**\n * The port of the dateilager server.\n */\n port?: number;\n\n /**\n * The GRPC headless service hostname, used for load balancing across multiple servers.\n */\n headlessHost?: string;\n };\n\n /**\n * The token that will be sent as authorization metadata to the dateilager server.\n */\n token: string | (() => Promise<string>);\n\n /**\n * The path to the dateilager-client executable.\n *\n * @default \"dateilager-client\"\n */\n command?: string;\n\n /**\n * The default number of milliseconds to wait before terminating any command.\n *\n * @default 0 No timeout.\n */\n timeout?:\n | number\n | {\n /**\n * The default number of milliseconds to wait before terminating the update command.\n *\n * @default 0 No timeout.\n */\n update?: number;\n\n /**\n * The default number of milliseconds to wait before terminating the rebuild command.\n *\n * @default 0 No timeout.\n */\n rebuild?: number;\n\n /**\n * The default number of milliseconds to wait before terminating the gc command.\n *\n * @default 0 No timeout.\n */\n gc?: number;\n };\n\n /**\n * Whether the dateilager binary client should enable tracing.\n *\n * @default false\n */\n tracing?: boolean;\n\n /**\n * Logging configuration.\n */\n logger?: {\n /**\n * The log level to pass to the dateilager binary client.\n */\n level: \"debug\" | \"info\" | \"warn\" | \"error\";\n\n /**\n * The function that will be called when the dateilager binary client logs something.\n */\n log: (level: \"debug\" | \"info\" | \"warn\" | \"error\", msg: string, fields: Record<string, unknown>) => void;\n };\n}\n\n/**\n * The version of the filesystem after the call to rebuild.\n *\n * If a file pattern was included then patternDetected can be used to know if that filepattern was seen while rebuilding.\n */\nexport interface RebuildResult {\n /**\n * Filesystem version.\n */\n version: bigint;\n /**\n * Files updated by the rebuild operation.\n */\n count: number;\n /**\n * Whether or not the file match was detected.\n */\n fileMatch: boolean;\n}\n\n/**\n * The Result from calling the Dateilager Garbage Compiler\n */\nexport interface GCResult {\n /**\n * The number of records garbage collected\n */\n count: number;\n}\n\n/**\n * A version of the DateiLager client that uses the compiled binary client instead of the Javascript one.\n *\n * Useful for working directly with a real filesystem instead of in memory objects.\n */\nexport class DateiLagerBinaryClient {\n /** @internal */\n private readonly _options;\n\n /**\n * @param options An object with {@link DateiLagerBinaryClientOptions options}.\n */\n public constructor(options: DateiLagerBinaryClientOptions) {\n this._options = {\n host: options.server.host,\n port: options.server.port ?? 5051,\n headlessHost: options.server.headlessHost,\n token: typeof options.token === \"string\" ? () => Promise.resolve(options.token as string) : options.token,\n command: options.command ?? \"dateilager-client\",\n timeout:\n typeof options.timeout === \"number\"\n ? {\n update: options.timeout,\n rebuild: options.timeout,\n }\n : {\n update: 0,\n rebuild: 0,\n ...options.timeout,\n },\n tracing: options.tracing ?? false,\n logger: options.logger,\n };\n }\n\n /**\n * Update objects in a project based on the differences in a local directory.\n *\n * @param project The id of the project.\n * @param directory The path of the directory to send updates from.\n * @param options Object of options.\n * @param options.timeout Number of milliseconds to wait before terminating the process.\n * @returns The latest project version or `null` if something went wrong.\n */\n public async update(project: bigint, directory: string, options?: { timeout?: number }): Promise<bigint | null> {\n return await trace(\n \"dateilager-binary-client.update\",\n {\n attributes: {\n \"dl.project\": String(project),\n \"dl.directory\": directory,\n },\n },\n async () => {\n const args = [\"--dir\", String(directory), \"--project\", String(project)];\n const result = await this._call(\"update\", args, directory, options);\n\n if (result.stdout == \"-1\") {\n return null;\n }\n\n return BigInt(result.stdout);\n }\n );\n }\n\n /**\n * Rebuild the local filesystem.\n *\n * @param project The id of the project.\n * @param to The version of the project to rebuild the filesystem to.\n * @param directory The path of the directory to rebuild the filesystem at.\n * @param options Object of options.\n * @param options.timeout Number of milliseconds to wait before terminating the process.\n * @param options.ignores The paths to ignore when rebuilding the FS.\n * @param options.summarize Should produce the summary file after rebuilding.\n * @param options.cacheDir Path where the cache directory is mounted.\n * @param options.matchInclude Set fileMatch to true if the written files are matched by this glob pattern\n * @param options.matchExclude Set fileMatch to false if the written files are matched by this glob pattern\n * @returns The latest project version or `null` if something went wrong.\n */\n public async rebuild(\n project: bigint,\n to: bigint | null,\n directory: string,\n options?: {\n timeout?: number;\n ignores?: string[];\n summarize?: boolean;\n cacheDir?: string;\n matchInclude?: string;\n matchExclude?: string;\n }\n ): Promise<RebuildResult> {\n return await trace(\n \"dateilager-binary-client.rebuild\",\n {\n attributes: {\n \"dl.project\": String(project),\n \"dl.to\": String(to),\n \"dl.directory\": directory,\n },\n },\n async () => {\n await fs.mkdir(directory, { recursive: true });\n\n const args = [\"--dir\", directory];\n if (to) {\n args.push(\"--to\", String(to));\n }\n\n if (options?.ignores) {\n args.push(\"--ignores\", options.ignores.join(\",\"));\n }\n\n if (options?.summarize === false) {\n args.push(\"--summarize=false\");\n }\n\n if (options?.cacheDir) {\n args.push(`--cachedir=${options.cacheDir}`);\n }\n\n if (options?.matchInclude) {\n args.push(`--matchinclude=${options.matchInclude}`);\n }\n\n if (options?.matchExclude) {\n args.push(`--matchexclude=${options.matchExclude}`);\n }\n\n args.push(\"--project\", String(project), \"--dir\", directory);\n const result = await this._call(\"rebuild\", args, directory, options);\n const parsed = JSON.parse(result.stdout) as { version: number; count: number; fileMatch: boolean };\n return { version: BigInt(parsed.version), count: parsed.count, fileMatch: parsed.fileMatch };\n }\n );\n }\n\n /**\n * @param sample sample size of cleanup\n * @param keep The amount of records to keep\n * @param from Where to start cleanup\n * @param options dict options passed\n * @param options.timeout timeout limit for the request\n */\n public async gcRandomProjects(sample: number, keep: number, from?: number, options?: { timeout?: number }): Promise<GCResult> {\n return await trace(\n \"dateilager-binary-client.gc\",\n {\n attributes: {\n \"db.mode\": \"random-projects\",\n \"dl.keep\": String(keep),\n \"dl.from\": String(from),\n \"dl.sample\": String(sample),\n },\n },\n async () => {\n const args = [\"--mode\", \"random-projects\", \"--keep\", String(keep), \"--sample\", String(sample)];\n\n if (from) args.push(\"--from\", String(from));\n\n const result = await this._call(\"gc\", args, undefined, options);\n const parsed = JSON.parse(result.stdout) as { count: number };\n return { count: parsed.count };\n }\n );\n }\n\n /**\n *\n * @param project The selected project to cleanup\n * @param keep The amount of records to keep\n * @param from Where to start cleanup\n * @param options dict options passed\n * @param options.timeout timeout limit for the request\n */\n public async gcProject(project: number, keep: number, from?: number, options?: { timeout?: number }): Promise<GCResult> {\n return await trace(\n \"dateilager-binary-client.gc\",\n {\n attributes: {\n \"db.mode\": \"project\",\n \"dl.keep\": String(keep),\n \"dl.from\": String(from),\n },\n },\n async () => {\n const args = [\"--mode\", \"project\", \"--keep\", String(keep), \"--project\", String(project)];\n\n if (from) args.push(\"--from\", String(from));\n\n const result = await this._call(\"gc\", args, undefined, options);\n const parsed = JSON.parse(result.stdout) as { count: number };\n return { count: parsed.count };\n }\n );\n }\n\n /**\n *\n * @param sample sample size of cleanup\n * @param options dict options passed\n * @param options.timeout timeout limit for the request\n */\n public async gcContents(sample: number, options?: { timeout?: number }): Promise<GCResult> {\n return await trace(\n \"dateilager-binary-client.gc\",\n {\n attributes: {\n \"db.mode\": \"contents\",\n \"dl.sample\": String(sample),\n },\n },\n async () => {\n const args = [\"--mode\", \"contents\", \"--sample\", String(sample)];\n\n const result = await this._call(\"gc\", args, undefined, options);\n const parsed = JSON.parse(result.stdout) as { count: number };\n return { count: parsed.count };\n }\n );\n }\n\n /** @internal */\n private async _call(\n method: \"update\" | \"rebuild\" | \"gc\",\n args: string[],\n cwd?: string,\n options?: { timeout?: number }\n ): Promise<ExecaReturnValue> {\n const baseArgs = [method, \"--host\", this._options.host, \"--port\", String(this._options.port), \"--log-encoding\", \"json\"];\n\n if (this._options.logger) {\n baseArgs.push(\"--log-level\", this._options.logger.level);\n }\n\n if (this._options.headlessHost) {\n baseArgs.push(\"--headless-host\", this._options.headlessHost);\n }\n\n if (this._options.tracing) {\n const carrier = {};\n propagation.inject(context.active(), carrier);\n const otelContext = JSON.stringify(carrier);\n\n baseArgs.push(\"--tracing\", \"--otel-context\", otelContext);\n }\n const subprocess = execa(this._options.command, baseArgs.concat(args), {\n cwd,\n timeout: options?.timeout ?? this._options.timeout[method],\n env: { DL_TOKEN: await this._options.token() },\n });\n\n if (this._options.logger && subprocess.stderr) {\n readline.createInterface(subprocess.stderr).on(\"line\", (line) => {\n try {\n // we purposefully extract and ignore the `ts` field\n // eslint-disable-next-line @typescript-eslint/no-unused-vars\n const { level, msg, ts, ...fields } = JSON.parse(line) as {\n [key: string]: unknown;\n level: \"debug\" | \"info\" | \"warn\" | \"error\";\n msg: string;\n ts: string | number;\n };\n\n this._options.logger?.log(level, msg, fields);\n } catch (error) {\n this._options.logger?.log(\"warn\", \"failed to log line\", { error, line });\n }\n });\n }\n\n return subprocess;\n }\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"fs_pb.client.js","sourceRoot":"","sources":["../../../src/pb/fs_pb.client.ts"],"names":[],"mappings":";;;AAOA,mCAA6B;AAiC7B,0DAA0D;AA0E1D;;GAEG;AACH,MAAa,QAAQ;IAIjB,YAA6B,UAAwB;;;;;mBAAxB;;QAH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Ac,EAAoC,iBAAiB,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACrH,CAAC;CACJ;AAtHD,4BAsHC","sourcesContent":["/* eslint-disable */\n// @generated by protobuf-ts 2.9.0 with parameter long_type_bigint,ts_nocheck,eslint_disable,add_pb_suffix\n// @generated from protobuf file \"fs.proto\" (package \"pb\", syntax proto3)\n// tslint:disable\n// @ts-nocheck\nimport type { RpcTransport } from \"@protobuf-ts/runtime-rpc\";\nimport type { ServiceInfo } from \"@protobuf-ts/runtime-rpc\";\nimport { Fs } from \"./fs_pb\";\nimport type { GetCacheResponse } from \"./fs_pb\";\nimport type { GetCacheRequest } from \"./fs_pb\";\nimport type { CloneToProjectResponse } from \"./fs_pb\";\nimport type { CloneToProjectRequest } from \"./fs_pb\";\nimport type { GcContentsResponse } from \"./fs_pb\";\nimport type { GcContentsRequest } from \"./fs_pb\";\nimport type { GcRandomProjectsResponse } from \"./fs_pb\";\nimport type { GcRandomProjectsRequest } from \"./fs_pb\";\nimport type { GcProjectResponse } from \"./fs_pb\";\nimport type { GcProjectRequest } from \"./fs_pb\";\nimport type { ResetResponse } from \"./fs_pb\";\nimport type { ResetRequest } from \"./fs_pb\";\nimport type { SnapshotResponse } from \"./fs_pb\";\nimport type { SnapshotRequest } from \"./fs_pb\";\nimport type { InspectResponse } from \"./fs_pb\";\nimport type { InspectRequest } from \"./fs_pb\";\nimport type { RollbackResponse } from \"./fs_pb\";\nimport type { RollbackRequest } from \"./fs_pb\";\nimport type { UpdateResponse } from \"./fs_pb\";\nimport type { UpdateRequest } from \"./fs_pb\";\nimport type { ClientStreamingCall } from \"@protobuf-ts/runtime-rpc\";\nimport type { GetUnaryResponse } from \"./fs_pb\";\nimport type { GetUnaryRequest } from \"./fs_pb\";\nimport type { GetCompressResponse } from \"./fs_pb\";\nimport type { GetCompressRequest } from \"./fs_pb\";\nimport type { GetResponse } from \"./fs_pb\";\nimport type { GetRequest } from \"./fs_pb\";\nimport type { ServerStreamingCall } from \"@protobuf-ts/runtime-rpc\";\nimport type { ListProjectsResponse } from \"./fs_pb\";\nimport type { ListProjectsRequest } from \"./fs_pb\";\nimport type { DeleteProjectResponse } from \"./fs_pb\";\nimport type { DeleteProjectRequest } from \"./fs_pb\";\nimport { stackIntercept } from \"@protobuf-ts/runtime-rpc\";\nimport type { NewProjectResponse } from \"./fs_pb\";\nimport type { NewProjectRequest } from \"./fs_pb\";\nimport type { UnaryCall } from \"@protobuf-ts/runtime-rpc\";\nimport type { RpcOptions } from \"@protobuf-ts/runtime-rpc\";\n/**\n * @generated from protobuf service pb.Fs\n */\nexport interface IFsClient {\n /**\n * @generated from protobuf rpc: NewProject(pb.NewProjectRequest) returns (pb.NewProjectResponse);\n */\n newProject(input: NewProjectRequest, options?: RpcOptions): UnaryCall<NewProjectRequest, NewProjectResponse>;\n /**\n * @generated from protobuf rpc: DeleteProject(pb.DeleteProjectRequest) returns (pb.DeleteProjectResponse);\n */\n deleteProject(input: DeleteProjectRequest, options?: RpcOptions): UnaryCall<DeleteProjectRequest, DeleteProjectResponse>;\n /**\n * @generated from protobuf rpc: ListProjects(pb.ListProjectsRequest) returns (pb.ListProjectsResponse);\n */\n listProjects(input: ListProjectsRequest, options?: RpcOptions): UnaryCall<ListProjectsRequest, ListProjectsResponse>;\n /**\n * @generated from protobuf rpc: Get(pb.GetRequest) returns (stream pb.GetResponse);\n */\n get(input: GetRequest, options?: RpcOptions): ServerStreamingCall<GetRequest, GetResponse>;\n /**\n * @generated from protobuf rpc: GetCompress(pb.GetCompressRequest) returns (stream pb.GetCompressResponse);\n */\n getCompress(input: GetCompressRequest, options?: RpcOptions): ServerStreamingCall<GetCompressRequest, GetCompressResponse>;\n /**\n * @generated from protobuf rpc: GetUnary(pb.GetUnaryRequest) returns (pb.GetUnaryResponse);\n */\n getUnary(input: GetUnaryRequest, options?: RpcOptions): UnaryCall<GetUnaryRequest, GetUnaryResponse>;\n /**\n * @generated from protobuf rpc: Update(stream pb.UpdateRequest) returns (pb.UpdateResponse);\n */\n update(options?: RpcOptions): ClientStreamingCall<UpdateRequest, UpdateResponse>;\n /**\n * @generated from protobuf rpc: Rollback(pb.RollbackRequest) returns (pb.RollbackResponse);\n */\n rollback(input: RollbackRequest, options?: RpcOptions): UnaryCall<RollbackRequest, RollbackResponse>;\n /**\n * @generated from protobuf rpc: Inspect(pb.InspectRequest) returns (pb.InspectResponse);\n */\n inspect(input: InspectRequest, options?: RpcOptions): UnaryCall<InspectRequest, InspectResponse>;\n /**\n * @generated from protobuf rpc: Snapshot(pb.SnapshotRequest) returns (pb.SnapshotResponse);\n */\n snapshot(input: SnapshotRequest, options?: RpcOptions): UnaryCall<SnapshotRequest, SnapshotResponse>;\n /**\n * @generated from protobuf rpc: Reset(pb.ResetRequest) returns (pb.ResetResponse);\n */\n reset(input: ResetRequest, options?: RpcOptions): UnaryCall<ResetRequest, ResetResponse>;\n /**\n * @generated from protobuf rpc: GcProject(pb.GcProjectRequest) returns (pb.GcProjectResponse);\n */\n gcProject(input: GcProjectRequest, options?: RpcOptions): UnaryCall<GcProjectRequest, GcProjectResponse>;\n /**\n * @generated from protobuf rpc: GcRandomProjects(pb.GcRandomProjectsRequest) returns (pb.GcRandomProjectsResponse);\n */\n gcRandomProjects(input: GcRandomProjectsRequest, options?: RpcOptions): UnaryCall<GcRandomProjectsRequest, GcRandomProjectsResponse>;\n /**\n * @generated from protobuf rpc: GcContents(pb.GcContentsRequest) returns (pb.GcContentsResponse);\n */\n gcContents(input: GcContentsRequest, options?: RpcOptions): UnaryCall<GcContentsRequest, GcContentsResponse>;\n /**\n * @generated from protobuf rpc: CloneToProject(pb.CloneToProjectRequest) returns (pb.CloneToProjectResponse);\n */\n cloneToProject(input: CloneToProjectRequest, options?: RpcOptions): UnaryCall<CloneToProjectRequest, CloneToProjectResponse>;\n /**\n * @generated from protobuf rpc: GetCache(pb.GetCacheRequest) returns (stream pb.GetCacheResponse);\n */\n getCache(input: GetCacheRequest, options?: RpcOptions): ServerStreamingCall<GetCacheRequest, GetCacheResponse>;\n}\n/**\n * @generated from protobuf service pb.Fs\n */\nexport class FsClient implements IFsClient, ServiceInfo {\n typeName = Fs.typeName;\n methods = Fs.methods;\n options = Fs.options;\n constructor(private readonly _transport: RpcTransport) {\n }\n /**\n * @generated from protobuf rpc: NewProject(pb.NewProjectRequest) returns (pb.NewProjectResponse);\n */\n newProject(input: NewProjectRequest, options?: RpcOptions): UnaryCall<NewProjectRequest, NewProjectResponse> {\n const method = this.methods[0], opt = this._transport.mergeOptions(options);\n return stackIntercept<NewProjectRequest, NewProjectResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: DeleteProject(pb.DeleteProjectRequest) returns (pb.DeleteProjectResponse);\n */\n deleteProject(input: DeleteProjectRequest, options?: RpcOptions): UnaryCall<DeleteProjectRequest, DeleteProjectResponse> {\n const method = this.methods[1], opt = this._transport.mergeOptions(options);\n return stackIntercept<DeleteProjectRequest, DeleteProjectResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: ListProjects(pb.ListProjectsRequest) returns (pb.ListProjectsResponse);\n */\n listProjects(input: ListProjectsRequest, options?: RpcOptions): UnaryCall<ListProjectsRequest, ListProjectsResponse> {\n const method = this.methods[2], opt = this._transport.mergeOptions(options);\n return stackIntercept<ListProjectsRequest, ListProjectsResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: Get(pb.GetRequest) returns (stream pb.GetResponse);\n */\n get(input: GetRequest, options?: RpcOptions): ServerStreamingCall<GetRequest, GetResponse> {\n const method = this.methods[3], opt = this._transport.mergeOptions(options);\n return stackIntercept<GetRequest, GetResponse>(\"serverStreaming\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: GetCompress(pb.GetCompressRequest) returns (stream pb.GetCompressResponse);\n */\n getCompress(input: GetCompressRequest, options?: RpcOptions): ServerStreamingCall<GetCompressRequest, GetCompressResponse> {\n const method = this.methods[4], opt = this._transport.mergeOptions(options);\n return stackIntercept<GetCompressRequest, GetCompressResponse>(\"serverStreaming\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: GetUnary(pb.GetUnaryRequest) returns (pb.GetUnaryResponse);\n */\n getUnary(input: GetUnaryRequest, options?: RpcOptions): UnaryCall<GetUnaryRequest, GetUnaryResponse> {\n const method = this.methods[5], opt = this._transport.mergeOptions(options);\n return stackIntercept<GetUnaryRequest, GetUnaryResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: Update(stream pb.UpdateRequest) returns (pb.UpdateResponse);\n */\n update(options?: RpcOptions): ClientStreamingCall<UpdateRequest, UpdateResponse> {\n const method = this.methods[6], opt = this._transport.mergeOptions(options);\n return stackIntercept<UpdateRequest, UpdateResponse>(\"clientStreaming\", this._transport, method, opt);\n }\n /**\n * @generated from protobuf rpc: Rollback(pb.RollbackRequest) returns (pb.RollbackResponse);\n */\n rollback(input: RollbackRequest, options?: RpcOptions): UnaryCall<RollbackRequest, RollbackResponse> {\n const method = this.methods[7], opt = this._transport.mergeOptions(options);\n return stackIntercept<RollbackRequest, RollbackResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: Inspect(pb.InspectRequest) returns (pb.InspectResponse);\n */\n inspect(input: InspectRequest, options?: RpcOptions): UnaryCall<InspectRequest, InspectResponse> {\n const method = this.methods[8], opt = this._transport.mergeOptions(options);\n return stackIntercept<InspectRequest, InspectResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: Snapshot(pb.SnapshotRequest) returns (pb.SnapshotResponse);\n */\n snapshot(input: SnapshotRequest, options?: RpcOptions): UnaryCall<SnapshotRequest, SnapshotResponse> {\n const method = this.methods[9], opt = this._transport.mergeOptions(options);\n return stackIntercept<SnapshotRequest, SnapshotResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: Reset(pb.ResetRequest) returns (pb.ResetResponse);\n */\n reset(input: ResetRequest, options?: RpcOptions): UnaryCall<ResetRequest, ResetResponse> {\n const method = this.methods[10], opt = this._transport.mergeOptions(options);\n return stackIntercept<ResetRequest, ResetResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: GcProject(pb.GcProjectRequest) returns (pb.GcProjectResponse);\n */\n gcProject(input: GcProjectRequest, options?: RpcOptions): UnaryCall<GcProjectRequest, GcProjectResponse> {\n const method = this.methods[11], opt = this._transport.mergeOptions(options);\n return stackIntercept<GcProjectRequest, GcProjectResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: GcRandomProjects(pb.GcRandomProjectsRequest) returns (pb.GcRandomProjectsResponse);\n */\n gcRandomProjects(input: GcRandomProjectsRequest, options?: RpcOptions): UnaryCall<GcRandomProjectsRequest, GcRandomProjectsResponse> {\n const method = this.methods[12], opt = this._transport.mergeOptions(options);\n return stackIntercept<GcRandomProjectsRequest, GcRandomProjectsResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: GcContents(pb.GcContentsRequest) returns (pb.GcContentsResponse);\n */\n gcContents(input: GcContentsRequest, options?: RpcOptions): UnaryCall<GcContentsRequest, GcContentsResponse> {\n const method = this.methods[13], opt = this._transport.mergeOptions(options);\n return stackIntercept<GcContentsRequest, GcContentsResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: CloneToProject(pb.CloneToProjectRequest) returns (pb.CloneToProjectResponse);\n */\n cloneToProject(input: CloneToProjectRequest, options?: RpcOptions): UnaryCall<CloneToProjectRequest, CloneToProjectResponse> {\n const method = this.methods[14], opt = this._transport.mergeOptions(options);\n return stackIntercept<CloneToProjectRequest, CloneToProjectResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: GetCache(pb.GetCacheRequest) returns (stream pb.GetCacheResponse);\n */\n getCache(input: GetCacheRequest, options?: RpcOptions): ServerStreamingCall<GetCacheRequest, GetCacheResponse> {\n const method = this.methods[15], opt = this._transport.mergeOptions(options);\n return stackIntercept<GetCacheRequest, GetCacheResponse>(\"serverStreaming\", this._transport, method, opt, input);\n }\n}\n"]}
1
+ {"version":3,"file":"fs_pb.client.js","sourceRoot":"","sources":["../../../src/pb/fs_pb.client.ts"],"names":[],"mappings":";;;AAOA,mCAA6B;AAiC7B,0DAA0D;AA0E1D;;GAEG;AACH,MAAa,QAAQ;IAIjB,YAA6B,UAAwB;;;;;mBAAxB;;QAH7B;;;;mBAAW,UAAE,CAAC,QAAQ;WAAC;QACvB;;;;mBAAU,UAAE,CAAC,OAAO;WAAC;QACrB;;;;mBAAU,UAAE,CAAC,OAAO;WAAC;IAErB,CAAC;IACD;;OAEG;IACH,UAAU,CAAC,KAAwB,EAAE,OAAoB;QACrD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC5E,OAAO,IAAA,4BAAc,EAAwC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAC/G,CAAC;IACD;;OAEG;IACH,aAAa,CAAC,KAA2B,EAAE,OAAoB;QAC3D,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC5E,OAAO,IAAA,4BAAc,EAA8C,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACrH,CAAC;IACD;;OAEG;IACH,YAAY,CAAC,KAA0B,EAAE,OAAoB;QACzD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,YAA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QAC7E,OAAO,IAAA,4BAAc,EAAgD,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACvH,CAAC;IACD;;OAEG;IACH,QAAQ,CAAC,KAAsB,EAAE,OAAoB;QACjD,MAAM,MAAM,GAAG,IAAI,CAAC,OAAO,CAAC,EAAE,CAAC,EAAE,GAAG,GAAG,IAAI,CAAC,UAAU,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAC7E,OAAO,IAAA,4BAAc,EAAoC,iBAAiB,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IACrH,CAAC;CACJ;AAtHD,4BAsHC","sourcesContent":["/* eslint-disable */\n// @generated by protobuf-ts 2.9.2 with parameter long_type_bigint,ts_nocheck,eslint_disable,add_pb_suffix\n// @generated from protobuf file \"fs.proto\" (package \"pb\", syntax proto3)\n// tslint:disable\n// @ts-nocheck\nimport type { RpcTransport } from \"@protobuf-ts/runtime-rpc\";\nimport type { ServiceInfo } from \"@protobuf-ts/runtime-rpc\";\nimport { Fs } from \"./fs_pb\";\nimport type { GetCacheResponse } from \"./fs_pb\";\nimport type { GetCacheRequest } from \"./fs_pb\";\nimport type { CloneToProjectResponse } from \"./fs_pb\";\nimport type { CloneToProjectRequest } from \"./fs_pb\";\nimport type { GcContentsResponse } from \"./fs_pb\";\nimport type { GcContentsRequest } from \"./fs_pb\";\nimport type { GcRandomProjectsResponse } from \"./fs_pb\";\nimport type { GcRandomProjectsRequest } from \"./fs_pb\";\nimport type { GcProjectResponse } from \"./fs_pb\";\nimport type { GcProjectRequest } from \"./fs_pb\";\nimport type { ResetResponse } from \"./fs_pb\";\nimport type { ResetRequest } from \"./fs_pb\";\nimport type { SnapshotResponse } from \"./fs_pb\";\nimport type { SnapshotRequest } from \"./fs_pb\";\nimport type { InspectResponse } from \"./fs_pb\";\nimport type { InspectRequest } from \"./fs_pb\";\nimport type { RollbackResponse } from \"./fs_pb\";\nimport type { RollbackRequest } from \"./fs_pb\";\nimport type { UpdateResponse } from \"./fs_pb\";\nimport type { UpdateRequest } from \"./fs_pb\";\nimport type { ClientStreamingCall } from \"@protobuf-ts/runtime-rpc\";\nimport type { GetUnaryResponse } from \"./fs_pb\";\nimport type { GetUnaryRequest } from \"./fs_pb\";\nimport type { GetCompressResponse } from \"./fs_pb\";\nimport type { GetCompressRequest } from \"./fs_pb\";\nimport type { GetResponse } from \"./fs_pb\";\nimport type { GetRequest } from \"./fs_pb\";\nimport type { ServerStreamingCall } from \"@protobuf-ts/runtime-rpc\";\nimport type { ListProjectsResponse } from \"./fs_pb\";\nimport type { ListProjectsRequest } from \"./fs_pb\";\nimport type { DeleteProjectResponse } from \"./fs_pb\";\nimport type { DeleteProjectRequest } from \"./fs_pb\";\nimport { stackIntercept } from \"@protobuf-ts/runtime-rpc\";\nimport type { NewProjectResponse } from \"./fs_pb\";\nimport type { NewProjectRequest } from \"./fs_pb\";\nimport type { UnaryCall } from \"@protobuf-ts/runtime-rpc\";\nimport type { RpcOptions } from \"@protobuf-ts/runtime-rpc\";\n/**\n * @generated from protobuf service pb.Fs\n */\nexport interface IFsClient {\n /**\n * @generated from protobuf rpc: NewProject(pb.NewProjectRequest) returns (pb.NewProjectResponse);\n */\n newProject(input: NewProjectRequest, options?: RpcOptions): UnaryCall<NewProjectRequest, NewProjectResponse>;\n /**\n * @generated from protobuf rpc: DeleteProject(pb.DeleteProjectRequest) returns (pb.DeleteProjectResponse);\n */\n deleteProject(input: DeleteProjectRequest, options?: RpcOptions): UnaryCall<DeleteProjectRequest, DeleteProjectResponse>;\n /**\n * @generated from protobuf rpc: ListProjects(pb.ListProjectsRequest) returns (pb.ListProjectsResponse);\n */\n listProjects(input: ListProjectsRequest, options?: RpcOptions): UnaryCall<ListProjectsRequest, ListProjectsResponse>;\n /**\n * @generated from protobuf rpc: Get(pb.GetRequest) returns (stream pb.GetResponse);\n */\n get(input: GetRequest, options?: RpcOptions): ServerStreamingCall<GetRequest, GetResponse>;\n /**\n * @generated from protobuf rpc: GetCompress(pb.GetCompressRequest) returns (stream pb.GetCompressResponse);\n */\n getCompress(input: GetCompressRequest, options?: RpcOptions): ServerStreamingCall<GetCompressRequest, GetCompressResponse>;\n /**\n * @generated from protobuf rpc: GetUnary(pb.GetUnaryRequest) returns (pb.GetUnaryResponse);\n */\n getUnary(input: GetUnaryRequest, options?: RpcOptions): UnaryCall<GetUnaryRequest, GetUnaryResponse>;\n /**\n * @generated from protobuf rpc: Update(stream pb.UpdateRequest) returns (pb.UpdateResponse);\n */\n update(options?: RpcOptions): ClientStreamingCall<UpdateRequest, UpdateResponse>;\n /**\n * @generated from protobuf rpc: Rollback(pb.RollbackRequest) returns (pb.RollbackResponse);\n */\n rollback(input: RollbackRequest, options?: RpcOptions): UnaryCall<RollbackRequest, RollbackResponse>;\n /**\n * @generated from protobuf rpc: Inspect(pb.InspectRequest) returns (pb.InspectResponse);\n */\n inspect(input: InspectRequest, options?: RpcOptions): UnaryCall<InspectRequest, InspectResponse>;\n /**\n * @generated from protobuf rpc: Snapshot(pb.SnapshotRequest) returns (pb.SnapshotResponse);\n */\n snapshot(input: SnapshotRequest, options?: RpcOptions): UnaryCall<SnapshotRequest, SnapshotResponse>;\n /**\n * @generated from protobuf rpc: Reset(pb.ResetRequest) returns (pb.ResetResponse);\n */\n reset(input: ResetRequest, options?: RpcOptions): UnaryCall<ResetRequest, ResetResponse>;\n /**\n * @generated from protobuf rpc: GcProject(pb.GcProjectRequest) returns (pb.GcProjectResponse);\n */\n gcProject(input: GcProjectRequest, options?: RpcOptions): UnaryCall<GcProjectRequest, GcProjectResponse>;\n /**\n * @generated from protobuf rpc: GcRandomProjects(pb.GcRandomProjectsRequest) returns (pb.GcRandomProjectsResponse);\n */\n gcRandomProjects(input: GcRandomProjectsRequest, options?: RpcOptions): UnaryCall<GcRandomProjectsRequest, GcRandomProjectsResponse>;\n /**\n * @generated from protobuf rpc: GcContents(pb.GcContentsRequest) returns (pb.GcContentsResponse);\n */\n gcContents(input: GcContentsRequest, options?: RpcOptions): UnaryCall<GcContentsRequest, GcContentsResponse>;\n /**\n * @generated from protobuf rpc: CloneToProject(pb.CloneToProjectRequest) returns (pb.CloneToProjectResponse);\n */\n cloneToProject(input: CloneToProjectRequest, options?: RpcOptions): UnaryCall<CloneToProjectRequest, CloneToProjectResponse>;\n /**\n * @generated from protobuf rpc: GetCache(pb.GetCacheRequest) returns (stream pb.GetCacheResponse);\n */\n getCache(input: GetCacheRequest, options?: RpcOptions): ServerStreamingCall<GetCacheRequest, GetCacheResponse>;\n}\n/**\n * @generated from protobuf service pb.Fs\n */\nexport class FsClient implements IFsClient, ServiceInfo {\n typeName = Fs.typeName;\n methods = Fs.methods;\n options = Fs.options;\n constructor(private readonly _transport: RpcTransport) {\n }\n /**\n * @generated from protobuf rpc: NewProject(pb.NewProjectRequest) returns (pb.NewProjectResponse);\n */\n newProject(input: NewProjectRequest, options?: RpcOptions): UnaryCall<NewProjectRequest, NewProjectResponse> {\n const method = this.methods[0], opt = this._transport.mergeOptions(options);\n return stackIntercept<NewProjectRequest, NewProjectResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: DeleteProject(pb.DeleteProjectRequest) returns (pb.DeleteProjectResponse);\n */\n deleteProject(input: DeleteProjectRequest, options?: RpcOptions): UnaryCall<DeleteProjectRequest, DeleteProjectResponse> {\n const method = this.methods[1], opt = this._transport.mergeOptions(options);\n return stackIntercept<DeleteProjectRequest, DeleteProjectResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: ListProjects(pb.ListProjectsRequest) returns (pb.ListProjectsResponse);\n */\n listProjects(input: ListProjectsRequest, options?: RpcOptions): UnaryCall<ListProjectsRequest, ListProjectsResponse> {\n const method = this.methods[2], opt = this._transport.mergeOptions(options);\n return stackIntercept<ListProjectsRequest, ListProjectsResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: Get(pb.GetRequest) returns (stream pb.GetResponse);\n */\n get(input: GetRequest, options?: RpcOptions): ServerStreamingCall<GetRequest, GetResponse> {\n const method = this.methods[3], opt = this._transport.mergeOptions(options);\n return stackIntercept<GetRequest, GetResponse>(\"serverStreaming\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: GetCompress(pb.GetCompressRequest) returns (stream pb.GetCompressResponse);\n */\n getCompress(input: GetCompressRequest, options?: RpcOptions): ServerStreamingCall<GetCompressRequest, GetCompressResponse> {\n const method = this.methods[4], opt = this._transport.mergeOptions(options);\n return stackIntercept<GetCompressRequest, GetCompressResponse>(\"serverStreaming\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: GetUnary(pb.GetUnaryRequest) returns (pb.GetUnaryResponse);\n */\n getUnary(input: GetUnaryRequest, options?: RpcOptions): UnaryCall<GetUnaryRequest, GetUnaryResponse> {\n const method = this.methods[5], opt = this._transport.mergeOptions(options);\n return stackIntercept<GetUnaryRequest, GetUnaryResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: Update(stream pb.UpdateRequest) returns (pb.UpdateResponse);\n */\n update(options?: RpcOptions): ClientStreamingCall<UpdateRequest, UpdateResponse> {\n const method = this.methods[6], opt = this._transport.mergeOptions(options);\n return stackIntercept<UpdateRequest, UpdateResponse>(\"clientStreaming\", this._transport, method, opt);\n }\n /**\n * @generated from protobuf rpc: Rollback(pb.RollbackRequest) returns (pb.RollbackResponse);\n */\n rollback(input: RollbackRequest, options?: RpcOptions): UnaryCall<RollbackRequest, RollbackResponse> {\n const method = this.methods[7], opt = this._transport.mergeOptions(options);\n return stackIntercept<RollbackRequest, RollbackResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: Inspect(pb.InspectRequest) returns (pb.InspectResponse);\n */\n inspect(input: InspectRequest, options?: RpcOptions): UnaryCall<InspectRequest, InspectResponse> {\n const method = this.methods[8], opt = this._transport.mergeOptions(options);\n return stackIntercept<InspectRequest, InspectResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: Snapshot(pb.SnapshotRequest) returns (pb.SnapshotResponse);\n */\n snapshot(input: SnapshotRequest, options?: RpcOptions): UnaryCall<SnapshotRequest, SnapshotResponse> {\n const method = this.methods[9], opt = this._transport.mergeOptions(options);\n return stackIntercept<SnapshotRequest, SnapshotResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: Reset(pb.ResetRequest) returns (pb.ResetResponse);\n */\n reset(input: ResetRequest, options?: RpcOptions): UnaryCall<ResetRequest, ResetResponse> {\n const method = this.methods[10], opt = this._transport.mergeOptions(options);\n return stackIntercept<ResetRequest, ResetResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: GcProject(pb.GcProjectRequest) returns (pb.GcProjectResponse);\n */\n gcProject(input: GcProjectRequest, options?: RpcOptions): UnaryCall<GcProjectRequest, GcProjectResponse> {\n const method = this.methods[11], opt = this._transport.mergeOptions(options);\n return stackIntercept<GcProjectRequest, GcProjectResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: GcRandomProjects(pb.GcRandomProjectsRequest) returns (pb.GcRandomProjectsResponse);\n */\n gcRandomProjects(input: GcRandomProjectsRequest, options?: RpcOptions): UnaryCall<GcRandomProjectsRequest, GcRandomProjectsResponse> {\n const method = this.methods[12], opt = this._transport.mergeOptions(options);\n return stackIntercept<GcRandomProjectsRequest, GcRandomProjectsResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: GcContents(pb.GcContentsRequest) returns (pb.GcContentsResponse);\n */\n gcContents(input: GcContentsRequest, options?: RpcOptions): UnaryCall<GcContentsRequest, GcContentsResponse> {\n const method = this.methods[13], opt = this._transport.mergeOptions(options);\n return stackIntercept<GcContentsRequest, GcContentsResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: CloneToProject(pb.CloneToProjectRequest) returns (pb.CloneToProjectResponse);\n */\n cloneToProject(input: CloneToProjectRequest, options?: RpcOptions): UnaryCall<CloneToProjectRequest, CloneToProjectResponse> {\n const method = this.methods[14], opt = this._transport.mergeOptions(options);\n return stackIntercept<CloneToProjectRequest, CloneToProjectResponse>(\"unary\", this._transport, method, opt, input);\n }\n /**\n * @generated from protobuf rpc: GetCache(pb.GetCacheRequest) returns (stream pb.GetCacheResponse);\n */\n getCache(input: GetCacheRequest, options?: RpcOptions): ServerStreamingCall<GetCacheRequest, GetCacheResponse> {\n const method = this.methods[15], opt = this._transport.mergeOptions(options);\n return stackIntercept<GetCacheRequest, GetCacheResponse>(\"serverStreaming\", this._transport, method, opt, input);\n }\n}\n"]}