Skip to content

Commit 749fcbf

Browse files
authored
Merge pull request #56 from objectstack-ai/copilot/add-organization-support
2 parents 69b5785 + 0d946cf commit 749fcbf

20 files changed

Lines changed: 899 additions & 0 deletions

content/docs/references/system/AuthConfig.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ description: AuthConfig Schema Reference
2222
| **csrf** | `object` | optional | |
2323
| **accountLinking** | `object` | optional | |
2424
| **twoFactor** | `object` | optional | |
25+
| **organization** | `object` | optional | Organization/multi-tenant configuration |
2526
| **enterprise** | `object` | optional | |
2627
| **userFieldMapping** | `object` | optional | |
2728
| **database** | `object` | optional | |
Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
---
2+
title: Invitation
3+
description: Invitation Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **id** | `string` || Unique invitation identifier |
11+
| **organizationId** | `string` || Organization ID |
12+
| **email** | `string` || Invitee email address |
13+
| **role** | `string` || Role to assign upon acceptance |
14+
| **status** | `Enum<'pending' \| 'accepted' \| 'rejected' \| 'expired'>` | optional | Invitation status |
15+
| **expiresAt** | `string` || Invitation expiry timestamp |
16+
| **inviterId** | `string` || User ID of the inviter |
17+
| **createdAt** | `string` || Invitation creation timestamp |
18+
| **updatedAt** | `string` || Last update timestamp |
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
---
2+
title: InvitationStatus
3+
description: InvitationStatus Schema Reference
4+
---
5+
6+
## Allowed Values
7+
8+
* `pending`
9+
* `accepted`
10+
* `rejected`
11+
* `expired`
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
title: Member
3+
description: Member Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **id** | `string` || Unique member identifier |
11+
| **organizationId** | `string` || Organization ID |
12+
| **userId** | `string` || User ID |
13+
| **role** | `string` || Member role (e.g., owner, admin, member, guest) |
14+
| **createdAt** | `string` || Member creation timestamp |
15+
| **updatedAt** | `string` || Last update timestamp |
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
---
2+
title: Organization
3+
description: Organization Schema Reference
4+
---
5+
6+
## Properties
7+
8+
| Property | Type | Required | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **id** | `string` || Unique organization identifier |
11+
| **name** | `string` || Organization display name |
12+
| **slug** | `string` || Unique URL-friendly slug (lowercase alphanumeric, hyphens, underscores) |
13+
| **logo** | `string` | optional | Organization logo URL |
14+
| **metadata** | `Record<string, any>` | optional | Custom metadata |
15+
| **createdAt** | `string` || Organization creation timestamp |
16+
| **updatedAt** | `string` || Last update timestamp |

content/docs/references/system/Session.mdx

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ description: Session Schema Reference
1010
| **id** | `string` || Unique session identifier |
1111
| **sessionToken** | `string` || Session token |
1212
| **userId** | `string` || Associated user ID |
13+
| **activeOrganizationId** | `string` | optional | Active organization ID for context switching |
1314
| **expires** | `string` || Session expiry timestamp |
1415
| **createdAt** | `string` || Session creation timestamp |
1516
| **updatedAt** | `string` || Last update timestamp |

packages/spec/json-schema/AuthConfig.json

Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -381,6 +381,33 @@
381381
},
382382
"additionalProperties": false
383383
},
384+
"organization": {
385+
"type": "object",
386+
"properties": {
387+
"enabled": {
388+
"type": "boolean",
389+
"default": false,
390+
"description": "Enable organization/multi-tenant features"
391+
},
392+
"allowUserToCreateOrg": {
393+
"type": "boolean",
394+
"default": true,
395+
"description": "Allow users to create organizations"
396+
},
397+
"defaultRole": {
398+
"type": "string",
399+
"default": "member",
400+
"description": "Default role for new members"
401+
},
402+
"creatorRole": {
403+
"type": "string",
404+
"default": "owner",
405+
"description": "Role assigned to organization creator"
406+
}
407+
},
408+
"additionalProperties": false,
409+
"description": "Organization/multi-tenant configuration"
410+
},
384411
"enterprise": {
385412
"type": "object",
386413
"properties": {
Lines changed: 69 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,69 @@
1+
{
2+
"$ref": "#/definitions/Invitation",
3+
"definitions": {
4+
"Invitation": {
5+
"type": "object",
6+
"properties": {
7+
"id": {
8+
"type": "string",
9+
"description": "Unique invitation identifier"
10+
},
11+
"organizationId": {
12+
"type": "string",
13+
"description": "Organization ID"
14+
},
15+
"email": {
16+
"type": "string",
17+
"format": "email",
18+
"description": "Invitee email address"
19+
},
20+
"role": {
21+
"type": "string",
22+
"description": "Role to assign upon acceptance"
23+
},
24+
"status": {
25+
"type": "string",
26+
"enum": [
27+
"pending",
28+
"accepted",
29+
"rejected",
30+
"expired"
31+
],
32+
"default": "pending",
33+
"description": "Invitation status"
34+
},
35+
"expiresAt": {
36+
"type": "string",
37+
"format": "date-time",
38+
"description": "Invitation expiry timestamp"
39+
},
40+
"inviterId": {
41+
"type": "string",
42+
"description": "User ID of the inviter"
43+
},
44+
"createdAt": {
45+
"type": "string",
46+
"format": "date-time",
47+
"description": "Invitation creation timestamp"
48+
},
49+
"updatedAt": {
50+
"type": "string",
51+
"format": "date-time",
52+
"description": "Last update timestamp"
53+
}
54+
},
55+
"required": [
56+
"id",
57+
"organizationId",
58+
"email",
59+
"role",
60+
"expiresAt",
61+
"inviterId",
62+
"createdAt",
63+
"updatedAt"
64+
],
65+
"additionalProperties": false
66+
}
67+
},
68+
"$schema": "http://json-schema.org/draft-07/schema#"
69+
}
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
{
2+
"$ref": "#/definitions/InvitationStatus",
3+
"definitions": {
4+
"InvitationStatus": {
5+
"type": "string",
6+
"enum": [
7+
"pending",
8+
"accepted",
9+
"rejected",
10+
"expired"
11+
]
12+
}
13+
},
14+
"$schema": "http://json-schema.org/draft-07/schema#"
15+
}
Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
{
2+
"$ref": "#/definitions/Member",
3+
"definitions": {
4+
"Member": {
5+
"type": "object",
6+
"properties": {
7+
"id": {
8+
"type": "string",
9+
"description": "Unique member identifier"
10+
},
11+
"organizationId": {
12+
"type": "string",
13+
"description": "Organization ID"
14+
},
15+
"userId": {
16+
"type": "string",
17+
"description": "User ID"
18+
},
19+
"role": {
20+
"type": "string",
21+
"description": "Member role (e.g., owner, admin, member, guest)"
22+
},
23+
"createdAt": {
24+
"type": "string",
25+
"format": "date-time",
26+
"description": "Member creation timestamp"
27+
},
28+
"updatedAt": {
29+
"type": "string",
30+
"format": "date-time",
31+
"description": "Last update timestamp"
32+
}
33+
},
34+
"required": [
35+
"id",
36+
"organizationId",
37+
"userId",
38+
"role",
39+
"createdAt",
40+
"updatedAt"
41+
],
42+
"additionalProperties": false
43+
}
44+
},
45+
"$schema": "http://json-schema.org/draft-07/schema#"
46+
}

0 commit comments

Comments
 (0)