specweave 0.24.8 → 0.24.11

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (132) hide show
  1. package/dist/src/cli/commands/init.d.ts.map +1 -1
  2. package/dist/src/cli/commands/init.js +3 -1
  3. package/dist/src/cli/commands/init.js.map +1 -1
  4. package/dist/src/cli/helpers/issue-tracker/github-multi-repo.d.ts.map +1 -1
  5. package/dist/src/cli/helpers/issue-tracker/github-multi-repo.js +18 -2
  6. package/dist/src/cli/helpers/issue-tracker/github-multi-repo.js.map +1 -1
  7. package/dist/src/cli/helpers/issue-tracker/index.js +4 -4
  8. package/dist/src/cli/helpers/issue-tracker/index.js.map +1 -1
  9. package/dist/src/core/repo-structure/git-error-handler.d.ts +1 -1
  10. package/dist/src/core/repo-structure/git-error-handler.d.ts.map +1 -1
  11. package/dist/src/core/repo-structure/git-provider.d.ts +1 -1
  12. package/dist/src/core/repo-structure/git-provider.d.ts.map +1 -1
  13. package/dist/src/core/repo-structure/platform-registry.d.ts.map +1 -1
  14. package/dist/src/core/repo-structure/platform-registry.js +20 -9
  15. package/dist/src/core/repo-structure/platform-registry.js.map +1 -1
  16. package/dist/src/core/repo-structure/prompt-consolidator.d.ts +13 -1
  17. package/dist/src/core/repo-structure/prompt-consolidator.d.ts.map +1 -1
  18. package/dist/src/core/repo-structure/prompt-consolidator.js +38 -5
  19. package/dist/src/core/repo-structure/prompt-consolidator.js.map +1 -1
  20. package/dist/src/core/repo-structure/providers/azure-devops-provider.d.ts +64 -0
  21. package/dist/src/core/repo-structure/providers/azure-devops-provider.d.ts.map +1 -0
  22. package/dist/src/core/repo-structure/providers/azure-devops-provider.js +263 -0
  23. package/dist/src/core/repo-structure/providers/azure-devops-provider.js.map +1 -0
  24. package/dist/src/core/repo-structure/providers/bitbucket-provider.d.ts +12 -11
  25. package/dist/src/core/repo-structure/providers/bitbucket-provider.d.ts.map +1 -1
  26. package/dist/src/core/repo-structure/providers/bitbucket-provider.js +164 -30
  27. package/dist/src/core/repo-structure/providers/bitbucket-provider.js.map +1 -1
  28. package/dist/src/core/repo-structure/providers/gitlab-provider.d.ts +10 -9
  29. package/dist/src/core/repo-structure/providers/gitlab-provider.d.ts.map +1 -1
  30. package/dist/src/core/repo-structure/providers/gitlab-provider.js +182 -28
  31. package/dist/src/core/repo-structure/providers/gitlab-provider.js.map +1 -1
  32. package/dist/src/core/repo-structure/providers/index.d.ts +3 -1
  33. package/dist/src/core/repo-structure/providers/index.d.ts.map +1 -1
  34. package/dist/src/core/repo-structure/providers/index.js +10 -2
  35. package/dist/src/core/repo-structure/providers/index.js.map +1 -1
  36. package/dist/src/core/repo-structure/providers/local-provider.d.ts +61 -0
  37. package/dist/src/core/repo-structure/providers/local-provider.d.ts.map +1 -0
  38. package/dist/src/core/repo-structure/providers/local-provider.js +148 -0
  39. package/dist/src/core/repo-structure/providers/local-provider.js.map +1 -0
  40. package/dist/src/core/repo-structure/repo-structure-manager.d.ts +11 -1
  41. package/dist/src/core/repo-structure/repo-structure-manager.d.ts.map +1 -1
  42. package/dist/src/core/repo-structure/repo-structure-manager.js +268 -84
  43. package/dist/src/core/repo-structure/repo-structure-manager.js.map +1 -1
  44. package/package.json +1 -1
  45. package/plugins/specweave/agents/pm/AGENT.md.bak +1893 -0
  46. package/plugins/specweave/hooks/docs-changed.sh.backup +79 -0
  47. package/plugins/specweave/hooks/human-input-required.sh.backup +75 -0
  48. package/plugins/specweave/hooks/lib/migrate-increment-work.sh.bak +245 -0
  49. package/plugins/specweave/hooks/lib/sync-spec-content.sh.bak +149 -0
  50. package/plugins/specweave/hooks/lib/validate-spec-status.sh.bak +163 -0
  51. package/plugins/specweave/hooks/post-first-increment.sh.backup +61 -0
  52. package/plugins/specweave/hooks/post-first-increment.sh.bak +61 -0
  53. package/plugins/specweave/hooks/post-increment-change.sh.backup +98 -0
  54. package/plugins/specweave/hooks/post-increment-completion.sh.backup +231 -0
  55. package/plugins/specweave/hooks/post-increment-planning.sh.backup +1048 -0
  56. package/plugins/specweave/hooks/post-increment-status-change.sh.backup +147 -0
  57. package/plugins/specweave/hooks/post-spec-update.sh.backup +158 -0
  58. package/plugins/specweave/hooks/post-spec-update.sh.bak +158 -0
  59. package/plugins/specweave/hooks/post-task-completion.sh +69 -175
  60. package/plugins/specweave/hooks/post-user-story-complete.sh.backup +179 -0
  61. package/plugins/specweave/hooks/post-user-story-complete.sh.bak +179 -0
  62. package/plugins/specweave/hooks/pre-command-deduplication.sh.backup +83 -0
  63. package/plugins/specweave/hooks/pre-command-deduplication.sh.bak +83 -0
  64. package/plugins/specweave/hooks/pre-implementation.sh.backup +67 -0
  65. package/plugins/specweave/hooks/pre-task-completion.sh.backup +194 -0
  66. package/plugins/specweave/hooks/pre-tool-use.sh.backup +133 -0
  67. package/plugins/specweave/hooks/user-prompt-submit.sh.backup +386 -0
  68. package/plugins/specweave/hooks/user-prompt-submit.sh.bak +386 -0
  69. package/plugins/specweave/lib/hooks/auto-transition.js.bak +50 -0
  70. package/plugins/specweave/lib/hooks/auto-transition.ts.bak +84 -0
  71. package/plugins/specweave/lib/hooks/consolidated-sync.js +183 -0
  72. package/plugins/specweave/lib/hooks/git-diff-analyzer.d.js.bak +0 -0
  73. package/plugins/specweave/lib/hooks/git-diff-analyzer.d.ts.bak +89 -0
  74. package/plugins/specweave/lib/hooks/git-diff-analyzer.js.bak +142 -0
  75. package/plugins/specweave/lib/hooks/git-diff-analyzer.ts.bak +269 -0
  76. package/plugins/specweave/lib/hooks/invoke-translator-skill.d.js.bak +0 -0
  77. package/plugins/specweave/lib/hooks/invoke-translator-skill.d.ts.bak +60 -0
  78. package/plugins/specweave/lib/hooks/invoke-translator-skill.js.bak +155 -0
  79. package/plugins/specweave/lib/hooks/invoke-translator-skill.ts.bak +264 -0
  80. package/plugins/specweave/lib/hooks/prepare-reflection-context.d.js.bak +0 -0
  81. package/plugins/specweave/lib/hooks/prepare-reflection-context.d.ts.bak +42 -0
  82. package/plugins/specweave/lib/hooks/prepare-reflection-context.js.bak +110 -0
  83. package/plugins/specweave/lib/hooks/prepare-reflection-context.ts.bak +178 -0
  84. package/plugins/specweave/lib/hooks/reflection-config-loader.d.js.bak +0 -0
  85. package/plugins/specweave/lib/hooks/reflection-config-loader.d.ts.bak +45 -0
  86. package/plugins/specweave/lib/hooks/reflection-config-loader.js.bak +92 -0
  87. package/plugins/specweave/lib/hooks/reflection-config-loader.ts.bak +156 -0
  88. package/plugins/specweave/lib/hooks/reflection-parser.d.js.bak +0 -0
  89. package/plugins/specweave/lib/hooks/reflection-parser.d.ts.bak +33 -0
  90. package/plugins/specweave/lib/hooks/reflection-parser.js.bak +301 -0
  91. package/plugins/specweave/lib/hooks/reflection-parser.ts.bak +484 -0
  92. package/plugins/specweave/lib/hooks/reflection-prompt-builder.d.js.bak +0 -0
  93. package/plugins/specweave/lib/hooks/reflection-prompt-builder.d.ts.bak +56 -0
  94. package/plugins/specweave/lib/hooks/reflection-prompt-builder.js.bak +182 -0
  95. package/plugins/specweave/lib/hooks/reflection-prompt-builder.ts.bak +306 -0
  96. package/plugins/specweave/lib/hooks/reflection-storage.d.js.bak +0 -0
  97. package/plugins/specweave/lib/hooks/reflection-storage.d.ts.bak +64 -0
  98. package/plugins/specweave/lib/hooks/reflection-storage.js.bak +231 -0
  99. package/plugins/specweave/lib/hooks/reflection-storage.ts.bak +369 -0
  100. package/plugins/specweave/lib/hooks/run-self-reflection.d.js.bak +0 -0
  101. package/plugins/specweave/lib/hooks/run-self-reflection.d.ts.bak +43 -0
  102. package/plugins/specweave/lib/hooks/run-self-reflection.js.bak +132 -0
  103. package/plugins/specweave/lib/hooks/run-self-reflection.ts.bak +258 -0
  104. package/plugins/specweave/lib/hooks/sync-cache.js.bak +294 -0
  105. package/plugins/specweave/lib/hooks/sync-living-docs.d.js.bak +1 -0
  106. package/plugins/specweave/lib/hooks/sync-living-docs.d.ts.bak +27 -0
  107. package/plugins/specweave/lib/hooks/sync-living-docs.js.bak +339 -0
  108. package/plugins/specweave/lib/hooks/sync-us-tasks.js.bak +476 -0
  109. package/plugins/specweave/lib/hooks/translate-file.d.js.bak +0 -0
  110. package/plugins/specweave/lib/hooks/translate-file.d.ts.bak +59 -0
  111. package/plugins/specweave/lib/hooks/translate-file.js.bak +289 -0
  112. package/plugins/specweave/lib/hooks/translate-file.ts.bak +428 -0
  113. package/plugins/specweave/lib/hooks/translate-living-docs.d.js.bak +0 -0
  114. package/plugins/specweave/lib/hooks/translate-living-docs.d.ts.bak +13 -0
  115. package/plugins/specweave/lib/hooks/translate-living-docs.js.bak +119 -0
  116. package/plugins/specweave/lib/hooks/translate-living-docs.ts.bak +224 -0
  117. package/plugins/specweave/lib/hooks/update-ac-status.js.bak +51 -0
  118. package/plugins/specweave/lib/hooks/update-ac-status.ts.bak +103 -0
  119. package/plugins/specweave/lib/hooks/update-tasks-md.d.js.bak +1 -0
  120. package/plugins/specweave/lib/hooks/update-tasks-md.d.ts.bak +29 -0
  121. package/plugins/specweave/lib/hooks/update-tasks-md.js.bak +296 -0
  122. package/plugins/specweave/lib/hooks/update-tasks-md.ts.bak +489 -0
  123. package/plugins/specweave-ado/hooks/post-living-docs-update.sh.backup +353 -0
  124. package/plugins/specweave-ado/hooks/post-task-completion.sh.backup +172 -0
  125. package/plugins/specweave-ado/lib/ado-multi-project-sync.js +1 -0
  126. package/plugins/specweave-ado/lib/enhanced-ado-sync.js +170 -0
  127. package/plugins/specweave-github/hooks/.specweave/logs/hooks-debug.log +424 -0
  128. package/plugins/specweave-github/hooks/post-task-completion.sh.backup +258 -0
  129. package/plugins/specweave-jira/hooks/post-task-completion.sh.backup +172 -0
  130. package/plugins/specweave-jira/lib/enhanced-jira-sync.js +3 -3
  131. package/plugins/specweave-release/hooks/.specweave/logs/dora-tracking.log +540 -0
  132. package/plugins/specweave-release/hooks/post-task-completion.sh.backup +110 -0
