@sixb/server 0.1.4 → 0.1.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/dist/index.js +38 -8
- package/dist/index.js.map +6 -6
- package/dist/routes/actions.d.ts +2 -1
- package/dist/routes/actions.d.ts.map +1 -1
- package/dist/routes/auth.d.ts +5 -0
- package/dist/routes/auth.d.ts.map +1 -1
- package/dist/schemas/actions.d.ts +92 -0
- package/dist/schemas/actions.d.ts.map +1 -1
- package/dist/schemas/auth.d.ts +47 -0
- package/dist/schemas/auth.d.ts.map +1 -1
- package/package.json +6 -6
- package/src/routes/actions.ts +18 -3
- package/src/routes/auth.ts +17 -1
- package/src/schemas/actions.ts +5 -0
- package/src/schemas/auth.ts +7 -0
package/dist/index.js
CHANGED
|
@@ -1212,6 +1212,9 @@ var ActionCatalogItemSchema = z3.object({
|
|
|
1212
1212
|
effects: z3.boolean()
|
|
1213
1213
|
})
|
|
1214
1214
|
});
|
|
1215
|
+
var ActionDetailSchema = ActionCatalogItemSchema.extend({
|
|
1216
|
+
inputSchema: z3.record(z3.unknown())
|
|
1217
|
+
});
|
|
1215
1218
|
var ActionRunStatusSchema = z3.enum([
|
|
1216
1219
|
"queued",
|
|
1217
1220
|
"running",
|
|
@@ -1671,6 +1674,7 @@ function registerActionRunRoutes(app, host) {
|
|
|
1671
1674
|
}
|
|
1672
1675
|
|
|
1673
1676
|
// src/routes/actions.ts
|
|
1677
|
+
import { schemaFieldsToJsonSchema } from "@sixb/core/internal/ontology";
|
|
1674
1678
|
function serializeAction(action) {
|
|
1675
1679
|
return ActionCatalogItemSchema.parse({
|
|
1676
1680
|
id: action.id,
|
|
@@ -1694,7 +1698,16 @@ function serializeAction(action) {
|
|
|
1694
1698
|
}
|
|
1695
1699
|
});
|
|
1696
1700
|
}
|
|
1697
|
-
function
|
|
1701
|
+
function serializeActionDetail(action, host) {
|
|
1702
|
+
return ActionDetailSchema.parse({
|
|
1703
|
+
...serializeAction(action),
|
|
1704
|
+
inputSchema: schemaFieldsToJsonSchema({
|
|
1705
|
+
fields: action.params,
|
|
1706
|
+
valueTypesById: host.definitions.ontology.getValueTypesById()
|
|
1707
|
+
})
|
|
1708
|
+
});
|
|
1709
|
+
}
|
|
1710
|
+
function registerActionRoutes(app, host) {
|
|
1698
1711
|
return app.get("/api/actions", async (context) => {
|
|
1699
1712
|
const actions = requireRequestSixb(context).actions.list();
|
|
1700
1713
|
return actions.map(serializeAction);
|
|
@@ -1713,10 +1726,10 @@ function registerActionRoutes(app, _host) {
|
|
|
1713
1726
|
set.status = 404;
|
|
1714
1727
|
return { error: "Action not found" };
|
|
1715
1728
|
}
|
|
1716
|
-
return
|
|
1729
|
+
return serializeActionDetail(action, host);
|
|
1717
1730
|
}, {
|
|
1718
1731
|
params: ActionIdParamsSchema,
|
|
1719
|
-
response: { 200:
|
|
1732
|
+
response: { 200: ActionDetailSchema, 404: ErrorResponseSchema },
|
|
1720
1733
|
detail: {
|
|
1721
1734
|
summary: "Get action metadata",
|
|
1722
1735
|
tags: [OPENAPI_TAGS.actions.name],
|
|
@@ -9476,7 +9489,11 @@ var AuthInvitationSchema = z29.object({
|
|
|
9476
9489
|
revokedAt: z29.string().optional()
|
|
9477
9490
|
});
|
|
9478
9491
|
var AuthInvitationDeliverySchema = z29.object({
|
|
9479
|
-
status: z29.enum(["sent", "skipped", "rate_limited", "not_supported"])
|
|
9492
|
+
status: z29.enum(["sent", "skipped", "rate_limited", "not_supported"]),
|
|
9493
|
+
link: z29.object({
|
|
9494
|
+
url: z29.string().url(),
|
|
9495
|
+
expiresAt: z29.string().optional()
|
|
9496
|
+
}).optional()
|
|
9480
9497
|
});
|
|
9481
9498
|
var AuthInvitationGroupOptionSchema = AuthGroupOptionSchema;
|
|
9482
9499
|
var AuthAccessTokenKindSchema = z29.enum(["personal", "serviceAccount"]);
|
|
@@ -9647,7 +9664,8 @@ var CreateAuthInvitationBodySchema = z29.object({
|
|
|
9647
9664
|
groupIds: z29.array(z29.string().min(1)).optional(),
|
|
9648
9665
|
destinationId: z29.enum(["atlas", "app"]).optional(),
|
|
9649
9666
|
expiresAt: z29.string().optional(),
|
|
9650
|
-
returnTo: z29.string().optional()
|
|
9667
|
+
returnTo: z29.string().optional(),
|
|
9668
|
+
revealLink: z29.boolean().optional()
|
|
9651
9669
|
});
|
|
9652
9670
|
var CreateAuthInvitationResponseSchema = z29.object({
|
|
9653
9671
|
invitation: AuthInvitationSchema,
|
|
@@ -10257,7 +10275,8 @@ function registerAuthRoutes(app, host, options) {
|
|
|
10257
10275
|
email: parsed.email,
|
|
10258
10276
|
groupIds: parsed.groupIds,
|
|
10259
10277
|
expiresAt: parseDate(parsed.expiresAt),
|
|
10260
|
-
returnTo: deliveryContext.returnTo
|
|
10278
|
+
returnTo: deliveryContext.returnTo,
|
|
10279
|
+
revealLink: parsed.revealLink
|
|
10261
10280
|
}, {
|
|
10262
10281
|
...authOptions,
|
|
10263
10282
|
delivery: {
|
|
@@ -10268,7 +10287,7 @@ function registerAuthRoutes(app, host, options) {
|
|
|
10268
10287
|
});
|
|
10269
10288
|
return jsonResponse2({
|
|
10270
10289
|
invitation: serializeInvitation(result.invitation),
|
|
10271
|
-
delivery: result.delivery
|
|
10290
|
+
delivery: serializeInvitationDelivery(result.delivery)
|
|
10272
10291
|
}, 201);
|
|
10273
10292
|
} catch (error) {
|
|
10274
10293
|
return authRouteErrorResponse(error);
|
|
@@ -11234,6 +11253,17 @@ function serializeInvitation(invitation) {
|
|
|
11234
11253
|
revokedAt: invitation.revokedAt ? toIsoString(invitation.revokedAt) : undefined
|
|
11235
11254
|
};
|
|
11236
11255
|
}
|
|
11256
|
+
function serializeInvitationDelivery(delivery) {
|
|
11257
|
+
return {
|
|
11258
|
+
status: delivery.status,
|
|
11259
|
+
...delivery.link ? {
|
|
11260
|
+
link: {
|
|
11261
|
+
url: delivery.link.url,
|
|
11262
|
+
expiresAt: delivery.link.expiresAt ? toIsoString(delivery.link.expiresAt) : undefined
|
|
11263
|
+
}
|
|
11264
|
+
} : {}
|
|
11265
|
+
};
|
|
11266
|
+
}
|
|
11237
11267
|
function serializeMemberSummary(member) {
|
|
11238
11268
|
return {
|
|
11239
11269
|
...serializeManagedMember(member.user, member.groupIds),
|
|
@@ -12873,4 +12903,4 @@ export {
|
|
|
12873
12903
|
SixbServer
|
|
12874
12904
|
};
|
|
12875
12905
|
|
|
12876
|
-
//# debugId=
|
|
12906
|
+
//# debugId=07F881CA7D25E16A64756E2164756E21
|