@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 CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@shopify/shop-minis-platform",
3
3
  "license": "SEE LICENSE IN LICENSE.txt",
4
- "version": "0.8.0",
4
+ "version": "0.8.2",
5
5
  "description": "Shared type definitions for Shop Minis Platform",
6
6
  "main": "src/index.ts",
7
7
  "exports": {
@@ -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
  }
@@ -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
+ }
@@ -0,0 +1,5 @@
1
+ import {DataHookFetchPolicy} from './types'
2
+
3
+ export const DATA_FETCHING_DEFAULT_PAGE_SIZE = 20
4
+ export const DATA_FETCHING_DEFAULT_FETCH_POLICY: DataHookFetchPolicy =
5
+ 'cache-first'
package/src/index.ts CHANGED
@@ -3,6 +3,7 @@ import {MinisEventsFunctions} from './events'
3
3
  import {MinisParams} from './types'
4
4
 
5
5
  export * from './types'
6
+ export * from './constants'
6
7
 
7
8
  declare global {
8
9
  interface Window {