@@ -0,0 +1,263 @@
1
+ /**
2
+ * Azure DevOps Provider Implementation
3
+ *
4
+ * Implements GitProvider interface for Azure DevOps Repos.
5
+ * Handles repository validation, creation, and management via Azure DevOps REST API.
6
+ *
7
+ * @module providers/azure-devops-provider
8
+ */
9
+ import { BaseGitProvider } from '../git-provider.js';
10
+ import { getActionableError, formatActionableError } from '../git-error-handler.js';
11
+ /**
12
+ * Azure DevOps Provider
13
+ *
14
+ * Implements Git operations for Azure DevOps platform.
15
+ * Note: Azure DevOps uses organization/project/repository structure.
16
+ * The "owner" parameter typically represents "organization/project".
17
+ */
18
+ export class AzureDevOpsProvider extends BaseGitProvider {
19
+ constructor(config) {
20
+ super({
21
+ type: 'azure-devops',
22
+ name: 'Azure DevOps',
23
+ host: config?.host || 'dev.azure.com',
24
+ apiBaseUrl: config?.apiBaseUrl || 'https://dev.azure.com',
25
+ selfHosted: config?.selfHosted || false,
26
+ customDomain: config?.customDomain
27
+ });
28
+ }
29
+ /**
30
+ * Validate if a repository exists in Azure DevOps
31
+ * owner format: "organization/project"
32
+ */
33
+ async validateRepository(owner, repo, token) {
34
+ try {
35
+ const [organization, project] = this.parseOwner(owner);
36
+ const headers = {
37
+ 'Accept': 'application/json'
38
+ };
39
+ if (token) {
40
+ // Azure DevOps uses Basic Auth with PAT
41
+ const auth = Buffer.from(`:${token}`).toString('base64');
42
+ headers['Authorization'] = `Basic ${auth}`;
43
+ }
44
+ const response = await fetch(`${this.config.apiBaseUrl}/${organization}/${project}/_apis/git/repositories/${repo}?api-version=7.0`, { headers });
45
+ if (response.status === 404) {
46
+ // Repository does not exist (good for creation)
47
+ return { exists: false, valid: true };
48
+ }
49
+ if (response.status === 200) {
50
+ // Repository already exists
51
+ const data = await response.json();
52
+ return {
53
+ exists: true,
54
+ valid: true,
55
+ url: data.webUrl || data.remoteUrl
56
+ };
57
+ }
58
+ if (response.status === 401 || response.status === 403) {
59
+ // Authentication or permission error
60
+ const apiError = {
61
+ status: response.status,
62
+ message: response.statusText,
63
+ platform: 'azure-devops',
64
+ operation: 'validate_repo',
65
+ resourceType: 'repository',
66
+ resourceName: `${organization}/${project}/${repo}`
67
+ };
68
+ const actionable = getActionableError(apiError);
69
+ return { exists: false, valid: false, error: formatActionableError(actionable) };
70
+ }
71
+ // Other error
72
+ const apiError = {
73
+ status: response.status,
74
+ message: response.statusText,
75
+ platform: 'azure-devops',
76
+ operation: 'validate_repo',
77
+ resourceType: 'repository',
78
+ resourceName: `${organization}/${project}/${repo}`
79
+ };
80
+ const actionable = getActionableError(apiError);
81
+ return {
82
+ exists: false,
83
+ valid: false,
84
+ error: formatActionableError(actionable)
85
+ };
86
+ }
87
+ catch (error) {
88
+ return {
89
+ exists: false,
90
+ valid: false,
91
+ error: `Network error: ${error instanceof Error ? error.message : String(error)}`
92
+ };
93
+ }
94
+ }
95
+ /**
96
+ * Validate if an Azure DevOps organization/project exists
97
+ * owner format: "organization/project"
98
+ */
99
+ async validateOwner(owner, token) {
100
+ const headers = {
101
+ 'Accept': 'application/json'
102
+ };
103
+ if (token) {
104
+ const auth = Buffer.from(`:${token}`).toString('base64');
105
+ headers['Authorization'] = `Basic ${auth}`;
106
+ }
107
+ try {
108
+ const [organization, project] = this.parseOwner(owner);
109
+ // Validate organization exists by checking projects
110
+ const orgResponse = await fetch(`${this.config.apiBaseUrl}/${organization}/_apis/projects?api-version=7.0`, { headers });
111
+ if (orgResponse.status !== 200) {
112
+ const apiError = {
113
+ status: 404,
114
+ message: 'Organization not found',
115
+ platform: 'azure-devops',
116
+ operation: 'validate_owner',
117
+ resourceType: 'organization',
118
+ resourceName: organization
119
+ };
120
+ const actionable = getActionableError(apiError);
121
+ return { valid: false, error: formatActionableError(actionable) };
122
+ }
123
+ // If project specified, validate it exists
124
+ if (project) {
125
+ const projectResponse = await fetch(`${this.config.apiBaseUrl}/${organization}/_apis/projects/${project}?api-version=7.0`, { headers });
126
+ if (projectResponse.status !== 200) {
127
+ const apiError = {
128
+ status: 404,
129
+ message: 'Project not found',
130
+ platform: 'azure-devops',
131
+ operation: 'validate_owner',
132
+ resourceType: 'project',
133
+ resourceName: `${organization}/${project}`
134
+ };
135
+ const actionable = getActionableError(apiError);
136
+ return { valid: false, error: formatActionableError(actionable) };
137
+ }
138
+ }
139
+ // Azure DevOps organizations are always "organization" type
140
+ return { valid: true, type: 'organization' };
141
+ }
142
+ catch (error) {
143
+ return {
144
+ valid: false,
145
+ error: `Network error: ${error instanceof Error ? error.message : String(error)}`
146
+ };
147
+ }
148
+ }
149
+ /**
150
+ * Create a new repository in Azure DevOps
151
+ */
152
+ async createRepository(options, token) {
153
+ const [organization, project] = this.parseOwner(options.owner);
154
+ if (!project) {
155
+ throw new Error('Azure DevOps requires a project. Use format: "organization/project"');
156
+ }
157
+ const payload = {
158
+ name: options.name,
159
+ project: {
160
+ name: project
161
+ }
162
+ };
163
+ const auth = Buffer.from(`:${token}`).toString('base64');
164
+ const response = await fetch(`${this.config.apiBaseUrl}/${organization}/${project}/_apis/git/repositories?api-version=7.0`, {
165
+ method: 'POST',
166
+ headers: {
167
+ 'Authorization': `Basic ${auth}`,
168
+ 'Accept': 'application/json',
169
+ 'Content-Type': 'application/json'
170
+ },
171
+ body: JSON.stringify(payload)
172
+ });
173
+ if (!response.ok) {
174
+ const error = await response.json();
175
+ // Handle "already exists" error
176
+ if (error.message?.includes('already exists') || error.typeKey === 'GitRepositoryNameAlreadyExistsException') {
177
+ // Repository already exists, return URL
178
+ const host = this.config.customDomain || this.config.host;
179
+ return `https://${host}/${organization}/${project}/_git/${options.name}`;
180
+ }
181
+ // Handle other errors with actionable messages
182
+ const apiError = {
183
+ status: response.status,
184
+ message: error.message || response.statusText,
185
+ platform: 'azure-devops',
186
+ operation: 'create_repo',
187
+ resourceType: 'repository',
188
+ resourceName: `${organization}/${project}/${options.name}`
189
+ };
190
+ const actionable = getActionableError(apiError);
191
+ throw new Error(formatActionableError(actionable));
192
+ }
193
+ const data = await response.json();
194
+ return data.webUrl || data.remoteUrl;
195
+ }
196
+ /**
197
+ * Check if account is an organization (always true for Azure DevOps)
198
+ */
199
+ async isOrganization(account, token) {
200
+ // Azure DevOps always uses organizations
201
+ return true;
202
+ }
203
+ /**
204
+ * Get token creation URL
205
+ */
206
+ getTokenUrl() {
207
+ if (this.config.selfHosted) {
208
+ return `https://${this.config.customDomain || this.config.host}/_usersSettings/tokens`;
209
+ }
210
+ return 'https://dev.azure.com/_usersSettings/tokens';
211
+ }
212
+ /**
213
+ * Get required token scopes
214
+ */
215
+ getRequiredScopes(isOrganization) {
216
+ return ['vso.code_write', 'vso.code_manage', 'vso.project'];
217
+ }
218
+ /**
219
+ * Override getRemoteUrl for Azure DevOps-specific URL format
220
+ */
221
+ getRemoteUrl(owner, repo, urlType) {
222
+ const [organization, project] = this.parseOwner(owner);
223
+ const host = this.config.customDomain || this.config.host;
224
+ if (!project) {
225
+ throw new Error('Azure DevOps requires a project. Use format: "organization/project"');
226
+ }
227
+ if (urlType === 'ssh') {
228
+ return `git@ssh.${host}:v3/${organization}/${project}/${repo}`;
229
+ }
230
+ else {
231
+ return `https://${host}/${organization}/${project}/_git/${repo}`;
232
+ }
233
+ }
234
+ /**
235
+ * Override getAuthHeaders for Azure DevOps-specific auth (Basic Auth with PAT)
236
+ */
237
+ getAuthHeaders(token) {
238
+ const auth = Buffer.from(`:${token}`).toString('base64');
239
+ return {
240
+ 'Authorization': `Basic ${auth}`,
241
+ 'Accept': 'application/json',
242
+ 'Content-Type': 'application/json'
243
+ };
244
+ }
245
+ /**
246
+ * Parse owner string into organization and project
247
+ * Format: "organization" or "organization/project"
248
+ */
249
+ parseOwner(owner) {
250
+ const parts = owner.split('/');
251
+ if (parts.length === 1) {
252
+ return [parts[0], null];
253
+ }
254
+ return [parts[0], parts[1]];
255
+ }
256
+ }
257
+ /**
258
+ * Create an Azure DevOps provider instance
259
+ */
260
+ export function createAzureDevOpsProvider(config) {
261
+ return new AzureDevOpsProvider(config);
262
+ }
263
+ //# sourceMappingURL=azure-devops-provider.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"azure-devops-provider.js","sourceRoot":"","sources":["../../../../../src/core/repo-structure/providers/azure-devops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AI,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QAE1D,IAAI,CAAC,OAAO,EAAE,CAAC;YACb,MAAM,IAAI,KAAK,CAAC,qEAAqE,CAAC,CAAC;QACzF,CAAC;QAED,IAAI,OAAO,KAAK,KAAK,EAAE,CAAC;YACtB,OAAO,WAAW,IAAI,OAAO,YAAY,IAAI,OAAO,IAAI,IAAI,EAAE,CAAC;QACjE,CAAC;aAAM,CAAC;YACN,OAAO,WAAW,IAAI,IAAI,YAAY,IAAI,OAAO,SAAS,IAAI,EAAE,CAAC;QACnE,CAAC;IACH,CAAC;IAED;;OAEG;IACO,cAAc,CAAC,KAAa;QACpC,MAAM,IAAI,GAAG,MAAM,CAAC,IAAI,CAAC,IAAI,KAAK,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QACzD,OAAO;YACL,eAAe,EAAE,SAAS,IAAI,EAAE;YAChC,QAAQ,EAAE,kBAAkB;YAC5B,cAAc,EAAE,kBAAkB;SACnC,CAAC;IACJ,CAAC;IAED;;;OAGG;IACK,UAAU,CAAC,KAAa;QAC9B,MAAM,KAAK,GAAG,KAAK,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QAC/B,IAAI,KAAK,CAAC,MAAM,KAAK,CAAC,EAAE,CAAC;YACvB,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,CAAC,CAAC;QAC1B,CAAC;QACD,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC;IAC9B,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,yBAAyB,CAAC,MAAgC;IACxE,OAAO,IAAI,mBAAmB,CAAC,MAAM,CAAC,CAAC;AACzC,CAAC"}
@@ -1,33 +1,34 @@
1
1
  /**
2
- * Bitbucket Provider Implementation (STUB)
2
+ * Bitbucket Provider Implementation
3
3
  *
4
- * Stub implementation for Bitbucket.org and Bitbucket Server/Data Center.
5
- * Full implementation coming soon!
4
+ * Implements GitProvider interface for Bitbucket.org and Bitbucket Server/Data Center.
5
+ * Handles repository validation, creation, and management via Bitbucket API 2.0.
6
6
  *
7
7
  * @module providers/bitbucket-provider
8
8
  */
