@edge-base/plugin-core 0.2.2 → 0.2.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/index.d.ts CHANGED
@@ -87,8 +87,13 @@ export interface PluginAdminContext {
87
87
  /** Admin user management. */
88
88
  auth: PluginAdminAuthContext;
89
89
  /**
90
- * Execute raw SQL with direct D1/DO access (no HTTP round-trip).
91
- * Preferred over `table().sql\`...\`` in server/plugin contexts for performance.
90
+ * Execute raw SQL through the fastest provider-aware path available.
91
+ * Uses direct PostgreSQL / Neon, D1, or DO execution when possible,
92
+ * then falls back to the internal worker SQL route when needed.
93
+ */
94
+ sqlProviderAware(namespace: string, id: string | undefined, query: string, params?: unknown[]): Promise<unknown[]>;
95
+ /**
96
+ * @deprecated Use `sqlProviderAware()` instead.
92
97
  */
93
98
  sqlWithDirectD1Access(namespace: string, id: string | undefined, query: string, params?: unknown[]): Promise<unknown[]>;
94
99
  /** Server-side broadcast to a realtime channel. */
package/dist/index.js CHANGED
@@ -254,6 +254,9 @@ export function createMockContext(options) {
254
254
  return { table: createTableProxy };
255
255
  },
256
256
  auth: mockAuth,
257
+ async sqlProviderAware() {
258
+ return [];
259
+ },
257
260
  async sqlWithDirectD1Access() {
258
261
  return [];
259
262
  },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edge-base/plugin-core",
3
- "version": "0.2.2",
3
+ "version": "0.2.4",
4
4
  "description": "EdgeBase plugin authoring helpers and public plugin contracts",
5
5
  "license": "MIT",
6
6
  "repository": {
@@ -33,7 +33,7 @@
33
33
  }
34
34
  },
35
35
  "dependencies": {
36
- "@edge-base/shared": "0.2.2"
36
+ "@edge-base/shared": "0.2.4"
37
37
  },
38
38
  "devDependencies": {
39
39
  "typescript": "^5.7.0"