@productcraft/waitlist 0.2.3 → 0.2.4
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 +8 -8
- package/dist/index.d.cts +252 -1
- package/dist/index.d.ts +252 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,7 +10,7 @@ The waitlist-entries endpoint can be called unauthenticated from a marketing-sit
|
|
|
10
10
|
|
|
11
11
|
## Quick start — accept a signup from a public form
|
|
12
12
|
|
|
13
|
-
```ts
|
|
13
|
+
```ts before
|
|
14
14
|
import { Waitlist } from "@productcraft/waitlist";
|
|
15
15
|
|
|
16
16
|
// No auth — public surface
|
|
@@ -37,7 +37,7 @@ If the waitlist has `settings.recaptcha_site_key` set, also pass a `recaptcha_to
|
|
|
37
37
|
|
|
38
38
|
## Quick start — workspace-admin (authenticated)
|
|
39
39
|
|
|
40
|
-
```ts
|
|
40
|
+
```ts before
|
|
41
41
|
import { Waitlist } from "@productcraft/waitlist";
|
|
42
42
|
|
|
43
43
|
// Reads PRODUCTCRAFT_API_KEY from the environment
|
|
@@ -70,7 +70,7 @@ PRODUCTCRAFT_API_KEY=pcft_live_...
|
|
|
70
70
|
|
|
71
71
|
## Configuration
|
|
72
72
|
|
|
73
|
-
```ts
|
|
73
|
+
```ts before
|
|
74
74
|
new Waitlist({
|
|
75
75
|
// Optional: required for workspace-admin calls. Public submit works without auth.
|
|
76
76
|
// Omit to use PRODUCTCRAFT_API_KEY from the environment
|
|
@@ -86,7 +86,7 @@ new Waitlist({
|
|
|
86
86
|
|
|
87
87
|
### Public surface
|
|
88
88
|
|
|
89
|
-
```ts
|
|
89
|
+
```ts before
|
|
90
90
|
// Read the waitlist's public metadata (name, position-window, active variant, ...)
|
|
91
91
|
await waitlist.client.GET(
|
|
92
92
|
"/v1/waitlists/{workspace_slug}/{waitlist_slug}",
|
|
@@ -102,7 +102,7 @@ await waitlist.client.GET(
|
|
|
102
102
|
|
|
103
103
|
### Entries (workspace-admin)
|
|
104
104
|
|
|
105
|
-
```ts
|
|
105
|
+
```ts before
|
|
106
106
|
// List entries
|
|
107
107
|
await waitlist.client.GET(
|
|
108
108
|
"/v1/workspaces/{workspace_id}/waitlists/{waitlist_id}/entries",
|
|
@@ -138,7 +138,7 @@ await waitlist.client.GET(
|
|
|
138
138
|
|
|
139
139
|
Variants split two ways: `kind: "ab"` for split-traffic A/B/n tests, or `kind: "locale"` for per-locale copy switching. Pick one; the body shape is `{ kind, slug, locale? }`.
|
|
140
140
|
|
|
141
|
-
```ts
|
|
141
|
+
```ts before
|
|
142
142
|
// A/B variant
|
|
143
143
|
await waitlist.client.POST(
|
|
144
144
|
"/v1/workspaces/{workspace_id}/waitlists/{waitlist_id}/variants",
|
|
@@ -162,7 +162,7 @@ Front-end picks up the active variant from `GET /v1/waitlists/:workspace_slug/:w
|
|
|
162
162
|
|
|
163
163
|
### Analytics
|
|
164
164
|
|
|
165
|
-
```ts
|
|
165
|
+
```ts before
|
|
166
166
|
// Conversion + per-variant counts
|
|
167
167
|
await waitlist.client.GET(
|
|
168
168
|
"/v1/workspaces/{workspace_id}/waitlists/{waitlist_id}/analytics",
|
|
@@ -184,7 +184,7 @@ await waitlist.client.GET(
|
|
|
184
184
|
|
|
185
185
|
### Webhooks
|
|
186
186
|
|
|
187
|
-
```ts
|
|
187
|
+
```ts before
|
|
188
188
|
// Subscribe to entry.created / entry.approved / entry.rejected
|
|
189
189
|
await waitlist.client.POST(
|
|
190
190
|
"/v1/workspaces/{workspace_id}/webhooks",
|
package/dist/index.d.cts
CHANGED
|
@@ -925,10 +925,136 @@ interface components {
|
|
|
925
925
|
*/
|
|
926
926
|
state: "ready" | "incomplete" | "off";
|
|
927
927
|
};
|
|
928
|
+
/**
|
|
929
|
+
* EntryApprovedEvent
|
|
930
|
+
* @description An entry was approved: by you, or automatically when the waitlist does not need approval. Every real delivery also carries the keys of the previous webhook body (`event`, `occurred_at`, `entry`) until its sunset; read `type`, `created_at` and `data` instead.
|
|
931
|
+
* @example {
|
|
932
|
+
* "created_at": "2026-11-05T09:00:00.000Z",
|
|
933
|
+
* "data": {
|
|
934
|
+
* "entry": {
|
|
935
|
+
* "created_at": "2026-10-17T10:00:00.000Z",
|
|
936
|
+
* "email": "ada@example.com",
|
|
937
|
+
* "id": "1d0b7828-0e1a-407b-8706-aeb7ff619088",
|
|
938
|
+
* "is_test": false,
|
|
939
|
+
* "name": "Ada Lovelace",
|
|
940
|
+
* "position": 4,
|
|
941
|
+
* "referral_code": "464QTHE0",
|
|
942
|
+
* "referral_count": 0,
|
|
943
|
+
* "referred_by_entry_id": null,
|
|
944
|
+
* "status": "approved",
|
|
945
|
+
* "updated_at": "2026-10-17T10:00:00.000Z"
|
|
946
|
+
* },
|
|
947
|
+
* "waitlist_id": "33a8b309-8753-4f08-90d7-9dc484eff392"
|
|
948
|
+
* },
|
|
949
|
+
* "id": "evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f",
|
|
950
|
+
* "type": "entry.approved",
|
|
951
|
+
* "waitlist_id": "33a8b309-8753-4f08-90d7-9dc484eff392",
|
|
952
|
+
* "workspace_id": "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
|
|
953
|
+
* }
|
|
954
|
+
*/
|
|
955
|
+
EntryApprovedEvent: {
|
|
956
|
+
/**
|
|
957
|
+
* Format: date-time
|
|
958
|
+
* @description When the event happened (the same on every retry).
|
|
959
|
+
* @example 2026-11-05T09:00:00.000Z
|
|
960
|
+
*/
|
|
961
|
+
created_at: string;
|
|
962
|
+
data: components["schemas"]["EntryEventDataDto"];
|
|
963
|
+
/**
|
|
964
|
+
* @description The event id, also sent as `webhook-id`; the same on every retry and replay.
|
|
965
|
+
* @example evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
966
|
+
*/
|
|
967
|
+
id: string;
|
|
968
|
+
/** @description Present and true only on a delivery made by "Send test"; its `data` is the catalogue example. */
|
|
969
|
+
test?: boolean;
|
|
970
|
+
/**
|
|
971
|
+
* @description The event type. Switch on it to narrow the event.
|
|
972
|
+
* @enum {string}
|
|
973
|
+
*/
|
|
974
|
+
type: "entry.approved";
|
|
975
|
+
/**
|
|
976
|
+
* Format: uuid
|
|
977
|
+
* @description The waitlist, so you can route without opening `data` (also in `data.waitlist_id`). Absent on "Send test" deliveries.
|
|
978
|
+
*/
|
|
979
|
+
waitlist_id?: string;
|
|
980
|
+
/**
|
|
981
|
+
* Format: uuid
|
|
982
|
+
* @description The workspace the waitlist belongs to. Absent on "Send test" deliveries.
|
|
983
|
+
*/
|
|
984
|
+
workspace_id?: string;
|
|
985
|
+
};
|
|
928
986
|
EntryCountResponseDto: {
|
|
929
987
|
/** @description Number of entries on the waitlist. Test entries are left out unless `include_test=true`. */
|
|
930
988
|
count: number;
|
|
931
989
|
};
|
|
990
|
+
/**
|
|
991
|
+
* EntryCreatedEvent
|
|
992
|
+
* @description Someone joined a waitlist. On a waitlist that does not need approval, entry.approved follows straight away. Every real delivery also carries the keys of the previous webhook body (`event`, `occurred_at`, `entry`) until its sunset; read `type`, `created_at` and `data` instead.
|
|
993
|
+
* @example {
|
|
994
|
+
* "created_at": "2026-11-05T09:00:00.000Z",
|
|
995
|
+
* "data": {
|
|
996
|
+
* "entry": {
|
|
997
|
+
* "created_at": "2026-10-17T10:00:00.000Z",
|
|
998
|
+
* "email": "ada@example.com",
|
|
999
|
+
* "id": "1d0b7828-0e1a-407b-8706-aeb7ff619088",
|
|
1000
|
+
* "is_test": false,
|
|
1001
|
+
* "name": "Ada Lovelace",
|
|
1002
|
+
* "position": 4,
|
|
1003
|
+
* "referral_code": "464QTHE0",
|
|
1004
|
+
* "referral_count": 0,
|
|
1005
|
+
* "referred_by_entry_id": null,
|
|
1006
|
+
* "status": "pending",
|
|
1007
|
+
* "updated_at": "2026-10-17T10:00:00.000Z"
|
|
1008
|
+
* },
|
|
1009
|
+
* "waitlist_id": "33a8b309-8753-4f08-90d7-9dc484eff392"
|
|
1010
|
+
* },
|
|
1011
|
+
* "id": "evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f",
|
|
1012
|
+
* "type": "entry.created",
|
|
1013
|
+
* "waitlist_id": "33a8b309-8753-4f08-90d7-9dc484eff392",
|
|
1014
|
+
* "workspace_id": "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
|
|
1015
|
+
* }
|
|
1016
|
+
*/
|
|
1017
|
+
EntryCreatedEvent: {
|
|
1018
|
+
/**
|
|
1019
|
+
* Format: date-time
|
|
1020
|
+
* @description When the event happened (the same on every retry).
|
|
1021
|
+
* @example 2026-11-05T09:00:00.000Z
|
|
1022
|
+
*/
|
|
1023
|
+
created_at: string;
|
|
1024
|
+
data: components["schemas"]["EntryEventDataDto"];
|
|
1025
|
+
/**
|
|
1026
|
+
* @description The event id, also sent as `webhook-id`; the same on every retry and replay.
|
|
1027
|
+
* @example evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
1028
|
+
*/
|
|
1029
|
+
id: string;
|
|
1030
|
+
/** @description Present and true only on a delivery made by "Send test"; its `data` is the catalogue example. */
|
|
1031
|
+
test?: boolean;
|
|
1032
|
+
/**
|
|
1033
|
+
* @description The event type. Switch on it to narrow the event.
|
|
1034
|
+
* @enum {string}
|
|
1035
|
+
*/
|
|
1036
|
+
type: "entry.created";
|
|
1037
|
+
/**
|
|
1038
|
+
* Format: uuid
|
|
1039
|
+
* @description The waitlist, so you can route without opening `data` (also in `data.waitlist_id`). Absent on "Send test" deliveries.
|
|
1040
|
+
*/
|
|
1041
|
+
waitlist_id?: string;
|
|
1042
|
+
/**
|
|
1043
|
+
* Format: uuid
|
|
1044
|
+
* @description The workspace the waitlist belongs to. Absent on "Send test" deliveries.
|
|
1045
|
+
*/
|
|
1046
|
+
workspace_id?: string;
|
|
1047
|
+
};
|
|
1048
|
+
EntryEventDataDto: {
|
|
1049
|
+
/** @description The entry, as it is after the event. */
|
|
1050
|
+
entry: components["schemas"]["WebhookEntryDto"];
|
|
1051
|
+
/**
|
|
1052
|
+
* Format: uuid
|
|
1053
|
+
* @description The waitlist the entry belongs to.
|
|
1054
|
+
* @example 33a8b309-8753-4f08-90d7-9dc484eff392
|
|
1055
|
+
*/
|
|
1056
|
+
waitlist_id: string;
|
|
1057
|
+
};
|
|
932
1058
|
EntryListPaginationDto: {
|
|
933
1059
|
has_more: boolean;
|
|
934
1060
|
next_cursor: string | null;
|
|
@@ -937,6 +1063,64 @@ interface components {
|
|
|
937
1063
|
data: components["schemas"]["EntryResponseDto"][];
|
|
938
1064
|
pagination: components["schemas"]["EntryListPaginationDto"];
|
|
939
1065
|
};
|
|
1066
|
+
/**
|
|
1067
|
+
* EntryRejectedEvent
|
|
1068
|
+
* @description An entry was rejected. Every real delivery also carries the keys of the previous webhook body (`event`, `occurred_at`, `entry`) until its sunset; read `type`, `created_at` and `data` instead.
|
|
1069
|
+
* @example {
|
|
1070
|
+
* "created_at": "2026-11-05T09:00:00.000Z",
|
|
1071
|
+
* "data": {
|
|
1072
|
+
* "entry": {
|
|
1073
|
+
* "created_at": "2026-10-17T10:00:00.000Z",
|
|
1074
|
+
* "email": "ada@example.com",
|
|
1075
|
+
* "id": "1d0b7828-0e1a-407b-8706-aeb7ff619088",
|
|
1076
|
+
* "is_test": false,
|
|
1077
|
+
* "name": "Ada Lovelace",
|
|
1078
|
+
* "position": 4,
|
|
1079
|
+
* "referral_code": "464QTHE0",
|
|
1080
|
+
* "referral_count": 0,
|
|
1081
|
+
* "referred_by_entry_id": null,
|
|
1082
|
+
* "status": "rejected",
|
|
1083
|
+
* "updated_at": "2026-10-17T10:00:00.000Z"
|
|
1084
|
+
* },
|
|
1085
|
+
* "waitlist_id": "33a8b309-8753-4f08-90d7-9dc484eff392"
|
|
1086
|
+
* },
|
|
1087
|
+
* "id": "evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f",
|
|
1088
|
+
* "type": "entry.rejected",
|
|
1089
|
+
* "waitlist_id": "33a8b309-8753-4f08-90d7-9dc484eff392",
|
|
1090
|
+
* "workspace_id": "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
|
|
1091
|
+
* }
|
|
1092
|
+
*/
|
|
1093
|
+
EntryRejectedEvent: {
|
|
1094
|
+
/**
|
|
1095
|
+
* Format: date-time
|
|
1096
|
+
* @description When the event happened (the same on every retry).
|
|
1097
|
+
* @example 2026-11-05T09:00:00.000Z
|
|
1098
|
+
*/
|
|
1099
|
+
created_at: string;
|
|
1100
|
+
data: components["schemas"]["EntryEventDataDto"];
|
|
1101
|
+
/**
|
|
1102
|
+
* @description The event id, also sent as `webhook-id`; the same on every retry and replay.
|
|
1103
|
+
* @example evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
1104
|
+
*/
|
|
1105
|
+
id: string;
|
|
1106
|
+
/** @description Present and true only on a delivery made by "Send test"; its `data` is the catalogue example. */
|
|
1107
|
+
test?: boolean;
|
|
1108
|
+
/**
|
|
1109
|
+
* @description The event type. Switch on it to narrow the event.
|
|
1110
|
+
* @enum {string}
|
|
1111
|
+
*/
|
|
1112
|
+
type: "entry.rejected";
|
|
1113
|
+
/**
|
|
1114
|
+
* Format: uuid
|
|
1115
|
+
* @description The waitlist, so you can route without opening `data` (also in `data.waitlist_id`). Absent on "Send test" deliveries.
|
|
1116
|
+
*/
|
|
1117
|
+
waitlist_id?: string;
|
|
1118
|
+
/**
|
|
1119
|
+
* Format: uuid
|
|
1120
|
+
* @description The workspace the waitlist belongs to. Absent on "Send test" deliveries.
|
|
1121
|
+
*/
|
|
1122
|
+
workspace_id?: string;
|
|
1123
|
+
};
|
|
940
1124
|
EntryResponseDto: {
|
|
941
1125
|
created_at: string;
|
|
942
1126
|
email: string;
|
|
@@ -963,6 +1147,8 @@ interface components {
|
|
|
963
1147
|
waitlist_id: string;
|
|
964
1148
|
workspace_id: string;
|
|
965
1149
|
};
|
|
1150
|
+
/** @enum {string} */
|
|
1151
|
+
EntryStatus: "pending" | "approved" | "rejected";
|
|
966
1152
|
ErrorParamDto: {
|
|
967
1153
|
/**
|
|
968
1154
|
* @description The failed rule (class-validator constraint name, e.g. `isEmail`, `isUuid`, `whitelistValidation` for a field the operation does not declare), or `invalid`.
|
|
@@ -1800,6 +1986,68 @@ interface components {
|
|
|
1800
1986
|
*/
|
|
1801
1987
|
url: string;
|
|
1802
1988
|
};
|
|
1989
|
+
WebhookEntryDto: {
|
|
1990
|
+
/**
|
|
1991
|
+
* Format: date-time
|
|
1992
|
+
* @description When the entry was created.
|
|
1993
|
+
* @example 2026-10-17T10:00:00.000Z
|
|
1994
|
+
*/
|
|
1995
|
+
created_at: string;
|
|
1996
|
+
/**
|
|
1997
|
+
* Format: email
|
|
1998
|
+
* @description The email address that signed up.
|
|
1999
|
+
* @example ada@example.com
|
|
2000
|
+
*/
|
|
2001
|
+
email: string;
|
|
2002
|
+
/**
|
|
2003
|
+
* Format: uuid
|
|
2004
|
+
* @description The entry id.
|
|
2005
|
+
* @example 1d0b7828-0e1a-407b-8706-aeb7ff619088
|
|
2006
|
+
*/
|
|
2007
|
+
id: string;
|
|
2008
|
+
/**
|
|
2009
|
+
* @description True for an entry made with "Add test signup" (those send no webhooks unless asked).
|
|
2010
|
+
* @example false
|
|
2011
|
+
*/
|
|
2012
|
+
is_test: boolean;
|
|
2013
|
+
/**
|
|
2014
|
+
* @description The name given at signup.
|
|
2015
|
+
* @example Ada Lovelace
|
|
2016
|
+
*/
|
|
2017
|
+
name: string;
|
|
2018
|
+
/**
|
|
2019
|
+
* @description Place in the queue, 1 first.
|
|
2020
|
+
* @example 4
|
|
2021
|
+
*/
|
|
2022
|
+
position: number;
|
|
2023
|
+
/**
|
|
2024
|
+
* @description The code this entry shares to refer others.
|
|
2025
|
+
* @example 464QTHE0
|
|
2026
|
+
*/
|
|
2027
|
+
referral_code: string;
|
|
2028
|
+
/**
|
|
2029
|
+
* @description How many signups used this entry's referral code.
|
|
2030
|
+
* @example 0
|
|
2031
|
+
*/
|
|
2032
|
+
referral_count: number;
|
|
2033
|
+
/**
|
|
2034
|
+
* Format: uuid
|
|
2035
|
+
* @description The entry whose referral code this one signed up with; null when none.
|
|
2036
|
+
* @example null
|
|
2037
|
+
*/
|
|
2038
|
+
referred_by_entry_id: string | null;
|
|
2039
|
+
/**
|
|
2040
|
+
* @description Review status after this event: `pending`, `approved` or `rejected`.
|
|
2041
|
+
* @example pending
|
|
2042
|
+
*/
|
|
2043
|
+
status: components["schemas"]["EntryStatus"];
|
|
2044
|
+
/**
|
|
2045
|
+
* Format: date-time
|
|
2046
|
+
* @description When the entry last changed.
|
|
2047
|
+
* @example 2026-10-17T10:00:00.000Z
|
|
2048
|
+
*/
|
|
2049
|
+
updated_at: string;
|
|
2050
|
+
};
|
|
1803
2051
|
WebhookEventDeliveryDto: {
|
|
1804
2052
|
/** @description Number of the latest attempt; retries and replays count up. */
|
|
1805
2053
|
attempt_number: number;
|
|
@@ -1881,7 +2129,10 @@ interface components {
|
|
|
1881
2129
|
};
|
|
1882
2130
|
/** @enum {string} */
|
|
1883
2131
|
WebhookEventStatus: "pending" | "delivered" | "failed" | "not_sent";
|
|
1884
|
-
/**
|
|
2132
|
+
/**
|
|
2133
|
+
* @description Every event type this product sends; `x-webhooks` maps each to its payload schema. New types can be added, so treat it as open.
|
|
2134
|
+
* @enum {string}
|
|
2135
|
+
*/
|
|
1885
2136
|
WebhookEventType: "entry.created" | "entry.approved" | "entry.rejected";
|
|
1886
2137
|
WebhookEventTypeDto: {
|
|
1887
2138
|
/**
|
package/dist/index.d.ts
CHANGED
|
@@ -925,10 +925,136 @@ interface components {
|
|
|
925
925
|
*/
|
|
926
926
|
state: "ready" | "incomplete" | "off";
|
|
927
927
|
};
|
|
928
|
+
/**
|
|
929
|
+
* EntryApprovedEvent
|
|
930
|
+
* @description An entry was approved: by you, or automatically when the waitlist does not need approval. Every real delivery also carries the keys of the previous webhook body (`event`, `occurred_at`, `entry`) until its sunset; read `type`, `created_at` and `data` instead.
|
|
931
|
+
* @example {
|
|
932
|
+
* "created_at": "2026-11-05T09:00:00.000Z",
|
|
933
|
+
* "data": {
|
|
934
|
+
* "entry": {
|
|
935
|
+
* "created_at": "2026-10-17T10:00:00.000Z",
|
|
936
|
+
* "email": "ada@example.com",
|
|
937
|
+
* "id": "1d0b7828-0e1a-407b-8706-aeb7ff619088",
|
|
938
|
+
* "is_test": false,
|
|
939
|
+
* "name": "Ada Lovelace",
|
|
940
|
+
* "position": 4,
|
|
941
|
+
* "referral_code": "464QTHE0",
|
|
942
|
+
* "referral_count": 0,
|
|
943
|
+
* "referred_by_entry_id": null,
|
|
944
|
+
* "status": "approved",
|
|
945
|
+
* "updated_at": "2026-10-17T10:00:00.000Z"
|
|
946
|
+
* },
|
|
947
|
+
* "waitlist_id": "33a8b309-8753-4f08-90d7-9dc484eff392"
|
|
948
|
+
* },
|
|
949
|
+
* "id": "evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f",
|
|
950
|
+
* "type": "entry.approved",
|
|
951
|
+
* "waitlist_id": "33a8b309-8753-4f08-90d7-9dc484eff392",
|
|
952
|
+
* "workspace_id": "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
|
|
953
|
+
* }
|
|
954
|
+
*/
|
|
955
|
+
EntryApprovedEvent: {
|
|
956
|
+
/**
|
|
957
|
+
* Format: date-time
|
|
958
|
+
* @description When the event happened (the same on every retry).
|
|
959
|
+
* @example 2026-11-05T09:00:00.000Z
|
|
960
|
+
*/
|
|
961
|
+
created_at: string;
|
|
962
|
+
data: components["schemas"]["EntryEventDataDto"];
|
|
963
|
+
/**
|
|
964
|
+
* @description The event id, also sent as `webhook-id`; the same on every retry and replay.
|
|
965
|
+
* @example evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
966
|
+
*/
|
|
967
|
+
id: string;
|
|
968
|
+
/** @description Present and true only on a delivery made by "Send test"; its `data` is the catalogue example. */
|
|
969
|
+
test?: boolean;
|
|
970
|
+
/**
|
|
971
|
+
* @description The event type. Switch on it to narrow the event.
|
|
972
|
+
* @enum {string}
|
|
973
|
+
*/
|
|
974
|
+
type: "entry.approved";
|
|
975
|
+
/**
|
|
976
|
+
* Format: uuid
|
|
977
|
+
* @description The waitlist, so you can route without opening `data` (also in `data.waitlist_id`). Absent on "Send test" deliveries.
|
|
978
|
+
*/
|
|
979
|
+
waitlist_id?: string;
|
|
980
|
+
/**
|
|
981
|
+
* Format: uuid
|
|
982
|
+
* @description The workspace the waitlist belongs to. Absent on "Send test" deliveries.
|
|
983
|
+
*/
|
|
984
|
+
workspace_id?: string;
|
|
985
|
+
};
|
|
928
986
|
EntryCountResponseDto: {
|
|
929
987
|
/** @description Number of entries on the waitlist. Test entries are left out unless `include_test=true`. */
|
|
930
988
|
count: number;
|
|
931
989
|
};
|
|
990
|
+
/**
|
|
991
|
+
* EntryCreatedEvent
|
|
992
|
+
* @description Someone joined a waitlist. On a waitlist that does not need approval, entry.approved follows straight away. Every real delivery also carries the keys of the previous webhook body (`event`, `occurred_at`, `entry`) until its sunset; read `type`, `created_at` and `data` instead.
|
|
993
|
+
* @example {
|
|
994
|
+
* "created_at": "2026-11-05T09:00:00.000Z",
|
|
995
|
+
* "data": {
|
|
996
|
+
* "entry": {
|
|
997
|
+
* "created_at": "2026-10-17T10:00:00.000Z",
|
|
998
|
+
* "email": "ada@example.com",
|
|
999
|
+
* "id": "1d0b7828-0e1a-407b-8706-aeb7ff619088",
|
|
1000
|
+
* "is_test": false,
|
|
1001
|
+
* "name": "Ada Lovelace",
|
|
1002
|
+
* "position": 4,
|
|
1003
|
+
* "referral_code": "464QTHE0",
|
|
1004
|
+
* "referral_count": 0,
|
|
1005
|
+
* "referred_by_entry_id": null,
|
|
1006
|
+
* "status": "pending",
|
|
1007
|
+
* "updated_at": "2026-10-17T10:00:00.000Z"
|
|
1008
|
+
* },
|
|
1009
|
+
* "waitlist_id": "33a8b309-8753-4f08-90d7-9dc484eff392"
|
|
1010
|
+
* },
|
|
1011
|
+
* "id": "evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f",
|
|
1012
|
+
* "type": "entry.created",
|
|
1013
|
+
* "waitlist_id": "33a8b309-8753-4f08-90d7-9dc484eff392",
|
|
1014
|
+
* "workspace_id": "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
|
|
1015
|
+
* }
|
|
1016
|
+
*/
|
|
1017
|
+
EntryCreatedEvent: {
|
|
1018
|
+
/**
|
|
1019
|
+
* Format: date-time
|
|
1020
|
+
* @description When the event happened (the same on every retry).
|
|
1021
|
+
* @example 2026-11-05T09:00:00.000Z
|
|
1022
|
+
*/
|
|
1023
|
+
created_at: string;
|
|
1024
|
+
data: components["schemas"]["EntryEventDataDto"];
|
|
1025
|
+
/**
|
|
1026
|
+
* @description The event id, also sent as `webhook-id`; the same on every retry and replay.
|
|
1027
|
+
* @example evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
1028
|
+
*/
|
|
1029
|
+
id: string;
|
|
1030
|
+
/** @description Present and true only on a delivery made by "Send test"; its `data` is the catalogue example. */
|
|
1031
|
+
test?: boolean;
|
|
1032
|
+
/**
|
|
1033
|
+
* @description The event type. Switch on it to narrow the event.
|
|
1034
|
+
* @enum {string}
|
|
1035
|
+
*/
|
|
1036
|
+
type: "entry.created";
|
|
1037
|
+
/**
|
|
1038
|
+
* Format: uuid
|
|
1039
|
+
* @description The waitlist, so you can route without opening `data` (also in `data.waitlist_id`). Absent on "Send test" deliveries.
|
|
1040
|
+
*/
|
|
1041
|
+
waitlist_id?: string;
|
|
1042
|
+
/**
|
|
1043
|
+
* Format: uuid
|
|
1044
|
+
* @description The workspace the waitlist belongs to. Absent on "Send test" deliveries.
|
|
1045
|
+
*/
|
|
1046
|
+
workspace_id?: string;
|
|
1047
|
+
};
|
|
1048
|
+
EntryEventDataDto: {
|
|
1049
|
+
/** @description The entry, as it is after the event. */
|
|
1050
|
+
entry: components["schemas"]["WebhookEntryDto"];
|
|
1051
|
+
/**
|
|
1052
|
+
* Format: uuid
|
|
1053
|
+
* @description The waitlist the entry belongs to.
|
|
1054
|
+
* @example 33a8b309-8753-4f08-90d7-9dc484eff392
|
|
1055
|
+
*/
|
|
1056
|
+
waitlist_id: string;
|
|
1057
|
+
};
|
|
932
1058
|
EntryListPaginationDto: {
|
|
933
1059
|
has_more: boolean;
|
|
934
1060
|
next_cursor: string | null;
|
|
@@ -937,6 +1063,64 @@ interface components {
|
|
|
937
1063
|
data: components["schemas"]["EntryResponseDto"][];
|
|
938
1064
|
pagination: components["schemas"]["EntryListPaginationDto"];
|
|
939
1065
|
};
|
|
1066
|
+
/**
|
|
1067
|
+
* EntryRejectedEvent
|
|
1068
|
+
* @description An entry was rejected. Every real delivery also carries the keys of the previous webhook body (`event`, `occurred_at`, `entry`) until its sunset; read `type`, `created_at` and `data` instead.
|
|
1069
|
+
* @example {
|
|
1070
|
+
* "created_at": "2026-11-05T09:00:00.000Z",
|
|
1071
|
+
* "data": {
|
|
1072
|
+
* "entry": {
|
|
1073
|
+
* "created_at": "2026-10-17T10:00:00.000Z",
|
|
1074
|
+
* "email": "ada@example.com",
|
|
1075
|
+
* "id": "1d0b7828-0e1a-407b-8706-aeb7ff619088",
|
|
1076
|
+
* "is_test": false,
|
|
1077
|
+
* "name": "Ada Lovelace",
|
|
1078
|
+
* "position": 4,
|
|
1079
|
+
* "referral_code": "464QTHE0",
|
|
1080
|
+
* "referral_count": 0,
|
|
1081
|
+
* "referred_by_entry_id": null,
|
|
1082
|
+
* "status": "rejected",
|
|
1083
|
+
* "updated_at": "2026-10-17T10:00:00.000Z"
|
|
1084
|
+
* },
|
|
1085
|
+
* "waitlist_id": "33a8b309-8753-4f08-90d7-9dc484eff392"
|
|
1086
|
+
* },
|
|
1087
|
+
* "id": "evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f",
|
|
1088
|
+
* "type": "entry.rejected",
|
|
1089
|
+
* "waitlist_id": "33a8b309-8753-4f08-90d7-9dc484eff392",
|
|
1090
|
+
* "workspace_id": "9b2f6c1e-0d6a-4a63-9a43-2f1c3e4d5a6b"
|
|
1091
|
+
* }
|
|
1092
|
+
*/
|
|
1093
|
+
EntryRejectedEvent: {
|
|
1094
|
+
/**
|
|
1095
|
+
* Format: date-time
|
|
1096
|
+
* @description When the event happened (the same on every retry).
|
|
1097
|
+
* @example 2026-11-05T09:00:00.000Z
|
|
1098
|
+
*/
|
|
1099
|
+
created_at: string;
|
|
1100
|
+
data: components["schemas"]["EntryEventDataDto"];
|
|
1101
|
+
/**
|
|
1102
|
+
* @description The event id, also sent as `webhook-id`; the same on every retry and replay.
|
|
1103
|
+
* @example evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
|
|
1104
|
+
*/
|
|
1105
|
+
id: string;
|
|
1106
|
+
/** @description Present and true only on a delivery made by "Send test"; its `data` is the catalogue example. */
|
|
1107
|
+
test?: boolean;
|
|
1108
|
+
/**
|
|
1109
|
+
* @description The event type. Switch on it to narrow the event.
|
|
1110
|
+
* @enum {string}
|
|
1111
|
+
*/
|
|
1112
|
+
type: "entry.rejected";
|
|
1113
|
+
/**
|
|
1114
|
+
* Format: uuid
|
|
1115
|
+
* @description The waitlist, so you can route without opening `data` (also in `data.waitlist_id`). Absent on "Send test" deliveries.
|
|
1116
|
+
*/
|
|
1117
|
+
waitlist_id?: string;
|
|
1118
|
+
/**
|
|
1119
|
+
* Format: uuid
|
|
1120
|
+
* @description The workspace the waitlist belongs to. Absent on "Send test" deliveries.
|
|
1121
|
+
*/
|
|
1122
|
+
workspace_id?: string;
|
|
1123
|
+
};
|
|
940
1124
|
EntryResponseDto: {
|
|
941
1125
|
created_at: string;
|
|
942
1126
|
email: string;
|
|
@@ -963,6 +1147,8 @@ interface components {
|
|
|
963
1147
|
waitlist_id: string;
|
|
964
1148
|
workspace_id: string;
|
|
965
1149
|
};
|
|
1150
|
+
/** @enum {string} */
|
|
1151
|
+
EntryStatus: "pending" | "approved" | "rejected";
|
|
966
1152
|
ErrorParamDto: {
|
|
967
1153
|
/**
|
|
968
1154
|
* @description The failed rule (class-validator constraint name, e.g. `isEmail`, `isUuid`, `whitelistValidation` for a field the operation does not declare), or `invalid`.
|
|
@@ -1800,6 +1986,68 @@ interface components {
|
|
|
1800
1986
|
*/
|
|
1801
1987
|
url: string;
|
|
1802
1988
|
};
|
|
1989
|
+
WebhookEntryDto: {
|
|
1990
|
+
/**
|
|
1991
|
+
* Format: date-time
|
|
1992
|
+
* @description When the entry was created.
|
|
1993
|
+
* @example 2026-10-17T10:00:00.000Z
|
|
1994
|
+
*/
|
|
1995
|
+
created_at: string;
|
|
1996
|
+
/**
|
|
1997
|
+
* Format: email
|
|
1998
|
+
* @description The email address that signed up.
|
|
1999
|
+
* @example ada@example.com
|
|
2000
|
+
*/
|
|
2001
|
+
email: string;
|
|
2002
|
+
/**
|
|
2003
|
+
* Format: uuid
|
|
2004
|
+
* @description The entry id.
|
|
2005
|
+
* @example 1d0b7828-0e1a-407b-8706-aeb7ff619088
|
|
2006
|
+
*/
|
|
2007
|
+
id: string;
|
|
2008
|
+
/**
|
|
2009
|
+
* @description True for an entry made with "Add test signup" (those send no webhooks unless asked).
|
|
2010
|
+
* @example false
|
|
2011
|
+
*/
|
|
2012
|
+
is_test: boolean;
|
|
2013
|
+
/**
|
|
2014
|
+
* @description The name given at signup.
|
|
2015
|
+
* @example Ada Lovelace
|
|
2016
|
+
*/
|
|
2017
|
+
name: string;
|
|
2018
|
+
/**
|
|
2019
|
+
* @description Place in the queue, 1 first.
|
|
2020
|
+
* @example 4
|
|
2021
|
+
*/
|
|
2022
|
+
position: number;
|
|
2023
|
+
/**
|
|
2024
|
+
* @description The code this entry shares to refer others.
|
|
2025
|
+
* @example 464QTHE0
|
|
2026
|
+
*/
|
|
2027
|
+
referral_code: string;
|
|
2028
|
+
/**
|
|
2029
|
+
* @description How many signups used this entry's referral code.
|
|
2030
|
+
* @example 0
|
|
2031
|
+
*/
|
|
2032
|
+
referral_count: number;
|
|
2033
|
+
/**
|
|
2034
|
+
* Format: uuid
|
|
2035
|
+
* @description The entry whose referral code this one signed up with; null when none.
|
|
2036
|
+
* @example null
|
|
2037
|
+
*/
|
|
2038
|
+
referred_by_entry_id: string | null;
|
|
2039
|
+
/**
|
|
2040
|
+
* @description Review status after this event: `pending`, `approved` or `rejected`.
|
|
2041
|
+
* @example pending
|
|
2042
|
+
*/
|
|
2043
|
+
status: components["schemas"]["EntryStatus"];
|
|
2044
|
+
/**
|
|
2045
|
+
* Format: date-time
|
|
2046
|
+
* @description When the entry last changed.
|
|
2047
|
+
* @example 2026-10-17T10:00:00.000Z
|
|
2048
|
+
*/
|
|
2049
|
+
updated_at: string;
|
|
2050
|
+
};
|
|
1803
2051
|
WebhookEventDeliveryDto: {
|
|
1804
2052
|
/** @description Number of the latest attempt; retries and replays count up. */
|
|
1805
2053
|
attempt_number: number;
|
|
@@ -1881,7 +2129,10 @@ interface components {
|
|
|
1881
2129
|
};
|
|
1882
2130
|
/** @enum {string} */
|
|
1883
2131
|
WebhookEventStatus: "pending" | "delivered" | "failed" | "not_sent";
|
|
1884
|
-
/**
|
|
2132
|
+
/**
|
|
2133
|
+
* @description Every event type this product sends; `x-webhooks` maps each to its payload schema. New types can be added, so treat it as open.
|
|
2134
|
+
* @enum {string}
|
|
2135
|
+
*/
|
|
1885
2136
|
WebhookEventType: "entry.created" | "entry.approved" | "entry.rejected";
|
|
1886
2137
|
WebhookEventTypeDto: {
|
|
1887
2138
|
/**
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@productcraft/waitlist",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.4",
|
|
4
4
|
"description": "Waitlist management — public-form signups, variants for A/B/n landing pages, referrals, position + leaderboard, approval workflow with invite-to-app, signed outbound webhooks, CSV export. Generated from the production OpenAPI spec.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "./dist/index.cjs",
|