9
9
  import { BaseGitProvider, type PlatformConfig, type RepoValidationResult, type OwnerValidationResult, type CreateRepoOptions } from '../git-provider.js';
10
10
  /**
11
- * Bitbucket Provider (Stub)
11
+ * Bitbucket Provider
12
12
  *
13
- * Placeholder implementation for Bitbucket support.
13
+ * Implements Git operations for Bitbucket platform.
14
+ * Supports both Bitbucket.org and Bitbucket Server/Data Center.
14
15
  */
15
16
  export declare class BitbucketProvider extends BaseGitProvider {
16
17
  constructor(config?: Partial<PlatformConfig>);
17
18
  /**
18
- * Validate repository (stub)
19
+ * Validate if a repository exists on Bitbucket
19
20
  */
20
21
  validateRepository(owner: string, repo: string, token?: string): Promise<RepoValidationResult>;
21
22
  /**
22
- * Validate owner (stub)
23
+ * Validate if a Bitbucket workspace (user or team) exists
23
24
  */
24
25
  validateOwner(owner: string, token?: string): Promise<OwnerValidationResult>;
25
26
  /**
26
- * Create repository (stub)
27
+ * Create a new repository on Bitbucket
27
28
  */
28
29
  createRepository(options: CreateRepoOptions, token: string): Promise<string>;
29
30
  /**
30
- * Check if organization (stub)
31
+ * Check if a workspace is a team (organization)
31
32
  */
32
33
  isOrganization(account: string, token?: string): Promise<boolean>;
33
34
  /**
@@ -39,11 +40,11 @@ export declare class BitbucketProvider extends BaseGitProvider {
39
40
  */
40
41
  getRequiredScopes(isOrganization?: boolean): string[];
41
42
  /**
42
- * Override SSH user for Bitbucket (uses 'git' not 'hg')
43
+ * Override SSH user for Bitbucket
43
44
  */
44
45
  protected getSSHUser(): string;
45
46
  /**
46
- * Override getAuthHeaders for Bitbucket-specific auth
47
+ * Override getAuthHeaders for Bitbucket-specific auth (Bearer token)
47
48
  */
48
49
  protected getAuthHeaders(token: string): Record<string, string>;
49
50
  }
