@sellhapi/studio-runtime 0.1.0
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/components/AppointmentBooker.d.ts +7 -0
- package/dist/components/AppointmentBooker.d.ts.map +1 -0
- package/dist/components/ArticleCard.d.ts +6 -0
- package/dist/components/ArticleCard.d.ts.map +1 -0
- package/dist/components/ArticleGrid.d.ts +8 -0
- package/dist/components/ArticleGrid.d.ts.map +1 -0
- package/dist/components/DonationCampaignGrid.d.ts +7 -0
- package/dist/components/DonationCampaignGrid.d.ts.map +1 -0
- package/dist/components/DonationForm.d.ts +9 -0
- package/dist/components/DonationForm.d.ts.map +1 -0
- package/dist/components/EventCard.d.ts +6 -0
- package/dist/components/EventCard.d.ts.map +1 -0
- package/dist/components/EventGrid.d.ts +8 -0
- package/dist/components/EventGrid.d.ts.map +1 -0
- package/dist/components/MembershipTiers.d.ts +6 -0
- package/dist/components/MembershipTiers.d.ts.map +1 -0
- package/dist/components/ProductCard.d.ts +6 -0
- package/dist/components/ProductCard.d.ts.map +1 -0
- package/dist/components/ProductGrid.d.ts +9 -0
- package/dist/components/ProductGrid.d.ts.map +1 -0
- package/dist/components/RSVPForm.d.ts +7 -0
- package/dist/components/RSVPForm.d.ts.map +1 -0
- package/dist/context.d.ts +26 -0
- package/dist/context.d.ts.map +1 -0
- package/dist/hooks/useArticles.d.ts +12 -0
- package/dist/hooks/useArticles.d.ts.map +1 -0
- package/dist/hooks/useBookAppointment.d.ts +26 -0
- package/dist/hooks/useBookAppointment.d.ts.map +1 -0
- package/dist/hooks/useCart.d.ts +63 -0
- package/dist/hooks/useCart.d.ts.map +1 -0
- package/dist/hooks/useCheckoutConfig.d.ts +21 -0
- package/dist/hooks/useCheckoutConfig.d.ts.map +1 -0
- package/dist/hooks/useCollection.d.ts +12 -0
- package/dist/hooks/useCollection.d.ts.map +1 -0
- package/dist/hooks/useContentForm.d.ts +31 -0
- package/dist/hooks/useContentForm.d.ts.map +1 -0
- package/dist/hooks/useContentItems.d.ts +122 -0
- package/dist/hooks/useContentItems.d.ts.map +1 -0
- package/dist/hooks/useCreateRSVP.d.ts +10 -0
- package/dist/hooks/useCreateRSVP.d.ts.map +1 -0
- package/dist/hooks/useDigitalProducts.d.ts +8 -0
- package/dist/hooks/useDigitalProducts.d.ts.map +1 -0
- package/dist/hooks/useDonate.d.ts +8 -0
- package/dist/hooks/useDonate.d.ts.map +1 -0
- package/dist/hooks/useDonationCampaigns.d.ts +10 -0
- package/dist/hooks/useDonationCampaigns.d.ts.map +1 -0
- package/dist/hooks/useEvents.d.ts +10 -0
- package/dist/hooks/useEvents.d.ts.map +1 -0
- package/dist/hooks/useFetch.d.ts +14 -0
- package/dist/hooks/useFetch.d.ts.map +1 -0
- package/dist/hooks/useMemberships.d.ts +5 -0
- package/dist/hooks/useMemberships.d.ts.map +1 -0
- package/dist/hooks/useProductCheckout.d.ts +15 -0
- package/dist/hooks/useProductCheckout.d.ts.map +1 -0
- package/dist/hooks/useProducts.d.ts +19 -0
- package/dist/hooks/useProducts.d.ts.map +1 -0
- package/dist/hooks/usePurchaseTickets.d.ts +8 -0
- package/dist/hooks/usePurchaseTickets.d.ts.map +1 -0
- package/dist/hooks/useServices.d.ts +8 -0
- package/dist/hooks/useServices.d.ts.map +1 -0
- package/dist/hooks/useShippingRates.d.ts +12 -0
- package/dist/hooks/useShippingRates.d.ts.map +1 -0
- package/dist/hooks/useStudioEditMode.d.ts +19 -0
- package/dist/hooks/useStudioEditMode.d.ts.map +1 -0
- package/dist/hooks/useSubscribeMembership.d.ts +8 -0
- package/dist/hooks/useSubscribeMembership.d.ts.map +1 -0
- package/dist/hooks/useValidateDiscount.d.ts +21 -0
- package/dist/hooks/useValidateDiscount.d.ts.map +1 -0
- package/dist/index.cjs +1594 -0
- package/dist/index.d.ts +104 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +1571 -0
- package/dist/types/index.d.ts +162 -0
- package/dist/types/index.d.ts.map +1 -0
- package/package.json +34 -0
|
@@ -0,0 +1,162 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Storefront data types for @sellhapi/studio-runtime
|
|
3
|
+
*
|
|
4
|
+
* These are the shapes returned by hooks and consumed by components.
|
|
5
|
+
* All monetary values are in kobo (integer × 100 = Naira).
|
|
6
|
+
*/
|
|
7
|
+
export interface StoreProduct {
|
|
8
|
+
id: string;
|
|
9
|
+
name: string;
|
|
10
|
+
description: string | null;
|
|
11
|
+
price: number;
|
|
12
|
+
priceKobo: number;
|
|
13
|
+
imageUrl: string | null;
|
|
14
|
+
type: "physical" | "digital";
|
|
15
|
+
slug: string | null;
|
|
16
|
+
categoryId: string | null;
|
|
17
|
+
}
|
|
18
|
+
export interface StoreProductVariant {
|
|
19
|
+
id: string;
|
|
20
|
+
name: string;
|
|
21
|
+
priceKobo: number;
|
|
22
|
+
sku: string | null;
|
|
23
|
+
stock: number | null;
|
|
24
|
+
}
|
|
25
|
+
export interface StoreProductDetail extends StoreProduct {
|
|
26
|
+
variants: StoreProductVariant[];
|
|
27
|
+
}
|
|
28
|
+
export interface StorefrontTicketType {
|
|
29
|
+
id: string;
|
|
30
|
+
name: string;
|
|
31
|
+
priceKobo: number;
|
|
32
|
+
capacity: number | null;
|
|
33
|
+
sold: number;
|
|
34
|
+
available: number | null;
|
|
35
|
+
}
|
|
36
|
+
export interface StorefrontEvent {
|
|
37
|
+
id: string;
|
|
38
|
+
title: string;
|
|
39
|
+
description: string | null;
|
|
40
|
+
startsAt: string;
|
|
41
|
+
endsAt: string | null;
|
|
42
|
+
location: string | null;
|
|
43
|
+
imageUrl: string | null;
|
|
44
|
+
status: string;
|
|
45
|
+
ticketTypes: StorefrontTicketType[];
|
|
46
|
+
}
|
|
47
|
+
export interface StorefrontMembershipTier {
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
description: string | null;
|
|
51
|
+
priceKobo: number;
|
|
52
|
+
billingPeriod: "monthly" | "yearly";
|
|
53
|
+
benefits: string[];
|
|
54
|
+
isActive: boolean;
|
|
55
|
+
}
|
|
56
|
+
export interface StorefrontService {
|
|
57
|
+
id: string;
|
|
58
|
+
name: string;
|
|
59
|
+
description: string | null;
|
|
60
|
+
priceKobo: number;
|
|
61
|
+
durationMinutes: number;
|
|
62
|
+
isActive: boolean;
|
|
63
|
+
imageUrl: string | null;
|
|
64
|
+
}
|
|
65
|
+
export interface StorefrontArticle {
|
|
66
|
+
id: string;
|
|
67
|
+
title: string;
|
|
68
|
+
slug: string;
|
|
69
|
+
excerpt: string | null;
|
|
70
|
+
coverUrl: string | null;
|
|
71
|
+
publishedAt: string;
|
|
72
|
+
author: {
|
|
73
|
+
name: string;
|
|
74
|
+
avatarUrl: string | null;
|
|
75
|
+
} | null;
|
|
76
|
+
category: {
|
|
77
|
+
name: string;
|
|
78
|
+
slug: string;
|
|
79
|
+
} | null;
|
|
80
|
+
tags: string[];
|
|
81
|
+
}
|
|
82
|
+
export interface StorefrontDonationCampaign {
|
|
83
|
+
id: string;
|
|
84
|
+
title: string;
|
|
85
|
+
description: string | null;
|
|
86
|
+
coverImageUrl: string | null;
|
|
87
|
+
status: "active" | "paused" | "ended";
|
|
88
|
+
goalAmountKobo: number | null;
|
|
89
|
+
raisedAmountKobo: number;
|
|
90
|
+
donorCount: number;
|
|
91
|
+
/**
|
|
92
|
+
* Fixed-amount mode. When non-null, the contributor pays exactly this amount —
|
|
93
|
+
* no amount input is shown on the storefront. null = open-amount mode.
|
|
94
|
+
*/
|
|
95
|
+
fixedAmountKobo: number | null;
|
|
96
|
+
minDonationKobo: number;
|
|
97
|
+
maxDonationKobo: number | null;
|
|
98
|
+
presetAmounts: number[];
|
|
99
|
+
isAnonymousAllowed: boolean;
|
|
100
|
+
showGoalProgress: boolean;
|
|
101
|
+
showDonorCount: boolean;
|
|
102
|
+
endsAt: string | null;
|
|
103
|
+
}
|
|
104
|
+
export interface RSVPInput {
|
|
105
|
+
eventId: string;
|
|
106
|
+
name: string;
|
|
107
|
+
email: string;
|
|
108
|
+
phone?: string;
|
|
109
|
+
}
|
|
110
|
+
export interface CommerceCustomer {
|
|
111
|
+
name: string;
|
|
112
|
+
email: string;
|
|
113
|
+
phone: string;
|
|
114
|
+
address?: string;
|
|
115
|
+
}
|
|
116
|
+
/** Returned by all commerce action hooks after initiate() resolves */
|
|
117
|
+
export interface CommerceActionResult {
|
|
118
|
+
paymentLink: string;
|
|
119
|
+
orderId?: string;
|
|
120
|
+
reference?: string;
|
|
121
|
+
}
|
|
122
|
+
export interface AvailabilitySlot {
|
|
123
|
+
id: string;
|
|
124
|
+
startTime: string;
|
|
125
|
+
endTime: string;
|
|
126
|
+
available: boolean;
|
|
127
|
+
}
|
|
128
|
+
export interface BookAppointmentInput {
|
|
129
|
+
serviceId: string;
|
|
130
|
+
staffMemberId: string;
|
|
131
|
+
slotId: string;
|
|
132
|
+
customer: CommerceCustomer;
|
|
133
|
+
note?: string;
|
|
134
|
+
}
|
|
135
|
+
export interface TicketOrder {
|
|
136
|
+
ticketTypeId: string;
|
|
137
|
+
quantity: number;
|
|
138
|
+
}
|
|
139
|
+
export interface PurchaseTicketsInput {
|
|
140
|
+
eventId: string;
|
|
141
|
+
ticketOrders: TicketOrder[];
|
|
142
|
+
customer: CommerceCustomer;
|
|
143
|
+
}
|
|
144
|
+
export interface DonateInput {
|
|
145
|
+
campaignId: string;
|
|
146
|
+
amountKobo: number;
|
|
147
|
+
customer: CommerceCustomer;
|
|
148
|
+
isAnonymous?: boolean;
|
|
149
|
+
donorMessage?: string;
|
|
150
|
+
}
|
|
151
|
+
export interface SubscribeMembershipInput {
|
|
152
|
+
tierId: string;
|
|
153
|
+
customer: CommerceCustomer;
|
|
154
|
+
}
|
|
155
|
+
export interface ProductCheckoutInput {
|
|
156
|
+
productId: string;
|
|
157
|
+
quantity: number;
|
|
158
|
+
variantId?: string;
|
|
159
|
+
customer: CommerceCustomer;
|
|
160
|
+
deliveryMethod?: "delivery" | "pickup";
|
|
161
|
+
}
|
|
162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AAS,EAAE,OAAO,CAAC;CACpB;AAED,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAO,MAAM,CAAC;IACvB,aAAa,EAAG,MAAM,CAAC;IACvB,MAAM,EAAU,MAAM,CAAC;IACvB,QAAQ,EAAQ,gBAAgB,CAAC;IACjC,IAAI,CAAC,EAAW,MAAM,CAAC;CACxB;AAID,MAAM,WAAW,WAAW;IAC1B,YAAY,EAAE,MAAM,CAAC;IACrB,QAAQ,EAAM,MAAM,CAAC;CACtB;AAED,MAAM,WAAW,oBAAoB;IACnC,OAAO,EAAO,MAAM,CAAC;IACrB,YAAY,EAAE,WAAW,EAAE,CAAC;IAC5B,QAAQ,EAAM,gBAAgB,CAAC;CAChC;AAID,MAAM,WAAW,WAAW;IAC1B,UAAU,EAAI,MAAM,CAAC;IACrB,UAAU,EAAI,MAAM,CAAC;IACrB,QAAQ,EAAM,gBAAgB,CAAC;IAC/B,WAAW,CAAC,EAAE,OAAO,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAID,MAAM,WAAW,wBAAwB;IACvC,MAAM,EAAI,MAAM,CAAC;IACjB,QAAQ,EAAE,gBAAgB,CAAC;CAC5B;AAID,MAAM,WAAW,oBAAoB;IACnC,SAAS,EAAI,MAAM,CAAC;IACpB,QAAQ,EAAK,MAAM,CAAC;IACpB,SAAS,CAAC,EAAG,MAAM,CAAC;IACpB,QAAQ,EAAK,gBAAgB,CAAC;IAC9B,cAAc,CAAC,EAAE,UAAU,GAAG,QAAQ,CAAC;CACxC"}
|
package/package.json
ADDED
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@sellhapi/studio-runtime",
|
|
3
|
+
"version": "0.1.0",
|
|
4
|
+
"description": "SellHapi Studio Runtime — hooks and components for AI-generated storefronts",
|
|
5
|
+
"type": "module",
|
|
6
|
+
"main": "./dist/index.cjs",
|
|
7
|
+
"module": "./dist/index.js",
|
|
8
|
+
"types": "./dist/index.d.ts",
|
|
9
|
+
"exports": {
|
|
10
|
+
".": {
|
|
11
|
+
"types": "./dist/index.d.ts",
|
|
12
|
+
"import": "./dist/index.js",
|
|
13
|
+
"require": "./dist/index.cjs"
|
|
14
|
+
}
|
|
15
|
+
},
|
|
16
|
+
"files": ["dist"],
|
|
17
|
+
"scripts": {
|
|
18
|
+
"build": "node build.mjs",
|
|
19
|
+
"prepublish": "node build.mjs"
|
|
20
|
+
},
|
|
21
|
+
"peerDependencies": {
|
|
22
|
+
"react": ">=18.0.0",
|
|
23
|
+
"react-dom": ">=18.0.0"
|
|
24
|
+
},
|
|
25
|
+
"devDependencies": {
|
|
26
|
+
"@types/react": "^18.3.0",
|
|
27
|
+
"@types/react-dom": "^18.3.0",
|
|
28
|
+
"esbuild": "^0.25.12",
|
|
29
|
+
"typescript": "^6.0.3"
|
|
30
|
+
},
|
|
31
|
+
"keywords": ["sellhapi", "studio", "runtime", "storefront", "hooks", "components"],
|
|
32
|
+
"author": "SellHapi",
|
|
33
|
+
"license": "MIT"
|
|
34
|
+
}
|