@famgia/omnify-types 0.0.39 → 0.0.41
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/index.d.cts +22 -0
- package/dist/index.d.ts +22 -0
- package/package.json +1 -1
- package/schemas/omnify-schema.json +31 -0
package/dist/index.d.cts
CHANGED
|
@@ -250,6 +250,28 @@ interface BasePropertyDefinition {
|
|
|
250
250
|
readonly renamedFrom?: string;
|
|
251
251
|
/** Validation rules (application-level only, NOT database) */
|
|
252
252
|
readonly rules?: ValidationRules;
|
|
253
|
+
/**
|
|
254
|
+
* Whether this field is the primary key.
|
|
255
|
+
* Use with `id: false` in schema options to create tables with custom primary keys.
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* ```yaml
|
|
259
|
+
* # Schema with custom string primary key (like Laravel's cache table)
|
|
260
|
+
* Cache:
|
|
261
|
+
* options:
|
|
262
|
+
* id: false # Disable auto-generated id column
|
|
263
|
+
* timestamps: false
|
|
264
|
+
* properties:
|
|
265
|
+
* key:
|
|
266
|
+
* type: String
|
|
267
|
+
* primary: true # This becomes the primary key
|
|
268
|
+
* value:
|
|
269
|
+
* type: Text
|
|
270
|
+
* expiration:
|
|
271
|
+
* type: Int
|
|
272
|
+
* ```
|
|
273
|
+
*/
|
|
274
|
+
readonly primary?: boolean;
|
|
253
275
|
/**
|
|
254
276
|
* Whether this field should be hidden in API responses/serialization.
|
|
255
277
|
* In Laravel, this adds the field to the $hidden array.
|
package/dist/index.d.ts
CHANGED
|
@@ -250,6 +250,28 @@ interface BasePropertyDefinition {
|
|
|
250
250
|
readonly renamedFrom?: string;
|
|
251
251
|
/** Validation rules (application-level only, NOT database) */
|
|
252
252
|
readonly rules?: ValidationRules;
|
|
253
|
+
/**
|
|
254
|
+
* Whether this field is the primary key.
|
|
255
|
+
* Use with `id: false` in schema options to create tables with custom primary keys.
|
|
256
|
+
*
|
|
257
|
+
* @example
|
|
258
|
+
* ```yaml
|
|
259
|
+
* # Schema with custom string primary key (like Laravel's cache table)
|
|
260
|
+
* Cache:
|
|
261
|
+
* options:
|
|
262
|
+
* id: false # Disable auto-generated id column
|
|
263
|
+
* timestamps: false
|
|
264
|
+
* properties:
|
|
265
|
+
* key:
|
|
266
|
+
* type: String
|
|
267
|
+
* primary: true # This becomes the primary key
|
|
268
|
+
* value:
|
|
269
|
+
* type: Text
|
|
270
|
+
* expiration:
|
|
271
|
+
* type: Int
|
|
272
|
+
* ```
|
|
273
|
+
*/
|
|
274
|
+
readonly primary?: boolean;
|
|
253
275
|
/**
|
|
254
276
|
* Whether this field should be hidden in API responses/serialization.
|
|
255
277
|
* In Laravel, this adds the field to the $hidden array.
|
package/package.json
CHANGED
|
@@ -183,6 +183,11 @@
|
|
|
183
183
|
"default": false,
|
|
184
184
|
"description": "Whether this field must be unique"
|
|
185
185
|
},
|
|
186
|
+
"primary": {
|
|
187
|
+
"type": "boolean",
|
|
188
|
+
"default": false,
|
|
189
|
+
"description": "Whether this field is the primary key. Use with options.id: false for tables with custom primary keys (e.g., cache tables)"
|
|
190
|
+
},
|
|
186
191
|
"default": {
|
|
187
192
|
"description": "Default value for the field"
|
|
188
193
|
},
|
|
@@ -535,6 +540,32 @@
|
|
|
535
540
|
{ "value": "published", "label": { "ja": "公開済み", "en": "Published" } },
|
|
536
541
|
{ "value": "archived", "label": { "ja": "アーカイブ", "en": "Archived" } }
|
|
537
542
|
]
|
|
543
|
+
},
|
|
544
|
+
{
|
|
545
|
+
"name": "Cache",
|
|
546
|
+
"displayName": {
|
|
547
|
+
"ja": "キャッシュ",
|
|
548
|
+
"en": "Cache"
|
|
549
|
+
},
|
|
550
|
+
"options": {
|
|
551
|
+
"id": false,
|
|
552
|
+
"timestamps": false
|
|
553
|
+
},
|
|
554
|
+
"properties": {
|
|
555
|
+
"key": {
|
|
556
|
+
"type": "String",
|
|
557
|
+
"primary": true,
|
|
558
|
+
"displayName": { "ja": "キー", "en": "Key" }
|
|
559
|
+
},
|
|
560
|
+
"value": {
|
|
561
|
+
"type": "Text",
|
|
562
|
+
"displayName": { "ja": "値", "en": "Value" }
|
|
563
|
+
},
|
|
564
|
+
"expiration": {
|
|
565
|
+
"type": "Int",
|
|
566
|
+
"displayName": { "ja": "有効期限", "en": "Expiration" }
|
|
567
|
+
}
|
|
568
|
+
}
|
|
538
569
|
}
|
|
539
570
|
]
|
|
540
571
|
}
|