openxiangda 2.0.0-alpha.23 → 2.0.0-alpha.26
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/dist/config.d.ts +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +1 -1
- package/dist/config.js.map +1 -1
- package/package.json +7 -7
- package/skills/manifest.json +1 -1
- package/skills/openxiangda-v2/SKILL.md +4 -4
- package/skills/openxiangda-v2/references/commands.md +1 -1
- package/skills/openxiangda-v2/references/data-authz.md +46 -4
- package/skills/openxiangda-v2/references/delivery.md +17 -2
- package/skills/openxiangda-v2/references/testing.md +10 -4
package/dist/config.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { defineOpenXiangdaApp, composeAppOperationSchemas, composeJsonSchema, currentUserDataPolicy, resourceRecordSchema, resourceCapabilityCodes, schemaRef, type AppDataFieldAccessDeclaration, type AppDataFieldDeclaration, type AppDataResourceDeclaration, type OpenXiangdaAppConfig, type OpenXiangdaAppDeclaration, type AppOperationSchemasInput, type JsonSchemaDefinitions, type ResourceRecordSchemaOptions, } from 'openxiangda-devkit-core';
|
|
1
|
+
export { defineOpenXiangdaApp, composeAppOperationSchemas, composeJsonSchema, currentUserDataPolicy, dataPolicyExpression, resourceRecordSchema, resourceReadPolicy, resourceCapabilityCodes, schemaRef, type AppDataFieldAccessDeclaration, type AppDataFieldDeclaration, type AppDataResourceDeclaration, type OpenXiangdaAppConfig, type OpenXiangdaAppDeclaration, type AppOperationSchemasInput, type JsonSchemaDefinitions, type ResourceRecordSchemaOptions, } from 'openxiangda-devkit-core';
|
|
2
2
|
//# sourceMappingURL=config.d.ts.map
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,SAAS,EACT,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,GACjC,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,SAAS,EACT,KAAK,6BAA6B,EAClC,KAAK,uBAAuB,EAC5B,KAAK,0BAA0B,EAC/B,KAAK,oBAAoB,EACzB,KAAK,yBAAyB,EAC9B,KAAK,wBAAwB,EAC7B,KAAK,qBAAqB,EAC1B,KAAK,2BAA2B,GACjC,MAAM,yBAAyB,CAAC"}
|
package/dist/config.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { defineOpenXiangdaApp, composeAppOperationSchemas, composeJsonSchema, currentUserDataPolicy, resourceRecordSchema, resourceCapabilityCodes, schemaRef, } from 'openxiangda-devkit-core';
|
|
1
|
+
export { defineOpenXiangdaApp, composeAppOperationSchemas, composeJsonSchema, currentUserDataPolicy, dataPolicyExpression, resourceRecordSchema, resourceReadPolicy, resourceCapabilityCodes, schemaRef, } from 'openxiangda-devkit-core';
|
|
2
2
|
//# sourceMappingURL=config.js.map
|
package/dist/config.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,uBAAuB,EACvB,SAAS,GASV,MAAM,yBAAyB,CAAC"}
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,oBAAoB,EACpB,0BAA0B,EAC1B,iBAAiB,EACjB,qBAAqB,EACrB,oBAAoB,EACpB,oBAAoB,EACpB,kBAAkB,EAClB,uBAAuB,EACvB,SAAS,GASV,MAAM,yBAAyB,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "openxiangda",
|
|
3
|
-
"version": "2.0.0-alpha.
|
|
3
|
+
"version": "2.0.0-alpha.26",
|
|
4
4
|
"description": "Unified OpenXiangda 2.0 CLI, SDK, React runtime, NestJS integration and AI skill distribution.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -49,12 +49,12 @@
|
|
|
49
49
|
"dependencies": {
|
|
50
50
|
"dayjs": "1.11.18",
|
|
51
51
|
"docx-preview": "0.3.7",
|
|
52
|
-
"openxiangda-cli": "2.0.0-alpha.
|
|
53
|
-
"openxiangda-contracts": "2.0.0-alpha.
|
|
54
|
-
"openxiangda-devkit-core": "2.0.0-alpha.
|
|
55
|
-
"openxiangda-mcp": "2.0.0-alpha.
|
|
56
|
-
"openxiangda-nest": "2.0.0-alpha.
|
|
57
|
-
"openxiangda-skill-kit": "2.0.0-alpha.
|
|
52
|
+
"openxiangda-cli": "2.0.0-alpha.113",
|
|
53
|
+
"openxiangda-contracts": "2.0.0-alpha.54",
|
|
54
|
+
"openxiangda-devkit-core": "2.0.0-alpha.71",
|
|
55
|
+
"openxiangda-mcp": "2.0.0-alpha.71",
|
|
56
|
+
"openxiangda-nest": "2.0.0-alpha.65",
|
|
57
|
+
"openxiangda-skill-kit": "2.0.0-alpha.89",
|
|
58
58
|
"xlsx": "https://cdn.sheetjs.com/xlsx-0.20.3/xlsx-0.20.3.tgz"
|
|
59
59
|
},
|
|
60
60
|
"peerDependencies": {
|
package/skills/manifest.json
CHANGED
|
@@ -4,7 +4,7 @@
|
|
|
4
4
|
{
|
|
5
5
|
"name": "openxiangda-v2",
|
|
6
6
|
"description": "Use when researching, designing, building, testing, or delivering a complete OpenXiangda 2.0 application.",
|
|
7
|
-
"sha256": "
|
|
7
|
+
"sha256": "08bd64cb7f0dee4889fd34e9081b3b01dcafa714273c51bae57ee9e22ccfcf9e"
|
|
8
8
|
}
|
|
9
9
|
]
|
|
10
10
|
}
|
|
@@ -10,14 +10,14 @@ Treat requirement discovery, architecture, authorization, development, testing a
|
|
|
10
10
|
Before a workspace exists, use this Skill's exact npm version:
|
|
11
11
|
|
|
12
12
|
```bash
|
|
13
|
-
pnpm dlx openxiangda@2.0.0-alpha.
|
|
14
|
-
pnpm dlx openxiangda@2.0.0-alpha.
|
|
13
|
+
pnpm dlx openxiangda@2.0.0-alpha.26 login --base-url <platform>
|
|
14
|
+
pnpm dlx openxiangda@2.0.0-alpha.26 create <directory>
|
|
15
15
|
```
|
|
16
16
|
|
|
17
17
|
Inside an application, use only its locked executable through `pnpm openxiangda`. Never invoke a bare global `openxiangda`, because that executable may belong to stable 1.x. Moving tags such as `latest` and `alpha` are forbidden. To install or refresh this same Skill from the package, run:
|
|
18
18
|
|
|
19
19
|
```bash
|
|
20
|
-
pnpm dlx openxiangda@2.0.0-alpha.
|
|
20
|
+
pnpm dlx openxiangda@2.0.0-alpha.26 skill install --force
|
|
21
21
|
```
|
|
22
22
|
|
|
23
23
|
Use this order:
|
|
@@ -29,7 +29,7 @@ Use this order:
|
|
|
29
29
|
5. For every resource or permission change, read [Data and authorization](references/data-authz.md) before editing `openxiangda.config.ts`.
|
|
30
30
|
6. Read [Frontend](references/frontend.md) for pages or fields and [Backend actions](references/backend.md) only for a real business action.
|
|
31
31
|
7. When the application explicitly enables standard approval, application events or notifications, read [Workflow, Events and Notification Hub](references/workflow-events.md). Keep them optional and out of ordinary CRUD.
|
|
32
|
-
8. Run the connected loop with `pnpm openxiangda dev`, then follow [Testing](references/testing.md) and `pnpm openxiangda check
|
|
32
|
+
8. Run the connected loop with `pnpm openxiangda dev`, then follow [Testing](references/testing.md) and `pnpm openxiangda check`; check performs the target platform's read-only Native compatibility preflight before application checks or builds.
|
|
33
33
|
9. Follow [Delivery](references/delivery.md): deploy preproduction first, inspect status/logs, then promote the exact successful version to production.
|
|
34
34
|
|
|
35
35
|
For an AI-native client, start the workspace protocol through the same pinned executable:
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
| --- | --- | --- |
|
|
7
7
|
| `pnpm openxiangda create` | deploy | 创建、绑定并初始化应用 |
|
|
8
8
|
| `pnpm openxiangda dev` | write-local | 连接平台测试数据启动本地 Web 与 Nest |
|
|
9
|
-
| `pnpm openxiangda check` | write-local |
|
|
9
|
+
| `pnpm openxiangda check` | write-local | 生成契约并在目标平台预检后执行检查、测试和构建 |
|
|
10
10
|
| `pnpm openxiangda accept` | deploy | 按计划准备可选的真实预发验收身份 |
|
|
11
11
|
| `pnpm openxiangda deploy` | deploy | 部署测试环境或显式复用测试版本部署生产 |
|
|
12
12
|
| `pnpm openxiangda status` | read | 查询最近或指定部署状态 |
|
|
@@ -8,8 +8,10 @@ source. Do not create `platform/data` modules.
|
|
|
8
8
|
```ts
|
|
9
9
|
import {
|
|
10
10
|
currentUserDataPolicy,
|
|
11
|
+
dataPolicyExpression,
|
|
11
12
|
defineOpenXiangdaApp,
|
|
12
13
|
resourceCapabilityCodes,
|
|
14
|
+
resourceReadPolicy,
|
|
13
15
|
} from 'openxiangda/config';
|
|
14
16
|
|
|
15
17
|
const APP_CODE = 'visitor-center';
|
|
@@ -119,10 +121,50 @@ currentUserDataPolicy({
|
|
|
119
121
|
```
|
|
120
122
|
|
|
121
123
|
Put that value in `authz.dataPolicies`, declare both roles, and set the
|
|
122
|
-
resource `dataPolicyCode` to the same code. Do not invent `
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
124
|
+
resource `dataPolicyCode` to the same code. Do not invent `current_user: true`,
|
|
125
|
+
lowercase match modes, a dotted value path, or policy-level `roleCodes`. The
|
|
126
|
+
compiler and platform know that `user.*` fields compare their stable `value`;
|
|
127
|
+
`field` remains the declared field root code.
|
|
128
|
+
|
|
129
|
+
For portal visibility windows, use the typed SDK expression and keep it a
|
|
130
|
+
server-enforced read policy:
|
|
131
|
+
|
|
132
|
+
```ts
|
|
133
|
+
resourceReadPolicy({
|
|
134
|
+
code: 'published-articles',
|
|
135
|
+
name: '仅查看当前已发布内容',
|
|
136
|
+
resourceCode: 'articles',
|
|
137
|
+
matchMode: 'AND',
|
|
138
|
+
rules: [{ dimensionCode: 'organization', field: 'organizationId' }],
|
|
139
|
+
expression: dataPolicyExpression.allOf(
|
|
140
|
+
dataPolicyExpression.constant({
|
|
141
|
+
field: 'status', operator: 'eq', value: 'PUBLISHED',
|
|
142
|
+
}),
|
|
143
|
+
dataPolicyExpression.databaseNow({
|
|
144
|
+
field: 'publishAt', operator: 'lte',
|
|
145
|
+
}),
|
|
146
|
+
dataPolicyExpression.anyOf(
|
|
147
|
+
dataPolicyExpression.null({ field: 'expireAt', operator: 'is_null' }),
|
|
148
|
+
dataPolicyExpression.databaseNow({ field: 'expireAt', operator: 'gt' }),
|
|
149
|
+
),
|
|
150
|
+
),
|
|
151
|
+
})
|
|
152
|
+
```
|
|
153
|
+
|
|
154
|
+
`db_now` is platform-owned PostgreSQL statement time and only accepts a
|
|
155
|
+
`datetime` field. Missing/null values match only `is_null`; they do not match
|
|
156
|
+
negative constants or time comparisons. The same bounded expression can
|
|
157
|
+
combine `currentUser`, `dimension`, `relation`, `constant`, `null`, and
|
|
158
|
+
`databaseNow` leaves under `allOf`/`anyOf`. Never duplicate this expression in
|
|
159
|
+
a page `where` filter and call it authorization: UI filters are optional
|
|
160
|
+
display state and cannot weaken or replace Native RLS.
|
|
161
|
+
|
|
162
|
+
`readExpression` is always added on top of the base `matchMode`/`rules`; those
|
|
163
|
+
base rules continue to restrict create/update/delete. If writes truly need no
|
|
164
|
+
row scope beyond capability checks, say so explicitly with
|
|
165
|
+
`writeBoundary: 'capability_only'` instead of `matchMode`/`rules`. Never use an
|
|
166
|
+
empty base implicitly: `check` rejects it so an AI cannot accidentally remove
|
|
167
|
+
write authorization while adding a portal read window.
|
|
126
168
|
|
|
127
169
|
When a business membership resource is the durable source of a package role or
|
|
128
170
|
RelationshipGrant, declare the projection instead of calling authorization
|
|
@@ -1,7 +1,22 @@
|
|
|
1
1
|
# OpenXiangda 2.0 Delivery
|
|
2
2
|
|
|
3
|
-
Run `pnpm openxiangda check --json`; it
|
|
4
|
-
|
|
3
|
+
Run `pnpm openxiangda check --json`; it defaults to the test target, compiles
|
|
4
|
+
the complete configuration and contract bundles, and asks the target
|
|
5
|
+
platform's advertised `configurationCompatibility` endpoint to run the same
|
|
6
|
+
Native compiler validation used during deployment preparation. This read-only
|
|
7
|
+
preflight happens before workspace checks, tests, builds, Buildx or uploads.
|
|
8
|
+
Use `--environment production` only when explicitly checking that target. A
|
|
9
|
+
failure preserves `pointer`, client contract/schema versions, platform
|
|
10
|
+
version/capability and the required/supported application-contract tuples.
|
|
11
|
+
The capability also publishes the existing 4 MiB configuration, 8 MiB
|
|
12
|
+
contract and 10 MiB total request bounds so oversized input fails before the
|
|
13
|
+
transport layer.
|
|
14
|
+
Never remove generated fields, reduce versions, raise limits, add app-code
|
|
15
|
+
exceptions or introduce 1.x compatibility to make it pass. The platform
|
|
16
|
+
revalidates authoritatively during deployment preparation.
|
|
17
|
+
|
|
18
|
+
After compatibility succeeds, check owns static checks, tests and production
|
|
19
|
+
builds but deliberately does not seal an AppPackage. Its
|
|
5
20
|
`data.sealedArtifact` object and `.openxiangda/build/seal-status.json` make that
|
|
6
21
|
state explicit even when an older `app-package.json` remains on disk. Deploy to
|
|
7
22
|
test with the returned `openxiangda deploy` next command. Deploy owns the
|
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
# Testing and Acceptance
|
|
2
2
|
|
|
3
3
|
Run `pnpm openxiangda check --json` after declaration or code changes. It owns
|
|
4
|
-
generation
|
|
5
|
-
|
|
4
|
+
generation plus a read-only Native compatibility preflight against the test
|
|
5
|
+
platform before static validation, unit tests or production builds. Use
|
|
6
|
+
`--environment production` only for an explicit production-target check.
|
|
7
|
+
Preserve the stable diagnostic and JSON pointer instead of bypassing a failing
|
|
8
|
+
stage. Read
|
|
6
9
|
`data.sealedArtifact` in the machine result. A successful check always reports
|
|
7
10
|
`state: "check-did-not-seal"`, `sealed: false` and
|
|
8
11
|
`usableForDeploy: false`; it may also describe an older package as
|
|
@@ -20,8 +23,11 @@ For each changed resource, verify the real chain:
|
|
|
20
23
|
6. PostgreSQL/RLS remains authoritative, including current-user and multi-role-union cases.
|
|
21
24
|
|
|
22
25
|
For platform generator changes, add a representative multi-resource fixture
|
|
23
|
-
(
|
|
24
|
-
|
|
26
|
+
(the compatibility corpus fixes 43 resources, complete list/form/detail/mobile
|
|
27
|
+
surfaces, Perspective/AuthZ/Workflow/Event and exactly 161 producers), assert
|
|
28
|
+
the real toolchain generator output remains byte-identical, and pass the same
|
|
29
|
+
fixture through the platform's exported Native validator. Then run the unchanged
|
|
30
|
+
Web dist budget gate. A budget failure is a
|
|
25
31
|
generator/runtime regression to fix; never raise the application budget or copy
|
|
26
32
|
generated contracts into a smaller application-local format. Browser acceptance
|
|
27
33
|
must also cover the large more-filters modal, declaration-order forms, hidden
|