Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions content/docs/references/system/AuthConfig.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ description: AuthConfig Schema Reference
| **csrf** | `object` | optional | |
| **accountLinking** | `object` | optional | |
| **twoFactor** | `object` | optional | |
| **organization** | `object` | optional | Organization/multi-tenant configuration |
| **enterprise** | `object` | optional | |
| **userFieldMapping** | `object` | optional | |
| **database** | `object` | optional | |
Expand Down
18 changes: 18 additions & 0 deletions content/docs/references/system/Invitation.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
title: Invitation
description: Invitation Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **id** | `string` | ✅ | Unique invitation identifier |
| **organizationId** | `string` | ✅ | Organization ID |
| **email** | `string` | ✅ | Invitee email address |
| **role** | `string` | ✅ | Role to assign upon acceptance |
| **status** | `Enum<'pending' \| 'accepted' \| 'rejected' \| 'expired'>` | optional | Invitation status |
| **expiresAt** | `string` | ✅ | Invitation expiry timestamp |
| **inviterId** | `string` | ✅ | User ID of the inviter |
| **createdAt** | `string` | ✅ | Invitation creation timestamp |
| **updatedAt** | `string` | ✅ | Last update timestamp |
11 changes: 11 additions & 0 deletions content/docs/references/system/InvitationStatus.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
---
title: InvitationStatus
description: InvitationStatus Schema Reference
---

## Allowed Values

* `pending`
* `accepted`
* `rejected`
* `expired`
15 changes: 15 additions & 0 deletions content/docs/references/system/Member.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
---
title: Member
description: Member Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **id** | `string` | ✅ | Unique member identifier |
| **organizationId** | `string` | ✅ | Organization ID |
| **userId** | `string` | ✅ | User ID |
| **role** | `string` | ✅ | Member role (e.g., owner, admin, member, guest) |
| **createdAt** | `string` | ✅ | Member creation timestamp |
| **updatedAt** | `string` | ✅ | Last update timestamp |
16 changes: 16 additions & 0 deletions content/docs/references/system/Organization.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
---
title: Organization
description: Organization Schema Reference
---

## Properties

