@atlasauth/types 0.17.0 → 0.18.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.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,22 @@
1
1
  # @atlasauth/types changelog
2
2
 
3
+ ## 0.18.0
4
+
5
+ - New `Register` interface: a generated `atlas-types.d.ts` narrows permission, role, plan, feature and metadata types. Without it everything stays `string`.
6
+
7
+ ## 0.17.1 — 2026-11-14
8
+
9
+ - The published package now carries the release notes for every version.
10
+
11
+ ## 0.17.0 — 2026-11-14
12
+
13
+ - Webhook events `oauth_tokens.revoked`, `resource_role_assignment.created`, `resource_role_assignment.deleted` and `user.deletion_paused`.
14
+ - Organization memberships carry `public_metadata`, `private_metadata`, `permissions` and `allowed_sign_in_methods`.
15
+
16
+ ## 0.16.0 — 2026-11-14
17
+
18
+ - Webhook event `user.sessions_revoked`.
19
+
3
20
  ## 0.15.0 — 2026-11-12
4
21
 
5
22
  - New webhook events (connection.provider_event, connection.owner_changed, impersonation.started/ended, risk.elevated), session device fields, has_passkey.
package/dist/authz.d.ts CHANGED
@@ -5,6 +5,7 @@
5
5
  * That package ships the runtime `evaluate()` / `ForbiddenError`; only the pure
6
6
  * types are mirrored here so `@atlasauth/types` stays runtime-free.
7
7
  */
8
+ import type { FeatureKey, OrgRoleKey, PermissionKey, PlanKey } from './register';
8
9
  /**
9
10
  * The minimal, structural view of session claims the authorization primitive
10
11
  * needs. Every SDK has its own richer `SessionClaims` (the backend verifier, the
@@ -45,18 +46,18 @@ export interface AuthzClaims {
45
46
  */
46
47
  export interface ProtectCondition {
47
48
  /** A single permission the ACTIVE organization role must hold. */
48
- permission?: string;
49
+ permission?: PermissionKey;
49
50
  /** An exact role in the active organization. */
50
- role?: string;
51
+ role?: OrgRoleKey;
51
52
  /** Any of these permissions (OR). */
52
- anyPermission?: readonly string[];
53
+ anyPermission?: readonly PermissionKey[];
53
54
  /** All of these permissions (AND). */
54
- allPermissions?: readonly string[];
55
+ allPermissions?: readonly PermissionKey[];
55
56
  /** The active billing plan (Clerk `has({ plan })`) — matches the `pla` claim.
56
57
  * Needs NO active organization: it is the subject's entitlement. */
57
- plan?: string;
58
+ plan?: PlanKey;
58
59
  /** A granted feature (Clerk `has({ feature })`) — an entry in the `fea` claim. */
59
- feature?: string;
60
+ feature?: FeatureKey;
60
61
  }
61
62
  export type ProtectReason = 'signed_out' | 'no_organization' | 'missing_permission' | 'missing_entitlement';
62
63
  export type ProtectOutcome = {
package/dist/authz.js CHANGED
@@ -1,10 +1,3 @@
1
1
  "use strict";
2
- /**
3
- * The shared authorization condition every Atlas SDK evaluates.
4
- *
5
- * COPIED verbatim from `@atlasauth/authz` (`src/claims.ts`, `src/protect.ts`).
6
- * That package ships the runtime `evaluate()` / `ForbiddenError`; only the pure
7
- * types are mirrored here so `@atlasauth/types` stays runtime-free.
8
- */
9
2
  Object.defineProperty(exports, "__esModule", { value: true });
10
3
  //# sourceMappingURL=authz.js.map
package/dist/authz.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"authz.js","sourceRoot":"","sources":["../src/authz.ts"],"names":[],"mappings":";AAAA;;;;;;GAMG"}
1
+ {"version":3,"file":"authz.js","sourceRoot":"","sources":["../src/authz.ts"],"names":[],"mappings":""}
package/dist/index.d.ts CHANGED
@@ -13,6 +13,7 @@ export type { SessionClaims } from './session';
13
13
  export type { AuthzClaims, ProtectCondition, ProtectOutcome, ProtectReason } from './authz';
14
14
  export type { VerifiedSessionClaims, AuthorizedSession, VerifyResult } from './verify';
15
15
  export type { Metadata, CursorPage, DataList, CursorParams, DeletedObject, User, UserReferral, UserReferralStatus, EmailAddress, Session, Organization, OrganizationMembership, Invitation, ApiKey, ApiKeySubjectType, ApiKeyVerification, } from './resources';
16
+ export type { Register, PermissionKey, OrgRoleKey, AppRoleKey, AppPermissionKey, PlanKey, FeatureKey, ScopeKey, WebhookEventKey, AppEventKey, AuditEventKey, FgaTypeKey, FgaRelationKey, RegisteredSessionClaims, UserPublicMetadata, UserUnsafeMetadata, UserPrivateMetadata, OrganizationPublicMetadata, OrganizationPrivateMetadata, } from './register';
16
17
  export type { WebhookEvent, WebhookPayload, WebhookVerifyResult, WebhookVerifyFailure, } from './webhooks';
