@azure/container-registry 1.1.1-alpha.20250619.1 → 1.1.1-alpha.20250730.1

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 (130) hide show
  1. package/dist/browser/containerRegistryChallengeHandler.js +6 -3
  2. package/dist/browser/containerRegistryChallengeHandler.js.map +1 -1
  3. package/dist/browser/containerRegistryClient.js +42 -50
  4. package/dist/browser/containerRegistryClient.js.map +1 -1
  5. package/dist/browser/containerRegistryTokenCredential.js +9 -1
  6. package/dist/browser/containerRegistryTokenCredential.js.map +1 -1
  7. package/dist/browser/containerRepository.js +41 -46
  8. package/dist/browser/containerRepository.js.map +1 -1
  9. package/dist/browser/content/containerRegistryContentClient.js +34 -32
  10. package/dist/browser/content/containerRegistryContentClient.js.map +1 -1
  11. package/dist/browser/generated/generatedClient.js +12 -3
  12. package/dist/browser/generated/generatedClient.js.map +1 -1
  13. package/dist/browser/generated/generatedClientContext.js +9 -2
  14. package/dist/browser/generated/generatedClientContext.js.map +1 -1
  15. package/dist/browser/generated/models/mappers.js +63 -29
  16. package/dist/browser/generated/models/mappers.js.map +1 -1
  17. package/dist/browser/generated/operations/authentication.js +1 -0
  18. package/dist/browser/generated/operations/authentication.js.map +1 -1
  19. package/dist/browser/generated/operations/containerRegistry.js +1 -0
  20. package/dist/browser/generated/operations/containerRegistry.js.map +1 -1
  21. package/dist/browser/generated/operations/containerRegistryBlob.js +1 -0
  22. package/dist/browser/generated/operations/containerRegistryBlob.js.map +1 -1
  23. package/dist/browser/registryArtifact.js +69 -53
  24. package/dist/browser/registryArtifact.js.map +1 -1
  25. package/dist/browser/transformations.js +13 -3
  26. package/dist/browser/transformations.js.map +1 -1
  27. package/dist/browser/utils/helpers.js +19 -35
  28. package/dist/browser/utils/helpers.js.map +1 -1
  29. package/dist/browser/utils/retriableReadableStream.js +64 -56
  30. package/dist/browser/utils/retriableReadableStream.js.map +1 -1
  31. package/dist/browser/utils/tokenCycler.js +7 -6
  32. package/dist/browser/utils/tokenCycler.js.map +1 -1
  33. package/dist/commonjs/containerRegistryChallengeHandler.js +6 -3
  34. package/dist/commonjs/containerRegistryChallengeHandler.js.map +1 -1
  35. package/dist/commonjs/containerRegistryClient.js +42 -50
  36. package/dist/commonjs/containerRegistryClient.js.map +1 -1
  37. package/dist/commonjs/containerRegistryTokenCredential.js +9 -1
  38. package/dist/commonjs/containerRegistryTokenCredential.js.map +1 -1
  39. package/dist/commonjs/containerRepository.js +41 -46
  40. package/dist/commonjs/containerRepository.js.map +1 -1
  41. package/dist/commonjs/content/containerRegistryContentClient.js +34 -31
  42. package/dist/commonjs/content/containerRegistryContentClient.js.map +1 -1
  43. package/dist/commonjs/generated/generatedClient.js +12 -3
  44. package/dist/commonjs/generated/generatedClient.js.map +1 -1
  45. package/dist/commonjs/generated/generatedClientContext.js +9 -2
  46. package/dist/commonjs/generated/generatedClientContext.js.map +1 -1
  47. package/dist/commonjs/generated/models/mappers.js +63 -29
  48. package/dist/commonjs/generated/models/mappers.js.map +1 -1
  49. package/dist/commonjs/generated/operations/authentication.js +1 -0
  50. package/dist/commonjs/generated/operations/authentication.js.map +1 -1
  51. package/dist/commonjs/generated/operations/containerRegistry.js +1 -0
  52. package/dist/commonjs/generated/operations/containerRegistry.js.map +1 -1
  53. package/dist/commonjs/generated/operations/containerRegistryBlob.js +1 -0
  54. package/dist/commonjs/generated/operations/containerRegistryBlob.js.map +1 -1
  55. package/dist/commonjs/registryArtifact.js +69 -53
  56. package/dist/commonjs/registryArtifact.js.map +1 -1
  57. package/dist/commonjs/transformations.js +13 -3
  58. package/dist/commonjs/transformations.js.map +1 -1
  59. package/dist/commonjs/tsdoc-metadata.json +11 -11
  60. package/dist/commonjs/utils/helpers.js +19 -35
  61. package/dist/commonjs/utils/helpers.js.map +1 -1
  62. package/dist/commonjs/utils/retriableReadableStream.js +64 -56
  63. package/dist/commonjs/utils/retriableReadableStream.js.map +1 -1
  64. package/dist/commonjs/utils/tokenCycler.js +7 -6
  65. package/dist/commonjs/utils/tokenCycler.js.map +1 -1
  66. package/dist/esm/containerRegistryChallengeHandler.js +6 -3
  67. package/dist/esm/containerRegistryChallengeHandler.js.map +1 -1
  68. package/dist/esm/containerRegistryClient.js +42 -50
  69. package/dist/esm/containerRegistryClient.js.map +1 -1
  70. package/dist/esm/containerRegistryTokenCredential.js +9 -1
  71. package/dist/esm/containerRegistryTokenCredential.js.map +1 -1
  72. package/dist/esm/containerRepository.js +41 -46
  73. package/dist/esm/containerRepository.js.map +1 -1
  74. package/dist/esm/content/containerRegistryContentClient.js +34 -32
  75. package/dist/esm/content/containerRegistryContentClient.js.map +1 -1
  76. package/dist/esm/generated/generatedClient.js +12 -3
  77. package/dist/esm/generated/generatedClient.js.map +1 -1
  78. package/dist/esm/generated/generatedClientContext.js +9 -2
  79. package/dist/esm/generated/generatedClientContext.js.map +1 -1
  80. package/dist/esm/generated/models/mappers.js +63 -29
  81. package/dist/esm/generated/models/mappers.js.map +1 -1
  82. package/dist/esm/generated/operations/authentication.js +1 -0
  83. package/dist/esm/generated/operations/authentication.js.map +1 -1
  84. package/dist/esm/generated/operations/containerRegistry.js +1 -0
  85. package/dist/esm/generated/operations/containerRegistry.js.map +1 -1
  86. package/dist/esm/generated/operations/containerRegistryBlob.js +1 -0
  87. package/dist/esm/generated/operations/containerRegistryBlob.js.map +1 -1
  88. package/dist/esm/registryArtifact.js +69 -53
  89. package/dist/esm/registryArtifact.js.map +1 -1
  90. package/dist/esm/transformations.js +13 -3
  91. package/dist/esm/transformations.js.map +1 -1
  92. package/dist/esm/utils/helpers.js +19 -35
  93. package/dist/esm/utils/helpers.js.map +1 -1
  94. package/dist/esm/utils/retriableReadableStream.js +64 -56
  95. package/dist/esm/utils/retriableReadableStream.js.map +1 -1
  96. package/dist/esm/utils/tokenCycler.js +7 -6
  97. package/dist/esm/utils/tokenCycler.js.map +1 -1
  98. package/dist/react-native/containerRegistryChallengeHandler.js +6 -3
  99. package/dist/react-native/containerRegistryChallengeHandler.js.map +1 -1
  100. package/dist/react-native/containerRegistryClient.js +42 -50
  101. package/dist/react-native/containerRegistryClient.js.map +1 -1
  102. package/dist/react-native/containerRegistryTokenCredential.js +9 -1
  103. package/dist/react-native/containerRegistryTokenCredential.js.map +1 -1
  104. package/dist/react-native/containerRepository.js +41 -46
  105. package/dist/react-native/containerRepository.js.map +1 -1
  106. package/dist/react-native/content/containerRegistryContentClient.js +34 -32
  107. package/dist/react-native/content/containerRegistryContentClient.js.map +1 -1
  108. package/dist/react-native/generated/generatedClient.js +12 -3
  109. package/dist/react-native/generated/generatedClient.js.map +1 -1
  110. package/dist/react-native/generated/generatedClientContext.js +9 -2
  111. package/dist/react-native/generated/generatedClientContext.js.map +1 -1
  112. package/dist/react-native/generated/models/mappers.js +63 -29
  113. package/dist/react-native/generated/models/mappers.js.map +1 -1
  114. package/dist/react-native/generated/operations/authentication.js +1 -0
  115. package/dist/react-native/generated/operations/authentication.js.map +1 -1
  116. package/dist/react-native/generated/operations/containerRegistry.js +1 -0
  117. package/dist/react-native/generated/operations/containerRegistry.js.map +1 -1
  118. package/dist/react-native/generated/operations/containerRegistryBlob.js +1 -0
  119. package/dist/react-native/generated/operations/containerRegistryBlob.js.map +1 -1
  120. package/dist/react-native/registryArtifact.js +69 -53
  121. package/dist/react-native/registryArtifact.js.map +1 -1
  122. package/dist/react-native/transformations.js +13 -3
  123. package/dist/react-native/transformations.js.map +1 -1
  124. package/dist/react-native/utils/helpers.js +19 -35
  125. package/dist/react-native/utils/helpers.js.map +1 -1
  126. package/dist/react-native/utils/retriableReadableStream.js +64 -56
  127. package/dist/react-native/utils/retriableReadableStream.js.map +1 -1
  128. package/dist/react-native/utils/tokenCycler.js +7 -6
  129. package/dist/react-native/utils/tokenCycler.js.map +1 -1
  130. package/package.json +2 -2
