@notty/types 0.2.13 → 0.7.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/dist/index.cjs CHANGED
@@ -66,6 +66,19 @@ var exampleSchema = {
66
66
  type: "relation",
67
67
  relation: "manyToMany",
68
68
  target: "categories"
69
+ },
70
+ // Media field examples
71
+ cover: {
72
+ type: "media",
73
+ allowedTypes: ["images"],
74
+ multiple: false
75
+ // single image
76
+ },
77
+ gallery: {
78
+ type: "media",
79
+ allowedTypes: ["images", "videos"],
80
+ multiple: true
81
+ // multiple media
69
82
  }
70
83
  }
71
84
  };
package/dist/index.d.cts CHANGED
@@ -65,6 +65,10 @@ interface ThemeConfig {
65
65
  * ACms Universal Schema Format
66
66
  * Аналог Strapi schema, но адаптированный для Drizzle
67
67
  */
68
+ /**
69
+ * Allowed media types for media field
70
+ */
71
+ type MediaType = 'images' | 'videos' | 'audios' | 'files';
68
72
  type FieldType = 'string' | 'text' | 'richtext' | 'integer' | 'bigint' | 'decimal' | 'boolean' | 'date' | 'datetime' | 'json' | 'enum' | 'relation' | 'component' | 'media';
69
73
  interface ACmsField {
70
74
  type: FieldType;
@@ -83,6 +87,8 @@ interface ACmsField {
83
87
  onDelete?: 'CASCADE' | 'SET NULL' | 'RESTRICT';
84
88
  component?: string;
85
89
  repeatable?: boolean;
90
+ allowedTypes?: MediaType[];
91
+ multiple?: boolean;
86
92
  index?: boolean | 'unique' | 'fulltext';
87
93
  foreignKey?: {
88
94
  table: string;
@@ -221,4 +227,4 @@ interface RollbackResult {
221
227
  errors?: string[];
222
228
  }
223
229
 
224
- export { type ACmsField, type ACmsSchema, type ContentEntry, type FieldType, type Migration, type MigrationDatabaseConnection, type MigrationRecord, type MigrationResult, type MigrationStatus, type MySQLMigrationConnection, type Plugin, type PluginHooks, type PostgresMigrationConnection, type QueryOptions, type RollbackResult, type SQLiteMigrationConnection, SchemaValidationError, type Theme, type ThemeConfig, type User, type ValidationError, type ValidationErrorCode, type ValidationResult, exampleSchema };
230
+ export { type ACmsField, type ACmsSchema, type ContentEntry, type FieldType, type MediaType, type Migration, type MigrationDatabaseConnection, type MigrationRecord, type MigrationResult, type MigrationStatus, type MySQLMigrationConnection, type Plugin, type PluginHooks, type PostgresMigrationConnection, type QueryOptions, type RollbackResult, type SQLiteMigrationConnection, SchemaValidationError, type Theme, type ThemeConfig, type User, type ValidationError, type ValidationErrorCode, type ValidationResult, exampleSchema };
package/dist/index.d.ts CHANGED
@@ -65,6 +65,10 @@ interface ThemeConfig {
65
65
  * ACms Universal Schema Format
66
66
  * Аналог Strapi schema, но адаптированный для Drizzle
67
67
  */
68
+ /**
69
+ * Allowed media types for media field
70
+ */
71
+ type MediaType = 'images' | 'videos' | 'audios' | 'files';
68
72
  type FieldType = 'string' | 'text' | 'richtext' | 'integer' | 'bigint' | 'decimal' | 'boolean' | 'date' | 'datetime' | 'json' | 'enum' | 'relation' | 'component' | 'media';
69
73
  interface ACmsField {
70
74
  type: FieldType;
@@ -83,6 +87,8 @@ interface ACmsField {
83
87
  onDelete?: 'CASCADE' | 'SET NULL' | 'RESTRICT';
84
88
  component?: string;
85
89
  repeatable?: boolean;
90
+ allowedTypes?: MediaType[];
91
+ multiple?: boolean;
86
92
  index?: boolean | 'unique' | 'fulltext';
87
93
  foreignKey?: {
88
94
  table: string;
@@ -221,4 +227,4 @@ interface RollbackResult {
221
227
  errors?: string[];
222
228
  }
223
229
 
224
- export { type ACmsField, type ACmsSchema, type ContentEntry, type FieldType, type Migration, type MigrationDatabaseConnection, type MigrationRecord, type MigrationResult, type MigrationStatus, type MySQLMigrationConnection, type Plugin, type PluginHooks, type PostgresMigrationConnection, type QueryOptions, type RollbackResult, type SQLiteMigrationConnection, SchemaValidationError, type Theme, type ThemeConfig, type User, type ValidationError, type ValidationErrorCode, type ValidationResult, exampleSchema };
230
+ export { type ACmsField, type ACmsSchema, type ContentEntry, type FieldType, type MediaType, type Migration, type MigrationDatabaseConnection, type MigrationRecord, type MigrationResult, type MigrationStatus, type MySQLMigrationConnection, type Plugin, type PluginHooks, type PostgresMigrationConnection, type QueryOptions, type RollbackResult, type SQLiteMigrationConnection, SchemaValidationError, type Theme, type ThemeConfig, type User, type ValidationError, type ValidationErrorCode, type ValidationResult, exampleSchema };
package/dist/index.js CHANGED
@@ -39,6 +39,19 @@ var exampleSchema = {
39
39
  type: "relation",
40
40
  relation: "manyToMany",
41
41
  target: "categories"
42
+ },
43
+ // Media field examples
44
+ cover: {
45
+ type: "media",
46
+ allowedTypes: ["images"],
47
+ multiple: false
48
+ // single image
49
+ },
50
+ gallery: {
51
+ type: "media",
52
+ allowedTypes: ["images", "videos"],
53
+ multiple: true
54
+ // multiple media
42
55
  }
43
56
  }
44
57
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@notty/types",
3
- "version": "0.2.13",
3
+ "version": "0.7.1",
4
4
  "description": "Shared TypeScript types for Notty CMS",
5
5
  "type": "module",
6
6
  "main": "./dist/index.cjs",