over-zero 0.0.0 → 0.0.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/cjs/createPermissions.cjs +43 -57
- package/dist/cjs/createPermissions.js +46 -48
- package/dist/cjs/createPermissions.js.map +2 -2
- package/dist/cjs/createPermissions.native.js +46 -53
- package/dist/cjs/createPermissions.native.js.map +2 -2
- package/dist/cjs/createZero.cjs +128 -0
- package/dist/cjs/createZero.js +107 -0
- package/dist/cjs/createZero.js.map +6 -0
- package/dist/cjs/createZero.native.js +115 -0
- package/dist/cjs/createZero.native.js.map +6 -0
- package/dist/cjs/createZeroServer.cjs +131 -0
- package/dist/cjs/createZeroServer.js +108 -0
- package/dist/cjs/createZeroServer.js.map +6 -0
- package/dist/cjs/createZeroServer.native.js +107 -0
- package/dist/cjs/createZeroServer.native.js.map +6 -0
- package/dist/cjs/helpers/context.js.map +1 -1
- package/dist/cjs/helpers/context.native.js.map +1 -1
- package/dist/cjs/helpers/createMutators.cjs +11 -11
- package/dist/cjs/helpers/createMutators.js +9 -7
- package/dist/cjs/helpers/createMutators.js.map +1 -1
- package/dist/cjs/helpers/createMutators.native.js +8 -6
- package/dist/cjs/helpers/createMutators.native.js.map +1 -1
- package/dist/cjs/helpers/ensureLoggedIn.cjs +1 -1
- package/dist/cjs/helpers/ensureLoggedIn.js +1 -1
- package/dist/cjs/helpers/ensureLoggedIn.js.map +1 -1
- package/dist/cjs/helpers/ensureLoggedIn.native.js +1 -1
- package/dist/cjs/helpers/ensureLoggedIn.native.js.map +1 -1
- package/dist/cjs/helpers/getAuthData.cjs +0 -36
- package/dist/cjs/helpers/getAuthData.js +0 -28
- package/dist/cjs/helpers/getAuthData.js.map +2 -2
- package/dist/cjs/helpers/getAuthData.native.js +0 -31
- package/dist/cjs/helpers/getAuthData.native.js.map +2 -2
- package/dist/cjs/helpers/useAuthData.cjs +0 -32
- package/dist/cjs/helpers/useAuthData.js +0 -24
- package/dist/cjs/helpers/useAuthData.js.map +2 -2
- package/dist/cjs/helpers/useAuthData.native.js +0 -31
- package/dist/cjs/helpers/useAuthData.native.js.map +2 -2
- package/dist/cjs/helpers/useZeroDebug.cjs +68 -0
- package/dist/cjs/helpers/useZeroDebug.js +49 -0
- package/dist/cjs/helpers/useZeroDebug.js.map +6 -0
- package/dist/cjs/helpers/useZeroDebug.native.js +66 -0
- package/dist/cjs/helpers/useZeroDebug.native.js.map +6 -0
- package/dist/cjs/helpers/zeroEmitter.cjs +2 -2
- package/dist/cjs/helpers/zeroEmitter.js +2 -2
- package/dist/cjs/helpers/zeroEmitter.native.js +1 -1
- package/dist/cjs/helpers/zeroEmitter.native.js.map +1 -1
- package/dist/cjs/index.cjs +3 -1
- package/dist/cjs/index.js +2 -0
- package/dist/cjs/index.js.map +1 -1
- package/dist/cjs/index.native.js +4 -0
- package/dist/cjs/index.native.js.map +1 -1
- package/dist/cjs/mutations.cjs +50 -0
- package/dist/cjs/mutations.js +43 -0
- package/dist/cjs/mutations.js.map +6 -0
- package/dist/cjs/mutations.native.js +50 -0
- package/dist/cjs/mutations.native.js.map +6 -0
- package/dist/cjs/server.cjs +18 -0
- package/dist/cjs/server.js +15 -0
- package/dist/cjs/server.js.map +6 -0
- package/dist/cjs/server.native.js +20 -0
- package/dist/cjs/server.native.js.map +6 -0
- package/dist/cjs/where.cjs +33 -0
- package/dist/cjs/where.js +28 -0
- package/dist/cjs/where.js.map +6 -0
- package/dist/cjs/where.native.js +34 -0
- package/dist/cjs/where.native.js.map +6 -0
- package/dist/esm/createPermissions.js +48 -47
- package/dist/esm/createPermissions.js.map +2 -2
- package/dist/esm/createPermissions.mjs +41 -55
- package/dist/esm/createPermissions.mjs.map +1 -1
- package/dist/esm/createPermissions.native.js +55 -69
- package/dist/esm/createPermissions.native.js.map +1 -1
- package/dist/esm/createZero.js +99 -0
- package/dist/esm/createZero.js.map +6 -0
- package/dist/esm/createZero.mjs +105 -0
- package/dist/esm/createZero.mjs.map +1 -0
- package/dist/esm/createZero.native.js +119 -0
- package/dist/esm/createZero.native.js.map +1 -0
- package/dist/esm/createZeroServer.js +90 -0
- package/dist/esm/createZeroServer.js.map +6 -0
- package/dist/esm/createZeroServer.mjs +97 -0
- package/dist/esm/createZeroServer.mjs.map +1 -0
- package/dist/esm/createZeroServer.native.js +104 -0
- package/dist/esm/createZeroServer.native.js.map +1 -0
- package/dist/esm/helpers/context.js.map +1 -1
- package/dist/esm/helpers/context.mjs.map +1 -1
- package/dist/esm/helpers/context.native.js.map +1 -1
- package/dist/esm/helpers/createMutators.js +6 -7
- package/dist/esm/helpers/createMutators.js.map +1 -1
- package/dist/esm/helpers/createMutators.mjs +7 -7
- package/dist/esm/helpers/createMutators.mjs.map +1 -1
- package/dist/esm/helpers/createMutators.native.js +9 -7
- package/dist/esm/helpers/createMutators.native.js.map +1 -1
- package/dist/esm/helpers/ensureLoggedIn.js +1 -1
- package/dist/esm/helpers/ensureLoggedIn.js.map +1 -1
- package/dist/esm/helpers/ensureLoggedIn.mjs +1 -1
- package/dist/esm/helpers/ensureLoggedIn.mjs.map +1 -1
- package/dist/esm/helpers/ensureLoggedIn.native.js +1 -1
- package/dist/esm/helpers/ensureLoggedIn.native.js.map +1 -1
- package/dist/esm/helpers/getAuthData.js +0 -12
- package/dist/esm/helpers/getAuthData.js.map +2 -2
- package/dist/esm/helpers/getAuthData.mjs +1 -12
- package/dist/esm/helpers/getAuthData.mjs.map +1 -1
- package/dist/esm/helpers/getAuthData.native.js +1 -12
- package/dist/esm/helpers/getAuthData.native.js.map +1 -1
- package/dist/esm/helpers/useAuthData.js +0 -10
- package/dist/esm/helpers/useAuthData.js.map +2 -2
- package/dist/esm/helpers/useAuthData.mjs +1 -8
- package/dist/esm/helpers/useAuthData.mjs.map +1 -1
- package/dist/esm/helpers/useAuthData.native.js +1 -12
- package/dist/esm/helpers/useAuthData.native.js.map +1 -1
- package/dist/esm/helpers/useZeroDebug.js +35 -0
- package/dist/esm/helpers/useZeroDebug.js.map +6 -0
- package/dist/esm/helpers/useZeroDebug.mjs +45 -0
- package/dist/esm/helpers/useZeroDebug.mjs.map +1 -0
- package/dist/esm/helpers/useZeroDebug.native.js +53 -0
- package/dist/esm/helpers/useZeroDebug.native.js.map +1 -0
- package/dist/esm/helpers/zeroEmitter.js +1 -1
- package/dist/esm/helpers/zeroEmitter.mjs +1 -1
- package/dist/esm/helpers/zeroEmitter.native.js +1 -1
- package/dist/esm/index.js +2 -0
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/index.mjs +3 -1
- package/dist/esm/index.mjs.map +1 -1
- package/dist/esm/index.native.js +3 -1
- package/dist/esm/index.native.js.map +1 -1
- package/dist/esm/mutations.js +27 -0
- package/dist/esm/mutations.js.map +6 -0
- package/dist/esm/mutations.mjs +27 -0
- package/dist/esm/mutations.mjs.map +1 -0
- package/dist/esm/mutations.native.js +29 -0
- package/dist/esm/mutations.native.js.map +1 -0
- package/dist/esm/server.js +2 -0
- package/dist/esm/server.js.map +6 -0
- package/dist/esm/server.mjs +2 -0
- package/dist/esm/server.mjs.map +1 -0
- package/dist/esm/server.native.js +2 -0
- package/dist/esm/server.native.js.map +1 -0
- package/dist/esm/where.js +12 -0
- package/dist/esm/where.js.map +6 -0
- package/dist/esm/where.mjs +9 -0
- package/dist/esm/where.mjs.map +1 -0
- package/dist/esm/where.native.js +9 -0
- package/dist/esm/where.native.js.map +1 -0
- package/package.json +12 -6
- package/src/createPermissions.ts +17 -77
- package/src/{createZeroClient.tsx → createZero.tsx} +25 -17
- package/src/createZeroServer.ts +43 -43
- package/src/helpers/createMutators.ts +19 -29
- package/src/helpers/ensureLoggedIn.ts +2 -1
- package/src/helpers/prettyFormatZeroQuery.ts +1 -1
- package/src/helpers/useZeroDebug.ts +1 -0
- package/src/index.ts +2 -6
- package/src/mutations.ts +20 -7
- package/src/server.ts +1 -0
- package/src/types.ts +74 -7
- package/src/where.ts +28 -0
- package/src/helpers/clearZeroDatabase.ts +0 -68
- package/src/helpers/getAuthData.tsx +0 -12
- package/src/helpers/useAuthData.ts +0 -13
- package/src/helpers/zeroEmitter.ts +0 -5
- package/types/createMutations.d.ts +0 -20
- package/types/createMutations.d.ts.map +0 -1
- package/types/createPermissions.d.ts +0 -37
- package/types/createPermissions.d.ts.map +0 -1
- package/types/createZeroClient.d.ts +0 -45
- package/types/createZeroClient.d.ts.map +0 -1
- package/types/createZeroServer.d.ts +0 -61
- package/types/createZeroServer.d.ts.map +0 -1
- package/types/helpers/batchQuery.d.ts +0 -7
- package/types/helpers/batchQuery.d.ts.map +0 -1
- package/types/helpers/clearZeroDatabase.d.ts +0 -2
- package/types/helpers/clearZeroDatabase.d.ts.map +0 -1
- package/types/helpers/context.d.ts +0 -5
- package/types/helpers/context.d.ts.map +0 -1
- package/types/helpers/createMutators.d.ts +0 -16
- package/types/helpers/createMutators.d.ts.map +0 -1
- package/types/helpers/ensureLoggedIn.d.ts +0 -2
- package/types/helpers/ensureLoggedIn.d.ts.map +0 -1
- package/types/helpers/getAuthData.d.ts +0 -1
- package/types/helpers/getAuthData.d.ts.map +0 -1
- package/types/helpers/prettyFormatZeroQuery.d.ts +0 -3
- package/types/helpers/prettyFormatZeroQuery.d.ts.map +0 -1
- package/types/helpers/useAuthData.d.ts +0 -1
- package/types/helpers/useAuthData.d.ts.map +0 -1
- package/types/helpers/useZeroDebug.d.ts +0 -3
- package/types/helpers/useZeroDebug.d.ts.map +0 -1
- package/types/helpers/zeroEmitter.d.ts +0 -2
- package/types/helpers/zeroEmitter.d.ts.map +0 -1
- package/types/index.d.ts +0 -9
- package/types/index.d.ts.map +0 -1
- package/types/types.d.ts +0 -21
- package/types/types.d.ts.map +0 -1
|
@@ -23,25 +23,25 @@ __export(createMutators_exports, {
|
|
|
23
23
|
createMutators: () => createMutators
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(createMutators_exports);
|
|
26
|
-
var
|
|
27
|
-
|
|
28
|
-
import_context = require("../context"),
|
|
29
|
-
import_models = require("../models"),
|
|
30
|
-
import_can = require("./can");
|
|
26
|
+
var import_helpers = require("@vxrn/helpers"),
|
|
27
|
+
import_context = require("./context.cjs");
|
|
31
28
|
function createMutators({
|
|
32
29
|
environment,
|
|
33
30
|
authData,
|
|
34
31
|
createServerActions,
|
|
35
|
-
asyncTasks = []
|
|
32
|
+
asyncTasks = [],
|
|
33
|
+
can,
|
|
34
|
+
models
|
|
36
35
|
}) {
|
|
37
|
-
const serverActions = createServerActions?.(
|
|
36
|
+
const serverActions = createServerActions?.(),
|
|
37
|
+
modelMutators = (0, import_helpers.mapObject)(models, val => val.mutate);
|
|
38
38
|
function withContext(fn) {
|
|
39
39
|
return async (tx, ...args) => {
|
|
40
40
|
const mutationContext = {
|
|
41
41
|
tx,
|
|
42
42
|
authData,
|
|
43
43
|
environment,
|
|
44
|
-
can
|
|
44
|
+
can,
|
|
45
45
|
serverActions,
|
|
46
46
|
asyncTasks
|
|
47
47
|
};
|
|
@@ -52,10 +52,10 @@ function createMutators({
|
|
|
52
52
|
return process.env.NODE_ENV !== "development" && !process.env.IS_TESTING ? fn : async (...args) => {
|
|
53
53
|
const startTime = performance.now();
|
|
54
54
|
try {
|
|
55
|
-
|
|
55
|
+
import_helpers.isServer && console.info(`[mutator] ${name} start`);
|
|
56
56
|
const result = await fn(...args),
|
|
57
57
|
duration = (performance.now() - startTime).toFixed(2);
|
|
58
|
-
return
|
|
58
|
+
return import_helpers.isClient ? (console.groupCollapsed(`[mutator] ${name} completed in ${duration}ms`), console.info("\u2192", args[1]), console.info("\u2190", result), console.trace(), console.groupEnd()) : console.info(`[mutator] ${name} completed in ${duration}ms`), result;
|
|
59
59
|
} catch (error) {
|
|
60
60
|
const duration = (performance.now() - startTime).toFixed(2);
|
|
61
61
|
throw console.groupCollapsed(`[mutator] ${name} failed after ${duration}ms`), console.error("error:", error), console.info("arguments:", JSON.stringify(args[1], null, 2)), console.info("stack trace:", new Error().stack), console.groupEnd(), error;
|
|
@@ -83,5 +83,5 @@ function createMutators({
|
|
|
83
83
|
}
|
|
84
84
|
return result;
|
|
85
85
|
}
|
|
86
|
-
return decorateMutators(
|
|
86
|
+
return decorateMutators(modelMutators);
|
|
87
87
|
}
|
|
@@ -17,21 +17,23 @@ __export(createMutators_exports, {
|
|
|
17
17
|
createMutators: () => createMutators
|
|
18
18
|
});
|
|
19
19
|
module.exports = __toCommonJS(createMutators_exports);
|
|
20
|
-
var
|
|
20
|
+
var import_helpers = require("@vxrn/helpers"), import_context = require("./context");
|
|
21
21
|
function createMutators({
|
|
22
22
|
environment,
|
|
23
23
|
authData,
|
|
24
24
|
createServerActions,
|
|
25
|
-
asyncTasks = []
|
|
25
|
+
asyncTasks = [],
|
|
26
|
+
can,
|
|
27
|
+
models
|
|
26
28
|
}) {
|
|
27
|
-
const serverActions = createServerActions?.(
|
|
29
|
+
const serverActions = createServerActions?.(), modelMutators = (0, import_helpers.mapObject)(models, (val) => val.mutate);
|
|
28
30
|
function withContext(fn) {
|
|
29
31
|
return async (tx, ...args) => {
|
|
30
32
|
const mutationContext = {
|
|
31
33
|
tx,
|
|
32
34
|
authData,
|
|
33
35
|
environment,
|
|
34
|
-
can
|
|
36
|
+
can,
|
|
35
37
|
serverActions,
|
|
36
38
|
asyncTasks
|
|
37
39
|
};
|
|
@@ -42,9 +44,9 @@ function createMutators({
|
|
|
42
44
|
return process.env.NODE_ENV !== "development" && !process.env.IS_TESTING ? fn : async (...args) => {
|
|
43
45
|
const startTime = performance.now();
|
|
44
46
|
try {
|
|
45
|
-
|
|
47
|
+
import_helpers.isServer && console.info(`[mutator] ${name} start`);
|
|
46
48
|
const result = await fn(...args), duration = (performance.now() - startTime).toFixed(2);
|
|
47
|
-
return
|
|
49
|
+
return import_helpers.isClient ? (console.groupCollapsed(`[mutator] ${name} completed in ${duration}ms`), console.info("\u2192", args[1]), console.info("\u2190", result), console.trace(), console.groupEnd()) : console.info(`[mutator] ${name} completed in ${duration}ms`), result;
|
|
48
50
|
} catch (error) {
|
|
49
51
|
const duration = (performance.now() - startTime).toFixed(2);
|
|
50
52
|
throw console.groupCollapsed(`[mutator] ${name} failed after ${duration}ms`), console.error("error:", error), console.info("arguments:", JSON.stringify(args[1], null, 2)), console.info("stack trace:", new Error().stack), console.groupEnd(), error;
|
|
@@ -76,6 +78,6 @@ function createMutators({
|
|
|
76
78
|
}
|
|
77
79
|
return result;
|
|
78
80
|
}
|
|
79
|
-
return decorateMutators(
|
|
81
|
+
return decorateMutators(modelMutators);
|
|
80
82
|
}
|
|
81
83
|
//# sourceMappingURL=createMutators.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/createMutators.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoD,0BAQpD,iBAA+B;AAExB,SAAS,eAA6C;AAAA,EAC3D;AAAA,EACA;AAAA,EACA;AAAA,EACA,aAAa,CAAC;AAAA,EACd;AAAA,EACA;AACF,GAO4B;AAC1B,QAAM,gBAAgB,sBAAsB,GAEtC,oBAAgB,0BAAU,QAAQ,CAAC,QAAQ,IAAI,MAAM;AAI3D,WAAS,YAAgC,IAAsC;AAC7E,WAAO,OAAO,OAAoB,SAA8B;AAC9D,YAAM,kBAAkB;AAAA,QACtB;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,QACA;AAAA,MACF;AAEA,aAAO,UAAM,+BAAe,iBAAiB,MAGpC,GAAG,iBAAiB,GAAG,IAAI,CACnC;AAAA,IACH;AAAA,EACF;AAEA,WAAS,uBACP,MACA,IACA;AACA,WAAI,QAAQ,IAAI,aAAa,iBAAiB,CAAC,QAAQ,IAAI,aAClD,KAGF,UAAU,SAA8B;AAC7C,YAAM,YAAY,YAAY,IAAI;AAElC,UAAI;AACF,QAAI,2BACF,QAAQ,KAAK,aA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OAAO,QAAQ,aAAa;AAC5D,YAAI,OAAO,eAAgB,YAAY;AACrC,gBAAM,WAAW,GAAG,UAAU,IAAI,IAAI;AACtC,iBAAO,UAAU,EAAE,IAAI,IAAI;AAAA,YACzB;AAAA,YACA,iBAAiB,UAAU,YAAY,WAAW,CAAC;AAAA,UACrD;AAAA,QACF;AAAA,IAEJ;AAEA,WAAO;AAAA,EACT;AAEA,SAAO,iBAAiB,aAAa;AACvC;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -18,9 +18,11 @@ __export(createMutators_exports, {
|
|
|
18
18
|
createMutators: () => createMutators
|
|
19
19
|
});
|
|
20
20
|
module.exports = __toCommonJS(createMutators_exports);
|
|
21
|
-
var
|
|
21
|
+
var import_helpers = require("@vxrn/helpers"), import_context = require("./context");
|
|
22
22
|
function createMutators(param) {
|
|
23
|
-
var { environment, authData, createServerActions, asyncTasks = [] } = param, serverActions = createServerActions == null ? void 0 : createServerActions(
|
|
23
|
+
var { environment, authData, createServerActions, asyncTasks = [], can, models } = param, serverActions = createServerActions == null ? void 0 : createServerActions(), modelMutators = (0, import_helpers.mapObject)(models, function(val) {
|
|
24
|
+
return val.mutate;
|
|
25
|
+
});
|
|
24
26
|
function withContext(fn) {
|
|
25
27
|
return async function(tx) {
|
|
26
28
|
for (var _len = arguments.length, args = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++)
|
|
@@ -29,7 +31,7 @@ function createMutators(param) {
|
|
|
29
31
|
tx,
|
|
30
32
|
authData,
|
|
31
33
|
environment,
|
|
32
|
-
can
|
|
34
|
+
can,
|
|
33
35
|
serverActions,
|
|
34
36
|
asyncTasks
|
|
35
37
|
};
|
|
@@ -44,9 +46,9 @@ function createMutators(param) {
|
|
|
44
46
|
args[_key] = arguments[_key];
|
|
45
47
|
var startTime = performance.now();
|
|
46
48
|
try {
|
|
47
|
-
|
|
49
|
+
import_helpers.isServer && console.info(`[mutator] ${name} start`);
|
|
48
50
|
var result = await fn(...args), duration = (performance.now() - startTime).toFixed(2);
|
|
49
|
-
return
|
|
51
|
+
return import_helpers.isClient ? (console.groupCollapsed(`[mutator] ${name} completed in ${duration}ms`), console.info("\u2192", args[1]), console.info("\u2190", result), console.trace(), console.groupEnd()) : console.info(`[mutator] ${name} completed in ${duration}ms`), result;
|
|
50
52
|
} catch (error) {
|
|
51
53
|
var duration1 = (performance.now() - startTime).toFixed(2);
|
|
52
54
|
throw console.groupCollapsed(`[mutator] ${name} failed after ${duration1}ms`), console.error("error:", error), console.info("arguments:", JSON.stringify(args[1], null, 2)), console.info("stack trace:", new Error().stack), console.groupEnd(), error;
|
|
@@ -107,7 +109,7 @@ function createMutators(param) {
|
|
|
107
109
|
}
|
|
108
110
|
return result;
|
|
109
111
|
}
|
|
110
|
-
return decorateMutators(
|
|
112
|
+
return decorateMutators(modelMutators);
|
|
111
113
|
}
|
|
112
114
|
// Annotate the CommonJS export names for ESM import in node:
|
|
113
115
|
0 && (module.exports = {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/createMutators.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAoD,0BACpD,iBAA+B;AACxB,SAAS,eAAe,OAAO;AAClC,MAAI,EAAE,aAAa,UAAU,qBAAqB,aAAa,CAAC,GAAG,KAAK,OAAO,IAAI,OAC/E,gBAAgB,uBAAwB,OAAyC,SAAS,oBAAoB,GAC9G,oBAAgB,0BAAU,QAAQ,SAAS,KAAK;AAChD,WAAO,IAAI;AAAA,EACf,CAAC;AACD,WAAS,YAAY,IAAI;AACrB,WAAO,eAAe,IAAI;AACtB,eAAQ,OAAO,UAAU,QAAQ,OAAO,IAAI,MAAM,OAAO,IAAI,OAAO,IAAI,CAAC,GA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AAW,GAAG,UAAU,IAAI,IAAI;AACpC,qBAAO,UAAU,EAAE,IAAI,IAAI,uBAAuB,UAAU,iBAAiB,UAAU,YAAY,WAAW,CAAC,CAAC;AAAA,YACpH;AAAA,UACJ;AAAA,QACJ,SAAS,KAAK;AACV,+BAAqB,IACrB,kBAAkB;AAAA,QACtB,UAAE;AACE,cAAI;AACA,YAAI,CAAC,8BAA8B,WAAW,UAAU,QACpD,WAAW,OAAO;AAAA,UAE1B,UAAE;AACE,gBAAI;AACA,oBAAM;AAAA,UAEd;AAAA,QACJ;AAAA,MACJ;AAAA,IACJ,SAAS,KAAK;AACV,0BAAoB,IACpB,iBAAiB;AAAA,IACrB,UAAE;AACE,UAAI;AACA,QAAI,CAAC,6BAA6B,UAAU,UAAU,QAClD,UAAU,OAAO;AAAA,MAEzB,UAAE;AACE,YAAI;AACA,gBAAM;AAAA,MAEd;AAAA,IACJ;AACA,WAAO;AAAA,EACX;AACA,SAAO,iBAAiB,aAAa;AACzC;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -24,7 +24,7 @@ __export(ensureLoggedIn_exports, {
|
|
|
24
24
|
});
|
|
25
25
|
module.exports = __toCommonJS(ensureLoggedIn_exports);
|
|
26
26
|
var import_helpers = require("@vxrn/helpers"),
|
|
27
|
-
import_context = require("
|
|
27
|
+
import_context = require("./context.cjs");
|
|
28
28
|
const ensureLoggedIn = () => {
|
|
29
29
|
const {
|
|
30
30
|
authData
|
|
@@ -17,7 +17,7 @@ __export(ensureLoggedIn_exports, {
|
|
|
17
17
|
ensureLoggedIn: () => ensureLoggedIn
|
|
18
18
|
});
|
|
19
19
|
module.exports = __toCommonJS(ensureLoggedIn_exports);
|
|
20
|
-
var import_helpers = require("@vxrn/helpers"), import_context = require("
|
|
20
|
+
var import_helpers = require("@vxrn/helpers"), import_context = require("./context");
|
|
21
21
|
const ensureLoggedIn = () => {
|
|
22
22
|
const { authData } = (0, import_context.context)();
|
|
23
23
|
return (0, import_helpers.ensure)(authData, "logged in"), authData;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/ensureLoggedIn.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAuB,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAuB,0BAEvB,iBAAwB;AAEjB,MAAM,iBAAiB,MAAgB;AAC5C,QAAM,EAAE,SAAS,QAAI,wBAAQ;AAC7B,oCAAO,UAAU,WAAW,GACrB;AACT;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -18,7 +18,7 @@ __export(ensureLoggedIn_exports, {
|
|
|
18
18
|
ensureLoggedIn: () => ensureLoggedIn
|
|
19
19
|
});
|
|
20
20
|
module.exports = __toCommonJS(ensureLoggedIn_exports);
|
|
21
|
-
var import_helpers = require("@vxrn/helpers"), import_context = require("
|
|
21
|
+
var import_helpers = require("@vxrn/helpers"), import_context = require("./context"), ensureLoggedIn = function() {
|
|
22
22
|
var { authData } = (0, import_context.context)();
|
|
23
23
|
return (0, import_helpers.ensure)(authData, "logged in"), authData;
|
|
24
24
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
3
|
"sources": ["../../../src/helpers/ensureLoggedIn.ts"],
|
|
4
|
-
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAuB,0BACvB,iBAAwB,
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,qBAAuB,0BACvB,iBAAwB,sBACb,iBAAiB,WAAW;AACnC,MAAI,EAAE,SAAS,QAAI,wBAAQ;AAC3B,oCAAO,UAAU,WAAW,GACrB;AACX;",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,36 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all) __defProp(target, name, {
|
|
7
|
-
get: all[name],
|
|
8
|
-
enumerable: !0
|
|
9
|
-
});
|
|
10
|
-
},
|
|
11
|
-
__copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
-
get: () => from[key],
|
|
14
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
-
});
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value: !0
|
|
20
|
-
}), mod);
|
|
21
|
-
var getAuthData_exports = {};
|
|
22
|
-
__export(getAuthData_exports, {
|
|
23
|
-
getAuthData: () => getAuthData
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(getAuthData_exports);
|
|
26
|
-
var import_authClient = require("~/auth/client/authClient");
|
|
27
|
-
const getAuthData = () => {
|
|
28
|
-
const {
|
|
29
|
-
user
|
|
30
|
-
} = (0, import_authClient.getAuth)();
|
|
31
|
-
return user ? {
|
|
32
|
-
id: user.id || "anon",
|
|
33
|
-
email: user.email,
|
|
34
|
-
role: void 0
|
|
35
|
-
} : null;
|
|
36
|
-
};
|
|
@@ -1,29 +1 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
-
var getAuthData_exports = {};
|
|
16
|
-
__export(getAuthData_exports, {
|
|
17
|
-
getAuthData: () => getAuthData
|
|
18
|
-
});
|
|
19
|
-
module.exports = __toCommonJS(getAuthData_exports);
|
|
20
|
-
var import_authClient = require("~/auth/client/authClient");
|
|
21
|
-
const getAuthData = () => {
|
|
22
|
-
const { user } = (0, import_authClient.getAuth)();
|
|
23
|
-
return user ? {
|
|
24
|
-
id: user.id || "anon",
|
|
25
|
-
email: user.email,
|
|
26
|
-
role: void 0
|
|
27
|
-
} : null;
|
|
28
|
-
};
|
|
29
1
|
//# sourceMappingURL=getAuthData.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
4
|
-
"mappings": "
|
|
3
|
+
"sources": [],
|
|
4
|
+
"mappings": "",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,33 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var getAuthData_exports = {};
|
|
17
|
-
__export(getAuthData_exports, {
|
|
18
|
-
getAuthData: () => getAuthData
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(getAuthData_exports);
|
|
21
|
-
var import_authClient = require("~/auth/client/authClient"), getAuthData = function() {
|
|
22
|
-
var { user } = (0, import_authClient.getAuth)();
|
|
23
|
-
return user ? {
|
|
24
|
-
id: user.id || "anon",
|
|
25
|
-
email: user.email,
|
|
26
|
-
role: void 0
|
|
27
|
-
} : null;
|
|
28
|
-
};
|
|
29
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
-
0 && (module.exports = {
|
|
31
|
-
getAuthData
|
|
32
|
-
});
|
|
33
2
|
//# sourceMappingURL=getAuthData.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
4
|
-
"mappings": "
|
|
3
|
+
"sources": [],
|
|
4
|
+
"mappings": "",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,32 +0,0 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all) __defProp(target, name, {
|
|
7
|
-
get: all[name],
|
|
8
|
-
enumerable: !0
|
|
9
|
-
});
|
|
10
|
-
},
|
|
11
|
-
__copyProps = (to, from, except, desc) => {
|
|
12
|
-
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
-
get: () => from[key],
|
|
14
|
-
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
-
});
|
|
16
|
-
return to;
|
|
17
|
-
};
|
|
18
|
-
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
-
value: !0
|
|
20
|
-
}), mod);
|
|
21
|
-
var useAuthData_exports = {};
|
|
22
|
-
__export(useAuthData_exports, {
|
|
23
|
-
useAuthData: () => useAuthData
|
|
24
|
-
});
|
|
25
|
-
module.exports = __toCommonJS(useAuthData_exports);
|
|
26
|
-
var import_react = require("react"),
|
|
27
|
-
import_authClient = require("~/auth/client/authClient"),
|
|
28
|
-
import_getAuthData = require("./getAuthData.cjs");
|
|
29
|
-
const useAuthData = () => {
|
|
30
|
-
const userId = (0, import_authClient.useAuth)()?.user?.id || "anon";
|
|
31
|
-
return (0, import_react.useMemo)(() => (0, import_getAuthData.getAuthData)(), [userId]);
|
|
32
|
-
};
|
|
@@ -1,25 +1 @@
|
|
|
1
|
-
var __defProp = Object.defineProperty;
|
|
2
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
-
var __export = (target, all) => {
|
|
6
|
-
for (var name in all)
|
|
7
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
-
for (let key of __getOwnPropNames(from))
|
|
11
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
-
return to;
|
|
13
|
-
};
|
|
14
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
-
var useAuthData_exports = {};
|
|
16
|
-
__export(useAuthData_exports, {
|
|
17
|
-
useAuthData: () => useAuthData
|
|
18
|
-
});
|
|
19
|
-
module.exports = __toCommonJS(useAuthData_exports);
|
|
20
|
-
var import_react = require("react"), import_authClient = require("~/auth/client/authClient"), import_getAuthData = require("./getAuthData");
|
|
21
|
-
const useAuthData = () => {
|
|
22
|
-
const userId = (0, import_authClient.useAuth)()?.user?.id || "anon";
|
|
23
|
-
return (0, import_react.useMemo)(() => (0, import_getAuthData.getAuthData)(), [userId]);
|
|
24
|
-
};
|
|
25
1
|
//# sourceMappingURL=useAuthData.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
4
|
-
"mappings": "
|
|
3
|
+
"sources": [],
|
|
4
|
+
"mappings": "",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -1,33 +1,2 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __defProp = Object.defineProperty;
|
|
3
|
-
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
-
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
-
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
-
var __export = (target, all) => {
|
|
7
|
-
for (var name in all)
|
|
8
|
-
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
9
|
-
}, __copyProps = (to, from, except, desc) => {
|
|
10
|
-
if (from && typeof from == "object" || typeof from == "function")
|
|
11
|
-
for (let key of __getOwnPropNames(from))
|
|
12
|
-
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
13
|
-
return to;
|
|
14
|
-
};
|
|
15
|
-
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
16
|
-
var useAuthData_exports = {};
|
|
17
|
-
__export(useAuthData_exports, {
|
|
18
|
-
useAuthData: () => useAuthData
|
|
19
|
-
});
|
|
20
|
-
module.exports = __toCommonJS(useAuthData_exports);
|
|
21
|
-
var import_react = require("react"), import_authClient = require("~/auth/client/authClient"), import_getAuthData = require("./getAuthData"), useAuthData = function() {
|
|
22
|
-
var _auth_user, auth = (0, import_authClient.useAuth)(), userId = (auth == null || (_auth_user = auth.user) === null || _auth_user === void 0 ? void 0 : _auth_user.id) || "anon";
|
|
23
|
-
return (0, import_react.useMemo)(function() {
|
|
24
|
-
return (0, import_getAuthData.getAuthData)();
|
|
25
|
-
}, [
|
|
26
|
-
userId
|
|
27
|
-
]);
|
|
28
|
-
};
|
|
29
|
-
// Annotate the CommonJS export names for ESM import in node:
|
|
30
|
-
0 && (module.exports = {
|
|
31
|
-
useAuthData
|
|
32
|
-
});
|
|
33
2
|
//# sourceMappingURL=useAuthData.js.map
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"version": 3,
|
|
3
|
-
"sources": [
|
|
4
|
-
"mappings": "
|
|
3
|
+
"sources": [],
|
|
4
|
+
"mappings": "",
|
|
5
5
|
"names": []
|
|
6
6
|
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all) __defProp(target, name, {
|
|
7
|
+
get: all[name],
|
|
8
|
+
enumerable: !0
|
|
9
|
+
});
|
|
10
|
+
},
|
|
11
|
+
__copyProps = (to, from, except, desc) => {
|
|
12
|
+
if (from && typeof from == "object" || typeof from == "function") for (let key of __getOwnPropNames(from)) !__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, {
|
|
13
|
+
get: () => from[key],
|
|
14
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
15
|
+
});
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = mod => __copyProps(__defProp({}, "__esModule", {
|
|
19
|
+
value: !0
|
|
20
|
+
}), mod);
|
|
21
|
+
var useZeroDebug_exports = {};
|
|
22
|
+
__export(useZeroDebug_exports, {
|
|
23
|
+
useZeroDebug: () => useZeroDebug
|
|
24
|
+
});
|
|
25
|
+
module.exports = __toCommonJS(useZeroDebug_exports);
|
|
26
|
+
var import_helpers = require("@vxrn/helpers"),
|
|
27
|
+
import_react = require("react"),
|
|
28
|
+
import_prettyFormatZeroQuery = require("./prettyFormatZeroQuery.cjs");
|
|
29
|
+
const activeQueries = /* @__PURE__ */new Map(),
|
|
30
|
+
astHistoryByComponent = /* @__PURE__ */new Map(),
|
|
31
|
+
filterLogs = table => !1,
|
|
32
|
+
COLLAPSED = !0,
|
|
33
|
+
AST_CHANGE_THRESHOLD = 4,
|
|
34
|
+
MAX_AST_HISTORY = 10,
|
|
35
|
+
useZeroDebug = (query, options, results) => {
|
|
36
|
+
const astObject = query._completeAst?.(),
|
|
37
|
+
table = astObject.table,
|
|
38
|
+
ast = JSON.stringify(astObject, null, 2),
|
|
39
|
+
enabled = !(!options || options?.enabled === !1) && filterLogs(table),
|
|
40
|
+
isPermissionQuery = new Error().stack?.includes("usePermission.ts"),
|
|
41
|
+
id = (0, import_react.useId)(),
|
|
42
|
+
num = activeQueries.get(ast) || 0,
|
|
43
|
+
shouldLog = enabled && num === 0;
|
|
44
|
+
enabled && (activeQueries.set(ast, num + 1), shouldLog && (COLLAPSED ? (console.groupCollapsed(`${isPermissionQuery ? "\u{1F46E}\u200D\u2642\uFE0F" : "\u2728"}${(0, import_prettyFormatZeroQuery.prettyFormatZeroQuery)(query, "minimal")}`), console.info(id, (0, import_prettyFormatZeroQuery.prettyFormatZeroQuery)(query, "full")), console.info("cached result", results), console.trace(), console.groupEnd()) : console.info("\u2728", (0, import_prettyFormatZeroQuery.prettyFormatZeroQuery)(query, "full")))), (0, import_react.useEffect)(() => {
|
|
45
|
+
if (!enabled) return;
|
|
46
|
+
const history = astHistoryByComponent.get(id) || {
|
|
47
|
+
asts: [],
|
|
48
|
+
changeCount: 0
|
|
49
|
+
},
|
|
50
|
+
currentAst = ast,
|
|
51
|
+
lastAst = history.asts[history.asts.length - 1];
|
|
52
|
+
currentAst !== lastAst && (history.asts.push(currentAst), history.asts.length > MAX_AST_HISTORY && history.asts.shift(), history.changeCount++, astHistoryByComponent.set(id, history), history.changeCount > AST_CHANGE_THRESHOLD && console.warn(`\u26A0\uFE0F AST changed ${history.changeCount} times for component.
|
|
53
|
+
- id: ${id}
|
|
54
|
+
- stack: ${(0, import_helpers.getCurrentComponentStack)("short")}
|
|
55
|
+
- table: ${table}`, {
|
|
56
|
+
componentId: id,
|
|
57
|
+
table,
|
|
58
|
+
changeCount: history.changeCount,
|
|
59
|
+
recentAsts: history.asts
|
|
60
|
+
}));
|
|
61
|
+
}, [id, ast, table, enabled]), (0, import_react.useEffect)(() => {
|
|
62
|
+
if (enabled) return () => {
|
|
63
|
+
activeQueries.set(ast, activeQueries.get(ast) - 1);
|
|
64
|
+
};
|
|
65
|
+
}, [ast, enabled]), (0, import_react.useEffect)(() => () => {
|
|
66
|
+
astHistoryByComponent.delete(id);
|
|
67
|
+
}, [id]);
|
|
68
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
var __defProp = Object.defineProperty;
|
|
2
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
3
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
4
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
5
|
+
var __export = (target, all) => {
|
|
6
|
+
for (var name in all)
|
|
7
|
+
__defProp(target, name, { get: all[name], enumerable: !0 });
|
|
8
|
+
}, __copyProps = (to, from, except, desc) => {
|
|
9
|
+
if (from && typeof from == "object" || typeof from == "function")
|
|
10
|
+
for (let key of __getOwnPropNames(from))
|
|
11
|
+
!__hasOwnProp.call(to, key) && key !== except && __defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: !0 }), mod);
|
|
15
|
+
var useZeroDebug_exports = {};
|
|
16
|
+
__export(useZeroDebug_exports, {
|
|
17
|
+
useZeroDebug: () => useZeroDebug
|
|
18
|
+
});
|
|
19
|
+
module.exports = __toCommonJS(useZeroDebug_exports);
|
|
20
|
+
var import_helpers = require("@vxrn/helpers"), import_react = require("react"), import_prettyFormatZeroQuery = require("./prettyFormatZeroQuery");
|
|
21
|
+
const activeQueries = /* @__PURE__ */ new Map(), astHistoryByComponent = /* @__PURE__ */ new Map(), filterLogs = (table) => !1, COLLAPSED = !0, AST_CHANGE_THRESHOLD = 4, MAX_AST_HISTORY = 10, useZeroDebug = (query, options, results) => {
|
|
22
|
+
const astObject = query._completeAst?.(), table = astObject.table, ast = JSON.stringify(astObject, null, 2), enabled = !(!options || options?.enabled === !1) && filterLogs(table), isPermissionQuery = new Error().stack?.includes("usePermission.ts"), id = (0, import_react.useId)(), num = activeQueries.get(ast) || 0, shouldLog = enabled && num === 0;
|
|
23
|
+
enabled && (activeQueries.set(ast, num + 1), shouldLog && (COLLAPSED ? (console.groupCollapsed(
|
|
24
|
+
`${isPermissionQuery ? "\u{1F46E}\u200D\u2642\uFE0F" : "\u2728"}${(0, import_prettyFormatZeroQuery.prettyFormatZeroQuery)(query, "minimal")}`
|
|
25
|
+
), console.info(id, (0, import_prettyFormatZeroQuery.prettyFormatZeroQuery)(query, "full")), console.info("cached result", results), console.trace(), console.groupEnd()) : console.info("\u2728", (0, import_prettyFormatZeroQuery.prettyFormatZeroQuery)(query, "full")))), (0, import_react.useEffect)(() => {
|
|
26
|
+
if (!enabled) return;
|
|
27
|
+
const history = astHistoryByComponent.get(id) || { asts: [], changeCount: 0 }, currentAst = ast, lastAst = history.asts[history.asts.length - 1];
|
|
28
|
+
currentAst !== lastAst && (history.asts.push(currentAst), history.asts.length > MAX_AST_HISTORY && history.asts.shift(), history.changeCount++, astHistoryByComponent.set(id, history), history.changeCount > AST_CHANGE_THRESHOLD && console.warn(
|
|
29
|
+
`\u26A0\uFE0F AST changed ${history.changeCount} times for component.
|
|
30
|
+
- id: ${id}
|
|
31
|
+
- stack: ${(0, import_helpers.getCurrentComponentStack)("short")}
|
|
32
|
+
- table: ${table}`,
|
|
33
|
+
{
|
|
34
|
+
componentId: id,
|
|
35
|
+
table,
|
|
36
|
+
changeCount: history.changeCount,
|
|
37
|
+
recentAsts: history.asts
|
|
38
|
+
}
|
|
39
|
+
));
|
|
40
|
+
}, [id, ast, table, enabled]), (0, import_react.useEffect)(() => {
|
|
41
|
+
if (enabled)
|
|
42
|
+
return () => {
|
|
43
|
+
activeQueries.set(ast, activeQueries.get(ast) - 1);
|
|
44
|
+
};
|
|
45
|
+
}, [ast, enabled]), (0, import_react.useEffect)(() => () => {
|
|
46
|
+
astHistoryByComponent.delete(id);
|
|
47
|
+
}, [id]);
|
|
48
|
+
};
|
|
49
|
+
//# sourceMappingURL=useZeroDebug.js.map
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
{
|
|
2
|
+
"version": 3,
|
|
3
|
+
"sources": ["../../../src/helpers/useZeroDebug.ts"],
|
|
4
|
+
"mappings": ";;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,qBAAyC,0BACzC,eAAiC,kBACjC,+BAAsC;AAEtC,MAAM,gBAAgB,oBAAI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