@powerhousedao/reactor-api 1.19.0 → 1.20.0
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/CHANGELOG.md +48 -10
- package/dist/index.js +296 -227
- package/dist/index.js.map +1 -1
- package/package.json +7 -7
- package/src/server.ts +3 -3
- package/src/subgraphs/auth/utils/helpers.ts +2 -2
- package/src/subgraphs/drive/index.ts +6 -4
- package/src/subgraphs/system/index.ts +3 -1
- package/src/utils/create-schema.ts +51 -10
package/dist/index.js
CHANGED
|
@@ -2,6 +2,7 @@ import { KnexAnalyticsStore, KnexQueryExecutor } from '@powerhousedao/analytics-
|
|
|
2
2
|
import express2, { Router } from 'express';
|
|
3
3
|
import fs from 'node:fs';
|
|
4
4
|
import https from 'node:https';
|
|
5
|
+
import path, { join } from 'node:path';
|
|
5
6
|
import * as analytics_engine_core_star from '@powerhousedao/analytics-engine-core';
|
|
6
7
|
import { AnalyticsQueryEngine, AnalyticsPath, AnalyticsGranularity } from '@powerhousedao/analytics-engine-core';
|
|
7
8
|
export * from '@powerhousedao/analytics-engine-core';
|
|
@@ -15,7 +16,6 @@ import { GraphQLError as GraphQLError$1, parse } from 'graphql';
|
|
|
15
16
|
import { actions } from 'document-model-libs/document-drive';
|
|
16
17
|
import z3, { z as z$1, ZodError as ZodError$1 } from 'zod';
|
|
17
18
|
import crypto from 'node:crypto';
|
|
18
|
-
import path, { join } from 'node:path';
|
|
19
19
|
import 'graphql-request';
|
|
20
20
|
import 'nanoevents';
|
|
21
21
|
import dotenv from 'dotenv';
|
|
@@ -157,7 +157,7 @@ var require_safe_buffer = __commonJS({
|
|
|
157
157
|
throw new TypeError("Argument must be a number");
|
|
158
158
|
}
|
|
159
159
|
var buf = Buffer2(size);
|
|
160
|
-
if (fill !==
|
|
160
|
+
if (fill !== undefined) {
|
|
161
161
|
if (typeof encoding === "string") {
|
|
162
162
|
buf.fill(fill, encoding);
|
|
163
163
|
} else {
|
|
@@ -218,7 +218,7 @@ var require_util = __commonJS({
|
|
|
218
218
|
}
|
|
219
219
|
exports.isSymbol = isSymbol;
|
|
220
220
|
function isUndefined2(arg) {
|
|
221
|
-
return arg ===
|
|
221
|
+
return arg === undefined;
|
|
222
222
|
}
|
|
223
223
|
exports.isUndefined = isUndefined2;
|
|
224
224
|
function isRegExp(re) {
|
|
@@ -588,7 +588,7 @@ var require_stream_writable = __commonJS({
|
|
|
588
588
|
var er = false;
|
|
589
589
|
if (chunk === null) {
|
|
590
590
|
er = new TypeError("May not write null values to stream");
|
|
591
|
-
} else if (typeof chunk !== "string" && chunk !==
|
|
591
|
+
} else if (typeof chunk !== "string" && chunk !== undefined && !state.objectMode) {
|
|
592
592
|
er = new TypeError("Invalid non-string/buffer chunk");
|
|
593
593
|
}
|
|
594
594
|
if (er) {
|
|
@@ -802,7 +802,7 @@ var require_stream_writable = __commonJS({
|
|
|
802
802
|
cb = encoding;
|
|
803
803
|
encoding = null;
|
|
804
804
|
}
|
|
805
|
-
if (chunk !== null && chunk !==
|
|
805
|
+
if (chunk !== null && chunk !== undefined) this.write(chunk, encoding);
|
|
806
806
|
if (state.corked) {
|
|
807
807
|
state.corked = 1;
|
|
808
808
|
this.uncork();
|
|
@@ -869,7 +869,7 @@ var require_stream_writable = __commonJS({
|
|
|
869
869
|
}
|
|
870
870
|
Object.defineProperty(Writable.prototype, "destroyed", {
|
|
871
871
|
get: function() {
|
|
872
|
-
if (this._writableState ===
|
|
872
|
+
if (this._writableState === undefined) {
|
|
873
873
|
return false;
|
|
874
874
|
}
|
|
875
875
|
return this._writableState.destroyed;
|
|
@@ -945,13 +945,13 @@ var require_stream_duplex = __commonJS({
|
|
|
945
945
|
}
|
|
946
946
|
Object.defineProperty(Duplex.prototype, "destroyed", {
|
|
947
947
|
get: function() {
|
|
948
|
-
if (this._readableState ===
|
|
948
|
+
if (this._readableState === undefined || this._writableState === undefined) {
|
|
949
949
|
return false;
|
|
950
950
|
}
|
|
951
951
|
return this._readableState.destroyed && this._writableState.destroyed;
|
|
952
952
|
},
|
|
953
953
|
set: function(value) {
|
|
954
|
-
if (this._readableState ===
|
|
954
|
+
if (this._readableState === undefined || this._writableState === undefined) {
|
|
955
955
|
return;
|
|
956
956
|
}
|
|
957
957
|
this._readableState.destroyed = value;
|
|
@@ -1055,7 +1055,7 @@ var require_string_decoder = __commonJS({
|
|
|
1055
1055
|
var i;
|
|
1056
1056
|
if (this.lastNeed) {
|
|
1057
1057
|
r = this.fillLast(buf);
|
|
1058
|
-
if (r ===
|
|
1058
|
+
if (r === undefined) return "";
|
|
1059
1059
|
i = this.lastNeed;
|
|
1060
1060
|
this.lastNeed = 0;
|
|
1061
1061
|
} else {
|
|
@@ -1127,7 +1127,7 @@ var require_string_decoder = __commonJS({
|
|
|
1127
1127
|
function utf8FillLast(buf) {
|
|
1128
1128
|
var p = this.lastTotal - this.lastNeed;
|
|
1129
1129
|
var r = utf8CheckExtraBytes(this, buf);
|
|
1130
|
-
if (r !==
|
|
1130
|
+
if (r !== undefined) return r;
|
|
1131
1131
|
if (this.lastNeed <= buf.length) {
|
|
1132
1132
|
buf.copy(this.lastChar, p, 0, this.lastNeed);
|
|
1133
1133
|
return this.lastChar.toString(this.encoding, 0, this.lastTotal);
|
|
@@ -1228,7 +1228,7 @@ var require_stream_readable = __commonJS({
|
|
|
1228
1228
|
var util2 = Object.create(require_util());
|
|
1229
1229
|
util2.inherits = require_inherits();
|
|
1230
1230
|
var debugUtil = __require("util");
|
|
1231
|
-
var debug =
|
|
1231
|
+
var debug = undefined;
|
|
1232
1232
|
if (debugUtil && debugUtil.debuglog) {
|
|
1233
1233
|
debug = debugUtil.debuglog("stream");
|
|
1234
1234
|
} else {
|
|
@@ -1297,7 +1297,7 @@ var require_stream_readable = __commonJS({
|
|
|
1297
1297
|
}
|
|
1298
1298
|
Object.defineProperty(Readable.prototype, "destroyed", {
|
|
1299
1299
|
get: function() {
|
|
1300
|
-
if (this._readableState ===
|
|
1300
|
+
if (this._readableState === undefined) {
|
|
1301
1301
|
return false;
|
|
1302
1302
|
}
|
|
1303
1303
|
return this._readableState.destroyed;
|
|
@@ -1384,7 +1384,7 @@ var require_stream_readable = __commonJS({
|
|
|
1384
1384
|
}
|
|
1385
1385
|
function chunkInvalid(state, chunk) {
|
|
1386
1386
|
var er;
|
|
1387
|
-
if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !==
|
|
1387
|
+
if (!_isUint8Array(chunk) && typeof chunk !== "string" && chunk !== undefined && !state.objectMode) {
|
|
1388
1388
|
er = new TypeError("Invalid non-string/buffer chunk");
|
|
1389
1389
|
}
|
|
1390
1390
|
return er;
|
|
@@ -1745,7 +1745,7 @@ var require_stream_readable = __commonJS({
|
|
|
1745
1745
|
stream.on("data", function(chunk) {
|
|
1746
1746
|
debug("wrapped data");
|
|
1747
1747
|
if (state.decoder) chunk = state.decoder.write(chunk);
|
|
1748
|
-
if (state.objectMode && (chunk === null || chunk ===
|
|
1748
|
+
if (state.objectMode && (chunk === null || chunk === undefined)) return;
|
|
1749
1749
|
else if (!state.objectMode && (!chunk || !chunk.length)) return;
|
|
1750
1750
|
var ret = _this.push(chunk);
|
|
1751
1751
|
if (!ret) {
|
|
@@ -1754,7 +1754,7 @@ var require_stream_readable = __commonJS({
|
|
|
1754
1754
|
}
|
|
1755
1755
|
});
|
|
1756
1756
|
for (var i in stream) {
|
|
1757
|
-
if (this[i] ===
|
|
1757
|
+
if (this[i] === undefined && typeof stream[i] === "function") {
|
|
1758
1758
|
this[i] = /* @__PURE__ */ function(method) {
|
|
1759
1759
|
return function() {
|
|
1760
1760
|
return stream[method].apply(stream, arguments);
|
|
@@ -2294,7 +2294,7 @@ var require_lib2 = __commonJS({
|
|
|
2294
2294
|
}
|
|
2295
2295
|
this.state = PENDING;
|
|
2296
2296
|
this.queue = [];
|
|
2297
|
-
this.outcome =
|
|
2297
|
+
this.outcome = undefined;
|
|
2298
2298
|
if (!process.browser) {
|
|
2299
2299
|
this.handled = UNHANDLED;
|
|
2300
2300
|
}
|
|
@@ -9769,7 +9769,7 @@ var require_lib4 = __commonJS({
|
|
|
9769
9769
|
var assign = require_util2().assign;
|
|
9770
9770
|
var keys = require_util2().keys;
|
|
9771
9771
|
function serialize(obj) {
|
|
9772
|
-
if (obj === null || obj ===
|
|
9772
|
+
if (obj === null || obj === undefined) return obj;
|
|
9773
9773
|
if (isRegex(obj)) return obj.toString();
|
|
9774
9774
|
return obj.toJSON ? obj.toJSON() : obj;
|
|
9775
9775
|
}
|
|
@@ -9796,7 +9796,7 @@ var require_lib4 = __commonJS({
|
|
|
9796
9796
|
const colonSeparator = space ? ": " : ":";
|
|
9797
9797
|
node = serialize(node);
|
|
9798
9798
|
node = replacer.call(parent, key, node);
|
|
9799
|
-
if (node ===
|
|
9799
|
+
if (node === undefined) return;
|
|
9800
9800
|
if (!isObject(node) || node === null) return stringify2(node);
|
|
9801
9801
|
if (isArray(node)) {
|
|
9802
9802
|
const out = [];
|
|
@@ -9996,7 +9996,7 @@ var ProcessorManager = class {
|
|
|
9996
9996
|
}
|
|
9997
9997
|
};
|
|
9998
9998
|
|
|
9999
|
-
// ../scalars/dist/es/internal/index-
|
|
9999
|
+
// ../scalars/dist/es/internal/index-FMBAZJfR.js
|
|
10000
10000
|
function devAssert(condition, message) {
|
|
10001
10001
|
const booleanCondition = Boolean(condition);
|
|
10002
10002
|
if (!booleanCondition) {
|
|
@@ -10072,7 +10072,7 @@ function printSourceLocation(source, sourceLocation) {
|
|
|
10072
10072
|
]);
|
|
10073
10073
|
}
|
|
10074
10074
|
function printPrefixedLines(lines) {
|
|
10075
|
-
const existingLines = lines.filter(([_, line]) => line !==
|
|
10075
|
+
const existingLines = lines.filter(([_, line]) => line !== undefined);
|
|
10076
10076
|
const padLen = Math.max(...existingLines.map(([prefix]) => prefix.length));
|
|
10077
10077
|
return existingLines.map(([prefix, line]) => prefix.padStart(padLen) + (line ? " " + line : "")).join("\n");
|
|
10078
10078
|
}
|
|
@@ -10134,21 +10134,21 @@ var GraphQLError = class _GraphQLError extends Error {
|
|
|
10134
10134
|
const { nodes, source, positions, path: path2, originalError, extensions } = toNormalizedOptions(rawArgs);
|
|
10135
10135
|
super(message);
|
|
10136
10136
|
this.name = "GraphQLError";
|
|
10137
|
-
this.path = path2 !== null && path2 !==
|
|
10138
|
-
this.originalError = originalError !== null && originalError !==
|
|
10137
|
+
this.path = path2 !== null && path2 !== undefined ? path2 : undefined;
|
|
10138
|
+
this.originalError = originalError !== null && originalError !== undefined ? originalError : undefined;
|
|
10139
10139
|
this.nodes = undefinedIfEmpty(
|
|
10140
|
-
Array.isArray(nodes) ? nodes : nodes ? [nodes] :
|
|
10140
|
+
Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined
|
|
10141
10141
|
);
|
|
10142
10142
|
const nodeLocations = undefinedIfEmpty(
|
|
10143
|
-
(_this$nodes = this.nodes) === null || _this$nodes ===
|
|
10143
|
+
(_this$nodes = this.nodes) === null || _this$nodes === undefined ? undefined : _this$nodes.map((node) => node.loc).filter((loc) => loc != null)
|
|
10144
10144
|
);
|
|
10145
|
-
this.source = source !== null && source !==
|
|
10146
|
-
this.positions = positions !== null && positions !==
|
|
10147
|
-
this.locations = positions && source ? positions.map((pos) => getLocation(source, pos)) : nodeLocations === null || nodeLocations ===
|
|
10145
|
+
this.source = source !== null && source !== undefined ? source : nodeLocations === null || nodeLocations === undefined ? undefined : (_nodeLocations$ = nodeLocations[0]) === null || _nodeLocations$ === undefined ? undefined : _nodeLocations$.source;
|
|
10146
|
+
this.positions = positions !== null && positions !== undefined ? positions : nodeLocations === null || nodeLocations === undefined ? undefined : nodeLocations.map((loc) => loc.start);
|
|
10147
|
+
this.locations = positions && source ? positions.map((pos) => getLocation(source, pos)) : nodeLocations === null || nodeLocations === undefined ? undefined : nodeLocations.map((loc) => getLocation(loc.source, loc.start));
|
|
10148
10148
|
const originalExtensions = isObjectLike(
|
|
10149
|
-
originalError === null || originalError ===
|
|
10150
|
-
) ? originalError === null || originalError ===
|
|
10151
|
-
this.extensions = (_ref = extensions !== null && extensions !==
|
|
10149
|
+
originalError === null || originalError === undefined ? undefined : originalError.extensions
|
|
10150
|
+
) ? originalError === null || originalError === undefined ? undefined : originalError.extensions : undefined;
|
|
10151
|
+
this.extensions = (_ref = extensions !== null && extensions !== undefined ? extensions : originalExtensions) !== null && _ref !== undefined ? _ref : /* @__PURE__ */ Object.create(null);
|
|
10152
10152
|
Object.defineProperties(this, {
|
|
10153
10153
|
message: {
|
|
10154
10154
|
writable: true,
|
|
@@ -10170,7 +10170,7 @@ var GraphQLError = class _GraphQLError extends Error {
|
|
|
10170
10170
|
enumerable: false
|
|
10171
10171
|
}
|
|
10172
10172
|
});
|
|
10173
|
-
if (originalError !== null && originalError !==
|
|
10173
|
+
if (originalError !== null && originalError !== undefined && originalError.stack) {
|
|
10174
10174
|
Object.defineProperty(this, "stack", {
|
|
10175
10175
|
value: originalError.stack,
|
|
10176
10176
|
writable: true,
|
|
@@ -10221,7 +10221,7 @@ var GraphQLError = class _GraphQLError extends Error {
|
|
|
10221
10221
|
}
|
|
10222
10222
|
};
|
|
10223
10223
|
function undefinedIfEmpty(array) {
|
|
10224
|
-
return array ===
|
|
10224
|
+
return array === undefined || array.length === 0 ? undefined : array;
|
|
10225
10225
|
}
|
|
10226
10226
|
var Kind;
|
|
10227
10227
|
(function(Kind2) {
|
|
@@ -10409,7 +10409,7 @@ function valueFromASTUntyped(valueNode, variables) {
|
|
|
10409
10409
|
(field) => valueFromASTUntyped(field.value, variables)
|
|
10410
10410
|
);
|
|
10411
10411
|
case Kind.VARIABLE:
|
|
10412
|
-
return variables === null || variables ===
|
|
10412
|
+
return variables === null || variables === undefined ? undefined : variables[valueNode.name.value];
|
|
10413
10413
|
}
|
|
10414
10414
|
}
|
|
10415
10415
|
function assertName(name) {
|
|
@@ -10435,16 +10435,16 @@ function assertName(name) {
|
|
|
10435
10435
|
var GraphQLScalarType = class {
|
|
10436
10436
|
constructor(config13) {
|
|
10437
10437
|
var _config$parseValue, _config$serialize, _config$parseLiteral, _config$extensionASTN;
|
|
10438
|
-
const parseValue = (_config$parseValue = config13.parseValue) !== null && _config$parseValue !==
|
|
10438
|
+
const parseValue = (_config$parseValue = config13.parseValue) !== null && _config$parseValue !== undefined ? _config$parseValue : identityFunc;
|
|
10439
10439
|
this.name = assertName(config13.name);
|
|
10440
10440
|
this.description = config13.description;
|
|
10441
10441
|
this.specifiedByURL = config13.specifiedByURL;
|
|
10442
|
-
this.serialize = (_config$serialize = config13.serialize) !== null && _config$serialize !==
|
|
10442
|
+
this.serialize = (_config$serialize = config13.serialize) !== null && _config$serialize !== undefined ? _config$serialize : identityFunc;
|
|
10443
10443
|
this.parseValue = parseValue;
|
|
10444
|
-
this.parseLiteral = (_config$parseLiteral = config13.parseLiteral) !== null && _config$parseLiteral !==
|
|
10444
|
+
this.parseLiteral = (_config$parseLiteral = config13.parseLiteral) !== null && _config$parseLiteral !== undefined ? _config$parseLiteral : (node, variables) => parseValue(valueFromASTUntyped(node, variables));
|
|
10445
10445
|
this.extensions = toObjMap(config13.extensions);
|
|
10446
10446
|
this.astNode = config13.astNode;
|
|
10447
|
-
this.extensionASTNodes = (_config$extensionASTN = config13.extensionASTNodes) !== null && _config$extensionASTN !==
|
|
10447
|
+
this.extensionASTNodes = (_config$extensionASTN = config13.extensionASTNodes) !== null && _config$extensionASTN !== undefined ? _config$extensionASTN : [];
|
|
10448
10448
|
config13.specifiedByURL == null || typeof config13.specifiedByURL === "string" || devAssert(
|
|
10449
10449
|
false,
|
|
10450
10450
|
`${this.name} must provide "specifiedByURL" as a string, but got: ${inspect(config13.specifiedByURL)}.`
|
|
@@ -10527,7 +10527,7 @@ var util;
|
|
|
10527
10527
|
if (checker(item))
|
|
10528
10528
|
return item;
|
|
10529
10529
|
}
|
|
10530
|
-
return
|
|
10530
|
+
return undefined;
|
|
10531
10531
|
};
|
|
10532
10532
|
util2.isInteger = typeof Number.isInteger === "function" ? (val) => Number.isInteger(val) : (val) => typeof val === "number" && isFinite(val) && Math.floor(val) === val;
|
|
10533
10533
|
function joinValues(array, separator = " | ") {
|
|
@@ -10841,7 +10841,7 @@ var makeIssue = (params) => {
|
|
|
10841
10841
|
...issueData,
|
|
10842
10842
|
path: fullPath
|
|
10843
10843
|
};
|
|
10844
|
-
if (issueData.message !==
|
|
10844
|
+
if (issueData.message !== undefined) {
|
|
10845
10845
|
return {
|
|
10846
10846
|
...issueData,
|
|
10847
10847
|
path: fullPath,
|
|
@@ -10873,7 +10873,7 @@ function addIssueToContext(ctx, issueData) {
|
|
|
10873
10873
|
// then schema-bound map if available
|
|
10874
10874
|
overrideMap,
|
|
10875
10875
|
// then global override map
|
|
10876
|
-
overrideMap === errorMap ?
|
|
10876
|
+
overrideMap === errorMap ? undefined : errorMap
|
|
10877
10877
|
// then global default map
|
|
10878
10878
|
].filter((x) => !!x)
|
|
10879
10879
|
});
|
|
@@ -10943,17 +10943,17 @@ var isDirty = (x) => x.status === "dirty";
|
|
|
10943
10943
|
var isValid = (x) => x.status === "valid";
|
|
10944
10944
|
var isAsync = (x) => typeof Promise !== "undefined" && x instanceof Promise;
|
|
10945
10945
|
function __classPrivateFieldGet(receiver, state, kind, f) {
|
|
10946
|
-
if (typeof state === "function" ? receiver !== state ||
|
|
10946
|
+
if (typeof state === "function" ? receiver !== state || true : !state.has(receiver)) throw new TypeError("Cannot read private member from an object whose class did not declare it");
|
|
10947
10947
|
return state.get(receiver);
|
|
10948
10948
|
}
|
|
10949
10949
|
function __classPrivateFieldSet(receiver, state, value, kind, f) {
|
|
10950
|
-
if (typeof state === "function" ? receiver !== state ||
|
|
10950
|
+
if (typeof state === "function" ? receiver !== state || true : !state.has(receiver)) throw new TypeError("Cannot write private member to an object whose class did not declare it");
|
|
10951
10951
|
return state.set(receiver, value), value;
|
|
10952
10952
|
}
|
|
10953
10953
|
var errorUtil;
|
|
10954
10954
|
(function(errorUtil2) {
|
|
10955
10955
|
errorUtil2.errToObj = (message) => typeof message === "string" ? { message } : message || {};
|
|
10956
|
-
errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message ===
|
|
10956
|
+
errorUtil2.toString = (message) => typeof message === "string" ? message : message === null || message === undefined ? undefined : message.message;
|
|
10957
10957
|
})(errorUtil || (errorUtil = {}));
|
|
10958
10958
|
var _ZodEnum_cache;
|
|
10959
10959
|
var _ZodNativeEnum_cache;
|
|
@@ -11008,14 +11008,14 @@ function processCreateParams(params) {
|
|
|
11008
11008
|
var _a, _b;
|
|
11009
11009
|
const { message } = params;
|
|
11010
11010
|
if (iss.code === "invalid_enum_value") {
|
|
11011
|
-
return { message: message !== null && message !==
|
|
11011
|
+
return { message: message !== null && message !== undefined ? message : ctx.defaultError };
|
|
11012
11012
|
}
|
|
11013
11013
|
if (typeof ctx.data === "undefined") {
|
|
11014
|
-
return { message: (_a = message !== null && message !==
|
|
11014
|
+
return { message: (_a = message !== null && message !== undefined ? message : required_error) !== null && _a !== undefined ? _a : ctx.defaultError };
|
|
11015
11015
|
}
|
|
11016
11016
|
if (iss.code !== "invalid_type")
|
|
11017
11017
|
return { message: ctx.defaultError };
|
|
11018
|
-
return { message: (_b = message !== null && message !==
|
|
11018
|
+
return { message: (_b = message !== null && message !== undefined ? message : invalid_type_error) !== null && _b !== undefined ? _b : ctx.defaultError };
|
|
11019
11019
|
};
|
|
11020
11020
|
return { errorMap: customMap, description };
|
|
11021
11021
|
}
|
|
@@ -11071,10 +11071,10 @@ var ZodType = class {
|
|
|
11071
11071
|
const ctx = {
|
|
11072
11072
|
common: {
|
|
11073
11073
|
issues: [],
|
|
11074
|
-
async: (_a = params === null || params ===
|
|
11075
|
-
contextualErrorMap: params === null || params ===
|
|
11074
|
+
async: (_a = params === null || params === undefined ? undefined : params.async) !== null && _a !== undefined ? _a : false,
|
|
11075
|
+
contextualErrorMap: params === null || params === undefined ? undefined : params.errorMap
|
|
11076
11076
|
},
|
|
11077
|
-
path: (params === null || params ===
|
|
11077
|
+
path: (params === null || params === undefined ? undefined : params.path) || [],
|
|
11078
11078
|
schemaErrorMap: this._def.errorMap,
|
|
11079
11079
|
parent: null,
|
|
11080
11080
|
data,
|
|
@@ -11105,7 +11105,7 @@ var ZodType = class {
|
|
|
11105
11105
|
issues: ctx.common.issues
|
|
11106
11106
|
};
|
|
11107
11107
|
} catch (err) {
|
|
11108
|
-
if ((_b = (_a = err === null || err ===
|
|
11108
|
+
if ((_b = (_a = err === null || err === undefined ? undefined : err.message) === null || _a === undefined ? undefined : _a.toLowerCase()) === null || _b === undefined ? undefined : _b.includes("encountered")) {
|
|
11109
11109
|
this["~standard"].async = true;
|
|
11110
11110
|
}
|
|
11111
11111
|
ctx.common = {
|
|
@@ -11130,10 +11130,10 @@ var ZodType = class {
|
|
|
11130
11130
|
const ctx = {
|
|
11131
11131
|
common: {
|
|
11132
11132
|
issues: [],
|
|
11133
|
-
contextualErrorMap: params === null || params ===
|
|
11133
|
+
contextualErrorMap: params === null || params === undefined ? undefined : params.errorMap,
|
|
11134
11134
|
async: true
|
|
11135
11135
|
},
|
|
11136
|
-
path: (params === null || params ===
|
|
11136
|
+
path: (params === null || params === undefined ? undefined : params.path) || [],
|
|
11137
11137
|
schemaErrorMap: this._def.errorMap,
|
|
11138
11138
|
parent: null,
|
|
11139
11139
|
data,
|
|
@@ -11298,7 +11298,7 @@ var ZodType = class {
|
|
|
11298
11298
|
return ZodReadonly.create(this);
|
|
11299
11299
|
}
|
|
11300
11300
|
isOptional() {
|
|
11301
|
-
return this.safeParse(
|
|
11301
|
+
return this.safeParse(undefined).success;
|
|
11302
11302
|
}
|
|
11303
11303
|
isNullable() {
|
|
11304
11304
|
return this.safeParse(null).success;
|
|
@@ -11395,7 +11395,7 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
11395
11395
|
return INVALID;
|
|
11396
11396
|
}
|
|
11397
11397
|
const status = new ParseStatus();
|
|
11398
|
-
let ctx =
|
|
11398
|
+
let ctx = undefined;
|
|
11399
11399
|
for (const check of this._def.checks) {
|
|
11400
11400
|
if (check.kind === "min") {
|
|
11401
11401
|
if (input.data.length < check.value) {
|
|
@@ -11749,10 +11749,10 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
11749
11749
|
}
|
|
11750
11750
|
return this._addCheck({
|
|
11751
11751
|
kind: "datetime",
|
|
11752
|
-
precision: typeof (options === null || options ===
|
|
11753
|
-
offset: (_a = options === null || options ===
|
|
11754
|
-
local: (_b = options === null || options ===
|
|
11755
|
-
...errorUtil.errToObj(options === null || options ===
|
|
11752
|
+
precision: typeof (options === null || options === undefined ? undefined : options.precision) === "undefined" ? null : options === null || options === undefined ? undefined : options.precision,
|
|
11753
|
+
offset: (_a = options === null || options === undefined ? undefined : options.offset) !== null && _a !== undefined ? _a : false,
|
|
11754
|
+
local: (_b = options === null || options === undefined ? undefined : options.local) !== null && _b !== undefined ? _b : false,
|
|
11755
|
+
...errorUtil.errToObj(options === null || options === undefined ? undefined : options.message)
|
|
11756
11756
|
});
|
|
11757
11757
|
}
|
|
11758
11758
|
date(message) {
|
|
@@ -11768,8 +11768,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
11768
11768
|
}
|
|
11769
11769
|
return this._addCheck({
|
|
11770
11770
|
kind: "time",
|
|
11771
|
-
precision: typeof (options === null || options ===
|
|
11772
|
-
...errorUtil.errToObj(options === null || options ===
|
|
11771
|
+
precision: typeof (options === null || options === undefined ? undefined : options.precision) === "undefined" ? null : options === null || options === undefined ? undefined : options.precision,
|
|
11772
|
+
...errorUtil.errToObj(options === null || options === undefined ? undefined : options.message)
|
|
11773
11773
|
});
|
|
11774
11774
|
}
|
|
11775
11775
|
duration(message) {
|
|
@@ -11786,8 +11786,8 @@ var ZodString = class _ZodString extends ZodType {
|
|
|
11786
11786
|
return this._addCheck({
|
|
11787
11787
|
kind: "includes",
|
|
11788
11788
|
value,
|
|
11789
|
-
position: options === null || options ===
|
|
11790
|
-
...errorUtil.errToObj(options === null || options ===
|
|
11789
|
+
position: options === null || options === undefined ? undefined : options.position,
|
|
11790
|
+
...errorUtil.errToObj(options === null || options === undefined ? undefined : options.message)
|
|
11791
11791
|
});
|
|
11792
11792
|
}
|
|
11793
11793
|
startsWith(value, message) {
|
|
@@ -11923,7 +11923,7 @@ ZodString.create = (params) => {
|
|
|
11923
11923
|
return new ZodString({
|
|
11924
11924
|
checks: [],
|
|
11925
11925
|
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
11926
|
-
coerce: (_a = params === null || params ===
|
|
11926
|
+
coerce: (_a = params === null || params === undefined ? undefined : params.coerce) !== null && _a !== undefined ? _a : false,
|
|
11927
11927
|
...processCreateParams(params)
|
|
11928
11928
|
});
|
|
11929
11929
|
};
|
|
@@ -11956,7 +11956,7 @@ var ZodNumber = class _ZodNumber extends ZodType {
|
|
|
11956
11956
|
});
|
|
11957
11957
|
return INVALID;
|
|
11958
11958
|
}
|
|
11959
|
-
let ctx =
|
|
11959
|
+
let ctx = undefined;
|
|
11960
11960
|
const status = new ParseStatus();
|
|
11961
11961
|
for (const check of this._def.checks) {
|
|
11962
11962
|
if (check.kind === "int") {
|
|
@@ -12162,7 +12162,7 @@ ZodNumber.create = (params) => {
|
|
|
12162
12162
|
return new ZodNumber({
|
|
12163
12163
|
checks: [],
|
|
12164
12164
|
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
12165
|
-
coerce: (params === null || params ===
|
|
12165
|
+
coerce: (params === null || params === undefined ? undefined : params.coerce) || false,
|
|
12166
12166
|
...processCreateParams(params)
|
|
12167
12167
|
});
|
|
12168
12168
|
};
|
|
@@ -12184,7 +12184,7 @@ var ZodBigInt = class _ZodBigInt extends ZodType {
|
|
|
12184
12184
|
if (parsedType !== ZodParsedType.bigint) {
|
|
12185
12185
|
return this._getInvalidInput(input);
|
|
12186
12186
|
}
|
|
12187
|
-
let ctx =
|
|
12187
|
+
let ctx = undefined;
|
|
12188
12188
|
const status = new ParseStatus();
|
|
12189
12189
|
for (const check of this._def.checks) {
|
|
12190
12190
|
if (check.kind === "min") {
|
|
@@ -12335,7 +12335,7 @@ ZodBigInt.create = (params) => {
|
|
|
12335
12335
|
return new ZodBigInt({
|
|
12336
12336
|
checks: [],
|
|
12337
12337
|
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
12338
|
-
coerce: (_a = params === null || params ===
|
|
12338
|
+
coerce: (_a = params === null || params === undefined ? undefined : params.coerce) !== null && _a !== undefined ? _a : false,
|
|
12339
12339
|
...processCreateParams(params)
|
|
12340
12340
|
});
|
|
12341
12341
|
};
|
|
@@ -12360,7 +12360,7 @@ var ZodBoolean = class extends ZodType {
|
|
|
12360
12360
|
ZodBoolean.create = (params) => {
|
|
12361
12361
|
return new ZodBoolean({
|
|
12362
12362
|
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
|
12363
|
-
coerce: (params === null || params ===
|
|
12363
|
+
coerce: (params === null || params === undefined ? undefined : params.coerce) || false,
|
|
12364
12364
|
...processCreateParams(params)
|
|
12365
12365
|
});
|
|
12366
12366
|
};
|
|
@@ -12387,7 +12387,7 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
12387
12387
|
return INVALID;
|
|
12388
12388
|
}
|
|
12389
12389
|
const status = new ParseStatus();
|
|
12390
|
-
let ctx =
|
|
12390
|
+
let ctx = undefined;
|
|
12391
12391
|
for (const check of this._def.checks) {
|
|
12392
12392
|
if (check.kind === "min") {
|
|
12393
12393
|
if (input.data.getTime() < check.value) {
|
|
@@ -12468,7 +12468,7 @@ var ZodDate = class _ZodDate extends ZodType {
|
|
|
12468
12468
|
ZodDate.create = (params) => {
|
|
12469
12469
|
return new ZodDate({
|
|
12470
12470
|
checks: [],
|
|
12471
|
-
coerce: (params === null || params ===
|
|
12471
|
+
coerce: (params === null || params === undefined ? undefined : params.coerce) || false,
|
|
12472
12472
|
typeName: ZodFirstPartyTypeKind.ZodDate,
|
|
12473
12473
|
...processCreateParams(params)
|
|
12474
12474
|
});
|
|
@@ -12622,8 +12622,8 @@ var ZodArray = class _ZodArray extends ZodType {
|
|
|
12622
12622
|
if (tooBig || tooSmall) {
|
|
12623
12623
|
addIssueToContext(ctx, {
|
|
12624
12624
|
code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,
|
|
12625
|
-
minimum: tooSmall ? def.exactLength.value :
|
|
12626
|
-
maximum: tooBig ? def.exactLength.value :
|
|
12625
|
+
minimum: tooSmall ? def.exactLength.value : undefined,
|
|
12626
|
+
maximum: tooBig ? def.exactLength.value : undefined,
|
|
12627
12627
|
type: "array",
|
|
12628
12628
|
inclusive: true,
|
|
12629
12629
|
exact: true,
|
|
@@ -12839,13 +12839,13 @@ var ZodObject = class _ZodObject extends ZodType {
|
|
|
12839
12839
|
return new _ZodObject({
|
|
12840
12840
|
...this._def,
|
|
12841
12841
|
unknownKeys: "strict",
|
|
12842
|
-
...message !==
|
|
12842
|
+
...message !== undefined ? {
|
|
12843
12843
|
errorMap: (issue, ctx) => {
|
|
12844
12844
|
var _a, _b, _c, _d;
|
|
12845
|
-
const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b ===
|
|
12845
|
+
const defaultError = (_c = (_b = (_a = this._def).errorMap) === null || _b === undefined ? undefined : _b.call(_a, issue, ctx).message) !== null && _c !== undefined ? _c : ctx.defaultError;
|
|
12846
12846
|
if (issue.code === "unrecognized_keys")
|
|
12847
12847
|
return {
|
|
12848
|
-
message: (_d = errorUtil.errToObj(message).message) !== null && _d !==
|
|
12848
|
+
message: (_d = errorUtil.errToObj(message).message) !== null && _d !== undefined ? _d : defaultError
|
|
12849
12849
|
};
|
|
12850
12850
|
return {
|
|
12851
12851
|
message: defaultError
|
|
@@ -13112,7 +13112,7 @@ var ZodUnion = class extends ZodType {
|
|
|
13112
13112
|
};
|
|
13113
13113
|
})).then(handleResults);
|
|
13114
13114
|
} else {
|
|
13115
|
-
let dirty =
|
|
13115
|
+
let dirty = undefined;
|
|
13116
13116
|
const issues = [];
|
|
13117
13117
|
for (const option of options) {
|
|
13118
13118
|
const childCtx = {
|
|
@@ -13174,11 +13174,11 @@ var getDiscriminator = (type13) => {
|
|
|
13174
13174
|
} else if (type13 instanceof ZodDefault) {
|
|
13175
13175
|
return getDiscriminator(type13._def.innerType);
|
|
13176
13176
|
} else if (type13 instanceof ZodUndefined) {
|
|
13177
|
-
return [
|
|
13177
|
+
return [undefined];
|
|
13178
13178
|
} else if (type13 instanceof ZodNull) {
|
|
13179
13179
|
return [null];
|
|
13180
13180
|
} else if (type13 instanceof ZodOptional) {
|
|
13181
|
-
return [
|
|
13181
|
+
return [undefined, ...getDiscriminator(type13.unwrap())];
|
|
13182
13182
|
} else if (type13 instanceof ZodNullable) {
|
|
13183
13183
|
return [null, ...getDiscriminator(type13.unwrap())];
|
|
13184
13184
|
} else if (type13 instanceof ZodBranded) {
|
|
@@ -13795,7 +13795,7 @@ function createZodEnum(values, params) {
|
|
|
13795
13795
|
var ZodEnum = class _ZodEnum extends ZodType {
|
|
13796
13796
|
constructor() {
|
|
13797
13797
|
super(...arguments);
|
|
13798
|
-
_ZodEnum_cache.set(this,
|
|
13798
|
+
_ZodEnum_cache.set(this, undefined);
|
|
13799
13799
|
}
|
|
13800
13800
|
_parse(input) {
|
|
13801
13801
|
if (typeof input.data !== "string") {
|
|
@@ -13865,7 +13865,7 @@ ZodEnum.create = createZodEnum;
|
|
|
13865
13865
|
var ZodNativeEnum = class extends ZodType {
|
|
13866
13866
|
constructor() {
|
|
13867
13867
|
super(...arguments);
|
|
13868
|
-
_ZodNativeEnum_cache.set(this,
|
|
13868
|
+
_ZodNativeEnum_cache.set(this, undefined);
|
|
13869
13869
|
}
|
|
13870
13870
|
_parse(input) {
|
|
13871
13871
|
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
|
@@ -14075,7 +14075,7 @@ var ZodOptional = class extends ZodType {
|
|
|
14075
14075
|
_parse(input) {
|
|
14076
14076
|
const parsedType = this._getType(input);
|
|
14077
14077
|
if (parsedType === ZodParsedType.undefined) {
|
|
14078
|
-
return OK(
|
|
14078
|
+
return OK(undefined);
|
|
14079
14079
|
}
|
|
14080
14080
|
return this._def.innerType._parse(input);
|
|
14081
14081
|
}
|
|
@@ -14306,7 +14306,7 @@ function custom(check, params = {}, fatal) {
|
|
|
14306
14306
|
var _a, _b;
|
|
14307
14307
|
if (!check(data)) {
|
|
14308
14308
|
const p = typeof params === "function" ? params(data) : typeof params === "string" ? { message: params } : params;
|
|
14309
|
-
const _fatal = (_b = (_a = p.fatal) !== null && _a !==
|
|
14309
|
+
const _fatal = (_b = (_a = p.fatal) !== null && _a !== undefined ? _a : fatal) !== null && _b !== undefined ? _b : true;
|
|
14310
14310
|
const p2 = typeof p === "string" ? { message: p } : p;
|
|
14311
14311
|
ctx.addIssue({ code: "custom", ...p2, fatal: _fatal });
|
|
14312
14312
|
}
|
|
@@ -14979,16 +14979,45 @@ var getDocumentModelTypeDefs = (documentDriveServer, typeDefs2) => {
|
|
|
14979
14979
|
const documentModels = documentDriveServer.getDocumentModels();
|
|
14980
14980
|
let dmSchema = "";
|
|
14981
14981
|
documentModels.forEach(({ documentModel: documentModel2 }) => {
|
|
14982
|
-
|
|
14982
|
+
const dmSchemaName = documentModel2.name.replaceAll(" ", "");
|
|
14983
|
+
let tmpDmSchema = `
|
|
14983
14984
|
${documentModel2.specifications.map(
|
|
14984
|
-
(specification) => specification.state.global.schema.replaceAll("
|
|
14985
|
+
(specification) => specification.state.global.schema.replaceAll("scalar DateTime", "").replaceAll(/input (.*?) {[\s\S]*?}/g, "")
|
|
14985
14986
|
).join("\n")};
|
|
14986
14987
|
|
|
14987
14988
|
${documentModel2.specifications.map(
|
|
14988
|
-
(specification) => specification.state.local.schema.replaceAll("
|
|
14989
|
+
(specification) => specification.state.local.schema.replaceAll("scalar DateTime", "").replaceAll(/input (.*?) {[\s\S]*?}/g, "").replaceAll("type AccountSnapshotLocalState", "").replaceAll("type BudgetStatementLocalState", "").replaceAll("type ScopeFrameworkLocalState", "")
|
|
14989
14990
|
).join("\n")};
|
|
14990
14991
|
|
|
14991
|
-
|
|
14992
|
+
|
|
14993
|
+
`;
|
|
14994
|
+
const found = tmpDmSchema.match(/(type|enum|union)\s+(\w+)\s/g);
|
|
14995
|
+
const trimmedFound = found?.map(
|
|
14996
|
+
(f) => f.replaceAll("type ", "").replaceAll("enum ", "").replaceAll("union ", "").trim()
|
|
14997
|
+
);
|
|
14998
|
+
trimmedFound?.forEach((f) => {
|
|
14999
|
+
const typeRegex = new RegExp(
|
|
15000
|
+
// Match type references in various GraphQL contexts
|
|
15001
|
+
`(?<![_A-Za-z0-9])(${f})(?![_A-Za-z0-9])|\\[(${f})\\]|\\[(${f})!\\]|\\[(${f})\\]!|\\[(${f})!\\]!`,
|
|
15002
|
+
// Non-null array of non-null types
|
|
15003
|
+
"g"
|
|
15004
|
+
);
|
|
15005
|
+
tmpDmSchema = tmpDmSchema.replace(
|
|
15006
|
+
typeRegex,
|
|
15007
|
+
(match2, p1, p2, p3, p4, p5) => {
|
|
15008
|
+
if (match2.startsWith("[")) {
|
|
15009
|
+
return match2.replace(
|
|
15010
|
+
p2 || p3 || p4 || p5,
|
|
15011
|
+
`${dmSchemaName}_${p2 || p3 || p4 || p5}`
|
|
15012
|
+
);
|
|
15013
|
+
}
|
|
15014
|
+
return `${dmSchemaName}_${p1}`;
|
|
15015
|
+
}
|
|
15016
|
+
);
|
|
15017
|
+
});
|
|
15018
|
+
dmSchema += tmpDmSchema;
|
|
15019
|
+
dmSchema += `
|
|
15020
|
+
type ${dmSchemaName} implements IDocument {
|
|
14992
15021
|
id: String!
|
|
14993
15022
|
name: String!
|
|
14994
15023
|
documentType: String!
|
|
@@ -14996,8 +15025,8 @@ var getDocumentModelTypeDefs = (documentDriveServer, typeDefs2) => {
|
|
|
14996
15025
|
revision: Int!
|
|
14997
15026
|
created: DateTime!
|
|
14998
15027
|
lastModified: DateTime!
|
|
14999
|
-
${
|
|
15000
|
-
${
|
|
15028
|
+
${dmSchemaName !== "DocumentModel" ? `initialState: ${dmSchemaName}_${dmSchemaName}State!` : ""}
|
|
15029
|
+
${dmSchemaName !== "DocumentModel" ? `state: ${dmSchemaName}_${dmSchemaName}State!` : ""}
|
|
15001
15030
|
}
|
|
15002
15031
|
`;
|
|
15003
15032
|
});
|
|
@@ -15058,7 +15087,7 @@ __export(analytics_exports, {
|
|
|
15058
15087
|
AnalyticsSubgraph: () => AnalyticsSubgraph
|
|
15059
15088
|
});
|
|
15060
15089
|
|
|
15061
|
-
// ../../node_modules/.pnpm/@powerhousedao+analytics-engine-graphql@0.2.
|
|
15090
|
+
// ../../node_modules/.pnpm/@powerhousedao+analytics-engine-graphql@0.2.2/node_modules/@powerhousedao/analytics-engine-graphql/dist/AnalyticsResolvers.js
|
|
15062
15091
|
var AnalyticsResolvers = {
|
|
15063
15092
|
Query: {
|
|
15064
15093
|
analytics: (_, __, { dataSources }) => {
|
|
@@ -15799,8 +15828,8 @@ var PolyNumberFormatter = class {
|
|
|
15799
15828
|
var PolyDateFormatter = class {
|
|
15800
15829
|
constructor(dt, intl, opts) {
|
|
15801
15830
|
this.opts = opts;
|
|
15802
|
-
this.originalZone =
|
|
15803
|
-
let z4 =
|
|
15831
|
+
this.originalZone = undefined;
|
|
15832
|
+
let z4 = undefined;
|
|
15804
15833
|
if (this.opts.timeZone) {
|
|
15805
15834
|
this.dt = dt;
|
|
15806
15835
|
} else if (dt.zone.type === "fixed") {
|
|
@@ -15979,7 +16008,7 @@ var Locale = class _Locale {
|
|
|
15979
16008
|
meridiems() {
|
|
15980
16009
|
return listStuff(
|
|
15981
16010
|
this,
|
|
15982
|
-
|
|
16011
|
+
undefined,
|
|
15983
16012
|
() => meridiems,
|
|
15984
16013
|
() => {
|
|
15985
16014
|
if (!this.meridiemCache) {
|
|
@@ -16660,7 +16689,7 @@ function maybeArray(thing) {
|
|
|
16660
16689
|
}
|
|
16661
16690
|
function bestBy(arr, by, compare) {
|
|
16662
16691
|
if (arr.length === 0) {
|
|
16663
|
-
return
|
|
16692
|
+
return undefined;
|
|
16664
16693
|
}
|
|
16665
16694
|
return arr.reduce((best, next) => {
|
|
16666
16695
|
const pair = [by(next), next];
|
|
@@ -16716,21 +16745,21 @@ function padStart(input, n2 = 2) {
|
|
|
16716
16745
|
}
|
|
16717
16746
|
function parseInteger(string) {
|
|
16718
16747
|
if (isUndefined(string) || string === null || string === "") {
|
|
16719
|
-
return
|
|
16748
|
+
return undefined;
|
|
16720
16749
|
} else {
|
|
16721
16750
|
return parseInt(string, 10);
|
|
16722
16751
|
}
|
|
16723
16752
|
}
|
|
16724
16753
|
function parseFloating(string) {
|
|
16725
16754
|
if (isUndefined(string) || string === null || string === "") {
|
|
16726
|
-
return
|
|
16755
|
+
return undefined;
|
|
16727
16756
|
} else {
|
|
16728
16757
|
return parseFloat(string);
|
|
16729
16758
|
}
|
|
16730
16759
|
}
|
|
16731
16760
|
function parseMillis(fraction) {
|
|
16732
16761
|
if (isUndefined(fraction) || fraction === null || fraction === "") {
|
|
16733
|
-
return
|
|
16762
|
+
return undefined;
|
|
16734
16763
|
} else {
|
|
16735
16764
|
const f = parseFloat("0." + fraction) * 1e3;
|
|
16736
16765
|
return Math.floor(f);
|
|
@@ -16819,7 +16848,7 @@ function normalizeObject(obj, normalizer) {
|
|
|
16819
16848
|
for (const u in obj) {
|
|
16820
16849
|
if (hasOwnProperty(obj, u)) {
|
|
16821
16850
|
const v = obj[u];
|
|
16822
|
-
if (v ===
|
|
16851
|
+
if (v === undefined || v === null) continue;
|
|
16823
16852
|
normalized[normalizer(u)] = asNumber(v);
|
|
16824
16853
|
}
|
|
16825
16854
|
}
|
|
@@ -17361,7 +17390,7 @@ function extractISODuration(match2) {
|
|
|
17361
17390
|
const [s2, yearStr, monthStr, weekStr, dayStr, hourStr, minuteStr, secondStr, millisecondsStr] = match2;
|
|
17362
17391
|
const hasNegativePrefix = s2[0] === "-";
|
|
17363
17392
|
const negativeSeconds = secondStr && secondStr[0] === "-";
|
|
17364
|
-
const maybeNegate = (num, force = false) => num !==
|
|
17393
|
+
const maybeNegate = (num, force = false) => num !== undefined && (force || num && hasNegativePrefix) ? -num : num;
|
|
17365
17394
|
return [
|
|
17366
17395
|
{
|
|
17367
17396
|
years: maybeNegate(parseFloating(yearStr)),
|
|
@@ -18301,7 +18330,7 @@ var Duration = class _Duration {
|
|
|
18301
18330
|
return false;
|
|
18302
18331
|
}
|
|
18303
18332
|
function eq(v1, v2) {
|
|
18304
|
-
if (v1 ===
|
|
18333
|
+
if (v1 === undefined || v1 === 0) return v2 === undefined || v2 === 0;
|
|
18305
18334
|
return v1 === v2;
|
|
18306
18335
|
}
|
|
18307
18336
|
for (const u of orderedUnits) {
|
|
@@ -19329,7 +19358,7 @@ function tokenForPart(part, formatOpts, resolvedOpts) {
|
|
|
19329
19358
|
val
|
|
19330
19359
|
};
|
|
19331
19360
|
}
|
|
19332
|
-
return
|
|
19361
|
+
return undefined;
|
|
19333
19362
|
}
|
|
19334
19363
|
function buildRegex(units) {
|
|
19335
19364
|
const re = units.map((u) => u.regex).reduce((f, r) => `${f}(${r.source})`, "");
|
|
@@ -19437,7 +19466,7 @@ function maybeExpandMacroToken(token, locale) {
|
|
|
19437
19466
|
}
|
|
19438
19467
|
const formatOpts = Formatter.macroTokenToFormatOpts(token.val);
|
|
19439
19468
|
const tokens = formatOptsToTokens(formatOpts, locale);
|
|
19440
|
-
if (tokens == null || tokens.includes(
|
|
19469
|
+
if (tokens == null || tokens.includes(undefined)) {
|
|
19441
19470
|
return token;
|
|
19442
19471
|
}
|
|
19443
19472
|
return tokens;
|
|
@@ -19462,7 +19491,7 @@ var TokenParser = class {
|
|
|
19462
19491
|
if (!this.isValid) {
|
|
19463
19492
|
return { input, tokens: this.tokens, invalidReason: this.invalidReason };
|
|
19464
19493
|
} else {
|
|
19465
|
-
const [rawMatches, matches] = match(input, this.regex, this.handlers), [result, zone, specificOffset] = matches ? dateTimeFromMatches(matches) : [null, null,
|
|
19494
|
+
const [rawMatches, matches] = match(input, this.regex, this.handlers), [result, zone, specificOffset] = matches ? dateTimeFromMatches(matches) : [null, null, undefined];
|
|
19466
19495
|
if (hasOwnProperty(matches, "a") && hasOwnProperty(matches, "H")) {
|
|
19467
19496
|
throw new ConflictingSpecificationError(
|
|
19468
19497
|
"Can't include meridiem when specifying 24-hour format"
|
|
@@ -19748,7 +19777,7 @@ function normalizeUnitWithLocalWeeks(unit) {
|
|
|
19748
19777
|
}
|
|
19749
19778
|
function guessOffsetForZone(zone) {
|
|
19750
19779
|
if (!zoneOffsetGuessCache[zone]) {
|
|
19751
|
-
if (zoneOffsetTs ===
|
|
19780
|
+
if (zoneOffsetTs === undefined) {
|
|
19752
19781
|
zoneOffsetTs = Settings.now();
|
|
19753
19782
|
}
|
|
19754
19783
|
zoneOffsetGuessCache[zone] = zone.offset(zoneOffsetTs);
|
|
@@ -19950,7 +19979,7 @@ var DateTime2 = class _DateTime {
|
|
|
19950
19979
|
throw new InvalidArgumentError(
|
|
19951
19980
|
`fromMillis requires a numerical input, but received a ${typeof milliseconds} with value ${milliseconds}`
|
|
19952
19981
|
);
|
|
19953
|
-
} else if (milliseconds < -
|
|
19982
|
+
} else if (milliseconds < -864e13 || milliseconds > MAX_DATE) {
|
|
19954
19983
|
return _DateTime.invalid("Timestamp out of range");
|
|
19955
19984
|
} else {
|
|
19956
19985
|
return new _DateTime({
|
|
@@ -20246,7 +20275,7 @@ var DateTime2 = class _DateTime {
|
|
|
20246
20275
|
return expanded.map((t) => t.val).join("");
|
|
20247
20276
|
}
|
|
20248
20277
|
static resetCache() {
|
|
20249
|
-
zoneOffsetTs =
|
|
20278
|
+
zoneOffsetTs = undefined;
|
|
20250
20279
|
zoneOffsetGuessCache = {};
|
|
20251
20280
|
}
|
|
20252
20281
|
// INFO
|
|
@@ -21244,7 +21273,7 @@ var DateTime2 = class _DateTime {
|
|
|
21244
21273
|
let unit = options.unit;
|
|
21245
21274
|
if (Array.isArray(options.unit)) {
|
|
21246
21275
|
units = options.unit;
|
|
21247
|
-
unit =
|
|
21276
|
+
unit = undefined;
|
|
21248
21277
|
}
|
|
21249
21278
|
return diffRelative(base, this.plus(padding), {
|
|
21250
21279
|
...options,
|
|
@@ -21549,7 +21578,7 @@ function friendlyDateTime(dateTimeish) {
|
|
|
21549
21578
|
}
|
|
21550
21579
|
}
|
|
21551
21580
|
|
|
21552
|
-
// ../../node_modules/.pnpm/@powerhousedao+analytics-engine-graphql@0.2.
|
|
21581
|
+
// ../../node_modules/.pnpm/@powerhousedao+analytics-engine-graphql@0.2.2/node_modules/@powerhousedao/analytics-engine-graphql/dist/AnalyticsModel.js
|
|
21553
21582
|
var AnalyticsModel = class {
|
|
21554
21583
|
engine;
|
|
21555
21584
|
queryLogger;
|
|
@@ -21589,7 +21618,12 @@ var AnalyticsModel = class {
|
|
|
21589
21618
|
}
|
|
21590
21619
|
this.queryLogger(query);
|
|
21591
21620
|
const results = await this.engine.execute(query);
|
|
21592
|
-
|
|
21621
|
+
const convertedResults = results.map((r) => ({
|
|
21622
|
+
...r,
|
|
21623
|
+
start: r.start.toJSDate(),
|
|
21624
|
+
end: r.end.toJSDate()
|
|
21625
|
+
}));
|
|
21626
|
+
return convertedResults;
|
|
21593
21627
|
}
|
|
21594
21628
|
async multiCurrencyQuery(filter) {
|
|
21595
21629
|
if (!filter) {
|
|
@@ -21673,7 +21707,7 @@ var getCurrency = (currency) => {
|
|
|
21673
21707
|
return currency ? AnalyticsPath.fromString(currency) : AnalyticsPath.fromString("");
|
|
21674
21708
|
};
|
|
21675
21709
|
|
|
21676
|
-
// ../../node_modules/.pnpm/@powerhousedao+analytics-engine-graphql@0.2.
|
|
21710
|
+
// ../../node_modules/.pnpm/@powerhousedao+analytics-engine-graphql@0.2.2/node_modules/@powerhousedao/analytics-engine-graphql/dist/schema.js
|
|
21677
21711
|
var typedefs = `
|
|
21678
21712
|
type AnalyticsQuery {
|
|
21679
21713
|
series(filter: AnalyticsFilter): [AnalyticsPeriod]
|
|
@@ -21911,7 +21945,7 @@ function isBaseMapInstance(obj) {
|
|
|
21911
21945
|
}
|
|
21912
21946
|
function latest(proxyDraft) {
|
|
21913
21947
|
var _a;
|
|
21914
|
-
return (_a = proxyDraft.copy) !== null && _a !==
|
|
21948
|
+
return (_a = proxyDraft.copy) !== null && _a !== undefined ? _a : proxyDraft.original;
|
|
21915
21949
|
}
|
|
21916
21950
|
function isDraft(target) {
|
|
21917
21951
|
return !!getProxyDraft(target);
|
|
@@ -21919,24 +21953,24 @@ function isDraft(target) {
|
|
|
21919
21953
|
function getProxyDraft(value) {
|
|
21920
21954
|
if (typeof value !== "object")
|
|
21921
21955
|
return null;
|
|
21922
|
-
return value === null || value ===
|
|
21956
|
+
return value === null || value === undefined ? undefined : value[PROXY_DRAFT];
|
|
21923
21957
|
}
|
|
21924
21958
|
function getValue(value) {
|
|
21925
21959
|
var _a;
|
|
21926
21960
|
const proxyDraft = getProxyDraft(value);
|
|
21927
|
-
return proxyDraft ? (_a = proxyDraft.copy) !== null && _a !==
|
|
21961
|
+
return proxyDraft ? (_a = proxyDraft.copy) !== null && _a !== undefined ? _a : proxyDraft.original : value;
|
|
21928
21962
|
}
|
|
21929
21963
|
function isDraftable(value, options) {
|
|
21930
21964
|
if (!value || typeof value !== "object")
|
|
21931
21965
|
return false;
|
|
21932
21966
|
let markResult;
|
|
21933
|
-
return Object.getPrototypeOf(value) === Object.prototype || Array.isArray(value) || value instanceof Map || value instanceof Set || !!(options === null || options ===
|
|
21967
|
+
return Object.getPrototypeOf(value) === Object.prototype || Array.isArray(value) || value instanceof Map || value instanceof Set || !!(options === null || options === undefined ? undefined : options.mark) && ((markResult = options.mark(value, dataTypes)) === dataTypes.immutable || typeof markResult === "function");
|
|
21934
21968
|
}
|
|
21935
21969
|
function getPath(target, path2 = []) {
|
|
21936
21970
|
if (Object.hasOwnProperty.call(target, "key")) {
|
|
21937
21971
|
const parentCopy = target.parent.copy;
|
|
21938
21972
|
const proxyDraft = getProxyDraft(get(parentCopy, target.key));
|
|
21939
|
-
if (proxyDraft !== null && (proxyDraft === null || proxyDraft ===
|
|
21973
|
+
if (proxyDraft !== null && (proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.original) !== target.original) {
|
|
21940
21974
|
return null;
|
|
21941
21975
|
}
|
|
21942
21976
|
const isSet = target.parent.type === 3;
|
|
@@ -22054,7 +22088,7 @@ function shallowCopy(original, options) {
|
|
|
22054
22088
|
return new SubClass(original);
|
|
22055
22089
|
}
|
|
22056
22090
|
return new Map(original);
|
|
22057
|
-
} else if ((options === null || options ===
|
|
22091
|
+
} else if ((options === null || options === undefined ? undefined : options.mark) && (markResult = options.mark(original, dataTypes), markResult !== undefined) && markResult !== dataTypes.mutable) {
|
|
22058
22092
|
if (markResult === dataTypes.immutable) {
|
|
22059
22093
|
return strictCopy(original);
|
|
22060
22094
|
} else if (typeof markResult === "function") {
|
|
@@ -22118,7 +22152,7 @@ function cloneIfNeeded(target) {
|
|
|
22118
22152
|
}
|
|
22119
22153
|
function markChanged(proxyDraft) {
|
|
22120
22154
|
var _a;
|
|
22121
|
-
proxyDraft.assignedMap = (_a = proxyDraft.assignedMap) !== null && _a !==
|
|
22155
|
+
proxyDraft.assignedMap = (_a = proxyDraft.assignedMap) !== null && _a !== undefined ? _a : /* @__PURE__ */ new Map();
|
|
22122
22156
|
if (!proxyDraft.operated) {
|
|
22123
22157
|
proxyDraft.operated = true;
|
|
22124
22158
|
if (proxyDraft.parent) {
|
|
@@ -22131,9 +22165,9 @@ function throwFrozenError() {
|
|
|
22131
22165
|
}
|
|
22132
22166
|
function deepFreeze(target, subKey, updatedValues, stack, keys) {
|
|
22133
22167
|
{
|
|
22134
|
-
updatedValues = updatedValues !== null && updatedValues !==
|
|
22135
|
-
stack = stack !== null && stack !==
|
|
22136
|
-
keys = keys !== null && keys !==
|
|
22168
|
+
updatedValues = updatedValues !== null && updatedValues !== undefined ? updatedValues : /* @__PURE__ */ new WeakMap();
|
|
22169
|
+
stack = stack !== null && stack !== undefined ? stack : [];
|
|
22170
|
+
keys = keys !== null && keys !== undefined ? keys : [];
|
|
22137
22171
|
const value = updatedValues.has(target) ? updatedValues.get(target) : target;
|
|
22138
22172
|
if (stack.length > 0) {
|
|
22139
22173
|
const index2 = stack.indexOf(value);
|
|
@@ -22218,14 +22252,14 @@ function handleValue(target, handledSet, options) {
|
|
|
22218
22252
|
if (isDraft(target) || !isDraftable(target, options) || handledSet.has(target) || Object.isFrozen(target))
|
|
22219
22253
|
return;
|
|
22220
22254
|
const isSet = target instanceof Set;
|
|
22221
|
-
const setMap = isSet ? /* @__PURE__ */ new Map() :
|
|
22255
|
+
const setMap = isSet ? /* @__PURE__ */ new Map() : undefined;
|
|
22222
22256
|
handledSet.add(target);
|
|
22223
22257
|
forEach(target, (key, value) => {
|
|
22224
22258
|
var _a;
|
|
22225
22259
|
if (isDraft(value)) {
|
|
22226
22260
|
const proxyDraft = getProxyDraft(value);
|
|
22227
22261
|
ensureShallowCopy(proxyDraft);
|
|
22228
|
-
const updatedValue = ((_a = proxyDraft.assignedMap) === null || _a ===
|
|
22262
|
+
const updatedValue = ((_a = proxyDraft.assignedMap) === null || _a === undefined ? undefined : _a.size) || proxyDraft.operated ? proxyDraft.copy : proxyDraft.original;
|
|
22229
22263
|
set(isSet ? setMap : target, key, updatedValue);
|
|
22230
22264
|
} else {
|
|
22231
22265
|
handleValue(value, handledSet, options);
|
|
@@ -22283,7 +22317,7 @@ function markFinalization(target, key, value, generatePatches2) {
|
|
|
22283
22317
|
finalizeSetValue(target);
|
|
22284
22318
|
finalizePatches(target, generatePatches2, patches, inversePatches);
|
|
22285
22319
|
if (target.options.enableAutoFreeze) {
|
|
22286
|
-
target.options.updatedValues = (_a = target.options.updatedValues) !== null && _a !==
|
|
22320
|
+
target.options.updatedValues = (_a = target.options.updatedValues) !== null && _a !== undefined ? _a : /* @__PURE__ */ new WeakMap();
|
|
22287
22321
|
target.options.updatedValues.set(updatedValue, proxyDraft.original);
|
|
22288
22322
|
}
|
|
22289
22323
|
set(copy, key, updatedValue);
|
|
@@ -22497,7 +22531,7 @@ var mapHandler = {
|
|
|
22497
22531
|
var _a, _b;
|
|
22498
22532
|
const target = getProxyDraft(this);
|
|
22499
22533
|
const value = latest(target).get(key);
|
|
22500
|
-
const mutable = ((_b = (_a = target.options).mark) === null || _b ===
|
|
22534
|
+
const mutable = ((_b = (_a = target.options).mark) === null || _b === undefined ? undefined : _b.call(_a, value, dataTypes)) === dataTypes.mutable;
|
|
22501
22535
|
if (target.options.strict) {
|
|
22502
22536
|
checkReadable(value, target.options, mutable);
|
|
22503
22537
|
}
|
|
@@ -22569,7 +22603,7 @@ var getNextIterator = (target, iterator, { isValuesIterator }) => () => {
|
|
|
22569
22603
|
const key = result.value;
|
|
22570
22604
|
let value = target.setMap.get(key);
|
|
22571
22605
|
const currentDraft = getProxyDraft(value);
|
|
22572
|
-
const mutable = ((_b = (_a = target.options).mark) === null || _b ===
|
|
22606
|
+
const mutable = ((_b = (_a = target.options).mark) === null || _b === undefined ? undefined : _b.call(_a, value, dataTypes)) === dataTypes.mutable;
|
|
22573
22607
|
if (target.options.strict) {
|
|
22574
22608
|
checkReadable(key, target.options, mutable);
|
|
22575
22609
|
}
|
|
@@ -22712,7 +22746,7 @@ var draftsCache = /* @__PURE__ */ new WeakSet();
|
|
|
22712
22746
|
var proxyHandler = {
|
|
22713
22747
|
get(target, key, receiver) {
|
|
22714
22748
|
var _a, _b;
|
|
22715
|
-
const copy = (_a = target.copy) === null || _a ===
|
|
22749
|
+
const copy = (_a = target.copy) === null || _a === undefined ? undefined : _a[key];
|
|
22716
22750
|
if (copy && draftsCache.has(copy)) {
|
|
22717
22751
|
return copy;
|
|
22718
22752
|
}
|
|
@@ -22752,8 +22786,8 @@ var proxyHandler = {
|
|
|
22752
22786
|
const desc = getDescriptor(source, key);
|
|
22753
22787
|
return desc ? `value` in desc ? desc.value : (
|
|
22754
22788
|
// !case: support for getter
|
|
22755
|
-
(_b = desc.get) === null || _b ===
|
|
22756
|
-
) :
|
|
22789
|
+
(_b = desc.get) === null || _b === undefined ? undefined : _b.call(target.proxy)
|
|
22790
|
+
) : undefined;
|
|
22757
22791
|
}
|
|
22758
22792
|
const value = source[key];
|
|
22759
22793
|
if (target.options.strict) {
|
|
@@ -22791,7 +22825,7 @@ var proxyHandler = {
|
|
|
22791
22825
|
throw new Error(`Only supports setting array indices and the 'length' property.`);
|
|
22792
22826
|
}
|
|
22793
22827
|
const desc = getDescriptor(latest(target), key);
|
|
22794
|
-
if (desc === null || desc ===
|
|
22828
|
+
if (desc === null || desc === undefined ? undefined : desc.set) {
|
|
22795
22829
|
desc.set.call(target.proxy, value);
|
|
22796
22830
|
return true;
|
|
22797
22831
|
}
|
|
@@ -22799,11 +22833,11 @@ var proxyHandler = {
|
|
|
22799
22833
|
const currentProxyDraft = getProxyDraft(current2);
|
|
22800
22834
|
if (currentProxyDraft && isEqual(currentProxyDraft.original, value)) {
|
|
22801
22835
|
target.copy[key] = value;
|
|
22802
|
-
target.assignedMap = (_a = target.assignedMap) !== null && _a !==
|
|
22836
|
+
target.assignedMap = (_a = target.assignedMap) !== null && _a !== undefined ? _a : /* @__PURE__ */ new Map();
|
|
22803
22837
|
target.assignedMap.set(key, false);
|
|
22804
22838
|
return true;
|
|
22805
22839
|
}
|
|
22806
|
-
if (isEqual(value, current2) && (value !==
|
|
22840
|
+
if (isEqual(value, current2) && (value !== undefined || has(target.original, key)))
|
|
22807
22841
|
return true;
|
|
22808
22842
|
ensureShallowCopy(target);
|
|
22809
22843
|
markChanged(target);
|
|
@@ -22846,14 +22880,14 @@ var proxyHandler = {
|
|
|
22846
22880
|
deleteProperty(target, key) {
|
|
22847
22881
|
var _a;
|
|
22848
22882
|
if (target.type === 1) {
|
|
22849
|
-
return proxyHandler.set.call(this, target, key,
|
|
22883
|
+
return proxyHandler.set.call(this, target, key, undefined, target.proxy);
|
|
22850
22884
|
}
|
|
22851
|
-
if (peek(target.original, key) !==
|
|
22885
|
+
if (peek(target.original, key) !== undefined || key in target.original) {
|
|
22852
22886
|
ensureShallowCopy(target);
|
|
22853
22887
|
markChanged(target);
|
|
22854
22888
|
target.assignedMap.set(key, false);
|
|
22855
22889
|
} else {
|
|
22856
|
-
target.assignedMap = (_a = target.assignedMap) !== null && _a !==
|
|
22890
|
+
target.assignedMap = (_a = target.assignedMap) !== null && _a !== undefined ? _a : /* @__PURE__ */ new Map();
|
|
22857
22891
|
target.assignedMap.delete(key);
|
|
22858
22892
|
}
|
|
22859
22893
|
if (target.copy)
|
|
@@ -22874,7 +22908,7 @@ function createDraft(createDraftOptions) {
|
|
|
22874
22908
|
finalities,
|
|
22875
22909
|
options,
|
|
22876
22910
|
// Mapping of draft Set items to their corresponding draft values.
|
|
22877
|
-
setMap: type13 === 3 ? new Map(original.entries()) :
|
|
22911
|
+
setMap: type13 === 3 ? new Map(original.entries()) : undefined
|
|
22878
22912
|
};
|
|
22879
22913
|
if (key || "key" in createDraftOptions) {
|
|
22880
22914
|
proxyDraft.key = key;
|
|
@@ -22899,12 +22933,12 @@ function createDraft(createDraftOptions) {
|
|
|
22899
22933
|
finalizeSetValue(proxyDraft2);
|
|
22900
22934
|
finalizePatches(proxyDraft2, generatePatches, patches, inversePatches);
|
|
22901
22935
|
if (target.options.enableAutoFreeze) {
|
|
22902
|
-
target.options.updatedValues = (_a = target.options.updatedValues) !== null && _a !==
|
|
22936
|
+
target.options.updatedValues = (_a = target.options.updatedValues) !== null && _a !== undefined ? _a : /* @__PURE__ */ new WeakMap();
|
|
22903
22937
|
target.options.updatedValues.set(updatedValue, proxyDraft2.original);
|
|
22904
22938
|
}
|
|
22905
22939
|
set(copy, key, updatedValue);
|
|
22906
22940
|
}
|
|
22907
|
-
(_b = oldProxyDraft.callbacks) === null || _b ===
|
|
22941
|
+
(_b = oldProxyDraft.callbacks) === null || _b === undefined ? undefined : _b.forEach((callback) => {
|
|
22908
22942
|
callback(patches, inversePatches);
|
|
22909
22943
|
});
|
|
22910
22944
|
});
|
|
@@ -22921,9 +22955,9 @@ internal.createDraft = createDraft;
|
|
|
22921
22955
|
function finalizeDraft(result, returnedValue, patches, inversePatches, enableAutoFreeze) {
|
|
22922
22956
|
var _a;
|
|
22923
22957
|
const proxyDraft = getProxyDraft(result);
|
|
22924
|
-
const original = (_a = proxyDraft === null || proxyDraft ===
|
|
22958
|
+
const original = (_a = proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.original) !== null && _a !== undefined ? _a : result;
|
|
22925
22959
|
const hasReturnedValue = !!returnedValue.length;
|
|
22926
|
-
if (proxyDraft === null || proxyDraft ===
|
|
22960
|
+
if (proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.operated) {
|
|
22927
22961
|
while (proxyDraft.finalities.draft.length > 0) {
|
|
22928
22962
|
const finalize = proxyDraft.finalities.draft.pop();
|
|
22929
22963
|
finalize(patches, inversePatches);
|
|
@@ -22933,7 +22967,7 @@ function finalizeDraft(result, returnedValue, patches, inversePatches, enableAut
|
|
|
22933
22967
|
if (proxyDraft)
|
|
22934
22968
|
revokeProxy(proxyDraft);
|
|
22935
22969
|
if (enableAutoFreeze) {
|
|
22936
|
-
deepFreeze(state, state, proxyDraft === null || proxyDraft ===
|
|
22970
|
+
deepFreeze(state, state, proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.options.updatedValues);
|
|
22937
22971
|
}
|
|
22938
22972
|
return [
|
|
22939
22973
|
state,
|
|
@@ -22954,7 +22988,7 @@ function draftify(baseState, options) {
|
|
|
22954
22988
|
patches = [];
|
|
22955
22989
|
inversePatches = [];
|
|
22956
22990
|
}
|
|
22957
|
-
const isMutable = ((_a = options.mark) === null || _a ===
|
|
22991
|
+
const isMutable = ((_a = options.mark) === null || _a === undefined ? undefined : _a.call(options, baseState, dataTypes)) === dataTypes.mutable || !isDraftable(baseState, options);
|
|
22958
22992
|
const draft = isMutable ? baseState : createDraft({
|
|
22959
22993
|
original: baseState,
|
|
22960
22994
|
parentDraft: null,
|
|
@@ -23000,14 +23034,14 @@ function handleReturnValue(options) {
|
|
|
23000
23034
|
function getCurrent(target) {
|
|
23001
23035
|
var _a;
|
|
23002
23036
|
const proxyDraft = getProxyDraft(target);
|
|
23003
|
-
if (!isDraftable(target, proxyDraft === null || proxyDraft ===
|
|
23037
|
+
if (!isDraftable(target, proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.options))
|
|
23004
23038
|
return target;
|
|
23005
23039
|
const type13 = getType(target);
|
|
23006
23040
|
if (proxyDraft && !proxyDraft.operated)
|
|
23007
23041
|
return proxyDraft.original;
|
|
23008
23042
|
let currentValue;
|
|
23009
23043
|
function ensureShallowCopy2() {
|
|
23010
|
-
currentValue = type13 === 2 ? !isBaseMapInstance(target) ? new (Object.getPrototypeOf(target)).constructor(target) : new Map(target) : type13 === 3 ? Array.from(proxyDraft.setMap.values()) : shallowCopy(target, proxyDraft === null || proxyDraft ===
|
|
23044
|
+
currentValue = type13 === 2 ? !isBaseMapInstance(target) ? new (Object.getPrototypeOf(target)).constructor(target) : new Map(target) : type13 === 3 ? Array.from(proxyDraft.setMap.values()) : shallowCopy(target, proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.options);
|
|
23011
23045
|
}
|
|
23012
23046
|
if (proxyDraft) {
|
|
23013
23047
|
proxyDraft.finalized = true;
|
|
@@ -23030,7 +23064,7 @@ function getCurrent(target) {
|
|
|
23030
23064
|
}
|
|
23031
23065
|
});
|
|
23032
23066
|
if (type13 === 3) {
|
|
23033
|
-
const value = (_a = proxyDraft === null || proxyDraft ===
|
|
23067
|
+
const value = (_a = proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.original) !== null && _a !== undefined ? _a : currentValue;
|
|
23034
23068
|
return !isBaseSetInstance(value) ? new (Object.getPrototypeOf(value)).constructor(currentValue) : new Set(currentValue);
|
|
23035
23069
|
}
|
|
23036
23070
|
return currentValue;
|
|
@@ -23055,7 +23089,7 @@ var makeCreator = (arg) => {
|
|
|
23055
23089
|
if (typeof arg1 !== "function") {
|
|
23056
23090
|
options = arg1;
|
|
23057
23091
|
}
|
|
23058
|
-
if (options !==
|
|
23092
|
+
if (options !== undefined && Object.prototype.toString.call(options) !== "[object Object]") {
|
|
23059
23093
|
throw new Error(`Invalid options: ${options}, 'options' should be an object.`);
|
|
23060
23094
|
}
|
|
23061
23095
|
options = Object.assign(Object.assign({}, arg), options);
|
|
@@ -23072,9 +23106,9 @@ var makeCreator = (arg) => {
|
|
|
23072
23106
|
}
|
|
23073
23107
|
return;
|
|
23074
23108
|
} : options.mark;
|
|
23075
|
-
const enablePatches = (_a = options.enablePatches) !== null && _a !==
|
|
23076
|
-
const strict = (_b = options.strict) !== null && _b !==
|
|
23077
|
-
const enableAutoFreeze = (_c = options.enableAutoFreeze) !== null && _c !==
|
|
23109
|
+
const enablePatches = (_a = options.enablePatches) !== null && _a !== undefined ? _a : false;
|
|
23110
|
+
const strict = (_b = options.strict) !== null && _b !== undefined ? _b : false;
|
|
23111
|
+
const enableAutoFreeze = (_c = options.enableAutoFreeze) !== null && _c !== undefined ? _c : false;
|
|
23078
23112
|
const _options = {
|
|
23079
23113
|
enableAutoFreeze,
|
|
23080
23114
|
mark,
|
|
@@ -23101,10 +23135,10 @@ var makeCreator = (arg) => {
|
|
|
23101
23135
|
const returnValue = (value) => {
|
|
23102
23136
|
const proxyDraft = getProxyDraft(draft);
|
|
23103
23137
|
if (!isDraft(value)) {
|
|
23104
|
-
if (value !==
|
|
23138
|
+
if (value !== undefined && !isEqual(value, draft) && (proxyDraft === null || proxyDraft === undefined ? undefined : proxyDraft.operated)) {
|
|
23105
23139
|
throw new Error(`Either the value is returned as a new non-draft value, or only the draft is modified without returning any value.`);
|
|
23106
23140
|
}
|
|
23107
|
-
const rawReturnValue = value === null || value ===
|
|
23141
|
+
const rawReturnValue = value === null || value === undefined ? undefined : value[RAW_RETURN_SYMBOL];
|
|
23108
23142
|
if (rawReturnValue) {
|
|
23109
23143
|
const _value = rawReturnValue[0];
|
|
23110
23144
|
if (_options.strict && typeof value === "object" && value !== null) {
|
|
@@ -23116,14 +23150,14 @@ var makeCreator = (arg) => {
|
|
|
23116
23150
|
}
|
|
23117
23151
|
return finalize([_value]);
|
|
23118
23152
|
}
|
|
23119
|
-
if (value !==
|
|
23153
|
+
if (value !== undefined) {
|
|
23120
23154
|
if (typeof value === "object" && value !== null) {
|
|
23121
23155
|
handleReturnValue({ rootDraft: proxyDraft, value });
|
|
23122
23156
|
}
|
|
23123
23157
|
return finalize([value]);
|
|
23124
23158
|
}
|
|
23125
23159
|
}
|
|
23126
|
-
if (value === draft || value ===
|
|
23160
|
+
if (value === draft || value === undefined) {
|
|
23127
23161
|
return finalize([]);
|
|
23128
23162
|
}
|
|
23129
23163
|
const returnedProxyDraft = getProxyDraft(value);
|
|
@@ -23152,7 +23186,7 @@ function castDraft(value) {
|
|
|
23152
23186
|
var __defProp2 = Object.defineProperty;
|
|
23153
23187
|
var __defNormalProp = (obj, key, value) => key in obj ? __defProp2(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
|
|
23154
23188
|
var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
|
|
23155
|
-
var isDefinedNonNullAny = (v) => v !==
|
|
23189
|
+
var isDefinedNonNullAny = (v) => v !== undefined && v !== null;
|
|
23156
23190
|
z$1.any().refine((v) => isDefinedNonNullAny(v));
|
|
23157
23191
|
var Load_StateSchema = z$1.enum(["LOAD_STATE"]);
|
|
23158
23192
|
var PruneSchema = z$1.enum(["PRUNE"]);
|
|
@@ -23275,7 +23309,7 @@ function requireSafeStableStringify() {
|
|
|
23275
23309
|
Symbol.toStringTag
|
|
23276
23310
|
).get;
|
|
23277
23311
|
function isTypedArrayWithEntries(value) {
|
|
23278
|
-
return typedArrayPrototypeGetSymbolToStringTag.call(value) !==
|
|
23312
|
+
return typedArrayPrototypeGetSymbolToStringTag.call(value) !== undefined && value.length !== 0;
|
|
23279
23313
|
}
|
|
23280
23314
|
function stringifyTypedArray(array, separator, maximumBreadth) {
|
|
23281
23315
|
if (array.length < maximumBreadth) {
|
|
@@ -23316,7 +23350,7 @@ function requireSafeStableStringify() {
|
|
|
23316
23350
|
throw new TypeError('The "deterministic" argument must be of type boolean or comparator function');
|
|
23317
23351
|
}
|
|
23318
23352
|
}
|
|
23319
|
-
return value ===
|
|
23353
|
+
return value === undefined ? true : value;
|
|
23320
23354
|
}
|
|
23321
23355
|
function getBooleanOption(options, key) {
|
|
23322
23356
|
let value;
|
|
@@ -23326,7 +23360,7 @@ function requireSafeStableStringify() {
|
|
|
23326
23360
|
throw new TypeError(`The "${key}" argument must be of type boolean`);
|
|
23327
23361
|
}
|
|
23328
23362
|
}
|
|
23329
|
-
return value ===
|
|
23363
|
+
return value === undefined ? true : value;
|
|
23330
23364
|
}
|
|
23331
23365
|
function getPositiveIntegerOption(options, key) {
|
|
23332
23366
|
let value;
|
|
@@ -23342,7 +23376,7 @@ function requireSafeStableStringify() {
|
|
|
23342
23376
|
throw new RangeError(`The "${key}" argument must be >= 1`);
|
|
23343
23377
|
}
|
|
23344
23378
|
}
|
|
23345
|
-
return value ===
|
|
23379
|
+
return value === undefined ? Infinity : value;
|
|
23346
23380
|
}
|
|
23347
23381
|
function getItemCount(number) {
|
|
23348
23382
|
if (number === 1) {
|
|
@@ -23378,7 +23412,7 @@ function requireSafeStableStringify() {
|
|
|
23378
23412
|
options = { ...options };
|
|
23379
23413
|
const fail = getStrictOption(options);
|
|
23380
23414
|
if (fail) {
|
|
23381
|
-
if (options.bigint ===
|
|
23415
|
+
if (options.bigint === undefined) {
|
|
23382
23416
|
options.bigint = false;
|
|
23383
23417
|
}
|
|
23384
23418
|
if (!("circularValue" in options)) {
|
|
@@ -23388,7 +23422,7 @@ function requireSafeStableStringify() {
|
|
|
23388
23422
|
const circularValue = getCircularValueOption(options);
|
|
23389
23423
|
const bigint = getBooleanOption(options, "bigint");
|
|
23390
23424
|
const deterministic = getDeterministicOption(options);
|
|
23391
|
-
const comparator = typeof deterministic === "function" ? deterministic :
|
|
23425
|
+
const comparator = typeof deterministic === "function" ? deterministic : undefined;
|
|
23392
23426
|
const maximumDepth = getPositiveIntegerOption(options, "maximumDepth");
|
|
23393
23427
|
const maximumBreadth = getPositiveIntegerOption(options, "maximumBreadth");
|
|
23394
23428
|
function stringifyFnReplacer(key, parent, stack, replacer, spacer, indentation) {
|
|
@@ -23429,11 +23463,11 @@ ${indentation}`;
|
|
|
23429
23463
|
let i = 0;
|
|
23430
23464
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
23431
23465
|
const tmp2 = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
23432
|
-
res += tmp2 !==
|
|
23466
|
+
res += tmp2 !== undefined ? tmp2 : "null";
|
|
23433
23467
|
res += join2;
|
|
23434
23468
|
}
|
|
23435
23469
|
const tmp = stringifyFnReplacer(String(i), value, stack, replacer, spacer, indentation);
|
|
23436
|
-
res += tmp !==
|
|
23470
|
+
res += tmp !== undefined ? tmp : "null";
|
|
23437
23471
|
if (value.length - 1 > maximumBreadth) {
|
|
23438
23472
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
23439
23473
|
res += `${join2}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
@@ -23469,7 +23503,7 @@ ${indentation}`;
|
|
|
23469
23503
|
for (let i = 0; i < maximumPropertiesToStringify; i++) {
|
|
23470
23504
|
const key2 = keys[i];
|
|
23471
23505
|
const tmp = stringifyFnReplacer(key2, value, stack, replacer, spacer, indentation);
|
|
23472
|
-
if (tmp !==
|
|
23506
|
+
if (tmp !== undefined) {
|
|
23473
23507
|
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
23474
23508
|
separator = join2;
|
|
23475
23509
|
}
|
|
@@ -23492,14 +23526,14 @@ ${originalIndentation}`;
|
|
|
23492
23526
|
case "boolean":
|
|
23493
23527
|
return value === true ? "true" : "false";
|
|
23494
23528
|
case "undefined":
|
|
23495
|
-
return
|
|
23529
|
+
return undefined;
|
|
23496
23530
|
case "bigint":
|
|
23497
23531
|
if (bigint) {
|
|
23498
23532
|
return String(value);
|
|
23499
23533
|
}
|
|
23500
23534
|
// fallthrough
|
|
23501
23535
|
default:
|
|
23502
|
-
return fail ? fail(value) :
|
|
23536
|
+
return fail ? fail(value) : undefined;
|
|
23503
23537
|
}
|
|
23504
23538
|
}
|
|
23505
23539
|
function stringifyArrayReplacer(key, value, stack, replacer, spacer, indentation) {
|
|
@@ -23538,11 +23572,11 @@ ${indentation}`;
|
|
|
23538
23572
|
let i = 0;
|
|
23539
23573
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
23540
23574
|
const tmp2 = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
23541
|
-
res += tmp2 !==
|
|
23575
|
+
res += tmp2 !== undefined ? tmp2 : "null";
|
|
23542
23576
|
res += join2;
|
|
23543
23577
|
}
|
|
23544
23578
|
const tmp = stringifyArrayReplacer(String(i), value[i], stack, replacer, spacer, indentation);
|
|
23545
|
-
res += tmp !==
|
|
23579
|
+
res += tmp !== undefined ? tmp : "null";
|
|
23546
23580
|
if (value.length - 1 > maximumBreadth) {
|
|
23547
23581
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
23548
23582
|
res += `${join2}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
@@ -23565,7 +23599,7 @@ ${indentation}`;
|
|
|
23565
23599
|
let separator = "";
|
|
23566
23600
|
for (const key2 of replacer) {
|
|
23567
23601
|
const tmp = stringifyArrayReplacer(key2, value[key2], stack, replacer, spacer, indentation);
|
|
23568
|
-
if (tmp !==
|
|
23602
|
+
if (tmp !== undefined) {
|
|
23569
23603
|
res += `${separator}${strEscape(key2)}:${whitespace}${tmp}`;
|
|
23570
23604
|
separator = join2;
|
|
23571
23605
|
}
|
|
@@ -23583,14 +23617,14 @@ ${originalIndentation}`;
|
|
|
23583
23617
|
case "boolean":
|
|
23584
23618
|
return value === true ? "true" : "false";
|
|
23585
23619
|
case "undefined":
|
|
23586
|
-
return
|
|
23620
|
+
return undefined;
|
|
23587
23621
|
case "bigint":
|
|
23588
23622
|
if (bigint) {
|
|
23589
23623
|
return String(value);
|
|
23590
23624
|
}
|
|
23591
23625
|
// fallthrough
|
|
23592
23626
|
default:
|
|
23593
|
-
return fail ? fail(value) :
|
|
23627
|
+
return fail ? fail(value) : undefined;
|
|
23594
23628
|
}
|
|
23595
23629
|
}
|
|
23596
23630
|
function stringifyIndent(key, value, stack, spacer, indentation) {
|
|
@@ -23631,11 +23665,11 @@ ${indentation}`;
|
|
|
23631
23665
|
let i = 0;
|
|
23632
23666
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
23633
23667
|
const tmp2 = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
23634
|
-
res2 += tmp2 !==
|
|
23668
|
+
res2 += tmp2 !== undefined ? tmp2 : "null";
|
|
23635
23669
|
res2 += join3;
|
|
23636
23670
|
}
|
|
23637
23671
|
const tmp = stringifyIndent(String(i), value[i], stack, spacer, indentation);
|
|
23638
|
-
res2 += tmp !==
|
|
23672
|
+
res2 += tmp !== undefined ? tmp : "null";
|
|
23639
23673
|
if (value.length - 1 > maximumBreadth) {
|
|
23640
23674
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
23641
23675
|
res2 += `${join3}"... ${getItemCount(removedKeys)} not stringified"`;
|
|
@@ -23672,7 +23706,7 @@ ${indentation}`;
|
|
|
23672
23706
|
for (let i = 0; i < maximumPropertiesToStringify; i++) {
|
|
23673
23707
|
const key2 = keys[i];
|
|
23674
23708
|
const tmp = stringifyIndent(key2, value[key2], stack, spacer, indentation);
|
|
23675
|
-
if (tmp !==
|
|
23709
|
+
if (tmp !== undefined) {
|
|
23676
23710
|
res += `${separator}${strEscape(key2)}: ${tmp}`;
|
|
23677
23711
|
separator = join2;
|
|
23678
23712
|
}
|
|
@@ -23695,14 +23729,14 @@ ${originalIndentation}`;
|
|
|
23695
23729
|
case "boolean":
|
|
23696
23730
|
return value === true ? "true" : "false";
|
|
23697
23731
|
case "undefined":
|
|
23698
|
-
return
|
|
23732
|
+
return undefined;
|
|
23699
23733
|
case "bigint":
|
|
23700
23734
|
if (bigint) {
|
|
23701
23735
|
return String(value);
|
|
23702
23736
|
}
|
|
23703
23737
|
// fallthrough
|
|
23704
23738
|
default:
|
|
23705
|
-
return fail ? fail(value) :
|
|
23739
|
+
return fail ? fail(value) : undefined;
|
|
23706
23740
|
}
|
|
23707
23741
|
}
|
|
23708
23742
|
function stringifySimple(key, value, stack) {
|
|
@@ -23726,7 +23760,7 @@ ${originalIndentation}`;
|
|
|
23726
23760
|
return circularValue;
|
|
23727
23761
|
}
|
|
23728
23762
|
let res = "";
|
|
23729
|
-
const hasLength = value.length !==
|
|
23763
|
+
const hasLength = value.length !== undefined;
|
|
23730
23764
|
if (hasLength && Array.isArray(value)) {
|
|
23731
23765
|
if (value.length === 0) {
|
|
23732
23766
|
return "[]";
|
|
@@ -23739,11 +23773,11 @@ ${originalIndentation}`;
|
|
|
23739
23773
|
let i = 0;
|
|
23740
23774
|
for (; i < maximumValuesToStringify - 1; i++) {
|
|
23741
23775
|
const tmp2 = stringifySimple(String(i), value[i], stack);
|
|
23742
|
-
res += tmp2 !==
|
|
23776
|
+
res += tmp2 !== undefined ? tmp2 : "null";
|
|
23743
23777
|
res += ",";
|
|
23744
23778
|
}
|
|
23745
23779
|
const tmp = stringifySimple(String(i), value[i], stack);
|
|
23746
|
-
res += tmp !==
|
|
23780
|
+
res += tmp !== undefined ? tmp : "null";
|
|
23747
23781
|
if (value.length - 1 > maximumBreadth) {
|
|
23748
23782
|
const removedKeys = value.length - maximumBreadth - 1;
|
|
23749
23783
|
res += `,"... ${getItemCount(removedKeys)} not stringified"`;
|
|
@@ -23774,7 +23808,7 @@ ${originalIndentation}`;
|
|
|
23774
23808
|
for (let i = 0; i < maximumPropertiesToStringify; i++) {
|
|
23775
23809
|
const key2 = keys[i];
|
|
23776
23810
|
const tmp = stringifySimple(key2, value[key2], stack);
|
|
23777
|
-
if (tmp !==
|
|
23811
|
+
if (tmp !== undefined) {
|
|
23778
23812
|
res += `${separator}${strEscape(key2)}:${tmp}`;
|
|
23779
23813
|
separator = ",";
|
|
23780
23814
|
}
|
|
@@ -23791,14 +23825,14 @@ ${originalIndentation}`;
|
|
|
23791
23825
|
case "boolean":
|
|
23792
23826
|
return value === true ? "true" : "false";
|
|
23793
23827
|
case "undefined":
|
|
23794
|
-
return
|
|
23828
|
+
return undefined;
|
|
23795
23829
|
case "bigint":
|
|
23796
23830
|
if (bigint) {
|
|
23797
23831
|
return String(value);
|
|
23798
23832
|
}
|
|
23799
23833
|
// fallthrough
|
|
23800
23834
|
default:
|
|
23801
|
-
return fail ? fail(value) :
|
|
23835
|
+
return fail ? fail(value) : undefined;
|
|
23802
23836
|
}
|
|
23803
23837
|
}
|
|
23804
23838
|
function stringify22(value, replacer, space) {
|
|
@@ -23920,7 +23954,7 @@ function ab2hex(ab) {
|
|
|
23920
23954
|
function hex2ab(hex) {
|
|
23921
23955
|
var _a;
|
|
23922
23956
|
return new Uint8Array(
|
|
23923
|
-
((_a = hex.match(/[\da-f]{2}/gi)) == null ?
|
|
23957
|
+
((_a = hex.match(/[\da-f]{2}/gi)) == null ? undefined : _a.map(function(h) {
|
|
23924
23958
|
return parseInt(h, 16);
|
|
23925
23959
|
})) ?? []
|
|
23926
23960
|
);
|
|
@@ -23933,7 +23967,7 @@ async function buildOperationSignature(context, signMethod) {
|
|
|
23933
23967
|
}
|
|
23934
23968
|
async function buildSignedOperation(action, reducer, document, context, signHandler) {
|
|
23935
23969
|
var _a, _b;
|
|
23936
|
-
const result = reducer(document, action,
|
|
23970
|
+
const result = reducer(document, action, undefined, {
|
|
23937
23971
|
reuseHash: true,
|
|
23938
23972
|
reuseOperationResultingState: true
|
|
23939
23973
|
});
|
|
@@ -23941,7 +23975,7 @@ async function buildSignedOperation(action, reducer, document, context, signHand
|
|
|
23941
23975
|
if (!operation) {
|
|
23942
23976
|
throw new Error("Action was not applied");
|
|
23943
23977
|
}
|
|
23944
|
-
const previousStateHash = ((_a = result.operations[action.scope].at(-2)) == null ?
|
|
23978
|
+
const previousStateHash = ((_a = result.operations[action.scope].at(-2)) == null ? undefined : _a.hash) ?? "";
|
|
23945
23979
|
const signature = await buildOperationSignature(
|
|
23946
23980
|
{
|
|
23947
23981
|
...context,
|
|
@@ -23955,7 +23989,7 @@ async function buildSignedOperation(action, reducer, document, context, signHand
|
|
|
23955
23989
|
context: {
|
|
23956
23990
|
...operation.context,
|
|
23957
23991
|
signer: {
|
|
23958
|
-
...(_b = operation.context) == null ?
|
|
23992
|
+
...(_b = operation.context) == null ? undefined : _b.signer,
|
|
23959
23993
|
...context.signer,
|
|
23960
23994
|
signatures: [...context.signer.signatures ?? [], signature]
|
|
23961
23995
|
}
|
|
@@ -24368,7 +24402,7 @@ var Mime = class {
|
|
|
24368
24402
|
for (let extension of extensions) {
|
|
24369
24403
|
const starred = extension.startsWith("*");
|
|
24370
24404
|
extension = starred ? extension.slice(1) : extension;
|
|
24371
|
-
allExtensions == null ?
|
|
24405
|
+
allExtensions == null ? undefined : allExtensions.add(extension);
|
|
24372
24406
|
if (first) {
|
|
24373
24407
|
__classPrivateFieldGet2(this, _Mime_typeToExtension, "f").set(type13, extension);
|
|
24374
24408
|
}
|
|
@@ -24399,7 +24433,7 @@ var Mime = class {
|
|
|
24399
24433
|
var _a;
|
|
24400
24434
|
if (typeof type13 !== "string")
|
|
24401
24435
|
return null;
|
|
24402
|
-
type13 = (_a = type13 == null ?
|
|
24436
|
+
type13 = (_a = type13 == null ? undefined : type13.split) == null ? undefined : _a.call(type13, ";")[0];
|
|
24403
24437
|
return (type13 && __classPrivateFieldGet2(this, _Mime_typeToExtension, "f").get(type13.trim().toLowerCase())) ?? null;
|
|
24404
24438
|
}
|
|
24405
24439
|
getAllExtensions(type13) {
|
|
@@ -24483,9 +24517,9 @@ function garbageCollect(sortedOperations) {
|
|
|
24483
24517
|
let i = sortedOperations.length - 1;
|
|
24484
24518
|
while (i > -1) {
|
|
24485
24519
|
result.unshift(sortedOperations[i]);
|
|
24486
|
-
const skipUntil = (((_a = sortedOperations[i]) == null ?
|
|
24520
|
+
const skipUntil = (((_a = sortedOperations[i]) == null ? undefined : _a.index) || 0) - (((_b = sortedOperations[i]) == null ? undefined : _b.skip) || 0) - 1;
|
|
24487
24521
|
let j = i - 1;
|
|
24488
|
-
while (j > -1 && (((_c = sortedOperations[j]) == null ?
|
|
24522
|
+
while (j > -1 && (((_c = sortedOperations[j]) == null ? undefined : _c.index) || 0) > skipUntil) {
|
|
24489
24523
|
j--;
|
|
24490
24524
|
}
|
|
24491
24525
|
i = j;
|
|
@@ -24652,11 +24686,11 @@ function nextSkipNumber(sortedOperations) {
|
|
|
24652
24686
|
return -1;
|
|
24653
24687
|
}
|
|
24654
24688
|
const cleanedOperations = garbageCollect(sortedOperations);
|
|
24655
|
-
let nextSkip = (((_a = cleanedOperations[cleanedOperations.length - 1]) == null ?
|
|
24689
|
+
let nextSkip = (((_a = cleanedOperations[cleanedOperations.length - 1]) == null ? undefined : _a.skip) || 0) + 1;
|
|
24656
24690
|
if (cleanedOperations.length > 1) {
|
|
24657
|
-
nextSkip += ((_b = cleanedOperations[cleanedOperations.length - 2]) == null ?
|
|
24691
|
+
nextSkip += ((_b = cleanedOperations[cleanedOperations.length - 2]) == null ? undefined : _b.skip) || 0;
|
|
24658
24692
|
}
|
|
24659
|
-
return (((_c = cleanedOperations[cleanedOperations.length - 1]) == null ?
|
|
24693
|
+
return (((_c = cleanedOperations[cleanedOperations.length - 1]) == null ? undefined : _c.index) || -1) < nextSkip ? -1 : nextSkip;
|
|
24660
24694
|
}
|
|
24661
24695
|
var checkOperationsIntegrity = (operations) => {
|
|
24662
24696
|
return checkCleanedOperationsIntegrity(
|
|
@@ -24669,7 +24703,7 @@ var groupOperationsByScope = (operations) => {
|
|
|
24669
24703
|
if (!acc[operation.scope]) {
|
|
24670
24704
|
acc[operation.scope] = [];
|
|
24671
24705
|
}
|
|
24672
|
-
(_a = acc[operation.scope]) == null ?
|
|
24706
|
+
(_a = acc[operation.scope]) == null ? undefined : _a.push(operation);
|
|
24673
24707
|
return acc;
|
|
24674
24708
|
}, {});
|
|
24675
24709
|
return result;
|
|
@@ -24692,7 +24726,7 @@ var prepareOperations = (operationsHistory, newOperations) => {
|
|
|
24692
24726
|
(integrityIssue) => integrityIssue.category === "MISSING_INDEX"
|
|
24693
24727
|
/* MISSING_INDEX */
|
|
24694
24728
|
);
|
|
24695
|
-
const firstMissingIndexOperation = (_a = [...missingIndexErrors].sort((a, b) => b.operation.index - a.operation.index).pop()) == null ?
|
|
24729
|
+
const firstMissingIndexOperation = (_a = [...missingIndexErrors].sort((a, b) => b.operation.index - a.operation.index).pop()) == null ? undefined : _a.operation;
|
|
24696
24730
|
for (const newOperation of sortedOperations) {
|
|
24697
24731
|
if (firstMissingIndexOperation && newOperation.index >= firstMissingIndexOperation.index) {
|
|
24698
24732
|
result.invalidOperations.push(newOperation);
|
|
@@ -24719,7 +24753,7 @@ function removeExistingOperations(newOperations, operationsHistory) {
|
|
|
24719
24753
|
}
|
|
24720
24754
|
function skipHeaderOperations(operations, skipHeaderOperation) {
|
|
24721
24755
|
const [lastOperation] = sortOperations$1(operations).slice(-1);
|
|
24722
|
-
const lastIndex = (lastOperation == null ?
|
|
24756
|
+
const lastIndex = (lastOperation == null ? undefined : lastOperation.index) ?? -1;
|
|
24723
24757
|
const nextIndex = lastIndex + 1;
|
|
24724
24758
|
const skipOperationIndex = {
|
|
24725
24759
|
...skipHeaderOperation,
|
|
@@ -24879,7 +24913,7 @@ async function loadFromZip(zip, reducer, options) {
|
|
|
24879
24913
|
const initialStateStr = await initialStateZip.async("string");
|
|
24880
24914
|
const initialState = JSON.parse(initialStateStr);
|
|
24881
24915
|
const headerZip = zip.file("header.json");
|
|
24882
|
-
let header =
|
|
24916
|
+
let header = undefined;
|
|
24883
24917
|
if (headerZip) {
|
|
24884
24918
|
header = JSON.parse(await headerZip.async("string"));
|
|
24885
24919
|
}
|
|
@@ -24900,7 +24934,7 @@ async function loadFromZip(zip, reducer, options) {
|
|
|
24900
24934
|
initialState,
|
|
24901
24935
|
clearedOperations,
|
|
24902
24936
|
reducer,
|
|
24903
|
-
|
|
24937
|
+
undefined,
|
|
24904
24938
|
header,
|
|
24905
24939
|
{},
|
|
24906
24940
|
options
|
|
@@ -24914,8 +24948,8 @@ async function loadFromZip(zip, reducer, options) {
|
|
|
24914
24948
|
return result;
|
|
24915
24949
|
}
|
|
24916
24950
|
function getFileAttributes(file) {
|
|
24917
|
-
const extension = file.replace(/^.*\./, "") ||
|
|
24918
|
-
const fileName = file.replace(/^.*[/\\]/, "") ||
|
|
24951
|
+
const extension = file.replace(/^.*\./, "") || undefined;
|
|
24952
|
+
const fileName = file.replace(/^.*[/\\]/, "") || undefined;
|
|
24919
24953
|
return { extension, fileName };
|
|
24920
24954
|
}
|
|
24921
24955
|
async function getRemoteFile(url) {
|
|
@@ -24952,8 +24986,8 @@ function undoOperation(document, action, skip) {
|
|
|
24952
24986
|
const sortedOperations = sortOperations$1(operations);
|
|
24953
24987
|
draft.action = noop(scope);
|
|
24954
24988
|
const lastOperation = sortedOperations.at(-1);
|
|
24955
|
-
let nextIndex = (lastOperation == null ?
|
|
24956
|
-
const isNewNoop = (lastOperation == null ?
|
|
24989
|
+
let nextIndex = (lastOperation == null ? undefined : lastOperation.index) ?? -1;
|
|
24990
|
+
const isNewNoop = (lastOperation == null ? undefined : lastOperation.type) !== "NOOP";
|
|
24957
24991
|
if (isNewNoop) {
|
|
24958
24992
|
nextIndex = nextIndex + 1;
|
|
24959
24993
|
} else {
|
|
@@ -25073,7 +25107,7 @@ function getNextRevision(document, action) {
|
|
|
25073
25107
|
} else {
|
|
25074
25108
|
latestOperation = document.operations[action.scope].at(-1);
|
|
25075
25109
|
}
|
|
25076
|
-
return ((latestOperation == null ?
|
|
25110
|
+
return ((latestOperation == null ? undefined : latestOperation.index) ?? -1) + 1;
|
|
25077
25111
|
}
|
|
25078
25112
|
function updateHeader(document, action) {
|
|
25079
25113
|
return {
|
|
@@ -25093,7 +25127,7 @@ function updateOperations(document, action, skip = 0, reuseLastOperationIndex =
|
|
|
25093
25127
|
const operations = document.operations[scope].slice();
|
|
25094
25128
|
let operationId;
|
|
25095
25129
|
const latestOperation = operations.at(-1);
|
|
25096
|
-
const lastOperationIndex = (latestOperation == null ?
|
|
25130
|
+
const lastOperationIndex = (latestOperation == null ? undefined : latestOperation.index) ?? -1;
|
|
25097
25131
|
let nextIndex = reuseLastOperationIndex ? lastOperationIndex : lastOperationIndex + 1;
|
|
25098
25132
|
let timestamp = (/* @__PURE__ */ new Date()).toISOString();
|
|
25099
25133
|
if ("index" in action) {
|
|
@@ -25116,7 +25150,7 @@ function updateOperations(document, action, skip = 0, reuseLastOperationIndex =
|
|
|
25116
25150
|
hash: "",
|
|
25117
25151
|
scope,
|
|
25118
25152
|
skip,
|
|
25119
|
-
error:
|
|
25153
|
+
error: undefined
|
|
25120
25154
|
});
|
|
25121
25155
|
return {
|
|
25122
25156
|
...document,
|
|
@@ -25167,19 +25201,19 @@ function processSkipOperation(document, action, customReducer, skipValue, reuseO
|
|
|
25167
25201
|
latestOperation
|
|
25168
25202
|
)
|
|
25169
25203
|
});
|
|
25170
|
-
let scopeState =
|
|
25204
|
+
let scopeState = undefined;
|
|
25171
25205
|
const lastRemainingOperation = documentOperations[scope].at(-1);
|
|
25172
|
-
if (reuseOperationResultingState && (lastRemainingOperation == null ?
|
|
25206
|
+
if (reuseOperationResultingState && (lastRemainingOperation == null ? undefined : lastRemainingOperation.resultingState)) {
|
|
25173
25207
|
scopeState = resultingStateParser(lastRemainingOperation.resultingState);
|
|
25174
25208
|
} else {
|
|
25175
25209
|
const { state } = replayOperations(
|
|
25176
25210
|
document.initialState,
|
|
25177
25211
|
documentOperations,
|
|
25178
25212
|
customReducer,
|
|
25179
|
-
|
|
25180
|
-
|
|
25181
|
-
|
|
25182
|
-
|
|
25213
|
+
undefined,
|
|
25214
|
+
undefined,
|
|
25215
|
+
undefined,
|
|
25216
|
+
undefined,
|
|
25183
25217
|
{
|
|
25184
25218
|
reuseHash: true,
|
|
25185
25219
|
reuseOperationResultingState,
|
|
@@ -25215,10 +25249,10 @@ function processUndoOperation(document, scope, customReducer, reuseOperationResu
|
|
|
25215
25249
|
document.initialState,
|
|
25216
25250
|
documentOperations,
|
|
25217
25251
|
customReducer,
|
|
25218
|
-
|
|
25219
|
-
|
|
25220
|
-
|
|
25221
|
-
|
|
25252
|
+
undefined,
|
|
25253
|
+
undefined,
|
|
25254
|
+
undefined,
|
|
25255
|
+
undefined,
|
|
25222
25256
|
{
|
|
25223
25257
|
reuseHash: true,
|
|
25224
25258
|
reuseOperationResultingState,
|
|
@@ -25412,7 +25446,7 @@ function mutableBaseReducer(document, action, customReducer, dispatch, options =
|
|
|
25412
25446
|
return newDocument;
|
|
25413
25447
|
}
|
|
25414
25448
|
function isNoopOperation(op) {
|
|
25415
|
-
return op.type === NOOP && op.skip !==
|
|
25449
|
+
return op.type === NOOP && op.skip !== undefined && op.skip > 0 && op.hash !== undefined;
|
|
25416
25450
|
}
|
|
25417
25451
|
function isUndoRedo(action) {
|
|
25418
25452
|
return [UNDO, REDO].includes(action.type);
|
|
@@ -25467,7 +25501,7 @@ var createExtendedState = (initialState, createState) => {
|
|
|
25467
25501
|
lastModified: (/* @__PURE__ */ new Date()).toISOString(),
|
|
25468
25502
|
attachments: {},
|
|
25469
25503
|
...initialState,
|
|
25470
|
-
state: (createState == null ?
|
|
25504
|
+
state: (createState == null ? undefined : createState(initialState == null ? undefined : initialState.state)) ?? ((initialState == null ? undefined : initialState.state) ?? { global: {}, local: {} })
|
|
25471
25505
|
};
|
|
25472
25506
|
};
|
|
25473
25507
|
var createDocument = (initialState, createState) => {
|
|
@@ -25532,7 +25566,7 @@ function sortMappedOperations(operations) {
|
|
|
25532
25566
|
function getDocumentLastModified(document) {
|
|
25533
25567
|
var _a;
|
|
25534
25568
|
const sortedOperations = sortOperations(document.operations);
|
|
25535
|
-
const timestamp = ((_a = sortedOperations.at(-1)) == null ?
|
|
25569
|
+
const timestamp = ((_a = sortedOperations.at(-1)) == null ? undefined : _a.timestamp) || document.initialState.lastModified;
|
|
25536
25570
|
return timestamp;
|
|
25537
25571
|
}
|
|
25538
25572
|
function replayOperations(initialState, clearedOperations, reducer, dispatch, header, documentReducer = baseReducer, skipHeaderOperations2 = {}, options) {
|
|
@@ -25639,7 +25673,7 @@ function replayDocument(initialState, operations, reducer, dispatch, header, ski
|
|
|
25639
25673
|
var _a;
|
|
25640
25674
|
return {
|
|
25641
25675
|
...operation,
|
|
25642
|
-
timestamp: ((_a = operations[scope][index2]) == null ?
|
|
25676
|
+
timestamp: ((_a = operations[scope][index2]) == null ? undefined : _a.timestamp) ?? operation.timestamp
|
|
25643
25677
|
};
|
|
25644
25678
|
})
|
|
25645
25679
|
]
|
|
@@ -25672,10 +25706,10 @@ function parseResultingState(state) {
|
|
|
25672
25706
|
var loadState = (state, operations) => createAction(
|
|
25673
25707
|
"LOAD_STATE",
|
|
25674
25708
|
{ state, operations },
|
|
25675
|
-
|
|
25709
|
+
undefined,
|
|
25676
25710
|
LoadStateActionInputSchema
|
|
25677
25711
|
);
|
|
25678
|
-
var noop = (scope = "global") => createAction("NOOP", {},
|
|
25712
|
+
var noop = (scope = "global") => createAction("NOOP", {}, undefined, void 0, scope);
|
|
25679
25713
|
|
|
25680
25714
|
// ../document-model/dist/node/es/internal/index-BOhJLvSm.js
|
|
25681
25715
|
var index = /* @__PURE__ */ Object.freeze(/* @__PURE__ */ Object.defineProperty({
|
|
@@ -25784,7 +25818,7 @@ var RunAsap;
|
|
|
25784
25818
|
return;
|
|
25785
25819
|
}
|
|
25786
25820
|
const index3 = event.data.split(":").at(1);
|
|
25787
|
-
if (index3 ===
|
|
25821
|
+
if (index3 === undefined) {
|
|
25788
25822
|
return;
|
|
25789
25823
|
}
|
|
25790
25824
|
const i = +index3;
|
|
@@ -25857,6 +25891,35 @@ function generateUUID2() {
|
|
|
25857
25891
|
return generateId();
|
|
25858
25892
|
}
|
|
25859
25893
|
|
|
25894
|
+
// ../document-drive/src/utils/logger.ts
|
|
25895
|
+
var Logger = class {
|
|
25896
|
+
#logger = console;
|
|
25897
|
+
constructor() {
|
|
25898
|
+
this.log = this.log.bind(this);
|
|
25899
|
+
this.info = this.info.bind(this);
|
|
25900
|
+
this.warn = this.warn.bind(this);
|
|
25901
|
+
this.error = this.error.bind(this);
|
|
25902
|
+
this.debug = this.debug.bind(this);
|
|
25903
|
+
this.trace = this.trace.bind(this);
|
|
25904
|
+
}
|
|
25905
|
+
set logger(logger2) {
|
|
25906
|
+
this.#logger = logger2;
|
|
25907
|
+
}
|
|
25908
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
25909
|
+
log = (...data) => this.#logger.log(...data);
|
|
25910
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
25911
|
+
info = (...data) => this.#logger.info(...data);
|
|
25912
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
25913
|
+
warn = (...data) => this.#logger.warn(...data);
|
|
25914
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
25915
|
+
error = (...data) => this.#logger.error(...data);
|
|
25916
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
25917
|
+
debug = (...data) => this.#logger.debug(...data);
|
|
25918
|
+
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
25919
|
+
trace = (...data) => this.#logger.trace(...data);
|
|
25920
|
+
};
|
|
25921
|
+
new Logger();
|
|
25922
|
+
|
|
25860
25923
|
// ../document-drive/src/utils/document-helpers.ts
|
|
25861
25924
|
index.documentHelpers;
|
|
25862
25925
|
|
|
@@ -25867,13 +25930,15 @@ var DriveSubgraph = class extends Subgraph {
|
|
|
25867
25930
|
typeDefs = gql`
|
|
25868
25931
|
type Query {
|
|
25869
25932
|
system: System
|
|
25870
|
-
drive:
|
|
25933
|
+
drive: DocumentDrive_DocumentDriveState
|
|
25871
25934
|
document(id: String!): IDocument
|
|
25872
25935
|
documents: [String!]!
|
|
25873
25936
|
}
|
|
25874
25937
|
|
|
25875
25938
|
type Mutation {
|
|
25876
|
-
registerPullResponderListener(
|
|
25939
|
+
registerPullResponderListener(
|
|
25940
|
+
filter: InputListenerFilter!
|
|
25941
|
+
): DocumentDrive_Listener
|
|
25877
25942
|
pushUpdates(strands: [InputStrandUpdate!]): [ListenerRevision!]!
|
|
25878
25943
|
acknowledge(
|
|
25879
25944
|
listenerId: String!
|
|
@@ -26101,7 +26166,7 @@ var DriveSubgraph = class extends Subgraph {
|
|
|
26101
26166
|
scope: s2.scope,
|
|
26102
26167
|
branch: "main"
|
|
26103
26168
|
})) ?? [];
|
|
26104
|
-
const result = await (s2.documentId !==
|
|
26169
|
+
const result = await (s2.documentId !== undefined ? this.reactor.queueOperations(
|
|
26105
26170
|
s2.driveId,
|
|
26106
26171
|
s2.documentId,
|
|
26107
26172
|
operations
|
|
@@ -26128,7 +26193,7 @@ var DriveSubgraph = class extends Subgraph {
|
|
|
26128
26193
|
driveId: s2.driveId,
|
|
26129
26194
|
scope: s2.scope,
|
|
26130
26195
|
status: result.status,
|
|
26131
|
-
error: result.error?.message ||
|
|
26196
|
+
error: result.error?.message || undefined
|
|
26132
26197
|
};
|
|
26133
26198
|
})
|
|
26134
26199
|
);
|
|
@@ -26221,7 +26286,9 @@ var SystemSubgraph = class extends Subgraph {
|
|
|
26221
26286
|
}
|
|
26222
26287
|
|
|
26223
26288
|
type Mutation {
|
|
26224
|
-
addDrive(
|
|
26289
|
+
addDrive(
|
|
26290
|
+
global: DocumentDriveStateInput!
|
|
26291
|
+
): DocumentDrive_DocumentDriveState
|
|
26225
26292
|
deleteDrive(id: ID!): Boolean
|
|
26226
26293
|
setDriveIcon(id: String!, icon: String!): Boolean
|
|
26227
26294
|
setDriveName(id: String!, name: String!): Boolean
|
|
@@ -26340,7 +26407,7 @@ var verifyToken = (token) => {
|
|
|
26340
26407
|
return decoded;
|
|
26341
26408
|
});
|
|
26342
26409
|
if (!verified) {
|
|
26343
|
-
return
|
|
26410
|
+
return undefined;
|
|
26344
26411
|
}
|
|
26345
26412
|
const validated = jwtSchema.parse(verified);
|
|
26346
26413
|
return validated;
|
|
@@ -26789,7 +26856,7 @@ var SubgraphManager = class {
|
|
|
26789
26856
|
expressMiddleware(server, {
|
|
26790
26857
|
context: ({ req }) => ({
|
|
26791
26858
|
headers: req.headers,
|
|
26792
|
-
driveId: req.params.drive ??
|
|
26859
|
+
driveId: req.params.drive ?? undefined,
|
|
26793
26860
|
driveServer: this.reactor,
|
|
26794
26861
|
db: this.operationalStore,
|
|
26795
26862
|
...this.getAdditionalContextFields()
|
|
@@ -26829,7 +26896,7 @@ function isPG(connectionString) {
|
|
|
26829
26896
|
}
|
|
26830
26897
|
return false;
|
|
26831
26898
|
}
|
|
26832
|
-
function getDbClient(connectionString =
|
|
26899
|
+
function getDbClient(connectionString = undefined) {
|
|
26833
26900
|
const isPg = connectionString && isPG(connectionString);
|
|
26834
26901
|
const client = isPg ? "pg" : ClientPgLite;
|
|
26835
26902
|
const connection = isPg ? { connectionString } : { pglite: new PGlite(connectionString) };
|
|
@@ -26838,6 +26905,8 @@ function getDbClient(connectionString = void 0) {
|
|
|
26838
26905
|
connection
|
|
26839
26906
|
});
|
|
26840
26907
|
}
|
|
26908
|
+
|
|
26909
|
+
// src/server.ts
|
|
26841
26910
|
var DEFAULT_PORT = 4e3;
|
|
26842
26911
|
async function startAPI(reactor, options) {
|
|
26843
26912
|
const port = options.port ?? DEFAULT_PORT;
|