@nuxt/scripts 1.3.6 → 2.0.0-beta.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 (207) hide show
  1. package/THIRD_PARTY_LICENSES.md +124 -0
  2. package/dist/devtools-client/200.html +1 -1
  3. package/dist/devtools-client/404.html +1 -1
  4. package/dist/devtools-client/_nuxt/{B551Pnuh.js → 2p1_IuX2.js} +1 -1
  5. package/dist/devtools-client/_nuxt/{KxC4Q3ev.js → 9elIQxwW.js} +1 -1
  6. package/dist/devtools-client/_nuxt/{DTP8MRtW.js → BNPn63Jz.js} +1 -1
  7. package/dist/devtools-client/_nuxt/BjRLaDIG.js +152 -0
  8. package/dist/devtools-client/_nuxt/BtNUYBXT.js +8 -0
  9. package/dist/devtools-client/_nuxt/CDDBpkXG.js +3 -0
  10. package/dist/devtools-client/_nuxt/Cpb0XAYP.js +1 -0
  11. package/dist/devtools-client/_nuxt/DAsiyhPm.js +6 -0
  12. package/dist/devtools-client/_nuxt/{VICyrUSM.js → DabLKy7M.js} +1 -1
  13. package/dist/devtools-client/_nuxt/Dat651Oh.js +1 -0
  14. package/dist/devtools-client/_nuxt/DcG2ZXvY.js +1 -0
  15. package/dist/devtools-client/_nuxt/DmlGWZ2X.js +1 -0
  16. package/dist/devtools-client/_nuxt/KsX6Az5B.js +1 -0
  17. package/dist/devtools-client/_nuxt/RL1np866.js +28 -0
  18. package/dist/devtools-client/_nuxt/UmWNrBO5.js +2 -0
  19. package/dist/devtools-client/_nuxt/builds/latest.json +1 -1
  20. package/dist/devtools-client/_nuxt/builds/meta/e28b96f1-78e8-41a4-ad6f-904cd078f85e.json +1 -0
  21. package/dist/devtools-client/_nuxt/{entry.CYUdJFoE.css → entry.9HJPJ6Hp.css} +1 -1
  22. package/dist/devtools-client/_nuxt/error-404.DnwL1N6v.css +1 -0
  23. package/dist/devtools-client/_nuxt/error-500.DEbXRLdm.css +1 -0
  24. package/dist/devtools-client/docs/index.html +1 -1
  25. package/dist/devtools-client/first-party/index.html +1 -1
  26. package/dist/devtools-client/index.html +1 -1
  27. package/dist/devtools-client/registry/index.html +1 -1
  28. package/dist/module.d.mts +2 -86
  29. package/dist/module.d.ts +2 -86
  30. package/dist/module.json +3 -3
  31. package/dist/module.mjs +71 -328
  32. package/dist/registry.mjs +54 -22
  33. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.d.vue.ts +1 -28
  34. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue +7 -50
  35. package/dist/runtime/components/GoogleMaps/ScriptGoogleMaps.vue.d.ts +1 -28
  36. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.d.vue.ts +0 -8
  37. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue +1 -13
  38. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsOverlayView.vue.d.ts +0 -8
  39. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.d.vue.ts +4 -4
  40. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.vue +9 -15
  41. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsStaticMap.vue.d.ts +4 -4
  42. package/dist/runtime/components/GoogleMaps/useGoogleMapsResource.d.ts +0 -22
  43. package/dist/runtime/components/GoogleMaps/useGoogleMapsResource.js +0 -31
  44. package/dist/runtime/components/Leaflet/ScriptLeafletGeoJson.d.vue.ts +31 -0
  45. package/dist/runtime/components/Leaflet/ScriptLeafletGeoJson.vue +43 -0
  46. package/dist/runtime/components/Leaflet/ScriptLeafletGeoJson.vue.d.ts +31 -0
  47. package/dist/runtime/components/Leaflet/ScriptLeafletMap.d.vue.ts +90 -0
  48. package/dist/runtime/components/Leaflet/ScriptLeafletMap.vue +171 -0
  49. package/dist/runtime/components/Leaflet/ScriptLeafletMap.vue.d.ts +90 -0
  50. package/dist/runtime/components/Leaflet/ScriptLeafletMarker.d.vue.ts +47 -0
  51. package/dist/runtime/components/Leaflet/ScriptLeafletMarker.vue +70 -0
  52. package/dist/runtime/components/Leaflet/ScriptLeafletMarker.vue.d.ts +47 -0
  53. package/dist/runtime/components/Leaflet/ScriptLeafletPopup.d.vue.ts +31 -0
  54. package/dist/runtime/components/Leaflet/ScriptLeafletPopup.vue +81 -0
  55. package/dist/runtime/components/Leaflet/ScriptLeafletPopup.vue.d.ts +31 -0
  56. package/dist/runtime/components/Leaflet/ScriptLeafletTileLayer.d.vue.ts +26 -0
  57. package/dist/runtime/components/Leaflet/ScriptLeafletTileLayer.vue +38 -0
  58. package/dist/runtime/components/Leaflet/ScriptLeafletTileLayer.vue.d.ts +26 -0
  59. package/dist/runtime/components/Leaflet/useLeafletResource.d.ts +30 -0
  60. package/dist/runtime/components/Leaflet/useLeafletResource.js +46 -0
  61. package/dist/runtime/components/MapLibre/ScriptMapLibreGeoJson.d.vue.ts +39 -0
  62. package/dist/runtime/components/MapLibre/ScriptMapLibreGeoJson.vue +84 -0
  63. package/dist/runtime/components/MapLibre/ScriptMapLibreGeoJson.vue.d.ts +39 -0
  64. package/dist/runtime/components/MapLibre/ScriptMapLibreMap.d.vue.ts +122 -0
  65. package/dist/runtime/components/MapLibre/ScriptMapLibreMap.vue +214 -0
  66. package/dist/runtime/components/MapLibre/ScriptMapLibreMap.vue.d.ts +122 -0
  67. package/dist/runtime/components/MapLibre/ScriptMapLibreMarker.d.vue.ts +35 -0
  68. package/dist/runtime/components/MapLibre/ScriptMapLibreMarker.vue +98 -0
  69. package/dist/runtime/components/MapLibre/ScriptMapLibreMarker.vue.d.ts +35 -0
  70. package/dist/runtime/components/MapLibre/ScriptMapLibreNavigationControl.d.vue.ts +12 -0
  71. package/dist/runtime/components/MapLibre/ScriptMapLibreNavigationControl.vue +23 -0
  72. package/dist/runtime/components/MapLibre/ScriptMapLibreNavigationControl.vue.d.ts +12 -0
  73. package/dist/runtime/components/MapLibre/ScriptMapLibrePopup.d.vue.ts +31 -0
  74. package/dist/runtime/components/MapLibre/ScriptMapLibrePopup.vue +99 -0
  75. package/dist/runtime/components/MapLibre/ScriptMapLibrePopup.vue.d.ts +31 -0
  76. package/dist/runtime/components/MapLibre/useMapLibreResource.d.ts +23 -0
  77. package/dist/runtime/components/MapLibre/useMapLibreResource.js +41 -0
  78. package/dist/runtime/components/ScriptCrisp.vue +20 -18
  79. package/dist/runtime/components/ScriptDeskCrew.d.vue.ts +40 -0
  80. package/dist/runtime/components/ScriptDeskCrew.vue +82 -0
  81. package/dist/runtime/components/ScriptDeskCrew.vue.d.ts +40 -0
  82. package/dist/runtime/components/ScriptIntercom.vue +21 -19
  83. package/dist/runtime/components/ScriptLoadingIndicator.d.vue.ts +1 -1
  84. package/dist/runtime/components/ScriptLoadingIndicator.vue.d.ts +1 -1
  85. package/dist/runtime/components/ScriptPayPalButtons.vue +7 -3
  86. package/dist/runtime/components/ScriptPayPalMessages.vue +8 -4
  87. package/dist/runtime/composables/useScript.js +96 -49
  88. package/dist/runtime/composables/useScriptProxyUrl.d.ts +4 -8
  89. package/dist/runtime/composables/useScriptProxyUrl.js +0 -7
  90. package/dist/runtime/composables/useScriptTriggerIdleTimeout.d.ts +2 -1
  91. package/dist/runtime/composables/useScriptTriggerIdleTimeout.js +3 -34
  92. package/dist/runtime/composables/useScriptTriggerInteraction.d.ts +2 -1
  93. package/dist/runtime/composables/useScriptTriggerInteraction.js +13 -46
  94. package/dist/runtime/composables/useScriptTriggerServiceWorker.d.ts +2 -1
  95. package/dist/runtime/composables/useScriptTriggerServiceWorker.js +5 -38
  96. package/dist/runtime/leaflet-styles.d.ts +13 -0
  97. package/dist/runtime/leaflet-styles.js +684 -0
  98. package/dist/runtime/maplibre-styles.d.ts +7 -0
  99. package/dist/runtime/maplibre-styles.js +25 -0
  100. package/dist/runtime/npm-script-api-state.d.ts +4 -0
  101. package/dist/runtime/npm-script-api-state.js +13 -0
  102. package/dist/runtime/registry/crisp.d.ts +1 -1
  103. package/dist/runtime/registry/crisp.js +30 -18
  104. package/dist/runtime/registry/deskcrew.d.ts +52 -0
  105. package/dist/runtime/registry/deskcrew.js +31 -0
  106. package/dist/runtime/registry/google-analytics.d.ts +0 -2
  107. package/dist/runtime/registry/google-maps.d.ts +2 -11
  108. package/dist/runtime/registry/google-maps.js +31 -10
  109. package/dist/runtime/registry/google-tag-manager.d.ts +0 -2
  110. package/dist/runtime/registry/leaflet.d.ts +13 -0
  111. package/dist/runtime/registry/leaflet.js +29 -0
  112. package/dist/runtime/registry/maplibre.d.ts +13 -0
  113. package/dist/runtime/registry/maplibre.js +29 -0
  114. package/dist/runtime/registry/matomo-analytics.js +1 -8
  115. package/dist/runtime/registry/plausible-analytics.d.ts +4 -16
  116. package/dist/runtime/registry/plausible-analytics.js +15 -58
  117. package/dist/runtime/registry/rybbit-analytics.d.ts +0 -4
  118. package/dist/runtime/registry/rybbit-analytics.js +1 -4
  119. package/dist/runtime/registry/schemas.d.ts +61 -5
  120. package/dist/runtime/registry/schemas.js +64 -5
  121. package/dist/runtime/registry/tiktok-pixel.d.ts +2 -12
  122. package/dist/runtime/registry/tiktok-pixel.js +1 -1
  123. package/dist/runtime/registry/usercentrics.js +46 -6
  124. package/dist/runtime/registry/youtube-player.d.ts +3 -4
  125. package/dist/runtime/registry/youtube-player.js +30 -23
  126. package/dist/runtime/server/bluesky-embed-image.d.ts +1 -1
  127. package/dist/runtime/server/bluesky-embed.d.ts +1 -1
  128. package/dist/runtime/server/bluesky-embed.js +3 -6
  129. package/dist/runtime/server/gravatar-proxy.d.ts +1 -1
  130. package/dist/runtime/server/gravatar-proxy.js +2 -3
  131. package/dist/runtime/server/instagram-embed-asset.d.ts +1 -1
  132. package/dist/runtime/server/instagram-embed-image.d.ts +1 -1
  133. package/dist/runtime/server/instagram-embed.d.ts +1 -1
  134. package/dist/runtime/server/instagram-embed.js +4 -7
  135. package/dist/runtime/server/utils/cached-upstream.d.ts +4 -11
  136. package/dist/runtime/server/utils/embed-rewriters.d.ts +3 -5
  137. package/dist/runtime/server/utils/embed-rewriters.js +8 -8
  138. package/dist/runtime/server/utils/image-proxy.d.ts +1 -1
  139. package/dist/runtime/server/utils/image-proxy.js +2 -3
  140. package/dist/runtime/server/utils/instagram-embed.d.ts +6 -6
  141. package/dist/runtime/server/utils/instagram-embed.js +18 -19
  142. package/dist/runtime/server/utils/proxy-url.d.ts +5 -6
  143. package/dist/runtime/server/utils/proxy-url.js +1 -4
  144. package/dist/runtime/server/x-embed-image.d.ts +1 -1
  145. package/dist/runtime/server/x-embed.d.ts +48 -1
  146. package/dist/runtime/server/x-embed.js +3 -6
  147. package/dist/runtime/types.d.ts +13 -13
  148. package/dist/runtime/utils/abortable-promise.js +26 -5
  149. package/dist/runtime/utils/nuxt-ready-script-trigger.d.ts +3 -0
  150. package/dist/runtime/utils/nuxt-ready-script-trigger.js +16 -0
  151. package/dist/runtime/utils.js +21 -32
  152. package/dist/stats.mjs +13 -0
  153. package/dist/types-source.mjs +1173 -100
  154. package/dist/types.d.mts +2 -2
  155. package/package.json +34 -21
  156. package/LICENSE.md +0 -9
  157. package/bin/cli.mjs +0 -2
  158. package/dist/cli.d.mts +0 -2
  159. package/dist/cli.d.ts +0 -2
  160. package/dist/cli.mjs +0 -50
  161. package/dist/devtools-client/_nuxt/8ltZ0o6d.js +0 -1
  162. package/dist/devtools-client/_nuxt/B8_EBdhg.js +0 -152
  163. package/dist/devtools-client/_nuxt/BKdLzFmX.js +0 -3
  164. package/dist/devtools-client/_nuxt/Bf2Kt1P0.js +0 -28
  165. package/dist/devtools-client/_nuxt/CC0GKROJ.js +0 -1
  166. package/dist/devtools-client/_nuxt/CH5oUfNi.js +0 -1
  167. package/dist/devtools-client/_nuxt/CMXzQxJZ.js +0 -1
  168. package/dist/devtools-client/_nuxt/CP7c-Js6.js +0 -8
  169. package/dist/devtools-client/_nuxt/C_v3_O0R.js +0 -6
  170. package/dist/devtools-client/_nuxt/CxN78VhB.js +0 -1
  171. package/dist/devtools-client/_nuxt/Dkc7iTdR.js +0 -1
  172. package/dist/devtools-client/_nuxt/builds/meta/35e54cbc-079c-4313-8838-34632d9dac97.json +0 -1
  173. package/dist/devtools-client/_nuxt/error-404.Bq2JQbJs.css +0 -1
  174. package/dist/devtools-client/_nuxt/error-500.5E_FOzlc.css +0 -1
  175. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.d.vue.ts +0 -13
  176. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue +0 -15
  177. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsAdvancedMarkerElement.vue.d.ts +0 -13
  178. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.d.vue.ts +0 -27
  179. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue +0 -34
  180. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsHeatmapLayer.vue.d.ts +0 -27
  181. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.d.vue.ts +0 -13
  182. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue +0 -11
  183. package/dist/runtime/components/GoogleMaps/ScriptGoogleMapsPinElement.vue.d.ts +0 -13
  184. package/dist/runtime/components/GoogleMaps/bindGoogleMapsEvents.d.ts +0 -13
  185. package/dist/runtime/components/GoogleMaps/bindGoogleMapsEvents.js +0 -8
  186. package/dist/runtime/components/GoogleMaps/injectionKeys.d.ts +0 -10
  187. package/dist/runtime/components/GoogleMaps/injectionKeys.js +0 -2
  188. package/dist/runtime/composables/useScriptProxyToken.d.ts +0 -12
  189. package/dist/runtime/composables/useScriptProxyToken.js +0 -4
  190. package/dist/runtime/npm-script-stub.d.ts +0 -20
  191. package/dist/runtime/npm-script-stub.js +0 -72
  192. package/dist/runtime/plugins/proxy-token.server.d.ts +0 -10
  193. package/dist/runtime/plugins/proxy-token.server.js +0 -17
  194. package/dist/runtime/server/google-maps-geocode-proxy.d.ts +0 -2
  195. package/dist/runtime/server/google-maps-geocode-proxy.js +0 -43
  196. package/dist/runtime/server/google-static-maps-proxy.d.ts +0 -2
  197. package/dist/runtime/server/google-static-maps-proxy.js +0 -56
  198. package/dist/runtime/server/utils/proxy-query.d.ts +0 -2
  199. package/dist/runtime/server/utils/proxy-query.js +0 -10
  200. package/dist/runtime/server/utils/sign-constants.d.ts +0 -16
  201. package/dist/runtime/server/utils/sign-constants.js +0 -5
  202. package/dist/runtime/server/utils/sign.d.ts +0 -101
  203. package/dist/runtime/server/utils/sign.js +0 -91
  204. package/dist/runtime/server/utils/withSigning.d.ts +0 -23
  205. package/dist/runtime/server/utils/withSigning.js +0 -19
  206. package/dist/runtime/unhead-features.d.ts +0 -1
  207. package/dist/runtime/unhead-features.js +0 -3
