@burdenoff/microfe-store 2026.510.113
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/README.md +217 -0
- package/dist/StoreAdminRoot.d.ts +22 -0
- package/dist/StoreAdminRoot.js +23 -0
- package/dist/StoreAdminRoot.js.map +1 -0
- package/dist/StoreAdminRoutes.d.ts +9 -0
- package/dist/StoreAdminRoutes.js +69 -0
- package/dist/StoreAdminRoutes.js.map +1 -0
- package/dist/StoreRoot.d.ts +31 -0
- package/dist/StoreRoot.js +139 -0
- package/dist/StoreRoot.js.map +1 -0
- package/dist/StoreRoutes.d.ts +12 -0
- package/dist/StoreRoutes.js +285 -0
- package/dist/StoreRoutes.js.map +1 -0
- package/dist/components/InstallAppModal.d.ts +26 -0
- package/dist/components/InstallAppModal.js +287 -0
- package/dist/components/InstallAppModal.js.map +1 -0
- package/dist/components/RouteGuards.d.ts +17 -0
- package/dist/components/RouteGuards.js +26 -0
- package/dist/components/RouteGuards.js.map +1 -0
- package/dist/components/cart/CartDrawer.d.ts +35 -0
- package/dist/components/cart/CartDrawer.js +162 -0
- package/dist/components/cart/CartDrawer.js.map +1 -0
- package/dist/components/index.d.ts +9 -0
- package/dist/components/index.js +3 -0
- package/dist/components/marketplace/ProductCard.d.ts +18 -0
- package/dist/components/marketplace/ProductCard.js +2 -0
- package/dist/dev/main.d.ts +1 -0
- package/dist/generated/global-operations.d.ts +2012 -0
- package/dist/generated/global-operations.js +1444 -0
- package/dist/generated/global-operations.js.map +1 -0
- package/dist/generated/global-types.d.ts +20856 -0
- package/dist/generated/global-types.js +14 -0
- package/dist/generated/global-types.js.map +1 -0
- package/dist/generated/wspace-operations.d.ts +1 -0
- package/dist/generated/wspace-types.d.ts +53362 -0
- package/dist/hooks/index.d.ts +12 -0
- package/dist/hooks/useBackendCart.d.ts +73 -0
- package/dist/hooks/useBackendCart.js +171 -0
- package/dist/hooks/useBackendCart.js.map +1 -0
- package/dist/hooks/useCart.d.ts +62 -0
- package/dist/hooks/useCart.js +90 -0
- package/dist/hooks/useCart.js.map +1 -0
- package/dist/hooks/useInstallations.d.ts +43 -0
- package/dist/hooks/useInstallations.js +140 -0
- package/dist/hooks/useInstallations.js.map +1 -0
- package/dist/hooks/useOrders.d.ts +40 -0
- package/dist/hooks/useOrders.js +73 -0
- package/dist/hooks/useOrders.js.map +1 -0
- package/dist/hooks/useProductSearch.d.ts +22 -0
- package/dist/hooks/useProductSearch.js +59 -0
- package/dist/hooks/useProductSearch.js.map +1 -0
- package/dist/hooks/useStoreGraphQL.d.ts +475 -0
- package/dist/hooks/useStoreGraphQL.js +751 -0
- package/dist/hooks/useStoreGraphQL.js.map +1 -0
- package/dist/hooks/useStoreGraphQLWithContext.d.ts +48 -0
- package/dist/hooks/useStoreGraphQLWithContext.js +39 -0
- package/dist/hooks/useStoreGraphQLWithContext.js.map +1 -0
- package/dist/hooks/useStorePermissions.d.ts +63 -0
- package/dist/hooks/useStorePermissions.js +88 -0
- package/dist/hooks/useStorePermissions.js.map +1 -0
- package/dist/index.d.ts +44 -0
- package/dist/index.js +13 -0
- package/dist/pages/AdminDashboardPage.d.ts +3 -0
- package/dist/pages/AdminDashboardPage.js +491 -0
- package/dist/pages/AdminDashboardPage.js.map +1 -0
- package/dist/pages/AdminReviewModerationPage.d.ts +3 -0
- package/dist/pages/AdminReviewModerationPage.js +247 -0
- package/dist/pages/AdminReviewModerationPage.js.map +1 -0
- package/dist/pages/AdminStoresPage.d.ts +3 -0
- package/dist/pages/AdminStoresPage.js +442 -0
- package/dist/pages/AdminStoresPage.js.map +1 -0
- package/dist/pages/AdminSubmissionsQueuePage.d.ts +3 -0
- package/dist/pages/AdminSubmissionsQueuePage.js +387 -0
- package/dist/pages/AdminSubmissionsQueuePage.js.map +1 -0
- package/dist/pages/AppDetailPage.d.ts +3 -0
- package/dist/pages/AppDetailPage.js +166 -0
- package/dist/pages/AppDetailPage.js.map +1 -0
- package/dist/pages/AppSettingsPage.d.ts +3 -0
- package/dist/pages/AppSettingsPage.js +100 -0
- package/dist/pages/AppSettingsPage.js.map +1 -0
- package/dist/pages/CartPage.d.ts +8 -0
- package/dist/pages/CartPage.js +259 -0
- package/dist/pages/CartPage.js.map +1 -0
- package/dist/pages/InstalledAppsPage.d.ts +8 -0
- package/dist/pages/InstalledAppsPage.js +290 -0
- package/dist/pages/InstalledAppsPage.js.map +1 -0
- package/dist/pages/MarketplaceHomePage.d.ts +3 -0
- package/dist/pages/MarketplaceHomePage.js +1118 -0
- package/dist/pages/MarketplaceHomePage.js.map +1 -0
- package/dist/pages/MyLicensesPage.d.ts +3 -0
- package/dist/pages/MyLicensesPage.js +146 -0
- package/dist/pages/MyLicensesPage.js.map +1 -0
- package/dist/pages/OrderConfirmationPage.d.ts +3 -0
- package/dist/pages/OrderConfirmationPage.js +178 -0
- package/dist/pages/OrderConfirmationPage.js.map +1 -0
- package/dist/pages/OrdersPage.d.ts +8 -0
- package/dist/pages/OrdersPage.js +358 -0
- package/dist/pages/OrdersPage.js.map +1 -0
- package/dist/pages/ProductCategoryPage.d.ts +3 -0
- package/dist/pages/ProductCategoryPage.js +83 -0
- package/dist/pages/ProductCategoryPage.js.map +1 -0
- package/dist/pages/ProductDetailPage.d.ts +8 -0
- package/dist/pages/ProductDetailPage.js +1205 -0
- package/dist/pages/ProductDetailPage.js.map +1 -0
- package/dist/pages/ProductReviewsPage.d.ts +3 -0
- package/dist/pages/ProductReviewsPage.js +86 -0
- package/dist/pages/ProductReviewsPage.js.map +1 -0
- package/dist/pages/PublisherDashboardPage.d.ts +3 -0
- package/dist/pages/PublisherDashboardPage.js +154 -0
- package/dist/pages/PublisherDashboardPage.js.map +1 -0
- package/dist/pages/PublisherRevenuePage.d.ts +3 -0
- package/dist/pages/PublisherRevenuePage.js +138 -0
- package/dist/pages/PublisherRevenuePage.js.map +1 -0
- package/dist/pages/PublisherSubmissionsPage.d.ts +3 -0
- package/dist/pages/PublisherSubmissionsPage.js +174 -0
- package/dist/pages/PublisherSubmissionsPage.js.map +1 -0
- package/dist/pages/PublisherSubmitPage.d.ts +3 -0
- package/dist/pages/PublisherSubmitPage.js +224 -0
- package/dist/pages/PublisherSubmitPage.js.map +1 -0
- package/dist/pages/SearchResultsPage.d.ts +3 -0
- package/dist/pages/SearchResultsPage.js +125 -0
- package/dist/pages/SearchResultsPage.js.map +1 -0
- package/dist/pages/StoresPage.d.ts +3 -0
- package/dist/pages/StoresPage.js +154 -0
- package/dist/pages/StoresPage.js.map +1 -0
- package/dist/providers/StoreProvider.d.ts +38 -0
- package/dist/providers/StoreProvider.js +51 -0
- package/dist/providers/StoreProvider.js.map +1 -0
- package/dist/store/storeStore.d.ts +69 -0
- package/dist/store/storeStore.js +68 -0
- package/dist/store/storeStore.js.map +1 -0
- package/dist/translations/en.d.ts +518 -0
- package/dist/translations/en.js +514 -0
- package/dist/translations/en.js.map +1 -0
- package/dist/types/index.d.ts +575 -0
- package/dist/utils/index.d.ts +67 -0
- package/dist/utils/index.js +114 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/nativeBridge.d.ts +2 -0
- package/dist/utils/nativeBridge.js +2 -0
- package/package.json +105 -0
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { OrderStatus } from '../generated/global-types';
|
|
2
|
+
|
|
3
|
+
interface StoreOrder {
|
|
4
|
+
id: string;
|
|
5
|
+
status: string;
|
|
6
|
+
total: number;
|
|
7
|
+
currency: string;
|
|
8
|
+
lineItems: Array<{
|
|
9
|
+
productId: string;
|
|
10
|
+
name: string;
|
|
11
|
+
quantity: number;
|
|
12
|
+
unitPrice: number;
|
|
13
|
+
subtotal: number;
|
|
14
|
+
itemType?: string;
|
|
15
|
+
pricingModel?: string;
|
|
16
|
+
productType?: string;
|
|
17
|
+
productIcon?: string;
|
|
18
|
+
variantId?: string;
|
|
19
|
+
variantName?: string;
|
|
20
|
+
version?: string;
|
|
21
|
+
}>;
|
|
22
|
+
createdAt: string;
|
|
23
|
+
updatedAt: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Hook for fetching and managing orders with offset-based pagination.
|
|
27
|
+
*/
|
|
28
|
+
export declare function useOrders(options?: {
|
|
29
|
+
limit?: number;
|
|
30
|
+
offset?: number;
|
|
31
|
+
status?: OrderStatus;
|
|
32
|
+
}): {
|
|
33
|
+
orders: StoreOrder[];
|
|
34
|
+
hasMore: boolean;
|
|
35
|
+
loading: boolean;
|
|
36
|
+
error: Error | null;
|
|
37
|
+
refetchOrders: () => Promise<void>;
|
|
38
|
+
loadMore: () => void;
|
|
39
|
+
};
|
|
40
|
+
export {};
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { useStoreGraphQLWithContext as e } from "./useStoreGraphQLWithContext.js";
|
|
2
|
+
import { GetMyOrdersDocument as t } from "../generated/global-operations.js";
|
|
3
|
+
import { useCallback as n, useEffect as r, useState as i } from "react";
|
|
4
|
+
import { useApolloClient as a } from "@apollo/client/react";
|
|
5
|
+
//#region src/hooks/useOrders.ts
|
|
6
|
+
var o = 20;
|
|
7
|
+
function s(s) {
|
|
8
|
+
let { query: c, hasOrganizationContext: l } = e(), u = a(), d = s?.limit ?? o, [f, p] = i(s?.offset ?? 0), [m] = i(s?.status), [h, g] = i([]), [_, v] = i(!1), [y, b] = i(!0), [x, S] = i(null), C = n(async (e = 0, n = !1) => {
|
|
9
|
+
b(!0), S(null);
|
|
10
|
+
try {
|
|
11
|
+
let r = {
|
|
12
|
+
limit: d,
|
|
13
|
+
offset: e,
|
|
14
|
+
status: m ?? null
|
|
15
|
+
}, i;
|
|
16
|
+
i = l ? await c({
|
|
17
|
+
query: t,
|
|
18
|
+
variables: r,
|
|
19
|
+
fetchPolicy: "network-only"
|
|
20
|
+
}) : await u.query({
|
|
21
|
+
query: t,
|
|
22
|
+
variables: r,
|
|
23
|
+
fetchPolicy: "network-only"
|
|
24
|
+
});
|
|
25
|
+
let a = (i.data?.myOrders ?? []).map((e) => {
|
|
26
|
+
let t = [];
|
|
27
|
+
if (e.lineItems) if (typeof e.lineItems == "string") try {
|
|
28
|
+
t = JSON.parse(e.lineItems);
|
|
29
|
+
} catch (e) {
|
|
30
|
+
console.error("Failed to parse order lineItems JSON:", e), t = [];
|
|
31
|
+
}
|
|
32
|
+
else t = e.lineItems;
|
|
33
|
+
return {
|
|
34
|
+
...e,
|
|
35
|
+
lineItems: t
|
|
36
|
+
};
|
|
37
|
+
});
|
|
38
|
+
g(n ? (e) => [...e, ...a] : a), v(a.length === d), p(e);
|
|
39
|
+
} catch (e) {
|
|
40
|
+
S(e), console.error("Failed to fetch orders:", e);
|
|
41
|
+
} finally {
|
|
42
|
+
b(!1);
|
|
43
|
+
}
|
|
44
|
+
}, [
|
|
45
|
+
c,
|
|
46
|
+
u,
|
|
47
|
+
l,
|
|
48
|
+
d,
|
|
49
|
+
m
|
|
50
|
+
]);
|
|
51
|
+
return r(() => {
|
|
52
|
+
C(0);
|
|
53
|
+
}, [C]), {
|
|
54
|
+
orders: h,
|
|
55
|
+
hasMore: _,
|
|
56
|
+
loading: y,
|
|
57
|
+
error: x,
|
|
58
|
+
refetchOrders: () => C(0),
|
|
59
|
+
loadMore: n(() => {
|
|
60
|
+
!_ || y || C(f + d, !0);
|
|
61
|
+
}, [
|
|
62
|
+
C,
|
|
63
|
+
_,
|
|
64
|
+
y,
|
|
65
|
+
f,
|
|
66
|
+
d
|
|
67
|
+
])
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
//#endregion
|
|
71
|
+
export { s as useOrders };
|
|
72
|
+
|
|
73
|
+
//# sourceMappingURL=useOrders.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useOrders.js","names":[],"sources":["../../src/hooks/useOrders.ts"],"sourcesContent":["/**\n * Orders Hook\n *\n * Provides order operations that interact with the backend store service.\n * All order data is fetched from the backend via GraphQL.\n */\n\nimport { useState, useEffect, useCallback } from 'react';\nimport { useApolloClient } from '@apollo/client/react';\nimport { GetMyOrdersDocument } from '../generated/global-operations';\nimport type { OrderStatus } from '../generated/global-types';\nimport { useStoreGraphQLWithContext } from './useStoreGraphQLWithContext';\n\nconst DEFAULT_PAGE_SIZE = 20;\n\n// Local type definition until schema is fully generated\ninterface StoreOrder {\n id: string;\n status: string;\n total: number;\n currency: string;\n lineItems: Array<{\n productId: string;\n name: string;\n quantity: number;\n unitPrice: number;\n subtotal: number;\n itemType?: string;\n pricingModel?: string;\n productType?: string;\n productIcon?: string;\n variantId?: string;\n variantName?: string;\n version?: string;\n }>;\n createdAt: string;\n updatedAt: string;\n}\n\n/**\n * Hook for fetching and managing orders with offset-based pagination.\n */\nexport function useOrders(options?: { limit?: number; offset?: number; status?: OrderStatus }) {\n const { query: queryWithContext, hasOrganizationContext } = useStoreGraphQLWithContext();\n const globalClient = useApolloClient();\n\n const limit = options?.limit ?? DEFAULT_PAGE_SIZE;\n const [offset, setOffset] = useState(options?.offset ?? 0);\n const [status] = useState<OrderStatus | undefined>(options?.status);\n\n const [allOrders, setAllOrders] = useState<StoreOrder[]>([]);\n const [hasMore, setHasMore] = useState(false);\n const [loading, setLoading] = useState(true);\n const [error, setError] = useState<Error | null>(null);\n\n const fetchOrders = useCallback(\n async (fetchOffset: number = 0, append = false) => {\n setLoading(true);\n setError(null);\n try {\n const variables = { limit, offset: fetchOffset, status: status ?? null };\n let result;\n\n if (hasOrganizationContext) {\n result = (await queryWithContext({\n query: GetMyOrdersDocument,\n variables,\n fetchPolicy: 'network-only',\n })) as { data?: { myOrders: StoreOrder[] } };\n } else {\n result = await globalClient.query<{ myOrders: StoreOrder[] }>({\n query: GetMyOrdersDocument,\n variables,\n fetchPolicy: 'network-only',\n });\n }\n\n const fetched = (result.data?.myOrders ?? []).map((order) => {\n let parsedLineItems: StoreOrder['lineItems'] = [];\n if (order.lineItems) {\n if (typeof order.lineItems === 'string') {\n try {\n parsedLineItems = JSON.parse(order.lineItems);\n } catch (parseErr) {\n console.error('Failed to parse order lineItems JSON:', parseErr);\n parsedLineItems = [];\n }\n } else {\n parsedLineItems = order.lineItems;\n }\n }\n return { ...order, lineItems: parsedLineItems };\n });\n\n if (append) {\n setAllOrders((prev) => [...prev, ...fetched]);\n } else {\n setAllOrders(fetched);\n }\n setHasMore(fetched.length === limit);\n setOffset(fetchOffset);\n } catch (err) {\n setError(err as Error);\n console.error('Failed to fetch orders:', err);\n } finally {\n setLoading(false);\n }\n },\n [queryWithContext, globalClient, hasOrganizationContext, limit, status]\n );\n\n useEffect(() => {\n fetchOrders(0);\n }, [fetchOrders]);\n\n const loadMore = useCallback(() => {\n if (!hasMore || loading) return;\n fetchOrders(offset + limit, true);\n }, [fetchOrders, hasMore, loading, offset, limit]);\n\n return {\n orders: allOrders,\n hasMore,\n loading,\n error,\n refetchOrders: () => fetchOrders(0),\n loadMore,\n };\n}\n"],"mappings":";;;;;AAaA,IAAM,IAAoB;AA6B1B,SAAgB,EAAU,GAAqE;CAC7F,IAAM,EAAE,OAAO,GAAkB,8BAA2B,GAA4B,EAClF,IAAe,GAAiB,EAEhC,IAAQ,GAAS,SAAS,GAC1B,CAAC,GAAQ,KAAa,EAAS,GAAS,UAAU,EAAE,EACpD,CAAC,KAAU,EAAkC,GAAS,OAAO,EAE7D,CAAC,GAAW,KAAgB,EAAuB,EAAE,CAAC,EACtD,CAAC,GAAS,KAAc,EAAS,GAAM,EACvC,CAAC,GAAS,KAAc,EAAS,GAAK,EACtC,CAAC,GAAO,KAAY,EAAuB,KAAK,EAEhD,IAAc,EAClB,OAAO,IAAsB,GAAG,IAAS,OAAU;AAEjD,EADA,EAAW,GAAK,EAChB,EAAS,KAAK;AACd,MAAI;GACF,IAAM,IAAY;IAAE;IAAO,QAAQ;IAAa,QAAQ,KAAU;IAAM,EACpE;AAEJ,GAOE,IAPE,IACQ,MAAM,EAAiB;IAC/B,OAAO;IACP;IACA,aAAa;IACd,CAAC,GAEO,MAAM,EAAa,MAAkC;IAC5D,OAAO;IACP;IACA,aAAa;IACd,CAAC;GAGJ,IAAM,KAAW,EAAO,MAAM,YAAY,EAAE,EAAE,KAAK,MAAU;IAC3D,IAAI,IAA2C,EAAE;AACjD,QAAI,EAAM,UACR,KAAI,OAAO,EAAM,aAAc,SAC7B,KAAI;AACF,SAAkB,KAAK,MAAM,EAAM,UAAU;aACtC,GAAU;AAEjB,KADA,QAAQ,MAAM,yCAAyC,EAAS,EAChE,IAAkB,EAAE;;QAGtB,KAAkB,EAAM;AAG5B,WAAO;KAAE,GAAG;KAAO,WAAW;KAAiB;KAC/C;AAQF,GALE,EADE,KACY,MAAS,CAAC,GAAG,GAAM,GAAG,EAAQ,GAE/B,EAAQ,EAEvB,EAAW,EAAQ,WAAW,EAAM,EACpC,EAAU,EAAY;WACf,GAAK;AAEZ,GADA,EAAS,EAAa,EACtB,QAAQ,MAAM,2BAA2B,EAAI;YACrC;AACR,KAAW,GAAM;;IAGrB;EAAC;EAAkB;EAAc;EAAwB;EAAO;EAAO,CACxE;AAWD,QATA,QAAgB;AACd,IAAY,EAAE;IACb,CAAC,EAAY,CAAC,EAOV;EACL,QAAQ;EACR;EACA;EACA;EACA,qBAAqB,EAAY,EAAE;EACnC,UAXe,QAAkB;AAC7B,IAAC,KAAW,KAChB,EAAY,IAAS,GAAO,GAAK;KAChC;GAAC;GAAa;GAAS;GAAS;GAAQ;GAAM,CAAC;EASjD"}
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { ProductFilter, ProductSort, SortBy } from '../types';
|
|
2
|
+
|
|
3
|
+
/**
|
|
4
|
+
* Hook for product search and filtering
|
|
5
|
+
*/
|
|
6
|
+
export declare function useProductSearch(): {
|
|
7
|
+
searchQuery: string;
|
|
8
|
+
activeFilters: ProductFilter;
|
|
9
|
+
viewMode: import('..').ViewMode;
|
|
10
|
+
sortBy: SortBy;
|
|
11
|
+
showFiltersPanel: boolean;
|
|
12
|
+
graphqlSort: ProductSort;
|
|
13
|
+
graphqlFilter: ProductFilter;
|
|
14
|
+
hasActiveFilters: boolean;
|
|
15
|
+
setSearchQuery: (query: string) => void;
|
|
16
|
+
updateFilters: (filters: Partial<ProductFilter>) => void;
|
|
17
|
+
clearFilters: () => void;
|
|
18
|
+
resetFilters: () => void;
|
|
19
|
+
setViewMode: (mode: import('..').ViewMode) => void;
|
|
20
|
+
setSortBy: (sort: SortBy) => void;
|
|
21
|
+
toggleFiltersPanel: () => void;
|
|
22
|
+
};
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { useStoreStore as e } from "../store/storeStore.js";
|
|
2
|
+
import { useMemo as t } from "react";
|
|
3
|
+
//#region src/hooks/useProductSearch.ts
|
|
4
|
+
function n() {
|
|
5
|
+
let { searchQuery: n, activeFilters: r, viewMode: i, sortBy: a, showFiltersPanel: o, setSearchQuery: s, updateFilters: c, clearFilters: l, resetFilters: u, setViewMode: d, setSortBy: f, toggleFiltersPanel: p } = e();
|
|
6
|
+
return {
|
|
7
|
+
searchQuery: n,
|
|
8
|
+
activeFilters: r,
|
|
9
|
+
viewMode: i,
|
|
10
|
+
sortBy: a,
|
|
11
|
+
showFiltersPanel: o,
|
|
12
|
+
graphqlSort: t(() => ({
|
|
13
|
+
relevance: {
|
|
14
|
+
field: "RELEVANCE",
|
|
15
|
+
direction: "DESC"
|
|
16
|
+
},
|
|
17
|
+
rating: {
|
|
18
|
+
field: "RATING",
|
|
19
|
+
direction: "DESC"
|
|
20
|
+
},
|
|
21
|
+
"price-asc": {
|
|
22
|
+
field: "PRICE",
|
|
23
|
+
direction: "ASC"
|
|
24
|
+
},
|
|
25
|
+
"price-desc": {
|
|
26
|
+
field: "PRICE",
|
|
27
|
+
direction: "DESC"
|
|
28
|
+
},
|
|
29
|
+
downloads: {
|
|
30
|
+
field: "DOWNLOADS",
|
|
31
|
+
direction: "DESC"
|
|
32
|
+
},
|
|
33
|
+
newest: {
|
|
34
|
+
field: "CREATED_AT",
|
|
35
|
+
direction: "DESC"
|
|
36
|
+
},
|
|
37
|
+
popular: {
|
|
38
|
+
field: "DOWNLOADS",
|
|
39
|
+
direction: "DESC"
|
|
40
|
+
}
|
|
41
|
+
})[a], [a]),
|
|
42
|
+
graphqlFilter: t(() => {
|
|
43
|
+
let e = { ...r };
|
|
44
|
+
return n && (e.search = n), e;
|
|
45
|
+
}, [r, n]),
|
|
46
|
+
hasActiveFilters: t(() => Object.keys(r).length > 0 || n.length > 0, [r, n]),
|
|
47
|
+
setSearchQuery: s,
|
|
48
|
+
updateFilters: c,
|
|
49
|
+
clearFilters: l,
|
|
50
|
+
resetFilters: u,
|
|
51
|
+
setViewMode: d,
|
|
52
|
+
setSortBy: f,
|
|
53
|
+
toggleFiltersPanel: p
|
|
54
|
+
};
|
|
55
|
+
}
|
|
56
|
+
//#endregion
|
|
57
|
+
export { n as useProductSearch };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=useProductSearch.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"useProductSearch.js","names":[],"sources":["../../src/hooks/useProductSearch.ts"],"sourcesContent":["import { useMemo } from 'react';\nimport { useStoreStore } from '../store/storeStore';\nimport type { ProductFilter, ProductSort, SortBy } from '../types';\n\n/**\n * Hook for product search and filtering\n */\nexport function useProductSearch() {\n const {\n searchQuery,\n activeFilters,\n viewMode,\n sortBy,\n showFiltersPanel,\n setSearchQuery,\n updateFilters,\n clearFilters,\n resetFilters,\n setViewMode,\n setSortBy,\n toggleFiltersPanel,\n } = useStoreStore();\n\n // Convert SortBy to GraphQL ProductSort\n const graphqlSort = useMemo((): ProductSort => {\n const sortMap: Record<SortBy, ProductSort> = {\n relevance: { field: 'RELEVANCE', direction: 'DESC' },\n rating: { field: 'RATING', direction: 'DESC' },\n 'price-asc': { field: 'PRICE', direction: 'ASC' },\n 'price-desc': { field: 'PRICE', direction: 'DESC' },\n downloads: { field: 'DOWNLOADS', direction: 'DESC' },\n newest: { field: 'CREATED_AT', direction: 'DESC' },\n popular: { field: 'DOWNLOADS', direction: 'DESC' },\n };\n\n return sortMap[sortBy];\n }, [sortBy]);\n\n // Build GraphQL filter from active filters\n const graphqlFilter = useMemo((): ProductFilter => {\n const filter: ProductFilter = { ...activeFilters };\n\n if (searchQuery) {\n filter.search = searchQuery;\n }\n\n return filter;\n }, [activeFilters, searchQuery]);\n\n // Check if any filters are active\n const hasActiveFilters = useMemo(() => {\n return Object.keys(activeFilters).length > 0 || searchQuery.length > 0;\n }, [activeFilters, searchQuery]);\n\n return {\n searchQuery,\n activeFilters,\n viewMode,\n sortBy,\n showFiltersPanel,\n graphqlSort,\n graphqlFilter,\n hasActiveFilters,\n setSearchQuery,\n updateFilters,\n clearFilters,\n resetFilters,\n setViewMode,\n setSortBy,\n toggleFiltersPanel,\n };\n}\n"],"mappings":";;;AAOA,SAAgB,IAAmB;CACjC,IAAM,EACJ,gBACA,kBACA,aACA,WACA,qBACA,mBACA,kBACA,iBACA,iBACA,gBACA,cACA,0BACE,GAAe;AAiCnB,QAAO;EACL;EACA;EACA;EACA;EACA;EACA,aApCkB,SAC2B;GAC3C,WAAW;IAAE,OAAO;IAAa,WAAW;IAAQ;GACpD,QAAQ;IAAE,OAAO;IAAU,WAAW;IAAQ;GAC9C,aAAa;IAAE,OAAO;IAAS,WAAW;IAAO;GACjD,cAAc;IAAE,OAAO;IAAS,WAAW;IAAQ;GACnD,WAAW;IAAE,OAAO;IAAa,WAAW;IAAQ;GACpD,QAAQ;IAAE,OAAO;IAAc,WAAW;IAAQ;GAClD,SAAS;IAAE,OAAO;IAAa,WAAW;IAAQ;GACnD,EAEc,IACd,CAAC,EAAO,CAAC;EAyBV,eAtBoB,QAA6B;GACjD,IAAM,IAAwB,EAAE,GAAG,GAAe;AAMlD,UAJI,MACF,EAAO,SAAS,IAGX;KACN,CAAC,GAAe,EAAY,CAAC;EAe9B,kBAZuB,QAChB,OAAO,KAAK,EAAc,CAAC,SAAS,KAAK,EAAY,SAAS,GACpE,CAAC,GAAe,EAAY,CAAC;EAW9B;EACA;EACA;EACA;EACA;EACA;EACA;EACD"}
|
|
@@ -0,0 +1,475 @@
|
|
|
1
|
+
import { BrowseStoreInput, StoreProductDetailsInput } from '../generated/global-types';
|
|
2
|
+
|
|
3
|
+
type ProductType = 'APP' | 'TEMPLATE' | 'THEME' | 'INTEGRATION' | 'WIDGET' | 'DATASET';
|
|
4
|
+
type CreateReviewInput = {
|
|
5
|
+
productId: string;
|
|
6
|
+
rating: number;
|
|
7
|
+
title?: string;
|
|
8
|
+
comment?: string;
|
|
9
|
+
};
|
|
10
|
+
type UpdateReviewInput = {
|
|
11
|
+
rating?: number;
|
|
12
|
+
title?: string;
|
|
13
|
+
comment?: string;
|
|
14
|
+
};
|
|
15
|
+
interface StoreProduct {
|
|
16
|
+
id: string;
|
|
17
|
+
name: string;
|
|
18
|
+
slug: string;
|
|
19
|
+
type: string;
|
|
20
|
+
nature: string;
|
|
21
|
+
status: string;
|
|
22
|
+
description?: string;
|
|
23
|
+
pricingModel: string;
|
|
24
|
+
price: number;
|
|
25
|
+
currency: string;
|
|
26
|
+
icon?: string;
|
|
27
|
+
screenshots: string[];
|
|
28
|
+
rating?: number;
|
|
29
|
+
reviewCount: number;
|
|
30
|
+
downloads: number;
|
|
31
|
+
featured: boolean;
|
|
32
|
+
category?: string;
|
|
33
|
+
tags?: string[];
|
|
34
|
+
publishedAt?: string;
|
|
35
|
+
publisher?: {
|
|
36
|
+
id: string;
|
|
37
|
+
name: string;
|
|
38
|
+
isVerified: boolean;
|
|
39
|
+
logoUrl?: string;
|
|
40
|
+
};
|
|
41
|
+
}
|
|
42
|
+
interface BrowseStoreResult {
|
|
43
|
+
products: StoreProduct[];
|
|
44
|
+
totalCount: number;
|
|
45
|
+
hasMore: boolean;
|
|
46
|
+
nextCursor?: string;
|
|
47
|
+
facets?: {
|
|
48
|
+
types: {
|
|
49
|
+
value: string;
|
|
50
|
+
count: number;
|
|
51
|
+
}[];
|
|
52
|
+
subTypes: {
|
|
53
|
+
value: string;
|
|
54
|
+
count: number;
|
|
55
|
+
}[];
|
|
56
|
+
categories: {
|
|
57
|
+
value: string;
|
|
58
|
+
count: number;
|
|
59
|
+
}[];
|
|
60
|
+
pricingModels: {
|
|
61
|
+
value: string;
|
|
62
|
+
count: number;
|
|
63
|
+
}[];
|
|
64
|
+
licenses: {
|
|
65
|
+
value: string;
|
|
66
|
+
count: number;
|
|
67
|
+
}[];
|
|
68
|
+
priceRange?: {
|
|
69
|
+
min: number;
|
|
70
|
+
max: number;
|
|
71
|
+
};
|
|
72
|
+
ratingDistribution?: {
|
|
73
|
+
fiveStars: number;
|
|
74
|
+
fourStars: number;
|
|
75
|
+
threeStars: number;
|
|
76
|
+
twoStars: number;
|
|
77
|
+
oneStar: number;
|
|
78
|
+
};
|
|
79
|
+
};
|
|
80
|
+
}
|
|
81
|
+
interface ProductReview {
|
|
82
|
+
id: string;
|
|
83
|
+
productId: string;
|
|
84
|
+
userId: string;
|
|
85
|
+
rating: number;
|
|
86
|
+
title?: string;
|
|
87
|
+
comment?: string;
|
|
88
|
+
status: string;
|
|
89
|
+
helpful: number;
|
|
90
|
+
createdAt: string;
|
|
91
|
+
updatedAt: string;
|
|
92
|
+
}
|
|
93
|
+
interface ProductCategory {
|
|
94
|
+
id: string;
|
|
95
|
+
name: string;
|
|
96
|
+
slug: string;
|
|
97
|
+
description?: string;
|
|
98
|
+
icon?: string;
|
|
99
|
+
parentId?: string;
|
|
100
|
+
}
|
|
101
|
+
interface SearchSuggestion {
|
|
102
|
+
term: string;
|
|
103
|
+
type: string;
|
|
104
|
+
count: number;
|
|
105
|
+
highlight?: string;
|
|
106
|
+
}
|
|
107
|
+
interface GroupedProducts {
|
|
108
|
+
featured: StoreProduct[];
|
|
109
|
+
mostDownloaded: StoreProduct[];
|
|
110
|
+
recentlyAdded: StoreProduct[];
|
|
111
|
+
freeItems: StoreProduct[];
|
|
112
|
+
}
|
|
113
|
+
/**
|
|
114
|
+
* Hook to browse/search store products with filters
|
|
115
|
+
* Uses Apollo Client from context
|
|
116
|
+
*/
|
|
117
|
+
export declare function useBrowseStore(input?: BrowseStoreInput): {
|
|
118
|
+
products: StoreProduct[];
|
|
119
|
+
totalCount: number;
|
|
120
|
+
hasMore: boolean;
|
|
121
|
+
facets: {
|
|
122
|
+
types: {
|
|
123
|
+
value: string;
|
|
124
|
+
count: number;
|
|
125
|
+
}[];
|
|
126
|
+
subTypes: {
|
|
127
|
+
value: string;
|
|
128
|
+
count: number;
|
|
129
|
+
}[];
|
|
130
|
+
categories: {
|
|
131
|
+
value: string;
|
|
132
|
+
count: number;
|
|
133
|
+
}[];
|
|
134
|
+
pricingModels: {
|
|
135
|
+
value: string;
|
|
136
|
+
count: number;
|
|
137
|
+
}[];
|
|
138
|
+
licenses: {
|
|
139
|
+
value: string;
|
|
140
|
+
count: number;
|
|
141
|
+
}[];
|
|
142
|
+
priceRange?: {
|
|
143
|
+
min: number;
|
|
144
|
+
max: number;
|
|
145
|
+
};
|
|
146
|
+
ratingDistribution?: {
|
|
147
|
+
fiveStars: number;
|
|
148
|
+
fourStars: number;
|
|
149
|
+
threeStars: number;
|
|
150
|
+
twoStars: number;
|
|
151
|
+
oneStar: number;
|
|
152
|
+
};
|
|
153
|
+
} | undefined;
|
|
154
|
+
loading: boolean;
|
|
155
|
+
error: Error | null;
|
|
156
|
+
refetch: () => Promise<void>;
|
|
157
|
+
};
|
|
158
|
+
/**
|
|
159
|
+
* Hook to browse/search store products with organization context.
|
|
160
|
+
* Uses organization-aware GraphQL client with automatic headers.
|
|
161
|
+
* Automatically applies defaultCompatibleWith from store context
|
|
162
|
+
* to the filter if not already specified in the input.
|
|
163
|
+
*/
|
|
164
|
+
export declare function useBrowseStoreWithContext(input?: BrowseStoreInput, options?: {
|
|
165
|
+
skip?: boolean;
|
|
166
|
+
}): {
|
|
167
|
+
products: StoreProduct[];
|
|
168
|
+
totalCount: number;
|
|
169
|
+
hasMore: boolean;
|
|
170
|
+
facets: {
|
|
171
|
+
types: {
|
|
172
|
+
value: string;
|
|
173
|
+
count: number;
|
|
174
|
+
}[];
|
|
175
|
+
subTypes: {
|
|
176
|
+
value: string;
|
|
177
|
+
count: number;
|
|
178
|
+
}[];
|
|
179
|
+
categories: {
|
|
180
|
+
value: string;
|
|
181
|
+
count: number;
|
|
182
|
+
}[];
|
|
183
|
+
pricingModels: {
|
|
184
|
+
value: string;
|
|
185
|
+
count: number;
|
|
186
|
+
}[];
|
|
187
|
+
licenses: {
|
|
188
|
+
value: string;
|
|
189
|
+
count: number;
|
|
190
|
+
}[];
|
|
191
|
+
priceRange?: {
|
|
192
|
+
min: number;
|
|
193
|
+
max: number;
|
|
194
|
+
};
|
|
195
|
+
ratingDistribution?: {
|
|
196
|
+
fiveStars: number;
|
|
197
|
+
fourStars: number;
|
|
198
|
+
threeStars: number;
|
|
199
|
+
twoStars: number;
|
|
200
|
+
oneStar: number;
|
|
201
|
+
};
|
|
202
|
+
} | undefined;
|
|
203
|
+
loading: boolean;
|
|
204
|
+
error: Error | null;
|
|
205
|
+
refetch: () => Promise<void>;
|
|
206
|
+
loadMore: () => void;
|
|
207
|
+
};
|
|
208
|
+
/**
|
|
209
|
+
* Lazy hook to browse store on demand
|
|
210
|
+
*/
|
|
211
|
+
export declare function useLazyBrowseStore(): {
|
|
212
|
+
browseStore: (input?: BrowseStoreInput) => Promise<BrowseStoreResult | null | undefined>;
|
|
213
|
+
products: StoreProduct[];
|
|
214
|
+
totalCount: number;
|
|
215
|
+
hasMore: boolean;
|
|
216
|
+
facets: {
|
|
217
|
+
types: {
|
|
218
|
+
value: string;
|
|
219
|
+
count: number;
|
|
220
|
+
}[];
|
|
221
|
+
subTypes: {
|
|
222
|
+
value: string;
|
|
223
|
+
count: number;
|
|
224
|
+
}[];
|
|
225
|
+
categories: {
|
|
226
|
+
value: string;
|
|
227
|
+
count: number;
|
|
228
|
+
}[];
|
|
229
|
+
pricingModels: {
|
|
230
|
+
value: string;
|
|
231
|
+
count: number;
|
|
232
|
+
}[];
|
|
233
|
+
licenses: {
|
|
234
|
+
value: string;
|
|
235
|
+
count: number;
|
|
236
|
+
}[];
|
|
237
|
+
priceRange?: {
|
|
238
|
+
min: number;
|
|
239
|
+
max: number;
|
|
240
|
+
};
|
|
241
|
+
ratingDistribution?: {
|
|
242
|
+
fiveStars: number;
|
|
243
|
+
fourStars: number;
|
|
244
|
+
threeStars: number;
|
|
245
|
+
twoStars: number;
|
|
246
|
+
oneStar: number;
|
|
247
|
+
};
|
|
248
|
+
} | undefined;
|
|
249
|
+
loading: boolean;
|
|
250
|
+
error: Error | null;
|
|
251
|
+
};
|
|
252
|
+
/**
|
|
253
|
+
* Hook to fetch product details for product page
|
|
254
|
+
*/
|
|
255
|
+
export declare function useStoreProductDetails(input: StoreProductDetailsInput): {
|
|
256
|
+
data: unknown;
|
|
257
|
+
loading: boolean;
|
|
258
|
+
error: Error | null;
|
|
259
|
+
refetch: () => Promise<void>;
|
|
260
|
+
};
|
|
261
|
+
/**
|
|
262
|
+
* Lazy hook to fetch product details on demand
|
|
263
|
+
*/
|
|
264
|
+
export declare function useLazyStoreProductDetails(): {
|
|
265
|
+
getProductDetails: (input: StoreProductDetailsInput) => Promise<{
|
|
266
|
+
product: StoreProduct;
|
|
267
|
+
publisher?: {
|
|
268
|
+
id: string;
|
|
269
|
+
name: string;
|
|
270
|
+
isVerified: boolean;
|
|
271
|
+
logoUrl?: string;
|
|
272
|
+
};
|
|
273
|
+
relatedProducts?: StoreProduct[];
|
|
274
|
+
reviews?: ProductReview[];
|
|
275
|
+
} | null>;
|
|
276
|
+
data: unknown;
|
|
277
|
+
loading: boolean;
|
|
278
|
+
error: Error | null;
|
|
279
|
+
};
|
|
280
|
+
/**
|
|
281
|
+
* Hook to fetch grouped products for homepage.
|
|
282
|
+
*/
|
|
283
|
+
export declare function useHomeGroupedProducts(options?: {
|
|
284
|
+
skip?: boolean;
|
|
285
|
+
}): {
|
|
286
|
+
data: GroupedProducts | null;
|
|
287
|
+
featured: StoreProduct[];
|
|
288
|
+
mostDownloaded: StoreProduct[];
|
|
289
|
+
recentlyAdded: StoreProduct[];
|
|
290
|
+
freeItems: StoreProduct[];
|
|
291
|
+
loading: boolean;
|
|
292
|
+
error: Error | null;
|
|
293
|
+
refetch: () => Promise<void>;
|
|
294
|
+
};
|
|
295
|
+
/**
|
|
296
|
+
* Hook to fetch featured products
|
|
297
|
+
*/
|
|
298
|
+
export declare function useFeaturedProducts(limit?: number): {
|
|
299
|
+
products: StoreProduct[];
|
|
300
|
+
loading: boolean;
|
|
301
|
+
error: Error | null;
|
|
302
|
+
refetch: () => Promise<void>;
|
|
303
|
+
};
|
|
304
|
+
/**
|
|
305
|
+
* Hook to fetch search suggestions for autocomplete
|
|
306
|
+
*/
|
|
307
|
+
export declare function useSearchSuggestions(query: string, options?: {
|
|
308
|
+
limit?: number;
|
|
309
|
+
types?: string[];
|
|
310
|
+
}): {
|
|
311
|
+
suggestions: SearchSuggestion[];
|
|
312
|
+
loading: boolean;
|
|
313
|
+
error: Error | null;
|
|
314
|
+
refetch: () => Promise<void>;
|
|
315
|
+
};
|
|
316
|
+
/**
|
|
317
|
+
* Lazy hook to fetch search suggestions on demand
|
|
318
|
+
*/
|
|
319
|
+
export declare function useLazySearchSuggestions(): {
|
|
320
|
+
getSuggestions: (query: string, options?: {
|
|
321
|
+
limit?: number;
|
|
322
|
+
types?: string[];
|
|
323
|
+
}) => Promise<SearchSuggestion[]>;
|
|
324
|
+
suggestions: SearchSuggestion[];
|
|
325
|
+
loading: boolean;
|
|
326
|
+
error: Error | null;
|
|
327
|
+
};
|
|
328
|
+
/**
|
|
329
|
+
* Hook to fetch trending search terms
|
|
330
|
+
*/
|
|
331
|
+
export declare function useTrendingSearches(options?: {
|
|
332
|
+
limit?: number;
|
|
333
|
+
type?: ProductType;
|
|
334
|
+
}): {
|
|
335
|
+
terms: string[];
|
|
336
|
+
loading: boolean;
|
|
337
|
+
error: Error | null;
|
|
338
|
+
refetch: () => Promise<void>;
|
|
339
|
+
};
|
|
340
|
+
/**
|
|
341
|
+
* Hook to fetch filter options for dropdowns
|
|
342
|
+
*/
|
|
343
|
+
export declare function useFilterOptions(options?: {
|
|
344
|
+
type?: ProductType;
|
|
345
|
+
withProducts?: boolean;
|
|
346
|
+
}): {
|
|
347
|
+
filterOptions: unknown;
|
|
348
|
+
loading: boolean;
|
|
349
|
+
error: Error | null;
|
|
350
|
+
refetch: () => Promise<void>;
|
|
351
|
+
};
|
|
352
|
+
/**
|
|
353
|
+
* Hook to fetch all categories
|
|
354
|
+
*/
|
|
355
|
+
export declare function useCategories(): {
|
|
356
|
+
categories: ProductCategory[];
|
|
357
|
+
loading: boolean;
|
|
358
|
+
error: Error | null;
|
|
359
|
+
refetch: () => Promise<void>;
|
|
360
|
+
};
|
|
361
|
+
/**
|
|
362
|
+
* Hook to fetch reviews for a product
|
|
363
|
+
*/
|
|
364
|
+
export declare function useProductReviews(productId: string, options?: {
|
|
365
|
+
status?: string;
|
|
366
|
+
}): {
|
|
367
|
+
reviews: ProductReview[];
|
|
368
|
+
loading: boolean;
|
|
369
|
+
error: Error | null;
|
|
370
|
+
refetch: () => Promise<void>;
|
|
371
|
+
};
|
|
372
|
+
/**
|
|
373
|
+
* Hook to fetch current user's review for a product
|
|
374
|
+
*/
|
|
375
|
+
export declare function useUserReviewForProduct(productId: string): {
|
|
376
|
+
review: ProductReview | null;
|
|
377
|
+
loading: boolean;
|
|
378
|
+
error: Error | null;
|
|
379
|
+
refetch: () => Promise<void>;
|
|
380
|
+
};
|
|
381
|
+
/**
|
|
382
|
+
* Hook to create a review
|
|
383
|
+
*/
|
|
384
|
+
export declare function useCreateReview(): {
|
|
385
|
+
createReview: (input: CreateReviewInput) => Promise<ProductReview | null>;
|
|
386
|
+
review: ProductReview | null;
|
|
387
|
+
loading: boolean;
|
|
388
|
+
error: Error | null;
|
|
389
|
+
};
|
|
390
|
+
/**
|
|
391
|
+
* Hook to update a review
|
|
392
|
+
*/
|
|
393
|
+
export declare function useUpdateReview(): {
|
|
394
|
+
updateReview: (id: string, input: UpdateReviewInput) => Promise<ProductReview | null>;
|
|
395
|
+
review: ProductReview | null;
|
|
396
|
+
loading: boolean;
|
|
397
|
+
error: Error | null;
|
|
398
|
+
};
|
|
399
|
+
/**
|
|
400
|
+
* Hook to delete a review
|
|
401
|
+
*/
|
|
402
|
+
export declare function useDeleteReview(): {
|
|
403
|
+
deleteReview: (id: string) => Promise<boolean>;
|
|
404
|
+
loading: boolean;
|
|
405
|
+
error: Error | null;
|
|
406
|
+
};
|
|
407
|
+
/**
|
|
408
|
+
* Hook to mark review as helpful
|
|
409
|
+
*/
|
|
410
|
+
export declare function useMarkReviewHelpful(): {
|
|
411
|
+
markHelpful: (id: string) => Promise<{
|
|
412
|
+
id: string;
|
|
413
|
+
helpful: number;
|
|
414
|
+
} | null>;
|
|
415
|
+
loading: boolean;
|
|
416
|
+
error: Error | null;
|
|
417
|
+
};
|
|
418
|
+
/**
|
|
419
|
+
* Hook to fetch current user's entitlements
|
|
420
|
+
*/
|
|
421
|
+
export declare function useMyEntitlements(): {
|
|
422
|
+
entitlements: unknown[];
|
|
423
|
+
hasMore: boolean;
|
|
424
|
+
loading: boolean;
|
|
425
|
+
error: Error | null;
|
|
426
|
+
refetch: () => Promise<void>;
|
|
427
|
+
loadMore: () => void;
|
|
428
|
+
};
|
|
429
|
+
/**
|
|
430
|
+
* Hook to check entitlement for a product
|
|
431
|
+
*/
|
|
432
|
+
export declare function useCheckEntitlement(productId: string): {
|
|
433
|
+
entitlement: unknown;
|
|
434
|
+
loading: boolean;
|
|
435
|
+
error: Error | null;
|
|
436
|
+
refetch: () => Promise<void>;
|
|
437
|
+
};
|
|
438
|
+
/**
|
|
439
|
+
* Hook to fetch workspace store orders
|
|
440
|
+
*/
|
|
441
|
+
export declare function useWorkspaceStoreOrders(billingAccountId: string, page: number, limit: number, options?: {
|
|
442
|
+
status?: string;
|
|
443
|
+
search?: string;
|
|
444
|
+
}): {
|
|
445
|
+
orders: unknown[];
|
|
446
|
+
total: number;
|
|
447
|
+
loading: boolean;
|
|
448
|
+
error: Error | null;
|
|
449
|
+
refetch: () => Promise<void>;
|
|
450
|
+
};
|
|
451
|
+
/**
|
|
452
|
+
* Hook to fetch publisher's products
|
|
453
|
+
*/
|
|
454
|
+
export declare function useMyPublishedProducts(): {
|
|
455
|
+
products: StoreProduct[];
|
|
456
|
+
hasMore: boolean;
|
|
457
|
+
loading: boolean;
|
|
458
|
+
error: Error | null;
|
|
459
|
+
refetch: () => Promise<void>;
|
|
460
|
+
loadMore: () => void;
|
|
461
|
+
};
|
|
462
|
+
/**
|
|
463
|
+
* Hook to fetch developer earnings
|
|
464
|
+
*/
|
|
465
|
+
export declare function useDeveloperEarnings(options?: {
|
|
466
|
+
period?: string;
|
|
467
|
+
startDate?: string;
|
|
468
|
+
endDate?: string;
|
|
469
|
+
}): {
|
|
470
|
+
earnings: unknown;
|
|
471
|
+
loading: boolean;
|
|
472
|
+
error: Error | null;
|
|
473
|
+
refetch: () => Promise<void>;
|
|
474
|
+
};
|
|
475
|
+
export type { BrowseStoreInput, StoreProductDetailsInput, ProductType, CreateReviewInput, UpdateReviewInput, StoreProduct, ProductReview, ProductCategory, SearchSuggestion, GroupedProducts, BrowseStoreResult, };
|