@selvajs/selva 4.21.0-beta.17 → 4.21.0-beta.19
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/build/adapter-node.js +1 -1
- package/build/client/_app/immutable/chunks/a5NclWb-.js +2 -0
- package/build/client/_app/immutable/chunks/a5NclWb-.js.br +0 -0
- package/build/client/_app/immutable/chunks/a5NclWb-.js.gz +0 -0
- package/build/client/_app/immutable/entry/{app.CqykPefk.js → app.D3YN7-nC.js} +2 -2
- package/build/client/_app/immutable/entry/app.D3YN7-nC.js.br +0 -0
- package/build/client/_app/immutable/entry/app.D3YN7-nC.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{20.B2EnikH5.js → 20.B8bN-AYw.js} +1 -1
- package/build/client/_app/immutable/nodes/20.B8bN-AYw.js.br +0 -0
- package/build/client/_app/immutable/nodes/20.B8bN-AYw.js.gz +0 -0
- package/build/client/_app/immutable/nodes/{25.C7VDbaM3.js → 25.DbMk0htM.js} +20 -20
- package/build/client/_app/immutable/nodes/25.DbMk0htM.js.br +0 -0
- package/build/client/_app/immutable/nodes/25.DbMk0htM.js.gz +0 -0
- package/build/client/_app/version.json +1 -1
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/server/.vite/manifest.json +58 -2
- package/build/server/chunks/DefinitionCard.js +1 -1
- package/build/server/chunks/DefinitionCard.js.map +1 -1
- package/build/server/chunks/api.js +1 -1
- package/build/server/chunks/baseHDR.js +5 -0
- package/build/server/chunks/baseHDR.js.map +1 -0
- package/build/server/chunks/capture.js +5 -0
- package/build/server/chunks/capture.js.map +1 -0
- package/build/server/chunks/diff.js +1 -8
- package/build/server/chunks/diff.js.map +1 -1
- package/build/server/chunks/grasshopper.js +23 -1
- package/build/server/chunks/grasshopper.js.map +1 -1
- package/build/server/chunks/handlers.js +71 -25
- package/build/server/chunks/handlers.js.map +1 -1
- package/build/server/chunks/instance.js +3 -3
- package/build/server/chunks/instanceAdmins.server.js +1 -1
- package/build/server/chunks/internal.js +1 -1
- package/build/server/chunks/inventory.js +59 -16
- package/build/server/chunks/inventory.js.map +1 -1
- package/build/server/chunks/package.js +2 -1
- package/build/server/chunks/package.js.map +1 -1
- package/build/server/chunks/path.js +7 -0
- package/build/server/chunks/path.js.map +1 -0
- package/build/server/chunks/presets.server.js +1 -1
- package/build/server/chunks/providers.server.js +21 -12
- package/build/server/chunks/providers.server.js.map +1 -1
- package/build/server/chunks/registry.js +18 -3
- package/build/server/chunks/registry.js.map +1 -1
- package/build/server/chunks/solve.js +5 -0
- package/build/server/chunks/solve.js.map +1 -0
- package/build/server/chunks/stash-instance.js +94 -0
- package/build/server/chunks/stash-instance.js.map +1 -0
- package/build/server/chunks/sveltekit.js +2 -1
- package/build/server/chunks/sveltekit.js.map +1 -1
- package/build/server/chunks/types4.js +10 -0
- package/build/server/chunks/types4.js.map +1 -0
- package/build/server/entries/endpoints/api/admin/users/_id_/disable/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/image/_server.ts.js +3 -2
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/image/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/publish/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/schema/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/share-links/_linkId_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/share-links/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/_versionId_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/_versionId_/changes/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/_versionId_/inventory/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/_versionId_/schema/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/_versionId_/scripts/_scriptId_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_guid_/versions/check/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/definitions/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/me/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/me/starred/_guid_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/me/token/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/orgs/_orgId_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/orgs/_orgId_/assets/_kind_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/orgs/_orgId_/members/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/orgs/_orgId_/members/_userId_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/orgs/_orgId_/tokens/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/orgs/_orgId_/tokens/_tokenId_/_server.ts.js +1 -1
- package/build/server/entries/endpoints/api/v1/projects/_id_/reclaim/_server.ts.js +1 -1
- package/build/server/entries/endpoints/docs/api/openapi.yaml/_server.ts.js +1 -1
- package/build/server/entries/endpoints/mcp/_server.ts.js +1232 -92
- package/build/server/entries/endpoints/mcp/_server.ts.js.map +1 -1
- package/build/server/entries/endpoints/mcp/files/_token_/_name_/_server.ts.js +18 -0
- package/build/server/entries/endpoints/mcp/files/_token_/_name_/_server.ts.js.map +1 -0
- package/build/server/entries/hooks.server.js +8 -3
- package/build/server/entries/hooks.server.js.map +1 -1
- package/build/server/entries/pages/projects/_page.svelte.js +12 -6
- package/build/server/entries/pages/projects/_page.svelte.js.map +1 -1
- package/build/server/entries/pages/team/tokens/_page.server.ts.js +1 -1
- package/build/server/manifest-full.js +8 -1
- package/build/server/manifest.js +8 -1
- package/build/server/nodes/20.js +1 -1
- package/build/server/nodes/25.js +1 -1
- package/build/server/server.js +8 -1
- package/package.json +7 -6
- package/templates/.env.example +6 -0
- package/build/client/_app/immutable/chunks/Cv7GBWJh.js +0 -2
- package/build/client/_app/immutable/chunks/Cv7GBWJh.js.br +0 -0
- package/build/client/_app/immutable/chunks/Cv7GBWJh.js.gz +0 -0
- package/build/client/_app/immutable/entry/app.CqykPefk.js.br +0 -0
- package/build/client/_app/immutable/entry/app.CqykPefk.js.gz +0 -0
- package/build/client/_app/immutable/nodes/20.B2EnikH5.js.br +0 -0
- package/build/client/_app/immutable/nodes/20.B2EnikH5.js.gz +0 -0
- package/build/client/_app/immutable/nodes/25.C7VDbaM3.js.br +0 -0
- package/build/client/_app/immutable/nodes/25.C7VDbaM3.js.gz +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { q as actorOf } from "./providers.server.js";
|
|
1
|
+
import { J as definitionPaths, q as actorOf } from "./providers.server.js";
|
|
2
2
|
import { $ as canView, G as scopeAllows, K as canChangeOrgRole, O as ApiErrorCode, Q as canSolve, S as requireManageOrgMembers, T as requireTargetIsOrgMember, W as outsideTokenOrg, Y as canEdit, _ as requireEditableDefinition, a as canCreateProjectIn, et as checkOwnerRemoval, f as requireCanEditProjectSettings, g as requireCanViewProject, i as canActorChangeOrgRole, j as isApiError, k as apiError, l as requireCanCreateDefinition, m as requireCanReclaim, o as projectAccessInputFromRowsWith, p as requireCanManage, q as canCreateDefinition, r as assertCanGrantPlatformPermissions, s as requireActingOrg, t as splitFlatPermissions, u as requireCanCreateProject, w as requireProjectVisibilityAllowed, x as requireManageOrgCompute } from "./access.js";
|
|
3
3
|
import { a as formatApiScope, i as describeApiScope, o as parseApiScope } from "./types.js";
|
|
4
4
|
import { r as hasPermission, t as SYSTEM_CONTEXT } from "./context.js";
|
|
@@ -7,9 +7,10 @@ import { n as GH_EXTENSIONS, r as toDefinitionListItem, t as COVER_IMAGE_CONTENT
|
|
|
7
7
|
import { a as toSourceDocumentId, r as GuidSchema } from "./schemas.js";
|
|
8
8
|
import { n as MAX_CHANGE_NOTE_LENGTH, t as CreateDefinitionInputSchema } from "./bodies.js";
|
|
9
9
|
import { a as MEMBER_ASSIGNABLE_PERMISSIONS, f as slugify, i as DEFAULT_ORG_PERMISSIONS, n as ALL_ORG_PERMISSIONS, s as OrgAssetKindSchema } from "./schemas2.js";
|
|
10
|
-
import { B as parseParam, G as requireUpload, H as requireCaller, K as throwZodError, L as scopeRefusalsToday, N as assertScope, R as formText, U as requireParams, V as readForm, W as requireSession, _ as UpdateDefinitionBodySchema, a as InviteResponseSchema, b as UpdateProjectMemberBodySchema, c as AddProjectMemberBodySchema, d as CreateProjectBodySchema, f as CreateShareLinkBodySchema, i as CreatedShareLinkResponseSchema, k as defaultProjectCreateLimiter, l as CreateApiTokenBodySchema, m as PublishVersionBodySchema, n as CreatedApiTokenResponseSchema, o as OrgComputeResponseSchema, p as OrgComputePatchBodySchema,
|
|
11
|
-
import {
|
|
10
|
+
import { B as parseParam, G as requireUpload, H as requireCaller, J as validateProjectFlags, K as throwZodError, L as scopeRefusalsToday, N as assertScope, R as formText, U as requireParams, V as readForm, W as requireSession, _ as UpdateDefinitionBodySchema, a as InviteResponseSchema, b as UpdateProjectMemberBodySchema, c as AddProjectMemberBodySchema, d as CreateProjectBodySchema, f as CreateShareLinkBodySchema, i as CreatedShareLinkResponseSchema, k as defaultProjectCreateLimiter, l as CreateApiTokenBodySchema, m as PublishVersionBodySchema, n as CreatedApiTokenResponseSchema, o as OrgComputeResponseSchema, p as OrgComputePatchBodySchema, r as CreatedInviteResponseSchema, s as ShareLinkResponseSchema, t as ApiTokenResponseSchema, u as CreateInviteBodySchema, v as UpdateOrgMemberBodySchema, y as UpdateProjectBodySchema, z as parseBody } from "./api.js";
|
|
11
|
+
import { t as DEFAULT_SHARE_LINK_MAX_SOLVES } from "./types4.js";
|
|
12
12
|
import { c as listEditableDefinitionsByDocument, d as loadVisibleVersion, f as mayUploadToDefinition, l as listVisibleDefinitions, m as clampPageLimit, p as resolveAccessibleProjects, s as getVisibleDefinition, u as loadVisibleDefinition, v as walkPages } from "./logging.js";
|
|
13
|
+
import { t as diffSchemas } from "./diff.js";
|
|
13
14
|
import { a as extractSchemaForUpload, c as fetchScriptSources, o as fetchExtraction } from "./errors.js";
|
|
14
15
|
import { n as resolveServerForOrg } from "./resolve-server.js";
|
|
15
16
|
import { n as validateIncomingServers, r as evictChangedServers, t as mergeApiKeys } from "./server-config-write.js";
|
|
@@ -54,7 +55,7 @@ function escapeHtml(s) {
|
|
|
54
55
|
}
|
|
55
56
|
// ../notifications/src/layout.ts
|
|
56
57
|
/**
|
|
57
|
-
* The frame every
|
|
58
|
+
* The frame every mail shares: card chrome, type stack, colours.
|
|
58
59
|
* Templates supply a body; this supplies the look, so mail written by
|
|
59
60
|
* different people at different times still reads as coming from one product.
|
|
60
61
|
*
|
|
@@ -86,9 +87,9 @@ function renderButton(href, label) {
|
|
|
86
87
|
* point is a link needs this: a button that does not render leaves the reader
|
|
87
88
|
* with no way to continue.
|
|
88
89
|
*/
|
|
89
|
-
function renderUrlFallback(href) {
|
|
90
|
+
function renderUrlFallback(href, label = "Or paste this into your browser:") {
|
|
90
91
|
return `<p style="margin:24px 0 0;font-size:13px;line-height:1.5;color:#6b6b6b;">
|
|
91
|
-
|
|
92
|
+
${escapeHtml(label)}<br />
|
|
92
93
|
<span style="word-break:break-all;color:#4a4a4a;">${escapeHtml(href)}</span>
|
|
93
94
|
</p>`;
|
|
94
95
|
}
|
|
@@ -108,15 +109,15 @@ function formatExpiry(iso) {
|
|
|
108
109
|
* is still the only way the invitee can accept.
|
|
109
110
|
*/
|
|
110
111
|
function renderInviteEmail(input) {
|
|
111
|
-
const { to, acceptUrl, orgName, invitedBy } = input;
|
|
112
|
+
const { to, acceptUrl, orgName, invitedBy, productName = "Selva" } = input;
|
|
112
113
|
const expiry = formatExpiry(input.expiresAt);
|
|
113
114
|
const inviter = invitedBy ? `${invitedBy} invited you` : "You have been invited";
|
|
114
115
|
return {
|
|
115
116
|
kind: "org.invite",
|
|
116
117
|
to,
|
|
117
|
-
subject: `${inviter} to join ${orgName} on
|
|
118
|
+
subject: `${inviter} to join ${orgName} on ${productName}`,
|
|
118
119
|
text: [
|
|
119
|
-
`${inviter} to join ${orgName} on
|
|
120
|
+
`${inviter} to join ${orgName} on ${productName}.`,
|
|
120
121
|
"",
|
|
121
122
|
"Open this link to accept and set up your account:",
|
|
122
123
|
acceptUrl,
|
|
@@ -126,7 +127,7 @@ function renderInviteEmail(input) {
|
|
|
126
127
|
"If you weren't expecting this invitation, you can ignore this email."
|
|
127
128
|
].join("\n"),
|
|
128
129
|
html: renderLayout({
|
|
129
|
-
heading: `Join ${orgName} on
|
|
130
|
+
heading: `Join ${orgName} on ${productName}`,
|
|
130
131
|
body: ` <p style="margin:0 0 24px;font-size:15px;line-height:1.5;color:#4a4a4a;">
|
|
131
132
|
${escapeHtml(inviter)} to join <strong>${escapeHtml(orgName)}</strong>. Open the link below to accept and set up your account.
|
|
132
133
|
</p>
|
|
@@ -151,14 +152,14 @@ function formatDate(iso) {
|
|
|
151
152
|
* the owner didn't create it, so the revoke link leads.
|
|
152
153
|
*/
|
|
153
154
|
function renderApiTokenCreatedEmail(input) {
|
|
154
|
-
const { to, tokenName, orgName, scopes, manageUrl } = input;
|
|
155
|
+
const { to, tokenName, orgName, scopes, manageUrl, productName = "Selva" } = input;
|
|
155
156
|
const expiry = formatDate(input.expiresAt);
|
|
156
157
|
return {
|
|
157
158
|
kind: "api_token.created",
|
|
158
159
|
to,
|
|
159
160
|
subject: `New API token "${tokenName}" in ${orgName}`,
|
|
160
161
|
text: [
|
|
161
|
-
`A new API token named "${tokenName}" was created on your
|
|
162
|
+
`A new API token named "${tokenName}" was created on your ${productName} account in ${orgName}.`,
|
|
162
163
|
"",
|
|
163
164
|
"It can:",
|
|
164
165
|
...scopes.map((s) => `- ${s}`),
|
|
@@ -193,14 +194,16 @@ function renderApiTokenCreatedEmail(input) {
|
|
|
193
194
|
*/
|
|
194
195
|
async function deliverInvite(input) {
|
|
195
196
|
const { ctx, log, invite, acceptUrl, actor, orgs, notifications, fallbackOrgName } = input;
|
|
197
|
+
const render = input.render ?? renderInviteEmail;
|
|
196
198
|
try {
|
|
197
199
|
const org = await orgs.getOrg(ctx, invite.orgId);
|
|
198
|
-
const { status } = await notifications.send(
|
|
200
|
+
const { status } = await notifications.send(await render({
|
|
199
201
|
to: invite.email,
|
|
200
202
|
acceptUrl,
|
|
201
203
|
orgName: org?.name ?? fallbackOrgName,
|
|
202
204
|
invitedBy: actor.profile?.displayName || actor.user?.email,
|
|
203
|
-
expiresAt: invite.expiresAt
|
|
205
|
+
expiresAt: invite.expiresAt,
|
|
206
|
+
productName: input.productName
|
|
204
207
|
}), log);
|
|
205
208
|
return status;
|
|
206
209
|
} catch (err) {
|
|
@@ -468,13 +471,15 @@ async function mailTokenCreated(req, token) {
|
|
|
468
471
|
if (!notifications || !to) return;
|
|
469
472
|
try {
|
|
470
473
|
const org = await req.deps.orgs.getOrg(req.ctx, token.orgId);
|
|
471
|
-
|
|
474
|
+
const render = req.deps.mailTemplates?.apiTokenCreated ?? renderApiTokenCreatedEmail;
|
|
475
|
+
await notifications.send(await render({
|
|
472
476
|
to,
|
|
473
477
|
tokenName: token.name,
|
|
474
478
|
orgName: org?.name ?? req.deps.instanceName,
|
|
475
479
|
scopes: token.scopes.map(describeApiScope),
|
|
476
480
|
expiresAt: token.expiresAt,
|
|
477
|
-
manageUrl: `${req.url.origin}${req.deps.apiTokenSettingsPath}
|
|
481
|
+
manageUrl: `${req.url.origin}${req.deps.apiTokenSettingsPath}`,
|
|
482
|
+
productName: req.deps.instanceName
|
|
478
483
|
}), req.log);
|
|
479
484
|
} catch (err) {
|
|
480
485
|
req.log.warn("API token mail could not be sent", {
|
|
@@ -976,25 +981,40 @@ function withDefaultsOf(schema, base) {
|
|
|
976
981
|
} : input)
|
|
977
982
|
};
|
|
978
983
|
}
|
|
984
|
+
function pluginRequirements(inventory) {
|
|
985
|
+
return inventory.libraries.filter((l) => !l.core).map((l) => ({
|
|
986
|
+
name: l.name,
|
|
987
|
+
version: l.version,
|
|
988
|
+
serverVersion: l.serverVersion ?? null
|
|
989
|
+
}));
|
|
990
|
+
}
|
|
979
991
|
function inventoryReport(inventory, schema, base) {
|
|
980
992
|
if (!inventory) return null;
|
|
981
993
|
const formIds = [...schema?.inputs ?? [], ...base?.schema?.inputs ?? []].map((i) => i.id);
|
|
982
994
|
return {
|
|
983
995
|
summary: summarizeInventory(inventory),
|
|
984
996
|
warnings: inventoryWarnings(inventory),
|
|
997
|
+
plugins: pluginRequirements(inventory),
|
|
998
|
+
extractedWith: inventory.extractedWith,
|
|
985
999
|
diff: base?.inventory ? diffInventories(base.inventory, inventory, { formIds }) : null,
|
|
986
1000
|
missing: base && !base.inventory ? "base" : null
|
|
987
1001
|
};
|
|
988
1002
|
}
|
|
989
1003
|
/**
|
|
990
|
-
* A plugin the server lacks
|
|
991
|
-
* missing, so it blocks the upload unless the caller
|
|
992
|
-
* being installed. The version's summary keeps
|
|
1004
|
+
* A plugin the server lacks, or a component its installed release lacks, makes every solve drop
|
|
1005
|
+
* those components and succeed with outputs missing, so it blocks the upload unless the caller
|
|
1006
|
+
* accepts that, e.g. while the plugin is still being installed. The version's summary keeps
|
|
1007
|
+
* saying so until a check finds them.
|
|
993
1008
|
*/
|
|
994
1009
|
function guardPlugins(inventory, accepted) {
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
1010
|
+
if (!inventory || accepted) return;
|
|
1011
|
+
const { missingPlugins, unloadedComponents = [] } = summarizeInventory(inventory);
|
|
1012
|
+
if (!missingPlugins.length && !unloadedComponents.length) return;
|
|
1013
|
+
const lacks = [missingPlugins.length && `${missingPlugins.join(", ")} installed`, unloadedComponents.length && `the components ${unloadedComponents.join(", ")} (its plugin release is older than the file's)`].filter(Boolean);
|
|
1014
|
+
apiError(422, ApiErrorCode.UNPROCESSABLE, `The Compute server does not have ${lacks.join(", nor ")}, so solves would drop those components and miss their outputs. Install or update the plugin first, or upload anyway with acceptMissingPlugins=true.`, void 0, {
|
|
1015
|
+
missingPlugins: missingPlugins.join(", "),
|
|
1016
|
+
unloadedComponents: unloadedComponents.join(", ")
|
|
1017
|
+
});
|
|
998
1018
|
}
|
|
999
1019
|
/** The version an upload follows: the draft it replaces, else the live one. */
|
|
1000
1020
|
async function loadBase(req, ctx, record) {
|
|
@@ -1126,7 +1146,9 @@ var refreshVersionInventory = async (req) => {
|
|
|
1126
1146
|
await req.deps.definitionMeta.setVersionInventory(ctx, version.id, inventory, summary);
|
|
1127
1147
|
return { body: {
|
|
1128
1148
|
summary,
|
|
1129
|
-
warnings: inventoryWarnings(inventory)
|
|
1149
|
+
warnings: inventoryWarnings(inventory),
|
|
1150
|
+
plugins: pluginRequirements(inventory),
|
|
1151
|
+
extractedWith: inventory.extractedWith
|
|
1130
1152
|
} };
|
|
1131
1153
|
};
|
|
1132
1154
|
/**
|
|
@@ -1389,6 +1411,19 @@ var uploadDefinitionImage = async (req) => {
|
|
|
1389
1411
|
const data = new Uint8Array(await file.arrayBuffer());
|
|
1390
1412
|
return { body: { coverImage: await definitionService(req.deps).saveCoverImage(ctx, guid, data) } };
|
|
1391
1413
|
};
|
|
1414
|
+
/** The cover image's bytes, by the same visibility rule as the definition. */
|
|
1415
|
+
var getDefinitionImage = async (req) => {
|
|
1416
|
+
const guid = parseParam(req.params.guid, GuidSchema, "GUID");
|
|
1417
|
+
const { ctx } = requireCaller(req);
|
|
1418
|
+
const record = await getVisibleDefinition(ctx, guid, req.deps);
|
|
1419
|
+
if (!record) apiError(404, ApiErrorCode.NOT_FOUND, "Definition not found");
|
|
1420
|
+
const bytes = record.coverImage ? await req.deps.storage.get(definitionPaths.image(guid)) : null;
|
|
1421
|
+
if (!bytes) apiError(404, ApiErrorCode.NOT_FOUND, "This definition has no cover image");
|
|
1422
|
+
return new Response(Buffer.from(bytes), { headers: {
|
|
1423
|
+
"Content-Type": "image/webp",
|
|
1424
|
+
"Cache-Control": "private, max-age=60"
|
|
1425
|
+
} });
|
|
1426
|
+
};
|
|
1392
1427
|
// ../server/src/handlers/projects.ts
|
|
1393
1428
|
/**
|
|
1394
1429
|
* Project handlers: the collection, and a single project's detail and settings.
|
|
@@ -1534,7 +1569,16 @@ var listProjectMembers = async (req) => {
|
|
|
1534
1569
|
const { id } = requireParams(req.params, "id");
|
|
1535
1570
|
const { ctx } = requireCaller(req);
|
|
1536
1571
|
await requireCanManage(req, id, "members");
|
|
1537
|
-
|
|
1572
|
+
const page = await req.deps.projects.listProjectMembers(ctx, id, parseListOptions(req.url));
|
|
1573
|
+
const profiles = await req.deps.userProfile.getProfiles(SYSTEM_CONTEXT, page.items.map((m) => m.userId));
|
|
1574
|
+
const names = new Map(profiles.map((p) => [p.userId, p.displayName]));
|
|
1575
|
+
return collection({
|
|
1576
|
+
...page,
|
|
1577
|
+
items: page.items.map((m) => ({
|
|
1578
|
+
...m,
|
|
1579
|
+
displayName: names.get(m.userId) ?? null
|
|
1580
|
+
}))
|
|
1581
|
+
});
|
|
1538
1582
|
};
|
|
1539
1583
|
var addProjectMember = async (req) => {
|
|
1540
1584
|
const { id } = requireParams(req.params, "id");
|
|
@@ -1722,6 +1766,8 @@ async function mailInvite(req, invite, acceptUrl) {
|
|
|
1722
1766
|
},
|
|
1723
1767
|
orgs: req.deps.orgs,
|
|
1724
1768
|
notifications,
|
|
1769
|
+
productName: req.deps.instanceName,
|
|
1770
|
+
render: req.deps.mailTemplates?.invite,
|
|
1725
1771
|
fallbackOrgName: req.deps.instanceName
|
|
1726
1772
|
});
|
|
1727
1773
|
}
|
|
@@ -1920,6 +1966,6 @@ async function revokeUnredeemedConsentToken(req, tokenId) {
|
|
|
1920
1966
|
await store.revoke(ctx, tokenId, "owner");
|
|
1921
1967
|
req.deps.tokens.resolutionCache?.forget(tokenId);
|
|
1922
1968
|
}
|
|
1923
|
-
export {
|
|
1969
|
+
export { revokeApiToken as $, deleteVersion as A, revokeShareLink as B, getDefinitionImage as C, updateDefinition as D, publishDefinition as E, listVersions as F, updateOrgMember as G, uploadOrgAsset as H, refreshVersionInventory as I, canManageApiTokenRoster as J, orgHasAnotherOwner as K, uploadVersion as L, getVersionChanges as M, getVersionSchema as N, uploadDefinitionImage as O, getVersionScriptDiff as P, mayHoldApiTokens as Q, createShareLink as R, getDefinition as S, listDefinitions as T, reclaimProject as U, removeOrgAsset as V, removeOrgMember as W, listApiTokens as X, createApiToken as Y, listOrgApiTokens as Z, getProject as _, inviterStillVouches as a, unstarDefinition as at, createDefinition as b, revokeInvite as c, addProjectMember as d, revokeOwnApiToken as et, listProjectMembers as f, deleteProject as g, createProject as h, createInvite as i, starDefinition as it, getVersion as j, checkVersion as k, getOrgCompute as l, updateProjectMemberRole as m, mintConsentToken as n, getOrg as nt, listInvites as o, getMe as ot, removeProjectMember as p, serializeOwnerChanges as q, revokeUnredeemedConsentToken as r, listOrgMembers as rt, resendInvite as s, consentOffer as t, revokeUserApiTokens as tt, updateOrgCompute as u, listProjects as v, getDefinitionSchema as w, deleteDefinition as x, updateProject as y, listShareLinks as z };
|
|
1924
1970
|
|
|
1925
1971
|
//# sourceMappingURL=handlers.js.map
|