@milaboratories/pl-drivers 1.12.7 → 1.12.8

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.
Files changed (92) hide show
  1. package/dist/clients/download.cjs +1 -0
  2. package/dist/clients/download.cjs.map +1 -1
  3. package/dist/clients/download.js +1 -0
  4. package/dist/clients/download.js.map +1 -1
  5. package/dist/clients/logs.cjs +2 -0
  6. package/dist/clients/logs.cjs.map +1 -1
  7. package/dist/clients/logs.js +2 -0
  8. package/dist/clients/logs.js.map +1 -1
  9. package/dist/clients/ls_api.cjs +1 -0
  10. package/dist/clients/ls_api.cjs.map +1 -1
  11. package/dist/clients/ls_api.js +1 -0
  12. package/dist/clients/ls_api.js.map +1 -1
  13. package/dist/clients/progress.cjs +4 -1
  14. package/dist/clients/progress.cjs.map +1 -1
  15. package/dist/clients/progress.js +4 -1
  16. package/dist/clients/progress.js.map +1 -1
  17. package/dist/clients/upload.cjs +17 -3
  18. package/dist/clients/upload.cjs.map +1 -1
  19. package/dist/clients/upload.js +17 -3
  20. package/dist/clients/upload.js.map +1 -1
  21. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.cjs +28 -16
  22. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.cjs.map +1 -1
  23. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.cjs +1 -1
  24. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.cjs.map +1 -1
  25. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.d.ts +2 -2
  26. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.js +1 -1
  27. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.js.map +1 -1
  28. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.d.ts +11 -5
  29. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.js +28 -16
  30. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.js.map +1 -1
  31. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.cjs +26 -12
  32. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.cjs.map +1 -1
  33. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.cjs +4 -4
  34. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.cjs.map +1 -1
  35. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.js +4 -4
  36. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.js.map +1 -1
  37. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.d.ts +16 -16
  38. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.js +26 -12
  39. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.js.map +1 -1
  40. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.cjs +36 -12
  41. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.cjs.map +1 -1
  42. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.cjs +1 -1
  43. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.cjs.map +1 -1
  44. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.d.ts +2 -2
  45. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.js +1 -1
  46. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.js.map +1 -1
  47. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.d.ts +8 -0
  48. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.js +36 -12
  49. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.js.map +1 -1
  50. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.cjs +29 -189
  51. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.cjs.map +1 -1
  52. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.cjs +20 -41
  53. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.cjs.map +1 -1
  54. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.d.ts +36 -66
  55. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.js +20 -41
  56. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.js.map +1 -1
  57. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.d.ts +52 -137
  58. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.js +29 -189
  59. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.js.map +1 -1
  60. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.cjs +225 -24
  61. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.cjs.map +1 -1
  62. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.cjs +21 -7
  63. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.cjs.map +1 -1
  64. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.js +21 -7
  65. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.js.map +1 -1
  66. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.js +225 -24
  67. package/dist/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.js.map +1 -1
  68. package/dist/proto-rest/downloadapi.d.ts +8 -3
  69. package/dist/proto-rest/progressapi.d.ts +4 -2
  70. package/dist/proto-rest/streamingapi.d.ts +64 -203
  71. package/package.json +5 -5
  72. package/src/clients/download.ts +1 -0
  73. package/src/clients/logs.ts +2 -0
  74. package/src/clients/ls_api.ts +1 -0
  75. package/src/clients/progress.ts +1 -1
  76. package/src/clients/upload.ts +14 -1
  77. package/src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.ts +2 -2
  78. package/src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.ts +24 -11
  79. package/src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.client.ts +8 -8
  80. package/src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/lsapi/protocol.ts +31 -18
  81. package/src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.client.ts +2 -2
  82. package/src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/progressapi/protocol.ts +23 -1
  83. package/src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.client.ts +39 -78
  84. package/src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/streamingapi/protocol.ts +72 -263
  85. package/src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client.ts +41 -14
  86. package/src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.ts +286 -44
  87. package/src/proto-grpc/google/protobuf/descriptor.ts +2 -5
  88. package/src/proto-rest/downloadapi.ts +8 -3
  89. package/src/proto-rest/lsapi.ts +23 -18
  90. package/src/proto-rest/progressapi.ts +4 -0
  91. package/src/proto-rest/streamingapi.ts +65 -211
  92. package/src/proto-rest/uploadapi.ts +141 -39
