@go-labs-sg/event-tech 1.5.0 → 1.7.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/dist/index.js CHANGED
@@ -6999,11 +6999,1258 @@ var DEPRECATED_EVENT_TYPES = [
6999
6999
  var activeEventTypeSchema = _enum(EventType).exclude(DEPRECATED_EVENT_TYPES);
7000
7000
  var ACTIVE_EVENT_TYPES = activeEventTypeSchema.options;
7001
7001
 
7002
+ // ../../../node_modules/.bun/@trpc+server@11.24.0+aec250ebf9e68690/node_modules/@trpc/server/dist/observable-CdPmrXKY.mjs
7003
+ function observable(subscribe) {
7004
+ const self = {
7005
+ subscribe(observer) {
7006
+ let teardownRef = null;
7007
+ let isDone = false;
7008
+ let unsubscribed = false;
7009
+ let teardownImmediately = false;
7010
+ function unsubscribe() {
7011
+ if (teardownRef === null) {
7012
+ teardownImmediately = true;
7013
+ return;
7014
+ }
7015
+ if (unsubscribed)
7016
+ return;
7017
+ unsubscribed = true;
7018
+ if (typeof teardownRef === "function")
7019
+ teardownRef();
7020
+ else if (teardownRef)
7021
+ teardownRef.unsubscribe();
7022
+ }
7023
+ teardownRef = subscribe({
7024
+ next(value) {
7025
+ var _observer$next;
7026
+ if (isDone)
7027
+ return;
7028
+ (_observer$next = observer.next) === null || _observer$next === undefined || _observer$next.call(observer, value);
7029
+ },
7030
+ error(err) {
7031
+ var _observer$error;
7032
+ if (isDone)
7033
+ return;
7034
+ isDone = true;
7035
+ (_observer$error = observer.error) === null || _observer$error === undefined || _observer$error.call(observer, err);
7036
+ unsubscribe();
7037
+ },
7038
+ complete() {
7039
+ var _observer$complete;
7040
+ if (isDone)
7041
+ return;
7042
+ isDone = true;
7043
+ (_observer$complete = observer.complete) === null || _observer$complete === undefined || _observer$complete.call(observer);
7044
+ unsubscribe();
7045
+ }
7046
+ });
7047
+ if (teardownImmediately)
7048
+ unsubscribe();
7049
+ return { unsubscribe };
7050
+ },
7051
+ pipe(...operations) {
7052
+ return operations.reduce(pipeReducer, self);
7053
+ }
7054
+ };
7055
+ return self;
7056
+ }
7057
+ function pipeReducer(prev, fn) {
7058
+ return fn(prev);
7059
+ }
7060
+ function observableToPromise(observable) {
7061
+ const ac = new AbortController;
7062
+ return new Promise((resolve, reject) => {
7063
+ let isDone = false;
7064
+ function onDone() {
7065
+ if (isDone)
7066
+ return;
7067
+ isDone = true;
7068
+ obs$.unsubscribe();
7069
+ }
7070
+ ac.signal.addEventListener("abort", () => {
7071
+ reject(ac.signal.reason);
7072
+ });
7073
+ const obs$ = observable.subscribe({
7074
+ next(data) {
7075
+ isDone = true;
7076
+ resolve(data);
7077
+ onDone();
7078
+ },
7079
+ error(data) {
7080
+ reject(data);
7081
+ },
7082
+ complete() {
7083
+ ac.abort();
7084
+ onDone();
7085
+ }
7086
+ });
7087
+ });
7088
+ }
7089
+
7090
+ // ../../../node_modules/.bun/@trpc+server@11.24.0+aec250ebf9e68690/node_modules/@trpc/server/dist/observable-DMA7fHJ6.mjs
7091
+ function share(_opts) {
7092
+ return (source) => {
7093
+ let refCount = 0;
7094
+ let subscription = null;
7095
+ let isConnecting = false;
7096
+ let observers = /* @__PURE__ */ new Set;
7097
+ function startIfNeeded() {
7098
+ if (subscription || isConnecting)
7099
+ return;
7100
+ isConnecting = true;
7101
+ let isDone = false;
7102
+ let sourceSubscription;
7103
+ try {
7104
+ sourceSubscription = source.subscribe({
7105
+ next(value) {
7106
+ notify(observers, (observer) => {
7107
+ var _observer$next;
7108
+ return (_observer$next = observer.next) === null || _observer$next === undefined ? undefined : _observer$next.call(observer, value);
7109
+ });
7110
+ },
7111
+ error(error) {
7112
+ isDone = true;
7113
+ terminate((observer) => {
7114
+ var _observer$error;
7115
+ return (_observer$error = observer.error) === null || _observer$error === undefined ? undefined : _observer$error.call(observer, error);
7116
+ });
7117
+ },
7118
+ complete() {
7119
+ isDone = true;
7120
+ terminate((observer) => {
7121
+ var _observer$complete;
7122
+ return (_observer$complete = observer.complete) === null || _observer$complete === undefined ? undefined : _observer$complete.call(observer);
7123
+ });
7124
+ }
7125
+ });
7126
+ } finally {
7127
+ isConnecting = false;
7128
+ }
7129
+ if (isDone)
7130
+ sourceSubscription.unsubscribe();
7131
+ else
7132
+ subscription = sourceSubscription;
7133
+ }
7134
+ function notify(targets, callback) {
7135
+ for (const observer of [...targets])
7136
+ if (targets.has(observer))
7137
+ callback(observer);
7138
+ }
7139
+ function terminate(callback) {
7140
+ const _sub = subscription;
7141
+ const terminatedObservers = observers;
7142
+ subscription = null;
7143
+ observers = /* @__PURE__ */ new Set;
7144
+ isConnecting = false;
7145
+ try {
7146
+ notify(terminatedObservers, callback);
7147
+ } finally {
7148
+ _sub === null || _sub === undefined || _sub.unsubscribe();
7149
+ }
7150
+ }
7151
+ function resetSource() {
7152
+ const _sub = subscription;
7153
+ subscription = null;
7154
+ _sub === null || _sub === undefined || _sub.unsubscribe();
7155
+ }
7156
+ function resetIfNeeded() {
7157
+ if (refCount === 0 && subscription)
7158
+ resetSource();
7159
+ }
7160
+ return observable((subscriber) => {
7161
+ refCount++;
7162
+ const subscriberObservers = observers;
7163
+ subscriberObservers.add(subscriber);
7164
+ startIfNeeded();
7165
+ return { unsubscribe() {
7166
+ refCount--;
7167
+ resetIfNeeded();
7168
+ subscriberObservers.delete(subscriber);
7169
+ } };
7170
+ });
7171
+ };
7172
+ }
7173
+ var distinctUnsetMarker = Symbol();
7174
+ function behaviorSubject(initialValue) {
7175
+ let value = initialValue;
7176
+ const observerList = /* @__PURE__ */ new Set;
7177
+ const addObserver = (observer) => {
7178
+ if (value !== undefined)
7179
+ observer.next(value);
7180
+ observerList.add(observer);
7181
+ };
7182
+ const removeObserver = (observer) => {
7183
+ observerList.delete(observer);
7184
+ };
7185
+ const obs = observable((observer) => {
7186
+ addObserver(observer);
7187
+ return () => {
7188
+ removeObserver(observer);
7189
+ };
7190
+ });
7191
+ obs.next = (nextValue) => {
7192
+ if (value === nextValue)
7193
+ return;
7194
+ value = nextValue;
7195
+ for (const observer of [...observerList])
7196
+ if (observerList.has(observer))
7197
+ observer.next(nextValue);
7198
+ };
7199
+ obs.get = () => value;
7200
+ return obs;
7201
+ }
7202
+
7203
+ // ../../../node_modules/.bun/@trpc+client@11.24.0+1bcc723bc4c4f345/node_modules/@trpc/client/dist/splitLink-DcpFI5s5.mjs
7204
+ function createChain(opts) {
7205
+ return observable((observer) => {
7206
+ function execute(index = 0, op = opts.op) {
7207
+ const next = opts.links[index];
7208
+ if (!next)
7209
+ throw new Error("No more links to execute - did you forget to add an ending link?");
7210
+ return next({
7211
+ op,
7212
+ next(nextOp) {
7213
+ return execute(index + 1, nextOp);
7214
+ }
7215
+ });
7216
+ }
7217
+ return execute().subscribe(observer);
7218
+ });
7219
+ }
7220
+
7221
+ // ../../../node_modules/.bun/@trpc+client@11.24.0+1bcc723bc4c4f345/node_modules/@trpc/client/dist/objectSpread2-weooBxVk.mjs
7222
+ function _typeof(o) {
7223
+ "@babel/helpers - typeof";
7224
+ return _typeof = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o) {
7225
+ return typeof o;
7226
+ } : function(o) {
7227
+ return o && typeof Symbol == "function" && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
7228
+ }, _typeof(o);
7229
+ }
7230
+ function toPrimitive(t, r) {
7231
+ if (_typeof(t) != "object" || !t)
7232
+ return t;
7233
+ var e = t[Symbol.toPrimitive];
7234
+ if (e !== undefined) {
7235
+ var i = e.call(t, r || "default");
7236
+ if (_typeof(i) != "object")
7237
+ return i;
7238
+ throw new TypeError("@@toPrimitive must return a primitive value.");
7239
+ }
7240
+ return (r === "string" ? String : Number)(t);
7241
+ }
7242
+ function toPropertyKey(t) {
7243
+ var i = toPrimitive(t, "string");
7244
+ return _typeof(i) == "symbol" ? i : i + "";
7245
+ }
7246
+ function _defineProperty(e, r, t) {
7247
+ return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
7248
+ value: t,
7249
+ enumerable: true,
7250
+ configurable: true,
7251
+ writable: true
7252
+ }) : e[r] = t, e;
7253
+ }
7254
+ function ownKeys(e, r) {
7255
+ var t = Object.keys(e);
7256
+ if (Object.getOwnPropertySymbols) {
7257
+ var o = Object.getOwnPropertySymbols(e);
7258
+ r && (o = o.filter(function(r) {
7259
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
7260
+ })), t.push.apply(t, o);
7261
+ }
7262
+ return t;
7263
+ }
7264
+ function _objectSpread2(e) {
7265
+ for (var r = 1;r < arguments.length; r++) {
7266
+ var t = arguments[r] != null ? arguments[r] : {};
7267
+ r % 2 ? ownKeys(Object(t), true).forEach(function(r) {
7268
+ _defineProperty(e, r, t[r]);
7269
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r) {
7270
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
7271
+ });
7272
+ }
7273
+ return e;
7274
+ }
7275
+
7276
+ // ../../../node_modules/.bun/@trpc+server@11.24.0+aec250ebf9e68690/node_modules/@trpc/server/dist/codes-nbrm_zWY.mjs
7277
+ function isObject2(value) {
7278
+ return !!value && !Array.isArray(value) && typeof value === "object";
7279
+ }
7280
+ function emptyObject() {
7281
+ return Object.create(null);
7282
+ }
7283
+ var TRPC_ERROR_CODES_BY_KEY = {
7284
+ PARSE_ERROR: -32700,
7285
+ BAD_REQUEST: -32600,
7286
+ INTERNAL_SERVER_ERROR: -32603,
7287
+ NOT_IMPLEMENTED: -32603,
7288
+ BAD_GATEWAY: -32603,
7289
+ SERVICE_UNAVAILABLE: -32603,
7290
+ GATEWAY_TIMEOUT: -32603,
7291
+ UNAUTHORIZED: -32001,
7292
+ PAYMENT_REQUIRED: -32002,
7293
+ FORBIDDEN: -32003,
7294
+ NOT_FOUND: -32004,
7295
+ METHOD_NOT_SUPPORTED: -32005,
7296
+ TIMEOUT: -32008,
7297
+ CONFLICT: -32009,
7298
+ PRECONDITION_FAILED: -32012,
7299
+ PAYLOAD_TOO_LARGE: -32013,
7300
+ UNSUPPORTED_MEDIA_TYPE: -32015,
7301
+ UNPROCESSABLE_CONTENT: -32022,
7302
+ PRECONDITION_REQUIRED: -32028,
7303
+ TOO_MANY_REQUESTS: -32029,
7304
+ CLIENT_CLOSED_REQUEST: -32099
7305
+ };
7306
+ var retryableRpcCodes = [
7307
+ TRPC_ERROR_CODES_BY_KEY.BAD_GATEWAY,
7308
+ TRPC_ERROR_CODES_BY_KEY.SERVICE_UNAVAILABLE,
7309
+ TRPC_ERROR_CODES_BY_KEY.GATEWAY_TIMEOUT,
7310
+ TRPC_ERROR_CODES_BY_KEY.INTERNAL_SERVER_ERROR
7311
+ ];
7312
+
7313
+ // ../../../node_modules/.bun/@trpc+server@11.24.0+aec250ebf9e68690/node_modules/@trpc/server/dist/getErrorShape-B5jPKHJ3.mjs
7314
+ var noop = () => {};
7315
+ var freezeIfAvailable = (obj) => {
7316
+ if (Object.freeze)
7317
+ Object.freeze(obj);
7318
+ };
7319
+ function createInnerProxy(callback, path, memo) {
7320
+ var _memo$cacheKey;
7321
+ const cacheKey = path.join(".");
7322
+ (_memo$cacheKey = memo[cacheKey]) !== null && _memo$cacheKey !== undefined || (memo[cacheKey] = new Proxy(noop, {
7323
+ get(_obj, key) {
7324
+ if (typeof key !== "string" || key === "then")
7325
+ return;
7326
+ return createInnerProxy(callback, [...path, key], memo);
7327
+ },
7328
+ apply(_1, _2, args) {
7329
+ const lastOfPath = path[path.length - 1];
7330
+ if (lastOfPath === "valueOf" || lastOfPath === "toString" || lastOfPath === "toJSON")
7331
+ return `tRPC.proxy(${path.slice(0, -1).join(".")})`;
7332
+ let opts = {
7333
+ args,
7334
+ path
7335
+ };
7336
+ if (lastOfPath === "call")
7337
+ opts = {
7338
+ args: args.length >= 2 ? [args[1]] : [],
7339
+ path: path.slice(0, -1)
7340
+ };
7341
+ else if (lastOfPath === "apply")
7342
+ opts = {
7343
+ args: args.length >= 2 ? args[1] : [],
7344
+ path: path.slice(0, -1)
7345
+ };
7346
+ freezeIfAvailable(opts.args);
7347
+ freezeIfAvailable(opts.path);
7348
+ return callback(opts);
7349
+ }
7350
+ }));
7351
+ return memo[cacheKey];
7352
+ }
7353
+ var createRecursiveProxy = (callback) => createInnerProxy(callback, [], emptyObject());
7354
+ var createFlatProxy = (callback) => {
7355
+ return new Proxy(noop, { get(_obj, name) {
7356
+ if (name === "then")
7357
+ return;
7358
+ return callback(name);
7359
+ } });
7360
+ };
7361
+ var formattedShapeSymbol = Symbol("trpc_formattedErrorShape");
7362
+ function _typeof2(o) {
7363
+ "@babel/helpers - typeof";
7364
+ return _typeof2 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o) {
7365
+ return typeof o;
7366
+ } : function(o) {
7367
+ return o && typeof Symbol == "function" && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;
7368
+ }, _typeof2(o);
7369
+ }
7370
+ function toPrimitive2(t, r) {
7371
+ if (_typeof2(t) != "object" || !t)
7372
+ return t;
7373
+ var e = t[Symbol.toPrimitive];
7374
+ if (e !== undefined) {
7375
+ var i = e.call(t, r || "default");
7376
+ if (_typeof2(i) != "object")
7377
+ return i;
7378
+ throw new TypeError("@@toPrimitive must return a primitive value.");
7379
+ }
7380
+ return (r === "string" ? String : Number)(t);
7381
+ }
7382
+ function toPropertyKey2(t) {
7383
+ var i = toPrimitive2(t, "string");
7384
+ return _typeof2(i) == "symbol" ? i : i + "";
7385
+ }
7386
+ function _defineProperty2(e, r, t) {
7387
+ return (r = toPropertyKey2(r)) in e ? Object.defineProperty(e, r, {
7388
+ value: t,
7389
+ enumerable: true,
7390
+ configurable: true,
7391
+ writable: true
7392
+ }) : e[r] = t, e;
7393
+ }
7394
+ function ownKeys2(e, r) {
7395
+ var t = Object.keys(e);
7396
+ if (Object.getOwnPropertySymbols) {
7397
+ var o = Object.getOwnPropertySymbols(e);
7398
+ r && (o = o.filter(function(r) {
7399
+ return Object.getOwnPropertyDescriptor(e, r).enumerable;
7400
+ })), t.push.apply(t, o);
7401
+ }
7402
+ return t;
7403
+ }
7404
+ function _objectSpread22(e) {
7405
+ for (var r = 1;r < arguments.length; r++) {
7406
+ var t = arguments[r] != null ? arguments[r] : {};
7407
+ r % 2 ? ownKeys2(Object(t), true).forEach(function(r) {
7408
+ _defineProperty2(e, r, t[r]);
7409
+ }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys2(Object(t)).forEach(function(r) {
7410
+ Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));
7411
+ });
7412
+ }
7413
+ return e;
7414
+ }
7415
+
7416
+ // ../../../node_modules/.bun/@trpc+server@11.24.0+aec250ebf9e68690/node_modules/@trpc/server/dist/asyncGeneratorDelegate-JWx0LJUD.mjs
7417
+ function transformResultInner(response, transformer) {
7418
+ if ("error" in response) {
7419
+ const error = transformer.deserialize(response.error);
7420
+ return {
7421
+ ok: false,
7422
+ error: _objectSpread22(_objectSpread22({}, response), {}, { error })
7423
+ };
7424
+ }
7425
+ return {
7426
+ ok: true,
7427
+ result: _objectSpread22(_objectSpread22({}, response.result), (!response.result.type || response.result.type === "data") && {
7428
+ type: "data",
7429
+ data: transformer.deserialize(response.result.data)
7430
+ })
7431
+ };
7432
+ }
7433
+ var TransformResultError = class extends Error {
7434
+ constructor() {
7435
+ super("Unable to transform response from server");
7436
+ }
7437
+ };
7438
+ function transformResult(response, transformer) {
7439
+ let result;
7440
+ try {
7441
+ result = transformResultInner(response, transformer);
7442
+ } catch (_unused) {
7443
+ throw new TransformResultError;
7444
+ }
7445
+ if (!result.ok && (!isObject2(result.error.error) || typeof result.error.error["code"] !== "number"))
7446
+ throw new TransformResultError;
7447
+ if (result.ok && !isObject2(result.result))
7448
+ throw new TransformResultError;
7449
+ return result;
7450
+ }
7451
+ function resolvePathSeparator(value) {
7452
+ return value !== null && value !== undefined ? value : ".";
7453
+ }
7454
+ function procedurePathToURLPath(path, separator) {
7455
+ if (separator === ".")
7456
+ return path;
7457
+ return path.split(".").join(separator);
7458
+ }
7459
+ function _OverloadYield(e, d) {
7460
+ this.v = e, this.k = d;
7461
+ }
7462
+ function AsyncGenerator(e) {
7463
+ var r, t;
7464
+ function resume(r, t) {
7465
+ try {
7466
+ var n = e[r](t), o = n.value, u = o instanceof _OverloadYield;
7467
+ Promise.resolve(u ? o.v : o).then(function(t) {
7468
+ if (u) {
7469
+ var i = r === "return" ? "return" : "next";
7470
+ if (!o.k || t.done)
7471
+ return resume(i, t);
7472
+ t = e[i](t).value;
7473
+ }
7474
+ settle(n.done ? "return" : "normal", t);
7475
+ }, function(e) {
7476
+ resume("throw", e);
7477
+ });
7478
+ } catch (e) {
7479
+ settle("throw", e);
7480
+ }
7481
+ }
7482
+ function settle(e, n) {
7483
+ switch (e) {
7484
+ case "return":
7485
+ r.resolve({
7486
+ value: n,
7487
+ done: true
7488
+ });
7489
+ break;
7490
+ case "throw":
7491
+ r.reject(n);
7492
+ break;
7493
+ default:
7494
+ r.resolve({
7495
+ value: n,
7496
+ done: false
7497
+ });
7498
+ }
7499
+ (r = r.next) ? resume(r.key, r.arg) : t = null;
7500
+ }
7501
+ this._invoke = function(e, n) {
7502
+ return new Promise(function(o, u) {
7503
+ var i = {
7504
+ key: e,
7505
+ arg: n,
7506
+ resolve: o,
7507
+ reject: u,
7508
+ next: null
7509
+ };
7510
+ t ? t = t.next = i : (r = t = i, resume(e, n));
7511
+ });
7512
+ }, typeof e["return"] != "function" && (this["return"] = undefined);
7513
+ }
7514
+ AsyncGenerator.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
7515
+ return this;
7516
+ }, AsyncGenerator.prototype.next = function(e) {
7517
+ return this._invoke("next", e);
7518
+ }, AsyncGenerator.prototype["throw"] = function(e) {
7519
+ return this._invoke("throw", e);
7520
+ }, AsyncGenerator.prototype["return"] = function(e) {
7521
+ return this._invoke("return", e);
7522
+ };
7523
+ var trackedSymbol = Symbol();
7524
+
7525
+ // ../../../node_modules/.bun/@trpc+client@11.24.0+1bcc723bc4c4f345/node_modules/@trpc/client/dist/TRPCClientError-Byo7P4QG.mjs
7526
+ function isTRPCClientError(cause) {
7527
+ return cause instanceof TRPCClientError;
7528
+ }
7529
+ function isTRPCErrorResponse(obj) {
7530
+ return isObject2(obj) && isObject2(obj["error"]) && typeof obj["error"]["code"] === "number" && typeof obj["error"]["message"] === "string";
7531
+ }
7532
+ function getMessageFromUnknownError(err, fallback) {
7533
+ if (typeof err === "string")
7534
+ return err;
7535
+ if (isObject2(err) && typeof err["message"] === "string")
7536
+ return err["message"];
7537
+ return fallback;
7538
+ }
7539
+ var TRPCClientError = class TRPCClientError extends Error {
7540
+ constructor(message, opts) {
7541
+ var _opts$result, _opts$result2;
7542
+ const cause = opts === null || opts === undefined ? undefined : opts.cause;
7543
+ super(message, { cause });
7544
+ _defineProperty(this, "cause", undefined);
7545
+ _defineProperty(this, "shape", undefined);
7546
+ _defineProperty(this, "data", undefined);
7547
+ _defineProperty(this, "meta", undefined);
7548
+ this.meta = opts === null || opts === undefined ? undefined : opts.meta;
7549
+ this.cause = cause;
7550
+ this.shape = opts === null || opts === undefined || (_opts$result = opts.result) === null || _opts$result === undefined ? undefined : _opts$result.error;
7551
+ this.data = opts === null || opts === undefined || (_opts$result2 = opts.result) === null || _opts$result2 === undefined ? undefined : _opts$result2.error.data;
7552
+ this.name = "TRPCClientError";
7553
+ Object.setPrototypeOf(this, TRPCClientError.prototype);
7554
+ }
7555
+ static from(_cause, opts = {}) {
7556
+ const cause = _cause;
7557
+ if (isTRPCClientError(cause)) {
7558
+ if (opts.meta)
7559
+ cause.meta = _objectSpread2(_objectSpread2({}, cause.meta), opts.meta);
7560
+ return cause;
7561
+ }
7562
+ if (isTRPCErrorResponse(cause))
7563
+ return new TRPCClientError(cause.error.message, _objectSpread2(_objectSpread2({}, opts), {}, {
7564
+ result: cause,
7565
+ cause: opts.cause
7566
+ }));
7567
+ return new TRPCClientError(getMessageFromUnknownError(cause, "Unknown error"), _objectSpread2(_objectSpread2({}, opts), {}, { cause }));
7568
+ }
7569
+ };
7570
+
7571
+ // ../../../node_modules/.bun/@trpc+client@11.24.0+1bcc723bc4c4f345/node_modules/@trpc/client/dist/unstable-internals.mjs
7572
+ function getTransformer(transformer) {
7573
+ const _transformer = transformer;
7574
+ if (!_transformer)
7575
+ return {
7576
+ input: {
7577
+ serialize: (data) => data,
7578
+ deserialize: (data) => data
7579
+ },
7580
+ output: {
7581
+ serialize: (data) => data,
7582
+ deserialize: (data) => data
7583
+ }
7584
+ };
7585
+ if ("input" in _transformer)
7586
+ return _transformer;
7587
+ return {
7588
+ input: _transformer,
7589
+ output: _transformer
7590
+ };
7591
+ }
7592
+
7593
+ // ../../../node_modules/.bun/@trpc+client@11.24.0+1bcc723bc4c4f345/node_modules/@trpc/client/dist/httpUtils-5Hmhcy-z.mjs
7594
+ var isFunction2 = (fn) => typeof fn === "function";
7595
+ function getFetch(customFetchImpl) {
7596
+ if (customFetchImpl)
7597
+ return customFetchImpl;
7598
+ if (typeof window !== "undefined" && isFunction2(window.fetch))
7599
+ return window.fetch.bind(window);
7600
+ if (typeof globalThis !== "undefined" && isFunction2(globalThis.fetch))
7601
+ return globalThis.fetch;
7602
+ throw new Error("No fetch implementation found");
7603
+ }
7604
+ function allAbortSignals(...signals) {
7605
+ const ac = new AbortController;
7606
+ const count = signals.length;
7607
+ let abortedCount = 0;
7608
+ const onAbort = () => {
7609
+ if (++abortedCount === count)
7610
+ ac.abort();
7611
+ };
7612
+ for (const signal of signals)
7613
+ if (signal === null || signal === undefined ? undefined : signal.aborted)
7614
+ onAbort();
7615
+ else
7616
+ signal === null || signal === undefined || signal.addEventListener("abort", onAbort, { once: true });
7617
+ return ac.signal;
7618
+ }
7619
+ function raceAbortSignalsWithCleanup(...signals) {
7620
+ const ac = new AbortController;
7621
+ const cleanup = () => {
7622
+ for (const signal of signals)
7623
+ signal === null || signal === undefined || signal.removeEventListener("abort", onAbort);
7624
+ };
7625
+ const onAbort = () => {
7626
+ cleanup();
7627
+ ac.abort();
7628
+ };
7629
+ for (const signal of signals) {
7630
+ if (signal === null || signal === undefined ? undefined : signal.aborted) {
7631
+ onAbort();
7632
+ break;
7633
+ }
7634
+ signal === null || signal === undefined || signal.addEventListener("abort", onAbort, { once: true });
7635
+ }
7636
+ return {
7637
+ signal: ac.signal,
7638
+ cleanup
7639
+ };
7640
+ }
7641
+ function resolveHTTPLinkOptions(opts) {
7642
+ return {
7643
+ url: opts.url.toString(),
7644
+ fetch: opts.fetch,
7645
+ transformer: getTransformer(opts.transformer),
7646
+ methodOverride: opts.methodOverride,
7647
+ pathSeparator: resolvePathSeparator(opts.pathSeparator)
7648
+ };
7649
+ }
7650
+ function arrayToDict(array) {
7651
+ const dict = {};
7652
+ for (let index = 0;index < array.length; index++) {
7653
+ const element = array[index];
7654
+ dict[index] = element;
7655
+ }
7656
+ return dict;
7657
+ }
7658
+ var METHOD = {
7659
+ query: "GET",
7660
+ mutation: "POST",
7661
+ subscription: "PATCH"
7662
+ };
7663
+ function getInput(opts) {
7664
+ return "input" in opts ? opts.transformer.input.serialize(opts.input) : arrayToDict(opts.inputs.map((_input) => opts.transformer.input.serialize(_input)));
7665
+ }
7666
+ var getUrl = (opts) => {
7667
+ const parts = opts.url.split("?");
7668
+ let url = parts[0].replace(/\/$/, "") + "/" + procedurePathToURLPath(opts.path, opts.pathSeparator);
7669
+ const queryParts = [];
7670
+ if (parts[1])
7671
+ queryParts.push(parts[1]);
7672
+ if ("inputs" in opts)
7673
+ queryParts.push("batch=1");
7674
+ if (opts.type === "query" || opts.type === "subscription") {
7675
+ const input = getInput(opts);
7676
+ if (input !== undefined && opts.methodOverride !== "POST")
7677
+ queryParts.push(`input=${encodeURIComponent(JSON.stringify(input))}`);
7678
+ }
7679
+ if (queryParts.length)
7680
+ url += "?" + queryParts.join("&");
7681
+ return url;
7682
+ };
7683
+ var getBody = (opts) => {
7684
+ if (opts.type === "query" && opts.methodOverride !== "POST")
7685
+ return;
7686
+ const input = getInput(opts);
7687
+ return input !== undefined ? JSON.stringify(input) : undefined;
7688
+ };
7689
+ var jsonHttpRequester = (opts) => {
7690
+ return httpRequest(_objectSpread2(_objectSpread2({}, opts), {}, {
7691
+ contentTypeHeader: "application/json",
7692
+ getUrl,
7693
+ getBody
7694
+ }));
7695
+ };
7696
+ var AbortError = class extends Error {
7697
+ constructor() {
7698
+ const name = "AbortError";
7699
+ super(name);
7700
+ this.name = name;
7701
+ this.message = name;
7702
+ }
7703
+ };
7704
+ var throwIfAborted = (signal) => {
7705
+ var _signal$throwIfAborte;
7706
+ if (!(signal === null || signal === undefined ? undefined : signal.aborted))
7707
+ return;
7708
+ (_signal$throwIfAborte = signal.throwIfAborted) === null || _signal$throwIfAborte === undefined || _signal$throwIfAborte.call(signal);
7709
+ if (typeof DOMException !== "undefined")
7710
+ throw new DOMException("AbortError", "AbortError");
7711
+ throw new AbortError;
7712
+ };
7713
+ async function fetchHTTPResponse(opts) {
7714
+ var _opts$methodOverride, _opts$trpcAcceptHeade;
7715
+ throwIfAborted(opts.signal);
7716
+ const url = opts.getUrl(opts);
7717
+ const body = opts.getBody(opts);
7718
+ const method = (_opts$methodOverride = opts.methodOverride) !== null && _opts$methodOverride !== undefined ? _opts$methodOverride : METHOD[opts.type];
7719
+ const resolvedHeaders = await (async () => {
7720
+ const heads = await opts.headers();
7721
+ if (Symbol.iterator in heads)
7722
+ return Object.fromEntries(heads);
7723
+ return heads;
7724
+ })();
7725
+ const hasContentType = Object.keys(resolvedHeaders).some((key) => key.toLowerCase() === "content-type");
7726
+ const headers = _objectSpread2(_objectSpread2(_objectSpread2({}, opts.contentTypeHeader && method !== "GET" && !hasContentType ? { "content-type": opts.contentTypeHeader } : {}), opts.trpcAcceptHeader ? { [(_opts$trpcAcceptHeade = opts.trpcAcceptHeaderKey) !== null && _opts$trpcAcceptHeade !== undefined ? _opts$trpcAcceptHeade : "trpc-accept"]: opts.trpcAcceptHeader } : undefined), resolvedHeaders);
7727
+ return getFetch(opts.fetch)(url, {
7728
+ method,
7729
+ signal: opts.signal,
7730
+ body,
7731
+ headers
7732
+ });
7733
+ }
7734
+ async function httpRequest(opts) {
7735
+ const meta = {};
7736
+ const res = await fetchHTTPResponse(opts);
7737
+ meta.response = res;
7738
+ const json = await res.json();
7739
+ meta.responseJSON = json;
7740
+ return {
7741
+ json,
7742
+ meta
7743
+ };
7744
+ }
7745
+
7746
+ // ../../../node_modules/.bun/@trpc+client@11.24.0+1bcc723bc4c4f345/node_modules/@trpc/client/dist/httpBatchLink-aPx7u_sr.mjs
7747
+ var throwFatalError = () => {
7748
+ throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new");
7749
+ };
7750
+ function dataLoader(batchLoader) {
7751
+ let pendingItems = null;
7752
+ let dispatchTimer = null;
7753
+ const destroyTimerAndPendingItems = () => {
7754
+ clearTimeout(dispatchTimer);
7755
+ dispatchTimer = null;
7756
+ pendingItems = null;
7757
+ };
7758
+ function groupItems(items) {
7759
+ const groupedItems = [[]];
7760
+ let index = 0;
7761
+ while (true) {
7762
+ const item = items[index];
7763
+ if (!item)
7764
+ break;
7765
+ const lastGroup = groupedItems[groupedItems.length - 1];
7766
+ if (item.aborted) {
7767
+ var _item$reject;
7768
+ (_item$reject = item.reject) === null || _item$reject === undefined || _item$reject.call(item, /* @__PURE__ */ new Error("Aborted"));
7769
+ index++;
7770
+ continue;
7771
+ }
7772
+ let isValid;
7773
+ try {
7774
+ isValid = batchLoader.validate(lastGroup.concat(item).map((it) => it.key));
7775
+ } catch (cause) {
7776
+ var _item$reject2;
7777
+ (_item$reject2 = item.reject) === null || _item$reject2 === undefined || _item$reject2.call(item, cause);
7778
+ index++;
7779
+ continue;
7780
+ }
7781
+ if (isValid) {
7782
+ lastGroup.push(item);
7783
+ index++;
7784
+ continue;
7785
+ }
7786
+ if (lastGroup.length === 0) {
7787
+ var _item$reject3;
7788
+ (_item$reject3 = item.reject) === null || _item$reject3 === undefined || _item$reject3.call(item, /* @__PURE__ */ new Error("Input is too big for a single dispatch"));
7789
+ index++;
7790
+ continue;
7791
+ }
7792
+ groupedItems.push([]);
7793
+ }
7794
+ return groupedItems;
7795
+ }
7796
+ function dispatch() {
7797
+ const groupedItems = groupItems(pendingItems);
7798
+ destroyTimerAndPendingItems();
7799
+ for (const items of groupedItems) {
7800
+ if (!items.length)
7801
+ continue;
7802
+ const batch = { items };
7803
+ for (const item of items)
7804
+ item.batch = batch;
7805
+ batchLoader.fetch(batch.items.map((_item) => _item.key)).then(async (result) => {
7806
+ await Promise.all(result.map(async (valueOrPromise, index) => {
7807
+ const item = batch.items[index];
7808
+ try {
7809
+ var _item$resolve;
7810
+ const value = await Promise.resolve(valueOrPromise);
7811
+ (_item$resolve = item.resolve) === null || _item$resolve === undefined || _item$resolve.call(item, value);
7812
+ } catch (cause) {
7813
+ var _item$reject4;
7814
+ (_item$reject4 = item.reject) === null || _item$reject4 === undefined || _item$reject4.call(item, cause);
7815
+ }
7816
+ item.batch = null;
7817
+ item.reject = null;
7818
+ item.resolve = null;
7819
+ }));
7820
+ for (const item of batch.items) {
7821
+ var _item$reject5;
7822
+ (_item$reject5 = item.reject) === null || _item$reject5 === undefined || _item$reject5.call(item, /* @__PURE__ */ new Error("Missing result"));
7823
+ item.batch = null;
7824
+ }
7825
+ }).catch((cause) => {
7826
+ for (const item of batch.items) {
7827
+ var _item$reject6;
7828
+ (_item$reject6 = item.reject) === null || _item$reject6 === undefined || _item$reject6.call(item, cause);
7829
+ item.batch = null;
7830
+ }
7831
+ });
7832
+ }
7833
+ }
7834
+ function load(key) {
7835
+ var _dispatchTimer;
7836
+ const item = {
7837
+ aborted: false,
7838
+ key,
7839
+ batch: null,
7840
+ resolve: throwFatalError,
7841
+ reject: throwFatalError
7842
+ };
7843
+ const promise = new Promise((resolve, reject) => {
7844
+ var _pendingItems;
7845
+ item.reject = reject;
7846
+ item.resolve = resolve;
7847
+ (_pendingItems = pendingItems) !== null && _pendingItems !== undefined || (pendingItems = []);
7848
+ pendingItems.push(item);
7849
+ });
7850
+ (_dispatchTimer = dispatchTimer) !== null && _dispatchTimer !== undefined || (dispatchTimer = setTimeout(dispatch));
7851
+ return promise;
7852
+ }
7853
+ return { load };
7854
+ }
7855
+ function httpBatchLink(opts) {
7856
+ var _opts$maxURLLength, _opts$maxItems;
7857
+ const resolvedOpts = resolveHTTPLinkOptions(opts);
7858
+ const maxURLLength = (_opts$maxURLLength = opts.maxURLLength) !== null && _opts$maxURLLength !== undefined ? _opts$maxURLLength : Infinity;
7859
+ const maxItems = (_opts$maxItems = opts.maxItems) !== null && _opts$maxItems !== undefined ? _opts$maxItems : Infinity;
7860
+ return () => {
7861
+ const batchLoader = (type) => {
7862
+ return {
7863
+ validate(batchOps) {
7864
+ if (maxURLLength === Infinity && maxItems === Infinity)
7865
+ return true;
7866
+ if (batchOps.length > maxItems)
7867
+ return false;
7868
+ const path = batchOps.map((op) => op.path).join(",");
7869
+ const inputs = batchOps.map((op) => op.input);
7870
+ return getUrl(_objectSpread2(_objectSpread2({}, resolvedOpts), {}, {
7871
+ type,
7872
+ path,
7873
+ inputs,
7874
+ signal: null
7875
+ })).length <= maxURLLength;
7876
+ },
7877
+ async fetch(batchOps) {
7878
+ const path = batchOps.map((op) => op.path).join(",");
7879
+ const inputs = batchOps.map((op) => op.input);
7880
+ const signal = allAbortSignals(...batchOps.map((op) => op.signal));
7881
+ const res = await jsonHttpRequester(_objectSpread2(_objectSpread2({}, resolvedOpts), {}, {
7882
+ path,
7883
+ inputs,
7884
+ type,
7885
+ headers() {
7886
+ if (!opts.headers)
7887
+ return {};
7888
+ if (typeof opts.headers === "function")
7889
+ return opts.headers({ opList: batchOps });
7890
+ return opts.headers;
7891
+ },
7892
+ signal
7893
+ }));
7894
+ return (Array.isArray(res.json) ? res.json : batchOps.map(() => res.json)).map((item) => ({
7895
+ meta: res.meta,
7896
+ json: item
7897
+ }));
7898
+ }
7899
+ };
7900
+ };
7901
+ const loaders = {
7902
+ query: dataLoader(batchLoader("query")),
7903
+ mutation: dataLoader(batchLoader("mutation"))
7904
+ };
7905
+ return ({ op }) => {
7906
+ return observable((observer) => {
7907
+ if (op.type === "subscription")
7908
+ throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");
7909
+ const ac = new AbortController;
7910
+ const { signal, cleanup } = raceAbortSignalsWithCleanup(op.signal, ac.signal);
7911
+ const promise = loaders[op.type].load(_objectSpread2(_objectSpread2({}, op), {}, { signal }));
7912
+ let isDone = false;
7913
+ let _res = undefined;
7914
+ promise.then((res) => {
7915
+ isDone = true;
7916
+ _res = res;
7917
+ const transformed = transformResult(res.json, resolvedOpts.transformer.output);
7918
+ if (!transformed.ok) {
7919
+ observer.error(TRPCClientError.from(transformed.error, { meta: res.meta }));
7920
+ return;
7921
+ }
7922
+ observer.next({
7923
+ context: res.meta,
7924
+ result: transformed.result
7925
+ });
7926
+ observer.complete();
7927
+ }).catch((err) => {
7928
+ isDone = true;
7929
+ observer.error(TRPCClientError.from(err, { meta: _res === null || _res === undefined ? undefined : _res.meta }));
7930
+ });
7931
+ return () => {
7932
+ if (!isDone)
7933
+ ac.abort();
7934
+ cleanup();
7935
+ };
7936
+ });
7937
+ };
7938
+ };
7939
+ }
7940
+
7941
+ // ../../../node_modules/.bun/@trpc+client@11.24.0+1bcc723bc4c4f345/node_modules/@trpc/client/dist/wsLink-BTxcQ23Z.mjs
7942
+ var resultOf = (value, ...args) => {
7943
+ return typeof value === "function" ? value(...args) : value;
7944
+ };
7945
+ function withResolvers() {
7946
+ let resolve;
7947
+ let reject;
7948
+ return {
7949
+ promise: new Promise((res, rej) => {
7950
+ resolve = res;
7951
+ reject = rej;
7952
+ }),
7953
+ resolve,
7954
+ reject
7955
+ };
7956
+ }
7957
+ async function prepareUrl(urlOptions) {
7958
+ const url = await resultOf(urlOptions.url);
7959
+ if (!urlOptions.connectionParams)
7960
+ return url;
7961
+ return url + `${url.includes("?") ? "&" : "?"}connectionParams=1`;
7962
+ }
7963
+ async function buildConnectionMessage(connectionParams, encoder) {
7964
+ const message = {
7965
+ method: "connectionParams",
7966
+ data: await resultOf(connectionParams)
7967
+ };
7968
+ return encoder.encode(message);
7969
+ }
7970
+ function asyncWsOpen(ws) {
7971
+ const { promise, resolve, reject } = withResolvers();
7972
+ ws.addEventListener("open", () => {
7973
+ ws.removeEventListener("error", reject);
7974
+ resolve();
7975
+ });
7976
+ ws.addEventListener("error", reject);
7977
+ return promise;
7978
+ }
7979
+ function setupPingInterval(ws, { intervalMs, pongTimeoutMs }) {
7980
+ let pingTimeout;
7981
+ let pongTimeout;
7982
+ function start() {
7983
+ pingTimeout = setTimeout(() => {
7984
+ ws.send("PING");
7985
+ pongTimeout = setTimeout(() => {
7986
+ ws.close();
7987
+ }, pongTimeoutMs);
7988
+ }, intervalMs);
7989
+ }
7990
+ function reset() {
7991
+ clearTimeout(pingTimeout);
7992
+ start();
7993
+ }
7994
+ function pong() {
7995
+ clearTimeout(pongTimeout);
7996
+ reset();
7997
+ }
7998
+ ws.addEventListener("open", start);
7999
+ ws.addEventListener("message", ({ data }) => {
8000
+ clearTimeout(pingTimeout);
8001
+ start();
8002
+ if (data === "PONG")
8003
+ pong();
8004
+ });
8005
+ ws.addEventListener("close", () => {
8006
+ clearTimeout(pingTimeout);
8007
+ clearTimeout(pongTimeout);
8008
+ });
8009
+ }
8010
+ var WsConnection = class WsConnection {
8011
+ constructor(opts) {
8012
+ var _opts$WebSocketPonyfi;
8013
+ _defineProperty(this, "id", ++WsConnection.connectCount);
8014
+ _defineProperty(this, "WebSocketPonyfill", undefined);
8015
+ _defineProperty(this, "urlOptions", undefined);
8016
+ _defineProperty(this, "keepAliveOpts", undefined);
8017
+ _defineProperty(this, "encoder", undefined);
8018
+ _defineProperty(this, "wsObservable", behaviorSubject(null));
8019
+ _defineProperty(this, "openPromise", null);
8020
+ this.WebSocketPonyfill = (_opts$WebSocketPonyfi = opts.WebSocketPonyfill) !== null && _opts$WebSocketPonyfi !== undefined ? _opts$WebSocketPonyfi : WebSocket;
8021
+ if (!this.WebSocketPonyfill)
8022
+ throw new Error("No WebSocket implementation found - you probably don't want to use this on the server, but if you do you need to pass a `WebSocket`-ponyfill");
8023
+ this.urlOptions = opts.urlOptions;
8024
+ this.keepAliveOpts = opts.keepAlive;
8025
+ this.encoder = opts.encoder;
8026
+ }
8027
+ get ws() {
8028
+ return this.wsObservable.get();
8029
+ }
8030
+ set ws(ws) {
8031
+ this.wsObservable.next(ws);
8032
+ }
8033
+ isOpen() {
8034
+ return !!this.ws && this.ws.readyState === this.WebSocketPonyfill.OPEN && !this.openPromise;
8035
+ }
8036
+ isClosed() {
8037
+ return !!this.ws && (this.ws.readyState === this.WebSocketPonyfill.CLOSING || this.ws.readyState === this.WebSocketPonyfill.CLOSED);
8038
+ }
8039
+ async open() {
8040
+ if (this.openPromise)
8041
+ return this.openPromise;
8042
+ this.id = ++WsConnection.connectCount;
8043
+ const wsPromise = prepareUrl(this.urlOptions).then((url) => new this.WebSocketPonyfill(url));
8044
+ this.openPromise = wsPromise.then(async (ws) => {
8045
+ this.ws = ws;
8046
+ ws.binaryType = "arraybuffer";
8047
+ ws.addEventListener("message", function({ data }) {
8048
+ if (data === "PING")
8049
+ this.send("PONG");
8050
+ });
8051
+ if (this.keepAliveOpts.enabled)
8052
+ setupPingInterval(ws, this.keepAliveOpts);
8053
+ ws.addEventListener("close", () => {
8054
+ if (this.ws === ws)
8055
+ this.ws = null;
8056
+ });
8057
+ await asyncWsOpen(ws);
8058
+ if (this.urlOptions.connectionParams)
8059
+ ws.send(await buildConnectionMessage(this.urlOptions.connectionParams, this.encoder));
8060
+ });
8061
+ try {
8062
+ await this.openPromise;
8063
+ } finally {
8064
+ this.openPromise = null;
8065
+ }
8066
+ }
8067
+ async close() {
8068
+ try {
8069
+ await this.openPromise;
8070
+ } finally {
8071
+ var _this$ws;
8072
+ (_this$ws = this.ws) === null || _this$ws === undefined || _this$ws.close();
8073
+ }
8074
+ }
8075
+ };
8076
+ _defineProperty(WsConnection, "connectCount", 0);
8077
+
8078
+ // ../../../node_modules/.bun/@trpc+client@11.24.0+1bcc723bc4c4f345/node_modules/@trpc/client/dist/index.mjs
8079
+ var TRPCUntypedClient = class {
8080
+ constructor(opts) {
8081
+ _defineProperty(this, "links", undefined);
8082
+ _defineProperty(this, "runtime", undefined);
8083
+ _defineProperty(this, "requestId", undefined);
8084
+ this.requestId = 0;
8085
+ this.runtime = {};
8086
+ this.links = opts.links.map((link) => link(this.runtime));
8087
+ }
8088
+ $request(opts) {
8089
+ var _opts$context;
8090
+ return createChain({
8091
+ links: this.links,
8092
+ op: _objectSpread2(_objectSpread2({}, opts), {}, {
8093
+ context: (_opts$context = opts.context) !== null && _opts$context !== undefined ? _opts$context : {},
8094
+ id: ++this.requestId
8095
+ })
8096
+ }).pipe(share());
8097
+ }
8098
+ async requestAsPromise(opts) {
8099
+ try {
8100
+ const req$ = this.$request(opts);
8101
+ return (await observableToPromise(req$)).result.data;
8102
+ } catch (err) {
8103
+ throw TRPCClientError.from(err);
8104
+ }
8105
+ }
8106
+ query(path, input, opts) {
8107
+ return this.requestAsPromise({
8108
+ type: "query",
8109
+ path,
8110
+ input,
8111
+ context: opts === null || opts === undefined ? undefined : opts.context,
8112
+ signal: opts === null || opts === undefined ? undefined : opts.signal
8113
+ });
8114
+ }
8115
+ mutation(path, input, opts) {
8116
+ return this.requestAsPromise({
8117
+ type: "mutation",
8118
+ path,
8119
+ input,
8120
+ context: opts === null || opts === undefined ? undefined : opts.context,
8121
+ signal: opts === null || opts === undefined ? undefined : opts.signal
8122
+ });
8123
+ }
8124
+ subscription(path, input, opts) {
8125
+ return this.$request({
8126
+ type: "subscription",
8127
+ path,
8128
+ input,
8129
+ context: opts.context,
8130
+ signal: opts.signal
8131
+ }).subscribe({
8132
+ next(envelope) {
8133
+ switch (envelope.result.type) {
8134
+ case "state":
8135
+ var _opts$onConnectionSta;
8136
+ (_opts$onConnectionSta = opts.onConnectionStateChange) === null || _opts$onConnectionSta === undefined || _opts$onConnectionSta.call(opts, envelope.result);
8137
+ break;
8138
+ case "started":
8139
+ var _opts$onStarted;
8140
+ (_opts$onStarted = opts.onStarted) === null || _opts$onStarted === undefined || _opts$onStarted.call(opts, { context: envelope.context });
8141
+ break;
8142
+ case "stopped":
8143
+ var _opts$onStopped;
8144
+ (_opts$onStopped = opts.onStopped) === null || _opts$onStopped === undefined || _opts$onStopped.call(opts);
8145
+ break;
8146
+ case "data":
8147
+ case undefined:
8148
+ var _opts$onData;
8149
+ (_opts$onData = opts.onData) === null || _opts$onData === undefined || _opts$onData.call(opts, envelope.result.data);
8150
+ }
8151
+ },
8152
+ error(err) {
8153
+ var _opts$onError;
8154
+ (_opts$onError = opts.onError) === null || _opts$onError === undefined || _opts$onError.call(opts, err);
8155
+ },
8156
+ complete() {
8157
+ var _opts$onComplete;
8158
+ (_opts$onComplete = opts.onComplete) === null || _opts$onComplete === undefined || _opts$onComplete.call(opts);
8159
+ }
8160
+ });
8161
+ }
8162
+ };
8163
+ var untypedClientSymbol = Symbol.for("trpc_untypedClient");
8164
+ var clientCallTypeMap = {
8165
+ query: "query",
8166
+ mutate: "mutation",
8167
+ subscribe: "subscription"
8168
+ };
8169
+ var clientCallTypeToProcedureType = (clientCallType) => {
8170
+ return clientCallTypeMap[clientCallType];
8171
+ };
8172
+ function createTRPCClientProxy(client) {
8173
+ const proxy = createRecursiveProxy(({ path, args }) => {
8174
+ const pathCopy = [...path];
8175
+ const procedureType = clientCallTypeToProcedureType(pathCopy.pop());
8176
+ const fullPath = pathCopy.join(".");
8177
+ return client[procedureType](fullPath, ...args);
8178
+ });
8179
+ return createFlatProxy((key) => {
8180
+ if (key === untypedClientSymbol)
8181
+ return client;
8182
+ return proxy[key];
8183
+ });
8184
+ }
8185
+ function createTRPCClient(opts) {
8186
+ return createTRPCClientProxy(new TRPCUntypedClient(opts));
8187
+ }
8188
+ function _OverloadYield2(e, d) {
8189
+ this.v = e, this.k = d;
8190
+ }
8191
+ function AsyncGenerator2(e) {
8192
+ var r, t;
8193
+ function resume(r, t) {
8194
+ try {
8195
+ var n = e[r](t), o = n.value, u = o instanceof _OverloadYield2;
8196
+ Promise.resolve(u ? o.v : o).then(function(t) {
8197
+ if (u) {
8198
+ var i = r === "return" ? "return" : "next";
8199
+ if (!o.k || t.done)
8200
+ return resume(i, t);
8201
+ t = e[i](t).value;
8202
+ }
8203
+ settle(n.done ? "return" : "normal", t);
8204
+ }, function(e) {
8205
+ resume("throw", e);
8206
+ });
8207
+ } catch (e) {
8208
+ settle("throw", e);
8209
+ }
8210
+ }
8211
+ function settle(e, n) {
8212
+ switch (e) {
8213
+ case "return":
8214
+ r.resolve({
8215
+ value: n,
8216
+ done: true
8217
+ });
8218
+ break;
8219
+ case "throw":
8220
+ r.reject(n);
8221
+ break;
8222
+ default:
8223
+ r.resolve({
8224
+ value: n,
8225
+ done: false
8226
+ });
8227
+ }
8228
+ (r = r.next) ? resume(r.key, r.arg) : t = null;
8229
+ }
8230
+ this._invoke = function(e, n) {
8231
+ return new Promise(function(o, u) {
8232
+ var i = {
8233
+ key: e,
8234
+ arg: n,
8235
+ resolve: o,
8236
+ reject: u,
8237
+ next: null
8238
+ };
8239
+ t ? t = t.next = i : (r = t = i, resume(e, n));
8240
+ });
8241
+ }, typeof e["return"] != "function" && (this["return"] = undefined);
8242
+ }
8243
+ AsyncGenerator2.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
8244
+ return this;
8245
+ }, AsyncGenerator2.prototype.next = function(e) {
8246
+ return this._invoke("next", e);
8247
+ }, AsyncGenerator2.prototype["throw"] = function(e) {
8248
+ return this._invoke("throw", e);
8249
+ }, AsyncGenerator2.prototype["return"] = function(e) {
8250
+ return this._invoke("return", e);
8251
+ };
8252
+
7002
8253
  // src/api-client.ts
