yourskills 0.1.0 → 0.1.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +60 -0
- package/dist/main.js +1398 -17
- package/package.json +5 -9
package/dist/main.js
CHANGED
|
@@ -13,7 +13,7 @@ import { chmodSync, mkdirSync, rmSync } from "node:fs";
|
|
|
13
13
|
import { readFile, writeFile } from "node:fs/promises";
|
|
14
14
|
import { homedir } from "node:os";
|
|
15
15
|
import { join } from "node:path";
|
|
16
|
-
var DEFAULT_URL = "
|
|
16
|
+
var DEFAULT_URL = "https://api.yourskills.store";
|
|
17
17
|
function configDir() {
|
|
18
18
|
const xdg = process.env.XDG_CONFIG_HOME;
|
|
19
19
|
return join(xdg && xdg.length > 0 ? xdg : join(homedir(), ".config"), "yourskills");
|
|
@@ -2069,8 +2069,1395 @@ import { mkdirSync as mkdirSync3 } from "node:fs";
|
|
|
2069
2069
|
import { appendFile, readFile as readFile3, rm, stat, writeFile as writeFile2 } from "node:fs/promises";
|
|
2070
2070
|
import { join as join7 } from "node:path";
|
|
2071
2071
|
|
|
2072
|
+
// ../../node_modules/.bun/@trpc+client@11.18.0+acc6907a906fa511/node_modules/@trpc/client/dist/objectSpread2-BvkFp-_Y.mjs
|
|
2073
|
+
var __create = Object.create;
|
|
2074
|
+
var __defProp = Object.defineProperty;
|
|
2075
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
2076
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
2077
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
2078
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
2079
|
+
var __commonJS = (cb, mod) => function() {
|
|
2080
|
+
return mod || (0, cb[__getOwnPropNames(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
2081
|
+
};
|
|
2082
|
+
var __copyProps = (to, from, except, desc) => {
|
|
2083
|
+
if (from && typeof from === "object" || typeof from === "function")
|
|
2084
|
+
for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key;i < n; i++) {
|
|
2085
|
+
key = keys[i];
|
|
2086
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
2087
|
+
__defProp(to, key, {
|
|
2088
|
+
get: ((k) => from[k]).bind(null, key),
|
|
2089
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
2090
|
+
});
|
|
2091
|
+
}
|
|
2092
|
+
return to;
|
|
2093
|
+
};
|
|
2094
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
2095
|
+
value: mod,
|
|
2096
|
+
enumerable: true
|
|
2097
|
+
}) : target, mod));
|
|
2098
|
+
var require_typeof = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(exports, module) {
|
|
2099
|
+
function _typeof$2(o) {
|
|
2100
|
+
"@babel/helpers - typeof";
|
|
2101
|
+
return module.exports = _typeof$2 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o$1) {
|
|
2102
|
+
return typeof o$1;
|
|
2103
|
+
} : function(o$1) {
|
|
2104
|
+
return o$1 && typeof Symbol == "function" && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
2105
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof$2(o);
|
|
2106
|
+
}
|
|
2107
|
+
module.exports = _typeof$2, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
2108
|
+
} });
|
|
2109
|
+
var require_toPrimitive = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(exports, module) {
|
|
2110
|
+
var _typeof$1 = require_typeof()["default"];
|
|
2111
|
+
function toPrimitive$1(t, r) {
|
|
2112
|
+
if (_typeof$1(t) != "object" || !t)
|
|
2113
|
+
return t;
|
|
2114
|
+
var e = t[Symbol.toPrimitive];
|
|
2115
|
+
if (e !== undefined) {
|
|
2116
|
+
var i = e.call(t, r || "default");
|
|
2117
|
+
if (_typeof$1(i) != "object")
|
|
2118
|
+
return i;
|
|
2119
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2120
|
+
}
|
|
2121
|
+
return (r === "string" ? String : Number)(t);
|
|
2122
|
+
}
|
|
2123
|
+
module.exports = toPrimitive$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
2124
|
+
} });
|
|
2125
|
+
var require_toPropertyKey = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(exports, module) {
|
|
2126
|
+
var _typeof = require_typeof()["default"];
|
|
2127
|
+
var toPrimitive = require_toPrimitive();
|
|
2128
|
+
function toPropertyKey$1(t) {
|
|
2129
|
+
var i = toPrimitive(t, "string");
|
|
2130
|
+
return _typeof(i) == "symbol" ? i : i + "";
|
|
2131
|
+
}
|
|
2132
|
+
module.exports = toPropertyKey$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
2133
|
+
} });
|
|
2134
|
+
var require_defineProperty = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(exports, module) {
|
|
2135
|
+
var toPropertyKey = require_toPropertyKey();
|
|
2136
|
+
function _defineProperty(e, r, t) {
|
|
2137
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
2138
|
+
value: t,
|
|
2139
|
+
enumerable: true,
|
|
2140
|
+
configurable: true,
|
|
2141
|
+
writable: true
|
|
2142
|
+
}) : e[r] = t, e;
|
|
2143
|
+
}
|
|
2144
|
+
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
2145
|
+
} });
|
|
2146
|
+
var require_objectSpread2 = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(exports, module) {
|
|
2147
|
+
var defineProperty = require_defineProperty();
|
|
2148
|
+
function ownKeys(e, r) {
|
|
2149
|
+
var t = Object.keys(e);
|
|
2150
|
+
if (Object.getOwnPropertySymbols) {
|
|
2151
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
2152
|
+
r && (o = o.filter(function(r$1) {
|
|
2153
|
+
return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
|
|
2154
|
+
})), t.push.apply(t, o);
|
|
2155
|
+
}
|
|
2156
|
+
return t;
|
|
2157
|
+
}
|
|
2158
|
+
function _objectSpread2(e) {
|
|
2159
|
+
for (var r = 1;r < arguments.length; r++) {
|
|
2160
|
+
var t = arguments[r] != null ? arguments[r] : {};
|
|
2161
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r$1) {
|
|
2162
|
+
defineProperty(e, r$1, t[r$1]);
|
|
2163
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
|
|
2164
|
+
Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
|
|
2165
|
+
});
|
|
2166
|
+
}
|
|
2167
|
+
return e;
|
|
2168
|
+
}
|
|
2169
|
+
module.exports = _objectSpread2, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
2170
|
+
} });
|
|
2171
|
+
|
|
2172
|
+
// ../../node_modules/.bun/@trpc+server@11.18.0+7524df1edfed9f02/node_modules/@trpc/server/dist/observable-UMO3vUa_.mjs
|
|
2173
|
+
function observable(subscribe) {
|
|
2174
|
+
const self = {
|
|
2175
|
+
subscribe(observer) {
|
|
2176
|
+
let teardownRef = null;
|
|
2177
|
+
let isDone = false;
|
|
2178
|
+
let unsubscribed = false;
|
|
2179
|
+
let teardownImmediately = false;
|
|
2180
|
+
function unsubscribe() {
|
|
2181
|
+
if (teardownRef === null) {
|
|
2182
|
+
teardownImmediately = true;
|
|
2183
|
+
return;
|
|
2184
|
+
}
|
|
2185
|
+
if (unsubscribed)
|
|
2186
|
+
return;
|
|
2187
|
+
unsubscribed = true;
|
|
2188
|
+
if (typeof teardownRef === "function")
|
|
2189
|
+
teardownRef();
|
|
2190
|
+
else if (teardownRef)
|
|
2191
|
+
teardownRef.unsubscribe();
|
|
2192
|
+
}
|
|
2193
|
+
teardownRef = subscribe({
|
|
2194
|
+
next(value) {
|
|
2195
|
+
var _observer$next;
|
|
2196
|
+
if (isDone)
|
|
2197
|
+
return;
|
|
2198
|
+
(_observer$next = observer.next) === null || _observer$next === undefined || _observer$next.call(observer, value);
|
|
2199
|
+
},
|
|
2200
|
+
error(err) {
|
|
2201
|
+
var _observer$error;
|
|
2202
|
+
if (isDone)
|
|
2203
|
+
return;
|
|
2204
|
+
isDone = true;
|
|
2205
|
+
(_observer$error = observer.error) === null || _observer$error === undefined || _observer$error.call(observer, err);
|
|
2206
|
+
unsubscribe();
|
|
2207
|
+
},
|
|
2208
|
+
complete() {
|
|
2209
|
+
var _observer$complete;
|
|
2210
|
+
if (isDone)
|
|
2211
|
+
return;
|
|
2212
|
+
isDone = true;
|
|
2213
|
+
(_observer$complete = observer.complete) === null || _observer$complete === undefined || _observer$complete.call(observer);
|
|
2214
|
+
unsubscribe();
|
|
2215
|
+
}
|
|
2216
|
+
});
|
|
2217
|
+
if (teardownImmediately)
|
|
2218
|
+
unsubscribe();
|
|
2219
|
+
return { unsubscribe };
|
|
2220
|
+
},
|
|
2221
|
+
pipe(...operations) {
|
|
2222
|
+
return operations.reduce(pipeReducer, self);
|
|
2223
|
+
}
|
|
2224
|
+
};
|
|
2225
|
+
return self;
|
|
2226
|
+
}
|
|
2227
|
+
function pipeReducer(prev, fn) {
|
|
2228
|
+
return fn(prev);
|
|
2229
|
+
}
|
|
2230
|
+
function observableToPromise(observable$1) {
|
|
2231
|
+
const ac = new AbortController;
|
|
2232
|
+
const promise = new Promise((resolve3, reject) => {
|
|
2233
|
+
let isDone = false;
|
|
2234
|
+
function onDone() {
|
|
2235
|
+
if (isDone)
|
|
2236
|
+
return;
|
|
2237
|
+
isDone = true;
|
|
2238
|
+
obs$.unsubscribe();
|
|
2239
|
+
}
|
|
2240
|
+
ac.signal.addEventListener("abort", () => {
|
|
2241
|
+
reject(ac.signal.reason);
|
|
2242
|
+
});
|
|
2243
|
+
const obs$ = observable$1.subscribe({
|
|
2244
|
+
next(data) {
|
|
2245
|
+
isDone = true;
|
|
2246
|
+
resolve3(data);
|
|
2247
|
+
onDone();
|
|
2248
|
+
},
|
|
2249
|
+
error(data) {
|
|
2250
|
+
reject(data);
|
|
2251
|
+
},
|
|
2252
|
+
complete() {
|
|
2253
|
+
ac.abort();
|
|
2254
|
+
onDone();
|
|
2255
|
+
}
|
|
2256
|
+
});
|
|
2257
|
+
});
|
|
2258
|
+
return promise;
|
|
2259
|
+
}
|
|
2260
|
+
|
|
2261
|
+
// ../../node_modules/.bun/@trpc+server@11.18.0+7524df1edfed9f02/node_modules/@trpc/server/dist/observable-CUiPknO-.mjs
|
|
2262
|
+
function share(_opts) {
|
|
2263
|
+
return (source) => {
|
|
2264
|
+
let refCount = 0;
|
|
2265
|
+
let subscription = null;
|
|
2266
|
+
const observers = [];
|
|
2267
|
+
function startIfNeeded() {
|
|
2268
|
+
if (subscription)
|
|
2269
|
+
return;
|
|
2270
|
+
subscription = source.subscribe({
|
|
2271
|
+
next(value) {
|
|
2272
|
+
for (const observer of observers) {
|
|
2273
|
+
var _observer$next;
|
|
2274
|
+
(_observer$next = observer.next) === null || _observer$next === undefined || _observer$next.call(observer, value);
|
|
2275
|
+
}
|
|
2276
|
+
},
|
|
2277
|
+
error(error) {
|
|
2278
|
+
for (const observer of observers) {
|
|
2279
|
+
var _observer$error;
|
|
2280
|
+
(_observer$error = observer.error) === null || _observer$error === undefined || _observer$error.call(observer, error);
|
|
2281
|
+
}
|
|
2282
|
+
},
|
|
2283
|
+
complete() {
|
|
2284
|
+
for (const observer of observers) {
|
|
2285
|
+
var _observer$complete;
|
|
2286
|
+
(_observer$complete = observer.complete) === null || _observer$complete === undefined || _observer$complete.call(observer);
|
|
2287
|
+
}
|
|
2288
|
+
}
|
|
2289
|
+
});
|
|
2290
|
+
}
|
|
2291
|
+
function resetIfNeeded() {
|
|
2292
|
+
if (refCount === 0 && subscription) {
|
|
2293
|
+
const _sub = subscription;
|
|
2294
|
+
subscription = null;
|
|
2295
|
+
_sub.unsubscribe();
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
return observable((subscriber) => {
|
|
2299
|
+
refCount++;
|
|
2300
|
+
observers.push(subscriber);
|
|
2301
|
+
startIfNeeded();
|
|
2302
|
+
return { unsubscribe() {
|
|
2303
|
+
refCount--;
|
|
2304
|
+
resetIfNeeded();
|
|
2305
|
+
const index = observers.findIndex((v) => v === subscriber);
|
|
2306
|
+
if (index > -1)
|
|
2307
|
+
observers.splice(index, 1);
|
|
2308
|
+
} };
|
|
2309
|
+
});
|
|
2310
|
+
};
|
|
2311
|
+
}
|
|
2312
|
+
var distinctUnsetMarker = Symbol();
|
|
2313
|
+
function behaviorSubject(initialValue) {
|
|
2314
|
+
let value = initialValue;
|
|
2315
|
+
const observerList = [];
|
|
2316
|
+
const addObserver = (observer) => {
|
|
2317
|
+
if (value !== undefined)
|
|
2318
|
+
observer.next(value);
|
|
2319
|
+
observerList.push(observer);
|
|
2320
|
+
};
|
|
2321
|
+
const removeObserver = (observer) => {
|
|
2322
|
+
observerList.splice(observerList.indexOf(observer), 1);
|
|
2323
|
+
};
|
|
2324
|
+
const obs = observable((observer) => {
|
|
2325
|
+
addObserver(observer);
|
|
2326
|
+
return () => {
|
|
2327
|
+
removeObserver(observer);
|
|
2328
|
+
};
|
|
2329
|
+
});
|
|
2330
|
+
obs.next = (nextValue) => {
|
|
2331
|
+
if (value === nextValue)
|
|
2332
|
+
return;
|
|
2333
|
+
value = nextValue;
|
|
2334
|
+
for (const observer of observerList)
|
|
2335
|
+
observer.next(nextValue);
|
|
2336
|
+
};
|
|
2337
|
+
obs.get = () => value;
|
|
2338
|
+
return obs;
|
|
2339
|
+
}
|
|
2340
|
+
|
|
2341
|
+
// ../../node_modules/.bun/@trpc+client@11.18.0+acc6907a906fa511/node_modules/@trpc/client/dist/splitLink-B7Cuf2c_.mjs
|
|
2342
|
+
function createChain(opts) {
|
|
2343
|
+
return observable((observer) => {
|
|
2344
|
+
function execute(index = 0, op = opts.op) {
|
|
2345
|
+
const next = opts.links[index];
|
|
2346
|
+
if (!next)
|
|
2347
|
+
throw new Error("No more links to execute - did you forget to add an ending link?");
|
|
2348
|
+
const subscription = next({
|
|
2349
|
+
op,
|
|
2350
|
+
next(nextOp) {
|
|
2351
|
+
const nextObserver = execute(index + 1, nextOp);
|
|
2352
|
+
return nextObserver;
|
|
2353
|
+
}
|
|
2354
|
+
});
|
|
2355
|
+
return subscription;
|
|
2356
|
+
}
|
|
2357
|
+
const obs$ = execute();
|
|
2358
|
+
return obs$.subscribe(observer);
|
|
2359
|
+
});
|
|
2360
|
+
}
|
|
2361
|
+
|
|
2362
|
+
// ../../node_modules/.bun/@trpc+server@11.18.0+7524df1edfed9f02/node_modules/@trpc/server/dist/codes-DagpWZLc.mjs
|
|
2363
|
+
function isObject(value) {
|
|
2364
|
+
return !!value && !Array.isArray(value) && typeof value === "object";
|
|
2365
|
+
}
|
|
2366
|
+
function emptyObject() {
|
|
2367
|
+
return Object.create(null);
|
|
2368
|
+
}
|
|
2369
|
+
var TRPC_ERROR_CODES_BY_KEY = {
|
|
2370
|
+
PARSE_ERROR: -32700,
|
|
2371
|
+
BAD_REQUEST: -32600,
|
|
2372
|
+
INTERNAL_SERVER_ERROR: -32603,
|
|
2373
|
+
NOT_IMPLEMENTED: -32603,
|
|
2374
|
+
BAD_GATEWAY: -32603,
|
|
2375
|
+
SERVICE_UNAVAILABLE: -32603,
|
|
2376
|
+
GATEWAY_TIMEOUT: -32603,
|
|
2377
|
+
UNAUTHORIZED: -32001,
|
|
2378
|
+
PAYMENT_REQUIRED: -32002,
|
|
2379
|
+
FORBIDDEN: -32003,
|
|
2380
|
+
NOT_FOUND: -32004,
|
|
2381
|
+
METHOD_NOT_SUPPORTED: -32005,
|
|
2382
|
+
TIMEOUT: -32008,
|
|
2383
|
+
CONFLICT: -32009,
|
|
2384
|
+
PRECONDITION_FAILED: -32012,
|
|
2385
|
+
PAYLOAD_TOO_LARGE: -32013,
|
|
2386
|
+
UNSUPPORTED_MEDIA_TYPE: -32015,
|
|
2387
|
+
UNPROCESSABLE_CONTENT: -32022,
|
|
2388
|
+
PRECONDITION_REQUIRED: -32028,
|
|
2389
|
+
TOO_MANY_REQUESTS: -32029,
|
|
2390
|
+
CLIENT_CLOSED_REQUEST: -32099
|
|
2391
|
+
};
|
|
2392
|
+
var retryableRpcCodes = [
|
|
2393
|
+
TRPC_ERROR_CODES_BY_KEY.BAD_GATEWAY,
|
|
2394
|
+
TRPC_ERROR_CODES_BY_KEY.SERVICE_UNAVAILABLE,
|
|
2395
|
+
TRPC_ERROR_CODES_BY_KEY.GATEWAY_TIMEOUT,
|
|
2396
|
+
TRPC_ERROR_CODES_BY_KEY.INTERNAL_SERVER_ERROR
|
|
2397
|
+
];
|
|
2398
|
+
|
|
2399
|
+
// ../../node_modules/.bun/@trpc+server@11.18.0+7524df1edfed9f02/node_modules/@trpc/server/dist/getErrorShape-BPSzUA7W.mjs
|
|
2400
|
+
var __create2 = Object.create;
|
|
2401
|
+
var __defProp2 = Object.defineProperty;
|
|
2402
|
+
var __getOwnPropDesc2 = Object.getOwnPropertyDescriptor;
|
|
2403
|
+
var __getOwnPropNames2 = Object.getOwnPropertyNames;
|
|
2404
|
+
var __getProtoOf2 = Object.getPrototypeOf;
|
|
2405
|
+
var __hasOwnProp2 = Object.prototype.hasOwnProperty;
|
|
2406
|
+
var __commonJS2 = (cb, mod) => function() {
|
|
2407
|
+
return mod || (0, cb[__getOwnPropNames2(cb)[0]])((mod = { exports: {} }).exports, mod), mod.exports;
|
|
2408
|
+
};
|
|
2409
|
+
var __copyProps2 = (to, from, except, desc) => {
|
|
2410
|
+
if (from && typeof from === "object" || typeof from === "function")
|
|
2411
|
+
for (var keys = __getOwnPropNames2(from), i = 0, n = keys.length, key;i < n; i++) {
|
|
2412
|
+
key = keys[i];
|
|
2413
|
+
if (!__hasOwnProp2.call(to, key) && key !== except)
|
|
2414
|
+
__defProp2(to, key, {
|
|
2415
|
+
get: ((k) => from[k]).bind(null, key),
|
|
2416
|
+
enumerable: !(desc = __getOwnPropDesc2(from, key)) || desc.enumerable
|
|
2417
|
+
});
|
|
2418
|
+
}
|
|
2419
|
+
return to;
|
|
2420
|
+
};
|
|
2421
|
+
var __toESM2 = (mod, isNodeMode, target) => (target = mod != null ? __create2(__getProtoOf2(mod)) : {}, __copyProps2(isNodeMode || !mod || !mod.__esModule ? __defProp2(target, "default", {
|
|
2422
|
+
value: mod,
|
|
2423
|
+
enumerable: true
|
|
2424
|
+
}) : target, mod));
|
|
2425
|
+
var noop = () => {};
|
|
2426
|
+
var freezeIfAvailable = (obj) => {
|
|
2427
|
+
if (Object.freeze)
|
|
2428
|
+
Object.freeze(obj);
|
|
2429
|
+
};
|
|
2430
|
+
function createInnerProxy(callback, path, memo) {
|
|
2431
|
+
var _memo$cacheKey;
|
|
2432
|
+
const cacheKey = path.join(".");
|
|
2433
|
+
(_memo$cacheKey = memo[cacheKey]) !== null && _memo$cacheKey !== undefined || (memo[cacheKey] = new Proxy(noop, {
|
|
2434
|
+
get(_obj, key) {
|
|
2435
|
+
if (typeof key !== "string" || key === "then")
|
|
2436
|
+
return;
|
|
2437
|
+
return createInnerProxy(callback, [...path, key], memo);
|
|
2438
|
+
},
|
|
2439
|
+
apply(_1, _2, args) {
|
|
2440
|
+
const lastOfPath = path[path.length - 1];
|
|
2441
|
+
if (lastOfPath === "valueOf" || lastOfPath === "toString" || lastOfPath === "toJSON") {
|
|
2442
|
+
const debugPath = path.slice(0, -1).join(".");
|
|
2443
|
+
return `tRPC.proxy(${debugPath})`;
|
|
2444
|
+
}
|
|
2445
|
+
let opts = {
|
|
2446
|
+
args,
|
|
2447
|
+
path
|
|
2448
|
+
};
|
|
2449
|
+
if (lastOfPath === "call")
|
|
2450
|
+
opts = {
|
|
2451
|
+
args: args.length >= 2 ? [args[1]] : [],
|
|
2452
|
+
path: path.slice(0, -1)
|
|
2453
|
+
};
|
|
2454
|
+
else if (lastOfPath === "apply")
|
|
2455
|
+
opts = {
|
|
2456
|
+
args: args.length >= 2 ? args[1] : [],
|
|
2457
|
+
path: path.slice(0, -1)
|
|
2458
|
+
};
|
|
2459
|
+
freezeIfAvailable(opts.args);
|
|
2460
|
+
freezeIfAvailable(opts.path);
|
|
2461
|
+
return callback(opts);
|
|
2462
|
+
}
|
|
2463
|
+
}));
|
|
2464
|
+
return memo[cacheKey];
|
|
2465
|
+
}
|
|
2466
|
+
var createRecursiveProxy = (callback) => createInnerProxy(callback, [], emptyObject());
|
|
2467
|
+
var createFlatProxy = (callback) => {
|
|
2468
|
+
return new Proxy(noop, { get(_obj, name) {
|
|
2469
|
+
if (name === "then")
|
|
2470
|
+
return;
|
|
2471
|
+
return callback(name);
|
|
2472
|
+
} });
|
|
2473
|
+
};
|
|
2474
|
+
var require_typeof2 = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/typeof.js"(exports, module) {
|
|
2475
|
+
function _typeof$2(o) {
|
|
2476
|
+
"@babel/helpers - typeof";
|
|
2477
|
+
return module.exports = _typeof$2 = typeof Symbol == "function" && typeof Symbol.iterator == "symbol" ? function(o$1) {
|
|
2478
|
+
return typeof o$1;
|
|
2479
|
+
} : function(o$1) {
|
|
2480
|
+
return o$1 && typeof Symbol == "function" && o$1.constructor === Symbol && o$1 !== Symbol.prototype ? "symbol" : typeof o$1;
|
|
2481
|
+
}, module.exports.__esModule = true, module.exports["default"] = module.exports, _typeof$2(o);
|
|
2482
|
+
}
|
|
2483
|
+
module.exports = _typeof$2, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
2484
|
+
} });
|
|
2485
|
+
var require_toPrimitive2 = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPrimitive.js"(exports, module) {
|
|
2486
|
+
var _typeof$1 = require_typeof2()["default"];
|
|
2487
|
+
function toPrimitive$1(t, r) {
|
|
2488
|
+
if (_typeof$1(t) != "object" || !t)
|
|
2489
|
+
return t;
|
|
2490
|
+
var e = t[Symbol.toPrimitive];
|
|
2491
|
+
if (e !== undefined) {
|
|
2492
|
+
var i = e.call(t, r || "default");
|
|
2493
|
+
if (_typeof$1(i) != "object")
|
|
2494
|
+
return i;
|
|
2495
|
+
throw new TypeError("@@toPrimitive must return a primitive value.");
|
|
2496
|
+
}
|
|
2497
|
+
return (r === "string" ? String : Number)(t);
|
|
2498
|
+
}
|
|
2499
|
+
module.exports = toPrimitive$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
2500
|
+
} });
|
|
2501
|
+
var require_toPropertyKey2 = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/toPropertyKey.js"(exports, module) {
|
|
2502
|
+
var _typeof = require_typeof2()["default"];
|
|
2503
|
+
var toPrimitive = require_toPrimitive2();
|
|
2504
|
+
function toPropertyKey$1(t) {
|
|
2505
|
+
var i = toPrimitive(t, "string");
|
|
2506
|
+
return _typeof(i) == "symbol" ? i : i + "";
|
|
2507
|
+
}
|
|
2508
|
+
module.exports = toPropertyKey$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
2509
|
+
} });
|
|
2510
|
+
var require_defineProperty2 = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/defineProperty.js"(exports, module) {
|
|
2511
|
+
var toPropertyKey = require_toPropertyKey2();
|
|
2512
|
+
function _defineProperty(e, r, t) {
|
|
2513
|
+
return (r = toPropertyKey(r)) in e ? Object.defineProperty(e, r, {
|
|
2514
|
+
value: t,
|
|
2515
|
+
enumerable: true,
|
|
2516
|
+
configurable: true,
|
|
2517
|
+
writable: true
|
|
2518
|
+
}) : e[r] = t, e;
|
|
2519
|
+
}
|
|
2520
|
+
module.exports = _defineProperty, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
2521
|
+
} });
|
|
2522
|
+
var require_objectSpread22 = __commonJS2({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/objectSpread2.js"(exports, module) {
|
|
2523
|
+
var defineProperty = require_defineProperty2();
|
|
2524
|
+
function ownKeys(e, r) {
|
|
2525
|
+
var t = Object.keys(e);
|
|
2526
|
+
if (Object.getOwnPropertySymbols) {
|
|
2527
|
+
var o = Object.getOwnPropertySymbols(e);
|
|
2528
|
+
r && (o = o.filter(function(r$1) {
|
|
2529
|
+
return Object.getOwnPropertyDescriptor(e, r$1).enumerable;
|
|
2530
|
+
})), t.push.apply(t, o);
|
|
2531
|
+
}
|
|
2532
|
+
return t;
|
|
2533
|
+
}
|
|
2534
|
+
function _objectSpread2(e) {
|
|
2535
|
+
for (var r = 1;r < arguments.length; r++) {
|
|
2536
|
+
var t = arguments[r] != null ? arguments[r] : {};
|
|
2537
|
+
r % 2 ? ownKeys(Object(t), true).forEach(function(r$1) {
|
|
2538
|
+
defineProperty(e, r$1, t[r$1]);
|
|
2539
|
+
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function(r$1) {
|
|
2540
|
+
Object.defineProperty(e, r$1, Object.getOwnPropertyDescriptor(t, r$1));
|
|
2541
|
+
});
|
|
2542
|
+
}
|
|
2543
|
+
return e;
|
|
2544
|
+
}
|
|
2545
|
+
module.exports = _objectSpread2, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
2546
|
+
} });
|
|
2547
|
+
var import_objectSpread2 = __toESM2(require_objectSpread22(), 1);
|
|
2548
|
+
|
|
2549
|
+
// ../../node_modules/.bun/@trpc+server@11.18.0+7524df1edfed9f02/node_modules/@trpc/server/dist/tracked-DWInO6EQ.mjs
|
|
2550
|
+
var import_defineProperty = __toESM2(require_defineProperty2(), 1);
|
|
2551
|
+
var import_objectSpread2$1 = __toESM2(require_objectSpread22(), 1);
|
|
2552
|
+
function transformResultInner(response, transformer) {
|
|
2553
|
+
if ("error" in response) {
|
|
2554
|
+
const error = transformer.deserialize(response.error);
|
|
2555
|
+
return {
|
|
2556
|
+
ok: false,
|
|
2557
|
+
error: (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, response), {}, { error })
|
|
2558
|
+
};
|
|
2559
|
+
}
|
|
2560
|
+
const result = (0, import_objectSpread2$1.default)((0, import_objectSpread2$1.default)({}, response.result), (!response.result.type || response.result.type === "data") && {
|
|
2561
|
+
type: "data",
|
|
2562
|
+
data: transformer.deserialize(response.result.data)
|
|
2563
|
+
});
|
|
2564
|
+
return {
|
|
2565
|
+
ok: true,
|
|
2566
|
+
result
|
|
2567
|
+
};
|
|
2568
|
+
}
|
|
2569
|
+
var TransformResultError = class extends Error {
|
|
2570
|
+
constructor() {
|
|
2571
|
+
super("Unable to transform response from server");
|
|
2572
|
+
}
|
|
2573
|
+
};
|
|
2574
|
+
function transformResult(response, transformer) {
|
|
2575
|
+
let result;
|
|
2576
|
+
try {
|
|
2577
|
+
result = transformResultInner(response, transformer);
|
|
2578
|
+
} catch (_unused) {
|
|
2579
|
+
throw new TransformResultError;
|
|
2580
|
+
}
|
|
2581
|
+
if (!result.ok && (!isObject(result.error.error) || typeof result.error.error["code"] !== "number"))
|
|
2582
|
+
throw new TransformResultError;
|
|
2583
|
+
if (result.ok && !isObject(result.result))
|
|
2584
|
+
throw new TransformResultError;
|
|
2585
|
+
return result;
|
|
2586
|
+
}
|
|
2587
|
+
var import_objectSpread22 = __toESM2(require_objectSpread22(), 1);
|
|
2588
|
+
var trackedSymbol = Symbol();
|
|
2589
|
+
// ../../node_modules/.bun/@trpc+client@11.18.0+acc6907a906fa511/node_modules/@trpc/client/dist/TRPCClientError-apv8gw59.mjs
|
|
2590
|
+
var import_defineProperty2 = __toESM(require_defineProperty(), 1);
|
|
2591
|
+
var import_objectSpread23 = __toESM(require_objectSpread2(), 1);
|
|
2592
|
+
function isTRPCClientError(cause) {
|
|
2593
|
+
return cause instanceof TRPCClientError;
|
|
2594
|
+
}
|
|
2595
|
+
function isTRPCErrorResponse(obj) {
|
|
2596
|
+
return isObject(obj) && isObject(obj["error"]) && typeof obj["error"]["code"] === "number" && typeof obj["error"]["message"] === "string";
|
|
2597
|
+
}
|
|
2598
|
+
function getMessageFromUnknownError(err, fallback) {
|
|
2599
|
+
if (typeof err === "string")
|
|
2600
|
+
return err;
|
|
2601
|
+
if (isObject(err) && typeof err["message"] === "string")
|
|
2602
|
+
return err["message"];
|
|
2603
|
+
return fallback;
|
|
2604
|
+
}
|
|
2605
|
+
var TRPCClientError = class TRPCClientError2 extends Error {
|
|
2606
|
+
constructor(message, opts) {
|
|
2607
|
+
var _opts$result, _opts$result2;
|
|
2608
|
+
const cause = opts === null || opts === undefined ? undefined : opts.cause;
|
|
2609
|
+
super(message, { cause });
|
|
2610
|
+
(0, import_defineProperty2.default)(this, "cause", undefined);
|
|
2611
|
+
(0, import_defineProperty2.default)(this, "shape", undefined);
|
|
2612
|
+
(0, import_defineProperty2.default)(this, "data", undefined);
|
|
2613
|
+
(0, import_defineProperty2.default)(this, "meta", undefined);
|
|
2614
|
+
this.meta = opts === null || opts === undefined ? undefined : opts.meta;
|
|
2615
|
+
this.cause = cause;
|
|
2616
|
+
this.shape = opts === null || opts === undefined || (_opts$result = opts.result) === null || _opts$result === undefined ? undefined : _opts$result.error;
|
|
2617
|
+
this.data = opts === null || opts === undefined || (_opts$result2 = opts.result) === null || _opts$result2 === undefined ? undefined : _opts$result2.error.data;
|
|
2618
|
+
this.name = "TRPCClientError";
|
|
2619
|
+
Object.setPrototypeOf(this, TRPCClientError2.prototype);
|
|
2620
|
+
}
|
|
2621
|
+
static from(_cause, opts = {}) {
|
|
2622
|
+
const cause = _cause;
|
|
2623
|
+
if (isTRPCClientError(cause)) {
|
|
2624
|
+
if (opts.meta)
|
|
2625
|
+
cause.meta = (0, import_objectSpread23.default)((0, import_objectSpread23.default)({}, cause.meta), opts.meta);
|
|
2626
|
+
return cause;
|
|
2627
|
+
}
|
|
2628
|
+
if (isTRPCErrorResponse(cause))
|
|
2629
|
+
return new TRPCClientError2(cause.error.message, (0, import_objectSpread23.default)((0, import_objectSpread23.default)({}, opts), {}, {
|
|
2630
|
+
result: cause,
|
|
2631
|
+
cause: opts.cause
|
|
2632
|
+
}));
|
|
2633
|
+
return new TRPCClientError2(getMessageFromUnknownError(cause, "Unknown error"), (0, import_objectSpread23.default)((0, import_objectSpread23.default)({}, opts), {}, { cause }));
|
|
2634
|
+
}
|
|
2635
|
+
};
|
|
2636
|
+
|
|
2637
|
+
// ../../node_modules/.bun/@trpc+client@11.18.0+acc6907a906fa511/node_modules/@trpc/client/dist/unstable-internals-Bg7n9BBj.mjs
|
|
2638
|
+
function getTransformer(transformer) {
|
|
2639
|
+
const _transformer = transformer;
|
|
2640
|
+
if (!_transformer)
|
|
2641
|
+
return {
|
|
2642
|
+
input: {
|
|
2643
|
+
serialize: (data) => data,
|
|
2644
|
+
deserialize: (data) => data
|
|
2645
|
+
},
|
|
2646
|
+
output: {
|
|
2647
|
+
serialize: (data) => data,
|
|
2648
|
+
deserialize: (data) => data
|
|
2649
|
+
}
|
|
2650
|
+
};
|
|
2651
|
+
if ("input" in _transformer)
|
|
2652
|
+
return _transformer;
|
|
2653
|
+
return {
|
|
2654
|
+
input: _transformer,
|
|
2655
|
+
output: _transformer
|
|
2656
|
+
};
|
|
2657
|
+
}
|
|
2658
|
+
|
|
2659
|
+
// ../../node_modules/.bun/@trpc+client@11.18.0+acc6907a906fa511/node_modules/@trpc/client/dist/httpUtils-BNq9QC3d.mjs
|
|
2660
|
+
var isFunction2 = (fn) => typeof fn === "function";
|
|
2661
|
+
function getFetch(customFetchImpl) {
|
|
2662
|
+
if (customFetchImpl)
|
|
2663
|
+
return customFetchImpl;
|
|
2664
|
+
if (typeof window !== "undefined" && isFunction2(window.fetch))
|
|
2665
|
+
return window.fetch;
|
|
2666
|
+
if (typeof globalThis !== "undefined" && isFunction2(globalThis.fetch))
|
|
2667
|
+
return globalThis.fetch;
|
|
2668
|
+
throw new Error("No fetch implementation found");
|
|
2669
|
+
}
|
|
2670
|
+
var import_objectSpread24 = __toESM(require_objectSpread2());
|
|
2671
|
+
function resolveHTTPLinkOptions(opts) {
|
|
2672
|
+
return {
|
|
2673
|
+
url: opts.url.toString(),
|
|
2674
|
+
fetch: opts.fetch,
|
|
2675
|
+
transformer: getTransformer(opts.transformer),
|
|
2676
|
+
methodOverride: opts.methodOverride
|
|
2677
|
+
};
|
|
2678
|
+
}
|
|
2679
|
+
function arrayToDict(array) {
|
|
2680
|
+
const dict = {};
|
|
2681
|
+
for (let index = 0;index < array.length; index++) {
|
|
2682
|
+
const element = array[index];
|
|
2683
|
+
dict[index] = element;
|
|
2684
|
+
}
|
|
2685
|
+
return dict;
|
|
2686
|
+
}
|
|
2687
|
+
var METHOD = {
|
|
2688
|
+
query: "GET",
|
|
2689
|
+
mutation: "POST",
|
|
2690
|
+
subscription: "PATCH"
|
|
2691
|
+
};
|
|
2692
|
+
function getInput(opts) {
|
|
2693
|
+
return "input" in opts ? opts.transformer.input.serialize(opts.input) : arrayToDict(opts.inputs.map((_input) => opts.transformer.input.serialize(_input)));
|
|
2694
|
+
}
|
|
2695
|
+
var getUrl = (opts) => {
|
|
2696
|
+
const parts = opts.url.split("?");
|
|
2697
|
+
const base = parts[0].replace(/\/$/, "");
|
|
2698
|
+
let url = base + "/" + opts.path;
|
|
2699
|
+
const queryParts = [];
|
|
2700
|
+
if (parts[1])
|
|
2701
|
+
queryParts.push(parts[1]);
|
|
2702
|
+
if ("inputs" in opts)
|
|
2703
|
+
queryParts.push("batch=1");
|
|
2704
|
+
if (opts.type === "query" || opts.type === "subscription") {
|
|
2705
|
+
const input = getInput(opts);
|
|
2706
|
+
if (input !== undefined && opts.methodOverride !== "POST")
|
|
2707
|
+
queryParts.push(`input=${encodeURIComponent(JSON.stringify(input))}`);
|
|
2708
|
+
}
|
|
2709
|
+
if (queryParts.length)
|
|
2710
|
+
url += "?" + queryParts.join("&");
|
|
2711
|
+
return url;
|
|
2712
|
+
};
|
|
2713
|
+
var getBody = (opts) => {
|
|
2714
|
+
if (opts.type === "query" && opts.methodOverride !== "POST")
|
|
2715
|
+
return;
|
|
2716
|
+
const input = getInput(opts);
|
|
2717
|
+
return input !== undefined ? JSON.stringify(input) : undefined;
|
|
2718
|
+
};
|
|
2719
|
+
var jsonHttpRequester = (opts) => {
|
|
2720
|
+
return httpRequest((0, import_objectSpread24.default)((0, import_objectSpread24.default)({}, opts), {}, {
|
|
2721
|
+
contentTypeHeader: "application/json",
|
|
2722
|
+
getUrl,
|
|
2723
|
+
getBody
|
|
2724
|
+
}));
|
|
2725
|
+
};
|
|
2726
|
+
var AbortError = class extends Error {
|
|
2727
|
+
constructor() {
|
|
2728
|
+
const name = "AbortError";
|
|
2729
|
+
super(name);
|
|
2730
|
+
this.name = name;
|
|
2731
|
+
this.message = name;
|
|
2732
|
+
}
|
|
2733
|
+
};
|
|
2734
|
+
var throwIfAborted = (signal) => {
|
|
2735
|
+
var _signal$throwIfAborte;
|
|
2736
|
+
if (!(signal === null || signal === undefined ? undefined : signal.aborted))
|
|
2737
|
+
return;
|
|
2738
|
+
(_signal$throwIfAborte = signal.throwIfAborted) === null || _signal$throwIfAborte === undefined || _signal$throwIfAborte.call(signal);
|
|
2739
|
+
if (typeof DOMException !== "undefined")
|
|
2740
|
+
throw new DOMException("AbortError", "AbortError");
|
|
2741
|
+
throw new AbortError;
|
|
2742
|
+
};
|
|
2743
|
+
async function fetchHTTPResponse(opts) {
|
|
2744
|
+
var _opts$methodOverride, _opts$trpcAcceptHeade;
|
|
2745
|
+
throwIfAborted(opts.signal);
|
|
2746
|
+
const url = opts.getUrl(opts);
|
|
2747
|
+
const body = opts.getBody(opts);
|
|
2748
|
+
const method = (_opts$methodOverride = opts.methodOverride) !== null && _opts$methodOverride !== undefined ? _opts$methodOverride : METHOD[opts.type];
|
|
2749
|
+
const resolvedHeaders = await (async () => {
|
|
2750
|
+
const heads = await opts.headers();
|
|
2751
|
+
if (Symbol.iterator in heads)
|
|
2752
|
+
return Object.fromEntries(heads);
|
|
2753
|
+
return heads;
|
|
2754
|
+
})();
|
|
2755
|
+
const headers = (0, import_objectSpread24.default)((0, import_objectSpread24.default)((0, import_objectSpread24.default)({}, opts.contentTypeHeader && method !== "GET" ? { "content-type": opts.contentTypeHeader } : {}), opts.trpcAcceptHeader ? { [(_opts$trpcAcceptHeade = opts.trpcAcceptHeaderKey) !== null && _opts$trpcAcceptHeade !== undefined ? _opts$trpcAcceptHeade : "trpc-accept"]: opts.trpcAcceptHeader } : undefined), resolvedHeaders);
|
|
2756
|
+
return getFetch(opts.fetch)(url, {
|
|
2757
|
+
method,
|
|
2758
|
+
signal: opts.signal,
|
|
2759
|
+
body,
|
|
2760
|
+
headers
|
|
2761
|
+
});
|
|
2762
|
+
}
|
|
2763
|
+
async function httpRequest(opts) {
|
|
2764
|
+
const meta = {};
|
|
2765
|
+
const res = await fetchHTTPResponse(opts);
|
|
2766
|
+
meta.response = res;
|
|
2767
|
+
const json = await res.json();
|
|
2768
|
+
meta.responseJSON = json;
|
|
2769
|
+
return {
|
|
2770
|
+
json,
|
|
2771
|
+
meta
|
|
2772
|
+
};
|
|
2773
|
+
}
|
|
2774
|
+
|
|
2775
|
+
// ../../node_modules/.bun/@trpc+client@11.18.0+acc6907a906fa511/node_modules/@trpc/client/dist/httpLink-oiU8eqFi.mjs
|
|
2776
|
+
var import_objectSpread25 = __toESM(require_objectSpread2(), 1);
|
|
2777
|
+
|
|
2778
|
+
// ../../node_modules/.bun/@trpc+client@11.18.0+acc6907a906fa511/node_modules/@trpc/client/dist/httpBatchLink-CaWjh1oW.mjs
|
|
2779
|
+
var throwFatalError = () => {
|
|
2780
|
+
throw new Error("Something went wrong. Please submit an issue at https://github.com/trpc/trpc/issues/new");
|
|
2781
|
+
};
|
|
2782
|
+
function dataLoader(batchLoader) {
|
|
2783
|
+
let pendingItems = null;
|
|
2784
|
+
let dispatchTimer = null;
|
|
2785
|
+
const destroyTimerAndPendingItems = () => {
|
|
2786
|
+
clearTimeout(dispatchTimer);
|
|
2787
|
+
dispatchTimer = null;
|
|
2788
|
+
pendingItems = null;
|
|
2789
|
+
};
|
|
2790
|
+
function groupItems(items) {
|
|
2791
|
+
const groupedItems = [[]];
|
|
2792
|
+
let index = 0;
|
|
2793
|
+
while (true) {
|
|
2794
|
+
const item = items[index];
|
|
2795
|
+
if (!item)
|
|
2796
|
+
break;
|
|
2797
|
+
const lastGroup = groupedItems[groupedItems.length - 1];
|
|
2798
|
+
if (item.aborted) {
|
|
2799
|
+
var _item$reject;
|
|
2800
|
+
(_item$reject = item.reject) === null || _item$reject === undefined || _item$reject.call(item, new Error("Aborted"));
|
|
2801
|
+
index++;
|
|
2802
|
+
continue;
|
|
2803
|
+
}
|
|
2804
|
+
const isValid = batchLoader.validate(lastGroup.concat(item).map((it) => it.key));
|
|
2805
|
+
if (isValid) {
|
|
2806
|
+
lastGroup.push(item);
|
|
2807
|
+
index++;
|
|
2808
|
+
continue;
|
|
2809
|
+
}
|
|
2810
|
+
if (lastGroup.length === 0) {
|
|
2811
|
+
var _item$reject2;
|
|
2812
|
+
(_item$reject2 = item.reject) === null || _item$reject2 === undefined || _item$reject2.call(item, new Error("Input is too big for a single dispatch"));
|
|
2813
|
+
index++;
|
|
2814
|
+
continue;
|
|
2815
|
+
}
|
|
2816
|
+
groupedItems.push([]);
|
|
2817
|
+
}
|
|
2818
|
+
return groupedItems;
|
|
2819
|
+
}
|
|
2820
|
+
function dispatch() {
|
|
2821
|
+
const groupedItems = groupItems(pendingItems);
|
|
2822
|
+
destroyTimerAndPendingItems();
|
|
2823
|
+
for (const items of groupedItems) {
|
|
2824
|
+
if (!items.length)
|
|
2825
|
+
continue;
|
|
2826
|
+
const batch = { items };
|
|
2827
|
+
for (const item of items)
|
|
2828
|
+
item.batch = batch;
|
|
2829
|
+
const promise = batchLoader.fetch(batch.items.map((_item) => _item.key));
|
|
2830
|
+
promise.then(async (result) => {
|
|
2831
|
+
await Promise.all(result.map(async (valueOrPromise, index) => {
|
|
2832
|
+
const item = batch.items[index];
|
|
2833
|
+
try {
|
|
2834
|
+
var _item$resolve;
|
|
2835
|
+
const value = await Promise.resolve(valueOrPromise);
|
|
2836
|
+
(_item$resolve = item.resolve) === null || _item$resolve === undefined || _item$resolve.call(item, value);
|
|
2837
|
+
} catch (cause) {
|
|
2838
|
+
var _item$reject3;
|
|
2839
|
+
(_item$reject3 = item.reject) === null || _item$reject3 === undefined || _item$reject3.call(item, cause);
|
|
2840
|
+
}
|
|
2841
|
+
item.batch = null;
|
|
2842
|
+
item.reject = null;
|
|
2843
|
+
item.resolve = null;
|
|
2844
|
+
}));
|
|
2845
|
+
for (const item of batch.items) {
|
|
2846
|
+
var _item$reject4;
|
|
2847
|
+
(_item$reject4 = item.reject) === null || _item$reject4 === undefined || _item$reject4.call(item, new Error("Missing result"));
|
|
2848
|
+
item.batch = null;
|
|
2849
|
+
}
|
|
2850
|
+
}).catch((cause) => {
|
|
2851
|
+
for (const item of batch.items) {
|
|
2852
|
+
var _item$reject5;
|
|
2853
|
+
(_item$reject5 = item.reject) === null || _item$reject5 === undefined || _item$reject5.call(item, cause);
|
|
2854
|
+
item.batch = null;
|
|
2855
|
+
}
|
|
2856
|
+
});
|
|
2857
|
+
}
|
|
2858
|
+
}
|
|
2859
|
+
function load(key) {
|
|
2860
|
+
var _dispatchTimer;
|
|
2861
|
+
const item = {
|
|
2862
|
+
aborted: false,
|
|
2863
|
+
key,
|
|
2864
|
+
batch: null,
|
|
2865
|
+
resolve: throwFatalError,
|
|
2866
|
+
reject: throwFatalError
|
|
2867
|
+
};
|
|
2868
|
+
const promise = new Promise((resolve3, reject) => {
|
|
2869
|
+
var _pendingItems;
|
|
2870
|
+
item.reject = reject;
|
|
2871
|
+
item.resolve = resolve3;
|
|
2872
|
+
(_pendingItems = pendingItems) !== null && _pendingItems !== undefined || (pendingItems = []);
|
|
2873
|
+
pendingItems.push(item);
|
|
2874
|
+
});
|
|
2875
|
+
(_dispatchTimer = dispatchTimer) !== null && _dispatchTimer !== undefined || (dispatchTimer = setTimeout(dispatch));
|
|
2876
|
+
return promise;
|
|
2877
|
+
}
|
|
2878
|
+
return { load };
|
|
2879
|
+
}
|
|
2880
|
+
function allAbortSignals(...signals) {
|
|
2881
|
+
const ac = new AbortController;
|
|
2882
|
+
const count = signals.length;
|
|
2883
|
+
let abortedCount = 0;
|
|
2884
|
+
const onAbort = () => {
|
|
2885
|
+
if (++abortedCount === count)
|
|
2886
|
+
ac.abort();
|
|
2887
|
+
};
|
|
2888
|
+
for (const signal of signals)
|
|
2889
|
+
if (signal === null || signal === undefined ? undefined : signal.aborted)
|
|
2890
|
+
onAbort();
|
|
2891
|
+
else
|
|
2892
|
+
signal === null || signal === undefined || signal.addEventListener("abort", onAbort, { once: true });
|
|
2893
|
+
return ac.signal;
|
|
2894
|
+
}
|
|
2895
|
+
var import_objectSpread26 = __toESM(require_objectSpread2(), 1);
|
|
2896
|
+
function httpBatchLink(opts) {
|
|
2897
|
+
var _opts$maxURLLength, _opts$maxItems;
|
|
2898
|
+
const resolvedOpts = resolveHTTPLinkOptions(opts);
|
|
2899
|
+
const maxURLLength = (_opts$maxURLLength = opts.maxURLLength) !== null && _opts$maxURLLength !== undefined ? _opts$maxURLLength : Infinity;
|
|
2900
|
+
const maxItems = (_opts$maxItems = opts.maxItems) !== null && _opts$maxItems !== undefined ? _opts$maxItems : Infinity;
|
|
2901
|
+
return () => {
|
|
2902
|
+
const batchLoader = (type) => {
|
|
2903
|
+
return {
|
|
2904
|
+
validate(batchOps) {
|
|
2905
|
+
if (maxURLLength === Infinity && maxItems === Infinity)
|
|
2906
|
+
return true;
|
|
2907
|
+
if (batchOps.length > maxItems)
|
|
2908
|
+
return false;
|
|
2909
|
+
const path = batchOps.map((op) => op.path).join(",");
|
|
2910
|
+
const inputs = batchOps.map((op) => op.input);
|
|
2911
|
+
const url = getUrl((0, import_objectSpread26.default)((0, import_objectSpread26.default)({}, resolvedOpts), {}, {
|
|
2912
|
+
type,
|
|
2913
|
+
path,
|
|
2914
|
+
inputs,
|
|
2915
|
+
signal: null
|
|
2916
|
+
}));
|
|
2917
|
+
return url.length <= maxURLLength;
|
|
2918
|
+
},
|
|
2919
|
+
async fetch(batchOps) {
|
|
2920
|
+
const path = batchOps.map((op) => op.path).join(",");
|
|
2921
|
+
const inputs = batchOps.map((op) => op.input);
|
|
2922
|
+
const signal = allAbortSignals(...batchOps.map((op) => op.signal));
|
|
2923
|
+
const res = await jsonHttpRequester((0, import_objectSpread26.default)((0, import_objectSpread26.default)({}, resolvedOpts), {}, {
|
|
2924
|
+
path,
|
|
2925
|
+
inputs,
|
|
2926
|
+
type,
|
|
2927
|
+
headers() {
|
|
2928
|
+
if (!opts.headers)
|
|
2929
|
+
return {};
|
|
2930
|
+
if (typeof opts.headers === "function")
|
|
2931
|
+
return opts.headers({ opList: batchOps });
|
|
2932
|
+
return opts.headers;
|
|
2933
|
+
},
|
|
2934
|
+
signal
|
|
2935
|
+
}));
|
|
2936
|
+
const resJSON = Array.isArray(res.json) ? res.json : batchOps.map(() => res.json);
|
|
2937
|
+
const result = resJSON.map((item) => ({
|
|
2938
|
+
meta: res.meta,
|
|
2939
|
+
json: item
|
|
2940
|
+
}));
|
|
2941
|
+
return result;
|
|
2942
|
+
}
|
|
2943
|
+
};
|
|
2944
|
+
};
|
|
2945
|
+
const query = dataLoader(batchLoader("query"));
|
|
2946
|
+
const mutation = dataLoader(batchLoader("mutation"));
|
|
2947
|
+
const loaders = {
|
|
2948
|
+
query,
|
|
2949
|
+
mutation
|
|
2950
|
+
};
|
|
2951
|
+
return ({ op }) => {
|
|
2952
|
+
return observable((observer) => {
|
|
2953
|
+
if (op.type === "subscription")
|
|
2954
|
+
throw new Error("Subscriptions are unsupported by `httpLink` - use `httpSubscriptionLink` or `wsLink`");
|
|
2955
|
+
const loader = loaders[op.type];
|
|
2956
|
+
const promise = loader.load(op);
|
|
2957
|
+
let _res = undefined;
|
|
2958
|
+
promise.then((res) => {
|
|
2959
|
+
_res = res;
|
|
2960
|
+
const transformed = transformResult(res.json, resolvedOpts.transformer.output);
|
|
2961
|
+
if (!transformed.ok) {
|
|
2962
|
+
observer.error(TRPCClientError.from(transformed.error, { meta: res.meta }));
|
|
2963
|
+
return;
|
|
2964
|
+
}
|
|
2965
|
+
observer.next({
|
|
2966
|
+
context: res.meta,
|
|
2967
|
+
result: transformed.result
|
|
2968
|
+
});
|
|
2969
|
+
observer.complete();
|
|
2970
|
+
}).catch((err) => {
|
|
2971
|
+
observer.error(TRPCClientError.from(err, { meta: _res === null || _res === undefined ? undefined : _res.meta }));
|
|
2972
|
+
});
|
|
2973
|
+
return () => {};
|
|
2974
|
+
});
|
|
2975
|
+
};
|
|
2976
|
+
};
|
|
2977
|
+
}
|
|
2978
|
+
|
|
2979
|
+
// ../../node_modules/.bun/@trpc+client@11.18.0+acc6907a906fa511/node_modules/@trpc/client/dist/loggerLink-ineCN1PO.mjs
|
|
2980
|
+
var import_objectSpread27 = __toESM(require_objectSpread2(), 1);
|
|
2981
|
+
|
|
2982
|
+
// ../../node_modules/.bun/@trpc+client@11.18.0+acc6907a906fa511/node_modules/@trpc/client/dist/wsLink-DSf4KOdW.mjs
|
|
2983
|
+
var resultOf = (value, ...args) => {
|
|
2984
|
+
return typeof value === "function" ? value(...args) : value;
|
|
2985
|
+
};
|
|
2986
|
+
var import_defineProperty$3 = __toESM(require_defineProperty(), 1);
|
|
2987
|
+
function withResolvers() {
|
|
2988
|
+
let resolve3;
|
|
2989
|
+
let reject;
|
|
2990
|
+
const promise = new Promise((res, rej) => {
|
|
2991
|
+
resolve3 = res;
|
|
2992
|
+
reject = rej;
|
|
2993
|
+
});
|
|
2994
|
+
return {
|
|
2995
|
+
promise,
|
|
2996
|
+
resolve: resolve3,
|
|
2997
|
+
reject
|
|
2998
|
+
};
|
|
2999
|
+
}
|
|
3000
|
+
async function prepareUrl(urlOptions) {
|
|
3001
|
+
const url = await resultOf(urlOptions.url);
|
|
3002
|
+
if (!urlOptions.connectionParams)
|
|
3003
|
+
return url;
|
|
3004
|
+
const prefix = url.includes("?") ? "&" : "?";
|
|
3005
|
+
const connectionParams = `${prefix}connectionParams=1`;
|
|
3006
|
+
return url + connectionParams;
|
|
3007
|
+
}
|
|
3008
|
+
async function buildConnectionMessage(connectionParams, encoder) {
|
|
3009
|
+
const message = {
|
|
3010
|
+
method: "connectionParams",
|
|
3011
|
+
data: await resultOf(connectionParams)
|
|
3012
|
+
};
|
|
3013
|
+
return encoder.encode(message);
|
|
3014
|
+
}
|
|
3015
|
+
var import_defineProperty$2 = __toESM(require_defineProperty(), 1);
|
|
3016
|
+
var import_defineProperty$1 = __toESM(require_defineProperty(), 1);
|
|
3017
|
+
function asyncWsOpen(ws) {
|
|
3018
|
+
const { promise, resolve: resolve3, reject } = withResolvers();
|
|
3019
|
+
ws.addEventListener("open", () => {
|
|
3020
|
+
ws.removeEventListener("error", reject);
|
|
3021
|
+
resolve3();
|
|
3022
|
+
});
|
|
3023
|
+
ws.addEventListener("error", reject);
|
|
3024
|
+
return promise;
|
|
3025
|
+
}
|
|
3026
|
+
function setupPingInterval(ws, { intervalMs, pongTimeoutMs }) {
|
|
3027
|
+
let pingTimeout;
|
|
3028
|
+
let pongTimeout;
|
|
3029
|
+
function start() {
|
|
3030
|
+
pingTimeout = setTimeout(() => {
|
|
3031
|
+
ws.send("PING");
|
|
3032
|
+
pongTimeout = setTimeout(() => {
|
|
3033
|
+
ws.close();
|
|
3034
|
+
}, pongTimeoutMs);
|
|
3035
|
+
}, intervalMs);
|
|
3036
|
+
}
|
|
3037
|
+
function reset() {
|
|
3038
|
+
clearTimeout(pingTimeout);
|
|
3039
|
+
start();
|
|
3040
|
+
}
|
|
3041
|
+
function pong() {
|
|
3042
|
+
clearTimeout(pongTimeout);
|
|
3043
|
+
reset();
|
|
3044
|
+
}
|
|
3045
|
+
ws.addEventListener("open", start);
|
|
3046
|
+
ws.addEventListener("message", ({ data }) => {
|
|
3047
|
+
clearTimeout(pingTimeout);
|
|
3048
|
+
start();
|
|
3049
|
+
if (data === "PONG")
|
|
3050
|
+
pong();
|
|
3051
|
+
});
|
|
3052
|
+
ws.addEventListener("close", () => {
|
|
3053
|
+
clearTimeout(pingTimeout);
|
|
3054
|
+
clearTimeout(pongTimeout);
|
|
3055
|
+
});
|
|
3056
|
+
}
|
|
3057
|
+
var WsConnection = class WsConnection2 {
|
|
3058
|
+
constructor(opts) {
|
|
3059
|
+
var _opts$WebSocketPonyfi;
|
|
3060
|
+
(0, import_defineProperty$1.default)(this, "id", ++WsConnection2.connectCount);
|
|
3061
|
+
(0, import_defineProperty$1.default)(this, "WebSocketPonyfill", undefined);
|
|
3062
|
+
(0, import_defineProperty$1.default)(this, "urlOptions", undefined);
|
|
3063
|
+
(0, import_defineProperty$1.default)(this, "keepAliveOpts", undefined);
|
|
3064
|
+
(0, import_defineProperty$1.default)(this, "encoder", undefined);
|
|
3065
|
+
(0, import_defineProperty$1.default)(this, "wsObservable", behaviorSubject(null));
|
|
3066
|
+
(0, import_defineProperty$1.default)(this, "openPromise", null);
|
|
3067
|
+
this.WebSocketPonyfill = (_opts$WebSocketPonyfi = opts.WebSocketPonyfill) !== null && _opts$WebSocketPonyfi !== undefined ? _opts$WebSocketPonyfi : WebSocket;
|
|
3068
|
+
if (!this.WebSocketPonyfill)
|
|
3069
|
+
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");
|
|
3070
|
+
this.urlOptions = opts.urlOptions;
|
|
3071
|
+
this.keepAliveOpts = opts.keepAlive;
|
|
3072
|
+
this.encoder = opts.encoder;
|
|
3073
|
+
}
|
|
3074
|
+
get ws() {
|
|
3075
|
+
return this.wsObservable.get();
|
|
3076
|
+
}
|
|
3077
|
+
set ws(ws) {
|
|
3078
|
+
this.wsObservable.next(ws);
|
|
3079
|
+
}
|
|
3080
|
+
isOpen() {
|
|
3081
|
+
return !!this.ws && this.ws.readyState === this.WebSocketPonyfill.OPEN && !this.openPromise;
|
|
3082
|
+
}
|
|
3083
|
+
isClosed() {
|
|
3084
|
+
return !!this.ws && (this.ws.readyState === this.WebSocketPonyfill.CLOSING || this.ws.readyState === this.WebSocketPonyfill.CLOSED);
|
|
3085
|
+
}
|
|
3086
|
+
async open() {
|
|
3087
|
+
var _this = this;
|
|
3088
|
+
if (_this.openPromise)
|
|
3089
|
+
return _this.openPromise;
|
|
3090
|
+
_this.id = ++WsConnection2.connectCount;
|
|
3091
|
+
const wsPromise = prepareUrl(_this.urlOptions).then((url) => new _this.WebSocketPonyfill(url));
|
|
3092
|
+
_this.openPromise = wsPromise.then(async (ws) => {
|
|
3093
|
+
_this.ws = ws;
|
|
3094
|
+
ws.binaryType = "arraybuffer";
|
|
3095
|
+
ws.addEventListener("message", function({ data }) {
|
|
3096
|
+
if (data === "PING")
|
|
3097
|
+
this.send("PONG");
|
|
3098
|
+
});
|
|
3099
|
+
if (_this.keepAliveOpts.enabled)
|
|
3100
|
+
setupPingInterval(ws, _this.keepAliveOpts);
|
|
3101
|
+
ws.addEventListener("close", () => {
|
|
3102
|
+
if (_this.ws === ws)
|
|
3103
|
+
_this.ws = null;
|
|
3104
|
+
});
|
|
3105
|
+
await asyncWsOpen(ws);
|
|
3106
|
+
if (_this.urlOptions.connectionParams)
|
|
3107
|
+
ws.send(await buildConnectionMessage(_this.urlOptions.connectionParams, _this.encoder));
|
|
3108
|
+
});
|
|
3109
|
+
try {
|
|
3110
|
+
await _this.openPromise;
|
|
3111
|
+
} finally {
|
|
3112
|
+
_this.openPromise = null;
|
|
3113
|
+
}
|
|
3114
|
+
}
|
|
3115
|
+
async close() {
|
|
3116
|
+
var _this2 = this;
|
|
3117
|
+
try {
|
|
3118
|
+
await _this2.openPromise;
|
|
3119
|
+
} finally {
|
|
3120
|
+
var _this$ws;
|
|
3121
|
+
(_this$ws = _this2.ws) === null || _this$ws === undefined || _this$ws.close();
|
|
3122
|
+
}
|
|
3123
|
+
}
|
|
3124
|
+
};
|
|
3125
|
+
(0, import_defineProperty$1.default)(WsConnection, "connectCount", 0);
|
|
3126
|
+
var import_defineProperty3 = __toESM(require_defineProperty(), 1);
|
|
3127
|
+
var import_objectSpread28 = __toESM(require_objectSpread2(), 1);
|
|
3128
|
+
|
|
3129
|
+
// ../../node_modules/.bun/@trpc+client@11.18.0+acc6907a906fa511/node_modules/@trpc/client/dist/index.mjs
|
|
3130
|
+
var import_defineProperty4 = __toESM(require_defineProperty(), 1);
|
|
3131
|
+
var import_objectSpread2$4 = __toESM(require_objectSpread2(), 1);
|
|
3132
|
+
var TRPCUntypedClient = class {
|
|
3133
|
+
constructor(opts) {
|
|
3134
|
+
(0, import_defineProperty4.default)(this, "links", undefined);
|
|
3135
|
+
(0, import_defineProperty4.default)(this, "runtime", undefined);
|
|
3136
|
+
(0, import_defineProperty4.default)(this, "requestId", undefined);
|
|
3137
|
+
this.requestId = 0;
|
|
3138
|
+
this.runtime = {};
|
|
3139
|
+
this.links = opts.links.map((link) => link(this.runtime));
|
|
3140
|
+
}
|
|
3141
|
+
$request(opts) {
|
|
3142
|
+
var _opts$context;
|
|
3143
|
+
const chain$ = createChain({
|
|
3144
|
+
links: this.links,
|
|
3145
|
+
op: (0, import_objectSpread2$4.default)((0, import_objectSpread2$4.default)({}, opts), {}, {
|
|
3146
|
+
context: (_opts$context = opts.context) !== null && _opts$context !== undefined ? _opts$context : {},
|
|
3147
|
+
id: ++this.requestId
|
|
3148
|
+
})
|
|
3149
|
+
});
|
|
3150
|
+
return chain$.pipe(share());
|
|
3151
|
+
}
|
|
3152
|
+
async requestAsPromise(opts) {
|
|
3153
|
+
var _this = this;
|
|
3154
|
+
try {
|
|
3155
|
+
const req$ = _this.$request(opts);
|
|
3156
|
+
const envelope = await observableToPromise(req$);
|
|
3157
|
+
const data = envelope.result.data;
|
|
3158
|
+
return data;
|
|
3159
|
+
} catch (err) {
|
|
3160
|
+
throw TRPCClientError.from(err);
|
|
3161
|
+
}
|
|
3162
|
+
}
|
|
3163
|
+
query(path, input, opts) {
|
|
3164
|
+
return this.requestAsPromise({
|
|
3165
|
+
type: "query",
|
|
3166
|
+
path,
|
|
3167
|
+
input,
|
|
3168
|
+
context: opts === null || opts === undefined ? undefined : opts.context,
|
|
3169
|
+
signal: opts === null || opts === undefined ? undefined : opts.signal
|
|
3170
|
+
});
|
|
3171
|
+
}
|
|
3172
|
+
mutation(path, input, opts) {
|
|
3173
|
+
return this.requestAsPromise({
|
|
3174
|
+
type: "mutation",
|
|
3175
|
+
path,
|
|
3176
|
+
input,
|
|
3177
|
+
context: opts === null || opts === undefined ? undefined : opts.context,
|
|
3178
|
+
signal: opts === null || opts === undefined ? undefined : opts.signal
|
|
3179
|
+
});
|
|
3180
|
+
}
|
|
3181
|
+
subscription(path, input, opts) {
|
|
3182
|
+
const observable$ = this.$request({
|
|
3183
|
+
type: "subscription",
|
|
3184
|
+
path,
|
|
3185
|
+
input,
|
|
3186
|
+
context: opts.context,
|
|
3187
|
+
signal: opts.signal
|
|
3188
|
+
});
|
|
3189
|
+
return observable$.subscribe({
|
|
3190
|
+
next(envelope) {
|
|
3191
|
+
switch (envelope.result.type) {
|
|
3192
|
+
case "state": {
|
|
3193
|
+
var _opts$onConnectionSta;
|
|
3194
|
+
(_opts$onConnectionSta = opts.onConnectionStateChange) === null || _opts$onConnectionSta === undefined || _opts$onConnectionSta.call(opts, envelope.result);
|
|
3195
|
+
break;
|
|
3196
|
+
}
|
|
3197
|
+
case "started": {
|
|
3198
|
+
var _opts$onStarted;
|
|
3199
|
+
(_opts$onStarted = opts.onStarted) === null || _opts$onStarted === undefined || _opts$onStarted.call(opts, { context: envelope.context });
|
|
3200
|
+
break;
|
|
3201
|
+
}
|
|
3202
|
+
case "stopped": {
|
|
3203
|
+
var _opts$onStopped;
|
|
3204
|
+
(_opts$onStopped = opts.onStopped) === null || _opts$onStopped === undefined || _opts$onStopped.call(opts);
|
|
3205
|
+
break;
|
|
3206
|
+
}
|
|
3207
|
+
case "data":
|
|
3208
|
+
case undefined: {
|
|
3209
|
+
var _opts$onData;
|
|
3210
|
+
(_opts$onData = opts.onData) === null || _opts$onData === undefined || _opts$onData.call(opts, envelope.result.data);
|
|
3211
|
+
break;
|
|
3212
|
+
}
|
|
3213
|
+
}
|
|
3214
|
+
},
|
|
3215
|
+
error(err) {
|
|
3216
|
+
var _opts$onError;
|
|
3217
|
+
(_opts$onError = opts.onError) === null || _opts$onError === undefined || _opts$onError.call(opts, err);
|
|
3218
|
+
},
|
|
3219
|
+
complete() {
|
|
3220
|
+
var _opts$onComplete;
|
|
3221
|
+
(_opts$onComplete = opts.onComplete) === null || _opts$onComplete === undefined || _opts$onComplete.call(opts);
|
|
3222
|
+
}
|
|
3223
|
+
});
|
|
3224
|
+
}
|
|
3225
|
+
};
|
|
3226
|
+
var untypedClientSymbol = Symbol.for("trpc_untypedClient");
|
|
3227
|
+
var clientCallTypeMap = {
|
|
3228
|
+
query: "query",
|
|
3229
|
+
mutate: "mutation",
|
|
3230
|
+
subscribe: "subscription"
|
|
3231
|
+
};
|
|
3232
|
+
var clientCallTypeToProcedureType = (clientCallType) => {
|
|
3233
|
+
return clientCallTypeMap[clientCallType];
|
|
3234
|
+
};
|
|
3235
|
+
function createTRPCClientProxy(client) {
|
|
3236
|
+
const proxy = createRecursiveProxy(({ path, args }) => {
|
|
3237
|
+
const pathCopy = [...path];
|
|
3238
|
+
const procedureType = clientCallTypeToProcedureType(pathCopy.pop());
|
|
3239
|
+
const fullPath = pathCopy.join(".");
|
|
3240
|
+
return client[procedureType](fullPath, ...args);
|
|
3241
|
+
});
|
|
3242
|
+
return createFlatProxy((key) => {
|
|
3243
|
+
if (key === untypedClientSymbol)
|
|
3244
|
+
return client;
|
|
3245
|
+
return proxy[key];
|
|
3246
|
+
});
|
|
3247
|
+
}
|
|
3248
|
+
function createTRPCClient(opts) {
|
|
3249
|
+
const client = new TRPCUntypedClient(opts);
|
|
3250
|
+
const proxy = createTRPCClientProxy(client);
|
|
3251
|
+
return proxy;
|
|
3252
|
+
}
|
|
3253
|
+
var import_objectSpread2$3 = __toESM(require_objectSpread2(), 1);
|
|
3254
|
+
var import_objectSpread2$2 = __toESM(require_objectSpread2(), 1);
|
|
3255
|
+
var require_asyncIterator = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/asyncIterator.js"(exports, module) {
|
|
3256
|
+
function _asyncIterator$1(r) {
|
|
3257
|
+
var n, t, o, e = 2;
|
|
3258
|
+
for (typeof Symbol != "undefined" && (t = Symbol.asyncIterator, o = Symbol.iterator);e--; ) {
|
|
3259
|
+
if (t && (n = r[t]) != null)
|
|
3260
|
+
return n.call(r);
|
|
3261
|
+
if (o && (n = r[o]) != null)
|
|
3262
|
+
return new AsyncFromSyncIterator(n.call(r));
|
|
3263
|
+
t = "@@asyncIterator", o = "@@iterator";
|
|
3264
|
+
}
|
|
3265
|
+
throw new TypeError("Object is not async iterable");
|
|
3266
|
+
}
|
|
3267
|
+
function AsyncFromSyncIterator(r) {
|
|
3268
|
+
function AsyncFromSyncIteratorContinuation(r$1) {
|
|
3269
|
+
if (Object(r$1) !== r$1)
|
|
3270
|
+
return Promise.reject(new TypeError(r$1 + " is not an object."));
|
|
3271
|
+
var n = r$1.done;
|
|
3272
|
+
return Promise.resolve(r$1.value).then(function(r$2) {
|
|
3273
|
+
return {
|
|
3274
|
+
value: r$2,
|
|
3275
|
+
done: n
|
|
3276
|
+
};
|
|
3277
|
+
});
|
|
3278
|
+
}
|
|
3279
|
+
return AsyncFromSyncIterator = function AsyncFromSyncIterator$1(r$1) {
|
|
3280
|
+
this.s = r$1, this.n = r$1.next;
|
|
3281
|
+
}, AsyncFromSyncIterator.prototype = {
|
|
3282
|
+
s: null,
|
|
3283
|
+
n: null,
|
|
3284
|
+
next: function next() {
|
|
3285
|
+
return AsyncFromSyncIteratorContinuation(this.n.apply(this.s, arguments));
|
|
3286
|
+
},
|
|
3287
|
+
return: function _return(r$1) {
|
|
3288
|
+
var n = this.s["return"];
|
|
3289
|
+
return n === undefined ? Promise.resolve({
|
|
3290
|
+
value: r$1,
|
|
3291
|
+
done: true
|
|
3292
|
+
}) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));
|
|
3293
|
+
},
|
|
3294
|
+
throw: function _throw(r$1) {
|
|
3295
|
+
var n = this.s["return"];
|
|
3296
|
+
return n === undefined ? Promise.reject(r$1) : AsyncFromSyncIteratorContinuation(n.apply(this.s, arguments));
|
|
3297
|
+
}
|
|
3298
|
+
}, new AsyncFromSyncIterator(r);
|
|
3299
|
+
}
|
|
3300
|
+
module.exports = _asyncIterator$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
3301
|
+
} });
|
|
3302
|
+
var import_asyncIterator = __toESM(require_asyncIterator(), 1);
|
|
3303
|
+
var import_objectSpread2$12 = __toESM(require_objectSpread2(), 1);
|
|
3304
|
+
var require_usingCtx = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/usingCtx.js"(exports, module) {
|
|
3305
|
+
function _usingCtx() {
|
|
3306
|
+
var r = typeof SuppressedError == "function" ? SuppressedError : function(r$1, e$1) {
|
|
3307
|
+
var n$1 = Error();
|
|
3308
|
+
return n$1.name = "SuppressedError", n$1.error = r$1, n$1.suppressed = e$1, n$1;
|
|
3309
|
+
}, e = {}, n = [];
|
|
3310
|
+
function using(r$1, e$1) {
|
|
3311
|
+
if (e$1 != null) {
|
|
3312
|
+
if (Object(e$1) !== e$1)
|
|
3313
|
+
throw new TypeError("using declarations can only be used with objects, functions, null, or undefined.");
|
|
3314
|
+
if (r$1)
|
|
3315
|
+
var o = e$1[Symbol.asyncDispose || Symbol["for"]("Symbol.asyncDispose")];
|
|
3316
|
+
if (o === undefined && (o = e$1[Symbol.dispose || Symbol["for"]("Symbol.dispose")], r$1))
|
|
3317
|
+
var t = o;
|
|
3318
|
+
if (typeof o != "function")
|
|
3319
|
+
throw new TypeError("Object is not disposable.");
|
|
3320
|
+
t && (o = function o$1() {
|
|
3321
|
+
try {
|
|
3322
|
+
t.call(e$1);
|
|
3323
|
+
} catch (r$2) {
|
|
3324
|
+
return Promise.reject(r$2);
|
|
3325
|
+
}
|
|
3326
|
+
}), n.push({
|
|
3327
|
+
v: e$1,
|
|
3328
|
+
d: o,
|
|
3329
|
+
a: r$1
|
|
3330
|
+
});
|
|
3331
|
+
} else
|
|
3332
|
+
r$1 && n.push({
|
|
3333
|
+
d: e$1,
|
|
3334
|
+
a: r$1
|
|
3335
|
+
});
|
|
3336
|
+
return e$1;
|
|
3337
|
+
}
|
|
3338
|
+
return {
|
|
3339
|
+
e,
|
|
3340
|
+
u: using.bind(null, false),
|
|
3341
|
+
a: using.bind(null, true),
|
|
3342
|
+
d: function d() {
|
|
3343
|
+
var o, t = this.e, s = 0;
|
|
3344
|
+
function next() {
|
|
3345
|
+
for (;o = n.pop(); )
|
|
3346
|
+
try {
|
|
3347
|
+
if (!o.a && s === 1)
|
|
3348
|
+
return s = 0, n.push(o), Promise.resolve().then(next);
|
|
3349
|
+
if (o.d) {
|
|
3350
|
+
var r$1 = o.d.call(o.v);
|
|
3351
|
+
if (o.a)
|
|
3352
|
+
return s |= 2, Promise.resolve(r$1).then(next, err);
|
|
3353
|
+
} else
|
|
3354
|
+
s |= 1;
|
|
3355
|
+
} catch (r$2) {
|
|
3356
|
+
return err(r$2);
|
|
3357
|
+
}
|
|
3358
|
+
if (s === 1)
|
|
3359
|
+
return t !== e ? Promise.reject(t) : Promise.resolve();
|
|
3360
|
+
if (t !== e)
|
|
3361
|
+
throw t;
|
|
3362
|
+
}
|
|
3363
|
+
function err(n$1) {
|
|
3364
|
+
return t = t !== e ? new r(n$1, t) : n$1, next();
|
|
3365
|
+
}
|
|
3366
|
+
return next();
|
|
3367
|
+
}
|
|
3368
|
+
};
|
|
3369
|
+
}
|
|
3370
|
+
module.exports = _usingCtx, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
3371
|
+
} });
|
|
3372
|
+
var require_OverloadYield = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/OverloadYield.js"(exports, module) {
|
|
3373
|
+
function _OverloadYield(e, d) {
|
|
3374
|
+
this.v = e, this.k = d;
|
|
3375
|
+
}
|
|
3376
|
+
module.exports = _OverloadYield, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
3377
|
+
} });
|
|
3378
|
+
var require_awaitAsyncGenerator = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/awaitAsyncGenerator.js"(exports, module) {
|
|
3379
|
+
var OverloadYield$1 = require_OverloadYield();
|
|
3380
|
+
function _awaitAsyncGenerator$1(e) {
|
|
3381
|
+
return new OverloadYield$1(e, 0);
|
|
3382
|
+
}
|
|
3383
|
+
module.exports = _awaitAsyncGenerator$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
3384
|
+
} });
|
|
3385
|
+
var require_wrapAsyncGenerator = __commonJS({ "../../node_modules/.pnpm/@oxc-project+runtime@0.72.2/node_modules/@oxc-project/runtime/src/helpers/wrapAsyncGenerator.js"(exports, module) {
|
|
3386
|
+
var OverloadYield = require_OverloadYield();
|
|
3387
|
+
function _wrapAsyncGenerator$1(e) {
|
|
3388
|
+
return function() {
|
|
3389
|
+
return new AsyncGenerator(e.apply(this, arguments));
|
|
3390
|
+
};
|
|
3391
|
+
}
|
|
3392
|
+
function AsyncGenerator(e) {
|
|
3393
|
+
var r, t;
|
|
3394
|
+
function resume(r$1, t$1) {
|
|
3395
|
+
try {
|
|
3396
|
+
var n = e[r$1](t$1), o = n.value, u = o instanceof OverloadYield;
|
|
3397
|
+
Promise.resolve(u ? o.v : o).then(function(t$2) {
|
|
3398
|
+
if (u) {
|
|
3399
|
+
var i = r$1 === "return" ? "return" : "next";
|
|
3400
|
+
if (!o.k || t$2.done)
|
|
3401
|
+
return resume(i, t$2);
|
|
3402
|
+
t$2 = e[i](t$2).value;
|
|
3403
|
+
}
|
|
3404
|
+
settle(n.done ? "return" : "normal", t$2);
|
|
3405
|
+
}, function(e$1) {
|
|
3406
|
+
resume("throw", e$1);
|
|
3407
|
+
});
|
|
3408
|
+
} catch (e$1) {
|
|
3409
|
+
settle("throw", e$1);
|
|
3410
|
+
}
|
|
3411
|
+
}
|
|
3412
|
+
function settle(e$1, n) {
|
|
3413
|
+
switch (e$1) {
|
|
3414
|
+
case "return":
|
|
3415
|
+
r.resolve({
|
|
3416
|
+
value: n,
|
|
3417
|
+
done: true
|
|
3418
|
+
});
|
|
3419
|
+
break;
|
|
3420
|
+
case "throw":
|
|
3421
|
+
r.reject(n);
|
|
3422
|
+
break;
|
|
3423
|
+
default:
|
|
3424
|
+
r.resolve({
|
|
3425
|
+
value: n,
|
|
3426
|
+
done: false
|
|
3427
|
+
});
|
|
3428
|
+
}
|
|
3429
|
+
(r = r.next) ? resume(r.key, r.arg) : t = null;
|
|
3430
|
+
}
|
|
3431
|
+
this._invoke = function(e$1, n) {
|
|
3432
|
+
return new Promise(function(o, u) {
|
|
3433
|
+
var i = {
|
|
3434
|
+
key: e$1,
|
|
3435
|
+
arg: n,
|
|
3436
|
+
resolve: o,
|
|
3437
|
+
reject: u,
|
|
3438
|
+
next: null
|
|
3439
|
+
};
|
|
3440
|
+
t ? t = t.next = i : (r = t = i, resume(e$1, n));
|
|
3441
|
+
});
|
|
3442
|
+
}, typeof e["return"] != "function" && (this["return"] = undefined);
|
|
3443
|
+
}
|
|
3444
|
+
AsyncGenerator.prototype[typeof Symbol == "function" && Symbol.asyncIterator || "@@asyncIterator"] = function() {
|
|
3445
|
+
return this;
|
|
3446
|
+
}, AsyncGenerator.prototype.next = function(e) {
|
|
3447
|
+
return this._invoke("next", e);
|
|
3448
|
+
}, AsyncGenerator.prototype["throw"] = function(e) {
|
|
3449
|
+
return this._invoke("throw", e);
|
|
3450
|
+
}, AsyncGenerator.prototype["return"] = function(e) {
|
|
3451
|
+
return this._invoke("return", e);
|
|
3452
|
+
};
|
|
3453
|
+
module.exports = _wrapAsyncGenerator$1, module.exports.__esModule = true, module.exports["default"] = module.exports;
|
|
3454
|
+
} });
|
|
3455
|
+
var import_usingCtx = __toESM(require_usingCtx(), 1);
|
|
3456
|
+
var import_awaitAsyncGenerator = __toESM(require_awaitAsyncGenerator(), 1);
|
|
3457
|
+
var import_wrapAsyncGenerator = __toESM(require_wrapAsyncGenerator(), 1);
|
|
3458
|
+
var import_objectSpread29 = __toESM(require_objectSpread2(), 1);
|
|
3459
|
+
|
|
2072
3460
|
// src/client.ts
|
|
2073
|
-
import { createTRPCClient, httpBatchLink } from "@trpc/client";
|
|
2074
3461
|
async function createClient(server) {
|
|
2075
3462
|
const { token, base } = await requireToken(server);
|
|
2076
3463
|
return createTRPCClient({
|
|
@@ -2855,6 +4242,7 @@ function updateCheckDue(last, now = Date.now()) {
|
|
|
2855
4242
|
return Number.isNaN(at) || now - at >= DAY_MS;
|
|
2856
4243
|
}
|
|
2857
4244
|
async function sessionStart() {
|
|
4245
|
+
await flushQuietly();
|
|
2858
4246
|
const config = await readConfig();
|
|
2859
4247
|
if (!updateCheckDue(config.lastUpdateCheck))
|
|
2860
4248
|
return;
|
|
@@ -2868,8 +4256,6 @@ async function sessionStart() {
|
|
|
2868
4256
|
console.log(`yourskills: ${moved} skill(s) behind your registry — run \`yourskills update\``);
|
|
2869
4257
|
}
|
|
2870
4258
|
}
|
|
2871
|
-
if (await trackingEnabled())
|
|
2872
|
-
await flush(client);
|
|
2873
4259
|
}
|
|
2874
4260
|
async function runHook(event) {
|
|
2875
4261
|
try {
|
|
@@ -3449,7 +4835,7 @@ Options:
|
|
|
3449
4835
|
-h, --help Show this help
|
|
3450
4836
|
|
|
3451
4837
|
Environment:
|
|
3452
|
-
YOURSKILLS_URL Registry base URL (default
|
|
4838
|
+
YOURSKILLS_URL Registry base URL (default api.yourskills.store)
|
|
3453
4839
|
YOURSKILLS_NO_TRACK Set to 1 to disable usage counting outright`;
|
|
3454
4840
|
function configCommand(rest) {
|
|
3455
4841
|
const [action, key, ...value] = rest;
|
|
@@ -3622,12 +5008,11 @@ function parseArgv(args, interactive = true) {
|
|
|
3622
5008
|
}
|
|
3623
5009
|
|
|
3624
5010
|
// src/client.ts
|
|
3625
|
-
import { createTRPCClient as createTRPCClient2, httpBatchLink as httpBatchLink2 } from "@trpc/client";
|
|
3626
5011
|
async function createClient2(server) {
|
|
3627
5012
|
const { token, base } = await requireToken(server);
|
|
3628
|
-
return
|
|
5013
|
+
return createTRPCClient({
|
|
3629
5014
|
links: [
|
|
3630
|
-
|
|
5015
|
+
httpBatchLink({
|
|
3631
5016
|
url: `${base.replace(/\/$/, "")}/trpc`,
|
|
3632
5017
|
headers: () => ({ authorization: `Bearer ${token}` })
|
|
3633
5018
|
})
|
|
@@ -3861,14 +5246,12 @@ function HelpScreen({ text }) {
|
|
|
3861
5246
|
// package.json
|
|
3862
5247
|
var package_default = {
|
|
3863
5248
|
name: "yourskills",
|
|
3864
|
-
version: "0.1.
|
|
5249
|
+
version: "0.1.2",
|
|
3865
5250
|
description: "Browse, install and keep up to date the agent skills and bundles your team publishes on yourskills.",
|
|
3866
|
-
license: "
|
|
3867
|
-
homepage: "https://
|
|
3868
|
-
|
|
3869
|
-
|
|
3870
|
-
url: "git+https://github.com/xiduzo/yourskills.git",
|
|
3871
|
-
directory: "apps/cli"
|
|
5251
|
+
license: "UNLICENSED",
|
|
5252
|
+
homepage: "https://yourskills.store",
|
|
5253
|
+
bugs: {
|
|
5254
|
+
url: "https://yourskills.store"
|
|
3872
5255
|
},
|
|
3873
5256
|
keywords: [
|
|
3874
5257
|
"agent-skills",
|
|
@@ -3900,8 +5283,6 @@ var package_default = {
|
|
|
3900
5283
|
prepublishOnly: "bun run build"
|
|
3901
5284
|
},
|
|
3902
5285
|
dependencies: {
|
|
3903
|
-
"@trpc/client": "^11.18.0",
|
|
3904
|
-
"@trpc/server": "^11.18.0",
|
|
3905
5286
|
ink: "^7.1.1",
|
|
3906
5287
|
react: "^19.2.8",
|
|
3907
5288
|
skills: "^1.5.25"
|