@@ -1 +1 @@
1
- {"version":3,"file":"upload.js","names":[],"sources":["../../src/clients/upload.ts"],"sourcesContent":["import type {\n WireClientProvider,\n WireClientProviderFactory,\n PlClient,\n} from \"@milaboratories/pl-client\";\nimport { addRTypeToMetadata, createRTypeRoutingHeader, RestAPI } from \"@milaboratories/pl-client\";\nimport type { ResourceInfo } from \"@milaboratories/pl-tree\";\nimport type { MiLogger } from \"@milaboratories/ts-helpers\";\nimport type { RpcOptions } from \"@protobuf-ts/runtime-rpc\";\nimport * as fs from \"node:fs/promises\";\nimport type { Dispatcher } from \"undici\";\nimport { request } from \"undici\";\nimport {\n UploadAPI_ChecksumAlgorithm,\n type UploadAPI_GetPartURL_Response,\n} from \"../proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol\";\nimport { UploadClient } from \"../proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client\";\nimport type { UploadApiPaths, UploadRestClientType } from \"../proto-rest\";\nimport { crc32c } from \"./crc32c\";\n\nimport type { IncomingHttpHeaders } from \"undici/types/header\";\n\nexport class MTimeError extends Error {\n name = \"MTimeError\";\n}\n\nexport class UnexpectedEOF extends Error {\n name = \"UnexpectedEOF\";\n}\n\nexport class NetworkError extends Error {\n name = \"NetworkError\";\n}\n\n/** Happens when the file doesn't exist */\nexport class NoFileForUploading extends Error {\n name = \"NoFileForUploading\";\n}\n\nexport class BadRequestError extends Error {\n name = \"BadRequestError\";\n}\n\n/** Low-level client for grpc uploadapi.\n * The user should pass here a concrete BlobUpload/<storageId> resource,\n * it can be got from handle field of BlobUpload. */\nexport class ClientUpload {\n private readonly wire: WireClientProvider<UploadRestClientType | UploadClient>;\n\n constructor(\n wireClientProviderFactory: WireClientProviderFactory,\n public readonly httpClient: Dispatcher,\n _: PlClient,\n public readonly logger: MiLogger,\n ) {\n this.wire = wireClientProviderFactory.createWireClientProvider((wire) => {\n if (wire.type === \"grpc\") {\n return new UploadClient(wire.Transport);\n }\n\n return RestAPI.createClient<UploadApiPaths>({\n hostAndPort: wire.Config.hostAndPort,\n ssl: wire.Config.ssl,\n dispatcher: wire.Dispatcher,\n middlewares: wire.Middlewares,\n });\n });\n }\n\n close() {}\n\n public async initUpload(\n { id, type }: ResourceInfo,\n options?: RpcOptions,\n ): Promise<{\n overall: bigint;\n toUpload: bigint[];\n checksumAlgorithm: UploadAPI_ChecksumAlgorithm;\n checksumHeader: string;\n }> {\n const client = this.wire.get();\n\n if (client instanceof UploadClient) {\n const init = (await client.init({ resourceId: id }, addRTypeToMetadata(type, options)))\n .response;\n\n return {\n overall: init.partsCount,\n toUpload: this.partsToUpload(init.partsCount, init.uploadedParts),\n checksumAlgorithm: init.checksumAlgorithm,\n checksumHeader: init.checksumHeader,\n };\n }\n\n const init = (\n await client.POST(\"/v1/upload/init\", {\n body: {\n resourceId: id.toString(),\n },\n headers: { ...createRTypeRoutingHeader(type) },\n })\n ).data!;\n\n return {\n overall: BigInt(init.partsCount),\n toUpload: this.partsToUpload(BigInt(init.partsCount), init.uploadedParts.map(BigInt)),\n checksumAlgorithm: init.checksumAlgorithm,\n checksumHeader: init.checksumHeader,\n };\n }\n\n public async partUpload(\n { id, type }: ResourceInfo,\n path: string,\n expectedMTimeUnix: bigint,\n partNumber: bigint,\n checksumAlgorithm: UploadAPI_ChecksumAlgorithm,\n checksumHeader: string,\n options?: RpcOptions,\n ) {\n const client = this.wire.get();\n\n let info: UploadAPI_GetPartURL_Response;\n if (client instanceof UploadClient) {\n // partChecksum isn't used for now but protoc requires it to be set\n info = (\n await client.getPartURL(\n {\n resourceId: id,\n partNumber,\n uploadedPartSize: 0n,\n isInternalUse: false,\n partChecksum: \"\",\n },\n addRTypeToMetadata(type, options),\n )\n ).response;\n } else {\n const resp = (\n await client.POST(\"/v1/upload/get-part-url\", {\n body: {\n resourceId: id.toString(),\n partNumber: partNumber.toString(),\n uploadedPartSize: \"0\",\n isInternalUse: false,\n partChecksum: \"\",\n },\n headers: { ...createRTypeRoutingHeader(type) },\n })\n ).data!;\n info = {\n uploadUrl: resp.uploadUrl,\n method: resp.method,\n headers: resp.headers,\n chunkStart: BigInt(resp.chunkStart),\n chunkEnd: BigInt(resp.chunkEnd),\n };\n }\n\n const chunk = await readFileChunk(path, info.chunkStart, info.chunkEnd);\n await checkExpectedMTime(path, expectedMTimeUnix);\n\n if (checksumHeader && checksumAlgorithm === UploadAPI_ChecksumAlgorithm.CRC32C) {\n info.headers.push({ name: checksumHeader, value: calculateCrc32cChecksum(chunk) });\n }\n\n const contentLength = Number(info.chunkEnd - info.chunkStart);\n if (chunk.length !== contentLength) {\n throw new Error(\n `Chunk size mismatch: expected ${contentLength} bytes, but read ${chunk.length} bytes from file`,\n );\n }\n\n const headers = Object.fromEntries(\n info.headers.map(({ name, value }) => [name.toLowerCase(), value]),\n );\n\n try {\n const {\n body: rawBody,\n statusCode,\n headers: responseHeaders,\n } = await request(info.uploadUrl, {\n dispatcher: this.httpClient,\n body: chunk,\n // We got headers only after we send\n // the whole body (in case of S3 PUT requests it's 5 MB).\n // It might be slow with a slow connection (or with SSH),\n // that's why we got big timeout here.\n headersTimeout: 60000,\n bodyTimeout: 60000,\n // Prevent connection reuse by setting \"Connection: close\" header.\n // This works around an issue with the backend's built-in S3 implementation\n // that caused HTTP/1.1 protocol lines to be included in the uploaded file content.\n reset: true,\n headers,\n method: info.method.toUpperCase() as Dispatcher.HttpMethod,\n });\n\n // always read the body for resources to be garbage collected.\n const body = await rawBody.text();\n checkStatusCodeOk(statusCode, body, responseHeaders, info);\n } catch (e: unknown) {\n if (e instanceof NetworkError) throw e;\n\n if (e instanceof BadRequestError) throw e;\n\n throw new Error(\n `partUpload: error ${JSON.stringify(e)} happened while trying to do part upload to the url ${info.uploadUrl}, headers: ${JSON.stringify(info.headers)}`,\n );\n }\n\n await this.updateProgress({ id, type }, BigInt(info.chunkEnd - info.chunkStart), options);\n }\n\n public async finalize(info: ResourceInfo, options?: RpcOptions) {\n const client = this.wire.get();\n\n if (client instanceof UploadClient) {\n await client.finalize({ resourceId: info.id }, addRTypeToMetadata(info.type, options));\n } else {\n await client.POST(\"/v1/upload/finalize\", {\n body: {\n resourceId: info.id.toString(),\n },\n headers: { ...createRTypeRoutingHeader(info.type) },\n });\n }\n }\n\n /** Calculates parts that need to be uploaded from the parts that were\n * already uploaded. */\n private partsToUpload(partsCount: bigint, uploadedParts: bigint[]): bigint[] {\n const toUpload: bigint[] = [];\n const uploaded = new Set(uploadedParts);\n\n for (let i = 1n; i <= partsCount; i++) {\n if (!uploaded.has(i)) toUpload.push(i);\n }\n\n return toUpload;\n }\n\n private async updateProgress(\n { id, type }: ResourceInfo,\n bytesProcessed: bigint,\n options?: RpcOptions,\n ): Promise<void> {\n const client = this.wire.get();\n\n if (client instanceof UploadClient) {\n await client.updateProgress(\n {\n resourceId: id,\n bytesProcessed,\n },\n addRTypeToMetadata(type, options),\n ).response;\n return;\n }\n\n await client.POST(\"/v1/upload/update-progress\", {\n body: {\n resourceId: id.toString(),\n bytesProcessed: bytesProcessed.toString(),\n },\n headers: { ...createRTypeRoutingHeader(type) },\n });\n return;\n }\n}\n\nasync function readFileChunk(path: string, chunkStart: bigint, chunkEnd: bigint): Promise<Buffer> {\n let f: fs.FileHandle | undefined;\n try {\n f = await fs.open(path);\n const len = Number(chunkEnd - chunkStart);\n const pos = Number(chunkStart);\n const b = Buffer.alloc(len);\n const bytesRead = await readBytesFromPosition(f, b, len, pos);\n\n return b.subarray(0, bytesRead);\n } catch (e: unknown) {\n if (e && typeof e === \"object\" && \"code\" in e && e.code == \"ENOENT\")\n throw new NoFileForUploading(`there is no file ${path} for uploading`);\n throw e;\n } finally {\n await f?.close();\n }\n}\n\n/** Read len bytes from a given position.\n * Without this, `FileHandle.read` can read less bytes than needed. */\nasync function readBytesFromPosition(f: fs.FileHandle, b: Buffer, len: number, position: number) {\n let bytesReadTotal = 0;\n while (bytesReadTotal < len) {\n const { bytesRead } = await f.read(\n b,\n bytesReadTotal,\n len - bytesReadTotal,\n position + bytesReadTotal,\n );\n if (bytesRead === 0) {\n throw new UnexpectedEOF(\"file ended earlier than expected.\");\n }\n bytesReadTotal += bytesRead;\n }\n\n return bytesReadTotal;\n}\n\nasync function checkExpectedMTime(path: string, expectedMTimeUnix: bigint) {\n const mTime = BigInt(Math.floor((await fs.stat(path)).mtimeMs / 1000));\n if (mTime > expectedMTimeUnix) {\n throw new MTimeError(`file was modified, expected mtime: ${expectedMTimeUnix}, got: ${mTime}.`);\n }\n}\n\n/** S3 error codes that indicate expired/invalid temporary credentials.\n * These are transient: a retry with a fresh presigned URL will succeed\n * once the backend refreshes its STS credentials. */\nconst TRANSIENT_S3_ERROR_CODES = [\"ExpiredToken\", \"RequestExpired\", \"TokenRefreshRequired\"];\n\nfunction isTransientS3Error(body: string): boolean {\n return TRANSIENT_S3_ERROR_CODES.some((code) => body.includes(`<Code>${code}</Code>`));\n}\n\nfunction checkStatusCodeOk(\n statusCode: number,\n body: string,\n headers: IncomingHttpHeaders,\n info: UploadAPI_GetPartURL_Response,\n) {\n if (statusCode == 400) {\n if (isTransientS3Error(body)) {\n throw new NetworkError(\n `transient S3 credential error, status code: ${statusCode},` +\n ` body: ${body}, headers: ${JSON.stringify(headers)}, url: ${info.uploadUrl}`,\n );\n }\n throw new BadRequestError(\n `response is not ok, status code: ${statusCode},` +\n ` body: ${body}, headers: ${JSON.stringify(headers)}, url: ${info.uploadUrl}`,\n );\n }\n\n if (statusCode != 200) {\n throw new NetworkError(\n `response is not ok, status code: ${statusCode},` +\n ` body: ${body}, headers: ${JSON.stringify(headers)}, url: ${info.uploadUrl}`,\n );\n }\n}\n\n/** Calculate CRC32C checksum of a buffer and return as base64 string */\nfunction calculateCrc32cChecksum(data: Buffer): string {\n const checksum = crc32c(data);\n // Convert to unsigned 32-bit integer and then to base64\n const buffer = Buffer.alloc(4);\n\n buffer.writeUInt32BE(checksum, 0);\n return buffer.toString(\"base64\");\n}\n"],"mappings":";;;;;;;;AAsBA,IAAa,aAAb,cAAgC,MAAM;CACpC,OAAO;;AAGT,IAAa,gBAAb,cAAmC,MAAM;CACvC,OAAO;;AAGT,IAAa,eAAb,cAAkC,MAAM;CACtC,OAAO;;;AAIT,IAAa,qBAAb,cAAwC,MAAM;CAC5C,OAAO;;AAGT,IAAa,kBAAb,cAAqC,MAAM;CACzC,OAAO;;;;;AAMT,IAAa,eAAb,MAA0B;CACxB,AAAiB;CAEjB,YACE,2BACA,AAAgB,YAChB,GACA,AAAgB,QAChB;EAHgB;EAEA;AAEhB,OAAK,OAAO,0BAA0B,0BAA0B,SAAS;AACvE,OAAI,KAAK,SAAS,OAChB,QAAO,IAAI,aAAa,KAAK,UAAU;AAGzC,UAAO,QAAQ,aAA6B;IAC1C,aAAa,KAAK,OAAO;IACzB,KAAK,KAAK,OAAO;IACjB,YAAY,KAAK;IACjB,aAAa,KAAK;IACnB,CAAC;IACF;;CAGJ,QAAQ;CAER,MAAa,WACX,EAAE,IAAI,QACN,SAMC;EACD,MAAM,SAAS,KAAK,KAAK,KAAK;AAE9B,MAAI,kBAAkB,cAAc;GAClC,MAAM,QAAQ,MAAM,OAAO,KAAK,EAAE,YAAY,IAAI,EAAE,mBAAmB,MAAM,QAAQ,CAAC,EACnF;AAEH,UAAO;IACL,SAAS,KAAK;IACd,UAAU,KAAK,cAAc,KAAK,YAAY,KAAK,cAAc;IACjE,mBAAmB,KAAK;IACxB,gBAAgB,KAAK;IACtB;;EAGH,MAAM,QACJ,MAAM,OAAO,KAAK,mBAAmB;GACnC,MAAM,EACJ,YAAY,GAAG,UAAU,EAC1B;GACD,SAAS,EAAE,GAAG,yBAAyB,KAAK,EAAE;GAC/C,CAAC,EACF;AA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,SAAS,KAAK,SAAS,SAAS,KAAK,SAAS,CAAC;;AAGvF,SAAS,kBACP,YACA,MACA,SACA,MACA;AACA,KAAI,cAAc,KAAK;AACrB,MAAI,mBAAmB,KAAK,CAC1B,OAAM,IAAI,aACR,+CAA+C,WAAW,UAC9C,KAAK,aAAa,KAAK,UAAU,QAAQ,CAAC,SAAS,KAAK,YACrE;AAEH,QAAM,IAAI,gBACR,oCAAoC,WAAW,UACnC,KAAK,aAAa,KAAK,UAAU,QAAQ,CAAC,SAAS,KAAK,YACrE;;AAGH,KAAI,cAAc,IAChB,OAAM,IAAI,aACR,oCAAoC,WAAW,UACnC,KAAK,aAAa,KAAK,UAAU,QAAQ,CAAC,SAAS,KAAK,YACrE;;;AAKL,SAAS,wBAAwB,MAAsB;CACrD,MAAM,WAAW,OAAO,KAAK;CAE7B,MAAM,SAAS,OAAO,MAAM,EAAE;AAE9B,QAAO,cAAc,UAAU,EAAE;AACjC,QAAO,OAAO,SAAS,SAAS"}
1
+ {"version":3,"file":"upload.js","names":[],"sources":["../../src/clients/upload.ts"],"sourcesContent":["import type {\n WireClientProvider,\n WireClientProviderFactory,\n PlClient,\n} from \"@milaboratories/pl-client\";\nimport { addRTypeToMetadata, createRTypeRoutingHeader, RestAPI } from \"@milaboratories/pl-client\";\nimport type { ResourceInfo } from \"@milaboratories/pl-tree\";\nimport type { MiLogger } from \"@milaboratories/ts-helpers\";\nimport type { RpcOptions } from \"@protobuf-ts/runtime-rpc\";\nimport * as fs from \"node:fs/promises\";\nimport type { Dispatcher } from \"undici\";\nimport { request } from \"undici\";\nimport {\n UploadAPI_ChecksumAlgorithm,\n type UploadAPI_GetPartURL_Response,\n} from \"../proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol\";\nimport { UploadClient } from \"../proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/uploadapi/protocol.client\";\nimport type { UploadApiPaths, UploadRestClientType } from \"../proto-rest\";\nimport { crc32c } from \"./crc32c\";\n\nimport type { IncomingHttpHeaders } from \"undici/types/header\";\n\nexport class MTimeError extends Error {\n name = \"MTimeError\";\n}\n\nexport class UnexpectedEOF extends Error {\n name = \"UnexpectedEOF\";\n}\n\nexport class NetworkError extends Error {\n name = \"NetworkError\";\n}\n\n/** Happens when the file doesn't exist */\nexport class NoFileForUploading extends Error {\n name = \"NoFileForUploading\";\n}\n\nexport class BadRequestError extends Error {\n name = \"BadRequestError\";\n}\n\n/** Low-level client for grpc uploadapi.\n * The user should pass here a concrete BlobUpload/<storageId> resource,\n * it can be got from handle field of BlobUpload. */\nexport class ClientUpload {\n private readonly wire: WireClientProvider<UploadRestClientType | UploadClient>;\n\n constructor(\n wireClientProviderFactory: WireClientProviderFactory,\n public readonly httpClient: Dispatcher,\n _: PlClient,\n public readonly logger: MiLogger,\n ) {\n this.wire = wireClientProviderFactory.createWireClientProvider((wire) => {\n if (wire.type === \"grpc\") {\n return new UploadClient(wire.Transport);\n }\n\n return RestAPI.createClient<UploadApiPaths>({\n hostAndPort: wire.Config.hostAndPort,\n ssl: wire.Config.ssl,\n dispatcher: wire.Dispatcher,\n middlewares: wire.Middlewares,\n });\n });\n }\n\n close() {}\n\n public async initUpload(\n { id, type }: ResourceInfo,\n options?: RpcOptions,\n ): Promise<{\n overall: bigint;\n toUpload: bigint[];\n checksumAlgorithm: UploadAPI_ChecksumAlgorithm;\n checksumHeader: string;\n }> {\n const client = this.wire.get();\n\n if (client instanceof UploadClient) {\n const init = (await client.init({ resourceId: id }, addRTypeToMetadata(type, options)))\n .response;\n\n return {\n overall: init.partsCount,\n toUpload: this.partsToUpload(init.partsCount, init.uploadedParts),\n checksumAlgorithm: init.checksumAlgorithm,\n checksumHeader: init.checksumHeader,\n };\n }\n\n const init = (\n await client.POST(\"/v1/upload/init\", {\n body: {\n resourceId: id.toString(),\n resourceSignature: \"\",\n },\n headers: { ...createRTypeRoutingHeader(type) },\n })\n ).data!;\n\n return {\n overall: BigInt(init.partsCount),\n toUpload: this.partsToUpload(BigInt(init.partsCount), init.uploadedParts.map(BigInt)),\n checksumAlgorithm: init.checksumAlgorithm,\n checksumHeader: init.checksumHeader,\n };\n }\n\n public async partUpload(\n { id, type }: ResourceInfo,\n path: string,\n expectedMTimeUnix: bigint,\n partNumber: bigint,\n checksumAlgorithm: UploadAPI_ChecksumAlgorithm,\n checksumHeader: string,\n options?: RpcOptions,\n ) {\n const client = this.wire.get();\n\n let info: UploadAPI_GetPartURL_Response;\n if (client instanceof UploadClient) {\n // partChecksum isn't used for now but protoc requires it to be set\n info = (\n await client.getPartURL(\n {\n resourceId: id,\n partNumber,\n uploadedPartSize: 0n,\n isInternalUse: false,\n partChecksum: \"\",\n },\n addRTypeToMetadata(type, options),\n )\n ).response;\n } else {\n const resp = (\n await client.POST(\"/v1/upload/get-part-url\", {\n body: {\n resourceId: id.toString(),\n resourceSignature: \"\",\n partNumber: partNumber.toString(),\n uploadedPartSize: \"0\",\n isInternalUse: false,\n partChecksum: \"\",\n },\n headers: { ...createRTypeRoutingHeader(type) },\n })\n ).data!;\n info = {\n uploadUrl: resp.uploadUrl,\n method: resp.method,\n headers: resp.headers,\n chunkStart: BigInt(resp.chunkStart),\n chunkEnd: BigInt(resp.chunkEnd),\n };\n }\n\n const chunk = await readFileChunk(path, info.chunkStart, info.chunkEnd);\n await checkExpectedMTime(path, expectedMTimeUnix);\n\n if (checksumHeader && checksumAlgorithm === UploadAPI_ChecksumAlgorithm.CRC32C) {\n info.headers.push({ name: checksumHeader, value: calculateCrc32cChecksum(chunk) });\n }\n\n const contentLength = Number(info.chunkEnd - info.chunkStart);\n if (chunk.length !== contentLength) {\n throw new Error(\n `Chunk size mismatch: expected ${contentLength} bytes, but read ${chunk.length} bytes from file`,\n );\n }\n\n const headers = Object.fromEntries(\n info.headers.map(({ name, value }) => [name.toLowerCase(), value]),\n );\n\n try {\n const {\n body: rawBody,\n statusCode,\n headers: responseHeaders,\n } = await request(info.uploadUrl, {\n dispatcher: this.httpClient,\n body: chunk,\n // We got headers only after we send\n // the whole body (in case of S3 PUT requests it's 5 MB).\n // It might be slow with a slow connection (or with SSH),\n // that's why we got big timeout here.\n headersTimeout: 60000,\n bodyTimeout: 60000,\n // Prevent connection reuse by setting \"Connection: close\" header.\n // This works around an issue with the backend's built-in S3 implementation\n // that caused HTTP/1.1 protocol lines to be included in the uploaded file content.\n reset: true,\n headers,\n method: info.method.toUpperCase() as Dispatcher.HttpMethod,\n });\n\n // always read the body for resources to be garbage collected.\n const body = await rawBody.text();\n checkStatusCodeOk(statusCode, body, responseHeaders, info);\n } catch (e: unknown) {\n if (e instanceof NetworkError) throw e;\n\n if (e instanceof BadRequestError) throw e;\n\n throw new Error(\n `partUpload: error ${JSON.stringify(e)} happened while trying to do part upload to the url ${info.uploadUrl}, headers: ${JSON.stringify(info.headers)}`,\n );\n }\n\n await this.updateProgress({ id, type }, BigInt(info.chunkEnd - info.chunkStart), options);\n }\n\n public async finalize(info: ResourceInfo, options?: RpcOptions) {\n const client = this.wire.get();\n\n if (client instanceof UploadClient) {\n await client.finalize(\n {\n resourceId: info.id,\n checksumAlgorithm: UploadAPI_ChecksumAlgorithm.UNSPECIFIED,\n checksum: new Uint8Array(0),\n },\n addRTypeToMetadata(info.type, options),\n );\n } else {\n await client.POST(\"/v1/upload/finalize\", {\n body: {\n resourceId: info.id.toString(),\n resourceSignature: \"\",\n checksumAlgorithm: 0,\n checksum: \"\",\n },\n headers: { ...createRTypeRoutingHeader(info.type) },\n });\n }\n }\n\n /** Calculates parts that need to be uploaded from the parts that were\n * already uploaded. */\n private partsToUpload(partsCount: bigint, uploadedParts: bigint[]): bigint[] {\n const toUpload: bigint[] = [];\n const uploaded = new Set(uploadedParts);\n\n for (let i = 1n; i <= partsCount; i++) {\n if (!uploaded.has(i)) toUpload.push(i);\n }\n\n return toUpload;\n }\n\n private async updateProgress(\n { id, type }: ResourceInfo,\n bytesProcessed: bigint,\n options?: RpcOptions,\n ): Promise<void> {\n const client = this.wire.get();\n\n if (client instanceof UploadClient) {\n await client.updateProgress(\n {\n resourceId: id,\n bytesProcessed,\n },\n addRTypeToMetadata(type, options),\n ).response;\n return;\n }\n\n await client.POST(\"/v1/upload/update-progress\", {\n body: {\n resourceId: id.toString(),\n resourceSignature: \"\",\n bytesProcessed: bytesProcessed.toString(),\n },\n headers: { ...createRTypeRoutingHeader(type) },\n });\n return;\n }\n}\n\nasync function readFileChunk(path: string, chunkStart: bigint, chunkEnd: bigint): Promise<Buffer> {\n let f: fs.FileHandle | undefined;\n try {\n f = await fs.open(path);\n const len = Number(chunkEnd - chunkStart);\n const pos = Number(chunkStart);\n const b = Buffer.alloc(len);\n const bytesRead = await readBytesFromPosition(f, b, len, pos);\n\n return b.subarray(0, bytesRead);\n } catch (e: unknown) {\n if (e && typeof e === \"object\" && \"code\" in e && e.code == \"ENOENT\")\n throw new NoFileForUploading(`there is no file ${path} for uploading`);\n throw e;\n } finally {\n await f?.close();\n }\n}\n\n/** Read len bytes from a given position.\n * Without this, `FileHandle.read` can read less bytes than needed. */\nasync function readBytesFromPosition(f: fs.FileHandle, b: Buffer, len: number, position: number) {\n let bytesReadTotal = 0;\n while (bytesReadTotal < len) {\n const { bytesRead } = await f.read(\n b,\n bytesReadTotal,\n len - bytesReadTotal,\n position + bytesReadTotal,\n );\n if (bytesRead === 0) {\n throw new UnexpectedEOF(\"file ended earlier than expected.\");\n }\n bytesReadTotal += bytesRead;\n }\n\n return bytesReadTotal;\n}\n\nasync function checkExpectedMTime(path: string, expectedMTimeUnix: bigint) {\n const mTime = BigInt(Math.floor((await fs.stat(path)).mtimeMs / 1000));\n if (mTime > expectedMTimeUnix) {\n throw new MTimeError(`file was modified, expected mtime: ${expectedMTimeUnix}, got: ${mTime}.`);\n }\n}\n\n/** S3 error codes that indicate expired/invalid temporary credentials.\n * These are transient: a retry with a fresh presigned URL will succeed\n * once the backend refreshes its STS credentials. */\nconst TRANSIENT_S3_ERROR_CODES = [\"ExpiredToken\", \"RequestExpired\", \"TokenRefreshRequired\"];\n\nfunction isTransientS3Error(body: string): boolean {\n return TRANSIENT_S3_ERROR_CODES.some((code) => body.includes(`<Code>${code}</Code>`));\n}\n\nfunction checkStatusCodeOk(\n statusCode: number,\n body: string,\n headers: IncomingHttpHeaders,\n info: UploadAPI_GetPartURL_Response,\n) {\n if (statusCode == 400) {\n if (isTransientS3Error(body)) {\n throw new NetworkError(\n `transient S3 credential error, status code: ${statusCode},` +\n ` body: ${body}, headers: ${JSON.stringify(headers)}, url: ${info.uploadUrl}`,\n );\n }\n throw new BadRequestError(\n `response is not ok, status code: ${statusCode},` +\n ` body: ${body}, headers: ${JSON.stringify(headers)}, url: ${info.uploadUrl}`,\n );\n }\n\n if (statusCode != 200) {\n throw new NetworkError(\n `response is not ok, status code: ${statusCode},` +\n ` body: ${body}, headers: ${JSON.stringify(headers)}, url: ${info.uploadUrl}`,\n );\n }\n}\n\n/** Calculate CRC32C checksum of a buffer and return as base64 string */\nfunction calculateCrc32cChecksum(data: Buffer): string {\n const checksum = crc32c(data);\n // Convert to unsigned 32-bit integer and then to base64\n const buffer = Buffer.alloc(4);\n\n buffer.writeUInt32BE(checksum, 0);\n return buffer.toString(\"base64\");\n}\n"],"mappings":";;;;;;;;AAsBA,IAAa,aAAb,cAAgC,MAAM;CACpC,OAAO;;AAGT,IAAa,gBAAb,cAAmC,MAAM;CACvC,OAAO;;AAGT,IAAa,eAAb,cAAkC,MAAM;CACtC,OAAO;;;AAIT,IAAa,qBAAb,cAAwC,MAAM;CAC5C,OAAO;;AAGT,IAAa,kBAAb,cAAqC,MAAM;CACzC,OAAO;;;;;AAMT,IAAa,eAAb,MAA0B;CACxB,AAAiB;CAEjB,YACE,2BACA,AAAgB,YAChB,GACA,AAAgB,QAChB;EAHgB;EAEA;AAEhB,OAAK,OAAO,0BAA0B,0BAA0B,SAAS;AACvE,OAAI,KAAK,SAAS,OAChB,QAAO,IAAI,aAAa,KAAK,UAAU;AAGzC,UAAO,QAAQ,aAA6B;IAC1C,aAAa,KAAK,OAAO;IACzB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,EAAE;AAE9B,QAAO,cAAc,UAAU,EAAE;AACjC,QAAO,OAAO,SAAS,SAAS"}
@@ -71,18 +71,28 @@ var DownloadAPI_GetDownloadURL$Type = class extends _protobuf_ts_runtime.Message
71
71
  const DownloadAPI_GetDownloadURL = new DownloadAPI_GetDownloadURL$Type();
