@omnifyjp/omnify 5.8.12 → 5.8.13
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/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@omnifyjp/omnify",
|
|
3
|
-
"version": "5.8.
|
|
3
|
+
"version": "5.8.13",
|
|
4
4
|
"description": "Schema-driven code generation for Laravel, TypeScript, and SQL",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"repository": {
|
|
@@ -36,10 +36,10 @@
|
|
|
36
36
|
"zod": "^3.24.0"
|
|
37
37
|
},
|
|
38
38
|
"optionalDependencies": {
|
|
39
|
-
"@omnifyjp/omnify-darwin-arm64": "5.8.
|
|
40
|
-
"@omnifyjp/omnify-darwin-x64": "5.8.
|
|
41
|
-
"@omnifyjp/omnify-linux-x64": "5.8.
|
|
42
|
-
"@omnifyjp/omnify-linux-arm64": "5.8.
|
|
43
|
-
"@omnifyjp/omnify-win32-x64": "5.8.
|
|
39
|
+
"@omnifyjp/omnify-darwin-arm64": "5.8.13",
|
|
40
|
+
"@omnifyjp/omnify-darwin-x64": "5.8.13",
|
|
41
|
+
"@omnifyjp/omnify-linux-x64": "5.8.13",
|
|
42
|
+
"@omnifyjp/omnify-linux-arm64": "5.8.13",
|
|
43
|
+
"@omnifyjp/omnify-win32-x64": "5.8.13"
|
|
44
44
|
}
|
|
45
45
|
}
|
|
@@ -46,13 +46,19 @@ function generateForSchema(name, schema, reader, config) {
|
|
|
46
46
|
function generateBasePolicyClass(name, schema, reader, config) {
|
|
47
47
|
const modelName = toPascalCase(name);
|
|
48
48
|
const baseNamespace = resolveModularBaseNamespace(config, name, 'Policies', config.policies.baseNamespace);
|
|
49
|
-
// Issue #98 v5.8.
|
|
50
|
-
//
|
|
51
|
-
//
|
|
52
|
-
//
|
|
49
|
+
// Issue #98 v5.8.13: policy method signatures (`view(User $user,
|
|
50
|
+
// <Model> $record): bool`) must type-hint the USER-EDITABLE Model
|
|
51
|
+
// class. Same root cause + fix as the v5.8.11 service / controller
|
|
52
|
+
// signature fix — when the user-editable policy child overrides a
|
|
53
|
+
// base method with the editable Model type, PHP signature
|
|
54
|
+
// contravariance fires with a Fatal compile error if the parent
|
|
55
|
+
// typed against the BASE Model. Modular structure: per-Schema
|
|
56
|
+
// isolation already aligns base + editable on one namespace.
|
|
53
57
|
const modelNamespace = config.structure === 'modular'
|
|
54
58
|
? config.models.namespace
|
|
55
|
-
:
|
|
59
|
+
: (config.models.userEditableGroupByFolder
|
|
60
|
+
? nestByGroup({ path: '', namespace: config.models.userEditableNamespace }, schema.group).namespace
|
|
61
|
+
: config.models.userEditableNamespace);
|
|
56
62
|
const policies = schema.policies;
|
|
57
63
|
const hasSoftDelete = schema.options?.softDelete ?? false;
|
|
58
64
|
const needsCidrHelper = policiesUseCidr(policies);
|