@burdenoff/microfe-store 2026.714.7 → 2026.715.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/dist/StoreAdminRoot.d.ts +22 -0
- package/dist/StoreAdminRoutes.d.ts +9 -0
- package/dist/StoreRoot.d.ts +31 -0
- package/dist/StoreRoutes.d.ts +12 -0
- package/dist/components/AccessDenied.d.ts +6 -0
- package/dist/components/InstallAppModal.d.ts +28 -0
- package/dist/components/PermissionGuard.d.ts +9 -0
- package/dist/components/RouteGuards.d.ts +8 -0
- package/dist/components/cart/CartDrawer.d.ts +35 -0
- package/dist/components/index.d.ts +8 -0
- package/dist/dev/main.d.ts +1 -0
- package/dist/generated/global-operations.d.ts +2027 -0
- package/dist/generated/global-types.d.ts +24704 -0
- package/dist/generated/wspace-operations.d.ts +1 -0
- package/dist/generated/wspace-types.d.ts +80484 -0
- package/dist/hooks/useBackendCart.d.ts +73 -0
- package/dist/hooks/useCart.d.ts +62 -0
- package/dist/hooks/useInstallations.d.ts +47 -0
- package/dist/hooks/useOrders.d.ts +47 -0
- package/dist/hooks/useProductSearch.d.ts +22 -0
- package/dist/hooks/useStoreGraphQL.d.ts +481 -0
- package/dist/hooks/useStoreGraphQLWithContext.d.ts +32 -0
- package/dist/hooks/useStorePermissions.d.ts +63 -0
- package/dist/index.d.ts +44 -0
- package/dist/pages/AdminDashboardPage.d.ts +3 -0
- package/dist/pages/AdminReviewModerationPage.d.ts +3 -0
- package/dist/pages/AdminStoresPage.d.ts +3 -0
- package/dist/pages/AdminSubmissionsQueuePage.d.ts +3 -0
- package/dist/pages/AppDetailPage.d.ts +3 -0
- package/dist/pages/AppSettingsPage.d.ts +3 -0
- package/dist/pages/CartPage.d.ts +8 -0
- package/dist/pages/InstalledAppsPage.d.ts +3 -0
- package/dist/pages/MarketplaceHomePage.d.ts +3 -0
- package/dist/pages/MyLicensesPage.d.ts +3 -0
- package/dist/pages/OrderConfirmationPage.d.ts +3 -0
- package/dist/pages/OrdersPage.d.ts +9 -0
- package/dist/pages/ProductCategoryPage.d.ts +3 -0
- package/dist/pages/ProductDetailPage.d.ts +8 -0
- package/dist/pages/SearchResultsPage.d.ts +3 -0
- package/dist/pages/StoresPage.d.ts +3 -0
- package/dist/providers/StoreProvider.d.ts +38 -0
- package/dist/store/storeStore.d.ts +69 -0
- package/dist/translations/en.d.ts +518 -0
- package/dist/types/index.d.ts +575 -0
- package/dist/utils/index.d.ts +71 -0
- package/dist/utils/nativeBridge.d.ts +2 -0
- package/package.json +2 -2
|
@@ -0,0 +1,481 @@
|
|
|
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<{
|
|
386
|
+
data: ProductReview | null;
|
|
387
|
+
errorMessage: null;
|
|
388
|
+
} | {
|
|
389
|
+
data: null;
|
|
390
|
+
errorMessage: string;
|
|
391
|
+
}>;
|
|
392
|
+
review: ProductReview | null;
|
|
393
|
+
loading: boolean;
|
|
394
|
+
error: Error | null;
|
|
395
|
+
};
|
|
396
|
+
/**
|
|
397
|
+
* Hook to update a review
|
|
398
|
+
*/
|
|
399
|
+
export declare function useUpdateReview(): {
|
|
400
|
+
updateReview: (id: string, input: UpdateReviewInput) => Promise<ProductReview | null>;
|
|
401
|
+
review: ProductReview | null;
|
|
402
|
+
loading: boolean;
|
|
403
|
+
error: Error | null;
|
|
404
|
+
};
|
|
405
|
+
/**
|
|
406
|
+
* Hook to delete a review
|
|
407
|
+
*/
|
|
408
|
+
export declare function useDeleteReview(): {
|
|
409
|
+
deleteReview: (id: string) => Promise<boolean>;
|
|
410
|
+
loading: boolean;
|
|
411
|
+
error: Error | null;
|
|
412
|
+
};
|
|
413
|
+
/**
|
|
414
|
+
* Hook to mark review as helpful
|
|
415
|
+
*/
|
|
416
|
+
export declare function useMarkReviewHelpful(): {
|
|
417
|
+
markHelpful: (id: string) => Promise<{
|
|
418
|
+
id: string;
|
|
419
|
+
helpful: number;
|
|
420
|
+
} | null>;
|
|
421
|
+
loading: boolean;
|
|
422
|
+
error: Error | null;
|
|
423
|
+
};
|
|
424
|
+
/**
|
|
425
|
+
* Hook to fetch current user's entitlements
|
|
426
|
+
*/
|
|
427
|
+
export declare function useMyEntitlements(): {
|
|
428
|
+
entitlements: unknown[];
|
|
429
|
+
hasMore: boolean;
|
|
430
|
+
loading: boolean;
|
|
431
|
+
error: Error | null;
|
|
432
|
+
refetch: () => Promise<void>;
|
|
433
|
+
loadMore: () => void;
|
|
434
|
+
};
|
|
435
|
+
/**
|
|
436
|
+
* Hook to check entitlement for a product
|
|
437
|
+
*/
|
|
438
|
+
export declare function useCheckEntitlement(productId: string): {
|
|
439
|
+
entitlement: unknown;
|
|
440
|
+
loading: boolean;
|
|
441
|
+
error: Error | null;
|
|
442
|
+
refetch: () => Promise<void>;
|
|
443
|
+
};
|
|
444
|
+
/**
|
|
445
|
+
* Hook to fetch workspace store orders
|
|
446
|
+
*/
|
|
447
|
+
export declare function useWorkspaceStoreOrders(billingAccountId: string, page: number, limit: number, options?: {
|
|
448
|
+
status?: string;
|
|
449
|
+
search?: string;
|
|
450
|
+
}): {
|
|
451
|
+
orders: unknown[];
|
|
452
|
+
total: number;
|
|
453
|
+
loading: boolean;
|
|
454
|
+
error: Error | null;
|
|
455
|
+
refetch: () => Promise<void>;
|
|
456
|
+
};
|
|
457
|
+
/**
|
|
458
|
+
* Hook to fetch publisher's products
|
|
459
|
+
*/
|
|
460
|
+
export declare function useMyPublishedProducts(): {
|
|
461
|
+
products: StoreProduct[];
|
|
462
|
+
hasMore: boolean;
|
|
463
|
+
loading: boolean;
|
|
464
|
+
error: Error | null;
|
|
465
|
+
refetch: () => Promise<void>;
|
|
466
|
+
loadMore: () => void;
|
|
467
|
+
};
|
|
468
|
+
/**
|
|
469
|
+
* Hook to fetch developer earnings
|
|
470
|
+
*/
|
|
471
|
+
export declare function useDeveloperEarnings(options?: {
|
|
472
|
+
period?: string;
|
|
473
|
+
startDate?: string;
|
|
474
|
+
endDate?: string;
|
|
475
|
+
}): {
|
|
476
|
+
earnings: unknown;
|
|
477
|
+
loading: boolean;
|
|
478
|
+
error: Error | null;
|
|
479
|
+
refetch: () => Promise<void>;
|
|
480
|
+
};
|
|
481
|
+
export type { BrowseStoreInput, StoreProductDetailsInput, ProductType, CreateReviewInput, UpdateReviewInput, StoreProduct, ProductReview, ProductCategory, SearchSuggestion, GroupedProducts, BrowseStoreResult, };
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { DocumentNode, OperationVariables, TypedDocumentNode } from '@apollo/client/core';
|
|
2
|
+
|
|
3
|
+
type GraphQLDocument = DocumentNode | TypedDocumentNode<unknown, OperationVariables>;
|
|
4
|
+
interface QueryWithContextOptions<TVariables extends OperationVariables = OperationVariables> {
|
|
5
|
+
query: GraphQLDocument;
|
|
6
|
+
variables?: TVariables;
|
|
7
|
+
fetchPolicy?: 'cache-first' | 'network-only' | 'cache-only' | 'no-cache';
|
|
8
|
+
context?: {
|
|
9
|
+
headers?: Record<string, string>;
|
|
10
|
+
};
|
|
11
|
+
}
|
|
12
|
+
interface MutationWithContextOptions<TVariables extends OperationVariables = OperationVariables> {
|
|
13
|
+
mutation: GraphQLDocument;
|
|
14
|
+
variables?: TVariables;
|
|
15
|
+
context?: {
|
|
16
|
+
headers?: Record<string, string>;
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Enhanced GraphQL client hook that automatically includes organization context
|
|
21
|
+
* in all requests to ensure proper organization-scoped licensing.
|
|
22
|
+
*/
|
|
23
|
+
export declare function useStoreGraphQLWithContext(): {
|
|
24
|
+
query: <TVariables extends OperationVariables = OperationVariables>(options: QueryWithContextOptions<TVariables>) => Promise<{
|
|
25
|
+
data: unknown;
|
|
26
|
+
error?: import('@apollo/client').ErrorLike;
|
|
27
|
+
}>;
|
|
28
|
+
mutate: <TData = unknown, TVariables extends OperationVariables = OperationVariables>(options: MutationWithContextOptions<TVariables>) => Promise<import("@apollo/client").ApolloClient.MutateResult<TData, undefined>>;
|
|
29
|
+
organizationId: string | undefined;
|
|
30
|
+
hasOrganizationContext: boolean;
|
|
31
|
+
};
|
|
32
|
+
export {};
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store permission constants matching RBAC resource:action format
|
|
3
|
+
*/
|
|
4
|
+
export declare const STORE_PERMISSIONS: {
|
|
5
|
+
readonly PRODUCT_READ: "store-product:read";
|
|
6
|
+
readonly PRODUCT_CREATE: "store-product:create";
|
|
7
|
+
readonly PRODUCT_UPDATE: "store-product:update";
|
|
8
|
+
readonly PRODUCT_DELETE: "store-product:delete";
|
|
9
|
+
readonly PRODUCT_PUBLISH: "store-product:publish";
|
|
10
|
+
readonly PRODUCT_ADMIN: "store-product:admin";
|
|
11
|
+
readonly CATEGORY_CREATE: "store-category:create";
|
|
12
|
+
readonly CATEGORY_UPDATE: "store-category:update";
|
|
13
|
+
readonly CATEGORY_DELETE: "store-category:delete";
|
|
14
|
+
readonly TAG_CREATE: "store-tag:create";
|
|
15
|
+
readonly TAG_DELETE: "store-tag:delete";
|
|
16
|
+
readonly REVIEW_CREATE: "store-review:create";
|
|
17
|
+
readonly REVIEW_UPDATE: "store-review:update";
|
|
18
|
+
readonly REVIEW_DELETE: "store-review:delete";
|
|
19
|
+
readonly REVIEW_ADMIN: "store-review:admin";
|
|
20
|
+
readonly ENTITLEMENT_READ: "store-entitlement:read";
|
|
21
|
+
readonly ENTITLEMENT_CREATE: "store-entitlement:create";
|
|
22
|
+
readonly ENTITLEMENT_UPDATE: "store-entitlement:update";
|
|
23
|
+
readonly ENTITLEMENT_DELETE: "store-entitlement:delete";
|
|
24
|
+
readonly ORDER_READ: "store-order:read";
|
|
25
|
+
readonly ORDER_CREATE: "store-order:create";
|
|
26
|
+
readonly ORDER_UPDATE: "store-order:update";
|
|
27
|
+
readonly ORDER_ADMIN: "store-order:admin";
|
|
28
|
+
readonly ORDER_EXPORT: "store-order:export";
|
|
29
|
+
readonly CART_READ: "store-cart:read";
|
|
30
|
+
readonly CART_CREATE: "store-cart:create";
|
|
31
|
+
readonly CART_UPDATE: "store-cart:update";
|
|
32
|
+
readonly CART_CHECKOUT: "store-cart:checkout";
|
|
33
|
+
readonly DOWNLOAD_READ: "store-download:read";
|
|
34
|
+
readonly DOWNLOAD_CREATE: "store-download:create";
|
|
35
|
+
readonly INSTALLATION_READ: "store-installation:read";
|
|
36
|
+
readonly INSTALLATION_CREATE: "store-installation:create";
|
|
37
|
+
readonly INSTALLATION_UPDATE: "store-installation:update";
|
|
38
|
+
readonly INSTALLATION_DELETE: "store-installation:delete";
|
|
39
|
+
readonly EARNINGS_READ: "store-earnings:read";
|
|
40
|
+
};
|
|
41
|
+
export type StorePermission = (typeof STORE_PERMISSIONS)[keyof typeof STORE_PERMISSIONS];
|
|
42
|
+
export interface StorePermissions {
|
|
43
|
+
canBrowse: boolean;
|
|
44
|
+
canPurchase: boolean;
|
|
45
|
+
canInstall: boolean;
|
|
46
|
+
canManageLicenses: boolean;
|
|
47
|
+
canPublish: boolean;
|
|
48
|
+
canModerate: boolean;
|
|
49
|
+
isPublisher: boolean;
|
|
50
|
+
isPlatformAdmin: boolean;
|
|
51
|
+
}
|
|
52
|
+
/**
|
|
53
|
+
* Hook for store permissions
|
|
54
|
+
*
|
|
55
|
+
* Integrates with the platform PermissionProvider from @burdenoff/fe-libs.
|
|
56
|
+
* Falls back to role-based checks when permissions are still loading.
|
|
57
|
+
*/
|
|
58
|
+
export declare function useStorePermissions(): {
|
|
59
|
+
permissions: StorePermissions;
|
|
60
|
+
PERMISSIONS: typeof STORE_PERMISSIONS;
|
|
61
|
+
hasPermission: (permission: StorePermission) => boolean;
|
|
62
|
+
isLoading: boolean;
|
|
63
|
+
};
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Store (App Marketplace) Microfrontend
|
|
3
|
+
*
|
|
4
|
+
* Provides a comprehensive UI for discovering, purchasing, installing, and managing
|
|
5
|
+
* both digital and physical products within the Burdenoff ecosystem.
|
|
6
|
+
*
|
|
7
|
+
* @example
|
|
8
|
+
* ```tsx
|
|
9
|
+
* import { StoreRoot, type StoreRootProps } from '@burdenoff/microfe-store';
|
|
10
|
+
*
|
|
11
|
+
* function App() {
|
|
12
|
+
* const props: StoreRootProps = {
|
|
13
|
+
* basePath: '/store',
|
|
14
|
+
* navigate: (path) => router.push(path),
|
|
15
|
+
* currentUser: { id: '1', email: 'user@example.com' },
|
|
16
|
+
* workspaceId: 'ws-123',
|
|
17
|
+
* organizationId: 'org-123',
|
|
18
|
+
* apiGatewayUrl: 'https://api.example.com/tenant/graphql',
|
|
19
|
+
* authToken: 'token',
|
|
20
|
+
* features: {
|
|
21
|
+
* enablePhysicalProducts: true,
|
|
22
|
+
* enablePublisherPortal: true,
|
|
23
|
+
* enableReviews: true,
|
|
24
|
+
* enableSubscriptions: true,
|
|
25
|
+
* },
|
|
26
|
+
* };
|
|
27
|
+
*
|
|
28
|
+
* return <StoreRoot {...props} />;
|
|
29
|
+
* }
|
|
30
|
+
* ```
|
|
31
|
+
*/
|
|
32
|
+
export { StoreRoot } from './StoreRoot';
|
|
33
|
+
export { StoreAdminRoot } from './StoreAdminRoot';
|
|
34
|
+
export type { StoreRootProps, StoreAdminRootProps, ProductSummary, InstallationSummary, SubmissionSummary, ItemType, ProductType, PricingModel, ProductStatus, SubscriptionStatus, InstallationStatus, LicenseType, LicenseStatus, OrderStatus, ShipmentStatus, ReviewStatus, SubmissionStatus, PaymentGateway, ViewMode, SortBy, Category, Publisher, ProductVariant, Product, CartItem, Cart, Address, ShippingMethod, Checkout, Order, Installation, License, LicenseActivation, Review, Submission, RevenueMetrics, ProductFilter, ProductSort, PageInfo, ProductConnection, GraphQLError, MutationResult, } from './types';
|
|
35
|
+
export { useStore } from './providers/StoreProvider';
|
|
36
|
+
export { useStoreStore } from './store/storeStore';
|
|
37
|
+
export { useCart } from './hooks/useCart';
|
|
38
|
+
export { useBackendCart } from './hooks/useBackendCart';
|
|
39
|
+
export { useProductSearch } from './hooks/useProductSearch';
|
|
40
|
+
export { useStorePermissions, STORE_PERMISSIONS, type StorePermission, type StorePermissions, } from './hooks/useStorePermissions';
|
|
41
|
+
export * from './utils';
|
|
42
|
+
export { useBrowseStore, useBrowseStoreWithContext, useLazyBrowseStore, useStoreProductDetails, useLazyStoreProductDetails, useHomeGroupedProducts, useFeaturedProducts, useSearchSuggestions, useLazySearchSuggestions, useTrendingSearches, useFilterOptions, useCategories, useProductReviews, useUserReviewForProduct, useCreateReview, useUpdateReview, useDeleteReview, useMarkReviewHelpful, useMyEntitlements, useCheckEntitlement, useWorkspaceStoreOrders, } from './hooks/useStoreGraphQL';
|
|
43
|
+
export * from './generated/global-operations';
|
|
44
|
+
export { enTranslations as storeTranslations } from './translations/en';
|