Skip to content

Commit e235f7c

Browse files
committed
更新文档和依赖项,修改品牌名称,调整链接和结构
1 parent 692eca6 commit e235f7c

File tree

8 files changed

+223
-142
lines changed

8 files changed

+223
-142
lines changed

content/docs.site.json

Lines changed: 3 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
},
1414
"branding": {
1515
"logo": {
16-
"text": "ObjectDocs",
16+
"text": "ObjectStack",
1717
"light": "/logo.svg",
1818
"dark": "/logo.svg"
1919
},
@@ -27,22 +27,14 @@
2727
"enabled": true,
2828
"transparentMode": "top",
2929
"links": [
30-
{
31-
"text": "Concepts",
32-
"url": "/docs/concepts/manifesto"
33-
},
34-
{
35-
"text": "References",
36-
"url": "/docs/references/Object"
37-
},
3830
{
3931
"text": "Website",
4032
"url": "https://www.objectstack.ai",
4133
"external": true
4234
}
4335
],
4436
"socials": [
45-
{ "platform": "github", "url": "https://github.com/objectstack-ai" }
37+
{ "platform": "github", "url": "https://github.com/objectstack-ai/spec" }
4638
]
4739
},
4840
"sidebar": {
@@ -64,7 +56,7 @@
6456
"page": {
6557
"showLastUpdate": true,
6658
"showEditLink": true,
67-
"repoBaseUrl": "https://github.com/objectstack-ai/objectdocs"
59+
"repoBaseUrl": "https://github.com/objectstack-ai/spec"
6860
},
6961
"content": {
7062
"math": false,

content/docs/concepts/security_architecture.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
---
2+
title: Security Architecture
3+
---
4+
15
# ObjectStack Security Model: The "Defense in Depth" Architecture
26

37
ObjectStack adopts the **"Salesforce-style"** metadata-driven security model. This is chosen over the Microsoft (Dataverse) model for its superior granularity and decoupling, which is essential for complex enterprise scenarios.

content/docs/index.mdx

Lines changed: 75 additions & 119 deletions
Original file line numberDiff line numberDiff line change
@@ -1,122 +1,78 @@
1-
2-
### 🟢 P0: 核心元模型 (The Metamodel)
3-
4-
*没有这部分,ObjectQL 和 ObjectUI 无法通信,系统无法运转。这是“万物皆对象”的法律定义。*
5-
6-
* **[ ] 1. 实体定义协议 (`EntitySchema`)**
7-
* **定义目标**: 描述一个“对象”长什么样。
8-
* **关键字段**: `name` (机器名), `label` (显示名), `dataSource` (存哪), `dbName` (物理表名)。
9-
* **用途**: ObjectQL 解析 `.gql` 文件后生成的 AST 结构;`/_api/metadata/objects/{name}` 的返回值。
10-
11-
12-
* **[ ] 2. 字段定义协议 (`FieldSchema`)**
13-
* **定义目标**: 描述对象里的“属性”。
14-
* **关键字段**: `type` (text/number/lookup...), `required`, `unique`, `defaultValue`
15-
* **关键枚举**: `FieldType` (必须枚举所有支持的类型,如 `master_detail`, `formula`, `image`)。
16-
* **用途**: 告诉前端渲染什么组件,告诉后端怎么建表。
17-
18-
19-
* **[ ] 3. 视图/布局协议 (`LayoutSchema`)**
20-
* **定义目标**: 描述界面如何排列。
21-
* **关键结构**:
22-
* `ListView`: 列定义 (`columns`), 排序 (`sort`), 筛选 (`filters`)。
23-
* `FormView`: 区域 (`sections`), 字段分组 (`groups`)。
24-
25-
26-
* **用途**: ObjectUI 根据这个 JSON 渲染页面,而不是写死 React 代码。
27-
28-
29-
30-
---
31-
32-
### 🔵 P1: 插件与分发 (Packaging & Runtime)
33-
34-
*没有这部分,你的应用市场和插件机制就是空谈。*
35-
36-
* **[ ] 4. 插件清单协议 (`ManifestSchema`)**
37-
* **定义目标**: 描述一个软件包(插件/应用)。
38-
* **文件对应**: `objectstack.config.ts``package.json > objectstack`
39-
* **关键字段**: `id`, `version`, `type` (app/plugin/driver), `permissions` (申请权限), `menus` (导航注入)。
40-
* **用途**: CLI 打包校验,应用商店展示。
41-
42-
43-
* **[ ] 5. 生命周期接口 (`PluginLifecycle`)**
44-
* **定义目标**: 插件在运行时如何被加载。
45-
* **接口定义**: `interface ObjectStackPlugin`
46-
* **关键方法**: `onInstall(ctx)`, `onEnable(ctx)`, `onDisable(ctx)`
47-
* **Context 定义**: `ctx.ql` (数据能力), `ctx.os` (系统能力), `ctx.logger`
48-
* **用途**: ObjectOS 加载 `node_modules` 时的统一入口标准。
49-
50-
51-
* **[ ] 6. 导航菜单协议 (`NavigationSchema`)**
52-
* **定义目标**: 描述侧边栏菜单结构。
53-
* **关键字段**: `label`, `icon`, `path`, `children`, `visible_on` (权限控制)。
54-
* **用途**: 多个插件的菜单合并渲染到 ObjectCloud / Studio 的侧边栏。
55-
56-
57-
581
---
59-
60-
### 🟠 P2: 驱动与连接 (Drivers & Logic)
61-
62-
*这部分决定了你的系统扩展性(能不能连 Excel,能不能写自定义代码)。*
63-
64-
* **[ ] 7. 数据驱动接口 (`DriverInterface`)**
65-
* **定义目标**: 任何数据库要想接入 ObjectQL,必须实现的标准。
66-
* **核心方法**:
67-
* `find(entity, query)`
68-
* `create(entity, data)`
69-
* `update(entity, id, data)`
70-
* `delete(entity, id)`
71-
* `syncSchema(entity)` (DDL 操作:建表/加字段)
72-
73-
74-
* **用途**: 让 `driver-postgres`, `driver-excel`, `driver-salesforce` 行为一致。
75-
76-
77-
* **[ ] 8. 触发器上下文协议 (`TriggerContext`)**
78-
* **定义目标**: 当用户写 `beforeInsert` 代码时,传入参数的标准。
79-
* **接口定义**:
80-
* `doc` (当前记录)
81-
* `previousDoc` (修改前的记录)
82-
* `userId` (谁在操作)
83-
84-
85-
* **用途**: 规范化业务逻辑代码的编写。
86-
87-
88-
* **[ ] 9. UI 组件契约 (`WidgetContract`)**
89-
* **定义目标**: 第三方开发者开发自定义 UI 组件(如:地图选择器)的标准。
90-
* **接口定义**: `interface FieldWidgetProps { value, onChange, readonly, options }`
91-
* **用途**: 让社区开发的 React 组件能无缝嵌入到 ObjectUI 的表单中。
92-
93-
94-
2+
title: ObjectStack Protocol
3+
description: The Standard for Post-SaaS Operating Systems
954
---
965

97-
### 💾 你的“立法”行动路线图
98-
99-
建议你在 `packages/spec` 仓库中按以下文件结构落地这些协议:
100-
101-
```text
102-
packages/spec/
103-
├── src/
104-
│ ├── types/
105-
│ │ ├── meta/ <-- P0: Metamodel
106-
│ │ │ ├── entity.ts (EntitySchema)
107-
│ │ │ ├── field.ts (FieldSchema)
108-
│ │ │ └── view.ts (LayoutSchema)
109-
│ │ ├── bundle/ <-- P1: Packaging
110-
│ │ │ ├── manifest.ts (ManifestSchema)
111-
│ │ │ └── menu.ts (NavigationSchema)
112-
│ │ ├── runtime/ <-- P2: Logic
113-
│ │ │ ├── plugin.ts (Lifecycle)
114-
│ │ │ └── driver.ts (DriverInterface)
115-
│ │ └── auth/ <-- from plugin-auth
116-
│ │ └── session.ts (User/Session Interface)
117-
│ ├── zods/ <-- 对应的 Zod 实现 (用于运行时校验)
118-
│ └── constants/ <-- 目录约定 (paths)
119-
└── package.json
120-
121-
```
122-
6+
import { FileText, Database, Layout, Settings, Book } from 'lucide-react';
7+
8+
# ObjectStack Protocol
9+
10+
**ObjectStack Protocol** is the "DNA" and constitution of the ObjectStack platform. It defines the metadata standards, schemas, and runtime behaviors that power a metadata-driven, low-code operating system.
11+
12+
<Callout type="info">
13+
This specification serves as the Single Source of Truth for all ObjectStack implementations. All definitions are strictly typed using Zod and TypeScript.
14+
</Callout>
15+
16+
## The Metamodel Architecture
17+
18+
The protocol is divided into three fundamental pillars that decouple data, presentation, and system configuration.
19+
20+
<Cards>
21+
<Card
22+
icon={<Database />}
23+
href="/docs/concepts/architecture"
24+
title="Data Protocol"
25+
description="Core business logic and data modeling. Defines Objects, Fields, Validation Rules, and Flows."
26+
/>
27+
<Card
28+
icon={<Layout />}
29+
href="/docs/references/App"
30+
title="UI Protocol"
31+
description="Presentation layer specifications. Defines Views, Layouts, Menus (Apps), and Dashboards."
32+
/>
33+
<Card
34+
icon={<Settings />}
35+
href="/docs/references/Datasource"
36+
title="System Protocol"
37+
description="Runtime configuration and environment binding. Defines Datasources, APIs, and Manifests."
38+
/>
39+
</Cards>
40+
41+
## Core Principles
42+
43+
### 1. Schema First
44+
Every protocol definition starts with a **Zod Schema**. This ensures runtime validation for the CLI and strict type derivation (`z.infer<T>`) for the IDE. We do not write code without a schema.
45+
46+
### 2. Configuration as Code
47+
All business logic is expressed as serializable JSON/YAML configuration. This enables:
48+
- **Version Control**: Git-based history for business logic.
49+
- **Reviewability**: Pull requests for application changes.
50+
- **Portability**: Move applications between environments instantly.
51+
52+
### 3. Separation of Concerns
53+
We strictly separate the **Metamodel** (pure definitions) from the **Runtime** (execution engine). The `spec` package contains *only* definitions, constants, and types—no heavy business logic.
54+
55+
## Directory Structure
56+
57+
The specification is organized reflecting the protocol pillars:
58+
59+
- **`src/data/`**: ObjectQL definitions (Object, Field, Validation).
60+
- **`src/ui/`**: ObjectUI definitions (App, View, Action).
61+
- **`src/system/`**: ObjectOS definitions (Manifest, Config).
62+
63+
## Next Steps
64+
65+
<Cards>
66+
<Card
67+
icon={<Book />}
68+
href="/docs/concepts/manifesto"
69+
title="Read the Manifesto"
70+
description="Understand the philosophy behind the Post-SaaS Operating System."
71+
/>
72+
<Card
73+
icon={<FileText />}
74+
href="/docs/references"
75+
title="API Reference"
76+
description="Explore the complete API and Schema reference documentation."
77+
/>
78+
</Cards>

content/docs/references/Plan.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ description: Plan Schema Reference
1313
| **label** | `string` || |
1414
| **active** | `boolean` | optional | |
1515
| **features** | `string[]` || List of enabled boolean features |
16-
| **limits** | `Record<string, number>` || Map of metric codes to limit values (e.g. { storage_gb: 10 }) |
16+
| **limits** | `Record<string, number>` || Map of metric codes to limit values (e.g. \{ storage_gb: 10 \}) |
1717
| **currency** | `string` | optional | |
1818
| **priceMonthly** | `number` | optional | |
1919
| **priceYearly** | `number` | optional | |

content/docs/references/StateMachineValidation.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,4 +15,4 @@ description: StateMachineValidation Schema Reference
1515
| **message** | `string` || Error message to display |
1616
| **type** | `string` || |
1717
| **field** | `string` || State field (e.g. status) |
18-
| **transitions** | `Record<string, string[]>` || Map of { OldState: [AllowedNewStates] } |
18+
| **transitions** | `Record<string, string[]>` || Map of \{ OldState: [AllowedNewStates] \} |

content/prompts/index.mdx

Lines changed: 125 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,125 @@
1+
---
2+
title: Documentation
3+
---
4+
5+
### 🟢 P0: 核心元模型 (The Metamodel)
6+
7+
*没有这部分,ObjectQL 和 ObjectUI 无法通信,系统无法运转。这是“万物皆对象”的法律定义。*
8+
9+
* **[ ] 1. 实体定义协议 (`EntitySchema`)**
10+
* **定义目标**: 描述一个“对象”长什么样。
11+
* **关键字段**: `name` (机器名), `label` (显示名), `dataSource` (存哪), `dbName` (物理表名)。
12+
* **用途**: ObjectQL 解析 `.gql` 文件后生成的 AST 结构;`/_api/metadata/objects/{name}` 的返回值。
13+
14+
15+
* **[ ] 2. 字段定义协议 (`FieldSchema`)**
16+
* **定义目标**: 描述对象里的“属性”。
17+
* **关键字段**: `type` (text/number/lookup...), `required`, `unique`, `defaultValue`
18+
* **关键枚举**: `FieldType` (必须枚举所有支持的类型,如 `master_detail`, `formula`, `image`)。
19+
* **用途**: 告诉前端渲染什么组件,告诉后端怎么建表。
20+
21+
22+
* **[ ] 3. 视图/布局协议 (`LayoutSchema`)**
23+
* **定义目标**: 描述界面如何排列。
24+
* **关键结构**:
25+
* `ListView`: 列定义 (`columns`), 排序 (`sort`), 筛选 (`filters`)。
26+
* `FormView`: 区域 (`sections`), 字段分组 (`groups`)。
27+
28+
29+
* **用途**: ObjectUI 根据这个 JSON 渲染页面,而不是写死 React 代码。
30+
31+
32+
33+
---
34+
35+
### 🔵 P1: 插件与分发 (Packaging & Runtime)
36+
37+
*没有这部分,你的应用市场和插件机制就是空谈。*
38+
39+
* **[ ] 4. 插件清单协议 (`ManifestSchema`)**
40+
* **定义目标**: 描述一个软件包(插件/应用)。
41+
* **文件对应**: `objectstack.config.ts``package.json > objectstack`
42+
* **关键字段**: `id`, `version`, `type` (app/plugin/driver), `permissions` (申请权限), `menus` (导航注入)。
43+
* **用途**: CLI 打包校验,应用商店展示。
44+
45+
46+
* **[ ] 5. 生命周期接口 (`PluginLifecycle`)**
47+
* **定义目标**: 插件在运行时如何被加载。
48+
* **接口定义**: `interface ObjectStackPlugin`
49+
* **关键方法**: `onInstall(ctx)`, `onEnable(ctx)`, `onDisable(ctx)`
50+
* **Context 定义**: `ctx.ql` (数据能力), `ctx.os` (系统能力), `ctx.logger`
51+
* **用途**: ObjectOS 加载 `node_modules` 时的统一入口标准。
52+
53+
54+
* **[ ] 6. 导航菜单协议 (`NavigationSchema`)**
55+
* **定义目标**: 描述侧边栏菜单结构。
56+
* **关键字段**: `label`, `icon`, `path`, `children`, `visible_on` (权限控制)。
57+
* **用途**: 多个插件的菜单合并渲染到 ObjectCloud / Studio 的侧边栏。
58+
59+
60+
61+
---
62+
63+
### 🟠 P2: 驱动与连接 (Drivers & Logic)
64+
65+
*这部分决定了你的系统扩展性(能不能连 Excel,能不能写自定义代码)。*
66+
67+
* **[ ] 7. 数据驱动接口 (`DriverInterface`)**
68+
* **定义目标**: 任何数据库要想接入 ObjectQL,必须实现的标准。
69+
* **核心方法**:
70+
* `find(entity, query)`
71+
* `create(entity, data)`
72+
* `update(entity, id, data)`
73+
* `delete(entity, id)`
74+
* `syncSchema(entity)` (DDL 操作:建表/加字段)
75+
76+
77+
* **用途**: 让 `driver-postgres`, `driver-excel`, `driver-salesforce` 行为一致。
78+
79+
80+
* **[ ] 8. 触发器上下文协议 (`TriggerContext`)**
81+
* **定义目标**: 当用户写 `beforeInsert` 代码时,传入参数的标准。
82+
* **接口定义**:
83+
* `doc` (当前记录)
84+
* `previousDoc` (修改前的记录)
85+
* `userId` (谁在操作)
86+
87+
88+
* **用途**: 规范化业务逻辑代码的编写。
89+
90+
91+
* **[ ] 9. UI 组件契约 (`WidgetContract`)**
92+
* **定义目标**: 第三方开发者开发自定义 UI 组件(如:地图选择器)的标准。
93+
* **接口定义**: `interface FieldWidgetProps { value, onChange, readonly, options }`
94+
* **用途**: 让社区开发的 React 组件能无缝嵌入到 ObjectUI 的表单中。
95+
96+
97+
98+
---
99+
100+
### 💾 你的“立法”行动路线图
101+
102+
建议你在 `packages/spec` 仓库中按以下文件结构落地这些协议:
103+
104+
```text
105+
packages/spec/
106+
├── src/
107+
│ ├── types/
108+
│ │ ├── meta/ <-- P0: Metamodel
109+
│ │ │ ├── entity.ts (EntitySchema)
110+
│ │ │ ├── field.ts (FieldSchema)
111+
│ │ │ └── view.ts (LayoutSchema)
112+
│ │ ├── bundle/ <-- P1: Packaging
113+
│ │ │ ├── manifest.ts (ManifestSchema)
114+
│ │ │ └── menu.ts (NavigationSchema)
115+
│ │ ├── runtime/ <-- P2: Logic
116+
│ │ │ ├── plugin.ts (Lifecycle)
117+
│ │ │ └── driver.ts (DriverInterface)
118+
│ │ └── auth/ <-- from plugin-auth
119+
│ │ └── session.ts (User/Session Interface)
120+
│ ├── zods/ <-- 对应的 Zod 实现 (用于运行时校验)
121+
│ └── constants/ <-- 目录约定 (paths)
122+
└── package.json
123+
124+
```
125+

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,6 +32,7 @@
3232
},
3333
"packageManager": "pnpm@10.28.0",
3434
"dependencies": {
35-
"@objectdocs/cli": "^0.2.1"
35+
"@objectdocs/cli": "^0.2.5",
36+
"lucide-react": "^0.562.0"
3637
}
3738
}

0 commit comments

Comments
 (0)