@madewithremy/admin 0.1.24 → 0.1.25
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/dist/index.d.ts +24 -4
- package/dist/index.js +27 -8
- package/dist/index.js.map +1 -1
- package/dist/prod.js +25 -6
- package/package.json +1 -1
package/dist/prod.js
CHANGED
|
@@ -2323,6 +2323,9 @@ Examples:
|
|
|
2323
2323
|
import fs from "fs";
|
|
2324
2324
|
|
|
2325
2325
|
// src/ops/issues.ts
|
|
2326
|
+
function authorship(ctx) {
|
|
2327
|
+
return ctx.originAppId ? { originAppId: ctx.originAppId } : {};
|
|
2328
|
+
}
|
|
2326
2329
|
function listQuery(params) {
|
|
2327
2330
|
return qs({
|
|
2328
2331
|
status: params.status,
|
|
@@ -2364,8 +2367,9 @@ function create(ctx, params) {
|
|
|
2364
2367
|
if (params.labels !== void 0) {
|
|
2365
2368
|
requestBody.labels = params.labels;
|
|
2366
2369
|
}
|
|
2367
|
-
|
|
2368
|
-
|
|
2370
|
+
const originAppId = params.originAppId ?? ctx.originAppId;
|
|
2371
|
+
if (originAppId !== void 0) {
|
|
2372
|
+
requestBody.originAppId = originAppId;
|
|
2369
2373
|
}
|
|
2370
2374
|
return call(
|
|
2371
2375
|
ctx,
|
|
@@ -2379,13 +2383,14 @@ function comment(ctx, number, body) {
|
|
|
2379
2383
|
ctx,
|
|
2380
2384
|
"POST",
|
|
2381
2385
|
`/_internal/v2/apps/${ctx.appId}/issues/${seg(number)}/comments`,
|
|
2382
|
-
{ body, authorKind: "agent" }
|
|
2386
|
+
{ body, authorKind: "agent", ...authorship(ctx) }
|
|
2383
2387
|
);
|
|
2384
2388
|
}
|
|
2385
2389
|
function close(ctx, number, comment2) {
|
|
2386
2390
|
const requestBody = {
|
|
2387
2391
|
status: "closed",
|
|
2388
|
-
authorKind: "agent"
|
|
2392
|
+
authorKind: "agent",
|
|
2393
|
+
...authorship(ctx)
|
|
2389
2394
|
};
|
|
2390
2395
|
if (comment2 !== void 0) {
|
|
2391
2396
|
requestBody.comment = comment2;
|
|
@@ -2402,11 +2407,14 @@ function reopen(ctx, number) {
|
|
|
2402
2407
|
ctx,
|
|
2403
2408
|
"POST",
|
|
2404
2409
|
`/_internal/v2/apps/${ctx.appId}/issues/${seg(number)}/update`,
|
|
2405
|
-
{ status: "open", authorKind: "agent" }
|
|
2410
|
+
{ status: "open", authorKind: "agent", ...authorship(ctx) }
|
|
2406
2411
|
);
|
|
2407
2412
|
}
|
|
2408
2413
|
function edit(ctx, number, params) {
|
|
2409
|
-
const requestBody = {
|
|
2414
|
+
const requestBody = {
|
|
2415
|
+
authorKind: "agent",
|
|
2416
|
+
...authorship(ctx)
|
|
2417
|
+
};
|
|
2410
2418
|
if (params.title !== void 0) {
|
|
2411
2419
|
requestBody.title = params.title;
|
|
2412
2420
|
}
|
|
@@ -8529,9 +8537,20 @@ async function main() {
|
|
|
8529
8537
|
fatal("MINDSTUDIO_API_KEY environment variable is not set");
|
|
8530
8538
|
}
|
|
8531
8539
|
const appIdOverride = a.str("app");
|
|
8540
|
+
let originAppId;
|
|
8541
|
+
if (appIdOverride) {
|
|
8542
|
+
try {
|
|
8543
|
+
const workspaceAppId = loadWorkspaceAppId();
|
|
8544
|
+
if (workspaceAppId !== appIdOverride) {
|
|
8545
|
+
originAppId = workspaceAppId;
|
|
8546
|
+
}
|
|
8547
|
+
} catch {
|
|
8548
|
+
}
|
|
8549
|
+
}
|
|
8532
8550
|
const ctx = {
|
|
8533
8551
|
apiKey,
|
|
8534
8552
|
appId: appIdOverride ?? loadWorkspaceAppId(),
|
|
8553
|
+
originAppId,
|
|
8535
8554
|
baseUrl: process.env["API_BASE_URL"] || DEFAULT_BASE_URL
|
|
8536
8555
|
};
|
|
8537
8556
|
return HANDLERS[route.key](ctx, a);
|