includio-cms 0.15.2 → 0.15.4

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.
Files changed (77) hide show
  1. package/CHANGELOG.md +40 -0
  2. package/DOCS.md +142 -3
  3. package/ROADMAP.md +13 -2
  4. package/dist/admin/client/shop/shipping-method-form.svelte +66 -1
  5. package/dist/admin/client/shop/shipping-method-form.svelte.d.ts +8 -0
  6. package/dist/admin/client/shop/shop-order-detail-page.svelte +101 -0
  7. package/dist/admin/remote/shop.remote.d.ts +44 -0
  8. package/dist/admin/remote/shop.remote.js +35 -0
  9. package/dist/cli/index.js +49 -4
  10. package/dist/cli/scaffold/admin.d.ts +9 -2
  11. package/dist/cli/scaffold/admin.js +91 -3
  12. package/dist/core/server/forms/submissions/operations/create.js +11 -5
  13. package/dist/db-postgres/schema/shop/order.d.ts +68 -0
  14. package/dist/db-postgres/schema/shop/order.js +4 -0
  15. package/dist/db-postgres/schema/shop/shippingMethod.d.ts +25 -0
  16. package/dist/db-postgres/schema/shop/shippingMethod.js +1 -0
  17. package/dist/paraglide/messages/_index.d.ts +3 -36
  18. package/dist/paraglide/messages/_index.js +3 -71
  19. package/dist/paraglide/messages/hello_world.d.ts +5 -0
  20. package/dist/paraglide/messages/hello_world.js +33 -0
  21. package/dist/paraglide/messages/login_hello.d.ts +16 -0
  22. package/dist/paraglide/messages/login_hello.js +34 -0
  23. package/dist/paraglide/messages/login_please_login.d.ts +16 -0
  24. package/dist/paraglide/messages/login_please_login.js +34 -0
  25. package/dist/shop/adapters/inpost/geowidget.d.ts +27 -0
  26. package/dist/shop/adapters/inpost/geowidget.js +31 -0
  27. package/dist/shop/adapters/inpost/index.d.ts +89 -0
  28. package/dist/shop/adapters/inpost/index.js +156 -0
  29. package/dist/shop/adapters/inpost/payload.d.ts +18 -0
  30. package/dist/shop/adapters/inpost/payload.js +85 -0
  31. package/dist/shop/adapters/inpost/points-api.d.ts +17 -0
  32. package/dist/shop/adapters/inpost/points-api.js +55 -0
  33. package/dist/shop/adapters/inpost/shipx-client.d.ts +56 -0
  34. package/dist/shop/adapters/inpost/shipx-client.js +95 -0
  35. package/dist/shop/adapters/inpost/status-map.d.ts +9 -0
  36. package/dist/shop/adapters/inpost/status-map.js +46 -0
  37. package/dist/shop/adapters/inpost/webhook.d.ts +16 -0
  38. package/dist/shop/adapters/inpost/webhook.js +55 -0
  39. package/dist/shop/client/index.d.ts +5 -0
  40. package/dist/shop/http/carrier-handler.d.ts +12 -0
  41. package/dist/shop/http/carrier-handler.js +45 -0
  42. package/dist/shop/http/carrier-webhook-handler.d.ts +13 -0
  43. package/dist/shop/http/carrier-webhook-handler.js +66 -0
  44. package/dist/shop/http/checkout-handler.js +23 -1
  45. package/dist/shop/http/index.d.ts +3 -0
  46. package/dist/shop/http/index.js +3 -0
  47. package/dist/shop/http/order-handler.js +14 -0
  48. package/dist/shop/http/shipment-label-handler.d.ts +10 -0
  49. package/dist/shop/http/shipment-label-handler.js +53 -0
  50. package/dist/shop/http/shipping-handler.js +3 -0
  51. package/dist/shop/index.d.ts +3 -1
  52. package/dist/shop/index.js +1 -0
  53. package/dist/shop/server/email.js +37 -0
  54. package/dist/shop/server/orders.d.ts +9 -0
  55. package/dist/shop/server/orders.js +48 -0
  56. package/dist/shop/server/shipments.d.ts +33 -0
  57. package/dist/shop/server/shipments.js +145 -0
  58. package/dist/shop/server/shipping.d.ts +2 -1
  59. package/dist/shop/server/shipping.js +9 -0
  60. package/dist/shop/svelte/InpostPicker.svelte +270 -0
  61. package/dist/shop/svelte/InpostPicker.svelte.d.ts +51 -0
  62. package/dist/shop/svelte/OrderStatus.svelte +53 -1
  63. package/dist/shop/svelte/index.d.ts +1 -0
  64. package/dist/shop/svelte/index.js +1 -0
  65. package/dist/shop/svelte/labels.d.ts +5 -0
  66. package/dist/shop/svelte/labels.js +6 -1
  67. package/dist/shop/types.d.ts +49 -1
  68. package/dist/updates/0.15.3/index.d.ts +2 -0
  69. package/dist/updates/0.15.3/index.js +19 -0
  70. package/dist/updates/0.15.4/index.d.ts +2 -0
  71. package/dist/updates/0.15.4/index.js +14 -0
  72. package/dist/updates/index.js +3 -1
  73. package/package.json +1 -1
  74. package/dist/paraglide/messages/en.d.ts +0 -5
  75. package/dist/paraglide/messages/en.js +0 -14
  76. package/dist/paraglide/messages/pl.d.ts +0 -5
  77. package/dist/paraglide/messages/pl.js +0 -14
