openxiangda 2.0.0-alpha.24 → 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
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:
|
|
@@ -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
|