17
18
  export type { Appearance, DesignTokens, ElementKey } from './appearance';
18
19
  export type { LocalizationResource, Localization, DeepPartial } from './localization';
@@ -0,0 +1,50 @@
1
+ /**
2
+ * Type registration. `atlas types generate` writes a file that augments this
3
+ * interface with the keys your instance really has:
4
+ *
5
+ * declare module '@atlasauth/types' {
6
+ * interface Register { permission: 'org:billing:manage' | 'org:docs:read'; }
7
+ * }
8
+ *
9
+ * Every SDK (`@atlasauth/react`, `@atlasauth/js`, `@atlasauth/backend`,
10
+ * `@atlasauth/authz`) reads the aliases below, so `has({ permission })` and
11
+ * `<Protect permission>` are checked against your keys. With no generated file
12
+ * `Register` is empty and every alias falls back to its loose default
13
+ * (`string`, `Record<string, unknown>`), so nothing changes for existing code.
14
+ */
15
+ export interface Register {
16
+ }
17
+ type Registered<K extends string, Fallback> = Register extends Record<K, infer T> ? T : Fallback;
18
+ /** An organization permission key (`org:billing:manage`). */
19
+ export type PermissionKey = Registered<'permission', string>;
20
+ /** An organization role key (`org:admin`). */
21
+ export type OrgRoleKey = Registered<'orgRole', string>;
22
+ /** An app-level (instance-wide) role key. */
23
+ export type AppRoleKey = Registered<'appRole', string>;
24
+ /** An app-level permission key. */
25
+ export type AppPermissionKey = Registered<'appPermission', string>;
26
+ /** A billing plan slug (the `pla` claim). */
27
+ export type PlanKey = Registered<'plan', string>;
28
+ /** A billing feature key (an entry of the `fea` claim). */
29
+ export type FeatureKey = Registered<'feature', string>;
30
+ /** An OAuth scope name. */
31
+ export type ScopeKey = Registered<'scope', string>;
32
+ /** A webhook event type from the instance's catalog. */
33
+ export type WebhookEventKey = Registered<'webhookEvent', string>;
34
+ /** A third-party app event type declared by the instance. */
35
+ export type AppEventKey = Registered<'appEvent', string>;
36
+ /** An audit event action. */
37
+ export type AuditEventKey = Registered<'auditEvent', string>;
38
+ /** A fine-grained authorization object type. */
39
+ export type FgaTypeKey = Registered<'fgaType', string>;
40
+ /** A fine-grained authorization relation name. */
41
+ export type FgaRelationKey = Registered<'fgaRelation', string>;
42
+ /** Extra session claims (templates, opt-in claims) layered over a verified token's claims. */
43
+ export type RegisteredSessionClaims = Registered<'sessionClaims', unknown>;
44
+ /** The shape of each metadata bag (from the instance's metadata schema). */
45
+ export type UserPublicMetadata = Registered<'publicMetadata', Record<string, unknown>>;
46
+ export type UserUnsafeMetadata = Registered<'unsafeMetadata', Record<string, unknown>>;
47
+ export type UserPrivateMetadata = Registered<'privateMetadata', Record<string, unknown>>;
48
+ export type OrganizationPublicMetadata = Registered<'organizationPublicMetadata', Record<string, unknown>>;
49
+ export type OrganizationPrivateMetadata = Registered<'organizationPrivateMetadata', Record<string, unknown>>;
50
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=register.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"register.js","sourceRoot":"","sources":["../src/register.ts"],"names":[],"mappings":""}
@@ -7,6 +7,7 @@
7
7
  * camelCase translation), because the SDK's job is to type the BAPI, not to
8
8
  * invent a second dialect a reader would then have to reconcile against the docs.
9
9
  */
10
+ import type { OrganizationPublicMetadata, UserPublicMetadata } from './register';
10
11
  /** A free-form metadata bag. The BAPI stores arbitrary JSON objects here. */
11
12
  export type Metadata = Record<string, unknown>;
12
13
  /**
@@ -43,7 +44,7 @@ export interface User {
43
44
  first_name: string | null;
44
45
  last_name: string | null;
45
46
  image_url: string | null;
46
- public_metadata: Metadata;
47
+ public_metadata: UserPublicMetadata;
47
48
  mfa_enabled: boolean;
48
49
  /** Whether the user holds at least one passkey. */
49
50
  has_passkey?: boolean;
@@ -130,7 +131,7 @@ export interface Organization {
130
131
  name: string;
131
132
  slug: string;
132
133
  image_url: string | null;
133
- public_metadata: Metadata;
134
+ public_metadata: OrganizationPublicMetadata;
134
135
  max_allowed_memberships: number;
135
136
  created_by: string;
136
137
  created_at: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@atlasauth/types",
3
- "version": "0.17.0",
3
+ "version": "0.18.0",
4
4
  "description": "Shared public TypeScript types for Atlas — the Atlas peer of @clerk/types. Dependency-free, runtime-free: import type { User } from '@atlasauth/types' pulls in no runtime SDK.",
5
5
  "types": "./dist/index.d.ts",
6
6
  "exports": {