@backstage/plugin-bitbucket-cloud-common 0.3.1-next.0 → 0.3.2-next.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,19 @@
1
1
  # @backstage/plugin-bitbucket-cloud-common
2
2
 
3
+ ## 0.3.2-next.0
4
+
5
+ ### Patch Changes
6
+
7
+ - Updated dependencies
8
+ - @backstage/integration@1.18.0-next.0
9
+
10
+ ## 0.3.1
11
+
12
+ ### Patch Changes
13
+
14
+ - Updated dependencies
15
+ - @backstage/integration@1.17.1
16
+
3
17
  ## 0.3.1-next.0
4
18
 
5
19
  ### Patch Changes
@@ -1 +1 @@
1
- {"version":3,"file":"BitbucketCloudClient.cjs.js","sources":["../src/BitbucketCloudClient.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BitbucketCloudIntegrationConfig } from '@backstage/integration';\nimport fetch, { Request } from 'cross-fetch';\nimport { Models } from './models';\nimport { WithPagination } from './pagination';\nimport {\n FilterAndSortOptions,\n PartialResponseOptions,\n RequestOptions,\n} from './types';\n\n/** @public */\nexport class BitbucketCloudClient {\n static fromConfig(\n config: BitbucketCloudIntegrationConfig,\n ): BitbucketCloudClient {\n return new BitbucketCloudClient(config);\n }\n\n private constructor(\n private readonly config: BitbucketCloudIntegrationConfig,\n ) {}\n\n searchCode(\n workspace: string,\n query: string,\n options?: FilterAndSortOptions & PartialResponseOptions,\n ): WithPagination<Models.SearchResultPage, Models.SearchCodeSearchResult> {\n const workspaceEnc = encodeURIComponent(workspace);\n return new WithPagination(\n paginationOptions =>\n this.createUrl(`/workspaces/${workspaceEnc}/search/code`, {\n ...paginationOptions,\n ...options,\n search_query: query,\n }),\n url => this.getTypeMapped(url),\n );\n }\n\n listRepositoriesByWorkspace(\n workspace: string,\n options?: FilterAndSortOptions & PartialResponseOptions,\n ): WithPagination<Models.PaginatedRepositories, Models.Repository> {\n const workspaceEnc = encodeURIComponent(workspace);\n\n return new WithPagination(\n paginationOptions =>\n this.createUrl(`/repositories/${workspaceEnc}`, {\n ...paginationOptions,\n ...options,\n }),\n url => this.getTypeMapped(url),\n );\n }\n\n listProjectsByWorkspace(\n workspace: string,\n options?: FilterAndSortOptions & PartialResponseOptions,\n ): WithPagination<Models.PaginatedProjects, Models.Project> {\n const workspaceEnc = encodeURIComponent(workspace);\n\n return new WithPagination(\n paginationOptions =>\n this.createUrl(`/workspaces/${workspaceEnc}/projects`, {\n ...paginationOptions,\n ...options,\n }),\n url => this.getTypeMapped(url),\n );\n }\n\n listWorkspaces(\n options?: FilterAndSortOptions & PartialResponseOptions,\n ): WithPagination<Models.PaginatedWorkspaces, Models.Workspace> {\n return new WithPagination(\n paginationOptions =>\n this.createUrl('/workspaces', { ...paginationOptions, ...options }),\n url => this.getTypeMapped(url),\n );\n }\n\n listBranchesByRepository(\n repository: string,\n workspace: string,\n options?: FilterAndSortOptions & PartialResponseOptions,\n ): WithPagination<Models.PaginatedBranches, Models.Branch> {\n const workspaceEnc = encodeURIComponent(workspace);\n\n return new WithPagination(\n paginationOptions =>\n this.createUrl(\n `/repositories/${workspaceEnc}/${repository}/refs/branches`,\n {\n ...paginationOptions,\n ...options,\n },\n ),\n url => this.getTypeMapped(url),\n );\n }\n\n private createUrl(endpoint: string, options?: RequestOptions): URL {\n const request = new URL(this.config.apiBaseUrl + endpoint);\n for (const key in options) {\n if (options[key]) {\n request.searchParams.append(key, options[key]!.toString());\n }\n }\n\n return request;\n }\n\n private async getTypeMapped<T = any>(url: URL): Promise<T> {\n return this.get(url).then(\n (response: Response) => response.json() as Promise<T>,\n );\n }\n\n private async get(url: URL): Promise<Response> {\n return this.request(new Request(url.toString(), { method: 'GET' }));\n }\n\n private async request(req: Request): Promise<Response> {\n return fetch(req, { headers: this.getAuthHeaders() }).then(\n (response: Response) => {\n if (!response.ok) {\n throw new Error(\n `Unexpected response for ${req.method} ${req.url}. Expected 200 but got ${response.status} - ${response.statusText}`,\n );\n }\n\n return response;\n },\n );\n }\n\n private getAuthHeaders(): Record<string, string> {\n const headers: Record<string, string> = {};\n\n if (this.config.username) {\n const buffer = Buffer.from(\n `${this.config.username}:${this.config.appPassword}`,\n 'utf8',\n );\n headers.Authorization = `Basic ${buffer.toString('base64')}`;\n } else if (this.config.token) {\n headers.Authorization = `Bearer ${this.config.token}`;\n }\n\n return headers;\n }\n}\n"],"names":["WithPagination","Request","fetch"],"mappings":";;;;;;;;;AA2BO,MAAM,oBAAqB,CAAA;AAAA,EAOxB,YACW,MACjB,EAAA;AADiB,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA;AAChB,EARH,OAAO,WACL,MACsB,EAAA;AACtB,IAAO,OAAA,IAAI,qBAAqB,MAAM,CAAA;AAAA;AACxC,EAMA,UAAA,CACE,SACA,EAAA,KAAA,EACA,OACwE,EAAA;AACxE,IAAM,MAAA,YAAA,GAAe,mBAAmB,SAAS,CAAA;AACjD,IAAA,OAAO,IAAIA,yBAAA;AAAA,MACT,CACE,iBAAA,KAAA,IAAA,CAAK,SAAU,CAAA,CAAA,YAAA,EAAe,YAAY,CAAgB,YAAA,CAAA,EAAA;AAAA,QACxD,GAAG,iBAAA;AAAA,QACH,GAAG,OAAA;AAAA,QACH,YAAc,EAAA;AAAA,OACf,CAAA;AAAA,MACH,CAAA,GAAA,KAAO,IAAK,CAAA,aAAA,CAAc,GAAG;AAAA,KAC/B;AAAA;AACF,EAEA,2BAAA,CACE,WACA,OACiE,EAAA;AACjE,IAAM,MAAA,YAAA,GAAe,mBAAmB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;AACT,KACF;AAAA;AACF,EAEQ,cAAyC,GAAA;AAC/C,IAAA,MAAM,UAAkC,EAAC;AAEzC,IAAI,IAAA,IAAA,CAAK,OAAO,QAAU,EAAA;AACxB,MAAA,MAAM,SAAS,MAAO,CAAA,IAAA;AAAA,QACpB,GAAG,IAAK,CAAA,MAAA,CAAO,QAAQ,CAAI,CAAA,EAAA,IAAA,CAAK,OAAO,WAAW,CAAA,CAAA;AAAA,QAClD;AAAA,OACF;AACA,MAAA,OAAA,CAAQ,aAAgB,GAAA,CAAA,MAAA,EAAS,MAAO,CAAA,QAAA,CAAS,QAAQ,CAAC,CAAA,CAAA;AAAA,KAC5D,MAAA,IAAW,IAAK,CAAA,MAAA,CAAO,KAAO,EAAA;AAC5B,MAAA,OAAA,CAAQ,aAAgB,GAAA,CAAA,OAAA,EAAU,IAAK,CAAA,MAAA,CAAO,KAAK,CAAA,CAAA;AAAA;AAGrD,IAAO,OAAA,OAAA;AAAA;AAEX;;;;"}
1
+ {"version":3,"file":"BitbucketCloudClient.cjs.js","sources":["../src/BitbucketCloudClient.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BitbucketCloudIntegrationConfig } from '@backstage/integration';\nimport fetch, { Request } from 'cross-fetch';\nimport { Models } from './models';\nimport { WithPagination } from './pagination';\nimport {\n FilterAndSortOptions,\n PartialResponseOptions,\n RequestOptions,\n} from './types';\n\n/** @public */\nexport class BitbucketCloudClient {\n static fromConfig(\n config: BitbucketCloudIntegrationConfig,\n ): BitbucketCloudClient {\n return new BitbucketCloudClient(config);\n }\n\n private constructor(\n private readonly config: BitbucketCloudIntegrationConfig,\n ) {}\n\n searchCode(\n workspace: string,\n query: string,\n options?: FilterAndSortOptions & PartialResponseOptions,\n ): WithPagination<Models.SearchResultPage, Models.SearchCodeSearchResult> {\n const workspaceEnc = encodeURIComponent(workspace);\n return new WithPagination(\n paginationOptions =>\n this.createUrl(`/workspaces/${workspaceEnc}/search/code`, {\n ...paginationOptions,\n ...options,\n search_query: query,\n }),\n url => this.getTypeMapped(url),\n );\n }\n\n listRepositoriesByWorkspace(\n workspace: string,\n options?: FilterAndSortOptions & PartialResponseOptions,\n ): WithPagination<Models.PaginatedRepositories, Models.Repository> {\n const workspaceEnc = encodeURIComponent(workspace);\n\n return new WithPagination(\n paginationOptions =>\n this.createUrl(`/repositories/${workspaceEnc}`, {\n ...paginationOptions,\n ...options,\n }),\n url => this.getTypeMapped(url),\n );\n }\n\n listProjectsByWorkspace(\n workspace: string,\n options?: FilterAndSortOptions & PartialResponseOptions,\n ): WithPagination<Models.PaginatedProjects, Models.Project> {\n const workspaceEnc = encodeURIComponent(workspace);\n\n return new WithPagination(\n paginationOptions =>\n this.createUrl(`/workspaces/${workspaceEnc}/projects`, {\n ...paginationOptions,\n ...options,\n }),\n url => this.getTypeMapped(url),\n );\n }\n\n listWorkspaces(\n options?: FilterAndSortOptions & PartialResponseOptions,\n ): WithPagination<Models.PaginatedWorkspaces, Models.Workspace> {\n return new WithPagination(\n paginationOptions =>\n this.createUrl('/workspaces', { ...paginationOptions, ...options }),\n url => this.getTypeMapped(url),\n );\n }\n\n listBranchesByRepository(\n repository: string,\n workspace: string,\n options?: FilterAndSortOptions & PartialResponseOptions,\n ): WithPagination<Models.PaginatedBranches, Models.Branch> {\n const workspaceEnc = encodeURIComponent(workspace);\n\n return new WithPagination(\n paginationOptions =>\n this.createUrl(\n `/repositories/${workspaceEnc}/${repository}/refs/branches`,\n {\n ...paginationOptions,\n ...options,\n },\n ),\n url => this.getTypeMapped(url),\n );\n }\n\n private createUrl(endpoint: string, options?: RequestOptions): URL {\n const request = new URL(this.config.apiBaseUrl + endpoint);\n for (const key in options) {\n if (options[key]) {\n request.searchParams.append(key, options[key]!.toString());\n }\n }\n\n return request;\n }\n\n private async getTypeMapped<T = any>(url: URL): Promise<T> {\n return this.get(url).then(\n (response: Response) => response.json() as Promise<T>,\n );\n }\n\n private async get(url: URL): Promise<Response> {\n return this.request(new Request(url.toString(), { method: 'GET' }));\n }\n\n private async request(req: Request): Promise<Response> {\n return fetch(req, { headers: this.getAuthHeaders() }).then(\n (response: Response) => {\n if (!response.ok) {\n throw new Error(\n `Unexpected response for ${req.method} ${req.url}. Expected 200 but got ${response.status} - ${response.statusText}`,\n );\n }\n\n return response;\n },\n );\n }\n\n private getAuthHeaders(): Record<string, string> {\n const headers: Record<string, string> = {};\n\n if (this.config.username) {\n const buffer = Buffer.from(\n `${this.config.username}:${this.config.appPassword}`,\n 'utf8',\n );\n headers.Authorization = `Basic ${buffer.toString('base64')}`;\n } else if (this.config.token) {\n headers.Authorization = `Bearer ${this.config.token}`;\n }\n\n return headers;\n }\n}\n"],"names":["WithPagination","Request","fetch"],"mappings":";;;;;;;;;AA2BO,MAAM,oBAAA,CAAqB;AAAA,EAOxB,YACW,MAAA,EACjB;AADiB,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA,EAChB;AAAA,EARH,OAAO,WACL,MAAA,EACsB;AACtB,IAAA,OAAO,IAAI,qBAAqB,MAAM,CAAA;AAAA,EACxC;AAAA,EAMA,UAAA,CACE,SAAA,EACA,KAAA,EACA,OAAA,EACwE;AACxE,IAAA,MAAM,YAAA,GAAe,mBAAmB,SAAS,CAAA;AACjD,IAAA,OAAO,IAAIA,yBAAA;AAAA,MACT,CAAA,iBAAA,KACE,IAAA,CAAK,SAAA,CAAU,CAAA,YAAA,EAAe,YAAY,CAAA,YAAA,CAAA,EAAgB;AAAA,QACxD,GAAG,iBAAA;AAAA,QACH,GAAG,OAAA;AAAA,QACH,YAAA,EAAc;AA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AM,IAAI,KAAA;AAAA,YACR,CAAA,wBAAA,EAA2B,GAAA,CAAI,MAAM,CAAA,CAAA,EAAI,GAAA,CAAI,GAAG,CAAA,uBAAA,EAA0B,QAAA,CAAS,MAAM,CAAA,GAAA,EAAM,QAAA,CAAS,UAAU,CAAA;AAAA,WACpH;AAAA,QACF;AAEA,QAAA,OAAO,QAAA;AAAA,MACT;AAAA,KACF;AAAA,EACF;AAAA,EAEQ,cAAA,GAAyC;AAC/C,IAAA,MAAM,UAAkC,EAAC;AAEzC,IAAA,IAAI,IAAA,CAAK,OAAO,QAAA,EAAU;AACxB,MAAA,MAAM,SAAS,MAAA,CAAO,IAAA;AAAA,QACpB,GAAG,IAAA,CAAK,MAAA,CAAO,QAAQ,CAAA,CAAA,EAAI,IAAA,CAAK,OAAO,WAAW,CAAA,CAAA;AAAA,QAClD;AAAA,OACF;AACA,MAAA,OAAA,CAAQ,aAAA,GAAgB,CAAA,MAAA,EAAS,MAAA,CAAO,QAAA,CAAS,QAAQ,CAAC,CAAA,CAAA;AAAA,IAC5D,CAAA,MAAA,IAAW,IAAA,CAAK,MAAA,CAAO,KAAA,EAAO;AAC5B,MAAA,OAAA,CAAQ,aAAA,GAAgB,CAAA,OAAA,EAAU,IAAA,CAAK,MAAA,CAAO,KAAK,CAAA,CAAA;AAAA,IACrD;AAEA,IAAA,OAAO,OAAA;AAAA,EACT;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"BitbucketCloudClient.esm.js","sources":["../src/BitbucketCloudClient.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BitbucketCloudIntegrationConfig } from '@backstage/integration';\nimport fetch, { Request } from 'cross-fetch';\nimport { Models } from './models';\nimport { WithPagination } from './pagination';\nimport {\n FilterAndSortOptions,\n PartialResponseOptions,\n RequestOptions,\n} from './types';\n\n/** @public */\nexport class BitbucketCloudClient {\n static fromConfig(\n config: BitbucketCloudIntegrationConfig,\n ): BitbucketCloudClient {\n return new BitbucketCloudClient(config);\n }\n\n private constructor(\n private readonly config: BitbucketCloudIntegrationConfig,\n ) {}\n\n searchCode(\n workspace: string,\n query: string,\n options?: FilterAndSortOptions & PartialResponseOptions,\n ): WithPagination<Models.SearchResultPage, Models.SearchCodeSearchResult> {\n const workspaceEnc = encodeURIComponent(workspace);\n return new WithPagination(\n paginationOptions =>\n this.createUrl(`/workspaces/${workspaceEnc}/search/code`, {\n ...paginationOptions,\n ...options,\n search_query: query,\n }),\n url => this.getTypeMapped(url),\n );\n }\n\n listRepositoriesByWorkspace(\n workspace: string,\n options?: FilterAndSortOptions & PartialResponseOptions,\n ): WithPagination<Models.PaginatedRepositories, Models.Repository> {\n const workspaceEnc = encodeURIComponent(workspace);\n\n return new WithPagination(\n paginationOptions =>\n this.createUrl(`/repositories/${workspaceEnc}`, {\n ...paginationOptions,\n ...options,\n }),\n url => this.getTypeMapped(url),\n );\n }\n\n listProjectsByWorkspace(\n workspace: string,\n options?: FilterAndSortOptions & PartialResponseOptions,\n ): WithPagination<Models.PaginatedProjects, Models.Project> {\n const workspaceEnc = encodeURIComponent(workspace);\n\n return new WithPagination(\n paginationOptions =>\n this.createUrl(`/workspaces/${workspaceEnc}/projects`, {\n ...paginationOptions,\n ...options,\n }),\n url => this.getTypeMapped(url),\n );\n }\n\n listWorkspaces(\n options?: FilterAndSortOptions & PartialResponseOptions,\n ): WithPagination<Models.PaginatedWorkspaces, Models.Workspace> {\n return new WithPagination(\n paginationOptions =>\n this.createUrl('/workspaces', { ...paginationOptions, ...options }),\n url => this.getTypeMapped(url),\n );\n }\n\n listBranchesByRepository(\n repository: string,\n workspace: string,\n options?: FilterAndSortOptions & PartialResponseOptions,\n ): WithPagination<Models.PaginatedBranches, Models.Branch> {\n const workspaceEnc = encodeURIComponent(workspace);\n\n return new WithPagination(\n paginationOptions =>\n this.createUrl(\n `/repositories/${workspaceEnc}/${repository}/refs/branches`,\n {\n ...paginationOptions,\n ...options,\n },\n ),\n url => this.getTypeMapped(url),\n );\n }\n\n private createUrl(endpoint: string, options?: RequestOptions): URL {\n const request = new URL(this.config.apiBaseUrl + endpoint);\n for (const key in options) {\n if (options[key]) {\n request.searchParams.append(key, options[key]!.toString());\n }\n }\n\n return request;\n }\n\n private async getTypeMapped<T = any>(url: URL): Promise<T> {\n return this.get(url).then(\n (response: Response) => response.json() as Promise<T>,\n );\n }\n\n private async get(url: URL): Promise<Response> {\n return this.request(new Request(url.toString(), { method: 'GET' }));\n }\n\n private async request(req: Request): Promise<Response> {\n return fetch(req, { headers: this.getAuthHeaders() }).then(\n (response: Response) => {\n if (!response.ok) {\n throw new Error(\n `Unexpected response for ${req.method} ${req.url}. Expected 200 but got ${response.status} - ${response.statusText}`,\n );\n }\n\n return response;\n },\n );\n }\n\n private getAuthHeaders(): Record<string, string> {\n const headers: Record<string, string> = {};\n\n if (this.config.username) {\n const buffer = Buffer.from(\n `${this.config.username}:${this.config.appPassword}`,\n 'utf8',\n );\n headers.Authorization = `Basic ${buffer.toString('base64')}`;\n } else if (this.config.token) {\n headers.Authorization = `Bearer ${this.config.token}`;\n }\n\n return headers;\n }\n}\n"],"names":[],"mappings":";;;AA2BO,MAAM,oBAAqB,CAAA;AAAA,EAOxB,YACW,MACjB,EAAA;AADiB,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA;AAChB,EARH,OAAO,WACL,MACsB,EAAA;AACtB,IAAO,OAAA,IAAI,qBAAqB,MAAM,CAAA;AAAA;AACxC,EAMA,UAAA,CACE,SACA,EAAA,KAAA,EACA,OACwE,EAAA;AACxE,IAAM,MAAA,YAA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A,CAAM,KAAK,EAAE,OAAA,EAAS,KAAK,cAAe,EAAA,EAAG,CAAE,CAAA,IAAA;AAAA,MACpD,CAAC,QAAuB,KAAA;AACtB,QAAI,IAAA,CAAC,SAAS,EAAI,EAAA;AAChB,UAAA,MAAM,IAAI,KAAA;AAAA,YACR,CAAA,wBAAA,EAA2B,GAAI,CAAA,MAAM,CAAI,CAAA,EAAA,GAAA,CAAI,GAAG,CAAA,uBAAA,EAA0B,QAAS,CAAA,MAAM,CAAM,GAAA,EAAA,QAAA,CAAS,UAAU,CAAA;AAAA,WACpH;AAAA;AAGF,QAAO,OAAA,QAAA;AAAA;AACT,KACF;AAAA;AACF,EAEQ,cAAyC,GAAA;AAC/C,IAAA,MAAM,UAAkC,EAAC;AAEzC,IAAI,IAAA,IAAA,CAAK,OAAO,QAAU,EAAA;AACxB,MAAA,MAAM,SAAS,MAAO,CAAA,IAAA;AAAA,QACpB,GAAG,IAAK,CAAA,MAAA,CAAO,QAAQ,CAAI,CAAA,EAAA,IAAA,CAAK,OAAO,WAAW,CAAA,CAAA;AAAA,QAClD;AAAA,OACF;AACA,MAAA,OAAA,CAAQ,aAAgB,GAAA,CAAA,MAAA,EAAS,MAAO,CAAA,QAAA,CAAS,QAAQ,CAAC,CAAA,CAAA;AAAA,KAC5D,MAAA,IAAW,IAAK,CAAA,MAAA,CAAO,KAAO,EAAA;AAC5B,MAAA,OAAA,CAAQ,aAAgB,GAAA,CAAA,OAAA,EAAU,IAAK,CAAA,MAAA,CAAO,KAAK,CAAA,CAAA;AAAA;AAGrD,IAAO,OAAA,OAAA;AAAA;AAEX;;;;"}
1
+ {"version":3,"file":"BitbucketCloudClient.esm.js","sources":["../src/BitbucketCloudClient.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { BitbucketCloudIntegrationConfig } from '@backstage/integration';\nimport fetch, { Request } from 'cross-fetch';\nimport { Models } from './models';\nimport { WithPagination } from './pagination';\nimport {\n FilterAndSortOptions,\n PartialResponseOptions,\n RequestOptions,\n} from './types';\n\n/** @public */\nexport class BitbucketCloudClient {\n static fromConfig(\n config: BitbucketCloudIntegrationConfig,\n ): BitbucketCloudClient {\n return new BitbucketCloudClient(config);\n }\n\n private constructor(\n private readonly config: BitbucketCloudIntegrationConfig,\n ) {}\n\n searchCode(\n workspace: string,\n query: string,\n options?: FilterAndSortOptions & PartialResponseOptions,\n ): WithPagination<Models.SearchResultPage, Models.SearchCodeSearchResult> {\n const workspaceEnc = encodeURIComponent(workspace);\n return new WithPagination(\n paginationOptions =>\n this.createUrl(`/workspaces/${workspaceEnc}/search/code`, {\n ...paginationOptions,\n ...options,\n search_query: query,\n }),\n url => this.getTypeMapped(url),\n );\n }\n\n listRepositoriesByWorkspace(\n workspace: string,\n options?: FilterAndSortOptions & PartialResponseOptions,\n ): WithPagination<Models.PaginatedRepositories, Models.Repository> {\n const workspaceEnc = encodeURIComponent(workspace);\n\n return new WithPagination(\n paginationOptions =>\n this.createUrl(`/repositories/${workspaceEnc}`, {\n ...paginationOptions,\n ...options,\n }),\n url => this.getTypeMapped(url),\n );\n }\n\n listProjectsByWorkspace(\n workspace: string,\n options?: FilterAndSortOptions & PartialResponseOptions,\n ): WithPagination<Models.PaginatedProjects, Models.Project> {\n const workspaceEnc = encodeURIComponent(workspace);\n\n return new WithPagination(\n paginationOptions =>\n this.createUrl(`/workspaces/${workspaceEnc}/projects`, {\n ...paginationOptions,\n ...options,\n }),\n url => this.getTypeMapped(url),\n );\n }\n\n listWorkspaces(\n options?: FilterAndSortOptions & PartialResponseOptions,\n ): WithPagination<Models.PaginatedWorkspaces, Models.Workspace> {\n return new WithPagination(\n paginationOptions =>\n this.createUrl('/workspaces', { ...paginationOptions, ...options }),\n url => this.getTypeMapped(url),\n );\n }\n\n listBranchesByRepository(\n repository: string,\n workspace: string,\n options?: FilterAndSortOptions & PartialResponseOptions,\n ): WithPagination<Models.PaginatedBranches, Models.Branch> {\n const workspaceEnc = encodeURIComponent(workspace);\n\n return new WithPagination(\n paginationOptions =>\n this.createUrl(\n `/repositories/${workspaceEnc}/${repository}/refs/branches`,\n {\n ...paginationOptions,\n ...options,\n },\n ),\n url => this.getTypeMapped(url),\n );\n }\n\n private createUrl(endpoint: string, options?: RequestOptions): URL {\n const request = new URL(this.config.apiBaseUrl + endpoint);\n for (const key in options) {\n if (options[key]) {\n request.searchParams.append(key, options[key]!.toString());\n }\n }\n\n return request;\n }\n\n private async getTypeMapped<T = any>(url: URL): Promise<T> {\n return this.get(url).then(\n (response: Response) => response.json() as Promise<T>,\n );\n }\n\n private async get(url: URL): Promise<Response> {\n return this.request(new Request(url.toString(), { method: 'GET' }));\n }\n\n private async request(req: Request): Promise<Response> {\n return fetch(req, { headers: this.getAuthHeaders() }).then(\n (response: Response) => {\n if (!response.ok) {\n throw new Error(\n `Unexpected response for ${req.method} ${req.url}. Expected 200 but got ${response.status} - ${response.statusText}`,\n );\n }\n\n return response;\n },\n );\n }\n\n private getAuthHeaders(): Record<string, string> {\n const headers: Record<string, string> = {};\n\n if (this.config.username) {\n const buffer = Buffer.from(\n `${this.config.username}:${this.config.appPassword}`,\n 'utf8',\n );\n headers.Authorization = `Basic ${buffer.toString('base64')}`;\n } else if (this.config.token) {\n headers.Authorization = `Bearer ${this.config.token}`;\n }\n\n return headers;\n }\n}\n"],"names":[],"mappings":";;;AA2BO,MAAM,oBAAA,CAAqB;AAAA,EAOxB,YACW,MAAA,EACjB;AADiB,IAAA,IAAA,CAAA,MAAA,GAAA,MAAA;AAAA,EAChB;AAAA,EARH,OAAO,WACL,MAAA,EACsB;AACtB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@
1
- {"version":3,"file":"index.cjs.js","sources":["../../src/models/index.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Bitbucket API\n * Code against the Bitbucket API to automate simple tasks, embed Bitbucket data into your own site, build mobile or desktop apps, or even add custom UI add-ons into Bitbucket itself using the Connect framework.\n *\n * The version of the OpenAPI document: 2.0\n * Contact: support@bitbucket.org\n *\n * NOTE: This file was auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n/** @public */\nexport namespace Models {\n /**\n * An account object.\n * @public\n */\n export interface Account extends ModelObject {\n created_on?: string;\n display_name?: string;\n links?: AccountLinks;\n uuid?: string;\n }\n\n /**\n * Links related to an Account.\n * @public\n */\n export interface AccountLinks {\n [key: string]: unknown;\n avatar?: Link;\n }\n\n /**\n * The author of a change in a repository\n * @public\n */\n export interface Author extends ModelObject {\n /**\n * The raw author value from the repository. This may be the only value available if the author does not match a user in Bitbucket.\n */\n raw?: string;\n user?: Account;\n }\n\n /**\n * The common base type for both repository and snippet commits.\n * @public\n */\n export interface BaseCommit extends ModelObject {\n author?: Author;\n committer?: Committer;\n date?: string;\n hash?: string;\n message?: string;\n parents?: Array<BaseCommit>;\n summary?: BaseCommitSummary;\n }\n\n /**\n * @public\n */\n export interface BaseCommitSummary {\n /**\n * The user's content rendered as HTML.\n */\n html?: string;\n /**\n * The type of markup language the raw content is to be interpreted in.\n */\n markup?: BaseCommitSummaryMarkupEnum;\n /**\n * The text as it was typed by a user.\n */\n raw?: string;\n }\n\n /**\n * The type of markup language the raw content is to be interpreted in.\n * @public\n */\n export const BaseCommitSummaryMarkupEnum = {\n Markdown: 'markdown',\n Creole: 'creole',\n Plaintext: 'plaintext',\n } as const;\n\n /**\n * The type of markup language the raw content is to be interpreted in.\n * @public\n */\n export type BaseCommitSummaryMarkupEnum =\n (typeof BaseCommitSummaryMarkupEnum)[keyof typeof BaseCommitSummaryMarkupEnum];\n\n /**\n * A branch object, representing a branch in a repository.\n * @public\n */\n export interface Branch {\n links?: RefLinks;\n /**\n * The name of the ref.\n */\n name?: string;\n target?: Commit;\n type: string;\n /**\n * The default merge strategy for pull requests targeting this branch.\n */\n default_merge_strategy?: string;\n /**\n * Available merge strategies for pull requests targeting this branch.\n */\n merge_strategies?: Array<BranchMergeStrategiesEnum>;\n }\n\n /**\n * Available merge strategies for pull requests targeting this branch.\n * @public\n */\n export const BranchMergeStrategiesEnum = {\n MergeCommit: 'merge_commit',\n Squash: 'squash',\n FastForward: 'fast_forward',\n SquashFastForward: 'squash_fast_forward',\n RebaseFastForward: 'rebase_fast_forward',\n RebaseMerge: 'rebase_merge',\n } as const;\n\n /**\n * Available merge strategies for pull requests targeting this branch.\n * @public\n */\n export type BranchMergeStrategiesEnum =\n (typeof BranchMergeStrategiesEnum)[keyof typeof BranchMergeStrategiesEnum];\n\n /**\n * A repository commit object.\n * @public\n */\n export interface Commit extends BaseCommit {\n participants?: Array<Participant>;\n repository?: Repository;\n }\n\n /**\n * A file object, representing a file at a commit in a repository\n * @public\n */\n export interface CommitFile {\n [key: string]: unknown;\n attributes?: CommitFileAttributesEnum;\n commit?: Commit;\n /**\n * The escaped version of the path as it appears in a diff. If the path does not require escaping this will be the same as path.\n */\n escaped_path?: string;\n /**\n * The path in the repository\n */\n path?: string;\n type: string;\n }\n\n /**\n * @public\n */\n export const CommitFileAttributesEnum = {\n Link: 'link',\n Executable: 'executable',\n Subrepository: 'subrepository',\n Binary: 'binary',\n Lfs: 'lfs',\n } as const;\n\n /**\n * @public\n */\n export type CommitFileAttributesEnum =\n (typeof CommitFileAttributesEnum)[keyof typeof CommitFileAttributesEnum];\n\n /**\n * The committer of a change in a repository\n * @public\n */\n export interface Committer extends ModelObject {\n /**\n * The raw committer value from the repository. This may be the only value available if the committer does not match a user in Bitbucket.\n */\n raw?: string;\n user?: Account;\n }\n\n /**\n * A link to a resource related to this object.\n * @public\n */\n export interface Link {\n href?: string;\n name?: string;\n }\n\n /**\n * Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.\n * @public\n */\n export interface ModelObject {\n [key: string]: unknown;\n type: string;\n }\n\n /**\n * A generic paginated list.\n * @public\n */\n export interface Paginated<TResultItem> {\n /**\n * Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.\n */\n next?: string;\n /**\n * Page number of the current results. This is an optional element that is not provided in all responses.\n */\n page?: number;\n /**\n * Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.\n */\n pagelen?: number;\n /**\n * Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.\n */\n previous?: string;\n /**\n * Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.\n */\n size?: number;\n /**\n * The values of the current page.\n */\n values?: Array<TResultItem> | Set<TResultItem>;\n }\n\n /**\n * A paginated list of branches.\n * @public\n */\n export interface PaginatedBranches extends Paginated<Branch> {\n /**\n * The values of the current page.\n */\n values?: Set<Branch>;\n }\n\n /**\n * A paginated list of projects\n * @public\n */\n export interface PaginatedProjects extends Paginated<Project> {\n /**\n * The values of the current page.\n */\n values?: Set<Project>;\n }\n\n /**\n * A paginated list of repositories.\n * @public\n */\n export interface PaginatedRepositories extends Paginated<Repository> {\n /**\n * The values of the current page.\n */\n values?: Set<Repository>;\n }\n\n /**\n * A paginated list of workspaces.\n * @public\n */\n export interface PaginatedWorkspaces extends Paginated<Workspace> {\n /**\n * The values of the current page.\n */\n values?: Set<Workspace>;\n }\n\n /**\n * Object describing a user's role on resources like commits or pull requests.\n * @public\n */\n export interface Participant extends ModelObject {\n approved?: boolean;\n /**\n * The ISO8601 timestamp of the participant's action. For approvers, this is the time of their approval. For commenters and pull request reviewers who are not approvers, this is the time they last commented, or null if they have not commented.\n */\n participated_on?: string;\n role?: ParticipantRoleEnum;\n state?: ParticipantStateEnum;\n user?: Account;\n }\n\n /**\n * @public\n */\n export const ParticipantRoleEnum = {\n Participant: 'PARTICIPANT',\n Reviewer: 'REVIEWER',\n } as const;\n\n /**\n * @public\n */\n export type ParticipantRoleEnum =\n (typeof ParticipantRoleEnum)[keyof typeof ParticipantRoleEnum];\n\n /**\n * @public\n */\n export const ParticipantStateEnum = {\n Approved: 'approved',\n ChangesRequested: 'changes_requested',\n Null: 'null',\n } as const;\n\n /**\n * @public\n */\n export type ParticipantStateEnum =\n (typeof ParticipantStateEnum)[keyof typeof ParticipantStateEnum];\n\n /**\n * A Bitbucket project.\n * Projects are used by teams to organize repositories.\n * @public\n */\n export interface Project extends ModelObject {\n created_on?: string;\n description?: string;\n /**\n *\n * Indicates whether the project contains publicly visible repositories.\n * Note that private projects cannot contain public repositories.\n */\n has_publicly_visible_repos?: boolean;\n /**\n *\n * Indicates whether the project is publicly accessible, or whether it is\n * private to the team and consequently only visible to team members.\n * Note that private projects cannot contain public repositories.\n */\n is_private?: boolean;\n /**\n * The project's key.\n */\n key?: string;\n links?: ProjectLinks;\n /**\n * The name of the project.\n */\n name?: string;\n owner?: Team;\n updated_on?: string;\n /**\n * The project's immutable id.\n */\n uuid?: string;\n }\n\n /**\n * @public\n */\n export interface ProjectLinks {\n avatar?: Link;\n html?: Link;\n }\n\n /**\n * @public\n */\n export interface RefLinks {\n commits?: Link;\n html?: Link;\n self?: Link;\n }\n\n /**\n * A Bitbucket repository.\n * @public\n */\n export interface Repository extends ModelObject {\n created_on?: string;\n description?: string;\n /**\n *\n * Controls the rules for forking this repository.\n *\n * * **allow_forks**: unrestricted forking\n * * **no_public_forks**: restrict forking to private forks (forks cannot\n * be made public later)\n * * **no_forks**: deny all forking\n */\n fork_policy?: RepositoryForkPolicyEnum;\n /**\n * The concatenation of the repository owner's username and the slugified name, e.g. \"evzijst/interruptingcow\". This is the same string used in Bitbucket URLs.\n */\n full_name?: string;\n /**\n *\n * The issue tracker for this repository is enabled. Issue Tracker\n * features are not supported for repositories in workspaces\n * administered through admin.atlassian.com.\n */\n has_issues?: boolean;\n /**\n *\n * The wiki for this repository is enabled. Wiki\n * features are not supported for repositories in workspaces\n * administered through admin.atlassian.com.\n */\n has_wiki?: boolean;\n is_private?: boolean;\n language?: string;\n links?: RepositoryLinks;\n mainbranch?: Branch;\n name?: string;\n owner?: Account;\n parent?: Repository;\n project?: Project;\n scm?: RepositoryScmEnum;\n size?: number;\n /**\n * The \"sluggified\" version of the repository's name. This contains only ASCII characters and can therefore be slightly different than the name\n */\n slug?: string;\n updated_on?: string;\n /**\n * The repository's immutable id. This can be used as a substitute for the slug segment in URLs. Doing this guarantees your URLs will survive renaming of the repository by its owner, or even transfer of the repository to a different user.\n */\n uuid?: string;\n }\n\n /**\n *\n * Controls the rules for forking this repository.\n *\n * * **allow_forks**: unrestricted forking\n * * **no_public_forks**: restrict forking to private forks (forks cannot\n * be made public later)\n * * **no_forks**: deny all forking\n * @public\n */\n export const RepositoryForkPolicyEnum = {\n AllowForks: 'allow_forks',\n NoPublicForks: 'no_public_forks',\n NoForks: 'no_forks',\n } as const;\n\n /**\n *\n * Controls the rules for forking this repository.\n *\n * * **allow_forks**: unrestricted forking\n * * **no_public_forks**: restrict forking to private forks (forks cannot\n * be made public later)\n * * **no_forks**: deny all forking\n * @public\n */\n export type RepositoryForkPolicyEnum =\n (typeof RepositoryForkPolicyEnum)[keyof typeof RepositoryForkPolicyEnum];\n\n /**\n * @public\n */\n export const RepositoryScmEnum = {\n Git: 'git',\n } as const;\n\n /**\n * @public\n */\n export type RepositoryScmEnum =\n (typeof RepositoryScmEnum)[keyof typeof RepositoryScmEnum];\n\n /**\n * @public\n */\n export interface RepositoryLinks {\n avatar?: Link;\n clone?: Array<Link>;\n commits?: Link;\n downloads?: Link;\n forks?: Link;\n hooks?: Link;\n html?: Link;\n pullrequests?: Link;\n self?: Link;\n watchers?: Link;\n }\n\n /**\n * @public\n */\n export interface SearchCodeSearchResult {\n readonly content_match_count?: number;\n readonly content_matches?: Array<SearchContentMatch>;\n file?: CommitFile;\n readonly path_matches?: Array<SearchSegment>;\n readonly type?: string;\n }\n\n /**\n * @public\n */\n export interface SearchContentMatch {\n readonly lines?: Array<SearchLine>;\n }\n\n /**\n * @public\n */\n export interface SearchLine {\n readonly line?: number;\n readonly segments?: Array<SearchSegment>;\n }\n\n /**\n * @public\n */\n export interface SearchResultPage extends Paginated<SearchCodeSearchResult> {\n readonly query_substituted?: boolean;\n /**\n * The values of the current page.\n */\n readonly values?: Array<SearchCodeSearchResult>;\n }\n\n /**\n * @public\n */\n export interface SearchSegment {\n readonly match?: boolean;\n readonly text?: string;\n }\n\n /**\n * A team object.\n * @public\n */\n export interface Team extends Account {\n links?: TeamLinks;\n }\n\n /**\n * Links related to a Team.\n * @public\n */\n export interface TeamLinks extends AccountLinks {\n html?: Link;\n members?: Link;\n projects?: Link;\n repositories?: Link;\n self?: Link;\n }\n\n /**\n * A Bitbucket workspace.\n * Workspaces are used to organize repositories.\n * @public\n */\n export interface Workspace extends ModelObject {\n created_on?: string;\n /**\n * Controls the rules for forking repositories within this workspace.\n *\n * * **allow_forks**: unrestricted forking\n * * **internal_only**: prevents forking of private repositories outside the workspace or to public repositories\n */\n forking_mode?: WorkspaceForkingModeEnum;\n /**\n * Indicates whether the workspace enforces private content, or whether it allows public content.\n */\n is_privacy_enforced?: boolean;\n /**\n * Indicates whether the workspace is publicly accessible, or whether it is\n * private to the members and consequently only visible to members.\n */\n is_private?: boolean;\n links?: WorkspaceLinks;\n /**\n * The name of the workspace.\n */\n name?: string;\n /**\n * The short label that identifies this workspace.\n */\n slug?: string;\n updated_on?: string;\n /**\n * The workspace's immutable id.\n */\n uuid?: string;\n }\n\n /**\n * Controls the rules for forking repositories within this workspace.\n *\n * * **allow_forks**: unrestricted forking\n * * **internal_only**: prevents forking of private repositories outside the workspace or to public repositories\n * @public\n */\n export const WorkspaceForkingModeEnum = {\n AllowForks: 'allow_forks',\n InternalOnly: 'internal_only',\n } as const;\n\n /**\n * Controls the rules for forking repositories within this workspace.\n *\n * * **allow_forks**: unrestricted forking\n * * **internal_only**: prevents forking of private repositories outside the workspace or to public repositories\n * @public\n */\n export type WorkspaceForkingModeEnum =\n (typeof WorkspaceForkingModeEnum)[keyof typeof WorkspaceForkingModeEnum];\n\n /**\n * @public\n */\n export interface WorkspaceLinks {\n avatar?: Link;\n html?: Link;\n members?: Link;\n owners?: Link;\n projects?: Link;\n repositories?: Link;\n self?: Link;\n snippets?: Link;\n }\n}\n"],"names":["Models"],"mappings":";;AA6BiBA;AAAA,CAAV,CAAUA,OAAV,KAAA;AAqEE,EAAMA,QAAA,2BAA8B,GAAA;AAAA,IACzC,QAAU,EAAA,UAAA;AAAA,IACV,MAAQ,EAAA,QAAA;AAAA,IACR,SAAW,EAAA;AAAA,GACb;AAmCO,EAAMA,QAAA,yBAA4B,GAAA;AAAA,IACvC,WAAa,EAAA,cAAA;AAAA,IACb,MAAQ,EAAA,QAAA;AAAA,IACR,WAAa,EAAA,cAAA;AAAA,IACb,iBAAmB,EAAA,qBAAA;AAAA,IACnB,iBAAmB,EAAA,qBAAA;AAAA,IACnB,WAAa,EAAA;AAAA,GACf;AAwCO,EAAMA,QAAA,wBAA2B,GAAA;AAAA,IACtC,IAAM,EAAA,MAAA;AAAA,IACN,UAAY,EAAA,YAAA;AAAA,IACZ,aAAe,EAAA,eAAA;AAAA,IACf,MAAQ,EAAA,QAAA;AAAA,IACR,GAAK,EAAA;AAAA,GACP;AAmIO,EAAMA,QAAA,mBAAsB,GAAA;AAAA,IACjC,WAAa,EAAA,aAAA;AAAA,IACb,QAAU,EAAA;AAAA,GACZ;AAWO,EAAMA,QAAA,oBAAuB,GAAA;AAAA,IAClC,QAAU,EAAA,UAAA;AAAA,IACV,gBAAkB,EAAA,mBAAA;AAAA,IAClB,IAAM,EAAA;AAAA,GACR;AAiIO,EAAMA,QAAA,wBAA2B,GAAA;AAAA,IACtC,UAAY,EAAA,aAAA;AAAA,IACZ,aAAe,EAAA,iBAAA;AAAA,IACf,OAAS,EAAA;AAAA,GACX;AAkBO,EAAMA,QAAA,iBAAoB,GAAA;AAAA,IAC/B,GAAK,EAAA;AAAA,GACP;AAuIO,EAAMA,QAAA,wBAA2B,GAAA;AAAA,IACtC,UAAY,EAAA,aAAA;AAAA,IACZ,YAAc,EAAA;AAAA,GAChB;AAAA,CAzlBe,EAAAA,cAAA,KAAAA,cAAA,GAAA,EAAA,CAAA,CAAA;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../../src/models/index.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Bitbucket API\n * Code against the Bitbucket API to automate simple tasks, embed Bitbucket data into your own site, build mobile or desktop apps, or even add custom UI add-ons into Bitbucket itself using the Connect framework.\n *\n * The version of the OpenAPI document: 2.0\n * Contact: support@bitbucket.org\n *\n * NOTE: This file was auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n/** @public */\nexport namespace Models {\n /**\n * An account object.\n * @public\n */\n export interface Account extends ModelObject {\n created_on?: string;\n display_name?: string;\n links?: AccountLinks;\n uuid?: string;\n }\n\n /**\n * Links related to an Account.\n * @public\n */\n export interface AccountLinks {\n [key: string]: unknown;\n avatar?: Link;\n }\n\n /**\n * The author of a change in a repository\n * @public\n */\n export interface Author extends ModelObject {\n /**\n * The raw author value from the repository. This may be the only value available if the author does not match a user in Bitbucket.\n */\n raw?: string;\n user?: Account;\n }\n\n /**\n * The common base type for both repository and snippet commits.\n * @public\n */\n export interface BaseCommit extends ModelObject {\n author?: Author;\n committer?: Committer;\n date?: string;\n hash?: string;\n message?: string;\n parents?: Array<BaseCommit>;\n summary?: BaseCommitSummary;\n }\n\n /**\n * @public\n */\n export interface BaseCommitSummary {\n /**\n * The user's content rendered as HTML.\n */\n html?: string;\n /**\n * The type of markup language the raw content is to be interpreted in.\n */\n markup?: BaseCommitSummaryMarkupEnum;\n /**\n * The text as it was typed by a user.\n */\n raw?: string;\n }\n\n /**\n * The type of markup language the raw content is to be interpreted in.\n * @public\n */\n export const BaseCommitSummaryMarkupEnum = {\n Markdown: 'markdown',\n Creole: 'creole',\n Plaintext: 'plaintext',\n } as const;\n\n /**\n * The type of markup language the raw content is to be interpreted in.\n * @public\n */\n export type BaseCommitSummaryMarkupEnum =\n (typeof BaseCommitSummaryMarkupEnum)[keyof typeof BaseCommitSummaryMarkupEnum];\n\n /**\n * A branch object, representing a branch in a repository.\n * @public\n */\n export interface Branch {\n links?: RefLinks;\n /**\n * The name of the ref.\n */\n name?: string;\n target?: Commit;\n type: string;\n /**\n * The default merge strategy for pull requests targeting this branch.\n */\n default_merge_strategy?: string;\n /**\n * Available merge strategies for pull requests targeting this branch.\n */\n merge_strategies?: Array<BranchMergeStrategiesEnum>;\n }\n\n /**\n * Available merge strategies for pull requests targeting this branch.\n * @public\n */\n export const BranchMergeStrategiesEnum = {\n MergeCommit: 'merge_commit',\n Squash: 'squash',\n FastForward: 'fast_forward',\n SquashFastForward: 'squash_fast_forward',\n RebaseFastForward: 'rebase_fast_forward',\n RebaseMerge: 'rebase_merge',\n } as const;\n\n /**\n * Available merge strategies for pull requests targeting this branch.\n * @public\n */\n export type BranchMergeStrategiesEnum =\n (typeof BranchMergeStrategiesEnum)[keyof typeof BranchMergeStrategiesEnum];\n\n /**\n * A repository commit object.\n * @public\n */\n export interface Commit extends BaseCommit {\n participants?: Array<Participant>;\n repository?: Repository;\n }\n\n /**\n * A file object, representing a file at a commit in a repository\n * @public\n */\n export interface CommitFile {\n [key: string]: unknown;\n attributes?: CommitFileAttributesEnum;\n commit?: Commit;\n /**\n * The escaped version of the path as it appears in a diff. If the path does not require escaping this will be the same as path.\n */\n escaped_path?: string;\n /**\n * The path in the repository\n */\n path?: string;\n type: string;\n }\n\n /**\n * @public\n */\n export const CommitFileAttributesEnum = {\n Link: 'link',\n Executable: 'executable',\n Subrepository: 'subrepository',\n Binary: 'binary',\n Lfs: 'lfs',\n } as const;\n\n /**\n * @public\n */\n export type CommitFileAttributesEnum =\n (typeof CommitFileAttributesEnum)[keyof typeof CommitFileAttributesEnum];\n\n /**\n * The committer of a change in a repository\n * @public\n */\n export interface Committer extends ModelObject {\n /**\n * The raw committer value from the repository. This may be the only value available if the committer does not match a user in Bitbucket.\n */\n raw?: string;\n user?: Account;\n }\n\n /**\n * A link to a resource related to this object.\n * @public\n */\n export interface Link {\n href?: string;\n name?: string;\n }\n\n /**\n * Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.\n * @public\n */\n export interface ModelObject {\n [key: string]: unknown;\n type: string;\n }\n\n /**\n * A generic paginated list.\n * @public\n */\n export interface Paginated<TResultItem> {\n /**\n * Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.\n */\n next?: string;\n /**\n * Page number of the current results. This is an optional element that is not provided in all responses.\n */\n page?: number;\n /**\n * Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.\n */\n pagelen?: number;\n /**\n * Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.\n */\n previous?: string;\n /**\n * Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.\n */\n size?: number;\n /**\n * The values of the current page.\n */\n values?: Array<TResultItem> | Set<TResultItem>;\n }\n\n /**\n * A paginated list of branches.\n * @public\n */\n export interface PaginatedBranches extends Paginated<Branch> {\n /**\n * The values of the current page.\n */\n values?: Set<Branch>;\n }\n\n /**\n * A paginated list of projects\n * @public\n */\n export interface PaginatedProjects extends Paginated<Project> {\n /**\n * The values of the current page.\n */\n values?: Set<Project>;\n }\n\n /**\n * A paginated list of repositories.\n * @public\n */\n export interface PaginatedRepositories extends Paginated<Repository> {\n /**\n * The values of the current page.\n */\n values?: Set<Repository>;\n }\n\n /**\n * A paginated list of workspaces.\n * @public\n */\n export interface PaginatedWorkspaces extends Paginated<Workspace> {\n /**\n * The values of the current page.\n */\n values?: Set<Workspace>;\n }\n\n /**\n * Object describing a user's role on resources like commits or pull requests.\n * @public\n */\n export interface Participant extends ModelObject {\n approved?: boolean;\n /**\n * The ISO8601 timestamp of the participant's action. For approvers, this is the time of their approval. For commenters and pull request reviewers who are not approvers, this is the time they last commented, or null if they have not commented.\n */\n participated_on?: string;\n role?: ParticipantRoleEnum;\n state?: ParticipantStateEnum;\n user?: Account;\n }\n\n /**\n * @public\n */\n export const ParticipantRoleEnum = {\n Participant: 'PARTICIPANT',\n Reviewer: 'REVIEWER',\n } as const;\n\n /**\n * @public\n */\n export type ParticipantRoleEnum =\n (typeof ParticipantRoleEnum)[keyof typeof ParticipantRoleEnum];\n\n /**\n * @public\n */\n export const ParticipantStateEnum = {\n Approved: 'approved',\n ChangesRequested: 'changes_requested',\n Null: 'null',\n } as const;\n\n /**\n * @public\n */\n export type ParticipantStateEnum =\n (typeof ParticipantStateEnum)[keyof typeof ParticipantStateEnum];\n\n /**\n * A Bitbucket project.\n * Projects are used by teams to organize repositories.\n * @public\n */\n export interface Project extends ModelObject {\n created_on?: string;\n description?: string;\n /**\n *\n * Indicates whether the project contains publicly visible repositories.\n * Note that private projects cannot contain public repositories.\n */\n has_publicly_visible_repos?: boolean;\n /**\n *\n * Indicates whether the project is publicly accessible, or whether it is\n * private to the team and consequently only visible to team members.\n * Note that private projects cannot contain public repositories.\n */\n is_private?: boolean;\n /**\n * The project's key.\n */\n key?: string;\n links?: ProjectLinks;\n /**\n * The name of the project.\n */\n name?: string;\n owner?: Team;\n updated_on?: string;\n /**\n * The project's immutable id.\n */\n uuid?: string;\n }\n\n /**\n * @public\n */\n export interface ProjectLinks {\n avatar?: Link;\n html?: Link;\n }\n\n /**\n * @public\n */\n export interface RefLinks {\n commits?: Link;\n html?: Link;\n self?: Link;\n }\n\n /**\n * A Bitbucket repository.\n * @public\n */\n export interface Repository extends ModelObject {\n created_on?: string;\n description?: string;\n /**\n *\n * Controls the rules for forking this repository.\n *\n * * **allow_forks**: unrestricted forking\n * * **no_public_forks**: restrict forking to private forks (forks cannot\n * be made public later)\n * * **no_forks**: deny all forking\n */\n fork_policy?: RepositoryForkPolicyEnum;\n /**\n * The concatenation of the repository owner's username and the slugified name, e.g. \"evzijst/interruptingcow\". This is the same string used in Bitbucket URLs.\n */\n full_name?: string;\n /**\n *\n * The issue tracker for this repository is enabled. Issue Tracker\n * features are not supported for repositories in workspaces\n * administered through admin.atlassian.com.\n */\n has_issues?: boolean;\n /**\n *\n * The wiki for this repository is enabled. Wiki\n * features are not supported for repositories in workspaces\n * administered through admin.atlassian.com.\n */\n has_wiki?: boolean;\n is_private?: boolean;\n language?: string;\n links?: RepositoryLinks;\n mainbranch?: Branch;\n name?: string;\n owner?: Account;\n parent?: Repository;\n project?: Project;\n scm?: RepositoryScmEnum;\n size?: number;\n /**\n * The \"sluggified\" version of the repository's name. This contains only ASCII characters and can therefore be slightly different than the name\n */\n slug?: string;\n updated_on?: string;\n /**\n * The repository's immutable id. This can be used as a substitute for the slug segment in URLs. Doing this guarantees your URLs will survive renaming of the repository by its owner, or even transfer of the repository to a different user.\n */\n uuid?: string;\n }\n\n /**\n *\n * Controls the rules for forking this repository.\n *\n * * **allow_forks**: unrestricted forking\n * * **no_public_forks**: restrict forking to private forks (forks cannot\n * be made public later)\n * * **no_forks**: deny all forking\n * @public\n */\n export const RepositoryForkPolicyEnum = {\n AllowForks: 'allow_forks',\n NoPublicForks: 'no_public_forks',\n NoForks: 'no_forks',\n } as const;\n\n /**\n *\n * Controls the rules for forking this repository.\n *\n * * **allow_forks**: unrestricted forking\n * * **no_public_forks**: restrict forking to private forks (forks cannot\n * be made public later)\n * * **no_forks**: deny all forking\n * @public\n */\n export type RepositoryForkPolicyEnum =\n (typeof RepositoryForkPolicyEnum)[keyof typeof RepositoryForkPolicyEnum];\n\n /**\n * @public\n */\n export const RepositoryScmEnum = {\n Git: 'git',\n } as const;\n\n /**\n * @public\n */\n export type RepositoryScmEnum =\n (typeof RepositoryScmEnum)[keyof typeof RepositoryScmEnum];\n\n /**\n * @public\n */\n export interface RepositoryLinks {\n avatar?: Link;\n clone?: Array<Link>;\n commits?: Link;\n downloads?: Link;\n forks?: Link;\n hooks?: Link;\n html?: Link;\n pullrequests?: Link;\n self?: Link;\n watchers?: Link;\n }\n\n /**\n * @public\n */\n export interface SearchCodeSearchResult {\n readonly content_match_count?: number;\n readonly content_matches?: Array<SearchContentMatch>;\n file?: CommitFile;\n readonly path_matches?: Array<SearchSegment>;\n readonly type?: string;\n }\n\n /**\n * @public\n */\n export interface SearchContentMatch {\n readonly lines?: Array<SearchLine>;\n }\n\n /**\n * @public\n */\n export interface SearchLine {\n readonly line?: number;\n readonly segments?: Array<SearchSegment>;\n }\n\n /**\n * @public\n */\n export interface SearchResultPage extends Paginated<SearchCodeSearchResult> {\n readonly query_substituted?: boolean;\n /**\n * The values of the current page.\n */\n readonly values?: Array<SearchCodeSearchResult>;\n }\n\n /**\n * @public\n */\n export interface SearchSegment {\n readonly match?: boolean;\n readonly text?: string;\n }\n\n /**\n * A team object.\n * @public\n */\n export interface Team extends Account {\n links?: TeamLinks;\n }\n\n /**\n * Links related to a Team.\n * @public\n */\n export interface TeamLinks extends AccountLinks {\n html?: Link;\n members?: Link;\n projects?: Link;\n repositories?: Link;\n self?: Link;\n }\n\n /**\n * A Bitbucket workspace.\n * Workspaces are used to organize repositories.\n * @public\n */\n export interface Workspace extends ModelObject {\n created_on?: string;\n /**\n * Controls the rules for forking repositories within this workspace.\n *\n * * **allow_forks**: unrestricted forking\n * * **internal_only**: prevents forking of private repositories outside the workspace or to public repositories\n */\n forking_mode?: WorkspaceForkingModeEnum;\n /**\n * Indicates whether the workspace enforces private content, or whether it allows public content.\n */\n is_privacy_enforced?: boolean;\n /**\n * Indicates whether the workspace is publicly accessible, or whether it is\n * private to the members and consequently only visible to members.\n */\n is_private?: boolean;\n links?: WorkspaceLinks;\n /**\n * The name of the workspace.\n */\n name?: string;\n /**\n * The short label that identifies this workspace.\n */\n slug?: string;\n updated_on?: string;\n /**\n * The workspace's immutable id.\n */\n uuid?: string;\n }\n\n /**\n * Controls the rules for forking repositories within this workspace.\n *\n * * **allow_forks**: unrestricted forking\n * * **internal_only**: prevents forking of private repositories outside the workspace or to public repositories\n * @public\n */\n export const WorkspaceForkingModeEnum = {\n AllowForks: 'allow_forks',\n InternalOnly: 'internal_only',\n } as const;\n\n /**\n * Controls the rules for forking repositories within this workspace.\n *\n * * **allow_forks**: unrestricted forking\n * * **internal_only**: prevents forking of private repositories outside the workspace or to public repositories\n * @public\n */\n export type WorkspaceForkingModeEnum =\n (typeof WorkspaceForkingModeEnum)[keyof typeof WorkspaceForkingModeEnum];\n\n /**\n * @public\n */\n export interface WorkspaceLinks {\n avatar?: Link;\n html?: Link;\n members?: Link;\n owners?: Link;\n projects?: Link;\n repositories?: Link;\n self?: Link;\n snippets?: Link;\n }\n}\n"],"names":["Models"],"mappings":";;AA6BiBA;AAAA,CAAV,CAAUA,OAAAA,KAAV;AAqEE,EAAMA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Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Bitbucket API\n * Code against the Bitbucket API to automate simple tasks, embed Bitbucket data into your own site, build mobile or desktop apps, or even add custom UI add-ons into Bitbucket itself using the Connect framework.\n *\n * The version of the OpenAPI document: 2.0\n * Contact: support@bitbucket.org\n *\n * NOTE: This file was auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n/** @public */\nexport namespace Models {\n /**\n * An account object.\n * @public\n */\n export interface Account extends ModelObject {\n created_on?: string;\n display_name?: string;\n links?: AccountLinks;\n uuid?: string;\n }\n\n /**\n * Links related to an Account.\n * @public\n */\n export interface AccountLinks {\n [key: string]: unknown;\n avatar?: Link;\n }\n\n /**\n * The author of a change in a repository\n * @public\n */\n export interface Author extends ModelObject {\n /**\n * The raw author value from the repository. This may be the only value available if the author does not match a user in Bitbucket.\n */\n raw?: string;\n user?: Account;\n }\n\n /**\n * The common base type for both repository and snippet commits.\n * @public\n */\n export interface BaseCommit extends ModelObject {\n author?: Author;\n committer?: Committer;\n date?: string;\n hash?: string;\n message?: string;\n parents?: Array<BaseCommit>;\n summary?: BaseCommitSummary;\n }\n\n /**\n * @public\n */\n export interface BaseCommitSummary {\n /**\n * The user's content rendered as HTML.\n */\n html?: string;\n /**\n * The type of markup language the raw content is to be interpreted in.\n */\n markup?: BaseCommitSummaryMarkupEnum;\n /**\n * The text as it was typed by a user.\n */\n raw?: string;\n }\n\n /**\n * The type of markup language the raw content is to be interpreted in.\n * @public\n */\n export const BaseCommitSummaryMarkupEnum = {\n Markdown: 'markdown',\n Creole: 'creole',\n Plaintext: 'plaintext',\n } as const;\n\n /**\n * The type of markup language the raw content is to be interpreted in.\n * @public\n */\n export type BaseCommitSummaryMarkupEnum =\n (typeof BaseCommitSummaryMarkupEnum)[keyof typeof BaseCommitSummaryMarkupEnum];\n\n /**\n * A branch object, representing a branch in a repository.\n * @public\n */\n export interface Branch {\n links?: RefLinks;\n /**\n * The name of the ref.\n */\n name?: string;\n target?: Commit;\n type: string;\n /**\n * The default merge strategy for pull requests targeting this branch.\n */\n default_merge_strategy?: string;\n /**\n * Available merge strategies for pull requests targeting this branch.\n */\n merge_strategies?: Array<BranchMergeStrategiesEnum>;\n }\n\n /**\n * Available merge strategies for pull requests targeting this branch.\n * @public\n */\n export const BranchMergeStrategiesEnum = {\n MergeCommit: 'merge_commit',\n Squash: 'squash',\n FastForward: 'fast_forward',\n SquashFastForward: 'squash_fast_forward',\n RebaseFastForward: 'rebase_fast_forward',\n RebaseMerge: 'rebase_merge',\n } as const;\n\n /**\n * Available merge strategies for pull requests targeting this branch.\n * @public\n */\n export type BranchMergeStrategiesEnum =\n (typeof BranchMergeStrategiesEnum)[keyof typeof BranchMergeStrategiesEnum];\n\n /**\n * A repository commit object.\n * @public\n */\n export interface Commit extends BaseCommit {\n participants?: Array<Participant>;\n repository?: Repository;\n }\n\n /**\n * A file object, representing a file at a commit in a repository\n * @public\n */\n export interface CommitFile {\n [key: string]: unknown;\n attributes?: CommitFileAttributesEnum;\n commit?: Commit;\n /**\n * The escaped version of the path as it appears in a diff. If the path does not require escaping this will be the same as path.\n */\n escaped_path?: string;\n /**\n * The path in the repository\n */\n path?: string;\n type: string;\n }\n\n /**\n * @public\n */\n export const CommitFileAttributesEnum = {\n Link: 'link',\n Executable: 'executable',\n Subrepository: 'subrepository',\n Binary: 'binary',\n Lfs: 'lfs',\n } as const;\n\n /**\n * @public\n */\n export type CommitFileAttributesEnum =\n (typeof CommitFileAttributesEnum)[keyof typeof CommitFileAttributesEnum];\n\n /**\n * The committer of a change in a repository\n * @public\n */\n export interface Committer extends ModelObject {\n /**\n * The raw committer value from the repository. This may be the only value available if the committer does not match a user in Bitbucket.\n */\n raw?: string;\n user?: Account;\n }\n\n /**\n * A link to a resource related to this object.\n * @public\n */\n export interface Link {\n href?: string;\n name?: string;\n }\n\n /**\n * Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.\n * @public\n */\n export interface ModelObject {\n [key: string]: unknown;\n type: string;\n }\n\n /**\n * A generic paginated list.\n * @public\n */\n export interface Paginated<TResultItem> {\n /**\n * Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.\n */\n next?: string;\n /**\n * Page number of the current results. This is an optional element that is not provided in all responses.\n */\n page?: number;\n /**\n * Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.\n */\n pagelen?: number;\n /**\n * Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.\n */\n previous?: string;\n /**\n * Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.\n */\n size?: number;\n /**\n * The values of the current page.\n */\n values?: Array<TResultItem> | Set<TResultItem>;\n }\n\n /**\n * A paginated list of branches.\n * @public\n */\n export interface PaginatedBranches extends Paginated<Branch> {\n /**\n * The values of the current page.\n */\n values?: Set<Branch>;\n }\n\n /**\n * A paginated list of projects\n * @public\n */\n export interface PaginatedProjects extends Paginated<Project> {\n /**\n * The values of the current page.\n */\n values?: Set<Project>;\n }\n\n /**\n * A paginated list of repositories.\n * @public\n */\n export interface PaginatedRepositories extends Paginated<Repository> {\n /**\n * The values of the current page.\n */\n values?: Set<Repository>;\n }\n\n /**\n * A paginated list of workspaces.\n * @public\n */\n export interface PaginatedWorkspaces extends Paginated<Workspace> {\n /**\n * The values of the current page.\n */\n values?: Set<Workspace>;\n }\n\n /**\n * Object describing a user's role on resources like commits or pull requests.\n * @public\n */\n export interface Participant extends ModelObject {\n approved?: boolean;\n /**\n * The ISO8601 timestamp of the participant's action. For approvers, this is the time of their approval. For commenters and pull request reviewers who are not approvers, this is the time they last commented, or null if they have not commented.\n */\n participated_on?: string;\n role?: ParticipantRoleEnum;\n state?: ParticipantStateEnum;\n user?: Account;\n }\n\n /**\n * @public\n */\n export const ParticipantRoleEnum = {\n Participant: 'PARTICIPANT',\n Reviewer: 'REVIEWER',\n } as const;\n\n /**\n * @public\n */\n export type ParticipantRoleEnum =\n (typeof ParticipantRoleEnum)[keyof typeof ParticipantRoleEnum];\n\n /**\n * @public\n */\n export const ParticipantStateEnum = {\n Approved: 'approved',\n ChangesRequested: 'changes_requested',\n Null: 'null',\n } as const;\n\n /**\n * @public\n */\n export type ParticipantStateEnum =\n (typeof ParticipantStateEnum)[keyof typeof ParticipantStateEnum];\n\n /**\n * A Bitbucket project.\n * Projects are used by teams to organize repositories.\n * @public\n */\n export interface Project extends ModelObject {\n created_on?: string;\n description?: string;\n /**\n *\n * Indicates whether the project contains publicly visible repositories.\n * Note that private projects cannot contain public repositories.\n */\n has_publicly_visible_repos?: boolean;\n /**\n *\n * Indicates whether the project is publicly accessible, or whether it is\n * private to the team and consequently only visible to team members.\n * Note that private projects cannot contain public repositories.\n */\n is_private?: boolean;\n /**\n * The project's key.\n */\n key?: string;\n links?: ProjectLinks;\n /**\n * The name of the project.\n */\n name?: string;\n owner?: Team;\n updated_on?: string;\n /**\n * The project's immutable id.\n */\n uuid?: string;\n }\n\n /**\n * @public\n */\n export interface ProjectLinks {\n avatar?: Link;\n html?: Link;\n }\n\n /**\n * @public\n */\n export interface RefLinks {\n commits?: Link;\n html?: Link;\n self?: Link;\n }\n\n /**\n * A Bitbucket repository.\n * @public\n */\n export interface Repository extends ModelObject {\n created_on?: string;\n description?: string;\n /**\n *\n * Controls the rules for forking this repository.\n *\n * * **allow_forks**: unrestricted forking\n * * **no_public_forks**: restrict forking to private forks (forks cannot\n * be made public later)\n * * **no_forks**: deny all forking\n */\n fork_policy?: RepositoryForkPolicyEnum;\n /**\n * The concatenation of the repository owner's username and the slugified name, e.g. \"evzijst/interruptingcow\". This is the same string used in Bitbucket URLs.\n */\n full_name?: string;\n /**\n *\n * The issue tracker for this repository is enabled. Issue Tracker\n * features are not supported for repositories in workspaces\n * administered through admin.atlassian.com.\n */\n has_issues?: boolean;\n /**\n *\n * The wiki for this repository is enabled. Wiki\n * features are not supported for repositories in workspaces\n * administered through admin.atlassian.com.\n */\n has_wiki?: boolean;\n is_private?: boolean;\n language?: string;\n links?: RepositoryLinks;\n mainbranch?: Branch;\n name?: string;\n owner?: Account;\n parent?: Repository;\n project?: Project;\n scm?: RepositoryScmEnum;\n size?: number;\n /**\n * The \"sluggified\" version of the repository's name. This contains only ASCII characters and can therefore be slightly different than the name\n */\n slug?: string;\n updated_on?: string;\n /**\n * The repository's immutable id. This can be used as a substitute for the slug segment in URLs. Doing this guarantees your URLs will survive renaming of the repository by its owner, or even transfer of the repository to a different user.\n */\n uuid?: string;\n }\n\n /**\n *\n * Controls the rules for forking this repository.\n *\n * * **allow_forks**: unrestricted forking\n * * **no_public_forks**: restrict forking to private forks (forks cannot\n * be made public later)\n * * **no_forks**: deny all forking\n * @public\n */\n export const RepositoryForkPolicyEnum = {\n AllowForks: 'allow_forks',\n NoPublicForks: 'no_public_forks',\n NoForks: 'no_forks',\n } as const;\n\n /**\n *\n * Controls the rules for forking this repository.\n *\n * * **allow_forks**: unrestricted forking\n * * **no_public_forks**: restrict forking to private forks (forks cannot\n * be made public later)\n * * **no_forks**: deny all forking\n * @public\n */\n export type RepositoryForkPolicyEnum =\n (typeof RepositoryForkPolicyEnum)[keyof typeof RepositoryForkPolicyEnum];\n\n /**\n * @public\n */\n export const RepositoryScmEnum = {\n Git: 'git',\n } as const;\n\n /**\n * @public\n */\n export type RepositoryScmEnum =\n (typeof RepositoryScmEnum)[keyof typeof RepositoryScmEnum];\n\n /**\n * @public\n */\n export interface RepositoryLinks {\n avatar?: Link;\n clone?: Array<Link>;\n commits?: Link;\n downloads?: Link;\n forks?: Link;\n hooks?: Link;\n html?: Link;\n pullrequests?: Link;\n self?: Link;\n watchers?: Link;\n }\n\n /**\n * @public\n */\n export interface SearchCodeSearchResult {\n readonly content_match_count?: number;\n readonly content_matches?: Array<SearchContentMatch>;\n file?: CommitFile;\n readonly path_matches?: Array<SearchSegment>;\n readonly type?: string;\n }\n\n /**\n * @public\n */\n export interface SearchContentMatch {\n readonly lines?: Array<SearchLine>;\n }\n\n /**\n * @public\n */\n export interface SearchLine {\n readonly line?: number;\n readonly segments?: Array<SearchSegment>;\n }\n\n /**\n * @public\n */\n export interface SearchResultPage extends Paginated<SearchCodeSearchResult> {\n readonly query_substituted?: boolean;\n /**\n * The values of the current page.\n */\n readonly values?: Array<SearchCodeSearchResult>;\n }\n\n /**\n * @public\n */\n export interface SearchSegment {\n readonly match?: boolean;\n readonly text?: string;\n }\n\n /**\n * A team object.\n * @public\n */\n export interface Team extends Account {\n links?: TeamLinks;\n }\n\n /**\n * Links related to a Team.\n * @public\n */\n export interface TeamLinks extends AccountLinks {\n html?: Link;\n members?: Link;\n projects?: Link;\n repositories?: Link;\n self?: Link;\n }\n\n /**\n * A Bitbucket workspace.\n * Workspaces are used to organize repositories.\n * @public\n */\n export interface Workspace extends ModelObject {\n created_on?: string;\n /**\n * Controls the rules for forking repositories within this workspace.\n *\n * * **allow_forks**: unrestricted forking\n * * **internal_only**: prevents forking of private repositories outside the workspace or to public repositories\n */\n forking_mode?: WorkspaceForkingModeEnum;\n /**\n * Indicates whether the workspace enforces private content, or whether it allows public content.\n */\n is_privacy_enforced?: boolean;\n /**\n * Indicates whether the workspace is publicly accessible, or whether it is\n * private to the members and consequently only visible to members.\n */\n is_private?: boolean;\n links?: WorkspaceLinks;\n /**\n * The name of the workspace.\n */\n name?: string;\n /**\n * The short label that identifies this workspace.\n */\n slug?: string;\n updated_on?: string;\n /**\n * The workspace's immutable id.\n */\n uuid?: string;\n }\n\n /**\n * Controls the rules for forking repositories within this workspace.\n *\n * * **allow_forks**: unrestricted forking\n * * **internal_only**: prevents forking of private repositories outside the workspace or to public repositories\n * @public\n */\n export const WorkspaceForkingModeEnum = {\n AllowForks: 'allow_forks',\n InternalOnly: 'internal_only',\n } as const;\n\n /**\n * Controls the rules for forking repositories within this workspace.\n *\n * * **allow_forks**: unrestricted forking\n * * **internal_only**: prevents forking of private repositories outside the workspace or to public repositories\n * @public\n */\n export type WorkspaceForkingModeEnum =\n (typeof WorkspaceForkingModeEnum)[keyof typeof WorkspaceForkingModeEnum];\n\n /**\n * @public\n */\n export interface WorkspaceLinks {\n avatar?: Link;\n html?: Link;\n members?: Link;\n owners?: Link;\n projects?: Link;\n repositories?: Link;\n self?: Link;\n snippets?: Link;\n }\n}\n"],"names":["Models"],"mappings":"AA6BiB,IAAA;AAAA,CAAV,CAAUA,OAAV,KAAA;AAqEE,EAAMA,QAAA,2BAA8B,GAAA;AAAA,IACzC,QAAU,EAAA,UAAA;AAAA,IACV,MAAQ,EAAA,QAAA;AAAA,IACR,SAAW,EAAA;AAAA,GACb;AAmCO,EAAMA,QAAA,yBAA4B,GAAA;AAAA,IACvC,WAAa,EAAA,cAAA;AAAA,IACb,MAAQ,EAAA,QAAA;AAAA,IACR,WAAa,EAAA,cAAA;AAAA,IACb,iBAAmB,EAAA,qBAAA;AAAA,IACnB,iBAAmB,EAAA,qBAAA;AAAA,IACnB,WAAa,EAAA;AAAA,GACf;AAwCO,EAAMA,QAAA,wBAA2B,GAAA;AAAA,IACtC,IAAM,EAAA,MAAA;AAAA,IACN,UAAY,EAAA,YAAA;AAAA,IACZ,aAAe,EAAA,eAAA;AAAA,IACf,MAAQ,EAAA,QAAA;AAAA,IACR,GAAK,EAAA;AAAA,GACP;AAmIO,EAAMA,QAAA,mBAAsB,GAAA;AAAA,IACjC,WAAa,EAAA,aAAA;AAAA,IACb,QAAU,EAAA;AAAA,GACZ;AAWO,EAAMA,QAAA,oBAAuB,GAAA;AAAA,IAClC,QAAU,EAAA,UAAA;AAAA,IACV,gBAAkB,EAAA,mBAAA;AAAA,IAClB,IAAM,EAAA;AAAA,GACR;AAiIO,EAAMA,QAAA,wBAA2B,GAAA;AAAA,IACtC,UAAY,EAAA,aAAA;AAAA,IACZ,aAAe,EAAA,iBAAA;AAAA,IACf,OAAS,EAAA;AAAA,GACX;AAkBO,EAAMA,QAAA,iBAAoB,GAAA;AAAA,IAC/B,GAAK,EAAA;AAAA,GACP;AAuIO,EAAMA,QAAA,wBAA2B,GAAA;AAAA,IACtC,UAAY,EAAA,aAAA;AAAA,IACZ,YAAc,EAAA;AAAA,GAChB;AAAA,CAzlBe,EAAA,MAAA,KAAA,MAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
1
+ {"version":3,"file":"index.esm.js","sources":["../../src/models/index.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n/**\n * Bitbucket API\n * Code against the Bitbucket API to automate simple tasks, embed Bitbucket data into your own site, build mobile or desktop apps, or even add custom UI add-ons into Bitbucket itself using the Connect framework.\n *\n * The version of the OpenAPI document: 2.0\n * Contact: support@bitbucket.org\n *\n * NOTE: This file was auto generated by OpenAPI Generator (https://openapi-generator.tech).\n * https://openapi-generator.tech\n * Do not edit the class manually.\n */\n\n/** @public */\nexport namespace Models {\n /**\n * An account object.\n * @public\n */\n export interface Account extends ModelObject {\n created_on?: string;\n display_name?: string;\n links?: AccountLinks;\n uuid?: string;\n }\n\n /**\n * Links related to an Account.\n * @public\n */\n export interface AccountLinks {\n [key: string]: unknown;\n avatar?: Link;\n }\n\n /**\n * The author of a change in a repository\n * @public\n */\n export interface Author extends ModelObject {\n /**\n * The raw author value from the repository. This may be the only value available if the author does not match a user in Bitbucket.\n */\n raw?: string;\n user?: Account;\n }\n\n /**\n * The common base type for both repository and snippet commits.\n * @public\n */\n export interface BaseCommit extends ModelObject {\n author?: Author;\n committer?: Committer;\n date?: string;\n hash?: string;\n message?: string;\n parents?: Array<BaseCommit>;\n summary?: BaseCommitSummary;\n }\n\n /**\n * @public\n */\n export interface BaseCommitSummary {\n /**\n * The user's content rendered as HTML.\n */\n html?: string;\n /**\n * The type of markup language the raw content is to be interpreted in.\n */\n markup?: BaseCommitSummaryMarkupEnum;\n /**\n * The text as it was typed by a user.\n */\n raw?: string;\n }\n\n /**\n * The type of markup language the raw content is to be interpreted in.\n * @public\n */\n export const BaseCommitSummaryMarkupEnum = {\n Markdown: 'markdown',\n Creole: 'creole',\n Plaintext: 'plaintext',\n } as const;\n\n /**\n * The type of markup language the raw content is to be interpreted in.\n * @public\n */\n export type BaseCommitSummaryMarkupEnum =\n (typeof BaseCommitSummaryMarkupEnum)[keyof typeof BaseCommitSummaryMarkupEnum];\n\n /**\n * A branch object, representing a branch in a repository.\n * @public\n */\n export interface Branch {\n links?: RefLinks;\n /**\n * The name of the ref.\n */\n name?: string;\n target?: Commit;\n type: string;\n /**\n * The default merge strategy for pull requests targeting this branch.\n */\n default_merge_strategy?: string;\n /**\n * Available merge strategies for pull requests targeting this branch.\n */\n merge_strategies?: Array<BranchMergeStrategiesEnum>;\n }\n\n /**\n * Available merge strategies for pull requests targeting this branch.\n * @public\n */\n export const BranchMergeStrategiesEnum = {\n MergeCommit: 'merge_commit',\n Squash: 'squash',\n FastForward: 'fast_forward',\n SquashFastForward: 'squash_fast_forward',\n RebaseFastForward: 'rebase_fast_forward',\n RebaseMerge: 'rebase_merge',\n } as const;\n\n /**\n * Available merge strategies for pull requests targeting this branch.\n * @public\n */\n export type BranchMergeStrategiesEnum =\n (typeof BranchMergeStrategiesEnum)[keyof typeof BranchMergeStrategiesEnum];\n\n /**\n * A repository commit object.\n * @public\n */\n export interface Commit extends BaseCommit {\n participants?: Array<Participant>;\n repository?: Repository;\n }\n\n /**\n * A file object, representing a file at a commit in a repository\n * @public\n */\n export interface CommitFile {\n [key: string]: unknown;\n attributes?: CommitFileAttributesEnum;\n commit?: Commit;\n /**\n * The escaped version of the path as it appears in a diff. If the path does not require escaping this will be the same as path.\n */\n escaped_path?: string;\n /**\n * The path in the repository\n */\n path?: string;\n type: string;\n }\n\n /**\n * @public\n */\n export const CommitFileAttributesEnum = {\n Link: 'link',\n Executable: 'executable',\n Subrepository: 'subrepository',\n Binary: 'binary',\n Lfs: 'lfs',\n } as const;\n\n /**\n * @public\n */\n export type CommitFileAttributesEnum =\n (typeof CommitFileAttributesEnum)[keyof typeof CommitFileAttributesEnum];\n\n /**\n * The committer of a change in a repository\n * @public\n */\n export interface Committer extends ModelObject {\n /**\n * The raw committer value from the repository. This may be the only value available if the committer does not match a user in Bitbucket.\n */\n raw?: string;\n user?: Account;\n }\n\n /**\n * A link to a resource related to this object.\n * @public\n */\n export interface Link {\n href?: string;\n name?: string;\n }\n\n /**\n * Base type for most resource objects. It defines the common `type` element that identifies an object's type. It also identifies the element as Swagger's `discriminator`.\n * @public\n */\n export interface ModelObject {\n [key: string]: unknown;\n type: string;\n }\n\n /**\n * A generic paginated list.\n * @public\n */\n export interface Paginated<TResultItem> {\n /**\n * Link to the next page if it exists. The last page of a collection does not have this value. Use this link to navigate the result set and refrain from constructing your own URLs.\n */\n next?: string;\n /**\n * Page number of the current results. This is an optional element that is not provided in all responses.\n */\n page?: number;\n /**\n * Current number of objects on the existing page. The default value is 10 with 100 being the maximum allowed value. Individual APIs may enforce different values.\n */\n pagelen?: number;\n /**\n * Link to previous page if it exists. A collections first page does not have this value. This is an optional element that is not provided in all responses. Some result sets strictly support forward navigation and never provide previous links. Clients must anticipate that backwards navigation is not always available. Use this link to navigate the result set and refrain from constructing your own URLs.\n */\n previous?: string;\n /**\n * Total number of objects in the response. This is an optional element that is not provided in all responses, as it can be expensive to compute.\n */\n size?: number;\n /**\n * The values of the current page.\n */\n values?: Array<TResultItem> | Set<TResultItem>;\n }\n\n /**\n * A paginated list of branches.\n * @public\n */\n export interface PaginatedBranches extends Paginated<Branch> {\n /**\n * The values of the current page.\n */\n values?: Set<Branch>;\n }\n\n /**\n * A paginated list of projects\n * @public\n */\n export interface PaginatedProjects extends Paginated<Project> {\n /**\n * The values of the current page.\n */\n values?: Set<Project>;\n }\n\n /**\n * A paginated list of repositories.\n * @public\n */\n export interface PaginatedRepositories extends Paginated<Repository> {\n /**\n * The values of the current page.\n */\n values?: Set<Repository>;\n }\n\n /**\n * A paginated list of workspaces.\n * @public\n */\n export interface PaginatedWorkspaces extends Paginated<Workspace> {\n /**\n * The values of the current page.\n */\n values?: Set<Workspace>;\n }\n\n /**\n * Object describing a user's role on resources like commits or pull requests.\n * @public\n */\n export interface Participant extends ModelObject {\n approved?: boolean;\n /**\n * The ISO8601 timestamp of the participant's action. For approvers, this is the time of their approval. For commenters and pull request reviewers who are not approvers, this is the time they last commented, or null if they have not commented.\n */\n participated_on?: string;\n role?: ParticipantRoleEnum;\n state?: ParticipantStateEnum;\n user?: Account;\n }\n\n /**\n * @public\n */\n export const ParticipantRoleEnum = {\n Participant: 'PARTICIPANT',\n Reviewer: 'REVIEWER',\n } as const;\n\n /**\n * @public\n */\n export type ParticipantRoleEnum =\n (typeof ParticipantRoleEnum)[keyof typeof ParticipantRoleEnum];\n\n /**\n * @public\n */\n export const ParticipantStateEnum = {\n Approved: 'approved',\n ChangesRequested: 'changes_requested',\n Null: 'null',\n } as const;\n\n /**\n * @public\n */\n export type ParticipantStateEnum =\n (typeof ParticipantStateEnum)[keyof typeof ParticipantStateEnum];\n\n /**\n * A Bitbucket project.\n * Projects are used by teams to organize repositories.\n * @public\n */\n export interface Project extends ModelObject {\n created_on?: string;\n description?: string;\n /**\n *\n * Indicates whether the project contains publicly visible repositories.\n * Note that private projects cannot contain public repositories.\n */\n has_publicly_visible_repos?: boolean;\n /**\n *\n * Indicates whether the project is publicly accessible, or whether it is\n * private to the team and consequently only visible to team members.\n * Note that private projects cannot contain public repositories.\n */\n is_private?: boolean;\n /**\n * The project's key.\n */\n key?: string;\n links?: ProjectLinks;\n /**\n * The name of the project.\n */\n name?: string;\n owner?: Team;\n updated_on?: string;\n /**\n * The project's immutable id.\n */\n uuid?: string;\n }\n\n /**\n * @public\n */\n export interface ProjectLinks {\n avatar?: Link;\n html?: Link;\n }\n\n /**\n * @public\n */\n export interface RefLinks {\n commits?: Link;\n html?: Link;\n self?: Link;\n }\n\n /**\n * A Bitbucket repository.\n * @public\n */\n export interface Repository extends ModelObject {\n created_on?: string;\n description?: string;\n /**\n *\n * Controls the rules for forking this repository.\n *\n * * **allow_forks**: unrestricted forking\n * * **no_public_forks**: restrict forking to private forks (forks cannot\n * be made public later)\n * * **no_forks**: deny all forking\n */\n fork_policy?: RepositoryForkPolicyEnum;\n /**\n * The concatenation of the repository owner's username and the slugified name, e.g. \"evzijst/interruptingcow\". This is the same string used in Bitbucket URLs.\n */\n full_name?: string;\n /**\n *\n * The issue tracker for this repository is enabled. Issue Tracker\n * features are not supported for repositories in workspaces\n * administered through admin.atlassian.com.\n */\n has_issues?: boolean;\n /**\n *\n * The wiki for this repository is enabled. Wiki\n * features are not supported for repositories in workspaces\n * administered through admin.atlassian.com.\n */\n has_wiki?: boolean;\n is_private?: boolean;\n language?: string;\n links?: RepositoryLinks;\n mainbranch?: Branch;\n name?: string;\n owner?: Account;\n parent?: Repository;\n project?: Project;\n scm?: RepositoryScmEnum;\n size?: number;\n /**\n * The \"sluggified\" version of the repository's name. This contains only ASCII characters and can therefore be slightly different than the name\n */\n slug?: string;\n updated_on?: string;\n /**\n * The repository's immutable id. This can be used as a substitute for the slug segment in URLs. Doing this guarantees your URLs will survive renaming of the repository by its owner, or even transfer of the repository to a different user.\n */\n uuid?: string;\n }\n\n /**\n *\n * Controls the rules for forking this repository.\n *\n * * **allow_forks**: unrestricted forking\n * * **no_public_forks**: restrict forking to private forks (forks cannot\n * be made public later)\n * * **no_forks**: deny all forking\n * @public\n */\n export const RepositoryForkPolicyEnum = {\n AllowForks: 'allow_forks',\n NoPublicForks: 'no_public_forks',\n NoForks: 'no_forks',\n } as const;\n\n /**\n *\n * Controls the rules for forking this repository.\n *\n * * **allow_forks**: unrestricted forking\n * * **no_public_forks**: restrict forking to private forks (forks cannot\n * be made public later)\n * * **no_forks**: deny all forking\n * @public\n */\n export type RepositoryForkPolicyEnum =\n (typeof RepositoryForkPolicyEnum)[keyof typeof RepositoryForkPolicyEnum];\n\n /**\n * @public\n */\n export const RepositoryScmEnum = {\n Git: 'git',\n } as const;\n\n /**\n * @public\n */\n export type RepositoryScmEnum =\n (typeof RepositoryScmEnum)[keyof typeof RepositoryScmEnum];\n\n /**\n * @public\n */\n export interface RepositoryLinks {\n avatar?: Link;\n clone?: Array<Link>;\n commits?: Link;\n downloads?: Link;\n forks?: Link;\n hooks?: Link;\n html?: Link;\n pullrequests?: Link;\n self?: Link;\n watchers?: Link;\n }\n\n /**\n * @public\n */\n export interface SearchCodeSearchResult {\n readonly content_match_count?: number;\n readonly content_matches?: Array<SearchContentMatch>;\n file?: CommitFile;\n readonly path_matches?: Array<SearchSegment>;\n readonly type?: string;\n }\n\n /**\n * @public\n */\n export interface SearchContentMatch {\n readonly lines?: Array<SearchLine>;\n }\n\n /**\n * @public\n */\n export interface SearchLine {\n readonly line?: number;\n readonly segments?: Array<SearchSegment>;\n }\n\n /**\n * @public\n */\n export interface SearchResultPage extends Paginated<SearchCodeSearchResult> {\n readonly query_substituted?: boolean;\n /**\n * The values of the current page.\n */\n readonly values?: Array<SearchCodeSearchResult>;\n }\n\n /**\n * @public\n */\n export interface SearchSegment {\n readonly match?: boolean;\n readonly text?: string;\n }\n\n /**\n * A team object.\n * @public\n */\n export interface Team extends Account {\n links?: TeamLinks;\n }\n\n /**\n * Links related to a Team.\n * @public\n */\n export interface TeamLinks extends AccountLinks {\n html?: Link;\n members?: Link;\n projects?: Link;\n repositories?: Link;\n self?: Link;\n }\n\n /**\n * A Bitbucket workspace.\n * Workspaces are used to organize repositories.\n * @public\n */\n export interface Workspace extends ModelObject {\n created_on?: string;\n /**\n * Controls the rules for forking repositories within this workspace.\n *\n * * **allow_forks**: unrestricted forking\n * * **internal_only**: prevents forking of private repositories outside the workspace or to public repositories\n */\n forking_mode?: WorkspaceForkingModeEnum;\n /**\n * Indicates whether the workspace enforces private content, or whether it allows public content.\n */\n is_privacy_enforced?: boolean;\n /**\n * Indicates whether the workspace is publicly accessible, or whether it is\n * private to the members and consequently only visible to members.\n */\n is_private?: boolean;\n links?: WorkspaceLinks;\n /**\n * The name of the workspace.\n */\n name?: string;\n /**\n * The short label that identifies this workspace.\n */\n slug?: string;\n updated_on?: string;\n /**\n * The workspace's immutable id.\n */\n uuid?: string;\n }\n\n /**\n * Controls the rules for forking repositories within this workspace.\n *\n * * **allow_forks**: unrestricted forking\n * * **internal_only**: prevents forking of private repositories outside the workspace or to public repositories\n * @public\n */\n export const WorkspaceForkingModeEnum = {\n AllowForks: 'allow_forks',\n InternalOnly: 'internal_only',\n } as const;\n\n /**\n * Controls the rules for forking repositories within this workspace.\n *\n * * **allow_forks**: unrestricted forking\n * * **internal_only**: prevents forking of private repositories outside the workspace or to public repositories\n * @public\n */\n export type WorkspaceForkingModeEnum =\n (typeof WorkspaceForkingModeEnum)[keyof typeof WorkspaceForkingModeEnum];\n\n /**\n * @public\n */\n export interface WorkspaceLinks {\n avatar?: Link;\n html?: Link;\n members?: Link;\n owners?: Link;\n projects?: Link;\n repositories?: Link;\n self?: Link;\n snippets?: Link;\n }\n}\n"],"names":["Models"],"mappings":"AA6BO,IAAU;AAAA,CAAV,CAAUA,OAAAA,KAAV;AAqEE,EAAMA,QAAA,2BAAA,GAA8B;AAAA,IACzC,QAAA,EAAU,UAAA;AAAA,IACV,MAAA,EAAQ,QAAA;AAAA,IACR,SAAA,EAAW;AAAA,GACb;AAmCO,EAAMA,QAAA,yBAAA,GAA4B;AAAA,IACvC,WAAA,EAAa,cAAA;AAAA,IACb,MAAA,EAAQ,QAAA;AAAA,IACR,WAAA,EAAa,cAAA;AAAA,IACb,iBAAA,EAAmB,qBAAA;AAAA,IACnB,iBAAA,EAAmB,qBAAA;AAAA,IACnB,WAAA,EAAa;AAAA,GACf;AAwCO,EAAMA,QAAA,wBAAA,GAA2B;AAAA,IACtC,IAAA,EAAM,MAAA;AAAA,IACN,UAAA,EAAY,YAAA;AAAA,IACZ,aAAA,EAAe,eAAA;AAAA,IACf,MAAA,EAAQ,QAAA;AAAA,IACR,GAAA,EAAK;AAAA,GACP;AAmIO,EAAMA,QAAA,mBAAA,GAAsB;AAAA,IACjC,WAAA,EAAa,aAAA;AAAA,IACb,QAAA,EAAU;AAAA,GACZ;AAWO,EAAMA,QAAA,oBAAA,GAAuB;AAAA,IAClC,QAAA,EAAU,UAAA;AAAA,IACV,gBAAA,EAAkB,mBAAA;AAAA,IAClB,IAAA,EAAM;AAAA,GACR;AAiIO,EAAMA,QAAA,wBAAA,GAA2B;AAAA,IACtC,UAAA,EAAY,aAAA;AAAA,IACZ,aAAA,EAAe,iBAAA;AAAA,IACf,OAAA,EAAS;AAAA,GACX;AAkBO,EAAMA,QAAA,iBAAA,GAAoB;AAAA,IAC/B,GAAA,EAAK;AAAA,GACP;AAuIO,EAAMA,QAAA,wBAAA,GAA2B;AAAA,IACtC,UAAA,EAAY,aAAA;AAAA,IACZ,YAAA,EAAc;AAAA,GAChB;AAAA,CAAA,EAzlBe,MAAA,KAAA,MAAA,GAAA,EAAA,CAAA,CAAA;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.cjs.js","sources":["../src/pagination.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Models } from './models';\n\n/** @public */\nexport type PaginationOptions = {\n page?: number;\n pagelen?: number;\n};\n\n/** @public */\nexport class WithPagination<\n TPage extends Models.Paginated<TResultItem>,\n TResultItem,\n> {\n constructor(\n private readonly createUrl: (options: PaginationOptions) => URL,\n private readonly fetch: (url: URL) => Promise<TPage>,\n ) {}\n\n getPage(options?: PaginationOptions): Promise<TPage> {\n const opts = { page: 1, pagelen: 100, ...options };\n const url = this.createUrl(opts);\n return this.fetch(url);\n }\n\n async *iteratePages(\n options?: PaginationOptions,\n ): AsyncGenerator<TPage, void> {\n const opts = { page: 1, pagelen: 100, ...options };\n let url: URL | undefined = this.createUrl(opts);\n let res;\n do {\n res = await this.fetch(url);\n url = res.next ? new URL(res.next) : undefined;\n yield res;\n } while (url);\n }\n\n async *iterateResults(options?: PaginationOptions) {\n const opts = { page: 1, pagelen: 100, ...options };\n let url: URL | undefined = this.createUrl(opts);\n let res;\n do {\n res = await this.fetch(url);\n url = res.next ? new URL(res.next) : undefined;\n for (const item of res.values ?? []) {\n yield item;\n }\n } while (url);\n }\n}\n"],"names":[],"mappings":";;AAyBO,MAAM,cAGX,CAAA;AAAA,EACA,WAAA,CACmB,WACA,KACjB,EAAA;AAFiB,IAAA,IAAA,CAAA,SAAA,GAAA,SAAA;AACA,IAAA,IAAA,CAAA,KAAA,GAAA,KAAA;AAAA;AAChB,EAEH,QAAQ,OAA6C,EAAA;AACnD,IAAA,MAAM,OAAO,EAAE,IAAA,EAAM,GAAG,OAAS,EAAA,GAAA,EAAK,GAAG,OAAQ,EAAA;AACjD,IAAM,MAAA,GAAA,GAAM,IAAK,CAAA,SAAA,CAAU,IAAI,CAAA;AAC/B,IAAO,OAAA,IAAA,CAAK,MAAM,GAAG,CAAA;AAAA;AACvB,EAEA,OAAO,aACL,OAC6B,EAAA;AAC7B,IAAA,MAAM,OAAO,EAAE,IAAA,EAAM,GAAG,OAAS,EAAA,GAAA,EAAK,GAAG,OAAQ,EAAA;AACjD,IAAI,IAAA,GAAA,GAAuB,IAAK,CAAA,SAAA,CAAU,IAAI,CAAA;AAC9C,IAAI,IAAA,GAAA;AACJ,IAAG,GAAA;AACD,MAAM,GAAA,GAAA,MAAM,IAAK,CAAA,KAAA,CAAM,GAAG,CAAA;AAC1B,MAAA,GAAA,GAAM,IAAI,IAAO,GAAA,IAAI,GAAI,CAAA,GAAA,CAAI,IAAI,CAAI,GAAA,KAAA,CAAA;AACrC,MAAM,MAAA,GAAA;AAAA,KACC,QAAA,GAAA;AAAA;AACX,EAEA,OAAO,eAAe,OAA6B,EAAA;AACjD,IAAA,MAAM,OAAO,EAAE,IAAA,EAAM,GAAG,OAAS,EAAA,GAAA,EAAK,GAAG,OAAQ,EAAA;AACjD,IAAI,IAAA,GAAA,GAAuB,IAAK,CAAA,SAAA,CAAU,IAAI,CAAA;AAC9C,IAAI,IAAA,GAAA;AACJ,IAAG,GAAA;AACD,MAAM,GAAA,GAAA,MAAM,IAAK,CAAA,KAAA,CAAM,GAAG,CAAA;AAC1B,MAAA,GAAA,GAAM,IAAI,IAAO,GAAA,IAAI,GAAI,CAAA,GAAA,CAAI,IAAI,CAAI,GAAA,KAAA,CAAA;AACrC,MAAA,KAAA,MAAW,IAAQ,IAAA,GAAA,CAAI,MAAU,IAAA,EAAI,EAAA;AACnC,QAAM,MAAA,IAAA;AAAA;AACR,KACO,QAAA,GAAA;AAAA;AAEb;;;;"}
1
+ {"version":3,"file":"pagination.cjs.js","sources":["../src/pagination.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Models } from './models';\n\n/** @public */\nexport type PaginationOptions = {\n page?: number;\n pagelen?: number;\n};\n\n/** @public */\nexport class WithPagination<\n TPage extends Models.Paginated<TResultItem>,\n TResultItem,\n> {\n constructor(\n private readonly createUrl: (options: PaginationOptions) => URL,\n private readonly fetch: (url: URL) => Promise<TPage>,\n ) {}\n\n getPage(options?: PaginationOptions): Promise<TPage> {\n const opts = { page: 1, pagelen: 100, ...options };\n const url = this.createUrl(opts);\n return this.fetch(url);\n }\n\n async *iteratePages(\n options?: PaginationOptions,\n ): AsyncGenerator<TPage, void> {\n const opts = { page: 1, pagelen: 100, ...options };\n let url: URL | undefined = this.createUrl(opts);\n let res;\n do {\n res = await this.fetch(url);\n url = res.next ? new URL(res.next) : undefined;\n yield res;\n } while (url);\n }\n\n async *iterateResults(options?: PaginationOptions) {\n const opts = { page: 1, pagelen: 100, ...options };\n let url: URL | undefined = this.createUrl(opts);\n let res;\n do {\n res = await this.fetch(url);\n url = res.next ? new URL(res.next) : undefined;\n for (const item of res.values ?? []) {\n yield item;\n }\n } while (url);\n }\n}\n"],"names":[],"mappings":";;AAyBO,MAAM,cAAA,CAGX;AAAA,EACA,WAAA,CACmB,WACA,KAAA,EACjB;AAFiB,IAAA,IAAA,CAAA,SAAA,GAAA,SAAA;AACA,IAAA,IAAA,CAAA,KAAA,GAAA,KAAA;AAAA,EAChB;AAAA,EAEH,QAAQ,OAAA,EAA6C;AACnD,IAAA,MAAM,OAAO,EAAE,IAAA,EAAM,GAAG,OAAA,EAAS,GAAA,EAAK,GAAG,OAAA,EAAQ;AACjD,IAAA,MAAM,GAAA,GAAM,IAAA,CAAK,SAAA,CAAU,IAAI,CAAA;AAC/B,IAAA,OAAO,IAAA,CAAK,MAAM,GAAG,CAAA;AAAA,EACvB;AAAA,EAEA,OAAO,aACL,OAAA,EAC6B;AAC7B,IAAA,MAAM,OAAO,EAAE,IAAA,EAAM,GAAG,OAAA,EAAS,GAAA,EAAK,GAAG,OAAA,EAAQ;AACjD,IAAA,IAAI,GAAA,GAAuB,IAAA,CAAK,SAAA,CAAU,IAAI,CAAA;AAC9C,IAAA,IAAI,GAAA;AACJ,IAAA,GAAG;AACD,MAAA,GAAA,GAAM,MAAM,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA;AAC1B,MAAA,GAAA,GAAM,IAAI,IAAA,GAAO,IAAI,GAAA,CAAI,GAAA,CAAI,IAAI,CAAA,GAAI,MAAA;AACrC,MAAA,MAAM,GAAA;AAAA,IACR,CAAA,QAAS,GAAA;AAAA,EACX;AAAA,EAEA,OAAO,eAAe,OAAA,EAA6B;AACjD,IAAA,MAAM,OAAO,EAAE,IAAA,EAAM,GAAG,OAAA,EAAS,GAAA,EAAK,GAAG,OAAA,EAAQ;AACjD,IAAA,IAAI,GAAA,GAAuB,IAAA,CAAK,SAAA,CAAU,IAAI,CAAA;AAC9C,IAAA,IAAI,GAAA;AACJ,IAAA,GAAG;AACD,MAAA,GAAA,GAAM,MAAM,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA;AAC1B,MAAA,GAAA,GAAM,IAAI,IAAA,GAAO,IAAI,GAAA,CAAI,GAAA,CAAI,IAAI,CAAA,GAAI,MAAA;AACrC,MAAA,KAAA,MAAW,IAAA,IAAQ,GAAA,CAAI,MAAA,IAAU,EAAC,EAAG;AACnC,QAAA,MAAM,IAAA;AAAA,MACR;AAAA,IACF,CAAA,QAAS,GAAA;AAAA,EACX;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"pagination.esm.js","sources":["../src/pagination.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Models } from './models';\n\n/** @public */\nexport type PaginationOptions = {\n page?: number;\n pagelen?: number;\n};\n\n/** @public */\nexport class WithPagination<\n TPage extends Models.Paginated<TResultItem>,\n TResultItem,\n> {\n constructor(\n private readonly createUrl: (options: PaginationOptions) => URL,\n private readonly fetch: (url: URL) => Promise<TPage>,\n ) {}\n\n getPage(options?: PaginationOptions): Promise<TPage> {\n const opts = { page: 1, pagelen: 100, ...options };\n const url = this.createUrl(opts);\n return this.fetch(url);\n }\n\n async *iteratePages(\n options?: PaginationOptions,\n ): AsyncGenerator<TPage, void> {\n const opts = { page: 1, pagelen: 100, ...options };\n let url: URL | undefined = this.createUrl(opts);\n let res;\n do {\n res = await this.fetch(url);\n url = res.next ? new URL(res.next) : undefined;\n yield res;\n } while (url);\n }\n\n async *iterateResults(options?: PaginationOptions) {\n const opts = { page: 1, pagelen: 100, ...options };\n let url: URL | undefined = this.createUrl(opts);\n let res;\n do {\n res = await this.fetch(url);\n url = res.next ? new URL(res.next) : undefined;\n for (const item of res.values ?? []) {\n yield item;\n }\n } while (url);\n }\n}\n"],"names":[],"mappings":"AAyBO,MAAM,cAGX,CAAA;AAAA,EACA,WAAA,CACmB,WACA,KACjB,EAAA;AAFiB,IAAA,IAAA,CAAA,SAAA,GAAA,SAAA;AACA,IAAA,IAAA,CAAA,KAAA,GAAA,KAAA;AAAA;AAChB,EAEH,QAAQ,OAA6C,EAAA;AACnD,IAAA,MAAM,OAAO,EAAE,IAAA,EAAM,GAAG,OAAS,EAAA,GAAA,EAAK,GAAG,OAAQ,EAAA;AACjD,IAAM,MAAA,GAAA,GAAM,IAAK,CAAA,SAAA,CAAU,IAAI,CAAA;AAC/B,IAAO,OAAA,IAAA,CAAK,MAAM,GAAG,CAAA;AAAA;AACvB,EAEA,OAAO,aACL,OAC6B,EAAA;AAC7B,IAAA,MAAM,OAAO,EAAE,IAAA,EAAM,GAAG,OAAS,EAAA,GAAA,EAAK,GAAG,OAAQ,EAAA;AACjD,IAAI,IAAA,GAAA,GAAuB,IAAK,CAAA,SAAA,CAAU,IAAI,CAAA;AAC9C,IAAI,IAAA,GAAA;AACJ,IAAG,GAAA;AACD,MAAM,GAAA,GAAA,MAAM,IAAK,CAAA,KAAA,CAAM,GAAG,CAAA;AAC1B,MAAA,GAAA,GAAM,IAAI,IAAO,GAAA,IAAI,GAAI,CAAA,GAAA,CAAI,IAAI,CAAI,GAAA,KAAA,CAAA;AACrC,MAAM,MAAA,GAAA;AAAA,KACC,QAAA,GAAA;AAAA;AACX,EAEA,OAAO,eAAe,OAA6B,EAAA;AACjD,IAAA,MAAM,OAAO,EAAE,IAAA,EAAM,GAAG,OAAS,EAAA,GAAA,EAAK,GAAG,OAAQ,EAAA;AACjD,IAAI,IAAA,GAAA,GAAuB,IAAK,CAAA,SAAA,CAAU,IAAI,CAAA;AAC9C,IAAI,IAAA,GAAA;AACJ,IAAG,GAAA;AACD,MAAM,GAAA,GAAA,MAAM,IAAK,CAAA,KAAA,CAAM,GAAG,CAAA;AAC1B,MAAA,GAAA,GAAM,IAAI,IAAO,GAAA,IAAI,GAAI,CAAA,GAAA,CAAI,IAAI,CAAI,GAAA,KAAA,CAAA;AACrC,MAAA,KAAA,MAAW,IAAQ,IAAA,GAAA,CAAI,MAAU,IAAA,EAAI,EAAA;AACnC,QAAM,MAAA,IAAA;AAAA;AACR,KACO,QAAA,GAAA;AAAA;AAEb;;;;"}
1
+ {"version":3,"file":"pagination.esm.js","sources":["../src/pagination.ts"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { Models } from './models';\n\n/** @public */\nexport type PaginationOptions = {\n page?: number;\n pagelen?: number;\n};\n\n/** @public */\nexport class WithPagination<\n TPage extends Models.Paginated<TResultItem>,\n TResultItem,\n> {\n constructor(\n private readonly createUrl: (options: PaginationOptions) => URL,\n private readonly fetch: (url: URL) => Promise<TPage>,\n ) {}\n\n getPage(options?: PaginationOptions): Promise<TPage> {\n const opts = { page: 1, pagelen: 100, ...options };\n const url = this.createUrl(opts);\n return this.fetch(url);\n }\n\n async *iteratePages(\n options?: PaginationOptions,\n ): AsyncGenerator<TPage, void> {\n const opts = { page: 1, pagelen: 100, ...options };\n let url: URL | undefined = this.createUrl(opts);\n let res;\n do {\n res = await this.fetch(url);\n url = res.next ? new URL(res.next) : undefined;\n yield res;\n } while (url);\n }\n\n async *iterateResults(options?: PaginationOptions) {\n const opts = { page: 1, pagelen: 100, ...options };\n let url: URL | undefined = this.createUrl(opts);\n let res;\n do {\n res = await this.fetch(url);\n url = res.next ? new URL(res.next) : undefined;\n for (const item of res.values ?? []) {\n yield item;\n }\n } while (url);\n }\n}\n"],"names":[],"mappings":"AAyBO,MAAM,cAAA,CAGX;AAAA,EACA,WAAA,CACmB,WACA,KAAA,EACjB;AAFiB,IAAA,IAAA,CAAA,SAAA,GAAA,SAAA;AACA,IAAA,IAAA,CAAA,KAAA,GAAA,KAAA;AAAA,EAChB;AAAA,EAEH,QAAQ,OAAA,EAA6C;AACnD,IAAA,MAAM,OAAO,EAAE,IAAA,EAAM,GAAG,OAAA,EAAS,GAAA,EAAK,GAAG,OAAA,EAAQ;AACjD,IAAA,MAAM,GAAA,GAAM,IAAA,CAAK,SAAA,CAAU,IAAI,CAAA;AAC/B,IAAA,OAAO,IAAA,CAAK,MAAM,GAAG,CAAA;AAAA,EACvB;AAAA,EAEA,OAAO,aACL,OAAA,EAC6B;AAC7B,IAAA,MAAM,OAAO,EAAE,IAAA,EAAM,GAAG,OAAA,EAAS,GAAA,EAAK,GAAG,OAAA,EAAQ;AACjD,IAAA,IAAI,GAAA,GAAuB,IAAA,CAAK,SAAA,CAAU,IAAI,CAAA;AAC9C,IAAA,IAAI,GAAA;AACJ,IAAA,GAAG;AACD,MAAA,GAAA,GAAM,MAAM,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA;AAC1B,MAAA,GAAA,GAAM,IAAI,IAAA,GAAO,IAAI,GAAA,CAAI,GAAA,CAAI,IAAI,CAAA,GAAI,MAAA;AACrC,MAAA,MAAM,GAAA;AAAA,IACR,CAAA,QAAS,GAAA;AAAA,EACX;AAAA,EAEA,OAAO,eAAe,OAAA,EAA6B;AACjD,IAAA,MAAM,OAAO,EAAE,IAAA,EAAM,GAAG,OAAA,EAAS,GAAA,EAAK,GAAG,OAAA,EAAQ;AACjD,IAAA,IAAI,GAAA,GAAuB,IAAA,CAAK,SAAA,CAAU,IAAI,CAAA;AAC9C,IAAA,IAAI,GAAA;AACJ,IAAA,GAAG;AACD,MAAA,GAAA,GAAM,MAAM,IAAA,CAAK,KAAA,CAAM,GAAG,CAAA;AAC1B,MAAA,GAAA,GAAM,IAAI,IAAA,GAAO,IAAI,GAAA,CAAI,GAAA,CAAI,IAAI,CAAA,GAAI,MAAA;AACrC,MAAA,KAAA,MAAW,IAAA,IAAQ,GAAA,CAAI,MAAA,IAAU,EAAC,EAAG;AACnC,QAAA,MAAM,IAAA;AAAA,MACR;AAAA,IACF,CAAA,QAAS,GAAA;AAAA,EACX;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-bitbucket-cloud-common",
3
- "version": "0.3.1-next.0",
3
+ "version": "0.3.2-next.0",
4
4
  "description": "Common functionalities for bitbucket-cloud plugins",
5
5
  "backstage": {
6
6
  "role": "common-library",
@@ -41,11 +41,11 @@
41
41
  "update-models": "yarn refresh-schema && yarn generate-models && yarn reduce-models"
42
42
  },
43
43
  "dependencies": {
44
- "@backstage/integration": "1.17.1-next.0",
44
+ "@backstage/integration": "1.18.0-next.0",
45
45
  "cross-fetch": "^4.0.0"
46
46
  },
47
47
  "devDependencies": {
48
- "@backstage/cli": "0.33.1-next.0",
48
+ "@backstage/cli": "0.34.2-next.1",
49
49
  "@openapitools/openapi-generator-cli": "^2.4.26",
50
50
  "msw": "^1.0.0",
51
51
  "ts-morph": "^24.0.0"