includio-cms 0.28.0 → 0.34.0
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/API.md +39 -13
- package/CHANGELOG.md +19 -0
- package/DOCS.md +1 -1
- package/ROADMAP.md +1 -0
- package/dist/admin/api/handler.js +4 -0
- package/dist/admin/api/integrations.d.ts +13 -0
- package/dist/admin/api/integrations.js +61 -0
- package/dist/admin/api/test-email.d.ts +9 -0
- package/dist/admin/api/test-email.js +39 -0
- package/dist/admin/auth-client.d.ts +2209 -2209
- package/dist/admin/client/index.d.ts +10 -0
- package/dist/admin/client/index.js +12 -0
- package/dist/admin/client/maintenance/maintenance-page.svelte +210 -0
- package/dist/admin/client/shop/coupon-schema.d.ts +1 -1
- package/dist/admin/client/shop/restore-order-cell.svelte +29 -0
- package/dist/admin/client/shop/restore-order-cell.svelte.d.ts +8 -0
- package/dist/admin/client/shop/shop-order-detail-page.svelte +71 -1
- package/dist/admin/client/shop/shop-orders-list-page.svelte +113 -53
- package/dist/admin/components/layout/app-sidebar.svelte +2 -0
- package/dist/admin/components/layout/nav-custom.svelte +26 -0
- package/dist/admin/components/layout/nav-custom.svelte.d.ts +3 -0
- package/dist/admin/components/layout/page-header.svelte +13 -3
- package/dist/admin/components/layout/page-header.svelte.d.ts +13 -3
- package/dist/admin/remote/admin.remote.d.ts +7 -0
- package/dist/admin/remote/admin.remote.js +10 -0
- package/dist/admin/remote/entry.remote.d.ts +4 -4
- package/dist/admin/remote/index.d.ts +1 -0
- package/dist/admin/remote/index.js +1 -0
- package/dist/admin/remote/invite.d.ts +2 -2
- package/dist/admin/remote/shop.remote.d.ts +75 -48
- package/dist/admin/remote/shop.remote.js +41 -10
- package/dist/admin/types.d.ts +15 -0
- package/dist/admin/utils/csv-export.d.ts +45 -0
- package/dist/admin/utils/csv-export.js +61 -0
- package/dist/cli/scaffold/admin.js +1 -1
- package/dist/components/ui/button-group/button-group-separator.svelte.d.ts +1 -1
- package/dist/components/ui/command/command.svelte.d.ts +1 -1
- package/dist/components/ui/field/field-label.svelte.d.ts +1 -1
- package/dist/components/ui/input/input.svelte.d.ts +1 -1
- package/dist/components/ui/input-group/input-group-input.svelte.d.ts +1 -1
- package/dist/components/ui/item/item-separator.svelte.d.ts +1 -1
- package/dist/components/ui/select/select-group-heading.svelte.d.ts +1 -1
- package/dist/components/ui/sidebar/sidebar-input.svelte.d.ts +1 -1
- package/dist/components/ui/sidebar/sidebar-separator.svelte.d.ts +1 -1
- package/dist/core/cms.d.ts +44 -2
- package/dist/core/cms.js +64 -0
- package/dist/core/index.d.ts +1 -4
- package/dist/core/index.js +4 -4
- package/dist/core/server/index.d.ts +4 -1
- package/dist/core/server/index.js +4 -1
- package/dist/db-postgres/schema/shop/order.d.ts +34 -0
- package/dist/db-postgres/schema/shop/order.js +4 -0
- package/dist/paraglide/messages/_index.d.ts +3 -36
- package/dist/paraglide/messages/_index.js +3 -71
- package/dist/paraglide/messages/hello_world.d.ts +5 -0
- package/dist/paraglide/messages/hello_world.js +33 -0
- package/dist/paraglide/messages/login_hello.d.ts +16 -0
- package/dist/paraglide/messages/login_hello.js +34 -0
- package/dist/paraglide/messages/login_please_login.d.ts +16 -0
- package/dist/paraglide/messages/login_please_login.js +34 -0
- package/dist/shop/adapters/fakturownia/client.d.ts +5 -0
- package/dist/shop/adapters/fakturownia/client.js +20 -0
- package/dist/shop/adapters/fakturownia/index.js +11 -0
- package/dist/shop/adapters/payu/index.js +11 -0
- package/dist/shop/index.d.ts +1 -1
- package/dist/shop/server/coupons.d.ts +10 -0
- package/dist/shop/server/coupons.js +19 -0
- package/dist/shop/server/email.d.ts +7 -3
- package/dist/shop/server/email.js +86 -112
- package/dist/shop/server/emailTemplateRegistry.d.ts +47 -0
- package/dist/shop/server/emailTemplateRegistry.js +288 -0
- package/dist/shop/server/orders.d.ts +60 -1
- package/dist/shop/server/orders.js +145 -16
- package/dist/shop/templates/_partials/footer.en.html +4 -0
- package/dist/shop/templates/_partials/footer.pl.html +4 -0
- package/dist/shop/templates/_partials/header.en.html +4 -0
- package/dist/shop/templates/_partials/header.pl.html +4 -0
- package/dist/shop/templates/_partials/items.en.html +14 -0
- package/dist/shop/templates/_partials/items.pl.html +14 -0
- package/dist/shop/templates/_partials/tracking.en.html +7 -0
- package/dist/shop/templates/_partials/tracking.pl.html +7 -0
- package/dist/shop/templates/awaiting-payment.en.html +6 -0
- package/dist/shop/templates/awaiting-payment.pl.html +6 -0
- package/dist/shop/templates/cancelled.en.html +6 -0
- package/dist/shop/templates/cancelled.pl.html +6 -0
- package/dist/shop/templates/low-stock.en.html +14 -0
- package/dist/shop/templates/low-stock.pl.html +14 -0
- package/dist/shop/templates/order-completed.en.html +6 -0
- package/dist/shop/templates/order-completed.pl.html +6 -0
- package/dist/shop/templates/order-received.en.html +7 -0
- package/dist/shop/templates/order-received.pl.html +7 -0
- package/dist/shop/templates/payment-received.en.html +7 -0
- package/dist/shop/templates/payment-received.pl.html +7 -0
- package/dist/shop/templates/payment-rejected.en.html +6 -0
- package/dist/shop/templates/payment-rejected.pl.html +6 -0
- package/dist/shop/templates/preparing.en.html +7 -0
- package/dist/shop/templates/preparing.pl.html +7 -0
- package/dist/shop/templates/refunded.en.html +6 -0
- package/dist/shop/templates/refunded.pl.html +6 -0
- package/dist/shop/templates/shipped.en.html +7 -0
- package/dist/shop/templates/shipped.pl.html +7 -0
- package/dist/shop/types.d.ts +63 -0
- package/dist/sveltekit/index.d.ts +0 -1
- package/dist/sveltekit/index.js +0 -1
- package/dist/sveltekit/server/index.d.ts +2 -0
- package/dist/sveltekit/server/index.js +4 -0
- package/dist/types/adapters/email.d.ts +13 -0
- package/dist/types/cms.d.ts +30 -0
- package/dist/types/index.d.ts +1 -1
- package/dist/updates/0.34.0/index.d.ts +2 -0
- package/dist/updates/0.34.0/index.js +17 -0
- package/dist/updates/index.js +3 -1
- package/package.json +7 -2
- package/dist/paraglide/messages/en.d.ts +0 -5
- package/dist/paraglide/messages/en.js +0 -14
- package/dist/paraglide/messages/pl.d.ts +0 -5
- package/dist/paraglide/messages/pl.js +0 -14
|
@@ -14,5 +14,18 @@ export interface SendMailOptions {
|
|
|
14
14
|
to: string | string[];
|
|
15
15
|
subject: string;
|
|
16
16
|
html: string;
|
|
17
|
+
/**
|
|
18
|
+
* Plain-text fallback served alongside HTML for clients that prefer text
|
|
19
|
+
* (better deliverability + accessibility). Optional — omitted = HTML-only.
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
text?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Override the Reply-To header. Useful for admin notifications where the
|
|
25
|
+
* default sender is a no-reply address but replies should land in a real
|
|
26
|
+
* inbox. Omitted = adapter default (typically no Reply-To header).
|
|
27
|
+
* @public
|
|
28
|
+
*/
|
|
29
|
+
replyTo?: string;
|
|
17
30
|
}
|
|
18
31
|
export type SendMail = (options: SendMailOptions) => Promise<void>;
|
package/dist/types/cms.d.ts
CHANGED
|
@@ -52,9 +52,21 @@ export interface AuthAdapter {
|
|
|
52
52
|
} | null>;
|
|
53
53
|
};
|
|
54
54
|
}
|
|
55
|
+
export interface AuthRateLimitRule {
|
|
56
|
+
window: number;
|
|
57
|
+
max: number;
|
|
58
|
+
}
|
|
59
|
+
export interface AuthRateLimitConfig {
|
|
60
|
+
enabled?: boolean;
|
|
61
|
+
window?: number;
|
|
62
|
+
max?: number;
|
|
63
|
+
customRules?: Record<string, AuthRateLimitRule>;
|
|
64
|
+
storage?: 'memory' | 'secondary-storage' | 'database';
|
|
65
|
+
}
|
|
55
66
|
export interface AuthConfig {
|
|
56
67
|
secret: string;
|
|
57
68
|
baseURL?: string;
|
|
69
|
+
rateLimit?: AuthRateLimitConfig;
|
|
58
70
|
}
|
|
59
71
|
export interface ApiKeyConfig {
|
|
60
72
|
key: string;
|
|
@@ -68,6 +80,22 @@ export interface ApiKeyConfig {
|
|
|
68
80
|
export interface TypographyConfig {
|
|
69
81
|
fixOrphans?: boolean;
|
|
70
82
|
}
|
|
83
|
+
/**
|
|
84
|
+
* Optional admin UI configuration — extension points for the panel sidebar
|
|
85
|
+
* and other admin surfaces. Set on `defineConfig({ admin: ... })`.
|
|
86
|
+
*
|
|
87
|
+
* @public
|
|
88
|
+
*/
|
|
89
|
+
export interface AdminConfig {
|
|
90
|
+
/**
|
|
91
|
+
* Additional sidebar nav items rendered below the built-in sections
|
|
92
|
+
* (Dashboard, Collections, Singles, Forms, Shop). Useful for custom
|
|
93
|
+
* admin pages added by the consumer project (e.g. `/admin/newsletter`).
|
|
94
|
+
* Items are read once per session via a remote query and rendered with
|
|
95
|
+
* the same styling as built-in sections.
|
|
96
|
+
*/
|
|
97
|
+
extraNavItems?: import('../admin/types.js').AdminNavItem[];
|
|
98
|
+
}
|
|
71
99
|
export interface CMSConfig {
|
|
72
100
|
languages: Language[];
|
|
73
101
|
collections?: CollectionConfig[];
|
|
@@ -85,6 +113,7 @@ export interface CMSConfig {
|
|
|
85
113
|
sidebarHelp?: boolean;
|
|
86
114
|
shop?: ResolvedShopConfig;
|
|
87
115
|
cmp?: ResolvedCmpConfig;
|
|
116
|
+
admin?: AdminConfig;
|
|
88
117
|
}
|
|
89
118
|
export interface ICMS {
|
|
90
119
|
collections: Record<string, CollectionConfigWithType>;
|
|
@@ -104,4 +133,5 @@ export interface ICMS {
|
|
|
104
133
|
typographyConfig: TypographyConfig;
|
|
105
134
|
shopConfig: ResolvedShopConfig | null;
|
|
106
135
|
cmpConfig: ResolvedCmpConfig | null;
|
|
136
|
+
adminConfig: AdminConfig | null;
|
|
107
137
|
}
|
package/dist/types/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@ export { type CollectionConfig } from './collections.js';
|
|
|
9
9
|
export { type SingleConfig } from './singles.js';
|
|
10
10
|
export { type FormConfig, type FormSubmission } from './forms.js';
|
|
11
11
|
export { type FormField, type FormFieldType, type FormBaseField, type FormTextField, type FormEmailField, type FormTextareaField, type FormCheckboxField, type FormSelectField } from './formFields.js';
|
|
12
|
-
export { type CMSConfig, type ApiKeyConfig, type AuthConfig, type TypographyConfig } from './cms.js';
|
|
12
|
+
export { type CMSConfig, type ApiKeyConfig, type AuthConfig, type AuthRateLimitConfig, type AuthRateLimitRule, type TypographyConfig } from './cms.js';
|
|
13
13
|
export { type PluginConfig, type CustomFieldDefinition, type IconSetPlugin, type IconDefinition, type Plugin, isIconSetPlugin } from './plugins.js';
|
|
14
14
|
export { type Language, type Localized } from './languages.js';
|
|
15
15
|
export { type Layout, type LayoutNode, type LayoutPreset, type LayoutNodeType, type ColumnRatio, type SectionNode, type ColumnsNode, type CardNode, type AccordionNode, type StackNode, type TabsNode, type TabNode } from './layout.js';
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
export const update = {
|
|
2
|
+
version: '0.34.0',
|
|
3
|
+
date: '2026-06-03',
|
|
4
|
+
description: 'Soft-delete zamówień (admin-only) — administrator może ukryć zamówienie z listy bez utraty danych. Odwracalne (kosz + przywracanie), bezpieczne księgowo: nie kasuje wiersza, faktur ani historii. Dozwolone tylko dla „bezpiecznych" statusów bez płatności (`new`, `awaitingPayment`, `cancelled`, `paymentRejected`) i zablokowane dla zamówień z wystawioną fakturą. Cała funkcja widoczna wyłącznie dla roli `admin`. Additive only — bez breaking changes.',
|
|
5
|
+
features: [
|
|
6
|
+
'`shop_orders` dostaje kolumny `deleted_at` (timestamptz, NULL = widoczne) i `deleted_by` (text). Lista zamówień domyślnie ukrywa miękko usunięte; `listOrders`/`countOrders` (`$lib/shop/server/orders.ts`) przyjmują `deleted: "exclude" | "only" | "include"` (domyślnie `exclude`).',
|
|
7
|
+
'`softDeleteOrder(orderId, deletedBy)` / `restoreOrder(orderId)` (`$lib/shop/server/orders.ts`, `@public`) — miękkie usuwanie/przywracanie (idempotentne). Soft-delete zwalnia natychmiast aktywną rezerwację stocku (nie czeka na TTL). Guard: `decideOrderDeletion(status, invoice)` + `DELETABLE_ORDER_STATUSES` / `isOrderDeletable(status)` (czyste, testowalne) — rzuca `OrderNotDeletableError` dla niedozwolonego statusu lub faktury `issued`/`sent`.',
|
|
8
|
+
'Auto-restore: zmiana statusu miękko usuniętego zamówienia na nieusuwalny (np. spóźniony webhook płatności na ukrytym `awaitingPayment` → `paid`) automatycznie zdejmuje je z kosza — opłacone zamówienia nigdy nie zostają ukryte.',
|
|
9
|
+
'Customer-facing `getOrderByNumber` nie zwraca miękko usuniętego zamówienia (nie resolvuje się na storefroncie); admin `getOrderById` celowo ignoruje `deletedAt` (podgląd/przywracanie z kosza).',
|
|
10
|
+
'`deleteOrderCmd` / `restoreOrderCmd` (commands) + `listOrdersAdmin({ deleted })` (`includio-cms/admin/remote`) — chronione `requireRole("admin")` (kosz i usuwanie tylko dla admina; normalna lista nadal `requireAuth`).',
|
|
11
|
+
'Admin UI: `shop-order-detail-page` zyskuje sekcję „Usuń zamówienie" (tylko admin + status usuwalny) z dialogiem potwierdzenia; `shop-orders-list-page` — przełącznik „Kosz" (tylko admin) z akcją „Przywróć" w wierszu.'
|
|
12
|
+
],
|
|
13
|
+
fixes: [],
|
|
14
|
+
breakingChanges: [],
|
|
15
|
+
sql: `ALTER TABLE shop_orders ADD COLUMN IF NOT EXISTS deleted_at timestamptz;
|
|
16
|
+
ALTER TABLE shop_orders ADD COLUMN IF NOT EXISTS deleted_by text;`
|
|
17
|
+
};
|
package/dist/updates/index.js
CHANGED
|
@@ -63,6 +63,7 @@ import { update as update0260 } from './0.26.0/index.js';
|
|
|
63
63
|
import { update as update0261 } from './0.26.1/index.js';
|
|
64
64
|
import { update as update0270 } from './0.27.0/index.js';
|
|
65
65
|
import { update as update0280 } from './0.28.0/index.js';
|
|
66
|
+
import { update as update0340 } from './0.34.0/index.js';
|
|
66
67
|
export const updates = [
|
|
67
68
|
update0065,
|
|
68
69
|
update0066,
|
|
@@ -128,7 +129,8 @@ export const updates = [
|
|
|
128
129
|
update0260,
|
|
129
130
|
update0261,
|
|
130
131
|
update0270,
|
|
131
|
-
update0280
|
|
132
|
+
update0280,
|
|
133
|
+
update0340
|
|
132
134
|
];
|
|
133
135
|
export const getUpdatesFrom = (fromVersion) => {
|
|
134
136
|
const fromParts = fromVersion.split('.').map(Number);
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "includio-cms",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.34.0",
|
|
4
4
|
"scripts": {
|
|
5
5
|
"dev": "vite dev",
|
|
6
6
|
"build": "vite build && npm run prepack",
|
|
@@ -43,7 +43,7 @@
|
|
|
43
43
|
"prepublishOnly": "tsx scripts/generate-changelog.ts && tsx scripts/compile-docs.ts && tsx scripts/generate-api-md.ts && git add CHANGELOG.md DOCS.md API.md && (git diff --cached --quiet || git commit -m \"Prepublish v${npm_package_version} (CHANGELOG.md, DOCS.md and API.md updated)\")"
|
|
44
44
|
},
|
|
45
45
|
"bin": {
|
|
46
|
-
"
|
|
46
|
+
"aria": "./dist/cli/index.js"
|
|
47
47
|
},
|
|
48
48
|
"files": [
|
|
49
49
|
"dist",
|
|
@@ -72,6 +72,10 @@
|
|
|
72
72
|
"svelte": "./dist/core/index.js",
|
|
73
73
|
"node": "./dist/core/index.js"
|
|
74
74
|
},
|
|
75
|
+
"./core/server": {
|
|
76
|
+
"types": "./dist/core/server/index.d.ts",
|
|
77
|
+
"node": "./dist/core/server/index.js"
|
|
78
|
+
},
|
|
75
79
|
"./types": {
|
|
76
80
|
"types": "./dist/types/index.d.ts",
|
|
77
81
|
"svelte": "./dist/types/index.js",
|
|
@@ -302,6 +306,7 @@
|
|
|
302
306
|
"dotenv": "^16.5.0",
|
|
303
307
|
"fast-glob": "^3.3.3",
|
|
304
308
|
"fluent-ffmpeg": "^2.1.3",
|
|
309
|
+
"handlebars": "^4.7.9",
|
|
305
310
|
"isomorphic-dompurify": "3.0.0-rc.2",
|
|
306
311
|
"lowlight": "^3.3.0",
|
|
307
312
|
"mrmime": "^2.0.1",
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export const hello_world = /** @type {(inputs: { name: NonNullable<unknown> }) => string} */ (i) => {
|
|
5
|
-
return `Hello, ${i.name} from en!`
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const login_hello = /** @type {(inputs: {}) => string} */ () => {
|
|
9
|
-
return `Welcome back`
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const login_please_login = /** @type {(inputs: {}) => string} */ () => {
|
|
13
|
-
return `Login to your account`
|
|
14
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
1
|
-
/* eslint-disable */
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
export const hello_world = /** @type {(inputs: { name: NonNullable<unknown> }) => string} */ (i) => {
|
|
5
|
-
return `Hello, ${i.name} from pl!`
|
|
6
|
-
};
|
|
7
|
-
|
|
8
|
-
export const login_hello = /** @type {(inputs: {}) => string} */ () => {
|
|
9
|
-
return `Witaj ponownie`
|
|
10
|
-
};
|
|
11
|
-
|
|
12
|
-
export const login_please_login = /** @type {(inputs: {}) => string} */ () => {
|
|
13
|
-
return `Zaloguj się na swoje konto`
|
|
14
|
-
};
|