@crowi/api-contract 2.0.0-alpha.0 → 2.0.0-alpha.1

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
@@ -150,7 +150,10 @@ var ForbiddenErrorSchema = ApiErrorSchema.extend({
150
150
  import { z as z3 } from "@hono/zod-openapi";
151
151
  var AppInfoResponseSchema = z3.object({
152
152
  title: z3.string().nullable(),
153
- confidential: z3.string().nullable()
153
+ confidential: z3.string().nullable(),
154
+ version: z3.string(),
155
+ apiVersion: z3.string(),
156
+ capabilities: z3.array(z3.string())
154
157
  });
155
158
 
156
159
  // src/contracts/app.ts
@@ -5882,7 +5885,10 @@ var stubListPlugins = { plugins: [] };
5882
5885
  var stubPluginConfig = { name: "", fields: [], values: {} };
5883
5886
  var stubUpdatePluginConfig = { ok: true, hotReloaded: false, reconfigureFailed: false };
5884
5887
  var stubClearRenderCache = { ok: true, clearedAt: "", removedCount: 0 };
5885
- var appAuthMeUserChain = new OpenAPIHono().openapi(appRoutes.getAppInfoRoute, (c) => c.json({ title: null, confidential: null }, 200)).openapi(installerRoutes.getInstallerStatusRoute, (c) => c.json({ status: "installer_required" }, 200)).openapi(installerRoutes.createAdminRoute, (c) => c.json({ status: "ok" }, 200)).openapi(tokenAuthRoutes.tokenLoginRoute, (c) => c.json(stubTokens, 200)).openapi(tokenAuthRoutes.tokenRegisterRoute, (c) => c.json({ status: "confirmation_required" }, 200)).openapi(inviteAcceptRoutes.invitePreviewRoute, (c) => c.json({ email: "stub@example.com" }, 200)).openapi(inviteAcceptRoutes.acceptInviteRoute, (c) => c.json(stubTokens, 200)).openapi(passwordResetRoutes.forgotPasswordRoute, (c) => c.json({ ok: true }, 200)).openapi(passwordResetRoutes.validateResetTokenRoute, (c) => c.json({ ok: true }, 200)).openapi(passwordResetRoutes.selfResetPasswordRoute, (c) => c.json(stubTokens, 200)).openapi(activationRoutes.validateActivationTokenRoute, (c) => c.json({ ok: true }, 200)).openapi(activationRoutes.activateAccountRoute, (c) => c.json(stubTokens, 200)).openapi(emailChangeRoutes.validateEmailChangeTokenRoute, (c) => c.json({ ok: true, email: "stub@example.com" }, 200)).openapi(emailChangeRoutes.confirmEmailChangeRoute, (c) => c.json({ ok: true, email: "stub@example.com" }, 200)).openapi(tokenAuthRoutes.tokenRefreshRoute, (c) => c.json(stubTokens, 200)).openapi(tokenAuthRoutes.tokenLogoutRoute, (c) => c.json({ message: "" }, 200)).openapi(
5888
+ var appAuthMeUserChain = new OpenAPIHono().openapi(
5889
+ appRoutes.getAppInfoRoute,
5890
+ (c) => c.json({ title: null, confidential: null, version: "", apiVersion: "v2", capabilities: [] }, 200)
5891
+ ).openapi(installerRoutes.getInstallerStatusRoute, (c) => c.json({ status: "installer_required" }, 200)).openapi(installerRoutes.createAdminRoute, (c) => c.json({ status: "ok" }, 200)).openapi(tokenAuthRoutes.tokenLoginRoute, (c) => c.json(stubTokens, 200)).openapi(tokenAuthRoutes.tokenRegisterRoute, (c) => c.json({ status: "confirmation_required" }, 200)).openapi(inviteAcceptRoutes.invitePreviewRoute, (c) => c.json({ email: "stub@example.com" }, 200)).openapi(inviteAcceptRoutes.acceptInviteRoute, (c) => c.json(stubTokens, 200)).openapi(passwordResetRoutes.forgotPasswordRoute, (c) => c.json({ ok: true }, 200)).openapi(passwordResetRoutes.validateResetTokenRoute, (c) => c.json({ ok: true }, 200)).openapi(passwordResetRoutes.selfResetPasswordRoute, (c) => c.json(stubTokens, 200)).openapi(activationRoutes.validateActivationTokenRoute, (c) => c.json({ ok: true }, 200)).openapi(activationRoutes.activateAccountRoute, (c) => c.json(stubTokens, 200)).openapi(emailChangeRoutes.validateEmailChangeTokenRoute, (c) => c.json({ ok: true, email: "stub@example.com" }, 200)).openapi(emailChangeRoutes.confirmEmailChangeRoute, (c) => c.json({ ok: true, email: "stub@example.com" }, 200)).openapi(tokenAuthRoutes.tokenRefreshRoute, (c) => c.json(stubTokens, 200)).openapi(tokenAuthRoutes.tokenLogoutRoute, (c) => c.json({ message: "" }, 200)).openapi(
5886
5892
  tokenAuthRoutes.tokenMeRoute,
5887
5893
  (c) => c.json(
5888
5894
  {
@@ -5910,6 +5916,23 @@ var createClient = (baseUrl, options = {}) => hc(baseUrl, {
5910
5916
  fetch: options.fetch
5911
5917
  });
5912
5918
 
5919
+ // src/schemas/app-capabilities.ts
5920
+ var STATIC_CAPABILITIES = [
5921
+ "oauth",
5922
+ // The oauth:* tags mirror GRANT_TYPES_SUPPORTED + the S256 PKCE method
5923
+ // (schemas/oauth-endpoints.ts / the RFC 8414 discovery doc). Keep in sync.
5924
+ "oauth:auth-code",
5925
+ "oauth:device",
5926
+ "oauth:pkce",
5927
+ "pat",
5928
+ "pages",
5929
+ "comments",
5930
+ "bookmarks",
5931
+ "attachments",
5932
+ "notifications"
5933
+ ];
5934
+ var API_SURFACE_VERSION = "v2";
5935
+
5913
5936
  // src/schemas/mail-token.ts
5914
5937
  import { z as z54 } from "@hono/zod-openapi";
5915
5938
  var MailTokenPurposeSchema = z54.enum(["invite", "activate", "reset", "email-change"]);
@@ -5930,6 +5953,7 @@ var MailTokenPayloadSchema = z54.object({
5930
5953
  });
5931
5954
  export {
5932
5955
  ALL_SCOPES,
5956
+ API_SURFACE_VERSION,
5933
5957
  AccessTokenSchema,
5934
5958
  ActivateRequestSchema,
5935
5959
  ActivateValidationResponseSchema,
@@ -6146,6 +6170,7 @@ export {
6146
6170
  RevokeRequestSchema,
6147
6171
  RevokeResponseSchema,
6148
6172
  SCOPES,
6173
+ STATIC_CAPABILITIES,
6149
6174
  SearchAdminUsersByEmailRequestSchema,
6150
6175
  SearchAdminUsersByEmailResponseSchema,
6151
6176
  SearchDriverEntrySchema,