includio-cms 0.36.0 → 0.36.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/API.md CHANGED
@@ -1,4 +1,4 @@
1
- # includio-cms — Public API v0.36.0
1
+ # includio-cms — Public API v0.36.1
2
2
 
3
3
  > Auto-generated by `scripts/generate-api-md.ts`. Do not edit by hand.
4
4
 
package/CHANGELOG.md CHANGED
@@ -3,6 +3,13 @@
3
3
  All notable changes to includio-cms are documented here.
4
4
  Generated from `src/lib/updates/` — do not edit manually.
5
5
 
6
+ ## 0.36.1 — 2026-06-08
7
+
8
+ Fakturownia adapter — fix B2C: gdy brak `buyer.nip` i `buyer.companyName`, payload zawiera `buyer_first_name` + `buyer_last_name` (rozdzielone przez `splitFullName` — spójnie z PayU/InPost). Bez tej zmiany Fakturownia API odrzuca fakturę dla osoby fizycznej z 422 `buyer_tax_no — nie może być puste`.
9
+
10
+ ### Fixed
11
+ - `buildFakturowniaInvoice` — dla B2C (brak NIP i companyName) payload zawiera teraz `buyer_first_name` i `buyer_last_name` (rozdzielone z `buyer.name` przez `splitFullName` z adaptera PayU). B2B (z NIP lub companyName) zachowuje obecne zachowanie — bez first/last name. Dla `splitFullName("Madonna")` (1 słowo) → tylko `buyer_first_name`. Naprawia 422 z Fakturownia dla osób fizycznych.
12
+
6
13
  ## 0.36.0 — 2026-06-05
7
14
 
8
15
  `defineShop({ invoiceName, cartName })` — opcjonalne multilingual template overriding produktowej nazwy w koszyku, podsumowaniu zamówienia i na fakturze. Reusuje engine od `variantLabel.template` (`{slug}`, `{slug|filter}`), z nowymi możliwościami: dot-path (`{hero.title}`) i auto-unwrap pól i18n. Reserved `{variant}` = wyrenderowany variantLabel. Order item `nameSnapshot` zyskuje opcjonalne pole `invoice` (zamrażane przy checkout). Additive — brak zmian default behavior.
package/DOCS.md CHANGED
@@ -1,4 +1,4 @@
1
- # Includio CMS Documentation (v0.36.0)
1
+ # Includio CMS Documentation (v0.36.1)
2
2
 
3
3
  > This file is auto-generated from the docs site. For the latest version, update the package.
4
4
 
@@ -19,6 +19,8 @@ export interface FakturowniaInvoiceBody {
19
19
  buyer_name: string;
20
20
  buyer_email: string;
21
21
  buyer_tax_no?: string;
22
+ buyer_first_name?: string;
23
+ buyer_last_name?: string;
22
24
  buyer_street?: string;
23
25
  buyer_city?: string;
24
26
  buyer_post_code?: string;
@@ -1,3 +1,4 @@
1
+ import { splitFullName } from '../payu/payload.js';
1
2
  /** Minor units (grosze) → major units (PLN) with 2-decimal precision. */
2
3
  function toMajor(minor) {
3
4
  return Math.round(minor) / 100;
@@ -18,6 +19,8 @@ function pick(addr, ...keys) {
18
19
  export function buildFakturowniaInvoice(payload, opts = {}) {
19
20
  const date = payload.paidAt.slice(0, 10);
20
21
  const { buyer } = payload;
22
+ const isB2C = !buyer.nip && !buyer.companyName;
23
+ const names = isB2C ? splitFullName(buyer.name) : {};
21
24
  return {
22
25
  kind: opts.kind ?? 'vat',
23
26
  status: 'paid',
@@ -28,6 +31,8 @@ export function buildFakturowniaInvoice(payload, opts = {}) {
28
31
  buyer_name: buyer.companyName || buyer.name,
29
32
  buyer_email: buyer.email,
30
33
  ...(buyer.nip ? { buyer_tax_no: buyer.nip } : {}),
34
+ ...(names.firstName ? { buyer_first_name: names.firstName } : {}),
35
+ ...(names.lastName ? { buyer_last_name: names.lastName } : {}),
31
36
  ...(pick(buyer.address, 'street') ? { buyer_street: pick(buyer.address, 'street') } : {}),
32
37
  ...(pick(buyer.address, 'city') ? { buyer_city: pick(buyer.address, 'city') } : {}),
33
38
  ...(pick(buyer.address, 'postCode', 'zip', 'postalCode')
@@ -0,0 +1,2 @@
1
+ import type { CmsUpdate } from '../index.js';
2
+ export declare const update: CmsUpdate;
@@ -0,0 +1,10 @@
1
+ export const update = {
2
+ version: '0.36.1',
3
+ date: '2026-06-08',
4
+ description: 'Fakturownia adapter — fix B2C: gdy brak `buyer.nip` i `buyer.companyName`, payload zawiera `buyer_first_name` + `buyer_last_name` (rozdzielone przez `splitFullName` — spójnie z PayU/InPost). Bez tej zmiany Fakturownia API odrzuca fakturę dla osoby fizycznej z 422 `buyer_tax_no — nie może być puste`.',
5
+ features: [],
6
+ fixes: [
7
+ '`buildFakturowniaInvoice` — dla B2C (brak NIP i companyName) payload zawiera teraz `buyer_first_name` i `buyer_last_name` (rozdzielone z `buyer.name` przez `splitFullName` z adaptera PayU). B2B (z NIP lub companyName) zachowuje obecne zachowanie — bez first/last name. Dla `splitFullName("Madonna")` (1 słowo) → tylko `buyer_first_name`. Naprawia 422 z Fakturownia dla osób fizycznych.'
8
+ ],
9
+ breakingChanges: []
10
+ };
@@ -67,6 +67,7 @@ import { update as update0340 } from './0.34.0/index.js';
67
67
  import { update as update0341 } from './0.34.1/index.js';
68
68
  import { update as update0350 } from './0.35.0/index.js';
69
69
  import { update as update0360 } from './0.36.0/index.js';
70
+ import { update as update0361 } from './0.36.1/index.js';
70
71
  export const updates = [
71
72
  update0065,
72
73
  update0066,
@@ -136,7 +137,8 @@ export const updates = [
136
137
  update0340,
137
138
  update0341,
138
139
  update0350,
139
- update0360
140
+ update0360,
141
+ update0361
140
142
  ];
141
143
  export const getUpdatesFrom = (fromVersion) => {
142
144
  const fromParts = fromVersion.split('.').map(Number);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "includio-cms",
3
- "version": "0.36.0",
3
+ "version": "0.36.1",
4
4
  "scripts": {
5
5
  "dev": "vite dev",
6
6
  "build": "vite build && npm run prepack",