@kyro-cms/core 0.12.71 → 0.13.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +150 -76
- package/dist/{WebhookService-DQyM9fVo.d.ts → WebhookService-BLi5Rz2m.d.ts} +1 -1
- package/dist/{WebhookService-bo1NrgBW.d.cts → WebhookService-BOJMgjBm.d.cts} +1 -1
- package/dist/WebhookService-BcuD8tnn.d.cts +143 -0
- package/dist/WebhookService-CFe6Zd0_.d.cts +143 -0
- package/dist/WebhookService-CGxHtw7E.d.cts +143 -0
- package/dist/WebhookService-CNC1lYz7.d.ts +143 -0
- package/dist/WebhookService-CVXmjbtQ.d.cts +143 -0
- package/dist/WebhookService-D5PSI5t6.d.cts +143 -0
- package/dist/WebhookService-DPCCn_12.d.ts +143 -0
- package/dist/WebhookService-Dk1lzSrG.d.cts +143 -0
- package/dist/WebhookService-Dncnbgm9.d.cts +143 -0
- package/dist/WebhookService-I6hdue2Y.d.ts +143 -0
- package/dist/WebhookService-KnQ2UDlW.d.ts +143 -0
- package/dist/WebhookService-UY5p89Bj.d.ts +143 -0
- package/dist/WebhookService-YZXBCRXA.d.ts +143 -0
- package/dist/WebhookService-fk0FGRlk.d.ts +143 -0
- package/dist/WebhookService-vsFnWrOh.d.ts +143 -0
- package/dist/WebhookService-zrDmAx7L.d.cts +143 -0
- package/dist/api-handler-graphql.cjs +1 -1
- package/dist/api-handler-graphql.js +1 -1
- package/dist/api-handler-trpc.cjs +1 -1
- package/dist/api-handler-trpc.js +1 -1
- package/dist/api-handler.cjs +1 -1
- package/dist/api-handler.js +1 -1
- package/dist/{base-urWvrsX8.d.cts → base-B--L0lCn.d.cts} +1 -1
- package/dist/base-B-i-tjm1.d.ts +218 -0
- package/dist/base-B-siit_y.d.cts +218 -0
- package/dist/base-B8SyZI4D.d.ts +218 -0
- package/dist/base-BCgFt3Yx.d.ts +218 -0
- package/dist/base-BHRGJ40F.d.cts +218 -0
- package/dist/base-BVoDPNjJ.d.cts +218 -0
- package/dist/base-BaOJ5uWd.d.cts +218 -0
- package/dist/base-BfPaVEAE.d.cts +218 -0
- package/dist/base-BxrX5EPU.d.cts +218 -0
- package/dist/base-CAb9EYQs.d.ts +218 -0
- package/dist/base-CcZIEll-.d.ts +218 -0
- package/dist/base-CyG7aF1e.d.cts +218 -0
- package/dist/{base-BcfNgOqZ.d.ts → base-DOImeJ-F.d.ts} +1 -1
- package/dist/base-DbnwE42-.d.cts +218 -0
- package/dist/base-NyiSsD-n.d.ts +218 -0
- package/dist/base-OYfoYPYP.d.ts +218 -0
- package/dist/base-xflndGDO.d.ts +218 -0
- package/dist/bootstrap-QQ6D3OYG.js +1 -0
- package/dist/bootstrap-QVKSKXJF.cjs +1 -0
- package/dist/bootstrap-RILR44UM.cjs +1 -0
- package/dist/bootstrap-ZRRUPRUR.js +1 -0
- package/dist/chunk-262YP5XA.cjs +1 -0
- package/dist/chunk-2FSOHXOU.cjs +56 -0
- package/dist/chunk-2OS5Y4LE.cjs +1 -0
- package/dist/chunk-2PXXQKN3.cjs +3 -0
- package/dist/{chunk-K6ZW5M6S.cjs → chunk-355R4LS5.cjs} +3 -3
- package/dist/chunk-35IVNLMA.js +122 -0
- package/dist/{chunk-FSWDDVLA.js → chunk-3GXLOYM3.js} +1 -1
- package/dist/chunk-3KZXF4US.js +2 -0
- package/dist/{chunk-H7PC2ENZ.cjs → chunk-3LAWUINR.cjs} +1 -1
- package/dist/chunk-3O3AVMWM.cjs +1 -0
- package/dist/chunk-3U6MKWET.cjs +120 -0
- package/dist/chunk-4BMWWGJN.js +384 -0
- package/dist/chunk-5A7E7N4B.cjs +431 -0
- package/dist/chunk-6DD4J7LI.js +2 -0
- package/dist/chunk-6GGPY7U2.js +4 -0
- package/dist/chunk-6MNLRAKM.cjs +121 -0
- package/dist/chunk-6NBZDW53.js +133 -0
- package/dist/{chunk-2HATK4C5.js → chunk-73Y63IPP.js} +4 -4
- package/dist/chunk-7K6ZUNJM.js +4 -0
- package/dist/chunk-7NKNSRCB.cjs +448 -0
- package/dist/chunk-A3IOQOV6.js +2 -0
- package/dist/chunk-A3XVL6ED.cjs +3 -0
- package/dist/{chunk-LKQHIOPW.cjs → chunk-APDQ6ZTG.cjs} +1 -1
- package/dist/chunk-ATI2UZ7U.js +2 -0
- package/dist/chunk-B4AC23SG.js +122 -0
- package/dist/chunk-BD6XHMMM.cjs +2 -0
- package/dist/chunk-CH4TZZI5.js +449 -0
- package/dist/{chunk-26KFM3P6.js → chunk-CNHUCCQJ.js} +1 -1
- package/dist/chunk-CRP6PSCE.js +2 -0
- package/dist/chunk-DI6TCZSE.js +122 -0
- package/dist/chunk-DORUYZQV.cjs +1 -0
- package/dist/chunk-E4H3ZZ7U.js +4 -0
- package/dist/chunk-EFKEVWAD.js +4 -0
- package/dist/chunk-EI7FRSNY.js +57 -0
- package/dist/chunk-EON4XLKQ.cjs +1 -0
- package/dist/chunk-EUQAOYEO.cjs +121 -0
- package/dist/chunk-EVAUBT7H.js +57 -0
- package/dist/chunk-EYHD7HZE.cjs +1 -0
- package/dist/chunk-EYYIPA5N.js +432 -0
- package/dist/chunk-F2O4QO5N.cjs +383 -0
- package/dist/chunk-FBWLSWZ4.js +122 -0
- package/dist/chunk-FDKU7HJX.js +2 -0
- package/dist/chunk-FGN6IMPY.cjs +3 -0
- package/dist/chunk-FK2BG4HU.js +3 -0
- package/dist/chunk-GV2IB4WQ.cjs +56 -0
- package/dist/chunk-GWIZT2P5.js +57 -0
- package/dist/chunk-H3FJ54KB.cjs +121 -0
- package/dist/chunk-HY3EAWB2.js +4 -0
- package/dist/chunk-I6UJVO2P.js +57 -0
- package/dist/chunk-IQSF6XRV.js +57 -0
- package/dist/chunk-IXGDTAES.js +4 -0
- package/dist/chunk-JA44K75G.js +2 -0
- package/dist/chunk-JZ7Z6WC2.cjs +3 -0
- package/dist/chunk-K5XGP57D.cjs +19 -0
- package/dist/chunk-KEITOXIP.js +2 -0
- package/dist/chunk-LPFRMQFQ.js +121 -0
- package/dist/chunk-LYU44UNN.cjs +56 -0
- package/dist/chunk-MDLJTZLV.cjs +1 -0
- package/dist/chunk-MFNN5DYG.cjs +1 -0
- package/dist/chunk-MJAODEFC.cjs +121 -0
- package/dist/chunk-MYHNTJLR.cjs +56 -0
- package/dist/chunk-N2YHO2WI.cjs +3 -0
- package/dist/chunk-N4FXLQE3.cjs +132 -0
- package/dist/chunk-NPBXLPOP.js +3 -0
- package/dist/chunk-ON5XJEPO.cjs +3 -0
- package/dist/chunk-OT2Z4XBD.cjs +1 -0
- package/dist/chunk-PFTBTWSC.cjs +1 -0
- package/dist/chunk-PTPVFLET.js +20 -0
- package/dist/chunk-PZDLPRJF.js +4 -0
- package/dist/chunk-Q5TFO66G.cjs +1 -0
- package/dist/chunk-QUTYCUST.js +4 -0
- package/dist/chunk-REKKBAQX.cjs +56 -0
- package/dist/chunk-REQ622YC.js +3 -0
- package/dist/chunk-RTNQP6BV.js +2 -0
- package/dist/chunk-RUJW47ZJ.js +2 -0
- package/dist/chunk-RXYCFZJC.cjs +121 -0
- package/dist/chunk-RYHOWZLK.js +2 -0
- package/dist/chunk-S2MZNEBQ.cjs +1 -0
- package/dist/chunk-S73YERS2.js +57 -0
- package/dist/chunk-SBNMXQNO.cjs +2 -0
- package/dist/chunk-SMQ6736Y.js +57 -0
- package/dist/chunk-T3DJ3UTP.cjs +121 -0
- package/dist/chunk-TJZO7ZSX.cjs +3 -0
- package/dist/chunk-TKUNRCRH.js +4 -0
- package/dist/chunk-TQLCOMKC.js +4 -0
- package/dist/chunk-TRXYDWGE.cjs +1 -0
- package/dist/chunk-TS55CUNJ.js +57 -0
- package/dist/chunk-UFBJ3WOZ.js +2 -0
- package/dist/chunk-UQRVQUVR.js +2 -0
- package/dist/chunk-UW5W35NP.js +122 -0
- package/dist/chunk-VI7WCO2J.cjs +3 -0
- package/dist/chunk-W2GPP6RB.js +122 -0
- package/dist/chunk-WHOA7YJU.cjs +1 -0
- package/dist/chunk-WNRUPL26.js +2 -0
- package/dist/chunk-WXT2XW7T.js +13 -0
- package/dist/chunk-XFYSADHV.cjs +2 -0
- package/dist/chunk-XIAJQLGS.js +2 -0
- package/dist/chunk-XK6UB77Q.js +4 -0
- package/dist/chunk-Y2VHO66Q.cjs +3 -0
- package/dist/chunk-Y5O2OD7J.cjs +3 -0
- package/dist/chunk-YARB43JG.cjs +56 -0
- package/dist/chunk-YLCEMVYY.cjs +56 -0
- package/dist/chunk-YSOM57GK.cjs +3 -0
- package/dist/chunk-Z3UVDGYS.cjs +56 -0
- package/dist/chunk-ZTLGK6R4.cjs +12 -0
- package/dist/chunk-ZUBJ6RLQ.cjs +1 -0
- package/dist/cli/index.cjs +1 -1
- package/dist/cli/index.js +1 -1
- package/dist/client.cjs +10 -10
- package/dist/client.d.cts +1265 -0
- package/dist/client.d.ts +1265 -0
- package/dist/client.js +10 -10
- package/dist/drizzle/index.cjs +1 -1
- package/dist/drizzle/index.d.cts +3 -3
- package/dist/drizzle/index.d.ts +3 -3
- package/dist/drizzle/index.js +1 -1
- package/dist/fields/index.cjs +1 -1
- package/dist/fields/index.d.cts +2 -2
- package/dist/fields/index.d.ts +2 -2
- package/dist/fields/index.js +1 -1
- package/dist/graphql/index.d.cts +3 -3
- package/dist/graphql/index.d.ts +3 -3
- package/dist/index-8Ino7vKq.d.ts +105 -0
- package/dist/{index-d1m_oup7.d.cts → index-B9BFNOHd.d.cts} +1 -1
- package/dist/index-BMcYFpTv.d.cts +105 -0
- package/dist/index-BttsFZDa.d.ts +105 -0
- package/dist/index-ByOM1Y5x.d.ts +105 -0
- package/dist/index-C6xmtRio.d.cts +105 -0
- package/dist/index-CTI3K_uq.d.cts +105 -0
- package/dist/index-CTL4zv_u.d.ts +105 -0
- package/dist/index-CaDbioSg.d.ts +105 -0
- package/dist/index-CxA9uOv0.d.ts +105 -0
- package/dist/{index-4cH-BjtP.d.ts → index-D6AXbuPI.d.ts} +1 -1
- package/dist/index-DF0KDBaM.d.cts +105 -0
- package/dist/index-DG4Xu7gA.d.cts +105 -0
- package/dist/index-DS3DpJli.d.cts +105 -0
- package/dist/index-NGnJpSgf.d.ts +105 -0
- package/dist/index-Zrg3sZ6R.d.cts +105 -0
- package/dist/index-eHex8Iwj.d.ts +105 -0
- package/dist/index-rm7uyOK1.d.cts +105 -0
- package/dist/index.cjs +32 -32
- package/dist/index.d.cts +73 -11
- package/dist/index.d.ts +73 -11
- package/dist/index.js +32 -32
- package/dist/lib-A2D63VXD.cjs +1 -0
- package/dist/lib-JQD2JAOO.js +2 -0
- package/dist/local-KR3AIGVA.cjs +1 -0
- package/dist/local-T7GISZBL.js +1 -0
- package/dist/mongo-auth-adapter-GR2CFFEA.js +1 -0
- package/dist/mongo-auth-adapter-UOO2LZUJ.cjs +1 -0
- package/dist/mongodb/index.cjs +1 -1
- package/dist/mongodb/index.d.cts +4 -3
- package/dist/mongodb/index.d.ts +4 -3
- package/dist/mongodb/index.js +1 -1
- package/dist/nodemailer-transport-3VWVUBM5.cjs +1 -0
- package/dist/nodemailer-transport-7RHATUKL.js +1 -0
- package/dist/nodemailer-transport-CHO2WKIY.js +1 -0
- package/dist/nodemailer-transport-ED2IXNGW.cjs +1 -0
- package/dist/rest/index.cjs +1 -1
- package/dist/rest/index.d.cts +4 -4
- package/dist/rest/index.d.ts +4 -4
- package/dist/rest/index.js +1 -1
- package/dist/templates/index.cjs +1 -1
- package/dist/templates/index.d.cts +2 -2
- package/dist/templates/index.d.ts +2 -2
- package/dist/templates/index.js +1 -1
- package/dist/trpc/index.cjs +1 -1
- package/dist/trpc/index.d.cts +3 -3
- package/dist/trpc/index.d.ts +3 -3
- package/dist/trpc/index.js +1 -1
- package/dist/types-6ShQp2EM.d.cts +839 -0
- package/dist/types-B5Qz1svz.d.cts +822 -0
- package/dist/types-B9oXBEKI.d.cts +330 -0
- package/dist/types-B9oXBEKI.d.ts +330 -0
- package/dist/types-BCOhfwHC.d.ts +839 -0
- package/dist/types-BRDBNacn.d.ts +839 -0
- package/dist/types-Bii0bhUV.d.cts +329 -0
- package/dist/types-Bii0bhUV.d.ts +329 -0
- package/dist/{types-BADIMVGF.d.ts → types-Bt2_ycUO.d.ts} +36 -1
- package/dist/types-C4wXHImf.d.ts +822 -0
- package/dist/types-C8yIAV6K.d.cts +839 -0
- package/dist/types-CORUQhY-.d.ts +839 -0
- package/dist/types-Cdssrcbz.d.cts +839 -0
- package/dist/types-CjGqxBd3.d.cts +330 -0
- package/dist/types-CjGqxBd3.d.ts +330 -0
- package/dist/types-DBGR-eQl.d.cts +839 -0
- package/dist/types-DCWgPFmi.d.cts +822 -0
- package/dist/types-DROqAsr0.d.cts +330 -0
- package/dist/types-DROqAsr0.d.ts +330 -0
- package/dist/{types-YAVR0H9Z.d.cts → types-DsF64Wrc.d.cts} +36 -1
- package/dist/types-DxaK39ix.d.cts +330 -0
- package/dist/types-DxaK39ix.d.ts +330 -0
- package/dist/types-IeKFn7Ky.d.ts +839 -0
- package/dist/types-QglJ7PwT.d.cts +839 -0
- package/dist/types-ZrjEVWfi.d.ts +811 -0
- package/dist/types-dEy5JxvN.d.ts +822 -0
- package/dist/types-tVJc9YbX.d.cts +811 -0
- package/dist/types-zt5qIvje.d.ts +839 -0
- package/dist/ws/index.cjs +1 -1
- package/dist/ws/index.d.cts +121 -1
- package/dist/ws/index.d.ts +121 -1
- package/dist/ws/index.js +1 -1
- package/package.json +2 -2
- package/dist/chunk-5M3FKE2V.js +0 -2
- package/dist/chunk-WCFHS7EZ.cjs +0 -1
package/README.md
CHANGED
|
@@ -2,50 +2,52 @@
|
|
|
2
2
|
|
|
3
3
|
<div align="center">
|
|
4
4
|
|
|
5
|
-
**Astro-native headless CMS with multi-database adapters, multi-protocol APIs, and
|
|
5
|
+
**Astro-native headless CMS with multi-database adapters, multi-protocol APIs, and a built-in React admin dashboard.**
|
|
6
6
|
|
|
7
7
|
[](https://www.npmjs.com/package/@kyro-cms/core)
|
|
8
8
|
[](https://opensource.org/licenses/MIT)
|
|
9
9
|
[](https://www.typescriptlang.org/)
|
|
10
10
|
|
|
11
|
-
<br />
|
|
12
|
-
|
|
13
11
|
</div>
|
|
14
12
|
|
|
15
13
|
---
|
|
16
14
|
|
|
17
15
|
## What Kyro Gives You
|
|
18
16
|
|
|
19
|
-
Kyro turns a single TypeScript config into a full CMS backend for Astro
|
|
17
|
+
Kyro turns a single TypeScript config (`kyro.config.ts`) into a full CMS backend for Astro:
|
|
20
18
|
|
|
21
|
-
- **REST, GraphQL, tRPC, and WebSocket
|
|
22
|
-
- **
|
|
23
|
-
- **Auto-generated
|
|
24
|
-
- **End-to-
|
|
25
|
-
- **
|
|
19
|
+
- **Unified Multi-Protocol APIs**: Auto-generated REST, GraphQL, tRPC, and WebSocket endpoints from the same collection schema.
|
|
20
|
+
- **Multi-Database Adapters**: Instant local SQLite development plus production PostgreSQL (Drizzle) and MongoDB adapters.
|
|
21
|
+
- **Built-in Admin Dashboard**: Auto-generated React UI with field builders, live preview, version history, media manager, auth, and RBAC.
|
|
22
|
+
- **End-to-End Type Safety**: Schema types and validation powered by TypeScript and Zod.
|
|
23
|
+
- **Extensible Architecture**: Custom plugins, lifecycle hooks, field components, and dashboard widgets.
|
|
26
24
|
|
|
27
25
|
---
|
|
28
26
|
|
|
29
27
|
## Quick Start
|
|
30
28
|
|
|
31
|
-
### Create a
|
|
29
|
+
### 1. Create a New Kyro Project
|
|
32
30
|
|
|
33
31
|
```bash
|
|
34
32
|
pnpm create @kyro-cms@latest my-project
|
|
33
|
+
# or
|
|
34
|
+
npm create @kyro-cms@latest my-project
|
|
35
|
+
# or
|
|
36
|
+
bun create @kyro-cms@latest my-project
|
|
37
|
+
|
|
35
38
|
cd my-project
|
|
36
39
|
pnpm install
|
|
37
40
|
pnpm dev
|
|
38
41
|
```
|
|
39
42
|
|
|
40
43
|
Open:
|
|
44
|
+
- `http://localhost:4321` — Public Astro site
|
|
45
|
+
- `http://localhost:4321/admin` — CMS Admin Dashboard
|
|
41
46
|
|
|
42
|
-
|
|
43
|
-
- `http://localhost:4321/admin` — admin dashboard
|
|
44
|
-
|
|
45
|
-
### Add Kyro to an existing project
|
|
47
|
+
### 2. Add Kyro to an Existing Astro Project
|
|
46
48
|
|
|
47
49
|
```bash
|
|
48
|
-
pnpm
|
|
50
|
+
pnpm add @kyro-cms/core @kyro-cms/admin
|
|
49
51
|
```
|
|
50
52
|
|
|
51
53
|
```typescript
|
|
@@ -53,83 +55,145 @@ pnpm install @kyro-cms/core
|
|
|
53
55
|
import { defineKyroConfig, createLocalAdapter } from "@kyro-cms/core";
|
|
54
56
|
|
|
55
57
|
export default defineKyroConfig({
|
|
56
|
-
name: "my-app",
|
|
57
58
|
adapter: createLocalAdapter({ path: "./data/kyro.db" }),
|
|
58
|
-
collections:
|
|
59
|
-
|
|
59
|
+
collections: [
|
|
60
|
+
{
|
|
60
61
|
slug: "posts",
|
|
61
62
|
label: "Posts",
|
|
63
|
+
admin: {
|
|
64
|
+
useAsTitle: "title",
|
|
65
|
+
icon: "lucide:Newspaper",
|
|
66
|
+
group: "Content",
|
|
67
|
+
defaultColumns: ["title", "slug", "updatedAt"],
|
|
68
|
+
},
|
|
62
69
|
fields: [
|
|
63
70
|
{ name: "title", type: "text", required: true },
|
|
64
|
-
{
|
|
71
|
+
{
|
|
72
|
+
name: "slug",
|
|
73
|
+
type: "text",
|
|
74
|
+
required: true,
|
|
75
|
+
admin: { position: "sidebar", autoGenerate: "title" },
|
|
76
|
+
},
|
|
65
77
|
{ name: "content", type: "richtext" },
|
|
66
|
-
{
|
|
78
|
+
{
|
|
79
|
+
name: "published",
|
|
80
|
+
type: "checkbox",
|
|
81
|
+
defaultValue: false,
|
|
82
|
+
admin: { position: "sidebar" },
|
|
83
|
+
},
|
|
67
84
|
],
|
|
68
85
|
},
|
|
69
|
-
|
|
86
|
+
],
|
|
70
87
|
});
|
|
71
88
|
```
|
|
72
89
|
|
|
73
90
|
---
|
|
74
91
|
|
|
75
|
-
##
|
|
92
|
+
## Core Concepts
|
|
76
93
|
|
|
77
|
-
|
|
94
|
+
### Database Adapters
|
|
78
95
|
|
|
79
|
-
|
|
80
|
-
- **High-performance engine:** batched relationship population, zero-latency access control checks, and ~99% smaller ESM entrypoints
|
|
81
|
-
- **Unified API surface:** one schema powers REST, GraphQL, tRPC, and WebSockets
|
|
82
|
-
- **Production-ready:** swap adapters without rewriting collections
|
|
83
|
-
- **Admin experience:** auto-generated UIs, auth, RBAC, and draft workflows
|
|
96
|
+
Kyro uses a shared adapter layer so the same collection schema works across different databases without code changes:
|
|
84
97
|
|
|
85
|
-
|
|
98
|
+
- **SQLite (`createLocalAdapter`)** — Zero-config instant local file database.
|
|
99
|
+
- **PostgreSQL (`createDrizzleAdapter`)** — Production SQL powered by Drizzle ORM.
|
|
100
|
+
- **MongoDB (`createMongoDBAdapter`)** — Flexible document store for scalable applications.
|
|
86
101
|
|
|
87
|
-
|
|
102
|
+
### API Protocols
|
|
88
103
|
|
|
89
|
-
|
|
104
|
+
One schema definition automatically powers four API layers:
|
|
90
105
|
|
|
91
|
-
|
|
106
|
+
- **REST** (`/api/:collection`) — Standard JSON CRUD endpoints.
|
|
107
|
+
- **GraphQL** (`/api/graphql`) — Type-safe nested queries, mutations, and schema introspection.
|
|
108
|
+
- **tRPC** (`/api/trpc`) — End-to-end type-safe RPC client without schema generation.
|
|
109
|
+
- **WebSocket** (`/api/ws`) — Real-time live subscriptions and document presence.
|
|
92
110
|
|
|
93
|
-
|
|
94
|
-
- **PostgreSQL** — production SQL with Drizzle
|
|
95
|
-
- **MongoDB** — flexible document storage
|
|
111
|
+
### Modular Packages
|
|
96
112
|
|
|
97
|
-
|
|
113
|
+
- **`@kyro-cms/core`**: Core engine, database adapters, auth, and API handlers.
|
|
114
|
+
- **`@kyro-cms/admin`**: Auto-generated admin dashboard with media manager, RBAC, and draft workflows.
|
|
115
|
+
- **`@kyro-cms/astro`**: Astro integration, Content Layer loaders, and Astro Dev Toolbar widget.
|
|
116
|
+
- **`@kyro-cms/connect`**: Universal, type-safe client SDK and CLI codegen.
|
|
117
|
+
- **`@kyro-cms/ai`**: AI-powered content generation and admin assistance via Vercel AI SDK.
|
|
98
118
|
|
|
99
|
-
|
|
119
|
+
---
|
|
100
120
|
|
|
101
|
-
|
|
102
|
-
- **GraphQL** for nested queries and schema introspection
|
|
103
|
-
- **tRPC** for fully type-safe client-server calls
|
|
104
|
-
- **WebSocket** for real-time subscriptions and live updates
|
|
121
|
+
## Collection Admin Configuration
|
|
105
122
|
|
|
106
|
-
|
|
123
|
+
Configure how collections look and behave inside the admin UI using the `admin` property:
|
|
107
124
|
|
|
108
|
-
|
|
125
|
+
```typescript
|
|
126
|
+
export const foodMenuCollection: CollectionConfig = {
|
|
127
|
+
slug: "food-menu",
|
|
128
|
+
label: "Food Menu",
|
|
129
|
+
admin: {
|
|
130
|
+
group: "Restaurant Menu", // Collapsible sidebar section name
|
|
131
|
+
order: 1, // Sorting position inside the section
|
|
132
|
+
icon: "lucide:Utensils", // "lucide:<name>", "hero:<name>", or "hero-solid:<name>"
|
|
133
|
+
useAsTitle: "name", // Field to display as title in lists & relation dropdowns
|
|
134
|
+
defaultColumns: ["name", "category", "price"], // Default table columns
|
|
135
|
+
description: "Manage restaurant food items and pricing",
|
|
136
|
+
},
|
|
137
|
+
fields: [ /* ... */ ],
|
|
138
|
+
};
|
|
139
|
+
```
|
|
109
140
|
|
|
110
|
-
|
|
111
|
-
|
|
141
|
+
| Property | Type | Description |
|
|
142
|
+
| :--- | :--- | :--- |
|
|
143
|
+
| `group` / `folder` | `string` | Categorizes the collection under a collapsible sidebar navigation drawer (e.g. `"Commerce"`, `"Restaurant Menu"`). |
|
|
144
|
+
| `order` | `number` | Controls the sorting order within the sidebar group (lower numbers first). |
|
|
145
|
+
| `icon` | `string` | Icon from [Lucide](https://lucide.dev/icons) (`"lucide:Utensils"`, `"Receipt"`) or [Heroicons](https://heroicons.com/) (`"hero:Sparkles"`, `"hero-solid:Fire"`). |
|
|
146
|
+
| `useAsTitle` | `string` | Field key displayed as the main title in list views, breadcrumbs, and relation pickers. |
|
|
147
|
+
| `defaultColumns` | `string[]` | Array of field keys rendered as default columns in the list table. |
|
|
148
|
+
| `description` | `string` | Subtitle description shown beneath the collection header. |
|
|
149
|
+
| `hidden` | `boolean` | When `true`, hides the collection from sidebar navigation while keeping APIs active. |
|
|
150
|
+
| `disablePreview` | `boolean` | Disables the live preview split view for this collection. |
|
|
151
|
+
| `disableDuplicate` | `boolean` | Hides the document duplicate action in the edit form. |
|
|
112
152
|
|
|
113
|
-
|
|
153
|
+
---
|
|
154
|
+
|
|
155
|
+
## Field Admin Configuration
|
|
156
|
+
|
|
157
|
+
Customize individual fields in edit forms with the `admin` property:
|
|
158
|
+
|
|
159
|
+
```typescript
|
|
160
|
+
{
|
|
161
|
+
name: "items",
|
|
162
|
+
type: "array",
|
|
163
|
+
label: "Order Items",
|
|
164
|
+
admin: {
|
|
165
|
+
readOnly: true,
|
|
166
|
+
display: "pills", // Displays items as compact inline pill capsules with count multipliers
|
|
167
|
+
},
|
|
168
|
+
fields: [
|
|
169
|
+
{ name: "name", type: "text", label: "Item Name" },
|
|
170
|
+
{ name: "quantity", type: "number", label: "Qty" },
|
|
171
|
+
{ name: "total", type: "number", label: "Total" },
|
|
172
|
+
],
|
|
173
|
+
}
|
|
174
|
+
```
|
|
175
|
+
|
|
176
|
+
| Property | Type | Description |
|
|
177
|
+
| :--- | :--- | :--- |
|
|
178
|
+
| `position` | `"sidebar" \| "main"` | Places the field in the sticky sidebar panel (ideal for status, dates, slug, badges) vs main form. |
|
|
179
|
+
| `display` | `"pills" \| "default"` | Array layout mode. `"pills"` renders compact line-item badge capsules with count multipliers and totals. |
|
|
180
|
+
| `collapsible` | `boolean` | Renders group fields with interactive collapsible accordion headers. |
|
|
181
|
+
| `initCollapsed` | `boolean` | Starts accordions, groups, and array cards closed by default. |
|
|
182
|
+
| `autoGenerate` | `string` | Auto-generates slug values from another field (e.g. `autoGenerate: "title"`). |
|
|
183
|
+
| `readOnly` | `boolean \| Function` | Displays field value as read-only. |
|
|
184
|
+
| `hidden` | `boolean \| Function` | Hides field from the admin UI form completely. |
|
|
114
185
|
|
|
115
|
-
Kyro is designed as a modular ecosystem:
|
|
116
|
-
- `@kyro-cms/astro` — Astro 5+ & 7+ integration, Content Layer loaders, Astro Dev Toolbar widget, and Zero-JS UI components.
|
|
117
|
-
- `@kyro-cms/admin` — Auto-generated React admin dashboard with media manager, auth, RBAC, and draft workflows.
|
|
118
|
-
- `@kyro-cms/connect` — Universal, type-safe API client and codegen for any framework.
|
|
119
|
-
- `@kyro-cms/ai` — Vercel AI SDK integration for automated content generation and AI admin assistance.
|
|
120
|
-
- `@kyro-cms/rich-text-react` — Headless React renderer for Kyro RichText content schemas.
|
|
121
|
-
- `@kyro-cms/field-locations` — Pre-built geographic SelectFields for Kyro CMS.
|
|
122
186
|
---
|
|
123
187
|
|
|
124
|
-
##
|
|
188
|
+
## API Examples
|
|
125
189
|
|
|
126
190
|
### REST
|
|
127
191
|
|
|
128
192
|
```bash
|
|
129
|
-
GET
|
|
130
|
-
GET
|
|
131
|
-
POST
|
|
132
|
-
PATCH
|
|
193
|
+
GET /api/posts
|
|
194
|
+
GET /api/posts/:id
|
|
195
|
+
POST /api/posts
|
|
196
|
+
PATCH /api/posts/:id
|
|
133
197
|
DELETE /api/posts/:id
|
|
134
198
|
```
|
|
135
199
|
|
|
@@ -148,15 +212,28 @@ query {
|
|
|
148
212
|
}
|
|
149
213
|
```
|
|
150
214
|
|
|
151
|
-
###
|
|
215
|
+
### Server-Side (Astro Pages & Endpoints)
|
|
152
216
|
|
|
153
|
-
|
|
154
|
-
|
|
217
|
+
Query the database directly with zero network overhead:
|
|
218
|
+
|
|
219
|
+
```astro
|
|
220
|
+
---
|
|
221
|
+
import { getKyro } from "@kyro-cms/astro";
|
|
222
|
+
|
|
223
|
+
const kyro = await getKyro();
|
|
224
|
+
const { docs: posts } = await kyro.find({ collection: "posts", limit: 10 });
|
|
225
|
+
---
|
|
226
|
+
|
|
227
|
+
<ul>
|
|
228
|
+
{posts.map((post) => (
|
|
229
|
+
<li>{post.title}</li>
|
|
230
|
+
))}
|
|
231
|
+
</ul>
|
|
155
232
|
```
|
|
156
233
|
|
|
157
|
-
###
|
|
234
|
+
### Client SDK (`@kyro-cms/connect`)
|
|
158
235
|
|
|
159
|
-
Type-safe client
|
|
236
|
+
Type-safe client for frontend frameworks (Next.js, Remix, SvelteKit, React):
|
|
160
237
|
|
|
161
238
|
```bash
|
|
162
239
|
pnpm add @kyro-cms/connect
|
|
@@ -164,27 +241,24 @@ pnpm add @kyro-cms/connect
|
|
|
164
241
|
|
|
165
242
|
```typescript
|
|
166
243
|
import { createClient } from "@kyro-cms/connect";
|
|
167
|
-
import type { KyroAppRouter } from "./kyro.generated";
|
|
168
244
|
|
|
169
|
-
const api = createClient
|
|
170
|
-
|
|
171
|
-
apiKey: "kyro_xxx",
|
|
172
|
-
});
|
|
173
|
-
|
|
174
|
-
const posts = await api["posts"].find.query({ page: 1, limit: 10 });
|
|
245
|
+
const api = createClient({ url: "http://localhost:4321/api/trpc" });
|
|
246
|
+
const { docs: posts } = await api.posts.find({ limit: 10 });
|
|
175
247
|
```
|
|
176
248
|
|
|
177
249
|
---
|
|
178
250
|
|
|
179
|
-
##
|
|
251
|
+
## Documentation
|
|
252
|
+
|
|
253
|
+
Comprehensive guides, API references, and architecture docs are available in the **[`kyro-docs`](https://kyro-cms.com)** site:
|
|
180
254
|
|
|
181
|
-
-
|
|
182
|
-
-
|
|
183
|
-
-
|
|
184
|
-
-
|
|
255
|
+
- **[Getting Started Guide](https://kyro-cms.com/getting-started.html)** — First-time setup & walkthrough
|
|
256
|
+
- **[Configuration Reference](https://kyro-cms.com/reference/configuration.html)** — Full `kyro.config.ts` reference
|
|
257
|
+
- **[Field Types Reference](https://kyro-cms.com/guides/field-types.html)** — All 25+ schema field types
|
|
258
|
+
- **[Admin Customization](https://kyro-cms.com/guides/admin-customization.html)** — Layouts, plugins, and overrides
|
|
185
259
|
|
|
186
260
|
---
|
|
187
261
|
|
|
188
262
|
## License
|
|
189
263
|
|
|
190
|
-
MIT
|
|
264
|
+
MIT © [Kyro CMS](https://kyro-cms.com)
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { B as BaseAdapter } from './types-DCWgPFmi.cjs';
|
|
2
|
+
|
|
3
|
+
declare const WEBHOOK_EVENTS: {
|
|
4
|
+
readonly COLLECTION_CREATE: "collection.create";
|
|
5
|
+
readonly COLLECTION_UPDATE: "collection.update";
|
|
6
|
+
readonly COLLECTION_DELETE: "collection.delete";
|
|
7
|
+
readonly MEDIA_UPLOAD: "media.upload";
|
|
8
|
+
readonly MEDIA_DELETE: "media.delete";
|
|
9
|
+
readonly AUTH_LOGIN: "auth.login";
|
|
10
|
+
readonly AUTH_REGISTER: "auth.register";
|
|
11
|
+
readonly AUTH_LOGOUT: "auth.logout";
|
|
12
|
+
readonly ORDER_CREATED: "order.created";
|
|
13
|
+
readonly ORDER_PAID: "order.paid";
|
|
14
|
+
readonly ORDER_SHIPPED: "order.shipped";
|
|
15
|
+
readonly ORDER_DELIVERED: "order.delivered";
|
|
16
|
+
};
|
|
17
|
+
type WebhookEvent = (typeof WEBHOOK_EVENTS)[keyof typeof WEBHOOK_EVENTS];
|
|
18
|
+
declare const ALL_WEBHOOK_EVENTS: WebhookEvent[];
|
|
19
|
+
type WebhookActionType = "generic" | "github-push";
|
|
20
|
+
interface WebhookActionConfig {
|
|
21
|
+
githubOwner?: string;
|
|
22
|
+
githubRepo?: string;
|
|
23
|
+
githubBranch?: string;
|
|
24
|
+
}
|
|
25
|
+
interface WebhookConfig {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
url: string;
|
|
29
|
+
events: WebhookEvent[];
|
|
30
|
+
collections?: string[];
|
|
31
|
+
status: "active" | "inactive" | "error";
|
|
32
|
+
secret?: string;
|
|
33
|
+
headers?: Record<string, string>;
|
|
34
|
+
action?: WebhookActionType;
|
|
35
|
+
config?: WebhookActionConfig;
|
|
36
|
+
lastTriggered?: string;
|
|
37
|
+
lastError?: string;
|
|
38
|
+
createdAt: string;
|
|
39
|
+
updatedAt: string;
|
|
40
|
+
}
|
|
41
|
+
interface CreateWebhookData {
|
|
42
|
+
name: string;
|
|
43
|
+
url: string;
|
|
44
|
+
events: (WebhookEvent | "create" | "update" | "delete")[];
|
|
45
|
+
collections?: string[];
|
|
46
|
+
status?: "active" | "inactive";
|
|
47
|
+
secret?: string;
|
|
48
|
+
headers?: Record<string, string>;
|
|
49
|
+
action?: WebhookActionType;
|
|
50
|
+
config?: WebhookActionConfig;
|
|
51
|
+
}
|
|
52
|
+
interface UpdateWebhookData {
|
|
53
|
+
name?: string;
|
|
54
|
+
url?: string;
|
|
55
|
+
events?: (WebhookEvent | "create" | "update" | "delete")[];
|
|
56
|
+
collections?: string[];
|
|
57
|
+
status?: "active" | "inactive" | "error";
|
|
58
|
+
secret?: string;
|
|
59
|
+
headers?: Record<string, string>;
|
|
60
|
+
action?: WebhookActionType;
|
|
61
|
+
config?: WebhookActionConfig;
|
|
62
|
+
lastTriggered?: string | null;
|
|
63
|
+
lastError?: string | null;
|
|
64
|
+
}
|
|
65
|
+
interface WebhookPayload {
|
|
66
|
+
id: string;
|
|
67
|
+
event: WebhookEvent;
|
|
68
|
+
timestamp: string;
|
|
69
|
+
collection?: string;
|
|
70
|
+
operation?: "create" | "update" | "delete";
|
|
71
|
+
data?: unknown;
|
|
72
|
+
previousData?: unknown;
|
|
73
|
+
user?: {
|
|
74
|
+
id: string;
|
|
75
|
+
email?: string;
|
|
76
|
+
role?: string;
|
|
77
|
+
};
|
|
78
|
+
tenantId?: string;
|
|
79
|
+
metadata?: Record<string, unknown>;
|
|
80
|
+
}
|
|
81
|
+
interface WebhookDelivery {
|
|
82
|
+
id: string;
|
|
83
|
+
webhookId: string;
|
|
84
|
+
event: WebhookEvent;
|
|
85
|
+
payload: WebhookPayload;
|
|
86
|
+
attempt: number;
|
|
87
|
+
status: "pending" | "success" | "failed" | "retrying";
|
|
88
|
+
responseStatus?: number;
|
|
89
|
+
responseBody?: string;
|
|
90
|
+
error?: string;
|
|
91
|
+
duration?: number;
|
|
92
|
+
createdAt: string;
|
|
93
|
+
deliveredAt?: string;
|
|
94
|
+
nextRetryAt?: string;
|
|
95
|
+
}
|
|
96
|
+
interface WebhookTriggerResult {
|
|
97
|
+
deliveryId: string;
|
|
98
|
+
webhookId: string;
|
|
99
|
+
event: WebhookEvent;
|
|
100
|
+
status: "queued" | "success" | "failed";
|
|
101
|
+
responseStatus?: number;
|
|
102
|
+
duration?: number;
|
|
103
|
+
error?: string;
|
|
104
|
+
}
|
|
105
|
+
declare const WEBHOOK_COLLECTION = "_webhooks";
|
|
106
|
+
declare const WEBHOOK_DELIVERY_COLLECTION = "_webhook_deliveries";
|
|
107
|
+
interface DeliveryResult {
|
|
108
|
+
success: boolean;
|
|
109
|
+
status: number;
|
|
110
|
+
statusText?: string;
|
|
111
|
+
body?: string;
|
|
112
|
+
duration: number;
|
|
113
|
+
error?: string;
|
|
114
|
+
}
|
|
115
|
+
interface DeliveryOptions {
|
|
116
|
+
timeout?: number;
|
|
117
|
+
maxRetries?: number;
|
|
118
|
+
retryDelay?: number;
|
|
119
|
+
onRetry?: (attempt: number, error: string) => void;
|
|
120
|
+
onSuccess?: (result: DeliveryResult) => void;
|
|
121
|
+
onFailure?: (error: string) => void;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
declare class WebhookService {
|
|
125
|
+
private db;
|
|
126
|
+
constructor(db: BaseAdapter);
|
|
127
|
+
getWebhooks(filters?: {
|
|
128
|
+
status?: string;
|
|
129
|
+
event?: WebhookEvent;
|
|
130
|
+
}): Promise<WebhookConfig[]>;
|
|
131
|
+
getWebhookById(id: string): Promise<WebhookConfig | null>;
|
|
132
|
+
createWebhook(data: CreateWebhookData): Promise<WebhookConfig>;
|
|
133
|
+
updateWebhook(id: string, data: UpdateWebhookData): Promise<WebhookConfig | null>;
|
|
134
|
+
deleteWebhook(id: string): Promise<void>;
|
|
135
|
+
trigger(event: WebhookEvent, payloadData: Omit<WebhookPayload, "id" | "event" | "timestamp">): Promise<WebhookTriggerResult[]>;
|
|
136
|
+
triggerWebhook(webhook: WebhookConfig, payload: WebhookPayload): Promise<WebhookTriggerResult>;
|
|
137
|
+
testWebhook(webhookId: string): Promise<WebhookTriggerResult | null>;
|
|
138
|
+
getDeliveryHistory(webhookId: string, limit?: number): Promise<WebhookDelivery[]>;
|
|
139
|
+
retryDelivery(deliveryId: string): Promise<WebhookTriggerResult | null>;
|
|
140
|
+
}
|
|
141
|
+
declare function createWebhookService(db: BaseAdapter): WebhookService;
|
|
142
|
+
|
|
143
|
+
export { ALL_WEBHOOK_EVENTS as A, type CreateWebhookData as C, type DeliveryResult as D, type UpdateWebhookData as U, type WebhookPayload as W, type WebhookDelivery as a, type WebhookConfig as b, type DeliveryOptions as c, WebhookService as d, WEBHOOK_COLLECTION as e, WEBHOOK_DELIVERY_COLLECTION as f, WEBHOOK_EVENTS as g, type WebhookEvent as h, type WebhookTriggerResult as i, createWebhookService as j };
|
|
@@ -0,0 +1,143 @@
|
|
|
1
|
+
import { B as BaseAdapter } from './types-6ShQp2EM.cjs';
|
|
2
|
+
|
|
3
|
+
declare const WEBHOOK_EVENTS: {
|
|
4
|
+
readonly COLLECTION_CREATE: "collection.create";
|
|
5
|
+
readonly COLLECTION_UPDATE: "collection.update";
|
|
6
|
+
readonly COLLECTION_DELETE: "collection.delete";
|
|
7
|
+
readonly MEDIA_UPLOAD: "media.upload";
|
|
8
|
+
readonly MEDIA_DELETE: "media.delete";
|
|
9
|
+
readonly AUTH_LOGIN: "auth.login";
|
|
10
|
+
readonly AUTH_REGISTER: "auth.register";
|
|
11
|
+
readonly AUTH_LOGOUT: "auth.logout";
|
|
12
|
+
readonly ORDER_CREATED: "order.created";
|
|
13
|
+
readonly ORDER_PAID: "order.paid";
|
|
14
|
+
readonly ORDER_SHIPPED: "order.shipped";
|
|
15
|
+
readonly ORDER_DELIVERED: "order.delivered";
|
|
16
|
+
};
|
|
17
|
+
type WebhookEvent = (typeof WEBHOOK_EVENTS)[keyof typeof WEBHOOK_EVENTS];
|
|
18
|
+
declare const ALL_WEBHOOK_EVENTS: WebhookEvent[];
|
|
19
|
+
type WebhookActionType = "generic" | "github-push";
|
|
20
|
+
interface WebhookActionConfig {
|
|
21
|
+
githubOwner?: string;
|
|
22
|
+
githubRepo?: string;
|
|
23
|
+
githubBranch?: string;
|
|
24
|
+
}
|
|
25
|
+
interface WebhookConfig {
|
|
26
|
+
id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
url: string;
|
|
29
|
+
events: WebhookEvent[];
|
|
30
|
+
collections?: string[];
|
|
31
|
+
status: "active" | "inactive" | "error";
|
|
32
|
+
secret?: string;
|
|
33
|
+
headers?: Record<string, string>;
|
|
34
|
+
action?: WebhookActionType;
|
|
35
|
+
config?: WebhookActionConfig;
|
|
36
|
+
lastTriggered?: string;
|
|
37
|
+
lastError?: string;
|
|
38
|
+
createdAt: string;
|
|
39
|
+
updatedAt: string;
|
|
40
|
+
}
|
|
41
|
+
interface CreateWebhookData {
|
|
42
|
+
name: string;
|
|
43
|
+
url: string;
|
|
44
|
+
events: (WebhookEvent | "create" | "update" | "delete")[];
|
|
45
|
+
collections?: string[];
|
|
46
|
+
status?: "active" | "inactive";
|
|
47
|
+
secret?: string;
|
|
48
|
+
headers?: Record<string, string>;
|
|
49
|
+
action?: WebhookActionType;
|
|
50
|
+
config?: WebhookActionConfig;
|
|
51
|
+
}
|
|
52
|
+
interface UpdateWebhookData {
|
|
53
|
+
name?: string;
|
|
54
|
+
url?: string;
|
|
55
|
+
events?: (WebhookEvent | "create" | "update" | "delete")[];
|
|
56
|
+
collections?: string[];
|
|
57
|
+
status?: "active" | "inactive" | "error";
|
|
58
|
+
secret?: string;
|
|
59
|
+
headers?: Record<string, string>;
|
|
60
|
+
action?: WebhookActionType;
|
|
61
|
+
config?: WebhookActionConfig;
|
|
62
|
+
lastTriggered?: string | null;
|
|
63
|
+
lastError?: string | null;
|
|
64
|
+
}
|
|
65
|
+
interface WebhookPayload {
|
|
66
|
+
id: string;
|
|
67
|
+
event: WebhookEvent;
|
|
68
|
+
timestamp: string;
|
|
69
|
+
collection?: string;
|
|
70
|
+
operation?: "create" | "update" | "delete";
|
|
71
|
+
data?: unknown;
|
|
72
|
+
previousData?: unknown;
|
|
73
|
+
user?: {
|
|
74
|
+
id: string;
|
|
75
|
+
email?: string;
|
|
76
|
+
role?: string;
|
|
77
|
+
};
|
|
78
|
+
tenantId?: string;
|
|
79
|
+
metadata?: Record<string, unknown>;
|
|
80
|
+
}
|
|
81
|
+
interface WebhookDelivery {
|
|
82
|
+
id: string;
|
|
83
|
+
webhookId: string;
|
|
84
|
+
event: WebhookEvent;
|
|
85
|
+
payload: WebhookPayload;
|
|
86
|
+
attempt: number;
|
|
87
|
+
status: "pending" | "success" | "failed" | "retrying";
|
|
88
|
+
responseStatus?: number;
|
|
89
|
+
responseBody?: string;
|
|
90
|
+
error?: string;
|
|
91
|
+
duration?: number;
|
|
92
|
+
createdAt: string;
|
|
93
|
+
deliveredAt?: string;
|
|
94
|
+
nextRetryAt?: string;
|
|
95
|
+
}
|
|
96
|
+
interface WebhookTriggerResult {
|
|
97
|
+
deliveryId: string;
|
|
98
|
+
webhookId: string;
|
|
99
|
+
event: WebhookEvent;
|
|
100
|
+
status: "queued" | "success" | "failed";
|
|
101
|
+
responseStatus?: number;
|
|
102
|
+
duration?: number;
|
|
103
|
+
error?: string;
|
|
104
|
+
}
|
|
105
|
+
declare const WEBHOOK_COLLECTION = "_webhooks";
|
|
106
|
+
declare const WEBHOOK_DELIVERY_COLLECTION = "_webhook_deliveries";
|
|
107
|
+
interface DeliveryResult {
|
|
108
|
+
success: boolean;
|
|
109
|
+
status: number;
|
|
110
|
+
statusText?: string;
|
|
111
|
+
body?: string;
|
|
112
|
+
duration: number;
|
|
113
|
+
error?: string;
|
|
114
|
+
}
|
|
115
|
+
interface DeliveryOptions {
|
|
116
|
+
timeout?: number;
|
|
117
|
+
maxRetries?: number;
|
|
118
|
+
retryDelay?: number;
|
|
119
|
+
onRetry?: (attempt: number, error: string) => void;
|
|
120
|
+
onSuccess?: (result: DeliveryResult) => void;
|
|
121
|
+
onFailure?: (error: string) => void;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
declare class WebhookService {
|
|
125
|
+
private db;
|
|
126
|
+
constructor(db: BaseAdapter);
|
|
127
|
+
getWebhooks(filters?: {
|
|
128
|
+
status?: string;
|
|
129
|
+
event?: WebhookEvent;
|
|
130
|
+
}): Promise<WebhookConfig[]>;
|
|
131
|
+
getWebhookById(id: string): Promise<WebhookConfig | null>;
|
|
132
|
+
createWebhook(data: CreateWebhookData): Promise<WebhookConfig>;
|
|
133
|
+
updateWebhook(id: string, data: UpdateWebhookData): Promise<WebhookConfig | null>;
|
|
134
|
+
deleteWebhook(id: string): Promise<void>;
|
|
135
|
+
trigger(event: WebhookEvent, payloadData: Omit<WebhookPayload, "id" | "event" | "timestamp">): Promise<WebhookTriggerResult[]>;
|
|
136
|
+
triggerWebhook(webhook: WebhookConfig, payload: WebhookPayload): Promise<WebhookTriggerResult>;
|
|
137
|
+
testWebhook(webhookId: string): Promise<WebhookTriggerResult | null>;
|
|
138
|
+
getDeliveryHistory(webhookId: string, limit?: number): Promise<WebhookDelivery[]>;
|
|
139
|
+
retryDelivery(deliveryId: string): Promise<WebhookTriggerResult | null>;
|
|
140
|
+
}
|
|
141
|
+
declare function createWebhookService(db: BaseAdapter): WebhookService;
|
|
142
|
+
|
|
143
|
+
export { ALL_WEBHOOK_EVENTS as A, type CreateWebhookData as C, type DeliveryResult as D, type UpdateWebhookData as U, type WebhookPayload as W, type WebhookDelivery as a, type WebhookConfig as b, type DeliveryOptions as c, WebhookService as d, WEBHOOK_COLLECTION as e, WEBHOOK_DELIVERY_COLLECTION as f, WEBHOOK_EVENTS as g, type WebhookEvent as h, type WebhookTriggerResult as i, createWebhookService as j };
|