@@ -9,6 +9,32 @@ export declare const gcmConsentState: import("valibot").ObjectSchema<{
9
9
  readonly wait_for_update: import("valibot").OptionalSchema<import("valibot").NumberSchema<undefined>, undefined>;
10
10
  readonly region: import("valibot").OptionalSchema<import("valibot").ArraySchema<import("valibot").StringSchema<undefined>, undefined>, undefined>;
11
11
  }, undefined>;
12
+ export declare const LeafletOptions: import("valibot").ObjectSchema<{
13
+ /**
14
+ * Inject the Leaflet 1.9.4 styles and default marker images when the script
15
+ * begins loading. Disable this when supplying your own Leaflet stylesheet.
16
+ * @default true
17
+ */
18
+ readonly injectStyles: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
19
+ }, undefined>;
20
+ export declare const MapLibreOptions: import("valibot").ObjectSchema<{
21
+ /**
22
+ * Inject the MapLibre GL JS 5.24.0 stylesheet when the script begins
23
+ * loading. Disable this when supplying the stylesheet through Nuxt.
24
+ * @default true
25
+ */
26
+ readonly injectStyles: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
27
+ /**
28
+ * Stylesheet URL used when `injectStyles` is enabled.
29
+ * @default 'https://unpkg.com/maplibre-gl@5.24.0/dist/maplibre-gl.css'
30
+ */
31
+ readonly stylesheetUrl: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
32
+ /**
33
+ * Worker URL for the CSP-compatible MapLibre build. Pair this with a custom
34
+ * `scriptInput.src` that loads `maplibre-gl-csp.js`.
35
+ */
36
+ readonly workerUrl: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
37
+ }, undefined>;
12
38
  export declare const AhrefsAnalyticsOptions: import("valibot").ObjectSchema<{
13
39
  /**
14
40
  * Your Ahrefs Web Analytics project key. Set as the `data-key` attribute
@@ -240,6 +266,41 @@ export declare const DatabuddyAnalyticsOptions: import("valibot").ObjectSchema<{
240
266
  */
241
267
  readonly enableErrorTracking: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
242
268
  }, undefined>;
