@azure/container-registry 1.0.0-beta.6 → 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -1 +1 @@
1
- {"version":3,"file":"registryArtifact.js","sourceRoot":"","sources":["../../src/registryArtifact.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;;AAKlC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,oBAAoB,CAAC;AAS5B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AA8LtF;;;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,GAAG,cAAc,CAAC;QAErC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC5C,IAAI,QAAQ,CAAC,WAAW,CAAC,EAAE;YACzB,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC;YAC1B,IAAI,CAAC,uBAAuB,GAAG,GAAG,SAAS,CAAC,QAAQ,IAAI,cAAc,IAAI,IAAI,CAAC,MAAM,EAAE,CAAC;SACzF;aAAM;YACL,IAAI,CAAC,uBAAuB,GAAG,GAAG,SAAS,CAAC,QAAQ,IAAI,cAAc,IAAI,WAAW,EAAE,CAAC;SACzF;QAED,IAAI,CAAC,MAAM,GAAG,MAAM,CAAC;IACvB,CAAC;IAED;;OAEG;IACK,KAAK,CAA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E,IAAI,CAAC,cAAc,EACnB,iBAAiB,CAAC,iBAAiB,EACnC,OAAO,CACR,CAAA,CAAC;gBACF,iBAAiB,CAAC,iBAAiB,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;gBACxE,IAAI,WAAW,CAAC,iBAAiB,EAAE;oBACjC,MAAM,KAAK,GAAG,WAAW,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;wBACpD,uBACE,mBAAmB,EAAE,WAAW,CAAC,mBAAmB,EACpD,cAAc,EAAE,WAAW,CAAC,UAAU,IACnC,CAAC,EACJ;oBACJ,CAAC,CAAC,CAAC;oBACH,oBAAM,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,mBAAmB,EAAE;wBACtD,KAAK,EAAE,iBAAiB,CAAC,iBAAiB;wBAC1C,UAAU,EAAE,IAAI;qBACjB,CAAC,CAAA,CAAC;iBACJ;aACF;QACH,CAAC;KAAA;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport { OperationOptions } from \"@azure/core-client\";\nimport { SpanStatusCode } from \"@azure/core-tracing\";\nimport \"@azure/core-paging\";\nimport { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\n\nimport {\n ArtifactTagProperties,\n ArtifactManifestProperties,\n TagOrderBy,\n TagPageResponse\n} from \"./models\";\nimport { URL } from \"./utils/url\";\nimport { createSpan } from \"./tracing\";\nimport { GeneratedClient } from \"./generated\";\nimport { extractNextLink, isDigest } from \"./utils/helpers\";\nimport { toArtifactManifestProperties, toServiceTagOrderBy } from \"./transformations\";\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 /** orderby query parameter */\n orderBy?: TagOrderBy;\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 * ```javascript\n * const client = new ContainerRegistryClient(url, credential);\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 -\n */\n getTagProperties(tag: string, options?: GetTagPropertiesOptions): Promise<ArtifactTagProperties>;\n /**\n * Updates the properties of a given tag.\n *\n * Example usage:\n *\n * ```javascript\n * const client = new ContainerRegistryClient(url, credential);\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 * ```javascript\n * const client = new ContainerRegistryClient(url, credentials);\n * const repository = client.getRepository(repositoryName);\n * const artifact = repository.getArtifact(digest)\n * for await (const tag of artifact.listTagProperties()) {\n * console.log(\"tag: \", tag);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```javascript\n * const iter = artifact.listTagProperties();\n * let item = await iter.next();\n * while (!item.done) {\n * console.log(\"tag properties: \", item.value);\n * item = await iter.next();\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```javascript\n * const pages = artifact.listTagProperties().byPage({ maxPageSize: 2 });\n * let page = await pages.next();\n * let i = 1;\n * while (!page.done) {\n * if (page.value) {\n * console.log(`-- page ${i++}`);\n * for (const tagProperties of page.value) {\n * console.log(` repository name: ${tagProperties}`);\n * }\n * }\n * page = await pages.next();\n * }\n * ```\n * @param options -\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 const { span, updatedOptions } = createSpan(\"RegistryArtifact-delete\", options);\n\n try {\n await this.client.containerRegistry.deleteManifest(\n this.repositoryName,\n await this.getDigest(),\n updatedOptions\n );\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\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 const { span, updatedOptions } = createSpan(\"RegistryArtifact-deleteTag\", options);\n\n try {\n await this.client.containerRegistry.deleteTag(this.repositoryName, tag, updatedOptions);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\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 const { span, updatedOptions } = createSpan(\"RegistryArtifact-getManifestProperties\", options);\n\n try {\n const result = await this.client.containerRegistry.getManifestProperties(\n this.repositoryName,\n await this.getDigest(),\n updatedOptions\n );\n return toArtifactManifestProperties(result, this.repositoryName, result.registryLoginServer!);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Updates the properties of the artifact's manifest.\n *\n * Example usage:\n *\n * ```javascript\n * const client = new ContainerRegistryClient(url, credential);\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 public async updateManifestProperties(\n options: UpdateManifestPropertiesOptions\n ): Promise<ArtifactManifestProperties> {\n const { span, updatedOptions } = createSpan(\"RegistryArtifact-updateManifestProperties\", {\n ...options,\n value: {\n canDelete: options.canDelete,\n canWrite: options.canWrite,\n canList: options.canList,\n canRead: options.canRead\n }\n });\n\n try {\n const result = await this.client.containerRegistry.updateManifestProperties(\n this.repositoryName,\n await this.getDigest(),\n updatedOptions\n );\n return toArtifactManifestProperties(result, this.repositoryName, result.registryLoginServer!);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Retrieves the properties of the specified tag.\n * @param tag - the tag to retrieve properties.\n * @param options -\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 const { span, updatedOptions } = createSpan(\"RegistryArtifact-getTagProperties\", options);\n try {\n return await this.client.containerRegistry.getTagProperties(\n this.repositoryName,\n tag,\n updatedOptions\n );\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Updates the properties of a given tag.\n *\n * Example usage:\n *\n * ```javascript\n * const client = new ContainerRegistryClient(url, credential);\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 public async updateTagProperties(\n tag: string,\n options: UpdateTagPropertiesOptions\n ): Promise<ArtifactTagProperties> {\n if (!tag) {\n throw new Error(\"invalid tag\");\n }\n\n const { span, updatedOptions } = createSpan(\"RegistryArtifact-updateTagProperties\", {\n ...options,\n value: {\n canDelete: options.canDelete,\n canWrite: options.canWrite,\n canList: options.canList,\n canRead: options.canRead\n }\n });\n\n try {\n return await this.client.containerRegistry.updateTagAttributes(\n this.repositoryName,\n tag,\n updatedOptions\n );\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\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 * ```javascript\n * const client = new ContainerRegistryClient(url, credentials);\n * const repository = client.getRepository(repositoryName);\n * const artifact = repository.getArtifact(digest)\n * for await (const tag of artifact.listTagProperties()) {\n * console.log(\"tag: \", tag);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```javascript\n * const iter = artifact.listTagProperties();\n * let item = await iter.next();\n * while (!item.done) {\n * console.log(\"tag properties: \", item.value);\n * item = await iter.next();\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```javascript\n * const pages = artifact.listTagProperties().byPage({ maxPageSize: 2 });\n * let page = await pages.next();\n * let i = 1;\n * while (!page.done) {\n * if (page.value) {\n * console.log(`-- page ${i++}`);\n * for (const tagProperties of page.value) {\n * console.log(` repository name: ${tagProperties}`);\n * }\n * }\n * page = await pages.next();\n * }\n * ```\n * @param options -\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.orderBy);\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,kCAAkC;;AAKlC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AACrD,OAAO,oBAAoB,CAAC;AAS5B,OAAO,EAAE,GAAG,EAAE,MAAM,aAAa,CAAC;AAClC,OAAO,EAAE,UAAU,EAAE,MAAM,WAAW,CAAC;AAEvC,OAAO,EAAE,eAAe,EAAE,QAAQ,EAAE,MAAM,iBAAiB,CAAC;AAC5D,OAAO,EAAE,4BAA4B,EAAE,mBAAmB,EAAE,MAAM,mBAAmB,CAAC;AA8LtF;;;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,GAAG,cAAc,CAAC;QAErC,MAAM,SAAS,GAAG,IAAI,GAAG,CAAC,gBAAgB,CAAC,CAAC;QAC5C,IAAI,QAAQ,CAAC,WAAW,CAAC,EAAE;YACzB,IAAI,CAAC,MAAM,GAAG,WAAW,CAAC;YAC1B,IAAI,CAAC,uBAAuB,GAAG,GAAG,SAAS,CAAC,QAAQ,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AAmB,EAAE;wBACtD,KAAK,EAAE,iBAAiB,CAAC,iBAAiB;wBAC1C,UAAU,EAAE,IAAI;qBACjB,CAAC,CAAA,CAAC;iBACJ;aACF;YACD,OAAO,iBAAiB,CAAC,iBAAiB,EAAE;gBAC1C,MAAM,WAAW,GAAG,cAAM,IAAI,CAAC,MAAM,CAAC,iBAAiB,CAAC,WAAW,CACjE,IAAI,CAAC,cAAc,EACnB,iBAAiB,CAAC,iBAAiB,EACnC,OAAO,CACR,CAAA,CAAC;gBACF,iBAAiB,CAAC,iBAAiB,GAAG,eAAe,CAAC,WAAW,CAAC,IAAI,CAAC,CAAC;gBACxE,IAAI,WAAW,CAAC,iBAAiB,EAAE;oBACjC,MAAM,KAAK,GAAG,WAAW,CAAC,iBAAiB,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE;wBACpD,uBACE,mBAAmB,EAAE,WAAW,CAAC,mBAAmB,EACpD,cAAc,EAAE,WAAW,CAAC,UAAU,IACnC,CAAC,EACJ;oBACJ,CAAC,CAAC,CAAC;oBACH,oBAAM,MAAM,CAAC,cAAc,CAAC,KAAK,EAAE,mBAAmB,EAAE;wBACtD,KAAK,EAAE,iBAAiB,CAAC,iBAAiB;wBAC1C,UAAU,EAAE,IAAI;qBACjB,CAAC,CAAA,CAAC;iBACJ;aACF;QACH,CAAC;KAAA;CACF","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/// <reference lib=\"esnext.asynciterable\" />\n\nimport { OperationOptions } from \"@azure/core-client\";\nimport { SpanStatusCode } from \"@azure/core-tracing\";\nimport \"@azure/core-paging\";\nimport { PageSettings, PagedAsyncIterableIterator } from \"@azure/core-paging\";\n\nimport {\n ArtifactTagProperties,\n ArtifactManifestProperties,\n ArtifactTagOrder,\n TagPageResponse,\n} from \"./models\";\nimport { URL } from \"./utils/url\";\nimport { createSpan } from \"./tracing\";\nimport { GeneratedClient } from \"./generated\";\nimport { extractNextLink, isDigest } from \"./utils/helpers\";\nimport { toArtifactManifestProperties, toServiceTagOrderBy } from \"./transformations\";\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 * ```javascript\n * const client = new ContainerRegistryClient(url, credential);\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 -\n */\n getTagProperties(tag: string, options?: GetTagPropertiesOptions): Promise<ArtifactTagProperties>;\n /**\n * Updates the properties of a given tag.\n *\n * Example usage:\n *\n * ```javascript\n * const client = new ContainerRegistryClient(url, credential);\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 * ```javascript\n * const client = new ContainerRegistryClient(url, credentials);\n * const repository = client.getRepository(repositoryName);\n * const artifact = repository.getArtifact(digest)\n * for await (const tag of artifact.listTagProperties()) {\n * console.log(\"tag: \", tag);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```javascript\n * const iter = artifact.listTagProperties();\n * let item = await iter.next();\n * while (!item.done) {\n * console.log(\"tag properties: \", item.value);\n * item = await iter.next();\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```javascript\n * const pages = artifact.listTagProperties().byPage({ maxPageSize: 2 });\n * let page = await pages.next();\n * let i = 1;\n * while (!page.done) {\n * if (page.value) {\n * console.log(`-- page ${i++}`);\n * for (const tagProperties of page.value) {\n * console.log(` repository name: ${tagProperties}`);\n * }\n * }\n * page = await pages.next();\n * }\n * ```\n * @param options -\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 const { span, updatedOptions } = createSpan(\"RegistryArtifact-delete\", options);\n\n try {\n await this.client.containerRegistry.deleteManifest(\n this.repositoryName,\n await this.getDigest(),\n updatedOptions\n );\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\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 const { span, updatedOptions } = createSpan(\"RegistryArtifact-deleteTag\", options);\n\n try {\n await this.client.containerRegistry.deleteTag(this.repositoryName, tag, updatedOptions);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\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 const { span, updatedOptions } = createSpan(\"RegistryArtifact-getManifestProperties\", options);\n\n try {\n const result = await this.client.containerRegistry.getManifestProperties(\n this.repositoryName,\n await this.getDigest(),\n updatedOptions\n );\n return toArtifactManifestProperties(result, this.repositoryName, result.registryLoginServer!);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Updates the properties of the artifact's manifest.\n *\n * Example usage:\n *\n * ```javascript\n * const client = new ContainerRegistryClient(url, credential);\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 public async updateManifestProperties(\n options: UpdateManifestPropertiesOptions\n ): Promise<ArtifactManifestProperties> {\n const { span, updatedOptions } = createSpan(\"RegistryArtifact-updateManifestProperties\", {\n ...options,\n value: {\n canDelete: options.canDelete,\n canWrite: options.canWrite,\n canList: options.canList,\n canRead: options.canRead,\n },\n });\n\n try {\n const result = await this.client.containerRegistry.updateManifestProperties(\n this.repositoryName,\n await this.getDigest(),\n updatedOptions\n );\n return toArtifactManifestProperties(result, this.repositoryName, result.registryLoginServer!);\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Retrieves the properties of the specified tag.\n * @param tag - the tag to retrieve properties.\n * @param options -\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 const { span, updatedOptions } = createSpan(\"RegistryArtifact-getTagProperties\", options);\n try {\n return await this.client.containerRegistry.getTagProperties(\n this.repositoryName,\n tag,\n updatedOptions\n );\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\n }\n }\n\n /**\n * Updates the properties of a given tag.\n *\n * Example usage:\n *\n * ```javascript\n * const client = new ContainerRegistryClient(url, credential);\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 public async updateTagProperties(\n tag: string,\n options: UpdateTagPropertiesOptions\n ): Promise<ArtifactTagProperties> {\n if (!tag) {\n throw new Error(\"invalid tag\");\n }\n\n const { span, updatedOptions } = createSpan(\"RegistryArtifact-updateTagProperties\", {\n ...options,\n value: {\n canDelete: options.canDelete,\n canWrite: options.canWrite,\n canList: options.canList,\n canRead: options.canRead,\n },\n });\n\n try {\n return await this.client.containerRegistry.updateTagAttributes(\n this.repositoryName,\n tag,\n updatedOptions\n );\n } catch (e) {\n span.setStatus({ code: SpanStatusCode.ERROR, message: e.message });\n throw e;\n } finally {\n span.end();\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 * ```javascript\n * const client = new ContainerRegistryClient(url, credentials);\n * const repository = client.getRepository(repositoryName);\n * const artifact = repository.getArtifact(digest)\n * for await (const tag of artifact.listTagProperties()) {\n * console.log(\"tag: \", tag);\n * }\n * ```\n *\n * Example using `iter.next()`:\n *\n * ```javascript\n * const iter = artifact.listTagProperties();\n * let item = await iter.next();\n * while (!item.done) {\n * console.log(\"tag properties: \", item.value);\n * item = await iter.next();\n * }\n * ```\n *\n * Example using `byPage()`:\n *\n * ```javascript\n * const pages = artifact.listTagProperties().byPage({ maxPageSize: 2 });\n * let page = await pages.next();\n * let i = 1;\n * while (!page.done) {\n * if (page.value) {\n * console.log(`-- page ${i++}`);\n * for (const tagProperties of page.value) {\n * console.log(` repository name: ${tagProperties}`);\n * }\n * }\n * page = await pages.next();\n * }\n * ```\n * @param options -\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,6 +12,6 @@ import { createSpanFunction } from "@azure/core-tracing";
12
12
  */
13
13
  export const createSpan = createSpanFunction({
14
14
  namespace: "Azure.Containers",
15
- packagePrefix: "Azure.Containers.ContainerRegistry"
15
+ packagePrefix: "Azure.Containers.ContainerRegistry",
16
16
  });
17
17
  //# sourceMappingURL=tracing.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tracing.js","sourceRoot":"","sources":["../../src/tracing.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,EAAE;AACF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC;IAC3C,SAAS,EAAE,kBAAkB;IAC7B,aAAa,EAAE,oCAAoC;CACpD,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n//\nimport { createSpanFunction } from \"@azure/core-tracing\";\n\n/**\n * Creates a span using the global tracer.\n *\n * @param name - The name of the operation being performed.\n * @param tracingOptions - The options for the underlying http request.\n *\n * @internal\n */\nexport const createSpan = createSpanFunction({\n namespace: \"Azure.Containers\",\n packagePrefix: \"Azure.Containers.ContainerRegistry\"\n});\n"]}
1
+ {"version":3,"file":"tracing.js","sourceRoot":"","sources":["../../src/tracing.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAClC,EAAE;AACF,OAAO,EAAE,kBAAkB,EAAE,MAAM,qBAAqB,CAAC;AAEzD;;;;;;;GAOG;AACH,MAAM,CAAC,MAAM,UAAU,GAAG,kBAAkB,CAAC;IAC3C,SAAS,EAAE,kBAAkB;IAC7B,aAAa,EAAE,oCAAoC;CACpD,CAAC,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n//\nimport { createSpanFunction } from \"@azure/core-tracing\";\n\n/**\n * Creates a span using the global tracer.\n *\n * @param name - The name of the operation being performed.\n * @param tracingOptions - The options for the underlying http request.\n *\n * @internal\n */\nexport const createSpan = createSpanFunction({\n namespace: \"Azure.Containers\",\n packagePrefix: \"Azure.Containers.ContainerRegistry\",\n});\n"]}
@@ -7,14 +7,14 @@ export function toManifestWritableProperties(from) {
7
7
  canDelete: from.canDelete,
8
8
  canList: from.canList,
9
9
  canRead: from.canRead,
10
- canWrite: from.canWrite
10
+ canWrite: from.canWrite,
11
11
  }
12
12
  : undefined;
13
13
  }
14
14
  export function toArtifactManifestProperties(from, repositoryName, registryLoginServer) {
15
15
  var _a, _b, _c, _d;
16
16
  return Object.assign({ registryLoginServer,
17
- repositoryName, digest: from.digest, size: 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));
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));
18
18
  }
