@shopify/shop-minis-platform 0.8.0 → 0.8.2
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 -1
- package/src/actions/params.ts +35 -0
- package/src/constants.ts +5 -0
- package/src/index.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
|
|
|
@@ -113,7 +114,6 @@ export interface ShopActionEvents {
|
|
|
113
114
|
ProductRecommendationClickParams,
|
|
114
115
|
void
|
|
115
116
|
>
|
|
116
|
-
HIDE_ENTRY_POINT: ShopAction<void, void>
|
|
117
117
|
CLOSE_MINI: ShopAction<void, void>
|
|
118
118
|
GET_ACCOUNT_INFORMATION: ShopAction<
|
|
119
119
|
GetAccountInformationParams,
|
|
@@ -231,4 +231,5 @@ export interface ShopActionEvents {
|
|
|
231
231
|
RequestPermissionResponse
|
|
232
232
|
>
|
|
233
233
|
REPORT_ERROR: ShopAction<ReportErrorParams, void>
|
|
234
|
+
REPORT_FETCH: ShopAction<ReportFetchParams, void>
|
|
234
235
|
}
|
package/src/actions/params.ts
CHANGED
|
@@ -684,3 +684,38 @@ export interface ReportErrorParams {
|
|
|
684
684
|
*/
|
|
685
685
|
additionalContext?: {[key: string]: any}
|
|
686
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
|
+
}
|
package/src/constants.ts
ADDED