@nocobase/app-plugin-api-keys 1.0.0-beta.13 → 1.0.0-beta.15

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.
Files changed (82) hide show
  1. package/CHANGELOG.md +64 -0
  2. package/README.md +7 -10
  3. package/dist/client/api-keys-client.d.ts.map +1 -1
  4. package/dist/client/api-keys-client.js.map +1 -1
  5. package/dist/client/index.d.ts +0 -2
  6. package/dist/client/index.d.ts.map +1 -1
  7. package/dist/client/index.js +0 -1
  8. package/dist/client/index.js.map +1 -1
  9. package/dist/client/plugin.d.ts +5 -6
  10. package/dist/client/plugin.d.ts.map +1 -1
  11. package/dist/client/plugin.js +4 -4
  12. package/dist/client/plugin.js.map +1 -1
  13. package/package.json +10 -25
  14. package/skills/nocobase-app-plugin-api-keys/SKILL.md +18 -23
  15. package/dist/client/components/page-container.d.ts +0 -4
  16. package/dist/client/components/page-container.d.ts.map +0 -1
  17. package/dist/client/components/page-container.js +0 -6
  18. package/dist/client/components/page-container.js.map +0 -1
  19. package/dist/client/components/page-header.d.ts +0 -8
  20. package/dist/client/components/page-header.d.ts.map +0 -1
  21. package/dist/client/components/page-header.js +0 -5
  22. package/dist/client/components/page-header.js.map +0 -1
  23. package/dist/client/components/ui/alert-dialog.d.ts +0 -19
  24. package/dist/client/components/ui/alert-dialog.d.ts.map +0 -1
  25. package/dist/client/components/ui/alert-dialog.js +0 -42
  26. package/dist/client/components/ui/alert-dialog.js.map +0 -1
  27. package/dist/client/components/ui/badge.d.ts +0 -6
  28. package/dist/client/components/ui/badge.d.ts.map +0 -1
  29. package/dist/client/components/ui/badge.js +0 -8
  30. package/dist/client/components/ui/badge.js.map +0 -1
  31. package/dist/client/components/ui/button.d.ts +0 -8
  32. package/dist/client/components/ui/button.d.ts.map +0 -1
  33. package/dist/client/components/ui/button.js +0 -27
  34. package/dist/client/components/ui/button.js.map +0 -1
  35. package/dist/client/components/ui/dialog.d.ts +0 -9
  36. package/dist/client/components/ui/dialog.d.ts.map +0 -1
  37. package/dist/client/components/ui/dialog.js +0 -29
  38. package/dist/client/components/ui/dialog.js.map +0 -1
  39. package/dist/client/components/ui/input.d.ts +0 -4
  40. package/dist/client/components/ui/input.d.ts.map +0 -1
  41. package/dist/client/components/ui/input.js +0 -8
  42. package/dist/client/components/ui/input.js.map +0 -1
  43. package/dist/client/components/ui/label.d.ts +0 -3
  44. package/dist/client/components/ui/label.d.ts.map +0 -1
  45. package/dist/client/components/ui/label.js +0 -6
  46. package/dist/client/components/ui/label.js.map +0 -1
  47. package/dist/client/components/ui/select.d.ts +0 -8
  48. package/dist/client/components/ui/select.d.ts.map +0 -1
  49. package/dist/client/components/ui/select.js +0 -19
  50. package/dist/client/components/ui/select.js.map +0 -1
  51. package/dist/client/components/ui/spinner.d.ts +0 -4
  52. package/dist/client/components/ui/spinner.d.ts.map +0 -1
  53. package/dist/client/components/ui/spinner.js +0 -11
  54. package/dist/client/components/ui/spinner.js.map +0 -1
  55. package/dist/client/components/ui/table.d.ts +0 -8
  56. package/dist/client/components/ui/table.d.ts.map +0 -1
  57. package/dist/client/components/ui/table.js +0 -21
  58. package/dist/client/components/ui/table.js.map +0 -1
  59. package/dist/client/lib/utils.d.ts +0 -2
  60. package/dist/client/lib/utils.d.ts.map +0 -1
  61. package/dist/client/lib/utils.js +0 -2
  62. package/dist/client/lib/utils.js.map +0 -1
  63. package/dist/client/locales/en-US.d.ts +0 -71
  64. package/dist/client/locales/en-US.d.ts.map +0 -1
  65. package/dist/client/locales/en-US.js +0 -62
  66. package/dist/client/locales/en-US.js.map +0 -1
  67. package/dist/client/locales/index.d.ts +0 -4
  68. package/dist/client/locales/index.d.ts.map +0 -1
  69. package/dist/client/locales/index.js +0 -7
  70. package/dist/client/locales/index.js.map +0 -1
  71. package/dist/client/locales/zh-CN.d.ts +0 -4
  72. package/dist/client/locales/zh-CN.d.ts.map +0 -1
  73. package/dist/client/locales/zh-CN.js +0 -62
  74. package/dist/client/locales/zh-CN.js.map +0 -1
  75. package/dist/client/pages/api-keys-page.d.ts +0 -3
  76. package/dist/client/pages/api-keys-page.d.ts.map +0 -1
  77. package/dist/client/pages/api-keys-page.js +0 -161
  78. package/dist/client/pages/api-keys-page.js.map +0 -1
  79. package/dist/client/routes.d.ts +0 -22
  80. package/dist/client/routes.d.ts.map +0 -1
  81. package/dist/client/routes.js +0 -42
  82. package/dist/client/routes.js.map +0 -1
package/CHANGELOG.md CHANGED
@@ -1,5 +1,69 @@
1
1
  # @nocobase/app-plugin-api-keys
2
2
 
