repository-provider 28.1.1 → 28.2.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/README.md CHANGED
@@ -69,12 +69,14 @@ console.log(await readme.getString());
69
69
  * [equals](#equals)
70
70
  * [Parameters](#parameters-9)
71
71
  * [provider](#provider)
72
- * [info](#info)
72
+ * [trace](#trace)
73
73
  * [Parameters](#parameters-10)
74
- * [warn](#warn)
74
+ * [info](#info)
75
75
  * [Parameters](#parameters-11)
76
- * [error](#error)
76
+ * [warn](#warn)
77
77
  * [Parameters](#parameters-12)
78
+ * [error](#error)
79
+ * [Parameters](#parameters-13)
78
80
  * [repositoryClass](#repositoryclass)
79
81
  * [pullRequestClass](#pullrequestclass)
80
82
  * [branchClass](#branchclass)
@@ -94,36 +96,36 @@ console.log(await readme.getString());
94
96
  * [BaseProvider](#baseprovider)
95
97
  * [Properties](#properties-2)
96
98
  * [equals](#equals-1)
97
- * [Parameters](#parameters-13)
99
+ * [Parameters](#parameters-14)
98
100
  * [repositoryBases](#repositorybases)
99
101
  * [normalizeRepositoryName](#normalizerepositoryname)
100
- * [Parameters](#parameters-14)
101
- * [normalizeGroupName](#normalizegroupname)
102
102
  * [Parameters](#parameters-15)
103
+ * [normalizeGroupName](#normalizegroupname)
104
+ * [Parameters](#parameters-16)
103
105
  * [areRepositoryNamesCaseSensitive](#arerepositorynamescasesensitive)
104
106
  * [areGroupNamesCaseSensitive](#aregroupnamescasesensitive)
105
107
  * [supportsBase](#supportsbase)
106
- * [Parameters](#parameters-16)
107
- * [parseName](#parsename)
108
108
  * [Parameters](#parameters-17)
109
- * [createRepository](#createrepository)
109
+ * [parseName](#parsename)
110
110
  * [Parameters](#parameters-18)
111
- * [list](#list)
111
+ * [createRepository](#createrepository)
112
112
  * [Parameters](#parameters-19)
113
- * [projects](#projects)
113
+ * [list](#list)
114
114
  * [Parameters](#parameters-20)
115
- * [milestones](#milestones)
115
+ * [projects](#projects)
116
116
  * [Parameters](#parameters-21)
117
- * [repositories](#repositories)
117
+ * [milestones](#milestones)
118
118
  * [Parameters](#parameters-22)
119
- * [branches](#branches)
119
+ * [repositories](#repositories)
120
120
  * [Parameters](#parameters-23)
121
- * [tags](#tags)
121
+ * [branches](#branches)
122
122
  * [Parameters](#parameters-24)
123
- * [hooks](#hooks)
123
+ * [tags](#tags)
124
124
  * [Parameters](#parameters-25)
125
- * [pullRequests](#pullrequests)
125
+ * [hooks](#hooks)
126
126
  * [Parameters](#parameters-26)
127
+ * [pullRequests](#pullrequests)
128
+ * [Parameters](#parameters-27)
127
129
  * [name](#name)
128
130
  * [fullName](#fullname)
129
131
  * [provider](#provider-1)
@@ -138,82 +140,82 @@ console.log(await readme.getString());
138
140
  * [pullRequestClass](#pullrequestclass-1)
139
141
  * [instanceIdentifier](#instanceidentifier)
140
142
  * [optionsFromEnvironment](#optionsfromenvironment)
141
- * [Parameters](#parameters-27)
142
- * [areOptionsSufficcient](#areoptionssufficcient)
143
143
  * [Parameters](#parameters-28)
144
- * [initialize](#initialize)
144
+ * [areOptionsSufficcient](#areoptionssufficcient)
145
145
  * [Parameters](#parameters-29)
146
+ * [initialize](#initialize)
147
+ * [Parameters](#parameters-30)
146
148
  * [priority](#priority)
147
149
  * [name](#name-1)
148
150
  * [messageDestination](#messagedestination-1)
149
151
  * [Branch](#branch)
150
- * [Parameters](#parameters-30)
152
+ * [Parameters](#parameters-31)
151
153
  * [Properties](#properties-3)
152
154
  * [url](#url-1)
153
155
  * [refType](#reftype)
154
156
  * [isDefault](#isdefault)
155
157
  * [delete](#delete)
156
158
  * [commit](#commit)
157
- * [Parameters](#parameters-31)
158
- * [commitIntoPullRequest](#commitintopullrequest)
159
159
  * [Parameters](#parameters-32)
160
- * [removeEntries](#removeentries)
160
+ * [commitIntoPullRequest](#commitintopullrequest)
161
161
  * [Parameters](#parameters-33)
162
- * [createPullRequest](#createpullrequest)
162
+ * [removeEntries](#removeentries)
163
163
  * [Parameters](#parameters-34)
164
- * [createBranch](#createbranch)
164
+ * [createPullRequest](#createpullrequest)
165
165
  * [Parameters](#parameters-35)
166
+ * [createBranch](#createbranch)
167
+ * [Parameters](#parameters-36)
166
168
  * [CommitResult](#commitresult)
167
169
  * [Properties](#properties-4)
168
170
  * [Commit](#commit-1)
169
- * [Parameters](#parameters-36)
171
+ * [Parameters](#parameters-37)
170
172
  * [Properties](#properties-5)
171
173
  * [Hook](#hook)
172
- * [Parameters](#parameters-37)
174
+ * [Parameters](#parameters-38)
173
175
  * [Properties](#properties-6)
174
176
  * [equals](#equals-2)
175
- * [Parameters](#parameters-38)
177
+ * [Parameters](#parameters-39)
176
178
  * [toJSON](#tojson-1)
177
179
  * [Issue](#issue)
178
- * [Parameters](#parameters-39)
179
- * [Milestone](#milestone)
180
180
  * [Parameters](#parameters-40)
181
- * [MultiGroupProvider](#multigroupprovider)
181
+ * [Milestone](#milestone)
182
182
  * [Parameters](#parameters-41)
183
+ * [MultiGroupProvider](#multigroupprovider)
184
+ * [Parameters](#parameters-42)
183
185
  * [repository](#repository)
184
- * [Parameters](#parameters-42)
185
- * [branch](#branch-1)
186
186
  * [Parameters](#parameters-43)
187
- * [repositoryGroup](#repositorygroup)
187
+ * [branch](#branch-1)
188
188
  * [Parameters](#parameters-44)
189
- * [repositoryGroups](#repositorygroups)
189
+ * [repositoryGroup](#repositorygroup)
190
190
  * [Parameters](#parameters-45)
191
- * [createRepositoryGroup](#createrepositorygroup)
191
+ * [repositoryGroups](#repositorygroups)
192
192
  * [Parameters](#parameters-46)
193
- * [addRepositoryGroup](#addrepositorygroup)
193
+ * [createRepositoryGroup](#createrepositorygroup)
194
194
  * [Parameters](#parameters-47)
195
+ * [addRepositoryGroup](#addrepositorygroup)
196
+ * [Parameters](#parameters-48)
195
197
  * [NamedObject](#namedobject)
196
- * [Parameters](#parameters-48)
198
+ * [Parameters](#parameters-49)
197
199
  * [Properties](#properties-7)
198
200
  * [equals](#equals-3)
199
- * [Parameters](#parameters-49)
201
+ * [Parameters](#parameters-50)
200
202
  * [displayName](#displayname)
201
203
  * [fullName](#fullname-1)
202
204
  * [toJSON](#tojson-2)
203
205
  * [Project](#project)
204
- * [Parameters](#parameters-50)
205
- * [PullRequest](#pullrequest)
206
206
  * [Parameters](#parameters-51)
207
+ * [PullRequest](#pullrequest)
208
+ * [Parameters](#parameters-52)
207
209
  * [Properties](#properties-8)
208
210
  * [fullName](#fullname-2)
209
211
  * [url](#url-2)
210
212
  * [repository](#repository-1)
211
213
  * [provider](#provider-2)
212
214
  * [equals](#equals-4)
213
- * [Parameters](#parameters-52)
215
+ * [Parameters](#parameters-53)
214
216
  * [delete](#delete-1)
215
217
  * [merge](#merge)
216
- * [Parameters](#parameters-53)
218
+ * [Parameters](#parameters-54)
217
219
  * [decline](#decline)
218
220
  * [reviews](#reviews)
219
221
  * [identifier](#identifier)
@@ -221,9 +223,9 @@ console.log(await readme.getString());
221
223
  * [defaultListStates](#defaultliststates)
222
224
  * [validMergeMethods](#validmergemethods)
223
225
  * [list](#list-1)
224
- * [Parameters](#parameters-54)
225
- * [open](#open)
226
226
  * [Parameters](#parameters-55)
227
+ * [open](#open)
228
+ * [Parameters](#parameters-56)
227
229
  * [title](#title)
228
230
  * [body](#body)
229
231
  * [state](#state)
@@ -233,19 +235,19 @@ console.log(await readme.getString());
233
235
  * [ContentEntry](#contententry)
234
236
  * [Properties](#properties-9)
235
237
  * [Ref](#ref)
236
- * [Parameters](#parameters-56)
238
+ * [Parameters](#parameters-57)
237
239
  * [equals](#equals-5)
238
- * [Parameters](#parameters-57)
240
+ * [Parameters](#parameters-58)
239
241
  * [ref](#ref-1)
240
242
  * [refId](#refid)
241
- * [Parameters](#parameters-58)
242
- * [entries](#entries)
243
243
  * [Parameters](#parameters-59)
244
+ * [entries](#entries)
245
+ * [Parameters](#parameters-60)
244
246
  * [asyncIterator](#asynciterator)
245
247
  * [maybeEntry](#maybeentry)
246
- * [Parameters](#parameters-60)
247
- * [entry](#entry)
248
248
  * [Parameters](#parameters-61)
249
+ * [entry](#entry)
250
+ * [Parameters](#parameters-62)
249
251
  * [owner](#owner)
250
252
  * [fullName](#fullname-3)
251
253
  * [fullCondensedName](#fullcondensedname)
@@ -261,30 +263,30 @@ console.log(await readme.getString());
261
263
  * [attributes](#attributes-1)
262
264
  * [isProtected](#isprotected-1)
263
265
  * [RepositoryGroup](#repositorygroup-1)
264
- * [Parameters](#parameters-62)
266
+ * [Parameters](#parameters-63)
265
267
  * [Properties](#properties-10)
266
268
  * [attributeMapping](#attributemapping-1)
267
269
  * [type](#type)
268
270
  * [url](#url-3)
269
271
  * [RepositoryOwner](#repositoryowner)
270
- * [Parameters](#parameters-63)
271
- * [Repository](#repository-2)
272
272
  * [Parameters](#parameters-64)
273
+ * [Repository](#repository-2)
274
+ * [Parameters](#parameters-65)
273
275
  * [Properties](#properties-11)
274
276
  * [fullName](#fullname-4)
275
277
  * [slug](#slug)
276
278
  * [provider](#provider-3)
277
279
  * [identifier](#identifier-2)
278
280
  * [equals](#equals-6)
279
- * [Parameters](#parameters-65)
280
- * [entry](#entry-1)
281
281
  * [Parameters](#parameters-66)
282
- * [entries](#entries-1)
282
+ * [entry](#entry-1)
283
283
  * [Parameters](#parameters-67)
284
- * [maybeEntry](#maybeentry-1)
284
+ * [entries](#entries-1)
285
285
  * [Parameters](#parameters-68)
286
- * [commits](#commits)
286
+ * [maybeEntry](#maybeentry-1)
287
287
  * [Parameters](#parameters-69)
288
+ * [commits](#commits)
289
+ * [Parameters](#parameters-70)
288
290
  * [urls](#urls)
289
291
  * [url](#url-4)
290
292
  * [cloneURL](#cloneurl)
@@ -298,40 +300,40 @@ console.log(await readme.getString());
298
300
  * [delete](#delete-2)
299
301
  * [defaultBranch](#defaultbranch)
300
302
  * [branch](#branch-2)
301
- * [Parameters](#parameters-70)
302
- * [branches](#branches-1)
303
303
  * [Parameters](#parameters-71)
304
- * [createBranch](#createbranch-1)
304
+ * [branches](#branches-1)
305
305
  * [Parameters](#parameters-72)
306
- * [addBranch](#addbranch)
306
+ * [createBranch](#createbranch-1)
307
307
  * [Parameters](#parameters-73)
308
- * [deleteBranch](#deletebranch)
308
+ * [addBranch](#addbranch)
309
309
  * [Parameters](#parameters-74)
310
- * [tag](#tag)
310
+ * [deleteBranch](#deletebranch)
311
311
  * [Parameters](#parameters-75)
312
- * [tags](#tags-1)
312
+ * [tag](#tag)
313
313
  * [Parameters](#parameters-76)
314
- * [addTag](#addtag)
314
+ * [tags](#tags-1)
315
315
  * [Parameters](#parameters-77)
316
- * [createPullRequest](#createpullrequest-1)
316
+ * [addTag](#addtag)
317
317
  * [Parameters](#parameters-78)
318
- * [addPullRequest](#addpullrequest)
318
+ * [createPullRequest](#createpullrequest-1)
319
319
  * [Parameters](#parameters-79)
320
+ * [addPullRequest](#addpullrequest)
321
+ * [Parameters](#parameters-80)
320
322
  * [pullRequests](#pullrequests-1)
321
323
  * [pullRequest](#pullrequest-1)
322
- * [Parameters](#parameters-80)
323
- * [deletePullRequest](#deletepullrequest)
324
324
  * [Parameters](#parameters-81)
325
- * [addHook](#addhook)
325
+ * [deletePullRequest](#deletepullrequest)
326
326
  * [Parameters](#parameters-82)
327
- * [createHook](#createhook)
327
+ * [addHook](#addhook)
328
328
  * [Parameters](#parameters-83)
329
+ * [createHook](#createhook)
330
+ * [Parameters](#parameters-84)
329
331
  * [hooks](#hooks-1)
330
332
  * [hook](#hook-1)
331
- * [Parameters](#parameters-84)
333
+ * [Parameters](#parameters-85)
332
334
  * [type](#type-1)
333
335
  * [refId](#refid-1)
334
- * [Parameters](#parameters-85)
336
+ * [Parameters](#parameters-86)
335
337
  * [toString](#tostring-1)
336
338
  * [toJSON](#tojson-3)
337
339
  * [attributes](#attributes-2)
@@ -341,23 +343,23 @@ console.log(await readme.getString());
341
343
  * [Review](#review)
342
344
  * [SingleGroupProvider](#singlegroupprovider)
343
345
  * [repository](#repository-3)
344
- * [Parameters](#parameters-86)
345
- * [repositoryGroup](#repositorygroup-2)
346
346
  * [Parameters](#parameters-87)
347
- * [repositoryGroups](#repositorygroups-1)
347
+ * [repositoryGroup](#repositorygroup-2)
348
348
  * [Parameters](#parameters-88)
349
+ * [repositoryGroups](#repositorygroups-1)
350
+ * [Parameters](#parameters-89)
349
351
  * [Tag](#tag-1)
350
- * [Parameters](#parameters-89)
352
+ * [Parameters](#parameters-90)
351
353
  * [refType](#reftype-1)
352
354
  * [isWritable](#iswritable-1)
353
355
  * [asArray](#asarray)
354
- * [Parameters](#parameters-90)
355
- * [stripBaseName](#stripbasename)
356
356
  * [Parameters](#parameters-91)
357
- * [stripBaseNames](#stripbasenames)
357
+ * [stripBaseName](#stripbasename)
358
358
  * [Parameters](#parameters-92)
359
- * [generateBranchName](#generatebranchname)
359
+ * [stripBaseNames](#stripbasenames)
360
360
  * [Parameters](#parameters-93)
361
+ * [generateBranchName](#generatebranchname)
362
+ * [Parameters](#parameters-94)
361
363
 
362
364
  ## Application
363
365
 
@@ -516,6 +518,14 @@ The provider we live in.
516
518
 
517
519
  Returns **[BaseProvider](#baseprovider)**
518
520
 
521
+ ### trace
522
+
523
+ Forwarded to the owner.
524
+
525
+ #### Parameters
526
+
527
+ * `args` **...any**
528
+
519
529
  ### info
520
530
 
521
531
  Forwarded to the owner.
@@ -870,10 +880,11 @@ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
870
880
 
871
881
  Extract options suitable for the constructor
872
882
  form the given set of environment variables.
883
+ Object with the detected key value pairs is delivered.
873
884
 
874
885
  #### Parameters
875
886
 
876
- * `env` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** as of from process.env
887
+ * `env` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** as from process.env
877
888
  * `instanceIdentifier` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** part of variable name. (optional, default `this.instanceIdentifier`)
878
889
 
879
890
  Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** undefined if no suitable environment variables have been found
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repository-provider",
3
- "version": "28.1.1",
3
+ "version": "28.2.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,7 +36,7 @@
36
36
  "ava": "^4.2.0",
37
37
  "c8": "^7.11.2",
38
38
  "documentation": "^13.2.5",
39
- "repository-provider-test-support": "^2.1.1",
39
+ "repository-provider-test-support": "^2.1.2",
40
40
  "semantic-release": "^19.0.2",
41
41
  "typescript": "^4.6.3"
42
42
  },
@@ -260,6 +260,15 @@ export class Repository extends NamedObject {
260
260
  * @return {Promise<Branch>}
261
261
  */
262
262
  async branch(name) {
263
+ if(name === this.defaultBranchName) {
264
+ const branch = this._branches.get(name);
265
+ if(branch) {
266
+ return branch;
267
+ }
268
+
269
+ return this.addBranch(name);
270
+ }
271
+
263
272
  await this.initializeBranches();
264
273
  return this._branches.get(name);
265
274
  }