@@ -1 +1 @@
1
- {"version":3,"file":"containerRegistryBlob.js","sourceRoot":"","sources":["../../../../src/generated/operations/containerRegistryBlob.ts"],"names":[],"mappings":"AAAA;;;;;;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,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,CAAC;IAChD,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,CAAC;IACrC,UAAU;CACX,CAAC;AACF,MAAM,qBAAqB,GAA6B;IACtD,IAAI,EAAE,2BAA2B;IACjC,UAAU,EAAE,KAAK;IACjB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,UAAU,EAAE;gBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACxB,cAAc,EAAE,gBAAgB;aACjC;YACD,aAAa,EAAE,OAAO,CAAC,oCAAoC;SAC5D;QACD,OAAO,EAAE,EAAE;KACZ;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC;IACpE,gBAAgB,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC;IACxD,UAAU;CACX,CAAC;AACF,MAAM,6BAA6B,GAA6B;IAC9D,IAAI,EAAE,2BAA2B;IACjC,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,aAAa,EAAE,OAAO,CAAC,4CAA4C;SACpE;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,SAAS;SAC9B;KACF;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC;IACpE,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC;IACvD,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { ContainerRegistryBlob } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { GeneratedClient } from \"../generatedClient.js\";\nimport {\n ContainerRegistryBlobGetBlobOptionalParams,\n ContainerRegistryBlobGetBlobResponse,\n ContainerRegistryBlobCheckBlobExistsOptionalParams,\n ContainerRegistryBlobCheckBlobExistsResponse,\n ContainerRegistryBlobDeleteBlobOptionalParams,\n ContainerRegistryBlobDeleteBlobResponse,\n ContainerRegistryBlobMountBlobOptionalParams,\n ContainerRegistryBlobMountBlobResponse,\n ContainerRegistryBlobGetUploadStatusOptionalParams,\n ContainerRegistryBlobGetUploadStatusResponse,\n ContainerRegistryBlobUploadChunkOptionalParams,\n ContainerRegistryBlobUploadChunkResponse,\n ContainerRegistryBlobCompleteUploadOptionalParams,\n ContainerRegistryBlobCompleteUploadResponse,\n ContainerRegistryBlobCancelUploadOptionalParams,\n ContainerRegistryBlobStartUploadOptionalParams,\n ContainerRegistryBlobStartUploadResponse,\n ContainerRegistryBlobGetChunkOptionalParams,\n ContainerRegistryBlobGetChunkResponse,\n ContainerRegistryBlobCheckChunkExistsOptionalParams,\n ContainerRegistryBlobCheckChunkExistsResponse\n} from \"../models/index.js\";\n\n/** Class containing ContainerRegistryBlob operations. */\nexport class ContainerRegistryBlobImpl implements ContainerRegistryBlob {\n private readonly client: GeneratedClient;\n\n /**\n * Initialize a new instance of the class ContainerRegistryBlob class.\n * @param client Reference to the service client\n */\n constructor(client: GeneratedClient) {\n this.client = client;\n }\n\n /**\n * Retrieve the blob from the registry identified by digest.\n * @param name Name of the image (including the namespace)\n * @param digest Digest of a BLOB\n * @param options The options parameters.\n */\n getBlob(\n name: string,\n digest: string,\n options?: ContainerRegistryBlobGetBlobOptionalParams\n ): Promise<ContainerRegistryBlobGetBlobResponse> {\n return this.client.sendOperationRequest(\n { name, digest, options },\n getBlobOperationSpec\n );\n }\n\n /**\n * Same as GET, except only the headers are returned.\n * @param name Name of the image (including the namespace)\n * @param digest Digest of a BLOB\n * @param options The options parameters.\n */\n checkBlobExists(\n name: string,\n digest: string,\n options?: ContainerRegistryBlobCheckBlobExistsOptionalParams\n ): Promise<ContainerRegistryBlobCheckBlobExistsResponse> {\n return this.client.sendOperationRequest(\n { name, digest, options },\n checkBlobExistsOperationSpec\n );\n }\n\n /**\n * Removes an already uploaded blob.\n * @param name Name of the image (including the namespace)\n * @param digest Digest of a BLOB\n * @param options The options parameters.\n */\n deleteBlob(\n name: string,\n digest: string,\n options?: ContainerRegistryBlobDeleteBlobOptionalParams\n ): Promise<ContainerRegistryBlobDeleteBlobResponse> {\n return this.client.sendOperationRequest(\n { name, digest, options },\n deleteBlobOperationSpec\n );\n }\n\n /**\n * Mount a blob identified by the `mount` parameter from another repository.\n * @param name Name of the image (including the namespace)\n * @param fromParam Name of the source repository.\n * @param mount Digest of blob to mount from the source repository.\n * @param options The options parameters.\n */\n mountBlob(\n name: string,\n fromParam: string,\n mount: string,\n options?: ContainerRegistryBlobMountBlobOptionalParams\n ): Promise<ContainerRegistryBlobMountBlobResponse> {\n return this.client.sendOperationRequest(\n { name, fromParam, mount, options },\n mountBlobOperationSpec\n );\n }\n\n /**\n * Retrieve status of upload identified by uuid. The primary purpose of this endpoint is to resolve the\n * current status of a resumable upload.\n * @param nextLink Link acquired from upload start or previous chunk. Note, do not include initial /\n * (must do substring(1) )\n * @param options The options parameters.\n */\n getUploadStatus(\n nextLink: string,\n options?: ContainerRegistryBlobGetUploadStatusOptionalParams\n ): Promise<ContainerRegistryBlobGetUploadStatusResponse> {\n return this.client.sendOperationRequest(\n { nextLink, options },\n getUploadStatusOperationSpec\n );\n }\n\n /**\n * Upload a stream of data without completing the upload.\n * @param nextLink Link acquired from upload start or previous chunk. Note, do not include initial /\n * (must do substring(1) )\n * @param value Raw data of blob\n * @param options The options parameters.\n */\n uploadChunk(\n nextLink: string,\n value: coreRestPipeline.RequestBodyType,\n options?: ContainerRegistryBlobUploadChunkOptionalParams\n ): Promise<ContainerRegistryBlobUploadChunkResponse> {\n return this.client.sendOperationRequest(\n { nextLink, value, options },\n uploadChunkOperationSpec\n );\n }\n\n /**\n * Complete the upload, providing all the data in the body, if necessary. A request without a body will\n * just complete the upload with previously uploaded content.\n * @param digest Digest of a BLOB\n * @param nextLink Link acquired from upload start or previous chunk. Note, do not include initial /\n * (must do substring(1) )\n * @param options The options parameters.\n */\n completeUpload(\n digest: string,\n nextLink: string,\n options?: ContainerRegistryBlobCompleteUploadOptionalParams\n ): Promise<ContainerRegistryBlobCompleteUploadResponse> {\n return this.client.sendOperationRequest(\n { digest, nextLink, options },\n completeUploadOperationSpec\n );\n }\n\n /**\n * Cancel outstanding upload processes, releasing associated resources. If this is not called, the\n * unfinished uploads will eventually timeout.\n * @param nextLink Link acquired from upload start or previous chunk. Note, do not include initial /\n * (must do substring(1) )\n * @param options The options parameters.\n */\n cancelUpload(\n nextLink: string,\n options?: ContainerRegistryBlobCancelUploadOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { nextLink, options },\n cancelUploadOperationSpec\n );\n }\n\n /**\n * Initiate a resumable blob upload with an empty request body.\n * @param name Name of the image (including the namespace)\n * @param options The options parameters.\n */\n startUpload(\n name: string,\n options?: ContainerRegistryBlobStartUploadOptionalParams\n ): Promise<ContainerRegistryBlobStartUploadResponse> {\n return this.client.sendOperationRequest(\n { name, options },\n startUploadOperationSpec\n );\n }\n\n /**\n * Retrieve the blob from the registry identified by `digest`. This endpoint may also support RFC7233\n * compliant range requests. Support can be detected by issuing a HEAD request. If the header\n * `Accept-Range: bytes` is returned, range requests can be used to fetch partial content.\n * @param name Name of the image (including the namespace)\n * @param digest Digest of a BLOB\n * @param range Format : bytes=<start>-<end>, HTTP Range header specifying blob chunk.\n * @param options The options parameters.\n */\n getChunk(\n name: string,\n digest: string,\n range: string,\n options?: ContainerRegistryBlobGetChunkOptionalParams\n ): Promise<ContainerRegistryBlobGetChunkResponse> {\n return this.client.sendOperationRequest(\n { name, digest, range, options },\n getChunkOperationSpec\n );\n }\n\n /**\n * Same as GET, except only the headers are returned.\n * @param name Name of the image (including the namespace)\n * @param digest Digest of a BLOB\n * @param range Format : bytes=<start>-<end>, HTTP Range header specifying blob chunk.\n * @param options The options parameters.\n */\n checkChunkExists(\n name: string,\n digest: string,\n range: string,\n options?: ContainerRegistryBlobCheckChunkExistsOptionalParams\n ): Promise<ContainerRegistryBlobCheckChunkExistsResponse> {\n return this.client.sendOperationRequest(\n { name, digest, range, options },\n checkChunkExistsOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getBlobOperationSpec: coreClient.OperationSpec = {\n path: \"/v2/{name}/blobs/{digest}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: {\n type: { name: \"Stream\" },\n serializedName: \"parsedResponse\"\n },\n headersMapper: Mappers.ContainerRegistryBlobGetBlobHeaders\n },\n 307: {\n headersMapper: Mappers.ContainerRegistryBlobGetBlobHeaders\n },\n default: {}\n },\n urlParameters: [Parameters.url, Parameters.name, Parameters.digest1],\n headerParameters: [Parameters.accept3],\n serializer\n};\nconst checkBlobExistsOperationSpec: coreClient.OperationSpec = {\n path: \"/v2/{name}/blobs/{digest}\",\n httpMethod: \"HEAD\",\n responses: {\n 200: {\n headersMapper: Mappers.ContainerRegistryBlobCheckBlobExistsHeaders\n },\n 307: {\n headersMapper: Mappers.ContainerRegistryBlobCheckBlobExistsHeaders\n },\n default: {\n bodyMapper: Mappers.AcrErrors\n }\n },\n urlParameters: [Parameters.url, Parameters.name, Parameters.digest1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst deleteBlobOperationSpec: coreClient.OperationSpec = {\n path: \"/v2/{name}/blobs/{digest}\",\n httpMethod: \"DELETE\",\n responses: {\n 202: {\n headersMapper: Mappers.ContainerRegistryBlobDeleteBlobHeaders\n },\n 404: {},\n default: {}\n },\n urlParameters: [Parameters.url, Parameters.name, Parameters.digest1],\n serializer\n};\nconst mountBlobOperationSpec: coreClient.OperationSpec = {\n path: \"/v2/{name}/blobs/uploads/\",\n httpMethod: \"POST\",\n responses: {\n 201: {\n headersMapper: Mappers.ContainerRegistryBlobMountBlobHeaders\n },\n default: {\n bodyMapper: Mappers.AcrErrors\n }\n },\n queryParameters: [Parameters.fromParam, Parameters.mount],\n urlParameters: [Parameters.url, Parameters.name],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getUploadStatusOperationSpec: coreClient.OperationSpec = {\n path: \"/{nextBlobUuidLink}\",\n httpMethod: \"GET\",\n responses: {\n 204: {\n headersMapper: Mappers.ContainerRegistryBlobGetUploadStatusHeaders\n },\n default: {\n bodyMapper: Mappers.AcrErrors\n }\n },\n urlParameters: [Parameters.url, Parameters.nextLink1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst uploadChunkOperationSpec: coreClient.OperationSpec = {\n path: \"/{nextBlobUuidLink}\",\n httpMethod: \"PATCH\",\n responses: {\n 202: {\n headersMapper: Mappers.ContainerRegistryBlobUploadChunkHeaders\n },\n default: {\n bodyMapper: Mappers.AcrErrors\n }\n },\n requestBody: Parameters.value3,\n urlParameters: [Parameters.url, Parameters.nextLink1],\n headerParameters: [Parameters.accept2, Parameters.contentType2],\n mediaType: \"binary\",\n serializer\n};\nconst completeUploadOperationSpec: coreClient.OperationSpec = {\n path: \"/{nextBlobUuidLink}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: Mappers.ContainerRegistryBlobCompleteUploadHeaders\n },\n default: {\n bodyMapper: Mappers.AcrErrors\n }\n },\n requestBody: Parameters.value4,\n queryParameters: [Parameters.digest2],\n urlParameters: [Parameters.url, Parameters.nextLink1],\n headerParameters: [Parameters.accept2, Parameters.contentType2],\n mediaType: \"binary\",\n serializer\n};\nconst cancelUploadOperationSpec: coreClient.OperationSpec = {\n path: \"/{nextBlobUuidLink}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.AcrErrors\n }\n },\n urlParameters: [Parameters.url, Parameters.nextLink1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst startUploadOperationSpec: coreClient.OperationSpec = {\n path: \"/v2/{name}/blobs/uploads/\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.ContainerRegistryBlobStartUploadHeaders\n },\n default: {\n bodyMapper: Mappers.AcrErrors\n }\n },\n urlParameters: [Parameters.url, Parameters.name],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getChunkOperationSpec: coreClient.OperationSpec = {\n path: \"/v2/{name}/blobs/{digest}\",\n httpMethod: \"GET\",\n responses: {\n 206: {\n bodyMapper: {\n type: { name: \"Stream\" },\n serializedName: \"parsedResponse\"\n },\n headersMapper: Mappers.ContainerRegistryBlobGetChunkHeaders\n },\n default: {}\n },\n urlParameters: [Parameters.url, Parameters.name, Parameters.digest1],\n headerParameters: [Parameters.accept3, Parameters.range],\n serializer\n};\nconst checkChunkExistsOperationSpec: coreClient.OperationSpec = {\n path: \"/v2/{name}/blobs/{digest}\",\n httpMethod: \"HEAD\",\n responses: {\n 200: {\n headersMapper: Mappers.ContainerRegistryBlobCheckChunkExistsHeaders\n },\n default: {\n bodyMapper: Mappers.AcrErrors\n }\n },\n urlParameters: [Parameters.url, Parameters.name, Parameters.digest1],\n headerParameters: [Parameters.accept, Parameters.range],\n serializer\n};\n"]}
1
+ {"version":3,"file":"containerRegistryBlob.js","sourceRoot":"","sources":["../../../../src/generated/operations/containerRegistryBlob.ts"],"names":[],"mappings":"AAAA;;;;;;GAMG;AAGH,OAAO,KAAK,UAAU,MAAM,oBAAoB,CAAC;AAEjD,OAAO,KAAK,OAAO,MAAM,sBAAsB,CAAC;AAChD,OAAO,KAAK,UAAU,MAAM,yBAAyB,CAAC;AA0BtD,yDAAyD;AACzD,MAAM,OAAO,yBAAyB;IACnB,MAAM,CAAkB;IAEzC;;;OAGG;IACH,YAAY,MAAuB;QACjC,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC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AAE;gBACV,IAAI,EAAE,EAAE,IAAI,EAAE,QAAQ,EAAE;gBACxB,cAAc,EAAE,gBAAgB;aACjC;YACD,aAAa,EAAE,OAAO,CAAC,oCAAoC;SAC5D;QACD,OAAO,EAAE,EAAE;KACZ;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC;IACpE,gBAAgB,EAAE,CAAC,UAAU,CAAC,OAAO,EAAE,UAAU,CAAC,KAAK,CAAC;IACxD,UAAU;CACX,CAAC;AACF,MAAM,6BAA6B,GAA6B;IAC9D,IAAI,EAAE,2BAA2B;IACjC,UAAU,EAAE,MAAM;IAClB,SAAS,EAAE;QACT,GAAG,EAAE;YACH,aAAa,EAAE,OAAO,CAAC,4CAA4C;SACpE;QACD,OAAO,EAAE;YACP,UAAU,EAAE,OAAO,CAAC,SAAS;SAC9B;KACF;IACD,aAAa,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,UAAU,CAAC,IAAI,EAAE,UAAU,CAAC,OAAO,CAAC;IACpE,gBAAgB,EAAE,CAAC,UAAU,CAAC,MAAM,EAAE,UAAU,CAAC,KAAK,CAAC;IACvD,UAAU;CACX,CAAC","sourcesContent":["/*\n * Copyright (c) Microsoft Corporation.\n * Licensed under the MIT License.\n *\n * Code generated by Microsoft (R) AutoRest Code Generator.\n * Changes may cause incorrect behavior and will be lost if the code is regenerated.\n */\n\nimport { ContainerRegistryBlob } from \"../operationsInterfaces/index.js\";\nimport * as coreClient from \"@azure/core-client\";\nimport * as coreRestPipeline from \"@azure/core-rest-pipeline\";\nimport * as Mappers from \"../models/mappers.js\";\nimport * as Parameters from \"../models/parameters.js\";\nimport { GeneratedClient } from \"../generatedClient.js\";\nimport {\n ContainerRegistryBlobGetBlobOptionalParams,\n ContainerRegistryBlobGetBlobResponse,\n ContainerRegistryBlobCheckBlobExistsOptionalParams,\n ContainerRegistryBlobCheckBlobExistsResponse,\n ContainerRegistryBlobDeleteBlobOptionalParams,\n ContainerRegistryBlobDeleteBlobResponse,\n ContainerRegistryBlobMountBlobOptionalParams,\n ContainerRegistryBlobMountBlobResponse,\n ContainerRegistryBlobGetUploadStatusOptionalParams,\n ContainerRegistryBlobGetUploadStatusResponse,\n ContainerRegistryBlobUploadChunkOptionalParams,\n ContainerRegistryBlobUploadChunkResponse,\n ContainerRegistryBlobCompleteUploadOptionalParams,\n ContainerRegistryBlobCompleteUploadResponse,\n ContainerRegistryBlobCancelUploadOptionalParams,\n ContainerRegistryBlobStartUploadOptionalParams,\n ContainerRegistryBlobStartUploadResponse,\n ContainerRegistryBlobGetChunkOptionalParams,\n ContainerRegistryBlobGetChunkResponse,\n ContainerRegistryBlobCheckChunkExistsOptionalParams,\n ContainerRegistryBlobCheckChunkExistsResponse\n} from \"../models/index.js\";\n\n/** Class containing ContainerRegistryBlob operations. */\nexport class ContainerRegistryBlobImpl implements ContainerRegistryBlob {\n private readonly client: GeneratedClient;\n\n /**\n * Initialize a new instance of the class ContainerRegistryBlob class.\n * @param client Reference to the service client\n */\n constructor(client: GeneratedClient) {\n this.client = client;\n }\n\n /**\n * Retrieve the blob from the registry identified by digest.\n * @param name Name of the image (including the namespace)\n * @param digest Digest of a BLOB\n * @param options The options parameters.\n */\n getBlob(\n name: string,\n digest: string,\n options?: ContainerRegistryBlobGetBlobOptionalParams\n ): Promise<ContainerRegistryBlobGetBlobResponse> {\n return this.client.sendOperationRequest(\n { name, digest, options },\n getBlobOperationSpec\n );\n }\n\n /**\n * Same as GET, except only the headers are returned.\n * @param name Name of the image (including the namespace)\n * @param digest Digest of a BLOB\n * @param options The options parameters.\n */\n checkBlobExists(\n name: string,\n digest: string,\n options?: ContainerRegistryBlobCheckBlobExistsOptionalParams\n ): Promise<ContainerRegistryBlobCheckBlobExistsResponse> {\n return this.client.sendOperationRequest(\n { name, digest, options },\n checkBlobExistsOperationSpec\n );\n }\n\n /**\n * Removes an already uploaded blob.\n * @param name Name of the image (including the namespace)\n * @param digest Digest of a BLOB\n * @param options The options parameters.\n */\n deleteBlob(\n name: string,\n digest: string,\n options?: ContainerRegistryBlobDeleteBlobOptionalParams\n ): Promise<ContainerRegistryBlobDeleteBlobResponse> {\n return this.client.sendOperationRequest(\n { name, digest, options },\n deleteBlobOperationSpec\n );\n }\n\n /**\n * Mount a blob identified by the `mount` parameter from another repository.\n * @param name Name of the image (including the namespace)\n * @param fromParam Name of the source repository.\n * @param mount Digest of blob to mount from the source repository.\n * @param options The options parameters.\n */\n mountBlob(\n name: string,\n fromParam: string,\n mount: string,\n options?: ContainerRegistryBlobMountBlobOptionalParams\n ): Promise<ContainerRegistryBlobMountBlobResponse> {\n return this.client.sendOperationRequest(\n { name, fromParam, mount, options },\n mountBlobOperationSpec\n );\n }\n\n /**\n * Retrieve status of upload identified by uuid. The primary purpose of this endpoint is to resolve the\n * current status of a resumable upload.\n * @param nextLink Link acquired from upload start or previous chunk. Note, do not include initial /\n * (must do substring(1) )\n * @param options The options parameters.\n */\n getUploadStatus(\n nextLink: string,\n options?: ContainerRegistryBlobGetUploadStatusOptionalParams\n ): Promise<ContainerRegistryBlobGetUploadStatusResponse> {\n return this.client.sendOperationRequest(\n { nextLink, options },\n getUploadStatusOperationSpec\n );\n }\n\n /**\n * Upload a stream of data without completing the upload.\n * @param nextLink Link acquired from upload start or previous chunk. Note, do not include initial /\n * (must do substring(1) )\n * @param value Raw data of blob\n * @param options The options parameters.\n */\n uploadChunk(\n nextLink: string,\n value: coreRestPipeline.RequestBodyType,\n options?: ContainerRegistryBlobUploadChunkOptionalParams\n ): Promise<ContainerRegistryBlobUploadChunkResponse> {\n return this.client.sendOperationRequest(\n { nextLink, value, options },\n uploadChunkOperationSpec\n );\n }\n\n /**\n * Complete the upload, providing all the data in the body, if necessary. A request without a body will\n * just complete the upload with previously uploaded content.\n * @param digest Digest of a BLOB\n * @param nextLink Link acquired from upload start or previous chunk. Note, do not include initial /\n * (must do substring(1) )\n * @param options The options parameters.\n */\n completeUpload(\n digest: string,\n nextLink: string,\n options?: ContainerRegistryBlobCompleteUploadOptionalParams\n ): Promise<ContainerRegistryBlobCompleteUploadResponse> {\n return this.client.sendOperationRequest(\n { digest, nextLink, options },\n completeUploadOperationSpec\n );\n }\n\n /**\n * Cancel outstanding upload processes, releasing associated resources. If this is not called, the\n * unfinished uploads will eventually timeout.\n * @param nextLink Link acquired from upload start or previous chunk. Note, do not include initial /\n * (must do substring(1) )\n * @param options The options parameters.\n */\n cancelUpload(\n nextLink: string,\n options?: ContainerRegistryBlobCancelUploadOptionalParams\n ): Promise<void> {\n return this.client.sendOperationRequest(\n { nextLink, options },\n cancelUploadOperationSpec\n );\n }\n\n /**\n * Initiate a resumable blob upload with an empty request body.\n * @param name Name of the image (including the namespace)\n * @param options The options parameters.\n */\n startUpload(\n name: string,\n options?: ContainerRegistryBlobStartUploadOptionalParams\n ): Promise<ContainerRegistryBlobStartUploadResponse> {\n return this.client.sendOperationRequest(\n { name, options },\n startUploadOperationSpec\n );\n }\n\n /**\n * Retrieve the blob from the registry identified by `digest`. This endpoint may also support RFC7233\n * compliant range requests. Support can be detected by issuing a HEAD request. If the header\n * `Accept-Range: bytes` is returned, range requests can be used to fetch partial content.\n * @param name Name of the image (including the namespace)\n * @param digest Digest of a BLOB\n * @param range Format : bytes=<start>-<end>, HTTP Range header specifying blob chunk.\n * @param options The options parameters.\n */\n getChunk(\n name: string,\n digest: string,\n range: string,\n options?: ContainerRegistryBlobGetChunkOptionalParams\n ): Promise<ContainerRegistryBlobGetChunkResponse> {\n return this.client.sendOperationRequest(\n { name, digest, range, options },\n getChunkOperationSpec\n );\n }\n\n /**\n * Same as GET, except only the headers are returned.\n * @param name Name of the image (including the namespace)\n * @param digest Digest of a BLOB\n * @param range Format : bytes=<start>-<end>, HTTP Range header specifying blob chunk.\n * @param options The options parameters.\n */\n checkChunkExists(\n name: string,\n digest: string,\n range: string,\n options?: ContainerRegistryBlobCheckChunkExistsOptionalParams\n ): Promise<ContainerRegistryBlobCheckChunkExistsResponse> {\n return this.client.sendOperationRequest(\n { name, digest, range, options },\n checkChunkExistsOperationSpec\n );\n }\n}\n// Operation Specifications\nconst serializer = coreClient.createSerializer(Mappers, /* isXml */ false);\n\nconst getBlobOperationSpec: coreClient.OperationSpec = {\n path: \"/v2/{name}/blobs/{digest}\",\n httpMethod: \"GET\",\n responses: {\n 200: {\n bodyMapper: {\n type: { name: \"Stream\" },\n serializedName: \"parsedResponse\"\n },\n headersMapper: Mappers.ContainerRegistryBlobGetBlobHeaders\n },\n 307: {\n headersMapper: Mappers.ContainerRegistryBlobGetBlobHeaders\n },\n default: {}\n },\n urlParameters: [Parameters.url, Parameters.name, Parameters.digest1],\n headerParameters: [Parameters.accept3],\n serializer\n};\nconst checkBlobExistsOperationSpec: coreClient.OperationSpec = {\n path: \"/v2/{name}/blobs/{digest}\",\n httpMethod: \"HEAD\",\n responses: {\n 200: {\n headersMapper: Mappers.ContainerRegistryBlobCheckBlobExistsHeaders\n },\n 307: {\n headersMapper: Mappers.ContainerRegistryBlobCheckBlobExistsHeaders\n },\n default: {\n bodyMapper: Mappers.AcrErrors\n }\n },\n urlParameters: [Parameters.url, Parameters.name, Parameters.digest1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst deleteBlobOperationSpec: coreClient.OperationSpec = {\n path: \"/v2/{name}/blobs/{digest}\",\n httpMethod: \"DELETE\",\n responses: {\n 202: {\n headersMapper: Mappers.ContainerRegistryBlobDeleteBlobHeaders\n },\n 404: {},\n default: {}\n },\n urlParameters: [Parameters.url, Parameters.name, Parameters.digest1],\n serializer\n};\nconst mountBlobOperationSpec: coreClient.OperationSpec = {\n path: \"/v2/{name}/blobs/uploads/\",\n httpMethod: \"POST\",\n responses: {\n 201: {\n headersMapper: Mappers.ContainerRegistryBlobMountBlobHeaders\n },\n default: {\n bodyMapper: Mappers.AcrErrors\n }\n },\n queryParameters: [Parameters.fromParam, Parameters.mount],\n urlParameters: [Parameters.url, Parameters.name],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getUploadStatusOperationSpec: coreClient.OperationSpec = {\n path: \"/{nextBlobUuidLink}\",\n httpMethod: \"GET\",\n responses: {\n 204: {\n headersMapper: Mappers.ContainerRegistryBlobGetUploadStatusHeaders\n },\n default: {\n bodyMapper: Mappers.AcrErrors\n }\n },\n urlParameters: [Parameters.url, Parameters.nextLink1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst uploadChunkOperationSpec: coreClient.OperationSpec = {\n path: \"/{nextBlobUuidLink}\",\n httpMethod: \"PATCH\",\n responses: {\n 202: {\n headersMapper: Mappers.ContainerRegistryBlobUploadChunkHeaders\n },\n default: {\n bodyMapper: Mappers.AcrErrors\n }\n },\n requestBody: Parameters.value3,\n urlParameters: [Parameters.url, Parameters.nextLink1],\n headerParameters: [Parameters.accept2, Parameters.contentType2],\n mediaType: \"binary\",\n serializer\n};\nconst completeUploadOperationSpec: coreClient.OperationSpec = {\n path: \"/{nextBlobUuidLink}\",\n httpMethod: \"PUT\",\n responses: {\n 201: {\n headersMapper: Mappers.ContainerRegistryBlobCompleteUploadHeaders\n },\n default: {\n bodyMapper: Mappers.AcrErrors\n }\n },\n requestBody: Parameters.value4,\n queryParameters: [Parameters.digest2],\n urlParameters: [Parameters.url, Parameters.nextLink1],\n headerParameters: [Parameters.accept2, Parameters.contentType2],\n mediaType: \"binary\",\n serializer\n};\nconst cancelUploadOperationSpec: coreClient.OperationSpec = {\n path: \"/{nextBlobUuidLink}\",\n httpMethod: \"DELETE\",\n responses: {\n 204: {},\n default: {\n bodyMapper: Mappers.AcrErrors\n }\n },\n urlParameters: [Parameters.url, Parameters.nextLink1],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst startUploadOperationSpec: coreClient.OperationSpec = {\n path: \"/v2/{name}/blobs/uploads/\",\n httpMethod: \"POST\",\n responses: {\n 202: {\n headersMapper: Mappers.ContainerRegistryBlobStartUploadHeaders\n },\n default: {\n bodyMapper: Mappers.AcrErrors\n }\n },\n urlParameters: [Parameters.url, Parameters.name],\n headerParameters: [Parameters.accept],\n serializer\n};\nconst getChunkOperationSpec: coreClient.OperationSpec = {\n path: \"/v2/{name}/blobs/{digest}\",\n httpMethod: \"GET\",\n responses: {\n 206: {\n bodyMapper: {\n type: { name: \"Stream\" },\n serializedName: \"parsedResponse\"\n },\n headersMapper: Mappers.ContainerRegistryBlobGetChunkHeaders\n },\n default: {}\n },\n urlParameters: [Parameters.url, Parameters.name, Parameters.digest1],\n headerParameters: [Parameters.accept3, Parameters.range],\n serializer\n};\nconst checkChunkExistsOperationSpec: coreClient.OperationSpec = {\n path: \"/v2/{name}/blobs/{digest}\",\n httpMethod: \"HEAD\",\n responses: {\n 200: {\n headersMapper: Mappers.ContainerRegistryBlobCheckChunkExistsHeaders\n },\n default: {\n bodyMapper: Mappers.AcrErrors\n }\n },\n urlParameters: [Parameters.url, Parameters.name, Parameters.digest1],\n headerParameters: [Parameters.accept, Parameters.range],\n serializer\n};\n"]}
@@ -1,6 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { __asyncDelegator, __asyncGenerator, __asyncValues, __await } from "tslib";
4
3
  import { tracingClient } from "./tracing.js";