72
72
  var DownloadAPI_GetDownloadURL_Request$Type = class extends _protobuf_ts_runtime.MessageType {
73
73
  constructor() {
74
- super("MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Request", [{
75
- no: 1,
76
- name: "resource_id",
77
- kind: "scalar",
78
- T: 4,
79
- L: 0
80
- }, {
81
- no: 2,
82
- name: "is_internal_use",
83
- kind: "scalar",
84
- T: 8
85
- }]);
74
+ super("MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Request", [
75
+ {
76
+ no: 1,
77
+ name: "resource_id",
78
+ kind: "scalar",
79
+ T: 4,
80
+ L: 0
81
+ },
82
+ {
83
+ no: 3,
84
+ name: "resource_signature",
85
+ kind: "scalar",
86
+ opt: true,
87
+ T: 12
88
+ },
89
+ {
90
+ no: 2,
91
+ name: "is_internal_use",
92
+ kind: "scalar",
93
+ T: 8
94
+ }
95
+ ]);
86
96
  }
87
97
  create(value) {
88
98
  const message = globalThis.Object.create(this.messagePrototype);
@@ -99,6 +109,9 @@ var DownloadAPI_GetDownloadURL_Request$Type = class extends _protobuf_ts_runtime
99
109
  case 1:
100
110
  message.resourceId = reader.uint64().toBigInt();
101
111
  break;
112
+ case 3:
113
+ message.resourceSignature = reader.bytes();
114
+ break;
102
115
  case 2:
103
116
  message.isInternalUse = reader.bool();
104
117
  break;
@@ -114,6 +127,7 @@ var DownloadAPI_GetDownloadURL_Request$Type = class extends _protobuf_ts_runtime
114
127
  internalBinaryWrite(message, writer, options) {
115
128
  if (message.resourceId !== 0n) writer.tag(1, _protobuf_ts_runtime.WireType.Varint).uint64(message.resourceId);
116
129
  if (message.isInternalUse !== false) writer.tag(2, _protobuf_ts_runtime.WireType.Varint).bool(message.isInternalUse);
130
+ if (message.resourceSignature !== void 0) writer.tag(3, _protobuf_ts_runtime.WireType.LengthDelimited).bytes(message.resourceSignature);
117
131
  let u = options.writeUnknownFields;
118
132
  if (u !== false) (u == true ? _protobuf_ts_runtime.UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
119
133
  return writer;
@@ -127,15 +141,13 @@ var DownloadAPI_GetDownloadURL_HTTPHeader$Type = class extends _protobuf_ts_runt
127
141
  constructor() {
128
142
  super("MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader", [{
129
143
  no: 1,
130
- name: "Name",
144
+ name: "name",
131
145
  kind: "scalar",
132
- jsonName: "Name",
133
146
  T: 9
134
147
  }, {
135
148
  no: 2,
136
- name: "Value",
149
+ name: "value",
137
150
  kind: "scalar",
138
- jsonName: "Value",
139
151
  T: 9
140
152
  }]);
141
153
  }
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.cjs","names":["MessageType","UnknownFieldHandler","WireType","ServiceType"],"sources":["../../../../../../../../../src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.ts"],"sourcesContent":["// @generated by protobuf-ts 2.11.1 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none\n// @generated from protobuf file \"github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.proto\" (package \"MiLaboratories.Controller.Shared\", syntax proto3)\n// tslint:disable\nimport { ServiceType } from \"@protobuf-ts/runtime-rpc\";\nimport { WireType } from \"@protobuf-ts/runtime\";\nimport type { BinaryWriteOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryWriter } from \"@protobuf-ts/runtime\";\nimport type { BinaryReadOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryReader } from \"@protobuf-ts/runtime\";\nimport { UnknownFieldHandler } from \"@protobuf-ts/runtime\";\nimport type { PartialMessage } from \"@protobuf-ts/runtime\";\nimport { reflectionMergePartial } from \"@protobuf-ts/runtime\";\nimport { MessageType } from \"@protobuf-ts/runtime\";\n/**\n * @generated from protobuf message MiLaboratories.Controller.Shared.DownloadAPI\n */\nexport interface DownloadAPI {\n}\n/**\n * @generated from protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL\n */\nexport interface DownloadAPI_GetDownloadURL {\n}\n/**\n * @generated from protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Request\n */\nexport interface DownloadAPI_GetDownloadURL_Request {\n /**\n * @generated from protobuf field: uint64 resource_id = 1\n */\n resourceId: bigint;\n /**\n * Pass `true` here if the blob will be downloaded from internal network,\n * e.g. controllers could use this if they are trying to download something from internal network.\n * For backward compatibility, by default pl treats all requests as from external network.\n *\n * @generated from protobuf field: bool is_internal_use = 2\n */\n isInternalUse: boolean;\n}\n/**\n * @generated from protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader\n */\nexport interface DownloadAPI_GetDownloadURL_HTTPHeader {\n /**\n * @generated from protobuf field: string Name = 1\n */\n name: string;\n /**\n * @generated from protobuf field: string Value = 2\n */\n value: string;\n}\n/**\n * @generated from protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Response\n */\nexport interface DownloadAPI_GetDownloadURL_Response {\n /**\n * @generated from protobuf field: string download_url = 1\n */\n downloadUrl: string;\n /**\n * @generated from protobuf field: repeated MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader headers = 2\n */\n headers: DownloadAPI_GetDownloadURL_HTTPHeader[];\n}\n// @generated message type with reflection information, may provide speed optimized methods\nclass DownloadAPI$Type extends MessageType<DownloadAPI> {\n constructor() {\n super(\"MiLaboratories.Controller.Shared.DownloadAPI\", []);\n }\n create(value?: PartialMessage<DownloadAPI>): DownloadAPI {\n const message = globalThis.Object.create((this.messagePrototype!));\n if (value !== undefined)\n reflectionMergePartial<DownloadAPI>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadAPI): DownloadAPI {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: DownloadAPI, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.DownloadAPI\n */\nexport const DownloadAPI = new DownloadAPI$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass DownloadAPI_GetDownloadURL$Type extends MessageType<DownloadAPI_GetDownloadURL> {\n constructor() {\n super(\"MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL\", []);\n }\n create(value?: PartialMessage<DownloadAPI_GetDownloadURL>): DownloadAPI_GetDownloadURL {\n const message = globalThis.Object.create((this.messagePrototype!));\n if (value !== undefined)\n reflectionMergePartial<DownloadAPI_GetDownloadURL>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadAPI_GetDownloadURL): DownloadAPI_GetDownloadURL {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: DownloadAPI_GetDownloadURL, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL\n */\nexport const DownloadAPI_GetDownloadURL = new DownloadAPI_GetDownloadURL$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass DownloadAPI_GetDownloadURL_Request$Type extends MessageType<DownloadAPI_GetDownloadURL_Request> {\n constructor() {\n super(\"MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Request\", [\n { no: 1, name: \"resource_id\", kind: \"scalar\", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },\n { no: 2, name: \"is_internal_use\", kind: \"scalar\", T: 8 /*ScalarType.BOOL*/ }\n ]);\n }\n create(value?: PartialMessage<DownloadAPI_GetDownloadURL_Request>): DownloadAPI_GetDownloadURL_Request {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.resourceId = 0n;\n message.isInternalUse = false;\n if (value !== undefined)\n reflectionMergePartial<DownloadAPI_GetDownloadURL_Request>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadAPI_GetDownloadURL_Request): DownloadAPI_GetDownloadURL_Request {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* uint64 resource_id */ 1:\n message.resourceId = reader.uint64().toBigInt();\n break;\n case /* bool is_internal_use */ 2:\n message.isInternalUse = reader.bool();\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: DownloadAPI_GetDownloadURL_Request, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* uint64 resource_id = 1; */\n if (message.resourceId !== 0n)\n writer.tag(1, WireType.Varint).uint64(message.resourceId);\n /* bool is_internal_use = 2; */\n if (message.isInternalUse !== false)\n writer.tag(2, WireType.Varint).bool(message.isInternalUse);\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Request\n */\nexport const DownloadAPI_GetDownloadURL_Request = new DownloadAPI_GetDownloadURL_Request$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass DownloadAPI_GetDownloadURL_HTTPHeader$Type extends MessageType<DownloadAPI_GetDownloadURL_HTTPHeader> {\n constructor() {\n super(\"MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader\", [\n { no: 1, name: \"Name\", kind: \"scalar\", jsonName: \"Name\", T: 9 /*ScalarType.STRING*/ },\n { no: 2, name: \"Value\", kind: \"scalar\", jsonName: \"Value\", T: 9 /*ScalarType.STRING*/ }\n ]);\n }\n create(value?: PartialMessage<DownloadAPI_GetDownloadURL_HTTPHeader>): DownloadAPI_GetDownloadURL_HTTPHeader {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.name = \"\";\n message.value = \"\";\n if (value !== undefined)\n reflectionMergePartial<DownloadAPI_GetDownloadURL_HTTPHeader>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadAPI_GetDownloadURL_HTTPHeader): DownloadAPI_GetDownloadURL_HTTPHeader {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* string Name */ 1:\n message.name = reader.string();\n break;\n case /* string Value */ 2:\n message.value = reader.string();\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: DownloadAPI_GetDownloadURL_HTTPHeader, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* string Name = 1; */\n if (message.name !== \"\")\n writer.tag(1, WireType.LengthDelimited).string(message.name);\n /* string Value = 2; */\n if (message.value !== \"\")\n writer.tag(2, WireType.LengthDelimited).string(message.value);\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader\n */\nexport const DownloadAPI_GetDownloadURL_HTTPHeader = new DownloadAPI_GetDownloadURL_HTTPHeader$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass DownloadAPI_GetDownloadURL_Response$Type extends MessageType<DownloadAPI_GetDownloadURL_Response> {\n constructor() {\n super(\"MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Response\", [\n { no: 1, name: \"download_url\", kind: \"scalar\", T: 9 /*ScalarType.STRING*/ },\n { no: 2, name: \"headers\", kind: \"message\", repeat: 2 /*RepeatType.UNPACKED*/, T: () => DownloadAPI_GetDownloadURL_HTTPHeader }\n ]);\n }\n create(value?: PartialMessage<DownloadAPI_GetDownloadURL_Response>): DownloadAPI_GetDownloadURL_Response {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.downloadUrl = \"\";\n message.headers = [];\n if (value !== undefined)\n reflectionMergePartial<DownloadAPI_GetDownloadURL_Response>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadAPI_GetDownloadURL_Response): DownloadAPI_GetDownloadURL_Response {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* string download_url */ 1:\n message.downloadUrl = reader.string();\n break;\n case /* repeated MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader headers */ 2:\n message.headers.push(DownloadAPI_GetDownloadURL_HTTPHeader.internalBinaryRead(reader, reader.uint32(), options));\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: DownloadAPI_GetDownloadURL_Response, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* string download_url = 1; */\n if (message.downloadUrl !== \"\")\n writer.tag(1, WireType.LengthDelimited).string(message.downloadUrl);\n /* repeated MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader headers = 2; */\n for (let i = 0; i < message.headers.length; i++)\n DownloadAPI_GetDownloadURL_HTTPHeader.internalBinaryWrite(message.headers[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Response\n */\nexport const DownloadAPI_GetDownloadURL_Response = new DownloadAPI_GetDownloadURL_Response$Type();\n/**\n * @generated ServiceType for protobuf service MiLaboratories.Controller.Shared.Download\n */\nexport const Download = new ServiceType(\"MiLaboratories.Controller.Shared.Download\", [\n { name: \"GetDownloadURL\", options: { \"google.api.http\": { post: \"/v1/get-download-url\", body: \"*\" } }, I: DownloadA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AkB,SAAS,EAAE,mBAAmB;EAAE,MAAM;EAAwB,MAAM;EAAK,EAAE;CAAE,GAAG;CAAoC,GAAG;CAAqC,CACzL,CAAC"}
1
+ {"version":3,"file":"protocol.cjs","names":["MessageType","UnknownFieldHandler","WireType","ServiceType"],"sources":["../../../../../../../../../src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.ts"],"sourcesContent":["// @generated by protobuf-ts 2.11.1 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none\n// @generated from protobuf file \"github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.proto\" (package \"MiLaboratories.Controller.Shared\", syntax proto3)\n// tslint:disable\nimport { ServiceType } from \"@protobuf-ts/runtime-rpc\";\nimport { WireType } from \"@protobuf-ts/runtime\";\nimport type { BinaryWriteOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryWriter } from \"@protobuf-ts/runtime\";\nimport type { BinaryReadOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryReader } from \"@protobuf-ts/runtime\";\nimport { UnknownFieldHandler } from \"@protobuf-ts/runtime\";\nimport type { PartialMessage } from \"@protobuf-ts/runtime\";\nimport { reflectionMergePartial } from \"@protobuf-ts/runtime\";\nimport { MessageType } from \"@protobuf-ts/runtime\";\n/**\n * @generated from protobuf message MiLaboratories.Controller.Shared.DownloadAPI\n */\nexport interface DownloadAPI {\n}\n/**\n * @generated from protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL\n */\nexport interface DownloadAPI_GetDownloadURL {\n}\n/**\n * @generated from protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Request\n */\nexport interface DownloadAPI_GetDownloadURL_Request {\n /**\n * @generated from protobuf field: uint64 resource_id = 1\n */\n resourceId: bigint;\n /**\n * Signature proving the caller is authorized to access this resource.\n *\n * @generated from protobuf field: optional bytes resource_signature = 3\n */\n resourceSignature?: Uint8Array;\n /**\n * Pass `true` here if the blob will be downloaded from the internal network,\n * e.g. controllers could use this if they are trying to download something from the internal network.\n * For backward compatibility, by default pl treats all requests as from the external network.\n *\n * @generated from protobuf field: bool is_internal_use = 2\n */\n isInternalUse: boolean;\n}\n/**\n * @generated from protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader\n */\nexport interface DownloadAPI_GetDownloadURL_HTTPHeader {\n /**\n * @generated from protobuf field: string name = 1\n */\n name: string;\n /**\n * @generated from protobuf field: string value = 2\n */\n value: string;\n}\n/**\n * @generated from protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Response\n */\nexport interface DownloadAPI_GetDownloadURL_Response {\n /**\n * @generated from protobuf field: string download_url = 1\n */\n downloadUrl: string;\n /**\n * @generated from protobuf field: repeated MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader headers = 2\n */\n headers: DownloadAPI_GetDownloadURL_HTTPHeader[];\n}\n// @generated message type with reflection information, may provide speed optimized methods\nclass DownloadAPI$Type extends MessageType<DownloadAPI> {\n constructor() {\n super(\"MiLaboratories.Controller.Shared.DownloadAPI\", []);\n }\n create(value?: PartialMessage<DownloadAPI>): DownloadAPI {\n const message = globalThis.Object.create((this.messagePrototype!));\n if (value !== undefined)\n reflectionMergePartial<DownloadAPI>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadAPI): DownloadAPI {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: DownloadAPI, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.DownloadAPI\n */\nexport const DownloadAPI = new DownloadAPI$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass DownloadAPI_GetDownloadURL$Type extends MessageType<DownloadAPI_GetDownloadURL> {\n constructor() {\n super(\"MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL\", []);\n }\n create(value?: PartialMessage<DownloadAPI_GetDownloadURL>): DownloadAPI_GetDownloadURL {\n const message = globalThis.Object.create((this.messagePrototype!));\n if (value !== undefined)\n reflectionMergePartial<DownloadAPI_GetDownloadURL>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadAPI_GetDownloadURL): DownloadAPI_GetDownloadURL {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: DownloadAPI_GetDownloadURL, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL\n */\nexport const DownloadAPI_GetDownloadURL = new DownloadAPI_GetDownloadURL$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass DownloadAPI_GetDownloadURL_Request$Type extends MessageType<DownloadAPI_GetDownloadURL_Request> {\n constructor() {\n super(\"MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Request\", [\n { no: 1, name: \"resource_id\", kind: \"scalar\", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },\n { no: 3, name: \"resource_signature\", kind: \"scalar\", opt: true, T: 12 /*ScalarType.BYTES*/ },\n { no: 2, name: \"is_internal_use\", kind: \"scalar\", T: 8 /*ScalarType.BOOL*/ }\n ]);\n }\n create(value?: PartialMessage<DownloadAPI_GetDownloadURL_Request>): DownloadAPI_GetDownloadURL_Request {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.resourceId = 0n;\n message.isInternalUse = false;\n if (value !== undefined)\n reflectionMergePartial<DownloadAPI_GetDownloadURL_Request>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadAPI_GetDownloadURL_Request): DownloadAPI_GetDownloadURL_Request {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* uint64 resource_id */ 1:\n message.resourceId = reader.uint64().toBigInt();\n break;\n case /* optional bytes resource_signature */ 3:\n message.resourceSignature = reader.bytes();\n break;\n case /* bool is_internal_use */ 2:\n message.isInternalUse = reader.bool();\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: DownloadAPI_GetDownloadURL_Request, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* uint64 resource_id = 1; */\n if (message.resourceId !== 0n)\n writer.tag(1, WireType.Varint).uint64(message.resourceId);\n /* bool is_internal_use = 2; */\n if (message.isInternalUse !== false)\n writer.tag(2, WireType.Varint).bool(message.isInternalUse);\n /* optional bytes resource_signature = 3; */\n if (message.resourceSignature !== undefined)\n writer.tag(3, WireType.LengthDelimited).bytes(message.resourceSignature);\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Request\n */\nexport const DownloadAPI_GetDownloadURL_Request = new DownloadAPI_GetDownloadURL_Request$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass DownloadAPI_GetDownloadURL_HTTPHeader$Type extends MessageType<DownloadAPI_GetDownloadURL_HTTPHeader> {\n constructor() {\n super(\"MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader\", [\n { no: 1, name: \"name\", kind: \"scalar\", T: 9 /*ScalarType.STRING*/ },\n { no: 2, name: \"value\", kind: \"scalar\", T: 9 /*ScalarType.STRING*/ }\n ]);\n }\n create(value?: PartialMessage<DownloadAPI_GetDownloadURL_HTTPHeader>): DownloadAPI_GetDownloadURL_HTTPHeader {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.name = \"\";\n message.value = \"\";\n if (value !== undefined)\n reflectionMergePartial<DownloadAPI_GetDownloadURL_HTTPHeader>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadAPI_GetDownloadURL_HTTPHeader): DownloadAPI_GetDownloadURL_HTTPHeader {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* string name */ 1:\n message.name = reader.string();\n break;\n case /* string value */ 2:\n message.value = reader.string();\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: DownloadAPI_GetDownloadURL_HTTPHeader, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* string name = 1; */\n if (message.name !== \"\")\n writer.tag(1, WireType.LengthDelimited).string(message.name);\n /* string value = 2; */\n if (message.value !== \"\")\n writer.tag(2, WireType.LengthDelimited).string(message.value);\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader\n */\nexport const DownloadAPI_GetDownloadURL_HTTPHeader = new DownloadAPI_GetDownloadURL_HTTPHeader$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass DownloadAPI_GetDownloadURL_Response$Type extends MessageType<DownloadAPI_GetDownloadURL_Response> {\n constructor() {\n super(\"MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Response\", [\n { no: 1, name: \"download_url\", kind: \"scalar\", T: 9 /*ScalarType.STRING*/ },\n { no: 2, name: \"headers\", kind: \"message\", repeat: 2 /*RepeatType.UNPACKED*/, T: () => DownloadAPI_GetDownloadURL_HTTPHeader }\n ]);\n }\n create(value?: PartialMessage<DownloadAPI_GetDownloadURL_Response>): DownloadAPI_GetDownloadURL_Response {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.downloadUrl = \"\";\n message.headers = [];\n if (value !== undefined)\n reflectionMergePartial<DownloadAPI_GetDownloadURL_Response>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadAPI_GetDownloadURL_Response): DownloadAPI_GetDownloadURL_Response {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* string download_url */ 1:\n message.downloadUrl = reader.string();\n break;\n case /* repeated MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader headers */ 2:\n message.headers.push(DownloadAPI_GetDownloadURL_HTTPHeader.internalBinaryRead(reader, reader.uint32(), options));\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: DownloadAPI_GetDownloadURL_Response, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* string download_url = 1; */\n if (message.downloadUrl !== \"\")\n writer.tag(1, WireType.LengthDelimited).string(message.downloadUrl);\n /* repeated MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader headers = 2; */\n for (let i = 0; i < message.headers.length; i++)\n DownloadAPI_GetDownloadURL_HTTPHeader.internalBinaryWrite(message.headers[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Response\n */\nexport const DownloadAPI_GetDownloadURL_Response = new DownloadAPI_GetDownloadURL_Response$Type();\n/**\n * @generated ServiceType for protobuf service MiLaboratories.Controller.Shared.Download\n */\nexport const Download = new ServiceType(\"MiLaboratories.Controller.Shared.Download\", [\n { name: \"GetDownloadURL\", options: { \"google.api.http\": { post: \"/v1/get-download-url\", body: \"*\" } }, I: DownloadAPI_GetDownloadURL_Request, O: DownloadAPI_GetDownloadURL_Response }\n]);\n"],"mappings":";;;;;AAyEA,IAAM,mBAAN,cAA+BA,iCAAyB;CACpD,cAAc;AACV,QAAM,gDAAgD,EAAE,CAAC;;CAE7D,OAAO,OAAkD;EACrD,MAAM,UAAU,WAAW,OAAO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M;CAAkB,SAAS,EAAE,mBAAmB;EAAE,MAAM;EAAwB,MAAM;EAAK,EAAE;CAAE,GAAG;CAAoC,GAAG;CAAqC,CACzL,CAAC"}
@@ -5,7 +5,7 @@ let _protobuf_ts_runtime_rpc = require("@protobuf-ts/runtime-rpc");
5
5
  //#region src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.ts
6
6
  /**
7
7
  *
8
- * Download provides access to any data, that can be downloaded via network.
8
+ * Download provides access to any data that can be downloaded over the network.
9
9
  *
10
10
  *
11
11
  * @generated from protobuf service MiLaboratories.Controller.Shared.Download
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.client.cjs","names":["Download"],"sources":["../../../../../../../../../src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.ts"],"sourcesContent":["// @generated by protobuf-ts 2.11.1 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none\n// @generated from protobuf file \"github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.proto\" (package \"MiLaboratories.Controller.Shared\", syntax proto3)\n// tslint:disable\nimport type { RpcTransport } from \"@protobuf-ts/runtime-rpc\";\nimport type { ServiceInfo } from \"@protobuf-ts/runtime-rpc\";\nimport { Download } from \"./protocol\";\nimport { stackIntercept } from \"@protobuf-ts/runtime-rpc\";\nimport type { DownloadAPI_GetDownloadURL_Response } from \"./protocol\";\nimport type { DownloadAPI_GetDownloadURL_Request } from \"./protocol\";\nimport type { UnaryCall } from \"@protobuf-ts/runtime-rpc\";\nimport type { RpcOptions } from \"@protobuf-ts/runtime-rpc\";\n/**\n *\n * Download provides access to any data, that can be downloaded via network.\n *\n *\n * @generated from protobuf service MiLaboratories.Controller.Shared.Download\n */\nexport interface IDownloadClient {\n /**\n * @generated from protobuf rpc: GetDownloadURL\n */\n getDownloadURL(input: DownloadAPI_GetDownloadURL_Request, options?: RpcOptions): UnaryCall<DownloadAPI_GetDownloadURL_Request, DownloadAPI_GetDownloadURL_Response>;\n}\n/**\n *\n * Download provides access to any data, that can be downloaded via network.\n *\n *\n * @generated from protobuf service MiLaboratories.Controller.Shared.Download\n */\nexport class DownloadClient implements IDownloadClient, ServiceInfo {\n typeName = Download.typeName;\n methods = Download.methods;\n options = Download.options;\n constructor(private readonly _transport: RpcTransport) {\n }\n /**\n * @generated from protobuf rpc: GetDownloadURL\n */\n getDownloadURL(input: DownloadAPI_GetDownloadURL_Request, options?: RpcOptions): UnaryCall<DownloadAPI_GetDownloadURL_Request, DownloadAPI_GetDownloadURL_Response> {\n const method = this.methods[0], opt = this._transport.mergeOptions(options);\n return stackIntercept<DownloadAPI_GetDownloadURL_Request, DownloadAPI_GetDownloadURL_Response>(\"unary\", this._transport, method, opt, input);\n }\n}\n"],"mappings":";;;;;;;;;;;;AA+BA,IAAa,iBAAb,MAAoE;CAChE,WAAWA,0BAAS;CACpB,UAAUA,0BAAS;CACnB,UAAUA,0BAAS;CACnB,YAAY,AAAiB,YAA0B;EAA1B;;;;;CAK7B,eAAe,OAA2C,SAA0G;EAChK,MAAM,SAAS,KAAK,QAAQ,IAAI,MAAM,KAAK,WAAW,aAAa,QAAQ;AAC3E,sDAA+F,SAAS,KAAK,YAAY,QAAQ,KAAK,MAAM"}
1
+ {"version":3,"file":"protocol.client.cjs","names":["Download"],"sources":["../../../../../../../../../src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.ts"],"sourcesContent":["// @generated by protobuf-ts 2.11.1 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none\n// @generated from protobuf file \"github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.proto\" (package \"MiLaboratories.Controller.Shared\", syntax proto3)\n// tslint:disable\nimport type { RpcTransport } from \"@protobuf-ts/runtime-rpc\";\nimport type { ServiceInfo } from \"@protobuf-ts/runtime-rpc\";\nimport { Download } from \"./protocol\";\nimport { stackIntercept } from \"@protobuf-ts/runtime-rpc\";\nimport type { DownloadAPI_GetDownloadURL_Response } from \"./protocol\";\nimport type { DownloadAPI_GetDownloadURL_Request } from \"./protocol\";\nimport type { UnaryCall } from \"@protobuf-ts/runtime-rpc\";\nimport type { RpcOptions } from \"@protobuf-ts/runtime-rpc\";\n/**\n *\n * Download provides access to any data that can be downloaded over the network.\n *\n *\n * @generated from protobuf service MiLaboratories.Controller.Shared.Download\n */\nexport interface IDownloadClient {\n /**\n * @generated from protobuf rpc: GetDownloadURL\n */\n getDownloadURL(input: DownloadAPI_GetDownloadURL_Request, options?: RpcOptions): UnaryCall<DownloadAPI_GetDownloadURL_Request, DownloadAPI_GetDownloadURL_Response>;\n}\n/**\n *\n * Download provides access to any data that can be downloaded over the network.\n *\n *\n * @generated from protobuf service MiLaboratories.Controller.Shared.Download\n */\nexport class DownloadClient implements IDownloadClient, ServiceInfo {\n typeName = Download.typeName;\n methods = Download.methods;\n options = Download.options;\n constructor(private readonly _transport: RpcTransport) {\n }\n /**\n * @generated from protobuf rpc: GetDownloadURL\n */\n getDownloadURL(input: DownloadAPI_GetDownloadURL_Request, options?: RpcOptions): UnaryCall<DownloadAPI_GetDownloadURL_Request, DownloadAPI_GetDownloadURL_Response> {\n const method = this.methods[0], opt = this._transport.mergeOptions(options);\n return stackIntercept<DownloadAPI_GetDownloadURL_Request, DownloadAPI_GetDownloadURL_Response>(\"unary\", this._transport, method, opt, input);\n }\n}\n"],"mappings":";;;;;;;;;;;;AA+BA,IAAa,iBAAb,MAAoE;CAChE,WAAWA,0BAAS;CACpB,UAAUA,0BAAS;CACnB,UAAUA,0BAAS;CACnB,YAAY,AAAiB,YAA0B;EAA1B;;;;;CAK7B,eAAe,OAA2C,SAA0G;EAChK,MAAM,SAAS,KAAK,QAAQ,IAAI,MAAM,KAAK,WAAW,aAAa,QAAQ;AAC3E,sDAA+F,SAAS,KAAK,YAAY,QAAQ,KAAK,MAAM"}
@@ -6,7 +6,7 @@ import * as _protobuf_ts_runtime0 from "@protobuf-ts/runtime";
6
6
  //#region src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.d.ts
7
7
  /**
8
8
  *
9
- * Download provides access to any data, that can be downloaded via network.
9
+ * Download provides access to any data that can be downloaded over the network.
10
10
  *
11
11
  *
12
12
  * @generated from protobuf service MiLaboratories.Controller.Shared.Download
@@ -19,7 +19,7 @@ interface IDownloadClient {
19
19
  }
20
20
  /**
21
21
  *
22
- * Download provides access to any data, that can be downloaded via network.
22
+ * Download provides access to any data that can be downloaded over the network.
23
23
  *
24
24
  *
25
25
  * @generated from protobuf service MiLaboratories.Controller.Shared.Download
@@ -4,7 +4,7 @@ import { stackIntercept } from "@protobuf-ts/runtime-rpc";
4
4
  //#region src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.ts
5
5
  /**
6
6
  *
7
- * Download provides access to any data, that can be downloaded via network.
7
+ * Download provides access to any data that can be downloaded over the network.
8
8
  *
9
9
  *
10
10
  * @generated from protobuf service MiLaboratories.Controller.Shared.Download
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.client.js","names":[],"sources":["../../../../../../../../../src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.ts"],"sourcesContent":["// @generated by protobuf-ts 2.11.1 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none\n// @generated from protobuf file \"github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.proto\" (package \"MiLaboratories.Controller.Shared\", syntax proto3)\n// tslint:disable\nimport type { RpcTransport } from \"@protobuf-ts/runtime-rpc\";\nimport type { ServiceInfo } from \"@protobuf-ts/runtime-rpc\";\nimport { Download } from \"./protocol\";\nimport { stackIntercept } from \"@protobuf-ts/runtime-rpc\";\nimport type { DownloadAPI_GetDownloadURL_Response } from \"./protocol\";\nimport type { DownloadAPI_GetDownloadURL_Request } from \"./protocol\";\nimport type { UnaryCall } from \"@protobuf-ts/runtime-rpc\";\nimport type { RpcOptions } from \"@protobuf-ts/runtime-rpc\";\n/**\n *\n * Download provides access to any data, that can be downloaded via network.\n *\n *\n * @generated from protobuf service MiLaboratories.Controller.Shared.Download\n */\nexport interface IDownloadClient {\n /**\n * @generated from protobuf rpc: GetDownloadURL\n */\n getDownloadURL(input: DownloadAPI_GetDownloadURL_Request, options?: RpcOptions): UnaryCall<DownloadAPI_GetDownloadURL_Request, DownloadAPI_GetDownloadURL_Response>;\n}\n/**\n *\n * Download provides access to any data, that can be downloaded via network.\n *\n *\n * @generated from protobuf service MiLaboratories.Controller.Shared.Download\n */\nexport class DownloadClient implements IDownloadClient, ServiceInfo {\n typeName = Download.typeName;\n methods = Download.methods;\n options = Download.options;\n constructor(private readonly _transport: RpcTransport) {\n }\n /**\n * @generated from protobuf rpc: GetDownloadURL\n */\n getDownloadURL(input: DownloadAPI_GetDownloadURL_Request, options?: RpcOptions): UnaryCall<DownloadAPI_GetDownloadURL_Request, DownloadAPI_GetDownloadURL_Response> {\n const method = this.methods[0], opt = this._transport.mergeOptions(options);\n return stackIntercept<DownloadAPI_GetDownloadURL_Request, DownloadAPI_GetDownloadURL_Response>(\"unary\", this._transport, method, opt, input);\n }\n}\n"],"mappings":";;;;;;;;;;;AA+BA,IAAa,iBAAb,MAAoE;CAChE,WAAW,SAAS;CACpB,UAAU,SAAS;CACnB,UAAU,SAAS;CACnB,YAAY,AAAiB,YAA0B;EAA1B;;;;;CAK7B,eAAe,OAA2C,SAA0G;EAChK,MAAM,SAAS,KAAK,QAAQ,IAAI,MAAM,KAAK,WAAW,aAAa,QAAQ;AAC3E,SAAO,eAAwF,SAAS,KAAK,YAAY,QAAQ,KAAK,MAAM"}
1
+ {"version":3,"file":"protocol.client.js","names":[],"sources":["../../../../../../../../../src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.client.ts"],"sourcesContent":["// @generated by protobuf-ts 2.11.1 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none\n// @generated from protobuf file \"github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.proto\" (package \"MiLaboratories.Controller.Shared\", syntax proto3)\n// tslint:disable\nimport type { RpcTransport } from \"@protobuf-ts/runtime-rpc\";\nimport type { ServiceInfo } from \"@protobuf-ts/runtime-rpc\";\nimport { Download } from \"./protocol\";\nimport { stackIntercept } from \"@protobuf-ts/runtime-rpc\";\nimport type { DownloadAPI_GetDownloadURL_Response } from \"./protocol\";\nimport type { DownloadAPI_GetDownloadURL_Request } from \"./protocol\";\nimport type { UnaryCall } from \"@protobuf-ts/runtime-rpc\";\nimport type { RpcOptions } from \"@protobuf-ts/runtime-rpc\";\n/**\n *\n * Download provides access to any data that can be downloaded over the network.\n *\n *\n * @generated from protobuf service MiLaboratories.Controller.Shared.Download\n */\nexport interface IDownloadClient {\n /**\n * @generated from protobuf rpc: GetDownloadURL\n */\n getDownloadURL(input: DownloadAPI_GetDownloadURL_Request, options?: RpcOptions): UnaryCall<DownloadAPI_GetDownloadURL_Request, DownloadAPI_GetDownloadURL_Response>;\n}\n/**\n *\n * Download provides access to any data that can be downloaded over the network.\n *\n *\n * @generated from protobuf service MiLaboratories.Controller.Shared.Download\n */\nexport class DownloadClient implements IDownloadClient, ServiceInfo {\n typeName = Download.typeName;\n methods = Download.methods;\n options = Download.options;\n constructor(private readonly _transport: RpcTransport) {\n }\n /**\n * @generated from protobuf rpc: GetDownloadURL\n */\n getDownloadURL(input: DownloadAPI_GetDownloadURL_Request, options?: RpcOptions): UnaryCall<DownloadAPI_GetDownloadURL_Request, DownloadAPI_GetDownloadURL_Response> {\n const method = this.methods[0], opt = this._transport.mergeOptions(options);\n return stackIntercept<DownloadAPI_GetDownloadURL_Request, DownloadAPI_GetDownloadURL_Response>(\"unary\", this._transport, method, opt, input);\n }\n}\n"],"mappings":";;;;;;;;;;;AA+BA,IAAa,iBAAb,MAAoE;CAChE,WAAW,SAAS;CACpB,UAAU,SAAS;CACnB,UAAU,SAAS;CACnB,YAAY,AAAiB,YAA0B;EAA1B;;;;;CAK7B,eAAe,OAA2C,SAA0G;EAChK,MAAM,SAAS,KAAK,QAAQ,IAAI,MAAM,KAAK,WAAW,aAAa,QAAQ;AAC3E,SAAO,eAAwF,SAAS,KAAK,YAAY,QAAQ,KAAK,MAAM"}
@@ -11,9 +11,15 @@ interface DownloadAPI_GetDownloadURL_Request {
11
11
  */
12
12
  resourceId: bigint;
13
13
  /**
14
- * Pass `true` here if the blob will be downloaded from internal network,
15
- * e.g. controllers could use this if they are trying to download something from internal network.
16
- * For backward compatibility, by default pl treats all requests as from external network.
14
+ * Signature proving the caller is authorized to access this resource.
15
+ *
16
+ * @generated from protobuf field: optional bytes resource_signature = 3
17
+ */
18
+ resourceSignature?: Uint8Array;
19
+ /**
20
+ * Pass `true` here if the blob will be downloaded from the internal network,
21
+ * e.g. controllers could use this if they are trying to download something from the internal network.
22
+ * For backward compatibility, by default pl treats all requests as from the external network.
17
23
  *
18
24
  * @generated from protobuf field: bool is_internal_use = 2
19
25
  */
@@ -24,11 +30,11 @@ interface DownloadAPI_GetDownloadURL_Request {
24
30
  */
25
31
  interface DownloadAPI_GetDownloadURL_HTTPHeader {
26
32
  /**
27
- * @generated from protobuf field: string Name = 1
33
+ * @generated from protobuf field: string name = 1
28
34
  */
29
35
  name: string;
30
36
  /**
31
- * @generated from protobuf field: string Value = 2
37
+ * @generated from protobuf field: string value = 2
32
38
  */
33
39
  value: string;
34
40
  }
@@ -70,18 +70,28 @@ var DownloadAPI_GetDownloadURL$Type = class extends MessageType {
70
70
  const DownloadAPI_GetDownloadURL = new DownloadAPI_GetDownloadURL$Type();
71
71
  var DownloadAPI_GetDownloadURL_Request$Type = class extends MessageType {
72
72
  constructor() {
73
- super("MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Request", [{
74
- no: 1,
75
- name: "resource_id",
76
- kind: "scalar",
77
- T: 4,
78
- L: 0
79
- }, {
80
- no: 2,
81
- name: "is_internal_use",
82
- kind: "scalar",
83
- T: 8
84
- }]);
73
+ super("MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Request", [
74
+ {
75
+ no: 1,
76
+ name: "resource_id",
77
+ kind: "scalar",
78
+ T: 4,
79
+ L: 0
80
+ },
81
+ {
82
+ no: 3,
83
+ name: "resource_signature",
84
+ kind: "scalar",
85
+ opt: true,
86
+ T: 12
87
+ },
88
+ {
89
+ no: 2,
90
+ name: "is_internal_use",
91
+ kind: "scalar",
92
+ T: 8
93
+ }
94
+ ]);
85
95
  }
86
96
  create(value) {
87
97
  const message = globalThis.Object.create(this.messagePrototype);
@@ -98,6 +108,9 @@ var DownloadAPI_GetDownloadURL_Request$Type = class extends MessageType {
98
108
  case 1:
99
109
  message.resourceId = reader.uint64().toBigInt();
100
110
  break;
111
+ case 3:
112
+ message.resourceSignature = reader.bytes();
113
+ break;
101
114
  case 2:
102
115
  message.isInternalUse = reader.bool();
103
116
  break;
@@ -113,6 +126,7 @@ var DownloadAPI_GetDownloadURL_Request$Type = class extends MessageType {
113
126
  internalBinaryWrite(message, writer, options) {
114
127
  if (message.resourceId !== 0n) writer.tag(1, WireType.Varint).uint64(message.resourceId);
115
128
  if (message.isInternalUse !== false) writer.tag(2, WireType.Varint).bool(message.isInternalUse);
129
+ if (message.resourceSignature !== void 0) writer.tag(3, WireType.LengthDelimited).bytes(message.resourceSignature);
116
130
  let u = options.writeUnknownFields;
117
131
  if (u !== false) (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);
118
132
  return writer;
@@ -126,15 +140,13 @@ var DownloadAPI_GetDownloadURL_HTTPHeader$Type = class extends MessageType {
126
140
  constructor() {
127
141
  super("MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader", [{
128
142
  no: 1,
129
- name: "Name",
143
+ name: "name",
130
144
  kind: "scalar",
131
- jsonName: "Name",
132
145
  T: 9
133
146
  }, {
134
147
  no: 2,
135
- name: "Value",
148
+ name: "value",
136
149
  kind: "scalar",
137
- jsonName: "Value",
138
150
  T: 9
139
151
  }]);
140
152
  }
@@ -1 +1 @@
1
- {"version":3,"file":"protocol.js","names":[],"sources":["../../../../../../../../../src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.ts"],"sourcesContent":["// @generated by protobuf-ts 2.11.1 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none\n// @generated from protobuf file \"github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.proto\" (package \"MiLaboratories.Controller.Shared\", syntax proto3)\n// tslint:disable\nimport { ServiceType } from \"@protobuf-ts/runtime-rpc\";\nimport { WireType } from \"@protobuf-ts/runtime\";\nimport type { BinaryWriteOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryWriter } from \"@protobuf-ts/runtime\";\nimport type { BinaryReadOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryReader } from \"@protobuf-ts/runtime\";\nimport { UnknownFieldHandler } from \"@protobuf-ts/runtime\";\nimport type { PartialMessage } from \"@protobuf-ts/runtime\";\nimport { reflectionMergePartial } from \"@protobuf-ts/runtime\";\nimport { MessageType } from \"@protobuf-ts/runtime\";\n/**\n * @generated from protobuf message MiLaboratories.Controller.Shared.DownloadAPI\n */\nexport interface DownloadAPI {\n}\n/**\n * @generated from protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL\n */\nexport interface DownloadAPI_GetDownloadURL {\n}\n/**\n * @generated from protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Request\n */\nexport interface DownloadAPI_GetDownloadURL_Request {\n /**\n * @generated from protobuf field: uint64 resource_id = 1\n */\n resourceId: bigint;\n /**\n * Pass `true` here if the blob will be downloaded from internal network,\n * e.g. controllers could use this if they are trying to download something from internal network.\n * For backward compatibility, by default pl treats all requests as from external network.\n *\n * @generated from protobuf field: bool is_internal_use = 2\n */\n isInternalUse: boolean;\n}\n/**\n * @generated from protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader\n */\nexport interface DownloadAPI_GetDownloadURL_HTTPHeader {\n /**\n * @generated from protobuf field: string Name = 1\n */\n name: string;\n /**\n * @generated from protobuf field: string Value = 2\n */\n value: string;\n}\n/**\n * @generated from protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Response\n */\nexport interface DownloadAPI_GetDownloadURL_Response {\n /**\n * @generated from protobuf field: string download_url = 1\n */\n downloadUrl: string;\n /**\n * @generated from protobuf field: repeated MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader headers = 2\n */\n headers: DownloadAPI_GetDownloadURL_HTTPHeader[];\n}\n// @generated message type with reflection information, may provide speed optimized methods\nclass DownloadAPI$Type extends MessageType<DownloadAPI> {\n constructor() {\n super(\"MiLaboratories.Controller.Shared.DownloadAPI\", []);\n }\n create(value?: PartialMessage<DownloadAPI>): DownloadAPI {\n const message = globalThis.Object.create((this.messagePrototype!));\n if (value !== undefined)\n reflectionMergePartial<DownloadAPI>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadAPI): DownloadAPI {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: DownloadAPI, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.DownloadAPI\n */\nexport const DownloadAPI = new DownloadAPI$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass DownloadAPI_GetDownloadURL$Type extends MessageType<DownloadAPI_GetDownloadURL> {\n constructor() {\n super(\"MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL\", []);\n }\n create(value?: PartialMessage<DownloadAPI_GetDownloadURL>): DownloadAPI_GetDownloadURL {\n const message = globalThis.Object.create((this.messagePrototype!));\n if (value !== undefined)\n reflectionMergePartial<DownloadAPI_GetDownloadURL>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadAPI_GetDownloadURL): DownloadAPI_GetDownloadURL {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: DownloadAPI_GetDownloadURL, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL\n */\nexport const DownloadAPI_GetDownloadURL = new DownloadAPI_GetDownloadURL$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass DownloadAPI_GetDownloadURL_Request$Type extends MessageType<DownloadAPI_GetDownloadURL_Request> {\n constructor() {\n super(\"MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Request\", [\n { no: 1, name: \"resource_id\", kind: \"scalar\", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },\n { no: 2, name: \"is_internal_use\", kind: \"scalar\", T: 8 /*ScalarType.BOOL*/ }\n ]);\n }\n create(value?: PartialMessage<DownloadAPI_GetDownloadURL_Request>): DownloadAPI_GetDownloadURL_Request {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.resourceId = 0n;\n message.isInternalUse = false;\n if (value !== undefined)\n reflectionMergePartial<DownloadAPI_GetDownloadURL_Request>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadAPI_GetDownloadURL_Request): DownloadAPI_GetDownloadURL_Request {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* uint64 resource_id */ 1:\n message.resourceId = reader.uint64().toBigInt();\n break;\n case /* bool is_internal_use */ 2:\n message.isInternalUse = reader.bool();\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: DownloadAPI_GetDownloadURL_Request, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* uint64 resource_id = 1; */\n if (message.resourceId !== 0n)\n writer.tag(1, WireType.Varint).uint64(message.resourceId);\n /* bool is_internal_use = 2; */\n if (message.isInternalUse !== false)\n writer.tag(2, WireType.Varint).bool(message.isInternalUse);\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Request\n */\nexport const DownloadAPI_GetDownloadURL_Request = new DownloadAPI_GetDownloadURL_Request$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass DownloadAPI_GetDownloadURL_HTTPHeader$Type extends MessageType<DownloadAPI_GetDownloadURL_HTTPHeader> {\n constructor() {\n super(\"MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader\", [\n { no: 1, name: \"Name\", kind: \"scalar\", jsonName: \"Name\", T: 9 /*ScalarType.STRING*/ },\n { no: 2, name: \"Value\", kind: \"scalar\", jsonName: \"Value\", T: 9 /*ScalarType.STRING*/ }\n ]);\n }\n create(value?: PartialMessage<DownloadAPI_GetDownloadURL_HTTPHeader>): DownloadAPI_GetDownloadURL_HTTPHeader {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.name = \"\";\n message.value = \"\";\n if (value !== undefined)\n reflectionMergePartial<DownloadAPI_GetDownloadURL_HTTPHeader>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadAPI_GetDownloadURL_HTTPHeader): DownloadAPI_GetDownloadURL_HTTPHeader {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* string Name */ 1:\n message.name = reader.string();\n break;\n case /* string Value */ 2:\n message.value = reader.string();\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: DownloadAPI_GetDownloadURL_HTTPHeader, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* string Name = 1; */\n if (message.name !== \"\")\n writer.tag(1, WireType.LengthDelimited).string(message.name);\n /* string Value = 2; */\n if (message.value !== \"\")\n writer.tag(2, WireType.LengthDelimited).string(message.value);\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader\n */\nexport const DownloadAPI_GetDownloadURL_HTTPHeader = new DownloadAPI_GetDownloadURL_HTTPHeader$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass DownloadAPI_GetDownloadURL_Response$Type extends MessageType<DownloadAPI_GetDownloadURL_Response> {\n constructor() {\n super(\"MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Response\", [\n { no: 1, name: \"download_url\", kind: \"scalar\", T: 9 /*ScalarType.STRING*/ },\n { no: 2, name: \"headers\", kind: \"message\", repeat: 2 /*RepeatType.UNPACKED*/, T: () => DownloadAPI_GetDownloadURL_HTTPHeader }\n ]);\n }\n create(value?: PartialMessage<DownloadAPI_GetDownloadURL_Response>): DownloadAPI_GetDownloadURL_Response {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.downloadUrl = \"\";\n message.headers = [];\n if (value !== undefined)\n reflectionMergePartial<DownloadAPI_GetDownloadURL_Response>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadAPI_GetDownloadURL_Response): DownloadAPI_GetDownloadURL_Response {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* string download_url */ 1:\n message.downloadUrl = reader.string();\n break;\n case /* repeated MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader headers */ 2:\n message.headers.push(DownloadAPI_GetDownloadURL_HTTPHeader.internalBinaryRead(reader, reader.uint32(), options));\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: DownloadAPI_GetDownloadURL_Response, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* string download_url = 1; */\n if (message.downloadUrl !== \"\")\n writer.tag(1, WireType.LengthDelimited).string(message.downloadUrl);\n /* repeated MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader headers = 2; */\n for (let i = 0; i < message.headers.length; i++)\n DownloadAPI_GetDownloadURL_HTTPHeader.internalBinaryWrite(message.headers[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Response\n */\nexport const DownloadAPI_GetDownloadURL_Response = new DownloadAPI_GetDownloadURL_Response$Type();\n/**\n * @generated ServiceType for protobuf service MiLaboratories.Controller.Shared.Download\n */\nexport const Download = new ServiceType(\"MiLaboratories.Controller.Shared.Download\", [\n { name: \"GetDownloadURL\", options: { \"google.api.http\": { post: \"/v1/get-download-url\", body: \"*\" } }, I: DownloadAPI_GetDownloadURL_Request, O: DownloadAPI_GetDownloadURL_Response }\n]);\n"],"mappings":";;;;AAmEA,IAAM,mBAAN,cAA+B,YAAyB;CACpD,cAAc;AACV,QAAM,gDAAgD,EAAE,CAAC;;CAE7D,OAAO,OAAkD;EACrD,MAAM,UAAU,WAAW,OAAO,OAAQ,KAAK,iBAAmB;AAClE,MAAI,UAAU,OACV,wBAAoC,MAAM,SAAS,MAAM;AAC7D,SAAO;;CAEX,mBAAmB,QAAuB,QAAgB,SAA4B,QAAmC;EACrH,IAAI,UAAU,UAAU,KAAK,QAAQ,EAAE,MAAM,OAAO,MAAM;AAC1D,SAAO,OAAO,MAAM,KAAK;GACrB,IAAI,CAAC,SAAS,YAAY,OAAO,KAAK;AACtC,WAAQ,SAAR;IACI;KACI,IAAI,IAAI,QAAQ;AAChB,SAAI,MAAM,QACN,OAAM,IAAI,WAAW,MAAM,iBAAiB,QAAQ,cAAc,SAAS,QAAQ,KAAK,WAAW;KACvG,IAAI,IAAI,OAAO,K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SAAS,UAAU,EAAE;;;AAG3G,SAAO;;CAEX,oBAAoB,SAA8C,QAAuB,SAA4C;AAEjI,MAAI,QAAQ,gBAAgB,GACxB,QAAO,IAAI,GAAG,SAAS,gBAAgB,CAAC,OAAO,QAAQ,YAAY;AAEvE,OAAK,IAAI,IAAI,GAAG,IAAI,QAAQ,QAAQ,QAAQ,IACxC,uCAAsC,oBAAoB,QAAQ,QAAQ,IAAI,OAAO,IAAI,GAAG,SAAS,gBAAgB,CAAC,MAAM,EAAE,QAAQ,CAAC,MAAM;EACjJ,IAAI,IAAI,QAAQ;AAChB,MAAI,MAAM,MACN,EAAC,KAAK,OAAO,oBAAoB,UAAU,GAAG,KAAK,UAAU,SAAS,OAAO;AACjF,SAAO;;;;;;AAMf,MAAa,sCAAsC,IAAI,0CAA0C;;;;AAIjG,MAAa,WAAW,IAAI,YAAY,6CAA6C,CACjF;CAAE,MAAM;CAAkB,SAAS,EAAE,mBAAmB;EAAE,MAAM;EAAwB,MAAM;EAAK,EAAE;CAAE,GAAG;CAAoC,GAAG;CAAqC,CACzL,CAAC"}
1
+ {"version":3,"file":"protocol.js","names":[],"sources":["../../../../../../../../../src/proto-grpc/github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.ts"],"sourcesContent":["// @generated by protobuf-ts 2.11.1 with parameter client_generic,optimize_speed,generate_dependencies,force_server_none\n// @generated from protobuf file \"github.com/milaboratory/pl/controllers/shared/grpc/downloadapi/protocol.proto\" (package \"MiLaboratories.Controller.Shared\", syntax proto3)\n// tslint:disable\nimport { ServiceType } from \"@protobuf-ts/runtime-rpc\";\nimport { WireType } from \"@protobuf-ts/runtime\";\nimport type { BinaryWriteOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryWriter } from \"@protobuf-ts/runtime\";\nimport type { BinaryReadOptions } from \"@protobuf-ts/runtime\";\nimport type { IBinaryReader } from \"@protobuf-ts/runtime\";\nimport { UnknownFieldHandler } from \"@protobuf-ts/runtime\";\nimport type { PartialMessage } from \"@protobuf-ts/runtime\";\nimport { reflectionMergePartial } from \"@protobuf-ts/runtime\";\nimport { MessageType } from \"@protobuf-ts/runtime\";\n/**\n * @generated from protobuf message MiLaboratories.Controller.Shared.DownloadAPI\n */\nexport interface DownloadAPI {\n}\n/**\n * @generated from protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL\n */\nexport interface DownloadAPI_GetDownloadURL {\n}\n/**\n * @generated from protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Request\n */\nexport interface DownloadAPI_GetDownloadURL_Request {\n /**\n * @generated from protobuf field: uint64 resource_id = 1\n */\n resourceId: bigint;\n /**\n * Signature proving the caller is authorized to access this resource.\n *\n * @generated from protobuf field: optional bytes resource_signature = 3\n */\n resourceSignature?: Uint8Array;\n /**\n * Pass `true` here if the blob will be downloaded from the internal network,\n * e.g. controllers could use this if they are trying to download something from the internal network.\n * For backward compatibility, by default pl treats all requests as from the external network.\n *\n * @generated from protobuf field: bool is_internal_use = 2\n */\n isInternalUse: boolean;\n}\n/**\n * @generated from protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader\n */\nexport interface DownloadAPI_GetDownloadURL_HTTPHeader {\n /**\n * @generated from protobuf field: string name = 1\n */\n name: string;\n /**\n * @generated from protobuf field: string value = 2\n */\n value: string;\n}\n/**\n * @generated from protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Response\n */\nexport interface DownloadAPI_GetDownloadURL_Response {\n /**\n * @generated from protobuf field: string download_url = 1\n */\n downloadUrl: string;\n /**\n * @generated from protobuf field: repeated MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader headers = 2\n */\n headers: DownloadAPI_GetDownloadURL_HTTPHeader[];\n}\n// @generated message type with reflection information, may provide speed optimized methods\nclass DownloadAPI$Type extends MessageType<DownloadAPI> {\n constructor() {\n super(\"MiLaboratories.Controller.Shared.DownloadAPI\", []);\n }\n create(value?: PartialMessage<DownloadAPI>): DownloadAPI {\n const message = globalThis.Object.create((this.messagePrototype!));\n if (value !== undefined)\n reflectionMergePartial<DownloadAPI>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadAPI): DownloadAPI {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: DownloadAPI, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.DownloadAPI\n */\nexport const DownloadAPI = new DownloadAPI$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass DownloadAPI_GetDownloadURL$Type extends MessageType<DownloadAPI_GetDownloadURL> {\n constructor() {\n super(\"MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL\", []);\n }\n create(value?: PartialMessage<DownloadAPI_GetDownloadURL>): DownloadAPI_GetDownloadURL {\n const message = globalThis.Object.create((this.messagePrototype!));\n if (value !== undefined)\n reflectionMergePartial<DownloadAPI_GetDownloadURL>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadAPI_GetDownloadURL): DownloadAPI_GetDownloadURL {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: DownloadAPI_GetDownloadURL, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL\n */\nexport const DownloadAPI_GetDownloadURL = new DownloadAPI_GetDownloadURL$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass DownloadAPI_GetDownloadURL_Request$Type extends MessageType<DownloadAPI_GetDownloadURL_Request> {\n constructor() {\n super(\"MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Request\", [\n { no: 1, name: \"resource_id\", kind: \"scalar\", T: 4 /*ScalarType.UINT64*/, L: 0 /*LongType.BIGINT*/ },\n { no: 3, name: \"resource_signature\", kind: \"scalar\", opt: true, T: 12 /*ScalarType.BYTES*/ },\n { no: 2, name: \"is_internal_use\", kind: \"scalar\", T: 8 /*ScalarType.BOOL*/ }\n ]);\n }\n create(value?: PartialMessage<DownloadAPI_GetDownloadURL_Request>): DownloadAPI_GetDownloadURL_Request {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.resourceId = 0n;\n message.isInternalUse = false;\n if (value !== undefined)\n reflectionMergePartial<DownloadAPI_GetDownloadURL_Request>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadAPI_GetDownloadURL_Request): DownloadAPI_GetDownloadURL_Request {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* uint64 resource_id */ 1:\n message.resourceId = reader.uint64().toBigInt();\n break;\n case /* optional bytes resource_signature */ 3:\n message.resourceSignature = reader.bytes();\n break;\n case /* bool is_internal_use */ 2:\n message.isInternalUse = reader.bool();\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: DownloadAPI_GetDownloadURL_Request, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* uint64 resource_id = 1; */\n if (message.resourceId !== 0n)\n writer.tag(1, WireType.Varint).uint64(message.resourceId);\n /* bool is_internal_use = 2; */\n if (message.isInternalUse !== false)\n writer.tag(2, WireType.Varint).bool(message.isInternalUse);\n /* optional bytes resource_signature = 3; */\n if (message.resourceSignature !== undefined)\n writer.tag(3, WireType.LengthDelimited).bytes(message.resourceSignature);\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Request\n */\nexport const DownloadAPI_GetDownloadURL_Request = new DownloadAPI_GetDownloadURL_Request$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass DownloadAPI_GetDownloadURL_HTTPHeader$Type extends MessageType<DownloadAPI_GetDownloadURL_HTTPHeader> {\n constructor() {\n super(\"MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader\", [\n { no: 1, name: \"name\", kind: \"scalar\", T: 9 /*ScalarType.STRING*/ },\n { no: 2, name: \"value\", kind: \"scalar\", T: 9 /*ScalarType.STRING*/ }\n ]);\n }\n create(value?: PartialMessage<DownloadAPI_GetDownloadURL_HTTPHeader>): DownloadAPI_GetDownloadURL_HTTPHeader {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.name = \"\";\n message.value = \"\";\n if (value !== undefined)\n reflectionMergePartial<DownloadAPI_GetDownloadURL_HTTPHeader>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadAPI_GetDownloadURL_HTTPHeader): DownloadAPI_GetDownloadURL_HTTPHeader {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* string name */ 1:\n message.name = reader.string();\n break;\n case /* string value */ 2:\n message.value = reader.string();\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: DownloadAPI_GetDownloadURL_HTTPHeader, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* string name = 1; */\n if (message.name !== \"\")\n writer.tag(1, WireType.LengthDelimited).string(message.name);\n /* string value = 2; */\n if (message.value !== \"\")\n writer.tag(2, WireType.LengthDelimited).string(message.value);\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader\n */\nexport const DownloadAPI_GetDownloadURL_HTTPHeader = new DownloadAPI_GetDownloadURL_HTTPHeader$Type();\n// @generated message type with reflection information, may provide speed optimized methods\nclass DownloadAPI_GetDownloadURL_Response$Type extends MessageType<DownloadAPI_GetDownloadURL_Response> {\n constructor() {\n super(\"MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Response\", [\n { no: 1, name: \"download_url\", kind: \"scalar\", T: 9 /*ScalarType.STRING*/ },\n { no: 2, name: \"headers\", kind: \"message\", repeat: 2 /*RepeatType.UNPACKED*/, T: () => DownloadAPI_GetDownloadURL_HTTPHeader }\n ]);\n }\n create(value?: PartialMessage<DownloadAPI_GetDownloadURL_Response>): DownloadAPI_GetDownloadURL_Response {\n const message = globalThis.Object.create((this.messagePrototype!));\n message.downloadUrl = \"\";\n message.headers = [];\n if (value !== undefined)\n reflectionMergePartial<DownloadAPI_GetDownloadURL_Response>(this, message, value);\n return message;\n }\n internalBinaryRead(reader: IBinaryReader, length: number, options: BinaryReadOptions, target?: DownloadAPI_GetDownloadURL_Response): DownloadAPI_GetDownloadURL_Response {\n let message = target ?? this.create(), end = reader.pos + length;\n while (reader.pos < end) {\n let [fieldNo, wireType] = reader.tag();\n switch (fieldNo) {\n case /* string download_url */ 1:\n message.downloadUrl = reader.string();\n break;\n case /* repeated MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader headers */ 2:\n message.headers.push(DownloadAPI_GetDownloadURL_HTTPHeader.internalBinaryRead(reader, reader.uint32(), options));\n break;\n default:\n let u = options.readUnknownField;\n if (u === \"throw\")\n throw new globalThis.Error(`Unknown field ${fieldNo} (wire type ${wireType}) for ${this.typeName}`);\n let d = reader.skip(wireType);\n if (u !== false)\n (u === true ? UnknownFieldHandler.onRead : u)(this.typeName, message, fieldNo, wireType, d);\n }\n }\n return message;\n }\n internalBinaryWrite(message: DownloadAPI_GetDownloadURL_Response, writer: IBinaryWriter, options: BinaryWriteOptions): IBinaryWriter {\n /* string download_url = 1; */\n if (message.downloadUrl !== \"\")\n writer.tag(1, WireType.LengthDelimited).string(message.downloadUrl);\n /* repeated MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.HTTPHeader headers = 2; */\n for (let i = 0; i < message.headers.length; i++)\n DownloadAPI_GetDownloadURL_HTTPHeader.internalBinaryWrite(message.headers[i], writer.tag(2, WireType.LengthDelimited).fork(), options).join();\n let u = options.writeUnknownFields;\n if (u !== false)\n (u == true ? UnknownFieldHandler.onWrite : u)(this.typeName, message, writer);\n return writer;\n }\n}\n/**\n * @generated MessageType for protobuf message MiLaboratories.Controller.Shared.DownloadAPI.GetDownloadURL.Response\n */\nexport const DownloadAPI_GetDownloadURL_Response = new DownloadAPI_GetDownloadURL_Response$Type();\n/**\n * @generated ServiceType for protobuf service MiLaboratories.Controller.Shared.Download\n */\nexport const Download = new ServiceType(\"MiLaboratories.Controller.Shared.Download\", [\n { name: \"GetDownloadURL\", options: { \"google.api.http\": { post: \"/v1/get-download-url\", body: \"*\" } }, I: DownloadAPI_GetDownloadURL_Request, O: DownloadAPI_GetDownloadURL_Response }\n]);\n"],"mappings":";;;;AAyEA,IAAM,mBAAN,cAA+B,YAAyB;CACpD,cAAc;AACV,QAAM,gDAAgD,EAAE,CAAC;;CAE7D,OAAO,OAAkD;EACrD,MAAM,UAAU,WAAW,OAAO,OAAQ,KAAK,iBAAmB;AAClE,MAAI,UAAU,OACV,wBAAoC,MAAM,SAAS,MAAM;AAC7D,SAAO;;CAEX,mBAAmB,QAAuB,QAAgB,SAA4B,QAAmC;EACrH,IAAI,UAAU,UAAU,KAAK,QAAQ,EAAE,MAAM,OAAO,MAAM;AAC1D,SAAO,OAAO,MAAM,KAAK;GACrB,IAAI,CAAC,SAAS,YAAY,OAAO,KAAK;AACtC,WAAQ,SAAR;IACI;KACI,IAAI,IAAI,QAAQ;AAChB,SAAI,MAAM,QACN,OAAM,IAAI,WAAW,MAAM,iBAAiB,QAAQ,cAAc,SAAS,QAAQ,KAAK,WAAW;KACvG,IAAI,IAAI,OAAO,KAAK,SAAS;AAC7B,SAAI,MAAM,MACN,EAAC,MAAM,OAAO,oBAAoB,SAAS,GAAG,KAAK,UAAU,SAAS,SAAS,UAAU,EAAE;;;AAG3G,SAAO;;CAEX,oBAAoB,SAAsB,QAAuB,SAA4C;EACzG,IAAI,IAAI,QAAQ;AAChB,MAAI,MAAM,MACN,EAAC,KAAK,OAAO,oBAAoB,UAAU,GAAG,KAAK,UAAU,SAAS,OAAO;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