@gadgetinc/dateilager 0.5.9 → 0.5.11
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/cjs/grpc-client.d.ts +18 -1
- package/dist/cjs/grpc-client.js +30 -0
- package/dist/cjs/grpc-client.js.map +1 -1
- package/dist/cjs/pb/fs_pb.client.d.ts +10 -0
- package/dist/cjs/pb/fs_pb.client.js +16 -9
- package/dist/cjs/pb/fs_pb.client.js.map +1 -1
- package/dist/cjs/pb/fs_pb.d.ts +54 -0
- package/dist/cjs/pb/fs_pb.js +124 -1
- package/dist/cjs/pb/fs_pb.js.map +1 -1
- package/dist/esm/grpc-client.d.ts +18 -1
- package/dist/esm/grpc-client.js +30 -0
- package/dist/esm/grpc-client.js.map +1 -1
- package/dist/esm/pb/fs_pb.client.d.ts +10 -0
- package/dist/esm/pb/fs_pb.client.js +16 -9
- package/dist/esm/pb/fs_pb.client.js.map +1 -1
- package/dist/esm/pb/fs_pb.d.ts +54 -0
- package/dist/esm/pb/fs_pb.js +123 -0
- package/dist/esm/pb/fs_pb.js.map +1 -1
- package/package.json +1 -1
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ClientOptions } from "@grpc/grpc-js";
|
|
2
2
|
import type { Span } from "@opentelemetry/api";
|
|
3
3
|
import type { ClientStreamingCall, RpcOptions } from "@protobuf-ts/runtime-rpc";
|
|
4
|
-
import type { CloneToProjectResponse, Objekt, Project, UpdateRequest, UpdateResponse } from "./pb/fs_pb";
|
|
4
|
+
import type { CloneToProjectResponse, GetUnaryResponse, Objekt, Project, UpdateRequest, UpdateResponse } from "./pb/fs_pb";
|
|
5
5
|
export type { Objekt, Project };
|
|
6
6
|
/**
|
|
7
7
|
* Options for {@link DateiLagerGrpcClient}.
|
|
@@ -86,6 +86,23 @@ export declare class DateiLagerGrpcClient {
|
|
|
86
86
|
* }
|
|
87
87
|
*/
|
|
88
88
|
listObjects(project: bigint, path: string, ignores?: string[], from?: bigint, to?: bigint): AsyncGenerator<Objekt, void>;
|
|
89
|
+
/**
|
|
90
|
+
* Get objects.
|
|
91
|
+
*
|
|
92
|
+
* @param project The id of the project.
|
|
93
|
+
* @param path The path to get objects under.
|
|
94
|
+
* @param ignores The paths under {@link path} to ignore.
|
|
95
|
+
* @param from The project version to start from.
|
|
96
|
+
* @param to The project version to end at.
|
|
97
|
+
* @returns All the objects under {@link path}.
|
|
98
|
+
* @example
|
|
99
|
+
* const response = await client.getObjects(1n, "");
|
|
100
|
+
* for (const object of response.objects) {
|
|
101
|
+
* console.log("[getObjects] path: " + object.path);
|
|
102
|
+
* console.log("[getObjects] content:\n" + object.content);
|
|
103
|
+
* }
|
|
104
|
+
*/
|
|
105
|
+
getObjects(project: bigint, path: string, ignores?: string[], from?: bigint, to?: bigint): Promise<GetUnaryResponse>;
|
|
89
106
|
/**
|
|
90
107
|
* Get an object.
|
|
91
108
|
*
|
package/dist/cjs/grpc-client.js
CHANGED
|
@@ -149,6 +149,36 @@ class DateiLagerGrpcClient {
|
|
|
149
149
|
span.end();
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
|
+
/**
|
|
153
|
+
* Get objects.
|
|
154
|
+
*
|
|
155
|
+
* @param project The id of the project.
|
|
156
|
+
* @param path The path to get objects under.
|
|
157
|
+
* @param ignores The paths under {@link path} to ignore.
|
|
158
|
+
* @param from The project version to start from.
|
|
159
|
+
* @param to The project version to end at.
|
|
160
|
+
* @returns All the objects under {@link path}.
|
|
161
|
+
* @example
|
|
162
|
+
* const response = await client.getObjects(1n, "");
|
|
163
|
+
* for (const object of response.objects) {
|
|
164
|
+
* console.log("[getObjects] path: " + object.path);
|
|
165
|
+
* console.log("[getObjects] content:\n" + object.content);
|
|
166
|
+
* }
|
|
167
|
+
*/
|
|
168
|
+
async getObjects(project, path, ignores = [], from, to) {
|
|
169
|
+
return await (0, telemetry_1.trace)("dateilager-grpc-client.get-unary", {
|
|
170
|
+
attributes: {
|
|
171
|
+
"dl.project": String(project),
|
|
172
|
+
"dl.path": path,
|
|
173
|
+
"dl.ignores": ignores,
|
|
174
|
+
"dl.from_version": String(from),
|
|
175
|
+
"dl.to_version": String(to),
|
|
176
|
+
},
|
|
177
|
+
}, async () => {
|
|
178
|
+
const call = this._client.getUnary({ project, fromVersion: from, toVersion: to, queries: [{ path, ignores, isPrefix: true }] }, this._rpcOptions());
|
|
179
|
+
return await call.response;
|
|
180
|
+
});
|
|
181
|
+
}
|
|
152
182
|
/**
|
|
153
183
|
* Get an object.
|
|
154
184
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"grpc-client.js","sourceRoot":"","sources":["../../src/grpc-client.ts"],"names":[],"mappings":";;;AACA,2CAA0E;AAE1E,4CAA8E;AAC9E,gEAA4D;AAE5D,+BAAgD;AAChD,oDAAqD;AAErD,oDAA6C;AA6C7C;;;;;GAKG;AACH,MAAa,oBAAoB;IAU/B;;;;;OAKG;IACH,YAAmB,OAAoC;QAfvD,gBAAgB;QAChB;;;;;WAAmC;QAEnC,gBAAgB;QAChB;;;;;WAA2C;QAE3C,gBAAgB;QAChB;;;;;WAA2D;QASzD,MAAM,OAAO,GAAG,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,CAAC;QAEnH,IAAI,CAAC,UAAU,GAAG,IAAI,8BAAa,CAAC;YAClC,IAAI,EAAE,OAAO,OAAO,CAAC,MAAM,KAAK,QAAQ,CAAC,CAAC,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,CAAC,GAAG,OAAO,CAAC,MAAM,CAAC,IAAI,IAAI,OAAO,CAAC,MAAM,CAAC,IAAI,EAAE;YAC3G,kBAAkB,EAAE,qBAAW,CAAC,yBAAyB,CACvD,4BAAkB,CAAC,SAAS,EAAE,EAC9B,qBAAW,CAAC,2BAA2B,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ata } from \"@grpc/grpc-js\";\nimport type { Span } from \"@opentelemetry/api\";\nimport { context as contextAPI, trace as traceAPI } from \"@opentelemetry/api\";\nimport { GrpcTransport } from \"@protobuf-ts/grpc-transport\";\nimport type { ClientStreamingCall, RpcOptions } from \"@protobuf-ts/runtime-rpc\";\nimport { TextDecoder, TextEncoder } from \"util\";\nimport { trace, tracer } from \"./internal/telemetry\";\nimport type { CloneToProjectResponse, Objekt, Project, UpdateRequest, UpdateResponse } from \"./pb/fs_pb\";\nimport { FsClient } from \"./pb/fs_pb.client\";\n\nexport type { Objekt, Project };\n\n/**\n * Options for {@link DateiLagerGrpcClient}.\n */\nexport interface DateiLagerGrpcClientOptions {\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 * Options that will be passed to the underlying grpc client constructor.\n *\n * @see ClientOptions\n */\n grpcClientOptions?: ClientOptions;\n\n /**\n * Options that will be passed to every remote procedure call.\n *\n * @see RpcOptions\n */\n rpcOptions?: RpcOptions | (() => RpcOptions | undefined);\n}\n\n/**\n * A client class for interacting with DateiLager's GRPC API.\n *\n * The DateiLager API surface area is as minimal as possible;\n * convenience functions, such as getObject, should be implemented within the client.\n */\nexport class DateiLagerGrpcClient {\n /** @internal */\n private readonly _client: FsClient;\n\n /** @internal */\n private readonly _transport: GrpcTransport;\n\n /** @internal */\n private readonly _rpcOptions: () => RpcOptions | undefined;\n\n /**\n * The library used to interact with GRPC creates connections lazily, this constructor will not\n * raise an error even if there is no service running at {@link DateiLagerGrpcClientOptions.server server}.\n *\n * @param options Grpc client options.\n */\n public constructor(options: DateiLagerGrpcClientOptions) {\n const tokenFn = typeof options.token === \"string\" ? () => Promise.resolve(options.token as string) : options.token;\n\n this._transport = new GrpcTransport({\n host: typeof options.server === \"string\" ? options.server : `${options.server.host}:${options.server.port}`,\n channelCredentials: credentials.combineChannelCredentials(\n ChannelCredentials.createSsl(),\n credentials.createFromMetadataGenerator((_, callback) => {\n tokenFn()\n .then((token) => {\n const meta = new Metadata();\n meta.add(\"authorization\", `Bearer ${token}`);\n callback(null, meta);\n })\n .catch(callback);\n })\n ),\n clientOptions: {\n \"grpc.keepalive_time_ms\": 5_000,\n \"grpc.keepalive_timeout_ms\": 1_000,\n \"grpc.keepalive_permit_without_calls\": 1,\n ...options.grpcClientOptions,\n },\n });\n\n this._client = new FsClient(this._transport);\n\n this._rpcOptions = options.rpcOptions instanceof Function ? options.rpcOptions : () => options.rpcOptions as RpcOptions | undefined;\n }\n\n /**\n * Close the underlying GRPC client.\n */\n public close(): void {\n this._transport.close();\n }\n\n /**\n * Create a new project.\n *\n * @param project The id of the project.\n * @param packPatterns The paths to pack.\n * @param template The id of the project to start from.\n */\n public async newProject(project: bigint, packPatterns: string[], template?: bigint): Promise<void> {\n await trace(\n \"dateilager-grpc-client.new-project\",\n {\n attributes: {\n \"dl.project\": String(project),\n \"dl.pack_patterns\": packPatterns,\n \"dl.template\": String(template),\n },\n },\n () => this._client.newProject({ id: project, packPatterns, template }, this._rpcOptions())\n );\n }\n\n /**\n * Delete a project.\n *\n * @param project The id of the project.\n */\n public async deleteProject(project: bigint): Promise<void> {\n await trace(\n \"dateilager-grpc-client.delete-project\",\n {\n attributes: {\n \"dl.project\": String(project),\n },\n },\n () => this._client.deleteProject({ project }, this._rpcOptions())\n );\n }\n\n /**\n * List objects.\n *\n * @param project The id of the project.\n * @param path The path to list objects under.\n * @param ignores The paths under {@link path} to ignore.\n * @param from The project version to start from.\n * @param to The project version to end at.\n * @returns A stream of objects.\n * @yields An object from the stream.\n * @example\n * for await (const object of client.listObjects(1n, \"\")) {\n * console.log(\"[listObjects] path: \" + object.path);\n * console.log(\"[listObjects] content:\\n\" + object.content);\n * }\n */\n public async *listObjects(\n project: bigint,\n path: string,\n ignores: string[] = [],\n from?: bigint,\n to?: bigint\n ): AsyncGenerator<Objekt, void> {\n const parentContext = contextAPI.active();\n const span = tracer.startSpan(\n \"dateilager-grpc-client.list-objects\",\n {\n attributes: {\n \"dl.project\": String(project),\n \"dl.path\": path,\n \"dl.ignores\": ignores,\n \"dl.from_version\": String(from),\n \"dl.to_version\": String(to),\n },\n },\n parentContext\n );\n\n try {\n const call = contextAPI.with(traceAPI.setSpan(parentContext, span), () =>\n this._client.get(\n {\n project,\n fromVersion: from,\n toVersion: to,\n queries: [\n {\n path,\n ignores,\n isPrefix: true,\n },\n ],\n },\n this._rpcOptions()\n )\n );\n\n for await (const response of call.responses) {\n if (response.object) {\n yield response.object;\n }\n }\n\n await call.status;\n } finally {\n span.end();\n }\n }\n\n /**\n * Get an object.\n *\n * @param project The id of the project.\n * @param path The path of the object.\n * @returns The object at the given path or undefined if it does not exist.\n */\n public async getObject(project: bigint, path: string): Promise<Objekt | undefined> {\n return await trace(\n \"dateilager-grpc-client.get-object\",\n {\n attributes: {\n \"dl.project\": String(project),\n \"dl.path\": path,\n },\n },\n async () => {\n const call = this._client.get(\n {\n project,\n queries: [\n {\n path,\n isPrefix: false,\n ignores: [],\n },\n ],\n },\n this._rpcOptions()\n );\n\n let object: Objekt | undefined;\n for await (const response of call.responses) {\n object = response.object;\n }\n\n await call.status;\n\n return object;\n }\n );\n }\n\n /**\n * Update objects.\n *\n * @param project The id of the project.\n * @returns An {@link UpdateInputStream} to send objects to update.\n */\n public updateObjects(project: bigint): UpdateInputStream {\n const parentContext = contextAPI.active();\n const span = tracer.startSpan(\n \"dateilager-grpc-client.update-objects\",\n {\n attributes: {\n \"dl.project\": String(project),\n },\n },\n parentContext\n );\n\n const call = contextAPI.with(traceAPI.setSpan(parentContext, span), () => this._client.update(this._rpcOptions()));\n\n return new UpdateInputStream(project, call, span);\n }\n\n /**\n * Update an object.\n *\n * @param project The id of the project.\n * @param obj The object to update.\n * @returns The latest project version or `null` if something went wrong.\n */\n public async updateObject(project: bigint, obj: Objekt): Promise<bigint | null> {\n const stream = this.updateObjects(project);\n await stream.send(obj);\n return await stream.complete();\n }\n\n /**\n * Snapshot the current state of the dateilager server.\n *\n * @returns All the projects on the dateilager server.\n * @throws If the dateilager server's DL_ENV environment variable is PROD.\n * @see DateiLagerGrpcClient.resetToSnapshotInDevOrTests\n */\n public async snapshotInDevOrTests(): Promise<Project[]> {\n const call = await this._client.snapshot({}, this._rpcOptions());\n return call.response.projects;\n }\n\n /**\n * Reset the given projects to their respective versions and delete any remaining projects.\n * If no projects are provided, delete all projects.\n *\n * @param projects The projects to reset.\n * @throws If the dateilager server's DL_ENV environment variable is PROD.\n * @see DateiLagerGrpcClient.snapshotInDevOrTests\n */\n public async resetToSnapshotInDevOrTests(projects: Project[]): Promise<void> {\n await this._client.reset({ projects }, this._rpcOptions());\n }\n\n /**\n * Clones the `source` projects changes (from `fromVersion` up to `toVersion`) to the `target` project.\n * This method assumes that it is always a one way clone from source to target, it does not take into account\n * the changes that have occurred in the `target` project.\n *\n * @param source The source project.\n * @param target The target project.\n * @param version The version of the source project to clone up to.\n * @returns The new version number of the target project.\n */\n public async cloneToProject(source: bigint, target: bigint, version: bigint): Promise<CloneToProjectResponse> {\n return await trace(\n \"dateilager-grpc-client.clone-to-project\",\n {\n attributes: {\n \"dl.source\": String(source),\n \"dl.target\": String(target),\n \"dl.version\": String(version),\n },\n },\n async () => {\n const call = await this._client.cloneToProject({ source, target, version }, this._rpcOptions());\n return call.response;\n }\n );\n }\n\n /**\n * GC project.\n *\n * @param project The project to GC.\n * @param keep The amount of versions since the latest that should be kept.\n * @param from The starting version to GC from.\n * @returns The amount of objects that were GC'd.\n */\n public async gcProject(project: bigint, keep: bigint, from?: bigint): Promise<bigint> {\n const call = await this._client.gcProject({\n project: project,\n keepVersions: keep,\n fromVersion: from,\n });\n return call.response.count;\n }\n\n /**\n * GC random projects.\n *\n * @param sample The percentage of projects to sample from.\n * @param keep The amount of versions since the latest that should be kept.\n * @param from The starting version to GC from.\n * @returns The amount of objects that were GC'd.\n */\n public async gcRandomProjects(sample: number, keep: bigint, from?: bigint): Promise<bigint> {\n const call = await this._client.gcRandomProjects({\n sample: sample,\n keepVersions: keep,\n fromVersion: from,\n });\n return call.response.count;\n }\n\n /**\n * GC contents.\n *\n * @param sample The percentage of projects to sample from.\n * @returns The amount of objects that were GC'd.\n */\n public async gcContents(sample: number): Promise<bigint> {\n const call = await this._client.gcContents({\n sample: sample,\n });\n return call.response.count;\n }\n}\n\n/**\n * Used to send a stream of objects to update.\n *\n * @see DateiLagerGrpcClient.updateObjects\n */\nclass UpdateInputStream {\n /** @internal */\n private readonly _project: bigint;\n\n /** @internal */\n private readonly _call: ClientStreamingCall<UpdateRequest, UpdateResponse>;\n\n /** @internal */\n private readonly _span: Span;\n\n public constructor(project: bigint, call: ClientStreamingCall<UpdateRequest, UpdateResponse>, span: Span) {\n this._project = project;\n this._call = call;\n this._span = span;\n }\n\n /**\n * Send an object to update.\n *\n * @param obj The object to update.\n */\n public async send(obj: Objekt): Promise<void> {\n try {\n await this._call.requests.send({\n project: this._project,\n object: obj,\n });\n } catch (err) {\n this._span.end();\n throw err;\n }\n }\n\n /**\n * Complete the update request.\n *\n * @returns The latest project version or `null` if something went wrong.\n */\n public async complete(): Promise<bigint | null> {\n try {\n await this._call.requests.complete();\n const response = await this._call.response;\n return response.version != -1n ? response.version : null;\n } finally {\n this._span.end();\n }\n }\n}\n\nconst encoder = new TextEncoder();\n\n/**\n * Encode string object contents as an array of bytes.\n *\n * @param content The string to encode.\n * @returns The encoded content as an array of bytes.\n */\nexport function encodeContent(content: string): Uint8Array {\n return encoder.encode(content);\n}\n\nconst decoder = new TextDecoder();\n\n/**\n * Decode an array of bytes as an object's string contents.\n *\n * @param bytes The array of bytes to decode.\n * @returns The bytes decoded into a string.\n */\nexport function decodeContent(bytes: Uint8Array | undefined): string {\n return decoder.decode(bytes);\n}\n"]}
|
|
1
|
+
{"version":3,"file":"grpc-client.js","sourceRoot":"","sources":["../../src/grpc-client.ts"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3C,OAAO,OAAO,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC;AACjC,CAAC;AAFD,sCAEC;AAED,MAAM,OAAO,GAAG,IAAI,kBAAW,EAAE,CAAC;AAElC;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,KAA6B;IACzD,OAAO,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;AAC/B,CAAC;AAFD,sCAEC","sourcesContent":["import type { ClientOptions } from \"@grpc/grpc-js\";\nimport { ChannelCredentials, credentials, Metadata } from \"@grpc/grpc-js\";\nimport type { Span } from \"@opentelemetry/api\";\nimport { context as contextAPI, trace as traceAPI } from \"@opentelemetry/api\";\nimport { GrpcTransport } from \"@protobuf-ts/grpc-transport\";\nimport type { ClientStreamingCall, RpcOptions } from \"@protobuf-ts/runtime-rpc\";\nimport { TextDecoder, TextEncoder } from \"util\";\nimport { trace, tracer } from \"./internal/telemetry\";\nimport type { CloneToProjectResponse, GetUnaryResponse, Objekt, Project, UpdateRequest, UpdateResponse } from \"./pb/fs_pb\";\nimport { FsClient } from \"./pb/fs_pb.client\";\n\nexport type { Objekt, Project };\n\n/**\n * Options for {@link DateiLagerGrpcClient}.\n */\nexport interface DateiLagerGrpcClientOptions {\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 * Options that will be passed to the underlying grpc client constructor.\n *\n * @see ClientOptions\n */\n grpcClientOptions?: ClientOptions;\n\n /**\n * Options that will be passed to every remote procedure call.\n *\n * @see RpcOptions\n */\n rpcOptions?: RpcOptions | (() => RpcOptions | undefined);\n}\n\n/**\n * A client class for interacting with DateiLager's GRPC API.\n *\n * The DateiLager API surface area is as minimal as possible;\n * convenience functions, such as getObject, should be implemented within the client.\n */\nexport class DateiLagerGrpcClient {\n /** @internal */\n private readonly _client: FsClient;\n\n /** @internal */\n private readonly _transport: GrpcTransport;\n\n /** @internal */\n private readonly _rpcOptions: () => RpcOptions | undefined;\n\n /**\n * The library used to interact with GRPC creates connections lazily, this constructor will not\n * raise an error even if there is no service running at {@link DateiLagerGrpcClientOptions.server server}.\n *\n * @param options Grpc client options.\n */\n public constructor(options: DateiLagerGrpcClientOptions) {\n const tokenFn = typeof options.token === \"string\" ? () => Promise.resolve(options.token as string) : options.token;\n\n this._transport = new GrpcTransport({\n host: typeof options.server === \"string\" ? options.server : `${options.server.host}:${options.server.port}`,\n channelCredentials: credentials.combineChannelCredentials(\n ChannelCredentials.createSsl(),\n credentials.createFromMetadataGenerator((_, callback) => {\n tokenFn()\n .then((token) => {\n const meta = new Metadata();\n meta.add(\"authorization\", `Bearer ${token}`);\n callback(null, meta);\n })\n .catch(callback);\n })\n ),\n clientOptions: {\n \"grpc.keepalive_time_ms\": 5_000,\n \"grpc.keepalive_timeout_ms\": 1_000,\n \"grpc.keepalive_permit_without_calls\": 1,\n ...options.grpcClientOptions,\n },\n });\n\n this._client = new FsClient(this._transport);\n\n this._rpcOptions = options.rpcOptions instanceof Function ? options.rpcOptions : () => options.rpcOptions as RpcOptions | undefined;\n }\n\n /**\n * Close the underlying GRPC client.\n */\n public close(): void {\n this._transport.close();\n }\n\n /**\n * Create a new project.\n *\n * @param project The id of the project.\n * @param packPatterns The paths to pack.\n * @param template The id of the project to start from.\n */\n public async newProject(project: bigint, packPatterns: string[], template?: bigint): Promise<void> {\n await trace(\n \"dateilager-grpc-client.new-project\",\n {\n attributes: {\n \"dl.project\": String(project),\n \"dl.pack_patterns\": packPatterns,\n \"dl.template\": String(template),\n },\n },\n () => this._client.newProject({ id: project, packPatterns, template }, this._rpcOptions())\n );\n }\n\n /**\n * Delete a project.\n *\n * @param project The id of the project.\n */\n public async deleteProject(project: bigint): Promise<void> {\n await trace(\n \"dateilager-grpc-client.delete-project\",\n {\n attributes: {\n \"dl.project\": String(project),\n },\n },\n () => this._client.deleteProject({ project }, this._rpcOptions())\n );\n }\n\n /**\n * List objects.\n *\n * @param project The id of the project.\n * @param path The path to list objects under.\n * @param ignores The paths under {@link path} to ignore.\n * @param from The project version to start from.\n * @param to The project version to end at.\n * @returns A stream of objects.\n * @yields An object from the stream.\n * @example\n * for await (const object of client.listObjects(1n, \"\")) {\n * console.log(\"[listObjects] path: \" + object.path);\n * console.log(\"[listObjects] content:\\n\" + object.content);\n * }\n */\n public async *listObjects(\n project: bigint,\n path: string,\n ignores: string[] = [],\n from?: bigint,\n to?: bigint\n ): AsyncGenerator<Objekt, void> {\n const parentContext = contextAPI.active();\n const span = tracer.startSpan(\n \"dateilager-grpc-client.list-objects\",\n {\n attributes: {\n \"dl.project\": String(project),\n \"dl.path\": path,\n \"dl.ignores\": ignores,\n \"dl.from_version\": String(from),\n \"dl.to_version\": String(to),\n },\n },\n parentContext\n );\n\n try {\n const call = contextAPI.with(traceAPI.setSpan(parentContext, span), () =>\n this._client.get(\n {\n project,\n fromVersion: from,\n toVersion: to,\n queries: [\n {\n path,\n ignores,\n isPrefix: true,\n },\n ],\n },\n this._rpcOptions()\n )\n );\n\n for await (const response of call.responses) {\n if (response.object) {\n yield response.object;\n }\n }\n\n await call.status;\n } finally {\n span.end();\n }\n }\n\n /**\n * Get objects.\n *\n * @param project The id of the project.\n * @param path The path to get objects under.\n * @param ignores The paths under {@link path} to ignore.\n * @param from The project version to start from.\n * @param to The project version to end at.\n * @returns All the objects under {@link path}.\n * @example\n * const response = await client.getObjects(1n, \"\");\n * for (const object of response.objects) {\n * console.log(\"[getObjects] path: \" + object.path);\n * console.log(\"[getObjects] content:\\n\" + object.content);\n * }\n */\n public async getObjects(project: bigint, path: string, ignores: string[] = [], from?: bigint, to?: bigint): Promise<GetUnaryResponse> {\n return await trace(\n \"dateilager-grpc-client.get-unary\",\n {\n attributes: {\n \"dl.project\": String(project),\n \"dl.path\": path,\n \"dl.ignores\": ignores,\n \"dl.from_version\": String(from),\n \"dl.to_version\": String(to),\n },\n },\n async () => {\n const call = this._client.getUnary(\n { project, fromVersion: from, toVersion: to, queries: [{ path, ignores, isPrefix: true }] },\n this._rpcOptions()\n );\n return await call.response;\n }\n );\n }\n\n /**\n * Get an object.\n *\n * @param project The id of the project.\n * @param path The path of the object.\n * @returns The object at the given path or undefined if it does not exist.\n */\n public async getObject(project: bigint, path: string): Promise<Objekt | undefined> {\n return await trace(\n \"dateilager-grpc-client.get-object\",\n {\n attributes: {\n \"dl.project\": String(project),\n \"dl.path\": path,\n },\n },\n async () => {\n const call = this._client.get(\n {\n project,\n queries: [\n {\n path,\n isPrefix: false,\n ignores: [],\n },\n ],\n },\n this._rpcOptions()\n );\n\n let object: Objekt | undefined;\n for await (const response of call.responses) {\n object = response.object;\n }\n\n await call.status;\n\n return object;\n }\n );\n }\n\n /**\n * Update objects.\n *\n * @param project The id of the project.\n * @returns An {@link UpdateInputStream} to send objects to update.\n */\n public updateObjects(project: bigint): UpdateInputStream {\n const parentContext = contextAPI.active();\n const span = tracer.startSpan(\n \"dateilager-grpc-client.update-objects\",\n {\n attributes: {\n \"dl.project\": String(project),\n },\n },\n parentContext\n );\n\n const call = contextAPI.with(traceAPI.setSpan(parentContext, span), () => this._client.update(this._rpcOptions()));\n\n return new UpdateInputStream(project, call, span);\n }\n\n /**\n * Update an object.\n *\n * @param project The id of the project.\n * @param obj The object to update.\n * @returns The latest project version or `null` if something went wrong.\n */\n public async updateObject(project: bigint, obj: Objekt): Promise<bigint | null> {\n const stream = this.updateObjects(project);\n await stream.send(obj);\n return await stream.complete();\n }\n\n /**\n * Snapshot the current state of the dateilager server.\n *\n * @returns All the projects on the dateilager server.\n * @throws If the dateilager server's DL_ENV environment variable is PROD.\n * @see DateiLagerGrpcClient.resetToSnapshotInDevOrTests\n */\n public async snapshotInDevOrTests(): Promise<Project[]> {\n const call = await this._client.snapshot({}, this._rpcOptions());\n return call.response.projects;\n }\n\n /**\n * Reset the given projects to their respective versions and delete any remaining projects.\n * If no projects are provided, delete all projects.\n *\n * @param projects The projects to reset.\n * @throws If the dateilager server's DL_ENV environment variable is PROD.\n * @see DateiLagerGrpcClient.snapshotInDevOrTests\n */\n public async resetToSnapshotInDevOrTests(projects: Project[]): Promise<void> {\n await this._client.reset({ projects }, this._rpcOptions());\n }\n\n /**\n * Clones the `source` projects changes (from `fromVersion` up to `toVersion`) to the `target` project.\n * This method assumes that it is always a one way clone from source to target, it does not take into account\n * the changes that have occurred in the `target` project.\n *\n * @param source The source project.\n * @param target The target project.\n * @param version The version of the source project to clone up to.\n * @returns The new version number of the target project.\n */\n public async cloneToProject(source: bigint, target: bigint, version: bigint): Promise<CloneToProjectResponse> {\n return await trace(\n \"dateilager-grpc-client.clone-to-project\",\n {\n attributes: {\n \"dl.source\": String(source),\n \"dl.target\": String(target),\n \"dl.version\": String(version),\n },\n },\n async () => {\n const call = await this._client.cloneToProject({ source, target, version }, this._rpcOptions());\n return call.response;\n }\n );\n }\n\n /**\n * GC project.\n *\n * @param project The project to GC.\n * @param keep The amount of versions since the latest that should be kept.\n * @param from The starting version to GC from.\n * @returns The amount of objects that were GC'd.\n */\n public async gcProject(project: bigint, keep: bigint, from?: bigint): Promise<bigint> {\n const call = await this._client.gcProject({\n project: project,\n keepVersions: keep,\n fromVersion: from,\n });\n return call.response.count;\n }\n\n /**\n * GC random projects.\n *\n * @param sample The percentage of projects to sample from.\n * @param keep The amount of versions since the latest that should be kept.\n * @param from The starting version to GC from.\n * @returns The amount of objects that were GC'd.\n */\n public async gcRandomProjects(sample: number, keep: bigint, from?: bigint): Promise<bigint> {\n const call = await this._client.gcRandomProjects({\n sample: sample,\n keepVersions: keep,\n fromVersion: from,\n });\n return call.response.count;\n }\n\n /**\n * GC contents.\n *\n * @param sample The percentage of projects to sample from.\n * @returns The amount of objects that were GC'd.\n */\n public async gcContents(sample: number): Promise<bigint> {\n const call = await this._client.gcContents({\n sample: sample,\n });\n return call.response.count;\n }\n}\n\n/**\n * Used to send a stream of objects to update.\n *\n * @see DateiLagerGrpcClient.updateObjects\n */\nclass UpdateInputStream {\n /** @internal */\n private readonly _project: bigint;\n\n /** @internal */\n private readonly _call: ClientStreamingCall<UpdateRequest, UpdateResponse>;\n\n /** @internal */\n private readonly _span: Span;\n\n public constructor(project: bigint, call: ClientStreamingCall<UpdateRequest, UpdateResponse>, span: Span) {\n this._project = project;\n this._call = call;\n this._span = span;\n }\n\n /**\n * Send an object to update.\n *\n * @param obj The object to update.\n */\n public async send(obj: Objekt): Promise<void> {\n try {\n await this._call.requests.send({\n project: this._project,\n object: obj,\n });\n } catch (err) {\n this._span.end();\n throw err;\n }\n }\n\n /**\n * Complete the update request.\n *\n * @returns The latest project version or `null` if something went wrong.\n */\n public async complete(): Promise<bigint | null> {\n try {\n await this._call.requests.complete();\n const response = await this._call.response;\n return response.version != -1n ? response.version : null;\n } finally {\n this._span.end();\n }\n }\n}\n\nconst encoder = new TextEncoder();\n\n/**\n * Encode string object contents as an array of bytes.\n *\n * @param content The string to encode.\n * @returns The encoded content as an array of bytes.\n */\nexport function encodeContent(content: string): Uint8Array {\n return encoder.encode(content);\n}\n\nconst decoder = new TextDecoder();\n\n/**\n * Decode an array of bytes as an object's string contents.\n *\n * @param bytes The array of bytes to decode.\n * @returns The bytes decoded into a string.\n */\nexport function decodeContent(bytes: Uint8Array | undefined): string {\n return decoder.decode(bytes);\n}\n"]}
|
|
@@ -19,6 +19,8 @@ import type { InspectRequest } from "./fs_pb";
|
|
|
19
19
|
import type { UpdateResponse } from "./fs_pb";
|
|
20
20
|
import type { UpdateRequest } from "./fs_pb";
|
|
21
21
|
import type { ClientStreamingCall } from "@protobuf-ts/runtime-rpc";
|
|
22
|
+
import type { GetUnaryResponse } from "./fs_pb";
|
|
23
|
+
import type { GetUnaryRequest } from "./fs_pb";
|
|
22
24
|
import type { GetCompressResponse } from "./fs_pb";
|
|
23
25
|
import type { GetCompressRequest } from "./fs_pb";
|
|
24
26
|
import type { GetResponse } from "./fs_pb";
|
|
@@ -56,6 +58,10 @@ export interface IFsClient {
|
|
|
56
58
|
* @generated from protobuf rpc: GetCompress(pb.GetCompressRequest) returns (stream pb.GetCompressResponse);
|
|
57
59
|
*/
|
|
58
60
|
getCompress(input: GetCompressRequest, options?: RpcOptions): ServerStreamingCall<GetCompressRequest, GetCompressResponse>;
|
|
61
|
+
/**
|
|
62
|
+
* @generated from protobuf rpc: GetUnary(pb.GetUnaryRequest) returns (pb.GetUnaryResponse);
|
|
63
|
+
*/
|
|
64
|
+
getUnary(input: GetUnaryRequest, options?: RpcOptions): UnaryCall<GetUnaryRequest, GetUnaryResponse>;
|
|
59
65
|
/**
|
|
60
66
|
* @generated from protobuf rpc: Update(stream pb.UpdateRequest) returns (pb.UpdateResponse);
|
|
61
67
|
*/
|
|
@@ -124,6 +130,10 @@ export declare class FsClient implements IFsClient, ServiceInfo {
|
|
|
124
130
|
* @generated from protobuf rpc: GetCompress(pb.GetCompressRequest) returns (stream pb.GetCompressResponse);
|
|
125
131
|
*/
|
|
126
132
|
getCompress(input: GetCompressRequest, options?: RpcOptions): ServerStreamingCall<GetCompressRequest, GetCompressResponse>;
|
|
133
|
+
/**
|
|
134
|
+
* @generated from protobuf rpc: GetUnary(pb.GetUnaryRequest) returns (pb.GetUnaryResponse);
|
|
135
|
+
*/
|
|
136
|
+
getUnary(input: GetUnaryRequest, options?: RpcOptions): UnaryCall<GetUnaryRequest, GetUnaryResponse>;
|
|
127
137
|
/**
|
|
128
138
|
* @generated from protobuf rpc: Update(stream pb.UpdateRequest) returns (pb.UpdateResponse);
|
|
129
139
|
*/
|
|
@@ -68,67 +68,74 @@ class FsClient {
|
|
|
68
68
|
const method = this.methods[4], opt = this._transport.mergeOptions(options);
|
|
69
69
|
return (0, runtime_rpc_1.stackIntercept)("serverStreaming", this._transport, method, opt, input);
|
|
70
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* @generated from protobuf rpc: GetUnary(pb.GetUnaryRequest) returns (pb.GetUnaryResponse);
|
|
73
|
+
*/
|
|
74
|
+
getUnary(input, options) {
|
|
75
|
+
const method = this.methods[5], opt = this._transport.mergeOptions(options);
|
|
76
|
+
return (0, runtime_rpc_1.stackIntercept)("unary", this._transport, method, opt, input);
|
|
77
|
+
}
|
|
71
78
|
/**
|
|
72
79
|
* @generated from protobuf rpc: Update(stream pb.UpdateRequest) returns (pb.UpdateResponse);
|
|
73
80
|
*/
|
|
74
81
|
update(options) {
|
|
75
|
-
const method = this.methods[
|
|
82
|
+
const method = this.methods[6], opt = this._transport.mergeOptions(options);
|
|
76
83
|
return (0, runtime_rpc_1.stackIntercept)("clientStreaming", this._transport, method, opt);
|
|
77
84
|
}
|
|
78
85
|
/**
|
|
79
86
|
* @generated from protobuf rpc: Inspect(pb.InspectRequest) returns (pb.InspectResponse);
|
|
80
87
|
*/
|
|
81
88
|
inspect(input, options) {
|
|
82
|
-
const method = this.methods[
|
|
89
|
+
const method = this.methods[7], opt = this._transport.mergeOptions(options);
|
|
83
90
|
return (0, runtime_rpc_1.stackIntercept)("unary", this._transport, method, opt, input);
|
|
84
91
|
}
|
|
85
92
|
/**
|
|
86
93
|
* @generated from protobuf rpc: Snapshot(pb.SnapshotRequest) returns (pb.SnapshotResponse);
|
|
87
94
|
*/
|
|
88
95
|
snapshot(input, options) {
|
|
89
|
-
const method = this.methods[
|
|
96
|
+
const method = this.methods[8], opt = this._transport.mergeOptions(options);
|
|
90
97
|
return (0, runtime_rpc_1.stackIntercept)("unary", this._transport, method, opt, input);
|
|
91
98
|
}
|
|
92
99
|
/**
|
|
93
100
|
* @generated from protobuf rpc: Reset(pb.ResetRequest) returns (pb.ResetResponse);
|
|
94
101
|
*/
|
|
95
102
|
reset(input, options) {
|
|
96
|
-
const method = this.methods[
|
|
103
|
+
const method = this.methods[9], opt = this._transport.mergeOptions(options);
|
|
97
104
|
return (0, runtime_rpc_1.stackIntercept)("unary", this._transport, method, opt, input);
|
|
98
105
|
}
|
|
99
106
|
/**
|
|
100
107
|
* @generated from protobuf rpc: GcProject(pb.GcProjectRequest) returns (pb.GcProjectResponse);
|
|
101
108
|
*/
|
|
102
109
|
gcProject(input, options) {
|
|
103
|
-
const method = this.methods[
|
|
110
|
+
const method = this.methods[10], opt = this._transport.mergeOptions(options);
|
|
104
111
|
return (0, runtime_rpc_1.stackIntercept)("unary", this._transport, method, opt, input);
|
|
105
112
|
}
|
|
106
113
|
/**
|
|
107
114
|
* @generated from protobuf rpc: GcRandomProjects(pb.GcRandomProjectsRequest) returns (pb.GcRandomProjectsResponse);
|
|
108
115
|
*/
|
|
109
116
|
gcRandomProjects(input, options) {
|
|
110
|
-
const method = this.methods[
|
|
117
|
+
const method = this.methods[11], opt = this._transport.mergeOptions(options);
|
|
111
118
|
return (0, runtime_rpc_1.stackIntercept)("unary", this._transport, method, opt, input);
|
|
112
119
|
}
|
|
113
120
|
/**
|
|
114
121
|
* @generated from protobuf rpc: GcContents(pb.GcContentsRequest) returns (pb.GcContentsResponse);
|
|
115
122
|
*/
|
|
116
123
|
gcContents(input, options) {
|
|
117
|
-
const method = this.methods[
|
|
124
|
+
const method = this.methods[12], opt = this._transport.mergeOptions(options);
|
|
118
125
|
return (0, runtime_rpc_1.stackIntercept)("unary", this._transport, method, opt, input);
|
|
119
126
|
}
|
|
120
127
|
/**
|
|
121
128
|
* @generated from protobuf rpc: CloneToProject(pb.CloneToProjectRequest) returns (pb.CloneToProjectResponse);
|
|
122
129
|
*/
|
|
123
130
|
cloneToProject(input, options) {
|
|
124
|
-
const method = this.methods[
|
|
131
|
+
const method = this.methods[13], opt = this._transport.mergeOptions(options);
|
|
125
132
|
return (0, runtime_rpc_1.stackIntercept)("unary", this._transport, method, opt, input);
|
|
126
133
|
}
|
|
127
134
|
/**
|
|
128
135
|
* @generated from protobuf rpc: GetCache(pb.GetCacheRequest) returns (stream pb.GetCacheResponse);
|
|
129
136
|
*/
|
|
130
137
|
getCache(input, options) {
|
|
131
|
-
const method = this.methods[
|
|
138
|
+
const method = this.methods[14], opt = this._transport.mergeOptions(options);
|
|
132
139
|
return (0, runtime_rpc_1.stackIntercept)("serverStreaming", this._transport, method, opt, input);
|
|
133
140
|
}
|
|
134
141
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"fs_pb.client.js","sourceRoot":"","sources":["../../../src/pb/fs_pb.client.ts"],"names":[],"mappings":";;;AAOA,mCAA6B;AA6B7B,0DAA0D;AAkE1D;;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,YAAY,CAAC,OAAO,CAAC,CAAC;QAC5E,OA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AAO,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAC3H,CAAC;IACD;;OAEG;IACH,UAAU,CAAC,KAAwB,EAAE,OAAoB;QACrD,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,EAAwC,OAAO,EAAE,IAAI,CAAC,UAAU,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,CAAC,CAAC;IAC/G,CAAC;IACD;;OAEG;IACH,cAAc,CAAC,KAA4B,EAAE,OAAoB;QAC7D,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,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;AAxGD,4BAwGC","sourcesContent":["/* eslint-disable */\n// @generated by protobuf-ts 2.8.1 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 { UpdateResponse } from \"./fs_pb\";\nimport type { UpdateRequest } from \"./fs_pb\";\nimport type { ClientStreamingCall } from \"@protobuf-ts/runtime-rpc\";\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: Update(stream pb.UpdateRequest) returns (pb.UpdateResponse);\n */\n update(options?: RpcOptions): ClientStreamingCall<UpdateRequest, UpdateResponse>;\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: Update(stream pb.UpdateRequest) returns (pb.UpdateResponse);\n */\n update(options?: RpcOptions): ClientStreamingCall<UpdateRequest, UpdateResponse> {\n const method = this.methods[5], opt = this._transport.mergeOptions(options);\n return stackIntercept<UpdateRequest, UpdateResponse>(\"clientStreaming\", this._transport, method, opt);\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[6], 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[7], 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[8], 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[9], 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[10], 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[11], 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[12], 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[13], 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;AA+B7B,0DAA0D;AAsE1D;;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,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E,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;AA/GD,4BA+GC","sourcesContent":["/* eslint-disable */\n// @generated by protobuf-ts 2.8.1 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 { 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: 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: Inspect(pb.InspectRequest) returns (pb.InspectResponse);\n */\n inspect(input: InspectRequest, options?: RpcOptions): UnaryCall<InspectRequest, InspectResponse> {\n const method = this.methods[7], 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[8], 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[9], 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[10], 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[11], 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[12], 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[13], 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[14], opt = this._transport.mergeOptions(options);\n return stackIntercept<GetCacheRequest, GetCacheResponse>(\"serverStreaming\", this._transport, method, opt, input);\n }\n}\n"]}
|
package/dist/cjs/pb/fs_pb.d.ts
CHANGED
|
@@ -201,6 +201,40 @@ export declare enum GetCompressResponse_Format {
|
|
|
201
201
|
*/
|
|
202
202
|
S2_TAR = 0
|
|
203
203
|
}
|
|
204
|
+
/**
|
|
205
|
+
* @generated from protobuf message pb.GetUnaryRequest
|
|
206
|
+
*/
|
|
207
|
+
export interface GetUnaryRequest {
|
|
208
|
+
/**
|
|
209
|
+
* @generated from protobuf field: int64 project = 1;
|
|
210
|
+
*/
|
|
211
|
+
project: bigint;
|
|
212
|
+
/**
|
|
213
|
+
* @generated from protobuf field: optional int64 from_version = 2;
|
|
214
|
+
*/
|
|
215
|
+
fromVersion?: bigint;
|
|
216
|
+
/**
|
|
217
|
+
* @generated from protobuf field: optional int64 to_version = 3;
|
|
218
|
+
*/
|
|
219
|
+
toVersion?: bigint;
|
|
220
|
+
/**
|
|
221
|
+
* @generated from protobuf field: repeated pb.ObjectQuery queries = 4;
|
|
222
|
+
*/
|
|
223
|
+
queries: ObjectQuery[];
|
|
224
|
+
}
|
|
225
|
+
/**
|
|
226
|
+
* @generated from protobuf message pb.GetUnaryResponse
|
|
227
|
+
*/
|
|
228
|
+
export interface GetUnaryResponse {
|
|
229
|
+
/**
|
|
230
|
+
* @generated from protobuf field: int64 version = 1;
|
|
231
|
+
*/
|
|
232
|
+
version: bigint;
|
|
233
|
+
/**
|
|
234
|
+
* @generated from protobuf field: repeated pb.Objekt objects = 2;
|
|
235
|
+
*/
|
|
236
|
+
objects: Objekt[];
|
|
237
|
+
}
|
|
204
238
|
/**
|
|
205
239
|
* @generated from protobuf message pb.UpdateRequest
|
|
206
240
|
*/
|
|
@@ -550,6 +584,26 @@ declare class GetCompressResponse$Type extends MessageType<GetCompressResponse>
|
|
|
550
584
|
* @generated MessageType for protobuf message pb.GetCompressResponse
|
|
551
585
|
*/
|
|
552
586
|
export declare const GetCompressResponse: GetCompressResponse$Type;
|
|
587
|
+
declare class GetUnaryRequest$Type extends MessageType<GetUnaryRequest> {
|
|
588
|
+
constructor();
|
|
589
|
+
create(value?: PartialMessage<GetUnaryRequest>): GetUnaryRequest;
|
|
590
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUnaryRequest): GetUnaryRequest;
|
|
591
|
+
internalBinaryWrite(message: GetUnaryRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
592
|
+
}
|
|
593
|
+
/**
|
|
594
|
+
* @generated MessageType for protobuf message pb.GetUnaryRequest
|
|
595
|
+
*/
|
|
596
|
+
export declare const GetUnaryRequest: GetUnaryRequest$Type;
|
|
597
|
+
declare class GetUnaryResponse$Type extends MessageType<GetUnaryResponse> {
|
|
598
|
+
constructor();
|
|
599
|
+
create(value?: PartialMessage<GetUnaryResponse>): GetUnaryResponse;
|
|
600
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetUnaryResponse): GetUnaryResponse;
|
|
601
|
+
internalBinaryWrite(message: GetUnaryResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
602
|
+
}
|
|
603
|
+
/**
|
|
604
|
+
* @generated MessageType for protobuf message pb.GetUnaryResponse
|
|
605
|
+
*/
|
|
606
|
+
export declare const GetUnaryResponse: GetUnaryResponse$Type;
|
|
553
607
|
declare class UpdateRequest$Type extends MessageType<UpdateRequest> {
|
|
554
608
|
constructor();
|
|
555
609
|
create(value?: PartialMessage<UpdateRequest>): UpdateRequest;
|
package/dist/cjs/pb/fs_pb.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.Fs = exports.GetCacheResponse = exports.GetCacheRequest = exports.CloneToProjectResponse = exports.CloneToProjectRequest = exports.GcContentsResponse = exports.GcContentsRequest = exports.GcRandomProjectsResponse = exports.GcRandomProjectsRequest = exports.GcProjectResponse = exports.GcProjectRequest = exports.ResetResponse = exports.ResetRequest = exports.SnapshotResponse = exports.SnapshotRequest = exports.InspectResponse = exports.InspectRequest = exports.UpdateResponse = exports.UpdateRequest = exports.GetCompressResponse = exports.GetCompressRequest = exports.GetResponse = exports.GetRequest = exports.ObjectQuery = exports.Objekt = exports.ListProjectsResponse = exports.ListProjectsRequest = exports.Project = exports.DeleteProjectResponse = exports.DeleteProjectRequest = exports.NewProjectResponse = exports.NewProjectRequest = exports.GetCacheResponse_Format = exports.GetCompressResponse_Format = void 0;
|
|
3
|
+
exports.Fs = exports.GetCacheResponse = exports.GetCacheRequest = exports.CloneToProjectResponse = exports.CloneToProjectRequest = exports.GcContentsResponse = exports.GcContentsRequest = exports.GcRandomProjectsResponse = exports.GcRandomProjectsRequest = exports.GcProjectResponse = exports.GcProjectRequest = exports.ResetResponse = exports.ResetRequest = exports.SnapshotResponse = exports.SnapshotRequest = exports.InspectResponse = exports.InspectRequest = exports.UpdateResponse = exports.UpdateRequest = exports.GetUnaryResponse = exports.GetUnaryRequest = exports.GetCompressResponse = exports.GetCompressRequest = exports.GetResponse = exports.GetRequest = exports.ObjectQuery = exports.Objekt = exports.ListProjectsResponse = exports.ListProjectsRequest = exports.Project = exports.DeleteProjectResponse = exports.DeleteProjectRequest = exports.NewProjectResponse = exports.NewProjectRequest = exports.GetCacheResponse_Format = exports.GetCompressResponse_Format = void 0;
|
|
4
4
|
/* eslint-disable */
|
|
5
5
|
// @generated by protobuf-ts 2.8.1 with parameter long_type_bigint,ts_nocheck,eslint_disable,add_pb_suffix
|
|
6
6
|
// @generated from protobuf file "fs.proto" (package "pb", syntax proto3)
|
|
@@ -729,6 +729,128 @@ class GetCompressResponse$Type extends runtime_5.MessageType {
|
|
|
729
729
|
*/
|
|
730
730
|
exports.GetCompressResponse = new GetCompressResponse$Type();
|
|
731
731
|
// @generated message type with reflection information, may provide speed optimized methods
|
|
732
|
+
class GetUnaryRequest$Type extends runtime_5.MessageType {
|
|
733
|
+
constructor() {
|
|
734
|
+
super("pb.GetUnaryRequest", [
|
|
735
|
+
{ no: 1, name: "project", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
|
|
736
|
+
{ no: 2, name: "from_version", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
|
|
737
|
+
{ no: 3, name: "to_version", kind: "scalar", opt: true, T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
|
|
738
|
+
{ no: 4, name: "queries", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => exports.ObjectQuery }
|
|
739
|
+
]);
|
|
740
|
+
}
|
|
741
|
+
create(value) {
|
|
742
|
+
const message = { project: 0n, queries: [] };
|
|
743
|
+
globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this });
|
|
744
|
+
if (value !== undefined)
|
|
745
|
+
(0, runtime_3.reflectionMergePartial)(this, message, value);
|
|
746
|
+
return message;
|
|
747
|
+
}
|
|
748
|
+
internalBinaryRead(reader, length, options, target) {
|
|
749
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
750
|
+
while (reader.pos < end) {
|
|
751
|
+
let [fieldNo, wireType] = reader.tag();
|
|
752
|
+
switch (fieldNo) {
|
|
753
|
+
case /* int64 project */ 1:
|
|
754
|
+
message.project = reader.int64().toBigInt();
|
|
755
|
+
break;
|
|
756
|
+
case /* optional int64 from_version */ 2:
|
|
757
|
+
message.fromVersion = reader.int64().toBigInt();
|
|
758
|
+
break;
|
|
759
|
+
case /* optional int64 to_version */ 3:
|
|
760
|
+
message.toVersion = reader.int64().toBigInt();
|
|
761
|
+
break;
|
|
762
|
+
case /* repeated pb.ObjectQuery queries */ 4:
|
|
763
|
+
message.queries.push(exports.ObjectQuery.internalBinaryRead(reader, reader.uint32(), options));
|
|
764
|
+
break;
|
|
765
|
+
default:
|
|
766
|
+
let u = options.readUnknownField;
|
|
767
|
+
if (u === "throw")
|
|
768
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
769
|
+
let d = reader.skip(wireType);
|
|
770
|
+
if (u !== false)
|
|
771
|
+
(u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
772
|
+
}
|
|
773
|
+
}
|
|
774
|
+
return message;
|
|
775
|
+
}
|
|
776
|
+
internalBinaryWrite(message, writer, options) {
|
|
777
|
+
/* int64 project = 1; */
|
|
778
|
+
if (message.project !== 0n)
|
|
779
|
+
writer.tag(1, runtime_1.WireType.Varint).int64(message.project);
|
|
780
|
+
/* optional int64 from_version = 2; */
|
|
781
|
+
if (message.fromVersion !== undefined)
|
|
782
|
+
writer.tag(2, runtime_1.WireType.Varint).int64(message.fromVersion);
|
|
783
|
+
/* optional int64 to_version = 3; */
|
|
784
|
+
if (message.toVersion !== undefined)
|
|
785
|
+
writer.tag(3, runtime_1.WireType.Varint).int64(message.toVersion);
|
|
786
|
+
/* repeated pb.ObjectQuery queries = 4; */
|
|
787
|
+
for (let i = 0; i < message.queries.length; i++)
|
|
788
|
+
exports.ObjectQuery.internalBinaryWrite(message.queries[i], writer.tag(4, runtime_1.WireType.LengthDelimited).fork(), options).join();
|
|
789
|
+
let u = options.writeUnknownFields;
|
|
790
|
+
if (u !== false)
|
|
791
|
+
(u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
792
|
+
return writer;
|
|
793
|
+
}
|
|
794
|
+
}
|
|
795
|
+
/**
|
|
796
|
+
* @generated MessageType for protobuf message pb.GetUnaryRequest
|
|
797
|
+
*/
|
|
798
|
+
exports.GetUnaryRequest = new GetUnaryRequest$Type();
|
|
799
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
800
|
+
class GetUnaryResponse$Type extends runtime_5.MessageType {
|
|
801
|
+
constructor() {
|
|
802
|
+
super("pb.GetUnaryResponse", [
|
|
803
|
+
{ no: 1, name: "version", kind: "scalar", T: 3 /*ScalarType.INT64*/, L: 0 /*LongType.BIGINT*/ },
|
|
804
|
+
{ no: 2, name: "objects", kind: "message", repeat: 1 /*RepeatType.PACKED*/, T: () => exports.Objekt }
|
|
805
|
+
]);
|
|
806
|
+
}
|
|
807
|
+
create(value) {
|
|
808
|
+
const message = { version: 0n, objects: [] };
|
|
809
|
+
globalThis.Object.defineProperty(message, runtime_4.MESSAGE_TYPE, { enumerable: false, value: this });
|
|
810
|
+
if (value !== undefined)
|
|
811
|
+
(0, runtime_3.reflectionMergePartial)(this, message, value);
|
|
812
|
+
return message;
|
|
813
|
+
}
|
|
814
|
+
internalBinaryRead(reader, length, options, target) {
|
|
815
|
+
let message = target ?? this.create(), end = reader.pos + length;
|
|
816
|
+
while (reader.pos < end) {
|
|
817
|
+
let [fieldNo, wireType] = reader.tag();
|
|
818
|
+
switch (fieldNo) {
|
|
819
|
+
case /* int64 version */ 1:
|
|
820
|
+
message.version = reader.int64().toBigInt();
|
|
821
|
+
break;
|
|
822
|
+
case /* repeated pb.Objekt objects */ 2:
|
|
823
|
+
message.objects.push(exports.Objekt.internalBinaryRead(reader, reader.uint32(), options));
|
|
824
|
+
break;
|
|
825
|
+
default:
|
|
826
|
+
let u = options.readUnknownField;
|
|
827
|
+
if (u === "throw")
|
|
828
|
+
throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);
|
|
829
|
+
let d = reader.skip(wireType);
|
|
830
|
+
if (u !== false)
|
|
831
|
+
(u === true ? runtime_2.UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);
|
|
832
|
+
}
|
|
833
|
+
}
|
|
834
|
+
return message;
|
|
835
|
+
}
|
|
836
|
+
internalBinaryWrite(message, writer, options) {
|
|
837
|
+
/* int64 version = 1; */
|
|
838
|
+
if (message.version !== 0n)
|
|
839
|
+
writer.tag(1, runtime_1.WireType.Varint).int64(message.version);
|
|
840
|
+
/* repeated pb.Objekt objects = 2; */
|
|
841
|
+
for (let i = 0; i < message.objects.length; i++)
|
|
842
|
+
exports.Objekt.internalBinaryWrite(message.objects[i], writer.tag(2, runtime_1.WireType.LengthDelimited).fork(), options).join();
|
|
843
|
+
let u = options.writeUnknownFields;
|
|
844
|
+
if (u !== false)
|
|
845
|
+
(u == true ? runtime_2.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
|
|
846
|
+
return writer;
|
|
847
|
+
}
|
|
848
|
+
}
|
|
849
|
+
/**
|
|
850
|
+
* @generated MessageType for protobuf message pb.GetUnaryResponse
|
|
851
|
+
*/
|
|
852
|
+
exports.GetUnaryResponse = new GetUnaryResponse$Type();
|
|
853
|
+
// @generated message type with reflection information, may provide speed optimized methods
|
|
732
854
|
class UpdateRequest$Type extends runtime_5.MessageType {
|
|
733
855
|
constructor() {
|
|
734
856
|
super("pb.UpdateRequest", [
|
|
@@ -1633,6 +1755,7 @@ exports.Fs = new runtime_rpc_1.ServiceType("pb.Fs", [
|
|
|
1633
1755
|
{ name: "ListProjects", options: {}, I: exports.ListProjectsRequest, O: exports.ListProjectsResponse },
|
|
1634
1756
|
{ name: "Get", serverStreaming: true, options: {}, I: exports.GetRequest, O: exports.GetResponse },
|
|
1635
1757
|
{ name: "GetCompress", serverStreaming: true, options: {}, I: exports.GetCompressRequest, O: exports.GetCompressResponse },
|
|
1758
|
+
{ name: "GetUnary", options: {}, I: exports.GetUnaryRequest, O: exports.GetUnaryResponse },
|
|
1636
1759
|
{ name: "Update", clientStreaming: true, options: {}, I: exports.UpdateRequest, O: exports.UpdateResponse },
|
|
1637
1760
|
{ name: "Inspect", options: {}, I: exports.InspectRequest, O: exports.InspectResponse },
|
|
1638
1761
|
{ name: "Snapshot", options: {}, I: exports.SnapshotRequest, O: exports.SnapshotResponse },
|