firstly 0.10.4 → 0.10.6
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 +16 -0
- package/esm/carbone/CarboneController.js +117 -103
- package/esm/feedback/FeedbackController.js +310 -289
- package/esm/mail/ui/LastMails.svelte +2 -1
- package/esm/sqlAdmin/SqlAdminController.d.ts +1 -0
- package/esm/sqlAdmin/SqlAdminController.js +33 -25
- package/esm/sqlAdmin/SqlDriftController.js +25 -13
- package/esm/sqlAdmin/server/drift/catalog.d.ts +4 -0
- package/esm/sqlAdmin/server/drift/catalog.js +25 -0
- package/esm/sqlAdmin/server/drift/createIndex.d.ts +2 -0
- package/esm/sqlAdmin/server/drift/createIndex.js +2 -1
- package/esm/sqlAdmin/server/drift/ident.d.ts +16 -0
- package/esm/sqlAdmin/server/drift/ident.js +22 -0
- package/esm/sqlAdmin/server/drift/nullable.js +11 -12
- package/esm/sqlAdmin/server/drift/orphanColumns.js +9 -8
- package/esm/sqlAdmin/server/drift/planPkSync.d.ts +4 -3
- package/esm/sqlAdmin/server/drift/planPkSync.js +8 -12
- package/esm/sqlAdmin/server/drift/primaryKeys.js +13 -10
- package/esm/sqlAdmin/server/drift/relationIndexes.d.ts +3 -3
- package/esm/sqlAdmin/server/drift/relationIndexes.js +23 -12
- package/esm/sqlAdmin/ui/SqlDrift.svelte +25 -19
- package/esm/sqlAdmin/ui/SqlTokens.svelte +5 -4
- package/package.json +2 -2
|
@@ -66,319 +66,340 @@ async function addMetaData(issueId, obj) {
|
|
|
66
66
|
}
|
|
67
67
|
export class FeedbackController {
|
|
68
68
|
static async getMilestones() {
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
69
|
+
if (import.meta.env.SSR) {
|
|
70
|
+
const data = await getGitHub(`query Milestones(
|
|
71
|
+
$repository: String!
|
|
72
|
+
$owner: String!
|
|
73
|
+
$filter: String
|
|
74
|
+
$take: Int = 25
|
|
75
|
+
$cursor: String
|
|
76
|
+
) {
|
|
77
|
+
repository(name: $repository, owner: $owner) {
|
|
78
|
+
milestones(query: $filter, last: $take, after: $cursor, states: OPEN) {
|
|
79
|
+
pageInfo {
|
|
80
|
+
endCursor
|
|
81
|
+
}
|
|
82
|
+
nodes {
|
|
83
|
+
id
|
|
84
|
+
number
|
|
85
|
+
title
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
`, {
|
|
91
|
+
repository: remult.context.feedbackOptions.repo.name,
|
|
92
|
+
owner: remult.context.feedbackOptions.repo.owner,
|
|
93
|
+
filter: remult.context.feedbackOptions.milestones?.title_filter ?? '',
|
|
94
|
+
});
|
|
95
|
+
return data.repository.milestones.nodes.map((c) => {
|
|
96
|
+
return {
|
|
97
|
+
...c,
|
|
98
|
+
title: c.title
|
|
99
|
+
.replaceAll(remult.context.feedbackOptions.milestones?.title_filter ?? '', '')
|
|
100
|
+
.trim(),
|
|
101
|
+
};
|
|
102
|
+
});
|
|
86
103
|
}
|
|
87
|
-
|
|
88
|
-
}
|
|
89
|
-
`, {
|
|
90
|
-
repository: remult.context.feedbackOptions.repo.name,
|
|
91
|
-
owner: remult.context.feedbackOptions.repo.owner,
|
|
92
|
-
filter: remult.context.feedbackOptions.milestones?.title_filter ?? '',
|
|
93
|
-
});
|
|
94
|
-
return data.repository.milestones.nodes.map((c) => {
|
|
95
|
-
return {
|
|
96
|
-
...c,
|
|
97
|
-
title: c.title
|
|
98
|
-
.replaceAll(remult.context.feedbackOptions.milestones?.title_filter ?? '', '')
|
|
99
|
-
.trim(),
|
|
100
|
-
};
|
|
101
|
-
});
|
|
104
|
+
throw new Error('feedback.getMilestones: server-only');
|
|
102
105
|
}
|
|
103
106
|
static async getIssues(milestoneNumber, issueState) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
107
|
+
if (import.meta.env.SSR) {
|
|
108
|
+
const issueOrder = issueState === 'CLOSED'
|
|
109
|
+
? { field: 'UPDATED_AT', direction: 'DESC' } // When close, the last issue updated.
|
|
110
|
+
: null; // When open take milestone order
|
|
111
|
+
const data = await getGitHub(`query Issues(
|
|
112
|
+
$repository: String!
|
|
113
|
+
$owner: String!
|
|
114
|
+
$filters: IssueFilters
|
|
115
|
+
$milestoneNumber: Int!
|
|
116
|
+
$take: Int = 25
|
|
117
|
+
$cursor: String
|
|
118
|
+
$issueOrder: IssueOrder
|
|
119
|
+
) {
|
|
120
|
+
repository(name: $repository, owner: $owner) {
|
|
121
|
+
milestone(number: $milestoneNumber) {
|
|
122
|
+
issues(first: $take, after: $cursor, filterBy: $filters, orderBy: $issueOrder) {
|
|
123
|
+
nodes {
|
|
124
|
+
id
|
|
125
|
+
number
|
|
126
|
+
titleHTML
|
|
127
|
+
state
|
|
128
|
+
createdAt
|
|
129
|
+
updatedAt
|
|
130
|
+
labels(first:10){
|
|
131
|
+
nodes {
|
|
132
|
+
name
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
}
|
|
137
|
+
}
|
|
138
|
+
}
|
|
139
|
+
}
|
|
140
|
+
`, {
|
|
141
|
+
repository: remult.context.feedbackOptions.repo.name,
|
|
142
|
+
owner: remult.context.feedbackOptions.repo.owner,
|
|
143
|
+
milestoneNumber,
|
|
144
|
+
filters: {
|
|
145
|
+
// GitHub treats `labels: []` as "match nothing", so omit the key when unset.
|
|
146
|
+
labels: remult.context.feedbackOptions.milestones?.labels_filters?.length
|
|
147
|
+
? remult.context.feedbackOptions.milestones.labels_filters
|
|
148
|
+
: undefined,
|
|
149
|
+
states: [issueState],
|
|
150
|
+
},
|
|
151
|
+
issueOrder,
|
|
152
|
+
});
|
|
153
|
+
return data.repository.milestone.issues.nodes.map((issue) => {
|
|
154
|
+
const labels = issue.labels.nodes.map((label) => label.name);
|
|
155
|
+
const hasWaitingForAnswerLabel = remult.context.feedbackOptions.highlight_label
|
|
156
|
+
? labels.some((name) => name.includes(remult.context.feedbackOptions.highlight_label))
|
|
157
|
+
: false;
|
|
158
|
+
return {
|
|
159
|
+
id: issue.id,
|
|
160
|
+
number: issue.number,
|
|
161
|
+
titleHTML: issue.titleHTML,
|
|
162
|
+
state: issue.state,
|
|
163
|
+
createdAt: issue.createdAt,
|
|
164
|
+
updatedAt: issue.updatedAt,
|
|
165
|
+
labels,
|
|
166
|
+
highlight: hasWaitingForAnswerLabel,
|
|
167
|
+
};
|
|
168
|
+
});
|
|
169
|
+
}
|
|
170
|
+
throw new Error('feedback.getIssues: server-only');
|
|
171
|
+
}
|
|
172
|
+
static async getIssue(issueNumber) {
|
|
173
|
+
if (import.meta.env.SSR) {
|
|
174
|
+
const data = await getGitHub(`query Issue($repository: String!, $owner: String!, $issueNumber: Int!) {
|
|
175
|
+
repository(name: $repository, owner: $owner) {
|
|
176
|
+
issue(number: $issueNumber) {
|
|
177
|
+
id
|
|
178
|
+
createdAt
|
|
179
|
+
bodyHTML
|
|
180
|
+
state
|
|
181
|
+
title
|
|
182
|
+
labels(first: 25){
|
|
183
|
+
nodes{
|
|
184
|
+
id
|
|
185
|
+
name
|
|
186
|
+
}
|
|
187
|
+
}
|
|
188
|
+
comments(first: 100) {
|
|
189
|
+
nodes {
|
|
190
|
+
id
|
|
191
|
+
isMinimized
|
|
192
|
+
createdAt
|
|
193
|
+
body
|
|
194
|
+
bodyHTML
|
|
195
|
+
reactionGroups {
|
|
196
|
+
content
|
|
197
|
+
reactors(first: 1) {
|
|
198
|
+
totalCount
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
}
|
|
205
|
+
}
|
|
206
|
+
`, {
|
|
207
|
+
repository: remult.context.feedbackOptions.repo.name,
|
|
208
|
+
owner: remult.context.feedbackOptions.repo.owner,
|
|
209
|
+
issueNumber,
|
|
210
|
+
});
|
|
211
|
+
const items = [];
|
|
212
|
+
const firstItem = {
|
|
213
|
+
bodyHTML: data.repository.issue.bodyHTML,
|
|
214
|
+
createdAt: data.repository.issue.createdAt,
|
|
215
|
+
public: true,
|
|
216
|
+
title: data.repository.issue.title,
|
|
217
|
+
};
|
|
218
|
+
items.push(firstItem);
|
|
219
|
+
const comments = data.repository.issue.comments.nodes;
|
|
220
|
+
for (let i = 0; i < comments.length; i++) {
|
|
221
|
+
if (comments[i].isMinimized) {
|
|
222
|
+
const parsed = JSON.parse(comments[i].body.replaceAll('<pre>\n', '').replaceAll('\n</pre>', ''));
|
|
223
|
+
const last = items.at(-1);
|
|
224
|
+
last.who = parsed?.author ?? '???';
|
|
225
|
+
last.public = true;
|
|
226
|
+
}
|
|
227
|
+
else {
|
|
228
|
+
const nbEye = comments[i].reactionGroups.find((c) => c.content === 'EYES')?.reactors.totalCount;
|
|
229
|
+
items.push({
|
|
230
|
+
bodyHTML: comments[i].bodyHTML,
|
|
231
|
+
createdAt: new Date(comments[i].createdAt),
|
|
232
|
+
public: nbEye && nbEye > 0 ? true : false,
|
|
233
|
+
title: data.repository.issue.title,
|
|
234
|
+
});
|
|
130
235
|
}
|
|
131
|
-
}
|
|
132
236
|
}
|
|
133
|
-
}
|
|
134
|
-
}
|
|
135
|
-
}
|
|
136
|
-
`, {
|
|
137
|
-
repository: remult.context.feedbackOptions.repo.name,
|
|
138
|
-
owner: remult.context.feedbackOptions.repo.owner,
|
|
139
|
-
milestoneNumber,
|
|
140
|
-
filters: {
|
|
141
|
-
// GitHub treats `labels: []` as "match nothing", so omit the key when unset.
|
|
142
|
-
labels: remult.context.feedbackOptions.milestones?.labels_filters?.length
|
|
143
|
-
? remult.context.feedbackOptions.milestones.labels_filters
|
|
144
|
-
: undefined,
|
|
145
|
-
states: [issueState],
|
|
146
|
-
},
|
|
147
|
-
issueOrder,
|
|
148
|
-
});
|
|
149
|
-
return data.repository.milestone.issues.nodes.map((issue) => {
|
|
150
|
-
const labels = issue.labels.nodes.map((label) => label.name);
|
|
151
237
|
const hasWaitingForAnswerLabel = remult.context.feedbackOptions.highlight_label
|
|
152
|
-
? labels.some((
|
|
238
|
+
? data.repository.issue.labels.nodes.some((label) => label.name.includes(remult.context.feedbackOptions.highlight_label))
|
|
153
239
|
: false;
|
|
154
|
-
|
|
155
|
-
id: issue.id,
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
createdAt: issue.createdAt,
|
|
160
|
-
updatedAt: issue.updatedAt,
|
|
161
|
-
labels,
|
|
240
|
+
const toRet = {
|
|
241
|
+
id: data.repository.issue.id,
|
|
242
|
+
state: data.repository.issue.state,
|
|
243
|
+
items: items.filter((c) => c.public),
|
|
244
|
+
labels: data.repository.issue.labels.nodes,
|
|
162
245
|
highlight: hasWaitingForAnswerLabel,
|
|
246
|
+
title: data.repository.issue.title,
|
|
163
247
|
};
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
static async getIssue(issueNumber) {
|
|
167
|
-
const data = await getGitHub(`query Issue($repository: String!, $owner: String!, $issueNumber: Int!) {
|
|
168
|
-
repository(name: $repository, owner: $owner) {
|
|
169
|
-
issue(number: $issueNumber) {
|
|
170
|
-
id
|
|
171
|
-
createdAt
|
|
172
|
-
bodyHTML
|
|
173
|
-
state
|
|
174
|
-
title
|
|
175
|
-
labels(first: 25){
|
|
176
|
-
nodes{
|
|
177
|
-
id
|
|
178
|
-
name
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
comments(first: 100) {
|
|
182
|
-
nodes {
|
|
183
|
-
id
|
|
184
|
-
isMinimized
|
|
185
|
-
createdAt
|
|
186
|
-
body
|
|
187
|
-
bodyHTML
|
|
188
|
-
reactionGroups {
|
|
189
|
-
content
|
|
190
|
-
reactors(first: 1) {
|
|
191
|
-
totalCount
|
|
192
|
-
}
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
`, {
|
|
200
|
-
repository: remult.context.feedbackOptions.repo.name,
|
|
201
|
-
owner: remult.context.feedbackOptions.repo.owner,
|
|
202
|
-
issueNumber,
|
|
203
|
-
});
|
|
204
|
-
const items = [];
|
|
205
|
-
const firstItem = {
|
|
206
|
-
bodyHTML: data.repository.issue.bodyHTML,
|
|
207
|
-
createdAt: data.repository.issue.createdAt,
|
|
208
|
-
public: true,
|
|
209
|
-
title: data.repository.issue.title,
|
|
210
|
-
};
|
|
211
|
-
items.push(firstItem);
|
|
212
|
-
const comments = data.repository.issue.comments.nodes;
|
|
213
|
-
for (let i = 0; i < comments.length; i++) {
|
|
214
|
-
if (comments[i].isMinimized) {
|
|
215
|
-
const parsed = JSON.parse(comments[i].body.replaceAll('<pre>\n', '').replaceAll('\n</pre>', ''));
|
|
216
|
-
const last = items.at(-1);
|
|
217
|
-
last.who = parsed?.author ?? '???';
|
|
218
|
-
last.public = true;
|
|
219
|
-
}
|
|
220
|
-
else {
|
|
221
|
-
const nbEye = comments[i].reactionGroups.find((c) => c.content === 'EYES')?.reactors.totalCount;
|
|
222
|
-
items.push({
|
|
223
|
-
bodyHTML: comments[i].bodyHTML,
|
|
224
|
-
createdAt: new Date(comments[i].createdAt),
|
|
225
|
-
public: nbEye && nbEye > 0 ? true : false,
|
|
226
|
-
title: data.repository.issue.title,
|
|
227
|
-
});
|
|
228
|
-
}
|
|
248
|
+
return toRet;
|
|
229
249
|
}
|
|
230
|
-
|
|
231
|
-
? data.repository.issue.labels.nodes.some((label) => label.name.includes(remult.context.feedbackOptions.highlight_label))
|
|
232
|
-
: false;
|
|
233
|
-
const toRet = {
|
|
234
|
-
id: data.repository.issue.id,
|
|
235
|
-
state: data.repository.issue.state,
|
|
236
|
-
items: items.filter((c) => c.public),
|
|
237
|
-
labels: data.repository.issue.labels.nodes,
|
|
238
|
-
highlight: hasWaitingForAnswerLabel,
|
|
239
|
-
title: data.repository.issue.title,
|
|
240
|
-
};
|
|
241
|
-
return toRet;
|
|
250
|
+
throw new Error('feedback.getIssue: server-only');
|
|
242
251
|
}
|
|
243
252
|
static async createIssue(milestoneId, title, body, metadata,
|
|
244
253
|
/** Extra label names applied on top of `create_label` (unknown names are ignored). */
|
|
245
254
|
labels = []) {
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
255
|
+
if (import.meta.env.SSR) {
|
|
256
|
+
const repoInfo = await getGitHub(`query RepoInfo(
|
|
257
|
+
$repository: String!
|
|
258
|
+
$owner: String!
|
|
259
|
+
) {
|
|
260
|
+
repository(name: $repository, owner: $owner) {
|
|
261
|
+
id
|
|
262
|
+
labels(first: 25){
|
|
263
|
+
nodes{
|
|
264
|
+
id
|
|
265
|
+
name
|
|
266
|
+
}
|
|
267
|
+
}
|
|
268
|
+
}
|
|
269
|
+
}`, {
|
|
270
|
+
repository: remult.context.feedbackOptions.repo.name,
|
|
271
|
+
owner: remult.context.feedbackOptions.repo.owner,
|
|
272
|
+
});
|
|
273
|
+
const repoInfoData = repoInfo.repository;
|
|
274
|
+
const wanted = new Set([remult.context.feedbackOptions.create_label, ...labels]);
|
|
275
|
+
const labelIds = repoInfoData.labels.nodes.filter((c) => wanted.has(c.name)).map((c) => c.id);
|
|
276
|
+
const newIssue = await getGitHub(`mutation CreateIssue($input: CreateIssueInput!) {
|
|
277
|
+
createIssue(input: $input) {
|
|
278
|
+
issue {
|
|
279
|
+
id
|
|
280
|
+
number
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
`, {
|
|
285
|
+
input: {
|
|
286
|
+
repositoryId: repoInfoData.id,
|
|
287
|
+
milestoneId: milestoneId,
|
|
288
|
+
labelIds,
|
|
289
|
+
title: title ?? 'New Feedback (wo title...)',
|
|
290
|
+
body: body,
|
|
291
|
+
},
|
|
292
|
+
});
|
|
293
|
+
const toRet = newIssue.createIssue.issue;
|
|
294
|
+
const feedbackMetadata = remult.context.feedbackOptions.transformMetadata?.({
|
|
295
|
+
user: remult.user,
|
|
296
|
+
metadata,
|
|
297
|
+
}) ?? metadata;
|
|
298
|
+
await addMetaData(toRet.id, feedbackMetadata);
|
|
299
|
+
remult.context.feedbackOptions.saved?.({
|
|
300
|
+
number: toRet.number,
|
|
301
|
+
title: title,
|
|
302
|
+
body,
|
|
303
|
+
metadata: feedbackMetadata,
|
|
304
|
+
});
|
|
305
|
+
return toRet;
|
|
271
306
|
}
|
|
272
|
-
|
|
273
|
-
}
|
|
274
|
-
`, {
|
|
275
|
-
input: {
|
|
276
|
-
repositoryId: repoInfoData.id,
|
|
277
|
-
milestoneId: milestoneId,
|
|
278
|
-
labelIds,
|
|
279
|
-
title: title ?? 'New Feedback (wo title...)',
|
|
280
|
-
body: body,
|
|
281
|
-
},
|
|
282
|
-
});
|
|
283
|
-
const toRet = newIssue.createIssue.issue;
|
|
284
|
-
const feedbackMetadata = remult.context.feedbackOptions.transformMetadata?.({
|
|
285
|
-
user: remult.user,
|
|
286
|
-
metadata,
|
|
287
|
-
}) ?? metadata;
|
|
288
|
-
await addMetaData(toRet.id, feedbackMetadata);
|
|
289
|
-
remult.context.feedbackOptions.saved?.({
|
|
290
|
-
number: toRet.number,
|
|
291
|
-
title: title,
|
|
292
|
-
body,
|
|
293
|
-
metadata: feedbackMetadata,
|
|
294
|
-
});
|
|
295
|
-
return toRet;
|
|
307
|
+
throw new Error('feedback.createIssue: server-only');
|
|
296
308
|
}
|
|
297
309
|
static async addCommentOnIssue(issueId, issueNumber, title, body, metadata, labels) {
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
310
|
+
if (import.meta.env.SSR) {
|
|
311
|
+
const inputComment = {
|
|
312
|
+
subjectId: issueId,
|
|
313
|
+
body,
|
|
314
|
+
};
|
|
315
|
+
const inputIssue = {
|
|
316
|
+
id: issueId,
|
|
317
|
+
labelIds: (remult.context.feedbackOptions.highlight_label
|
|
318
|
+
? labels.filter((c) => c.name !== remult.context.feedbackOptions.highlight_label)
|
|
319
|
+
: labels).map((c) => c.id),
|
|
320
|
+
};
|
|
321
|
+
await getGitHub(`mutation AddComment($inputComment: AddCommentInput!, $inputIssue: UpdateIssueInput!) {
|
|
322
|
+
addComment(input: $inputComment) {
|
|
323
|
+
commentEdge {
|
|
324
|
+
node {
|
|
325
|
+
id
|
|
326
|
+
}
|
|
327
|
+
}
|
|
328
|
+
}
|
|
329
|
+
updateIssue(input: $inputIssue) {
|
|
330
|
+
issue {
|
|
331
|
+
id
|
|
332
|
+
}
|
|
333
|
+
}
|
|
334
|
+
}
|
|
335
|
+
`, {
|
|
336
|
+
inputComment,
|
|
337
|
+
inputIssue,
|
|
338
|
+
});
|
|
339
|
+
const feedbackMetadata = remult.context.feedbackOptions.transformMetadata?.({
|
|
340
|
+
user: remult.user,
|
|
341
|
+
metadata,
|
|
342
|
+
}) ?? metadata;
|
|
343
|
+
await addMetaData(issueId, feedbackMetadata);
|
|
344
|
+
remult.context.feedbackOptions.saved?.({
|
|
345
|
+
number: issueNumber,
|
|
346
|
+
title,
|
|
347
|
+
body,
|
|
348
|
+
metadata: feedbackMetadata,
|
|
349
|
+
});
|
|
350
|
+
return 'done';
|
|
320
351
|
}
|
|
321
|
-
|
|
322
|
-
`, {
|
|
323
|
-
inputComment,
|
|
324
|
-
inputIssue,
|
|
325
|
-
});
|
|
326
|
-
const feedbackMetadata = remult.context.feedbackOptions.transformMetadata?.({
|
|
327
|
-
user: remult.user,
|
|
328
|
-
metadata,
|
|
329
|
-
}) ?? metadata;
|
|
330
|
-
await addMetaData(issueId, feedbackMetadata);
|
|
331
|
-
remult.context.feedbackOptions.saved?.({
|
|
332
|
-
number: issueNumber,
|
|
333
|
-
title,
|
|
334
|
-
body,
|
|
335
|
-
metadata: feedbackMetadata,
|
|
336
|
-
});
|
|
337
|
-
return 'done';
|
|
352
|
+
throw new Error('feedback.addCommentOnIssue: server-only');
|
|
338
353
|
}
|
|
339
354
|
static async close(issueId, labels) {
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
355
|
+
if (import.meta.env.SSR) {
|
|
356
|
+
const inputClose = {
|
|
357
|
+
issueId,
|
|
358
|
+
};
|
|
359
|
+
const inputIssue = {
|
|
360
|
+
id: issueId,
|
|
361
|
+
labelIds: (remult.context.feedbackOptions.highlight_label
|
|
362
|
+
? labels.filter((c) => c.name !== remult.context.feedbackOptions.highlight_label)
|
|
363
|
+
: labels).map((c) => c.id),
|
|
364
|
+
};
|
|
365
|
+
await getGitHub(`mutation CloseIssue($inputIssue: UpdateIssueInput!, $inputClose: CloseIssueInput!) {
|
|
366
|
+
updateIssue(input: $inputIssue) {
|
|
367
|
+
issue {
|
|
368
|
+
id
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
closeIssue(input: $inputClose) {
|
|
372
|
+
issue {
|
|
373
|
+
id
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
}
|
|
377
|
+
`, {
|
|
378
|
+
inputIssue,
|
|
379
|
+
inputClose,
|
|
380
|
+
});
|
|
381
|
+
return 'done';
|
|
359
382
|
}
|
|
360
|
-
|
|
361
|
-
`, {
|
|
362
|
-
inputIssue,
|
|
363
|
-
inputClose,
|
|
364
|
-
});
|
|
365
|
-
return 'done';
|
|
383
|
+
throw new Error('feedback.close: server-only');
|
|
366
384
|
}
|
|
367
385
|
static async reOpen(issueId) {
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
386
|
+
if (import.meta.env.SSR) {
|
|
387
|
+
const input = {
|
|
388
|
+
issueId,
|
|
389
|
+
};
|
|
390
|
+
await getGitHub(`mutation ReOpenIssue($input: ReopenIssueInput!) {
|
|
391
|
+
reopenIssue(input: $input) {
|
|
392
|
+
issue {
|
|
393
|
+
id
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
`, {
|
|
398
|
+
input,
|
|
399
|
+
});
|
|
400
|
+
return 'done';
|
|
376
401
|
}
|
|
377
|
-
|
|
378
|
-
`, {
|
|
379
|
-
input,
|
|
380
|
-
});
|
|
381
|
-
return 'done';
|
|
402
|
+
throw new Error('feedback.reOpen: server-only');
|
|
382
403
|
}
|
|
383
404
|
}
|
|
384
405
|
__decorate([
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import { remult, repo } from 'remult'
|
|
5
5
|
|
|
6
|
+
import { errorMessage } from '../../core/helper.js'
|
|
6
7
|
import { Mail } from '../Mail'
|
|
7
8
|
import { Roles_Mail } from '../Roles_Mail'
|
|
8
9
|
|
|
@@ -28,7 +29,7 @@
|
|
|
28
29
|
try {
|
|
29
30
|
mails = await repo(Mail).find({ limit })
|
|
30
31
|
} catch (e) {
|
|
31
|
-
error =
|
|
32
|
+
error = errorMessage(e)
|
|
32
33
|
} finally {
|
|
33
34
|
isLoading = false
|
|
34
35
|
}
|
|
@@ -50,6 +50,7 @@ export type SqlTokensOptions = {
|
|
|
50
50
|
/** Override the pool used by `read` tokens. Defaults to the Postgres pool behind the data provider. */
|
|
51
51
|
pool?: SqlTokenPool;
|
|
52
52
|
};
|
|
53
|
+
export declare const SERVER_ONLY = "sqlAdmin: server-only";
|
|
53
54
|
export declare const SQL_ADMINS: ("FF_Role.Admin" | "SqlAdmin.Admin")[];
|
|
54
55
|
export declare class SqlAdminController {
|
|
55
56
|
/** Optional override set by the `sqlAdmin()` module's `initApi`. Falls back to `SqlDatabase.getDb()`. */
|