@deliverart/sdk-js-receipt-template 2.25.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/README.md +28 -0
- package/dist/index.cjs +14218 -0
- package/dist/index.d.cts +2754 -0
- package/dist/index.d.ts +2754 -0
- package/dist/index.js +14170 -0
- package/package.json +36 -0
package/README.md
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
# @deliverart/sdk-js-receipt-template
|
|
2
|
+
|
|
3
|
+
Typed SDK contract for point-of-sale receipt templates.
|
|
4
|
+
|
|
5
|
+
The package provides:
|
|
6
|
+
|
|
7
|
+
- Zod schemas for versioned block definitions;
|
|
8
|
+
- list, detail, point-of-sale collection, create, and update requests;
|
|
9
|
+
- optimistic concurrency through `If-Match` on `UpdateReceiptTemplate`;
|
|
10
|
+
- IRI schemas for relationships from print rules.
|
|
11
|
+
|
|
12
|
+
```ts
|
|
13
|
+
import {
|
|
14
|
+
GetReceiptTemplateDetails,
|
|
15
|
+
UpdateReceiptTemplate,
|
|
16
|
+
} from '@deliverart/sdk-js-receipt-template'
|
|
17
|
+
|
|
18
|
+
const template = await sdk.call(new GetReceiptTemplateDetails(templateId))
|
|
19
|
+
|
|
20
|
+
const updated = await sdk.call(
|
|
21
|
+
new UpdateReceiptTemplate(template.id, template.revision, {
|
|
22
|
+
name: 'Cucina',
|
|
23
|
+
definition: nextDefinition,
|
|
24
|
+
}),
|
|
25
|
+
)
|
|
26
|
+
```
|
|
27
|
+
|
|
28
|
+
`UpdateReceiptTemplate` emits `application/merge-patch+json` and a strong `If-Match` header. A stale revision is rejected by the API instead of silently overwriting a newer edit.
|