@productcraft/waitlist 0.2.2 → 0.2.3

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/index.d.cts CHANGED
@@ -850,7 +850,10 @@ interface components {
850
850
  url: string;
851
851
  };
852
852
  CreateWebhookEndpointDto: {
853
- /** @example Production receiver */
853
+ /**
854
+ * @description A label for people.
855
+ * @example Production receiver
856
+ */
854
857
  description?: string | null;
855
858
  /**
856
859
  * @description Create it switched off.
@@ -1054,15 +1057,19 @@ interface components {
1054
1057
  webhook_id: string;
1055
1058
  };
1056
1059
  ListWebhookEndpointsResponseDto: {
1060
+ /** @description The endpoints, newest first. */
1057
1061
  data: components["schemas"]["WebhookEndpointDto"][];
1058
1062
  /** @description Always one page (an endpoint limit applies). */
1059
1063
  pagination: components["schemas"]["WebhookPaginationDto"];
1060
1064
  };
1061
1065
  ListWebhookEventTypesResponseDto: {
1066
+ /** @description Every event type this product sends. */
1062
1067
  data: components["schemas"]["WebhookEventTypeDto"][];
1063
1068
  };
1064
1069
  ListWebhookEventsResponseDto: {
1070
+ /** @description The events, newest first. */
1065
1071
  data: components["schemas"]["WebhookEventDto"][];
1072
+ /** @description The cursor for the next page. */
1066
1073
  pagination: components["schemas"]["WebhookPaginationDto"];
1067
1074
  };
