@replohq/canopy-sdk 2.6.0 → 3.0.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 (389) hide show
  1. package/_vendor/replo-utils/lib/fonts.mjs +1 -0
  2. package/_vendor/replo-utils/lib/geometry.mjs +2 -0
  3. package/_vendor/replo-utils/lib/json.mjs +1 -0
  4. package/_vendor/replo-utils/lib/misc.mjs +1 -0
  5. package/_vendor/replo-utils/lib/posthogReplay.mjs +2 -0
  6. package/_vendor/replo-utils/lib/url.mjs +1 -0
  7. package/_vendor/replo-utils/react/use-iframe-rpc-channel.mjs +1 -1
  8. package/_vendor/schemas/designLibrary.mjs +1 -1
  9. package/_vendor/schemas/generated/consent.d.ts +2 -0
  10. package/_vendor/schemas/generated/selectModeIframeRpc.d.ts +8 -0
  11. package/_vendor/schemas/iframeRpcChannel.mjs +2 -1
  12. package/_vendor/schemas/loaderKeys.d.ts +1 -1
  13. package/_vendor/schemas/loaderKeys.mjs +103 -23
  14. package/_vendor/schemas/money.mjs +1860 -3
  15. package/_vendor/schemas/pageAnnotations.mjs +1 -1
  16. package/_vendor/schemas/routing/match.mjs +1 -0
  17. package/_vendor/schemas/routing/rules.mjs +2 -1
  18. package/_vendor/schemas/selectMode.d.ts +4 -4
  19. package/_vendor/schemas/selectMode.mjs +1 -0
  20. package/_vendor/schemas/selectModeIframeRpc.d.ts +25 -5
  21. package/_vendor/schemas/selectModeIframeRpc.mjs +12 -3
  22. package/analytics/analytics-provider.d.ts +5 -10
  23. package/analytics/analytics-provider.js +14 -101
  24. package/analytics/analytics-provider.js.map +2 -2
  25. package/analytics/get-analytics-sinks.d.ts +2 -19
  26. package/analytics/get-analytics-sinks.js +9 -46
  27. package/analytics/get-analytics-sinks.js.map +2 -2
  28. package/analytics/hooks/use-product-viewed-analytics.d.ts +2 -6
  29. package/analytics/hooks/use-product-viewed-analytics.js +6 -28
  30. package/analytics/hooks/use-product-viewed-analytics.js.map +2 -2
  31. package/analytics/replo-first-party-pixel.d.ts +3 -12
  32. package/analytics/replo-first-party-pixel.js +8 -24
  33. package/analytics/replo-first-party-pixel.js.map +2 -2
  34. package/analytics/replo-pixel-script.d.ts +4 -10
  35. package/analytics/replo-pixel-script.js +9 -23
  36. package/analytics/replo-pixel-script.js.map +2 -2
  37. package/analytics/sinks/ga4-sink.d.ts +10 -9
  38. package/analytics/sinks/ga4-sink.js +99 -50
  39. package/analytics/sinks/ga4-sink.js.map +2 -2
  40. package/analytics/sinks/meta-sink.d.ts +5 -4
  41. package/analytics/sinks/meta-sink.js +82 -29
  42. package/analytics/sinks/meta-sink.js.map +2 -2
  43. package/analytics/sinks/pinterest-sink.d.ts +7 -6
  44. package/analytics/sinks/pinterest-sink.js +82 -49
  45. package/analytics/sinks/pinterest-sink.js.map +2 -2
  46. package/analytics/sinks/reddit-sink.d.ts +8 -7
  47. package/analytics/sinks/reddit-sink.js +82 -53
  48. package/analytics/sinks/reddit-sink.js.map +2 -2
  49. package/analytics/sinks/replo-sink.d.ts +9 -8
  50. package/analytics/sinks/replo-sink.js +89 -37
  51. package/analytics/sinks/replo-sink.js.map +2 -2
  52. package/analytics/sinks/snapchat-sink.d.ts +6 -5
  53. package/analytics/sinks/snapchat-sink.js +82 -40
  54. package/analytics/sinks/snapchat-sink.js.map +2 -2
  55. package/analytics/sinks/tiktok-sink.d.ts +8 -7
  56. package/analytics/sinks/tiktok-sink.js +82 -52
  57. package/analytics/sinks/tiktok-sink.js.map +2 -2
  58. package/analytics/sinks/window-sink.d.ts +11 -14
  59. package/analytics/sinks/window-sink.js +101 -28
  60. package/analytics/sinks/window-sink.js.map +2 -2
  61. package/analytics/utils/analytics-utils.d.ts +4 -2
  62. package/analytics/utils/analytics-utils.js +19 -123
  63. package/analytics/utils/analytics-utils.js.map +2 -2
  64. package/analytics/utils/navigation-tracker.d.ts +2 -1
  65. package/analytics/utils/navigation-tracker.js +37 -30
  66. package/analytics/utils/navigation-tracker.js.map +2 -2
  67. package/analytics/utils/shopify-funnel-gate.d.ts +2 -7
  68. package/analytics/utils/shopify-funnel-gate.js +8 -15
  69. package/analytics/utils/shopify-funnel-gate.js.map +2 -2
  70. package/cart/buy-now-action.d.ts +2 -9
  71. package/cart/buy-now-action.js +5 -97
  72. package/cart/buy-now-action.js.map +2 -2
  73. package/cart/cart-actions.d.ts +12 -56
  74. package/cart/cart-actions.js +88 -68
  75. package/cart/cart-actions.js.map +2 -2
  76. package/cart/cart-loader.d.ts +3 -9
  77. package/cart/cart-loader.js +14 -6
  78. package/cart/cart-loader.js.map +2 -2
  79. package/cart/cart-provider.d.ts +6 -58
  80. package/cart/cart-provider.js +13 -359
  81. package/cart/cart-provider.js.map +3 -3
  82. package/cart/cart-schema.d.ts +2 -1
  83. package/cart/cart-schema.js +12 -64
  84. package/cart/cart-schema.js.map +2 -2
  85. package/cart/cart-types.d.ts +1 -1
  86. package/cart/cart-types.js +5 -4
  87. package/cart/cart-types.js.map +2 -2
  88. package/cart/gateways/cart-constants.d.ts +1 -0
  89. package/cart/gateways/cart-constants.js.map +2 -2
  90. package/cart/gateways/cart-gateway.d.ts +1 -0
  91. package/cart/gateways/cart-gateway.js +13 -12
  92. package/cart/gateways/cart-gateway.js.map +2 -2
  93. package/cart/gateways/cookie-cart-gateway.d.ts +8 -11
  94. package/cart/gateways/cookie-cart-gateway.js +93 -97
  95. package/cart/gateways/cookie-cart-gateway.js.map +2 -2
  96. package/cart/gateways/default-cart-gateway.d.ts +10 -16
  97. package/cart/gateways/default-cart-gateway.js +13 -23
  98. package/cart/gateways/default-cart-gateway.js.map +2 -2
  99. package/cart/gateways/resolver-cart-gateway.d.ts +1 -0
  100. package/cart/gateways/resolver-cart-gateway.js +13 -102
  101. package/cart/gateways/resolver-cart-gateway.js.map +2 -2
  102. package/cart/gateways/stripe-cart-gateway.d.ts +10 -16
  103. package/cart/gateways/stripe-cart-gateway.js +13 -21
  104. package/cart/gateways/stripe-cart-gateway.js.map +2 -2
  105. package/cart/hooks/use-add-to-cart.d.ts +3 -47
  106. package/cart/hooks/use-add-to-cart.js +10 -115
  107. package/cart/hooks/use-add-to-cart.js.map +2 -2
  108. package/cart/hooks/use-buy-now.d.ts +1 -39
  109. package/cart/hooks/use-buy-now.js +5 -55
  110. package/cart/hooks/use-buy-now.js.map +2 -2
  111. package/cart/utils/cart-utils.d.ts +8 -35
  112. package/cart/utils/cart-utils.js +21 -35
  113. package/cart/utils/cart-utils.js.map +2 -2
  114. package/cart/utils/cookie-cart-persistence.d.ts +16 -41
  115. package/cart/utils/cookie-cart-persistence.js +38 -143
  116. package/cart/utils/cookie-cart-persistence.js.map +2 -2
  117. package/cart/utils/variant-to-cart-line.d.ts +12 -42
  118. package/cart/utils/variant-to-cart-line.js +31 -147
  119. package/cart/utils/variant-to-cart-line.js.map +2 -2
  120. package/chunk-UJCSKKID.mjs +27 -0
  121. package/{chunk-OFU2QEDR.mjs → chunk-ZZPQ3E7S.mjs} +50 -5
  122. package/consent/consent-action.d.ts +2 -1
  123. package/consent/consent-action.js +10 -20
  124. package/consent/consent-action.js.map +2 -2
  125. package/consent/consent-actions.d.ts +2 -13
  126. package/consent/consent-actions.js +9 -29
  127. package/consent/consent-actions.js.map +2 -2
  128. package/consent/consent-store.d.ts +9 -36
  129. package/consent/consent-store.js +12 -182
  130. package/consent/consent-store.js.map +2 -2
  131. package/consent/cookie.d.ts +9 -12
  132. package/consent/cookie.js +32 -64
  133. package/consent/cookie.js.map +2 -2
  134. package/consent/replo-scripts.d.ts +5 -18
  135. package/consent/replo-scripts.js +11 -94
  136. package/consent/replo-scripts.js.map +2 -2
  137. package/consent/script-registration-store.d.ts +6 -2
  138. package/consent/script-registration-store.js +33 -47
  139. package/consent/script-registration-store.js.map +2 -2
  140. package/consent/script-snippets.d.ts +4 -18
  141. package/consent/script-snippets.js +19 -127
  142. package/consent/script-snippets.js.map +2 -2
  143. package/consent/window-api.d.ts +4 -15
  144. package/consent/window-api.js +8 -63
  145. package/consent/window-api.js.map +2 -2
  146. package/editor/ClientErrorBoundary.d.ts +4 -10
  147. package/editor/ClientErrorBoundary.js +7 -55
  148. package/editor/ClientErrorBoundary.js.map +2 -2
  149. package/editor/DocumentReadyBeacon.d.ts +3 -1
  150. package/editor/DocumentReadyBeacon.js +6 -3
  151. package/editor/DocumentReadyBeacon.js.map +2 -2
  152. package/editor/LinkInterceptor.d.ts +1 -0
  153. package/editor/LinkInterceptor.js +6 -121
  154. package/editor/LinkInterceptor.js.map +2 -2
  155. package/editor/NextErrorReporter.d.ts +1 -0
  156. package/editor/NextErrorReporter.js +6 -85
  157. package/editor/NextErrorReporter.js.map +2 -2
  158. package/editor/annotations/AnnotationLayerMount.d.ts +1 -0
  159. package/editor/annotations/AnnotationLayerMount.js +6 -6
  160. package/editor/annotations/AnnotationLayerMount.js.map +2 -2
  161. package/editor/annotations/annotationController.d.ts +1 -0
  162. package/editor/annotations/annotationController.js +6 -378
  163. package/editor/annotations/annotationController.js.map +2 -2
  164. package/editor/annotations/bridgeGate.d.ts +4 -7
  165. package/editor/annotations/bridgeGate.js +13 -15
  166. package/editor/annotations/bridgeGate.js.map +2 -2
  167. package/editor/design-library-preview/DesignLibraryPreview.d.ts +1 -0
  168. package/editor/design-library-preview/DesignLibraryPreview.js +6 -86
  169. package/editor/design-library-preview/DesignLibraryPreview.js.map +2 -2
  170. package/editor/posthog-relay.d.ts +1 -10
  171. package/editor/posthog-relay.js +6 -65
  172. package/editor/posthog-relay.js.map +2 -2
  173. package/editor/select-mode/EditorSelection.d.ts +1 -23
  174. package/editor/select-mode/EditorSelection.js +5 -87
  175. package/editor/select-mode/EditorSelection.js.map +2 -2
  176. package/editor/select-mode/annotationFrames.d.ts +9 -9
  177. package/editor/select-mode/annotationFrames.js +22 -103
  178. package/editor/select-mode/annotationFrames.js.map +2 -2
  179. package/editor/select-mode/descriptor/elementDescriptor.d.ts +6 -21
  180. package/editor/select-mode/descriptor/elementDescriptor.js +19 -192
  181. package/editor/select-mode/descriptor/elementDescriptor.js.map +3 -3
  182. package/editor/select-mode/descriptor/styleExtraction.d.ts +4 -2
  183. package/editor/select-mode/descriptor/styleExtraction.js +11 -262
  184. package/editor/select-mode/descriptor/styleExtraction.js.map +2 -2
  185. package/editor/select-mode/displayModeStore.d.ts +2 -0
  186. package/editor/select-mode/displayModeStore.js +14 -39
  187. package/editor/select-mode/displayModeStore.js.map +2 -2
  188. package/editor/select-mode/fast-refresh-relay.d.ts +2 -1
  189. package/editor/select-mode/fast-refresh-relay.js +7 -28
  190. package/editor/select-mode/fast-refresh-relay.js.map +2 -2
  191. package/editor/select-mode/fiber.d.ts +14 -7
  192. package/editor/select-mode/fiber.js +40 -286
  193. package/editor/select-mode/fiber.js.map +2 -2
  194. package/editor/select-mode/hooks/useCrosshairCursor.d.ts +2 -9
  195. package/editor/select-mode/hooks/useCrosshairCursor.js +7 -15
  196. package/editor/select-mode/hooks/useCrosshairCursor.js.map +2 -2
  197. package/editor/select-mode/hooks/useEditModeStateMachine.d.ts +5 -3
  198. package/editor/select-mode/hooks/useEditModeStateMachine.js +13 -228
  199. package/editor/select-mode/hooks/useEditModeStateMachine.js.map +2 -2
  200. package/editor/select-mode/hooks/useOptimisticOverrides.d.ts +2 -1
  201. package/editor/select-mode/hooks/useOptimisticOverrides.js +6 -277
  202. package/editor/select-mode/hooks/useOptimisticOverrides.js.map +2 -2
  203. package/editor/select-mode/hooks/useParentMessaging.d.ts +2 -20
  204. package/editor/select-mode/hooks/useParentMessaging.js +7 -69
  205. package/editor/select-mode/hooks/useParentMessaging.js.map +2 -2
  206. package/editor/select-mode/hooks/useSelectModeController.d.ts +2 -1
  207. package/editor/select-mode/hooks/useSelectModeController.js +6 -40
  208. package/editor/select-mode/hooks/useSelectModeController.js.map +2 -2
  209. package/editor/select-mode/hooks/useSelectionHover.d.ts +2 -16
  210. package/editor/select-mode/hooks/useSelectionHover.js +7 -105
  211. package/editor/select-mode/hooks/useSelectionHover.js.map +2 -2
  212. package/editor/select-mode/hooks/useSelectionInteractions.d.ts +2 -26
  213. package/editor/select-mode/hooks/useSelectionInteractions.js +7 -348
  214. package/editor/select-mode/hooks/useSelectionInteractions.js.map +2 -2
  215. package/editor/select-mode/hooks/useSelectionScrollSync.d.ts +2 -22
  216. package/editor/select-mode/hooks/useSelectionScrollSync.js +7 -65
  217. package/editor/select-mode/hooks/useSelectionScrollSync.js.map +2 -2
  218. package/editor/select-mode/hooks/useSiblingResolution.d.ts +4 -2
  219. package/editor/select-mode/hooks/useSiblingResolution.js +13 -52
  220. package/editor/select-mode/hooks/useSiblingResolution.js.map +2 -2
  221. package/editor/select-mode/iframeRpcChannel.d.ts +10 -349
  222. package/editor/select-mode/iframeRpcChannel.js +23 -79
  223. package/editor/select-mode/iframeRpcChannel.js.map +2 -2
  224. package/editor/select-mode/inlineTextMarks.d.ts +4 -6
  225. package/editor/select-mode/inlineTextMarks.js +13 -18
  226. package/editor/select-mode/inlineTextMarks.js.map +2 -2
  227. package/editor/select-mode/interactions/selectionGeometry.d.ts +19 -61
  228. package/editor/select-mode/interactions/selectionGeometry.js +57 -165
  229. package/editor/select-mode/interactions/selectionGeometry.js.map +2 -2
  230. package/editor/select-mode/selectModeSession.d.ts +1 -0
  231. package/editor/select-mode/selectModeSession.js +6 -3
  232. package/editor/select-mode/selectModeSession.js.map +2 -2
  233. package/editor/select-mode/selectionFrame.d.ts +9 -60
  234. package/editor/select-mode/selectionFrame.js +28 -116
  235. package/editor/select-mode/selectionFrame.js.map +2 -2
  236. package/editor/select-mode/symbolicate.d.ts +2 -1
  237. package/editor/select-mode/symbolicate.js +7 -195
  238. package/editor/select-mode/symbolicate.js.map +2 -2
  239. package/editor/select-mode/tiptapInlineEditor.d.ts +15 -2
  240. package/editor/select-mode/tiptapInlineEditor.js +6 -114
  241. package/editor/select-mode/tiptapInlineEditor.js.map +2 -2
  242. package/env.d.ts +2 -1
  243. package/env.js +10 -37
  244. package/env.js.map +2 -2
  245. package/gateways/canopy-api.d.ts +15 -12
  246. package/gateways/canopy-api.js +122 -160
  247. package/gateways/canopy-api.js.map +2 -2
  248. package/hooks/use-client-value.d.ts +2 -10
  249. package/hooks/use-client-value.js +10 -7
  250. package/hooks/use-client-value.js.map +2 -2
  251. package/hooks/use-formatted-price.d.ts +1 -14
  252. package/hooks/use-formatted-price.js +6 -14
  253. package/hooks/use-formatted-price.js.map +2 -2
  254. package/lib/canopy-error.d.ts +2 -5
  255. package/lib/canopy-error.js +10 -14
  256. package/lib/canopy-error.js.map +2 -2
  257. package/lib/get-query-client.d.ts +2 -1
  258. package/lib/get-query-client.js +8 -27
  259. package/lib/get-query-client.js.map +2 -2
  260. package/lib/integration-utils.d.ts +1 -0
  261. package/lib/integration-utils.js +9 -3
  262. package/lib/integration-utils.js.map +2 -2
  263. package/lib/shopify-utils.d.ts +2 -10
  264. package/lib/shopify-utils.js +10 -2
  265. package/lib/shopify-utils.js.map +2 -2
  266. package/lib/tombstone.d.ts +21 -0
  267. package/lib/tombstone.js +99 -0
  268. package/lib/tombstone.js.map +7 -0
  269. package/lib/url-utils.d.ts +2 -4
  270. package/lib/url-utils.js +10 -3
  271. package/lib/url-utils.js.map +2 -2
  272. package/loaders/collection-loader.d.ts +3 -2
  273. package/loaders/collection-loader.js +5 -48
  274. package/loaders/collection-loader.js.map +2 -2
  275. package/loaders/collection-products-loader.d.ts +3 -2
  276. package/loaders/collection-products-loader.js +5 -51
  277. package/loaders/collection-products-loader.js.map +2 -2
  278. package/loaders/contentful-entries-loader.d.ts +3 -2
  279. package/loaders/contentful-entries-loader.js +5 -71
  280. package/loaders/contentful-entries-loader.js.map +2 -2
  281. package/loaders/contentful-entry-loader.d.ts +3 -2
  282. package/loaders/contentful-entry-loader.js +5 -53
  283. package/loaders/contentful-entry-loader.js.map +2 -2
  284. package/loaders/invoke-loader-action.d.ts +2 -8
  285. package/loaders/invoke-loader-action.js +13 -8
  286. package/loaders/invoke-loader-action.js.map +2 -2
  287. package/loaders/invoke-loader-server.d.ts +2 -14
  288. package/loaders/invoke-loader-server.js +12 -34
  289. package/loaders/invoke-loader-server.js.map +2 -2
  290. package/loaders/invoke-loader.d.ts +6 -12
  291. package/loaders/invoke-loader.js +27 -29
  292. package/loaders/invoke-loader.js.map +2 -2
  293. package/loaders/levanta-product-loader.d.ts +3 -2
  294. package/loaders/levanta-product-loader.js +5 -46
  295. package/loaders/levanta-product-loader.js.map +2 -2
  296. package/loaders/loader-error-boundary.d.ts +9 -15
  297. package/loaders/loader-error-boundary.js +50 -13
  298. package/loaders/loader-error-boundary.js.map +2 -2
  299. package/loaders/loader-keys.d.ts +4 -12
  300. package/loaders/loader-keys.js +6 -1
  301. package/loaders/loader-keys.js.map +2 -2
  302. package/loaders/loader-schemas.d.ts +142 -61
  303. package/loaders/loader-schemas.js +253 -90
  304. package/loaders/loader-schemas.js.map +2 -2
  305. package/loaders/metaobject-loader.d.ts +3 -2
  306. package/loaders/metaobject-loader.js +5 -47
  307. package/loaders/metaobject-loader.js.map +2 -2
  308. package/loaders/metaobjects-loader.d.ts +3 -2
  309. package/loaders/metaobjects-loader.js +5 -53
  310. package/loaders/metaobjects-loader.js.map +2 -2
  311. package/loaders/okendo-review-aggregate-loader.d.ts +9 -10
  312. package/loaders/okendo-review-aggregate-loader.js +5 -49
  313. package/loaders/okendo-review-aggregate-loader.js.map +2 -2
  314. package/loaders/okendo-reviews-loader.d.ts +8 -16
  315. package/loaders/okendo-reviews-loader.js +5 -47
  316. package/loaders/okendo-reviews-loader.js.map +2 -2
  317. package/loaders/prefetch-loaders.d.ts +4 -26
  318. package/loaders/prefetch-loaders.js +5 -40
  319. package/loaders/prefetch-loaders.js.map +2 -2
  320. package/loaders/preview-placeholder.d.ts +8 -22
  321. package/loaders/preview-placeholder.js +47 -209
  322. package/loaders/preview-placeholder.js.map +2 -2
  323. package/loaders/product-loader-args.d.ts +2 -11
  324. package/loaders/product-loader-args.js +6 -12
  325. package/loaders/product-loader-args.js.map +2 -2
  326. package/loaders/product-loader.d.ts +3 -2
  327. package/loaders/product-loader.js +5 -45
  328. package/loaders/product-loader.js.map +2 -2
  329. package/loaders/rebuy-recommendations-loader.d.ts +8 -157
  330. package/loaders/rebuy-recommendations-loader.js +5 -50
  331. package/loaders/rebuy-recommendations-loader.js.map +2 -2
  332. package/loaders/reviews-io-review-aggregate-loader.d.ts +5 -4
  333. package/loaders/reviews-io-review-aggregate-loader.js +5 -36
  334. package/loaders/reviews-io-review-aggregate-loader.js.map +2 -2
  335. package/loaders/reviews-io-reviews-loader.d.ts +5 -4
  336. package/loaders/reviews-io-reviews-loader.js +5 -58
  337. package/loaders/reviews-io-reviews-loader.js.map +2 -2
  338. package/loaders/smile-earning-rules-loader.d.ts +10 -11
  339. package/loaders/smile-earning-rules-loader.js +5 -37
  340. package/loaders/smile-earning-rules-loader.js.map +2 -2
  341. package/loaders/smile-rewards-loader.d.ts +10 -11
  342. package/loaders/smile-rewards-loader.js +5 -37
  343. package/loaders/smile-rewards-loader.js.map +2 -2
  344. package/loaders/smile-vip-tiers-loader.d.ts +9 -10
  345. package/loaders/smile-vip-tiers-loader.js +5 -36
  346. package/loaders/smile-vip-tiers-loader.js.map +2 -2
  347. package/loaders/statsig-experiment-loader.d.ts +3 -8
  348. package/loaders/statsig-experiment-loader.js +5 -74
  349. package/loaders/statsig-experiment-loader.js.map +2 -2
  350. package/loaders/vendor-loader-keys.d.ts +4 -0
  351. package/loaders/vendor-loader-keys.js +9 -0
  352. package/loaders/vendor-loader-keys.js.map +7 -0
  353. package/loaders/yotpo-review-aggregate-loader.d.ts +5 -4
  354. package/loaders/yotpo-review-aggregate-loader.js +5 -43
  355. package/loaders/yotpo-review-aggregate-loader.js.map +2 -2
  356. package/loaders/yotpo-reviews-loader.d.ts +5 -4
  357. package/loaders/yotpo-reviews-loader.js +5 -58
  358. package/loaders/yotpo-reviews-loader.js.map +2 -2
  359. package/money.d.ts +9 -9
  360. package/money.js +25 -6
  361. package/money.js.map +2 -2
  362. package/next/config.d.ts +3 -1
  363. package/next/config.js +11 -85
  364. package/next/config.js.map +2 -2
  365. package/next/image-loader.d.ts +2 -1
  366. package/next/image-loader.js +7 -47
  367. package/next/image-loader.js.map +2 -2
  368. package/next/open-next.d.ts +4 -2
  369. package/next/open-next.js +6 -19
  370. package/next/open-next.js.map +2 -2
  371. package/orders/order-status-schema.d.ts +28 -13
  372. package/orders/order-status-schema.js +45 -13
  373. package/orders/order-status-schema.js.map +2 -2
  374. package/orders/order-status.d.ts +2 -8
  375. package/orders/order-status.js +6 -36
  376. package/orders/order-status.js.map +2 -2
  377. package/package.json +1 -12
  378. package/providers/query-provider.d.ts +3 -1
  379. package/providers/query-provider.js +10 -6
  380. package/providers/query-provider.js.map +2 -2
  381. package/providers/replo-provider.d.ts +3 -1
  382. package/providers/replo-provider.js +6 -37
  383. package/providers/replo-provider.js.map +2 -2
  384. package/routing/evaluate.d.ts +3 -3
  385. package/routing/evaluate.js +5 -40
  386. package/routing/evaluate.js.map +2 -2
  387. package/routing/rules.d.ts +3 -11
  388. package/routing/rules.js +7 -1
  389. package/routing/rules.js.map +2 -2
