@jay-framework/wix-bookings 0.25.5 → 0.26.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/agent-kit/designer/wix-bookings-dashboard-content.md +67 -0
- package/agent-kit/plugin/wix-bookings-setup.md +58 -5
- package/agent-kit/plugin/wix-bookings-troubleshooting.md +29 -3
- package/dist/contracts/booking-flow.jay-contract +27 -0
- package/dist/contracts/booking-flow.jay-contract.d.ts +35 -3
- package/dist/{index.client-DHSnbb5_.d.ts → index.client-oaMPI34g.d.ts} +42 -6
- package/dist/index.client.d.ts +1 -1
- package/dist/index.client.js +661 -117
- package/dist/index.d.ts +2 -2
- package/dist/index.js +60 -144
- package/dist/query-services-B1MS77NZ.js +176 -0
- package/dist/tools.d.ts +4 -2
- package/dist/tools.js +150 -23
- package/package.json +16 -16
- package/plugin.yaml +3 -0
- package/dist/config-loader-sfgwfXPV.js +0 -27
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
# wix-bookings — dashboard-managed content
|
|
2
|
+
|
|
3
|
+
**Plugin** `@jay-framework/wix-bookings` · **contract** `booking-flow`.
|
|
4
|
+
|
|
5
|
+
Service data (name, tagline, description, price, duration, staff, images) is managed in the **Wix dashboard**. When asked to change it: **do not edit code.** Identify the service with the steps below. **Never write without a service id from these steps** — a wrong id changes, or sends the site owner to, the wrong service. When a step doesn't give a clear answer, use a [fallback](#fallbacks): it gives the services-list link and never writes.
|
|
6
|
+
|
|
7
|
+
**Mixed requests** (e.g. "rename this service and make the card bigger"): edit the jay-html part normally, and handle the service data part with the steps below.
|
|
8
|
+
|
|
9
|
+
## Agent behavior
|
|
10
|
+
|
|
11
|
+
### Reply style
|
|
12
|
+
|
|
13
|
+
Keep replies to the site owner **short and simple** (about 1–3 sentences). They are often non-technical — use everyday words and a visual or business angle. Say **what** changed or **where** they can change the service in Wix. Do **not** put file paths, code, binding syntax, or service ids in the thread reply (use ids only in tools and in the steps below).
|
|
14
|
+
|
|
15
|
+
### Update data or send a link
|
|
16
|
+
|
|
17
|
+
- **Try to update** the service when you are **confident** you have the right service id (step 1), the request is **unambiguous**, and you have a **Wix API or tool** that can apply the change. After a successful update, confirm in plain language and include the dashboard link from step 3 so they can review.
|
|
18
|
+
- If you are **not** confident, the request is **ambiguous**, or you **lack** a working update tool → **do not write**. Build the dashboard link when you can and tell them where to edit the service in Wix.
|
|
19
|
+
- If an update **fails** → say so briefly and give the dashboard link.
|
|
20
|
+
|
|
21
|
+
Do not hard-code service fields into jay-html.
|
|
22
|
+
|
|
23
|
+
### Ambiguity and area markers
|
|
24
|
+
|
|
25
|
+
A screenshot may show **several services** inside one **area marker**, but inspect returns **one** `Target source` (one element, at most **one** service id from step 1).
|
|
26
|
+
|
|
27
|
+
When you are unsure — several services visible, the comment does not name which one, “change these” without naming each, or the resolved id may not match what they meant — **do not write**. Explain briefly what you see, which service (if any) the mark resolved to, and **ask them to clarify** (name the service, say “both”, or mark one service at a time). Use the [services list](#fallbacks) when several services might be in scope; use a single-service link only when step 1 gave one clear id. Do not look up a service id by name alone (step 2).
|
|
28
|
+
|
|
29
|
+
## What you get
|
|
30
|
+
|
|
31
|
+
When the user clicks an element in the editor, you get the **source-editing inspector result**: `file` (the page jay-html), `node` (the clicked element: `lines`, `tag`, `html` — its open tag, attributes and own text) and `stack` — enclosing frames, **innermost → outermost**:
|
|
32
|
+
|
|
33
|
+
- `{ kind: 'forEach', lines, itemId }` — a repeated item; `itemId` is the value of its `trackBy`.
|
|
34
|
+
- `{ kind: 'region', lines, name, props? }` — a `<jay:NAME …>` instance.
|
|
35
|
+
|
|
36
|
+
All `lines` are 1-based ranges in `file`. The contract is added as a page script — `<script type="application/jay-headless" plugin="@jay-framework/wix-bookings" contract="booking-flow" key="K">` — or as a `<jay:booking-flow>` instance (a `region` frame named `booking-flow`; its lists then appear without the `K.` prefix).
|
|
37
|
+
|
|
38
|
+
No inspector result → fallback.
|
|
39
|
+
|
|
40
|
+
## Steps
|
|
41
|
+
|
|
42
|
+
1. **Find the service id.** Go through the `forEach` frames in `stack`, innermost first; read the element in `file` at the frame's `lines`:
|
|
43
|
+
|
|
44
|
+
| `forEach` attribute | `trackBy` | `itemId` is |
|
|
45
|
+
|---------------------|-----------|-------------|
|
|
46
|
+
| `K.services` (or `services` inside a `booking-flow` region) | `id` | service id |
|
|
47
|
+
|
|
48
|
+
Use the first match. `slots` and `formFields` frames are **not** services — skip them and keep going outward.
|
|
49
|
+
2. **No match** — the click is on the slot picker, the booking form, or the selected service's name (`{K.selectedServiceName}`): there is **no service id** in the inspector result. Don't guess from markup alone. If the user **named** a service in chat, you may match `name` → `serviceId` in `agent-kit/references/wix-bookings/services.yaml` (from `jay-stack agent-kit`) and then build the single-service link; otherwise use the services-list link and name the service from the visible text.
|
|
50
|
+
3. **Build the link** with `wix-server-client/getDashboardUrl`: service → `{ "path": "bookings/services/form/<serviceId>" }`. Run from the project root: `npx jay-stack-cli action wix-server-client/getDashboardUrl --input '{"path":"bookings/services/form/<serviceId>"}'`; the output's `url` is the link. Never read `config/.wix.yaml` or other credential files to build it.
|
|
51
|
+
4. **Reply** (see [Agent behavior](#agent-behavior)): plain language only — e.g. “This service is set up in your Wix Bookings dashboard; you can change the name here: <url>” or “I updated the service name to …; you can review it here: <url>”.
|
|
52
|
+
|
|
53
|
+
## Fallbacks
|
|
54
|
+
|
|
55
|
+
Give the services-list link — path `bookings/services` — and say you couldn't identify the specific service. Also use it for "add a service".
|
|
56
|
+
|
|
57
|
+
Fall back when: there is no inspector result; no `services` frame matches; or its `trackBy` isn't `id`.
|
|
58
|
+
|
|
59
|
+
If `wix-server-client/getDashboardUrl` itself fails, give no link: say services are managed in the Wix dashboard (Booking Services) and that you couldn't build the link.
|
|
60
|
+
|
|
61
|
+
## Not editable content
|
|
62
|
+
|
|
63
|
+
Time slots, the selected slot and the participant form state are **live booking-flow state**, not site content. Edit no code and no data. Reply in plain language that this is live availability, not something you can edit on the page — suggest changing hours or staff in Bookings, or the page design in the template if they meant how it looks. Add the service link if step 1 found an id, otherwise the services-list link.
|
|
64
|
+
|
|
65
|
+
## Not dashboard content
|
|
66
|
+
|
|
67
|
+
Layout, CSS and markup live in jay-html — edit those normally.
|
|
@@ -30,12 +30,40 @@ postCheckoutUrl: "/book"
|
|
|
30
30
|
|
|
31
31
|
| Field | Purpose |
|
|
32
32
|
|-------|---------|
|
|
33
|
-
| `bookingAppId` | Wix Bookings app ID on the site |
|
|
34
|
-
| `staffResourceTypeId` |
|
|
33
|
+
| `bookingAppId` | Wix Bookings app ID on the site (empty = default Wix Bookings app) |
|
|
34
|
+
| `staffResourceTypeId` | Site-specific resource **typeId** for staff — required when slot queries use `ANY_RESOURCE` staff selection |
|
|
35
35
|
| `slotWindowDays` | How far ahead to query slots (default 14) |
|
|
36
36
|
| `postCheckoutUrl` | Relative path after paid checkout (e.g. `/book`) |
|
|
37
37
|
|
|
38
|
-
|
|
38
|
+
#### `staffResourceTypeId` — setup auto-fill
|
|
39
|
+
|
|
40
|
+
Each Wix site has its own staff resource type. `jay-stack setup wix-bookings` tries to fill an empty value from live Bookings data:
|
|
41
|
+
|
|
42
|
+
1. `POST /bookings/v1/staff-members/query` — collect each service-provider staff member's `resourceId`
|
|
43
|
+
2. `POST /bookings/v2/resources/query` — find a resource in that set and take its `typeId`
|
|
44
|
+
|
|
45
|
+
`POST /bookings/v2/resources/resource-types/query` is **not** used (it can return an empty list on a fresh site).
|
|
46
|
+
|
|
47
|
+
| Outcome | What to do |
|
|
48
|
+
|---------|------------|
|
|
49
|
+
| Setup writes `staffResourceTypeId` | Re-run `jay-stack setup` only when staff or resource types change on the site |
|
|
50
|
+
| Setup returns `needs-config` (no staff) | Add at least one staff member in the Wix Bookings dashboard, run setup again, **or** copy a staff resource's `typeId` from `POST /bookings/v2/resources/query` into `config/.wix-bookings.yaml` |
|
|
51
|
+
| Value already in YAML | Setup leaves it unchanged (no Wix calls) |
|
|
52
|
+
|
|
53
|
+
### 2. Agent-kit references (`jay-stack agent-kit`)
|
|
54
|
+
|
|
55
|
+
After setup and a working API key, run `jay-stack agent-kit` to refresh:
|
|
56
|
+
|
|
57
|
+
| File | Contents |
|
|
58
|
+
|------|----------|
|
|
59
|
+
| `agent-kit/references/wix-bookings/services.yaml` | Visible services — `serviceId`, `name`, `type`, `formId`, `dashboardPath` (`bookings/services/form/<id>`) |
|
|
60
|
+
| `agent-kit/references/wix-bookings/site.yaml` | `staffResourceTypeId`, staff members (`id`, `resourceId`), config vs discovered type for troubleshooting |
|
|
61
|
+
|
|
62
|
+
Same pattern as `wix-forms` → `forms.yaml` and `wix-data` → `collections.yaml`: agents resolve **which service** or **which staff resource type** without guessing from page markup alone.
|
|
63
|
+
|
|
64
|
+
Staff and services are **not** edited in Jay — the index is for discovery and dashboard links. Service field changes stay in the Wix dashboard (see `wix-bookings-dashboard-content.md`).
|
|
65
|
+
|
|
66
|
+
### 3. API key permissions
|
|
39
67
|
|
|
40
68
|
Configure in [Wix API Keys Manager](https://manage.wix.com/account/api-keys). Each step needs its own permission; Wix returns **403** until the right scope is granted.
|
|
41
69
|
|
|
@@ -47,7 +75,7 @@ Configure in [Wix API Keys Manager](https://manage.wix.com/account/api-keys). Ea
|
|
|
47
75
|
|
|
48
76
|
Also enable **Wix Forms** on the API key (via `wix-forms` plugin) for participant field schema.
|
|
49
77
|
|
|
50
|
-
###
|
|
78
|
+
### 4. Headless settings (not API key)
|
|
51
79
|
|
|
52
80
|
Under **Dashboard → Settings → Development & integrations → Headless Settings → your client** (same `clientId` as `config/.wix.yaml`):
|
|
53
81
|
|
|
@@ -60,7 +88,7 @@ For local dev, add **`localhost:3000`** under **Allowed redirect domains** (doma
|
|
|
60
88
|
|
|
61
89
|
The Wix site must be **published** — hosted checkout uses the published site.
|
|
62
90
|
|
|
63
|
-
###
|
|
91
|
+
### 5. Booking page
|
|
64
92
|
|
|
65
93
|
```html
|
|
66
94
|
<script type="application/jay-headless"
|
|
@@ -74,6 +102,31 @@ The Wix site must be **published** — hosted checkout uses the published site.
|
|
|
74
102
|
</jay:booking-flow>
|
|
75
103
|
```
|
|
76
104
|
|
|
105
|
+
## Outcomes — write your own copy
|
|
106
|
+
|
|
107
|
+
The plugin reports **what happened** through enum variants; the string tags are English **defaults**. For your own wording or another language, branch on the variant and write the text in jay-html. Never detect an outcome by testing or matching a string.
|
|
108
|
+
|
|
109
|
+
| Variant | Members | Default text in |
|
|
110
|
+
| ------- | ------- | --------------- |
|
|
111
|
+
| `servicesFailure` | `NONE`, `PERMISSION` (Bookings API 403), `UNKNOWN` | `servicesError` |
|
|
112
|
+
| `slotsFailure` | `NONE`, `UNKNOWN` (loading availability failed) | `slotsMessage` |
|
|
113
|
+
| `bookingState` | `IDLE`, `BOOKING`, `CONFIRMED`, `FAILED` | `bookingStatus` (on `CONFIRMED`) |
|
|
114
|
+
| `bookingFailure` | `NONE`, `VALIDATION`, `FORM_UNAVAILABLE`, `CHECKOUT_PERMISSION`, `CHECKOUT_REDIRECT_REJECTED`, `SITE_NOT_PUBLISHED`, `UNKNOWN` | `bookingError` |
|
|
115
|
+
|
|
116
|
+
- **No available times** is not a failure: `!hasSlots` with `slotsFailure === NONE` (and `!slotsLoading`).
|
|
117
|
+
- `VALIDATION`: the participant form failed a check; `bookingError` names the field (English template, Wix label).
|
|
118
|
+
- `CHECKOUT_PERMISSION`, `CHECKOUT_REDIRECT_REJECTED`, `SITE_NOT_PUBLISHED` are **setup** problems (see the troubleshooting guide). Show visitors a neutral line; the default text is a hint for the site owner.
|
|
119
|
+
|
|
120
|
+
```html
|
|
121
|
+
<p if="servicesFailure === PERMISSION">Les réservations sont momentanément indisponibles.</p>
|
|
122
|
+
<p if="!slotsLoading && !hasSlots && slotsFailure === NONE">Aucun créneau dans les 14 prochains jours.</p>
|
|
123
|
+
<p if="bookingState === CONFIRMED">Réservation confirmée !</p>
|
|
124
|
+
<p if="bookingFailure === VALIDATION">Vérifiez vos informations.</p>
|
|
125
|
+
<p if="bookingFailure === UNKNOWN">La réservation a échoué. Réessayez.</p>
|
|
126
|
+
```
|
|
127
|
+
|
|
128
|
+
With a page-script import (`key="booking"`), prefix the tags: `booking.bookingState`.
|
|
129
|
+
|
|
77
130
|
## Server flow
|
|
78
131
|
|
|
79
132
|
```
|
|
@@ -40,7 +40,20 @@ For local smoke tests, **All site permissions** is acceptable temporarily.
|
|
|
40
40
|
Bookings loads participant fields via `getFormSummary` from `@jay-framework/wix-forms`:
|
|
41
41
|
|
|
42
42
|
- Ensure `wix-forms` is set up and API key has **Wix Forms** permission
|
|
43
|
-
-
|
|
43
|
+
- A service's participant form is `form.id` in the Wix Bookings service. The all-zero id
|
|
44
|
+
(`00000000-0000-0000-0000-000000000000`) means the site default form: the plugin then shows its
|
|
45
|
+
built-in First name / Last name / Email fields and does not call `getFormSummary`
|
|
46
|
+
- `formId` in `agent-kit/references/wix-bookings/services.yaml` is empty for those default-form services
|
|
47
|
+
- Changed a service in the dashboard (e.g. assigned a custom form) and the page still shows the old
|
|
48
|
+
data: the services list is slow-rendered and stays fresh for 10 minutes. Restart the dev server,
|
|
49
|
+
or wait, before re-testing
|
|
50
|
+
- Fields show `required: false` even when Wix requires them: the Form Summary API does not
|
|
51
|
+
carry `required`. **`createBooking` does not enforce it either** — QA 2026-11-10 booked a form
|
|
52
|
+
with a required Address and got 200 without one
|
|
53
|
+
- **Known gap — fields are dropped:** only text, email, phone, number and URL fields are shown.
|
|
54
|
+
Address (and other non-text fields) are silently left out of the participant form, even when
|
|
55
|
+
required. Wix checkout does not ask for them either, so the booking is confirmed without them.
|
|
56
|
+
Do not put address or other non-text fields on a booking form until this is fixed
|
|
44
57
|
|
|
45
58
|
## Do not assume success from redirect alone
|
|
46
59
|
|
|
@@ -50,6 +63,19 @@ Bookings loads participant fields via `getFormSummary` from `@jay-framework/wix-
|
|
|
50
63
|
|
|
51
64
|
| Symptom | Check |
|
|
52
65
|
|---------|-------|
|
|
53
|
-
| No services | `bookingAppId` in `config/.wix-bookings.yaml
|
|
54
|
-
| Slot query fails | `staffResourceTypeId`
|
|
66
|
+
| No services | `bookingAppId` in `config/.wix-bookings.yaml`; API key **Wix Bookings** permission |
|
|
67
|
+
| Slot query fails / no availability | `staffResourceTypeId` in config — must be the staff resource's `typeId` on this site |
|
|
68
|
+
| Setup could not fill `staffResourceTypeId` | No staff on site — add staff in Bookings dashboard and re-run `jay-stack setup wix-bookings` |
|
|
69
|
+
| `staffResourceTypeId` looks wrong | Compare `staffResourceTypeIdFromConfig` vs `staffResourceTypeIdDiscovered` in `agent-kit/references/wix-bookings/site.yaml` after `jay-stack agent-kit` |
|
|
70
|
+
| Agent cannot name a service | Refresh `agent-kit/references/wix-bookings/services.yaml` (`jay-stack agent-kit`) |
|
|
55
71
|
| Wrong return URL after checkout | `postCheckoutUrl` in config |
|
|
72
|
+
|
|
73
|
+
### `staffResourceTypeId` manual recovery
|
|
74
|
+
|
|
75
|
+
When setup returns `needs-config` for staff:
|
|
76
|
+
|
|
77
|
+
1. In Wix Bookings, ensure at least one **staff member** exists.
|
|
78
|
+
2. Re-run `jay-stack setup wix-bookings`, **or**
|
|
79
|
+
3. Call `POST /bookings/v2/resources/query`, find a resource linked to staff, and set `staffResourceTypeId` to that resource's `typeId` in `config/.wix-bookings.yaml`.
|
|
80
|
+
|
|
81
|
+
Runtime slot queries pass this value as `resourceTypeId` when the service allows any staff member (`ANY_RESOURCE`). An empty or wrong value causes Wix to reject the slot request.
|
|
@@ -37,6 +37,13 @@ tags:
|
|
|
37
37
|
type: data
|
|
38
38
|
dataType: string
|
|
39
39
|
phase: fast+interactive
|
|
40
|
+
description: English default text; branch on servicesFailure for your own copy
|
|
41
|
+
|
|
42
|
+
- tag: servicesFailure
|
|
43
|
+
type: variant
|
|
44
|
+
dataType: enum (NONE | PERMISSION | UNKNOWN)
|
|
45
|
+
phase: fast+interactive
|
|
46
|
+
description: Why listing services failed (NONE when it did not)
|
|
40
47
|
|
|
41
48
|
- tag: showServices
|
|
42
49
|
type: variant
|
|
@@ -81,6 +88,13 @@ tags:
|
|
|
81
88
|
type: data
|
|
82
89
|
dataType: string
|
|
83
90
|
phase: fast+interactive
|
|
91
|
+
description: English default text (a load error, or no available times)
|
|
92
|
+
|
|
93
|
+
- tag: slotsFailure
|
|
94
|
+
type: variant
|
|
95
|
+
dataType: enum (NONE | UNKNOWN)
|
|
96
|
+
phase: fast+interactive
|
|
97
|
+
description: Whether loading availability failed; no times with NONE means none are available
|
|
84
98
|
|
|
85
99
|
- tag: formFields
|
|
86
100
|
type: sub-contract
|
|
@@ -108,11 +122,24 @@ tags:
|
|
|
108
122
|
type: data
|
|
109
123
|
dataType: string
|
|
110
124
|
phase: fast+interactive
|
|
125
|
+
description: English default text on confirmation; branch on bookingState for your own copy
|
|
111
126
|
|
|
112
127
|
- tag: bookingError
|
|
113
128
|
type: data
|
|
114
129
|
dataType: string
|
|
115
130
|
phase: fast+interactive
|
|
131
|
+
description: English default text on failure; branch on bookingFailure for your own copy
|
|
132
|
+
|
|
133
|
+
- tag: bookingState
|
|
134
|
+
type: variant
|
|
135
|
+
dataType: enum (IDLE | BOOKING | CONFIRMED | FAILED)
|
|
136
|
+
phase: fast+interactive
|
|
137
|
+
|
|
138
|
+
- tag: bookingFailure
|
|
139
|
+
type: variant
|
|
140
|
+
dataType: enum (NONE | VALIDATION | FORM_UNAVAILABLE | CHECKOUT_PERMISSION | CHECKOUT_REDIRECT_REJECTED | SITE_NOT_PUBLISHED | UNKNOWN)
|
|
141
|
+
phase: fast+interactive
|
|
142
|
+
description: Why the participant form or the booking failed (NONE when it did not)
|
|
116
143
|
|
|
117
144
|
- tag: bookButton
|
|
118
145
|
type: interactive
|
|
@@ -11,6 +11,12 @@ export interface ServiceOfBookingFlowViewState {
|
|
|
11
11
|
formId: string
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
+
export enum ServicesFailure {
|
|
15
|
+
NONE,
|
|
16
|
+
PERMISSION,
|
|
17
|
+
UNKNOWN
|
|
18
|
+
}
|
|
19
|
+
|
|
14
20
|
export interface SlotOfBookingFlowViewState {
|
|
15
21
|
id: string,
|
|
16
22
|
label: string,
|
|
@@ -20,6 +26,11 @@ export interface SlotOfBookingFlowViewState {
|
|
|
20
26
|
eventId: string
|
|
21
27
|
}
|
|
22
28
|
|
|
29
|
+
export enum SlotsFailure {
|
|
30
|
+
NONE,
|
|
31
|
+
UNKNOWN
|
|
32
|
+
}
|
|
33
|
+
|
|
23
34
|
export interface FormFieldOfBookingFlowViewState {
|
|
24
35
|
target: string,
|
|
25
36
|
label: string,
|
|
@@ -27,12 +38,30 @@ export interface FormFieldOfBookingFlowViewState {
|
|
|
27
38
|
required: boolean
|
|
28
39
|
}
|
|
29
40
|
|
|
41
|
+
export enum BookingState {
|
|
42
|
+
IDLE,
|
|
43
|
+
BOOKING,
|
|
44
|
+
CONFIRMED,
|
|
45
|
+
FAILED
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
export enum BookingFailure {
|
|
49
|
+
NONE,
|
|
50
|
+
VALIDATION,
|
|
51
|
+
FORM_UNAVAILABLE,
|
|
52
|
+
CHECKOUT_PERMISSION,
|
|
53
|
+
CHECKOUT_REDIRECT_REJECTED,
|
|
54
|
+
SITE_NOT_PUBLISHED,
|
|
55
|
+
UNKNOWN
|
|
56
|
+
}
|
|
57
|
+
|
|
30
58
|
export interface BookingFlowViewState {
|
|
31
59
|
services: Array<ServiceOfBookingFlowViewState>,
|
|
32
60
|
servicesLoading: boolean,
|
|
33
61
|
showNoServices: boolean,
|
|
34
62
|
hasSlots: boolean,
|
|
35
63
|
servicesError: string,
|
|
64
|
+
servicesFailure: ServicesFailure,
|
|
36
65
|
showServices: boolean,
|
|
37
66
|
showSlots: boolean,
|
|
38
67
|
showForm: boolean,
|
|
@@ -40,22 +69,25 @@ export interface BookingFlowViewState {
|
|
|
40
69
|
slots: Array<SlotOfBookingFlowViewState>,
|
|
41
70
|
slotsLoading: boolean,
|
|
42
71
|
slotsMessage: string,
|
|
72
|
+
slotsFailure: SlotsFailure,
|
|
43
73
|
formFields: Array<FormFieldOfBookingFlowViewState>,
|
|
44
74
|
formLoading: boolean,
|
|
45
75
|
isBooking: boolean,
|
|
46
76
|
bookingStatus: string,
|
|
47
|
-
bookingError: string
|
|
77
|
+
bookingError: string,
|
|
78
|
+
bookingState: BookingState,
|
|
79
|
+
bookingFailure: BookingFailure
|
|
48
80
|
}
|
|
49
81
|
|
|
50
82
|
export type BookingFlowSlowViewState = {};
|
|
51
83
|
|
|
52
|
-
export type BookingFlowFastViewState = Pick<BookingFlowViewState, 'servicesLoading' | 'showNoServices' | 'hasSlots' | 'servicesError' | 'showServices' | 'showSlots' | 'showForm' | 'selectedServiceName' | 'slotsLoading' | 'slotsMessage' | 'formLoading' | 'isBooking' | 'bookingStatus' | 'bookingError'> & {
|
|
84
|
+
export type BookingFlowFastViewState = Pick<BookingFlowViewState, 'servicesLoading' | 'showNoServices' | 'hasSlots' | 'servicesError' | 'servicesFailure' | 'showServices' | 'showSlots' | 'showForm' | 'selectedServiceName' | 'slotsLoading' | 'slotsMessage' | 'slotsFailure' | 'formLoading' | 'isBooking' | 'bookingStatus' | 'bookingError' | 'bookingState' | 'bookingFailure'> & {
|
|
53
85
|
services: Array<BookingFlowViewState['services'][number]>;
|
|
54
86
|
slots: Array<BookingFlowViewState['slots'][number]>;
|
|
55
87
|
formFields: Array<BookingFlowViewState['formFields'][number]>;
|
|
56
88
|
};
|
|
57
89
|
|
|
58
|
-
export type BookingFlowInteractiveViewState = Pick<BookingFlowViewState, 'servicesLoading' | 'showNoServices' | 'hasSlots' | 'servicesError' | 'showServices' | 'showSlots' | 'showForm' | 'selectedServiceName' | 'slotsLoading' | 'slotsMessage' | 'formLoading' | 'isBooking' | 'bookingStatus' | 'bookingError'> & {
|
|
90
|
+
export type BookingFlowInteractiveViewState = Pick<BookingFlowViewState, 'servicesLoading' | 'showNoServices' | 'hasSlots' | 'servicesError' | 'servicesFailure' | 'showServices' | 'showSlots' | 'showForm' | 'selectedServiceName' | 'slotsLoading' | 'slotsMessage' | 'slotsFailure' | 'formLoading' | 'isBooking' | 'bookingStatus' | 'bookingError' | 'bookingState' | 'bookingFailure'> & {
|
|
59
91
|
services: Array<BookingFlowViewState['services'][number]>;
|
|
60
92
|
slots: Array<BookingFlowViewState['slots'][number]>;
|
|
61
93
|
formFields: Array<BookingFlowViewState['formFields'][number]>;
|
|
@@ -26,6 +26,12 @@ interface ServiceOfBookingFlowViewState {
|
|
|
26
26
|
formId: string
|
|
27
27
|
}
|
|
28
28
|
|
|
29
|
+
declare enum ServicesFailure {
|
|
30
|
+
NONE,
|
|
31
|
+
PERMISSION,
|
|
32
|
+
UNKNOWN
|
|
33
|
+
}
|
|
34
|
+
|
|
29
35
|
interface SlotOfBookingFlowViewState {
|
|
30
36
|
id: string,
|
|
31
37
|
label: string,
|
|
@@ -35,6 +41,11 @@ interface SlotOfBookingFlowViewState {
|
|
|
35
41
|
eventId: string
|
|
36
42
|
}
|
|
37
43
|
|
|
44
|
+
declare enum SlotsFailure {
|
|
45
|
+
NONE,
|
|
46
|
+
UNKNOWN
|
|
47
|
+
}
|
|
48
|
+
|
|
38
49
|
interface FormFieldOfBookingFlowViewState {
|
|
39
50
|
target: string,
|
|
40
51
|
label: string,
|
|
@@ -42,12 +53,30 @@ interface FormFieldOfBookingFlowViewState {
|
|
|
42
53
|
required: boolean
|
|
43
54
|
}
|
|
44
55
|
|
|
56
|
+
declare enum BookingState {
|
|
57
|
+
IDLE,
|
|
58
|
+
BOOKING,
|
|
59
|
+
CONFIRMED,
|
|
60
|
+
FAILED
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
declare enum BookingFailure {
|
|
64
|
+
NONE,
|
|
65
|
+
VALIDATION,
|
|
66
|
+
FORM_UNAVAILABLE,
|
|
67
|
+
CHECKOUT_PERMISSION,
|
|
68
|
+
CHECKOUT_REDIRECT_REJECTED,
|
|
69
|
+
SITE_NOT_PUBLISHED,
|
|
70
|
+
UNKNOWN
|
|
71
|
+
}
|
|
72
|
+
|
|
45
73
|
interface BookingFlowViewState {
|
|
46
74
|
services: Array<ServiceOfBookingFlowViewState>,
|
|
47
75
|
servicesLoading: boolean,
|
|
48
76
|
showNoServices: boolean,
|
|
49
77
|
hasSlots: boolean,
|
|
50
78
|
servicesError: string,
|
|
79
|
+
servicesFailure: ServicesFailure,
|
|
51
80
|
showServices: boolean,
|
|
52
81
|
showSlots: boolean,
|
|
53
82
|
showForm: boolean,
|
|
@@ -55,22 +84,25 @@ interface BookingFlowViewState {
|
|
|
55
84
|
slots: Array<SlotOfBookingFlowViewState>,
|
|
56
85
|
slotsLoading: boolean,
|
|
57
86
|
slotsMessage: string,
|
|
87
|
+
slotsFailure: SlotsFailure,
|
|
58
88
|
formFields: Array<FormFieldOfBookingFlowViewState>,
|
|
59
89
|
formLoading: boolean,
|
|
60
90
|
isBooking: boolean,
|
|
61
91
|
bookingStatus: string,
|
|
62
|
-
bookingError: string
|
|
92
|
+
bookingError: string,
|
|
93
|
+
bookingState: BookingState,
|
|
94
|
+
bookingFailure: BookingFailure
|
|
63
95
|
}
|
|
64
96
|
|
|
65
97
|
type BookingFlowSlowViewState = {};
|
|
66
98
|
|
|
67
|
-
type BookingFlowFastViewState = Pick<BookingFlowViewState, 'servicesLoading' | 'showNoServices' | 'hasSlots' | 'servicesError' | 'showServices' | 'showSlots' | 'showForm' | 'selectedServiceName' | 'slotsLoading' | 'slotsMessage' | 'formLoading' | 'isBooking' | 'bookingStatus' | 'bookingError'> & {
|
|
99
|
+
type BookingFlowFastViewState = Pick<BookingFlowViewState, 'servicesLoading' | 'showNoServices' | 'hasSlots' | 'servicesError' | 'servicesFailure' | 'showServices' | 'showSlots' | 'showForm' | 'selectedServiceName' | 'slotsLoading' | 'slotsMessage' | 'slotsFailure' | 'formLoading' | 'isBooking' | 'bookingStatus' | 'bookingError' | 'bookingState' | 'bookingFailure'> & {
|
|
68
100
|
services: Array<BookingFlowViewState['services'][number]>;
|
|
69
101
|
slots: Array<BookingFlowViewState['slots'][number]>;
|
|
70
102
|
formFields: Array<BookingFlowViewState['formFields'][number]>;
|
|
71
103
|
};
|
|
72
104
|
|
|
73
|
-
type BookingFlowInteractiveViewState = Pick<BookingFlowViewState, 'servicesLoading' | 'showNoServices' | 'hasSlots' | 'servicesError' | 'showServices' | 'showSlots' | 'showForm' | 'selectedServiceName' | 'slotsLoading' | 'slotsMessage' | 'formLoading' | 'isBooking' | 'bookingStatus' | 'bookingError'> & {
|
|
105
|
+
type BookingFlowInteractiveViewState = Pick<BookingFlowViewState, 'servicesLoading' | 'showNoServices' | 'hasSlots' | 'servicesError' | 'servicesFailure' | 'showServices' | 'showSlots' | 'showForm' | 'selectedServiceName' | 'slotsLoading' | 'slotsMessage' | 'slotsFailure' | 'formLoading' | 'isBooking' | 'bookingStatus' | 'bookingError' | 'bookingState' | 'bookingFailure'> & {
|
|
74
106
|
services: Array<BookingFlowViewState['services'][number]>;
|
|
75
107
|
slots: Array<BookingFlowViewState['slots'][number]>;
|
|
76
108
|
formFields: Array<BookingFlowViewState['formFields'][number]>;
|
|
@@ -154,6 +186,7 @@ declare const WIX_BOOKINGS_SERVICE: _jay_framework_fullstack_component.ServiceMa
|
|
|
154
186
|
interface BookingFlowCarryForward {
|
|
155
187
|
services: BookingServiceView[];
|
|
156
188
|
servicesError?: string;
|
|
189
|
+
servicesFailure?: ServicesFailure;
|
|
157
190
|
}
|
|
158
191
|
declare const bookingFlow: _jay_framework_fullstack_component.JayStackComponentDefinition<BookingFlowRefs, BookingFlowSlowViewState, BookingFlowFastViewState, BookingFlowInteractiveViewState, [BookingFlowCarryForward, WixBookingsService], [Signals<BookingFlowFastViewState>, BookingFlowCarryForward], object, {}, _jay_framework_component.JayComponentCore<object, BookingFlowInteractiveViewState>>;
|
|
159
192
|
|
|
@@ -205,6 +238,11 @@ declare const createBooking: _jay_framework_fullstack_component.JayAction<{
|
|
|
205
238
|
paymentPreference?: "ONLINE" | "OFFLINE";
|
|
206
239
|
}, CreateBookingOutcome, [WixBookingsService]>;
|
|
207
240
|
|
|
241
|
+
interface ServiceForm {
|
|
242
|
+
id?: string;
|
|
243
|
+
_id?: string;
|
|
244
|
+
}
|
|
245
|
+
|
|
208
246
|
interface RawBookingService {
|
|
209
247
|
_id?: string;
|
|
210
248
|
id?: string;
|
|
@@ -229,9 +267,7 @@ interface RawBookingService {
|
|
|
229
267
|
sessionDurations?: number[];
|
|
230
268
|
};
|
|
231
269
|
};
|
|
232
|
-
form?:
|
|
233
|
-
_id?: string;
|
|
234
|
-
};
|
|
270
|
+
form?: ServiceForm;
|
|
235
271
|
}
|
|
236
272
|
|
|
237
273
|
/**
|
package/dist/index.client.d.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
export { m as BookingFeatures, g as BookingFormFieldView, q as BookingOrder, B as BookingServiceView, f as BookingSlotView, n as BookingStep, C as CreateBookingOutcome, T as TimeSlot, o as TimeSlotsQuery, h as WIX_BOOKINGS_CONTEXT, p as WixBookingsContext, b as bookingFlow, j as canBookOnline, d as createBooking, k as createWixBookingsContext, i as init, l as listServices, c as listSlots } from './index.client-
|
|
1
|
+
export { m as BookingFeatures, g as BookingFormFieldView, q as BookingOrder, B as BookingServiceView, f as BookingSlotView, n as BookingStep, C as CreateBookingOutcome, T as TimeSlot, o as TimeSlotsQuery, h as WIX_BOOKINGS_CONTEXT, p as WixBookingsContext, b as bookingFlow, j as canBookOnline, d as createBooking, k as createWixBookingsContext, i as init, l as listServices, c as listSlots } from './index.client-oaMPI34g.js';
|
|
2
2
|
import '@jay-framework/fullstack-component';
|
|
3
3
|
import '@jay-framework/component';
|
|
4
4
|
import '@jay-framework/runtime';
|