5
4
  import { extractNextLink, isDigest } from "./utils/helpers.js";
6
5
  import { toArtifactManifestProperties, toServiceTagOrderBy } from "./transformations.js";
@@ -9,6 +8,22 @@ import { toArtifactManifestProperties, toServiceTagOrderBy } from "./transformat
9
8
  * @internal
10
9
  */
11
10
  export class RegistryArtifactImpl {
11
+ tagOrDigest;
12
+ client;
13
+ /**
14
+ * The Azure Container Registry endpoint.
15
+ */
16
+ registryEndpoint;
17
+ /**
18
+ * Repository name.
19
+ */
20
+ repositoryName;
21
+ /**
22
+ * Name of the form 'registry-login-server/repository-name\@digest' or
23
+ * 'registry-login-server/repository-name:tag'
24
+ */
25
+ fullyQualifiedReference;
26
+ digest;
12
27
  /**
13
28
  * Creates an instance of a RegistryArtifact.
14
29
  * @param registryEndpoint - the URL to the Container Registry endpoint
@@ -102,12 +117,15 @@ export class RegistryArtifactImpl {
102
117
  * @param options - options to update manifest properties
103
118
  */
104
119
  async updateManifestProperties(options) {
105
- return tracingClient.withSpan("RegistryArtifactImpl.updateManifestProperties", Object.assign(Object.assign({}, options), { value: {
120
+ return tracingClient.withSpan("RegistryArtifactImpl.updateManifestProperties", {
121
+ ...options,
122
+ value: {
106
123
  canDelete: options.canDelete,
107
124
  canWrite: options.canWrite,
108
125
  canList: options.canList,
109
126
  canRead: options.canRead,
110
- } }), async (updatedOptions) => {
127
+ },
128
+ }, async (updatedOptions) => {
111
129
  const result = await this.client.containerRegistry.updateManifestProperties(this.repositoryName, await this.getDigest(), updatedOptions);
112
130
  return toArtifactManifestProperties(result, this.repositoryName, result.registryLoginServer);
113
131
  });
@@ -155,12 +173,15 @@ export class RegistryArtifactImpl {
155
173
  if (!tag) {
156
174
  throw new Error("invalid tag");
157
175
  }
158
- return tracingClient.withSpan("RegistryArtifactImpl.updateTagProperties", Object.assign(Object.assign({}, options), { value: {
176
+ return tracingClient.withSpan("RegistryArtifactImpl.updateTagProperties", {
177
+ ...options,
178
+ value: {
159
179
  canDelete: options.canDelete,
160
180
  canWrite: options.canWrite,
161
181
  canList: options.canList,
162
182
  canRead: options.canRead,
163
- } }), (updatedOptions) => {
183
+ },
184
+ }, (updatedOptions) => {
164
185
  return this.client.containerRegistry.updateTagAttributes(this.repositoryName, tag, updatedOptions);
165
186
  });
166
187
  }
@@ -198,57 +219,52 @@ export class RegistryArtifactImpl {
198
219
  byPage: (settings = {}) => this.listTagsPage(settings, options),
199
220
  };
200
221
  }
201
- listTagsItems() {
202
- return __asyncGenerator(this, arguments, function* listTagsItems_1(options = {}) {
203
- var _a, e_1, _b, _c;
204
- try {
205
- for (var _d = true, _e = __asyncValues(this.listTagsPage({}, options)), _f; _f = yield __await(_e.next()), _a = _f.done, !_a; _d = true) {
206
- _c = _f.value;
207
- _d = false;
208
- const page = _c;
209
- yield __await(yield* __asyncDelegator(__asyncValues(page)));
210
- }
211
- }
212
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
213
- finally {
214
- try {
215
- if (!_d && !_a && (_b = _e.return)) yield __await(_b.call(_e));
216
- }
217
- finally { if (e_1) throw e_1.error; }
218
- }
219
- });
222
+ async *listTagsItems(options = {}) {
223
+ for await (const page of this.listTagsPage({}, options)) {
224
+ yield* page;
225
+ }
220
226
  }
221
- listTagsPage(continuationState_1) {
222
- return __asyncGenerator(this, arguments, function* listTagsPage_1(continuationState, options = {}) {
223
- const orderby = toServiceTagOrderBy(options.order);
224
- if (!continuationState.continuationToken) {
225
- const optionsComplete = Object.assign(Object.assign({}, options), { n: continuationState.maxPageSize, orderby });
226
- const currentPage = yield __await(this.client.containerRegistry.getTags(this.repositoryName, optionsComplete));
227
- continuationState.continuationToken = extractNextLink(currentPage.link);
228
- if (currentPage.tagAttributeBases) {
229
- const array = currentPage.tagAttributeBases.map((t) => {
230
- return Object.assign({ registryLoginServer: currentPage.registryLoginServer, repositoryName: currentPage.repository }, t);
231
- });
232
- yield yield __await(Object.defineProperty(array, "continuationToken", {
233
- value: continuationState.continuationToken,
234
- enumerable: true,
235
- }));
236
- }
227
+ async *listTagsPage(continuationState, options = {}) {
228
+ const orderby = toServiceTagOrderBy(options.order);
229
+ if (!continuationState.continuationToken) {
230
+ const optionsComplete = {
231
+ ...options,
232
+ n: continuationState.maxPageSize,
233
+ orderby,
234
+ };
235
+ const currentPage = await this.client.containerRegistry.getTags(this.repositoryName, optionsComplete);
236
+ continuationState.continuationToken = extractNextLink(currentPage.link);
237
+ if (currentPage.tagAttributeBases) {
238
+ const array = currentPage.tagAttributeBases.map((t) => {
239
+ return {
240
+ registryLoginServer: currentPage.registryLoginServer,
241
+ repositoryName: currentPage.repository,
242
+ ...t,
243
+ };
244
+ });
245
+ yield Object.defineProperty(array, "continuationToken", {
246
+ value: continuationState.continuationToken,
247
+ enumerable: true,
248
+ });
237
249
  }
238
- while (continuationState.continuationToken) {
239
- const currentPage = yield __await(this.client.containerRegistry.getTagsNext(this.repositoryName, continuationState.continuationToken, options));
240
- continuationState.continuationToken = extractNextLink(currentPage.link);
241
- if (currentPage.tagAttributeBases) {
242
- const array = currentPage.tagAttributeBases.map((t) => {
243
- return Object.assign({ registryLoginServer: currentPage.registryLoginServer, repositoryName: currentPage.repository }, t);
244
- });
245
- yield yield __await(Object.defineProperty(array, "continuationToken", {
246
- value: continuationState.continuationToken,
247
- enumerable: true,
248
- }));
249
- }
250
+ }
251
+ while (continuationState.continuationToken) {
252
+ const currentPage = await this.client.containerRegistry.getTagsNext(this.repositoryName, continuationState.continuationToken, options);
253
+ continuationState.continuationToken = extractNextLink(currentPage.link);
254
+ if (currentPage.tagAttributeBases) {
255
+ const array = currentPage.tagAttributeBases.map((t) => {
256
+ return {
257
+ registryLoginServer: currentPage.registryLoginServer,
258
+ repositoryName: currentPage.repository,
259
+ ...t,
260
+ };
261
+ });
262
+ yield Object.defineProperty(array, "continuationToken", {
263
+ value: continuationState.continuationToken,
264
+ enumerable: true,
265
+ });
250
266
  }
251
- });
267
+ }
252
268
  }
253
269
  }
254
270
  //# sourceMappingURL=registryArtifact.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"registryArtifact.js","sourceRoot":"","sources":["../../src/registryArtifact.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAalC,OAAO,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAE7C,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,oBAAoB,CAAC;AAC/D,OAAO,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,MAAM,sBAAsB,CAAC;AAwLzF;;;GAGG;AACH,MAAM,OAAO,oBAAoB;IAkB/B;;;;;;OAMG;IACH,YACE,gBAAwB,EACxB,cAAsB,EACd,WAAmB,EAC3B,MAAuB;QADf,gBAAW,GAAX,WAAW,CAAQ;QAG3B,IAAI,CAAC,gBAAgB,GAAG,gBAAgB,CAAC;QACzC,IAAI,CAAC,cAAc,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licensed under the MIT License.\n\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport type { OperationOptions } from \"@azure/core-client\";\nimport type { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\n\nimport type {\n ArtifactTagProperties,\n ArtifactManifestProperties,\n ArtifactTagOrder,\n TagPageResponse,\n} from \"./models.js\";\nimport { tracingClient } from \"./tracing.js\";\nimport type { GeneratedClient } from \"./generated/index.js\";\nimport { extractNextLink, isDigest } from \"./utils/helpers.js\";\nimport { toArtifactManifestProperties, toServiceTagOrderBy } from \"./transformations.js\";\n\n/**\n * Options for the `delete` method of `RegistryArtifact`.\n */\nexport interface DeleteArtifactOptions extends OperationOptions {}\n/**\n * Options for the `deleteTag` method of `RegistryArtifact`.\n */\nexport interface DeleteTagOptions extends OperationOptions {}\n/**\n * Options for the `getManifestProperties` method of `RegistryArtifact`.\n */\nexport interface GetManifestPropertiesOptions extends OperationOptions {}\n/**\n * Options for the `getTagProperties` method of `RegistryArtifact`.\n */\nexport interface GetTagPropertiesOptions extends OperationOptions {}\n\n/**\n * Options for the `updateTagProperties` method of `RegistryArtifact`.\n */\nexport interface UpdateTagPropertiesOptions extends OperationOptions {\n /** Whether or not this tag can be deleted */\n canDelete?: boolean;\n /** Whether or not this tag can be written to */\n canWrite?: boolean;\n /** Whether or not to include this tag when listing tags */\n canList?: boolean;\n /** Whether or not this tag can be read */\n canRead?: boolean;\n}\n\n/**\n * Options for the `updateManifestProperties` method of `RegistryArtifact`.\n */\nexport interface UpdateManifestPropertiesOptions extends OperationOptions {\n /** Whether or not this manifest can be deleted */\n canDelete?: boolean;\n /** Whether or not this manifest can be written to */\n canWrite?: boolean;\n /** Whether or not to include this manifest when listing manifest properties */\n canList?: boolean;\n /** Whether or not this manifest can be read */\n canRead?: boolean;\n}\n\n/**\n * Options for the `listTagProperties` method of `RegistryArtifact`.\n */\nexport interface ListTagPropertiesOptions extends OperationOptions {\n /** order in which the tags are returned */\n order?: ArtifactTagOrder;\n}\n\n/**\n * `Artifact` is the general term for items stored in a container registry,\n * and can include Docker images or other Open Container Initiative (OCI) artifact types.\n *\n * The {@link RegistryArtifact} interface is a helper that groups information and operations about an image\n * or artifact in a container registry.\n *\n */\nexport interface RegistryArtifact {\n /**\n * The Azure Container Registry endpoint.\n */\n readonly registryEndpoint: string;\n /**\n * Repository name.\n */\n readonly repositoryName: string;\n /**\n * fully qualified reference of the artifact.\n */\n readonly fullyQualifiedReference: string;\n /**\n * Deletes this registry artifact by deleting its manifest.\n * @param options -\n */\n delete(options?: DeleteArtifactOptions): Promise<void>;\n /**\n * Deletes a tag. This removes the tag from the artifact and its manifest.\n * @param tag - the name of the tag to delete.\n * @param options -\n */\n deleteTag(tag: string, options?: DeleteTagOptions): Promise<void>;\n /**\n * Retrieves the properties of the manifest that uniquely identifies this artifact.\n * @param options -\n */\n getManifestProperties(\n options?: GetManifestPropertiesOptions,\n ): Promise<ArtifactManifestProperties>;\n /**\n * Updates the properties of the artifact's manifest.\n *\n * Example usage:\n *\n * ```ts snippet:RegistryArtifactUpdateManifestProperties\n * import { ContainerRegistryClient } from \"@azure/container-registry\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const endpoint = \"https://myregistryname.azurecr.io\";\n * const repositoryName = \"library/hello-world\";\n * const artifactTagOrDigest = \"latest\";\n * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());\n *\n * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest);\n * const updated = await artifact.updateManifestProperties({\n * canDelete: false,\n * canList: false,\n * canRead: false,\n * canWrite: false,\n * });\n * ```\n * @param options -\n */\n updateManifestProperties(\n options: UpdateManifestPropertiesOptions,\n ): Promise<ArtifactManifestProperties>;\n /**\n * Retrieves the properties of the specified tag.\n * @param tag - the tag to retrieve properties.\n * @param options - options to get tag properties\n */\n getTagProperties(tag: string, options?: GetTagPropertiesOptions): Promise<ArtifactTagProperties>;\n /**\n * Updates the properties of a given tag.\n *\n * Example usage:\n *\n * ```ts snippet:RegistryArtifactUpdateTagProperties\n * import { ContainerRegistryClient } from \"@azure/container-registry\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const endpoint = \"https://myregistryname.azurecr.io\";\n * const repositoryName = \"library/hello-world\";\n * const artifactTagOrDigest = \"latest\";\n * const tag = \"latest\";\n * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());\n *\n * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest);\n * const updated = await artifact.updateTagProperties(tag, {\n * canDelete: false,\n * canList: false,\n * canRead: false,\n * canWrite: false,\n * });\n * ```\n * @param tag - name of the tag to update properties on\n * @param options -\n */\n updateTagProperties(\n tag: string,\n options: UpdateTagPropertiesOptions,\n ): Promise<ArtifactTagProperties>;\n /**\n * Returns an async iterable iterator to list the tags that uniquely identify this artifact and the properties of each.\n *\n * Example using `for-await-of` syntax:\n *\n * ```ts snippet:RegistryArtifactListTagProperties\n * import { ContainerRegistryClient } from \"@azure/container-registry\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const endpoint = \"https://myregistryname.azurecr.io\";\n * const repositoryName = \"library/hello-world\";\n * const artifactTagOrDigest = \"latest\";\n * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());\n *\n * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest);\n * for await (const tag of artifact.listTagProperties()) {\n * console.log(\"tag: \", tag);\n * }\n * ```\n *\n * @param options - options to list tags\n */\n listTagProperties(\n options?: ListTagPropertiesOptions,\n ): PagedAsyncIterableIterator<ArtifactTagProperties>;\n}\n\n/**\n * The client class used to interact with the Container Registry service.\n * @internal\n */\nexport class RegistryArtifactImpl {\n private client: GeneratedClient;\n /**\n * The Azure Container Registry endpoint.\n */\n public readonly registryEndpoint: string;\n /**\n * Repository name.\n */\n public readonly repositoryName: string;\n\n /**\n * Name of the form 'registry-login-server/repository-name\\@digest' or\n * 'registry-login-server/repository-name:tag'\n */\n public readonly fullyQualifiedReference: string;\n\n private digest?: string;\n /**\n * Creates an instance of a RegistryArtifact.\n * @param registryEndpoint - the URL to the Container Registry endpoint\n * @param repositoryName - the name of the repository\n * @param tagOrDigest - the tag or digest of this artifact\n * @param client - the generated client that interacts with service\n */\n constructor(\n registryEndpoint: string,\n repositoryName: string,\n private tagOrDigest: string,\n client: GeneratedClient,\n ) {\n this.registryEndpoint = registryEndpoint;\n this.repositoryName = repositoryName;\n\n const parsedUrl = new URL(registryEndpoint);\n if (isDigest(tagOrDigest)) {\n this.digest = tagOrDigest;\n this.fullyQualifiedReference = `${parsedUrl.hostname}/${repositoryName}@${this.digest}`;\n } else {\n this.fullyQualifiedReference = `${parsedUrl.hostname}/${repositoryName}:${tagOrDigest}`;\n }\n\n this.client = client;\n }\n\n /**\n * digest of this artifact.\n */\n private async getDigest(): Promise<string> {\n if (this.digest) {\n return this.digest;\n }\n\n if (!isDigest(this.tagOrDigest)) {\n this.digest = (await this.getTagProperties(this.tagOrDigest)).digest;\n } else {\n this.digest = this.tagOrDigest;\n }\n\n return this.digest;\n }\n\n /**\n * Deletes this registry artifact by deleting its manifest.\n * @param options -\n */\n public async delete(options: DeleteArtifactOptions = {}): Promise<void> {\n return tracingClient.withSpan(\n \"RegistryArtifactImpl.delete\",\n options,\n async (updatedOptions) => {\n await this.client.containerRegistry.deleteManifest(\n this.repositoryName,\n await this.getDigest(),\n updatedOptions,\n );\n },\n );\n }\n\n /**\n * Deletes a tag. This removes the tag from the artifact and its manifest.\n * @param tag - the name of the tag to delete.\n * @param options -\n */\n public async deleteTag(tag: string, options: DeleteTagOptions = {}): Promise<void> {\n if (!tag) {\n throw new Error(\"invalid tag\");\n }\n\n return tracingClient.withSpan(\n \"RegistryArtifactImpl.deleteTag\",\n options,\n async (updatedOptions) => {\n await this.client.containerRegistry.deleteTag(this.repositoryName, tag, updatedOptions);\n },\n );\n }\n\n /**\n * Retrieves the properties of the manifest that uniquely identifies this artifact.\n * @param options -\n */\n public async getManifestProperties(\n options: GetManifestPropertiesOptions = {},\n ): Promise<ArtifactManifestProperties> {\n return tracingClient.withSpan(\n \"RegistryArtifactImpl.getManifestProperties\",\n options,\n async (updatedOptions) => {\n const result = await this.client.containerRegistry.getManifestProperties(\n this.repositoryName,\n await this.getDigest(),\n updatedOptions,\n );\n return toArtifactManifestProperties(\n result,\n this.repositoryName,\n result.registryLoginServer!,\n );\n },\n );\n }\n\n /**\n * Updates the properties of the artifact's manifest.\n *\n * Example usage:\n *\n * ```ts snippet:RegistryArtifactUpdateManifestProperties\n * import { ContainerRegistryClient } from \"@azure/container-registry\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const endpoint = \"https://myregistryname.azurecr.io\";\n * const repositoryName = \"library/hello-world\";\n * const artifactTagOrDigest = \"latest\";\n * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());\n *\n * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest);\n * const updated = await artifact.updateManifestProperties({\n * canDelete: false,\n * canList: false,\n * canRead: false,\n * canWrite: false,\n * });\n * ```\n * @param options - options to update manifest properties\n */\n public async updateManifestProperties(\n options: UpdateManifestPropertiesOptions,\n ): Promise<ArtifactManifestProperties> {\n return tracingClient.withSpan(\n \"RegistryArtifactImpl.updateManifestProperties\",\n {\n ...options,\n value: {\n canDelete: options.canDelete,\n canWrite: options.canWrite,\n canList: options.canList,\n canRead: options.canRead,\n },\n },\n async (updatedOptions) => {\n const result = await this.client.containerRegistry.updateManifestProperties(\n this.repositoryName,\n await this.getDigest(),\n updatedOptions,\n );\n return toArtifactManifestProperties(\n result,\n this.repositoryName,\n result.registryLoginServer!,\n );\n },\n );\n }\n\n /**\n * Retrieves the properties of the specified tag.\n * @param tag - the tag to retrieve properties.\n * @param options - options to get tag properties\n */\n public async getTagProperties(\n tag: string,\n options: GetTagPropertiesOptions = {},\n ): Promise<ArtifactTagProperties> {\n if (!tag) {\n throw new Error(\"invalid tag\");\n }\n\n return tracingClient.withSpan(\n \"RegistryArtifactImpl.getTagProperties\",\n options,\n (updatedOptions) => {\n return this.client.containerRegistry.getTagProperties(\n this.repositoryName,\n tag,\n updatedOptions,\n );\n },\n );\n }\n\n /**\n * Updates the properties of a given tag.\n *\n * Example usage:\n *\n * ```ts snippet:RegistryArtifactUpdateTagProperties\n * import { ContainerRegistryClient } from \"@azure/container-registry\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const endpoint = \"https://myregistryname.azurecr.io\";\n * const repositoryName = \"library/hello-world\";\n * const artifactTagOrDigest = \"latest\";\n * const tag = \"latest\";\n * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());\n *\n * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest);\n * const updated = await artifact.updateTagProperties(tag, {\n * canDelete: false,\n * canList: false,\n * canRead: false,\n * canWrite: false,\n * });\n * ```\n * @param tag - name of the tag to update properties on\n * @param options - options to update tag properties\n */\n public async updateTagProperties(\n tag: string,\n options: UpdateTagPropertiesOptions,\n ): Promise<ArtifactTagProperties> {\n if (!tag) {\n throw new Error(\"invalid tag\");\n }\n\n return tracingClient.withSpan(\n \"RegistryArtifactImpl.updateTagProperties\",\n {\n ...options,\n value: {\n canDelete: options.canDelete,\n canWrite: options.canWrite,\n canList: options.canList,\n canRead: options.canRead,\n },\n },\n (updatedOptions) => {\n return this.client.containerRegistry.updateTagAttributes(\n this.repositoryName,\n tag,\n updatedOptions,\n );\n },\n );\n }\n\n /**\n * Returns an async iterable iterator to list the tags that uniquely identify this artifact and the properties of each.\n *\n * Example using `for-await-of` syntax:\n *\n * ```ts snippet:RegistryArtifactListTagProperties\n * import { ContainerRegistryClient } from \"@azure/container-registry\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const endpoint = \"https://myregistryname.azurecr.io\";\n * const repositoryName = \"library/hello-world\";\n * const artifactTagOrDigest = \"latest\";\n * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());\n *\n * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest);\n * for await (const tag of artifact.listTagProperties()) {\n * console.log(\"tag: \", tag);\n * }\n * ```\n *\n * @param options - options to list tags\n */\n public listTagProperties(\n options: ListTagPropertiesOptions = {},\n ): PagedAsyncIterableIterator<ArtifactTagProperties, TagPageResponse> {\n const iter = this.listTagsItems(options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings: PageSettings = {}) => this.listTagsPage(settings, options),\n };\n }\n\n private async *listTagsItems(\n options: ListTagPropertiesOptions = {},\n ): AsyncIterableIterator<ArtifactTagProperties> {\n for await (const page of this.listTagsPage({}, options)) {\n yield* page;\n }\n }\n\n private async *listTagsPage(\n continuationState: PageSettings,\n options: ListTagPropertiesOptions = {},\n ): AsyncIterableIterator<TagPageResponse> {\n const orderby = toServiceTagOrderBy(options.order);\n if (!continuationState.continuationToken) {\n const optionsComplete = {\n ...options,\n n: continuationState.maxPageSize,\n orderby,\n };\n const currentPage = await this.client.containerRegistry.getTags(\n this.repositoryName,\n optionsComplete,\n );\n continuationState.continuationToken = extractNextLink(currentPage.link);\n if (currentPage.tagAttributeBases) {\n const array = currentPage.tagAttributeBases.map((t) => {\n return {\n registryLoginServer: currentPage.registryLoginServer,\n repositoryName: currentPage.repository,\n ...t,\n };\n });\n yield Object.defineProperty(array, \"continuationToken\", {\n value: continuationState.continuationToken,\n enumerable: true,\n });\n }\n }\n while (continuationState.continuationToken) {\n const currentPage = await this.client.containerRegistry.getTagsNext(\n this.repositoryName,\n continuationState.continuationToken,\n options,\n );\n continuationState.continuationToken = extractNextLink(currentPage.link);\n if (currentPage.tagAttributeBases) {\n const array = currentPage.tagAttributeBases.map((t) => {\n return {\n registryLoginServer: currentPage.registryLoginServer,\n repositoryName: currentPage.repository,\n ...t,\n };\n });\n yield Object.defineProperty(array, \"continuationToken\", {\n value: continuationState.continuationToken,\n enumerable: true,\n });\n }\n }\n }\n}\n"]}
1
+ {"version":3,"file":"registryArtifact.js","sourceRoot":"","sources":["../../src/registryArtifact.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC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;YACxE,IAAI,WAAW,CAAC,iBAAiB,EAAE,CAAC;gBAClC,MAAM,KAAK,GAAG,WAAW,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;oBACpD,OAAO;wBACL,mBAAmB,EAAE,WAAW,CAAC,mBAAmB;wBACpD,cAAc,EAAE,WAAW,CAAC,UAAU;wBACtC,GAAG,CAAC;qBACL,CAAC;gBACJ,CAAC,CAAC,CAAC;gBACH,MAAM,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,mBAAmB,EAAE;oBACtD,KAAK,EAAE,iBAAiB,CAAC,iBAAiB;oBAC1C,UAAU,EAAE,IAAI;iBACjB,CAAC,CAAC;YACL,CAAC;QACH,CAAC;IACH,CAAC;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport type { OperationOptions } from \"@azure/core-client\";\nimport type { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\n\nimport type {\n ArtifactTagProperties,\n ArtifactManifestProperties,\n ArtifactTagOrder,\n TagPageResponse,\n} from \"./models.js\";\nimport { tracingClient } from \"./tracing.js\";\nimport type { GeneratedClient } from \"./generated/index.js\";\nimport { extractNextLink, isDigest } from \"./utils/helpers.js\";\nimport { toArtifactManifestProperties, toServiceTagOrderBy } from \"./transformations.js\";\n\n/**\n * Options for the `delete` method of `RegistryArtifact`.\n */\nexport interface DeleteArtifactOptions extends OperationOptions {}\n/**\n * Options for the `deleteTag` method of `RegistryArtifact`.\n */\nexport interface DeleteTagOptions extends OperationOptions {}\n/**\n * Options for the `getManifestProperties` method of `RegistryArtifact`.\n */\nexport interface GetManifestPropertiesOptions extends OperationOptions {}\n/**\n * Options for the `getTagProperties` method of `RegistryArtifact`.\n */\nexport interface GetTagPropertiesOptions extends OperationOptions {}\n\n/**\n * Options for the `updateTagProperties` method of `RegistryArtifact`.\n */\nexport interface UpdateTagPropertiesOptions extends OperationOptions {\n /** Whether or not this tag can be deleted */\n canDelete?: boolean;\n /** Whether or not this tag can be written to */\n canWrite?: boolean;\n /** Whether or not to include this tag when listing tags */\n canList?: boolean;\n /** Whether or not this tag can be read */\n canRead?: boolean;\n}\n\n/**\n * Options for the `updateManifestProperties` method of `RegistryArtifact`.\n */\nexport interface UpdateManifestPropertiesOptions extends OperationOptions {\n /** Whether or not this manifest can be deleted */\n canDelete?: boolean;\n /** Whether or not this manifest can be written to */\n canWrite?: boolean;\n /** Whether or not to include this manifest when listing manifest properties */\n canList?: boolean;\n /** Whether or not this manifest can be read */\n canRead?: boolean;\n}\n\n/**\n * Options for the `listTagProperties` method of `RegistryArtifact`.\n */\nexport interface ListTagPropertiesOptions extends OperationOptions {\n /** order in which the tags are returned */\n order?: ArtifactTagOrder;\n}\n\n/**\n * `Artifact` is the general term for items stored in a container registry,\n * and can include Docker images or other Open Container Initiative (OCI) artifact types.\n *\n * The {@link RegistryArtifact} interface is a helper that groups information and operations about an image\n * or artifact in a container registry.\n *\n */\nexport interface RegistryArtifact {\n /**\n * The Azure Container Registry endpoint.\n */\n readonly registryEndpoint: string;\n /**\n * Repository name.\n */\n readonly repositoryName: string;\n /**\n * fully qualified reference of the artifact.\n */\n readonly fullyQualifiedReference: string;\n /**\n * Deletes this registry artifact by deleting its manifest.\n * @param options -\n */\n delete(options?: DeleteArtifactOptions): Promise<void>;\n /**\n * Deletes a tag. This removes the tag from the artifact and its manifest.\n * @param tag - the name of the tag to delete.\n * @param options -\n */\n deleteTag(tag: string, options?: DeleteTagOptions): Promise<void>;\n /**\n * Retrieves the properties of the manifest that uniquely identifies this artifact.\n * @param options -\n */\n getManifestProperties(\n options?: GetManifestPropertiesOptions,\n ): Promise<ArtifactManifestProperties>;\n /**\n * Updates the properties of the artifact's manifest.\n *\n * Example usage:\n *\n * ```ts snippet:RegistryArtifactUpdateManifestProperties\n * import { ContainerRegistryClient } from \"@azure/container-registry\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const endpoint = \"https://myregistryname.azurecr.io\";\n * const repositoryName = \"library/hello-world\";\n * const artifactTagOrDigest = \"latest\";\n * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());\n *\n * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest);\n * const updated = await artifact.updateManifestProperties({\n * canDelete: false,\n * canList: false,\n * canRead: false,\n * canWrite: false,\n * });\n * ```\n * @param options -\n */\n updateManifestProperties(\n options: UpdateManifestPropertiesOptions,\n ): Promise<ArtifactManifestProperties>;\n /**\n * Retrieves the properties of the specified tag.\n * @param tag - the tag to retrieve properties.\n * @param options - options to get tag properties\n */\n getTagProperties(tag: string, options?: GetTagPropertiesOptions): Promise<ArtifactTagProperties>;\n /**\n * Updates the properties of a given tag.\n *\n * Example usage:\n *\n * ```ts snippet:RegistryArtifactUpdateTagProperties\n * import { ContainerRegistryClient } from \"@azure/container-registry\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const endpoint = \"https://myregistryname.azurecr.io\";\n * const repositoryName = \"library/hello-world\";\n * const artifactTagOrDigest = \"latest\";\n * const tag = \"latest\";\n * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());\n *\n * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest);\n * const updated = await artifact.updateTagProperties(tag, {\n * canDelete: false,\n * canList: false,\n * canRead: false,\n * canWrite: false,\n * });\n * ```\n * @param tag - name of the tag to update properties on\n * @param options -\n */\n updateTagProperties(\n tag: string,\n options: UpdateTagPropertiesOptions,\n ): Promise<ArtifactTagProperties>;\n /**\n * Returns an async iterable iterator to list the tags that uniquely identify this artifact and the properties of each.\n *\n * Example using `for-await-of` syntax:\n *\n * ```ts snippet:RegistryArtifactListTagProperties\n * import { ContainerRegistryClient } from \"@azure/container-registry\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const endpoint = \"https://myregistryname.azurecr.io\";\n * const repositoryName = \"library/hello-world\";\n * const artifactTagOrDigest = \"latest\";\n * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());\n *\n * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest);\n * for await (const tag of artifact.listTagProperties()) {\n * console.log(\"tag: \", tag);\n * }\n * ```\n *\n * @param options - options to list tags\n */\n listTagProperties(\n options?: ListTagPropertiesOptions,\n ): PagedAsyncIterableIterator<ArtifactTagProperties>;\n}\n\n/**\n * The client class used to interact with the Container Registry service.\n * @internal\n */\nexport class RegistryArtifactImpl {\n private client: GeneratedClient;\n /**\n * The Azure Container Registry endpoint.\n */\n public readonly registryEndpoint: string;\n /**\n * Repository name.\n */\n public readonly repositoryName: string;\n\n /**\n * Name of the form 'registry-login-server/repository-name\\@digest' or\n * 'registry-login-server/repository-name:tag'\n */\n public readonly fullyQualifiedReference: string;\n\n private digest?: string;\n /**\n * Creates an instance of a RegistryArtifact.\n * @param registryEndpoint - the URL to the Container Registry endpoint\n * @param repositoryName - the name of the repository\n * @param tagOrDigest - the tag or digest of this artifact\n * @param client - the generated client that interacts with service\n */\n constructor(\n registryEndpoint: string,\n repositoryName: string,\n private tagOrDigest: string,\n client: GeneratedClient,\n ) {\n this.registryEndpoint = registryEndpoint;\n this.repositoryName = repositoryName;\n\n const parsedUrl = new URL(registryEndpoint);\n if (isDigest(tagOrDigest)) {\n this.digest = tagOrDigest;\n this.fullyQualifiedReference = `${parsedUrl.hostname}/${repositoryName}@${this.digest}`;\n } else {\n this.fullyQualifiedReference = `${parsedUrl.hostname}/${repositoryName}:${tagOrDigest}`;\n }\n\n this.client = client;\n }\n\n /**\n * digest of this artifact.\n */\n private async getDigest(): Promise<string> {\n if (this.digest) {\n return this.digest;\n }\n\n if (!isDigest(this.tagOrDigest)) {\n this.digest = (await this.getTagProperties(this.tagOrDigest)).digest;\n } else {\n this.digest = this.tagOrDigest;\n }\n\n return this.digest;\n }\n\n /**\n * Deletes this registry artifact by deleting its manifest.\n * @param options -\n */\n public async delete(options: DeleteArtifactOptions = {}): Promise<void> {\n return tracingClient.withSpan(\n \"RegistryArtifactImpl.delete\",\n options,\n async (updatedOptions) => {\n await this.client.containerRegistry.deleteManifest(\n this.repositoryName,\n await this.getDigest(),\n updatedOptions,\n );\n },\n );\n }\n\n /**\n * Deletes a tag. This removes the tag from the artifact and its manifest.\n * @param tag - the name of the tag to delete.\n * @param options -\n */\n public async deleteTag(tag: string, options: DeleteTagOptions = {}): Promise<void> {\n if (!tag) {\n throw new Error(\"invalid tag\");\n }\n\n return tracingClient.withSpan(\n \"RegistryArtifactImpl.deleteTag\",\n options,\n async (updatedOptions) => {\n await this.client.containerRegistry.deleteTag(this.repositoryName, tag, updatedOptions);\n },\n );\n }\n\n /**\n * Retrieves the properties of the manifest that uniquely identifies this artifact.\n * @param options -\n */\n public async getManifestProperties(\n options: GetManifestPropertiesOptions = {},\n ): Promise<ArtifactManifestProperties> {\n return tracingClient.withSpan(\n \"RegistryArtifactImpl.getManifestProperties\",\n options,\n async (updatedOptions) => {\n const result = await this.client.containerRegistry.getManifestProperties(\n this.repositoryName,\n await this.getDigest(),\n updatedOptions,\n );\n return toArtifactManifestProperties(\n result,\n this.repositoryName,\n result.registryLoginServer!,\n );\n },\n );\n }\n\n /**\n * Updates the properties of the artifact's manifest.\n *\n * Example usage:\n *\n * ```ts snippet:RegistryArtifactUpdateManifestProperties\n * import { ContainerRegistryClient } from \"@azure/container-registry\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const endpoint = \"https://myregistryname.azurecr.io\";\n * const repositoryName = \"library/hello-world\";\n * const artifactTagOrDigest = \"latest\";\n * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());\n *\n * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest);\n * const updated = await artifact.updateManifestProperties({\n * canDelete: false,\n * canList: false,\n * canRead: false,\n * canWrite: false,\n * });\n * ```\n * @param options - options to update manifest properties\n */\n public async updateManifestProperties(\n options: UpdateManifestPropertiesOptions,\n ): Promise<ArtifactManifestProperties> {\n return tracingClient.withSpan(\n \"RegistryArtifactImpl.updateManifestProperties\",\n {\n ...options,\n value: {\n canDelete: options.canDelete,\n canWrite: options.canWrite,\n canList: options.canList,\n canRead: options.canRead,\n },\n },\n async (updatedOptions) => {\n const result = await this.client.containerRegistry.updateManifestProperties(\n this.repositoryName,\n await this.getDigest(),\n updatedOptions,\n );\n return toArtifactManifestProperties(\n result,\n this.repositoryName,\n result.registryLoginServer!,\n );\n },\n );\n }\n\n /**\n * Retrieves the properties of the specified tag.\n * @param tag - the tag to retrieve properties.\n * @param options - options to get tag properties\n */\n public async getTagProperties(\n tag: string,\n options: GetTagPropertiesOptions = {},\n ): Promise<ArtifactTagProperties> {\n if (!tag) {\n throw new Error(\"invalid tag\");\n }\n\n return tracingClient.withSpan(\n \"RegistryArtifactImpl.getTagProperties\",\n options,\n (updatedOptions) => {\n return this.client.containerRegistry.getTagProperties(\n this.repositoryName,\n tag,\n updatedOptions,\n );\n },\n );\n }\n\n /**\n * Updates the properties of a given tag.\n *\n * Example usage:\n *\n * ```ts snippet:RegistryArtifactUpdateTagProperties\n * import { ContainerRegistryClient } from \"@azure/container-registry\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const endpoint = \"https://myregistryname.azurecr.io\";\n * const repositoryName = \"library/hello-world\";\n * const artifactTagOrDigest = \"latest\";\n * const tag = \"latest\";\n * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());\n *\n * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest);\n * const updated = await artifact.updateTagProperties(tag, {\n * canDelete: false,\n * canList: false,\n * canRead: false,\n * canWrite: false,\n * });\n * ```\n * @param tag - name of the tag to update properties on\n * @param options - options to update tag properties\n */\n public async updateTagProperties(\n tag: string,\n options: UpdateTagPropertiesOptions,\n ): Promise<ArtifactTagProperties> {\n if (!tag) {\n throw new Error(\"invalid tag\");\n }\n\n return tracingClient.withSpan(\n \"RegistryArtifactImpl.updateTagProperties\",\n {\n ...options,\n value: {\n canDelete: options.canDelete,\n canWrite: options.canWrite,\n canList: options.canList,\n canRead: options.canRead,\n },\n },\n (updatedOptions) => {\n return this.client.containerRegistry.updateTagAttributes(\n this.repositoryName,\n tag,\n updatedOptions,\n );\n },\n );\n }\n\n /**\n * Returns an async iterable iterator to list the tags that uniquely identify this artifact and the properties of each.\n *\n * Example using `for-await-of` syntax:\n *\n * ```ts snippet:RegistryArtifactListTagProperties\n * import { ContainerRegistryClient } from \"@azure/container-registry\";\n * import { DefaultAzureCredential } from \"@azure/identity\";\n *\n * const endpoint = \"https://myregistryname.azurecr.io\";\n * const repositoryName = \"library/hello-world\";\n * const artifactTagOrDigest = \"latest\";\n * const client = new ContainerRegistryClient(endpoint, new DefaultAzureCredential());\n *\n * const artifact = client.getArtifact(repositoryName, artifactTagOrDigest);\n * for await (const tag of artifact.listTagProperties()) {\n * console.log(\"tag: \", tag);\n * }\n * ```\n *\n * @param options - options to list tags\n */\n public listTagProperties(\n options: ListTagPropertiesOptions = {},\n ): PagedAsyncIterableIterator<ArtifactTagProperties, TagPageResponse> {\n const iter = this.listTagsItems(options);\n\n return {\n next() {\n return iter.next();\n },\n [Symbol.asyncIterator]() {\n return this;\n },\n byPage: (settings: PageSettings = {}) => this.listTagsPage(settings, options),\n };\n }\n\n private async *listTagsItems(\n options: ListTagPropertiesOptions = {},\n ): AsyncIterableIterator<ArtifactTagProperties> {\n for await (const page of this.listTagsPage({}, options)) {\n yield* page;\n }\n }\n\n private async *listTagsPage(\n continuationState: PageSettings,\n options: ListTagPropertiesOptions = {},\n ): AsyncIterableIterator<TagPageResponse> {\n const orderby = toServiceTagOrderBy(options.order);\n if (!continuationState.continuationToken) {\n const optionsComplete = {\n ...options,\n n: continuationState.maxPageSize,\n orderby,\n };\n const currentPage = await this.client.containerRegistry.getTags(\n this.repositoryName,\n optionsComplete,\n );\n continuationState.continuationToken = extractNextLink(currentPage.link);\n if (currentPage.tagAttributeBases) {\n const array = currentPage.tagAttributeBases.map((t) => {\n return {\n registryLoginServer: currentPage.registryLoginServer,\n repositoryName: currentPage.repository,\n ...t,\n };\n });\n yield Object.defineProperty(array, \"continuationToken\", {\n value: continuationState.continuationToken,\n enumerable: true,\n });\n }\n }\n while (continuationState.continuationToken) {\n const currentPage = await this.client.containerRegistry.getTagsNext(\n this.repositoryName,\n continuationState.continuationToken,\n options,\n );\n continuationState.continuationToken = extractNextLink(currentPage.link);\n if (currentPage.tagAttributeBases) {\n const array = currentPage.tagAttributeBases.map((t) => {\n return {\n registryLoginServer: currentPage.registryLoginServer,\n repositoryName: currentPage.repository,\n ...t,\n };\n });\n yield Object.defineProperty(array, \"continuationToken\", {\n value: continuationState.continuationToken,\n enumerable: true,\n });\n }\n }\n }\n}\n"]}
@@ -12,9 +12,19 @@ export function toManifestWritableProperties(from) {
12
12
  : undefined;
13
13
  }
14
14
  export function toArtifactManifestProperties(from, repositoryName, registryLoginServer) {
15
- var _a, _b, _c, _d;
16
- return Object.assign({ registryLoginServer,
17
- repositoryName, digest: from.digest, sizeInBytes: from.size, createdOn: from.createdOn, lastUpdatedOn: from.lastUpdatedOn, architecture: (_a = from.architecture) !== null && _a !== void 0 ? _a : undefined, operatingSystem: (_b = from.operatingSystem) !== null && _b !== void 0 ? _b : undefined, relatedArtifacts: (_c = from.relatedArtifacts) !== null && _c !== void 0 ? _c : [], tags: (_d = from.tags) !== null && _d !== void 0 ? _d : [] }, toManifestWritableProperties(from));
15
+ return {
16
+ registryLoginServer,
17
+ repositoryName,
18
+ digest: from.digest,
19
+ sizeInBytes: from.size,
20
+ createdOn: from.createdOn,
21
+ lastUpdatedOn: from.lastUpdatedOn,
22
+ architecture: from.architecture ?? undefined,
23
+ operatingSystem: from.operatingSystem ?? undefined,
24
+ relatedArtifacts: from.relatedArtifacts ?? [],
25
+ tags: from.tags ?? [],
26
+ ...toManifestWritableProperties(from),
27
+ };
18
28
  }
19
29
  export function toServiceTagOrderBy(orderBy) {
20
30
  return orderBy === "LastUpdatedOnAscending"
@@ -1 +1 @@
1
- {"version":3,"file":"transformations.js","sourceRoot":"","sources":["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AC,CAAC,SAAS,CAAC;AAClB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n ArtifactTagOrderBy as ServiceTagOrderBy,\n ArtifactManifestOrderBy as ServiceManifestOrderBy,\n ManifestWriteableProperties as ServiceManifestWritableProperties,\n ArtifactManifestProperties as ServiceArtifactManifestProperties,\n} from \"./generated/models/index.js\";\nimport type {\n ArtifactManifestProperties,\n ArtifactTagOrder,\n ArtifactManifestOrder,\n} from \"./models.js\";\n\n/** Changeable attributes. Filter out `quarantineState` and `quarantineDetails` returned by service */\ninterface ManifestWriteableProperties {\n /** Delete enabled */\n canDelete?: boolean;\n /** Write enabled */\n canWrite?: boolean;\n /** List enabled */\n canList?: boolean;\n /** Read enabled */\n canRead?: boolean;\n}\n\nexport function toManifestWritableProperties(\n from?: ServiceManifestWritableProperties,\n): ManifestWriteableProperties | undefined {\n // don't return unwanted properties, namely `quarantineState` and `quarantineDetails`\n return from\n ? {\n canDelete: from.canDelete,\n canList: from.canList,\n canRead: from.canRead,\n canWrite: from.canWrite,\n }\n : undefined;\n}\n\nexport function toArtifactManifestProperties(\n from: ServiceArtifactManifestProperties,\n repositoryName: string,\n registryLoginServer: string,\n): ArtifactManifestProperties {\n return {\n registryLoginServer,\n repositoryName,\n digest: from.digest,\n sizeInBytes: from.size,\n createdOn: from.createdOn,\n lastUpdatedOn: from.lastUpdatedOn,\n architecture: from.architecture ?? undefined,\n operatingSystem: from.operatingSystem ?? undefined,\n relatedArtifacts: from.relatedArtifacts ?? [],\n tags: from.tags ?? [],\n ...toManifestWritableProperties(from),\n };\n}\n\nexport function toServiceTagOrderBy(orderBy?: ArtifactTagOrder): ServiceTagOrderBy | undefined {\n return orderBy === \"LastUpdatedOnAscending\"\n ? \"timeasc\"\n : orderBy === \"LastUpdatedOnDescending\"\n ? \"timedesc\"\n : undefined;\n}\n\nexport function toServiceManifestOrderBy(\n orderBy?: ArtifactManifestOrder,\n): ServiceManifestOrderBy | undefined {\n return orderBy === \"LastUpdatedOnAscending\"\n ? \"timeasc\"\n : orderBy === \"LastUpdatedOnDescending\"\n ? \"timedesc\"\n : undefined;\n}\n"]}
1
+ {"version":3,"file":"transformations.js","sourceRoot":"","sources":["../../src/transformations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AA0BlC,MAAM,UAAU,4BAA4B,CAC1C,IAAwC;IAExC,qFAAqF;IACrF,OAAO,IAAI;QACT,CAAC,CAAC;YACE,SAAS,EAAE,IAAI,CAAC,SAAS;YACzB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,QAAQ,EAAE,IAAI,CAAC,QAAQ;SACxB;QACH,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,4BAA4B,CAC1C,IAAuC,EACvC,cAAsB,EACtB,mBAA2B;IAE3B,OAAO;QACL,mBAAmB;QACnB,cAAc;QACd,MAAM,EAAE,IAAI,CAAC,MAAM;QACnB,WAAW,EAAE,IAAI,CAAC,IAAI;QACtB,SAAS,EAAE,IAAI,CAAC,SAAS;QACzB,aAAa,EAAE,IAAI,CAAC,aAAa;QACjC,YAAY,EAAE,IAAI,CAAC,YAAY,IAAI,SAAS;QAC5C,eAAe,EAAE,IAAI,CAAC,eAAe,IAAI,SAAS;QAClD,gBAAgB,EAAE,IAAI,CAAC,gBAAgB,IAAI,EAAE;QAC7C,IAAI,EAAE,IAAI,CAAC,IAAI,IAAI,EAAE;QACrB,GAAG,4BAA4B,CAAC,IAAI,CAAC;KACtC,CAAC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAA0B;IAC5D,OAAO,OAAO,KAAK,wBAAwB;QACzC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,OAAO,KAAK,yBAAyB;YACrC,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,SAAS,CAAC;AAClB,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,OAA+B;IAE/B,OAAO,OAAO,KAAK,wBAAwB;QACzC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,OAAO,KAAK,yBAAyB;YACrC,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,SAAS,CAAC;AAClB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\nimport type {\n ArtifactTagOrderBy as ServiceTagOrderBy,\n ArtifactManifestOrderBy as ServiceManifestOrderBy,\n ManifestWriteableProperties as ServiceManifestWritableProperties,\n ArtifactManifestProperties as ServiceArtifactManifestProperties,\n} from \"./generated/models/index.js\";\nimport type {\n ArtifactManifestProperties,\n ArtifactTagOrder,\n ArtifactManifestOrder,\n} from \"./models.js\";\n\n/** Changeable attributes. Filter out `quarantineState` and `quarantineDetails` returned by service */\ninterface ManifestWriteableProperties {\n /** Delete enabled */\n canDelete?: boolean;\n /** Write enabled */\n canWrite?: boolean;\n /** List enabled */\n canList?: boolean;\n /** Read enabled */\n canRead?: boolean;\n}\n\nexport function toManifestWritableProperties(\n from?: ServiceManifestWritableProperties,\n): ManifestWriteableProperties | undefined {\n // don't return unwanted properties, namely `quarantineState` and `quarantineDetails`\n return from\n ? {\n canDelete: from.canDelete,\n canList: from.canList,\n canRead: from.canRead,\n canWrite: from.canWrite,\n }\n : undefined;\n}\n\nexport function toArtifactManifestProperties(\n from: ServiceArtifactManifestProperties,\n repositoryName: string,\n registryLoginServer: string,\n): ArtifactManifestProperties {\n return {\n registryLoginServer,\n repositoryName,\n digest: from.digest,\n sizeInBytes: from.size,\n createdOn: from.createdOn,\n lastUpdatedOn: from.lastUpdatedOn,\n architecture: from.architecture ?? undefined,\n operatingSystem: from.operatingSystem ?? undefined,\n relatedArtifacts: from.relatedArtifacts ?? [],\n tags: from.tags ?? [],\n ...toManifestWritableProperties(from),\n };\n}\n\nexport function toServiceTagOrderBy(orderBy?: ArtifactTagOrder): ServiceTagOrderBy | undefined {\n return orderBy === \"LastUpdatedOnAscending\"\n ? \"timeasc\"\n : orderBy === \"LastUpdatedOnDescending\"\n ? \"timedesc\"\n : undefined;\n}\n\nexport function toServiceManifestOrderBy(\n orderBy?: ArtifactManifestOrder,\n): ServiceManifestOrderBy | undefined {\n return orderBy === \"LastUpdatedOnAscending\"\n ? \"timeasc\"\n : orderBy === \"LastUpdatedOnDescending\"\n ? \"timedesc\"\n : undefined;\n}\n"]}
@@ -1,6 +1,5 @@
1
1
  // Copyright (c) Microsoft Corporation.
2
2
  // Licensed under the MIT License.
3
- import { __asyncGenerator, __asyncValues, __await } from "tslib";
4
3
  /**
5
4
  * Extract the path part from the next link value returned by the service,
6
5
  * @internal
@@ -9,7 +8,7 @@ export function extractNextLink(value) {
9
8
  // The link value has this pattern
10
9
  // `</acr/v1/name/...&n=2&orderby=>; rel="next"`
11
10
  // and we only want the part inside of <...>
12
- return value === null || value === void 0 ? void 0 : value.substr(1, value.indexOf(">") - 1);
11
+ return value?.substr(1, value.indexOf(">") - 1);
13
12
  }
14
13
  /**
15
14
  * Checks whether a string is a digest
@@ -33,40 +32,25 @@ export async function readStreamToEnd(stream, maxLength) {
33
32
  stream.on("error", (err) => reject(err));
34
33
  });
35
34
  }
36
- export function readChunksFromStream(stream, chunkSize) {
37
- return __asyncGenerator(this, arguments, function* readChunksFromStream_1() {
38
- var _a, e_1, _b, _c;
39
- let chunk = Buffer.alloc(chunkSize);
40
- let chunkCursor = 0;
41
- try {
42
- for (var _d = true, stream_1 = __asyncValues(stream), stream_1_1; stream_1_1 = yield __await(stream_1.next()), _a = stream_1_1.done, !_a; _d = true) {
43
- _c = stream_1_1.value;
44
- _d = false;
45
- const data = _c;
46
- const dataAsBuffer = Buffer.isBuffer(data) ? data : Buffer.from(data, "utf8");
47
- let dataCursor = 0;
48
- while (dataCursor < dataAsBuffer.length) {
49
- const bytesCopied = dataAsBuffer.copy(chunk, chunkCursor, dataCursor);
50
- dataCursor += bytesCopied;
51
- chunkCursor += bytesCopied;
52
- if (chunkCursor >= chunkSize) {
53
- yield yield __await(chunk);
54
- chunkCursor = 0;
55
- chunk = Buffer.alloc(chunkSize);
56
- }
57
- }
35
+ export async function* readChunksFromStream(stream, chunkSize) {
36
+ let chunk = Buffer.alloc(chunkSize);
37
+ let chunkCursor = 0;
38
+ for await (const data of stream) {
39
+ const dataAsBuffer = Buffer.isBuffer(data) ? data : Buffer.from(data, "utf8");
40
+ let dataCursor = 0;
41
+ while (dataCursor < dataAsBuffer.length) {
42
+ const bytesCopied = dataAsBuffer.copy(chunk, chunkCursor, dataCursor);
43
+ dataCursor += bytesCopied;
44
+ chunkCursor += bytesCopied;
45
+ if (chunkCursor >= chunkSize) {
46
+ yield chunk;
47
+ chunkCursor = 0;
48
+ chunk = Buffer.alloc(chunkSize);
58
49
  }
59
50
  }
60
- catch (e_1_1) { e_1 = { error: e_1_1 }; }
61
- finally {
62
- try {
63
- if (!_d && !_a && (_b = stream_1.return)) yield __await(_b.call(stream_1));
64
- }
65
- finally { if (e_1) throw e_1.error; }
66
- }
67
- if (chunkCursor > 0) {
68
- yield yield __await(chunk.subarray(0, chunkCursor));
69
- }
70
- });
51
+ }
52
+ if (chunkCursor > 0) {
53
+ yield chunk.subarray(0, chunkCursor);
54
+ }
71
55
  }
72
56
  //# sourceMappingURL=helpers.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAElC;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,KAAyB;IACvD,kCAAkC;IAClC,oDAAoD;IACpD,4CAA4C;IAC5C,OAAO,KAAK,aAAL,KAAK,uBAAL,KAAK,CAAE,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAClD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,WAAmB;IAC1C,OAAO,WAAW,CAAC,QAAQ,CAA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I,CAAC,IAAI,EAAE,MAAM,CAAC,CAAC;gBAC9E,IAAI,UAAU,GAAG,CAAC,CAAC;gBAEnB,OAAO,UAAU,GAAG,YAAY,CAAC,MAAM,EAAE,CAAC;oBACxC,MAAM,WAAW,GAAG,YAAY,CAAC,IAAI,CAAC,KAAK,EAAE,WAAW,EAAE,UAAU,CAAC,CAAC;oBACtE,UAAU,IAAI,WAAW,CAAC;oBAC1B,WAAW,IAAI,WAAW,CAAC;oBAC3B,IAAI,WAAW,IAAI,SAAS,EAAE,CAAC;wBAC7B,oBAAM,KAAK,CAAA,CAAC;wBACZ,WAAW,GAAG,CAAC,CAAC;wBAChB,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;oBAClC,CAAC;gBACH,CAAC;YACH,CAAC;;;;;;;;;QAED,IAAI,WAAW,GAAG,CAAC,EAAE,CAAC;YACpB,oBAAM,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,WAAW,CAAC,CAAA,CAAC;QACvC,CAAC;IACH,CAAC;CAAA","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Extract the path part from the next link value returned by the service,\n * @internal\n */\nexport function extractNextLink(value: string | undefined): string | undefined {\n // The link value has this pattern\n // `</acr/v1/name/...&n=2&orderby=>; rel=\"next\"`\n // and we only want the part inside of <...>\n return value?.substr(1, value.indexOf(\">\") - 1);\n}\n\n/**\n * Checks whether a string is a digest\n * @internal\n */\nexport function isDigest(tagOrDigest: string): boolean {\n return tagOrDigest.includes(\":\");\n}\n\nexport async function readStreamToEnd(\n stream: NodeJS.ReadableStream,\n maxLength?: number,\n): Promise<Buffer> {\n const buffers: Buffer[] = [];\n let bytesRead = 0;\n\n return new Promise((resolve, reject) => {\n stream.on(\"data\", (chunk) => {\n buffers.push(chunk);\n bytesRead += chunk.length;\n\n if (maxLength && bytesRead > maxLength) {\n reject(new Error(`Stream exceeded maximum allowed length of ${maxLength} bytes.`));\n }\n });\n stream.on(\"end\", () => resolve(Buffer.concat(buffers)));\n stream.on(\"error\", (err) => reject(err));\n });\n}\n\nexport async function* readChunksFromStream(\n stream: NodeJS.ReadableStream,\n chunkSize: number,\n): AsyncGenerator<Buffer> {\n let chunk = Buffer.alloc(chunkSize);\n let chunkCursor = 0;\n\n for await (const data of stream) {\n const dataAsBuffer = Buffer.isBuffer(data) ? data : Buffer.from(data, \"utf8\");\n let dataCursor = 0;\n\n while (dataCursor < dataAsBuffer.length) {\n const bytesCopied = dataAsBuffer.copy(chunk, chunkCursor, dataCursor);\n dataCursor += bytesCopied;\n chunkCursor += bytesCopied;\n if (chunkCursor >= chunkSize) {\n yield chunk;\n chunkCursor = 0;\n chunk = Buffer.alloc(chunkSize);\n }\n }\n }\n\n if (chunkCursor > 0) {\n yield chunk.subarray(0, chunkCursor);\n }\n}\n"]}
1
+ {"version":3,"file":"helpers.js","sourceRoot":"","sources":["../../../src/utils/helpers.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAElC;;;GAGG;AACH,MAAM,UAAU,eAAe,CAAC,KAAyB;IACvD,kCAAkC;IAClC,oDAAoD;IACpD,4CAA4C;IAC5C,OAAO,KAAK,EAAE,MAAM,CAAC,CAAC,EAAE,KAAK,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC,CAAC;AAClD,CAAC;AAED;;;GAGG;AACH,MAAM,UAAU,QAAQ,CAAC,WAAmB;IAC1C,OAAO,WAAW,CAAC,QAAQ,CAAC,GAAG,CAAC,CAAC;AACnC,CAAC;AAED,MAAM,CAAC,KAAK,UAAU,eAAe,CACnC,MAA6B,EAC7B,SAAkB;IAElB,MAAM,OAAO,GAAa,EAAE,CAAC;IAC7B,IAAI,SAAS,GAAG,CAAC,CAAC;IAElB,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,MAAM,EAAE,EAAE;QACrC,MAAM,CAAC,EAAE,CAAC,MAAM,EAAE,CAAC,KAAK,EAAE,EAAE;Y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,CAAC;gBACZ,WAAW,GAAG,CAAC,CAAC;gBAChB,KAAK,GAAG,MAAM,CAAC,KAAK,CAAC,SAAS,CAAC,CAAC;YAClC,CAAC;QACH,CAAC;IACH,CAAC;IAED,IAAI,WAAW,GAAG,CAAC,EAAE,CAAC;QACpB,MAAM,KAAK,CAAC,QAAQ,CAAC,CAAC,EAAE,WAAW,CAAC,CAAC;IACvC,CAAC;AACH,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT License.\n\n/**\n * Extract the path part from the next link value returned by the service,\n * @internal\n */\nexport function extractNextLink(value: string | undefined): string | undefined {\n // The link value has this pattern\n // `</acr/v1/name/...&n=2&orderby=>; rel=\"next\"`\n // and we only want the part inside of <...>\n return value?.substr(1, value.indexOf(\">\") - 1);\n}\n\n/**\n * Checks whether a string is a digest\n * @internal\n */\nexport function isDigest(tagOrDigest: string): boolean {\n return tagOrDigest.includes(\":\");\n}\n\nexport async function readStreamToEnd(\n stream: NodeJS.ReadableStream,\n maxLength?: number,\n): Promise<Buffer> {\n const buffers: Buffer[] = [];\n let bytesRead = 0;\n\n return new Promise((resolve, reject) => {\n stream.on(\"data\", (chunk) => {\n buffers.push(chunk);\n bytesRead += chunk.length;\n\n if (maxLength && bytesRead > maxLength) {\n reject(new Error(`Stream exceeded maximum allowed length of ${maxLength} bytes.`));\n }\n });\n stream.on(\"end\", () => resolve(Buffer.concat(buffers)));\n stream.on(\"error\", (err) => reject(err));\n });\n}\n\nexport async function* readChunksFromStream(\n stream: NodeJS.ReadableStream,\n chunkSize: number,\n): AsyncGenerator<Buffer> {\n let chunk = Buffer.alloc(chunkSize);\n let chunkCursor = 0;\n\n for await (const data of stream) {\n const dataAsBuffer = Buffer.isBuffer(data) ? data : Buffer.from(data, \"utf8\");\n let dataCursor = 0;\n\n while (dataCursor < dataAsBuffer.length) {\n const bytesCopied = dataAsBuffer.copy(chunk, chunkCursor, dataCursor);\n dataCursor += bytesCopied;\n chunkCursor += bytesCopied;\n if (chunkCursor >= chunkSize) {\n yield chunk;\n chunkCursor = 0;\n chunk = Buffer.alloc(chunkSize);\n }\n }\n }\n\n if (chunkCursor > 0) {\n yield chunk.subarray(0, chunkCursor);\n }\n}\n"]}