@gadgetinc/dateilager 0.3.2 → 0.3.4
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 +3 -4
- package/dist/cjs/grpc-client.js +5 -9
- 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 +7 -0
- package/dist/cjs/pb/fs_pb.client.js.map +1 -1
- package/dist/cjs/pb/fs_pb.d.ts +62 -11
- package/dist/cjs/pb/fs_pb.js +136 -30
- package/dist/cjs/pb/fs_pb.js.map +1 -1
- package/dist/esm/grpc-client.d.ts +3 -4
- package/dist/esm/grpc-client.js +5 -9
- 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 +7 -0
- package/dist/esm/pb/fs_pb.client.js.map +1 -1
- package/dist/esm/pb/fs_pb.d.ts +62 -11
- package/dist/esm/pb/fs_pb.js +135 -29
- package/dist/esm/pb/fs_pb.js.map +1 -1
- package/package.json +1 -1
|
@@ -133,11 +133,10 @@ export declare class DateiLagerGrpcClient {
|
|
|
133
133
|
*
|
|
134
134
|
* @param source The source project.
|
|
135
135
|
* @param target The target project.
|
|
136
|
-
* @param
|
|
137
|
-
* @
|
|
138
|
-
* @returns The new version number of the target project
|
|
136
|
+
* @param version The version of the source project to clone up to.
|
|
137
|
+
* @returns The new version number of the target project
|
|
139
138
|
*/
|
|
140
|
-
cloneToProject(source: bigint, target: bigint,
|
|
139
|
+
cloneToProject(source: bigint, target: bigint, version: bigint): Promise<CloneToProjectResponse>;
|
|
141
140
|
}
|
|
142
141
|
/**
|
|
143
142
|
* Used to send a stream of objects to update.
|
package/dist/cjs/grpc-client.js
CHANGED
|
@@ -130,7 +130,6 @@ class DateiLagerGrpcClient {
|
|
|
130
130
|
path,
|
|
131
131
|
ignores,
|
|
132
132
|
isPrefix: true,
|
|
133
|
-
withContent: true,
|
|
134
133
|
},
|
|
135
134
|
],
|
|
136
135
|
}, this._rpcOptions()));
|
|
@@ -165,7 +164,6 @@ class DateiLagerGrpcClient {
|
|
|
165
164
|
{
|
|
166
165
|
path,
|
|
167
166
|
isPrefix: false,
|
|
168
|
-
withContent: true,
|
|
169
167
|
ignores: [],
|
|
170
168
|
},
|
|
171
169
|
],
|
|
@@ -235,20 +233,18 @@ class DateiLagerGrpcClient {
|
|
|
235
233
|
*
|
|
236
234
|
* @param source The source project.
|
|
237
235
|
* @param target The target project.
|
|
238
|
-
* @param
|
|
239
|
-
* @
|
|
240
|
-
* @returns The new version number of the target project
|
|
236
|
+
* @param version The version of the source project to clone up to.
|
|
237
|
+
* @returns The new version number of the target project
|
|
241
238
|
*/
|
|
242
|
-
async cloneToProject(source, target,
|
|
239
|
+
async cloneToProject(source, target, version) {
|
|
243
240
|
return await (0, telemetry_1.trace)("dateilager-grpc-client.clone-to-project", {
|
|
244
241
|
attributes: {
|
|
245
242
|
"dl.source": String(source),
|
|
246
243
|
"dl.target": String(target),
|
|
247
|
-
"dl.
|
|
248
|
-
"dl.toVersion": String(toVersion),
|
|
244
|
+
"dl.version": String(version),
|
|
249
245
|
},
|
|
250
246
|
}, async () => {
|
|
251
|
-
const call = await this._client.cloneToProject({ source, target,
|
|
247
|
+
const call = await this._client.cloneToProject({ source, target, version }, this._rpcOptions());
|
|
252
248
|
return call.response;
|
|
253
249
|
});
|
|
254
250
|
}
|
|
@@ -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;QAEn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AC,QAAQ,CAAC,IAAI,CAAC;gBAC7B,OAAO,EAAE,IAAI,CAAC,QAAQ;gBACtB,MAAM,EAAE,GAAG;aACZ,CAAC,CAAC;SACJ;QAAC,OAAO,GAAG,EAAE;YACZ,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;YACjB,MAAM,GAAG,CAAC;SACX;IACH,CAAC;IAED;;;;OAIG;IACI,KAAK,CAAC,QAAQ;QACnB,IAAI;YACF,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC,QAAQ,EAAE,CAAC;YACrC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,KAAK,CAAC,QAAQ,CAAC;YAC3C,OAAO,QAAQ,CAAC,OAAO,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,CAAC,CAAC,IAAI,CAAC;SAC1D;gBAAS;YACR,IAAI,CAAC,KAAK,CAAC,GAAG,EAAE,CAAC;SAClB;IACH,CAAC;CACF;AAED,MAAM,OAAO,GAAG,IAAI,kBAAW,EAAE,CAAC;AAElC;;;;;GAKG;AACH,SAAgB,aAAa,CAAC,OAAe;IAC3C,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, 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: options.grpcClientOptions,\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 withContent: 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 withContent: true,\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 fromVersion Start version of the source project.\n * @param toVersion Stop version of the source project.\n * @returns The new version number of the target project\n */\n public async cloneToProject(source: bigint, target: bigint, fromVersion: bigint, toVersion: 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.fromVersion\": String(fromVersion),\n \"dl.toVersion\": String(toVersion),\n },\n },\n async () => {\n const call = await this._client.cloneToProject({ source, target, fromVersion, toVersion }, this._rpcOptions());\n return call.response;\n }\n );\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"],"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,CAA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AAe;IAC3C,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, 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: options.grpcClientOptions,\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/**\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,5 +1,7 @@
|
|
|
1
1
|
import type { RpcTransport } from "@protobuf-ts/runtime-rpc";
|
|
2
2
|
import type { ServiceInfo } from "@protobuf-ts/runtime-rpc";
|
|
3
|
+
import type { GetCacheResponse } from "./fs_pb";
|
|
4
|
+
import type { GetCacheRequest } from "./fs_pb";
|
|
3
5
|
import type { CloneToProjectResponse } from "./fs_pb";
|
|
4
6
|
import type { CloneToProjectRequest } from "./fs_pb";
|
|
5
7
|
import type { GcContentsResponse } from "./fs_pb";
|
|
@@ -86,6 +88,10 @@ export interface IFsClient {
|
|
|
86
88
|
* @generated from protobuf rpc: CloneToProject(pb.CloneToProjectRequest) returns (pb.CloneToProjectResponse);
|
|
87
89
|
*/
|
|
88
90
|
cloneToProject(input: CloneToProjectRequest, options?: RpcOptions): UnaryCall<CloneToProjectRequest, CloneToProjectResponse>;
|
|
91
|
+
/**
|
|
92
|
+
* @generated from protobuf rpc: GetCache(pb.GetCacheRequest) returns (stream pb.GetCacheResponse);
|
|
93
|
+
*/
|
|
94
|
+
getCache(input: GetCacheRequest, options?: RpcOptions): ServerStreamingCall<GetCacheRequest, GetCacheResponse>;
|
|
89
95
|
}
|
|
90
96
|
/**
|
|
91
97
|
* @generated from protobuf service pb.Fs
|
|
@@ -150,4 +156,8 @@ export declare class FsClient implements IFsClient, ServiceInfo {
|
|
|
150
156
|
* @generated from protobuf rpc: CloneToProject(pb.CloneToProjectRequest) returns (pb.CloneToProjectResponse);
|
|
151
157
|
*/
|
|
152
158
|
cloneToProject(input: CloneToProjectRequest, options?: RpcOptions): UnaryCall<CloneToProjectRequest, CloneToProjectResponse>;
|
|
159
|
+
/**
|
|
160
|
+
* @generated from protobuf rpc: GetCache(pb.GetCacheRequest) returns (stream pb.GetCacheResponse);
|
|
161
|
+
*/
|
|
162
|
+
getCache(input: GetCacheRequest, options?: RpcOptions): ServerStreamingCall<GetCacheRequest, GetCacheResponse>;
|
|
153
163
|
}
|
|
@@ -124,6 +124,13 @@ class FsClient {
|
|
|
124
124
|
const method = this.methods[12], opt = this._transport.mergeOptions(options);
|
|
125
125
|
return (0, runtime_rpc_1.stackIntercept)("unary", this._transport, method, opt, input);
|
|
126
126
|
}
|
|
127
|
+
/**
|
|
128
|
+
* @generated from protobuf rpc: GetCache(pb.GetCacheRequest) returns (stream pb.GetCacheResponse);
|
|
129
|
+
*/
|
|
130
|
+
getCache(input, options) {
|
|
131
|
+
const method = this.methods[13], opt = this._transport.mergeOptions(options);
|
|
132
|
+
return (0, runtime_rpc_1.stackIntercept)("serverStreaming", this._transport, method, opt, input);
|
|
133
|
+
}
|
|
127
134
|
}
|
|
128
135
|
exports.FsClient = FsClient;
|
|
129
136
|
//# sourceMappingURL=fs_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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;CACJ;AAjGD,4BAiGC","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 { 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/**\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"]}
|
|
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,EAA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AC;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"]}
|
package/dist/cjs/pb/fs_pb.d.ts
CHANGED
|
@@ -107,10 +107,6 @@ export interface ObjectQuery {
|
|
|
107
107
|
* @generated from protobuf field: bool is_prefix = 2;
|
|
108
108
|
*/
|
|
109
109
|
isPrefix: boolean;
|
|
110
|
-
/**
|
|
111
|
-
* @generated from protobuf field: bool with_content = 3;
|
|
112
|
-
*/
|
|
113
|
-
withContent: boolean;
|
|
114
110
|
/**
|
|
115
111
|
* @generated from protobuf field: repeated string ignores = 4;
|
|
116
112
|
*/
|
|
@@ -170,6 +166,10 @@ export interface GetCompressRequest {
|
|
|
170
166
|
* @generated from protobuf field: repeated pb.ObjectQuery queries = 5;
|
|
171
167
|
*/
|
|
172
168
|
queries: ObjectQuery[];
|
|
169
|
+
/**
|
|
170
|
+
* @generated from protobuf field: repeated int64 available_cache_versions = 6;
|
|
171
|
+
*/
|
|
172
|
+
availableCacheVersions: bigint[];
|
|
173
173
|
}
|
|
174
174
|
/**
|
|
175
175
|
* @generated from protobuf message pb.GetCompressResponse
|
|
@@ -368,15 +368,11 @@ export interface CloneToProjectRequest {
|
|
|
368
368
|
*/
|
|
369
369
|
source: bigint;
|
|
370
370
|
/**
|
|
371
|
-
* @generated from protobuf field: int64
|
|
372
|
-
*/
|
|
373
|
-
fromVersion: bigint;
|
|
374
|
-
/**
|
|
375
|
-
* @generated from protobuf field: int64 to_version = 3;
|
|
371
|
+
* @generated from protobuf field: int64 version = 2;
|
|
376
372
|
*/
|
|
377
|
-
|
|
373
|
+
version: bigint;
|
|
378
374
|
/**
|
|
379
|
-
* @generated from protobuf field: int64 target =
|
|
375
|
+
* @generated from protobuf field: int64 target = 3;
|
|
380
376
|
*/
|
|
381
377
|
target: bigint;
|
|
382
378
|
}
|
|
@@ -389,6 +385,41 @@ export interface CloneToProjectResponse {
|
|
|
389
385
|
*/
|
|
390
386
|
latestVersion: bigint;
|
|
391
387
|
}
|
|
388
|
+
/**
|
|
389
|
+
* @generated from protobuf message pb.GetCacheRequest
|
|
390
|
+
*/
|
|
391
|
+
export interface GetCacheRequest {
|
|
392
|
+
}
|
|
393
|
+
/**
|
|
394
|
+
* @generated from protobuf message pb.GetCacheResponse
|
|
395
|
+
*/
|
|
396
|
+
export interface GetCacheResponse {
|
|
397
|
+
/**
|
|
398
|
+
* @generated from protobuf field: int64 version = 1;
|
|
399
|
+
*/
|
|
400
|
+
version: bigint;
|
|
401
|
+
/**
|
|
402
|
+
* @generated from protobuf field: pb.GetCacheResponse.Format format = 2;
|
|
403
|
+
*/
|
|
404
|
+
format: GetCacheResponse_Format;
|
|
405
|
+
/**
|
|
406
|
+
* @generated from protobuf field: bytes bytes = 3;
|
|
407
|
+
*/
|
|
408
|
+
bytes: Uint8Array;
|
|
409
|
+
/**
|
|
410
|
+
* @generated from protobuf field: bytes hash = 4;
|
|
411
|
+
*/
|
|
412
|
+
hash: Uint8Array;
|
|
413
|
+
}
|
|
414
|
+
/**
|
|
415
|
+
* @generated from protobuf enum pb.GetCacheResponse.Format
|
|
416
|
+
*/
|
|
417
|
+
export declare enum GetCacheResponse_Format {
|
|
418
|
+
/**
|
|
419
|
+
* @generated from protobuf enum value: S2_TAR = 0;
|
|
420
|
+
*/
|
|
421
|
+
S2_TAR = 0
|
|
422
|
+
}
|
|
392
423
|
declare class NewProjectRequest$Type extends MessageType<NewProjectRequest> {
|
|
393
424
|
constructor();
|
|
394
425
|
create(value?: PartialMessage<NewProjectRequest>): NewProjectRequest;
|
|
@@ -679,6 +710,26 @@ declare class CloneToProjectResponse$Type extends MessageType<CloneToProjectResp
|
|
|
679
710
|
* @generated MessageType for protobuf message pb.CloneToProjectResponse
|
|
680
711
|
*/
|
|
681
712
|
export declare const CloneToProjectResponse: CloneToProjectResponse$Type;
|
|
713
|
+
declare class GetCacheRequest$Type extends MessageType<GetCacheRequest> {
|
|
714
|
+
constructor();
|
|
715
|
+
create(value?: PartialMessage<GetCacheRequest>): GetCacheRequest;
|
|
716
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetCacheRequest): GetCacheRequest;
|
|
717
|
+
internalBinaryWrite(message: GetCacheRequest, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
718
|
+
}
|
|
719
|
+
/**
|
|
720
|
+
* @generated MessageType for protobuf message pb.GetCacheRequest
|
|
721
|
+
*/
|
|
722
|
+
export declare const GetCacheRequest: GetCacheRequest$Type;
|
|
723
|
+
declare class GetCacheResponse$Type extends MessageType<GetCacheResponse> {
|
|
724
|
+
constructor();
|
|
725
|
+
create(value?: PartialMessage<GetCacheResponse>): GetCacheResponse;
|
|
726
|
+
internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: GetCacheResponse): GetCacheResponse;
|
|
727
|
+
internalBinaryWrite(message: GetCacheResponse, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter;
|
|
728
|
+
}
|
|
729
|
+
/**
|
|
730
|
+
* @generated MessageType for protobuf message pb.GetCacheResponse
|
|
731
|
+
*/
|
|
732
|
+
export declare const GetCacheResponse: GetCacheResponse$Type;
|
|
682
733
|
/**
|
|
683
734
|
* @generated ServiceType for protobuf service pb.Fs
|
|
684
735
|
*/
|