ezlogs-nextjs 0.4.6 → 0.4.7
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/README.md +23 -3
- package/dist/{chunk-B5ZUQULZ.cjs → chunk-2YCQFLXW.cjs} +3 -0
- package/dist/{chunk-RD47JECJ.js → chunk-343ZGTMH.js} +1 -1
- package/dist/{chunk-2NFJOT6Q.js → chunk-5ZMOWEBY.js} +1 -1
- package/dist/{chunk-IBSNHBUC.js → chunk-7MFKEYDN.js} +3 -0
- package/dist/{chunk-U3IJV5EJ.js → chunk-AXIQTU52.js} +1 -1
- package/dist/{chunk-RMKGMIV2.js → chunk-BE3RCFNP.js} +1 -1
- package/dist/{chunk-H3FC5HMW.cjs → chunk-CHVJ4WPM.cjs} +2 -2
- package/dist/{chunk-M3VBQ5KT.js → chunk-CYAFYBKF.js} +2 -2
- package/dist/{chunk-O7SFYXJC.cjs → chunk-EXGEA4KE.cjs} +12 -12
- package/dist/{chunk-YO6E763S.cjs → chunk-JB4UYCZI.cjs} +5 -5
- package/dist/{chunk-65HRY3PW.cjs → chunk-KOFR5OC3.cjs} +21 -21
- package/dist/{chunk-PK2Z2ABL.js → chunk-Q3HRVWCS.js} +3 -3
- package/dist/{chunk-B3WST6ES.cjs → chunk-UC2KS5EG.cjs} +9 -9
- package/dist/{chunk-DM2EAOSF.cjs → chunk-XWEBKN65.cjs} +4 -4
- package/dist/db/drizzle.cjs +3 -3
- package/dist/db/drizzle.js +2 -2
- package/dist/db/postgres-js.cjs +4 -4
- package/dist/db/postgres-js.js +2 -2
- package/dist/db/prisma.cjs +12 -12
- package/dist/db/prisma.js +2 -2
- package/dist/db/supabase.cjs +11 -11
- package/dist/db/supabase.js +2 -2
- package/dist/index.cjs +121 -106
- package/dist/index.js +21 -6
- package/dist/jobs/bullmq.cjs +17 -17
- package/dist/jobs/bullmq.js +4 -4
- package/dist/jobs/inngest.cjs +154 -50
- package/dist/jobs/inngest.d.cts +6 -6
- package/dist/jobs/inngest.d.ts +6 -6
- package/dist/jobs/inngest.js +144 -40
- package/dist/jobs/supabase-queues.cjs +9 -9
- package/dist/jobs/supabase-queues.js +4 -4
- package/dist/jobs/trigger.cjs +7 -7
- package/dist/jobs/trigger.js +4 -4
- package/dist/jobs/upstash-workflow.cjs +19 -19
- package/dist/jobs/upstash-workflow.js +5 -5
- package/dist/nextjs-plugin/loader.cjs +34 -5
- package/dist/nextjs-plugin/loader.js +34 -5
- package/dist/triggers/index.cjs +16 -16
- package/dist/triggers/index.js +5 -5
- package/package.json +1 -1
package/dist/db/supabase.cjs
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
3
|
var chunkVJR4VB4B_cjs = require('../chunk-VJR4VB4B.cjs');
|
|
4
|
-
var
|
|
5
|
-
var
|
|
4
|
+
var chunkUC2KS5EG_cjs = require('../chunk-UC2KS5EG.cjs');
|
|
5
|
+
var chunk2YCQFLXW_cjs = require('../chunk-2YCQFLXW.cjs');
|
|
6
6
|
var chunkTWTG5ILJ_cjs = require('../chunk-TWTG5ILJ.cjs');
|
|
7
7
|
require('../chunk-ZDSQYCYV.cjs');
|
|
8
8
|
|
|
9
9
|
// src/db/supabase.ts
|
|
10
10
|
function triggerPathWillCapture(table) {
|
|
11
|
-
const config =
|
|
11
|
+
const config = chunk2YCQFLXW_cjs.configuration();
|
|
12
12
|
if (!config.databaseReader) return false;
|
|
13
13
|
const tracked = config.triggerTrackedTables;
|
|
14
14
|
if (tracked === null) return false;
|
|
@@ -65,7 +65,7 @@ function wrapSupabase(client) {
|
|
|
65
65
|
var GLOBAL_CLIENT_KEY = /* @__PURE__ */ Symbol.for("ezlogs-nextjs:supabase-current-client");
|
|
66
66
|
function registerActorSource(client) {
|
|
67
67
|
try {
|
|
68
|
-
const slot =
|
|
68
|
+
const slot = chunk2YCQFLXW_cjs.currentActorSource();
|
|
69
69
|
if (slot) {
|
|
70
70
|
slot.clients ??= [];
|
|
71
71
|
if (!slot.clients.includes(client)) slot.clients.push(client);
|
|
@@ -78,7 +78,7 @@ function registerActorSource(client) {
|
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
async function tryExtractSupabaseActor() {
|
|
81
|
-
const slot =
|
|
81
|
+
const slot = chunk2YCQFLXW_cjs.currentActorSource();
|
|
82
82
|
const clients = slot ? slot.clients ?? [] : [globalThis[GLOBAL_CLIENT_KEY]];
|
|
83
83
|
for (const client of clients) {
|
|
84
84
|
const actor = await userOf(client);
|
|
@@ -275,7 +275,7 @@ function emitFromMutation(ctx, values, result, filters, beforeRow) {
|
|
|
275
275
|
return;
|
|
276
276
|
}
|
|
277
277
|
if (!isPlainObject(values)) {
|
|
278
|
-
|
|
278
|
+
chunkUC2KS5EG_cjs.emitDbEvent({
|
|
279
279
|
modelClass: ctx.table,
|
|
280
280
|
operation: ctx.operation,
|
|
281
281
|
resourceId: idFromFilters(filters)
|
|
@@ -289,9 +289,9 @@ function emitFromMutation(ctx, values, result, filters, beforeRow) {
|
|
|
289
289
|
function emitOneRow(ctx, values, resultRow, filters, beforeRow) {
|
|
290
290
|
const resourceId = resultRow?.id ?? values.id ?? idFromFilters(filters) ?? null;
|
|
291
291
|
const merged = beforeRow ?? resultRow ?? values;
|
|
292
|
-
const displayName =
|
|
292
|
+
const displayName = chunkUC2KS5EG_cjs.resolveDisplayName(ctx.table, merged);
|
|
293
293
|
if (ctx.operation === "create") {
|
|
294
|
-
|
|
294
|
+
chunkUC2KS5EG_cjs.emitDbEvent({
|
|
295
295
|
modelClass: ctx.table,
|
|
296
296
|
operation: "create",
|
|
297
297
|
resourceId,
|
|
@@ -303,7 +303,7 @@ function emitOneRow(ctx, values, resultRow, filters, beforeRow) {
|
|
|
303
303
|
}
|
|
304
304
|
if (ctx.operation === "update") {
|
|
305
305
|
const changes = buildUpdateChanges(values, beforeRow);
|
|
306
|
-
|
|
306
|
+
chunkUC2KS5EG_cjs.emitDbEvent({
|
|
307
307
|
modelClass: ctx.table,
|
|
308
308
|
operation: "update",
|
|
309
309
|
resourceId,
|
|
@@ -317,8 +317,8 @@ function emitFromDelete(table, result, filters, beforeRow) {
|
|
|
317
317
|
const resultRow = pickFirstResultRow(result);
|
|
318
318
|
const resourceId = resultRow?.id ?? beforeRow?.id ?? idFromFilters(filters) ?? null;
|
|
319
319
|
const richestRow = resultRow ?? beforeRow;
|
|
320
|
-
const displayName = richestRow ?
|
|
321
|
-
|
|
320
|
+
const displayName = richestRow ? chunkUC2KS5EG_cjs.resolveDisplayName(table, richestRow) : null;
|
|
321
|
+
chunkUC2KS5EG_cjs.emitDbEvent({
|
|
322
322
|
modelClass: table,
|
|
323
323
|
operation: "destroy",
|
|
324
324
|
resourceId,
|
package/dist/db/supabase.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { instrumentFrom, instrumentFactory } from '../chunk-JWJKFZBW.js';
|
|
2
|
-
import { emitDbEvent, resolveDisplayName } from '../chunk-
|
|
3
|
-
import { currentActorSource, configuration } from '../chunk-
|
|
2
|
+
import { emitDbEvent, resolveDisplayName } from '../chunk-AXIQTU52.js';
|
|
3
|
+
import { currentActorSource, configuration } from '../chunk-7MFKEYDN.js';
|
|
4
4
|
import { logger } from '../chunk-FCFVIRQF.js';
|
|
5
5
|
import '../chunk-SIAA4J6H.js';
|
|
6
6
|
|