@wix/himalaya-cli 0.1487.0 → 0.1489.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/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/dev-server/src/builder.d.ts +12 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts +13 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/stdlib/wix-sdk/bookings-v2/src/extensions.d.ts +48 -0
- package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/wix-bookings.mjs +22 -0
- package/dist/cli.mjs +145 -42
- package/dist/preview-assets.generated.bin +0 -0
- package/package.json +2 -2
- package/templates/beauty-salon/config.ts +13 -0
- package/templates/beauty-salon/dev/index.ts +784 -0
- package/templates/beauty-salon/himalaya.content.json +3 -0
- package/templates/beauty-salon/tier5-src/_shared/branded-lite-hosted.ts +2 -1
- package/templates/beauty-salon/tier5-src/_shared/branded-load-state.ts +106 -0
- package/templates/beauty-salon/tier5-src/_shared/himi-bookings.ts +14 -0
- package/templates/beauty-salon/tier5-src/_shared/member-account-routes.ts +2 -1
- package/templates/beauty-salon/tier5-src/himi-booking-time/index.ts +25 -11
- package/templates/beauty-salon/tier5-src/himi-branded-lite-agenda/index.ts +769 -0
- package/templates/branded-lite/config.ts +13 -0
- package/templates/branded-lite/dev/index.ts +930 -66
- package/templates/branded-lite/himalaya.content.json +3 -0
- package/templates/branded-lite/tier5-src/_shared/branded-lite-hosted.ts +2 -1
- package/templates/branded-lite/tier5-src/_shared/business-chat-model.ts +5 -3
- package/templates/branded-lite/tier5-src/_shared/business-chat-presenter.ts +84 -5
- package/templates/branded-lite/tier5-src/_shared/himi-bookings.ts +14 -0
- package/templates/branded-lite/tier5-src/_shared/member-account-routes.ts +2 -1
- package/templates/branded-lite/tier5-src/business-chat/index.ts +135 -35
- package/templates/branded-lite/tier5-src/himi-booking-time/index.ts +25 -11
- package/templates/branded-lite/tier5-src/himi-branded-lite-agenda/index.ts +769 -0
- package/templates/community-club/tier5-src/_shared/branded-lite-hosted.ts +2 -1
- package/templates/community-club/tier5-src/_shared/member-account-routes.ts +2 -1
- package/templates/events-meetups/tier5-src/_shared/branded-lite-hosted.ts +2 -1
- package/templates/events-meetups/tier5-src/_shared/member-account-routes.ts +2 -1
- package/templates/gym-fitness/config.ts +13 -0
- package/templates/gym-fitness/dev/index.ts +784 -0
- package/templates/gym-fitness/himalaya.content.json +3 -0
- package/templates/gym-fitness/tier5-src/_shared/branded-lite-hosted.ts +2 -1
- package/templates/gym-fitness/tier5-src/_shared/branded-load-state.ts +106 -0
- package/templates/gym-fitness/tier5-src/_shared/himi-bookings.ts +14 -0
- package/templates/gym-fitness/tier5-src/_shared/member-account-routes.ts +2 -1
- package/templates/gym-fitness/tier5-src/himi-booking-time/index.ts +25 -11
- package/templates/gym-fitness/tier5-src/himi-branded-lite-agenda/index.ts +769 -0
- package/templates/nonprofit-cause/tier5-src/_shared/branded-lite-hosted.ts +2 -1
- package/templates/nonprofit-cause/tier5-src/_shared/member-account-routes.ts +2 -1
- package/templates/podcast-creator/tier5-src/_shared/branded-lite-hosted.ts +2 -1
- package/templates/podcast-creator/tier5-src/_shared/member-account-routes.ts +2 -1
- package/templates/portfolio-creative/tier5-src/_shared/branded-lite-hosted.ts +2 -1
- package/templates/portfolio-creative/tier5-src/_shared/member-account-routes.ts +2 -1
- package/templates/restaurant/tier5-src/_shared/branded-lite-hosted.ts +2 -1
- package/templates/restaurant/tier5-src/_shared/member-account-routes.ts +2 -1
- package/templates/retail-store/tier5-src/_shared/branded-lite-hosted.ts +2 -1
- package/templates/retail-store/tier5-src/_shared/member-account-routes.ts +2 -1
- package/templates/yoga-studio/config.ts +13 -0
- package/templates/yoga-studio/dev/index.ts +784 -0
- package/templates/yoga-studio/himalaya.content.json +3 -0
- package/templates/yoga-studio/tier5-src/_shared/branded-lite-hosted.ts +2 -1
- package/templates/yoga-studio/tier5-src/_shared/branded-load-state.ts +106 -0
- package/templates/yoga-studio/tier5-src/_shared/himi-bookings.ts +14 -0
- package/templates/yoga-studio/tier5-src/_shared/member-account-routes.ts +2 -1
- package/templates/yoga-studio/tier5-src/himi-booking-time/index.ts +25 -11
- package/templates/yoga-studio/tier5-src/himi-branded-lite-agenda/index.ts +769 -0
|
@@ -1233,6 +1233,18 @@ export declare function monthCalendar(props: {
|
|
|
1233
1233
|
selectedEndDatePath?: string;
|
|
1234
1234
|
/** Fires with args{startDate, endDate} once a range completes. */
|
|
1235
1235
|
onSelectRange?: ActionShape;
|
|
1236
|
+
/** "month" (default) | "week": the one-row collapsed calendar an agenda sits under.
|
|
1237
|
+
* Week mode shows the week holding the selected day (else today) and pages by 7 days. */
|
|
1238
|
+
displayMode?: "month" | "week";
|
|
1239
|
+
/** Worker-driven mode, applied on CHANGE — a user toggle is not swallowed. */
|
|
1240
|
+
displayModePath?: string;
|
|
1241
|
+
/** Draw the week ↔ month toggle (title chevron + grab handle). */
|
|
1242
|
+
expandable?: boolean;
|
|
1243
|
+
/** The user switched mode → args{mode}. */
|
|
1244
|
+
onDisplayModeChange?: ActionShape;
|
|
1245
|
+
/** The visible days changed → args{startDate, endDate}. Load against THIS:
|
|
1246
|
+
* `onMonthChange` is silent in week mode, and a week can straddle two months. */
|
|
1247
|
+
onVisibleRangeChange?: ActionShape;
|
|
1236
1248
|
}, opts?: {
|
|
1237
1249
|
id?: string;
|
|
1238
1250
|
}): Component;
|
package/dist/authoring-runtime/node_modules/@wix/himalaya/dist/_types/core/ts/src/schema.d.ts
CHANGED
|
@@ -2279,6 +2279,19 @@ export interface MonthCalendarProps {
|
|
|
2279
2279
|
selectedEndDatePath?: string;
|
|
2280
2280
|
/** Fires with args{startDate, endDate} once a range completes. */
|
|
2281
2281
|
onSelectRange?: Action;
|
|
2282
|
+
/** "month" (default) | "week" — the one-row collapsed calendar an agenda sits
|
|
2283
|
+
* under. Week mode shows the week holding the selected day (else today), pages
|
|
2284
|
+
* by 7 days, and titles the month holding most of that week. */
|
|
2285
|
+
displayMode?: "month" | "week";
|
|
2286
|
+
/** Worker-driven mode, applied on CHANGE (the `yearPath` rule). */
|
|
2287
|
+
displayModePath?: string;
|
|
2288
|
+
/** Draw the week ↔ month toggle: a chevron on the title and a grab handle. */
|
|
2289
|
+
expandable?: boolean;
|
|
2290
|
+
/** The user switched mode → args{mode}. */
|
|
2291
|
+
onDisplayModeChange?: Action;
|
|
2292
|
+
/** The visible days changed (a page in either mode, or a mode switch) →
|
|
2293
|
+
* args{startDate, endDate}, LOCAL "YYYY-MM-DD" of the first and last cell. */
|
|
2294
|
+
onVisibleRangeChange?: Action;
|
|
2282
2295
|
}
|
|
2283
2296
|
export interface TimeGridProps {
|
|
2284
2297
|
mode?: "day" | "3day" | "week";
|
|
@@ -184,6 +184,54 @@ export declare function cancelBooking(bookingId: string, revision: string, notif
|
|
|
184
184
|
* override from a member screen would do. Notifies by default: the business needs to
|
|
185
185
|
* know a member dropped out. */
|
|
186
186
|
export declare function cancelBookingAsMember(bookingId: string, revision: string, notify?: boolean): Promise<WixUpdateBookingResponse>;
|
|
187
|
+
export interface WixWaitlistContact {
|
|
188
|
+
email: string;
|
|
189
|
+
firstName?: string;
|
|
190
|
+
lastName?: string;
|
|
191
|
+
}
|
|
192
|
+
export interface WixWaitlistRegistration {
|
|
193
|
+
id?: string;
|
|
194
|
+
bookingId?: string;
|
|
195
|
+
waitingResource?: string;
|
|
196
|
+
status?: string;
|
|
197
|
+
availableActions?: {
|
|
198
|
+
leave?: boolean;
|
|
199
|
+
enroll?: boolean;
|
|
200
|
+
};
|
|
201
|
+
}
|
|
202
|
+
export interface WixWaitlistEntry {
|
|
203
|
+
/** The waitlisted session id. */
|
|
204
|
+
waitingResource?: string;
|
|
205
|
+
registrations?: WixWaitlistRegistration[];
|
|
206
|
+
}
|
|
207
|
+
export interface WixRegisterToWaitlistResponse {
|
|
208
|
+
registrationId?: string;
|
|
209
|
+
booking?: {
|
|
210
|
+
id?: string;
|
|
211
|
+
status?: string;
|
|
212
|
+
};
|
|
213
|
+
}
|
|
214
|
+
/** Register the signed-in member to a full session's waitlist —
|
|
215
|
+
* POST /bookings/v1/waitlist/register. `sessionId` is the availability slot's
|
|
216
|
+
* `sessionId`. Wix answers with an error when the session has no waitlist or it is
|
|
217
|
+
* full, so offer this only while the entry reports `waitingList.openSpots > 0`.
|
|
218
|
+
* @scope member — requires a signed-in site member; `contact.email` is theirs. Only name and
|
|
219
|
+
* email are sent, so a booking form with other required fields can refuse it. */
|
|
220
|
+
export declare function registerToWaitlist(sessionId: string, contact: WixWaitlistContact): Promise<WixRegisterToWaitlistResponse>;
|
|
221
|
+
/** The waitlists of the given sessions — GET /bookings/v1/waitlist/list (public data).
|
|
222
|
+
* Each registration carries its `bookingId`, which is how a member's own place is found.
|
|
223
|
+
* @scope visitor — an anonymous visitor session is enough. */
|
|
224
|
+
export declare function listWaitlists(sessionIds: string[]): Promise<{
|
|
225
|
+
list?: WixWaitlistEntry[];
|
|
226
|
+
}>;
|
|
227
|
+
/** Leave a waitlist — POST /bookings/v1/waitlist/leave. Wix also cancels the pending
|
|
228
|
+
* booking the registration created, and offers the place to the next registrant.
|
|
229
|
+
* @scope member — requires the signed-in member who registered; `registrationId` comes from
|
|
230
|
+
* `listWaitlists`. */
|
|
231
|
+
export declare function leaveWaitlist(registrationId: string, sessionId: string): Promise<{
|
|
232
|
+
registrationId?: string;
|
|
233
|
+
waitingResource?: string;
|
|
234
|
+
}>;
|
|
187
235
|
/** True when Wix refused a booking write because it breaks the site's booking /
|
|
188
236
|
* cancellation policy (HTTP 428). Surface it as guidance ("too late to cancel
|
|
189
237
|
* online — contact the business"), never as a retryable error. */
|
|
@@ -115,6 +115,25 @@ function cancelBookingAsMember(bookingId, revision, notify = true) {
|
|
|
115
115
|
participantNotification: { notifyParticipants: notify }
|
|
116
116
|
});
|
|
117
117
|
}
|
|
118
|
+
function registerToWaitlist(sessionId, contact) {
|
|
119
|
+
if (!sessionId || !contact?.email) throw new Error("registerToWaitlist: sessionId + contact.email required");
|
|
120
|
+
return wixCall("POST", "/bookings/v1/waitlist/register", {
|
|
121
|
+
waitingResource: sessionId,
|
|
122
|
+
formInfo: {
|
|
123
|
+
contactDetails: { email: contact.email, ...contact.firstName ? { firstName: contact.firstName } : {}, ...contact.lastName ? { lastName: contact.lastName } : {} },
|
|
124
|
+
paymentSelection: [{ numberOfParticipants: 1 }]
|
|
125
|
+
}
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
function listWaitlists(sessionIds) {
|
|
129
|
+
const ids = sessionIds.filter(Boolean);
|
|
130
|
+
if (!ids.length) return Promise.resolve({ list: [] });
|
|
131
|
+
return wixCall("GET", wixQueryPath("/bookings/v1/waitlist/list", { waitingResources: ids }));
|
|
132
|
+
}
|
|
133
|
+
function leaveWaitlist(registrationId, sessionId) {
|
|
134
|
+
if (!registrationId || !sessionId) throw new Error("leaveWaitlist: registrationId + sessionId required");
|
|
135
|
+
return wixCall("POST", "/bookings/v1/waitlist/leave", { registrationId, waitingResource: sessionId });
|
|
136
|
+
}
|
|
118
137
|
function isBookingPolicyViolation(error) {
|
|
119
138
|
const msg = error instanceof Error ? error.message : String(error ?? "");
|
|
120
139
|
return /BOOKING_POLICY_VIOLATION|CANCELLATION_POLICY|cancellation policy/i.test(msg);
|
|
@@ -283,12 +302,15 @@ export {
|
|
|
283
302
|
getBookingFull,
|
|
284
303
|
getService,
|
|
285
304
|
isBookingPolicyViolation,
|
|
305
|
+
leaveWaitlist,
|
|
286
306
|
listBookings,
|
|
307
|
+
listWaitlists,
|
|
287
308
|
queryBookings,
|
|
288
309
|
queryResources,
|
|
289
310
|
queryServiceAvailability,
|
|
290
311
|
queryServices,
|
|
291
312
|
queryStaff,
|
|
313
|
+
registerToWaitlist,
|
|
292
314
|
rescheduleBooking,
|
|
293
315
|
searchServices,
|
|
294
316
|
setBookingAction,
|