@learnorama/mozaik-sdk 0.12.3-staging.46.1 → 0.13.0-staging.48.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.
Files changed (266) hide show
  1. package/README.md +25 -0
  2. package/dist/api/account.d.ts +1 -1
  3. package/dist/api/account.js.map +1 -1
  4. package/dist/api/admin-catalogue.d.ts +1 -1
  5. package/dist/api/admin-catalogue.js.map +1 -1
  6. package/dist/api/admin-consumption.d.ts +1 -1
  7. package/dist/api/admin-consumption.js.map +1 -1
  8. package/dist/api/admin-contracts.d.ts +1 -1
  9. package/dist/api/admin-contracts.js.map +1 -1
  10. package/dist/api/admin-desk.d.ts +1 -1
  11. package/dist/api/admin-desk.js.map +1 -1
  12. package/dist/api/admin-licenses.d.ts +1 -1
  13. package/dist/api/admin-licenses.js.map +1 -1
  14. package/dist/api/admin-partner-selections.d.ts +1 -1
  15. package/dist/api/admin-partner-selections.js.map +1 -1
  16. package/dist/api/admin-patrons.d.ts +1 -1
  17. package/dist/api/admin-patrons.js.map +1 -1
  18. package/dist/api/admin-reviews.d.ts +1 -1
  19. package/dist/api/admin-reviews.js.map +1 -1
  20. package/dist/api/admin-roles.d.ts +1 -1
  21. package/dist/api/admin-roles.js.map +1 -1
  22. package/dist/api/admin-support.d.ts +1 -1
  23. package/dist/api/admin-support.js.map +1 -1
  24. package/dist/api/admin-tenants.d.ts +1 -1
  25. package/dist/api/admin-tenants.js.map +1 -1
  26. package/dist/api/admin-tutoring.d.ts +1 -1
  27. package/dist/api/admin-tutoring.js.map +1 -1
  28. package/dist/api/auth.d.ts +1 -1
  29. package/dist/api/auth.js.map +1 -1
  30. package/dist/api/biblio-billing-webhooks.d.ts +18 -0
  31. package/dist/api/biblio-billing-webhooks.js +62 -0
  32. package/dist/api/biblio-billing-webhooks.js.map +1 -0
  33. package/dist/api/biblio-billing.d.ts +192 -0
  34. package/dist/api/biblio-billing.js +645 -0
  35. package/dist/api/biblio-billing.js.map +1 -0
  36. package/dist/api/biblio-catalogue.d.ts +1 -1
  37. package/dist/api/biblio-catalogue.js.map +1 -1
  38. package/dist/api/biblio-home.d.ts +1 -1
  39. package/dist/api/biblio-home.js.map +1 -1
  40. package/dist/api/biblio-learning-author-profiles.d.ts +108 -0
  41. package/dist/api/biblio-learning-author-profiles.js +331 -0
  42. package/dist/api/biblio-learning-author-profiles.js.map +1 -0
  43. package/dist/api/biblio-learning-authoring.d.ts +168 -0
  44. package/dist/api/biblio-learning-authoring.js +586 -0
  45. package/dist/api/biblio-learning-authoring.js.map +1 -0
  46. package/dist/api/biblio-learning-editorial.d.ts +54 -0
  47. package/dist/api/biblio-learning-editorial.js +149 -0
  48. package/dist/api/biblio-learning-editorial.js.map +1 -0
  49. package/dist/api/biblio-learning-feedback.d.ts +60 -0
  50. package/dist/api/biblio-learning-feedback.js +180 -0
  51. package/dist/api/biblio-learning-feedback.js.map +1 -0
  52. package/dist/api/biblio-learning-finance.d.ts +186 -0
  53. package/dist/api/biblio-learning-finance.js +622 -0
  54. package/dist/api/biblio-learning-finance.js.map +1 -0
  55. package/dist/api/biblio-learning-integrations.d.ts +60 -0
  56. package/dist/api/biblio-learning-integrations.js +215 -0
  57. package/dist/api/biblio-learning-integrations.js.map +1 -0
  58. package/dist/api/biblio-learning-membership.d.ts +24 -0
  59. package/dist/api/biblio-learning-membership.js +69 -0
  60. package/dist/api/biblio-learning-membership.js.map +1 -0
  61. package/dist/api/biblio-learning.d.ts +222 -0
  62. package/dist/api/biblio-learning.js +697 -0
  63. package/dist/api/biblio-learning.js.map +1 -0
  64. package/dist/api/biblio-library.d.ts +1 -1
  65. package/dist/api/biblio-library.js.map +1 -1
  66. package/dist/api/biblio-nextory.d.ts +1 -1
  67. package/dist/api/biblio-nextory.js.map +1 -1
  68. package/dist/api/biblio-press.d.ts +1 -1
  69. package/dist/api/biblio-press.js.map +1 -1
  70. package/dist/api/biblio-search.d.ts +1 -1
  71. package/dist/api/biblio-search.js.map +1 -1
  72. package/dist/api/biblio-telemetry.d.ts +1 -1
  73. package/dist/api/biblio-telemetry.js.map +1 -1
  74. package/dist/api/consumption.d.ts +1 -1
  75. package/dist/api/consumption.js.map +1 -1
  76. package/dist/api/cvs-app.d.ts +1 -1
  77. package/dist/api/cvs-app.js.map +1 -1
  78. package/dist/api/cvs-documents.d.ts +1 -1
  79. package/dist/api/cvs-documents.js.map +1 -1
  80. package/dist/api/cvs-favorites.d.ts +1 -1
  81. package/dist/api/cvs-favorites.js.map +1 -1
  82. package/dist/api/cvs-ils.d.ts +1 -1
  83. package/dist/api/cvs-ils.js.map +1 -1
  84. package/dist/api/cvs-loans.d.ts +1 -1
  85. package/dist/api/cvs-loans.js.map +1 -1
  86. package/dist/api/cvs-payments.d.ts +1 -1
  87. package/dist/api/cvs-payments.js.map +1 -1
  88. package/dist/api/cvs-streaming.d.ts +1 -1
  89. package/dist/api/cvs-streaming.js.map +1 -1
  90. package/dist/api/index.d.ts +11 -1
  91. package/dist/api/index.js +11 -1
  92. package/dist/api/partner-catalogue.d.ts +1 -1
  93. package/dist/api/partner-catalogue.js.map +1 -1
  94. package/dist/api/partner-reader.d.ts +1 -1
  95. package/dist/api/partner-reader.js.map +1 -1
  96. package/dist/api/profiles.d.ts +1 -1
  97. package/dist/api/profiles.js.map +1 -1
  98. package/dist/api/search.d.ts +1 -1
  99. package/dist/api/search.js.map +1 -1
  100. package/dist/api/tutoring-catalogue.d.ts +1 -1
  101. package/dist/api/tutoring-catalogue.js.map +1 -1
  102. package/dist/api/tutoring-chat.d.ts +1 -1
  103. package/dist/api/tutoring-chat.js.map +1 -1
  104. package/dist/api/tutoring-dispatch.d.ts +1 -1
  105. package/dist/api/tutoring-dispatch.js.map +1 -1
  106. package/dist/api/tutoring-practitioner.d.ts +1 -1
  107. package/dist/api/tutoring-practitioner.js.map +1 -1
  108. package/dist/api/tutoring-requests.d.ts +1 -1
  109. package/dist/api/tutoring-requests.js.map +1 -1
  110. package/dist/chunks/client2.d.ts +1 -1
  111. package/dist/chunks/connection.d.ts +1 -1
  112. package/dist/chunks/index.d.ts +10062 -3487
  113. package/dist/index.d.ts +3 -3
  114. package/dist/index.js +3 -3
  115. package/dist/index.js.map +1 -1
  116. package/dist/models.d.ts +2 -2
  117. package/dist/models.js +329 -1
  118. package/dist/models.js.map +1 -1
  119. package/dist/react/account.d.ts +1 -1
  120. package/dist/react/account.js +1 -1
  121. package/dist/react/account.js.map +1 -1
  122. package/dist/react/admin-catalogue.d.ts +1 -1
  123. package/dist/react/admin-catalogue.js +1 -1
  124. package/dist/react/admin-catalogue.js.map +1 -1
  125. package/dist/react/admin-consumption.d.ts +1 -1
  126. package/dist/react/admin-consumption.js +1 -1
  127. package/dist/react/admin-consumption.js.map +1 -1
  128. package/dist/react/admin-contracts.d.ts +1 -1
  129. package/dist/react/admin-contracts.js +1 -1
  130. package/dist/react/admin-contracts.js.map +1 -1
  131. package/dist/react/admin-desk.d.ts +1 -1
  132. package/dist/react/admin-desk.js +1 -1
  133. package/dist/react/admin-desk.js.map +1 -1
  134. package/dist/react/admin-licenses.d.ts +1 -1
  135. package/dist/react/admin-licenses.js +1 -1
  136. package/dist/react/admin-licenses.js.map +1 -1
  137. package/dist/react/admin-partner-selections.d.ts +1 -1
  138. package/dist/react/admin-partner-selections.js +1 -1
  139. package/dist/react/admin-partner-selections.js.map +1 -1
  140. package/dist/react/admin-patrons.d.ts +1 -1
  141. package/dist/react/admin-patrons.js +1 -1
  142. package/dist/react/admin-patrons.js.map +1 -1
  143. package/dist/react/admin-reviews.d.ts +1 -1
  144. package/dist/react/admin-reviews.js +1 -1
  145. package/dist/react/admin-reviews.js.map +1 -1
  146. package/dist/react/admin-roles.d.ts +1 -1
  147. package/dist/react/admin-roles.js +1 -1
  148. package/dist/react/admin-roles.js.map +1 -1
  149. package/dist/react/admin-support.d.ts +1 -1
  150. package/dist/react/admin-support.js +1 -1
  151. package/dist/react/admin-support.js.map +1 -1
  152. package/dist/react/admin-tenants.d.ts +1 -1
  153. package/dist/react/admin-tenants.js +1 -1
  154. package/dist/react/admin-tenants.js.map +1 -1
  155. package/dist/react/admin-tutoring.d.ts +1 -1
  156. package/dist/react/admin-tutoring.js +1 -1
  157. package/dist/react/admin-tutoring.js.map +1 -1
  158. package/dist/react/auth.d.ts +1 -1
  159. package/dist/react/auth.js +1 -1
  160. package/dist/react/auth.js.map +1 -1
  161. package/dist/react/biblio-billing-webhooks.d.ts +56 -0
  162. package/dist/react/biblio-billing-webhooks.js +126 -0
  163. package/dist/react/biblio-billing-webhooks.js.map +1 -0
  164. package/dist/react/biblio-billing.d.ts +876 -0
  165. package/dist/react/biblio-billing.js +1491 -0
  166. package/dist/react/biblio-billing.js.map +1 -0
  167. package/dist/react/biblio-catalogue.d.ts +1 -1
  168. package/dist/react/biblio-catalogue.js +1 -1
  169. package/dist/react/biblio-catalogue.js.map +1 -1
  170. package/dist/react/biblio-home.d.ts +1 -1
  171. package/dist/react/biblio-home.js +1 -1
  172. package/dist/react/biblio-home.js.map +1 -1
  173. package/dist/react/biblio-learning-author-profiles.d.ts +513 -0
  174. package/dist/react/biblio-learning-author-profiles.js +795 -0
  175. package/dist/react/biblio-learning-author-profiles.js.map +1 -0
  176. package/dist/react/biblio-learning-authoring.d.ts +745 -0
  177. package/dist/react/biblio-learning-authoring.js +1335 -0
  178. package/dist/react/biblio-learning-authoring.js.map +1 -0
  179. package/dist/react/biblio-learning-editorial.d.ts +264 -0
  180. package/dist/react/biblio-learning-editorial.js +371 -0
  181. package/dist/react/biblio-learning-editorial.js.map +1 -0
  182. package/dist/react/biblio-learning-feedback.d.ts +280 -0
  183. package/dist/react/biblio-learning-feedback.js +433 -0
  184. package/dist/react/biblio-learning-feedback.js.map +1 -0
  185. package/dist/react/biblio-learning-finance.d.ts +868 -0
  186. package/dist/react/biblio-learning-finance.js +1439 -0
  187. package/dist/react/biblio-learning-finance.js.map +1 -0
  188. package/dist/react/biblio-learning-integrations.d.ts +237 -0
  189. package/dist/react/biblio-learning-integrations.js +483 -0
  190. package/dist/react/biblio-learning-integrations.js.map +1 -0
  191. package/dist/react/biblio-learning-membership.d.ts +99 -0
  192. package/dist/react/biblio-learning-membership.js +165 -0
  193. package/dist/react/biblio-learning-membership.js.map +1 -0
  194. package/dist/react/biblio-learning.d.ts +1047 -0
  195. package/dist/react/biblio-learning.js +1667 -0
  196. package/dist/react/biblio-learning.js.map +1 -0
  197. package/dist/react/biblio-library.d.ts +1 -1
  198. package/dist/react/biblio-library.js +1 -1
  199. package/dist/react/biblio-library.js.map +1 -1
  200. package/dist/react/biblio-nextory.d.ts +1 -1
  201. package/dist/react/biblio-nextory.js +1 -1
  202. package/dist/react/biblio-nextory.js.map +1 -1
  203. package/dist/react/biblio-press.d.ts +1 -1
  204. package/dist/react/biblio-press.js +1 -1
  205. package/dist/react/biblio-press.js.map +1 -1
  206. package/dist/react/biblio-search.d.ts +1 -1
  207. package/dist/react/biblio-search.js +1 -1
  208. package/dist/react/biblio-search.js.map +1 -1
  209. package/dist/react/biblio-telemetry.d.ts +1 -1
  210. package/dist/react/biblio-telemetry.js +1 -1
  211. package/dist/react/biblio-telemetry.js.map +1 -1
  212. package/dist/react/chat.d.ts +1 -1
  213. package/dist/react/consumption.d.ts +1 -1
  214. package/dist/react/consumption.js +1 -1
  215. package/dist/react/consumption.js.map +1 -1
  216. package/dist/react/cvs-app.d.ts +1 -1
  217. package/dist/react/cvs-app.js +1 -1
  218. package/dist/react/cvs-app.js.map +1 -1
  219. package/dist/react/cvs-documents.d.ts +1 -1
  220. package/dist/react/cvs-documents.js +1 -1
  221. package/dist/react/cvs-documents.js.map +1 -1
  222. package/dist/react/cvs-favorites.d.ts +1 -1
  223. package/dist/react/cvs-favorites.js +1 -1
  224. package/dist/react/cvs-favorites.js.map +1 -1
  225. package/dist/react/cvs-ils.d.ts +1 -1
  226. package/dist/react/cvs-ils.js +1 -1
  227. package/dist/react/cvs-ils.js.map +1 -1
  228. package/dist/react/cvs-loans.d.ts +1 -1
  229. package/dist/react/cvs-loans.js +1 -1
  230. package/dist/react/cvs-loans.js.map +1 -1
  231. package/dist/react/cvs-payments.d.ts +1 -1
  232. package/dist/react/cvs-payments.js +1 -1
  233. package/dist/react/cvs-payments.js.map +1 -1
  234. package/dist/react/cvs-streaming.d.ts +1 -1
  235. package/dist/react/cvs-streaming.js +1 -1
  236. package/dist/react/cvs-streaming.js.map +1 -1
  237. package/dist/react/index.d.ts +11 -1
  238. package/dist/react/index.js +11 -1
  239. package/dist/react/partner-catalogue.d.ts +1 -1
  240. package/dist/react/partner-catalogue.js +1 -1
  241. package/dist/react/partner-catalogue.js.map +1 -1
  242. package/dist/react/partner-reader.d.ts +1 -1
  243. package/dist/react/partner-reader.js +1 -1
  244. package/dist/react/partner-reader.js.map +1 -1
  245. package/dist/react/profiles.d.ts +1 -1
  246. package/dist/react/profiles.js +1 -1
  247. package/dist/react/profiles.js.map +1 -1
  248. package/dist/react/search.d.ts +1 -1
  249. package/dist/react/search.js +1 -1
  250. package/dist/react/search.js.map +1 -1
  251. package/dist/react/tutoring-catalogue.d.ts +1 -1
  252. package/dist/react/tutoring-catalogue.js +1 -1
  253. package/dist/react/tutoring-catalogue.js.map +1 -1
  254. package/dist/react/tutoring-chat.d.ts +1 -1
  255. package/dist/react/tutoring-chat.js +1 -1
  256. package/dist/react/tutoring-chat.js.map +1 -1
  257. package/dist/react/tutoring-dispatch.d.ts +1 -1
  258. package/dist/react/tutoring-dispatch.js +1 -1
  259. package/dist/react/tutoring-dispatch.js.map +1 -1
  260. package/dist/react/tutoring-practitioner.d.ts +1 -1
  261. package/dist/react/tutoring-practitioner.js +1 -1
  262. package/dist/react/tutoring-practitioner.js.map +1 -1
  263. package/dist/react/tutoring-requests.d.ts +1 -1
  264. package/dist/react/tutoring-requests.js +1 -1
  265. package/dist/react/tutoring-requests.js.map +1 -1
  266. package/package.json +7 -7
