@quickback-dev/cli 0.47.8 → 0.47.9
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 +3 -1
- package/dist/codex/AGENTS.md +290 -0
- package/dist/commands/codex.d.ts +16 -0
- package/dist/commands/codex.d.ts.map +1 -0
- package/dist/commands/codex.js +159 -0
- package/dist/commands/codex.js.map +1 -0
- package/dist/commands/compile.d.ts +5 -0
- package/dist/commands/compile.d.ts.map +1 -1
- package/dist/commands/compile.js +12 -2
- package/dist/commands/compile.js.map +1 -1
- package/dist/commands/create.d.ts.map +1 -1
- package/dist/commands/create.js +1 -1
- package/dist/commands/create.js.map +1 -1
- package/dist/commands/dev.d.ts +16 -0
- package/dist/commands/dev.d.ts.map +1 -0
- package/dist/commands/dev.js +117 -0
- package/dist/commands/dev.js.map +1 -0
- package/dist/commands/init.d.ts +6 -0
- package/dist/commands/init.d.ts.map +1 -0
- package/dist/commands/init.js +405 -0
- package/dist/commands/init.js.map +1 -0
- package/dist/docs/content.d.ts.map +1 -1
- package/dist/docs/content.js +15 -5
- package/dist/docs/content.js.map +1 -1
- package/dist/index.js +4 -2
- package/dist/index.js.map +1 -1
- package/dist/lib/api-client.d.ts +13 -1
- package/dist/lib/api-client.d.ts.map +1 -1
- package/dist/lib/api-client.js +47 -20
- package/dist/lib/api-client.js.map +1 -1
- package/dist/lib/api-client.test.js +78 -0
- package/dist/lib/api-client.test.js.map +1 -1
- package/dist/lib/file-loader.d.ts +11 -0
- package/dist/lib/file-loader.d.ts.map +1 -1
- package/dist/lib/file-loader.js +35 -0
- package/dist/lib/file-loader.js.map +1 -1
- package/dist/lib/sweep-stale.d.ts +25 -0
- package/dist/lib/sweep-stale.d.ts.map +1 -0
- package/dist/lib/sweep-stale.js +179 -0
- package/dist/lib/sweep-stale.js.map +1 -0
- package/dist/lib/sweep-stale.test.d.ts +2 -0
- package/dist/lib/sweep-stale.test.d.ts.map +1 -0
- package/dist/lib/sweep-stale.test.js +130 -0
- package/dist/lib/sweep-stale.test.js.map +1 -0
- package/dist/skill/docs/changelog.md +19 -0
- package/dist/skill/docs/compiler/cloud-compiler/cli.md +3 -0
- package/dist/skill/docs/compiler/definitions/encryption.md +117 -1
- package/dist/skill/docs/compiler/definitions/masking.md +32 -0
- package/dist/skill/docs/compiler/definitions/rate-limit.md +216 -0
- package/dist/skill/docs/compiler/definitions/sealed-protocol.md +332 -0
- package/dist/skill/docs/stack/webhooks/inbound.md +62 -5
- package/package.json +1 -1
- package/src/skill/docs/changelog.md +43 -0
- package/src/skill/docs/compiler/cloud-compiler/cli.md +3 -0
- package/src/skill/docs/compiler/definitions/encryption.md +117 -1
- package/src/skill/docs/compiler/definitions/masking.md +32 -0
- package/src/skill/docs/compiler/definitions/rate-limit.md +216 -0
- package/src/skill/docs/compiler/definitions/sealed-protocol.md +332 -0
- package/src/skill/docs/compiler/definitions/triggers.md +5 -0
- package/src/skill/docs/stack/schedules/index.md +60 -0
- package/src/skill/docs/stack/webhooks/inbound.md +62 -5
|
@@ -37,7 +37,8 @@ Use `onWebhookEvent()` in your action code to register handlers for specific eve
|
|
|
37
37
|
|
|
38
38
|
```typescript
|
|
39
39
|
onWebhookEvent("stripe:checkout.session.completed", async (ctx) => {
|
|
40
|
-
const { type, data, provider, env } = ctx;
|
|
40
|
+
const { type, data, event, provider, env } = ctx;
|
|
41
|
+
// ctx.event is the full Stripe envelope; ctx.data is event.data.object
|
|
41
42
|
await createSubscription(data, env);
|
|
42
43
|
});
|
|
43
44
|
|
|
@@ -51,11 +52,31 @@ onWebhookEvent("stripe:*", async (ctx) => {
|
|
|
51
52
|
|
|
52
53
|
| Field | Type | Description |
|
|
53
54
|
|-------|------|-------------|
|
|
54
|
-
| `type` | `string` |
|
|
55
|
-
| `data` | `unknown` |
|
|
55
|
+
| `type` | `string` | Event type (e.g., `checkout.session.completed`) |
|
|
56
|
+
| `data` | `unknown` | The convenience slice of the payload. For Stripe this is `event.data.object`. |
|
|
57
|
+
| `event` | `unknown` | The **full event envelope**, exactly as the provider sent it — nothing dropped. For Stripe this carries `account` (Connect connected-account id), `id`, `livemode`, `api_version`, `request`, etc. |
|
|
56
58
|
| `provider` | `string` | Provider name (e.g., `stripe`) |
|
|
57
59
|
| `env` | `CloudflareBindings` | Cloudflare environment bindings |
|
|
58
60
|
|
|
61
|
+
For `stripe:` patterns the context is typed automatically: `ctx.event` is a
|
|
62
|
+
`StripeWebhookEvent` and `ctx.data` is its `data.object`, so `ctx.event.account`,
|
|
63
|
+
`ctx.event.id`, and `ctx.event.livemode` are all typed with no cast.
|
|
64
|
+
|
|
65
|
+
```typescript
|
|
66
|
+
onWebhookEvent("stripe:invoice.paid", async (ctx) => {
|
|
67
|
+
ctx.event.account; // string | undefined — the acct_… (Connect)
|
|
68
|
+
ctx.event.id; // string — evt_…
|
|
69
|
+
ctx.event.livemode; // boolean
|
|
70
|
+
ctx.data; // event.data.object (Record<string, unknown>)
|
|
71
|
+
});
|
|
72
|
+
```
|
|
73
|
+
|
|
74
|
+
`data.object` is an open record. Cast it when you need inner-field typing:
|
|
75
|
+
|
|
76
|
+
```typescript
|
|
77
|
+
const session = ctx.data as import("stripe").Stripe.Checkout.Session;
|
|
78
|
+
```
|
|
79
|
+
|
|
59
80
|
**Execution order:**
|
|
60
81
|
1. Specific handlers run first (exact match on event type)
|
|
61
82
|
2. Wildcard handlers run after
|
|
@@ -80,6 +101,41 @@ The signed payload is `<timestamp>.<raw_body>`. Verification checks:
|
|
|
80
101
|
- HMAC matches
|
|
81
102
|
- Timestamp is within 5 minutes (prevents replay attacks)
|
|
82
103
|
|
|
104
|
+
#### Stripe Connect
|
|
105
|
+
|
|
106
|
+
The single-secret model is exactly what a Connect platform needs. With Standard
|
|
107
|
+
connected accounts and direct charges, each of your customers connects their own
|
|
108
|
+
Stripe account, and **one** webhook endpoint on your platform receives events
|
|
109
|
+
from **all** connected accounts — every delivery signed with your **one**
|
|
110
|
+
platform signing secret.
|
|
111
|
+
|
|
112
|
+
1. In the Stripe Dashboard, add a webhook endpoint pointing at
|
|
113
|
+
`https://<your-api>/webhooks/v1/inbound/stripe` and enable **"Listen to
|
|
114
|
+
events on Connected accounts."**
|
|
115
|
+
2. Set that endpoint's signing secret as `STRIPE_WEBHOOK_SECRET` (one secret
|
|
116
|
+
covers every connected account — no per-account configuration).
|
|
117
|
+
|
|
118
|
+
To know **which connected account** an event belongs to, read the top-level
|
|
119
|
+
`event.account` (an `acct_…` id) off the envelope via `ctx.event.account`. It is
|
|
120
|
+
**not** inside `event.data.object`.
|
|
121
|
+
|
|
122
|
+
```typescript
|
|
123
|
+
onWebhookEvent("stripe:checkout.session.completed", async (ctx) => {
|
|
124
|
+
const connectedAccount = ctx.event.account; // acct_… — which organizer
|
|
125
|
+
if (!connectedAccount) return; // platform-account event, ignore
|
|
126
|
+
|
|
127
|
+
// Route to the org that owns this connected account, and validate the match.
|
|
128
|
+
const org = await findOrgByStripeAccount(connectedAccount, ctx.env);
|
|
129
|
+
if (!org) throw new Error(`Unknown connected account ${connectedAccount}`);
|
|
130
|
+
|
|
131
|
+
await fulfillOrder(ctx.data, org, ctx.env);
|
|
132
|
+
});
|
|
133
|
+
```
|
|
134
|
+
|
|
135
|
+
`ctx.data` remains `event.data.object` (the Checkout Session) for convenience;
|
|
136
|
+
`ctx.event` gives you the rest of the envelope — `account`, `id`, `livemode`,
|
|
137
|
+
`api_version`, `request` — so nothing about the delivery is lost.
|
|
138
|
+
|
|
83
139
|
### Custom Providers
|
|
84
140
|
|
|
85
141
|
Providers implement this interface:
|
|
@@ -90,8 +146,9 @@ interface InboundProvider {
|
|
|
90
146
|
verifySignature(payload: string, signature: string, secret: string): Promise<boolean>;
|
|
91
147
|
parseEvent(payload: string): {
|
|
92
148
|
type: string;
|
|
93
|
-
data: unknown;
|
|
94
|
-
externalId?: string;
|
|
149
|
+
data: unknown; // convenience slice (e.g. Stripe's data.object)
|
|
150
|
+
externalId?: string; // provider event id, for idempotency
|
|
151
|
+
envelope?: unknown; // full event envelope, when available
|
|
95
152
|
};
|
|
96
153
|
}
|
|
97
154
|
```
|