@crowi/api-contract 2.0.0-alpha.15 → 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.
@@ -794,15 +794,13 @@ interface paths {
794
794
  path?: never;
795
795
  cookie?: never;
796
796
  };
797
- /** Top-level navigation that redirects the browser to the named provider */
797
+ /** Top-level navigation that redirects the browser to the named provider (public sign-in ONLY) */
798
798
  get: {
799
799
  parameters: {
800
800
  query: {
801
801
  continue: string;
802
802
  handoff_jwk: string;
803
803
  handoff_proof: string;
804
- link?: "1";
805
- link_grant?: string;
806
804
  };
807
805
  header?: never;
808
806
  path: {
@@ -819,7 +817,7 @@ interface paths {
819
817
  };
820
818
  content?: never;
821
819
  };
822
- /** @description Malformed continue / sender proof, or an invalid/expired/mismatched link grant */
820
+ /** @description Malformed continue / sender proof, OR a raw `link` query key is present (any value) — the retired link-via-GET flow is gone entirely; a raw `link` key is always rejected rather than silently downgraded to public sign-in. */
823
821
  400: {
824
822
  headers: {
825
823
  [name: string]: unknown;
@@ -834,36 +832,6 @@ interface paths {
834
832
  };
835
833
  };
836
834
  };
837
- /** @description link=1 without a web-session JWT — never downgraded to the public sign-in start */
838
- 401: {
839
- headers: {
840
- [name: string]: unknown;
841
- };
842
- content: {
843
- "application/json": {
844
- error: {
845
- code: components["schemas"]["ErrorCode"];
846
- message: string;
847
- details?: unknown;
848
- };
849
- };
850
- };
851
- };
852
- /** @description link=1 with a non-web credential (PAT / OAuth access token) */
853
- 403: {
854
- headers: {
855
- [name: string]: unknown;
856
- };
857
- content: {
858
- "application/json": {
859
- error: {
860
- code: components["schemas"]["ErrorCode"];
861
- message: string;
862
- details?: unknown;
863
- };
864
- };
865
- };
866
- };
867
835
  /** @description Unknown, unconfigured, or credential-kind provider */
868
836
  404: {
869
837
  headers: {
@@ -928,7 +896,7 @@ interface paths {
928
896
  };
929
897
  requestBody?: never;
930
898
  responses: {
931
- /** @description Redirect to the trusted web login/complete page on success, or back to the trusted web /login on failure */
899
+ /** @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 — never a completion code, never accountLabel, never the underlying reason). */
932
900
  302: {
933
901
  headers: {
934
902
  [name: string]: unknown;
@@ -1161,7 +1129,7 @@ interface paths {
1161
1129
  patch?: never;
1162
1130
  trace?: never;
1163
1131
  };
1164
- "/auth/providers/{name}/link-grants": {
1132
+ "/auth/providers/{name}/link-start": {
1165
1133
  parameters: {
1166
1134
  query?: never;
1167
1135
  header?: never;
@@ -1170,7 +1138,7 @@ interface paths {
1170
1138
  };
1171
1139
  get?: never;
1172
1140
  put?: never;
1173
- /** Mint a short-lived, opaque grant that authorizes ONE link start for the current web session */
1141
+ /** Mint an IdP authorization URL + flow-specific state cookie for the current web session (stage 1 of 3) */
1174
1142
  post: {
1175
1143
  parameters: {
1176
1144
  query?: never;
@@ -1180,26 +1148,160 @@ interface paths {
1180
1148
  };
1181
1149
  cookie?: never;
1182
1150
  };
1183
- requestBody?: {
1184
- content: {
1185
- "application/json": {
1186
- handoffChallenge: string;
1151
+ requestBody?: never;
1152
+ responses: {
1153
+ /** @description Authorization URL to navigate the browser to. Sets a flow-specific, 300s state cookie. */
1154
+ 200: {
1155
+ headers: {
1156
+ [name: string]: unknown;
1157
+ };
1158
+ content: {
1159
+ "application/json": {
1160
+ /** Format: uri */
1161
+ authorizationUrl: string;
1162
+ };
1163
+ };
1164
+ };
1165
+ /** @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 — no Set-Cookie or authorizationUrl is returned. */
1166
+ 400: {
1167
+ headers: {
1168
+ [name: string]: unknown;
1169
+ };
1170
+ content: {
1171
+ "application/json": {
1172
+ error: {
1173
+ code: components["schemas"]["ErrorCode"];
1174
+ message: string;
1175
+ details?: unknown;
1176
+ };
1177
+ };
1178
+ };
1179
+ };
1180
+ /** @description Authentication required (credential missing/invalid — resolved by middleware before this route's own validation) */
1181
+ 401: {
1182
+ headers: {
1183
+ [name: string]: unknown;
1184
+ };
1185
+ content: {
1186
+ "application/json": {
1187
+ error: {
1188
+ /** @enum {string} */
1189
+ code: "AUTHENTICATION_REQUIRED";
1190
+ /** @enum {string} */
1191
+ message: "Authentication is required";
1192
+ redirectTo?: string;
1193
+ };
1194
+ };
1195
+ };
1196
+ };
1197
+ /** @description Non-web credential (PAT / OAuth access token) — linking is a session-level account change */
1198
+ 403: {
1199
+ headers: {
1200
+ [name: string]: unknown;
1201
+ };
1202
+ content: {
1203
+ "application/json": {
1204
+ error: {
1205
+ code: components["schemas"]["ErrorCode"];
1206
+ message: string;
1207
+ details?: unknown;
1208
+ };
1209
+ };
1187
1210
  };
1188
1211
  };
1212
+ /** @description Unknown, unconfigured, or credential-kind provider */
1213
+ 404: {
1214
+ headers: {
1215
+ [name: string]: unknown;
1216
+ };
1217
+ content: {
1218
+ "application/json": {
1219
+ error: {
1220
+ code: components["schemas"]["ErrorCode"];
1221
+ message: string;
1222
+ details?: unknown;
1223
+ };
1224
+ };
1225
+ };
1226
+ };
1227
+ /** @description Internal server error (e.g. a declared multi-instance topology with no reachable Redis) */
1228
+ 500: {
1229
+ headers: {
1230
+ [name: string]: unknown;
1231
+ };
1232
+ content: {
1233
+ "application/json": {
1234
+ error: {
1235
+ /** @enum {string} */
1236
+ code: "INTERNAL_ERROR";
1237
+ /** @enum {string} */
1238
+ message: "Internal server error";
1239
+ };
1240
+ };
1241
+ };
1242
+ };
1243
+ };
1244
+ };
1245
+ delete?: never;
1246
+ options?: never;
1247
+ head?: never;
1248
+ patch?: never;
1249
+ trace?: never;
1250
+ };
1251
+ "/auth/providers/{name}/link-completions/{code}": {
1252
+ parameters: {
1253
+ query?: never;
1254
+ header?: never;
1255
+ path?: never;
1256
+ cookie?: never;
1257
+ };
1258
+ /** Read a pending link completion's confirmation details (stage 3a — non-destructive) */
1259
+ get: {
1260
+ parameters: {
1261
+ query?: never;
1262
+ header?: never;
1263
+ path: {
1264
+ name: string;
1265
+ code: string;
1266
+ };
1267
+ cookie?: never;
1189
1268
  };
1269
+ requestBody?: never;
1190
1270
  responses: {
1191
- /** @description Opaque single-use grant id */
1271
+ /** @description Pending, unconsumed completion bound to the caller — provider label fallback + optional display-only accountLabel */
1192
1272
  200: {
1193
1273
  headers: {
1194
1274
  [name: string]: unknown;
1195
1275
  };
1196
1276
  content: {
1197
1277
  "application/json": {
1198
- linkGrant: string;
1278
+ provider: string;
1279
+ accountLabel?: string;
1199
1280
  };
1200
1281
  };
1201
1282
  };
1202
- /** @description Authentication required */
1283
+ /** @description Authenticated but `{code}` fails the 43-character base64url shape (VALIDATION_ERROR) */
1284
+ 400: {
1285
+ headers: {
1286
+ [name: string]: unknown;
1287
+ };
1288
+ content: {
1289
+ "application/json": {
1290
+ error: {
1291
+ /** @enum {string} */
1292
+ code: "VALIDATION_ERROR";
1293
+ message: string;
1294
+ details?: {
1295
+ fieldErrors: {
1296
+ [key: string]: string[];
1297
+ };
1298
+ formErrors: string[];
1299
+ };
1300
+ };
1301
+ };
1302
+ };
1303
+ };
1304
+ /** @description Authentication required — resolved by middleware before this route's own `{code}` shape validation, so an unauthenticated + malformed code is still 401, never 400 */
1203
1305
  401: {
1204
1306
  headers: {
1205
1307
  [name: string]: unknown;
@@ -1231,7 +1333,7 @@ interface paths {
1231
1333
  };
1232
1334
  };
1233
1335
  };
1234
- /** @description Unknown, unconfigured, or credential-kind provider */
1336
+ /** @description Never-issued, expired, retention-expired, or bound to a different user/provider/authVersion — all collapse to the same generic NOT_FOUND (no result-unknown code exists) */
1235
1337
  404: {
1236
1338
  headers: {
1237
1339
  [name: string]: unknown;
@@ -1246,6 +1348,148 @@ interface paths {
1246
1348
  };
1247
1349
  };
1248
1350
  };
1351
+ /** @description The caller's own completion was already consumed */
1352
+ 409: {
1353
+ headers: {
1354
+ [name: string]: unknown;
1355
+ };
1356
+ content: {
1357
+ "application/json": {
1358
+ error: {
1359
+ /** @enum {string} */
1360
+ code: "LINK_COMPLETION_CONSUMED";
1361
+ message: string;
1362
+ };
1363
+ };
1364
+ };
1365
+ };
1366
+ /** @description Internal server error */
1367
+ 500: {
1368
+ headers: {
1369
+ [name: string]: unknown;
1370
+ };
1371
+ content: {
1372
+ "application/json": {
1373
+ error: {
1374
+ /** @enum {string} */
1375
+ code: "INTERNAL_ERROR";
1376
+ /** @enum {string} */
1377
+ message: "Internal server error";
1378
+ };
1379
+ };
1380
+ };
1381
+ };
1382
+ };
1383
+ };
1384
+ put?: never;
1385
+ /** Atomically consume a link completion code and insert the identity (stage 3b — terminal) */
1386
+ post: {
1387
+ parameters: {
1388
+ query?: never;
1389
+ header?: never;
1390
+ path: {
1391
+ name: string;
1392
+ code: string;
1393
+ };
1394
+ cookie?: never;
1395
+ };
1396
+ requestBody?: never;
1397
+ responses: {
1398
+ /** @description Linked (fresh winner OR an already-consumed replay that resolves to the same owner) — the same body either way */
1399
+ 200: {
1400
+ headers: {
1401
+ [name: string]: unknown;
1402
+ };
1403
+ content: {
1404
+ "application/json": {
1405
+ /** @enum {string} */
1406
+ result: "linked";
1407
+ };
1408
+ };
1409
+ };
1410
+ /** @description Authenticated but `{code}` fails the 43-character base64url shape (VALIDATION_ERROR) */
1411
+ 400: {
1412
+ headers: {
1413
+ [name: string]: unknown;
1414
+ };
1415
+ content: {
1416
+ "application/json": {
1417
+ error: {
1418
+ /** @enum {string} */
1419
+ code: "VALIDATION_ERROR";
1420
+ message: string;
1421
+ details?: {
1422
+ fieldErrors: {
1423
+ [key: string]: string[];
1424
+ };
1425
+ formErrors: string[];
1426
+ };
1427
+ };
1428
+ };
1429
+ };
1430
+ };
1431
+ /** @description Authentication required — resolved by middleware before this route's own `{code}` shape validation, so an unauthenticated + malformed code is still 401, never 400 */
1432
+ 401: {
1433
+ headers: {
1434
+ [name: string]: unknown;
1435
+ };
1436
+ content: {
1437
+ "application/json": {
1438
+ error: {
1439
+ /** @enum {string} */
1440
+ code: "AUTHENTICATION_REQUIRED";
1441
+ /** @enum {string} */
1442
+ message: "Authentication is required";
1443
+ redirectTo?: string;
1444
+ };
1445
+ };
1446
+ };
1447
+ };
1448
+ /** @description Non-web credential (PAT / OAuth access token) */
1449
+ 403: {
1450
+ headers: {
1451
+ [name: string]: unknown;
1452
+ };
1453
+ content: {
1454
+ "application/json": {
1455
+ error: {
1456
+ code: components["schemas"]["ErrorCode"];
1457
+ message: string;
1458
+ details?: unknown;
1459
+ };
1460
+ };
1461
+ };
1462
+ };
1463
+ /** @description Never-issued, expired, retention-expired, or bound to a different user/provider — all collapse to the same generic NOT_FOUND */
1464
+ 404: {
1465
+ headers: {
1466
+ [name: string]: unknown;
1467
+ };
1468
+ content: {
1469
+ "application/json": {
1470
+ error: {
1471
+ code: components["schemas"]["ErrorCode"];
1472
+ message: string;
1473
+ details?: unknown;
1474
+ };
1475
+ };
1476
+ };
1477
+ };
1478
+ /** @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) — no other conflict code exists. */
1479
+ 409: {
1480
+ headers: {
1481
+ [name: string]: unknown;
1482
+ };
1483
+ content: {
1484
+ "application/json": {
1485
+ error: {
1486
+ /** @enum {string} */
1487
+ code: "FEDERATED_IDENTITY_IN_USE" | "FEDERATED_LINK_AUTH_STATE_CHANGED" | "FEDERATED_LINK_NOT_LINKED";
1488
+ message: string;
1489
+ };
1490
+ };
1491
+ };
1492
+ };
1249
1493
  /** @description Internal server error */
1250
1494
  500: {
1251
1495
  headers: {
@@ -15234,7 +15478,7 @@ interface components {
15234
15478
  };
15235
15479
  };
15236
15480
  /** @enum {string} */
15237
- ErrorCode: "AUTHENTICATION_REQUIRED" | "ADMIN_REQUIRED" | "THIRD_PARTY_AUTH_REQUIRED" | "USER_REGISTERED" | "USER_SUSPENDED" | "USER_INVITED" | "USER_NOT_ACTIVE" | "EMAIL_NOT_CONFIRMED" | "INTERNAL_ERROR" | "VALIDATION_ERROR" | "INVALID_REQUEST" | "NOT_FOUND" | "CONFLICT" | "SERVICE_UNAVAILABLE" | "APPLICATION_NOT_INSTALLED" | "INVALID_PAGE_ID" | "PAGE_NOT_FOUND" | "PAGE_NOT_GRANTED" | "PAGE_REVISION_ERROR" | "PAGE_TWIN_EXISTS" | "INVALID_GRANT" | "COMMENT_NOT_FOUND" | "NOTIFICATION_NOT_FOUND" | "USER_NOT_FOUND" | "USER_EXISTS" | "USERNAME_TAKEN" | "EMAIL_TAKEN" | "EMAIL_NOT_ALLOWED" | "INVALID_ACTIVATION_TOKEN" | "INVALID_INVITE_TOKEN" | "INVITE_ALREADY_ACCEPTED" | "INVALID_RESET_TOKEN" | "INVALID_EMAIL_CHANGE_TOKEN" | "INVALID_CREDENTIALS" | "REFRESH_TOKEN_REQUIRED" | "REGISTRATION_CLOSED" | "FEDERATED_HANDOFF_INVALID" | "FEDERATED_HANDOFF_CONSUMED" | "ENCRYPTION_NOT_CONFIGURED" | "MAIL_FROM_NOT_CONFIGURED" | "MAIL_TEST_FAILED" | "PLUGIN_NOT_FOUND" | "PLUGIN_CONFIG_VALIDATION_FAILED";
15481
+ ErrorCode: "AUTHENTICATION_REQUIRED" | "ADMIN_REQUIRED" | "THIRD_PARTY_AUTH_REQUIRED" | "USER_REGISTERED" | "USER_SUSPENDED" | "USER_INVITED" | "USER_NOT_ACTIVE" | "EMAIL_NOT_CONFIRMED" | "INTERNAL_ERROR" | "VALIDATION_ERROR" | "INVALID_REQUEST" | "NOT_FOUND" | "CONFLICT" | "SERVICE_UNAVAILABLE" | "APPLICATION_NOT_INSTALLED" | "INVALID_PAGE_ID" | "PAGE_NOT_FOUND" | "PAGE_NOT_GRANTED" | "PAGE_REVISION_ERROR" | "PAGE_TWIN_EXISTS" | "INVALID_GRANT" | "COMMENT_NOT_FOUND" | "NOTIFICATION_NOT_FOUND" | "USER_NOT_FOUND" | "USER_EXISTS" | "USERNAME_TAKEN" | "EMAIL_TAKEN" | "EMAIL_NOT_ALLOWED" | "INVALID_ACTIVATION_TOKEN" | "INVALID_INVITE_TOKEN" | "INVITE_ALREADY_ACCEPTED" | "INVALID_RESET_TOKEN" | "INVALID_EMAIL_CHANGE_TOKEN" | "INVALID_CREDENTIALS" | "REFRESH_TOKEN_REQUIRED" | "REGISTRATION_CLOSED" | "FEDERATED_HANDOFF_INVALID" | "FEDERATED_HANDOFF_CONSUMED" | "FEDERATED_IDENTITY_IN_USE" | "FEDERATED_LINK_AUTH_STATE_CHANGED" | "FEDERATED_LINK_NOT_LINKED" | "LINK_COMPLETION_CONSUMED" | "ENCRYPTION_NOT_CONFIGURED" | "MAIL_FROM_NOT_CONFIGURED" | "MAIL_TEST_FAILED" | "PLUGIN_NOT_FOUND" | "PLUGIN_CONFIG_VALIDATION_FAILED";
15238
15482
  ApplicationNotInstalledError: {
15239
15483
  error: {
15240
15484
  /** @enum {string} */