@@ -0,0 +1,645 @@
1
+
2
+ import { r as request } from "../chunks/client.js";
3
+ //#region src/api/biblio-billing/biblio-billing.ts
4
+ const getBillingCreateProductUrl = (catalogueId) => {
5
+ return `/billing/catalogues/${catalogueId}/products`;
6
+ };
7
+ /**
8
+ * A global commercial operator creates an offer and its server-owned net price/tax. New offers default to inactive. Fixed offers need accessMonths or an institutional template; recurring offers cannot use a template. Retention offers require the customer's dated agreement. Requires high-assurance authentication.
9
+ * @summary Create a catalogue billing offer
10
+ */
11
+ const billingCreateProduct = async (catalogueId, billingProductWrite, options) => {
12
+ const getHeaders = (h) => {
13
+ if (!h) return {};
14
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
15
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
16
+ const headers = {};
17
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
18
+ return headers;
19
+ };
20
+ return request(getBillingCreateProductUrl(catalogueId), {
21
+ ...options,
22
+ method: "POST",
23
+ headers: {
24
+ "Content-Type": "application/json",
25
+ ...getHeaders(options?.headers)
26
+ },
27
+ body: JSON.stringify(billingProductWrite)
28
+ });
29
+ };
30
+ const getBillingGeneratePromotionsUrl = (catalogueId) => {
31
+ return `/billing/catalogues/${catalogueId}/promotion-batches`;
32
+ };
33
+ /**
34
+ * Create 1–500 independent rules and encrypted distribution codes atomically from one reviewed template. Each code is the optional prefix followed by 20 unambiguous characters; rule.code must be null. rule.quantity is stock per generated rule, not the number of codes. Requires global commercial authority. Requires high-assurance authentication.
35
+ * @summary Generate a bounded promotion-code batch
36
+ */
37
+ const billingGeneratePromotions = async (catalogueId, promotionGeneratorWrite, options) => {
38
+ const getHeaders = (h) => {
39
+ if (!h) return {};
40
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
41
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
42
+ const headers = {};
43
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
44
+ return headers;
45
+ };
46
+ return request(getBillingGeneratePromotionsUrl(catalogueId), {
47
+ ...options,
48
+ method: "POST",
49
+ headers: {
50
+ "Content-Type": "application/json",
51
+ ...getHeaders(options?.headers)
52
+ },
53
+ body: JSON.stringify(promotionGeneratorWrite)
54
+ });
55
+ };
56
+ const getBillingPromotionGeneratorsUrl = (catalogueId, params) => {
57
+ const normalizedParams = new URLSearchParams();
58
+ Object.entries(params || {}).forEach(([key, value]) => {
59
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
60
+ });
61
+ const stringifiedParams = normalizedParams.toString();
62
+ return stringifiedParams.length > 0 ? `/billing/catalogues/${catalogueId}/promotion-generators?${stringifiedParams}` : `/billing/catalogues/${catalogueId}/promotion-generators`;
63
+ };
64
+ /**
65
+ * Global commercial operators list safe generator definitions, newest first. Includes historical sourceMask and partial rule fields when known; codes and private source metadata require a separate audited export.
66
+ * @summary List catalogue promotion generators
67
+ */
68
+ const billingPromotionGenerators = async (catalogueId, params, options) => {
69
+ return request(getBillingPromotionGeneratorsUrl(catalogueId, params), {
70
+ ...options,
71
+ method: "GET"
72
+ });
73
+ };
74
+ const getBillingListPromotionsUrl = (catalogueId, params) => {
75
+ const normalizedParams = new URLSearchParams();
76
+ Object.entries(params || {}).forEach(([key, value]) => {
77
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
78
+ });
79
+ const stringifiedParams = normalizedParams.toString();
80
+ return stringifiedParams.length > 0 ? `/billing/catalogues/${catalogueId}/promotions?${stringifiedParams}` : `/billing/catalogues/${catalogueId}/promotions`;
81
+ };
82
+ /**
83
+ * Catalogue finance operators list rule metadata, including inactive rules, ordered by promotion ID. Codes are deliberately omitted; explicit audited reveal or export is required to distribute codes.
84
+ * @summary List catalogue promotion rules
85
+ */
86
+ const billingListPromotions = async (catalogueId, params, options) => {
87
+ return request(getBillingListPromotionsUrl(catalogueId, params), {
88
+ ...options,
89
+ method: "GET"
90
+ });
91
+ };
92
+ const getBillingCreatePromotionUrl = (catalogueId) => {
93
+ return `/billing/catalogues/${catalogueId}/promotions`;
94
+ };
95
+ /**
96
+ * A global commercial operator creates bounded promotion stock for a catalogue. Discounts apply to explicit checkouts; benefits without payment-method requirements can be redeemed directly. Null code generates three groups of six unambiguous characters. Explicit codes retain their display form; lookup uses NFKC, trim and casefold normalization. Targets must belong to the catalogue. Requires high-assurance authentication.
97
+ * @summary Create a discount or access benefit
98
+ */
99
+ const billingCreatePromotion = async (catalogueId, promotionWrite, options) => {
100
+ const getHeaders = (h) => {
101
+ if (!h) return {};
102
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
103
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
104
+ const headers = {};
105
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
106
+ return headers;
107
+ };
108
+ return request(getBillingCreatePromotionUrl(catalogueId), {
109
+ ...options,
110
+ method: "POST",
111
+ headers: {
112
+ "Content-Type": "application/json",
113
+ ...getHeaders(options?.headers)
114
+ },
115
+ body: JSON.stringify(promotionWrite)
116
+ });
117
+ };
118
+ const getBillingExportPromotionCodesUrl = (catalogueId) => {
119
+ return `/billing/catalogues/${catalogueId}/promotions/export`;
120
+ };
121
+ /**
122
+ * Global commercial operators decrypt selected catalogue codes in one audited transaction. Supply unique promotionIds and a reason; all IDs must belong to the selected catalogue or the entire export is refused. The JSON data is ordered by promotion ID. Responses are private, no-store. Requires high-assurance authentication.
123
+ * @summary Export selected promotion codes with an audit reason
124
+ */
125
+ const billingExportPromotionCodes = async (catalogueId, promotionExportWrite, options) => {
126
+ const getHeaders = (h) => {
127
+ if (!h) return {};
128
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
129
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
130
+ const headers = {};
131
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
132
+ return headers;
133
+ };
134
+ return request(getBillingExportPromotionCodesUrl(catalogueId), {
135
+ ...options,
136
+ method: "POST",
137
+ headers: {
138
+ "Content-Type": "application/json",
139
+ ...getHeaders(options?.headers)
140
+ },
141
+ body: JSON.stringify(promotionExportWrite)
142
+ });
143
+ };
144
+ const getBillingQuoteCheckoutUrl = () => {
145
+ return `/billing/checkouts`;
146
+ };
147
+ /**
148
+ * Freeze server-priced purchase and renewal terms for 15 minutes and reserve promotion stock. Reuse requestKey with the same product and normalized promotion set to retrieve the same checkout; changing either under the same key returns 409. No payment is submitted by quoting. Display recurring, renewalAmount and expiresAt before obtaining consent. A fully discounted offer without a required payment method can become fixed access without renewal. Uses the authenticated independent profile in the Biblio product context; support impersonation is refused. Responses are private and must not be cached. Requires high-assurance authentication.
149
+ * @summary Quote a personal checkout
150
+ */
151
+ const billingQuoteCheckout = async (billingQuoteWrite, options) => {
152
+ const getHeaders = (h) => {
153
+ if (!h) return {};
154
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
155
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
156
+ const headers = {};
157
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
158
+ return headers;
159
+ };
160
+ return request(getBillingQuoteCheckoutUrl(), {
161
+ ...options,
162
+ method: "POST",
163
+ headers: {
164
+ "Content-Type": "application/json",
165
+ ...getHeaders(options?.headers)
166
+ },
167
+ body: JSON.stringify(billingQuoteWrite)
168
+ });
169
+ };
170
+ const getBillingReadCheckoutUrl = (checkoutId) => {
171
+ return `/billing/checkouts/${checkoutId}`;
172
+ };
173
+ /**
174
+ * Return persisted quote and outcome without contacting the payment provider. A submitting or unknown checkout requires the explicit reconcile operation; reading it does not retry payment. Uses the authenticated independent profile in the Biblio product context; support impersonation is refused. Responses are private and must not be cached.
175
+ * @summary Read the current profile's checkout
176
+ */
177
+ const billingReadCheckout = async (checkoutId, options) => {
178
+ return request(getBillingReadCheckoutUrl(checkoutId), {
179
+ ...options,
180
+ method: "GET"
181
+ });
182
+ };
183
+ const getBillingReconcileCheckoutUrl = (checkoutId) => {
184
+ return `/billing/checkouts/${checkoutId}/reconcile`;
185
+ };
186
+ /**
187
+ * Look up provider evidence using the checkout's existing operation identity and complete the same purchase when a matching receipt is found. This never resubmits payment. An absent receipt leaves the checkout submitting or unknown; terminal and quoted states are returned unchanged. Environment and quote integrity must match before access can be granted. Uses the authenticated independent profile in the Biblio product context; support impersonation is refused. Responses are private and must not be cached. Requires high-assurance authentication.
188
+ * @summary Reconcile an uncertain checkout
189
+ */
190
+ const billingReconcileCheckout = async (checkoutId, options) => {
191
+ return request(getBillingReconcileCheckoutUrl(checkoutId), {
192
+ ...options,
193
+ method: "POST"
194
+ });
195
+ };
196
+ const getBillingSubmitCheckoutUrl = (checkoutId) => {
197
+ return `/billing/checkouts/${checkoutId}/submit`;
198
+ };
199
+ /**
200
+ * Submit the owned quote with acceptedTerms=true and a single-use provider nonce when payment or renewal requires it. Completed, submitting and unknown checkouts are returned without another charge. HTTP 200 alone does not mean payment succeeded: complete confirms the receipt, failed records a refusal, and unknown preserves an ambiguous provider outcome. Reconcile the same checkout after uncertainty; do not create a replacement payment. Uses the authenticated independent profile in the Biblio product context; support impersonation is refused. Responses are private and must not be cached. Requires high-assurance authentication.
201
+ * @summary Submit an accepted checkout
202
+ */
203
+ const billingSubmitCheckout = async (checkoutId, billingCheckoutSubmitWrite, options) => {
204
+ const getHeaders = (h) => {
205
+ if (!h) return {};
206
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
207
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
208
+ const headers = {};
209
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
210
+ return headers;
211
+ };
212
+ return request(getBillingSubmitCheckoutUrl(checkoutId), {
213
+ ...options,
214
+ method: "POST",
215
+ headers: {
216
+ "Content-Type": "application/json",
217
+ ...getHeaders(options?.headers)
218
+ },
219
+ body: JSON.stringify(billingCheckoutSubmitWrite)
220
+ });
221
+ };
222
+ const getBillingCreateClientTokenUrl = () => {
223
+ return `/billing/client-token`;
224
+ };
225
+ /**
226
+ * Obtain a Braintree client token for an owned, unexpired quoted checkout in the current environment. Pass it to the provider SDK to collect a single-use paymentMethodNonce, then submit the checkout. The token is sensitive and must not be logged or persisted in client analytics. Uses the authenticated independent profile in the Biblio product context; support impersonation is refused. Responses are private and must not be cached. Requires high-assurance authentication.
227
+ * @summary Create a checkout payment client token
228
+ */
229
+ const billingCreateClientToken = async (billingClientTokenWrite, options) => {
230
+ const getHeaders = (h) => {
231
+ if (!h) return {};
232
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
233
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
234
+ const headers = {};
235
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
236
+ return headers;
237
+ };
238
+ return request(getBillingCreateClientTokenUrl(), {
239
+ ...options,
240
+ method: "POST",
241
+ headers: {
242
+ "Content-Type": "application/json",
243
+ ...getHeaders(options?.headers)
244
+ },
245
+ body: JSON.stringify(billingClientTokenWrite)
246
+ });
247
+ };
248
+ const getBillingPrepareIdentityUrl = () => {
249
+ return `/billing/identity`;
250
+ };
251
+ /**
252
+ * Return or create the stable server-issued billing subject for the selected provider in the configured environment. Supply this subject to the mobile billing SDK; never substitute a profile ID or email. This explicit request does not grant course access or charge a payment method. Uses the authenticated independent profile in the Biblio product context; support impersonation is refused. Responses are private and must not be cached. Requires high-assurance authentication.
253
+ * @summary Prepare the current profile's billing identity
254
+ */
255
+ const billingPrepareIdentity = async (billingIdentityWrite, options) => {
256
+ const getHeaders = (h) => {
257
+ if (!h) return {};
258
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
259
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
260
+ const headers = {};
261
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
262
+ return headers;
263
+ };
264
+ return request(getBillingPrepareIdentityUrl(), {
265
+ ...options,
266
+ method: "POST",
267
+ headers: {
268
+ "Content-Type": "application/json",
269
+ ...getHeaders(options?.headers)
270
+ },
271
+ body: JSON.stringify(billingIdentityWrite)
272
+ });
273
+ };
274
+ const getBillingListProductsUrl = (params) => {
275
+ const normalizedParams = new URLSearchParams();
276
+ Object.entries(params || {}).forEach(([key, value]) => {
277
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
278
+ });
279
+ const stringifiedParams = normalizedParams.toString();
280
+ return stringifiedParams.length > 0 ? `/billing/products?${stringifiedParams}` : `/billing/products`;
281
+ };
282
+ /**
283
+ * List active offers visible to the profile, with server-calculated tax-inclusive prices. Retention offers appear only within seven days of their exact institution agreement's end. checkoutAvailable reflects configured web payment capability; providerProducts identifies active mappings in the current billing environment. Listing never starts a purchase. Uses the authenticated independent profile in the Biblio product context; support impersonation is refused. Responses are private and must not be cached.
284
+ * @summary List personal purchase offers
285
+ */
286
+ const billingListProducts = async (params, options) => {
287
+ return request(getBillingListProductsUrl(params), {
288
+ ...options,
289
+ method: "GET"
290
+ });
291
+ };
292
+ const getBillingSetOfferAvailabilityUrl = (productId) => {
293
+ return `/billing/products/${productId}/availability`;
294
+ };
295
+ /**
296
+ * Set offer availability after commercial review and record the reason in the audit trail. Requires catalogue finance and global commercial authority. Returns 204 with no response body. Requires high-assurance authentication.
297
+ * @summary Activate or withdraw an offer
298
+ */
299
+ const billingSetOfferAvailability = async (productId, billingProductAvailabilityWrite, options) => {
300
+ const getHeaders = (h) => {
301
+ if (!h) return {};
302
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
303
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
304
+ const headers = {};
305
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
306
+ return headers;
307
+ };
308
+ return request(getBillingSetOfferAvailabilityUrl(productId), {
309
+ ...options,
310
+ method: "PUT",
311
+ headers: {
312
+ "Content-Type": "application/json",
313
+ ...getHeaders(options?.headers)
314
+ },
315
+ body: JSON.stringify(billingProductAvailabilityWrite)
316
+ });
317
+ };
318
+ const getBillingBindProviderProductUrl = (productId) => {
319
+ return `/billing/products/${productId}/provider`;
320
+ };
321
+ /**
322
+ * Catalogue finance operators associate an offer with an exact provider product and sandbox or production environment. A provider/environment/product identifier cannot be shared by different offers. Store products must be public recurring offers. Returns 204 with no response body. Requires high-assurance authentication.
323
+ * @summary Bind an offer to a provider product
324
+ */
325
+ const billingBindProviderProduct = async (productId, billingProviderProductWrite, options) => {
326
+ const getHeaders = (h) => {
327
+ if (!h) return {};
328
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
329
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
330
+ const headers = {};
331
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
332
+ return headers;
333
+ };
334
+ return request(getBillingBindProviderProductUrl(productId), {
335
+ ...options,
336
+ method: "PUT",
337
+ headers: {
338
+ "Content-Type": "application/json",
339
+ ...getHeaders(options?.headers)
340
+ },
341
+ body: JSON.stringify(billingProviderProductWrite)
342
+ });
343
+ };
344
+ const getBillingPromotionGeneratorUrl = (generatorId) => {
345
+ return `/billing/promotion-generators/${generatorId}`;
346
+ };
347
+ /**
348
+ * Return a safe definition to a global commercial operator. batchSize counts generated codes while rule.quantity describes permitted uses of each code. Historical missing rule values stay null.
349
+ * @summary Read a promotion generator definition
350
+ */
351
+ const billingPromotionGenerator = async (generatorId, options) => {
352
+ return request(getBillingPromotionGeneratorUrl(generatorId), {
353
+ ...options,
354
+ method: "GET"
355
+ });
356
+ };
357
+ const getBillingRedeemPromotionUrl = () => {
358
+ return `/billing/promotions/redeem`;
359
+ };
360
+ /**
361
+ * Redeem a usable benefit code that does not require a payment method, atomically consuming stock and creating personal access through shared contracts. Discounts use checkout instead. Reusing requestKey for the same promotion returns the previous redemption; reuse for another code returns 409. Case/Unicode-normalized lookup, per-user stock and access-window limits apply. Uses the authenticated independent profile in the Biblio product context; support impersonation is refused. Responses are private and must not be cached. Requires high-assurance authentication.
362
+ * @summary Redeem an access benefit for the current profile
363
+ */
364
+ const billingRedeemPromotion = async (promotionRedeemWrite, options) => {
365
+ const getHeaders = (h) => {
366
+ if (!h) return {};
367
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
368
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
369
+ const headers = {};
370
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
371
+ return headers;
372
+ };
373
+ return request(getBillingRedeemPromotionUrl(), {
374
+ ...options,
375
+ method: "POST",
376
+ headers: {
377
+ "Content-Type": "application/json",
378
+ ...getHeaders(options?.headers)
379
+ },
380
+ body: JSON.stringify(promotionRedeemWrite)
381
+ });
382
+ };
383
+ const getBillingPromotionCapacityUrl = (promotionId) => {
384
+ return `/billing/promotions/${promotionId}/capacity`;
385
+ };
386
+ /**
387
+ * Global commercial operators inspect total and per-user limits, redeemed stock and live reservations. Submitting or unknown checkouts keep reservations even after quote expiry. remaining is max(0, quantity - redeemed - reserved); a positive count alone does not prove a rule is active or usable.
388
+ * @summary Inspect promotion stock and payment reservations
389
+ */
390
+ const billingPromotionCapacity = async (promotionId, options) => {
391
+ return request(getBillingPromotionCapacityUrl(promotionId), {
392
+ ...options,
393
+ method: "GET"
394
+ });
395
+ };
396
+ const getBillingRevealPromotionCodeUrl = (promotionId) => {
397
+ return `/billing/promotions/${promotionId}/code`;
398
+ };
399
+ /**
400
+ * A catalogue finance operator decrypts one distribution code and records the supplied reason. The response is private, no-store; do not expose it in public reports. Requires high-assurance authentication.
401
+ * @summary Reveal one promotion code with an audit reason
402
+ */
403
+ const billingRevealPromotionCode = async (promotionId, promotionRevealWrite, options) => {
404
+ const getHeaders = (h) => {
405
+ if (!h) return {};
406
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
407
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
408
+ const headers = {};
409
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
410
+ return headers;
411
+ };
412
+ return request(getBillingRevealPromotionCodeUrl(promotionId), {
413
+ ...options,
414
+ method: "POST",
415
+ headers: {
416
+ "Content-Type": "application/json",
417
+ ...getHeaders(options?.headers)
418
+ },
419
+ body: JSON.stringify(promotionRevealWrite)
420
+ });
421
+ };
422
+ const getBillingPromotionRedemptionsUrl = (promotionId, params) => {
423
+ const normalizedParams = new URLSearchParams();
424
+ Object.entries(params || {}).forEach(([key, value]) => {
425
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
426
+ });
427
+ const stringifiedParams = normalizedParams.toString();
428
+ return stringifiedParams.length > 0 ? `/billing/promotions/${promotionId}/redemptions?${stringifiedParams}` : `/billing/promotions/${promotionId}/redemptions`;
429
+ };
430
+ /**
431
+ * Global commercial operators list a promotion's native and imported redemptions, newest first. Historical beneficiary, contract, transaction, discount and time references can be null; do not infer a payment from a redemption. Codes and raw source identifiers are omitted.
432
+ * @summary List promotion redemption evidence
433
+ */
434
+ const billingPromotionRedemptions = async (promotionId, params, options) => {
435
+ return request(getBillingPromotionRedemptionsUrl(promotionId, params), {
436
+ ...options,
437
+ method: "GET"
438
+ });
439
+ };
440
+ const getBillingRestoreStorePurchasesUrl = () => {
441
+ return `/billing/store/restore`;
442
+ };
443
+ /**
444
+ * Fetch RevenueCat evidence for the server-issued billing subject and reconcile supported store receipts in the current environment with active provider mappings. Receipts belonging to another profile are refused. Unknown receipt price, tax or renewal values stay unknown. The returned page contains restored subscriptions and can be empty; there is no client-supplied receipt-owner ID. Uses the authenticated independent profile in the Biblio product context; support impersonation is refused. Responses are private and must not be cached. Requires high-assurance authentication.
445
+ * @summary Restore the current profile's mobile purchases
446
+ */
447
+ const billingRestoreStorePurchases = async (billingIdentityWrite, options) => {
448
+ const getHeaders = (h) => {
449
+ if (!h) return {};
450
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
451
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
452
+ const headers = {};
453
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
454
+ return headers;
455
+ };
456
+ return request(getBillingRestoreStorePurchasesUrl(), {
457
+ ...options,
458
+ method: "POST",
459
+ headers: {
460
+ "Content-Type": "application/json",
461
+ ...getHeaders(options?.headers)
462
+ },
463
+ body: JSON.stringify(billingIdentityWrite)
464
+ });
465
+ };
466
+ const getBillingListSubscriptionsUrl = (params) => {
467
+ const normalizedParams = new URLSearchParams();
468
+ Object.entries(params || {}).forEach(([key, value]) => {
469
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
470
+ });
471
+ const stringifiedParams = normalizedParams.toString();
472
+ return stringifiedParams.length > 0 ? `/billing/subscriptions?${stringifiedParams}` : `/billing/subscriptions`;
473
+ };
474
+ /**
475
+ * List local subscription projections, newest first. No provider refresh occurs. autoRenew=null means renewal is unknown, and unknown historical price/currency remain null; use explicit reconciliation or store restoration to obtain current evidence. Uses the authenticated independent profile in the Biblio product context; support impersonation is refused. Responses are private and must not be cached.
476
+ * @summary List the current profile's subscriptions
477
+ */
478
+ const billingListSubscriptions = async (params, options) => {
479
+ return request(getBillingListSubscriptionsUrl(params), {
480
+ ...options,
481
+ method: "GET"
482
+ });
483
+ };
484
+ const getBillingReadSubscriptionUrl = (subscriptionId) => {
485
+ return `/billing/subscriptions/${subscriptionId}`;
486
+ };
487
+ /**
488
+ * Read the local subscription and its known access, price and renewal terms. managementUrl is provided for mobile store subscriptions. This GET neither refreshes receipts nor changes renewal. Uses the authenticated independent profile in the Biblio product context; support impersonation is refused. Responses are private and must not be cached.
489
+ * @summary Read the current profile's subscription
490
+ */
491
+ const billingReadSubscription = async (subscriptionId, options) => {
492
+ return request(getBillingReadSubscriptionUrl(subscriptionId), {
493
+ ...options,
494
+ method: "GET"
495
+ });
496
+ };
497
+ const getBillingCancelSubscriptionUrl = (subscriptionId) => {
498
+ return `/billing/subscriptions/${subscriptionId}/cancel`;
499
+ };
500
+ /**
501
+ * Cancel Braintree renewal and project the provider-confirmed access end, or cancel a local fixed subscription. Existing paid access follows the confirmed period. Optional feedback is stored separately. Mobile store renewal must be managed through managementUrl; this operation returns 409 for stores. Uses the authenticated independent profile in the Biblio product context; support impersonation is refused. Responses are private and must not be cached. Requires high-assurance authentication.
502
+ * @summary Cancel a personal subscription's renewal
503
+ */
504
+ const billingCancelSubscription = async (subscriptionId, billingCancelWrite, options) => {
505
+ const getHeaders = (h) => {
506
+ if (!h) return {};
507
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
508
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
509
+ const headers = {};
510
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
511
+ return headers;
512
+ };
513
+ return request(getBillingCancelSubscriptionUrl(subscriptionId), {
514
+ ...options,
515
+ method: "POST",
516
+ headers: {
517
+ "Content-Type": "application/json",
518
+ ...getHeaders(options?.headers)
519
+ },
520
+ body: JSON.stringify(billingCancelWrite)
521
+ });
522
+ };
523
+ const getBillingCancellationFeedbackUrl = (subscriptionId, params) => {
524
+ const normalizedParams = new URLSearchParams();
525
+ Object.entries(params || {}).forEach(([key, value]) => {
526
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
527
+ });
528
+ const stringifiedParams = normalizedParams.toString();
529
+ return stringifiedParams.length > 0 ? `/billing/subscriptions/${subscriptionId}/cancellation-feedback?${stringifiedParams}` : `/billing/subscriptions/${subscriptionId}/cancellation-feedback`;
530
+ };
531
+ /**
532
+ * List only this profile's recorded cancellation feedback for the owned subscription, newest first. Missing historical answers and dates stay null. Feedback is not evidence of current provider renewal state. Uses the authenticated independent profile in the Biblio product context; support impersonation is refused. Responses are private and must not be cached.
533
+ * @summary List an owned subscription's cancellation feedback
534
+ */
535
+ const billingCancellationFeedback = async (subscriptionId, params, options) => {
536
+ return request(getBillingCancellationFeedbackUrl(subscriptionId, params), {
537
+ ...options,
538
+ method: "GET"
539
+ });
540
+ };
541
+ const getBillingSubscriptionClientTokenUrl = (subscriptionId) => {
542
+ return `/billing/subscriptions/${subscriptionId}/client-token`;
543
+ };
544
+ /**
545
+ * Initialize payment-method collection for an owned Braintree subscription whose renewal is confirmed active. Unknown renewal must be reconciled first; store and nonrenewing subscriptions are not editable here. Uses the authenticated independent profile in the Biblio product context; support impersonation is refused. Responses are private and must not be cached. Requires high-assurance authentication.
546
+ * @summary Create a subscription payment-method token
547
+ */
548
+ const billingSubscriptionClientToken = async (subscriptionId, options) => {
549
+ return request(getBillingSubscriptionClientTokenUrl(subscriptionId), {
550
+ ...options,
551
+ method: "POST"
552
+ });
553
+ };
554
+ const getBillingSubscriptionHistoryUrl = (subscriptionId, params) => {
555
+ const normalizedParams = new URLSearchParams();
556
+ Object.entries(params || {}).forEach(([key, value]) => {
557
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
558
+ });
559
+ const stringifiedParams = normalizedParams.toString();
560
+ return stringifiedParams.length > 0 ? `/billing/subscriptions/${subscriptionId}/history?${stringifiedParams}` : `/billing/subscriptions/${subscriptionId}/history`;
561
+ };
562
+ /**
563
+ * List preserved subscription events, newest local identifier first. Source status and transactionType are evidence labels, not current renewal guarantees. Unknown source times remain null with clockBasis; amount may also be null and this projection does not supply a currency. Uses the authenticated independent profile in the Biblio product context; support impersonation is refused. Responses are private and must not be cached.
564
+ * @summary List an owned subscription's source events
565
+ */
566
+ const billingSubscriptionHistory = async (subscriptionId, params, options) => {
567
+ return request(getBillingSubscriptionHistoryUrl(subscriptionId, params), {
568
+ ...options,
569
+ method: "GET"
570
+ });
571
+ };
572
+ const getBillingUpdatePaymentMethodUrl = (subscriptionId) => {
573
+ return `/billing/subscriptions/${subscriptionId}/payment-method`;
574
+ };
575
+ /**
576
+ * Use a new provider SDK nonce to update the current profile's renewing Braintree subscription and apply the returned receipt. acceptedOutstandingBalance explicitly allows collection of an outstanding balance; it defaults to false. Store subscriptions use their original provider. Uses the authenticated independent profile in the Biblio product context; support impersonation is refused. Responses are private and must not be cached. Requires high-assurance authentication.
577
+ * @summary Update a renewing subscription's payment method
578
+ */
579
+ const billingUpdatePaymentMethod = async (subscriptionId, billingPaymentMethodWrite, options) => {
580
+ const getHeaders = (h) => {
581
+ if (!h) return {};
582
+ if (h instanceof Headers) return Object.fromEntries(h.entries());
583
+ if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
584
+ const headers = {};
585
+ for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
586
+ return headers;
587
+ };
588
+ return request(getBillingUpdatePaymentMethodUrl(subscriptionId), {
589
+ ...options,
590
+ method: "PUT",
591
+ headers: {
592
+ "Content-Type": "application/json",
593
+ ...getHeaders(options?.headers)
594
+ },
595
+ body: JSON.stringify(billingPaymentMethodWrite)
596
+ });
597
+ };
598
+ const getBillingReconcileSubscriptionUrl = (subscriptionId) => {
599
+ return `/billing/subscriptions/${subscriptionId}/reconcile`;
600
+ };
601
+ /**
602
+ * Read the existing Braintree subscription, refresh authoritative renewal/access terms and project shared contract access. The existing provider identity and current billing environment must match. Use store restoration for App Store and Play Store subscriptions. Uses the authenticated independent profile in the Biblio product context; support impersonation is refused. Responses are private and must not be cached. Requires high-assurance authentication.
603
+ * @summary Refresh a Braintree subscription from its receipt
604
+ */
605
+ const billingReconcileSubscription = async (subscriptionId, options) => {
606
+ return request(getBillingReconcileSubscriptionUrl(subscriptionId), {
607
+ ...options,
608
+ method: "POST"
609
+ });
610
+ };
611
+ const getBillingListTransactionsUrl = (params) => {
612
+ const normalizedParams = new URLSearchParams();
613
+ Object.entries(params || {}).forEach(([key, value]) => {
614
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
615
+ });
616
+ const stringifiedParams = normalizedParams.toString();
617
+ return stringifiedParams.length > 0 ? `/billing/transactions?${stringifiedParams}` : `/billing/transactions`;
618
+ };
619
+ /**
620
+ * List private native and imported transactions, newest local identifier first. Historical timestamps, money and currency remain null when unverified. amountBasis distinguishes verified_receipt, historical_provider_evidence and unknown. listedAmountBeforeDiscount and calculatedAmountAfterDiscount preserve source arithmetic; they must not be presented as confirmed paid amounts. clockBasis describes time evidence. Uses the authenticated independent profile in the Biblio product context; support impersonation is refused. Responses are private and must not be cached.
621
+ * @summary List the current profile's payment history
622
+ */
623
+ const billingListTransactions = async (params, options) => {
624
+ return request(getBillingListTransactionsUrl(params), {
625
+ ...options,
626
+ method: "GET"
627
+ });
628
+ };
629
+ const getBillingReadTransactionUrl = (transactionId) => {
630
+ return `/billing/transactions/${transactionId}`;
631
+ };
632
+ /**
633
+ * Return one transaction belonging to the authenticated profile. Historical timestamps, money and currency remain null when unverified. amountBasis distinguishes verified_receipt, historical_provider_evidence and unknown. listedAmountBeforeDiscount and calculatedAmountAfterDiscount preserve source arithmetic; they must not be presented as confirmed paid amounts. clockBasis describes time evidence. Uses the authenticated independent profile in the Biblio product context; support impersonation is refused. Responses are private and must not be cached.
634
+ * @summary Read an owned transaction's payment evidence
635
+ */
636
+ const billingReadTransaction = async (transactionId, options) => {
637
+ return request(getBillingReadTransactionUrl(transactionId), {
638
+ ...options,
639
+ method: "GET"
640
+ });
641
+ };
642
+ //#endregion
643
+ export { billingBindProviderProduct, billingCancelSubscription, billingCancellationFeedback, billingCreateClientToken, billingCreateProduct, billingCreatePromotion, billingExportPromotionCodes, billingGeneratePromotions, billingListProducts, billingListPromotions, billingListSubscriptions, billingListTransactions, billingPrepareIdentity, billingPromotionCapacity, billingPromotionGenerator, billingPromotionGenerators, billingPromotionRedemptions, billingQuoteCheckout, billingReadCheckout, billingReadSubscription, billingReadTransaction, billingReconcileCheckout, billingReconcileSubscription, billingRedeemPromotion, billingRestoreStorePurchases, billingRevealPromotionCode, billingSetOfferAvailability, billingSubmitCheckout, billingSubscriptionClientToken, billingSubscriptionHistory, billingUpdatePaymentMethod, getBillingBindProviderProductUrl, getBillingCancelSubscriptionUrl, getBillingCancellationFeedbackUrl, getBillingCreateClientTokenUrl, getBillingCreateProductUrl, getBillingCreatePromotionUrl, getBillingExportPromotionCodesUrl, getBillingGeneratePromotionsUrl, getBillingListProductsUrl, getBillingListPromotionsUrl, getBillingListSubscriptionsUrl, getBillingListTransactionsUrl, getBillingPrepareIdentityUrl, getBillingPromotionCapacityUrl, getBillingPromotionGeneratorUrl, getBillingPromotionGeneratorsUrl, getBillingPromotionRedemptionsUrl, getBillingQuoteCheckoutUrl, getBillingReadCheckoutUrl, getBillingReadSubscriptionUrl, getBillingReadTransactionUrl, getBillingReconcileCheckoutUrl, getBillingReconcileSubscriptionUrl, getBillingRedeemPromotionUrl, getBillingRestoreStorePurchasesUrl, getBillingRevealPromotionCodeUrl, getBillingSetOfferAvailabilityUrl, getBillingSubmitCheckoutUrl, getBillingSubscriptionClientTokenUrl, getBillingSubscriptionHistoryUrl, getBillingUpdatePaymentMethodUrl };
644
+
645
+ //# sourceMappingURL=biblio-billing.js.map