@shopify/ui-extensions 2026.10.0-rc.13 → 2026.10.0-rc.14

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 (117) hide show
  1. package/build/cjs/surfaces/customer-account/preact/authenticated-account.js +1 -1
  2. package/build/cjs/surfaces/point-of-sale/events.js +37 -21
  3. package/build/cjs/surfaces/point-of-sale/pos-list-template.js +339 -0
  4. package/build/cjs/surfaces/point-of-sale.js +2 -0
  5. package/build/esm/surfaces/customer-account/preact/authenticated-account.mjs +1 -1
  6. package/build/esm/surfaces/point-of-sale/events.mjs +37 -21
  7. package/build/esm/surfaces/point-of-sale/pos-list-template.mjs +331 -0
  8. package/build/esm/surfaces/point-of-sale.mjs +1 -0
  9. package/build/esnext/surfaces/customer-account/preact/authenticated-account.esnext +1 -1
  10. package/build/esnext/surfaces/point-of-sale/events.esnext +37 -21
  11. package/build/esnext/surfaces/point-of-sale/pos-list-template.esnext +331 -0
  12. package/build/esnext/surfaces/point-of-sale.esnext +1 -0
  13. package/build/ts/shared.d.ts +6 -20
  14. package/build/ts/shared.d.ts.map +1 -1
  15. package/build/ts/surfaces/checkout/api/address-autocomplete/format-suggestion.d.ts +7 -0
  16. package/build/ts/surfaces/checkout/api/address-autocomplete/format-suggestion.d.ts.map +1 -1
  17. package/build/ts/surfaces/checkout/api/address-autocomplete/shared.d.ts +8 -1
  18. package/build/ts/surfaces/checkout/api/address-autocomplete/shared.d.ts.map +1 -1
  19. package/build/ts/surfaces/checkout/api/address-autocomplete/standard.d.ts +2 -2
  20. package/build/ts/surfaces/checkout/api/address-autocomplete/standard.d.ts.map +1 -1
  21. package/build/ts/surfaces/checkout/api/address-autocomplete/suggest.d.ts +7 -0
  22. package/build/ts/surfaces/checkout/api/address-autocomplete/suggest.d.ts.map +1 -1
  23. package/build/ts/surfaces/checkout/api/checkout/checkout.d.ts +15 -4
  24. package/build/ts/surfaces/checkout/api/checkout/checkout.d.ts.map +1 -1
  25. package/build/ts/surfaces/checkout/api/shared.d.ts +102 -1
  26. package/build/ts/surfaces/checkout/api/shared.d.ts.map +1 -1
  27. package/build/ts/surfaces/checkout/api/standard/standard.d.ts +8 -2
  28. package/build/ts/surfaces/checkout/api/standard/standard.d.ts.map +1 -1
  29. package/build/ts/surfaces/checkout/components/MoneyField.d.ts +3 -1
  30. package/build/ts/surfaces/checkout/components/NumberField.d.ts +3 -1
  31. package/build/ts/surfaces/checkout/preact/country.d.ts +1 -1
  32. package/build/ts/surfaces/checkout/preact/country.d.ts.map +1 -1
  33. package/build/ts/surfaces/checkout.d.ts +2 -2
  34. package/build/ts/surfaces/checkout.d.ts.map +1 -1
  35. package/build/ts/surfaces/customer-account/api/shared.d.ts +26 -7
  36. package/build/ts/surfaces/customer-account/api/shared.d.ts.map +1 -1
  37. package/build/ts/surfaces/customer-account/api.d.ts +1 -1
  38. package/build/ts/surfaces/customer-account/api.d.ts.map +1 -1
  39. package/build/ts/surfaces/customer-account/components/MoneyField.d.ts +3 -1
  40. package/build/ts/surfaces/customer-account/components/NumberField.d.ts +3 -1
  41. package/build/ts/surfaces/customer-account/preact/authenticated-account.d.ts +3 -3
  42. package/build/ts/surfaces/customer-account/preact/authenticated-account.d.ts.map +1 -1
  43. package/build/ts/surfaces/point-of-sale/api/docs.d.ts +7 -0
  44. package/build/ts/surfaces/point-of-sale/api/docs.d.ts.map +1 -1
  45. package/build/ts/surfaces/point-of-sale/api/extension-api/extension-api.d.ts +25 -5
  46. package/build/ts/surfaces/point-of-sale/api/extension-api/extension-api.d.ts.map +1 -1
  47. package/build/ts/surfaces/point-of-sale/api/navigation-api/navigation-api.d.ts +19 -7
  48. package/build/ts/surfaces/point-of-sale/api/navigation-api/navigation-api.d.ts.map +1 -1
  49. package/build/ts/surfaces/point-of-sale/api/resolution-api/resolution-api.d.ts +8 -5
  50. package/build/ts/surfaces/point-of-sale/api/resolution-api/resolution-api.d.ts.map +1 -1
  51. package/build/ts/surfaces/point-of-sale/components/POSList.d.ts +179 -0
  52. package/build/ts/surfaces/point-of-sale/components/targets/BlockExtensionComponents.d.ts +1 -1
  53. package/build/ts/surfaces/point-of-sale/components/targets/BlockExtensionComponents.d.ts.map +1 -1
  54. package/build/ts/surfaces/point-of-sale/components/targets/ResolutionComponents.d.ts +1 -1
  55. package/build/ts/surfaces/point-of-sale/components/targets/ResolutionComponents.d.ts.map +1 -1
  56. package/build/ts/surfaces/point-of-sale/components/targets/StandardComponents.d.ts +1 -1
  57. package/build/ts/surfaces/point-of-sale/components/targets/StandardComponents.d.ts.map +1 -1
  58. package/build/ts/surfaces/point-of-sale/events/transaction-complete-event.d.ts +8 -0
  59. package/build/ts/surfaces/point-of-sale/events/transaction-complete-event.d.ts.map +1 -1
  60. package/build/ts/surfaces/point-of-sale/events.d.ts +49 -27
  61. package/build/ts/surfaces/point-of-sale/events.d.ts.map +1 -1
  62. package/build/ts/surfaces/point-of-sale/extension-targets.d.ts +4 -4
  63. package/build/ts/surfaces/point-of-sale/extension-targets.d.ts.map +1 -1
  64. package/build/ts/surfaces/point-of-sale/globals.d.ts +0 -2
  65. package/build/ts/surfaces/point-of-sale/globals.d.ts.map +1 -1
  66. package/build/ts/surfaces/point-of-sale/pos-list-template.d.ts +36 -0
  67. package/build/ts/surfaces/point-of-sale/pos-list-template.d.ts.map +1 -0
  68. package/build/ts/surfaces/point-of-sale/targets/pos.cart.line-item-details.action.render.d.ts +1 -0
  69. package/build/ts/surfaces/point-of-sale/targets/pos.cart.validations.resolution.render.d.ts +1 -0
  70. package/build/ts/surfaces/point-of-sale/targets/pos.customer-details.action.render.d.ts +1 -0
  71. package/build/ts/surfaces/point-of-sale/targets/pos.draft-order-details.action.render.d.ts +1 -0
  72. package/build/ts/surfaces/point-of-sale/targets/pos.exchange.post.action.render.d.ts +1 -0
  73. package/build/ts/surfaces/point-of-sale/targets/pos.home.modal.render.d.ts +1 -0
  74. package/build/ts/surfaces/point-of-sale/targets/pos.order-details.action.render.d.ts +1 -0
  75. package/build/ts/surfaces/point-of-sale/targets/pos.payment.validations.resolution.render.d.ts +1 -0
  76. package/build/ts/surfaces/point-of-sale/targets/pos.product-details.action.render.d.ts +1 -0
  77. package/build/ts/surfaces/point-of-sale/targets/pos.purchase.post.action.render.d.ts +1 -0
  78. package/build/ts/surfaces/point-of-sale/targets/pos.register-details.action.render.d.ts +1 -0
  79. package/build/ts/surfaces/point-of-sale/targets/pos.return.post.action.render.d.ts +1 -0
  80. package/build/ts/surfaces/point-of-sale/types/base-transaction-complete.d.ts +8 -0
  81. package/build/ts/surfaces/point-of-sale/types/base-transaction-complete.d.ts.map +1 -1
  82. package/build/ts/surfaces/point-of-sale.d.ts +1 -0
  83. package/build/ts/surfaces/point-of-sale.d.ts.map +1 -1
  84. package/build/tsconfig.tsbuildinfo +1 -1
  85. package/package.json +2 -1
  86. package/src/shared.ts +22 -21
  87. package/src/surfaces/checkout/api/address-autocomplete/format-suggestion.ts +9 -0
  88. package/src/surfaces/checkout/api/address-autocomplete/shared.ts +9 -0
  89. package/src/surfaces/checkout/api/address-autocomplete/standard.ts +1 -2
  90. package/src/surfaces/checkout/api/address-autocomplete/suggest.ts +8 -0
  91. package/src/surfaces/checkout/api/checkout/checkout.ts +19 -9
  92. package/src/surfaces/checkout/api/shared.ts +110 -1
  93. package/src/surfaces/checkout/api/standard/standard.ts +11 -1
  94. package/src/surfaces/checkout/components/MoneyField.d.ts +3 -1
  95. package/src/surfaces/checkout/components/NumberField.d.ts +3 -1
  96. package/src/surfaces/checkout/preact/country.ts +1 -1
  97. package/src/surfaces/checkout.ts +3 -0
  98. package/src/surfaces/customer-account/api/shared.ts +25 -7
  99. package/src/surfaces/customer-account/api.ts +1 -0
  100. package/src/surfaces/customer-account/preact/authenticated-account.ts +3 -3
  101. package/src/surfaces/point-of-sale/api/docs.ts +8 -0
  102. package/src/surfaces/point-of-sale/api/extension-api/extension-api.ts +25 -5
  103. package/src/surfaces/point-of-sale/api/navigation-api/navigation-api.ts +22 -7
  104. package/src/surfaces/point-of-sale/api/resolution-api/resolution-api.ts +8 -5
  105. package/src/surfaces/point-of-sale/components/POSList.d.ts +179 -0
  106. package/src/surfaces/point-of-sale/components/targets/BlockExtensionComponents.ts +0 -4
  107. package/src/surfaces/point-of-sale/components/targets/ResolutionComponents.ts +1 -1
  108. package/src/surfaces/point-of-sale/components/targets/StandardComponents.ts +1 -3
  109. package/src/surfaces/point-of-sale/components.d.ts +194 -0
  110. package/src/surfaces/point-of-sale/events/transaction-complete-event.ts +8 -0
  111. package/src/surfaces/point-of-sale/events.ts +49 -27
  112. package/src/surfaces/point-of-sale/extension-targets.ts +4 -4
  113. package/src/surfaces/point-of-sale/globals.ts +0 -2
  114. package/src/surfaces/point-of-sale/pos-list-template.ts +351 -0
  115. package/src/surfaces/point-of-sale/tests/pos-list-template.test.ts +306 -0
  116. package/src/surfaces/point-of-sale/types/base-transaction-complete.ts +8 -0
  117. package/src/surfaces/point-of-sale.ts +1 -0