3
+ ## 1.0.0-beta.15
4
+
5
+ ### Patch Changes
6
+
7
+ - cf23bfe: Republish every package so the `latest` dist-tag points at its current beta release, matching `beta`.
8
+ - Updated dependencies [cf23bfe]
9
+ - @nocobase/app-client@3.0.0-beta.1
10
+ - @nocobase/app-plugin-authentication@2.0.0-beta.6
11
+ - @nocobase/app-plugin-authorization@1.0.0-beta.27
12
+ - @nocobase/app-server@2.0.0-beta.4
13
+ - @nocobase/authorization@1.0.0-beta.13
14
+ - @nocobase/db@1.0.0-beta.19
15
+ - @nocobase/service-provider@0.0.2-beta.2
16
+
17
+ ## 1.0.0-beta.14
18
+
19
+ ### Minor Changes
20
+
21
+ - c796cb9: Plugins no longer contribute Settings or Dev pages. Every page a plugin registered under `/settings/...` or `/dev/...` is removed, together with the components, locale keys and tests only those pages used; an application that wants such a page builds it on the plugin's HTTP API and client and declares it among its own routes.
22
+
23
+ - `@nocobase/app-plugin-api-keys`: the API keys page, `createApiKeysRoutes`, `normalizeApiKeysRoutePath`, `API_KEYS_PAGE_ACCESS`, `API_KEYS_ROUTE_ID` and the `./client/routes` entry are removed. The client factory takes no options, so call `apiKeys()`.
24
+ - `@nocobase/app-plugin-authorization`: the Permission Sets and Permission Inspector pages, the `./client/routes` entry and the `./client/management` entry the rule plugins built their pages from are removed. `useCan`, `AuthorizationClient`, the provider and the HTTP API are unchanged.
25
+ - `@nocobase/app-plugin-authz-default-access`, `@nocobase/app-plugin-authz-restriction-rules`, `@nocobase/app-plugin-authz-sharing-rules`: the rule pages and the `./client/routes` entry are removed. The client registers only the locale for the title its server registers.
26
+ - `@nocobase/app-plugin-database-explorer`: the explorer page and the `./client/routes` entry are removed. `DatabaseExplorerClient` and `DATABASE_EXPLORER_ACCESS` remain.
27
+ - `@nocobase/app-plugin-mail`: the account overview page and every Dev page are removed, along with the browser acceptance suite that drove them. `MailWorkspacePage` and `MailAccountsPage` remain; `MailWorkspacePage` takes an `accountsHref` that names the application's accounts page, and its empty state links there only when it is given. `mail.oauthReturnUrl` now defaults to the application root instead of `/dev/mail/accounts`; set it to the page that renders `MailAccountsPage`.
28
+ - `@nocobase/app-plugin-notification`: the notification logs page and the `./client/routes` entry are removed; the `logs-ui` registry item is unchanged.
29
+ - `@nocobase/app-plugin-notification-in-app`: the Dev inbox page, the `routes` export and the `./client/routes` entry are removed. Render `NotificationInAppInbox` inside `NotificationInAppProvider` in an application page.
30
+ - `@nocobase/app-plugin-scheduler`: the schedule list and detail pages are removed. The client registers only the locales for the titles its server registers.
31
+ - `@nocobase/app-plugin-users`: the user management page and the `mount`, `path`, `title` and `componentLoader` options are removed, together with `createUsersRoutes`, `USERS_PAGE_ACCESS` and `USERS_ROUTE_ID`. The plugin contributes only the invitation page at `/invite/:token`, which `inviteComponentLoader` still replaces; build a user management page on `UsersClient`.
32
+
33
+ - c796cb9: Remove the Settings and Dev route surfaces. `@nocobase/app-client` no longer exports `defineSettingsRoutes()`, `defineDevRoutes()`, `isAppClientSettingsRouteGroup()`, `isAppClientDevRouteGroup()` or their definition, contribution and registered-route types, and the resolved runtime no longer carries `settingsRouteTree`, `devRouteTree`, `settings`, `settingGroups`, `devRoutes` or `devRouteGroups`. `AppClientSettingsRouteNavigation` is renamed `AppClientRouteNavigation` and `AppClientSettingIcon` is renamed `AppClientRouteIcon`. A contribution to any parent other than `app` now fails registration with a message that names `defineAppRoutes()`. Plugins contribute no settings or dev pages; an application that wants a configuration page declares it with `defineAppRoutes()` in its own navigation, for example under a Settings group.
34
+
35
+ The default and examples templates drop the settings layout, the `/settings/*` route, the dev route plumbing, and the Settings and Inbox buttons in the header; the `/inbox` page and the inbox block stay. The examples template no longer registers `@nocobase/app-plugin-departments-example`, which is removed. Upgrading an application means removing `defineSettingsRoutes([])` from `client/routes.ts`, the `settingsRouteTree` and `devRouteTree` props passed to `AppRouter`, and any settings layout it kept, and moving its own settings pages to `defineAppRoutes()`. Every package that depends on or peers with `@nocobase/app-client` is released again so that its published range accepts `3.0.0-beta.0`.
36
+
37
+ ### Patch Changes
38
+
39
+ - c796cb9: Remove the AI employee packages from the repository
40
+
41
+ `@nocobase/app-plugin-ai-employee`, `@nocobase/ai-employee` and `@nocobase/app-plugin-ai-employee-example` were already deprecated and no template installed them; they are now deleted and will not be released again. The Default and Examples templates drop `@nocobase/ai-employee-avatars`, which only the plugin's avatars used.
42
+
43
+ Generated plugins' `AGENTS.md` and the copies shipped with existing plugins no longer list `@nocobase/ai-employee` among the identity-sensitive packages. The HTTP API references in the application development Skill use other plugins for their examples, and the upgrade Skill tells an application that still depends on the removed packages to review their usage before removing them, because the runtime will move past what their peer ranges accept.
44
+
45
+ `pnpm build` no longer copies `ai/skills` into `dist/ai/skills`. The AI employee plugin was the only reader of that directory; an application that keeps Skills there for another purpose has to copy them itself, for example from a build hook.
46
+
47
+ - c796cb9: Remove NocoBase Hub. `@nocobase/app-plugin-hub`, `@nocobase/app-template-hub` and `@nocobase/hub-cli` are no longer published, and every package that offered or described the Hub drops it.
48
+
49
+ Breaking for `@nocobase/app-installer`: it installs, upgrades and rolls back from a deployment archive only. `install --template`, `install --keep-source`, `upgrade --to`, `upgrade --rebuild`, `upgrade --keep-source` and `status --offline` are removed, as are the `latest` and `updateAvailable` members of the `status` result and the `rebuilt` and `notes` members of the `upgrade` result. An installation an earlier version built from the published Hub template is refused with `STATE_UNSUPPORTED`; manage it with the app-installer version that installed it. The error codes that only a template build reported (`PNPM_MISSING`, `PNPM_UNSUPPORTED`, `REGISTRY_UNREACHABLE`, `VERSION_NOT_FOUND`, `DISK_LOW`, `CREATE_FAILED`, `DRIVER_INSTALL_FAILED` and `BUILD_FAILED`) are no longer produced, and pm2 always kills the process tree of an application it stops.
50
+
51
+ Breaking for `@nocobase/create-app`: `--template hub` is no longer a template name, and a generated application no longer gets a `.env`.
52
+
53
+ The Default template no longer depends on `@nocobase/hub-cli`, so an application generated from it has no `pnpm nocobase hub` commands. An application upgraded from an earlier version that published to a Hub removes the dependency with `pnpm nocobase package remove @nocobase/hub-cli` and deletes `.nocobase/hub.json`; the `nocobase-app-upgrade` Skill describes the steps. The application Skills, the plugins' documentation and the in-app test notification text no longer mention the Hub.
54
+
55
+ - Updated dependencies [c796cb9]
56
+ - Updated dependencies [c796cb9]
57
+ - Updated dependencies [c796cb9]
58
+ - Updated dependencies [fb7b576]
59
+ - @nocobase/app-server@2.0.0-beta.3
60
+ - @nocobase/app-plugin-authentication@2.0.0-beta.3
61
+ - @nocobase/app-plugin-authorization@1.0.0-beta.26
62
+ - @nocobase/app-client@3.0.0-beta.0
63
+ - @nocobase/authorization@1.0.0-beta.12
64
+ - @nocobase/db@1.0.0-beta.18
65
+ - @nocobase/service-provider@0.0.2-beta.1
66
+
3
67
  ## 1.0.0-beta.13
4
68
 
5
69
  ### Minor Changes
package/README.md CHANGED
@@ -4,14 +4,13 @@ API key authentication for NocoBase applications, built on Better Auth.
4
4
 
