@beignet/provider-inngest 0.0.3 → 0.0.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/README.md +23 -9
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/package.json +31 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,33 @@
|
|
|
1
1
|
# @beignet/provider-inngest
|
|
2
2
|
|
|
3
|
+
## 0.0.4
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 8bcb31f: Mark package READMEs with Beignet's experimental alpha status and 0.0.x stability expectations.
|
|
8
|
+
- d137044: Declare `@beignet/core` as a peer dependency with a lockstep version range in
|
|
9
|
+
every integration and provider package instead of a regular `"*"` dependency.
|
|
10
|
+
Installs now always resolve a single shared copy of core, so `instanceof`
|
|
11
|
+
checks such as `isContractError` and upload error identity keep working, and
|
|
12
|
+
mixed Beignet versions fail loudly at install time instead of at runtime.
|
|
13
|
+
|
|
14
|
+
If your package manager does not install peer dependencies automatically, add
|
|
15
|
+
`@beignet/core` to your app alongside these packages. `@beignet/nuqs` now also
|
|
16
|
+
declares `@beignet/react-query` as a peer dependency, and
|
|
17
|
+
`@beignet/provider-storage-s3` now expects you to install
|
|
18
|
+
`@aws-sdk/client-s3` and `@aws-sdk/s3-request-presigner` yourself, matching
|
|
19
|
+
how other providers treat their SDKs.
|
|
20
|
+
|
|
21
|
+
- 603478f: Align package documentation with the canonical route registry and AppContext conventions.
|
|
22
|
+
- 1a79090: Emit Node-compatible ESM: all relative imports in published packages now carry explicit .js extensions, fixing ERR_MODULE_NOT_FOUND when running the CLI or importing package dist files under plain Node.
|
|
23
|
+
- 5a51869: Add schedule run attempt metadata and align durable workflow retry, backoff, terminal failure, and dead-letter documentation.
|
|
24
|
+
- 69b8c35: Stop declaring `INNGEST_APP_NAME` as required provider env metadata. The provider defaults the app name to `"beignet-app"`, so `beignet doctor` no longer warns when `INNGEST_APP_NAME` is absent from app env files.
|
|
25
|
+
- 44f1192: Move first-party provider diagnostics to package-owned `beignet.provider`
|
|
26
|
+
manifest metadata and have doctor read installed provider package manifests.
|
|
27
|
+
- 2aa77ca: Add static provider metadata and provider wiring diagnostics for generated apps.
|
|
28
|
+
- 03b1743: Document durable workflow provider conventions for retries, backoff, dead-letter state, and unsupported provider semantics.
|
|
29
|
+
- 8063d38: Rename the contract front door to `defineContract`/`defineContractGroup`, rename operational commands to tasks (`@beignet/core/tasks`, `defineTasks`, `runTask`, `beignet task run`, `beignet make task`, `server/tasks.ts`, `features/<feature>/tasks/`, `paths.tasks`), and standardize context binding: context-free declarations stay top-level (`defineEvent`), while context-bound definitions come from per-capability factories (`createListeners`, `createJobs`, `createSchedules`, `createNotifications`, `createTasks`) called once in `lib/`. Top-level context-generic `defineListener`, `defineJob`, `defineSchedule`, and `defineNotification` are removed.
|
|
30
|
+
|
|
3
31
|
## 0.0.3
|
|
4
32
|
|
|
5
33
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -1,5 +1,9 @@
|
|
|
1
1
|
# @beignet/provider-inngest
|
|
2
2
|
|
|
3
|
+
> [!CAUTION]
|
|
4
|
+
> Beignet is experimental alpha software. The `0.0.x` package line is for early
|
|
5
|
+
> evaluation, and APIs may change between releases while the framework settles.
|
|
6
|
+
|
|
3
7
|
Inngest-backed `JobDispatcherPort` provider for Beignet applications.
|
|
4
8
|
|
|
5
9
|
The provider installs the app-facing `ctx.ports.jobs` dispatcher for durable
|
|
@@ -29,7 +33,7 @@ const appPorts = definePorts({});
|
|
|
29
33
|
export const server = await createNextServer({
|
|
30
34
|
ports: appPorts,
|
|
31
35
|
providers: [inngestProvider],
|
|
32
|
-
|
|
36
|
+
context: ({ ports }) => ({
|
|
33
37
|
ports,
|
|
34
38
|
}),
|
|
35
39
|
routes,
|
|
@@ -47,12 +51,12 @@ Define jobs with `@beignet/core/jobs`, then dispatch them through
|
|
|
47
51
|
`ctx.ports.jobs`:
|
|
48
52
|
|
|
49
53
|
```typescript
|
|
50
|
-
import {
|
|
54
|
+
import { createJobs, retry } from "@beignet/core/jobs";
|
|
51
55
|
import { z } from "zod";
|
|
52
56
|
|
|
53
|
-
const
|
|
57
|
+
const { defineJob } = createJobs<AppContext>();
|
|
54
58
|
|
|
55
|
-
export const SendInviteEmailJob =
|
|
59
|
+
export const SendInviteEmailJob = defineJob("mail.invite.send", {
|
|
56
60
|
payload: z.object({
|
|
57
61
|
inviteId: z.string(),
|
|
58
62
|
inviteeEmail: z.string().email(),
|
|
@@ -69,7 +73,7 @@ export const SendInviteEmailJob = jobs.defineJob("mail.invite.send", {
|
|
|
69
73
|
},
|
|
70
74
|
});
|
|
71
75
|
|
|
72
|
-
async function inviteUser(ctx:
|
|
76
|
+
async function inviteUser(ctx: AppContext, input: InviteUserInput) {
|
|
73
77
|
const invite = await ctx.ports.db.invites.create({
|
|
74
78
|
inviterId: ctx.actor.id,
|
|
75
79
|
inviteeEmail: input.email,
|
|
@@ -194,14 +198,14 @@ and dispatch the job from the listener:
|
|
|
194
198
|
|
|
195
199
|
```typescript
|
|
196
200
|
// features/users/listeners.ts
|
|
197
|
-
import {
|
|
201
|
+
import { createListeners } from "@beignet/core/events";
|
|
198
202
|
import { UserInvited } from "@/features/users/domain/events";
|
|
199
203
|
import { SendInviteEmailJob } from "@/features/users/jobs";
|
|
200
|
-
import type {
|
|
204
|
+
import type { AppContext } from "@/app-context";
|
|
201
205
|
|
|
202
|
-
const
|
|
206
|
+
const { defineListener } = createListeners<AppContext>();
|
|
203
207
|
|
|
204
|
-
export const sendInviteEmail =
|
|
208
|
+
export const sendInviteEmail = defineListener(UserInvited, {
|
|
205
209
|
name: "mail.send-invite-email",
|
|
206
210
|
async handle({ payload, ctx }) {
|
|
207
211
|
await ctx.ports.jobs.dispatch(SendInviteEmailJob, {
|
|
@@ -232,6 +236,16 @@ backoff fields, jitter, and `retryIf` classification are outbox-worker
|
|
|
232
236
|
semantics; `createInngestJobFunction(...)` fails fast if a job policy includes
|
|
233
237
|
retry behavior that the adapter cannot honor.
|
|
234
238
|
|
|
239
|
+
The Beignet terms still apply: `attempts` is the maximum total attempts,
|
|
240
|
+
including the first try, while Inngest's `retries` setting is the number of
|
|
241
|
+
retries after the first try. Inngest owns backoff and terminal failure handling
|
|
242
|
+
for direct Inngest jobs. Use the Beignet outbox when the app needs Beignet-owned
|
|
243
|
+
backoff, retry classification, or dead-letter state.
|
|
244
|
+
|
|
245
|
+
This is the provider convention for external job systems: map the Beignet
|
|
246
|
+
semantics the provider can actually honor, document the mapping, and fail fast
|
|
247
|
+
for retry fields that would otherwise be silently ignored.
|
|
248
|
+
|
|
235
249
|
Define functions separately from your Beignet server, usually in a
|
|
236
250
|
serverless function or route handler:
|
|
237
251
|
|
package/dist/index.d.ts
CHANGED
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;;;;;;;;;GA0BG;AAEH,OAAO,KAAK,EAEV,MAAM,EACN,YAAY,EACZ,cAAc,EACf,MAAM,oBAAoB,CAAC;AAE5B,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAC;AAC7D,OAAO,EAGL,KAAK,6BAA6B,EACnC,MAAM,yBAAyB,CAAC;AACjC,OAAO,EAAE,OAAO,EAAE,KAAK,eAAe,EAAE,MAAM,SAAS,CAAC;AACxD,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;;GAGG;AACH,QAAA,MAAM,mBAAmB;;;iBAYvB,CAAC;AAEH;;GAEG;AACH,MAAM,MAAM,aAAa,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,mBAAmB,CAAC,CAAC;AAEhE;;;GAGG;AACH,MAAM,WAAW,WAAW;IAC1B;;;OAGG;IACH,MAAM,EAAE,OAAO,CAAC;IAEhB;;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AC;IACrB;;OAEG;IACH,GAAG,CAAC,EAAE,yBAAyB,CAAC,GAAG,CAAC,CAAC;IACrC;;OAEG;IACH,eAAe,CAAC,EAAE,iCAAiC,CAAC;CACrD;AAgED;;GAEG;AACH,wBAAgB,0BAA0B,CACxC,MAAM,EAAE,OAAO,EACf,OAAO,GAAE,2BAAgC,GACxC,iBAAiB,CAoCnB;AAED;;;;;;GAMG;AACH,wBAAgB,wBAAwB,CACtC,GAAG,EACH,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,cAAc,EAAE,GAAG,CAAC,EAC7C,OAAO,EAAE,+BAA+B,CAAC,CAAC,EAAE,GAAG,CAAC,GAAG,eAAe,CAAC,GAAG,CAyDvE;AAED;;;;;;;;;;;;;;;;;;;GAmBG;AACH,eAAO,MAAM,eAAe;;;;;;iBA4D1B,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@beignet/provider-inngest",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.4",
|
|
4
4
|
"type": "module",
|
|
5
5
|
"description": "Inngest provider for Beignet - adds inngest port for background jobs and events",
|
|
6
6
|
"main": "./dist/index.js",
|
|
@@ -54,11 +54,11 @@
|
|
|
54
54
|
"node": ">=18.0.0"
|
|
55
55
|
},
|
|
56
56
|
"peerDependencies": {
|
|
57
|
+
"@beignet/core": ">=0.0.3 <1.0.0",
|
|
57
58
|
"inngest": "^3.0.0"
|
|
58
59
|
},
|
|
59
60
|
"dependencies": {
|
|
60
|
-
"zod": "^4.0.0"
|
|
61
|
-
"@beignet/core": "*"
|
|
61
|
+
"zod": "^4.0.0"
|
|
62
62
|
},
|
|
63
63
|
"devDependencies": {
|
|
64
64
|
"@beignet/devtools": "*",
|
|
@@ -66,5 +66,33 @@
|
|
|
66
66
|
"@types/node": "^20.10.0",
|
|
67
67
|
"inngest": "^3.0.0",
|
|
68
68
|
"typescript": "^5.3.0"
|
|
69
|
+
},
|
|
70
|
+
"beignet": {
|
|
71
|
+
"provider": {
|
|
72
|
+
"displayName": "Inngest provider",
|
|
73
|
+
"ports": [
|
|
74
|
+
"inngest",
|
|
75
|
+
"jobs"
|
|
76
|
+
],
|
|
77
|
+
"appPorts": [
|
|
78
|
+
{
|
|
79
|
+
"name": "jobs",
|
|
80
|
+
"type": "JobDispatcherPort"
|
|
81
|
+
}
|
|
82
|
+
],
|
|
83
|
+
"env": [
|
|
84
|
+
"INNGEST_APP_NAME",
|
|
85
|
+
"INNGEST_EVENT_KEY"
|
|
86
|
+
],
|
|
87
|
+
"watchers": [
|
|
88
|
+
"jobs"
|
|
89
|
+
],
|
|
90
|
+
"registration": {
|
|
91
|
+
"required": true,
|
|
92
|
+
"tokens": [
|
|
93
|
+
"inngestProvider"
|
|
94
|
+
]
|
|
95
|
+
}
|
|
96
|
+
}
|
|
69
97
|
}
|
|
70
98
|
}
|