@oh-my-ghaad/gitlab 0.0.9 → 0.0.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.
package/CHANGELOG.md CHANGED
@@ -1,3 +1,21 @@
1
+ ## [0.0.11](https://github.com/cmgriffing/oh-my-ghaad/compare/v0.0.10...v0.0.11) (2025-10-06)
2
+
3
+
4
+ ### Bug Fixes
5
+
6
+ * remove thrown error when creating a file and it not existing yet ([3ed41b7](https://github.com/cmgriffing/oh-my-ghaad/commit/3ed41b79cbdb0115fe1640549fd76ff5a452728e))
7
+
8
+
9
+
10
+ ## [0.0.10](https://github.com/cmgriffing/oh-my-ghaad/compare/v0.0.9...v0.0.10) (2025-10-06)
11
+
12
+
13
+ ### Bug Fixes
14
+
15
+ * create branch if none found in gitlab adapter ([d175797](https://github.com/cmgriffing/oh-my-ghaad/commit/d17579734ac25025a71ac0cadfa19d73815bf723))
16
+
17
+
18
+
1
19
  ## [0.0.9](https://github.com/cmgriffing/oh-my-ghaad/compare/v0.0.8...v0.0.9) (2025-10-05)
2
20
 
3
21
 
package/dist/index.cjs CHANGED
@@ -163,35 +163,7 @@ var GitlabAdapter = class extends import_core.Adapter {
163
163
  }
164
164
  let branch = branchesOrError.find((branch2) => branch2.default);
165
165
  if (!branch) {
166
- branch = {
167
- name: "main",
168
- merged: true,
169
- protected: false,
170
- default: true,
171
- developersCanPush: true,
172
- developersCanMerge: true,
173
- canPush: true,
174
- webUrl: "",
175
- commit: {
176
- id: "",
177
- shortId: "",
178
- title: "",
179
- authorName: "",
180
- authorEmail: "",
181
- sha: "",
182
- message: "",
183
- author: {
184
- name: "",
185
- email: "",
186
- date: ""
187
- },
188
- committer: {
189
- name: "",
190
- email: "",
191
- date: ""
192
- }
193
- }
194
- };
166
+ branch = await this.api.Branches.create(this.repo.id, "main", "HEAD");
195
167
  }
196
168
  const existingFileOrError = await this.api.RepositoryFiles.show(
197
169
  this.repo.id,
@@ -205,7 +177,6 @@ var GitlabAdapter = class extends import_core.Adapter {
205
177
  if (existingFileOrError.cause.response.status === 401 && this.unauthorizedHandler) {
206
178
  this.unauthorizedHandler();
207
179
  }
208
- throw new Error("Failed to fetch existing file");
209
180
  }
210
181
  if (existingFileOrError) {
211
182
  throw new Error("File already exists");
package/dist/index.js CHANGED
@@ -138,35 +138,7 @@ var GitlabAdapter = class extends Adapter {
138
138
  }
139
139
  let branch = branchesOrError.find((branch2) => branch2.default);
140
140
  if (!branch) {
141
- branch = {
142
- name: "main",
143
- merged: true,
144
- protected: false,
145
- default: true,
146
- developersCanPush: true,
147
- developersCanMerge: true,
148
- canPush: true,
149
- webUrl: "",
150
- commit: {
151
- id: "",
152
- shortId: "",
153
- title: "",
154
- authorName: "",
155
- authorEmail: "",
156
- sha: "",
157
- message: "",
158
- author: {
159
- name: "",
160
- email: "",
161
- date: ""
162
- },
163
- committer: {
164
- name: "",
165
- email: "",
166
- date: ""
167
- }
168
- }
169
- };
141
+ branch = await this.api.Branches.create(this.repo.id, "main", "HEAD");
170
142
  }
171
143
  const existingFileOrError = await this.api.RepositoryFiles.show(
172
144
  this.repo.id,
@@ -180,7 +152,6 @@ var GitlabAdapter = class extends Adapter {
180
152
  if (existingFileOrError.cause.response.status === 401 && this.unauthorizedHandler) {
181
153
  this.unauthorizedHandler();
182
154
  }
183
- throw new Error("Failed to fetch existing file");
184
155
  }
185
156
  if (existingFileOrError) {
186
157
  throw new Error("File already exists");
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@oh-my-ghaad/gitlab",
3
- "version": "0.0.9",
3
+ "version": "0.0.11",
4
4
  "description": "",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",
@@ -10,7 +10,7 @@
10
10
  "license": "MIT",
11
11
  "dependencies": {
12
12
  "@gitbeaker/rest": "^43.5.0",
13
- "@oh-my-ghaad/core": "0.0.9"
13
+ "@oh-my-ghaad/core": "0.0.11"
14
14
  },
15
15
  "devDependencies": {
16
16
  "tsup": "^8.5.0",
package/src/adapter.ts CHANGED
@@ -149,36 +149,7 @@ export class GitlabAdapter extends Adapter implements IAdapter {
149
149
  let branch = branchesOrError.find((branch) => branch.default);
150
150
 
151
151
  if (!branch) {
152
- // throw new Error("Failed to find default branch");
153
- branch = {
154
- name: "main",
155
- merged: true,
156
- protected: false,
157
- default: true,
158
- developersCanPush: true,
159
- developersCanMerge: true,
160
- canPush: true,
161
- webUrl: "",
162
- commit: {
163
- id: "",
164
- shortId: "",
165
- title: "",
166
- authorName: "",
167
- authorEmail: "",
168
- sha: "",
169
- message: "",
170
- author: {
171
- name: "",
172
- email: "",
173
- date: "",
174
- },
175
- committer: {
176
- name: "",
177
- email: "",
178
- date: "",
179
- },
180
- },
181
- };
152
+ branch = await this.api.Branches.create(this.repo.id, "main", "HEAD");
182
153
  }
183
154
 
184
155
  const existingFileOrError = await this.api.RepositoryFiles.show(
@@ -197,7 +168,6 @@ export class GitlabAdapter extends Adapter implements IAdapter {
197
168
  ) {
198
169
  this.unauthorizedHandler();
199
170
  }
200
- throw new Error("Failed to fetch existing file");
201
171
  }
202
172
 
203
173
  if (existingFileOrError) {