5
5
  A key authenticates as the user who created it. `Auth.getSession()` resolves the `x-api-key` header the same way it resolves a session cookie, so `auth.required()`, the route guards, and `@nocobase/app-plugin-authorization` all see the owning user and exactly the roles that user holds. Nothing in an application has to know a request arrived by key rather than by cookie.
6
6
 
7
- Keys are self-service: each signed-in user creates and revokes their own under `/settings/api-keys`.
7
+ Keys are self-service: each signed-in user creates and revokes their own. The plugin ships no page for that; an application builds one on `authClient.apiKey.*` or the scoped key API below and declares it among its own routes.
8
8
 
9
9
  ## What this package is
10
10
 
11
11
  Better Auth's [API Key plugin](https://www.better-auth.com/docs/plugins/api-key), plus the parts an application needs around it:
12
12
 
13
13
  - the `apikey` table migration;
14
- - the Settings page and its locales;
15
14
  - `apiKey` and `apiKeyClient`, carrying Better Auth's own names and options.
16
15
 
17
16
  `apiKey` is wrapped only to supply three defaults, all of them overridable; everything else is Better Auth's behavior and its documentation applies unchanged. They come from this package rather than from a dependency each application installs because the migration here has to match the schema that version of `@better-auth/api-key` declares; a test asserts the table carries a column for every field the plugin declares.
