@cronvello/sdk 0.1.2 → 0.1.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/dist/next.cjs.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/adapters/next.ts"],"names":[],"mappings":";;;AA2BO,SAAS,YAAY,GAAA,EAAwC;AAClE,EAAA,OAAO,OAAO,GAAA,KAAQ;AACpB,IAAA,MAAM,OAAA,GAAU,MAAM,GAAA,CAAI,IAAA,EAAK;AAC/B,IAAA,MAAM,UAAkC,EAAC;AACzC,IAAA,GAAA,CAAI,OAAA,CAAQ,OAAA,GAAU,CAAC,KAAA,EAAO,GAAA,KAAQ;AACpC,MAAA,OAAA,CAAQ,GAAA,CAAI,WAAA,EAAa,CAAA,GAAI,KAAA;AAAA,IAC/B,CAAC,CAAA;AACD,IAAA,MAAM,MAAA,GAAS,MAAM,GAAA,CAAI,MAAA,CAAO;AAAA,MAC9B,QAAQ,GAAA,CAAI,MAAA;AAAA,MACZ,aAAA,EAAe,GAAA,CAAI,OAAA,CAAQ,GAAA,CAAI,eAAe,CAAA,IAAK,MAAA;AAAA,MACnD,OAAA;AAAA,MACA;AAAA,KACD,CAAA;AACD,IAAA,OAAO,IAAI,QAAA,CAAS,IAAA,CAAK,SAAA,CAAU,MAAA,CAAO,IAAI,CAAA,EAAG;AAAA,MAC/C,QAAQ,MAAA,CAAO,MAAA;AAAA,MACf,OAAA,EAAS,EAAE,cAAA,EAAgB,kBAAA;AAAmB,KAC/C,CAAA;AAAA,EACH,CAAA;AACF","file":"next.cjs","sourcesContent":["/**\n * Next.js App Router adapter (Route Handlers). Zero dependency on `next` — uses the Web\n * Fetch `Request`/`Response` globals (Node 18+ and the edge runtime).\n *\n * // app/cronvello/dispatch/route.ts\n * import { cronvello } from \"@/lib/cronvello\";\n * import { nextHandler } from \"@cronvello/sdk/next\";\n * export const POST = nextHandler(cronvello);\n *\n * On serverless hosts, prefer the default sync execution mode so the work finishes within the\n * request. async_callback needs a host that keeps running after the response (see docs).\n */\n\nimport type { DispatchHandler } from \"../registry/dispatch-handler.js\";\n\n/** Structural subset of the Web Fetch `Request` we rely on. */\nexport interface FetchRequestLike {\n method: string;\n headers: {\n get(name: string): string | null;\n forEach?(cb: (value: string, key: string) => void): void;\n };\n text(): Promise<string>;\n}\n\nexport type NextRouteHandler = (req: FetchRequestLike) => Promise<Response>;\n\nexport function nextHandler(app: DispatchHandler): NextRouteHandler {\n return async (req) => {\n const rawBody = await req.text();\n const headers: Record<string, string> = {};\n req.headers.forEach?.((value, key) => {\n headers[key.toLowerCase()] = value;\n });\n const result = await app.handle({\n method: req.method,\n authorization: req.headers.get(\"authorization\") ?? undefined,\n rawBody,\n headers,\n });\n return new Response(JSON.stringify(result.body), {\n status: result.status,\n headers: { \"content-type\": \"application/json\" },\n });\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/adapters/next.ts"],"names":[],"mappings":";;;AA2BO,SAAS,YAAY,GAAA,EAAwC;AAClE,EAAA,OAAO,OAAO,GAAA,KAAQ;AACpB,IAAA,MAAM,OAAA,GAAU,MAAM,GAAA,CAAI,IAAA,EAAK;AAC/B,IAAA,MAAM,UAAkC,EAAC;AACzC,IAAA,GAAA,CAAI,OAAA,CAAQ,OAAA,GAAU,CAAC,KAAA,EAAO,GAAA,KAAQ;AACpC,MAAA,OAAA,CAAQ,GAAA,CAAI,WAAA,EAAa,CAAA,GAAI,KAAA;AAAA,IAC/B,CAAC,CAAA;AACD,IAAA,MAAM,MAAA,GAAS,MAAM,GAAA,CAAI,MAAA,CAAO;AAAA,MAC9B,QAAQ,GAAA,CAAI,MAAA;AAAA,MACZ,aAAA,EAAe,GAAA,CAAI,OAAA,CAAQ,GAAA,CAAI,eAAe,CAAA,IAAK,MAAA;AAAA,MACnD,OAAA;AAAA,MACA;AAAA,KACD,CAAA;AACD,IAAA,OAAO,IAAI,QAAA,CAAS,IAAA,CAAK,SAAA,CAAU,MAAA,CAAO,IAAI,CAAA,EAAG;AAAA,MAC/C,QAAQ,MAAA,CAAO,MAAA;AAAA,MACf,OAAA,EAAS,EAAE,cAAA,EAAgB,kBAAA;AAAmB,KAC/C,CAAA;AAAA,EACH,CAAA;AACF","file":"next.cjs","sourcesContent":["/**\n * Next.js App Router adapter (Route Handlers). Zero dependency on `next` — uses the Web\n * Fetch `Request`/`Response` globals (Node 20+ and the edge runtime).\n *\n * // app/cronvello/dispatch/route.ts\n * import { cronvello } from \"@/lib/cronvello\";\n * import { nextHandler } from \"@cronvello/sdk/next\";\n * export const POST = nextHandler(cronvello);\n *\n * On serverless hosts, prefer the default sync execution mode so the work finishes within the\n * request. async_callback needs a host that keeps running after the response (see docs).\n */\n\nimport type { DispatchHandler } from \"../registry/dispatch-handler.js\";\n\n/** Structural subset of the Web Fetch `Request` we rely on. */\nexport interface FetchRequestLike {\n method: string;\n headers: {\n get(name: string): string | null;\n forEach?(cb: (value: string, key: string) => void): void;\n };\n text(): Promise<string>;\n}\n\nexport type NextRouteHandler = (req: FetchRequestLike) => Promise<Response>;\n\nexport function nextHandler(app: DispatchHandler): NextRouteHandler {\n return async (req) => {\n const rawBody = await req.text();\n const headers: Record<string, string> = {};\n req.headers.forEach?.((value, key) => {\n headers[key.toLowerCase()] = value;\n });\n const result = await app.handle({\n method: req.method,\n authorization: req.headers.get(\"authorization\") ?? undefined,\n rawBody,\n headers,\n });\n return new Response(JSON.stringify(result.body), {\n status: result.status,\n headers: { \"content-type\": \"application/json\" },\n });\n };\n}\n"]}
package/dist/next.d.cts CHANGED
@@ -1,8 +1,8 @@
1
- import { O as DispatchHandler } from './dispatch-handler-BNy-H5Nr.cjs';
1
+ import { O as DispatchHandler } from './dispatch-handler-DazGcFHz.cjs';
2
2
 