7003
- import {
7004
- createTRPCProxyClient,
7005
- httpBatchLink
7006
- } from "@trpc/client";
7007
8254
  import SuperJSON from "superjson";
7008
8255
 
7009
8256
  // src/config.ts
@@ -7032,7 +8279,7 @@ var normalizeApiBaseUrl = (value) => {
7032
8279
  };
7033
8280
 
7034
8281
  // src/api-client.ts
7035
- var createEventTechClient = (apiBaseUrl, readAccessToken, fetchImplementation = fetch) => createTRPCProxyClient({
8282
+ var createEventTechClient = (apiBaseUrl, readAccessToken, fetchImplementation = fetch) => createTRPCClient({
7036
8283
  links: [
7037
8284
  httpBatchLink({
7038
8285
  url: `${apiBaseUrl}/api/trpc`,
@@ -7045,7 +8292,7 @@ var createEventTechClient = (apiBaseUrl, readAccessToken, fetchImplementation =
7045
8292
  })
7046
8293
  ]
7047
8294
  });
7048
- var createEventTechPublicClient = (apiBaseUrl, fetchImplementation = fetch) => createTRPCProxyClient({
8295
+ var createEventTechPublicClient = (apiBaseUrl, fetchImplementation = fetch) => createTRPCClient({
7049
8296
  links: [
7050
8297
  httpBatchLink({
7051
8298
  url: `${apiBaseUrl}/api/trpc`,
@@ -7356,7 +8603,8 @@ Event Passport:
7356
8603
 
7357
8604
  Organization and event setup:
7358
8605
  organization create is global-admin only. It provisions the org and emails an owner invitation
7359
- to --owner-email; deliveryStatus reports whether that email was sent. Names must be unique.
8606
+ to --owner-email after it is saved; deliveryStatus (sent/failed) and
8607
+ ownerInvitation.emailDeliveryStatus report the outcome. Names must be unique.
7360
8608
  event create needs org owner/admin (or global admin). --type is an active event type such as
7361
8609
  LUCKY_DRAW; a LUCKY_DRAW event gets its board with default config automatically.
7362
8610
  --start/--end are ISO 8601 date-times with an offset, for example 2026-11-20T18:00:00+08:00.
@@ -8362,7 +9610,7 @@ var command_manifest_default = [
8362
9610
  path: ["organization", "member", "list"],
8363
9611
  procedure: "organization.getOrganizationMembersById",
8364
9612
  operation: "query",
8365
- summary: "List an organization's members and pending invitations (paged).",
9613
+ summary: "List an organization's members and pending invitations (paged), with each invitation's stored emailDeliveryStatus.",
8366
9614
  effects: [],
8367
9615
  dates: [],
8368
9616
  input: {
@@ -8412,7 +9660,7 @@ var command_manifest_default = [
8412
9660
  path: ["organization", "member", "invite"],
8413
9661
  procedure: "organization.createOrganizationMember",
8414
9662
  operation: "mutation",
8415
- summary: "Invite a member to an organization and email the invitation.",
9663
+ summary: "Invite a member to an organization and email the invitation; reports deliveryStatus and the stored emailDeliveryStatus.",
8416
9664
  effects: ["state-change", "email"],
8417
9665
  target: "email",
8418
9666
  dates: [],
@@ -8437,6 +9685,29 @@ var command_manifest_default = [
8437
9685
  required: ["email", "organizationId"]
8438
9686
  }
8439
9687
  },
9688
+ {
9689
+ path: ["organization", "member", "invitation-resend"],
9690
+ procedure: "organization.resendOrganizationMemberInvitation",
9691
+ operation: "mutation",
9692
+ summary: "Resend the invitation email to a pending legacy (policy v1) member; reports deliveryStatus and the stored emailDeliveryStatus.",
9693
+ effects: ["state-change", "email"],
9694
+ target: "memberId",
9695
+ dates: [],
9696
+ input: {
9697
+ type: "object",
9698
+ properties: {
9699
+ organizationId: {
9700
+ type: "string",
9701
+ minLength: 1
9702
+ },
9703
+ memberId: {
9704
+ type: "string",
9705
+ minLength: 1
9706
+ }
9707
+ },
9708
+ required: ["organizationId", "memberId"]
9709
+ }
9710
+ },
8440
9711
  {
8441
9712
  path: ["organization", "member", "remove"],
8442
9713
  procedure: "organization.deleteOrganizationMember",
@@ -8659,7 +9930,7 @@ var command_manifest_default = [
8659
9930
  path: ["organization", "invitation", "resend"],
8660
9931
  procedure: "organization.resendInvitation",
8661
9932
  operation: "mutation",
8662
- summary: "Resend a pending organization invitation email.",
9933
+ summary: "Replace a pending organization invitation and email it; reports deliveryStatus and the stored emailDeliveryStatus.",
8663
9934
  effects: ["state-change", "email"],
8664
9935
  target: "invitationId",
8665
9936
  dates: [],
@@ -9049,10 +10320,137 @@ var command_manifest_default = [
9049
10320
  path: ["admin", "member", "list"],
9050
10321
  procedure: "admin.member.getAllMembers",
9051
10322
  operation: "query",
9052
- summary: "List organization members across every organization as a global admin.",
10323
+ summary: "List organization members across every organization (paged; filter by search, organizationId, role, status, joinedFrom/joinedTo).",
9053
10324
  effects: [],
9054
- dates: [],
9055
- input: null
10325
+ dates: ["joinedFrom", "joinedTo"],
10326
+ input: {
10327
+ type: "object",
10328
+ properties: {
10329
+ search: {
10330
+ type: "string",
10331
+ maxLength: 200
10332
+ },
10333
+ organizationId: {
10334
+ type: "string",
10335
+ minLength: 1
10336
+ },
10337
+ role: {
10338
+ type: "string",
10339
+ enum: ["OWNER", "ADMIN", "MEMBER"]
10340
+ },
10341
+ status: {
10342
+ type: "string",
10343
+ enum: ["PENDING", "ACTIVE", "LEFT", "REMOVED", "REJECTED"]
10344
+ },
10345
+ joinedFrom: {
10346
+ type: "string",
10347
+ format: "date-time"
10348
+ },
10349
+ joinedTo: {
10350
+ type: "string",
10351
+ format: "date-time"
10352
+ },
10353
+ limit: {
10354
+ default: 25,
10355
+ type: "integer",
10356
+ minimum: 1,
10357
+ maximum: 100
10358
+ },
10359
+ cursor: {
10360
+ anyOf: [
10361
+ {
10362
+ type: "string",
10363
+ minLength: 1,
10364
+ maxLength: 2048
10365
+ },
10366
+ {
10367
+ type: "null"
10368
+ }
10369
+ ]
10370
+ },
10371
+ direction: {
10372
+ type: "string",
10373
+ const: "forward"
10374
+ }
10375
+ },
10376
+ additionalProperties: false
10377
+ }
10378
+ },
10379
+ {
10380
+ path: ["admin", "member", "count"],
10381
+ procedure: "admin.member.getMemberCounts",
10382
+ operation: "query",
10383
+ summary: "Count members matching the list filters, with role and status splits.",
10384
+ effects: [],
10385
+ dates: ["joinedFrom", "joinedTo"],
10386
+ input: {
10387
+ type: "object",
10388
+ properties: {
10389
+ search: {
10390
+ type: "string",
10391
+ maxLength: 200
10392
+ },
10393
+ organizationId: {
10394
+ type: "string",
10395
+ minLength: 1
10396
+ },
10397
+ role: {
10398
+ type: "string",
10399
+ enum: ["OWNER", "ADMIN", "MEMBER"]
10400
+ },
10401
+ status: {
10402
+ type: "string",
10403
+ enum: ["PENDING", "ACTIVE", "LEFT", "REMOVED", "REJECTED"]
10404
+ },
10405
+ joinedFrom: {
10406
+ type: "string",
10407
+ format: "date-time"
10408
+ },
10409
+ joinedTo: {
10410
+ type: "string",
10411
+ format: "date-time"
10412
+ }
10413
+ },
10414
+ additionalProperties: false
10415
+ }
10416
+ },
10417
+ {
10418
+ path: ["admin", "member", "export"],
10419
+ procedure: "admin.member.exportMembers",
10420
+ operation: "query",
10421
+ summary: "Export every member matching the list filters (fails above 5,000 rows).",
10422
+ effects: [],
10423
+ dates: ["joinedFrom", "joinedTo"],
10424
+ input: {
10425
+ type: "object",
10426
+ properties: {
10427
+ search: {
10428
+ type: "string",
10429
+ maxLength: 200
10430
+ },
10431
+ organizationId: {
10432
+ type: "string",
10433
+ minLength: 1
10434
+ },
10435
+ role: {
10436
+ type: "string",
10437
+ enum: ["OWNER", "ADMIN", "MEMBER"]
10438
+ },
10439
+ status: {
10440
+ type: "string",
10441
+ enum: ["PENDING", "ACTIVE", "LEFT", "REMOVED", "REJECTED"]
10442
+ },
10443
+ joinedFrom: {
10444
+ type: "string",
10445
+ format: "date-time"
10446
+ },
10447
+ joinedTo: {
10448
+ type: "string",
10449
+ format: "date-time"
10450
+ }
10451
+ },
10452
+ additionalProperties: false
10453
+ }
9056
10454
  },
9057
10455
  {
9058
10456
  path: ["admin", "member", "role-update"],
@@ -9108,10 +10506,161 @@ var command_manifest_default = [
9108
10506
  path: ["admin", "activity", "list"],
9109
10507
  procedure: "admin.activity.getAll",
9110
10508
  operation: "query",
9111
- summary: "List platform activity as a global admin.",
10509
+ summary: "List organization and member activity-log events (paged; filter by search, organizationId, eventType, from/to).",
9112
10510
  effects: [],
9113
- dates: [],
9114
- input: null
10511
+ dates: ["from", "to"],
10512
+ input: {
10513
+ type: "object",
10514
+ properties: {
10515
+ search: {
10516
+ type: "string",
10517
+ maxLength: 200
10518
+ },
10519
+ organizationId: {
10520
+ type: "string",
10521
+ minLength: 1
10522
+ },
10523
+ eventType: {
10524
+ type: "string",
10525
+ enum: [
10526
+ "organization_provisioned",
10527
+ "organization_updated",
10528
+ "organization_archived",
10529
+ "organization_restored",
10530
+ "member_invited",
10531
+ "member_joined",
10532
+ "member_role_changed",
10533
+ "member_invitation_rejected",
10534
+ "member_left",
10535
+ "member_removed",
10536
+ "ownership_transferred"
10537
+ ]
10538
+ },
10539
+ from: {
10540
+ type: "string",
10541
+ format: "date-time"
10542
+ },
10543
+ to: {
10544
+ type: "string",
10545
+ format: "date-time"
10546
+ },
10547
+ limit: {
10548
+ default: 25,
10549
+ type: "integer",
10550
+ minimum: 1,
10551
+ maximum: 100
10552
+ },
10553
+ cursor: {
10554
+ anyOf: [
10555
+ {
10556
+ type: "string",
10557
+ minLength: 1,
10558
+ maxLength: 2048
10559
+ },
10560
+ {
10561
+ type: "null"
10562
+ }
10563
+ ]
10564
+ },
10565
+ direction: {
10566
+ type: "string",
10567
+ const: "forward"
10568
+ }
10569
+ },
10570
+ additionalProperties: false
10571
+ }
10572
+ },
10573
+ {
10574
+ path: ["admin", "activity", "count"],
10575
+ procedure: "admin.activity.getCounts",
10576
+ operation: "query",
10577
+ summary: "Count activity matching the filters, with 30-day daily and type splits.",
10578
+ effects: [],
10579
+ dates: ["from", "to"],
10580
+ input: {
10581
+ type: "object",
10582
+ properties: {
10583
+ search: {
10584
+ type: "string",
10585
+ maxLength: 200
10586
+ },
10587
+ organizationId: {
10588
+ type: "string",
10589
+ minLength: 1
10590
+ },
10591
+ eventType: {
10592
+ type: "string",
10593
+ enum: [
10594
+ "organization_provisioned",
10595
+ "organization_updated",
10596
+ "organization_archived",
10597
+ "organization_restored",
10598
+ "member_invited",
10599
+ "member_joined",
10600
+ "member_role_changed",
10601
+ "member_invitation_rejected",
10602
+ "member_left",
10603
+ "member_removed",
10604
+ "ownership_transferred"
10605
+ ]
10606
+ },
10607
+ from: {
10608
+ type: "string",
10609
+ format: "date-time"
10610
+ },
10611
+ to: {
10612
+ type: "string",
10613
+ format: "date-time"
10614
+ }
10615
+ },
10616
+ additionalProperties: false
10617
+ }
10618
+ },
10619
+ {
10620
+ path: ["admin", "activity", "export"],
10621
+ procedure: "admin.activity.export",
10622
+ operation: "query",
10623
+ summary: "Export every activity event matching the filters (fails above 5,000 rows).",
10624
+ effects: [],
10625
+ dates: ["from", "to"],
10626
+ input: {
10627
+ type: "object",
10628
+ properties: {
10629
+ search: {
10630
+ type: "string",
10631
+ maxLength: 200
10632
+ },
10633
+ organizationId: {
10634
+ type: "string",
10635
+ minLength: 1
10636
+ },
10637
+ eventType: {
10638
+ type: "string",
10639
+ enum: [
10640
+ "organization_provisioned",
10641
+ "organization_updated",
10642
+ "organization_archived",
10643
+ "organization_restored",
10644
+ "member_invited",
10645
+ "member_joined",
10646
+ "member_role_changed",
10647
+ "member_invitation_rejected",
10648
+ "member_left",
10649
+ "member_removed",
10650
+ "ownership_transferred"
10651
+ ]
10652
+ },
10653
+ from: {
10654
+ type: "string",
10655
+ format: "date-time"
10656
+ },
10657
+ to: {
10658
+ type: "string",
10659
+ format: "date-time"
10660
+ }
10661
+ },
10662
+ additionalProperties: false
10663
+ }
9115
10664
  },
9116
10665
  {
9117
10666
  path: ["admin", "dashboard", "event-analytics"],
@@ -9126,10 +10675,41 @@ var command_manifest_default = [
9126
10675
  path: ["admin", "user", "list"],
9127
10676
  procedure: "admin.user.getUsers",
9128
10677
  operation: "query",
9129
- summary: "List users as a global admin.",
10678
+ summary: "List users A to Z by name (paged; filter by search).",
9130
10679
  effects: [],
9131
10680
  dates: [],
9132
- input: null
10681
+ input: {
10682
+ type: "object",
10683
+ properties: {
10684
+ search: {
10685
+ type: "string",
10686
+ maxLength: 200
10687
+ },
10688
+ limit: {
10689
+ default: 25,
10690
+ type: "integer",
10691
+ minimum: 1,
10692
+ maximum: 100
10693
+ },
10694
+ cursor: {
10695
+ anyOf: [
10696
+ {
10697
+ type: "string",
10698
+ minLength: 1,
10699
+ maxLength: 2048
10700
+ },
10701
+ {
10702
+ type: "null"
10703
+ }
10704
+ ]
10705
+ },
10706
+ direction: {
10707
+ type: "string",
10708
+ const: "forward"
10709
+ }
10710
+ },
10711
+ additionalProperties: false
10712
+ }
9133
10713
  },
9134
10714
  {
9135
10715
  path: ["admin", "user", "get"],
@@ -9201,7 +10781,7 @@ var command_manifest_default = [
9201
10781
  path: ["event", "access", "list"],
9202
10782
  procedure: "access.listEventAssignments",
9203
10783
  operation: "query",
9204
- summary: "List event staff assignments and pending staff invitations.",
10784
+ summary: "List event staff assignments and pending staff invitations, with each invitation's stored emailDeliveryStatus.",
9205
10785
  effects: [],
9206
10786
  dates: [],
9207
10787
  input: {
@@ -9223,7 +10803,7 @@ var command_manifest_default = [
9223
10803
  path: ["event", "access", "invite"],
9224
10804
  procedure: "access.inviteEventStaff",
9225
10805
  operation: "mutation",
9226
- summary: "Invite event staff by email. startsAt/expiresAt are ISO date-times or null.",
10806
+ summary: "Invite event staff by email; reports deliveryStatus and the stored emailDeliveryStatus. startsAt/expiresAt are ISO date-times or null.",
9227
10807
  effects: ["state-change", "email"],
9228
10808
  target: "email",
9229
10809
  dates: ["expiresAt", "startsAt"],
@@ -9279,7 +10859,7 @@ var command_manifest_default = [
9279
10859
  path: ["event", "access", "invitation-resend"],
9280
10860
  procedure: "access.resendEventStaffInvitation",
9281
10861
  operation: "mutation",
9282
- summary: "Resend a pending event staff invitation email.",
10862
+ summary: "Replace a pending event staff invitation and email it; reports deliveryStatus and the stored emailDeliveryStatus.",
9283
10863
  effects: ["state-change", "email"],
9284
10864
  target: "invitationId",
9285
10865
  dates: [],