@telnyx/edge-runtime 0.1.0 → 0.1.1
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/build-env.js +0 -9
- package/dist/env.d.ts +0 -7
- package/dist/env.js +11 -7
- package/package.json +1 -1
package/dist/build-env.js
CHANGED
|
@@ -178,15 +178,6 @@ async function safeReadText(resp) {
|
|
|
178
178
|
return "<unreadable>";
|
|
179
179
|
}
|
|
180
180
|
}
|
|
181
|
-
/**
|
|
182
|
-
* The `env` your handler uses. Built lazily on first access:
|
|
183
|
-
*
|
|
184
|
-
* import { env } from "@telnyx/edge-runtime";
|
|
185
|
-
*
|
|
186
|
-
* Lazy so a plain `import` doesn't pay the cost — the work is small but
|
|
187
|
-
* non-zero, and consumers that import the package without touching `env`
|
|
188
|
-
* (e.g. type-only imports, other workspaces) shouldn't trigger it.
|
|
189
|
-
*/
|
|
190
181
|
let _env;
|
|
191
182
|
const realEnv = () => (_env ??= buildEnv());
|
|
192
183
|
export const env = new Proxy({}, {
|
package/dist/env.d.ts
CHANGED
|
@@ -1,10 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Customer-extensible bindings environment.
|
|
3
|
-
*
|
|
4
|
-
* Customers either pass their own typed env (`StatefulActor<MyEnv>`) or rely on
|
|
5
|
-
* codegen to augment the global `Env` interface.
|
|
6
|
-
*/
|
|
7
1
|
export interface Env {
|
|
8
|
-
[binding: string]: unknown;
|
|
9
2
|
}
|
|
10
3
|
//# sourceMappingURL=env.d.ts.map
|
package/dist/env.js
CHANGED
|
@@ -1,11 +1,15 @@
|
|
|
1
|
-
//
|
|
1
|
+
// Customer-extensible bindings environment.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
3
|
+
// Empty by design — declared bindings come from the customer's
|
|
4
|
+
// `telnyx-env.d.ts`, generated by `telnyx-edge types`. That file augments
|
|
5
|
+
// either the global `Env` (for `fetch(req, env: Env)` handlers) or this
|
|
6
|
+
// module's `Env` (for `import { env } from "@telnyx/edge-runtime"`).
|
|
6
7
|
//
|
|
7
|
-
//
|
|
8
|
-
//
|
|
9
|
-
//
|
|
8
|
+
// Dropping the previous `[binding: string]: unknown` index signature is the
|
|
9
|
+
// load-bearing point: with it gone, a misspelled binding fails to
|
|
10
|
+
// type-check with TS2339 ("Property 'X' does not exist on type 'Env'")
|
|
11
|
+
// instead of silently degrading to `unknown`. Customers either get strict
|
|
12
|
+
// bindings from their generated d.ts, or get a clear compile-time signal
|
|
13
|
+
// that they need to run `telnyx-edge types`.
|
|
10
14
|
export {};
|
|
11
15
|
//# sourceMappingURL=env.js.map
|