@pylonsync/functions 0.3.274 → 0.3.275

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@pylonsync/functions",
3
- "version": "0.3.274",
3
+ "version": "0.3.275",
4
4
  "description": "TypeScript function runtime for pylon — defines server-side queries, mutations, and actions.",
5
5
  "type": "module",
6
6
  "main": "src/index.ts",
@@ -910,12 +910,18 @@ async function _doBuildInner(
910
910
  // rather than an inline string in CLIENT_RUNTIME_SOURCE that nothing
911
911
  // could render. Bun pulls it into the shared chunk via the runtime's
912
912
  // static `import { createPylonBoundary } from "./client-boundary"`.
913
+ //
914
+ // Resolve THIS module's directory from the standard `import.meta.url`
915
+ // (via node:url) rather than Bun's `import.meta.dir` — the latter is a
916
+ // Bun-only extension that `tsc` doesn't know about, so any app that
917
+ // imports `@pylonsync/functions` and runs `tsc` would otherwise fail
918
+ // type-checking on this file. `import.meta.url` works in Bun and Node.
919
+ const urlMod: any = await import("node:url");
920
+ const fileURLToPath = urlMod.fileURLToPath ?? urlMod.default?.fileURLToPath;
921
+ const here = path.dirname(fileURLToPath(import.meta.url));
913
922
  fs.writeFileSync(
914
923
  path.join(stageDir, "client-boundary.ts"),
915
- fs.readFileSync(
916
- path.join(import.meta.dir, "ssr-client-boundary.ts"),
917
- "utf8",
918
- ),
924
+ fs.readFileSync(path.join(here, "ssr-client-boundary.ts"), "utf8"),
919
925
  "utf8",
920
926
  );
921
927
 
package/src/types.ts CHANGED
@@ -293,6 +293,14 @@ export interface Scheduler {
293
293
  * webhook). Available on action ctx only — sending email is external
294
294
  * I/O, not allowed in mutation transactions.
295
295
  *
296
+ * This is the APP email channel (`PYLON_EMAIL_*`): arbitrary recipient
297
+ * and body, so it must be the app's own provider. It is deliberately
298
+ * separate from Pylon's built-in auth emails (codes / password reset /
299
+ * invitations), which send via a `PYLON_AUTH_EMAIL_*` channel. On Pylon
300
+ * Cloud the auth channel may be a shared, locked-down platform key, so
301
+ * `ctx.email` stays inert until you set `PYLON_EMAIL_*` yourself — the
302
+ * shared auth key can never be used to send arbitrary mail.
303
+ *
296
304
  * The runtime owns provider config + credentials; functions only
297
305
  * supply the (to, subject, body) tuple. Failures are surfaced as
298
306
  * thrown errors; on success the return is void.