@@ -1,118 +1,10 @@
1
- import { Editor, Mark } from "@tiptap/core";
2
- import Bold from "@tiptap/extension-bold";
3
- import Document from "@tiptap/extension-document";
4
- import Italic from "@tiptap/extension-italic";
5
- import Strike from "@tiptap/extension-strike";
6
- import Text from "@tiptap/extension-text";
7
- import Underline from "@tiptap/extension-underline";
8
- const InlineDocument = Document.extend({
9
- content: "inline*"
10
- });
11
- const InlineLink = Mark.create({
12
- name: "link",
13
- inclusive: false,
14
- addAttributes() {
15
- return {
16
- class: { default: null },
17
- href: { default: null },
18
- rel: { default: null },
19
- target: { default: null }
20
- };
21
- },
22
- parseHTML() {
23
- return [{ tag: "a[href]" }];
24
- },
25
- renderHTML({ HTMLAttributes }) {
26
- return ["a", HTMLAttributes, 0];
27
- }
28
- });
29
- function createInlineTiptapEditor({
30
- element,
31
- content,
32
- onCommit,
33
- onEscape,
34
- onBlur,
35
- onSelectionUpdate
36
- }) {
37
- const originalAttributes = Array.from(
38
- element.attributes,
39
- ({ name, value }) => ({
40
- name,
41
- value
42
- })
43
- );
44
- element.replaceChildren();
45
- const mount = {
46
- mount: element
47
- };
48
- const editor = new Editor({
49
- element: mount,
50
- content,
51
- extensions: [
52
- InlineDocument,
53
- Text,
54
- Bold,
55
- Italic,
56
- Underline,
57
- Strike,
58
- InlineLink
59
- ],
60
- editorProps: {
61
- // Drop the browser's default focus ring on the contenteditable — the
62
- // select-mode selection frame already indicates the edit target.
63
- attributes: { style: "outline: none;" },
64
- handleKeyDown: (_view, event) => {
65
- if (event.key === "Enter" && (event.shiftKey || event.metaKey || event.ctrlKey)) {
66
- event.preventDefault();
67
- onCommit();
68
- return true;
69
- }
70
- if (event.key === "Escape") {
71
- event.preventDefault();
72
- onEscape();
73
- return true;
74
- }
75
- return false;
76
- }
77
- },
78
- onSelectionUpdate: ({ editor: activeEditor }) => {
79
- onSelectionUpdate({
80
- bold: activeEditor.isActive("bold"),
81
- italic: activeEditor.isActive("italic"),
82
- underline: activeEditor.isActive("underline"),
83
- strike: activeEditor.isActive("strike")
84
- });
85
- },
86
- onBlur: () => {
87
- onBlur();
88
- }
1
+ import { canopyTombstoneError } from "../../lib/tombstone";
2
+ function createInlineTiptapEditor(_args) {
3
+ throw canopyTombstoneError({
4
+ symbol: "createInlineTiptapEditor",
5
+ subpath: "editor/select-mode/tiptapInlineEditor",
6
+ replacement: { kind: "sandbox-runtime" }
89
7
  });
90
- return {
91
- focus: () => editor.commands.focus(),
92
- // Focus the editor with the full text block selected so the user can type
93
- // to replace it immediately (or arrow/click to drop the selection).
94
- focusAndSelectAll: () => editor.chain().focus().selectAll().run(),
95
- destroy: () => {
96
- editor.destroy();
97
- for (const attribute of Array.from(element.attributes)) {
98
- element.removeAttribute(attribute.name);
99
- }
100
- for (const { name, value } of originalAttributes) {
101
- element.setAttribute(name, value);
102
- }
103
- },
104
- getHTML: () => editor.getHTML(),
105
- getJSON: () => editor.getJSON(),
106
- runFormatCommand: (command) => {
107
- const commandRunners = {
108
- toggleBold: () => editor.chain().focus().toggleBold().run(),
109
- toggleItalic: () => editor.chain().focus().toggleItalic().run(),
110
- toggleUnderline: () => editor.chain().focus().toggleUnderline().run(),
111
- toggleStrike: () => editor.chain().focus().toggleStrike().run()
112
- };
113
- commandRunners[command]();
114
- }
115
- };
116
8
  }
117
9
  export {
118
10
  createInlineTiptapEditor
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../../../editor/select-mode/tiptapInlineEditor.ts"],
4
- "sourcesContent": ["import type { JSONContent } from \"@tiptap/core\";\nimport type { SelectModeFormatCommand } from \"schemas/generated/selectMode\";\n\nimport { Editor, Mark } from \"@tiptap/core\";\nimport Bold from \"@tiptap/extension-bold\";\nimport Document from \"@tiptap/extension-document\";\nimport Italic from \"@tiptap/extension-italic\";\nimport Strike from \"@tiptap/extension-strike\";\nimport Text from \"@tiptap/extension-text\";\nimport Underline from \"@tiptap/extension-underline\";\n\nconst InlineDocument = Document.extend({\n content: \"inline*\",\n});\n\nconst InlineLink = Mark.create({\n name: \"link\",\n inclusive: false,\n addAttributes() {\n return {\n class: { default: null },\n href: { default: null },\n rel: { default: null },\n target: { default: null },\n };\n },\n parseHTML() {\n return [{ tag: \"a[href]\" }];\n },\n renderHTML({ HTMLAttributes }) {\n return [\"a\", HTMLAttributes, 0];\n },\n});\n\nexport type InlineTiptapEditor = {\n focus: () => void;\n focusAndSelectAll: () => void;\n destroy: () => void;\n getHTML: () => string;\n getJSON: () => JSONContent;\n runFormatCommand: (command: SelectModeFormatCommand) => void;\n};\n\nexport function createInlineTiptapEditor({\n element,\n content,\n onCommit,\n onEscape,\n onBlur,\n onSelectionUpdate,\n}: {\n element: HTMLElement;\n content: string;\n onCommit: () => void;\n onEscape: () => void;\n onBlur: () => void;\n onSelectionUpdate: (activeMarks: {\n bold: boolean;\n italic: boolean;\n underline: boolean;\n strike: boolean;\n }) => void;\n}): InlineTiptapEditor {\n const originalAttributes = Array.from(\n element.attributes,\n ({ name, value }) => ({\n name,\n value,\n }),\n );\n // ProseMirror *appends* its contenteditable to the mount node rather than\n // replacing it, so the element's original text node would survive as a\n // sibling and render a duplicate copy. The editor's initial content comes\n // from the `content` option below (not the element's DOM), and the caller\n // keeps the original HTML for revert, so emptying the node here is safe.\n element.replaceChildren();\n const mount = {\n mount: element,\n } as unknown as Element; /* eslint-disable-line replo/no-as-cast -- NOTE (Noah Gilmore, 2026-07-16): ProseMirror accepts this documented direct-mount shape at runtime, but Tiptap v2's Editor option incorrectly narrows it to Element. */\n const editor = new Editor({\n element: mount,\n content,\n extensions: [\n InlineDocument,\n Text,\n Bold,\n Italic,\n Underline,\n Strike,\n InlineLink,\n ],\n editorProps: {\n // Drop the browser's default focus ring on the contenteditable \u2014 the\n // select-mode selection frame already indicates the edit target.\n attributes: { style: \"outline: none;\" },\n handleKeyDown: (_view, event) => {\n // Commit on Shift-Enter or Cmd/Ctrl-Enter; a bare Enter inserts a line\n // break as usual.\n if (\n event.key === \"Enter\" &&\n (event.shiftKey || event.metaKey || event.ctrlKey)\n ) {\n event.preventDefault();\n onCommit();\n return true;\n }\n if (event.key === \"Escape\") {\n event.preventDefault();\n onEscape();\n return true;\n }\n return false;\n },\n },\n onSelectionUpdate: ({ editor: activeEditor }) => {\n onSelectionUpdate({\n bold: activeEditor.isActive(\"bold\"),\n italic: activeEditor.isActive(\"italic\"),\n underline: activeEditor.isActive(\"underline\"),\n strike: activeEditor.isActive(\"strike\"),\n });\n },\n onBlur: () => {\n onBlur();\n },\n });\n\n return {\n focus: () => editor.commands.focus(),\n // Focus the editor with the full text block selected so the user can type\n // to replace it immediately (or arrow/click to drop the selection).\n focusAndSelectAll: () => editor.chain().focus().selectAll().run(),\n destroy: () => {\n editor.destroy();\n for (const attribute of Array.from(element.attributes)) {\n element.removeAttribute(attribute.name);\n }\n for (const { name, value } of originalAttributes) {\n element.setAttribute(name, value);\n }\n },\n getHTML: () => editor.getHTML(),\n getJSON: () => editor.getJSON(),\n runFormatCommand: (command) => {\n const commandRunners: Record<SelectModeFormatCommand, () => void> = {\n toggleBold: () => editor.chain().focus().toggleBold().run(),\n toggleItalic: () => editor.chain().focus().toggleItalic().run(),\n toggleUnderline: () => editor.chain().focus().toggleUnderline().run(),\n toggleStrike: () => editor.chain().focus().toggleStrike().run(),\n };\n commandRunners[command]();\n },\n };\n}\n"],
5
- "mappings": "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",
4
+ "sourcesContent": ["import type { SelectModeFormatCommand } from \"schemas/generated/selectMode\";\n\nimport { canopyTombstoneError } from \"../../lib/tombstone\";\n\ntype JSONContent = {\n type?: string;\n // oxlint-disable-next-line typescript/no-explicit-any -- Preserves Tiptap's retired public JSON contract.\n attrs?: Record<string, any>;\n content?: JSONContent[];\n marks?: {\n type: string;\n // oxlint-disable-next-line typescript/no-explicit-any -- Preserves Tiptap's retired public JSON contract.\n attrs?: Record<string, any>;\n // oxlint-disable-next-line typescript/no-explicit-any -- Preserves Tiptap's retired public JSON contract.\n [key: string]: any;\n }[];\n text?: string;\n // oxlint-disable-next-line typescript/no-explicit-any -- Preserves Tiptap's retired public JSON contract.\n [key: string]: any;\n};\n\nexport type InlineTiptapEditor = {\n focus: () => void;\n focusAndSelectAll: () => void;\n destroy: () => void;\n getHTML: () => string;\n getJSON: () => JSONContent;\n runFormatCommand: (command: SelectModeFormatCommand) => void;\n};\n\n/** @deprecated Mount SandboxRuntime from @replohq/sandbox-runtime instead. */\nexport function createInlineTiptapEditor(_args: {\n element: HTMLElement;\n content: string;\n onCommit: () => void;\n onEscape: () => void;\n onBlur: () => void;\n onSelectionUpdate: (activeMarks: {\n bold: boolean;\n italic: boolean;\n underline: boolean;\n strike: boolean;\n }) => void;\n}): InlineTiptapEditor {\n throw canopyTombstoneError({\n symbol: \"createInlineTiptapEditor\",\n subpath: \"editor/select-mode/tiptapInlineEditor\",\n replacement: { kind: \"sandbox-runtime\" },\n });\n}\n"],
5
+ "mappings": "AAEA,SAAS,4BAA4B;AA6B9B,SAAS,yBAAyB,OAYlB;AACrB,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa,EAAE,MAAM,kBAAkB;AAAA,EACzC,CAAC;AACH;",
6
6
  "names": []
7
7
  }
package/env.d.ts CHANGED
@@ -5,5 +5,6 @@ type Env = {
5
5
  REPLO_ANALYTICS_PIXEL_URL?: string;
6
6
  CHECKOUT_PROVIDER?: "shopify" | "stripe" | "none";
7
7
  };
8
- export declare const getEnv: () => Promise<Env>;
8
+ /** @deprecated Use a supported public @replohq/sdk API for this domain; getEnv has no direct replacement. */
9
+ export declare function getEnv(): Promise<Env>;
9
10
  export {};
package/env.js CHANGED
@@ -1,41 +1,14 @@
1
- import { getCloudflareContext } from "@opennextjs/cloudflare";
2
- import JSONC from "tiny-jsonc";
3
- import { z } from "zod";
4
- import { CanopyError } from "./lib/canopy-error";
5
- const envSchema = z.object({
6
- CANOPY_API_HOST: z.string().min(1),
7
- PROJECT_ID: z.uuid(),
8
- ANALYTICS_FIRE_API_URL: z.string().optional(),
9
- REPLO_ANALYTICS_PIXEL_URL: z.string().optional(),
10
- CHECKOUT_PROVIDER: z.enum(["shopify", "stripe", "none"]).optional()
11
- });
12
- const wranglerConfigSchema = z.object({ vars: envSchema });
13
- class MissingWranglerConfigError extends CanopyError {
1
+ import { canopyTombstoneError } from "./lib/tombstone";
2
+ async function getEnv() {
3
+ throw canopyTombstoneError({
4
+ symbol: "getEnv",
5
+ subpath: "env",
6
+ replacement: {
7
+ kind: "internal",
8
+ nearestPublicSubpaths: ["providers/replo-provider"]
9
+ }
10
+ });
14
11
  }
15
- const isDeployedWorker = () => {
16
- return process.env.NODE_ENV === "production" && process.env.BUILD_ENV !== "build" && process.env.NEXT_PHASE !== "phase-production-build";
17
- };
18
- const getEnv = async () => {
19
- if (isDeployedWorker()) {
20
- const { env } = await getCloudflareContext({ async: true });
21
- return envSchema.parse(env);
22
- }
23
- const { promises: fs } = await import(
24
- /* turbopackIgnore: true */
25
- /* webpackIgnore: true */
26
- "node:fs"
27
- );
28
- let raw;
29
- try {
30
- raw = await fs.readFile(`${process.cwd()}/wrangler.jsonc`, "utf8");
31
- } catch (error) {
32
- throw new MissingWranglerConfigError({
33
- message: `wrangler.jsonc not found in ${process.cwd()}. It holds this site's Replo project config (project id, API host) and is required to run outside the deployed worker. If this clone predates the committed config, open the site in Replo once \u2014 the dev server regenerates and commits it \u2014 then git pull.`,
34
- cause: error
35
- });
36
- }
37
- return wranglerConfigSchema.parse(JSONC.parse(raw)).vars;
38
- };
39
12
  export {
40
13
  getEnv
41
14
  };
package/env.js.map CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "version": 3,
3
3
  "sources": ["../env.ts"],
4
- "sourcesContent": ["import { getCloudflareContext } from \"@opennextjs/cloudflare\";\nimport JSONC from \"tiny-jsonc\";\nimport { z } from \"zod\";\n\nimport { CanopyError } from \"./lib/canopy-error\";\n\ntype Env = {\n CANOPY_API_HOST: string;\n PROJECT_ID: string;\n\n // Base URL of analytics-fire (e.g. https://data.replo.app). Read server-side by\n // the consent action (`consent/consent-actions.ts`) to forward proof-of-consent\n // records. Optional: absent in environments where the audit pipeline isn't\n // wired (e.g. local dev), where consent recording simply no-ops.\n ANALYTICS_FIRE_API_URL?: string;\n\n // Base URL of the Replo first-party analytics pixel CDN (e.g.\n // https://pixel.replo.app). `<ReploFirstPartyPixel>` loads\n // `${REPLO_ANALYTICS_PIXEL_URL}/latest.js` into the page once analytics consent\n // is granted; the browser fetches it directly. Optional: absent when the pixel\n // isn't configured (e.g. lean local dev), where the pixel simply isn't injected.\n REPLO_ANALYTICS_PIXEL_URL?: string;\n\n CHECKOUT_PROVIDER?: \"shopify\" | \"stripe\" | \"none\";\n};\n\nconst envSchema = z.object({\n CANOPY_API_HOST: z.string().min(1),\n PROJECT_ID: z.uuid(),\n ANALYTICS_FIRE_API_URL: z.string().optional(),\n REPLO_ANALYTICS_PIXEL_URL: z.string().optional(),\n CHECKOUT_PROVIDER: z.enum([\"shopify\", \"stripe\", \"none\"]).optional(),\n});\n\nconst wranglerConfigSchema = z.object({ vars: envSchema });\n\nclass MissingWranglerConfigError extends CanopyError {}\n\n// NOTE (Cole, 2026-07-28, REPL-29501): outside the deployed worker, read wrangler.jsonc directly \u2014 concurrent workerd boots race on the shared .wrangler/state SQLite (SQLITE_BUSY).\nconst isDeployedWorker = () => {\n return (\n process.env.NODE_ENV === \"production\" &&\n process.env.BUILD_ENV !== \"build\" &&\n process.env.NEXT_PHASE !== \"phase-production-build\"\n );\n};\n\nexport const getEnv = async (): Promise<Env> => {\n if (isDeployedWorker()) {\n const { env } = await getCloudflareContext({ async: true });\n return envSchema.parse(env);\n }\n // NOTE (Cole, 2026-07-29, REPL-29501): client chunks bundle this module (integration-utils has client consumers). A static node:fs broke those chunks in 0.16.3, and a computed specifier fails Turbopack too (\"expression is too dynamic\") \u2014 only the ignore-annotated literal import compiles; postbuild.mts asserts the annotation survives into dist.\n const { promises: fs }: typeof import(\"node:fs\") = await import(\n /* turbopackIgnore: true */ /* webpackIgnore: true */ \"node:fs\"\n );\n let raw: string;\n try {\n raw = await fs.readFile(`${process.cwd()}/wrangler.jsonc`, \"utf8\");\n } catch (error) {\n throw new MissingWranglerConfigError({\n message:\n `wrangler.jsonc not found in ${process.cwd()}. It holds this site's Replo project config ` +\n `(project id, API host) and is required to run outside the deployed worker. ` +\n `If this clone predates the committed config, open the site in Replo once \u2014 the dev ` +\n `server regenerates and commits it \u2014 then git pull.`,\n cause: error,\n });\n }\n return wranglerConfigSchema.parse(JSONC.parse(raw)).vars;\n};\n"],
5
- "mappings": "AAAA,SAAS,4BAA4B;AACrC,OAAO,WAAW;AAClB,SAAS,SAAS;AAElB,SAAS,mBAAmB;AAsB5B,MAAM,YAAY,EAAE,OAAO;AAAA,EACzB,iBAAiB,EAAE,OAAO,EAAE,IAAI,CAAC;AAAA,EACjC,YAAY,EAAE,KAAK;AAAA,EACnB,wBAAwB,EAAE,OAAO,EAAE,SAAS;AAAA,EAC5C,2BAA2B,EAAE,OAAO,EAAE,SAAS;AAAA,EAC/C,mBAAmB,EAAE,KAAK,CAAC,WAAW,UAAU,MAAM,CAAC,EAAE,SAAS;AACpE,CAAC;AAED,MAAM,uBAAuB,EAAE,OAAO,EAAE,MAAM,UAAU,CAAC;AAEzD,MAAM,mCAAmC,YAAY;AAAC;AAGtD,MAAM,mBAAmB,MAAM;AAC7B,SACE,QAAQ,IAAI,aAAa,gBACzB,QAAQ,IAAI,cAAc,WAC1B,QAAQ,IAAI,eAAe;AAE/B;AAEO,MAAM,SAAS,YAA0B;AAC9C,MAAI,iBAAiB,GAAG;AACtB,UAAM,EAAE,IAAI,IAAI,MAAM,qBAAqB,EAAE,OAAO,KAAK,CAAC;AAC1D,WAAO,UAAU,MAAM,GAAG;AAAA,EAC5B;AAEA,QAAM,EAAE,UAAU,GAAG,IAA8B,MAAM;AAAA;AAAA;AAAA,IACD;AAAA,EACxD;AACA,MAAI;AACJ,MAAI;AACF,UAAM,MAAM,GAAG,SAAS,GAAG,QAAQ,IAAI,CAAC,mBAAmB,MAAM;AAAA,EACnE,SAAS,OAAO;AACd,UAAM,IAAI,2BAA2B;AAAA,MACnC,SACE,+BAA+B,QAAQ,IAAI,CAAC;AAAA,MAI9C,OAAO;AAAA,IACT,CAAC;AAAA,EACH;AACA,SAAO,qBAAqB,MAAM,MAAM,MAAM,GAAG,CAAC,EAAE;AACtD;",
4
+ "sourcesContent": ["import { canopyTombstoneError } from \"./lib/tombstone\";\n\ntype Env = {\n CANOPY_API_HOST: string;\n PROJECT_ID: string;\n // Base URL of analytics-fire (e.g. https://data.replo.app). Read server-side by\n // the consent action (`consent/consent-actions.ts`) to forward proof-of-consent\n // records. Optional: absent in environments where the audit pipeline isn't\n // wired (e.g. local dev), where consent recording simply no-ops.\n ANALYTICS_FIRE_API_URL?: string;\n // Base URL of the Replo first-party analytics pixel CDN (e.g.\n // https://pixel.replo.app). `<ReploFirstPartyPixel>` loads\n // `${REPLO_ANALYTICS_PIXEL_URL}/latest.js` into the page once analytics consent\n // is granted; the browser fetches it directly. Optional: absent when the pixel\n // isn't configured (e.g. lean local dev), where the pixel simply isn't injected.\n REPLO_ANALYTICS_PIXEL_URL?: string;\n CHECKOUT_PROVIDER?: \"shopify\" | \"stripe\" | \"none\";\n};\n\n/** @deprecated Use a supported public @replohq/sdk API for this domain; getEnv has no direct replacement. */\nexport async function getEnv(): Promise<Env> {\n throw canopyTombstoneError({\n symbol: \"getEnv\",\n subpath: \"env\",\n replacement: {\n kind: \"internal\",\n nearestPublicSubpaths: [\"providers/replo-provider\"],\n },\n });\n}\n"],
5
+ "mappings": "AAAA,SAAS,4BAA4B;AAoBrC,eAAsB,SAAuB;AAC3C,QAAM,qBAAqB;AAAA,IACzB,QAAQ;AAAA,IACR,SAAS;AAAA,IACT,aAAa;AAAA,MACX,MAAM;AAAA,MACN,uBAAuB,CAAC,0BAA0B;AAAA,IACpD;AAAA,EACF,CAAC;AACH;",
6
6
  "names": []
7
7
  }
@@ -1,24 +1,26 @@
1
1
  import type { Cart } from "../cart/cart-schema";
2
- import { CanopyError } from "../lib/canopy-error";
2
+ import type { CanopyErrorConfig } from "../lib/canopy-error";
3
3
  type CanopyApiGatewayErrorConfig = {
4
4
  message: string;
5
5
  statusCode?: number;
6
6
  cause?: unknown;
7
7
  additionalData?: Record<string, unknown>;
8
8
  };
9
- export declare class CanopyApiGatewayError extends CanopyError {
9
+ /** @deprecated Use a supported public @replohq/sdk API for this domain; CanopyApiGatewayError has no direct replacement. */
10
+ export declare class CanopyApiGatewayError extends Error {
11
+ config: CanopyErrorConfig;
12
+ id: string;
10
13
  statusCode: number;
11
- constructor(config: CanopyApiGatewayErrorConfig);
14
+ constructor(_config: CanopyApiGatewayErrorConfig);
12
15
  }
13
16
  declare class CanopyApiGateway {
14
17
  private apiHost;
15
18
  private baseUrl;
16
- constructor(apiHost: string);
17
- private static readonly REQUEST_TIMEOUT_MILLISECONDS;
19
+ constructor(_apiHost: string);
18
20
  static setup(): Promise<CanopyApiGateway>;
19
21
  private _post;
20
22
  private _get;
21
- invokeLoader({ loaderKey, args, }: {
23
+ invokeLoader(_args: {
22
24
  loaderKey: string;
23
25
  args: Record<string, unknown>;
24
26
  }): Promise<{
@@ -31,10 +33,10 @@ declare class CanopyApiGateway {
31
33
  } | undefined;
32
34
  }>;
33
35
  private _cartPost;
34
- cartGet({ cartId }: {
36
+ cartGet(_args: {
35
37
  cartId: string;
36
38
  }): Promise<Cart | null>;
37
- cartCreate(options?: {
39
+ cartCreate(_options?: {
38
40
  lines?: {
39
41
  merchandiseId: string;
40
42
  quantity: number;
@@ -46,7 +48,7 @@ declare class CanopyApiGateway {
46
48
  }[];
47
49
  discountCodes?: string[];
48
50
  }): Promise<Cart>;
49
- cartAddLines({ cartId, lines, }: {
51
+ cartAddLines(_args: {
50
52
  cartId: string;
51
53
  lines: {
52
54
  merchandiseId: string;
@@ -58,7 +60,7 @@ declare class CanopyApiGateway {
58
60
  sellingPlanId?: string | null;
59
61
  }[];
60
62
  }): Promise<Cart>;
61
- cartUpdateLines({ cartId, lines, }: {
63
+ cartUpdateLines(_args: {
62
64
  cartId: string;
63
65
  lines: {
64
66
  lineId: string;
@@ -70,14 +72,15 @@ declare class CanopyApiGateway {
70
72
  sellingPlanId?: string | null;
71
73
  }[];
72
74
  }): Promise<Cart>;
73
- cartRemoveLines({ cartId, lineIds, }: {
75
+ cartRemoveLines(_args: {
74
76
  cartId: string;
75
77
  lineIds: string[];
76
78
  }): Promise<Cart>;
77
- cartUpdateDiscountCodes({ cartId, discountCodes, }: {
79
+ cartUpdateDiscountCodes(_args: {
78
80
  cartId: string;
79
81
  discountCodes: string[];
80
82
  }): Promise<Cart>;
81
83
  }
84
+ /** @deprecated Use a supported public @replohq/sdk API for this domain; getCanopyApiGateway has no direct replacement. */
82
85
  export declare function getCanopyApiGateway(): Promise<CanopyApiGateway>;
83
86
  export {};
@@ -1,194 +1,156 @@
1
- import { z } from "zod";
2
- import { cartSchema } from "../cart/cart-schema";
3
- import { getEnv } from "../env";
4
- import { CanopyError } from "../lib/canopy-error";
5
- import { buildBaseUrl } from "../lib/url-utils";
6
- class CanopyApiGatewayError extends CanopyError {
1
+ import { canopyTombstoneError } from "../lib/tombstone";
2
+ class CanopyApiGatewayError extends Error {
3
+ config;
4
+ id;
7
5
  statusCode;
8
- constructor(config) {
9
- const resolvedStatusCode = config.statusCode ?? 500;
10
- super({
11
- message: config.message,
12
- cause: config.cause,
13
- additionalData: {
14
- ...config.additionalData,
15
- statusCode: resolvedStatusCode
6
+ constructor(_config) {
7
+ super();
8
+ throw canopyTombstoneError({
9
+ symbol: "CanopyApiGatewayError",
10
+ subpath: "gateways/canopy-api",
11
+ replacement: {
12
+ kind: "internal",
13
+ nearestPublicSubpaths: ["providers/replo-provider"]
16
14
  }
17
15
  });
18
- this.statusCode = resolvedStatusCode;
19
16
  }
20
17
  }
21
- class UnknownCanopyApiError extends CanopyApiGatewayError {
22
- constructor(config) {
23
- super({ ...config, statusCode: 502 });
24
- }
25
- }
26
- const loaderInvokeResponseSchema = z.object({
27
- data: z.unknown(),
28
- meta: z.object({
29
- cache: z.object({
30
- hit: z.boolean(),
31
- ttlSeconds: z.number()
32
- })
33
- }).optional()
34
- });
35
18
  class CanopyApiGateway {
36
19
  apiHost;
37
20
  baseUrl;
38
- constructor(apiHost) {
39
- this.apiHost = apiHost;
40
- this.baseUrl = buildBaseUrl(apiHost);
21
+ constructor(_apiHost) {
22
+ throw canopyTombstoneError({
23
+ symbol: "CanopyApiGateway",
24
+ subpath: "gateways/canopy-api",
25
+ replacement: {
26
+ kind: "internal",
27
+ nearestPublicSubpaths: ["providers/replo-provider"]
28
+ }
29
+ });
41
30
  }
42
- static REQUEST_TIMEOUT_MILLISECONDS = 1e4;
43
31
  static async setup() {
44
- const env = await getEnv();
45
- return new CanopyApiGateway(env.CANOPY_API_HOST);
32
+ throw canopyTombstoneError({
33
+ symbol: "CanopyApiGateway",
34
+ subpath: "gateways/canopy-api",
35
+ replacement: {
36
+ kind: "internal",
37
+ nearestPublicSubpaths: ["providers/replo-provider"]
38
+ }
39
+ });
46
40
  }
47
- async _post(url, body) {
48
- const abortController = new AbortController();
49
- const timeoutId = setTimeout(() => {
50
- abortController.abort();
51
- }, CanopyApiGateway.REQUEST_TIMEOUT_MILLISECONDS);
52
- try {
53
- return await fetch(url, {
54
- method: "POST",
55
- headers: { "Content-Type": "application/json" },
56
- body: JSON.stringify(body),
57
- signal: abortController.signal
58
- });
59
- } catch (error) {
60
- let message = `Failed to POST to canopy-api at ${url}: ${error}`;
61
- if (process.env.NODE_ENV !== "production") {
62
- message += `
63
-
64
- apiHost: ${this.apiHost}
65
- If you're running locally, make sure the canopy-api cloudflare worker is running. You may need to restart the dev server.`;
41
+ async _post(_url, _body) {
42
+ throw canopyTombstoneError({
43
+ symbol: "CanopyApiGateway",
44
+ subpath: "gateways/canopy-api",
45
+ replacement: {
46
+ kind: "internal",
47
+ nearestPublicSubpaths: ["providers/replo-provider"]
66
48
  }
67
- throw new UnknownCanopyApiError({ message, cause: error });
68
- } finally {
69
- clearTimeout(timeoutId);
70
- }
49
+ });
71
50
  }
72
- async _get(url) {
73
- const abortController = new AbortController();
74
- const timeoutId = setTimeout(() => {
75
- abortController.abort();
76
- }, CanopyApiGateway.REQUEST_TIMEOUT_MILLISECONDS);
77
- try {
78
- return await fetch(url, { signal: abortController.signal });
79
- } catch (error) {
80
- let message = `Failed to GET from canopy-api at ${url}: ${error}`;
81
- if (process.env.NODE_ENV !== "production") {
82
- message += `
83
-
84
- apiHost: ${this.apiHost}
85
- If you're running locally, make sure the canopy-api cloudflare worker is running. You may need to restart the dev server.`;
51
+ async _get(_url) {
52
+ throw canopyTombstoneError({
53
+ symbol: "CanopyApiGateway",
54
+ subpath: "gateways/canopy-api",
55
+ replacement: {
56
+ kind: "internal",
57
+ nearestPublicSubpaths: ["providers/replo-provider"]
86
58
  }
87
- throw new UnknownCanopyApiError({ message, cause: error });
88
- } finally {
89
- clearTimeout(timeoutId);
90
- }
59
+ });
91
60
  }
92
- async invokeLoader({
93
- loaderKey,
94
- args
95
- }) {
96
- const env = await getEnv();
97
- const response = await this._post(`${this.baseUrl}/api/v1/loaders/invoke`, {
98
- projectId: env.PROJECT_ID,
99
- loaderKey,
100
- args
61
+ async invokeLoader(_args) {
62
+ throw canopyTombstoneError({
63
+ symbol: "CanopyApiGateway",
64
+ subpath: "gateways/canopy-api",
65
+ replacement: {
66
+ kind: "internal",
67
+ nearestPublicSubpaths: ["providers/replo-provider"]
68
+ }
101
69
  });
102
- if (!response.ok) {
103
- const errorBody = await response.text().catch(() => "");
104
- throw new CanopyApiGatewayError({
105
- message: `Failed to invoke loader ${loaderKey}: ${response.status} ${response.statusText}${errorBody ? ` \u2014 ${errorBody}` : ""}`,
106
- statusCode: response.status
107
- });
108
- }
109
- return loaderInvokeResponseSchema.parse(await response.json());
110
70
  }
111
71
  // ---------------------------------------------------------------------------
112
72
  // Cart operations (canopy-api-backed ExternalCart)
113
73
  // ---------------------------------------------------------------------------
114
- async _cartPost(path, body) {
115
- const env = await getEnv();
116
- const url = `${this.baseUrl}/api/v1/cart${path}`;
117
- const abortController = new AbortController();
118
- const timeoutId = setTimeout(() => {
119
- abortController.abort();
120
- }, CanopyApiGateway.REQUEST_TIMEOUT_MILLISECONDS);
121
- let response;
122
- try {
123
- response = await fetch(url, {
124
- method: "POST",
125
- headers: {
126
- "Content-Type": "application/json"
127
- },
128
- body: JSON.stringify({ ...body, projectId: env.PROJECT_ID }),
129
- signal: abortController.signal
130
- });
131
- } catch (error) {
132
- throw new UnknownCanopyApiError({
133
- message: `Failed to POST cart operation to ${url}: ${error}`,
134
- cause: error
135
- });
136
- } finally {
137
- clearTimeout(timeoutId);
138
- }
139
- if (!response.ok) {
140
- const text = await response.text().catch(() => "");
141
- throw new CanopyApiGatewayError({
142
- message: `Cart operation ${path} failed: ${response.status} ${response.statusText} \u2014 ${text}`,
143
- statusCode: response.status
144
- });
145
- }
146
- const json = await response.json();
147
- return cartSchema.parse(json.data);
74
+ async _cartPost(_path, _body) {
75
+ throw canopyTombstoneError({
76
+ symbol: "CanopyApiGateway",
77
+ subpath: "gateways/canopy-api",
78
+ replacement: {
79
+ kind: "internal",
80
+ nearestPublicSubpaths: ["providers/replo-provider"]
81
+ }
82
+ });
148
83
  }
149
- async cartGet({ cartId }) {
150
- try {
151
- return await this._cartPost("/get", { cartId });
152
- } catch (error) {
153
- if (error instanceof CanopyApiGatewayError && error.statusCode === 404) {
154
- return null;
84
+ async cartGet(_args) {
85
+ throw canopyTombstoneError({
86
+ symbol: "CanopyApiGateway",
87
+ subpath: "gateways/canopy-api",
88
+ replacement: {
89
+ kind: "internal",
90
+ nearestPublicSubpaths: ["providers/replo-provider"]
155
91
  }
156
- throw error;
157
- }
92
+ });
158
93
  }
159
- async cartCreate(options) {
160
- return this._cartPost("/create", {
161
- lines: options?.lines,
162
- discountCodes: options?.discountCodes
94
+ async cartCreate(_options) {
95
+ throw canopyTombstoneError({
96
+ symbol: "CanopyApiGateway",
97
+ subpath: "gateways/canopy-api",
98
+ replacement: {
99
+ kind: "internal",
100
+ nearestPublicSubpaths: ["providers/replo-provider"]
101
+ }
163
102
  });
164
103
  }
165
- async cartAddLines({
166
- cartId,
167
- lines
168
- }) {
169
- return this._cartPost("/add-lines", { cartId, lines });
104
+ async cartAddLines(_args) {
105
+ throw canopyTombstoneError({
106
+ symbol: "CanopyApiGateway",
107
+ subpath: "gateways/canopy-api",
108
+ replacement: {
109
+ kind: "internal",
110
+ nearestPublicSubpaths: ["providers/replo-provider"]
111
+ }
112
+ });
170
113
  }
171
- async cartUpdateLines({
172
- cartId,
173
- lines
174
- }) {
175
- return this._cartPost("/update-lines", { cartId, lines });
114
+ async cartUpdateLines(_args) {
115
+ throw canopyTombstoneError({
116
+ symbol: "CanopyApiGateway",
117
+ subpath: "gateways/canopy-api",
118
+ replacement: {
119
+ kind: "internal",
120
+ nearestPublicSubpaths: ["providers/replo-provider"]
121
+ }
122
+ });
176
123
  }
177
- async cartRemoveLines({
178
- cartId,
179
- lineIds
180
- }) {
181
- return this._cartPost("/remove-lines", { cartId, lineIds });
124
+ async cartRemoveLines(_args) {
125
+ throw canopyTombstoneError({
126
+ symbol: "CanopyApiGateway",
127
+ subpath: "gateways/canopy-api",
128
+ replacement: {
129
+ kind: "internal",
130
+ nearestPublicSubpaths: ["providers/replo-provider"]
131
+ }
132
+ });
182
133
  }
183
- async cartUpdateDiscountCodes({
184
- cartId,
185
- discountCodes
186
- }) {
187
- return this._cartPost("/update-discount-codes", { cartId, discountCodes });
134
+ async cartUpdateDiscountCodes(_args) {
135
+ throw canopyTombstoneError({
136
+ symbol: "CanopyApiGateway",
137
+ subpath: "gateways/canopy-api",
138
+ replacement: {
139
+ kind: "internal",
140
+ nearestPublicSubpaths: ["providers/replo-provider"]
141
+ }
142
+ });
188
143
  }
189
144
  }
190
145
  async function getCanopyApiGateway() {
191
- return CanopyApiGateway.setup();
146
+ throw canopyTombstoneError({
147
+ symbol: "getCanopyApiGateway",
148
+ subpath: "gateways/canopy-api",
149
+ replacement: {
150
+ kind: "internal",
151
+ nearestPublicSubpaths: ["providers/replo-provider"]
152
+ }
153
+ });
192
154
  }
193
155
  export {
194
156
  CanopyApiGatewayError,