From 667ab84f2eb652acbf68cffb02ef7aa51bea25c4 Mon Sep 17 00:00:00 2001 From: Julian Krauser Date: Thu, 16 Jan 2025 13:51:32 +0100 Subject: [PATCH] date / datetime to lists --- .../article/content-types/article/schema.json | 12 +++- .../collection-lookup/schema.json | 6 +- src/api/event/content-types/event/schema.json | 12 +++- .../content-types/operation/schema.json | 12 +++- .../vehicle/content-types/vehicle/schema.json | 15 +++-- .../1.0.0/full_documentation.json | 62 +++++++++++++------ types/generated/contentTypes.d.ts | 12 ++-- 7 files changed, 91 insertions(+), 40 deletions(-) diff --git a/src/api/article/content-types/article/schema.json b/src/api/article/content-types/article/schema.json index 82cdd58..f624d5b 100644 --- a/src/api/article/content-types/article/schema.json +++ b/src/api/article/content-types/article/schema.json @@ -35,19 +35,25 @@ "image": { "type": "media", "multiple": false, - "allowedTypes": ["images"], + "required": false, + "allowedTypes": [ + "images" + ], "pluginOptions": {} }, "attachment": { "type": "media", "multiple": true, "required": false, - "allowedTypes": ["images"], + "allowedTypes": [ + "images" + ], "pluginOptions": {} }, "date": { "pluginOptions": {}, - "type": "date" + "type": "date", + "required": true } } } diff --git a/src/api/collection-lookup/content-types/collection-lookup/schema.json b/src/api/collection-lookup/content-types/collection-lookup/schema.json index 80508ba..27e3ac5 100644 --- a/src/api/collection-lookup/content-types/collection-lookup/schema.json +++ b/src/api/collection-lookup/content-types/collection-lookup/schema.json @@ -18,9 +18,9 @@ "unique": true }, "collection": { - "type": "string", - "required": true, - "unique": true + "type": "enumeration", + "enum": ["events", "vehicles", "articles", "operations"], + "required": true }, "image_item": { "type": "boolean", diff --git a/src/api/event/content-types/event/schema.json b/src/api/event/content-types/event/schema.json index dce0824..a15bfb1 100644 --- a/src/api/event/content-types/event/schema.json +++ b/src/api/event/content-types/event/schema.json @@ -35,19 +35,25 @@ "image": { "type": "media", "multiple": false, - "allowedTypes": ["images"], + "required": false, + "allowedTypes": [ + "images" + ], "pluginOptions": {} }, "attachment": { "type": "media", "multiple": true, "required": false, - "allowedTypes": ["images"], + "allowedTypes": [ + "images" + ], "pluginOptions": {} }, "date": { "pluginOptions": {}, - "type": "date" + "type": "datetime", + "required": true } } } diff --git a/src/api/operation/content-types/operation/schema.json b/src/api/operation/content-types/operation/schema.json index 3947b37..f8320b5 100644 --- a/src/api/operation/content-types/operation/schema.json +++ b/src/api/operation/content-types/operation/schema.json @@ -35,19 +35,25 @@ "image": { "type": "media", "multiple": false, - "allowedTypes": ["images"], + "required": false, + "allowedTypes": [ + "images" + ], "pluginOptions": {} }, "attachment": { "type": "media", "multiple": true, "required": false, - "allowedTypes": ["images"], + "allowedTypes": [ + "images" + ], "pluginOptions": {} }, "date": { "pluginOptions": {}, - "type": "date" + "type": "datetime", + "required": true } } } diff --git a/src/api/vehicle/content-types/vehicle/schema.json b/src/api/vehicle/content-types/vehicle/schema.json index 90c068c..5ca135f 100644 --- a/src/api/vehicle/content-types/vehicle/schema.json +++ b/src/api/vehicle/content-types/vehicle/schema.json @@ -4,7 +4,8 @@ "info": { "singularName": "vehicle", "pluralName": "vehicles", - "displayName": "Fahrzeuge" + "displayName": "Fahrzeuge", + "description": "" }, "options": { "draftAndPublish": true @@ -34,19 +35,25 @@ "image": { "type": "media", "multiple": false, - "allowedTypes": ["images"], + "required": false, + "allowedTypes": [ + "images" + ], "pluginOptions": {} }, "attachment": { "type": "media", "multiple": true, "required": false, - "allowedTypes": ["images"], + "allowedTypes": [ + "images" + ], "pluginOptions": {} }, "date": { "pluginOptions": {}, - "type": "date" + "type": "datetime", + "required": false } } } diff --git a/src/extensions/documentation/documentation/1.0.0/full_documentation.json b/src/extensions/documentation/documentation/1.0.0/full_documentation.json index 9789a15..3a42929 100644 --- a/src/extensions/documentation/documentation/1.0.0/full_documentation.json +++ b/src/extensions/documentation/documentation/1.0.0/full_documentation.json @@ -14,7 +14,7 @@ "name": "Apache 2.0", "url": "https://www.apache.org/licenses/LICENSE-2.0.html" }, - "x-generation-date": "2025-01-14T08:03:38.856Z" + "x-generation-date": "2025-01-16T12:40:38.072Z" }, "x-strapi-config": { "plugins": [ @@ -5182,7 +5182,8 @@ "required": [ "title", "description", - "slug" + "slug", + "date" ], "type": "object", "properties": { @@ -5286,7 +5287,8 @@ "required": [ "title", "description", - "slug" + "slug", + "date" ], "properties": { "id": { @@ -6450,7 +6452,13 @@ "type": "string" }, "collection": { - "type": "string" + "type": "string", + "enum": [ + "events", + "vehicles", + "articles", + "operations" + ] }, "image_item": { "type": "boolean" @@ -6541,7 +6549,13 @@ "type": "string" }, "collection": { - "type": "string" + "type": "string", + "enum": [ + "events", + "vehicles", + "articles", + "operations" + ] }, "image_item": { "type": "boolean" @@ -6859,7 +6873,13 @@ "type": "string" }, "collection": { - "type": "string" + "type": "string", + "enum": [ + "events", + "vehicles", + "articles", + "operations" + ] }, "image_item": { "type": "boolean" @@ -6950,7 +6970,8 @@ "required": [ "title", "description", - "slug" + "slug", + "date" ], "type": "object", "properties": { @@ -6991,7 +7012,7 @@ }, "date": { "type": "string", - "format": "date" + "format": "date-time" }, "locale": { "type": "string" @@ -7054,7 +7075,8 @@ "required": [ "title", "description", - "slug" + "slug", + "date" ], "properties": { "id": { @@ -7805,7 +7827,7 @@ }, "date": { "type": "string", - "format": "date" + "format": "date-time" }, "createdAt": { "type": "string", @@ -8128,7 +8150,7 @@ }, "date": { "type": "string", - "format": "date" + "format": "date-time" }, "createdAt": { "type": "string", @@ -10416,7 +10438,8 @@ "required": [ "title", "description", - "slug" + "slug", + "date" ], "type": "object", "properties": { @@ -10457,7 +10480,7 @@ }, "date": { "type": "string", - "format": "date" + "format": "date-time" }, "locale": { "type": "string" @@ -10520,7 +10543,8 @@ "required": [ "title", "description", - "slug" + "slug", + "date" ], "properties": { "id": { @@ -11271,7 +11295,7 @@ }, "date": { "type": "string", - "format": "date" + "format": "date-time" }, "createdAt": { "type": "string", @@ -11594,7 +11618,7 @@ }, "date": { "type": "string", - "format": "date" + "format": "date-time" }, "createdAt": { "type": "string", @@ -12058,7 +12082,7 @@ }, "date": { "type": "string", - "format": "date" + "format": "date-time" }, "locale": { "type": "string" @@ -12872,7 +12896,7 @@ }, "date": { "type": "string", - "format": "date" + "format": "date-time" }, "createdAt": { "type": "string", @@ -13195,7 +13219,7 @@ }, "date": { "type": "string", - "format": "date" + "format": "date-time" }, "createdAt": { "type": "string", diff --git a/types/generated/contentTypes.d.ts b/types/generated/contentTypes.d.ts index 0ca5e01..a015f73 100644 --- a/types/generated/contentTypes.d.ts +++ b/types/generated/contentTypes.d.ts @@ -344,7 +344,7 @@ export interface ApiArticleArticle extends Struct.CollectionTypeSchema { content: Schema.Attribute.Blocks; createdAt: Schema.Attribute.DateTime; createdBy: Schema.Attribute.Relation<"oneToOne", "admin::user"> & Schema.Attribute.Private; - date: Schema.Attribute.Date; + date: Schema.Attribute.Date & Schema.Attribute.Required; description: Schema.Attribute.String & Schema.Attribute.Required; image: Schema.Attribute.Media<"images">; locale: Schema.Attribute.String & Schema.Attribute.Private; @@ -369,7 +369,8 @@ export interface ApiCollectionLookupCollectionLookup extends Struct.CollectionTy draftAndPublish: true; }; attributes: { - collection: Schema.Attribute.String & Schema.Attribute.Required & Schema.Attribute.Unique; + collection: Schema.Attribute.Enumeration<["events", "vehicles", "articles", "operations"]> & + Schema.Attribute.Required; createdAt: Schema.Attribute.DateTime; createdBy: Schema.Attribute.Relation<"oneToOne", "admin::user"> & Schema.Attribute.Private; date_list: Schema.Attribute.Boolean & Schema.Attribute.Required & Schema.Attribute.DefaultTo; @@ -402,7 +403,7 @@ export interface ApiEventEvent extends Struct.CollectionTypeSchema { content: Schema.Attribute.Blocks; createdAt: Schema.Attribute.DateTime; createdBy: Schema.Attribute.Relation<"oneToOne", "admin::user"> & Schema.Attribute.Private; - date: Schema.Attribute.Date; + date: Schema.Attribute.DateTime & Schema.Attribute.Required; description: Schema.Attribute.String & Schema.Attribute.Required; image: Schema.Attribute.Media<"images">; locale: Schema.Attribute.String & Schema.Attribute.Private; @@ -490,7 +491,7 @@ export interface ApiOperationOperation extends Struct.CollectionTypeSchema { content: Schema.Attribute.Blocks; createdAt: Schema.Attribute.DateTime; createdBy: Schema.Attribute.Relation<"oneToOne", "admin::user"> & Schema.Attribute.Private; - date: Schema.Attribute.Date; + date: Schema.Attribute.DateTime & Schema.Attribute.Required; description: Schema.Attribute.String & Schema.Attribute.Required; image: Schema.Attribute.Media<"images">; locale: Schema.Attribute.String & Schema.Attribute.Private; @@ -542,6 +543,7 @@ export interface ApiPagePage extends Struct.CollectionTypeSchema { export interface ApiVehicleVehicle extends Struct.CollectionTypeSchema { collectionName: "vehicles"; info: { + description: ""; displayName: "Fahrzeuge"; pluralName: "vehicles"; singularName: "vehicle"; @@ -554,7 +556,7 @@ export interface ApiVehicleVehicle extends Struct.CollectionTypeSchema { content: Schema.Attribute.Blocks; createdAt: Schema.Attribute.DateTime; createdBy: Schema.Attribute.Relation<"oneToOne", "admin::user"> & Schema.Attribute.Private; - date: Schema.Attribute.Date; + date: Schema.Attribute.DateTime; description: Schema.Attribute.String & Schema.Attribute.Required; image: Schema.Attribute.Media<"images">; locale: Schema.Attribute.String & Schema.Attribute.Private;