@@ -0,0 +1,331 @@
1
+ import htm from 'htm';
2
+
3
+ /**
4
+ * The tagged template that compiles `<s-pos-list-item>` markup into the
5
+ * `itemTemplates` value `<s-pos-list>` accepts. Templates are static: the
6
+ * result contains no functions. Compilation and validation happen when the
7
+ * helper executes, not during the extension build. Define templates at module
8
+ * scope to compile once per module execution.
9
+ * Invalid templates throw synchronously and return no partial collection.
10
+ * An uncaught module-scope exception aborts module evaluation; catch the helper
11
+ * invocation to recover explicitly. There is no automatic list-only fallback.
12
+ *
13
+ * @publicDocs
14
+ */
15
+
16
+ const ITEM_TAG = 's-pos-list-item';
17
+ const LIST_TAG = 's-pos-list';
18
+ const PATH_PATTERN = /^[\w.]+$/;
19
+ const EVENT_PROP_PATTERN = /^on/i;
20
+ const BIND_PREFIX = 'bind:';
21
+ /** `{{#if path}}`, `{{/if}}`, or `{{path}}`; anything else inside `{{ }}` is unsupported. */
22
+ const EXPRESSION_PATTERN = /\{\{\s*(?:#if\s+([\w.]+)|(\/if)|([\w.]+))\s*\}\}/g;
23
+ const ANY_EXPRESSION_PATTERN = /\{\{([\s\S]*?)\}\}/g;
24
+ function fail(message) {
25
+ throw new Error(`posListTemplate: ${message}`);
26
+ }
27
+ function isRawElement(value) {
28
+ return typeof value === 'object' && value !== null && 'tag' in value && 'props' in value && 'children' in value;
29
+ }
30
+ function createRawElement(type, props, ...children) {
31
+ if (typeof type !== 'string') {
32
+ fail('interpolated values are not supported; templates must be static');
33
+ }
34
+ return {
35
+ tag: type,
36
+ props: props !== null && props !== void 0 ? props : {},
37
+ children
38
+ };
39
+ }
40
+ const parse = htm.bind(createRawElement);
41
+
42
+ /**
43
+ * Splits a string into literal and `{{path}}` segments. Used for attribute
44
+ * values, where block expressions have no meaning.
45
+ */
46
+ function parseSegments(value) {
47
+ const segments = [];
48
+ let lastIndex = 0;
49
+ for (const match of value.matchAll(ANY_EXPRESSION_PATTERN)) {
50
+ var _match$index;
51
+ const expression = match[1].trim();
52
+ if (!PATH_PATTERN.test(expression)) {
53
+ if (expression.startsWith('#if') || expression === '/if') {
54
+ fail(`{{#if}} is not supported inside an attribute value: "${match[0]}"`);
55
+ }
56
+ fail(`unsupported template expression "${match[0]}"`);
57
+ }
58
+ const index = (_match$index = match.index) !== null && _match$index !== void 0 ? _match$index : 0;
59
+ if (index > lastIndex) {
60
+ segments.push(value.slice(lastIndex, index));
61
+ }
62
+ segments.push({
63
+ path: expression
64
+ });
65
+ lastIndex = index + match[0].length;
66
+ }
67
+ if (lastIndex < value.length) {
68
+ segments.push(value.slice(lastIndex));
69
+ }
70
+ return segments;
71
+ }
72
+ function tokenizeText(value, tokens) {
73
+ let lastIndex = 0;
74
+ for (const match of value.matchAll(ANY_EXPRESSION_PATTERN)) {
75
+ var _match$index2;
76
+ const index = (_match$index2 = match.index) !== null && _match$index2 !== void 0 ? _match$index2 : 0;
77
+ if (index > lastIndex) {
78
+ tokens.push({
79
+ kind: 'text',
80
+ value: value.slice(lastIndex, index)
81
+ });
82
+ }
83
+ EXPRESSION_PATTERN.lastIndex = 0;
84
+ const expression = EXPRESSION_PATTERN.exec(match[0]);
85
+ if (expression === null || expression[0].length !== match[0].length) {
86
+ fail(`unsupported template expression "${match[0]}"`);
87
+ }
88
+ const [, ifPath, endIf, path] = expression;
89
+ if (ifPath !== undefined) {
90
+ tokens.push({
91
+ kind: 'if',
92
+ path: ifPath
93
+ });
94
+ } else if (endIf !== undefined) {
95
+ tokens.push({
96
+ kind: 'endif'
97
+ });
98
+ } else if (path !== undefined) {
99
+ tokens.push({
100
+ kind: 'path',
101
+ path
102
+ });
103
+ }
104
+ lastIndex = index + match[0].length;
105
+ }
106
+ if (lastIndex < value.length) {
107
+ tokens.push({
108
+ kind: 'text',
109
+ value: value.slice(lastIndex)
110
+ });
111
+ }
112
+ }
113
+ function tokenize(rawChildren) {
114
+ const tokens = [];
115
+ for (const child of rawChildren.flat()) {
116
+ if (typeof child === 'string') {
117
+ if (child.trim().length > 0) {
118
+ tokenizeText(child, tokens);
119
+ }
120
+ } else if (isRawElement(child)) {
121
+ tokens.push({
122
+ kind: 'element',
123
+ element: child
124
+ });
125
+ } else if (child !== null && child !== undefined && child !== false) {
126
+ fail('interpolated values are not supported; templates must be static');
127
+ }
128
+ }
129
+ return tokens;
130
+ }
131
+ function compileProp(name, value, props) {
132
+ const isBinding = name.startsWith(BIND_PREFIX);
133
+ const propName = isBinding ? name.slice(BIND_PREFIX.length) : name;
134
+ if (EVENT_PROP_PATTERN.test(propName)) {
135
+ fail(`event handlers are not supported in templates; use onRowClick on <${LIST_TAG}>`);
136
+ }
137
+ if (isBinding) {
138
+ if (typeof value !== 'string' || !PATH_PATTERN.test(value)) {
139
+ fail(`${name} must name a row field path`);
140
+ }
141
+ if (propName in props) {
142
+ fail(`"${propName}" is set both as an attribute and through ${name}`);
143
+ }
144
+ props[propName] = {
145
+ kind: 'field',
146
+ path: value
147
+ };
148
+ return;
149
+ }
150
+ if (typeof value === 'string') {
151
+ props[name] = value.includes('{{') ? {
152
+ kind: 'segments',
153
+ segments: parseSegments(value)
154
+ } : {
155
+ kind: 'literal',
156
+ value
157
+ };
158
+ return;
159
+ }
160
+ if (typeof value === 'boolean') {
161
+ props[name] = {
162
+ kind: 'literal',
163
+ value
164
+ };
165
+ return;
166
+ }
167
+ fail('interpolated values are not supported; templates must be static');
168
+ }
169
+ function compileElement(element, parentIfPath) {
170
+ if (element.tag === ITEM_TAG || element.tag === LIST_TAG) {
171
+ fail(`<${element.tag}> can only appear as a template root`);
172
+ }
173
+ const props = {};
174
+ // Plain attributes first so `bind:` can detect a collision with one.
175
+ const entries = Object.entries(element.props);
176
+ for (const [name, value] of entries) {
177
+ if (!name.startsWith(BIND_PREFIX)) {
178
+ compileProp(name, value, props);
179
+ }
180
+ }
181
+ for (const [name, value] of entries) {
182
+ if (name.startsWith(BIND_PREFIX)) {
183
+ compileProp(name, value, props);
184
+ }
185
+ }
186
+ const node = {
187
+ kind: 'element',
188
+ tag: element.tag,
189
+ props
190
+ };
191
+ const children = compileChildren(element.children, false, parentIfPath);
192
+ if (children.length > 0) {
193
+ node.children = children;
194
+ }
195
+ return node;
196
+ }
197
+ function compileChildren(rawChildren, atRoot, parentIfPath) {
198
+ var _openIf$path2, _openIf2;
199
+ const nodes = [];
200
+ let pendingText = [];
201
+ let openIf;
202
+ const target = () => openIf ? openIf.children : nodes;
203
+ const flushText = () => {
204
+ if (pendingText.length === 0) {
205
+ return;
206
+ }
207
+ if (atRoot) {
208
+ fail('text must be inside a component such as <s-text>');
209
+ }
210
+ target().push({
211
+ kind: 'text',
212
+ segments: pendingText
213
+ });
214
+ pendingText = [];
215
+ };
216
+ for (const token of tokenize(rawChildren)) {
217
+ switch (token.kind) {
218
+ case 'text':
219
+ pendingText.push(token.value);
220
+ break;
221
+ case 'path':
222
+ pendingText.push({
223
+ path: token.path
224
+ });
225
+ break;
226
+ case 'if':
227
+ {
228
+ var _openIf$path, _openIf;
229
+ flushText();
230
+ const enclosingIfPath = (_openIf$path = (_openIf = openIf) === null || _openIf === void 0 ? void 0 : _openIf.path) !== null && _openIf$path !== void 0 ? _openIf$path : parentIfPath;
231
+ if (enclosingIfPath !== undefined) {
232
+ fail(`{{#if}} cannot be nested: {{#if ${token.path}}} inside {{#if ${enclosingIfPath}}}`);
233
+ }
234
+ openIf = {
235
+ path: token.path,
236
+ children: []
237
+ };
238
+ break;
239
+ }
240
+ case 'endif':
241
+ flushText();
242
+ if (!openIf) {
243
+ fail('{{/if}} without a matching {{#if}}');
244
+ }
245
+ nodes.push({
246
+ kind: 'if',
247
+ path: openIf.path,
248
+ children: openIf.children
249
+ });
250
+ openIf = undefined;
251
+ break;
252
+ case 'element':
253
+ flushText();
254
+ target().push(compileElement(token.element, (_openIf$path2 = (_openIf2 = openIf) === null || _openIf2 === void 0 ? void 0 : _openIf2.path) !== null && _openIf$path2 !== void 0 ? _openIf$path2 : parentIfPath));
255
+ break;
256
+ }
257
+ }
258
+ flushText();
259
+ if (openIf) {
260
+ fail(`{{#if ${openIf.path}}} is missing its {{/if}}`);
261
+ }
262
+ return nodes;
263
+ }
264
+ function compileRoot(root, seen) {
265
+ if (!isRawElement(root) || root.tag !== ITEM_TAG) {
266
+ fail(`every template root must be an <${ITEM_TAG} templateId="…"> element`);
267
+ }
268
+ let templateId;
269
+ let type = 'button';
270
+ for (const [name, value] of Object.entries(root.props)) {
271
+ if (name === 'templateId') {
272
+ if (typeof value !== 'string' || value.length === 0) {
273
+ fail(`<${ITEM_TAG}> requires a literal, non-empty templateId`);
274
+ }
275
+ templateId = value;
276
+ } else if (name === 'type') {
277
+ if (value !== 'button' && value !== 'text') {
278
+ fail(`<${ITEM_TAG}> type must be "button" or "text", got ${JSON.stringify(value)}`);
279
+ }
280
+ type = value;
281
+ } else {
282
+ fail(`<${ITEM_TAG}> does not accept a "${name}" attribute; only templateId and type are allowed`);
283
+ }
284
+ }
285
+ if (templateId === undefined) {
286
+ fail(`<${ITEM_TAG}> requires a literal, non-empty templateId`);
287
+ }
288
+ if (seen.has(templateId)) {
289
+ fail(`duplicate templateId "${templateId}"`);
290
+ }
291
+ seen.add(templateId);
292
+ return {
293
+ templateId,
294
+ type,
295
+ children: compileChildren(root.children, true)
296
+ };
297
+ }
298
+
299
+ /**
300
+ * Compiles `<s-pos-list-item>` markup into the `itemTemplates` value for
301
+ * `<s-pos-list>`.
302
+ *
303
+ * Compilation and validation happen when this helper executes, not during the
304
+ * extension build. Define templates at module scope to compile once per module
305
+ * execution.
306
+ * Invalid templates throw synchronously and return no partial collection.
307
+ * An uncaught module-scope exception aborts module evaluation; catch the helper
308
+ * invocation to recover explicitly. There is no automatic list-only fallback.
309
+ *
310
+ * Inside a template, `{{path}}` interpolates a row field as text, `bind:prop="path"`
311
+ * passes a row field to a component prop with its own type, and
312
+ * `{{#if path}}…{{/if}}` renders its content only when the field is truthy.
313
+ * Event handlers, interpolated values, and any other `{{…}}` expression are
314
+ * rejected when the template is compiled.
315
+ *
316
+ * @publicDocs
317
+ */
318
+ const posListTemplate = (strings, ...values) => {
319
+ if (values.length > 0) {
320
+ fail('interpolated values are not supported; templates must be static');
321
+ }
322
+ const parsed = parse(strings);
323
+ const roots = Array.isArray(parsed) ? parsed : [parsed];
324
+ const seen = new Set();
325
+ const templates = roots.filter(root => !(typeof root === 'string' && root.trim().length === 0)).map(root => compileRoot(root, seen));
326
+ return {
327
+ templates
328
+ };
329
+ };
330
+
331
+ export { posListTemplate };
@@ -1,2 +1,3 @@
1
1
  export { POS_EVENT_NAMES, POS_INTERCEPT_NAMES } from './point-of-sale/events.mjs';
2
+ export { posListTemplate } from './point-of-sale/pos-list-template.mjs';
2
3
  export { StorageError } from './point-of-sale/types/storage.mjs';
@@ -2,7 +2,7 @@ import { useApi } from './api.esnext';
2
2
  import { useSubscription } from './subscription.esnext';
3
3
 
4
4
  /**
5
- * Returns the current authenticated `Customer`.
5
+ * Returns the current `AuthenticatedAccountCustomer`.
6
6
  *
7
7
  * The value is `undefined` if the customer isn't authenticated.
8
8
  */
@@ -36,26 +36,26 @@ const POS_INTERCEPT_NAMES = {
36
36
  *
37
37
  * Used as the generic type parameter for `shopify.intercept`.
38
38
  *
39
- * @private
39
+ * @publicDocs
40
40
  */
41
41
 
42
42
  /**
43
43
  * The data carried by a `cartvalidations` event.
44
44
  *
45
- * @private
45
+ * @publicDocs
46
46
  */
47
47
 
48
48
  /**
49
49
  * The event a `cartvalidations` interceptor receives. Carries a snapshot of
50
50
  * the POS cart taken when the event was produced.
51
51
  *
52
- * @private
52
+ * @publicDocs
53
53
  */
54
54
 
55
55
  /**
56
56
  * The kind of payment method being attempted.
57
57
  *
58
- * @private
58
+ * @publicDocs
59
59
  */
60
60
 
61
61
  /**
@@ -65,7 +65,7 @@ const POS_INTERCEPT_NAMES = {
65
65
  * disambiguates method types a shop can have several of (for example custom
66
66
  * payment methods) as they become interceptable.
67
67
  *
68
- * @private
68
+ * @publicDocs
69
69
  */
70
70
 
71
71
  /**
@@ -73,77 +73,93 @@ const POS_INTERCEPT_NAMES = {
73
73
  * attempt's payment method and amount; split payments produce one event per
74
74
  * tender, each with its own amount.
75
75
  *
76
- * @private
76
+ * @publicDocs
77
77
  */
78
78
 
79
79
  /**
80
80
  * The data carried by a `paymentvalidations` event.
81
81
  *
82
- * @private
82
+ * @publicDocs
83
83
  */
84
84
 
85
85
  /**
86
86
  * Targets the whole cart rather than a specific line item.
87
87
  *
88
- * @private
88
+ * @publicDocs
89
89
  */
90
90
 
91
91
  /**
92
92
  * Targets one cart line item by its `uuid` from this event's `cart` snapshot,
93
93
  * for example `$.cart.lineItems['adfd6b06-4a24-4f5f-9f4b-ea21f4432dd4']`.
94
94
  *
95
- * @private
95
+ * @publicDocs
96
96
  */
97
97
 
98
- /** @private */
98
+ /**
99
+ * A target that a `cartvalidations` interceptor can use: the whole cart or
100
+ * one cart line item.
101
+ *
102
+ * @publicDocs
103
+ */
99
104
 
100
105
  /**
101
106
  * Targets the payment attempt being intercepted.
102
107
  *
103
- * @private
108
+ * @publicDocs
104
109
  */
105
110
 
106
- /** @private */
111
+ /**
112
+ * A target that a `paymentvalidations` interceptor can use. The only
113
+ * supported target is the payment attempt.
114
+ *
115
+ * @publicDocs
116
+ */
107
117
 
108
118
  /**
109
119
  * Where a validation applies, as an enumerated token. Targets are matched
110
120
  * as exact strings, never evaluated as JSON paths.
111
121
  *
112
- * @private
122
+ * @publicDocs
113
123
  */
114
124
 
115
125
  /**
116
126
  * Maps POS interceptable workflow names to their valid validation targets.
117
127
  *
118
- * @private
128
+ * @publicDocs
119
129
  */
120
130
 
121
131
  /**
122
132
  * The interceptor callback for a POS interceptable workflow, keyed by the
123
133
  * workflow name so the event and its valid validation targets stay paired.
124
134
  *
125
- * @private
135
+ * @publicDocs
126
136
  */
127
137
 
128
138
  /**
129
- * The result an interceptor returns. An empty `operations` list allows the
130
- * workflow; an `ERROR` validation blocks it.
139
+ * The result an interceptor returns. An empty `operations` list adds no
140
+ * findings from this interceptor and doesn't remove or override findings from
141
+ * other interceptors.
131
142
  *
132
- * @private
143
+ * @publicDocs
133
144
  */
134
145
 
135
146
  /**
136
147
  * A single host operation produced by an interceptor.
137
148
  *
138
- * @private
149
+ * @publicDocs
139
150
  */
140
151
 
141
- /** @private */
152
+ /**
153
+ * The severity of a validation. `ERROR` can block the workflow when blocking
154
+ * is declared and allowed by the store. `WARNING` never blocks.
155
+ *
156
+ * @publicDocs
157
+ */
142
158
 
143
159
  /**
144
160
  * Adds a validation to the workflow being intercepted.
145
161
  *
146
- * @private
162
+ * @publicDocs
147
163
  */
148
164
 
149
165
  export { POS_EVENT_NAMES, POS_INTERCEPT_NAMES };