@shopify/shop-minis-platform 0.7.0 → 0.8.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.
- package/package.json +1 -1
- package/src/actions/actions.ts +2 -0
- package/src/actions/params.ts +39 -0
- package/src/types/product.ts +1 -0
package/package.json
CHANGED
package/src/actions/actions.ts
CHANGED
|
@@ -93,6 +93,7 @@ import {
|
|
|
93
93
|
RequestPermissionParams,
|
|
94
94
|
RequestPermissionResponse,
|
|
95
95
|
ReportErrorParams,
|
|
96
|
+
ReportFetchParams,
|
|
96
97
|
} from './params'
|
|
97
98
|
import {ShopAction, SnakeToCamelCase} from './shared'
|
|
98
99
|
|
|
@@ -231,4 +232,5 @@ export interface ShopActionEvents {
|
|
|
231
232
|
RequestPermissionResponse
|
|
232
233
|
>
|
|
233
234
|
REPORT_ERROR: ShopAction<ReportErrorParams, void>
|
|
235
|
+
REPORT_FETCH: ShopAction<ReportFetchParams, void>
|
|
234
236
|
}
|
package/src/actions/params.ts
CHANGED
|
@@ -65,6 +65,10 @@ export interface AddToCartParams extends BuyProductLineItem {
|
|
|
65
65
|
* @deprecated
|
|
66
66
|
*/
|
|
67
67
|
attribution?: LineItemAttribution
|
|
68
|
+
/**
|
|
69
|
+
* The URL of the variant image.
|
|
70
|
+
*/
|
|
71
|
+
variantImageUrl?: string
|
|
68
72
|
}
|
|
69
73
|
|
|
70
74
|
export interface BuyProductLineItem {
|
|
@@ -680,3 +684,38 @@ export interface ReportErrorParams {
|
|
|
680
684
|
*/
|
|
681
685
|
additionalContext?: {[key: string]: any}
|
|
682
686
|
}
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* Parameters for reporting fetch calls made in the webview.
|
|
690
|
+
* This captures network request details for observability.
|
|
691
|
+
*/
|
|
692
|
+
export interface ReportFetchParams {
|
|
693
|
+
/**
|
|
694
|
+
* The HTTP method used (GET, POST, etc.)
|
|
695
|
+
*/
|
|
696
|
+
method: string
|
|
697
|
+
/**
|
|
698
|
+
* The URL that was fetched
|
|
699
|
+
*/
|
|
700
|
+
url: string
|
|
701
|
+
/**
|
|
702
|
+
* The HTTP status code of the response (0 for network errors)
|
|
703
|
+
*/
|
|
704
|
+
status: number
|
|
705
|
+
/**
|
|
706
|
+
* Duration of the request in milliseconds
|
|
707
|
+
*/
|
|
708
|
+
duration: number
|
|
709
|
+
/**
|
|
710
|
+
* Whether the request was successful (response.ok)
|
|
711
|
+
*/
|
|
712
|
+
success: boolean
|
|
713
|
+
/**
|
|
714
|
+
* Error message if the request failed
|
|
715
|
+
*/
|
|
716
|
+
error?: string
|
|
717
|
+
/**
|
|
718
|
+
* Timestamp when the request completed
|
|
719
|
+
*/
|
|
720
|
+
timestamp: number
|
|
721
|
+
}
|