@omnifyjp/omnify 4.5.2 → 4.6.1
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/omnify-config-schema.json +397 -0
- package/omnify-schema.json +1195 -0
- package/package.json +7 -7
|
@@ -0,0 +1,397 @@
|
|
|
1
|
+
{
|
|
2
|
+
"$schema": "http://json-schema.org/draft-07/schema#",
|
|
3
|
+
"$id": "https://omnify.dev/schemas/omnify-config-schema.json",
|
|
4
|
+
"title": "Omnify Configuration",
|
|
5
|
+
"description": "Configuration file for Omnify (omnify.yaml)",
|
|
6
|
+
"type": "object",
|
|
7
|
+
"properties": {
|
|
8
|
+
"input": {
|
|
9
|
+
"type": "string",
|
|
10
|
+
"description": "Consumer-mode shortcut: path/URL/npm-spec for an upstream schemas.json. When set, omnify-ts skips the connections+migrations indirection and uses this value directly. Accepts a local path (relative to this file), an http(s) URL (cached + pinned via .omnify/input.lock.json), or a scoped npm package specifier (e.g. '@famgia/dxs-product-schemas/schemas.json'). Frontend / consumer projects should use this; backend projects use schemasDir + connections instead."
|
|
11
|
+
},
|
|
12
|
+
"package": {
|
|
13
|
+
"type": "boolean",
|
|
14
|
+
"default": false,
|
|
15
|
+
"description": "Enable package mode: use stable deterministic timestamps for all Laravel migration outputs so the same schema produces the same filenames on every machine. Shorthand for setting `stableTimestamps: true` on every migration config. Issue #60."
|
|
16
|
+
},
|
|
17
|
+
"schemasDir": {
|
|
18
|
+
"type": "string",
|
|
19
|
+
"default": "./schemas",
|
|
20
|
+
"description": "Directory containing schema YAML files"
|
|
21
|
+
},
|
|
22
|
+
"packages": {
|
|
23
|
+
"type": "array",
|
|
24
|
+
"items": {
|
|
25
|
+
"$ref": "#/definitions/PackageConfig"
|
|
26
|
+
},
|
|
27
|
+
"description": "External schema packages to consume (short form: path only, long form: explicit schemasDir + lockFile)"
|
|
28
|
+
},
|
|
29
|
+
"lockFilePath": {
|
|
30
|
+
"type": "string",
|
|
31
|
+
"default": ".omnify/lock.json",
|
|
32
|
+
"description": "Path to the lock file for tracking migration state"
|
|
33
|
+
},
|
|
34
|
+
"connections": {
|
|
35
|
+
"type": "object",
|
|
36
|
+
"additionalProperties": {
|
|
37
|
+
"$ref": "#/definitions/Connection"
|
|
38
|
+
},
|
|
39
|
+
"description": "Database connection configurations"
|
|
40
|
+
},
|
|
41
|
+
"default": {
|
|
42
|
+
"type": "string",
|
|
43
|
+
"default": "default",
|
|
44
|
+
"description": "Default connection name"
|
|
45
|
+
},
|
|
46
|
+
"locale": {
|
|
47
|
+
"$ref": "#/definitions/Locale",
|
|
48
|
+
"description": "Locale settings for multi-language support"
|
|
49
|
+
},
|
|
50
|
+
"compoundTypes": {
|
|
51
|
+
"type": "array",
|
|
52
|
+
"items": {
|
|
53
|
+
"type": "string",
|
|
54
|
+
"enum": ["japan"]
|
|
55
|
+
},
|
|
56
|
+
"description": "Built-in compound type packs to enable (e.g., 'japan' for JapaneseName, JapaneseAddress)"
|
|
57
|
+
},
|
|
58
|
+
"codegen": {
|
|
59
|
+
"$ref": "#/definitions/Codegen",
|
|
60
|
+
"description": "Code generation configuration (connection-independent, reads schemas.json)"
|
|
61
|
+
},
|
|
62
|
+
"file": {
|
|
63
|
+
"$ref": "#/definitions/FileConfig",
|
|
64
|
+
"description": "File upload configuration for polymorphic file attachments"
|
|
65
|
+
},
|
|
66
|
+
"verbose": {
|
|
67
|
+
"type": "boolean",
|
|
68
|
+
"default": false,
|
|
69
|
+
"description": "Enable verbose output during generation"
|
|
70
|
+
}
|
|
71
|
+
},
|
|
72
|
+
"definitions": {
|
|
73
|
+
"FileConfig": {
|
|
74
|
+
"type": "object",
|
|
75
|
+
"additionalProperties": false,
|
|
76
|
+
"properties": {
|
|
77
|
+
"tempFlow": {
|
|
78
|
+
"type": "boolean",
|
|
79
|
+
"default": false,
|
|
80
|
+
"description": "Enable temporary → permanent file upload flow"
|
|
81
|
+
},
|
|
82
|
+
"tempTtl": {
|
|
83
|
+
"type": "string",
|
|
84
|
+
"description": "Temporary file TTL (e.g., '24h', '12h')"
|
|
85
|
+
},
|
|
86
|
+
"cleanupSchedule": {
|
|
87
|
+
"type": "string",
|
|
88
|
+
"description": "Phase 1 schedule: soft-delete expired temp records (e.g., 'hourly')"
|
|
89
|
+
},
|
|
90
|
+
"purgeAfter": {
|
|
91
|
+
"type": "string",
|
|
92
|
+
"description": "Grace period before physical file deletion (e.g., '72h')"
|
|
93
|
+
},
|
|
94
|
+
"purgeSchedule": {
|
|
95
|
+
"type": "string",
|
|
96
|
+
"description": "Phase 2 schedule: force-delete + remove physical files (e.g., 'daily')"
|
|
97
|
+
},
|
|
98
|
+
"defaultDisk": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"description": "Default storage disk (e.g., 'public', 's3', 'local')"
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
},
|
|
104
|
+
"PackageConfig": {
|
|
105
|
+
"type": "object",
|
|
106
|
+
"properties": {
|
|
107
|
+
"path": {
|
|
108
|
+
"type": "string",
|
|
109
|
+
"description": "Path to the package root directory (short form: auto-discovers omnify.yaml inside)"
|
|
110
|
+
},
|
|
111
|
+
"name": {
|
|
112
|
+
"type": "string",
|
|
113
|
+
"description": "Package identifier. Defaults to directory basename (short form) or required (long form)"
|
|
114
|
+
},
|
|
115
|
+
"schemasDir": {
|
|
116
|
+
"type": "string",
|
|
117
|
+
"description": "Path to schemas directory (long form only, required when path is not set)"
|
|
118
|
+
},
|
|
119
|
+
"lockFile": {
|
|
120
|
+
"type": "string",
|
|
121
|
+
"description": "Path to package lock file (long form only, required when path is not set)"
|
|
122
|
+
},
|
|
123
|
+
"codegen": {
|
|
124
|
+
"$ref": "#/definitions/Codegen",
|
|
125
|
+
"description": "Codegen overrides for this package (merged with package's own codegen config)"
|
|
126
|
+
}
|
|
127
|
+
}
|
|
128
|
+
},
|
|
129
|
+
"Connection": {
|
|
130
|
+
"type": "object",
|
|
131
|
+
"required": ["driver"],
|
|
132
|
+
"properties": {
|
|
133
|
+
"driver": {
|
|
134
|
+
"type": "string",
|
|
135
|
+
"enum": ["mysql", "pgsql", "postgres", "sqlite"],
|
|
136
|
+
"description": "Database driver"
|
|
137
|
+
},
|
|
138
|
+
"migrations": {
|
|
139
|
+
"type": "array",
|
|
140
|
+
"items": {
|
|
141
|
+
"$ref": "#/definitions/Migration"
|
|
142
|
+
},
|
|
143
|
+
"description": "Migration output configurations"
|
|
144
|
+
}
|
|
145
|
+
}
|
|
146
|
+
},
|
|
147
|
+
"Migration": {
|
|
148
|
+
"type": "object",
|
|
149
|
+
"required": ["type", "path"],
|
|
150
|
+
"properties": {
|
|
151
|
+
"type": {
|
|
152
|
+
"type": "string",
|
|
153
|
+
"enum": ["laravel", "sql"],
|
|
154
|
+
"description": "Migration output type"
|
|
155
|
+
},
|
|
156
|
+
"path": {
|
|
157
|
+
"type": "string",
|
|
158
|
+
"description": "Output directory for migration files"
|
|
159
|
+
},
|
|
160
|
+
"schemasPath": {
|
|
161
|
+
"type": "string",
|
|
162
|
+
"description": "Path for exported schemas JSON (laravel only)"
|
|
163
|
+
},
|
|
164
|
+
"dialect": {
|
|
165
|
+
"type": "string",
|
|
166
|
+
"enum": ["mysql", "postgresql", "sqlite"],
|
|
167
|
+
"description": "SQL dialect for generated migrations (sql only)"
|
|
168
|
+
},
|
|
169
|
+
"stableTimestamps": {
|
|
170
|
+
"type": "boolean",
|
|
171
|
+
"default": false,
|
|
172
|
+
"description": "Use deterministic timestamps derived from schema order instead of clock time. For packages published to Packagist — ensures identical filenames on every machine. Timestamps use a fixed year-2000 base so they always sort before consumer migrations. Issue #60."
|
|
173
|
+
},
|
|
174
|
+
"options": {
|
|
175
|
+
"type": "object",
|
|
176
|
+
"additionalProperties": false,
|
|
177
|
+
"properties": {
|
|
178
|
+
"enumStrategy": {
|
|
179
|
+
"type": "string",
|
|
180
|
+
"enum": ["string", "native", "conditional"],
|
|
181
|
+
"default": "string",
|
|
182
|
+
"description": "Enum column strategy: 'string' (cross-DB, default), 'native' (MySQL ENUM), or 'conditional' (runtime if/else)"
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
}
|
|
186
|
+
},
|
|
187
|
+
"allOf": [
|
|
188
|
+
{
|
|
189
|
+
"if": {
|
|
190
|
+
"properties": { "type": { "const": "laravel" } }
|
|
191
|
+
},
|
|
192
|
+
"then": {
|
|
193
|
+
"properties": {
|
|
194
|
+
"schemasPath": { "type": "string" }
|
|
195
|
+
}
|
|
196
|
+
}
|
|
197
|
+
},
|
|
198
|
+
{
|
|
199
|
+
"if": {
|
|
200
|
+
"properties": { "type": { "const": "sql" } }
|
|
201
|
+
},
|
|
202
|
+
"then": {
|
|
203
|
+
"properties": {
|
|
204
|
+
"dialect": { "type": "string", "enum": ["mysql", "postgresql", "sqlite"] }
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
]
|
|
209
|
+
},
|
|
210
|
+
"Codegen": {
|
|
211
|
+
"type": "object",
|
|
212
|
+
"properties": {
|
|
213
|
+
"typescript": {
|
|
214
|
+
"description": "TypeScript codegen configuration. Single-target legacy form (object) or multi-target form (array of named targets). Issue #43.",
|
|
215
|
+
"oneOf": [
|
|
216
|
+
{ "$ref": "#/definitions/CodegenTypeScript" },
|
|
217
|
+
{
|
|
218
|
+
"type": "array",
|
|
219
|
+
"items": { "$ref": "#/definitions/CodegenTypeScript" }
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
},
|
|
223
|
+
"laravel": {
|
|
224
|
+
"description": "Laravel PHP codegen configuration. Single-target legacy form (object) or multi-target form (array of named targets). Issue #43.",
|
|
225
|
+
"oneOf": [
|
|
226
|
+
{ "$ref": "#/definitions/CodegenLaravel" },
|
|
227
|
+
{
|
|
228
|
+
"type": "array",
|
|
229
|
+
"items": { "$ref": "#/definitions/CodegenLaravel" }
|
|
230
|
+
}
|
|
231
|
+
]
|
|
232
|
+
}
|
|
233
|
+
}
|
|
234
|
+
},
|
|
235
|
+
"CodegenTypeScript": {
|
|
236
|
+
"type": "object",
|
|
237
|
+
"properties": {
|
|
238
|
+
"name": {
|
|
239
|
+
"type": "string",
|
|
240
|
+
"description": "Target identifier (used by --target CLI flag in v2). Defaults to 'default' when omitted in legacy single-object form."
|
|
241
|
+
},
|
|
242
|
+
"enable": {
|
|
243
|
+
"type": "boolean",
|
|
244
|
+
"default": false,
|
|
245
|
+
"description": "Enable this TypeScript target. Defaults to false."
|
|
246
|
+
},
|
|
247
|
+
"modelsPath": {
|
|
248
|
+
"type": "string",
|
|
249
|
+
"description": "Output directory for generated TypeScript model files (legacy alias for `output`; either is accepted, `output` wins when both are set)"
|
|
250
|
+
},
|
|
251
|
+
"output": {
|
|
252
|
+
"type": "string",
|
|
253
|
+
"description": "Output directory for generated TypeScript model files. Preferred field name; symmetrical with the top-level `input` field used by consumer-mode configs."
|
|
254
|
+
},
|
|
255
|
+
"platform": {
|
|
256
|
+
"type": "string",
|
|
257
|
+
"enum": ["web", "expo"],
|
|
258
|
+
"default": "web",
|
|
259
|
+
"description": "Target runtime platform. 'web' (default) emits browser-friendly code; 'expo' adapts for React Native / Expo (AppState focusManager, async auth headers). Issue #63."
|
|
260
|
+
},
|
|
261
|
+
"auth": {
|
|
262
|
+
"type": "string",
|
|
263
|
+
"enum": ["cookie", "secureStore"],
|
|
264
|
+
"default": "cookie",
|
|
265
|
+
"description": "Auth header strategy for generated service layer. 'cookie' (default) uses browser cookies; 'secureStore' uses Expo SecureStore for async bearer token auth. Issue #63."
|
|
266
|
+
},
|
|
267
|
+
"includeGroups": {
|
|
268
|
+
"type": "array",
|
|
269
|
+
"items": { "type": "string" },
|
|
270
|
+
"description": "Schema groups to include in this target (e.g. ['Inventory', 'Product']). Combined with includeSchemas / excludeSchemas. Issue #43."
|
|
271
|
+
},
|
|
272
|
+
"includeSchemas": {
|
|
273
|
+
"type": "array",
|
|
274
|
+
"items": { "type": "string" },
|
|
275
|
+
"description": "Allow-list of schema names to include in this target. Combined with includeGroups."
|
|
276
|
+
},
|
|
277
|
+
"excludeSchemas": {
|
|
278
|
+
"type": "array",
|
|
279
|
+
"items": { "type": "string" },
|
|
280
|
+
"description": "Deny-list of schema names to exclude from this target (always overrides includes)."
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
},
|
|
284
|
+
"CodegenLaravel": {
|
|
285
|
+
"type": "object",
|
|
286
|
+
"properties": {
|
|
287
|
+
"name": {
|
|
288
|
+
"type": "string",
|
|
289
|
+
"description": "Target identifier (used by --target CLI flag in v2). Defaults to 'default' when omitted in legacy single-object form."
|
|
290
|
+
},
|
|
291
|
+
"includeGroups": {
|
|
292
|
+
"type": "array",
|
|
293
|
+
"items": { "type": "string" },
|
|
294
|
+
"description": "Schema groups to include in this target. Issue #43."
|
|
295
|
+
},
|
|
296
|
+
"includeSchemas": {
|
|
297
|
+
"type": "array",
|
|
298
|
+
"items": { "type": "string" },
|
|
299
|
+
"description": "Allow-list of schema names to include in this target."
|
|
300
|
+
},
|
|
301
|
+
"excludeSchemas": {
|
|
302
|
+
"type": "array",
|
|
303
|
+
"items": { "type": "string" },
|
|
304
|
+
"description": "Deny-list of schema names to exclude (overrides includes)."
|
|
305
|
+
},
|
|
306
|
+
"enable": {
|
|
307
|
+
"type": "boolean",
|
|
308
|
+
"default": false,
|
|
309
|
+
"description": "Enable Laravel PHP codegen. Defaults to false."
|
|
310
|
+
},
|
|
311
|
+
"rootPath": {
|
|
312
|
+
"type": "string",
|
|
313
|
+
"description": "Filesystem prefix applied to all generated paths. Use this for monorepo setups where Laravel lives in a subdirectory (e.g. 'backend' makes everything write under backend/app/...)."
|
|
314
|
+
},
|
|
315
|
+
"structure": {
|
|
316
|
+
"type": "string",
|
|
317
|
+
"enum": ["legacy", "modular"],
|
|
318
|
+
"default": "legacy",
|
|
319
|
+
"description": "Directory layout for generated base files. 'modular' uses app/Modules/{Schema}/."
|
|
320
|
+
},
|
|
321
|
+
"model": {
|
|
322
|
+
"$ref": "#/definitions/CodegenLaravelPath",
|
|
323
|
+
"description": "Model output configuration (default: app/Models/Omnify)"
|
|
324
|
+
},
|
|
325
|
+
"request": {
|
|
326
|
+
"$ref": "#/definitions/CodegenLaravelPath",
|
|
327
|
+
"description": "Request output configuration (default: app/Http/Requests)"
|
|
328
|
+
},
|
|
329
|
+
"resource": {
|
|
330
|
+
"$ref": "#/definitions/CodegenLaravelPath",
|
|
331
|
+
"description": "Resource output configuration (default: app/Http/Resources)"
|
|
332
|
+
},
|
|
333
|
+
"factory": {
|
|
334
|
+
"$ref": "#/definitions/CodegenLaravelPath",
|
|
335
|
+
"description": "Factory output configuration (default: database/factories)"
|
|
336
|
+
},
|
|
337
|
+
"provider": {
|
|
338
|
+
"$ref": "#/definitions/CodegenLaravelPath",
|
|
339
|
+
"description": "Provider output configuration (default: app/Providers)"
|
|
340
|
+
},
|
|
341
|
+
"policy": {
|
|
342
|
+
"$ref": "#/definitions/CodegenLaravelPath",
|
|
343
|
+
"description": "Policy output configuration (default: app/Policies/Omnify)"
|
|
344
|
+
},
|
|
345
|
+
"controller": {
|
|
346
|
+
"$ref": "#/definitions/CodegenLaravelPath",
|
|
347
|
+
"description": "Controller output configuration (default: app/Http/Controllers)"
|
|
348
|
+
},
|
|
349
|
+
"service": {
|
|
350
|
+
"$ref": "#/definitions/CodegenLaravelPath",
|
|
351
|
+
"description": "Service output configuration (default: app/Services)"
|
|
352
|
+
},
|
|
353
|
+
"route": {
|
|
354
|
+
"$ref": "#/definitions/CodegenLaravelPath",
|
|
355
|
+
"description": "Route file output configuration (default: routes/api/omnify)"
|
|
356
|
+
},
|
|
357
|
+
"config": {
|
|
358
|
+
"$ref": "#/definitions/CodegenLaravelPath",
|
|
359
|
+
"description": "Path for the omnify-schemas.php config file (default: config/omnify-schemas.php)"
|
|
360
|
+
}
|
|
361
|
+
}
|
|
362
|
+
},
|
|
363
|
+
"CodegenLaravelPath": {
|
|
364
|
+
"type": "object",
|
|
365
|
+
"properties": {
|
|
366
|
+
"path": {
|
|
367
|
+
"type": "string",
|
|
368
|
+
"description": "Output directory path"
|
|
369
|
+
},
|
|
370
|
+
"namespace": {
|
|
371
|
+
"type": "string",
|
|
372
|
+
"description": "PHP namespace (default: derived from path)"
|
|
373
|
+
}
|
|
374
|
+
}
|
|
375
|
+
},
|
|
376
|
+
"Locale": {
|
|
377
|
+
"type": "object",
|
|
378
|
+
"properties": {
|
|
379
|
+
"locales": {
|
|
380
|
+
"type": "array",
|
|
381
|
+
"items": {
|
|
382
|
+
"type": "string"
|
|
383
|
+
},
|
|
384
|
+
"description": "List of supported locale codes (e.g., ['ja', 'en', 'vi'])"
|
|
385
|
+
},
|
|
386
|
+
"defaultLocale": {
|
|
387
|
+
"type": "string",
|
|
388
|
+
"description": "Default locale code"
|
|
389
|
+
},
|
|
390
|
+
"fallbackLocale": {
|
|
391
|
+
"type": "string",
|
|
392
|
+
"description": "Fallback locale when translation is missing"
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
}
|