| Property | Type | Required | Description |
| :--- | :--- | :--- | :--- |
| **id** | `string` | ✅ | Unique organization identifier |
| **name** | `string` | ✅ | Organization display name |
| **slug** | `string` | ✅ | Unique URL-friendly slug (lowercase alphanumeric, hyphens, underscores) |
| **logo** | `string` | optional | Organization logo URL |
| **metadata** | `Record<string, any>` | optional | Custom metadata |
| **createdAt** | `string` | ✅ | Organization creation timestamp |
| **updatedAt** | `string` | ✅ | Last update timestamp |
1 change: 1 addition & 0 deletions content/docs/references/system/Session.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ description: Session Schema Reference
| **id** | `string` | ✅ | Unique session identifier |
| **sessionToken** | `string` | ✅ | Session token |
| **userId** | `string` | ✅ | Associated user ID |
| **activeOrganizationId** | `string` | optional | Active organization ID for context switching |
| **expires** | `string` | ✅ | Session expiry timestamp |
| **createdAt** | `string` | ✅ | Session creation timestamp |
| **updatedAt** | `string` | ✅ | Last update timestamp |
Expand Down
27 changes: 27 additions & 0 deletions packages/spec/json-schema/AuthConfig.json
Original file line number Diff line number Diff line change
Expand Up @@ -381,6 +381,33 @@
},
"additionalProperties": false
},
"organization": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": false,
"description": "Enable organization/multi-tenant features"
},
"allowUserToCreateOrg": {
"type": "boolean",
"default": true,
"description": "Allow users to create organizations"
},
"defaultRole": {
"type": "string",
"default": "member",
"description": "Default role for new members"
},
"creatorRole": {
"type": "string",
"default": "owner",
"description": "Role assigned to organization creator"
}
},
"additionalProperties": false,
"description": "Organization/multi-tenant configuration"
},
"enterprise": {
"type": "object",
"properties": {
Expand Down
69 changes: 69 additions & 0 deletions packages/spec/json-schema/Invitation.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,69 @@
{
"$ref": "#/definitions/Invitation",
"definitions": {
"Invitation": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique invitation identifier"
},
"organizationId": {
"type": "string",
"description": "Organization ID"
},
"email": {
"type": "string",
"format": "email",
"description": "Invitee email address"
},
"role": {
"type": "string",
"description": "Role to assign upon acceptance"
},
"status": {
"type": "string",
"enum": [
"pending",
"accepted",
"rejected",
"expired"
],
"default": "pending",
"description": "Invitation status"
},
"expiresAt": {
"type": "string",
"format": "date-time",
"description": "Invitation expiry timestamp"
},
"inviterId": {
"type": "string",
"description": "User ID of the inviter"
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "Invitation creation timestamp"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"description": "Last update timestamp"
}
},
"required": [
"id",
"organizationId",
"email",
"role",
"expiresAt",
"inviterId",
"createdAt",
"updatedAt"
],
"additionalProperties": false
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
15 changes: 15 additions & 0 deletions packages/spec/json-schema/InvitationStatus.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"$ref": "#/definitions/InvitationStatus",
"definitions": {
"InvitationStatus": {
"type": "string",
"enum": [
"pending",
"accepted",
"rejected",
"expired"
]
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
46 changes: 46 additions & 0 deletions packages/spec/json-schema/Member.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
{
"$ref": "#/definitions/Member",
"definitions": {
"Member": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique member identifier"
},
"organizationId": {
"type": "string",
"description": "Organization ID"
},
"userId": {
"type": "string",
"description": "User ID"
},
"role": {
"type": "string",
"description": "Member role (e.g., owner, admin, member, guest)"
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "Member creation timestamp"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"description": "Last update timestamp"
}
},
"required": [
"id",
"organizationId",
"userId",
"role",
"createdAt",
"updatedAt"
],
"additionalProperties": false
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
52 changes: 52 additions & 0 deletions packages/spec/json-schema/Organization.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
{
"$ref": "#/definitions/Organization",
"definitions": {
"Organization": {
"type": "object",
"properties": {
"id": {
"type": "string",
"description": "Unique organization identifier"
},
"name": {
"type": "string",
"description": "Organization display name"
},
"slug": {
"type": "string",
"pattern": "^[a-z0-9_-]+$",
"description": "Unique URL-friendly slug (lowercase alphanumeric, hyphens, underscores)"
},
"logo": {
"type": "string",
"format": "uri",
"description": "Organization logo URL"
},
"metadata": {
"type": "object",
"additionalProperties": {},
"description": "Custom metadata"
},
"createdAt": {
"type": "string",
"format": "date-time",
"description": "Organization creation timestamp"
},
"updatedAt": {
"type": "string",
"format": "date-time",
"description": "Last update timestamp"
}
},
"required": [
"id",
"name",
"slug",
"createdAt",
"updatedAt"
],
"additionalProperties": false
}
},
"$schema": "http://json-schema.org/draft-07/schema#"
}
4 changes: 4 additions & 0 deletions packages/spec/json-schema/Session.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,10 @@
"type": "string",
"description": "Associated user ID"
},
"activeOrganizationId": {
"type": "string",
"description": "Active organization ID for context switching"
},
"expires": {
"type": "string",
"format": "date-time",
Expand Down
27 changes: 27 additions & 0 deletions packages/spec/json-schema/StandardAuthProvider.json
Original file line number Diff line number Diff line change
Expand Up @@ -389,6 +389,33 @@
},
"additionalProperties": false
},
"organization": {
"type": "object",
"properties": {
"enabled": {
"type": "boolean",
"default": false,
"description": "Enable organization/multi-tenant features"
},
"allowUserToCreateOrg": {
"type": "boolean",
"default": true,
"description": "Allow users to create organizations"
},
"defaultRole": {
"type": "string",
"default": "member",
"description": "Default role for new members"
},
"creatorRole": {
"type": "string",
"default": "owner",
"description": "Role assigned to organization creator"
}
},
"additionalProperties": false,
"description": "Organization/multi-tenant configuration"
},
"enterprise": {
"type": "object",
"properties": {
Expand Down
1 change: 1 addition & 0 deletions packages/spec/src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ export * from './system/api.zod';
export * from './system/identity.zod'; // User, Account, Session models
export * from './system/auth.zod'; // Authentication configuration
export * from './system/auth-protocol'; // Authentication wire protocol & constants
export * from './system/organization.zod'; // Organization, Member, Invitation models
export * from './system/policy.zod';
export * from './system/role.zod';
export * from './system/territory.zod';
Expand Down
Loading
Loading