@@ -1 +1 @@
1
- {"version":3,"file":"bitbucket-provider.d.ts","sourceRoot":"","sources":["../../../../../src/core/repo-structure/providers/bitbucket-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,KAAK,cAAc,EAAE,KAAK,oBAAoB,EAAE,KAAK,qBAAqB,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEzJ;;;;GAIG;AACH,qBAAa,iBAAkB,SAAQ,eAAe;gBACxC,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC;IAW5C;;OAEG;IACG,kBAAkB,CACtB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,oBAAoB,CAAC;IAmBhC;;OAEG;IACG,aAAa,CACjB,KAAK,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,qBAAqB,CAAC;IAIjC;;OAEG;IACG,gBAAgB,CACpB,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,CAAC;IAIlB;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIvE;;OAEG;IACH,WAAW,IAAI,MAAM;IAOrB;;OAEG;IACH,iBAAiB,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE;IAIrD;;OAEG;IACH,SAAS,CAAC,UAAU,IAAI,MAAM;IAI9B;;OAEG;IACH,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAQhE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,iBAAiB,CAE3F"}
1
+ {"version":3,"file":"bitbucket-provider.d.ts","sourceRoot":"","sources":["../../../../../src/core/repo-structure/providers/bitbucket-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,KAAK,cAAc,EAAE,KAAK,oBAAoB,EAAE,KAAK,qBAAqB,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAGzJ;;;;;GAKG;AACH,qBAAa,iBAAkB,SAAQ,eAAe;gBACxC,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC;IAW5C;;OAEG;IACG,kBAAkB,CACtB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,oBAAoB,CAAC;IAuEhC;;OAEG;IACG,aAAa,CACjB,KAAK,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,qBAAqB,CAAC;IAsDjC;;OAEG;IACG,gBAAgB,CACpB,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,CAAC;IAoDlB;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAyBvE;;OAEG;IACH,WAAW,IAAI,MAAM;IAOrB;;OAEG;IACH,iBAAiB,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE;IAIrD;;OAEG;IACH,SAAS,CAAC,UAAU,IAAI,MAAM;IAI9B;;OAEG;IACH,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAOhE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,iBAAiB,CAE3F"}
@@ -1,16 +1,18 @@
1
1
  /**
2
- * Bitbucket Provider Implementation (STUB)
2
+ * Bitbucket Provider Implementation
3
3
  *
4
- * Stub implementation for Bitbucket.org and Bitbucket Server/Data Center.
5
- * Full implementation coming soon!
4
+ * Implements GitProvider interface for Bitbucket.org and Bitbucket Server/Data Center.
5
+ * Handles repository validation, creation, and management via Bitbucket API 2.0.
6
6
  *
7
7
  * @module providers/bitbucket-provider
8
8
  */
9
9
  import { BaseGitProvider } from '../git-provider.js';
10
+ import { getActionableError, formatActionableError } from '../git-error-handler.js';
10
11
  /**
11
- * Bitbucket Provider (Stub)
12
+ * Bitbucket Provider
12
13
  *
13
- * Placeholder implementation for Bitbucket support.
14
+ * Implements Git operations for Bitbucket platform.
15
+ * Supports both Bitbucket.org and Bitbucket Server/Data Center.
14
16
  */
15
17
  export class BitbucketProvider extends BaseGitProvider {
16
18
  constructor(config) {
@@ -24,42 +26,175 @@ export class BitbucketProvider extends BaseGitProvider {
24
26
  });
25
27
  }
26
28
  /**
27
- * Validate repository (stub)
29
+ * Validate if a repository exists on Bitbucket
28
30
  */
29
31
  async validateRepository(owner, repo, token) {
30
- throw new Error(`
31
- Bitbucket Support Coming Soon!
32
-
33
- Bitbucket integration is not yet implemented.
34
- Currently, only GitHub is fully supported.
35
-
36
- 🔜 What's coming:
37
- Bitbucket.org and Bitbucket Server/Data Center support
38
- Repository validation and creation
39
- Workspace support
40
- SSH and HTTPS remote URLs
41
-
42
- For now, please use GitHub or wait for the next SpecWeave release.
43
-
44
- 📖 Track progress: https://github.com/anton-abyzov/specweave/issues
45
- `.trim());
32
+ try {
33
+ const headers = {
34
+ 'Accept': 'application/json'
35
+ };
36
+ if (token) {
37
+ headers['Authorization'] = `Bearer ${token}`;
38
+ }
39
+ const response = await fetch(this.getApiUrl(`/repositories/${owner}/${repo}`), { headers });
40
+ if (response.status === 404) {
41
+ // Repository does not exist (good for creation)
42
+ return { exists: false, valid: true };
43
+ }
44
+ if (response.status === 200) {
45
+ // Repository already exists
46
+ const data = await response.json();
47
+ return {
48
+ exists: true,
49
+ valid: true,
50
+ url: data.links.html.href
51
+ };
52
+ }
53
+ if (response.status === 401 || response.status === 403) {
54
+ // Authentication or permission error
55
+ const apiError = {
56
+ status: response.status,
57
+ message: response.statusText,
58
+ platform: 'bitbucket',
59
+ operation: 'validate_repo',
60
+ resourceType: 'repository',
61
+ resourceName: `${owner}/${repo}`
62
+ };
63
+ const actionable = getActionableError(apiError);
64
+ return { exists: false, valid: false, error: formatActionableError(actionable) };
65
+ }
66
+ // Other error
67
+ const apiError = {
68
+ status: response.status,
69
+ message: response.statusText,
70
+ platform: 'bitbucket',
71
+ operation: 'validate_repo',
72
+ resourceType: 'repository',
73
+ resourceName: `${owner}/${repo}`
74
+ };
75
+ const actionable = getActionableError(apiError);
76
+ return {
77
+ exists: false,
78
+ valid: false,
79
+ error: formatActionableError(actionable)
80
+ };
81
+ }
82
+ catch (error) {
83
+ return {
84
+ exists: false,
85
+ valid: false,
86
+ error: `Network error: ${error instanceof Error ? error.message : String(error)}`
87
+ };
88
+ }
46
89
  }
47
90
  /**
48
- * Validate owner (stub)
91
+ * Validate if a Bitbucket workspace (user or team) exists
49
92
  */
50
93
  async validateOwner(owner, token) {
51
- throw new Error('Bitbucket support coming soon! Please use GitHub for now.');
94
+ const headers = {
95
+ 'Accept': 'application/json'
96
+ };
97
+ if (token) {
98
+ headers['Authorization'] = `Bearer ${token}`;
99
+ }
100
+ try {
101
+ // Try as workspace (can be user or team)
102
+ const workspaceResponse = await fetch(this.getApiUrl(`/workspaces/${owner}`), { headers });
103
+ if (workspaceResponse.status === 200) {
104
+ const data = await workspaceResponse.json();
105
+ // Workspace can be either user or team
106
+ const type = data.type === 'team' ? 'organization' : 'user';
107
+ return { valid: true, type };
108
+ }
109
+ // Try as user
110
+ const userResponse = await fetch(this.getApiUrl(`/users/${owner}`), { headers });
111
+ if (userResponse.status === 200) {
112
+ return { valid: true, type: 'user' };
113
+ }
114
+ // Not found
115
+ const apiError = {
116
+ status: 404,
117
+ message: 'Not Found',
118
+ platform: 'bitbucket',
119
+ operation: 'validate_owner',
120
+ resourceType: 'workspace',
121
+ resourceName: owner
122
+ };
123
+ const actionable = getActionableError(apiError);
124
+ return { valid: false, error: formatActionableError(actionable) };
125
+ }
126
+ catch (error) {
127
+ return {
128
+ valid: false,
129
+ error: `Network error: ${error instanceof Error ? error.message : String(error)}`
130
+ };
131
+ }
52
132
  }
53
133
  /**
54
- * Create repository (stub)
134
+ * Create a new repository on Bitbucket
55
135
  */
56
136
  async createRepository(options, token) {
57
- throw new Error('Bitbucket support coming soon! Please use GitHub for now.');
137
+ const payload = {
138
+ scm: 'git',
139
+ name: options.name,
140
+ description: options.description,
141
+ is_private: options.visibility === 'private',
142
+ has_issues: options.hasIssues !== false,
143
+ has_wiki: options.hasWiki || false,
144
+ fork_policy: 'no_public_forks'
145
+ };
146
+ const response = await fetch(this.getApiUrl(`/repositories/${options.owner}/${options.name}`), {
147
+ method: 'POST',
148
+ headers: {
149
+ 'Authorization': `Bearer ${token}`,
150
+ 'Accept': 'application/json',
151
+ 'Content-Type': 'application/json'
152
+ },
153
+ body: JSON.stringify(payload)
154
+ });
155
+ if (!response.ok) {
156
+ const error = await response.json();
157
+ // Handle "already exists" error
158
+ if (response.status === 400 && error.error?.message?.includes('already exists')) {
159
+ // Repository already exists, return URL
160
+ const host = this.config.customDomain || this.config.host;
161
+ return `https://${host}/${options.owner}/${options.name}`;
162
+ }
163
+ // Handle other errors with actionable messages
164
+ const apiError = {
165
+ status: response.status,
166
+ message: error.error?.message || response.statusText,
167
+ platform: 'bitbucket',
168
+ operation: 'create_repo',
169
+ resourceType: 'repository',
170
+ resourceName: `${options.owner}/${options.name}`
171
+ };
172
+ const actionable = getActionableError(apiError);
173
+ throw new Error(formatActionableError(actionable));
174
+ }
175
+ const data = await response.json();
176
+ return data.links.html.href;
58
177
  }
59
178
  /**
60
- * Check if organization (stub)
179
+ * Check if a workspace is a team (organization)
61
180
  */
62
181
  async isOrganization(account, token) {
182
+ try {
183
+ const headers = {
184
+ 'Accept': 'application/json'
185
+ };
186
+ if (token) {
187
+ headers['Authorization'] = `Bearer ${token}`;
188
+ }
189
+ const response = await fetch(this.getApiUrl(`/workspaces/${account}`), { headers });
190
+ if (response.ok) {
191
+ const data = await response.json();
192
+ return data.type === 'team';
193
+ }
194
+ }
195
+ catch {
196
+ // Assume user if we can't determine
197
+ }
63
198
  return false;
64
199
  }
65
200
  /**
@@ -78,16 +213,15 @@ For now, please use GitHub or wait for the next SpecWeave release.
78
213
  return ['repository:read', 'repository:write', 'repository:admin'];
79
214
  }
80
215
  /**
81
- * Override SSH user for Bitbucket (uses 'git' not 'hg')
216
+ * Override SSH user for Bitbucket
82
217
  */
83
218
  getSSHUser() {
84
219
  return 'git';
85
220
  }
86
221
  /**
87
- * Override getAuthHeaders for Bitbucket-specific auth
222
+ * Override getAuthHeaders for Bitbucket-specific auth (Bearer token)
88
223
  */
89
224
  getAuthHeaders(token) {
90
- // Bitbucket uses HTTP Basic Auth or App Passwords
91
225
  return {
92
226
  'Authorization': `Bearer ${token}`,
93
227
  'Accept': 'application/json',
@@ -1 +1 @@
1
- {"version":3,"file":"bitbucket-provider.js","sourceRoot":"","sources":["../../../../../src/core/repo-structure/providers/bitbucket-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAsG,MAAM,oBAAoB,CAAC;AAEzJ;;;;GAIG;AACH,MAAM,OAAO,iBAAkB,SAAQ,eAAe;IACpD,YAAY,MAAgC;QAC1C,KAAK,CAAC;YACJ,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,WAAW;YACjB,IAAI,EAAE,MAAM,EAAE,IAAI,IAAI,eAAe;YACrC,UAAU,EAAE,MAAM,EAAE,UAAU,IAAI,+BAA+B;YACjE,UAAU,EAAE,MAAM,EAAE,UAAU,IAAI,KAAK;YACvC,YAAY,EAAE,MAAM,EAAE,YAAY;SACnC,CAAC,CAAC;IACL,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,kBAAkB,CACtB,KAAa,EACb,IAAY,EACZ,KAAc;QAEd,MAAM,IAAI,KAAK,CAAC;;;;;;;;;;;;;;;KAef,CAAC,IAAI,EAAE,CAAC,CAAC;IACZ,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,aAAa,CACjB,KAAa,EACb,KAAc;QAEd,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC/E,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,gBAAgB,CACpB,OAA0B,EAC1B,KAAa;QAEb,MAAM,IAAI,KAAK,CAAC,2DAA2D,CAAC,CAAC;IAC/E,CAAC;IAED;;OAEG;IACH,KAAK,CAAC,cAAc,CAAC,OAAe,EAAE,KAAc;QAClD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACH,WAAW;QACT,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;YAC3B,OAAO,WAAW,IAAI,CAAC,MAAM,CAAC,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,kCAAkC,CAAC;QACnG,CAAC;QACD,OAAO,uDAAuD,CAAC;IACjE,CAAC;IAED;;OAEG;IACH,iBAAiB,CAAC,cAAwB;QACxC,OAAO,CAAC,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;IACrE,CAAC;IAED;;OAEG;IACO,UAAU;QAClB,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACO,cAAc,CAAC,KAAa;QACpC,kDAAkD;QAClD,OAAO;YACL,eAAe,EAAE,UAAU,KAAK,EAAE;YAClC,QAAQ,EAAE,kBAAkB;YAC5B,cAAc,EAAE,kBAAkB;SACnC,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAgC;IACtE,OAAO,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC"}
1
+ {"version":3,"file":"bitbucket-provider.js","sourceRoot":"","sources":["../../../../../src/core/repo-structure/providers/bitbucket-provider.ts"],"names":[],"mappings":"AAAA;;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E,CAAC;YAC/C,CAAC;YAED,MAAM,QAAQ,GAAG,MAAM,KAAK,CAC1B,IAAI,CAAC,SAAS,CAAC,eAAe,OAAO,EAAE,CAAC,EACxC,EAAE,OAAO,EAAE,CACZ,CAAC;YAEF,IAAI,QAAQ,CAAC,EAAE,EAAE,CAAC;gBAChB,MAAM,IAAI,GAAQ,MAAM,QAAQ,CAAC,IAAI,EAAE,CAAC;gBACxC,OAAO,IAAI,CAAC,IAAI,KAAK,MAAM,CAAC;YAC9B,CAAC;QACH,CAAC;QAAC,MAAM,CAAC;YACP,oCAAoC;QACtC,CAAC;QACD,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACH,WAAW;QACT,IAAI,IAAI,CAAC,MAAM,CAAC,UAAU,EAAE,CAAC;YAC3B,OAAO,WAAW,IAAI,CAAC,MAAM,CAAC,YAAY,IAAI,IAAI,CAAC,MAAM,CAAC,IAAI,kCAAkC,CAAC;QACnG,CAAC;QACD,OAAO,uDAAuD,CAAC;IACjE,CAAC;IAED;;OAEG;IACH,iBAAiB,CAAC,cAAwB;QACxC,OAAO,CAAC,iBAAiB,EAAE,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;IACrE,CAAC;IAED;;OAEG;IACO,UAAU;QAClB,OAAO,KAAK,CAAC;IACf,CAAC;IAED;;OAEG;IACO,cAAc,CAAC,KAAa;QACpC,OAAO;YACL,eAAe,EAAE,UAAU,KAAK,EAAE;YAClC,QAAQ,EAAE,kBAAkB;YAC5B,cAAc,EAAE,kBAAkB;SACnC,CAAC;IACJ,CAAC;CACF;AAED;;GAEG;AACH,MAAM,UAAU,uBAAuB,CAAC,MAAgC;IACtE,OAAO,IAAI,iBAAiB,CAAC,MAAM,CAAC,CAAC;AACvC,CAAC"}
@@ -1,33 +1,34 @@
1
1
  /**
2
- * GitLab Provider Implementation (STUB)
2
+ * GitLab Provider Implementation
3
3
  *
4
- * Stub implementation for GitLab.com and self-hosted GitLab instances.
5
- * Full implementation coming soon!
4
+ * Implements GitProvider interface for GitLab.com and self-hosted GitLab instances.
5
+ * Handles project validation, creation, and management via GitLab API v4.
6
6
  *
7
7
  * @module providers/gitlab-provider
8
8
  */
9
9
  import { BaseGitProvider, type PlatformConfig, type RepoValidationResult, type OwnerValidationResult, type CreateRepoOptions } from '../git-provider.js';
10
10
  /**
11
- * GitLab Provider (Stub)
11
+ * GitLab Provider
12
12
  *
13
- * Placeholder implementation for GitLab support.
13
+ * Implements Git operations for GitLab platform.
14
+ * Supports both GitLab.com and self-hosted GitLab instances.
14
15
  */
15
16
  export declare class GitLabProvider extends BaseGitProvider {
16
17
  constructor(config?: Partial<PlatformConfig>);
17
18
  /**
18
- * Validate repository (stub)
19
+ * Validate if a project exists on GitLab
19
20
  */
20
21
  validateRepository(owner: string, repo: string, token?: string): Promise<RepoValidationResult>;
21
22
  /**
22
- * Validate owner (stub)
23
+ * Validate if a GitLab namespace (user or group) exists
23
24
  */
24
25
  validateOwner(owner: string, token?: string): Promise<OwnerValidationResult>;
25
26
  /**
26
- * Create repository (stub)
27
+ * Create a new project on GitLab
27
28
  */
28
29
  createRepository(options: CreateRepoOptions, token: string): Promise<string>;
29
30
  /**
30
- * Check if organization (stub)
31
+ * Check if a namespace is a group (organization)
31
32
  */
32
33
  isOrganization(account: string, token?: string): Promise<boolean>;
33
34
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"gitlab-provider.d.ts","sourceRoot":"","sources":["../../../../../src/core/repo-structure/providers/gitlab-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,KAAK,cAAc,EAAE,KAAK,oBAAoB,EAAE,KAAK,qBAAqB,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEzJ;;;;GAIG;AACH,qBAAa,cAAe,SAAQ,eAAe;gBACrC,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC;IAW5C;;OAEG;IACG,kBAAkB,CACtB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,oBAAoB,CAAC;IAmBhC;;OAEG;IACG,aAAa,CACjB,KAAK,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,qBAAqB,CAAC;IAIjC;;OAEG;IACG,gBAAgB,CACpB,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,CAAC;IAIlB;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAIvE;;OAEG;IACH,WAAW,IAAI,MAAM;IAOrB;;OAEG;IACH,iBAAiB,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE;IAIrD;;OAEG;IACH,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAOhE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,cAAc,CAErF"}
1
+ {"version":3,"file":"gitlab-provider.d.ts","sourceRoot":"","sources":["../../../../../src/core/repo-structure/providers/gitlab-provider.ts"],"names":[],"mappings":"AAAA;;;;;;;GAOG;AAEH,OAAO,EAAE,eAAe,EAAE,KAAK,cAAc,EAAE,KAAK,oBAAoB,EAAE,KAAK,qBAAqB,EAAE,KAAK,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAGzJ;;;;;GAKG;AACH,qBAAa,cAAe,SAAQ,eAAe;gBACrC,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC;IAW5C;;OAEG;IACG,kBAAkB,CACtB,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,oBAAoB,CAAC;IA0EhC;;OAEG;IACG,aAAa,CACjB,KAAK,EAAE,MAAM,EACb,KAAK,CAAC,EAAE,MAAM,GACb,OAAO,CAAC,qBAAqB,CAAC;IAsDjC;;OAEG;IACG,gBAAgB,CACpB,OAAO,EAAE,iBAAiB,EAC1B,KAAK,EAAE,MAAM,GACZ,OAAO,CAAC,MAAM,CAAC;IA6ElB;;OAEG;IACG,cAAc,CAAC,OAAO,EAAE,MAAM,EAAE,KAAK,CAAC,EAAE,MAAM,GAAG,OAAO,CAAC,OAAO,CAAC;IAsBvE;;OAEG;IACH,WAAW,IAAI,MAAM;IAOrB;;OAEG;IACH,iBAAiB,CAAC,cAAc,CAAC,EAAE,OAAO,GAAG,MAAM,EAAE;IAIrD;;OAEG;IACH,SAAS,CAAC,cAAc,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC;CAOhE;AAED;;GAEG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,GAAG,cAAc,CAErF"}