@vindentech/api-client 0.3.0-next.75 → 0.3.0-next.77

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.
@@ -0,0 +1,136 @@
1
+ import { customFetch } from '../../mutator.js';
2
+ ;
3
+ export const getPriceBookControllerGetPriceBookV1Url = () => {
4
+ return `/v1/billing/price-book`;
5
+ };
6
+ /**
7
+ * Each section lists the tenant-wide active rules in the tenant's default currency — in effect today, and published to start later. `writable` says whether this caller may open or edit a change set under the tenant's price book mode. 🔒 Requires permission: pricingrule:read. Gate UI with hasRequiredPermissions() from @vindentech/api-client.
8
+ * @summary Read the price book: tenant-wide rules per section, and the open draft
9
+ */
10
+ export const priceBookControllerGetPriceBookV1 = async (options) => {
11
+ return customFetch(getPriceBookControllerGetPriceBookV1Url(), {
12
+ ...options,
13
+ method: 'GET'
14
+ });
15
+ };
16
+ export const getPriceBookControllerCreateDraftV1Url = () => {
17
+ return `/v1/billing/price-book/change-sets`;
18
+ };
19
+ /**
20
+ * 🔒 Requires permission: pricebook:write. Gate UI with hasRequiredPermissions() from @vindentech/api-client.
21
+ * @summary Open the tenant's price book draft (one at a time)
22
+ */
23
+ export const priceBookControllerCreateDraftV1 = async (createPriceBookChangeSetDto, options) => {
24
+ const getHeaders = (h) => {
25
+ if (!h)
26
+ return {};
27
+ if (h instanceof Headers)
28
+ return Object.fromEntries(h.entries());
29
+ if (Array.isArray(h))
30
+ return Object.fromEntries(h);
31
+ return h;
32
+ };
33
+ return customFetch(getPriceBookControllerCreateDraftV1Url(), {
34
+ ...options,
35
+ method: 'POST',
36
+ headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },
37
+ body: JSON.stringify(createPriceBookChangeSetDto)
38
+ });
39
+ };
40
+ export const getPriceBookControllerReplaceSectionV1Url = (id, section) => {
41
+ return `/v1/billing/price-book/change-sets/${id}/sections/${section}`;
42
+ };
43
+ /**
44
+ * `entries` is the whole section as it should read after publish — one template application per entry, each template's event type inside the section. An empty list closes the section's live rules at publish. Marks the section edited and returns the draft at its new version. 🔒 Requires permission: pricebook:write. Gate UI with hasRequiredPermissions() from @vindentech/api-client.
45
+ * @summary Replace one section of the draft
46
+ */
47
+ export const priceBookControllerReplaceSectionV1 = async (id, section, replacePriceBookSectionDto, options) => {
48
+ const getHeaders = (h) => {
49
+ if (!h)
50
+ return {};
51
+ if (h instanceof Headers)
52
+ return Object.fromEntries(h.entries());
53
+ if (Array.isArray(h))
54
+ return Object.fromEntries(h);
55
+ return h;
56
+ };
57
+ return customFetch(getPriceBookControllerReplaceSectionV1Url(id, section), {
58
+ ...options,
59
+ method: 'PUT',
60
+ headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },
61
+ body: JSON.stringify(replacePriceBookSectionDto)
62
+ });
63
+ };
64
+ export const getPriceBookControllerPreviewV1Url = (id) => {
65
+ return `/v1/billing/price-book/change-sets/${id}/preview`;
66
+ };
67
+ /**
68
+ * Runs the publish and rolls it back: the rules that would go live, and the live rules that would close or be retired, per edited section. Any refusal is the one publish would give. 🔒 Requires permission: pricebook:write. Gate UI with hasRequiredPermissions() from @vindentech/api-client.
69
+ * @summary Show what publishing the draft would do, without doing it
70
+ */
71
+ export const priceBookControllerPreviewV1 = async (id, previewPriceBookChangeSetDto, options) => {
72
+ const getHeaders = (h) => {
73
+ if (!h)
74
+ return {};
75
+ if (h instanceof Headers)
76
+ return Object.fromEntries(h.entries());
77
+ if (Array.isArray(h))
78
+ return Object.fromEntries(h);
79
+ return h;
80
+ };
81
+ return customFetch(getPriceBookControllerPreviewV1Url(id), {
82
+ ...options,
83
+ method: 'POST',
84
+ headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },
85
+ body: JSON.stringify(previewPriceBookChangeSetDto)
86
+ });
87
+ };
88
+ export const getPriceBookControllerPublishV1Url = (id) => {
89
+ return `/v1/billing/price-book/change-sets/${id}/publish`;
90
+ };
91
+ /**
92
+ * In one transaction: every edited section's live tenant-wide rules close at effectiveFrom (a rule published to start on or after it is retired instead), and the draft's rules go live from it. No approver. 🔒 Requires permission: pricebook:write. Gate UI with hasRequiredPermissions() from @vindentech/api-client.
93
+ * @summary Publish the draft on its effective date
94
+ */
95
+ export const priceBookControllerPublishV1 = async (id, publishPriceBookChangeSetDto, options) => {
96
+ const getHeaders = (h) => {
97
+ if (!h)
98
+ return {};
99
+ if (h instanceof Headers)
100
+ return Object.fromEntries(h.entries());
101
+ if (Array.isArray(h))
102
+ return Object.fromEntries(h);
103
+ return h;
104
+ };
105
+ return customFetch(getPriceBookControllerPublishV1Url(id), {
106
+ ...options,
107
+ method: 'POST',
108
+ headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },
109
+ body: JSON.stringify(publishPriceBookChangeSetDto)
110
+ });
111
+ };
112
+ export const getPriceBookControllerDiscardV1Url = (id) => {
113
+ return `/v1/billing/price-book/change-sets/${id}/discard`;
114
+ };
115
+ /**
116
+ * Deletes the draft's rules (they never priced anything) and closes the draft. 🔒 Requires permission: pricebook:write. Gate UI with hasRequiredPermissions() from @vindentech/api-client.
117
+ * @summary Discard the draft
118
+ */
119
+ export const priceBookControllerDiscardV1 = async (id, discardPriceBookChangeSetDto, options) => {
120
+ const getHeaders = (h) => {
121
+ if (!h)
122
+ return {};
123
+ if (h instanceof Headers)
124
+ return Object.fromEntries(h.entries());
125
+ if (Array.isArray(h))
126
+ return Object.fromEntries(h);
127
+ return h;
128
+ };
129
+ return customFetch(getPriceBookControllerDiscardV1Url(id), {
130
+ ...options,
131
+ method: 'POST',
132
+ headers: { 'Content-Type': 'application/json', ...getHeaders(options?.headers) },
133
+ body: JSON.stringify(discardPriceBookChangeSetDto)
134
+ });
135
+ };
136
+ //# sourceMappingURL=price-book.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"price-book.js","sourceRoot":"","sources":["../../../src/generated/price-book/price-book.ts"],"names":[],"mappings":"AAkBA,OAAO,EAAE,WAAW,EAAE,MAAM,kBAAkB,CAAC;AAU/C,CAAC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,CAAC,SAAS,CAAC,4BAA4B,CAAC;KACnD,CACF,CAAC;AAAA,CAAC,CAAA;AA2BH,MAAM,CAAC,MAAM,kCAAkC,GAAG,CAAC,EAAU,EAAG,EAAE;IAKhE,OAAO,sCAAsC,EAAE,UAAU,CAAA;AAC3D,CAAC,CAAA;AAED;;;GAGG;AACH,MAAM,CAAC,MAAM,4BAA4B,GAAG,KAAK,EAAE,EAAU,EACzD,4BAA0D,EAAE,OAA2C,EAAiD,EAAE;IAE1J,MAAM,UAAU,GAAG,CAAC,CAAuC,EAA8C,EAAE;QAC3G,IAAI,CAAC,CAAC;YAAE,OAAO,EAAE,CAAC;QAClB,IAAI,CAAC,YAAY,OAAO;YAAE,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,OAAO,EAAE,CAAC,CAAC;QACjE,IAAI,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;YAAE,OAAO,MAAM,CAAC,WAAW,CAAC,CAAC,CAAC,CAAC;QACnD,OAAO,CAAC,CAAC;IACX,CAAC,CAAC;IACJ,OAAO,WAAW,CAAuC,kCAAkC,CAAC,EAAE,CAAC,EAC7F;QACE,GAAG,OAAO;QACV,MAAM,EAAE,MAAM;QACd,OAAO,EAAE,EAAE,cAAc,EAAE,kBAAkB,EAAE,GAAG,UAAU,CAAC,OAAO,EAAE,OAAO,CAAC,EAAE;QAChF,IAAI,EAAE,IAAI,CAAC,SAAS,CAAC,4BAA4B,CAAC;KACnD,CACF,CAAC;AAAA,CAAC,CAAA"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@vindentech/api-client",
3
- "version": "0.3.0-next.75",
3
+ "version": "0.3.0-next.77",
4
4
  "description": "TypeScript SDK for the Vinden Core API. Generated from OpenAPI via orval.",
5
5
  "license": "UNLICENSED",
6
6
  "type": "module",