@aaronshaf/ger 2.0.5 → 2.0.7

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@aaronshaf/ger",
3
- "version": "2.0.5",
3
+ "version": "2.0.7",
4
4
  "description": "Gerrit CLI and SDK - A modern CLI tool and TypeScript SDK for Gerrit Code Review, built with Effect-TS",
5
5
  "keywords": [
6
6
  "gerrit",
package/src/api/gerrit.ts CHANGED
@@ -215,7 +215,7 @@ export const GerritApiServiceLive: Layer.Layer<GerritApiService, never, ConfigSe
215
215
  const listChanges = (query = 'is:open') =>
216
216
  Effect.gen(function* () {
217
217
  const { credentials, authHeader } = yield* getCredentialsAndAuth
218
- const url = `${credentials.host}/a/changes/?q=${encodeURIComponent(query)}&o=LABELS&o=DETAILED_LABELS&o=DETAILED_ACCOUNTS&o=SUBMITTABLE`
218
+ const url = `${credentials.host}/a/changes/?q=${encodeURIComponent(query)}&o=LABELS&o=DETAILED_LABELS&o=DETAILED_ACCOUNTS&o=SUBMITTABLE&o=CURRENT_REVISION`
219
219
  return yield* makeRequest(url, authHeader, 'GET', undefined, Schema.Array(ChangeInfo))
220
220
  })
221
221
 
@@ -103,13 +103,51 @@ export const searchCommand = (
103
103
  changes: groupedChanges.flatMap(({ project, changes: projectChanges }) =>
104
104
  projectChanges.map((change) => ({
105
105
  number: change._number,
106
+ id: change.id,
107
+ change_id: change.change_id,
106
108
  subject: change.subject,
107
109
  status: change.status,
108
110
  project,
109
111
  branch: change.branch,
110
112
  owner: change.owner?.name ?? 'Unknown',
113
+ ...(change.owner?._account_id !== undefined
114
+ ? { owner_account_id: change.owner._account_id }
115
+ : {}),
111
116
  ...(change.owner?.email ? { owner_email: change.owner.email } : {}),
117
+ ...(change.owner?.username ? { owner_username: change.owner.username } : {}),
118
+ ...(change.created ? { created: change.created } : {}),
112
119
  ...(change.updated ? { updated: change.updated } : {}),
120
+ ...(change.insertions !== undefined ? { insertions: change.insertions } : {}),
121
+ ...(change.deletions !== undefined ? { deletions: change.deletions } : {}),
122
+ ...(change.current_revision ? { current_revision: change.current_revision } : {}),
123
+ ...(change.submittable !== undefined ? { submittable: change.submittable } : {}),
124
+ ...(change.work_in_progress !== undefined
125
+ ? { work_in_progress: change.work_in_progress }
126
+ : {}),
127
+ ...(change.topic ? { topic: change.topic } : {}),
128
+ ...(change.labels && Object.keys(change.labels).length > 0
129
+ ? { labels: change.labels }
130
+ : {}),
131
+ ...(change.reviewers?.REVIEWER && change.reviewers.REVIEWER.length > 0
132
+ ? {
133
+ reviewers: change.reviewers.REVIEWER.map((r) => ({
134
+ ...(r._account_id !== undefined ? { account_id: r._account_id } : {}),
135
+ ...(r.name ? { name: r.name } : {}),
136
+ ...(r.email ? { email: r.email } : {}),
137
+ ...(r.username ? { username: r.username } : {}),
138
+ })),
139
+ }
140
+ : {}),
141
+ ...(change.reviewers?.CC && change.reviewers.CC.length > 0
142
+ ? {
143
+ cc: change.reviewers.CC.map((r) => ({
144
+ ...(r._account_id !== undefined ? { account_id: r._account_id } : {}),
145
+ ...(r.name ? { name: r.name } : {}),
146
+ ...(r.email ? { email: r.email } : {}),
147
+ ...(r.username ? { username: r.username } : {}),
148
+ })),
149
+ }
150
+ : {}),
113
151
  })),
114
152
  ),
115
153
  }