@krak-stack/auth 0.3.2 → 0.4.0

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 (34) hide show
  1. package/CHANGELOG.md +20 -0
  2. package/README.md +37 -0
  3. package/dist/admin/api.group.d.ts +4 -4
  4. package/dist/admin/schema.d.ts +6 -6
  5. package/dist/api.d.ts +1577 -1331
  6. package/dist/auth/api.group.d.ts +124 -1
  7. package/dist/auth/api.group.js +36 -1
  8. package/dist/auth/schema.d.ts +38 -0
  9. package/dist/auth/schema.js +38 -0
  10. package/dist/components/account-deletion.js +2 -1
  11. package/dist/components/admin-organization-form.js +3 -2
  12. package/dist/components/admin-organizations.js +3 -3
  13. package/dist/components/admin-users.js +3 -3
  14. package/dist/components/appearance.d.ts +89 -0
  15. package/dist/components/appearance.js +59 -0
  16. package/dist/components/auth-client-api.d.ts +134 -4
  17. package/dist/components/auth-forms.d.ts +5 -1
  18. package/dist/components/auth-forms.js +60 -7
  19. package/dist/components/contact-fields.js +2 -1
  20. package/dist/components/index.d.ts +1 -0
  21. package/dist/components/organization-sso-atom.d.ts +71 -0
  22. package/dist/components/organization-sso-atom.js +40 -0
  23. package/dist/components/organization-sso-messages.d.ts +76 -0
  24. package/dist/components/organization-sso-messages.js +77 -0
  25. package/dist/components/organization-sso-settings.d.ts +6 -0
  26. package/dist/components/organization-sso-settings.js +96 -0
  27. package/dist/components/organization-switcher.d.ts +8 -3
  28. package/dist/components/organization-switcher.js +25 -13
  29. package/dist/components/scrollable-dialog.d.ts +3 -2
  30. package/dist/components/scrollable-dialog.js +11 -4
  31. package/dist/components/user-button.d.ts +8 -2
  32. package/dist/components/user-button.js +8 -7
  33. package/dist/service.d.ts +260 -0
  34. package/package.json +3 -3
package/CHANGELOG.md CHANGED
@@ -1,5 +1,25 @@
1
1
  # @krak-stack/auth
2
2
 
3
+ ## 0.4.0
4
+
5
+ ### Minor Changes
6
+
7
+ - 0f8d256: Add typed organization-managed OIDC settings, domain discovery, verification, enable/disable and removal endpoints. The opt-in SSO sign-in button resolves the organization's connection dynamically from an email domain or organization slug.
8
+
9
+ Show organization SSO settings directly in the organization switcher’s Security dialog for owners and admins. No app-specific panel is required.
10
+
11
+ Keep the Callback URL section open or closed as selected when toggling SSO.
12
+
13
+ ### Patch Changes
14
+
15
+ - c9a1e7b: Allow verified organization SSO settings to omit the DNS challenge token. Domain verification now uses Better Auth's built-in challenge lifecycle instead of custom provider token storage.
16
+
17
+ ## 0.3.3
18
+
19
+ ### Patch Changes
20
+
21
+ - 3a84c4a: Add optional trigger variants, sizes, classes and non-interactive badges to UserButton and OrganizationSwitcher. Expose grouped presentation classes for menus, dialogs, forms, nested selects and tables, forwarding scope through portals without changing authentication, requests or actions. Require KrakStack registry 0.10.2 or later in the 0.10 release line for table, brand and field popup hooks, and update the SDK's development dependency and peer range to match.
22
+
3
23
  ## 0.3.2
4
24
 
5
25
  ### Patch Changes
package/README.md CHANGED
@@ -34,6 +34,43 @@ Choose a narrow package subpath for the runtime boundary:
34
34
 
35
35
  The complete export map is defined in `package.json` and documented at [auth.krakstack.net/en/docs/sdk](https://auth.krakstack.net/en/docs/sdk).
36
36
 
37
+ ## Account UI appearance
38
+
39
+ `UserButton` and `OrganizationSwitcher` accept `variant`, `size`, trigger `className`, optional non-interactive `triggerBadge`, and grouped `classNames: AuthUIClassNames`. Defaults remain unchanged. Badges render on the closed trigger, not in its menu. Supply localized accessible descriptions in the consuming application; do not put interactive controls inside a trigger badge.
40
+
41
+ ```tsx
42
+ <OrganizationSwitcher
43
+ variant="outline"
44
+ className="project-account-trigger"
45
+ triggerBadge={<span aria-hidden="true">P</span>}
46
+ classNames={{
47
+ trigger: { badge: "project-account-badge", label: "project-account-label" },
48
+ menu: {
49
+ content: "project-account-menu",
50
+ subContent: "project-account-menu",
51
+ },
52
+ dialog: { content: "project-account-dialog", body: "project-account-body" },
53
+ form: { content: "project-account-fields" },
54
+ popup: { select: "project-select", combobox: "project-combobox" },
55
+ table: {
56
+ className: "project-account-table",
57
+ classNames: {
58
+ menu: {
59
+ content: "project-table-menu",
60
+ subContent: "project-table-menu",
61
+ },
62
+ },
63
+ },
64
+ }}
65
+ />
66
+ ```
67
+
68
+ Groups: `trigger` (visual, image, icon, content, label, subtitle, indicator, badge); `menu` (content, header, group, item, label, separator, subContent, subTrigger); `dialog` (content, header, title, description, body, footer); `popup` (select, combobox); `form.content` (scrollable form-body scope); and `table` (DataTable root className and grouped classNames). Trigger text hooks apply where that trigger renders text; UserButton remains icon-only. Table hooks mirror the registry table's presentation map.
69
+
70
+ Classes reach the actual portalled surfaces, including nested account/admin dialogs and table menus. Internal `data-auth-slot` markers identify account-specific parts without replacing primitive `data-slot` attributes. Scope form controls and existing tab/navigation layouts beneath your supplied dialog/form classes; do not target all popups globally. Caller-provided menu actions remain caller-owned. Local CSS variables must also be defined on portal scopes, not only the trigger wrapper.
71
+
72
+ SDK 0.3.3 requires `@krak-stack/registry@^0.10.2` for AppBrand part classes, table classes and field popup classes. Update any installed registry source items separately; updating the npm package does not replace copied component files. Changing appearance does not require auth server or database changes.
73
+
37
74
  ## Server Configuration
38
75
 
39
76
  Server clients use:
@@ -218,8 +218,8 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
218
218
  readonly createdAt: Schema.Date;
219
219
  readonly updatedAt: Schema.Date;
220
220
  }>>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listOrganizations", "GET", "/admin/organizations", never, Schema.toCodecStringTree<Schema.Struct<{