@@ -0,0 +1,19 @@
1
+ export const update = {
2
+ version: '0.15.3',
3
+ date: '2026-04-16',
4
+ description: 'Shop: InPost carrier adapter — Geowidget v5 picker + ShipX shipment + webhook auto-status.',
5
+ features: [
6
+ '`inpostAdapter()` ships in `includio-cms/shop` — wires Geowidget v5 (paczkomat picker on the frontend), ShipX (admin "Utwórz przesyłkę InPost" button creates the shipment, auto-buys the offer, fetches the label PDF) and a webhook receiver (`POST /api/shop/carriers/inpost/webhook?secret=...`) that updates order status + tracking number when ShipX events arrive.',
7
+ '`<InpostPicker>` Svelte component (`includio-cms/shop/svelte`) — drop-in widget with `bind:value={carrierRef}`, lazy-loads the geowidget script + CSS, hides itself for `inpost_courier_*` services. Raw API alternative: `GET /api/shop/carriers/inpost`.',
8
+ 'Per-shipping-method service config — `shop_shipping_methods.carrier_config` jsonb with `serviceType` (`inpost_locker_standard` / `inpost_locker_express` / `inpost_courier_standard` / `inpost_courier_express`) and `defaultSize` (A/B/C → small/medium/large). Admin shipping form ungates the InPost option and shows the new fields when selected.',
9
+ 'Customer order endpoint exposes `trackingNumber` + `trackingUrl` (resolved via `adapter.trackingUrl()`); `<OrderStatus>` renders a "Śledzenie przesyłki" section automatically. Status emails for `preparing` / `sent` / `done` include a tracking block with a clickable carrier link.',
10
+ 'Admin order detail page gains a "Przesyłka {carrierType}" panel: Utwórz przesyłkę / Pobierz etykietę PDF / Anuluj przesyłkę. PDF is streamed through an admin-auth proxy at `/api/shop/admin/orders/[id]/label`.',
11
+ 'Checkout validates `carrierRef` against the carrier (Operating-only paczkomats via InPost Points API, in-memory cached 5 min). Invalid selections reject with HTTP 400 before the order is created.',
12
+ 'CLI scaffold (`pnpm includio scaffold admin`) emits the new routes: `api/shop/carriers/[id]/+server.ts`, `api/shop/carriers/[id]/webhook/+server.ts`, `api/shop/admin/orders/[id]/label/+server.ts`.',
13
+ 'CLI scaffolder auto-detects shop usage by scanning `src/lib/cms/cms.config.ts` for an active `shop:` property — projects without the shop module get a clean route tree by default, no flag required. Override with `--shop` / `--no-shop` (or pass `scaffoldAdmin({ shop: false })` programmatically). Combined with the existing config-driven schema generator + admin sidebar guard, shop is now fully opt-in with zero footprint when unused.'
14
+ ],
15
+ fixes: [],
16
+ breakingChanges: [],
17
+ sql: 'ALTER TABLE shop_shipping_methods ADD COLUMN carrier_config jsonb;\nALTER TABLE shop_orders ADD COLUMN shipment_id text, ADD COLUMN tracking_number text, ADD COLUMN label_url text, ADD COLUMN shipment_created_at timestamptz;',
18
+ notes: 'Run the SQL once, then `pnpm db:push` to sync the rest of the schema. InPost requires two tokens: a public Geowidget v5 token (browser-side, from `manager.paczkomaty.pl`) and a private ShipX organization token (server-side). On sandbox, ShipX `POST /shipments/:id/buy` is asynchronous and often stalls in `offer_selected` because test accounts have no wallet to pay the offer — the webhook reconciles whatever ends up. See /docs/shop/inpost for full setup.'
19
+ };
@@ -0,0 +1,2 @@
1
+ import type { CmsUpdate } from '../index.js';
2
+ export declare const update: CmsUpdate;
@@ -0,0 +1,14 @@
1
+ export const update = {
2
+ version: '0.15.4',
3
+ date: '2026-04-21',
4
+ description: 'Forms: auto-scaffolded public submission endpoint + decoupled notification emails from submission success.',
5
+ features: [
6
+ 'CLI scaffold (`pnpm includio scaffold admin`) now emits `src/routes/api/forms/[slug]/submit/+server.ts` — the public POST endpoint for form submissions. Previously each project had to hand-roll this file (the handler lives in the library, but SvelteKit does not load routes from `node_modules`). New projects get it out-of-the-box; existing projects can run `includio scaffold admin` to generate it without overwriting other admin files.',
7
+ 'Added `ideas/health-check-module.md` — proposal for built-in `/api/health` + `/api/health/ready` endpoints, opt-in SMTP verify, and a ręczny "Test SMTP connection / Send test mail" section in the admin maintenance page. Context: diagnosing a silent SMTP misconfiguration in a live project required grepping through library internals; a one-click diagnostics panel would have surfaced the empty `EMAIL_HOST` immediately.'
8
+ ],
9
+ fixes: [
10
+ '`createFormSubmission()` now keeps the notification-email call in a separate `try/catch` from the DB write. Before: if SMTP was misconfigured (empty `EMAIL_HOST` locally, unreachable relay, etc.) the whole operation returned `false` → endpoint responded `500 "Submission failed"` even though the submission was already persisted. After: DB failure still returns `false` (critical path); email failure is logged via `console.error` and the submission succeeds with `200`.'
11
+ ],
12
+ breakingChanges: [],
13
+ notes: 'No SQL migration. No API signature changes. Existing projects that already have a hand-rolled `src/routes/api/forms/[slug]/submit/+server.ts` keep working — scaffold skips existing files unless `--force` is passed.'
14
+ };
@@ -47,7 +47,9 @@ import { update as update0146 } from './0.14.6/index.js';
47
47
  import { update as update0150 } from './0.15.0/index.js';