@@ -31,9 +30,9 @@ export default defineAppConfig((_runtime) => ({
31
30
  ```
32
31
 
33
32
  ```ts
34
- // client/plugins.ts — the management page
33
+ // client/plugins.ts — registers the plugin; it contributes no pages
35
34
  import apiKeys from '@nocobase/app-plugin-api-keys/client';
36
- apiKeys({ path: '/api-keys' });
35
+ apiKeys();
37
36
 
38
37
  // client/config/auth.ts — so authClient.apiKey.* reaches the endpoints
39
38
  import { apiKeyClient } from '@nocobase/app-plugin-api-keys/client';
@@ -43,7 +42,7 @@ export default defineAppConfig((_runtime) => ({
43
42
  }));
44
43
  ```
45
44
 
46
- Then grant `page:api-keys/access` to the roles that may manage keys — normally all authenticated users, since every endpoint acts only on the caller's own keys — and run `pnpm nocobase db apply`.
45
+ Then run `pnpm nocobase db apply`.
47
46
 
48
47
  Registering the server plugin without `apiKey()` creates the table and mounts no endpoints; registering `apiKey()` without the server plugin mounts endpoints against a table that does not exist.
49
48
 
@@ -51,9 +50,9 @@ Registering the server plugin without `apiKey()` creates the table and mounts no
51
50
 
52
51
  | Option | Better Auth | Here | Why |
53
52
  | ------------------------- | ----------------------------------- | ------- | ----------------------------------------------------------------------------------------------------------------------- |
54
- | `enableSessionForAPIKeys` | `false` | `true` | Without it a key authenticates nothing: the page still issues keys, and every request carrying one answers 401 |
53
+ | `enableSessionForAPIKeys` | `false` | `true` | Without it a key authenticates nothing: keys are still issued, and every request carrying one answers 401 |
55
54
  | `rateLimit.enabled` | `true`, 10 requests per key per day | `false` | That is a quota for issuing keys rather than for using them, and it silently breaks the first integration anyone writes |
56
- | `requireName` | `false` | `true` | The management page identifies a key by its name, and a key listed as "unnamed" cannot be revoked with any confidence |
55
+ | `requireName` | `false` | `true` | A key is identified by its name, and a key listed as "unnamed" cannot be revoked with any confidence |
57
56
 
58
57
  All three are overridable. `apiKey({ rateLimit: { enabled: true, maxRequests: 1000, timeWindow: 60_000 } })` sets a quota, and passing all three back reproduces Better Auth's own behaviour exactly.
59
58
 
@@ -145,8 +144,6 @@ A service account's key is treated as scoped even without a scope: `required()`
145
144
 
146
145
  `toApiKeysApiError(error)` turns `ApiKeyScopeError` and `ApiKeyRequestError` into that body's `ApiError`, for an application's own key routes: `router.onError((error, context) => apiErrorHandler(toApiKeysApiError(error), context))`.
147
146
 
148
- The Settings page under `/settings/api-keys` predates scopes and does not offer them; an application that offers scoped keys builds its own page on this API.
149
-
150
147
  ## Verification
151
148
 
152
149
  ```bash
@@ -163,4 +160,4 @@ Server calls run through `Auth.pluginApi()` and the normal Better Auth hooks; `w
163
160
 
164
161
  `findRequestApiKey(plugin, headers)` returns the key a request carries, read from the headers of every configuration that resolves keys into sessions, and `createApiKeyApiDocsAccess(resolveAuth)` is the API document access check the plugin's server registers; an application assembling its own providers can register it on `apiDocsToken` itself. `Auth.plugin<ApiKeysPlugin>('api-key')?.options.configurations` holds the configurations `apiKey()` was created with, after its defaults.
165
162
 
166
- Trusted lifecycle integrations can call `removeUserApiKeys(connection, userId, configIds)` within their user-deletion transaction to remove database-backed credentials for explicit user-referencing configurations. Do not pass organization-referencing or custom-storage configurations. Hub uses `default` and `hub-publishing`; dependent Hub bindings are removed by foreign-key cascades.
163
+ Trusted lifecycle integrations can call `removeUserApiKeys(connection, userId, configIds)` within their user-deletion transaction to remove database-backed credentials for explicit user-referencing configurations. Do not pass organization-referencing or custom-storage configurations.
@@ -1 +1 @@
1
- {"version":3,"file":"api-keys-client.d.ts","sourceRoot":"","sources":["../../client/api-keys-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAEhE;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAG3D,OAAO,QAAQ,4CAA4C,CAAC;IAC1D,UAAU,wBAAwB;QAChC,SAAS,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;KAC5C;CACF;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC"}
1
+ {"version":3,"file":"api-keys-client.d.ts","sourceRoot":"","sources":["../../client/api-keys-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAC;AACnD,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAIhE;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC;AAG3D,OAAO,QAAQ,4CAA4C,CAAC;IAC1D,UAAU,wBAAwB;QAChC,SAAS,EAAE,UAAU,CAAC,OAAO,YAAY,CAAC,CAAC;KAC5C;CACF;AAED;;;GAGG;AACH,MAAM,MAAM,aAAa,GAAG,IAAI,CAAC,MAAM,EAAE,KAAK,CAAC,CAAC"}
@@ -1 +1 @@
1
- {"version":3,"file":"api-keys-client.js","sourceRoot":"","sources":["../../client/api-keys-client.ts"],"names":[],"mappings":"AAGA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC"}
1
+ {"version":3,"file":"api-keys-client.js","sourceRoot":"","sources":["../../client/api-keys-client.ts"],"names":[],"mappings":"AAKA;;;;GAIG;AACH,OAAO,EAAE,YAAY,EAAE,MAAM,6BAA6B,CAAC"}
@@ -1,6 +1,4 @@
1
1
  export { default } from './plugin.js';
2
- export type { ApiKeysClientOptions } from './plugin.js';
3
- export { createApiKeysRoutes, API_KEYS_PAGE_ACCESS, API_KEYS_ROUTE_ID, } from './routes.js';
4
2
  export { apiKeyClient, type ApiKeySummary } from './api-keys-client.js';
5
3
  export { API_KEY_EXPIRY_CHOICES, expiryChoiceToSeconds, formatKeyHint, isExpired, type ApiKeyExpiryChoice, } from './expiry.js';
6
4
  //# sourceMappingURL=index.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,YAAY,EAAE,oBAAoB,EAAE,MAAM,aAAa,CAAC;AACxD,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,SAAS,EACT,KAAK,kBAAkB,GACxB,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,YAAY,EAAE,KAAK,aAAa,EAAE,MAAM,sBAAsB,CAAC;AACxE,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,SAAS,EACT,KAAK,kBAAkB,GACxB,MAAM,aAAa,CAAC"}
@@ -1,7 +1,6 @@
1
1
  // The plugin's public client surface. The default export is the registration
2
2
  // factory an application lists in its client/plugins.ts.
3
3
  export { default } from './plugin.js';
4
- export { createApiKeysRoutes, API_KEYS_PAGE_ACCESS, API_KEYS_ROUTE_ID, } from './routes.js';
5
4
  export { apiKeyClient } from './api-keys-client.js';
6
5
  export { API_KEY_EXPIRY_CHOICES, expiryChoiceToSeconds, formatKeyHint, isExpired, } from './expiry.js';
7
6
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,yDAAyD;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAEtC,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,iBAAiB,GAClB,MAAM,aAAa,CAAC;AACrB,OAAO,EAAE,YAAY,EAAsB,MAAM,sBAAsB,CAAC;AACxE,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,SAAS,GAEV,MAAM,aAAa,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../client/index.ts"],"names":[],"mappings":"AAAA,6EAA6E;AAC7E,yDAAyD;AACzD,OAAO,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AACtC,OAAO,EAAE,YAAY,EAAsB,MAAM,sBAAsB,CAAC;AACxE,OAAO,EACL,sBAAsB,EACtB,qBAAqB,EACrB,aAAa,EACb,SAAS,GAEV,MAAM,aAAa,CAAC"}
@@ -1,9 +1,8 @@
1
1
  import { type AppClientPluginFactory } from '@nocobase/app-client/plugins';
2
- export interface ApiKeysClientOptions {
3
- /** Path relative to /settings, for example `/api-keys`. */
4
- readonly path?: string;
5
- readonly title?: string;
6
- }
7
- declare const apiKeys: AppClientPluginFactory<ApiKeysClientOptions>;
2
+ /**
3
+ * Registers the plugin with the client application. It contributes no pages: an application that wants a page for
4
+ * managing keys builds it on `apiKeyClient` and declares it among its own routes.
5
+ */
6
+ declare const apiKeys: AppClientPluginFactory;
8
7
  export default apiKeys;
9
8
  //# sourceMappingURL=plugin.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../client/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,8BAA8B,CAAC;AAKtC,MAAM,WAAW,oBAAoB;IACnC,2DAA2D;IAC3D,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,QAAQ,CAAC,KAAK,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,QAAA,MAAM,OAAO,EAAE,sBAAsB,CAAC,oBAAoB,CAKtD,CAAC;AAEL,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"plugin.d.ts","sourceRoot":"","sources":["../../client/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EAEL,KAAK,sBAAsB,EAC5B,MAAM,8BAA8B,CAAC;AAEtC;;;GAGG;AACH,QAAA,MAAM,OAAO,EAAE,sBAEb,CAAC;AAEH,eAAe,OAAO,CAAC"}
@@ -1,10 +1,10 @@
1
1
  import { defineClientPlugin, } from '@nocobase/app-client/plugins';
2
- import locales from './locales/index.js';
3
- import { createApiKeysRoutes } from './routes.js';
2
+ /**
3
+ * Registers the plugin with the client application. It contributes no pages: an application that wants a page for
4
+ * managing keys builds it on `apiKeyClient` and declares it among its own routes.
5
+ */
4
6
  const apiKeys = defineClientPlugin({
5
7
  packageName: '@nocobase/app-plugin-api-keys',
6
- locales,
7
- routes: (options) => createApiKeysRoutes(options),
8
8
  });
9
9
  export default apiKeys;
10
10
  //# sourceMappingURL=plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../client/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,GAEnB,MAAM,8BAA8B,CAAC;AAEtC,OAAO,OAAO,MAAM,oBAAoB,CAAC;AACzC,OAAO,EAAE,mBAAmB,EAAE,MAAM,aAAa,CAAC;AAQlD,MAAM,OAAO,GACX,kBAAkB,CAAC;IACjB,WAAW,EAAE,+BAA+B;IAC5C,OAAO;IACP,MAAM,EAAE,CAAC,OAAO,EAAE,EAAE,CAAC,mBAAmB,CAAC,OAAO,CAAC;CAClD,CAAC,CAAC;AAEL,eAAe,OAAO,CAAC"}
1
+ {"version":3,"file":"plugin.js","sourceRoot":"","sources":["../../client/plugin.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,kBAAkB,GAEnB,MAAM,8BAA8B,CAAC;AAEtC;;;GAGG;AACH,MAAM,OAAO,GAA2B,kBAAkB,CAAC;IACzD,WAAW,EAAE,+BAA+B;CAC7C,CAAC,CAAC;AAEH,eAAe,OAAO,CAAC"}
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "@nocobase/app-plugin-api-keys",
3
3
  "displayName": "API Keys App Plugin",
4
4
  "description": "API key authentication for NocoBase applications, built on Better Auth.",
5
- "version": "1.0.0-beta.13",
5
+ "version": "1.0.0-beta.15",
6
6
  "type": "module",
7
7
  "prettier": "@nocobase/dev-config/prettier",
8
8
  "engines": {
@@ -22,10 +22,6 @@
22
22
  "types": "./dist/client/plugin.d.ts",
23
23
  "import": "./dist/client/plugin.js"
24
24
  },
25
- "./client/routes": {
26
- "types": "./dist/client/routes.d.ts",
27
- "import": "./dist/client/routes.js"
28
- },
29
25
  "./shared/scopes": {
30
26
  "types": "./dist/shared/scopes.d.ts",
31
27
  "import": "./dist/shared/scopes.js"
@@ -51,33 +47,22 @@
51
47
  "zod": "^4.6.5"
52
48
  },
53
49
  "peerDependencies": {
54
- "@base-ui/react": "^1.6.0",
55
- "class-variance-authority": "^0.7.1",
56
- "cn": "^0.4.0",
57
- "lucide-react": "^0.487.0",
58
- "react": "^19.0.0",
59
- "@nocobase/app-client": "^2.0.0-beta.2",
60
- "@nocobase/app-plugin-authentication": "^2.0.0-beta.2",
61
- "@nocobase/app-plugin-authorization": "^1.0.0-beta.25",
62
- "@nocobase/app-server": "^2.0.0-beta.1",
63
- "@nocobase/authorization": "^1.0.0-beta.12",
64
- "@nocobase/db": "^1.0.0-beta.18",
65
- "@nocobase/i18n": "^1.0.0-beta.5",
66
- "@nocobase/service-provider": "^0.0.2-beta.1"
50
+ "@nocobase/app-client": "^3.0.0-beta.1",
51
+ "@nocobase/app-plugin-authentication": "^2.0.0-beta.6",
52
+ "@nocobase/app-plugin-authorization": "^1.0.0-beta.27",
53
+ "@nocobase/app-server": "^2.0.0-beta.4",
54
+ "@nocobase/authorization": "^1.0.0-beta.13",
55
+ "@nocobase/db": "^1.0.0-beta.19",
56
+ "@nocobase/service-provider": "^0.0.2-beta.2"
67
57
  },
68
58
  "devDependencies": {
69
- "@testing-library/react": "^16.3.2",
70
59
  "@types/node": "^24.0.0",
71
- "@types/react": "^19.2.0",
72
60
  "eslint": "^10.0.0",
73
61
  "prettier": "^3.9.6",
74
- "shadcn": "^4.13.1",
75
- "tailwindcss": "^4.1.4",
76
- "tw-animate-css": "^1.2.5",
77
62
  "typescript": "^6.0.3",
78
63
  "vitest": "^4.1.10",
79
- "@nocobase/app-testing": "0.1.0-beta.1",
80
- "@nocobase/dev-config": "0.1.0-beta.19"
64
+ "@nocobase/app-testing": "0.1.0-beta.3",
65
+ "@nocobase/dev-config": "0.1.0-beta.22"
81
66
  },
82
67
  "scripts": {
83
68
  "clean": "node ./scripts/clean-dist.mjs",
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  name: nocobase-app-plugin-api-keys
3
- description: Register the API Keys plugin in a NocoBase App, let scripts and integrations call the App's API with an x-api-key header, place or restrict the key management page, or work out why a key is rejected.
3
+ description: Register the API Keys plugin in a NocoBase App, let scripts and integrations call the App's API with an x-api-key header, or work out why a key is rejected.
4
4
  metadata:
5
5
  short-description: Authenticate API requests with user-owned keys
6
6
  ---
@@ -13,7 +13,7 @@ App issued is being rejected. The default configuration resolves a key into its
13
13
 
14
14
  This package is Better Auth's
15
15
  [API Key plugin](https://www.better-auth.com/docs/plugins/api-key) plus the
16
- `apikey` migration, the Settings page, and the locales. `apiKey` is wrapped
16
+ `apikey` migration. `apiKey` is wrapped
17
17
  only to supply three defaults, all overridable; its name, options and behaviour
18
18
  are Better Auth's, and Better Auth's documentation applies unchanged.
19
19
 
@@ -25,14 +25,14 @@ are Better Auth's, and Better Auth's documentation applies unchanged.
25
25
  option types, from the same entry. Use these rather than adding
26
26
  `@better-auth/api-key` to the App: the migration here matches the schema this
27
27
  version declares, and taking both from one package keeps them in step.
28
- - Client registration factory and `ApiKeysClientOptions`:
29
- `@nocobase/app-plugin-api-keys/client`.
28
+ - Client registration factory: `@nocobase/app-plugin-api-keys/client`. It
29
+ contributes no pages.
30
30
  - `apiKeyClient`, re-exported from `@better-auth/api-key/client` by the same
31
31
  entry.
32
- - `ApiKeySummary`, `API_KEYS_PAGE_ACCESS`, `API_KEYS_ROUTE_ID`, and the expiry
33
- helpers, for an App that builds its own page instead of using the one here.
34
- The page itself reads `useAuthenticationClient().apiKey`, typed through the
35
- authentication plugin's `AuthClientPluginRegistry`.
32
+ - `ApiKeySummary` and the expiry helpers, for the App's own key management
33
+ page. Such a page reads `useAuthenticationClient().apiKey`, typed through the
34
+ authentication plugin's `AuthClientPluginRegistry`, and is declared among the
35
+ App's own routes.
36
36
  - HTTP API: `POST /api/auth/api-key/create`, `GET /api/auth/api-key/list`,
37
37
  `GET /api/auth/api-key/get`, `POST /api/auth/api-key/update`, and
38
38
  `POST /api/auth/api-key/delete`. All five act only on the caller's own keys.
@@ -45,14 +45,10 @@ Better Auth's, mounted by Authentication's `/api/auth/*` handler. Its server reg
45
45
  Both halves are required, and each fails differently on its own.
46
46
 
47
47
  1. Add the default export to the App's `server/plugins.ts` and
48
- `client/plugins.ts`. Configure the page with
49
- `apiKeys({ path: '/api-keys' })`; it mounts under `/settings`.
48
+ `client/plugins.ts`.
50
49
  2. Add `apiKey()` to `plugins` in `server/config/auth.ts`, and `apiKeyClient()`
51
50
  to `plugins` in `client/config/auth.ts`.
52
- 3. Grant `page:api-keys/access` to the roles that may manage keys. Keys are
53
- self-service and every endpoint acts only on the caller's own, so this is
54
- normally granted to all authenticated users.
55
- 4. Run `pnpm nocobase db apply`.
51
+ 3. Run `pnpm nocobase db apply`.
56
52
 
57
53
  Only step 1 leaves the `apikey` table created and no endpoints mounted. Only
58
54
  step 2 mounts endpoints against a table that does not exist, and every call
@@ -64,8 +60,8 @@ fails at the database.
64
60
  false }` and `requireName: true`, so an App normally passes nothing.
65
61
 
66
62
  `enableSessionForAPIKeys` is the one that has to be set. Better Auth defaults
67
- it off, and with it off a key authenticates nothing: the Settings page still
68
- issues keys, and every request carrying one answers 401. Nothing points at the
63
+ it off, and with it off a key authenticates nothing: keys are still
64
+ issued, and every request carrying one answers 401. Nothing points at the
69
65
  configuration, so do not override it without meaning to.
70
66
 
71
67
  `rateLimit` is off because Better Auth's own default is 10 requests per key per
@@ -138,21 +134,20 @@ own, or the Session is minted and returned first.
138
134
 
139
135
  ## Ownership
140
136
 
141
- The plugin owns the `apikey` table, the `@better-auth/api-key` version, the
142
- three defaults, and the Settings page. The App owns its two `config/auth.ts`
143
- files, any option it overrides there, where the page is mounted, and which
144
- roles may reach it.
137
+ The plugin owns the `apikey` table, the `@better-auth/api-key` version, and
138
+ the three defaults. The App owns its two `config/auth.ts` files, any
139
+ option it overrides there, and any page it builds for managing keys.
145
140
 
146
141
  Never write the `apikey` table directly. Its `key` column holds a hash, and a
147
142
  row inserted by hand authenticates nothing.
148
143
 
149
144
  ## Verification
150
145
 
151
- 1. Grant `page:api-keys/access`, sign in, open the Settings page, create a key,
152
- and copy it.
146
+ 1. Sign in and create a key with `authClient.apiKey.create()` (or the App's own
147
+ page), and copy it.
153
148
  2. `curl -H 'x-api-key: <key>' <app>/api/<a route behind auth.required()>` —
154
149
  expect the same response the signed-in user gets.
155
- 3. Revoke the key in the page, repeat step 2 — expect 401, not 500.
150
+ 3. Revoke the key, repeat step 2 — expect 401, not 500.
156
151
  4. Disable the owning user, repeat step 2 with a second key — expect 401.
157
152
 
158
153
  ## Trusted server extensions
@@ -1,4 +0,0 @@
1
- import type { ComponentProps, ReactElement } from 'react';
2
- export type PageContainerProps = ComponentProps<'section'>;
3
- export declare function PageContainer({ className, ...props }: PageContainerProps): ReactElement;
4
- //# sourceMappingURL=page-container.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"page-container.d.ts","sourceRoot":"","sources":["../../../client/components/page-container.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAG1D,MAAM,MAAM,kBAAkB,GAAG,cAAc,CAAC,SAAS,CAAC,CAAC;AAE3D,wBAAgB,aAAa,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,kBAAkB,GAAG,YAAY,CAOnC"}
@@ -1,6 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from 'cn';
3
- export function PageContainer({ className, ...props }) {
4
- return (_jsx("section", { className: cn('w-full space-y-6 p-6 md:p-8', className), ...props }));
5
- }
6
- //# sourceMappingURL=page-container.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"page-container.js","sourceRoot":"","sources":["../../../client/components/page-container.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,EAAE,EAAE,MAAM,IAAI,CAAC;AAIxB,MAAM,UAAU,aAAa,CAAC,EAC5B,SAAS,EACT,GAAG,KAAK,EACW;IACnB,OAAO,CACL,kBACE,SAAS,EAAE,EAAE,CAAC,6BAA6B,EAAE,SAAS,CAAC,KACnD,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
@@ -1,8 +0,0 @@
1
- import type { ReactNode, ReactElement } from 'react';
2
- export interface PageHeaderProps {
3
- readonly title: ReactNode;
4
- readonly description?: ReactNode;
5
- readonly actions?: ReactNode;
6
- }
7
- export declare function PageHeader({ actions, description, title, }: PageHeaderProps): ReactElement;
8
- //# sourceMappingURL=page-header.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"page-header.d.ts","sourceRoot":"","sources":["../../../client/components/page-header.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,SAAS,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAErD,MAAM,WAAW,eAAe;IAC9B,QAAQ,CAAC,KAAK,EAAE,SAAS,CAAC;IAC1B,QAAQ,CAAC,WAAW,CAAC,EAAE,SAAS,CAAC;IACjC,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,CAAC;CAC9B;AAED,wBAAgB,UAAU,CAAC,EACzB,OAAO,EACP,WAAW,EACX,KAAK,GACN,EAAE,eAAe,GAAG,YAAY,CAkBhC"}
@@ -1,5 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- export function PageHeader({ actions, description, title, }) {
3
- return (_jsxs("header", { className: 'flex flex-col gap-4 sm:flex-row sm:items-end sm:justify-between', children: [_jsxs("div", { className: 'min-w-0', children: [_jsx("h1", { className: 'font-heading text-3xl font-semibold tracking-[-0.035em]', children: title }), description ? (_jsx("p", { className: 'mt-2 max-w-2xl text-sm leading-6 text-muted-foreground', children: description })) : null] }), actions ? (_jsx("div", { className: 'flex shrink-0 items-center gap-2', children: actions })) : null] }));
4
- }
5
- //# sourceMappingURL=page-header.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"page-header.js","sourceRoot":"","sources":["../../../client/components/page-header.tsx"],"names":[],"mappings":";AAQA,MAAM,UAAU,UAAU,CAAC,EACzB,OAAO,EACP,WAAW,EACX,KAAK,GACW;IAChB,OAAO,CACL,kBAAQ,SAAS,EAAC,iEAAiE,aACjF,eAAK,SAAS,EAAC,SAAS,aACtB,aAAI,SAAS,EAAC,yDAAyD,YACpE,KAAK,GACH,EACJ,WAAW,CAAC,CAAC,CAAC,CACb,YAAG,SAAS,EAAC,wDAAwD,YAClE,WAAW,GACV,CACL,CAAC,CAAC,CAAC,IAAI,IACJ,EACL,OAAO,CAAC,CAAC,CAAC,CACT,cAAK,SAAS,EAAC,kCAAkC,YAAE,OAAO,GAAO,CAClE,CAAC,CAAC,CAAC,IAAI,IACD,CACV,CAAC;AACJ,CAAC"}
@@ -1,19 +0,0 @@
1
- import * as React from 'react';
2
- import { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog';
3
- import { Button } from './button.js';
4
- declare function AlertDialog({ ...props }: AlertDialogPrimitive.Root.Props): React.JSX.Element;
5
- declare function AlertDialogTrigger({ ...props }: AlertDialogPrimitive.Trigger.Props): React.JSX.Element;
6
- declare function AlertDialogPortal({ ...props }: AlertDialogPrimitive.Portal.Props): React.JSX.Element;
7
- declare function AlertDialogOverlay({ className, ...props }: AlertDialogPrimitive.Backdrop.Props): React.JSX.Element;
8
- declare function AlertDialogContent({ className, size, ...props }: AlertDialogPrimitive.Popup.Props & {
9
- size?: 'default' | 'sm';
10
- }): React.JSX.Element;
11
- declare function AlertDialogHeader({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
12
- declare function AlertDialogFooter({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
13
- declare function AlertDialogMedia({ className, ...props }: React.ComponentProps<'div'>): React.JSX.Element;
14
- declare function AlertDialogTitle({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Title>): React.JSX.Element;
15
- declare function AlertDialogDescription({ className, ...props }: React.ComponentProps<typeof AlertDialogPrimitive.Description>): React.JSX.Element;
16
- declare function AlertDialogAction({ className, ...props }: React.ComponentProps<typeof Button>): React.JSX.Element;
17
- declare function AlertDialogCancel({ className, variant, size, ...props }: AlertDialogPrimitive.Close.Props & Pick<React.ComponentProps<typeof Button>, 'variant' | 'size'>): React.JSX.Element;
18
- export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };
19
- //# sourceMappingURL=alert-dialog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"alert-dialog.d.ts","sourceRoot":"","sources":["../../../../client/components/ui/alert-dialog.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAC/B,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAGlF,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC,iBAAS,WAAW,CAAC,EACnB,GAA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cAAc,CAAC,OAAO,oBAAoB,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAW7E;AAED,iBAAS,sBAAsB,CAAC,EAC9B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CACrB,OAAO,oBAAoB,CAAC,WAAW,CACxC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAWpB;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,GAAG,KAAK,EACT,EAAE,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAQzD;AAED,iBAAS,iBAAiB,CAAC,EACzB,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,oBAAoB,CAAC,KAAK,CAAC,KAAK,GACjC,IAAI,CACF,KAAK,CAAC,cAAc,CAAC,OAAO,MAAM,CAAC,EACnC,SAAS,GAAG,MAAM,CACnB,GAAG,KAAK,CAAC,GAAG,CAAC,OAAO,CAStB;AAED,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,GACnB,CAAC"}
@@ -1,42 +0,0 @@
1
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
2
- import { AlertDialog as AlertDialogPrimitive } from '@base-ui/react/alert-dialog';
3
- import { cn } from 'cn';
4
- import { Button } from './button.js';
5
- function AlertDialog({ ...props }) {
6
- return _jsx(AlertDialogPrimitive.Root, { "data-slot": 'alert-dialog', ...props });
7
- }
8
- function AlertDialogTrigger({ ...props }) {
9
- return (_jsx(AlertDialogPrimitive.Trigger, { "data-slot": 'alert-dialog-trigger', ...props }));
10
- }
11
- function AlertDialogPortal({ ...props }) {
12
- return (_jsx(AlertDialogPrimitive.Portal, { "data-slot": 'alert-dialog-portal', ...props }));
13
- }
14
- function AlertDialogOverlay({ className, ...props }) {
15
- return (_jsx(AlertDialogPrimitive.Backdrop, { "data-slot": 'alert-dialog-overlay', className: cn('fixed inset-0 isolate z-50 bg-black/10 duration-100 supports-backdrop-filter:backdrop-blur-xs data-open:animate-in data-open:fade-in-0 data-closed:animate-out data-closed:fade-out-0', className), ...props }));
16
- }
17
- function AlertDialogContent({ className, size = 'default', ...props }) {
18
- return (_jsxs(AlertDialogPortal, { children: [_jsx(AlertDialogOverlay, {}), _jsx(AlertDialogPrimitive.Popup, { "data-slot": 'alert-dialog-content', "data-size": size, className: cn('group/alert-dialog-content fixed top-1/2 left-1/2 z-50 grid w-full -translate-x-1/2 -translate-y-1/2 gap-4 rounded-xl bg-popover p-4 text-popover-foreground ring-1 ring-foreground/10 duration-100 outline-none data-[size=default]:max-w-xs data-[size=sm]:max-w-xs data-[size=default]:sm:max-w-sm data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95', className), ...props })] }));
19
- }
20
- function AlertDialogHeader({ className, ...props }) {
21
- return (_jsx("div", { "data-slot": 'alert-dialog-header', className: cn('grid grid-rows-[auto_1fr] place-items-center gap-1.5 text-center has-data-[slot=alert-dialog-media]:grid-rows-[auto_auto_1fr] has-data-[slot=alert-dialog-media]:gap-x-4 sm:group-data-[size=default]/alert-dialog-content:place-items-start sm:group-data-[size=default]/alert-dialog-content:text-left sm:group-data-[size=default]/alert-dialog-content:has-data-[slot=alert-dialog-media]:grid-rows-[auto_1fr]', className), ...props }));
22
- }
23
- function AlertDialogFooter({ className, ...props }) {
24
- return (_jsx("div", { "data-slot": 'alert-dialog-footer', className: cn('-mx-4 -mb-4 flex flex-col-reverse gap-2 rounded-b-xl border-t bg-muted/50 p-4 group-data-[size=sm]/alert-dialog-content:grid group-data-[size=sm]/alert-dialog-content:grid-cols-2 sm:flex-row sm:justify-end', className), ...props }));
25
- }
26
- function AlertDialogMedia({ className, ...props }) {
27
- return (_jsx("div", { "data-slot": 'alert-dialog-media', className: cn("mb-2 inline-flex size-10 items-center justify-center rounded-md bg-muted sm:group-data-[size=default]/alert-dialog-content:row-span-2 *:[svg:not([class*='size-'])]:size-6", className), ...props }));
28
- }
29
- function AlertDialogTitle({ className, ...props }) {
30
- return (_jsx(AlertDialogPrimitive.Title, { "data-slot": 'alert-dialog-title', className: cn('font-heading text-base font-medium sm:group-data-[size=default]/alert-dialog-content:group-has-data-[slot=alert-dialog-media]/alert-dialog-content:col-start-2', className), ...props }));
31
- }
32
- function AlertDialogDescription({ className, ...props }) {
33
- return (_jsx(AlertDialogPrimitive.Description, { "data-slot": 'alert-dialog-description', className: cn('text-sm text-balance text-muted-foreground md:text-pretty *:[a]:underline *:[a]:underline-offset-3 *:[a]:hover:text-foreground', className), ...props }));
34
- }
35
- function AlertDialogAction({ className, ...props }) {
36
- return (_jsx(Button, { "data-slot": 'alert-dialog-action', className: cn(className), ...props }));
37
- }
38
- function AlertDialogCancel({ className, variant = 'outline', size = 'default', ...props }) {
39
- return (_jsx(AlertDialogPrimitive.Close, { "data-slot": 'alert-dialog-cancel', className: cn(className), render: _jsx(Button, { variant: variant, size: size }), ...props }));
40
- }
41
- export { AlertDialog, AlertDialogAction, AlertDialogCancel, AlertDialogContent, AlertDialogDescription, AlertDialogFooter, AlertDialogHeader, AlertDialogMedia, AlertDialogOverlay, AlertDialogPortal, AlertDialogTitle, AlertDialogTrigger, };
42
- //# sourceMappingURL=alert-dialog.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"alert-dialog.js","sourceRoot":"","sources":["../../../../client/components/ui/alert-dialog.tsx"],"names":[],"mappings":";AACA,OAAO,EAAE,WAAW,IAAI,oBAAoB,EAAE,MAAM,6BAA6B,CAAC;AAClF,OAAO,EAAE,EAAE,EAAE,MAAM,IAAI,CAAC;AAExB,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAErC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AAED,OAAO,EACL,WAAW,EACX,iBAAiB,EACjB,iBAAiB,EACjB,kBAAkB,EAClB,sBAAsB,EACtB,iBAAiB,EACjB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,EAClB,iBAAiB,EACjB,gBAAgB,EAChB,kBAAkB,GACnB,CAAC"}
@@ -1,6 +0,0 @@
1
- import type { ComponentProps, ReactElement } from 'react';
2
- export type BadgeProps = ComponentProps<'span'> & {
3
- readonly variant?: 'default' | 'secondary';
4
- };
5
- export declare function Badge({ className, variant, ...props }: BadgeProps): ReactElement;
6
- //# sourceMappingURL=badge.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"badge.d.ts","sourceRoot":"","sources":["../../../../client/components/ui/badge.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1D,MAAM,MAAM,UAAU,GAAG,cAAc,CAAC,MAAM,CAAC,GAAG;IAChD,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,WAAW,CAAC;CAC5C,CAAC;AAEF,wBAAgB,KAAK,CAAC,EACpB,SAAS,EACT,OAAmB,EACnB,GAAG,KAAK,EACT,EAAE,UAAU,GAAG,YAAY,CAa3B"}
@@ -1,8 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { cn } from 'cn';
3
- export function Badge({ className, variant = 'default', ...props }) {
4
- return (_jsx("span", { className: cn('inline-flex w-fit items-center rounded-full px-2 py-0.5 text-xs font-medium', variant === 'default'
5
- ? 'bg-primary text-primary-foreground'
6
- : 'bg-secondary text-secondary-foreground', className), ...props }));
7
- }
8
- //# sourceMappingURL=badge.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"badge.js","sourceRoot":"","sources":["../../../../client/components/ui/badge.tsx"],"names":[],"mappings":";AAGA,OAAO,EAAE,EAAE,EAAE,MAAM,IAAI,CAAC;AAMxB,MAAM,UAAU,KAAK,CAAC,EACpB,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,GAAG,KAAK,EACG;IACX,OAAO,CACL,eACE,SAAS,EAAE,EAAE,CACX,6EAA6E,EAC7E,OAAO,KAAK,SAAS;YACnB,CAAC,CAAC,oCAAoC;YACtC,CAAC,CAAC,wCAAwC,EAC5C,SAAS,CACV,KACG,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
@@ -1,8 +0,0 @@
1
- import { Button as ButtonPrimitive } from '@base-ui/react/button';
2
- import type { ReactElement } from 'react';
3
- export type ButtonProps = ButtonPrimitive.Props & {
4
- readonly size?: 'default' | 'sm' | 'lg' | 'icon' | 'icon-sm';
5
- readonly variant?: 'default' | 'outline' | 'ghost' | 'destructive';
6
- };
7
- export declare function Button({ className, variant, size, ...props }: ButtonProps): ReactElement;
8
- //# sourceMappingURL=button.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"button.d.ts","sourceRoot":"","sources":["../../../../client/components/ui/button.tsx"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAI1C,MAAM,MAAM,WAAW,GAAG,eAAe,CAAC,KAAK,GAAG;IAChD,QAAQ,CAAC,IAAI,CAAC,EAAE,SAAS,GAAG,IAAI,GAAG,IAAI,GAAG,MAAM,GAAG,SAAS,CAAC;IAC7D,QAAQ,CAAC,OAAO,CAAC,EAAE,SAAS,GAAG,SAAS,GAAG,OAAO,GAAG,aAAa,CAAC;CACpE,CAAC;AAyBF,wBAAgB,MAAM,CAAC,EACrB,SAAS,EACT,OAAmB,EACnB,IAAgB,EAChB,GAAG,KAAK,EACT,EAAE,WAAW,GAAG,YAAY,CAQ5B"}
@@ -1,27 +0,0 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- // shadcn base-nova source adapted for declaration-emitting ESM builds.
3
- import { Button as ButtonPrimitive } from '@base-ui/react/button';
4
- import { cva } from 'class-variance-authority';
5
- import { cn } from 'cn';
6
- const buttonVariants = cva('inline-flex shrink-0 items-center justify-center rounded-lg border border-transparent text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-3 focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:size-4 [&_svg]:shrink-0', {
7
- variants: {
8
- variant: {
9
- default: 'bg-primary text-primary-foreground hover:bg-primary/80',
10
- outline: 'border-border bg-background hover:bg-muted',
11
- ghost: 'hover:bg-muted',
12
- destructive: 'bg-destructive/10 text-destructive hover:bg-destructive/20',
13
- },
14
- size: {
15
- default: 'h-9 gap-1.5 px-3',
16
- sm: 'h-8 gap-1 px-2.5',
17
- lg: 'h-10 gap-2 px-4',
18
- icon: 'size-9',
19
- 'icon-sm': 'size-8',
20
- },
21
- },
22
- defaultVariants: { variant: 'default', size: 'default' },
23
- });
24
- export function Button({ className, variant = 'default', size = 'default', ...props }) {
25
- return (_jsx(ButtonPrimitive, { "data-slot": 'button', className: cn(buttonVariants({ variant, size }), className), ...props }));
26
- }
27
- //# sourceMappingURL=button.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"button.js","sourceRoot":"","sources":["../../../../client/components/ui/button.tsx"],"names":[],"mappings":";AAAA,uEAAuE;AACvE,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAClE,OAAO,EAAE,GAAG,EAAE,MAAM,0BAA0B,CAAC;AAG/C,OAAO,EAAE,EAAE,EAAE,MAAM,IAAI,CAAC;AAOxB,MAAM,cAAc,GAAG,GAAG,CACxB,gVAAgV,EAChV;IACE,QAAQ,EAAE;QACR,OAAO,EAAE;YACP,OAAO,EAAE,wDAAwD;YACjE,OAAO,EAAE,4CAA4C;YACrD,KAAK,EAAE,gBAAgB;YACvB,WAAW,EACT,4DAA4D;SAC/D;QACD,IAAI,EAAE;YACJ,OAAO,EAAE,kBAAkB;YAC3B,EAAE,EAAE,kBAAkB;YACtB,EAAE,EAAE,iBAAiB;YACrB,IAAI,EAAE,QAAQ;YACd,SAAS,EAAE,QAAQ;SACpB;KACF;IACD,eAAe,EAAE,EAAE,OAAO,EAAE,SAAS,EAAE,IAAI,EAAE,SAAS,EAAE;CACzD,CACF,CAAC;AAEF,MAAM,UAAU,MAAM,CAAC,EACrB,SAAS,EACT,OAAO,GAAG,SAAS,EACnB,IAAI,GAAG,SAAS,EAChB,GAAG,KAAK,EACI;IACZ,OAAO,CACL,KAAC,eAAe,iBACJ,QAAQ,EAClB,SAAS,EAAE,EAAE,CAAC,cAAc,CAAC,EAAE,OAAO,EAAE,IAAI,EAAE,CAAC,EAAE,SAAS,CAAC,KACvD,KAAK,GACT,CACH,CAAC;AACJ,CAAC"}
@@ -1,9 +0,0 @@
1
- import { Dialog as DialogPrimitive } from '@base-ui/react/dialog';
2
- import type { ComponentProps, ReactElement } from 'react';
3
- export declare function Dialog(props: DialogPrimitive.Root.Props): ReactElement;
4
- export declare function DialogContent(inputProps: DialogPrimitive.Popup.Props): ReactElement;
5
- export declare function DialogHeader({ className, ...props }: ComponentProps<'div'>): ReactElement;
6
- export declare function DialogFooter({ className, ...props }: ComponentProps<'div'>): ReactElement;
7
- export declare function DialogTitle(props: DialogPrimitive.Title.Props): ReactElement;
8
- export declare function DialogDescription(props: DialogPrimitive.Description.Props): ReactElement;
9
- //# sourceMappingURL=dialog.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"dialog.d.ts","sourceRoot":"","sources":["../../../../client/components/ui/dialog.tsx"],"names":[],"mappings":"AAEA,OAAO,EAAE,MAAM,IAAI,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAElE,OAAO,KAAK,EAAE,cAAc,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAK1D,wBAAgB,MAAM,CAAC,KAAK,EAAE,eAAe,CAAC,IAAI,CAAC,KAAK,GAAG,YAAY,CAEtE;AACD,wBAAgB,aAAa,CAC3B,UAAU,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,GACtC,YAAY,CA8Bd;AACD,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAEtC;AACD,wBAAgB,YAAY,CAAC,EAC3B,SAAS,EACT,GAAG,KAAK,EACT,EAAE,cAAc,CAAC,KAAK,CAAC,GAAG,YAAY,CAWtC;AACD,wBAAgB,WAAW,CAAC,KAAK,EAAE,eAAe,CAAC,KAAK,CAAC,KAAK,GAAG,YAAY,CAE5E;AACD,wBAAgB,iBAAiB,CAC/B,KAAK,EAAE,eAAe,CAAC,WAAW,CAAC,KAAK,GACvC,YAAY,CAOd"}