feat: extract cms from mp/cms — initial libreshop/cms
Some checks failed
Build and publish / build (push) Failing after 17s
Some checks failed
Build and publish / build (push) Failing after 17s
Source moved verbatim from mp/cms/ on 2026-04-29; mp was the first concrete adapter consuming the libreshop toolkit. Builds and publishes git.librete.ch/libreshop/cms on every main / v* push via the standard .gitea/workflows/build.yml shared across libreshop components.
This commit is contained in:
62
types/generated/components.d.ts
vendored
Normal file
62
types/generated/components.d.ts
vendored
Normal file
@@ -0,0 +1,62 @@
|
||||
import type { Attribute, Schema } from "@strapi/strapi";
|
||||
|
||||
export interface AddressStructuredAddress extends Schema.Component {
|
||||
collectionName: "components_address_structured_addresses";
|
||||
info: {
|
||||
description: "Address fields matching HTML autocomplete attributes";
|
||||
displayName: "Structured Address";
|
||||
};
|
||||
attributes: {
|
||||
addressLevel2: Attribute.String;
|
||||
country: Attribute.String & Attribute.DefaultTo<"DE">;
|
||||
familyName: Attribute.String;
|
||||
givenName: Attribute.String;
|
||||
postalCode: Attribute.String;
|
||||
streetAddress: Attribute.String;
|
||||
};
|
||||
}
|
||||
|
||||
export interface ProductsCart extends Schema.Component {
|
||||
collectionName: "components_products_carts";
|
||||
info: {
|
||||
description: "";
|
||||
displayName: "cart";
|
||||
icon: "stack";
|
||||
};
|
||||
attributes: {
|
||||
count: Attribute.Integer &
|
||||
Attribute.SetMinMax<
|
||||
{
|
||||
min: 1;
|
||||
},
|
||||
number
|
||||
> &
|
||||
Attribute.DefaultTo<1>;
|
||||
product: Attribute.Relation<"products.cart", "oneToOne", "api::product.product">;
|
||||
};
|
||||
}
|
||||
|
||||
export interface WebsitesWebsiteInMenu extends Schema.Component {
|
||||
collectionName: "components_websites_website_in_menus";
|
||||
info: {
|
||||
description: "";
|
||||
displayName: "Website in Menu";
|
||||
icon: "file";
|
||||
};
|
||||
attributes: {
|
||||
menu: Attribute.String & Attribute.Required;
|
||||
richtext: Attribute.Blocks;
|
||||
showInFooter: Attribute.Boolean & Attribute.DefaultTo<true>;
|
||||
showInHeader: Attribute.Boolean & Attribute.DefaultTo<true>;
|
||||
};
|
||||
}
|
||||
|
||||
declare module "@strapi/types" {
|
||||
export module Shared {
|
||||
export interface Components {
|
||||
"address.structured-address": AddressStructuredAddress;
|
||||
"products.cart": ProductsCart;
|
||||
"websites.website-in-menu": WebsitesWebsiteInMenu;
|
||||
}
|
||||
}
|
||||
}
|
||||
1001
types/generated/contentTypes.d.ts
vendored
Normal file
1001
types/generated/contentTypes.d.ts
vendored
Normal file
File diff suppressed because it is too large
Load Diff
72
types/index.ts
Normal file
72
types/index.ts
Normal file
@@ -0,0 +1,72 @@
|
||||
import { GetValues, GetPopulatableKeys, GetNonPopulatableKeys } from "@strapi/types/dist/types/core/attributes";
|
||||
|
||||
export type Order = GetValues<"api::order.order", GetNonPopulatableKeys<"api::order.order"> | GetPopulatableKeys<"api::order.order">>;
|
||||
export type OrderSafe = GetValues<"api::order.order", GetPopulatableKeys<"api::order.order">>;
|
||||
export type Product = GetValues<
|
||||
"api::product.product",
|
||||
GetNonPopulatableKeys<"api::product.product"> | GetPopulatableKeys<"api::product.product">
|
||||
> & { totalProductPrice?: number };
|
||||
export type ProductPattern = GetValues<
|
||||
"api::product-pattern.product-pattern",
|
||||
GetNonPopulatableKeys<"api::product-pattern.product-pattern"> | GetPopulatableKeys<"api::product-pattern.product-pattern">
|
||||
>;
|
||||
export type ProductPages = GetValues<
|
||||
"api::product-page.product-page",
|
||||
GetNonPopulatableKeys<"api::product-page.product-page"> | GetPopulatableKeys<"api::product-page.product-page">
|
||||
>;
|
||||
export type ProductRuling = GetValues<
|
||||
"api::product-ruling.product-ruling",
|
||||
GetNonPopulatableKeys<"api::product-ruling.product-ruling"> | GetPopulatableKeys<"api::product-ruling.product-ruling">
|
||||
>;
|
||||
export type ProductCover = GetValues<
|
||||
"api::product-cover.product-cover",
|
||||
GetNonPopulatableKeys<"api::product-cover.product-cover"> | GetPopulatableKeys<"api::product-cover.product-cover">
|
||||
>;
|
||||
export type ProductImage = GetValues<
|
||||
"api::product-image.product-image",
|
||||
GetNonPopulatableKeys<"api::product-image.product-image"> | GetPopulatableKeys<"api::product-image.product-image">
|
||||
>;
|
||||
export type CartProduct = GetValues<"products.cart", GetNonPopulatableKeys<"products.cart"> | GetPopulatableKeys<"products.cart">>;
|
||||
export type ProductCategory = ProductImage;
|
||||
|
||||
export type PdfBody = {
|
||||
subject: string;
|
||||
date: string;
|
||||
to: {
|
||||
name: string;
|
||||
address: string[];
|
||||
};
|
||||
nr: {
|
||||
customer: string;
|
||||
order: string;
|
||||
shipping?: string;
|
||||
invoice?: string;
|
||||
};
|
||||
service: {
|
||||
description: string;
|
||||
price: {
|
||||
per_unit: number;
|
||||
total: number;
|
||||
};
|
||||
count: number;
|
||||
nr: string;
|
||||
}[];
|
||||
currency: "\\euro";
|
||||
body?: string;
|
||||
total: number;
|
||||
subtotal: number;
|
||||
VAT: {
|
||||
rate: number;
|
||||
amount: number;
|
||||
};
|
||||
shipping: number;
|
||||
};
|
||||
|
||||
export type StructuredAddress = {
|
||||
givenName: string;
|
||||
familyName: string;
|
||||
streetAddress: string;
|
||||
postalCode: string;
|
||||
addressLevel2: string; // city
|
||||
country?: string;
|
||||
};
|
||||
Reference in New Issue
Block a user