@pikku/skills 0.12.47 → 0.12.50
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/skills.gen.js +2 -2
- package/package.json +1 -1
- package/skills/pikku-addon/SKILL.md +6 -0
- package/skills/pikku-addon/references/openapi.md +1 -1
- package/skills/pikku-architect/SKILL.md +64 -55
- package/skills/pikku-architect/references/plan-defects.md +14 -14
- package/skills/pikku-build/SKILL.md +17 -16
- package/skills/pikku-build/references/app.md +88 -123
- package/skills/pikku-build/references/design.md +13 -13
- package/skills/pikku-build/references/multi-app.md +1 -1
- package/skills/pikku-build/references/platform.md +7 -7
- package/skills/pikku-build/references/quick.md +7 -6
- package/skills/pikku-build/references/scenarios.md +19 -19
- package/skills/pikku-build/references/ship.md +8 -8
- package/skills/pikku-changes/SKILL.md +73 -27
- package/skills/pikku-fabric/SKILL.md +16 -0
- package/skills/pikku-knowledge/SKILL.md +41 -81
- package/skills/pikku-kysely/SKILL.md +19 -0
- package/skills/pikku-wiring/references/trigger.md +19 -6
|
@@ -107,17 +107,30 @@ subscribe to its events as `<source>:<event>`:
|
|
|
107
107
|
- The route is `POST /webhooks/<name>` unless `method`/`route` say otherwise.
|
|
108
108
|
`method` may be a list, e.g. `['get', 'post']` for a provider that verifies
|
|
109
109
|
the URL with a GET and delivers events with a POST, or `['head', 'post']`
|
|
110
|
-
for one that checks the URL with a HEAD.
|
|
111
|
-
It needs no session.
|
|
110
|
+
for one that checks the URL with a HEAD. A HEAD is answered with a `200`
|
|
111
|
+
before `verify` or `receive` run. It needs no session.
|
|
112
112
|
- `events` maps each event name to a schema. An event that fails its schema is
|
|
113
113
|
logged and dropped; so is one no `wireTrigger` listens for. Both still get a
|
|
114
114
|
`200`, so the provider does not retry forever.
|
|
115
|
-
- `receive(services, { body, headers, method, url, query })` gets the
|
|
116
|
-
bytes** and only parses them: it returns `{ events: [{ name, id?, data }] }
|
|
117
|
-
|
|
115
|
+
- `receive(services, { body, headers, method, url, query }, { http })` gets the
|
|
116
|
+
**raw bytes** and only parses them: it returns `{ events: [{ name, id?, data }] }`.
|
|
117
|
+
A handshake returns nothing and answers through `http.response`
|
|
118
|
+
(`http.response.header('x-hook-secret', secret)`,
|
|
119
|
+
`http.response.json({ challenge })`), which is sent only then. Throwing
|
|
118
120
|
rejects the request with the error's status (`UnauthorizedError` → 401).
|
|
119
121
|
Omitted, the JSON body becomes one event dispatched to a trigger named just
|
|
120
122
|
`<source>`.
|
|
123
|
+
- A named `receive` is declared with `pikkuWebhookReceive` from `#pikku/trigger`
|
|
124
|
+
(`#pikku/addon/trigger` in an addon), never `pikkuSessionlessFunc`: it is
|
|
125
|
+
public, typed to the request, and never callable as an RPC. The inspector
|
|
126
|
+
rejects any other wrapper. `parseJson` from `#pikku/utils`
|
|
127
|
+
(`#pikku/addon/utils`) parses the bytes and answers a body that is not JSON
|
|
128
|
+
with a 400:
|
|
129
|
+
|
|
130
|
+
```ts snippet:pikkuWebhookReceive
|
|
131
|
+
|
|
132
|
+
```
|
|
133
|
+
|
|
121
134
|
- Every accepted event is queued on `pikku-incoming-webhooks` and run by a
|
|
122
135
|
generated worker, so the provider is answered quickly and a failing trigger is
|
|
123
136
|
retried by the queue. This needs a `queueService` and an
|
|
@@ -150,7 +163,7 @@ subscribe to its events as `<source>:<event>`:
|
|
|
150
163
|
`timingSafeStringEqual` in `@pikku/core/hmac`.
|
|
151
164
|
|
|
152
165
|
A request with a body that fails is refused with a 401. A bodiless request
|
|
153
|
-
that fails (a
|
|
166
|
+
that fails (a validation token in the query) still reaches
|
|
154
167
|
`receive` so it can answer the handshake, but any events it returns are
|
|
155
168
|
refused. A handshake that hands over the secret (Asana) stores it with
|
|
156
169
|
`credentialService.set` under the same credential name.
|