@crowi/api-contract 2.0.0-alpha.14 → 2.0.0-alpha.16

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.mjs CHANGED
@@ -108,6 +108,11 @@ var ERROR_CODES = [
108
108
  // --- federated sign-in (RFC-0014) ---
109
109
  "FEDERATED_HANDOFF_INVALID",
110
110
  "FEDERATED_HANDOFF_CONSUMED",
111
+ // --- federated account linking (RFC-0014 §5.4) ---
112
+ "FEDERATED_IDENTITY_IN_USE",
113
+ "FEDERATED_LINK_AUTH_STATE_CHANGED",
114
+ "FEDERATED_LINK_NOT_LINKED",
115
+ "LINK_COMPLETION_CONSUMED",
111
116
  // --- admin subsystems ---
112
117
  "ENCRYPTION_NOT_CONFIGURED",
113
118
  "MAIL_FROM_NOT_CONFIGURED",
@@ -1047,7 +1052,7 @@ var adminStorageRoutes = {
1047
1052
  };
1048
1053
 
1049
1054
  // src/contracts/admin/users.ts
1050
- import { createRoute as createRoute8 } from "@hono/zod-openapi";
1055
+ import { createRoute as createRoute8, z as z14 } from "@hono/zod-openapi";
1051
1056
 
1052
1057
  // src/schemas/admin/users.ts
1053
1058
  import { z as z13 } from "@hono/zod-openapi";
@@ -1101,8 +1106,11 @@ var ListAdminUsersRequestSchema = z13.object({
1101
1106
  page: z13.coerce.number().int().min(1).optional().default(1),
1102
1107
  limit: z13.coerce.number().int().min(1).max(100).optional().default(50)
1103
1108
  });
1109
+ var AdminUserListItemSchema = UserPublicSchema.extend({
1110
+ linkedProviders: z13.array(z13.string())
1111
+ });
1104
1112
  var ListAdminUsersResponseSchema = z13.object({
1105
- users: z13.array(UserPublicSchema),
1113
+ users: z13.array(AdminUserListItemSchema),
1106
1114
  pager: AdminPagerSchema
1107
1115
  });
1108
1116
  var SearchAdminUsersByEmailRequestSchema = z13.object({
@@ -1137,8 +1145,7 @@ var InviteUsersResponseSchema = z13.object({
1137
1145
  results: z13.array(InvitedUserResultSchema)
1138
1146
  });
1139
1147
  var EditAdminUserRequestSchema = z13.object({
1140
- name: z13.string().min(1),
1141
- email: z13.string().email()
1148
+ name: z13.string().min(1)
1142
1149
  });
1143
1150
  var AdminUserMutationResponseSchema = z13.object({
1144
1151
  user: UserPublicSchema
@@ -1150,6 +1157,32 @@ var ResetPasswordResponseSchema = z13.object({
1150
1157
  var UpdateAdminUserEmailRequestSchema = z13.object({
1151
1158
  email: z13.string().email()
1152
1159
  });
1160
+ var EmailLockedByFederatedIdentityErrorSchema = z13.object({
1161
+ error: z13.object({
1162
+ code: z13.literal("EMAIL_LOCKED_BY_FEDERATED_IDENTITY"),
1163
+ message: z13.string()
1164
+ })
1165
+ });
1166
+ var AdminUserIdentityParamSchema = AdminUserIdParamSchema.extend({
1167
+ provider: z13.string()
1168
+ });
1169
+ var UnlinkUserIdentityResponseSchema = z13.object({
1170
+ user: UserPublicSchema,
1171
+ passwordIssued: z13.boolean(),
1172
+ newPassword: z13.string().optional()
1173
+ });
1174
+ var UnlinkUserIdentityNotFoundErrorSchema = z13.object({
1175
+ error: z13.object({
1176
+ code: z13.enum(["NOT_FOUND", "NOT_LINKED"]),
1177
+ message: z13.string()
1178
+ })
1179
+ });
1180
+ var UnlinkUserIdentityConflictErrorSchema = z13.object({
1181
+ error: z13.object({
1182
+ code: z13.enum(["CANNOT_UNLINK_SELF", "PASSWORD_AUTH_DISABLED"]),
1183
+ message: z13.string()
1184
+ })
1185
+ });
1153
1186
  var DeleteAdminUserResponseSchema = z13.object({
1154
1187
  deletedId: z13.string()
1155
1188
  });
@@ -1253,7 +1286,7 @@ var editUserRoute = createRoute8({
1253
1286
  path: "/admin/users/{id}",
1254
1287
  tags: ["admin.users"],
1255
1288
  security: [{ bearerAuth: [] }],
1256
- summary: "Update a user's name and email",
1289
+ summary: "Update a user's name (email changes go through PUT /admin/users/{id}/email)",
1257
1290
  request: {
1258
1291
  params: AdminUserIdParamSchema,
1259
1292
  body: {
@@ -1281,10 +1314,6 @@ var editUserRoute = createRoute8({
1281
1314
  description: "User not found",
1282
1315
  content: { "application/json": { schema: NotFoundErrorSchema } }
1283
1316
  },
1284
- 409: {
1285
- description: "Email already in use by another user",
1286
- content: { "application/json": { schema: ConflictErrorSchema } }
1287
- },
1288
1317
  500: {
1289
1318
  description: "Internal server error",
1290
1319
  content: { "application/json": { schema: InternalServerErrorSchema } }
@@ -1545,8 +1574,48 @@ var updateUserEmailRoute = createRoute8({
1545
1574
  content: { "application/json": { schema: NotFoundErrorSchema } }
1546
1575
  },
1547
1576
  409: {
1548
- description: "Email already in use by another user",
1549
- content: { "application/json": { schema: ConflictErrorSchema } }
1577
+ description: "Email already in use by another user, or locked by a linked federated identity",
1578
+ content: { "application/json": { schema: z14.union([ConflictErrorSchema, EmailLockedByFederatedIdentityErrorSchema]) } }
1579
+ },
1580
+ 500: {
1581
+ description: "Internal server error",
1582
+ content: { "application/json": { schema: InternalServerErrorSchema } }
1583
+ }
1584
+ }
1585
+ });
1586
+ var unlinkUserIdentityRoute = createRoute8({
1587
+ method: "delete",
1588
+ path: "/admin/users/{id}/identities/{provider}",
1589
+ tags: ["admin.users"],
1590
+ security: [{ bearerAuth: [] }],
1591
+ summary: "Unlink a user's federated identity for a provider (admin-initiated)",
1592
+ request: {
1593
+ params: AdminUserIdentityParamSchema
1594
+ },
1595
+ responses: {
1596
+ 200: {
1597
+ description: "Identity removed; passwordIssued/newPassword report whether a password was generated",
1598
+ content: { "application/json": { schema: UnlinkUserIdentityResponseSchema } }
1599
+ },
1600
+ 400: {
1601
+ description: "Invalid id",
1602
+ content: { "application/json": { schema: ValidationErrorSchema } }
1603
+ },
1604
+ 401: {
1605
+ description: "Authentication required",
1606
+ content: { "application/json": { schema: AuthenticationRequiredErrorSchema } }
1607
+ },
1608
+ 403: {
1609
+ description: "Admin permission required",
1610
+ content: { "application/json": { schema: AdminRequiredErrorSchema } }
1611
+ },
1612
+ 404: {
1613
+ description: "User not found, or the user has no identity for this provider",
1614
+ content: { "application/json": { schema: UnlinkUserIdentityNotFoundErrorSchema } }
1615
+ },
1616
+ 409: {
1617
+ description: "Refused: the target is the operating admin themself, or password auth is disabled instance-wide",
1618
+ content: { "application/json": { schema: UnlinkUserIdentityConflictErrorSchema } }
1550
1619
  },
1551
1620
  500: {
1552
1621
  description: "Internal server error",
@@ -1631,6 +1700,7 @@ var adminUsersRoutes = {
1631
1700
  resetPasswordRoute,
1632
1701
  resendInviteRoute,
1633
1702
  updateUserEmailRoute,
1703
+ unlinkUserIdentityRoute,
1634
1704
  pendingUsersCountRoute,
1635
1705
  deleteUserRoute
1636
1706
  };
@@ -5988,12 +6058,28 @@ var FederatedHandoffResponseSchema = TokenAuthResponseSchema;
5988
6058
  var LinkedAuthProviderListResponseSchema = z52.object({
5989
6059
  identities: z52.array(z52.object({ provider: z52.string() }))
5990
6060
  });
5991
- var CreateLinkGrantRequestSchema = z52.object({
5992
- /** RFC 7638 thumbprint of the P-256 public key this browser will use at `/start` — binds the grant to this browser (AC-2). */
5993
- handoffChallenge: z52.string().min(1)
6061
+ var LinkCompletionCodeSchema = z52.string().regex(/^[A-Za-z0-9_-]{43}$/, "must be a 43-character base64url completion code");
6062
+ var StartProviderLinkResponseSchema = z52.object({
6063
+ authorizationUrl: z52.string().url()
6064
+ });
6065
+ var PendingLinkCompletionResponseSchema = z52.object({
6066
+ provider: z52.string(),
6067
+ accountLabel: z52.string().optional()
5994
6068
  });
5995
- var CreateLinkGrantResponseSchema = z52.object({
5996
- linkGrant: z52.string()
6069
+ var CompleteProviderLinkResponseSchema = z52.object({
6070
+ result: z52.literal("linked")
6071
+ });
6072
+ var LinkCompletionConsumedErrorSchema = ApiErrorSchema.extend({
6073
+ error: z52.object({
6074
+ code: z52.literal("LINK_COMPLETION_CONSUMED"),
6075
+ message: z52.string()
6076
+ })
6077
+ });
6078
+ var CompleteProviderLinkConflictErrorSchema = ApiErrorSchema.extend({
6079
+ error: z52.object({
6080
+ code: z52.enum(["FEDERATED_IDENTITY_IN_USE", "FEDERATED_LINK_AUTH_STATE_CHANGED", "FEDERATED_LINK_NOT_LINKED"]),
6081
+ message: z52.string()
6082
+ })
5997
6083
  });
5998
6084
  var UnlinkAuthProviderErrorSchema = z52.object({
5999
6085
  error: z52.object({
@@ -6024,7 +6110,7 @@ var startFederatedProviderRoute = createRoute29({
6024
6110
  method: "get",
6025
6111
  path: "/auth/providers/{name}/start",
6026
6112
  tags: ["federatedAuth"],
6027
- summary: "Top-level navigation that redirects the browser to the named provider",
6113
+ summary: "Top-level navigation that redirects the browser to the named provider (public sign-in ONLY)",
6028
6114
  request: {
6029
6115
  params: z53.object({ name: z53.string() }),
6030
6116
  query: z53.object({
@@ -6032,31 +6118,13 @@ var startFederatedProviderRoute = createRoute29({
6032
6118
  /** base64url(JSON) of the sender's P-256 public JWK. */
6033
6119
  handoff_jwk: z53.string().min(1),
6034
6120
  /** base64url ES256 signature over the start canonical message. */
6035
- handoff_proof: z53.string().min(1),
6036
- /**
6037
- * RFC-0014 phase 3 — `'1'` switches this start into LINK mode: the
6038
- * request must carry a web-session JWT, and the flow attaches the
6039
- * resulting identity to that session's user instead of signing
6040
- * anyone in. Absent (the ordinary sign-in start) the route stays
6041
- * fully public.
6042
- */
6043
- link: z53.literal("1").optional(),
6044
- /** The opaque id from `POST /auth/providers/{name}/link-grants`. Required when `link=1`, ignored otherwise. */
6045
- link_grant: z53.string().min(1).optional()
6121
+ handoff_proof: z53.string().min(1)
6046
6122
  })
6047
6123
  },
6048
6124
  responses: {
6049
6125
  302: { description: "Redirect to the provider authorization endpoint" },
6050
6126
  400: {
6051
- description: "Malformed continue / sender proof, or an invalid/expired/mismatched link grant",
6052
- content: { "application/json": { schema: ApiErrorSchema } }
6053
- },
6054
- 401: {
6055
- description: "link=1 without a web-session JWT \u2014 never downgraded to the public sign-in start",
6056
- content: { "application/json": { schema: ApiErrorSchema } }
6057
- },
6058
- 403: {
6059
- description: "link=1 with a non-web credential (PAT / OAuth access token)",
6127
+ description: "Malformed continue / sender proof, OR a raw `link` query key is present (any value) \u2014 the retired link-via-GET flow is gone entirely; a raw `link` key is always rejected rather than silently downgraded to public sign-in.",
6060
6128
  content: { "application/json": { schema: ApiErrorSchema } }
6061
6129
  },
6062
6130
  404: {
@@ -6089,32 +6157,113 @@ var listLinkedAuthProvidersRoute = createRoute29({
6089
6157
  }
6090
6158
  }
6091
6159
  });
6092
- var createAuthProviderLinkGrantRoute = createRoute29({
6160
+ var startProviderLinkRoute = createRoute29({
6093
6161
  method: "post",
6094
- path: "/auth/providers/{name}/link-grants",
6162
+ path: "/auth/providers/{name}/link-start",
6095
6163
  tags: ["federatedAuth"],
6096
- summary: "Mint a short-lived, opaque grant that authorizes ONE link start for the current web session",
6164
+ summary: "Mint an IdP authorization URL + flow-specific state cookie for the current web session (stage 1 of 3)",
6097
6165
  request: {
6098
- params: z53.object({ name: z53.string() }),
6099
- body: { content: { "application/json": { schema: CreateLinkGrantRequestSchema } } }
6166
+ params: z53.object({ name: z53.string() })
6100
6167
  },
6101
6168
  responses: {
6102
6169
  200: {
6103
- description: "Opaque single-use grant id",
6104
- content: { "application/json": { schema: CreateLinkGrantResponseSchema } }
6170
+ description: "Authorization URL to navigate the browser to. Sets a flow-specific, 300s state cookie.",
6171
+ content: { "application/json": { schema: StartProviderLinkResponseSchema } }
6172
+ },
6173
+ 400: {
6174
+ description: "The signed link-state cookie value would exceed its per-cookie byte limit, or the aggregate Cookie-header admission budget cannot be satisfied even after pruning \u2014 no Set-Cookie or authorizationUrl is returned.",
6175
+ content: { "application/json": { schema: ApiErrorSchema } }
6105
6176
  },
6106
6177
  401: {
6107
- description: "Authentication required",
6178
+ description: "Authentication required (credential missing/invalid \u2014 resolved by middleware before this route's own validation)",
6108
6179
  content: { "application/json": { schema: AuthenticationRequiredErrorSchema } }
6109
6180
  },
6110
6181
  403: {
6111
- description: "Non-web credential (PAT / OAuth access token)",
6182
+ description: "Non-web credential (PAT / OAuth access token) \u2014 linking is a session-level account change",
6112
6183
  content: { "application/json": { schema: ApiErrorSchema } }
6113
6184
  },
6114
6185
  404: {
6115
6186
  description: "Unknown, unconfigured, or credential-kind provider",
6116
6187
  content: { "application/json": { schema: ApiErrorSchema } }
6117
6188
  },
6189
+ 500: {
6190
+ description: "Internal server error (e.g. a declared multi-instance topology with no reachable Redis)",
6191
+ content: { "application/json": { schema: InternalServerErrorSchema } }
6192
+ }
6193
+ }
6194
+ });
6195
+ var getProviderLinkCompletionRoute = createRoute29({
6196
+ method: "get",
6197
+ path: "/auth/providers/{name}/link-completions/{code}",
6198
+ tags: ["federatedAuth"],
6199
+ summary: "Read a pending link completion's confirmation details (stage 3a \u2014 non-destructive)",
6200
+ request: {
6201
+ params: z53.object({ name: z53.string(), code: LinkCompletionCodeSchema })
6202
+ },
6203
+ responses: {
6204
+ 200: {
6205
+ description: "Pending, unconsumed completion bound to the caller \u2014 provider label fallback + optional display-only accountLabel",
6206
+ content: { "application/json": { schema: PendingLinkCompletionResponseSchema } }
6207
+ },
6208
+ 400: {
6209
+ description: "Authenticated but `{code}` fails the 43-character base64url shape (VALIDATION_ERROR)",
6210
+ content: { "application/json": { schema: ValidationErrorSchema } }
6211
+ },
6212
+ 401: {
6213
+ description: "Authentication required \u2014 resolved by middleware before this route's own `{code}` shape validation, so an unauthenticated + malformed code is still 401, never 400",
6214
+ content: { "application/json": { schema: AuthenticationRequiredErrorSchema } }
6215
+ },
6216
+ 403: {
6217
+ description: "Non-web credential (PAT / OAuth access token)",
6218
+ content: { "application/json": { schema: ApiErrorSchema } }
6219
+ },
6220
+ 404: {
6221
+ description: "Never-issued, expired, retention-expired, or bound to a different user/provider/authVersion \u2014 all collapse to the same generic NOT_FOUND (no result-unknown code exists)",
6222
+ content: { "application/json": { schema: ApiErrorSchema } }
6223
+ },
6224
+ 409: {
6225
+ description: "The caller's own completion was already consumed",
6226
+ content: { "application/json": { schema: LinkCompletionConsumedErrorSchema } }
6227
+ },
6228
+ 500: {
6229
+ description: "Internal server error",
6230
+ content: { "application/json": { schema: InternalServerErrorSchema } }
6231
+ }
6232
+ }
6233
+ });
6234
+ var completeProviderLinkRoute = createRoute29({
6235
+ method: "post",
6236
+ path: "/auth/providers/{name}/link-completions/{code}",
6237
+ tags: ["federatedAuth"],
6238
+ summary: "Atomically consume a link completion code and insert the identity (stage 3b \u2014 terminal)",
6239
+ request: {
6240
+ params: z53.object({ name: z53.string(), code: LinkCompletionCodeSchema })
6241
+ },
6242
+ responses: {
6243
+ 200: {
6244
+ description: "Linked (fresh winner OR an already-consumed replay that resolves to the same owner) \u2014 the same body either way",
6245
+ content: { "application/json": { schema: CompleteProviderLinkResponseSchema } }
6246
+ },
6247
+ 400: {
6248
+ description: "Authenticated but `{code}` fails the 43-character base64url shape (VALIDATION_ERROR)",
6249
+ content: { "application/json": { schema: ValidationErrorSchema } }
6250
+ },
6251
+ 401: {
6252
+ description: "Authentication required \u2014 resolved by middleware before this route's own `{code}` shape validation, so an unauthenticated + malformed code is still 401, never 400",
6253
+ content: { "application/json": { schema: AuthenticationRequiredErrorSchema } }
6254
+ },
6255
+ 403: {
6256
+ description: "Non-web credential (PAT / OAuth access token)",
6257
+ content: { "application/json": { schema: ApiErrorSchema } }
6258
+ },
6259
+ 404: {
6260
+ description: "Never-issued, expired, retention-expired, or bound to a different user/provider \u2014 all collapse to the same generic NOT_FOUND",
6261
+ content: { "application/json": { schema: ApiErrorSchema } }
6262
+ },
6263
+ 409: {
6264
+ description: "FEDERATED_IDENTITY_IN_USE (provider account owned by someone else, or this user already has a different account of this provider), FEDERATED_LINK_AUTH_STATE_CHANGED (fresh User re-read found the session inactive or authVersion changed since link-start), or FEDERATED_LINK_NOT_LINKED (an already-consumed replay whose original insert has not landed) \u2014 no other conflict code exists.",
6265
+ content: { "application/json": { schema: CompleteProviderLinkConflictErrorSchema } }
6266
+ },
6118
6267
  500: {
6119
6268
  description: "Internal server error",
6120
6269
  content: { "application/json": { schema: InternalServerErrorSchema } }
@@ -6168,7 +6317,7 @@ var callbackFederatedProviderRoute = createRoute29({
6168
6317
  },
6169
6318
  responses: {
6170
6319
  302: {
6171
- description: "Redirect to the trusted web login/complete page on success, or back to the trusted web /login on failure"
6320
+ description: "Ordinary sign-in: redirect to the trusted web login/complete page on success, or back to the trusted web /login on failure. Link flow (query `state` in the reserved crowilnk_ namespace): success redirects to `/me?provider=<name>&link_completion=<code>` (provider + completion code ONLY); failure redirects to `/me?provider=<name>&link=link_failed` (provider + the generic marker ONLY \u2014 never a completion code, never accountLabel, never the underlying reason)."
6172
6321
  },
6173
6322
  404: {
6174
6323
  description: "Unknown or unconfigured provider (also used when trusted origins cannot be resolved)",
@@ -6213,7 +6362,9 @@ var federatedAuthRoutes = {
6213
6362
  callbackFederatedProviderRoute,
6214
6363
  federatedHandoffRoute,
6215
6364
  listLinkedAuthProvidersRoute,
6216
- createAuthProviderLinkGrantRoute,
6365
+ startProviderLinkRoute,
6366
+ getProviderLinkCompletionRoute,
6367
+ completeProviderLinkRoute,
6217
6368
  unlinkAuthProviderRoute
6218
6369
  };
6219
6370
 
@@ -7101,6 +7252,7 @@ var stubSearchAdminUsersByEmail = { users: [] };
7101
7252
  var stubInviteUsers = { results: [] };
7102
7253
  var stubAdminUserMutation = { user: stubUserPublic };
7103
7254
  var stubResetPassword = { user: stubUserPublic, newPassword: "" };
7255
+ var stubUnlinkUserIdentity = { user: stubUserPublic, passwordIssued: false };
7104
7256
  var stubDeleteAdminUser = { deletedId: "" };
7105
7257
  var stubPendingUsersCount = { count: 0 };
7106
7258
  var stubListPlugins = { plugins: [] };
@@ -7146,9 +7298,9 @@ var bookmarkBacklinkCommentRevisionChain = new OpenAPIHono().openapi(bookmarkRou
7146
7298
  var pageChain = new OpenAPIHono().openapi(pageRoutes.getPageRoute, (c) => c.json(stubPageWithRevision, 200)).openapi(pageRoutes.listPagesRoute, (c) => c.json(stubListPages, 200)).openapi(pageRoutes.listPageChildrenRoute, (c) => c.json(stubListPageChildren, 200)).openapi(pageRoutes.createPageRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.updatePageRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.setPageGrantRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.seenPageRoute, (c) => c.json(stubSeenUsers, 200)).openapi(pageRoutes.getSeenUsersRoute, (c) => c.json(stubSeenUsers, 200)).openapi(pageRoutes.likePageRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.unlikePageRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.claimPageLinkAccessRoute, (c) => c.json({ ...stubPageWithRevision, granted: false }, 200)).openapi(pageRoutes.getWatchStatusRoute, (c) => c.json(stubWatchStatus, 200)).openapi(pageRoutes.setWatchStatusRoute, (c) => c.json(stubWatchStatus, 200)).openapi(pageRoutes.deletePageRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.revertDeletedPageRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.revertToRevisionRoute, (c) => c.json(stubPageResponse, 200)).openapi(pageRoutes.renamePageRoute, (c) => c.json({ ...stubPageResponse, renamed_count: 1 }, 200)).openapi(pageRoutes.renameSubtreeRoute, (c) => c.json({ renamed_count: 0 }, 200)).openapi(pagePreviewRoutes.previewPageRoute, (c) => c.json(stubPreview, 200)).openapi(pageCollabRoutes.getYjsTokenRoute, (c) => c.json(stubWsToken, 200)).openapi(presenceRoutes.getPresenceTokenRoute, (c) => c.json(stubPresenceToken, 200)).openapi(presenceRoutes.getLikersRoute, (c) => c.json(stubLikers, 200));
7147
7299
  var lateContractApp = new OpenAPIHono().openapi(draftRoutes.createDraftRoute, (c) => c.json(stubCreateDraft, 201)).openapi(draftRoutes.listDraftsRoute, (c) => c.json(stubListDrafts, 200)).openapi(draftRoutes.cancelDraftRoute, (c) => c.json(stubCreateDraft, 200)).openapi(autocompleteRoutes.autocompleteUsersRoute, (c) => c.json(stubAutocomplete, 200)).openapi(autocompleteRoutes.autocompletePagesRoute, (c) => c.json(stubAutocomplete, 200)).openapi(attachmentRoutes.getAttachmentUsageRoute, (c) => c.json(stubAttachmentUsage, 200)).openapi(attachmentRoutes.listAttachmentsRoute, (c) => c.json(stubListAttachments, 200)).openapi(attachmentRoutes.addAttachmentRoute, (c) => c.json(stubAddAttachment, 200)).openapi(attachmentRoutes.uploadAttachmentRoute, (c) => c.json(stubUploadAttachment, 200)).openapi(attachmentRoutes.getAttachmentMetaRoute, (c) => c.json(stubAttachmentMeta, 200)).openapi(attachmentRoutes.removeAttachmentRoute, (c) => c.json(stubRemoveAttachment, 200)).openapi(attachmentRoutes.getUploadPolicyRoute, (c) => c.json(stubUploadPolicy, 200)).openapi(searchRoutes.searchPagesRoute, (c) => c.json(stubSearchPages, 200)).openapi(adminCryptoRoutes.getCryptoStatusRoute, (c) => c.json(stubCryptoStatus, 200)).openapi(adminCryptoRoutes.reencryptAllRoute, (c) => c.json(stubReencrypt, 200)).openapi(notificationRoutes.listNotificationsRoute, (c) => c.json(stubListNotifications, 200)).openapi(notificationRoutes.markAllAsReadRoute, (c) => c.json(stubMarkAllAsRead, 200)).openapi(notificationRoutes.getNotificationsTokenRoute, (c) => c.json(stubNotificationsToken, 200)).openapi(notificationRoutes.getUnreadCountRoute, (c) => c.json(stubNotificationStatus, 200)).openapi(notificationRoutes.openNotificationRoute, (c) => c.json(stubOpenNotification, 200));
7148
7300
  var adminSettingsContractApp = new OpenAPIHono().openapi(adminAppRoutes.getAppSettingsRoute, (c) => c.json(stubGetAppSettings, 200)).openapi(adminAppRoutes.updateAppSettingsRoute, (c) => c.json(stubUpdateAppSettings, 200)).openapi(adminAuthRoutes.getAuthSettingsRoute, (c) => c.json(stubAuthSettings, 200)).openapi(adminAuthRoutes.updateAuthSettingsRoute, (c) => c.json(stubAuthSettings, 200)).openapi(adminSecurityRoutes.getSecuritySettingsRoute, (c) => c.json(stubSecuritySettings, 200)).openapi(adminSecurityRoutes.updateSecuritySettingsRoute, (c) => c.json(stubSecuritySettings, 200)).openapi(adminMailRoutes.getMailSettingsRoute, (c) => c.json(stubMailSettings, 200)).openapi(adminMailRoutes.updateMailSettingsRoute, (c) => c.json(stubUpdateMailSettings, 200)).openapi(adminMailRoutes.sendTestMailRoute, (c) => c.json(stubSendTestMail, 200)).openapi(adminStorageRoutes.getStorageStatusRoute, (c) => c.json(stubStorageStatus, 200)).openapi(adminSearchRoutes.getSearchStatusRoute, (c) => c.json(stubSearchStatus, 200));
7149
- var adminUsersPluginsContractApp = new OpenAPIHono().openapi(adminUsersRoutes.listUsersRoute, (c) => c.json(stubListAdminUsers, 200)).openapi(adminUsersRoutes.searchUsersByEmailRoute, (c) => c.json(stubSearchAdminUsersByEmail, 200)).openapi(adminUsersRoutes.pendingUsersCountRoute, (c) => c.json(stubPendingUsersCount, 200)).openapi(adminUsersRoutes.inviteUsersRoute, (c) => c.json(stubInviteUsers, 200)).openapi(adminUsersRoutes.editUserRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.makeAdminRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.removeFromAdminRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.activateUserRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.suspendUserRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.resetPasswordRoute, (c) => c.json(stubResetPassword, 200)).openapi(adminUsersRoutes.resendInviteRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.updateUserEmailRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.deleteUserRoute, (c) => c.json(stubDeleteAdminUser, 200)).openapi(adminPluginsRoutes.listPluginsRoute, (c) => c.json(stubListPlugins, 200)).openapi(adminPluginsRoutes.getPluginConfigRoute, (c) => c.json(stubPluginConfig, 200)).openapi(adminPluginsRoutes.updatePluginConfigRoute, (c) => c.json(stubUpdatePluginConfig, 200)).openapi(adminPluginsRoutes.getPluginReadinessRoute, (c) => c.json(stubPluginReadiness, 200)).openapi(adminPluginsRoutes.clearRenderCacheAllRoute, (c) => c.json(stubClearRenderCache, 200)).openapi(adminPluginsRoutes.clearRenderCachePluginRoute, (c) => c.json(stubClearRenderCache, 200));
7301
+ var adminUsersPluginsContractApp = new OpenAPIHono().openapi(adminUsersRoutes.listUsersRoute, (c) => c.json(stubListAdminUsers, 200)).openapi(adminUsersRoutes.searchUsersByEmailRoute, (c) => c.json(stubSearchAdminUsersByEmail, 200)).openapi(adminUsersRoutes.pendingUsersCountRoute, (c) => c.json(stubPendingUsersCount, 200)).openapi(adminUsersRoutes.inviteUsersRoute, (c) => c.json(stubInviteUsers, 200)).openapi(adminUsersRoutes.editUserRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.makeAdminRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.removeFromAdminRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.activateUserRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.suspendUserRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.resetPasswordRoute, (c) => c.json(stubResetPassword, 200)).openapi(adminUsersRoutes.resendInviteRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.updateUserEmailRoute, (c) => c.json(stubAdminUserMutation, 200)).openapi(adminUsersRoutes.unlinkUserIdentityRoute, (c) => c.json(stubUnlinkUserIdentity, 200)).openapi(adminUsersRoutes.deleteUserRoute, (c) => c.json(stubDeleteAdminUser, 200)).openapi(adminPluginsRoutes.listPluginsRoute, (c) => c.json(stubListPlugins, 200)).openapi(adminPluginsRoutes.getPluginConfigRoute, (c) => c.json(stubPluginConfig, 200)).openapi(adminPluginsRoutes.updatePluginConfigRoute, (c) => c.json(stubUpdatePluginConfig, 200)).openapi(adminPluginsRoutes.getPluginReadinessRoute, (c) => c.json(stubPluginReadiness, 200)).openapi(adminPluginsRoutes.clearRenderCacheAllRoute, (c) => c.json(stubClearRenderCache, 200)).openapi(adminPluginsRoutes.clearRenderCachePluginRoute, (c) => c.json(stubClearRenderCache, 200));
7150
7302
  var oauthContractApp = new OpenAPIHono().openapi(oauthRoutes.authorizeRoute, (c) => c.json(stubAuthorize, 200)).openapi(oauthRoutes.tokenRoute, (c) => c.json(stubToken, 200)).openapi(oauthRoutes.revokeRoute, (c) => c.json(stubRevoke, 200)).openapi(oauthRoutes.discoveryRoute, (c) => c.json(stubDiscovery, 200)).openapi(oauthRoutes.deviceAuthorizeRoute, (c) => c.json(stubDeviceAuthorize, 200)).openapi(oauthRoutes.deviceInfoRoute, (c) => c.json(stubDeviceInfo, 200)).openapi(oauthRoutes.deviceVerifyRoute, (c) => c.json(stubDeviceVerify, 200)).openapi(oauthRoutes.clientInfoRoute, (c) => c.json(stubClientInfo, 200));
7151
- var federatedAuthContractApp = new OpenAPIHono().openapi(federatedAuthRoutes.listFederatedProvidersRoute, (c) => c.json(stubProviderList, 200)).openapi(federatedAuthRoutes.startFederatedProviderRoute, (c) => c.redirect("", 302)).openapi(federatedAuthRoutes.callbackFederatedProviderRoute, (c) => c.redirect("", 302)).openapi(federatedAuthRoutes.federatedHandoffRoute, (c) => c.json(stubTokens, 200)).openapi(federatedAuthRoutes.listLinkedAuthProvidersRoute, (c) => c.json({ identities: [] }, 200)).openapi(federatedAuthRoutes.createAuthProviderLinkGrantRoute, (c) => c.json({ linkGrant: "" }, 200)).openapi(federatedAuthRoutes.unlinkAuthProviderRoute, (c) => c.body(null, 204));
7303
+ var federatedAuthContractApp = new OpenAPIHono().openapi(federatedAuthRoutes.listFederatedProvidersRoute, (c) => c.json(stubProviderList, 200)).openapi(federatedAuthRoutes.startFederatedProviderRoute, (c) => c.redirect("", 302)).openapi(federatedAuthRoutes.callbackFederatedProviderRoute, (c) => c.redirect("", 302)).openapi(federatedAuthRoutes.federatedHandoffRoute, (c) => c.json(stubTokens, 200)).openapi(federatedAuthRoutes.listLinkedAuthProvidersRoute, (c) => c.json({ identities: [] }, 200)).openapi(federatedAuthRoutes.startProviderLinkRoute, (c) => c.json({ authorizationUrl: "" }, 200)).openapi(federatedAuthRoutes.getProviderLinkCompletionRoute, (c) => c.json({ provider: "" }, 200)).openapi(federatedAuthRoutes.completeProviderLinkRoute, (c) => c.json({ result: "linked" }, 200)).openapi(federatedAuthRoutes.unlinkAuthProviderRoute, (c) => c.body(null, 204));
7152
7304
  var federatedRegistrationContractApp = new OpenAPIHono().openapi(federatedRegistrationRoutes.getFederatedRegistrationRoute, (c) => c.json(stubFederatedRegistrationSnapshot, 200)).openapi(federatedRegistrationRoutes.submitFederatedRegistrationRoute, (c) => c.json({ status: "approval_required" }, 200)).openapi(federatedRegistrationRoutes.logoutFederatedRegistrationRoute, (c) => c.body(null, 204));
7153
7305
  var createClient = (baseUrl, options = {}) => hc(baseUrl, {
7154
7306
  headers: options.headers,
@@ -7384,6 +7536,8 @@ export {
7384
7536
  AdminRequiredErrorSchema,
7385
7537
  AdminSidebarSection,
7386
7538
  AdminUserIdParamSchema,
7539
+ AdminUserIdentityParamSchema,
7540
+ AdminUserListItemSchema,
7387
7541
  AdminUserMutationResponseSchema,
7388
7542
  ApiErrorSchema,
7389
7543
  AppInfoResponseSchema,
@@ -7419,6 +7573,8 @@ export {
7419
7573
  CommentInvalidRequestErrorSchema,
7420
7574
  CommentNotFoundErrorSchema,
7421
7575
  CommentSchema,
7576
+ CompleteProviderLinkConflictErrorSchema,
7577
+ CompleteProviderLinkResponseSchema,
7422
7578
  ConfigReadinessIssueSchema,
7423
7579
  ConfigReadinessResponseSchema,
7424
7580
  ConfirmEmailChangeRequestSchema,
@@ -7431,8 +7587,6 @@ export {
7431
7587
  CreateAdminResponseSchema,
7432
7588
  CreateDraftRequestSchema,
7433
7589
  CreateDraftResponseSchema,
7434
- CreateLinkGrantRequestSchema,
7435
- CreateLinkGrantResponseSchema,
7436
7590
  CreatePageRequestSchema,
7437
7591
  CrowiCodeSidecarSchema,
7438
7592
  CrowiDiagramNodeSchema,
@@ -7467,6 +7621,7 @@ export {
7467
7621
  DraftSummarySchema,
7468
7622
  ERROR_CODES,
7469
7623
  EditAdminUserRequestSchema,
7624
+ EmailLockedByFederatedIdentityErrorSchema,
7470
7625
  EncryptionNotConfiguredErrorSchema,
7471
7626
  ErrorCodeSchema,
7472
7627
  FRONTMATTER_MAX_ENTRIES,
@@ -7522,6 +7677,8 @@ export {
7522
7677
  LanguageSchema,
7523
7678
  LikerSchema,
7524
7679
  LikersResponseSchema,
7680
+ LinkCompletionCodeSchema,
7681
+ LinkCompletionConsumedErrorSchema,
7525
7682
  LinkedAuthProviderListResponseSchema,
7526
7683
  ListAccessTokensResponseSchema,
7527
7684
  ListAdminUsersRequestSchema,
@@ -7586,6 +7743,7 @@ export {
7586
7743
  PasswordErrorResponseSchema,
7587
7744
  PasswordUpdateSuccessSchema,
7588
7745
  PastAttachmentUsageSchema,
7746
+ PendingLinkCompletionResponseSchema,
7589
7747
  PendingUsersCountResponseSchema,
7590
7748
  PictureUploadResponseSchema,
7591
7749
  PluginAdminPlacementSchema,
@@ -7665,6 +7823,7 @@ export {
7665
7823
  ShikiTokenLinesSchema,
7666
7824
  ShikiTokenSchema,
7667
7825
  ShikiTokenStyleSchema,
7826
+ StartProviderLinkResponseSchema,
7668
7827
  StorageDriverEntrySchema,
7669
7828
  SuccessResponseSchema,
7670
7829
  ThemeSchema,
@@ -7679,6 +7838,9 @@ export {
7679
7838
  TokenResponseSchema,
7680
7839
  UPLOAD_ALLOWED_MIME,
7681
7840
  UnlinkAuthProviderErrorSchema,
7841
+ UnlinkUserIdentityConflictErrorSchema,
7842
+ UnlinkUserIdentityNotFoundErrorSchema,
7843
+ UnlinkUserIdentityResponseSchema,
7682
7844
  UpdateAdminUserEmailRequestSchema,
7683
7845
  UpdateAppSettingsRequestSchema,
7684
7846
  UpdateAppSettingsResponseSchema,
@@ -7750,10 +7912,10 @@ export {
7750
7912
  clearRenderCachePluginRoute,
7751
7913
  clientInfoRoute,
7752
7914
  commentRoutes,
7915
+ completeProviderLinkRoute,
7753
7916
  confirmEmailChangeRoute,
7754
7917
  createAccessTokenRoute,
7755
7918
  createAdminRoute,
7756
- createAuthProviderLinkGrantRoute,
7757
7919
  createClient,
7758
7920
  createDraftRoute,
7759
7921
  createPageRoute,
@@ -7791,6 +7953,7 @@ export {
7791
7953
  getPluginReadinessRoute,
7792
7954
  getPresenceTokenRoute,
7793
7955
  getProfileRoute,
7956
+ getProviderLinkCompletionRoute,
7794
7957
  getRevisionRoute,
7795
7958
  getRevisionsRoute,
7796
7959
  getSearchStatusRoute,
@@ -7864,6 +8027,7 @@ export {
7864
8027
  setPageGrantRoute,
7865
8028
  setWatchStatusRoute,
7866
8029
  startFederatedProviderRoute,
8030
+ startProviderLinkRoute,
7867
8031
  stripKnownHtmlTags,
7868
8032
  submitFederatedRegistrationRoute,
7869
8033
  suspendUserRoute,
@@ -7876,6 +8040,7 @@ export {
7876
8040
  tokenRoute,
7877
8041
  unlikePageRoute,
7878
8042
  unlinkAuthProviderRoute,
8043
+ unlinkUserIdentityRoute,
7879
8044
  unwrapRenderedAst,
7880
8045
  updateAppSettingsRoute,
7881
8046
  updateAuthSettingsRoute,