@edge-base/plugin-core 0.2.1 → 0.2.2

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
@@ -86,8 +86,11 @@ export interface PluginAdminContext {
86
86
  };
87
87
  /** Admin user management. */
88
88
  auth: PluginAdminAuthContext;
89
- /** Raw SQL on a DB namespace DO. */
90
- sql(namespace: string, id: string | undefined, query: string, params?: unknown[]): Promise<unknown[]>;
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.
92
+ */
93
+ sqlWithDirectD1Access(namespace: string, id: string | undefined, query: string, params?: unknown[]): Promise<unknown[]>;
91
94
  /** Server-side broadcast to a realtime channel. */
92
95
  broadcast(channel: string, event: string, payload?: Record<string, unknown>): Promise<void>;
93
96
  /** Inter-function calls. */
package/dist/index.js CHANGED
@@ -254,7 +254,7 @@ export function createMockContext(options) {
254
254
  return { table: createTableProxy };
255
255
  },
256
256
  auth: mockAuth,
257
- async sql() {
257
+ async sqlWithDirectD1Access() {
258
258
  return [];
259
259
  },
260
260
  async broadcast() { },
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@edge-base/plugin-core",
3
- "version": "0.2.1",
3
+ "version": "0.2.2",
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.1"
36
+ "@edge-base/shared": "0.2.2"
37
37
  },
38
38
  "devDependencies": {
39
39
  "typescript": "^5.7.0"