19
19
  export function toServiceTagOrderBy(orderBy) {
20
20
  return orderBy === "LastUpdatedOnAscending"
@@ -1 +1 @@
1
- {"version":3,"file":"transformations.js","sourceRoot":"","sources":["../../src/transformations.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAsBlC,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,uBACE,mBAAmB;QACnB,cAAc,EACd,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,IAAI,EAAE,IAAI,CAAC,IAAI,EACf,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,aAAa,EAAE,IAAI,CAAC,aAAa,EACjC,YAAY,EAAE,MAAA,IAAI,CAAC,YAAY,mCAAI,SAAS,EAC5C,eAAe,EAAE,MAAA,IAAI,CAAC,eAAe,mCAAI,SAAS,EAClD,gBAAgB,EAAE,MAAA,IAAI,CAAC,gBAAgB,mCAAI,EAAE,EAC7C,IAAI,EAAE,MAAA,IAAI,CAAC,IAAI,mCAAI,EAAE,IAClB,4BAA4B,CAAC,IAAI,CAAC,EACrC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAAoB;IACtD,OAAO,OAAO,KAAK,wBAAwB;QACzC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,OAAO,KAAK,yBAAyB;YACvC,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,OAAyB;IAEzB,OAAO,OAAO,KAAK,wBAAwB;QACzC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,OAAO,KAAK,yBAAyB;YACvC,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n ArtifactTagOrderBy as ServiceTagOrderBy,\n ArtifactManifestOrderBy as ServiceManifestOrderBy,\n ManifestWriteableProperties as ServiceManifestWritableProperties,\n ArtifactManifestProperties as ServiceArtifactManifestProperties\n} from \"./generated/models\";\nimport { ArtifactManifestProperties, TagOrderBy, ManifestOrderBy } from \"./models\";\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 size: 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?: TagOrderBy): ServiceTagOrderBy | undefined {\n return orderBy === \"LastUpdatedOnAscending\"\n ? \"timeasc\"\n : orderBy === \"LastUpdatedOnDescending\"\n ? \"timedesc\"\n : undefined;\n}\n\nexport function toServiceManifestOrderBy(\n orderBy?: ManifestOrderBy\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;AAsBlC,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,uBACE,mBAAmB;QACnB,cAAc,EACd,MAAM,EAAE,IAAI,CAAC,MAAM,EACnB,WAAW,EAAE,IAAI,CAAC,IAAI,EACtB,SAAS,EAAE,IAAI,CAAC,SAAS,EACzB,aAAa,EAAE,IAAI,CAAC,aAAa,EACjC,YAAY,EAAE,MAAA,IAAI,CAAC,YAAY,mCAAI,SAAS,EAC5C,eAAe,EAAE,MAAA,IAAI,CAAC,eAAe,mCAAI,SAAS,EAClD,gBAAgB,EAAE,MAAA,IAAI,CAAC,gBAAgB,mCAAI,EAAE,EAC7C,IAAI,EAAE,MAAA,IAAI,CAAC,IAAI,mCAAI,EAAE,IAClB,4BAA4B,CAAC,IAAI,CAAC,EACrC;AACJ,CAAC;AAED,MAAM,UAAU,mBAAmB,CAAC,OAA0B;IAC5D,OAAO,OAAO,KAAK,wBAAwB;QACzC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,OAAO,KAAK,yBAAyB;YACvC,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC;AAED,MAAM,UAAU,wBAAwB,CACtC,OAA+B;IAE/B,OAAO,OAAO,KAAK,wBAAwB;QACzC,CAAC,CAAC,SAAS;QACX,CAAC,CAAC,OAAO,KAAK,yBAAyB;YACvC,CAAC,CAAC,UAAU;YACZ,CAAC,CAAC,SAAS,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport {\n ArtifactTagOrderBy as ServiceTagOrderBy,\n ArtifactManifestOrderBy as ServiceManifestOrderBy,\n ManifestWriteableProperties as ServiceManifestWritableProperties,\n ArtifactManifestProperties as ServiceArtifactManifestProperties,\n} from \"./generated/models\";\nimport { ArtifactManifestProperties, ArtifactTagOrder, ArtifactManifestOrder } from \"./models\";\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 +1 @@
1
- {"version":3,"file":"base64.browser.js","sourceRoot":"","sources":["../../../src/utils/base64.browser.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,aAAqB;IAChD,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n// eslint-disable-next-line @azure/azure-sdk/ts-no-namespaces\ndeclare global {\n function atob(input: string): string;\n}\n\n/**\n * Base64 decode\n *\n * @internal\n * @param encodedString -\n * @returns\n\n */\nexport function base64decode(encodedString: string): string {\n return atob(encodedString);\n}\n"]}
1
+ {"version":3,"file":"base64.browser.js","sourceRoot":"","sources":["../../../src/utils/base64.browser.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAOlC;;;;;;;GAOG;AACH,MAAM,UAAU,YAAY,CAAC,aAAqB;IAChD,OAAO,IAAI,CAAC,aAAa,CAAC,CAAC;AAC7B,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n// eslint-disable-next-line @typescript-eslint/no-namespace\ndeclare global {\n function atob(input: string): string;\n}\n\n/**\n * Base64 decode\n *\n * @internal\n * @param encodedString -\n * @returns\n\n */\nexport function base64decode(encodedString: string): string {\n return atob(encodedString);\n}\n"]}
@@ -7,7 +7,7 @@ function delay(t, value) {
7
7
  export const DEFAULT_CYCLER_OPTIONS = {
8
8
  forcedRefreshWindowInMs: 1000,
9
9
  retryIntervalInMs: 3000,
10
- refreshWindowInMs: 1000 * 60 * 2 // Start refreshing 2m before expiry
10
+ refreshWindowInMs: 1000 * 60 * 2, // Start refreshing 2m before expiry
11
11
  };
12
12
  /**
13
13
  * Converts an an unreliable access token getter (which may resolve with null)
@@ -91,7 +91,7 @@ export function createTokenCycler(credential, tokenCyclerOptions) {
91
91
  */
92
92
  get mustRefresh() {
93
93
  return (token === null || token.expiresOnTimestamp - options.forcedRefreshWindowInMs < Date.now());
94
- }
94
+ },
95
95
  };
96
96
  /**
97
97
  * Starts a refresh job or returns the existing job if one is already
@@ -143,7 +143,7 @@ export function createTokenCycler(credential, tokenCyclerOptions) {
143
143
  refresh(scopes, tokenOptions);
144
144
  }
145
145
  return token;
146
- }
146
+ },
147
147
  };
148
148
  }
149
149
  //# sourceMappingURL=tokenCycler.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"tokenCycler.js","sourceRoot":"","sources":["../../../src/utils/tokenCycler.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,SAAS,KAAK,CAAI,CAAS,EAAE,KAAS;IACpC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACvE,CAAC;AAyCD,sDAAs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L,IAAI,WAAW;YACb,OAAO,KAAK,IAAI,SAAS,CAAC;QAC5B,CAAC;QACD,QAAQ,EAAE,KAAK,EAAE,MAAyB,EAAE,YAAe,EAAwB,EAAE;YACnF,EAAE;YACF,gBAAgB;YAChB,+DAA+D;YAC/D,6CAA6C;YAC7C,+DAA+D;YAC/D,yCAAyC;YACzC,6DAA6D;YAC7D,YAAY;YACZ,EAAE;YACF,IAAI,MAAM,CAAC,WAAW;gBAAE,OAAO,OAAO,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;YAE7D,IAAI,MAAM,CAAC,aAAa,EAAE;gBACxB,OAAO,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;aAC/B;YAED,OAAO,KAAoB,CAAC;QAC9B,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AccessToken, GetTokenOptions, TokenCredential } from \"@azure/core-auth\";\n\nfunction delay<T>(t: number, value?: T): Promise<T | void> {\n return new Promise((resolve) => setTimeout(() => resolve(value), t));\n}\n/**\n * A function that gets a promise of an access token and allows providing\n * options.\n *\n * @param options - the options to pass to the underlying token provider\n */\nexport type AccessTokenGetter<T extends GetTokenOptions> = (\n scopes: string | string[],\n options: T\n) => Promise<AccessToken>;\n\n/**\n * The response of the\n */\nexport interface AccessTokenRefresher<T extends GetTokenOptions> {\n cachedToken?: AccessToken;\n getToken: AccessTokenGetter<T>;\n}\n\nexport interface TokenCyclerOptions {\n /**\n * The window of time before token expiration during which the token will be\n * considered unusable due to risk of the token expiring before sending the\n * request.\n *\n * This will only become meaningful if the refresh fails for over\n * (refreshWindow - forcedRefreshWindow) milliseconds.\n */\n forcedRefreshWindowInMs: number;\n /**\n * Interval in milliseconds to retry failed token refreshes.\n */\n retryIntervalInMs: number;\n /**\n * The window of time before token expiration during which\n * we will attempt to refresh the token.\n */\n refreshWindowInMs: number;\n}\n\n// Default options for the cycler if none are provided\nexport const DEFAULT_CYCLER_OPTIONS: TokenCyclerOptions = {\n forcedRefreshWindowInMs: 1000, // Force waiting for a refresh 1s before the token expires\n retryIntervalInMs: 3000, // Allow refresh attempts every 3s\n refreshWindowInMs: 1000 * 60 * 2 // Start refreshing 2m before expiry\n};\n\n/**\n * Converts an an unreliable access token getter (which may resolve with null)\n * into an AccessTokenGetter by retrying the unreliable getter in a regular\n * interval.\n *\n * @param getAccessToken - A function that produces a promise of an access token that may fail by returning null.\n * @param retryIntervalInMs - The time (in milliseconds) to wait between retry attempts.\n * @param refreshTimeout - The timestamp after which the refresh attempt will fail, throwing an exception.\n * @returns - A promise that, if it resolves, will resolve with an access token.\n */\nasync function beginRefresh(\n getAccessToken: () => Promise<AccessToken | null>,\n retryIntervalInMs: number,\n refreshTimeout: number\n): Promise<AccessToken> {\n // This wrapper handles exceptions gracefully as long as we haven't exceeded\n // the timeout.\n async function tryGetAccessToken(): Promise<AccessToken | null> {\n if (Date.now() < refreshTimeout) {\n try {\n return await getAccessToken();\n } catch {\n return null;\n }\n } else {\n const finalToken = await getAccessToken();\n\n // Timeout is up, so throw if it's still null\n if (finalToken === null) {\n throw new Error(\"Failed to refresh access token.\");\n }\n\n return finalToken;\n }\n }\n\n let token: AccessToken | null = await tryGetAccessToken();\n\n while (token === null) {\n await delay(retryIntervalInMs);\n\n token = await tryGetAccessToken();\n }\n\n return token;\n}\n\n/**\n * Creates a token cycler from a credential, scopes, and optional settings.\n *\n * A token cycler represents a way to reliably retrieve a valid access token\n * from a TokenCredential. It will handle initializing the token, refreshing it\n * when it nears expiration, and synchronizes refresh attempts to avoid\n * concurrency hazards.\n *\n * @param credential - the underlying TokenCredential that provides the access\n * token\n * @param tokenCyclerOptions - optionally override default settings for the cycler\n *\n * @returns - a function that reliably produces a valid access token\n */\nexport function createTokenCycler<T extends GetTokenOptions>(\n credential: TokenCredential,\n tokenCyclerOptions?: Partial<TokenCyclerOptions>\n): AccessTokenRefresher<T> {\n let refreshWorker: Promise<AccessToken> | null = null;\n let token: AccessToken | null = null;\n\n const options = {\n ...DEFAULT_CYCLER_OPTIONS,\n ...tokenCyclerOptions\n };\n\n /**\n * This little holder defines several predicates that we use to construct\n * the rules of refreshing the token.\n */\n const cycler = {\n /**\n * Produces true if a refresh job is currently in progress.\n */\n get isRefreshing(): boolean {\n return refreshWorker !== null;\n },\n /**\n * Produces true if the cycler SHOULD refresh (we are within the refresh\n * window and not already refreshing)\n */\n get shouldRefresh(): boolean {\n return (\n !cycler.isRefreshing &&\n (token?.expiresOnTimestamp ?? 0) - options.refreshWindowInMs < Date.now()\n );\n },\n /**\n * Produces true if the cycler MUST refresh (null or nearly-expired\n * token).\n */\n get mustRefresh(): boolean {\n return (\n token === null || token.expiresOnTimestamp - options.forcedRefreshWindowInMs < Date.now()\n );\n }\n };\n\n /**\n * Starts a refresh job or returns the existing job if one is already\n * running.\n */\n function refresh(scopes: string | string[], getTokenOptions: T): Promise<AccessToken> {\n if (!cycler.isRefreshing) {\n // We bind `scopes` here to avoid passing it around a lot\n const tryGetAccessToken = (): Promise<AccessToken | null> =>\n credential.getToken(scopes, getTokenOptions);\n\n // Take advantage of promise chaining to insert an assignment to `token`\n // before the refresh can be considered done.\n refreshWorker = beginRefresh(\n tryGetAccessToken,\n options.retryIntervalInMs,\n // If we don't have a token, then we should timeout immediately\n token?.expiresOnTimestamp ?? Date.now()\n )\n .then((_token) => {\n refreshWorker = null;\n token = _token;\n return token;\n })\n .catch((reason) => {\n // We also should reset the refresher if we enter a failed state. All\n // existing awaiters will throw, but subsequent requests will start a\n // new retry chain.\n refreshWorker = null;\n token = null;\n throw reason;\n });\n }\n\n return refreshWorker as Promise<AccessToken>;\n }\n\n return {\n get cachedToken(): AccessToken | undefined {\n return token || undefined;\n },\n getToken: async (scopes: string | string[], tokenOptions: T): Promise<AccessToken> => {\n //\n // Simple rules:\n // - If we MUST refresh, then return the refresh task, blocking\n // the pipeline until a token is available.\n // - If we SHOULD refresh, then run refresh but don't return it\n // (we can still use the cached token).\n // - Return the token, since it's fine if we didn't return in\n // step 1.\n //\n if (cycler.mustRefresh) return refresh(scopes, tokenOptions);\n\n if (cycler.shouldRefresh) {\n refresh(scopes, tokenOptions);\n }\n\n return token as AccessToken;\n }\n };\n}\n"]}
1
+ {"version":3,"file":"tokenCycler.js","sourceRoot":"","sources":["../../../src/utils/tokenCycler.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAIlC,SAAS,KAAK,CAAI,CAAS,EAAE,KAAS;IACpC,OAAO,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE,CAAC,UAAU,CAAC,GAAG,EAAE,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC,CAAC,CAAC,CAAC;AACvE,CAAC;AAyCD,sDAAsD;AACtD,MAAM,CAAC,MAAM,sBAAsB,GAAuB;IACxD,uBAAuB,EAAE,IAAI;IAC7B,iBAAiB,EAAE,IAAI;IACvB,iBAAiB,EAAE,IAAI,GAAG,EAAE,GAAG,CAAC,EAAE,oCAAoC;CACvE,CAAC;AAEF;;;;;;;;;GASG;AACH,KAAK,UAAU,YAAY,CACzB,cAAiD,EACjD,iBAAyB,EACzB,cAAsB;IAEtB,4EAA4E;IAC5E,eAAe;IACf,KAAK,UAAU,iBAAiB;QAC9B,IAAI,IAAI,CAAC,GAAG,EAAE,GAAG,cAAc,EAAE;YAC/B,IAAI;gBACF,OAAO,MAAM,cAAc,EAAE,CAAC;aAC/B;YAAC,WAAM;gBACN,OAAO,IAAI,CAAC;aACb;SACF;aAAM;YACL,MAAM,UAAU,GAAG,MAAM,cAAc,EAAE,CAAC;YAE1C,6CAA6C;YAC7C,IAAI,UAAU,KAAK,IAAI,EAAE;gBACvB,MAAM,IAAI,KAAK,CAAC,iCAAiC,CAAC,CAAC;aACpD;YAED,OAAO,UAAU,CAAC;SACnB;IACH,CAAC;IAED,IAAI,KAAK,GAAuB,MAAM,iBAAiB,EAAE,CAAC;IAE1D,OAAO,KAAK,KAAK,IAAI,EAAE;QACrB,MAA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BAAL,KAAK,CAAE,kBAAkB,mCAAI,IAAI,CAAC,GAAG,EAAE,CACxC;iBACE,IAAI,CAAC,CAAC,MAAM,EAAE,EAAE;gBACf,aAAa,GAAG,IAAI,CAAC;gBACrB,KAAK,GAAG,MAAM,CAAC;gBACf,OAAO,KAAK,CAAC;YACf,CAAC,CAAC;iBACD,KAAK,CAAC,CAAC,MAAM,EAAE,EAAE;gBAChB,sEAAsE;gBACtE,qEAAqE;gBACrE,mBAAmB;gBACnB,aAAa,GAAG,IAAI,CAAC;gBACrB,KAAK,GAAG,IAAI,CAAC;gBACb,MAAM,MAAM,CAAC;YACf,CAAC,CAAC,CAAC;SACN;QAED,OAAO,aAAqC,CAAC;IAC/C,CAAC;IAED,OAAO;QACL,IAAI,WAAW;YACb,OAAO,KAAK,IAAI,SAAS,CAAC;QAC5B,CAAC;QACD,QAAQ,EAAE,KAAK,EAAE,MAAyB,EAAE,YAAe,EAAwB,EAAE;YACnF,EAAE;YACF,gBAAgB;YAChB,+DAA+D;YAC/D,6CAA6C;YAC7C,+DAA+D;YAC/D,yCAAyC;YACzC,6DAA6D;YAC7D,YAAY;YACZ,EAAE;YACF,IAAI,MAAM,CAAC,WAAW;gBAAE,OAAO,OAAO,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;YAE7D,IAAI,MAAM,CAAC,aAAa,EAAE;gBACxB,OAAO,CAAC,MAAM,EAAE,YAAY,CAAC,CAAC;aAC/B;YAED,OAAO,KAAoB,CAAC;QAC9B,CAAC;KACF,CAAC;AACJ,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\nimport { AccessToken, GetTokenOptions, TokenCredential } from \"@azure/core-auth\";\n\nfunction delay<T>(t: number, value?: T): Promise<T | void> {\n return new Promise((resolve) => setTimeout(() => resolve(value), t));\n}\n/**\n * A function that gets a promise of an access token and allows providing\n * options.\n *\n * @param options - the options to pass to the underlying token provider\n */\nexport type AccessTokenGetter<T extends GetTokenOptions> = (\n scopes: string | string[],\n options: T\n) => Promise<AccessToken>;\n\n/**\n * The response of the\n */\nexport interface AccessTokenRefresher<T extends GetTokenOptions> {\n cachedToken?: AccessToken;\n getToken: AccessTokenGetter<T>;\n}\n\nexport interface TokenCyclerOptions {\n /**\n * The window of time before token expiration during which the token will be\n * considered unusable due to risk of the token expiring before sending the\n * request.\n *\n * This will only become meaningful if the refresh fails for over\n * (refreshWindow - forcedRefreshWindow) milliseconds.\n */\n forcedRefreshWindowInMs: number;\n /**\n * Interval in milliseconds to retry failed token refreshes.\n */\n retryIntervalInMs: number;\n /**\n * The window of time before token expiration during which\n * we will attempt to refresh the token.\n */\n refreshWindowInMs: number;\n}\n\n// Default options for the cycler if none are provided\nexport const DEFAULT_CYCLER_OPTIONS: TokenCyclerOptions = {\n forcedRefreshWindowInMs: 1000, // Force waiting for a refresh 1s before the token expires\n retryIntervalInMs: 3000, // Allow refresh attempts every 3s\n refreshWindowInMs: 1000 * 60 * 2, // Start refreshing 2m before expiry\n};\n\n/**\n * Converts an an unreliable access token getter (which may resolve with null)\n * into an AccessTokenGetter by retrying the unreliable getter in a regular\n * interval.\n *\n * @param getAccessToken - A function that produces a promise of an access token that may fail by returning null.\n * @param retryIntervalInMs - The time (in milliseconds) to wait between retry attempts.\n * @param refreshTimeout - The timestamp after which the refresh attempt will fail, throwing an exception.\n * @returns - A promise that, if it resolves, will resolve with an access token.\n */\nasync function beginRefresh(\n getAccessToken: () => Promise<AccessToken | null>,\n retryIntervalInMs: number,\n refreshTimeout: number\n): Promise<AccessToken> {\n // This wrapper handles exceptions gracefully as long as we haven't exceeded\n // the timeout.\n async function tryGetAccessToken(): Promise<AccessToken | null> {\n if (Date.now() < refreshTimeout) {\n try {\n return await getAccessToken();\n } catch {\n return null;\n }\n } else {\n const finalToken = await getAccessToken();\n\n // Timeout is up, so throw if it's still null\n if (finalToken === null) {\n throw new Error(\"Failed to refresh access token.\");\n }\n\n return finalToken;\n }\n }\n\n let token: AccessToken | null = await tryGetAccessToken();\n\n while (token === null) {\n await delay(retryIntervalInMs);\n\n token = await tryGetAccessToken();\n }\n\n return token;\n}\n\n/**\n * Creates a token cycler from a credential, scopes, and optional settings.\n *\n * A token cycler represents a way to reliably retrieve a valid access token\n * from a TokenCredential. It will handle initializing the token, refreshing it\n * when it nears expiration, and synchronizes refresh attempts to avoid\n * concurrency hazards.\n *\n * @param credential - the underlying TokenCredential that provides the access\n * token\n * @param tokenCyclerOptions - optionally override default settings for the cycler\n *\n * @returns - a function that reliably produces a valid access token\n */\nexport function createTokenCycler<T extends GetTokenOptions>(\n credential: TokenCredential,\n tokenCyclerOptions?: Partial<TokenCyclerOptions>\n): AccessTokenRefresher<T> {\n let refreshWorker: Promise<AccessToken> | null = null;\n let token: AccessToken | null = null;\n\n const options = {\n ...DEFAULT_CYCLER_OPTIONS,\n ...tokenCyclerOptions,\n };\n\n /**\n * This little holder defines several predicates that we use to construct\n * the rules of refreshing the token.\n */\n const cycler = {\n /**\n * Produces true if a refresh job is currently in progress.\n */\n get isRefreshing(): boolean {\n return refreshWorker !== null;\n },\n /**\n * Produces true if the cycler SHOULD refresh (we are within the refresh\n * window and not already refreshing)\n */\n get shouldRefresh(): boolean {\n return (\n !cycler.isRefreshing &&\n (token?.expiresOnTimestamp ?? 0) - options.refreshWindowInMs < Date.now()\n );\n },\n /**\n * Produces true if the cycler MUST refresh (null or nearly-expired\n * token).\n */\n get mustRefresh(): boolean {\n return (\n token === null || token.expiresOnTimestamp - options.forcedRefreshWindowInMs < Date.now()\n );\n },\n };\n\n /**\n * Starts a refresh job or returns the existing job if one is already\n * running.\n */\n function refresh(scopes: string | string[], getTokenOptions: T): Promise<AccessToken> {\n if (!cycler.isRefreshing) {\n // We bind `scopes` here to avoid passing it around a lot\n const tryGetAccessToken = (): Promise<AccessToken | null> =>\n credential.getToken(scopes, getTokenOptions);\n\n // Take advantage of promise chaining to insert an assignment to `token`\n // before the refresh can be considered done.\n refreshWorker = beginRefresh(\n tryGetAccessToken,\n options.retryIntervalInMs,\n // If we don't have a token, then we should timeout immediately\n token?.expiresOnTimestamp ?? Date.now()\n )\n .then((_token) => {\n refreshWorker = null;\n token = _token;\n return token;\n })\n .catch((reason) => {\n // We also should reset the refresher if we enter a failed state. All\n // existing awaiters will throw, but subsequent requests will start a\n // new retry chain.\n refreshWorker = null;\n token = null;\n throw reason;\n });\n }\n\n return refreshWorker as Promise<AccessToken>;\n }\n\n return {\n get cachedToken(): AccessToken | undefined {\n return token || undefined;\n },\n getToken: async (scopes: string | string[], tokenOptions: T): Promise<AccessToken> => {\n //\n // Simple rules:\n // - If we MUST refresh, then return the refresh task, blocking\n // the pipeline until a token is available.\n // - If we SHOULD refresh, then run refresh but don't return it\n // (we can still use the cached token).\n // - Return the token, since it's fine if we didn't return in\n // step 1.\n //\n if (cycler.mustRefresh) return refresh(scopes, tokenOptions);\n\n if (cycler.shouldRefresh) {\n refresh(scopes, tokenOptions);\n }\n\n return token as AccessToken;\n },\n };\n}\n"]}
@@ -1 +1 @@
1
- {"version":3,"file":"wwwAuthenticateParser.js","sourceRoot":"","sources":["../../../src/utils/wwwAuthenticateParser.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAuBlC;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,eAAuB;IAC1D,wDAAwD;IACxD,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC9C,oFAAoF;IACpF,oDAAoD;IACpD,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAC5B,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAClE,EAAE,CACH,CAAC;IACF,+DAA+D;IAC/D,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAC7B,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,CAAW,EAAE,EAAE,CAAC,iCAC/B,MAAM,KACT,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IACzB,EACF,EAAE,CACH,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Defined supported names of WWW-Authenticate name-value pairs.\n */\nexport type ValidParsedWWWAuthenticateProperties =\n // \"authorization_uri\" was used in the track 1 version of KeyVault.\n // This is not a relevant property anymore, since the service is consistently answering with \"authorization\".\n // | \"authorization_uri\"\n | \"authorization\"\n | \"claims\"\n // Even though the service is moving to \"scope\", both \"resource\" and \"scope\" should be supported.\n | \"resource\"\n | \"scope\"\n | \"service\";\n\n/**\n * Represents the result of `parseWWWAuthenticate()`;\n */\nexport type ParsedWWWAuthenticate = {\n [Key in ValidParsedWWWAuthenticateProperties]?: string;\n};\n\n/**\n * Parses an WWW-Authenticate response.\n * This transforms a string value like:\n * `Bearer authorization=\"some_authorization\", resource=\"https://some.url\"`\n * into an object like:\n * `{ authorization: \"some_authorization\", resource: \"https://some.url\" }`\n * @param wwwAuthenticate - String value in the WWW-Authenticate header\n */\nexport function parseWWWAuthenticate(wwwAuthenticate: string): ParsedWWWAuthenticate {\n // First we split the string by either `,`, `, ` or ` `.\n const parts = wwwAuthenticate.split(/, *| +/);\n // Then we only keep the strings with an equal sign after a word and before a quote.\n // also splitting these sections by their equal sign\n const keyValues = parts.reduce<string[][]>(\n (acc, str) => (str.match(/\\w=\"/) ? [...acc, str.split(\"=\")] : acc),\n []\n );\n // Then we transform these key-value pairs back into an object.\n const parsed = keyValues.reduce<ParsedWWWAuthenticate>(\n (result, [key, value]: string[]) => ({\n ...result,\n [key]: value.slice(1, -1)\n }),\n {}\n );\n return parsed;\n}\n"]}
1
+ {"version":3,"file":"wwwAuthenticateParser.js","sourceRoot":"","sources":["../../../src/utils/wwwAuthenticateParser.ts"],"names":[],"mappings":"AAAA,uCAAuC;AACvC,kCAAkC;AAuBlC;;;;;;;GAOG;AACH,MAAM,UAAU,oBAAoB,CAAC,eAAuB;IAC1D,wDAAwD;IACxD,MAAM,KAAK,GAAG,eAAe,CAAC,KAAK,CAAC,QAAQ,CAAC,CAAC;IAC9C,oFAAoF;IACpF,oDAAoD;IACpD,MAAM,SAAS,GAAG,KAAK,CAAC,MAAM,CAC5B,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,GAAG,EAAE,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,GAAG,CAAC,EAClE,EAAE,CACH,CAAC;IACF,+DAA+D;IAC/D,MAAM,MAAM,GAAG,SAAS,CAAC,MAAM,CAC7B,CAAC,MAAM,EAAE,CAAC,GAAG,EAAE,KAAK,CAAW,EAAE,EAAE,CAAC,iCAC/B,MAAM,KACT,CAAC,GAAG,CAAC,EAAE,KAAK,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC,IACzB,EACF,EAAE,CACH,CAAC;IACF,OAAO,MAAM,CAAC;AAChB,CAAC","sourcesContent":["// Copyright (c) Microsoft Corporation.\n// Licensed under the MIT license.\n\n/**\n * Defined supported names of WWW-Authenticate name-value pairs.\n */\nexport type ValidParsedWWWAuthenticateProperties =\n // \"authorization_uri\" was used in the track 1 version of KeyVault.\n // This is not a relevant property anymore, since the service is consistently answering with \"authorization\".\n // | \"authorization_uri\"\n | \"authorization\"\n | \"claims\"\n // Even though the service is moving to \"scope\", both \"resource\" and \"scope\" should be supported.\n | \"resource\"\n | \"scope\"\n | \"service\";\n\n/**\n * Represents the result of `parseWWWAuthenticate()`;\n */\nexport type ParsedWWWAuthenticate = {\n [Key in ValidParsedWWWAuthenticateProperties]?: string;\n};\n\n/**\n * Parses an WWW-Authenticate response.\n * This transforms a string value like:\n * `Bearer authorization=\"some_authorization\", resource=\"https://some.url\"`\n * into an object like:\n * `{ authorization: \"some_authorization\", resource: \"https://some.url\" }`\n * @param wwwAuthenticate - String value in the WWW-Authenticate header\n */\nexport function parseWWWAuthenticate(wwwAuthenticate: string): ParsedWWWAuthenticate {\n // First we split the string by either `,`, `, ` or ` `.\n const parts = wwwAuthenticate.split(/, *| +/);\n // Then we only keep the strings with an equal sign after a word and before a quote.\n // also splitting these sections by their equal sign\n const keyValues = parts.reduce<string[][]>(\n (acc, str) => (str.match(/\\w=\"/) ? [...acc, str.split(\"=\")] : acc),\n []\n );\n // Then we transform these key-value pairs back into an object.\n const parsed = keyValues.reduce<ParsedWWWAuthenticate>(\n (result, [key, value]: string[]) => ({\n ...result,\n [key]: value.slice(1, -1),\n }),\n {}\n );\n return parsed;\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@azure/container-registry",
3
- "version": "1.0.0-beta.6",
3
+ "version": "1.0.0",
4
4
  "description": "An isomorphic client library for the Azure Container Registry service.",
5
5
  "sdk-type": "client",
6
6
  "main": "dist/index.js",
@@ -32,7 +32,6 @@
32
32
  "build": "npm run clean && tsc -p . && rollup -c 2>&1 && api-extractor run --local",
33
33
  "check-format": "prettier --list-different --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
34
34
  "clean": "rimraf dist dist-* temp types *.tgz *.log",
35
- "docs": "typedoc --excludePrivate --excludeNotExported --excludeExternals --stripInternal --mode file --out ./dist/docs ./src",
36
35
  "execute:samples": "dev-tool samples run samples-dev",
37
36
  "extract-api": "tsc -p . && api-extractor run --local",
38
37
  "format": "prettier --write --config ../../../.prettierrc.json --ignore-path ../../../.prettierignore \"src/**/*.ts\" \"test/**/*.ts\" \"samples-dev/**/*.ts\" \"*.{js,json}\"",
@@ -114,12 +113,11 @@
114
113
  "karma-mocha-reporter": "^2.2.5",
115
114
  "karma-sourcemap-loader": "^0.3.8",
116
115
  "mocha": "^7.1.1",
117
- "mocha-junit-reporter": "^1.18.0",
118
- "nyc": "^14.0.0",
119
- "prettier": "^1.16.4",
116
+ "mocha-junit-reporter": "^2.0.0",
117
+ "nyc": "^15.0.0",
118
+ "prettier": "^2.5.1",
120
119
  "rimraf": "^3.0.0",
121
120
  "rollup": "^1.16.3",
122
- "typedoc": "0.15.2",
123
121
  "typescript": "~4.2.0",
124
122
  "util": "^0.12.1"
125
123
  },
@@ -6,6 +6,15 @@ import { PagedAsyncIterableIterator } from '@azure/core-paging';
6
6
  import { PipelineOptions } from '@azure/core-rest-pipeline';
7
7
  import { TokenCredential } from '@azure/core-auth';
8
8
 
9
+ /**
10
+ * Defines values for ArtifactManifestOrder.
11
+ * this contains the known values that the service supports.
12
+ * ### Know values supported by the service
13
+ * **LastUpdatedOnDescending**: Order registry artifacts by LastUpdatedOn field, from most recently updated to least recently updated.
14
+ * **LastUpdatedOnAscending**: Order registry artifacts by LastUpdatedOn field, from least recently updated to most recently updated.
15
+ */
16
+ export declare type ArtifactManifestOrder = "LastUpdatedOnDescending" | "LastUpdatedOnAscending";
17
+
9
18
  /** Manifest attributes details */
10
19
  export declare interface ArtifactManifestPlatform {
11
20
  /**
@@ -46,7 +55,7 @@ export declare interface ArtifactManifestProperties {
46
55
  * Image size
47
56
  * NOTE: This property will not be serialized. It can only be populated by the server.
48
57
  */
49
- readonly size?: number;
58
+ readonly sizeInBytes?: number;
50
59
  /**
51
60
  * Created time
52
61
  * NOTE: This property will not be serialized. It can only be populated by the server.
@@ -87,6 +96,15 @@ export declare interface ArtifactManifestProperties {
87
96
  canRead?: boolean;
88
97
  }
89
98
 
99
+ /**
100
+ * Defines values for ArtifactTagOrder.
101
+ * this contains the known values that the service supports.
102
+ * ### Know values supported by the service
103
+ * **LastUpdatedOnDescending**: Order tags by LastUpdatedOn field, from most recently updated to least recently updated.
104
+ * **LastUpdatedOnAscending**: Order tags by LastUpdatedOn field, from least recently updated to most recently updated.
105
+ */
106
+ export declare type ArtifactTagOrder = "LastUpdatedOnDescending" | "LastUpdatedOnAscending";
107
+
90
108
  /** Tag attributes */
91
109
  export declare interface ArtifactTagProperties {
92
110
  /**
@@ -514,8 +532,8 @@ export declare enum KnownContainerRegistryAudience {
514
532
  * Options for the `listRegistryArtifacts` method of `ContainerRepository`.
515
533
  */
516
534
  export declare interface ListManifestPropertiesOptions extends OperationOptions {
517
- /** orderby query parameter */
518
- orderBy?: ManifestOrderBy;
535
+ /** order in which the manifest properties are returned */
536
+ order?: ArtifactManifestOrder;
519
537
  }
520
538
 
521
539
  /**
@@ -528,19 +546,10 @@ export declare interface ListRepositoriesOptions extends OperationOptions {
528
546
  * Options for the `listTagProperties` method of `RegistryArtifact`.
529
547
  */
530
548
  export declare interface ListTagPropertiesOptions extends OperationOptions {
531
- /** orderby query parameter */
532
- orderBy?: TagOrderBy;
549
+ /** order in which the tags are returned */
550
+ order?: ArtifactTagOrder;
533
551
  }
534
552
 
535
- /**
536
- * Defines values for RegistryArtifactOrderBy.
537
- * this contains the known values that the service supports.
538
- * ### Know values supported by the service
539
- * **LastUpdatedOnDescending**: Order registry artifacts by LastUpdatedOn field, from most recently updated to least recently updated.
540
- * **LastUpdatedOnAscending**: Order registry artifacts by LastUpdatedOn field, from least recently updated to most recently updated.
541
- */
542
- export declare type ManifestOrderBy = "LastUpdatedOnDescending" | "LastUpdatedOnAscending";
543
-
544
553
  /**
545
554
  * Contains response data for the listManifests operation.
546
555
  */
@@ -687,15 +696,6 @@ export declare interface RepositoryPageResponse extends Array<string> {
687
696
  continuationToken?: string;
688
697
  }
689
698
 
690
- /**
691
- * Defines values for TagOrderBy.
692
- * this contains the known values that the service supports.
693
- * ### Know values supported by the service
694
- * **LastUpdatedOnDescending**: Order tags by LastUpdatedOn field, from most recently updated to least recently updated.
695
- * **LastUpdatedOnAscending**: Order tags by LastUpdatedOn field, from least recently updated to most recently updated.
696
- */
697
- export declare type TagOrderBy = "LastUpdatedOnDescending" | "LastUpdatedOnAscending";
698
-
699
699
  /**
700
700
  * Contains response data for the listTags operation.
701
701
  */