3
3
  /**
4
4
  * Next.js App Router adapter (Route Handlers). Zero dependency on `next` — uses the Web
5
- * Fetch `Request`/`Response` globals (Node 18+ and the edge runtime).
5
+ * Fetch `Request`/`Response` globals (Node 20+ and the edge runtime).
6
6
  *
7
7
  * // app/cronvello/dispatch/route.ts
8
8
  * import { cronvello } from "@/lib/cronvello";
package/dist/next.d.ts CHANGED
@@ -1,8 +1,8 @@
1
- import { O as DispatchHandler } from './dispatch-handler-BNy-H5Nr.js';
1
+ import { O as DispatchHandler } from './dispatch-handler-DazGcFHz.js';
2
2
 
3
3
  /**
4
4
  * Next.js App Router adapter (Route Handlers). Zero dependency on `next` — uses the Web
5
- * Fetch `Request`/`Response` globals (Node 18+ and the edge runtime).
5
+ * Fetch `Request`/`Response` globals (Node 20+ and the edge runtime).
6
6
  *
7
7
  * // app/cronvello/dispatch/route.ts
8
8
  * import { cronvello } from "@/lib/cronvello";
package/dist/next.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../src/adapters/next.ts"],"names":[],"mappings":";AA2BO,SAAS,YAAY,GAAA,EAAwC;AAClE,EAAA,OAAO,OAAO,GAAA,KAAQ;AACpB,IAAA,MAAM,OAAA,GAAU,MAAM,GAAA,CAAI,IAAA,EAAK;AAC/B,IAAA,MAAM,UAAkC,EAAC;AACzC,IAAA,GAAA,CAAI,OAAA,CAAQ,OAAA,GAAU,CAAC,KAAA,EAAO,GAAA,KAAQ;AACpC,MAAA,OAAA,CAAQ,GAAA,CAAI,WAAA,EAAa,CAAA,GAAI,KAAA;AAAA,IAC/B,CAAC,CAAA;AACD,IAAA,MAAM,MAAA,GAAS,MAAM,GAAA,CAAI,MAAA,CAAO;AAAA,MAC9B,QAAQ,GAAA,CAAI,MAAA;AAAA,MACZ,aAAA,EAAe,GAAA,CAAI,OAAA,CAAQ,GAAA,CAAI,eAAe,CAAA,IAAK,MAAA;AAAA,MACnD,OAAA;AAAA,MACA;AAAA,KACD,CAAA;AACD,IAAA,OAAO,IAAI,QAAA,CAAS,IAAA,CAAK,SAAA,CAAU,MAAA,CAAO,IAAI,CAAA,EAAG;AAAA,MAC/C,QAAQ,MAAA,CAAO,MAAA;AAAA,MACf,OAAA,EAAS,EAAE,cAAA,EAAgB,kBAAA;AAAmB,KAC/C,CAAA;AAAA,EACH,CAAA;AACF","file":"next.js","sourcesContent":["/**\n * Next.js App Router adapter (Route Handlers). Zero dependency on `next` — uses the Web\n * Fetch `Request`/`Response` globals (Node 18+ and the edge runtime).\n *\n * // app/cronvello/dispatch/route.ts\n * import { cronvello } from \"@/lib/cronvello\";\n * import { nextHandler } from \"@cronvello/sdk/next\";\n * export const POST = nextHandler(cronvello);\n *\n * On serverless hosts, prefer the default sync execution mode so the work finishes within the\n * request. async_callback needs a host that keeps running after the response (see docs).\n */\n\nimport type { DispatchHandler } from \"../registry/dispatch-handler.js\";\n\n/** Structural subset of the Web Fetch `Request` we rely on. */\nexport interface FetchRequestLike {\n method: string;\n headers: {\n get(name: string): string | null;\n forEach?(cb: (value: string, key: string) => void): void;\n };\n text(): Promise<string>;\n}\n\nexport type NextRouteHandler = (req: FetchRequestLike) => Promise<Response>;\n\nexport function nextHandler(app: DispatchHandler): NextRouteHandler {\n return async (req) => {\n const rawBody = await req.text();\n const headers: Record<string, string> = {};\n req.headers.forEach?.((value, key) => {\n headers[key.toLowerCase()] = value;\n });\n const result = await app.handle({\n method: req.method,\n authorization: req.headers.get(\"authorization\") ?? undefined,\n rawBody,\n headers,\n });\n return new Response(JSON.stringify(result.body), {\n status: result.status,\n headers: { \"content-type\": \"application/json\" },\n });\n };\n}\n"]}
1
+ {"version":3,"sources":["../src/adapters/next.ts"],"names":[],"mappings":";AA2BO,SAAS,YAAY,GAAA,EAAwC;AAClE,EAAA,OAAO,OAAO,GAAA,KAAQ;AACpB,IAAA,MAAM,OAAA,GAAU,MAAM,GAAA,CAAI,IAAA,EAAK;AAC/B,IAAA,MAAM,UAAkC,EAAC;AACzC,IAAA,GAAA,CAAI,OAAA,CAAQ,OAAA,GAAU,CAAC,KAAA,EAAO,GAAA,KAAQ;AACpC,MAAA,OAAA,CAAQ,GAAA,CAAI,WAAA,EAAa,CAAA,GAAI,KAAA;AAAA,IAC/B,CAAC,CAAA;AACD,IAAA,MAAM,MAAA,GAAS,MAAM,GAAA,CAAI,MAAA,CAAO;AAAA,MAC9B,QAAQ,GAAA,CAAI,MAAA;AAAA,MACZ,aAAA,EAAe,GAAA,CAAI,OAAA,CAAQ,GAAA,CAAI,eAAe,CAAA,IAAK,MAAA;AAAA,MACnD,OAAA;AAAA,MACA;AAAA,KACD,CAAA;AACD,IAAA,OAAO,IAAI,QAAA,CAAS,IAAA,CAAK,SAAA,CAAU,MAAA,CAAO,IAAI,CAAA,EAAG;AAAA,MAC/C,QAAQ,MAAA,CAAO,MAAA;AAAA,MACf,OAAA,EAAS,EAAE,cAAA,EAAgB,kBAAA;AAAmB,KAC/C,CAAA;AAAA,EACH,CAAA;AACF","file":"next.js","sourcesContent":["/**\n * Next.js App Router adapter (Route Handlers). Zero dependency on `next` — uses the Web\n * Fetch `Request`/`Response` globals (Node 20+ and the edge runtime).\n *\n * // app/cronvello/dispatch/route.ts\n * import { cronvello } from \"@/lib/cronvello\";\n * import { nextHandler } from \"@cronvello/sdk/next\";\n * export const POST = nextHandler(cronvello);\n *\n * On serverless hosts, prefer the default sync execution mode so the work finishes within the\n * request. async_callback needs a host that keeps running after the response (see docs).\n */\n\nimport type { DispatchHandler } from \"../registry/dispatch-handler.js\";\n\n/** Structural subset of the Web Fetch `Request` we rely on. */\nexport interface FetchRequestLike {\n method: string;\n headers: {\n get(name: string): string | null;\n forEach?(cb: (value: string, key: string) => void): void;\n };\n text(): Promise<string>;\n}\n\nexport type NextRouteHandler = (req: FetchRequestLike) => Promise<Response>;\n\nexport function nextHandler(app: DispatchHandler): NextRouteHandler {\n return async (req) => {\n const rawBody = await req.text();\n const headers: Record<string, string> = {};\n req.headers.forEach?.((value, key) => {\n headers[key.toLowerCase()] = value;\n });\n const result = await app.handle({\n method: req.method,\n authorization: req.headers.get(\"authorization\") ?? undefined,\n rawBody,\n headers,\n });\n return new Response(JSON.stringify(result.body), {\n status: result.status,\n headers: { \"content-type\": \"application/json\" },\n });\n };\n}\n"]}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cronvello/sdk",
3
- "version": "0.1.2",
3
+ "version": "0.1.4",
4
4
  "description": "Code-first cron jobs for Cronvello. Define jobs in your code, the SDK syncs them to https://api.cronvello.com and runs them — no dashboard required.",
5
5
  "keywords": [
6
6
  "cron",
@@ -24,7 +24,7 @@
24
24
  "type": "module",
25
25
  "sideEffects": false,
26
26
  "engines": {
27
- "node": ">=18"
27
+ "node": ">=20"
28
28
  },
29
29
  "files": [
30
30
  "dist",