48
48
  import { update as update0151 } from './0.15.1/index.js';
49
49
  import { update as update0152 } from './0.15.2/index.js';
50
- export const updates = [update0065, update0066, update0067, update0068, update0069, update010, update011, update012, update013, update014, update015, update020, update022, update050, update051, update052, update053, update054, update055, update056, update057, update058, update060, update061, update062, update070, update071, update072, update073, update080, update090, update0100, update0110, update0120, update0130, update0131, update0132, update0133, update0134, update0140, update0141, update0142, update0143, update0144, update0145, update0146, update0150, update0151, update0152];
50
+ import { update as update0153 } from './0.15.3/index.js';
51
+ import { update as update0154 } from './0.15.4/index.js';
52
+ export const updates = [update0065, update0066, update0067, update0068, update0069, update010, update011, update012, update013, update014, update015, update020, update022, update050, update051, update052, update053, update054, update055, update056, update057, update058, update060, update061, update062, update070, update071, update072, update073, update080, update090, update0100, update0110, update0120, update0130, update0131, update0132, update0133, update0134, update0140, update0141, update0142, update0143, update0144, update0145, update0146, update0150, update0151, update0152, update0153, update0154];
51
53
  export const getUpdatesFrom = (fromVersion) => {
52
54
  const fromParts = fromVersion.split('.').map(Number);
53
55
  return updates.filter((update) => {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "includio-cms",
3
- "version": "0.15.2",
3
+ "version": "0.15.4",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",
@@ -1,5 +0,0 @@
1
- export const hello_world: (inputs: {
2
- name: NonNullable<unknown>;
3
- }) => string;
4
- export const login_hello: (inputs: {}) => string;
5
- export const login_please_login: (inputs: {}) => string;
@@ -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,5 +0,0 @@
1
- export const hello_world: (inputs: {
2
- name: NonNullable<unknown>;
3
- }) => string;
4
- export const login_hello: (inputs: {}) => string;
5
- export const login_please_login: (inputs: {}) => string;
@@ -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
- };