1068
1075
  NotificationTestResponseDto: {
@@ -1222,6 +1229,7 @@ interface components {
1222
1229
  ReplayWebhookEventResponseDto: {
1223
1230
  /** @description One attempt per endpoint it was sent to. */
1224
1231
  attempts: components["schemas"]["WebhookDeliveryAttemptDto"][];
1232
+ /** @description The replayed event (the same id as the original). */
1225
1233
  event_id: string;
1226
1234
  };
1227
1235
  RotateWebhookSecretDto: {
@@ -1338,6 +1346,7 @@ interface components {
1338
1346
  url?: string;
1339
1347
  };
1340
1348
  UpdateWebhookEndpointDto: {
1349
+ /** @description A new label; null clears it. */
1341
1350
  description?: string | null;
1342
1351
  /** @description Switch it on or off. Switching on also clears an automatic disable. */
1343
1352
  enabled?: boolean;
@@ -1345,6 +1354,7 @@ interface components {
1345
1354
  event_types?: ("entry.created" | "entry.approved" | "entry.rejected")[];
1346
1355
  /**
1347
1356
  * Format: uri
1357
+ * @description A new absolute https:// URL on a public host.
1348
1358
  * @example https://api.acme.com/webhooks
1349
1359
  */
1350
1360
  url?: string;
@@ -1394,7 +1404,7 @@ interface components {
1394
1404
  waitlist_id: string;
1395
1405
  };
1396
1406
  /** @description Error codes this API returns (open set: a client must accept codes it does not know; new codes are not a breaking change). Each is documented at https://productcraft.co/docs/errors#<code>. */
1397
- WaitlistErrorCode: ("BAD_REQUEST" | "VALIDATION_ERROR" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "REQUEST_TIMEOUT" | "CONFLICT" | "GONE" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "UNPROCESSABLE_ENTITY" | "PRECONDITION_REQUIRED" | "RATE_LIMITED" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "SERVICE_NOT_ENABLED" | "INVALID_CREDENTIALS" | "SESSION_REVOKED" | "MCP_NOT_PERMITTED" | "MCP_WORKSPACE_MISMATCH" | "PAK_NOT_PERMITTED" | "ACTIONS_NOT_GRANTABLE" | "IDEMPOTENCY_KEY_REUSE" | "IDEMPOTENCY_KEY_REQUIRED" | "WEBHOOK_ENDPOINT_LIMIT" | "WEBHOOK_ENDPOINT_NOT_FOUND" | "WEBHOOK_ENDPOINT_NOT_SUBSCRIBED" | "WEBHOOK_EVENT_NOT_FOUND" | "WEBHOOK_EVENT_TYPE_UNKNOWN" | "MAIL_UNREACHABLE" | "ORIGIN_NOT_ALLOWED" | "WAITLIST_NOT_FOUND" | "domain_not_verified_by_provider" | "from_domain_not_verified" | "no_default_sender") | string;
1407
+ WaitlistErrorCode: ("BAD_REQUEST" | "VALIDATION_ERROR" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "REQUEST_TIMEOUT" | "CONFLICT" | "GONE" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "UNPROCESSABLE_ENTITY" | "PRECONDITION_REQUIRED" | "RATE_LIMITED" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "SERVICE_NOT_ENABLED" | "INVALID_CREDENTIALS" | "SESSION_REVOKED" | "MCP_NOT_PERMITTED" | "MCP_WORKSPACE_MISMATCH" | "PAK_NOT_PERMITTED" | "ACTIONS_NOT_GRANTABLE" | "IDEMPOTENCY_KEY_REUSE" | "IDEMPOTENCY_KEY_REQUIRED" | "IDEMPOTENCY_IN_PROGRESS" | "WEBHOOK_ENDPOINT_LIMIT" | "WEBHOOK_ENDPOINT_NOT_FOUND" | "WEBHOOK_ENDPOINT_NOT_SUBSCRIBED" | "WEBHOOK_EVENT_NOT_FOUND" | "WEBHOOK_EVENT_TYPE_UNKNOWN" | "MAIL_UNREACHABLE" | "ORIGIN_NOT_ALLOWED" | "WAITLIST_NOT_FOUND" | "domain_not_verified_by_provider" | "from_domain_not_verified" | "no_default_sender") | string;
1398
1408
  WaitlistListPaginationDto: {
1399
1409
  has_more: boolean;
1400
1410
  next_cursor: string | null;
@@ -1557,6 +1567,8 @@ interface components {
1557
1567
  */
1558
1568
  window: "1d" | "7d" | "30d";
1559
1569
  };
1570
+ /** @enum {string} */
1571
+ WebhookAttemptTrigger: "automatic" | "replay" | "test";
1560
1572
  WebhookCreateResponseDto: {
1561
1573
  /** @description Whether it receives events (`enabled` on the new routes). */
1562
1574
  active: boolean;
@@ -1585,18 +1597,37 @@ interface components {
1585
1597
  WebhookDeliveryAttemptDto: {
1586
1598
  /** @description 1 for the first delivery; retries and replays count up. */
1587
1599
  attempt_number: number;
1588
- /** Format: date-time */
1600
+ /**
1601
+ * Format: date-time
1602
+ * @description When the attempt was made.
1603
+ */
1589
1604
  attempted_at: string;
1590
- /** Format: uuid */
1605
+ /**
1606
+ * Format: uuid
1607
+ * @description The endpoint it was delivered to.
1608
+ */
1591
1609
  endpoint_id: string;
1592
- /** @example request timed out */
1610
+ /**
1611
+ * @description Why the attempt failed when no 2xx came back; null on success.
1612
+ * @example request timed out
1613
+ */
1593
1614
  error_message: string | null;
1594
- /** @example evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f */
1615
+ /**
1616
+ * @description The event that was delivered.
1617
+ * @example evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
1618
+ */
1595
1619
  event_id: string;
1596
- /** @example user.created */
1620
+ /**
1621
+ * @description The event's type.
1622
+ * @example user.created
1623
+ */
1597
1624
  event_type: string;
1598
- /** Format: uuid */
1625
+ /**
1626
+ * Format: uuid
1627
+ * @description The attempt's id.
1628
+ */
1599
1629
  id: string;
1630
+ /** @description Milliseconds until the response; null when none came back. */
1600
1631
  latency_ms: number | null;
1601
1632
  /** @description The first 1 KiB of the response body. */
1602
1633
  response_body: string | null;
@@ -1604,11 +1635,8 @@ interface components {
1604
1635
  status_code: number | null;
1605
1636
  /** @description True for a 2xx response. */
1606
1637
  succeeded: boolean;
1607
- /**
1608
- * @description `automatic` (first delivery or a retry), `replay` or `test`.
1609
- * @enum {string}
1610
- */
1611
- trigger: "automatic" | "replay" | "test";
1638
+ /** @description `automatic` (first delivery or a retry), `replay` or `test`. */
1639
+ trigger: components["schemas"]["WebhookAttemptTrigger"];
1612
1640
  /**
1613
1641
  * Format: uri
1614
1642
  * @description Where it was sent.
@@ -1619,17 +1647,28 @@ interface components {
1619
1647
  data: components["schemas"]["LegacyWebhookDeliveryAttemptDto"][];
1620
1648
  pagination: components["schemas"]["PaginationDto"];
1621
1649
  };
1650
+ /** @enum {string} */
1651
+ WebhookEndpointDisabledReason: "manual" | "failing";
1622
1652
  WebhookEndpointDto: {
1623
1653
  /** @description Failed automatic deliveries in a row; a success resets it. */
1624
1654
  consecutive_failures: number;
1625
- /** Format: date-time */
1655
+ /**
1656
+ * Format: date-time
1657
+ * @description When the endpoint was created.
1658
+ */
1626
1659
  created_at: string;
1627
- /** @example Production receiver */
1660
+ /**
1661
+ * @description A label for people; null when unset.
1662
+ * @example Production receiver
1663
+ */
1628
1664
  description: string | null;
1629
- /** Format: date-time */
1665
+ /**
1666
+ * Format: date-time
1667
+ * @description When it was switched off; null while enabled.
1668
+ */
1630
1669
  disabled_at: string | null;
1631
- /** @enum {string|null} */
1632
- disabled_reason: "manual" | "failing" | null;
1670
+ /** @description `manual`: switched off by a caller. `failing`: switched off automatically after failed deliveries. Null while enabled. */
1671
+ disabled_reason: components["schemas"]["WebhookEndpointDisabledReason"] | null;
1633
1672
  /** @description The on/off switch (`PATCH … { enabled }`). */
1634
1673
  enabled: boolean;
1635
1674
  /**
@@ -1642,7 +1681,10 @@ interface components {
1642
1681
  * @description Start of the current failure streak.
1643
1682
  */
1644
1683
  first_failure_at: string | null;
1645
- /** Format: uuid */
1684
+ /**
1685
+ * Format: uuid
1686
+ * @description The endpoint's id.
1687
+ */
1646
1688
  id: string;
1647
1689
  /** @description True for endpoints carried over from the product's previous webhook system: they also receive the old signature header until its sunset date. */
1648
1690
  legacy_signature: boolean;
@@ -1665,30 +1707,42 @@ interface components {
1665
1707
  * @example x9Q=
1666
1708
  */
1667
1709
  signing_secret_hint: string;
1710
+ /** @description `enabled` receives events. `disabled` was switched off. `auto_disabled` was switched off after 20 failed deliveries in a row or 24 hours of failures; `PATCH { enabled: true }` turns it back on. */
1711
+ status: components["schemas"]["WebhookEndpointStatus"];
1668
1712
  /**
1669
- * @description `enabled` receives events. `disabled` was switched off. `auto_disabled` was switched off after 20 failed deliveries in a row or 24 hours of failures; `PATCH { enabled: true }` turns it back on.
1670
- * @enum {string}
1713
+ * Format: date-time
1714
+ * @description When the endpoint last changed.
1671
1715
  */
1672
- status: "enabled" | "disabled" | "auto_disabled";
1673
- /** Format: date-time */
1674
1716
  updated_at: string;
1675
1717
  /**
1676
1718
  * Format: uri
1719
+ * @description Where events are sent.
1677
1720
  * @example https://api.acme.com/webhooks
1678
1721
  */
1679
1722
  url: string;
1680
1723
  };
1724
+ /** @enum {string} */
1725
+ WebhookEndpointStatus: "enabled" | "disabled" | "auto_disabled";
1681
1726
  WebhookEndpointWithSecretDto: {
1682
1727
  /** @description Failed automatic deliveries in a row; a success resets it. */
1683
1728
  consecutive_failures: number;
1684
- /** Format: date-time */
1729
+ /**
1730
+ * Format: date-time
1731
+ * @description When the endpoint was created.
1732
+ */
1685
1733
  created_at: string;
1686
- /** @example Production receiver */
1734
+ /**
1735
+ * @description A label for people; null when unset.
1736
+ * @example Production receiver
1737
+ */
1687
1738
  description: string | null;
1688
- /** Format: date-time */
1739
+ /**
1740
+ * Format: date-time
1741
+ * @description When it was switched off; null while enabled.
1742
+ */
1689
1743
  disabled_at: string | null;
1690
- /** @enum {string|null} */
1691
- disabled_reason: "manual" | "failing" | null;
1744
+ /** @description `manual`: switched off by a caller. `failing`: switched off automatically after failed deliveries. Null while enabled. */
1745
+ disabled_reason: components["schemas"]["WebhookEndpointDisabledReason"] | null;
1692
1746
  /** @description The on/off switch (`PATCH … { enabled }`). */
1693
1747
  enabled: boolean;
1694
1748
  /**
@@ -1701,7 +1755,10 @@ interface components {
1701
1755
  * @description Start of the current failure streak.
1702
1756
  */
1703
1757
  first_failure_at: string | null;
1704
- /** Format: uuid */
1758
+ /**
1759
+ * Format: uuid
1760
+ * @description The endpoint's id.
1761
+ */
1705
1762
  id: string;
1706
1763
  /** @description True for endpoints carried over from the product's previous webhook system: they also receive the old signature header until its sunset date. */
1707
1764
  legacy_signature: boolean;
@@ -1729,15 +1786,16 @@ interface components {
1729
1786
  * @example x9Q=
1730
1787
  */
1731
1788
  signing_secret_hint: string;
1789
+ /** @description `enabled` receives events. `disabled` was switched off. `auto_disabled` was switched off after 20 failed deliveries in a row or 24 hours of failures; `PATCH { enabled: true }` turns it back on. */
1790
+ status: components["schemas"]["WebhookEndpointStatus"];
1732
1791
  /**
1733
- * @description `enabled` receives events. `disabled` was switched off. `auto_disabled` was switched off after 20 failed deliveries in a row or 24 hours of failures; `PATCH { enabled: true }` turns it back on.
1734
- * @enum {string}
1792
+ * Format: date-time
1793
+ * @description When the endpoint last changed.
1735
1794
  */
1736
- status: "enabled" | "disabled" | "auto_disabled";
1737
- /** Format: date-time */
1738
1795
  updated_at: string;
1739
1796
  /**
1740
1797
  * Format: uri
1798
+ * @description Where events are sent.
1741
1799
  * @example https://api.acme.com/webhooks
1742
1800
  */
1743
1801
  url: string;
@@ -1745,15 +1803,22 @@ interface components {
1745
1803
  WebhookEventDeliveryDto: {
1746
1804
  /** @description Number of the latest attempt; retries and replays count up. */
1747
1805
  attempt_number: number;
1748
- /** Format: date-time */
1806
+ /**
1807
+ * Format: date-time
1808
+ * @description When the latest attempt was made.
1809
+ */
1749
1810
  attempted_at: string;
1750
- /** Format: uuid */
1811
+ /**
1812
+ * Format: uuid
1813
+ * @description The endpoint.
1814
+ */
1751
1815
  endpoint_id: string;
1752
1816
  /**
1753
1817
  * Format: date-time
1754
1818
  * @description When the next automatic attempt is due; null when none is queued.
1755
1819
  */
1756
1820
  next_attempt_at: string | null;
1821
+ /** @description HTTP status of the latest attempt; null when no response came back. */
1757
1822
  status_code: number | null;
1758
1823
  /** @description True when the latest attempt got a 2xx. */
1759
1824
  succeeded: boolean;
@@ -1761,7 +1826,10 @@ interface components {
1761
1826
  WebhookEventDetailDto: {
1762
1827
  /** @description Every attempt, newest first. */
1763
1828
  attempts: components["schemas"]["WebhookDeliveryAttemptDto"][];
1764
- /** Format: date-time */
1829
+ /**
1830
+ * Format: date-time
1831
+ * @description When the event happened.
1832
+ */
1765
1833
  created_at: string;
1766
1834
  /** @description Latest attempt per endpoint (an endpoint whose first attempt is still queued is not listed yet). */
1767
1835
  deliveries: components["schemas"]["WebhookEventDeliveryDto"][];
@@ -1774,21 +1842,21 @@ interface components {
1774
1842
  payload: {
1775
1843
  [key: string]: unknown;
1776
1844
  };
1777
- /**
1778
- * @description `pending`: a delivery is queued. `failed`: the latest attempt to some endpoint failed and none is queued. `delivered`: every endpoint answered 2xx. `not_sent`: no endpoint subscribed.
1779
- * @enum {string}
1780
- */
1781
- status: "pending" | "delivered" | "failed" | "not_sent";
1845
+ /** @description `pending`: a delivery is queued. `failed`: the latest attempt to some endpoint failed and none is queued. `delivered`: every endpoint answered 2xx. `not_sent`: no endpoint subscribed. */
1846
+ status: components["schemas"]["WebhookEventStatus"];
1782
1847
  /** @description Made by "Send test". */
1783
1848
  test: boolean;
1784
1849
  /**
1850
+ * @description The event type (one of this product's catalogue).
1785
1851
  * @example entry.created
1786
- * @enum {string}
1787
1852
  */
1788
- type: "entry.created" | "entry.approved" | "entry.rejected";
1853
+ type: components["schemas"]["WebhookEventType"];
1789
1854
  };
1790
1855
  WebhookEventDto: {
1791
- /** Format: date-time */
1856
+ /**
1857
+ * Format: date-time
1858
+ * @description When the event happened.
1859
+ */
1792
1860
  created_at: string;
1793
1861
  /** @description Latest attempt per endpoint (an endpoint whose first attempt is still queued is not listed yet). */
1794
1862
  deliveries: components["schemas"]["WebhookEventDeliveryDto"][];
@@ -1801,36 +1869,40 @@ interface components {
1801
1869
  payload: {
1802
1870
  [key: string]: unknown;
1803
1871
  };
1804
- /**
1805
- * @description `pending`: a delivery is queued. `failed`: the latest attempt to some endpoint failed and none is queued. `delivered`: every endpoint answered 2xx. `not_sent`: no endpoint subscribed.
1806
- * @enum {string}
1807
- */
1808
- status: "pending" | "delivered" | "failed" | "not_sent";
1872
+ /** @description `pending`: a delivery is queued. `failed`: the latest attempt to some endpoint failed and none is queued. `delivered`: every endpoint answered 2xx. `not_sent`: no endpoint subscribed. */
1873
+ status: components["schemas"]["WebhookEventStatus"];
1809
1874
  /** @description Made by "Send test". */
1810
1875
  test: boolean;
1811
1876
  /**
1877
+ * @description The event type (one of this product's catalogue).
1812
1878
  * @example entry.created
1813
- * @enum {string}
1814
1879
  */
1815
- type: "entry.created" | "entry.approved" | "entry.rejected";
1880
+ type: components["schemas"]["WebhookEventType"];
1816
1881
  };
1882
+ /** @enum {string} */
1883
+ WebhookEventStatus: "pending" | "delivered" | "failed" | "not_sent";
1884
+ /** @enum {string} */
1885
+ WebhookEventType: "entry.created" | "entry.approved" | "entry.rejected";
1817
1886
  WebhookEventTypeDto: {
1818
1887
  /**
1819
1888
  * @description Group shown in the event picker.
1820
1889
  * @example Users
1821
1890
  */
1822
1891
  category: string;
1823
- /** @example A user signed up or was created by an admin. */
1892
+ /**
1893
+ * @description When this event is sent.
1894
+ * @example A user signed up or was created by an admin.
1895
+ */
1824
1896
  description: string;
1825
1897
  /** @description An example `data` object; "Send test" delivers exactly this. */
1826
1898
  example: {
1827
1899
  [key: string]: unknown;
1828
1900
  };
1829
1901
  /**
1902
+ * @description The event type (one of this product's catalogue).
1830
1903
  * @example entry.created
1831
- * @enum {string}
1832
1904
  */
1833
- type: "entry.created" | "entry.approved" | "entry.rejected";
1905
+ type: components["schemas"]["WebhookEventType"];
1834
1906
  };
1835
1907
  WebhookListResponseDto: {
1836
1908
  data: components["schemas"]["WebhookResponseDto"][];
@@ -2238,6 +2310,8 @@ interface operations {
2238
2310
  /** @description Accepted by Mail and queued for delivery. */
2239
2311
  202: {
2240
2312
  headers: {
2313
+ /** @description `true` when this response is a replay of an earlier request with the same `Idempotency-Key`. */
2314
+ "Idempotent-Replay"?: "true";
2241
2315
  "X-Request-Id": components["headers"]["RequestId"];
2242
2316
  [name: string]: unknown;
2243
2317
  };
@@ -2285,9 +2359,11 @@ interface operations {
2285
2359
  "application/json": components["schemas"]["ErrorResponseDto"];
2286
2360
  };
2287
2361
  };
2288
- /** @description Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). */
2362
+ /** @description Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key). */
2289
2363
  409: {
2290
2364
  headers: {
2365
+ /** @description Seconds to wait before retrying with the same key (sent with `IDEMPOTENCY_IN_PROGRESS`). */
2366
+ "Retry-After"?: number;
2291
2367
  "X-Request-Id": components["headers"]["RequestId"];
2292
2368
  [name: string]: unknown;
2293
2369
  };
@@ -2387,6 +2463,8 @@ interface operations {
2387
2463
  /** @description Waitlist created. */
2388
2464
  201: {
2389
2465
  headers: {
2466
+ /** @description `true` when this response is a replay of an earlier request with the same `Idempotency-Key`. */
2467
+ "Idempotent-Replay"?: "true";
2390
2468
  "X-Request-Id": components["headers"]["RequestId"];
2391
2469
  [name: string]: unknown;
2392
2470
  };
@@ -2414,9 +2492,11 @@ interface operations {
2414
2492
  "application/json": components["schemas"]["ErrorResponseDto"];
2415
2493
  };
2416
2494
  };
2417
- /** @description Slug already taken in this workspace. */
2495
+ /** @description Slug already taken in this workspace. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key). */
2418
2496
  409: {
2419
2497
  headers: {
2498
+ /** @description Seconds to wait before retrying with the same key (sent with `IDEMPOTENCY_IN_PROGRESS`). */
2499
+ "Retry-After"?: number;
2420
2500
  "X-Request-Id": components["headers"]["RequestId"];
2421
2501
  [name: string]: unknown;
2422
2502
  };
@@ -3114,6 +3194,8 @@ interface operations {
3114
3194
  /** @description Test entry created. */
3115
3195
  201: {
3116
3196
  headers: {
3197
+ /** @description `true` when this response is a replay of an earlier request with the same `Idempotency-Key`. */
3198
+ "Idempotent-Replay"?: "true";
3117
3199
  "X-Request-Id": components["headers"]["RequestId"];
3118
3200
  [name: string]: unknown;
3119
3201
  };
@@ -3151,9 +3233,11 @@ interface operations {
3151
3233
  "application/json": components["schemas"]["ErrorResponseDto"];
3152
3234
  };
3153
3235
  };
3154
- /** @description Idempotency-Key reused with a different body. */
3236
+ /** @description Idempotency-Key reused with a different body. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key). */
3155
3237
  409: {
3156
3238
  headers: {
3239
+ /** @description Seconds to wait before retrying with the same key (sent with `IDEMPOTENCY_IN_PROGRESS`). */
3240
+ "Retry-After"?: number;
3157
3241
  "X-Request-Id": components["headers"]["RequestId"];
3158
3242
  [name: string]: unknown;
3159
3243
  };
@@ -3401,6 +3485,8 @@ interface operations {
3401
3485
  /** @description Webhook created. Includes plaintext `signing_secret` exactly once. */
3402
3486
  201: {
3403
3487
  headers: {
3488
+ /** @description `true` when this response is a replay of an earlier request with the same `Idempotency-Key`. */
3489
+ "Idempotent-Replay"?: "true";
3404
3490
  "X-Request-Id": components["headers"]["RequestId"];
3405
3491
  [name: string]: unknown;
3406
3492
  };
@@ -3408,9 +3494,11 @@ interface operations {
3408
3494
  "application/json": components["schemas"]["WebhookCreateResponseDto"];
3409
3495
  };
3410
3496
  };
3411
- /** @description The workspace already has 10 webhooks. */
3497
+ /** @description The workspace already has 10 webhooks. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key). */
3412
3498
  409: {
3413
3499
  headers: {
3500
+ /** @description Seconds to wait before retrying with the same key (sent with `IDEMPOTENCY_IN_PROGRESS`). */
3501
+ "Retry-After"?: number;
3414
3502
  "X-Request-Id": components["headers"]["RequestId"];
3415
3503
  [name: string]: unknown;
3416
3504
  };
@@ -3492,6 +3580,8 @@ interface operations {
3492
3580
  responses: {
3493
3581
  201: {
3494
3582
  headers: {
3583
+ /** @description `true` when this response is a replay of an earlier request with the same `Idempotency-Key`. */
3584
+ "Idempotent-Replay"?: "true";
3495
3585
  "X-Request-Id": components["headers"]["RequestId"];
3496
3586
  [name: string]: unknown;
3497
3587
  };
@@ -3529,9 +3619,11 @@ interface operations {
3529
3619
  "application/json": components["schemas"]["ErrorResponseDto"];
3530
3620
  };
3531
3621
  };
3532
- /** @description Already 10 endpoints (`WEBHOOK_ENDPOINT_LIMIT`), or Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). */
3622
+ /** @description Already 10 endpoints (`WEBHOOK_ENDPOINT_LIMIT`), or Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key). */
3533
3623
  409: {
3534
3624
  headers: {
3625
+ /** @description Seconds to wait before retrying with the same key (sent with `IDEMPOTENCY_IN_PROGRESS`). */
3626
+ "Retry-After"?: number;
3535
3627
  "X-Request-Id": components["headers"]["RequestId"];
3536
3628
  [name: string]: unknown;
3537
3629
  };
@@ -3697,6 +3789,8 @@ interface operations {
3697
3789
  responses: {
3698
3790
  200: {
3699
3791
  headers: {
3792
+ /** @description `true` when this response is a replay of an earlier request with the same `Idempotency-Key`. */
3793
+ "Idempotent-Replay"?: "true";
3700
3794
  "X-Request-Id": components["headers"]["RequestId"];
3701
3795
  [name: string]: unknown;
3702
3796
  };
@@ -3744,9 +3838,11 @@ interface operations {
3744
3838
  "application/json": components["schemas"]["ErrorResponseDto"];
3745
3839
  };
3746
3840
  };
3747
- /** @description Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). */
3841
+ /** @description Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key). */
3748
3842
  409: {
3749
3843
  headers: {
3844
+ /** @description Seconds to wait before retrying with the same key (sent with `IDEMPOTENCY_IN_PROGRESS`). */
3845
+ "Retry-After"?: number;
3750
3846
  "X-Request-Id": components["headers"]["RequestId"];
3751
3847
  [name: string]: unknown;
3752
3848
  };
@@ -3787,6 +3883,8 @@ interface operations {
3787
3883
  responses: {
3788
3884
  200: {
3789
3885
  headers: {
3886
+ /** @description `true` when this response is a replay of an earlier request with the same `Idempotency-Key`. */
3887
+ "Idempotent-Replay"?: "true";
3790
3888
  "X-Request-Id": components["headers"]["RequestId"];
3791
3889
  [name: string]: unknown;
3792
3890
  };
@@ -3834,9 +3932,11 @@ interface operations {
3834
3932
  "application/json": components["schemas"]["ErrorResponseDto"];
3835
3933
  };
3836
3934
  };
3837
- /** @description Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). */
3935
+ /** @description Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key). */
3838
3936
  409: {
3839
3937
  headers: {
3938
+ /** @description Seconds to wait before retrying with the same key (sent with `IDEMPOTENCY_IN_PROGRESS`). */
3939
+ "Retry-After"?: number;
3840
3940
  "X-Request-Id": components["headers"]["RequestId"];
3841
3941
  [name: string]: unknown;
3842
3942
  };
@@ -3868,6 +3968,8 @@ interface operations {
3868
3968
  /** @description The attempt, successful or not. */
3869
3969
  200: {
3870
3970
  headers: {
3971
+ /** @description `true` when this response is a replay of an earlier request with the same `Idempotency-Key`. */
3972
+ "Idempotent-Replay"?: "true";
3871
3973
  "X-Request-Id": components["headers"]["RequestId"];
3872
3974
  [name: string]: unknown;
3873
3975
  };
@@ -3915,9 +4017,11 @@ interface operations {
3915
4017
  "application/json": components["schemas"]["ErrorResponseDto"];
3916
4018
  };
3917
4019
  };
3918
- /** @description Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). */
4020
+ /** @description Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key). */
3919
4021
  409: {
3920
4022
  headers: {
4023
+ /** @description Seconds to wait before retrying with the same key (sent with `IDEMPOTENCY_IN_PROGRESS`). */
4024
+ "Retry-After"?: number;
3921
4025
  "X-Request-Id": components["headers"]["RequestId"];
3922
4026
  [name: string]: unknown;
3923
4027
  };
@@ -3976,11 +4080,13 @@ interface operations {
3976
4080
  type?: ("entry.created" | "entry.approved" | "entry.rejected")[];
3977
4081
  /** @description Only events sent (or queued) to this endpoint. */
3978
4082
  endpoint_id?: string;
3979
- status?: "pending" | "delivered" | "failed" | "not_sent";
4083
+ /** @description Only events in this delivery status. */
4084
+ status?: components["schemas"]["WebhookEventStatus"];
3980
4085
  /** @description Only events created at or after this instant. */
3981
4086
  created_after?: string;
3982
4087
  /** @description Only events created before this instant. */
3983
4088
  created_before?: string;
4089
+ /** @description Page size. */
3984
4090
  limit?: number;
3985
4091
  /** @description The previous page's `pagination.next_cursor`. */
3986
4092
  cursor?: string;
@@ -4119,6 +4225,8 @@ interface operations {
4119
4225
  responses: {
4120
4226
  200: {
4121
4227
  headers: {
4228
+ /** @description `true` when this response is a replay of an earlier request with the same `Idempotency-Key`. */
4229
+ "Idempotent-Replay"?: "true";
4122
4230
  "X-Request-Id": components["headers"]["RequestId"];
4123
4231
  [name: string]: unknown;
4124
4232
  };
@@ -4166,9 +4274,11 @@ interface operations {
4166
4274
  "application/json": components["schemas"]["ErrorResponseDto"];
4167
4275
  };
4168
4276
  };
4169
- /** @description `endpoint_id` is switched off or does not receive this event type (`WEBHOOK_ENDPOINT_NOT_SUBSCRIBED`), or Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). */
4277
+ /** @description `endpoint_id` is switched off or does not receive this event type (`WEBHOOK_ENDPOINT_NOT_SUBSCRIBED`), or Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key). */
4170
4278
  409: {
4171
4279
  headers: {
4280
+ /** @description Seconds to wait before retrying with the same key (sent with `IDEMPOTENCY_IN_PROGRESS`). */
4281
+ "Retry-After"?: number;
4172
4282
  "X-Request-Id": components["headers"]["RequestId"];
4173
4283
  [name: string]: unknown;
4174
4284
  };
package/dist/index.d.ts CHANGED
@@ -850,7 +850,10 @@ interface components {
850
850
  url: string;
851
851
  };
852
852
  CreateWebhookEndpointDto: {
853
- /** @example Production receiver */
853
+ /**
854
+ * @description A label for people.
855
+ * @example Production receiver
856
+ */
854
857
  description?: string | null;
855
858
  /**
856
859
  * @description Create it switched off.
@@ -1054,15 +1057,19 @@ interface components {
1054
1057
  webhook_id: string;
1055
1058
  };
1056
1059
  ListWebhookEndpointsResponseDto: {
1060
+ /** @description The endpoints, newest first. */
1057
1061
  data: components["schemas"]["WebhookEndpointDto"][];
1058
1062
  /** @description Always one page (an endpoint limit applies). */
1059
1063
  pagination: components["schemas"]["WebhookPaginationDto"];
1060
1064
  };
1061
1065
  ListWebhookEventTypesResponseDto: {
1066
+ /** @description Every event type this product sends. */
1062
1067
  data: components["schemas"]["WebhookEventTypeDto"][];
1063
1068
  };
1064
1069
  ListWebhookEventsResponseDto: {
1070
+ /** @description The events, newest first. */
1065
1071
  data: components["schemas"]["WebhookEventDto"][];
1072
+ /** @description The cursor for the next page. */
1066
1073
  pagination: components["schemas"]["WebhookPaginationDto"];
1067
1074
  };
1068
1075
  NotificationTestResponseDto: {
@@ -1222,6 +1229,7 @@ interface components {
1222
1229
  ReplayWebhookEventResponseDto: {
1223
1230
  /** @description One attempt per endpoint it was sent to. */
1224
1231
  attempts: components["schemas"]["WebhookDeliveryAttemptDto"][];
1232
+ /** @description The replayed event (the same id as the original). */
1225
1233
  event_id: string;
1226
1234
  };
1227
1235
  RotateWebhookSecretDto: {
@@ -1338,6 +1346,7 @@ interface components {
1338
1346
  url?: string;
1339
1347
  };
1340
1348
  UpdateWebhookEndpointDto: {
1349
+ /** @description A new label; null clears it. */
1341
1350
  description?: string | null;
1342
1351
  /** @description Switch it on or off. Switching on also clears an automatic disable. */
1343
1352
  enabled?: boolean;
@@ -1345,6 +1354,7 @@ interface components {
1345
1354
  event_types?: ("entry.created" | "entry.approved" | "entry.rejected")[];
1346
1355
  /**
1347
1356
  * Format: uri
1357
+ * @description A new absolute https:// URL on a public host.
1348
1358
  * @example https://api.acme.com/webhooks
1349
1359
  */
1350
1360
  url?: string;
@@ -1394,7 +1404,7 @@ interface components {
1394
1404
  waitlist_id: string;
1395
1405
  };
1396
1406
  /** @description Error codes this API returns (open set: a client must accept codes it does not know; new codes are not a breaking change). Each is documented at https://productcraft.co/docs/errors#<code>. */
1397
- WaitlistErrorCode: ("BAD_REQUEST" | "VALIDATION_ERROR" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "REQUEST_TIMEOUT" | "CONFLICT" | "GONE" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "UNPROCESSABLE_ENTITY" | "PRECONDITION_REQUIRED" | "RATE_LIMITED" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "SERVICE_NOT_ENABLED" | "INVALID_CREDENTIALS" | "SESSION_REVOKED" | "MCP_NOT_PERMITTED" | "MCP_WORKSPACE_MISMATCH" | "PAK_NOT_PERMITTED" | "ACTIONS_NOT_GRANTABLE" | "IDEMPOTENCY_KEY_REUSE" | "IDEMPOTENCY_KEY_REQUIRED" | "WEBHOOK_ENDPOINT_LIMIT" | "WEBHOOK_ENDPOINT_NOT_FOUND" | "WEBHOOK_ENDPOINT_NOT_SUBSCRIBED" | "WEBHOOK_EVENT_NOT_FOUND" | "WEBHOOK_EVENT_TYPE_UNKNOWN" | "MAIL_UNREACHABLE" | "ORIGIN_NOT_ALLOWED" | "WAITLIST_NOT_FOUND" | "domain_not_verified_by_provider" | "from_domain_not_verified" | "no_default_sender") | string;
1407
+ WaitlistErrorCode: ("BAD_REQUEST" | "VALIDATION_ERROR" | "UNAUTHORIZED" | "PAYMENT_REQUIRED" | "FORBIDDEN" | "NOT_FOUND" | "METHOD_NOT_ALLOWED" | "NOT_ACCEPTABLE" | "REQUEST_TIMEOUT" | "CONFLICT" | "GONE" | "PRECONDITION_FAILED" | "PAYLOAD_TOO_LARGE" | "UNSUPPORTED_MEDIA_TYPE" | "UNPROCESSABLE_ENTITY" | "PRECONDITION_REQUIRED" | "RATE_LIMITED" | "INTERNAL_SERVER_ERROR" | "NOT_IMPLEMENTED" | "BAD_GATEWAY" | "SERVICE_UNAVAILABLE" | "GATEWAY_TIMEOUT" | "SERVICE_NOT_ENABLED" | "INVALID_CREDENTIALS" | "SESSION_REVOKED" | "MCP_NOT_PERMITTED" | "MCP_WORKSPACE_MISMATCH" | "PAK_NOT_PERMITTED" | "ACTIONS_NOT_GRANTABLE" | "IDEMPOTENCY_KEY_REUSE" | "IDEMPOTENCY_KEY_REQUIRED" | "IDEMPOTENCY_IN_PROGRESS" | "WEBHOOK_ENDPOINT_LIMIT" | "WEBHOOK_ENDPOINT_NOT_FOUND" | "WEBHOOK_ENDPOINT_NOT_SUBSCRIBED" | "WEBHOOK_EVENT_NOT_FOUND" | "WEBHOOK_EVENT_TYPE_UNKNOWN" | "MAIL_UNREACHABLE" | "ORIGIN_NOT_ALLOWED" | "WAITLIST_NOT_FOUND" | "domain_not_verified_by_provider" | "from_domain_not_verified" | "no_default_sender") | string;
1398
1408
  WaitlistListPaginationDto: {
1399
1409
  has_more: boolean;
1400
1410
  next_cursor: string | null;
@@ -1557,6 +1567,8 @@ interface components {
1557
1567
  */
1558
1568
  window: "1d" | "7d" | "30d";
1559
1569
  };
1570
+ /** @enum {string} */
1571
+ WebhookAttemptTrigger: "automatic" | "replay" | "test";
1560
1572
  WebhookCreateResponseDto: {
1561
1573
  /** @description Whether it receives events (`enabled` on the new routes). */
1562
1574
  active: boolean;
@@ -1585,18 +1597,37 @@ interface components {
1585
1597
  WebhookDeliveryAttemptDto: {
1586
1598
  /** @description 1 for the first delivery; retries and replays count up. */
1587
1599
  attempt_number: number;
1588
- /** Format: date-time */
1600
+ /**
1601
+ * Format: date-time
1602
+ * @description When the attempt was made.
1603
+ */
1589
1604
  attempted_at: string;
1590
- /** Format: uuid */
1605
+ /**
1606
+ * Format: uuid
1607
+ * @description The endpoint it was delivered to.
1608
+ */
1591
1609
  endpoint_id: string;
1592
- /** @example request timed out */
1610
+ /**
1611
+ * @description Why the attempt failed when no 2xx came back; null on success.
1612
+ * @example request timed out
1613
+ */
1593
1614
  error_message: string | null;
1594
- /** @example evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f */
1615
+ /**
1616
+ * @description The event that was delivered.
1617
+ * @example evt_3f0c3c1e-8a2b-4c55-9d3f-0a1b2c3d4e5f
1618
+ */
1595
1619
  event_id: string;
1596
- /** @example user.created */
1620
+ /**
1621
+ * @description The event's type.
1622
+ * @example user.created
1623
+ */
1597
1624
  event_type: string;
1598
- /** Format: uuid */
1625
+ /**
1626
+ * Format: uuid
1627
+ * @description The attempt's id.
1628
+ */
1599
1629
  id: string;
1630
+ /** @description Milliseconds until the response; null when none came back. */
1600
1631
  latency_ms: number | null;
1601
1632
  /** @description The first 1 KiB of the response body. */
1602
1633
  response_body: string | null;
@@ -1604,11 +1635,8 @@ interface components {
1604
1635
  status_code: number | null;
1605
1636
  /** @description True for a 2xx response. */
1606
1637
  succeeded: boolean;
1607
- /**
1608
- * @description `automatic` (first delivery or a retry), `replay` or `test`.
1609
- * @enum {string}
1610
- */
1611
- trigger: "automatic" | "replay" | "test";
1638
+ /** @description `automatic` (first delivery or a retry), `replay` or `test`. */
1639
+ trigger: components["schemas"]["WebhookAttemptTrigger"];
1612
1640
  /**
1613
1641
  * Format: uri
1614
1642
  * @description Where it was sent.
@@ -1619,17 +1647,28 @@ interface components {
1619
1647
  data: components["schemas"]["LegacyWebhookDeliveryAttemptDto"][];
1620
1648
  pagination: components["schemas"]["PaginationDto"];
1621
1649
  };
1650
+ /** @enum {string} */
1651
+ WebhookEndpointDisabledReason: "manual" | "failing";
1622
1652
  WebhookEndpointDto: {
1623
1653
  /** @description Failed automatic deliveries in a row; a success resets it. */
1624
1654
  consecutive_failures: number;
1625
- /** Format: date-time */
1655
+ /**
1656
+ * Format: date-time
1657
+ * @description When the endpoint was created.
1658
+ */
1626
1659
  created_at: string;
1627
- /** @example Production receiver */
1660
+ /**
1661
+ * @description A label for people; null when unset.
1662
+ * @example Production receiver
1663
+ */
1628
1664
  description: string | null;
1629
- /** Format: date-time */
1665
+ /**
1666
+ * Format: date-time
1667
+ * @description When it was switched off; null while enabled.
1668
+ */
1630
1669
  disabled_at: string | null;
1631
- /** @enum {string|null} */
1632
- disabled_reason: "manual" | "failing" | null;
1670
+ /** @description `manual`: switched off by a caller. `failing`: switched off automatically after failed deliveries. Null while enabled. */
1671
+ disabled_reason: components["schemas"]["WebhookEndpointDisabledReason"] | null;
1633
1672
  /** @description The on/off switch (`PATCH … { enabled }`). */
1634
1673
  enabled: boolean;
1635
1674
  /**
@@ -1642,7 +1681,10 @@ interface components {
1642
1681
  * @description Start of the current failure streak.
1643
1682
  */
1644
1683
  first_failure_at: string | null;
1645
- /** Format: uuid */
1684
+ /**
1685
+ * Format: uuid
1686
+ * @description The endpoint's id.
1687
+ */
1646
1688
  id: string;
1647
1689
  /** @description True for endpoints carried over from the product's previous webhook system: they also receive the old signature header until its sunset date. */
1648
1690
  legacy_signature: boolean;
@@ -1665,30 +1707,42 @@ interface components {
1665
1707
  * @example x9Q=
1666
1708
  */
1667
1709
  signing_secret_hint: string;
1710
+ /** @description `enabled` receives events. `disabled` was switched off. `auto_disabled` was switched off after 20 failed deliveries in a row or 24 hours of failures; `PATCH { enabled: true }` turns it back on. */
1711
+ status: components["schemas"]["WebhookEndpointStatus"];
1668
1712
  /**
1669
- * @description `enabled` receives events. `disabled` was switched off. `auto_disabled` was switched off after 20 failed deliveries in a row or 24 hours of failures; `PATCH { enabled: true }` turns it back on.
1670
- * @enum {string}
1713
+ * Format: date-time
1714
+ * @description When the endpoint last changed.
1671
1715
  */
1672
- status: "enabled" | "disabled" | "auto_disabled";
1673
- /** Format: date-time */
1674
1716
  updated_at: string;
1675
1717
  /**
1676
1718
  * Format: uri
1719
+ * @description Where events are sent.
1677
1720
  * @example https://api.acme.com/webhooks
1678
1721
  */
1679
1722
  url: string;
1680
1723
  };
1724
+ /** @enum {string} */
1725
+ WebhookEndpointStatus: "enabled" | "disabled" | "auto_disabled";
1681
1726
  WebhookEndpointWithSecretDto: {
1682
1727
  /** @description Failed automatic deliveries in a row; a success resets it. */
1683
1728
  consecutive_failures: number;
1684
- /** Format: date-time */
1729
+ /**
1730
+ * Format: date-time
1731
+ * @description When the endpoint was created.
1732
+ */
1685
1733
  created_at: string;
1686
- /** @example Production receiver */
1734
+ /**
1735
+ * @description A label for people; null when unset.
1736
+ * @example Production receiver
1737
+ */
1687
1738
  description: string | null;
1688
- /** Format: date-time */
1739
+ /**
1740
+ * Format: date-time
1741
+ * @description When it was switched off; null while enabled.
1742
+ */
1689
1743
  disabled_at: string | null;
1690
- /** @enum {string|null} */
1691
- disabled_reason: "manual" | "failing" | null;
1744
+ /** @description `manual`: switched off by a caller. `failing`: switched off automatically after failed deliveries. Null while enabled. */
1745
+ disabled_reason: components["schemas"]["WebhookEndpointDisabledReason"] | null;
1692
1746
  /** @description The on/off switch (`PATCH … { enabled }`). */
1693
1747
  enabled: boolean;
1694
1748
  /**
@@ -1701,7 +1755,10 @@ interface components {
1701
1755
  * @description Start of the current failure streak.
1702
1756
  */
1703
1757
  first_failure_at: string | null;
1704
- /** Format: uuid */
1758
+ /**
1759
+ * Format: uuid
1760
+ * @description The endpoint's id.
1761
+ */
1705
1762
  id: string;
1706
1763
  /** @description True for endpoints carried over from the product's previous webhook system: they also receive the old signature header until its sunset date. */
1707
1764
  legacy_signature: boolean;
@@ -1729,15 +1786,16 @@ interface components {
1729
1786
  * @example x9Q=
1730
1787
  */
1731
1788
  signing_secret_hint: string;
1789
+ /** @description `enabled` receives events. `disabled` was switched off. `auto_disabled` was switched off after 20 failed deliveries in a row or 24 hours of failures; `PATCH { enabled: true }` turns it back on. */
1790
+ status: components["schemas"]["WebhookEndpointStatus"];
1732
1791
  /**
1733
- * @description `enabled` receives events. `disabled` was switched off. `auto_disabled` was switched off after 20 failed deliveries in a row or 24 hours of failures; `PATCH { enabled: true }` turns it back on.
1734
- * @enum {string}
1792
+ * Format: date-time
1793
+ * @description When the endpoint last changed.
1735
1794
  */
1736
- status: "enabled" | "disabled" | "auto_disabled";
1737
- /** Format: date-time */
1738
1795
  updated_at: string;
1739
1796
  /**
1740
1797
  * Format: uri
1798
+ * @description Where events are sent.
1741
1799
  * @example https://api.acme.com/webhooks
1742
1800
  */
1743
1801
  url: string;
@@ -1745,15 +1803,22 @@ interface components {
1745
1803
  WebhookEventDeliveryDto: {
1746
1804
  /** @description Number of the latest attempt; retries and replays count up. */
1747
1805
  attempt_number: number;
1748
- /** Format: date-time */
1806
+ /**
1807
+ * Format: date-time
1808
+ * @description When the latest attempt was made.
1809
+ */
1749
1810
  attempted_at: string;
1750
- /** Format: uuid */
1811
+ /**
1812
+ * Format: uuid
1813
+ * @description The endpoint.
1814
+ */
1751
1815
  endpoint_id: string;
1752
1816
  /**
1753
1817
  * Format: date-time
1754
1818
  * @description When the next automatic attempt is due; null when none is queued.
1755
1819
  */
1756
1820
  next_attempt_at: string | null;
1821
+ /** @description HTTP status of the latest attempt; null when no response came back. */
1757
1822
  status_code: number | null;
1758
1823
  /** @description True when the latest attempt got a 2xx. */
1759
1824
  succeeded: boolean;
@@ -1761,7 +1826,10 @@ interface components {
1761
1826
  WebhookEventDetailDto: {
1762
1827
  /** @description Every attempt, newest first. */
1763
1828
  attempts: components["schemas"]["WebhookDeliveryAttemptDto"][];
1764
- /** Format: date-time */
1829
+ /**
1830
+ * Format: date-time
1831
+ * @description When the event happened.
1832
+ */
1765
1833
  created_at: string;
1766
1834
  /** @description Latest attempt per endpoint (an endpoint whose first attempt is still queued is not listed yet). */
1767
1835
  deliveries: components["schemas"]["WebhookEventDeliveryDto"][];
@@ -1774,21 +1842,21 @@ interface components {
1774
1842
  payload: {
1775
1843
  [key: string]: unknown;
1776
1844
  };
1777
- /**
1778
- * @description `pending`: a delivery is queued. `failed`: the latest attempt to some endpoint failed and none is queued. `delivered`: every endpoint answered 2xx. `not_sent`: no endpoint subscribed.
1779
- * @enum {string}
1780
- */
1781
- status: "pending" | "delivered" | "failed" | "not_sent";
1845
+ /** @description `pending`: a delivery is queued. `failed`: the latest attempt to some endpoint failed and none is queued. `delivered`: every endpoint answered 2xx. `not_sent`: no endpoint subscribed. */
1846
+ status: components["schemas"]["WebhookEventStatus"];
1782
1847
  /** @description Made by "Send test". */
1783
1848
  test: boolean;
1784
1849
  /**
1850
+ * @description The event type (one of this product's catalogue).
1785
1851
  * @example entry.created
1786
- * @enum {string}
1787
1852
  */
1788
- type: "entry.created" | "entry.approved" | "entry.rejected";
1853
+ type: components["schemas"]["WebhookEventType"];
1789
1854
  };
1790
1855
  WebhookEventDto: {
1791
- /** Format: date-time */
1856
+ /**
1857
+ * Format: date-time
1858
+ * @description When the event happened.
1859
+ */
1792
1860
  created_at: string;
1793
1861
  /** @description Latest attempt per endpoint (an endpoint whose first attempt is still queued is not listed yet). */
1794
1862
  deliveries: components["schemas"]["WebhookEventDeliveryDto"][];
@@ -1801,36 +1869,40 @@ interface components {
1801
1869
  payload: {
1802
1870
  [key: string]: unknown;
1803
1871
  };
1804
- /**
1805
- * @description `pending`: a delivery is queued. `failed`: the latest attempt to some endpoint failed and none is queued. `delivered`: every endpoint answered 2xx. `not_sent`: no endpoint subscribed.
1806
- * @enum {string}
1807
- */
1808
- status: "pending" | "delivered" | "failed" | "not_sent";
1872
+ /** @description `pending`: a delivery is queued. `failed`: the latest attempt to some endpoint failed and none is queued. `delivered`: every endpoint answered 2xx. `not_sent`: no endpoint subscribed. */
1873
+ status: components["schemas"]["WebhookEventStatus"];
1809
1874
  /** @description Made by "Send test". */
1810
1875
  test: boolean;
1811
1876
  /**
1877
+ * @description The event type (one of this product's catalogue).
1812
1878
  * @example entry.created
1813
- * @enum {string}
1814
1879
  */
1815
- type: "entry.created" | "entry.approved" | "entry.rejected";
1880
+ type: components["schemas"]["WebhookEventType"];
1816
1881
  };
1882
+ /** @enum {string} */
1883
+ WebhookEventStatus: "pending" | "delivered" | "failed" | "not_sent";
1884
+ /** @enum {string} */
1885
+ WebhookEventType: "entry.created" | "entry.approved" | "entry.rejected";
1817
1886
  WebhookEventTypeDto: {
1818
1887
  /**
1819
1888
  * @description Group shown in the event picker.
1820
1889
  * @example Users
1821
1890
  */
1822
1891
  category: string;
1823
- /** @example A user signed up or was created by an admin. */
1892
+ /**
1893
+ * @description When this event is sent.
1894
+ * @example A user signed up or was created by an admin.
1895
+ */
1824
1896
  description: string;
1825
1897
  /** @description An example `data` object; "Send test" delivers exactly this. */
1826
1898
  example: {
1827
1899
  [key: string]: unknown;
1828
1900
  };
1829
1901
  /**
1902
+ * @description The event type (one of this product's catalogue).
1830
1903
  * @example entry.created
1831
- * @enum {string}
1832
1904
  */
1833
- type: "entry.created" | "entry.approved" | "entry.rejected";
1905
+ type: components["schemas"]["WebhookEventType"];
1834
1906
  };
1835
1907
  WebhookListResponseDto: {
1836
1908
  data: components["schemas"]["WebhookResponseDto"][];
@@ -2238,6 +2310,8 @@ interface operations {
2238
2310
  /** @description Accepted by Mail and queued for delivery. */
2239
2311
  202: {
2240
2312
  headers: {
2313
+ /** @description `true` when this response is a replay of an earlier request with the same `Idempotency-Key`. */
2314
+ "Idempotent-Replay"?: "true";
2241
2315
  "X-Request-Id": components["headers"]["RequestId"];
2242
2316
  [name: string]: unknown;
2243
2317
  };
@@ -2285,9 +2359,11 @@ interface operations {
2285
2359
  "application/json": components["schemas"]["ErrorResponseDto"];
2286
2360
  };
2287
2361
  };
2288
- /** @description Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). */
2362
+ /** @description Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key). */
2289
2363
  409: {
2290
2364
  headers: {
2365
+ /** @description Seconds to wait before retrying with the same key (sent with `IDEMPOTENCY_IN_PROGRESS`). */
2366
+ "Retry-After"?: number;
2291
2367
  "X-Request-Id": components["headers"]["RequestId"];
2292
2368
  [name: string]: unknown;
2293
2369
  };
@@ -2387,6 +2463,8 @@ interface operations {
2387
2463
  /** @description Waitlist created. */
2388
2464
  201: {
2389
2465
  headers: {
2466
+ /** @description `true` when this response is a replay of an earlier request with the same `Idempotency-Key`. */
2467
+ "Idempotent-Replay"?: "true";
2390
2468
  "X-Request-Id": components["headers"]["RequestId"];
2391
2469
  [name: string]: unknown;
2392
2470
  };
@@ -2414,9 +2492,11 @@ interface operations {
2414
2492
  "application/json": components["schemas"]["ErrorResponseDto"];
2415
2493
  };
2416
2494
  };
2417
- /** @description Slug already taken in this workspace. */
2495
+ /** @description Slug already taken in this workspace. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key). */
2418
2496
  409: {
2419
2497
  headers: {
2498
+ /** @description Seconds to wait before retrying with the same key (sent with `IDEMPOTENCY_IN_PROGRESS`). */
2499
+ "Retry-After"?: number;
2420
2500
  "X-Request-Id": components["headers"]["RequestId"];
2421
2501
  [name: string]: unknown;
2422
2502
  };
@@ -3114,6 +3194,8 @@ interface operations {
3114
3194
  /** @description Test entry created. */
3115
3195
  201: {
3116
3196
  headers: {
3197
+ /** @description `true` when this response is a replay of an earlier request with the same `Idempotency-Key`. */
3198
+ "Idempotent-Replay"?: "true";
3117
3199
  "X-Request-Id": components["headers"]["RequestId"];
3118
3200
  [name: string]: unknown;
3119
3201
  };
@@ -3151,9 +3233,11 @@ interface operations {
3151
3233
  "application/json": components["schemas"]["ErrorResponseDto"];
3152
3234
  };
3153
3235
  };
3154
- /** @description Idempotency-Key reused with a different body. */
3236
+ /** @description Idempotency-Key reused with a different body. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key). */
3155
3237
  409: {
3156
3238
  headers: {
3239
+ /** @description Seconds to wait before retrying with the same key (sent with `IDEMPOTENCY_IN_PROGRESS`). */
3240
+ "Retry-After"?: number;
3157
3241
  "X-Request-Id": components["headers"]["RequestId"];
3158
3242
  [name: string]: unknown;
3159
3243
  };
@@ -3401,6 +3485,8 @@ interface operations {
3401
3485
  /** @description Webhook created. Includes plaintext `signing_secret` exactly once. */
3402
3486
  201: {
3403
3487
  headers: {
3488
+ /** @description `true` when this response is a replay of an earlier request with the same `Idempotency-Key`. */
3489
+ "Idempotent-Replay"?: "true";
3404
3490
  "X-Request-Id": components["headers"]["RequestId"];
3405
3491
  [name: string]: unknown;
3406
3492
  };
@@ -3408,9 +3494,11 @@ interface operations {
3408
3494
  "application/json": components["schemas"]["WebhookCreateResponseDto"];
3409
3495
  };
3410
3496
  };
3411
- /** @description The workspace already has 10 webhooks. */
3497
+ /** @description The workspace already has 10 webhooks. Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key). */
3412
3498
  409: {
3413
3499
  headers: {
3500
+ /** @description Seconds to wait before retrying with the same key (sent with `IDEMPOTENCY_IN_PROGRESS`). */
3501
+ "Retry-After"?: number;
3414
3502
  "X-Request-Id": components["headers"]["RequestId"];
3415
3503
  [name: string]: unknown;
3416
3504
  };
@@ -3492,6 +3580,8 @@ interface operations {
3492
3580
  responses: {
3493
3581
  201: {
3494
3582
  headers: {
3583
+ /** @description `true` when this response is a replay of an earlier request with the same `Idempotency-Key`. */
3584
+ "Idempotent-Replay"?: "true";
3495
3585
  "X-Request-Id": components["headers"]["RequestId"];
3496
3586
  [name: string]: unknown;
3497
3587
  };
@@ -3529,9 +3619,11 @@ interface operations {
3529
3619
  "application/json": components["schemas"]["ErrorResponseDto"];
3530
3620
  };
3531
3621
  };
3532
- /** @description Already 10 endpoints (`WEBHOOK_ENDPOINT_LIMIT`), or Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). */
3622
+ /** @description Already 10 endpoints (`WEBHOOK_ENDPOINT_LIMIT`), or Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key). */
3533
3623
  409: {
3534
3624
  headers: {
3625
+ /** @description Seconds to wait before retrying with the same key (sent with `IDEMPOTENCY_IN_PROGRESS`). */
3626
+ "Retry-After"?: number;
3535
3627
  "X-Request-Id": components["headers"]["RequestId"];
3536
3628
  [name: string]: unknown;
3537
3629
  };
@@ -3697,6 +3789,8 @@ interface operations {
3697
3789
  responses: {
3698
3790
  200: {
3699
3791
  headers: {
3792
+ /** @description `true` when this response is a replay of an earlier request with the same `Idempotency-Key`. */
3793
+ "Idempotent-Replay"?: "true";
3700
3794
  "X-Request-Id": components["headers"]["RequestId"];
3701
3795
  [name: string]: unknown;
3702
3796
  };
@@ -3744,9 +3838,11 @@ interface operations {
3744
3838
  "application/json": components["schemas"]["ErrorResponseDto"];
3745
3839
  };
3746
3840
  };
3747
- /** @description Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). */
3841
+ /** @description Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key). */
3748
3842
  409: {
3749
3843
  headers: {
3844
+ /** @description Seconds to wait before retrying with the same key (sent with `IDEMPOTENCY_IN_PROGRESS`). */
3845
+ "Retry-After"?: number;
3750
3846
  "X-Request-Id": components["headers"]["RequestId"];
3751
3847
  [name: string]: unknown;
3752
3848
  };
@@ -3787,6 +3883,8 @@ interface operations {
3787
3883
  responses: {
3788
3884
  200: {
3789
3885
  headers: {
3886
+ /** @description `true` when this response is a replay of an earlier request with the same `Idempotency-Key`. */
3887
+ "Idempotent-Replay"?: "true";
3790
3888
  "X-Request-Id": components["headers"]["RequestId"];
3791
3889
  [name: string]: unknown;
3792
3890
  };
@@ -3834,9 +3932,11 @@ interface operations {
3834
3932
  "application/json": components["schemas"]["ErrorResponseDto"];
3835
3933
  };
3836
3934
  };
3837
- /** @description Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). */
3935
+ /** @description Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key). */
3838
3936
  409: {
3839
3937
  headers: {
3938
+ /** @description Seconds to wait before retrying with the same key (sent with `IDEMPOTENCY_IN_PROGRESS`). */
3939
+ "Retry-After"?: number;
3840
3940
  "X-Request-Id": components["headers"]["RequestId"];
3841
3941
  [name: string]: unknown;
3842
3942
  };
@@ -3868,6 +3968,8 @@ interface operations {
3868
3968
  /** @description The attempt, successful or not. */
3869
3969
  200: {
3870
3970
  headers: {
3971
+ /** @description `true` when this response is a replay of an earlier request with the same `Idempotency-Key`. */
3972
+ "Idempotent-Replay"?: "true";
3871
3973
  "X-Request-Id": components["headers"]["RequestId"];
3872
3974
  [name: string]: unknown;
3873
3975
  };
@@ -3915,9 +4017,11 @@ interface operations {
3915
4017
  "application/json": components["schemas"]["ErrorResponseDto"];
3916
4018
  };
3917
4019
  };
3918
- /** @description Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). */
4020
+ /** @description Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key). */
3919
4021
  409: {
3920
4022
  headers: {
4023
+ /** @description Seconds to wait before retrying with the same key (sent with `IDEMPOTENCY_IN_PROGRESS`). */
4024
+ "Retry-After"?: number;
3921
4025
  "X-Request-Id": components["headers"]["RequestId"];
3922
4026
  [name: string]: unknown;
3923
4027
  };
@@ -3976,11 +4080,13 @@ interface operations {
3976
4080
  type?: ("entry.created" | "entry.approved" | "entry.rejected")[];
3977
4081
  /** @description Only events sent (or queued) to this endpoint. */
3978
4082
  endpoint_id?: string;
3979
- status?: "pending" | "delivered" | "failed" | "not_sent";
4083
+ /** @description Only events in this delivery status. */
4084
+ status?: components["schemas"]["WebhookEventStatus"];
3980
4085
  /** @description Only events created at or after this instant. */
3981
4086
  created_after?: string;
3982
4087
  /** @description Only events created before this instant. */
3983
4088
  created_before?: string;
4089
+ /** @description Page size. */
3984
4090
  limit?: number;
3985
4091
  /** @description The previous page's `pagination.next_cursor`. */
3986
4092
  cursor?: string;
@@ -4119,6 +4225,8 @@ interface operations {
4119
4225
  responses: {
4120
4226
  200: {
4121
4227
  headers: {
4228
+ /** @description `true` when this response is a replay of an earlier request with the same `Idempotency-Key`. */
4229
+ "Idempotent-Replay"?: "true";
4122
4230
  "X-Request-Id": components["headers"]["RequestId"];
4123
4231
  [name: string]: unknown;
4124
4232
  };
@@ -4166,9 +4274,11 @@ interface operations {
4166
4274
  "application/json": components["schemas"]["ErrorResponseDto"];
4167
4275
  };
4168
4276
  };
4169
- /** @description `endpoint_id` is switched off or does not receive this event type (`WEBHOOK_ENDPOINT_NOT_SUBSCRIBED`), or Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). */
4277
+ /** @description `endpoint_id` is switched off or does not receive this event type (`WEBHOOK_ENDPOINT_NOT_SUBSCRIBED`), or Idempotency-Key reused with a different body (`IDEMPOTENCY_KEY_REUSE`). Idempotency: `IDEMPOTENCY_KEY_REUSE` when this `Idempotency-Key` was already used with a different body or route; `IDEMPOTENCY_IN_PROGRESS` while another request with the same key is still running (retry after `Retry-After` seconds, with the same key). */
4170
4278
  409: {
4171
4279
  headers: {
4280
+ /** @description Seconds to wait before retrying with the same key (sent with `IDEMPOTENCY_IN_PROGRESS`). */
4281
+ "Retry-After"?: number;
4172
4282
  "X-Request-Id": components["headers"]["RequestId"];
4173
4283
  [name: string]: unknown;
4174
4284
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@productcraft/waitlist",
3
- "version": "0.2.2",
3
+ "version": "0.2.3",
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",
@@ -19,7 +19,7 @@
19
19
  "LICENSE"
20
20
  ],
21
21
  "engines": {
22
- "node": ">=18"
22
+ "node": ">=20.3"
23
23
  },
24
24
  "keywords": [
25
25
  "productcraft",
@@ -43,7 +43,7 @@
43
43
  },
44
44
  "dependencies": {
45
45
  "openapi-fetch": "^0.13.0",
46
- "@productcraft/core": "^0.3.0"
46
+ "@productcraft/core": "^0.4.0"
47
47
  },
48
48
  "scripts": {
49
49
  "build": "tsup"