269
+ export declare const DeskCrewOptions: import("valibot").ObjectSchema<{
270
+ /**
271
+ * The DeskCrew public widget key, for example `pub_xxxxxxxx`.
272
+ * Rendered as the `data-key` attribute. Find it in the DeskCrew dashboard under Install.
273
+ * @see https://deskcrew.io/integrations/nuxt
274
+ */
275
+ readonly widgetKey: import("valibot").SchemaWithPipe<readonly [import("valibot").StringSchema<undefined>, import("valibot").MinLengthAction<string, 1, undefined>]>;
276
+ /**
277
+ * The workspace board slug, lowercase letters, numbers and dashes only.
278
+ * Rendered as the `data-board` attribute. Required for the help centre, changelog and
279
+ * embedded portal surfaces; the chat launcher works without it.
280
+ */
281
+ readonly board: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
282
+ /**
283
+ * Accent colour as a 6 digit hex value, for example `#4f46e5`.
284
+ * Rendered as the `data-color` attribute. Overrides the accent configured on the workspace.
285
+ */
286
+ readonly color: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
287
+ /**
288
+ * Which side of the viewport the launcher sits on.
289
+ * Rendered as the `data-position` attribute.
290
+ * @default 'right'
291
+ */
292
+ readonly position: import("valibot").OptionalSchema<import("valibot").UnionSchema<[import("valibot").LiteralSchema<"left", undefined>, import("valibot").LiteralSchema<"right", undefined>], undefined>, undefined>;
293
+ /**
294
+ * Greeting text shown in the widget header, overriding the workspace default.
295
+ * Rendered as the `data-greeting` attribute.
296
+ */
297
+ readonly greeting: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
298
+ /**
299
+ * Render the workspace logo in the launcher bubble instead of the default icon.
300
+ * Rendered as the `data-launcher` attribute.
301
+ */
302
+ readonly launcher: import("valibot").OptionalSchema<import("valibot").LiteralSchema<"logo", undefined>, undefined>;
303
+ }, undefined>;
243
304
  export declare const FathomAnalyticsOptions: import("valibot").ObjectSchema<{
244
305
  /**
245
306
  * The Fathom Analytics site ID.
@@ -591,11 +652,6 @@ export declare const MatomoAnalyticsOptions: import("valibot").ObjectSchema<{
591
652
  * A custom tracker URL. Overrides the default tracker endpoint derived from `matomoUrl` or `cloudId`.
592
653
  */
593
654
  readonly trackerUrl: import("valibot").OptionalSchema<import("valibot").StringSchema<undefined>, undefined>;
594
- /**
595
- * Whether to track the initial page view on load.
596
- * @deprecated Use `watch: true` (default) for automatic page view tracking.
597
- */
598
- readonly trackPageView: import("valibot").OptionalSchema<import("valibot").BooleanSchema<undefined>, undefined>;
599
655
  /**
600
656
  * Enable download and outlink tracking.
601
657
  */
@@ -11,6 +11,32 @@ export const gcmConsentState = object({
11
11
  wait_for_update: optional(number()),
12
12
  region: optional(array(string()))
13
13
  });
14
+ export const LeafletOptions = object({
15
+ /**
16
+ * Inject the Leaflet 1.9.4 styles and default marker images when the script
17
+ * begins loading. Disable this when supplying your own Leaflet stylesheet.
18
+ * @default true
19
+ */
20
+ injectStyles: optional(boolean())
21
+ });
22
+ export const MapLibreOptions = object({
23
+ /**
24
+ * Inject the MapLibre GL JS 5.24.0 stylesheet when the script begins
25
+ * loading. Disable this when supplying the stylesheet through Nuxt.
26
+ * @default true
27
+ */
28
+ injectStyles: optional(boolean()),
29
+ /**
30
+ * Stylesheet URL used when `injectStyles` is enabled.
31
+ * @default 'https://unpkg.com/maplibre-gl@5.24.0/dist/maplibre-gl.css'
32
+ */
33
+ stylesheetUrl: optional(string()),
34
+ /**
35
+ * Worker URL for the CSP-compatible MapLibre build. Pair this with a custom
36
+ * `scriptInput.src` that loads `maplibre-gl-csp.js`.
37
+ */
38
+ workerUrl: optional(string())
39
+ });
14
40
  export const AhrefsAnalyticsOptions = object({
15
41
  /**
16
42
  * Your Ahrefs Web Analytics project key. Set as the `data-key` attribute
@@ -239,6 +265,44 @@ export const DatabuddyAnalyticsOptions = object({
239
265
  */
240
266
  enableErrorTracking: optional(boolean())
241
267
  });
268
+ export const DeskCrewOptions = object({
269
+ /**
270
+ * The DeskCrew public widget key, for example `pub_xxxxxxxx`.
271
+ * Rendered as the `data-key` attribute. Find it in the DeskCrew dashboard under Install.
272
+ * @see https://deskcrew.io/integrations/nuxt
273
+ */
274
+ // minLength(1) rather than a bare string(): envDefaults resolves an unset key to '',
275
+ // which would validate happily and render data-key="" onto the tag, booting a keyless
276
+ // widget that silently talks to no workspace. Failing loudly in dev is the point.
277
+ widgetKey: pipe(string(), minLength(1)),
278
+ /**
279
+ * The workspace board slug, lowercase letters, numbers and dashes only.
280
+ * Rendered as the `data-board` attribute. Required for the help centre, changelog and
281
+ * embedded portal surfaces; the chat launcher works without it.
282
+ */
283
+ board: optional(string()),
284
+ /**
285
+ * Accent colour as a 6 digit hex value, for example `#4f46e5`.
286
+ * Rendered as the `data-color` attribute. Overrides the accent configured on the workspace.
287
+ */
288
+ color: optional(string()),
289
+ /**
290
+ * Which side of the viewport the launcher sits on.
291
+ * Rendered as the `data-position` attribute.
292
+ * @default 'right'
293
+ */
294
+ position: optional(union([literal("left"), literal("right")])),
295
+ /**
296
+ * Greeting text shown in the widget header, overriding the workspace default.
297
+ * Rendered as the `data-greeting` attribute.
298
+ */
299
+ greeting: optional(string()),
300
+ /**
301
+ * Render the workspace logo in the launcher bubble instead of the default icon.
302
+ * Rendered as the `data-launcher` attribute.
303
+ */
304
+ launcher: optional(literal("logo"))
305
+ });
242
306
  export const FathomAnalyticsOptions = object({
243
307
  /**
244
308
  * The Fathom Analytics site ID.
@@ -547,11 +611,6 @@ export const MatomoAnalyticsOptions = object({
547
611
  * A custom tracker URL. Overrides the default tracker endpoint derived from `matomoUrl` or `cloudId`.
548
612
  */
549
613
  trackerUrl: optional(string()),
550
- /**
551
- * Whether to track the initial page view on load.
552
- * @deprecated Use `watch: true` (default) for automatic page view tracking.
553
- */
554
- trackPageView: optional(boolean()),
555
614
  /**
556
615
  * Enable download and outlink tracking.
557
616
  */
@@ -68,18 +68,8 @@ export interface TtqInstance {
68
68
  enableCookie: () => void;
69
69
  disableCookie: () => void;
70
70
  }
71
- /**
72
- * Legacy callable signature. Pre-1.2 `useScriptTikTokPixel` exposed `ttq` as an
73
- * `fbq`-style callable (`ttq('page')`, `ttq('track', …)`); the adapter keeps it
74
- * working alongside the method form.
75
- */
76
- type TtqCallable = ((cmd: 'track', event: StandardEvents | (string & {}), properties?: EventProperties, options?: TrackOptions) => void) & ((cmd: 'page') => void) & ((cmd: 'identify', properties: IdentifyProperties) => void) & ((cmd: (string & {}), ...args: any[]) => void);
77
- /**
78
- * The public `ttq` returned by the composable: a callable adapter (legacy form)
79
- * that also carries the deferred methods (`ttq.page()`, `ttq.track(…)`). The
80
- * adapter forwards to `window.ttq`, which is TikTok's real array protocol.
81
- */
82
- export type Ttq = TtqCallable & TtqInstance & {
71
+ /** The method-based `ttq` API returned by the composable. */
72
+ export type Ttq = TtqInstance & {
83
73
  /** Resolve the per-pixel method bag for a specific pixel id. */
84
74
  instance: (id: string) => TtqInstance;
85
75
  };
@@ -24,7 +24,7 @@ function createTtqAdapter() {
24
24
  warnUnhashedIdentify(args[0]);
25
25
  return window.ttq[method]?.(...args);
26
26
  };
27
- const adapter = ((method, ...args) => dispatch(method, ...args));
27
+ const adapter = {};
28
28
  for (const method of [...TTQ_METHODS, "instance"])
29
29
  adapter[method] = (...args) => dispatch(method, ...args);
30
30
  return adapter;
@@ -1,7 +1,6 @@
1
1
  import { useHead } from "@unhead/vue";
2
- import { useNuxtApp } from "nuxt/app";
2
+ import { logger } from "../logger.js";
3
3
  import { useRegistryScript } from "../utils.js";
4
- import { attachUsercentricsConsent } from "../utils/usercentrics-consent.js";
5
4
  import { UsercentricsOptions } from "./schemas.js";
6
5
  export { UsercentricsOptions };
7
6
  export function useScriptUsercentrics(_options) {
@@ -25,13 +24,54 @@ export function useScriptUsercentrics(_options) {
25
24
  },
26
25
  schema: import.meta.dev ? UsercentricsOptions : void 0,
27
26
  scriptOptions: {
28
- use() {
29
- return { ucCmp: window.__ucCmp };
27
+ resolve({ waitFor }) {
28
+ return waitFor((resolve) => {
29
+ const onReady = () => {
30
+ if (window.__ucCmp)
31
+ resolve({ ucCmp: window.__ucCmp });
32
+ };
33
+ window.addEventListener("UC_CMP_API_READY", onReady);
34
+ const api = window.__ucCmp;
35
+ if (api?.isInitialized) {
36
+ Promise.resolve(api.isInitialized()).then((initialized) => {
37
+ if (initialized)
38
+ onReady();
39
+ }).catch((error) => {
40
+ logger.debug("[usercentrics] Waiting for UC_CMP_API_READY after isInitialized() failed", error);
41
+ });
42
+ }
43
+ return () => window.removeEventListener("UC_CMP_API_READY", onReady);
44
+ });
30
45
  }
31
46
  }
32
47
  };
33
48
  }, _options);
34
- if (import.meta.client)
35
- attachUsercentricsConsent(instance, window, (callback) => useNuxtApp().hooks.hook("app:unmount", callback));
49
+ if (import.meta.client && !instance.consent) {
50
+ const whenReady = () => instance.load().then((api) => api.ucCmp);
51
+ instance.consent = {
52
+ whenReady,
53
+ onConsentChange(cb) {
54
+ if (instance.signal.aborted)
55
+ return () => {
56
+ };
57
+ const handler = (e) => cb(e.detail, e);
58
+ let active = true;
59
+ const stop = () => {
60
+ if (!active)
61
+ return;
62
+ active = false;
63
+ window.removeEventListener("UC_UI_CMP_EVENT", handler);
64
+ instance.signal.removeEventListener("abort", stop);
65
+ };
66
+ window.addEventListener("UC_UI_CMP_EVENT", handler);
67
+ instance.signal.addEventListener("abort", stop, { once: true });
68
+ return stop;
69
+ },
70
+ showFirstLayer: () => whenReady().then((api) => api.showFirstLayer()),
71
+ showSecondLayer: () => whenReady().then((api) => api.showSecondLayer()),
72
+ acceptAll: () => whenReady().then((api) => api.acceptAllConsents()),
73
+ denyAll: () => whenReady().then((api) => api.denyAllConsents())
74
+ };
75
+ }
36
76
  return instance;
37
77
  }
@@ -1,7 +1,6 @@
1
1
  import type { RegistryScriptInput, UseScriptContext } from '#nuxt-scripts/types';
2
- import type { MaybePromise } from '../utils.js';
3
2
  export interface YouTubePlayerApi {
4
- YT: MaybePromise<{
3
+ YT: {
5
4
  Player: YT.Player;
6
5
  PlayerState: YT.PlayerState;
7
6
  get: (k: string) => any;
@@ -12,11 +11,11 @@ export interface YouTubePlayerApi {
12
11
  setConfig: (config: YT.PlayerOptions) => void;
13
12
  subscribe: <EventName extends keyof YT.Events>(event: EventName, listener: YT.Events[EventName], context?: any) => void;
14
13
  unsubscribe: <EventName extends keyof YT.Events>(event: EventName, listener: YT.Events[EventName], context?: any) => void;
15
- }>;
14
+ };
16
15
  }
17
16
  declare global {
18
17
  interface Window extends YouTubePlayerApi {
19
- onYouTubeIframeAPIReady: () => void;
18
+ onYouTubeIframeAPIReady?: () => void;
20
19
  }
21
20
  }
22
21
  export type YouTubePlayerInput = RegistryScriptInput;
@@ -1,9 +1,6 @@
1
1
  import { useHead } from "@unhead/vue";
2
2
  import { watch } from "vue";
3
3
  import { useRegistryScript } from "../utils.js";
4
- import { armYouTubeReadiness, useYouTubeReadinessState } from "../utils/youtube-readiness.js";
5
- const cleanupDecoration = Symbol("nuxt-scripts:youtube-cleanup");
6
- const readinessDecoration = Symbol("nuxt-scripts:youtube-readiness");
7
4
  export function useScriptYouTubePlayer(_options) {
8
5
  const instance = useRegistryScript("youtubePlayer", () => ({
9
6
  scriptInput: {
@@ -12,29 +9,39 @@ export function useScriptYouTubePlayer(_options) {
12
9
  // crossorigin can't be set or it breaks
13
10
  },
14
11
  scriptOptions: {
15
- use() {
16
- const readiness = useYouTubeReadinessState();
17
- return {
18
- YT: window.YT || readiness.promise.then(() => {
19
- return window.YT;
20
- })
21
- };
12
+ resolve({ waitFor }) {
13
+ if (typeof window.YT?.Player === "function")
14
+ return { YT: window.YT };
15
+ return waitFor((resolve, reject) => {
16
+ const previousReady = window.onYouTubeIframeAPIReady;
17
+ let onReady;
18
+ const restoreReady = () => {
19
+ if (window.onYouTubeIframeAPIReady !== onReady)
20
+ return;
21
+ if (previousReady)
22
+ window.onYouTubeIframeAPIReady = previousReady;
23
+ else
24
+ delete window.onYouTubeIframeAPIReady;
25
+ };
26
+ onReady = () => {
27
+ restoreReady();
28
+ try {
29
+ previousReady?.();
30
+ } catch (error) {
31
+ if (import.meta.dev)
32
+ console.error("[nuxt-scripts] Previous onYouTubeIframeAPIReady handler failed:", error);
33
+ }
34
+ if (typeof window.YT?.Player === "function")
35
+ resolve({ YT: window.YT });
36
+ else
37
+ reject(new Error("[nuxt-scripts] YouTube reported ready without exposing window.YT.Player"));
38
+ };
39
+ window.onYouTubeIframeAPIReady = onReady;
40
+ return restoreReady;
41
+ });
22
42
  }
23
- },
24
- clientInit: import.meta.server ? void 0 : () => {
25
- armYouTubeReadiness(useYouTubeReadinessState());
26
43
  }
27
44
  }), _options);
28
- const clientInstance = import.meta.server || typeof window === "undefined" ? void 0 : instance;
29
- if (clientInstance && !clientInstance[cleanupDecoration]) {
30
- clientInstance[cleanupDecoration] = true;
31
- clientInstance[readinessDecoration] = useYouTubeReadinessState();
32
- const originalRemove = instance.remove;
33
- instance.remove = () => {
34
- clientInstance[readinessDecoration]?.controller?.abort();
35
- return originalRemove();
36
- };
37
- }
38
45
  if (import.meta.client) {
39
46
  const _ = watch(instance.status, (status) => {
40
47
  if (status === "loading") {
@@ -1,2 +1,2 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, any>;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<Buffer<ArrayBufferLike>>>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, any>;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<Record<string, any>>>;
2
2
  export default _default;
@@ -1,8 +1,6 @@
1
1
  import { createError, defineEventHandler, getQuery, setHeader } from "#nuxt-scripts/h3";
2
- import { useRuntimeConfig } from "#nuxt-scripts/nitro";
3
2
  import { createCachedJsonFetch, isSafeHttpsUrl } from "./utils/cached-upstream.js";
4
3
  import { rewriteBlueskyPostImages } from "./utils/embed-rewriters.js";
5
- import { withSigning } from "./utils/withSigning.js";
6
4
  const BSKY_POST_URL_RE = /^https:\/\/bsky\.app\/profile\/([^/]+)\/post\/([^/?]+)$/;
7
5
  const EMBED_BSKY_SUFFIX_RE = /\/embed\/bluesky$/;
8
6
  const allowBlueskyApiUrl = (url) => isSafeHttpsUrl(url) && url.hostname === "public.api.bsky.app";
@@ -24,7 +22,7 @@ const cachedPostFetch = createCachedJsonFetch(
24
22
  contentTypePrefixes: ["application/json"]
25
23
  }
26
24
  );
27
- export default withSigning(defineEventHandler(async (event) => {
25
+ export default defineEventHandler(async (event) => {
28
26
  const query = getQuery(event);
29
27
  const postUrl = query.url;
30
28
  if (!postUrl) {
@@ -79,9 +77,8 @@ export default withSigning(defineEventHandler(async (event) => {
79
77
  const handlerPath = event.path?.split("?")[0] || "";
80
78
  const prefix = handlerPath.replace(EMBED_BSKY_SUFFIX_RE, "") || "/_scripts";
81
79
  const imagePath = `${prefix}/embed/bluesky-image`;
82
- const secret = useRuntimeConfig()["nuxt-scripts"]?.proxySecret;
83
- rewriteBlueskyPostImages(post, imagePath, secret);
80
+ rewriteBlueskyPostImages(post, imagePath);
84
81
  setHeader(event, "Content-Type", "application/json");
85
82
  setHeader(event, "Cache-Control", "public, max-age=600, s-maxage=600");
86
83
  return post;
87
- }));
84
+ });
@@ -1,2 +1,2 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, any>;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<Buffer<ArrayBufferLike>>>;
2
2
  export default _default;
@@ -2,7 +2,6 @@ import { withQuery } from "ufo";
2
2
  import { createError, defineEventHandler, getQuery, setHeader } from "#nuxt-scripts/h3";
3
3
  import { useRuntimeConfig } from "#nuxt-scripts/nitro";
4
4
  import { createCachedBinaryFetch, isSafeHttpsUrl } from "./utils/cached-upstream.js";
5
- import { withSigning } from "./utils/withSigning.js";
6
5
  const GRAVATAR_HASH_RE = /^[a-f\d]{64}$/i;
7
6
  const GRAVATAR_RATINGS = /* @__PURE__ */ new Set(["g", "pg", "r", "x"]);
8
7
  function firstString(value) {
@@ -12,7 +11,7 @@ const cachedGravatarFetch = createCachedBinaryFetch("nuxt-scripts-gravatar", 360
12
11
  allowContentType: (contentType) => contentType.startsWith("image/") && contentType !== "image/svg+xml",
13
12
  allowUrl: (url) => isSafeHttpsUrl(url) && (url.hostname === "gravatar.com" || url.hostname.endsWith(".gravatar.com"))
14
13
  });
15
- export default withSigning(defineEventHandler(async (event) => {
14
+ export default defineEventHandler(async (event) => {
16
15
  const runtimeConfig = useRuntimeConfig();
17
16
  const proxyConfig = runtimeConfig.public["nuxt-scripts"]?.gravatarProxy;
18
17
  const query = getQuery(event);
@@ -80,4 +79,4 @@ export default withSigning(defineEventHandler(async (event) => {
80
79
  setHeader(event, "Vary", "Accept-Encoding");
81
80
  setHeader(event, "X-Content-Type-Options", "nosniff");
82
81
  return result.body;
83
- }));
82
+ });
@@ -1,2 +1,2 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, any>;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<Buffer<ArrayBufferLike>>>;
2
2
  export default _default;
@@ -1,2 +1,2 @@
1
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, any>;
1
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<Buffer<ArrayBufferLike>>>;
2
2
  export default _default;
@@ -1,3 +1,3 @@
1
1
  export { proxyAssetUrl, proxyImageUrl, rewriteUrl, rewriteUrlsInText, scopeCss } from './utils/instagram-embed.js';
2
- declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, any>;
2
+ declare const _default: import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<string>>;
3
3
  export default _default;
@@ -1,8 +1,6 @@
1
1
  import { createError, defineEventHandler, getQuery, setHeader } from "#nuxt-scripts/h3";
2
- import { useRuntimeConfig } from "#nuxt-scripts/nitro";
3
2
  import { createCachedJsonFetch } from "./utils/cached-upstream.js";
4
3
  import { isEmbedShell, isSafeInstagramCssUrl, isSafeInstagramEmbedUrl, isSafeInstagramPostUrl, sanitizeInstagramEmbedCss, sanitizeInstagramEmbedHtml } from "./utils/instagram-embed.js";
5
- import { withSigning } from "./utils/withSigning.js";
6
4
  export { proxyAssetUrl, proxyImageUrl, rewriteUrl, rewriteUrlsInText, scopeCss } from "./utils/instagram-embed.js";
7
5
  const EMBED_INSTAGRAM_SUFFIX_RE = /\/embed\/instagram$/;
8
6
  const cachedEmbedFetch = createCachedJsonFetch(
@@ -38,10 +36,9 @@ const cachedCssFetch = createCachedJsonFetch(
38
36
  contentTypePrefixes: ["text/css"]
39
37
  }
40
38
  );
41
- export default withSigning(defineEventHandler(async (event) => {
39
+ export default defineEventHandler(async (event) => {
42
40
  const handlerPath = event.path?.split("?")[0] || "";
43
41
  const prefix = handlerPath.replace(EMBED_INSTAGRAM_SUFFIX_RE, "") || "/_scripts";
44
- const secret = useRuntimeConfig()["nuxt-scripts"]?.proxySecret;
45
42
  const query = getQuery(event);
46
43
  const postUrl = query.url;
47
44
  const captions = query.captions === "true";
@@ -84,7 +81,7 @@ export default withSigning(defineEventHandler(async (event) => {
84
81
  statusMessage: error.statusMessage || "Failed to fetch Instagram embed"
85
82
  });
86
83
  });
87
- const { bodyHtml, cssUrls } = sanitizeInstagramEmbedHtml(html, prefix, secret);
84
+ const { bodyHtml, cssUrls } = sanitizeInstagramEmbedHtml(html, prefix);
88
85
  const cssContents = await Promise.all(
89
86
  cssUrls.map(
90
87
  (url) => cachedCssFetch(url, {
@@ -94,7 +91,7 @@ export default withSigning(defineEventHandler(async (event) => {
94
91
  })
95
92
  )
96
93
  );
97
- const combinedCss = sanitizeInstagramEmbedCss(cssContents.join("\n"), ".instagram-embed-root", prefix, secret);
94
+ const combinedCss = sanitizeInstagramEmbedCss(cssContents.join("\n"), ".instagram-embed-root", prefix);
98
95
  const baseStyles = `
99
96
  .instagram-embed-root { background: white; max-width: 540px; width: calc(100% - 2px); border-radius: 3px; border: 1px solid rgb(219, 219, 219); display: block; margin: 0px 0px 12px; min-width: 326px; padding: 0px; }
100
97
  .instagram-embed-root #splash-screen { display: none !important; }
@@ -108,4 +105,4 @@ ${combinedCss}</style>${bodyHtml}</div>`;
108
105
  setHeader(event, "Content-Security-Policy", "sandbox; default-src 'none'");
109
106
  setHeader(event, "X-Content-Type-Options", "nosniff");
110
107
  return result;
111
- }));
108
+ });
@@ -4,17 +4,10 @@ import { Buffer } from 'node:buffer';
4
4
  *
5
5
  * ## Why
6
6
  *
7
- * Proxy URLs arriving from the client carry per-request auth artefacts (`sig`,
8
- * `_pt`, `_ts`) that change across renders. CDNs key on full URL so each
9
- * rotation produces a unique edge cache entry and upstream origins take the hit
10
- * on every render. Caching the *upstream response* here — keyed on the inner
11
- * resource URL (or normalized param set) — dedupes those fetches across every
12
- * request that resolves to the same upstream, regardless of how the caller
13
- * authenticated.
14
- *
15
- * Safe because `withSigning` runs before any cache path: unsigned requests 403
16
- * before they can do a cache lookup. Cache stores hold only responses produced
17
- * from legitimately-authenticated requests.
7
+ * The same upstream resource is often requested under slightly different proxy
8
+ * URLs across renders. Caching the *upstream response*, keyed on the inner
9
+ * resource URL or normalized param set, dedupes those fetches across
10
+ * every request that resolves to the same upstream.
18
11
  *
19
12
  * ## Binary payloads
20
13
  *
@@ -1,13 +1,11 @@
1
1
  /**
2
2
  * Mutate a tweet (and any quoted tweet) in place so every raw CDN image URL
3
- * is rewritten to route through the site's `/embed/x-image` proxy. When a
4
- * `secret` is provided, URLs are HMAC-signed and pass `withSigning` without a
5
- * page token.
3
+ * is rewritten to route through the site's `/embed/x-image` proxy.
6
4
  *
7
5
  * Clone the input first if it came from a shared cache — this function does
8
6
  * not copy.
9
7
  */
10
- export declare function rewriteTweetImages(tweet: any, imagePath: string, secret?: string): void;
8
+ export declare function rewriteTweetImages(tweet: any, imagePath: string): void;
11
9
  /**
12
10
  * Mutate a Bluesky post in place so every CDN image URL routes through the
13
11
  * site's `/embed/bluesky-image` proxy. Covers author avatar, embedded images
@@ -16,4 +14,4 @@ export declare function rewriteTweetImages(tweet: any, imagePath: string, secret
16
14
  * Clone the input first if it came from a shared cache — this function does
17
15
  * not copy.
18
16
  */
19
- export declare function rewriteBlueskyPostImages(post: any, imagePath: string, secret?: string): void;
17
+ export declare function rewriteBlueskyPostImages(post: any, imagePath: string): void;
@@ -1,30 +1,30 @@
1
1
  import { buildProxyUrl } from "./proxy-url.js";
2
- export function rewriteTweetImages(tweet, imagePath, secret) {
2
+ export function rewriteTweetImages(tweet, imagePath) {
3
3
  if (!tweet)
4
4
  return;
5
5
  if (tweet.user?.profile_image_url_https)
6
- tweet.user.profile_image_url_https = buildProxyUrl(imagePath, { url: tweet.user.profile_image_url_https }, secret);
6
+ tweet.user.profile_image_url_https = buildProxyUrl(imagePath, { url: tweet.user.profile_image_url_https });
7
7
  if (tweet.photos) {
8
8
  for (const photo of tweet.photos) {
9
9
  if (photo.url)
10
- photo.url = buildProxyUrl(imagePath, { url: photo.url }, secret);
10
+ photo.url = buildProxyUrl(imagePath, { url: photo.url });
11
11
  }
12
12
  }
13
13
  if (tweet.entities?.media) {
14
14
  for (const media of tweet.entities.media) {
15
15
  if (media.media_url_https)
16
- media.media_url_https = buildProxyUrl(imagePath, { url: media.media_url_https }, secret);
16
+ media.media_url_https = buildProxyUrl(imagePath, { url: media.media_url_https });
17
17
  }
18
18
  }
19
19
  if (tweet.video?.poster)
20
- tweet.video.poster = buildProxyUrl(imagePath, { url: tweet.video.poster }, secret);
20
+ tweet.video.poster = buildProxyUrl(imagePath, { url: tweet.video.poster });
21
21
  if (tweet.quoted_tweet)
22
- rewriteTweetImages(tweet.quoted_tweet, imagePath, secret);
22
+ rewriteTweetImages(tweet.quoted_tweet, imagePath);
23
23
  }
24
- export function rewriteBlueskyPostImages(post, imagePath, secret) {
24
+ export function rewriteBlueskyPostImages(post, imagePath) {
25
25
  if (!post)
26
26
  return;
27
- const proxy = (url) => url ? buildProxyUrl(imagePath, { url }, secret) : url;
27
+ const proxy = (url) => url ? buildProxyUrl(imagePath, { url }) : url;
28
28
  if (post.author?.avatar)
29
29
  post.author.avatar = proxy(post.author.avatar);
30
30
  const embed = post.embed;
@@ -12,4 +12,4 @@ export interface ImageProxyConfig {
12
12
  /** Unique name for the nitro cache group (defaults to derived from allowedDomains). */
13
13
  cacheName?: string;
14
14
  }
15
- export declare function createImageProxyHandler(config: ImageProxyConfig): import("h3").EventHandler<import("h3").EventHandlerRequest, any>;
15
+ export declare function createImageProxyHandler(config: ImageProxyConfig): import("h3").EventHandler<import("h3").EventHandlerRequest, Promise<Buffer<ArrayBufferLike>>>;
@@ -1,7 +1,6 @@
1
1
  import { createError, defineEventHandler, getQuery, setHeader } from "#nuxt-scripts/h3";
2
2
  import { createCachedBinaryFetch } from "./cached-upstream.js";
3
3
  import { isPublicNetworkHostname } from "./network-host.js";
4
- import { withSigning } from "./withSigning.js";
5
4
  const AMP_RE = /&amp;/g;
6
5
  export function createImageProxyHandler(config) {
7
6
  const {
@@ -21,7 +20,7 @@ export function createImageProxyHandler(config) {
21
20
  allowContentType: contentTypeAllowed,
22
21
  allowUrl: urlAllowed
23
22
  });
24
- return withSigning(defineEventHandler(async (event) => {
23
+ return defineEventHandler(async (event) => {
25
24
  const query = getQuery(event);
26
25
  let url = query.url;
27
26
  if (decodeAmpersands && url)
@@ -79,5 +78,5 @@ export function createImageProxyHandler(config) {
79
78
  setHeader(event, "Content-Security-Policy", "sandbox; default-src 'none'");
80
79
  setHeader(event, "X-Content-Type-Options", "nosniff");
81
80
  return result.body;
82
- }));
81
+ });
83
82
  }
@@ -9,15 +9,15 @@ export declare const INSTAGRAM_ASSET_HOST = "static.cdninstagram.com";
9
9
  export declare function isSafeInstagramPostUrl(url: URL): boolean;
10
10
  export declare function isSafeInstagramEmbedUrl(url: URL): boolean;
11
11
  export declare function isSafeInstagramCssUrl(url: URL): boolean;
12
- export declare function sanitizeInstagramEmbedHtml(html: string, prefix: string, secret?: string): {
12
+ export declare function sanitizeInstagramEmbedHtml(html: string, prefix: string): {
13
13
  bodyHtml: string;
14
14
  cssUrls: string[];
15
15
  };
16
- export declare function sanitizeInstagramEmbedCss(css: string, scopeSelector: string, prefix: string, secret?: string): string;
17
- export declare function proxyImageUrl(url: string, prefix?: string, secret?: string): string;
18
- export declare function proxyAssetUrl(url: string, prefix?: string, secret?: string): string;
19
- export declare function rewriteUrl(url: string, prefix?: string, secret?: string): string;
20
- export declare function rewriteUrlsInText(text: string, prefix?: string, secret?: string): string;
16
+ export declare function sanitizeInstagramEmbedCss(css: string, scopeSelector: string, prefix: string): string;
17
+ export declare function proxyImageUrl(url: string, prefix?: string): string;
18
+ export declare function proxyAssetUrl(url: string, prefix?: string): string;
19
+ export declare function rewriteUrl(url: string, prefix?: string): string;
20
+ export declare function rewriteUrlsInText(text: string, prefix?: string): string;
21
21
  /**
22
22
  * Scope CSS rules under a parent selector and strip global/page-level rules.
23
23
  * Removes :root, html, body selectors and @charset/@import at-rules.