221
- readonly page: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Number, Schema.NumberFromString]>>, never, never>;
222
- readonly pageSize: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Number, Schema.NumberFromString]>>, never, never>;
221
+ readonly page: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Finite, Schema.FiniteFromString]>>, never, never>;
222
+ readonly pageSize: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Finite, Schema.FiniteFromString]>>, never, never>;
223
223
  readonly globalFilter: Schema.optional<Schema.String>;
224
224
  readonly sort: Schema.optional<Schema.declare<readonly {
225
225
  readonly id: string;
@@ -306,8 +306,8 @@ export declare const AdminApiGroup: HttpApiGroup.HttpApiGroup<"admin", HttpApiEn
306
306
  readonly pageCount: Schema.Int;
307
307
  }>;
308
308
  }>>, Schema.toCodecJson<typeof HttpApiError.Unauthorized | typeof HttpApiError.Forbidden | typeof HttpApiError.InternalServerError>, never, never> | HttpApiEndpoint.HttpApiEndpoint<"listUsers", "GET", "/admin/users", never, Schema.toCodecStringTree<Schema.Struct<{
309
- readonly page: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Number, Schema.NumberFromString]>>, never, never>;
310
- readonly pageSize: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Number, Schema.NumberFromString]>>, never, never>;
309
+ readonly page: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Finite, Schema.FiniteFromString]>>, never, never>;
310
+ readonly pageSize: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Finite, Schema.FiniteFromString]>>, never, never>;
311
311
  readonly globalFilter: Schema.optional<Schema.String>;
312
312
  readonly sort: Schema.optional<Schema.declare<readonly {
313
313
  readonly id: string;
@@ -1,8 +1,8 @@
1
1
  import { Schema } from "effect";
2
2
  import { ServerCreateDomainPayload, ServerDomain, ServerDomainIdParams, ServerDomainRecordsResponse, ServerUpdateDomainPayload } from "../server/schema.js";
3
3
  export declare const AdminListQuery: Schema.Struct<{
4
- readonly page: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Number, Schema.NumberFromString]>>, never, never>;
5
- readonly pageSize: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Number, Schema.NumberFromString]>>, never, never>;
4
+ readonly page: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Finite, Schema.FiniteFromString]>>, never, never>;
5
+ readonly pageSize: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Finite, Schema.FiniteFromString]>>, never, never>;
6
6
  readonly globalFilter: Schema.optional<Schema.String>;
7
7
  readonly sort: Schema.optional<Schema.declare<readonly {
8
8
  readonly id: string;
@@ -109,8 +109,8 @@ export declare const AdminOrganizationColumnFilter: Schema.Union<readonly [Schem
109
109
  readonly values: Schema.NonEmptyArray<Schema.String>;
110
110
  }>]>;
111
111
  export declare const AdminUserListQuery: Schema.Struct<{
112
- readonly page: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Number, Schema.NumberFromString]>>, never, never>;
113
- readonly pageSize: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Number, Schema.NumberFromString]>>, never, never>;
112
+ readonly page: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Finite, Schema.FiniteFromString]>>, never, never>;
113
+ readonly pageSize: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Finite, Schema.FiniteFromString]>>, never, never>;
114
114
  readonly globalFilter: Schema.optional<Schema.String>;
115
115
  readonly sort: Schema.optional<Schema.declare<readonly {
116
116
  readonly id: string;
@@ -169,8 +169,8 @@ export declare const AdminUserListQuery: Schema.Struct<{
169
169
  })[]>>;
170
170
  }>;
171
171
  export declare const AdminOrganizationListQuery: Schema.Struct<{
172
- readonly page: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Number, Schema.NumberFromString]>>, never, never>;
173
- readonly pageSize: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Number, Schema.NumberFromString]>>, never, never>;
172
+ readonly page: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Finite, Schema.FiniteFromString]>>, never, never>;
173
+ readonly pageSize: Schema.decodeTo<Schema.Int, Schema.optional<Schema.Union<readonly [Schema.Finite, Schema.FiniteFromString]>>, never, never>;
174
174
  readonly globalFilter: Schema.optional<Schema.String>;
175
175
  readonly sort: Schema.optional<Schema.declare<readonly {
176
176
  readonly id: string;