@midsummer-ai/sdk 0.1.0-staging.5036 → 0.1.0-staging.5059
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/THIRD-PARTY-NOTICES +0 -26
- package/auth/contract.mjs +1 -1
- package/auth/index.mjs +1 -1
- package/auth/password.mjs +1 -1
- package/{auth-Dp3oUiLB.mjs → auth-Cq_UKvop.mjs} +1 -1
- package/{authorize-BzDrbYtI-0gOzDrp2.mjs → authorize-BzDrbYtI-BOTNiImu.mjs} +4 -553
- package/client.d.mts +1 -1
- package/client.mjs +1 -1
- package/contract.d.mts +1 -1
- package/contract.mjs +40 -2
- package/database/stand-in.d.mts +1 -1
- package/database/stand-in.mjs +1 -1
- package/{dist-DXtY-DJA.mjs → dist-CVKQXPsH.mjs} +2 -2
- package/{engine-CmTP59GT.mjs → engine-UPVFI808.mjs} +7 -4
- package/{errors-B1tO_wdm.mjs → errors-BY4sZe52.mjs} +2 -1
- package/{factory-9jfDGyc1.mjs → factory-KME_pxnd.mjs} +1 -1
- package/{get-id-field-vhOArqXN.mjs → get-id-field-D2HgdhsI.mjs} +2 -321
- package/here-C2jhTheQ.mjs +1 -1
- package/{index-BhrtT3r7.d.mts → index-7AbnNJLx.d.mts} +17 -2
- package/index.d.mts +1 -1
- package/index.mjs +2 -2
- package/{names-C-VZGec6.mjs → names-Dk-eRYJU.mjs} +21 -2
- package/package.json +2 -1
- package/s3.d.mts +1 -1
- package/s3.mjs +5 -4
- package/socket.d.mts +1 -1
- package/socket.mjs +1 -1
- package/{src-CKKUcBlb.mjs → src-CQmtQTvJ.mjs} +7 -3
- package/stand-in.d.mts +1 -1
- package/stand-in.mjs +7 -2
- package/storage/contract.mjs +1 -1
- package/storage/files.d.mts +1 -1
- package/storage/files.mjs +2 -2
- package/wire.d.mts +1 -1
- package/wire.mjs +9 -4
package/THIRD-PARTY-NOTICES
CHANGED
|
@@ -306,32 +306,6 @@ THE SOFTWARE.
|
|
|
306
306
|
|
|
307
307
|
---
|
|
308
308
|
|
|
309
|
-
@noble/hashes 2.4.0 (MIT)
|
|
310
|
-
|
|
311
|
-
The MIT License (MIT)
|
|
312
|
-
|
|
313
|
-
Copyright (c) 2022 Paul Miller (https://paulmillr.com)
|
|
314
|
-
|
|
315
|
-
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
316
|
-
of this software and associated documentation files (the “Software”), to deal
|
|
317
|
-
in the Software without restriction, including without limitation the rights
|
|
318
|
-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
319
|
-
copies of the Software, and to permit persons to whom the Software is
|
|
320
|
-
furnished to do so, subject to the following conditions:
|
|
321
|
-
|
|
322
|
-
The above copyright notice and this permission notice shall be included in
|
|
323
|
-
all copies or substantial portions of the Software.
|
|
324
|
-
|
|
325
|
-
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
326
|
-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
327
|
-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
328
|
-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
329
|
-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
330
|
-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
|
331
|
-
THE SOFTWARE.
|
|
332
|
-
|
|
333
|
-
---
|
|
334
|
-
|
|
335
309
|
@opentelemetry/api 1.9.0 (Apache-2.0)
|
|
336
310
|
|
|
337
311
|
Apache License
|
package/auth/contract.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { s as AuthError } from "../auth-
|
|
1
|
+
import { s as AuthError } from "../auth-Cq_UKvop.mjs";
|
|
2
2
|
import { d as SETTINGS_TTL_MS, n as LIMIT_WINDOW_MS, t as LIMITS } from "../guard-VPI6xq4z.mjs";
|
|
3
3
|
import { IMPERSONATION_TOKEN_MS, startImpersonation } from "./impersonate.mjs";
|
|
4
4
|
//#region src/auth/contract.ts
|
package/auth/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { a as createAuth, i as auth, n as AUTH_ROUTES, o as databaseStore, r as SESSION_CACHE_S, s as AuthError, t as AUTH_PATH } from "../auth-
|
|
1
|
+
import { a as createAuth, i as auth, n as AUTH_ROUTES, o as databaseStore, r as SESSION_CACHE_S, s as AuthError, t as AUTH_PATH } from "../auth-Cq_UKvop.mjs";
|
|
2
2
|
import { checkSignInMail, signInWords } from "./mail.mjs";
|
|
3
3
|
import { n as authFiles } from "../files-ZySaprII.mjs";
|
|
4
4
|
import { IMPERSONATION_S } from "./impersonate.mjs";
|
package/auth/password.mjs
CHANGED
|
@@ -1269,7 +1269,7 @@ const DAY_S = 86400;
|
|
|
1269
1269
|
* the engine (a session with no cookie, the settings, the hosted pages), never load it. Loaded at import, it added 0.2
|
|
1270
1270
|
* to 0.6 s to the first answer of each new copy of a Next.js app's server on Midsummer.
|
|
1271
1271
|
*/
|
|
1272
|
-
const engineAdapter = () => import("./engine-
|
|
1272
|
+
const engineAdapter = () => import("./engine-UPVFI808.mjs").then((n) => n.t);
|
|
1273
1273
|
const keyOf = (row) => ({
|
|
1274
1274
|
id: row.id,
|
|
1275
1275
|
name: row.name,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { r as __exportAll$1 } from "./rolldown-runtime-CL6CfywC.mjs";
|
|
2
|
-
import { A as
|
|
2
|
+
import { A as isDevelopment, C as logger, D as env, M as isTest, _ as toBufferSource, a as createRandomStringGenerator, b as getAuthTables, f as ATTR_HTTP_ROUTE, g as base64Url, h as base64, j as isProduction, m as hex, o as createWithSpan, p as ATTR_OPERATION_ID, s as ATTR_CONTEXT, t as encodeDeterministicId, u as ATTR_HOOK_TYPE, w as shouldPublishLog, y as safeJSONParse } from "./get-id-field-D2HgdhsI.mjs";
|
|
3
3
|
import { A as _coercedString, B as __getBetterAuthGlobal, C as string$1, E as url, F as BetterAuthError, I as APIError$1, L as BetterCallError, M as toDotPath, N as NEVER, O as _coercedBoolean, P as APIError, R as ValidationError$1, T as unknown, V as __getCurrentEndpointContext, _ as never, a as ZodString, b as optional, c as array, f as ipv4, g as looseObject, h as literal, i as ZodOptional, j as validate, k as _coercedNumber, l as boolean$1, n as ZodNumber, o as _enum, p as ipv6, r as ZodObject, t as ZodBoolean, u as date, v as number$1, w as union, x as record, y as object, z as kAPIErrorHeaderSymbol } from "./schemas-DTJTcCdK.mjs";
|
|
4
4
|
import { i as getAsyncLocalStorage, t as defineRequestState } from "./request-state-BaLB2Hrt.mjs";
|
|
5
|
+
import { hkdf } from "@noble/hashes/hkdf.js";
|
|
6
|
+
import { sha256 } from "@noble/hashes/sha2.js";
|
|
5
7
|
//#region ../../node_modules/.bun/better-auth@1.7.18+d2a99e59e2beabd0/node_modules/better-auth/dist/utils/wildcard.mjs
|
|
6
8
|
/**
|
|
7
9
|
* Escapes a character if it has a special meaning in regular expressions
|
|
@@ -421,557 +423,6 @@ function shouldBindAccountCookieToSessionUser(options) {
|
|
|
421
423
|
return hasServerAccountStore(options);
|
|
422
424
|
}
|
|
423
425
|
//#endregion
|
|
424
|
-
//#region ../../node_modules/.bun/@noble+hashes@2.4.0/node_modules/@noble/hashes/hmac.js
|
|
425
|
-
/**
|
|
426
|
-
* HMAC: RFC2104 message authentication code.
|
|
427
|
-
* @module
|
|
428
|
-
*/
|
|
429
|
-
/**
|
|
430
|
-
* Internal class for HMAC.
|
|
431
|
-
* Accepts any byte key, although RFC 2104 §3 recommends keys at least
|
|
432
|
-
* `HashLen` bytes long.
|
|
433
|
-
*/
|
|
434
|
-
var _HMAC = class {
|
|
435
|
-
oHash;
|
|
436
|
-
iHash;
|
|
437
|
-
blockLen;
|
|
438
|
-
outputLen;
|
|
439
|
-
canXOF = false;
|
|
440
|
-
finished = false;
|
|
441
|
-
destroyed = false;
|
|
442
|
-
constructor(hash, key) {
|
|
443
|
-
ahash(hash);
|
|
444
|
-
abytes$1(key, void 0, "key");
|
|
445
|
-
this.iHash = hash.create();
|
|
446
|
-
if (typeof this.iHash.update !== "function") throw new Error("expected Hash instance");
|
|
447
|
-
this.blockLen = this.iHash.blockLen;
|
|
448
|
-
this.outputLen = this.iHash.outputLen;
|
|
449
|
-
const blockLen = this.blockLen;
|
|
450
|
-
const pad = new Uint8Array(blockLen);
|
|
451
|
-
pad.set(key.length > blockLen ? hash.create().update(key).digest() : key);
|
|
452
|
-
for (let i = 0; i < pad.length; i++) pad[i] ^= 54;
|
|
453
|
-
this.iHash.update(pad);
|
|
454
|
-
this.oHash = hash.create();
|
|
455
|
-
for (let i = 0; i < pad.length; i++) pad[i] ^= 106;
|
|
456
|
-
this.oHash.update(pad);
|
|
457
|
-
clean$1(pad);
|
|
458
|
-
}
|
|
459
|
-
update(buf) {
|
|
460
|
-
aexists$1(this);
|
|
461
|
-
this.iHash.update(buf);
|
|
462
|
-
return this;
|
|
463
|
-
}
|
|
464
|
-
digestInto(out) {
|
|
465
|
-
aexists$1(this);
|
|
466
|
-
aoutput$1(out, this);
|
|
467
|
-
this.finished = true;
|
|
468
|
-
const buf = out.subarray(0, this.outputLen);
|
|
469
|
-
this.iHash.digestInto(buf);
|
|
470
|
-
this.oHash.update(buf);
|
|
471
|
-
this.oHash.digestInto(buf);
|
|
472
|
-
this.destroy();
|
|
473
|
-
}
|
|
474
|
-
digest() {
|
|
475
|
-
const out = new Uint8Array(this.oHash.outputLen);
|
|
476
|
-
this.digestInto(out);
|
|
477
|
-
return out;
|
|
478
|
-
}
|
|
479
|
-
_cloneInto(to) {
|
|
480
|
-
to ||= Object.create(Object.getPrototypeOf(this), {});
|
|
481
|
-
const { oHash, iHash, finished, destroyed, blockLen, outputLen, canXOF } = this;
|
|
482
|
-
to = to;
|
|
483
|
-
to.finished = finished;
|
|
484
|
-
to.destroyed = destroyed;
|
|
485
|
-
to.blockLen = blockLen;
|
|
486
|
-
to.outputLen = outputLen;
|
|
487
|
-
to.canXOF = canXOF;
|
|
488
|
-
to.oHash = oHash._cloneInto(to.oHash);
|
|
489
|
-
to.iHash = iHash._cloneInto(to.iHash);
|
|
490
|
-
return to;
|
|
491
|
-
}
|
|
492
|
-
clone() {
|
|
493
|
-
return this._cloneInto();
|
|
494
|
-
}
|
|
495
|
-
destroy() {
|
|
496
|
-
this.destroyed = true;
|
|
497
|
-
this.oHash.destroy();
|
|
498
|
-
this.iHash.destroy();
|
|
499
|
-
}
|
|
500
|
-
};
|
|
501
|
-
const hmac$1 = /* @__PURE__ */ (() => {
|
|
502
|
-
const hmac_ = ((hash, key, message) => new _HMAC(hash, key).update(message).digest());
|
|
503
|
-
hmac_.create = (hash, key) => new _HMAC(hash, key);
|
|
504
|
-
return hmac_;
|
|
505
|
-
})();
|
|
506
|
-
//#endregion
|
|
507
|
-
//#region ../../node_modules/.bun/@noble+hashes@2.4.0/node_modules/@noble/hashes/hkdf.js
|
|
508
|
-
/**
|
|
509
|
-
* HKDF (RFC 5869): extract + expand in one step.
|
|
510
|
-
* See {@link https://soatok.blog/2021/11/17/understanding-hkdf/}.
|
|
511
|
-
* @module
|
|
512
|
-
*/
|
|
513
|
-
const HKDF_COUNTER = /* @__PURE__ */ Uint8Array.of(0);
|
|
514
|
-
const EMPTY_BUFFER = /* @__PURE__ */ Uint8Array.of();
|
|
515
|
-
/**
|
|
516
|
-
* HKDF-expand from the spec. The most important part. `HKDF-Expand(PRK, info, L) -> OKM`
|
|
517
|
-
* @param hash - hash function that would be used (e.g. sha256)
|
|
518
|
-
* @param prk - a pseudorandom key of at least HashLen octets
|
|
519
|
-
* (usually, the output from the extract step)
|
|
520
|
-
* @param info - optional context and application specific information (can be a zero-length string)
|
|
521
|
-
* @param length - length of output keying material in bytes.
|
|
522
|
-
* RFC 5869 §2.3 allows `0..255*HashLen`, so `0` returns an empty OKM.
|
|
523
|
-
* @param _recycled - Internal destroyed extract hashes owned by the combined `hkdf()` call.
|
|
524
|
-
* @returns Output keying material with the requested length.
|
|
525
|
-
* @throws If the requested output length exceeds the HKDF limit
|
|
526
|
-
* for the selected hash. {@link Error}
|
|
527
|
-
* @example
|
|
528
|
-
* Run the HKDF expand step.
|
|
529
|
-
* ```ts
|
|
530
|
-
* import { expand } from '@noble/hashes/hkdf.js';
|
|
531
|
-
* import { sha256 } from '@noble/hashes/sha2.js';
|
|
532
|
-
* expand(sha256, new Uint8Array(32), new Uint8Array([1, 2, 3]), 16);
|
|
533
|
-
* ```
|
|
534
|
-
*/
|
|
535
|
-
function expand(hash, prk, info, length = 32, _recycled) {
|
|
536
|
-
ahash(hash);
|
|
537
|
-
anumber$1(length, "length");
|
|
538
|
-
abytes$1(prk, void 0, "prk");
|
|
539
|
-
const olen = hash.outputLen;
|
|
540
|
-
if (prk.length < olen) throw new Error("\"prk\" must be at least HashLen octets");
|
|
541
|
-
if (length > 255 * olen) throw new Error("Length must be <= 255*HashLen");
|
|
542
|
-
const blocks = Math.ceil(length / olen);
|
|
543
|
-
if (info === void 0) info = EMPTY_BUFFER;
|
|
544
|
-
else abytes$1(info, void 0, "info");
|
|
545
|
-
if (!blocks) {
|
|
546
|
-
if (_recycled) clean$1(prk);
|
|
547
|
-
return /* @__PURE__ */ new Uint8Array();
|
|
548
|
-
}
|
|
549
|
-
const okm = _recycled && blocks === 1 ? prk : new Uint8Array(blocks * olen);
|
|
550
|
-
const { iHash, oHash } = hmac$1.create(hash, prk);
|
|
551
|
-
const T = _recycled ? prk : new Uint8Array(olen);
|
|
552
|
-
const worker = blocks > 1 ? _recycled?.iHash || hash.create() : void 0;
|
|
553
|
-
for (let counter = 0; counter < blocks - 1; counter++) {
|
|
554
|
-
HKDF_COUNTER[0] = counter + 1;
|
|
555
|
-
const iWork = iHash._cloneInto(worker);
|
|
556
|
-
if (counter) iWork.update(T);
|
|
557
|
-
iWork.update(info).update(HKDF_COUNTER).digestInto(T);
|
|
558
|
-
oHash._cloneInto(worker).update(T).digestInto(T);
|
|
559
|
-
okm.set(T, olen * counter);
|
|
560
|
-
}
|
|
561
|
-
HKDF_COUNTER[0] = blocks;
|
|
562
|
-
if (blocks > 1) iHash.update(T);
|
|
563
|
-
iHash.update(info).update(HKDF_COUNTER).digestInto(T);
|
|
564
|
-
oHash.update(T).digestInto(T);
|
|
565
|
-
okm.set(T, olen * (blocks - 1));
|
|
566
|
-
iHash.destroy();
|
|
567
|
-
oHash.destroy();
|
|
568
|
-
worker?.destroy();
|
|
569
|
-
if (T !== okm) clean$1(T);
|
|
570
|
-
clean$1(HKDF_COUNTER);
|
|
571
|
-
if (length === okm.length) return okm;
|
|
572
|
-
const res = okm.slice(0, length);
|
|
573
|
-
clean$1(okm);
|
|
574
|
-
return res;
|
|
575
|
-
}
|
|
576
|
-
/**
|
|
577
|
-
* HKDF (RFC 5869): derive keys from an initial input.
|
|
578
|
-
* Combines hkdf_extract + hkdf_expand in one step
|
|
579
|
-
* @param hash - hash function that would be used (e.g. sha256)
|
|
580
|
-
* @param ikm - input keying material, the initial key
|
|
581
|
-
* @param salt - optional salt value (a non-secret random value)
|
|
582
|
-
* @param info - optional context and application specific information bytes
|
|
583
|
-
* @param length - length of output keying material in bytes.
|
|
584
|
-
* RFC 5869 §2.3 allows `0..255*HashLen`, so `0` returns an empty OKM.
|
|
585
|
-
* @returns Output keying material derived from the input key.
|
|
586
|
-
* @throws If the requested output length exceeds the HKDF limit
|
|
587
|
-
* for the selected hash. {@link Error}
|
|
588
|
-
* @example
|
|
589
|
-
* HKDF (RFC 5869): derive keys from an initial input.
|
|
590
|
-
* ```ts
|
|
591
|
-
* import { hkdf } from '@noble/hashes/hkdf.js';
|
|
592
|
-
* import { sha256 } from '@noble/hashes/sha2.js';
|
|
593
|
-
* import { randomBytes, utf8ToBytes } from '@noble/hashes/utils.js';
|
|
594
|
-
* const inputKey = randomBytes(32);
|
|
595
|
-
* const salt = randomBytes(32);
|
|
596
|
-
* const info = utf8ToBytes('application-key');
|
|
597
|
-
* const okm = hkdf(sha256, inputKey, salt, info, 32);
|
|
598
|
-
* ```
|
|
599
|
-
*/
|
|
600
|
-
const hkdf = (hash, ikm, salt, info, length) => {
|
|
601
|
-
ahash(hash);
|
|
602
|
-
if (salt === void 0) salt = new Uint8Array(hash.outputLen);
|
|
603
|
-
const HMAC = hmac$1.create(hash, salt).update(ikm);
|
|
604
|
-
return expand(hash, HMAC.digest(), info, length, HMAC);
|
|
605
|
-
};
|
|
606
|
-
//#endregion
|
|
607
|
-
//#region ../../node_modules/.bun/@noble+hashes@2.4.0/node_modules/@noble/hashes/_u64.js
|
|
608
|
-
const fromNumH = (n) => n / 2 ** 32 | 0;
|
|
609
|
-
const fromNumL = (n) => n >>> 0;
|
|
610
|
-
function setU64FromNum(view, byteOffset, n, isLE) {
|
|
611
|
-
const h = fromNumH(n);
|
|
612
|
-
const l = fromNumL(n);
|
|
613
|
-
view.setUint32(byteOffset, isLE ? l : h, isLE);
|
|
614
|
-
view.setUint32(byteOffset + 4, isLE ? h : l, isLE);
|
|
615
|
-
}
|
|
616
|
-
//#endregion
|
|
617
|
-
//#region ../../node_modules/.bun/@noble+hashes@2.4.0/node_modules/@noble/hashes/_md.js
|
|
618
|
-
/**
|
|
619
|
-
* Internal Merkle-Damgard hash utils.
|
|
620
|
-
* @module
|
|
621
|
-
*/
|
|
622
|
-
/**
|
|
623
|
-
* Shared 32-bit conditional boolean primitive reused by SHA-256, SHA-1, and MD5 `F`.
|
|
624
|
-
* Returns bits from `b` when `a` is set, otherwise from `c`.
|
|
625
|
-
* The XOR form is equivalent to MD5's `F(X,Y,Z) = XY v not(X)Z` because the masked terms never
|
|
626
|
-
* set the same bit.
|
|
627
|
-
* @param a - selector word
|
|
628
|
-
* @param b - word chosen when selector bit is set
|
|
629
|
-
* @param c - word chosen when selector bit is clear
|
|
630
|
-
* @returns Mixed 32-bit word.
|
|
631
|
-
* @example
|
|
632
|
-
* Combine three words with the shared 32-bit choice primitive.
|
|
633
|
-
* ```ts
|
|
634
|
-
* Chi(0xffffffff, 0x12345678, 0x87654321);
|
|
635
|
-
* ```
|
|
636
|
-
*/
|
|
637
|
-
function Chi(a, b, c) {
|
|
638
|
-
return a & b ^ ~a & c;
|
|
639
|
-
}
|
|
640
|
-
/**
|
|
641
|
-
* Shared 32-bit majority primitive reused by SHA-256 and SHA-1.
|
|
642
|
-
* Returns bits shared by at least two inputs.
|
|
643
|
-
* @param a - first input word
|
|
644
|
-
* @param b - second input word
|
|
645
|
-
* @param c - third input word
|
|
646
|
-
* @returns Mixed 32-bit word.
|
|
647
|
-
* @example
|
|
648
|
-
* Combine three words with the shared 32-bit majority primitive.
|
|
649
|
-
* ```ts
|
|
650
|
-
* Maj(0xffffffff, 0x12345678, 0x87654321);
|
|
651
|
-
* ```
|
|
652
|
-
*/
|
|
653
|
-
function Maj(a, b, c) {
|
|
654
|
-
return a & b ^ a & c ^ b & c;
|
|
655
|
-
}
|
|
656
|
-
/**
|
|
657
|
-
* Merkle-Damgard hash construction base class.
|
|
658
|
-
* Could be used to create MD5, RIPEMD, SHA1, SHA2.
|
|
659
|
-
* Accepts only byte-aligned `Uint8Array` input, even when the underlying spec describes bit
|
|
660
|
-
* strings with partial-byte tails.
|
|
661
|
-
* @param blockLen - internal block size in bytes
|
|
662
|
-
* @param outputLen - digest size in bytes
|
|
663
|
-
* @param padOffset - trailing length field size in bytes
|
|
664
|
-
* @param isLE - whether length and state words are encoded in little-endian
|
|
665
|
-
* @example
|
|
666
|
-
* Use a concrete subclass to get the shared Merkle-Damgard update/digest flow.
|
|
667
|
-
* ```ts
|
|
668
|
-
* import { _SHA1 } from '@noble/hashes/legacy.js';
|
|
669
|
-
* const hash = new _SHA1();
|
|
670
|
-
* hash.update(new Uint8Array([97, 98, 99]));
|
|
671
|
-
* hash.digest();
|
|
672
|
-
* ```
|
|
673
|
-
*/
|
|
674
|
-
var HashMD = class {
|
|
675
|
-
blockLen;
|
|
676
|
-
outputLen;
|
|
677
|
-
canXOF = false;
|
|
678
|
-
padOffset;
|
|
679
|
-
isLE;
|
|
680
|
-
buffer;
|
|
681
|
-
view;
|
|
682
|
-
finished = false;
|
|
683
|
-
length = 0;
|
|
684
|
-
pos = 0;
|
|
685
|
-
destroyed = false;
|
|
686
|
-
constructor(blockLen, outputLen, padOffset, isLE) {
|
|
687
|
-
this.blockLen = blockLen;
|
|
688
|
-
this.outputLen = outputLen;
|
|
689
|
-
this.padOffset = padOffset;
|
|
690
|
-
this.isLE = isLE;
|
|
691
|
-
this.buffer = new Uint8Array(blockLen);
|
|
692
|
-
this.view = createView$1(this.buffer);
|
|
693
|
-
}
|
|
694
|
-
update(data) {
|
|
695
|
-
aexists$1(this);
|
|
696
|
-
abytes$1(data);
|
|
697
|
-
const { view, buffer, blockLen } = this;
|
|
698
|
-
const len = data.length;
|
|
699
|
-
let processed = false;
|
|
700
|
-
for (let pos = 0; pos < len;) {
|
|
701
|
-
const take = Math.min(blockLen - this.pos, len - pos);
|
|
702
|
-
if (take === blockLen) {
|
|
703
|
-
const dataView = createView$1(data);
|
|
704
|
-
for (; blockLen <= len - pos; pos += blockLen) this.process(dataView, pos);
|
|
705
|
-
processed = true;
|
|
706
|
-
continue;
|
|
707
|
-
}
|
|
708
|
-
buffer.set(pos === 0 && take === len ? data : data.subarray(pos, pos + take), this.pos);
|
|
709
|
-
this.pos += take;
|
|
710
|
-
pos += take;
|
|
711
|
-
if (this.pos === blockLen) {
|
|
712
|
-
this.process(view, 0);
|
|
713
|
-
this.pos = 0;
|
|
714
|
-
processed = true;
|
|
715
|
-
}
|
|
716
|
-
}
|
|
717
|
-
this.length += data.length;
|
|
718
|
-
if (processed) this.roundClean();
|
|
719
|
-
return this;
|
|
720
|
-
}
|
|
721
|
-
digestInto(out) {
|
|
722
|
-
aexists$1(this);
|
|
723
|
-
aoutput$1(out, this);
|
|
724
|
-
this.finished = true;
|
|
725
|
-
const { buffer, view, blockLen, isLE } = this;
|
|
726
|
-
let { pos } = this;
|
|
727
|
-
buffer[pos++] = 128;
|
|
728
|
-
buffer.fill(0, pos);
|
|
729
|
-
if (this.padOffset > blockLen - pos) {
|
|
730
|
-
this.process(view, 0);
|
|
731
|
-
buffer.fill(0);
|
|
732
|
-
}
|
|
733
|
-
setU64FromNum(view, blockLen - 8, this.length * 8, isLE);
|
|
734
|
-
this.process(view, 0);
|
|
735
|
-
this.roundClean();
|
|
736
|
-
const oview = out === buffer ? view : createView$1(out);
|
|
737
|
-
const len = this.outputLen;
|
|
738
|
-
const outLen = len / 4;
|
|
739
|
-
const state = this.get();
|
|
740
|
-
if (len % 4 || outLen > state.length) throw new Error("invalid outputLen");
|
|
741
|
-
for (let i = 0; i < outLen; i++) oview.setUint32(4 * i, state[i], isLE);
|
|
742
|
-
}
|
|
743
|
-
digest() {
|
|
744
|
-
const { buffer, outputLen } = this;
|
|
745
|
-
this.digestInto(buffer);
|
|
746
|
-
const res = buffer.slice(0, outputLen);
|
|
747
|
-
this.destroy();
|
|
748
|
-
return res;
|
|
749
|
-
}
|
|
750
|
-
_cloneIntoMeta(to) {
|
|
751
|
-
const { buffer, length, finished, destroyed, pos } = this;
|
|
752
|
-
to.destroyed = destroyed;
|
|
753
|
-
to.finished = finished;
|
|
754
|
-
to.length = length;
|
|
755
|
-
to.pos = pos;
|
|
756
|
-
if (pos) to.buffer.set(buffer);
|
|
757
|
-
return to;
|
|
758
|
-
}
|
|
759
|
-
clone() {
|
|
760
|
-
return this._cloneInto();
|
|
761
|
-
}
|
|
762
|
-
};
|
|
763
|
-
/**
|
|
764
|
-
* Initial SHA-2 state: fractional parts of square roots of first 16 primes 2..53.
|
|
765
|
-
* Check out `test/misc/sha2-gen-iv.js` for recomputation guide.
|
|
766
|
-
*/
|
|
767
|
-
/** Initial SHA256 state from RFC 6234 §6.1: the first 32 bits of the fractional parts of the
|
|
768
|
-
* square roots of the first eight prime numbers. Exported as a shared table; callers must treat
|
|
769
|
-
* it as read-only because constructors copy words from it by index. */
|
|
770
|
-
const SHA256_IV = /* @__PURE__ */ Uint32Array.from([
|
|
771
|
-
1779033703,
|
|
772
|
-
3144134277,
|
|
773
|
-
1013904242,
|
|
774
|
-
2773480762,
|
|
775
|
-
1359893119,
|
|
776
|
-
2600822924,
|
|
777
|
-
528734635,
|
|
778
|
-
1541459225
|
|
779
|
-
]);
|
|
780
|
-
//#endregion
|
|
781
|
-
//#region ../../node_modules/.bun/@noble+hashes@2.4.0/node_modules/@noble/hashes/sha2.js
|
|
782
|
-
/**
|
|
783
|
-
* SHA2 hash function. A.k.a. sha256, sha384, sha512, sha512_224, sha512_256.
|
|
784
|
-
* SHA256 is the fastest hash implementable in JS, even faster than Blake3.
|
|
785
|
-
* Check out {@link https://www.rfc-editor.org/rfc/rfc4634 | RFC 4634} and
|
|
786
|
-
* {@link https://nvlpubs.nist.gov/nistpubs/FIPS/NIST.FIPS.180-4.pdf | FIPS 180-4}.
|
|
787
|
-
* @module
|
|
788
|
-
*/
|
|
789
|
-
/**
|
|
790
|
-
* SHA-224 / SHA-256 round constants from RFC 6234 §5.1: the first 32 bits
|
|
791
|
-
* of the cube roots of the first 64 primes (2..311).
|
|
792
|
-
*/
|
|
793
|
-
const SHA256_K = /* @__PURE__ */ Uint32Array.from([
|
|
794
|
-
1116352408,
|
|
795
|
-
1899447441,
|
|
796
|
-
3049323471,
|
|
797
|
-
3921009573,
|
|
798
|
-
961987163,
|
|
799
|
-
1508970993,
|
|
800
|
-
2453635748,
|
|
801
|
-
2870763221,
|
|
802
|
-
3624381080,
|
|
803
|
-
310598401,
|
|
804
|
-
607225278,
|
|
805
|
-
1426881987,
|
|
806
|
-
1925078388,
|
|
807
|
-
2162078206,
|
|
808
|
-
2614888103,
|
|
809
|
-
3248222580,
|
|
810
|
-
3835390401,
|
|
811
|
-
4022224774,
|
|
812
|
-
264347078,
|
|
813
|
-
604807628,
|
|
814
|
-
770255983,
|
|
815
|
-
1249150122,
|
|
816
|
-
1555081692,
|
|
817
|
-
1996064986,
|
|
818
|
-
2554220882,
|
|
819
|
-
2821834349,
|
|
820
|
-
2952996808,
|
|
821
|
-
3210313671,
|
|
822
|
-
3336571891,
|
|
823
|
-
3584528711,
|
|
824
|
-
113926993,
|
|
825
|
-
338241895,
|
|
826
|
-
666307205,
|
|
827
|
-
773529912,
|
|
828
|
-
1294757372,
|
|
829
|
-
1396182291,
|
|
830
|
-
1695183700,
|
|
831
|
-
1986661051,
|
|
832
|
-
2177026350,
|
|
833
|
-
2456956037,
|
|
834
|
-
2730485921,
|
|
835
|
-
2820302411,
|
|
836
|
-
3259730800,
|
|
837
|
-
3345764771,
|
|
838
|
-
3516065817,
|
|
839
|
-
3600352804,
|
|
840
|
-
4094571909,
|
|
841
|
-
275423344,
|
|
842
|
-
430227734,
|
|
843
|
-
506948616,
|
|
844
|
-
659060556,
|
|
845
|
-
883997877,
|
|
846
|
-
958139571,
|
|
847
|
-
1322822218,
|
|
848
|
-
1537002063,
|
|
849
|
-
1747873779,
|
|
850
|
-
1955562222,
|
|
851
|
-
2024104815,
|
|
852
|
-
2227730452,
|
|
853
|
-
2361852424,
|
|
854
|
-
2428436474,
|
|
855
|
-
2756734187,
|
|
856
|
-
3204031479,
|
|
857
|
-
3329325298
|
|
858
|
-
]);
|
|
859
|
-
/** Reusable SHA-224 / SHA-256 message schedule buffer `W_t` from RFC 6234 §6.2 step 1. */
|
|
860
|
-
const SHA256_W = /* @__PURE__ */ new Uint32Array(64);
|
|
861
|
-
/** Internal SHA-224 / SHA-256 compression engine from RFC 6234 §6.2. */
|
|
862
|
-
var SHA2_32B = class extends HashMD {
|
|
863
|
-
A = 0;
|
|
864
|
-
B = 0;
|
|
865
|
-
C = 0;
|
|
866
|
-
D = 0;
|
|
867
|
-
E = 0;
|
|
868
|
-
F = 0;
|
|
869
|
-
G = 0;
|
|
870
|
-
H = 0;
|
|
871
|
-
constructor(outputLen, IV) {
|
|
872
|
-
super(64, outputLen, 8, false);
|
|
873
|
-
this.A = IV[0] | 0;
|
|
874
|
-
this.B = IV[1] | 0;
|
|
875
|
-
this.C = IV[2] | 0;
|
|
876
|
-
this.D = IV[3] | 0;
|
|
877
|
-
this.E = IV[4] | 0;
|
|
878
|
-
this.F = IV[5] | 0;
|
|
879
|
-
this.G = IV[6] | 0;
|
|
880
|
-
this.H = IV[7] | 0;
|
|
881
|
-
}
|
|
882
|
-
get() {
|
|
883
|
-
const { A, B, C, D, E, F, G, H } = this;
|
|
884
|
-
return [
|
|
885
|
-
A,
|
|
886
|
-
B,
|
|
887
|
-
C,
|
|
888
|
-
D,
|
|
889
|
-
E,
|
|
890
|
-
F,
|
|
891
|
-
G,
|
|
892
|
-
H
|
|
893
|
-
];
|
|
894
|
-
}
|
|
895
|
-
set(A, B, C, D, E, F, G, H) {
|
|
896
|
-
this.A = A | 0;
|
|
897
|
-
this.B = B | 0;
|
|
898
|
-
this.C = C | 0;
|
|
899
|
-
this.D = D | 0;
|
|
900
|
-
this.E = E | 0;
|
|
901
|
-
this.F = F | 0;
|
|
902
|
-
this.G = G | 0;
|
|
903
|
-
this.H = H | 0;
|
|
904
|
-
}
|
|
905
|
-
_cloneInto(to) {
|
|
906
|
-
(to ||= new this.constructor()).set(...this.get());
|
|
907
|
-
return this._cloneIntoMeta(to);
|
|
908
|
-
}
|
|
909
|
-
process(view, offset) {
|
|
910
|
-
for (let i = 0; i < 16; i++, offset += 4) SHA256_W[i] = view.getUint32(offset, false);
|
|
911
|
-
for (let i = 16; i < 64; i++) {
|
|
912
|
-
const W15 = SHA256_W[i - 15];
|
|
913
|
-
const W2 = SHA256_W[i - 2];
|
|
914
|
-
const s0 = rotr(W15, 7) ^ rotr(W15, 18) ^ W15 >>> 3;
|
|
915
|
-
const s1 = rotr(W2, 17) ^ rotr(W2, 19) ^ W2 >>> 10;
|
|
916
|
-
SHA256_W[i] = s1 + SHA256_W[i - 7] + s0 + SHA256_W[i - 16] | 0;
|
|
917
|
-
}
|
|
918
|
-
let { A, B, C, D, E, F, G, H } = this;
|
|
919
|
-
for (let i = 0; i < 64; i++) {
|
|
920
|
-
const sigma1 = rotr(E, 6) ^ rotr(E, 11) ^ rotr(E, 25);
|
|
921
|
-
const T1 = H + sigma1 + Chi(E, F, G) + SHA256_K[i] + SHA256_W[i] | 0;
|
|
922
|
-
const T2 = (rotr(A, 2) ^ rotr(A, 13) ^ rotr(A, 22)) + Maj(A, B, C) | 0;
|
|
923
|
-
H = G;
|
|
924
|
-
G = F;
|
|
925
|
-
F = E;
|
|
926
|
-
E = D + T1 | 0;
|
|
927
|
-
D = C;
|
|
928
|
-
C = B;
|
|
929
|
-
B = A;
|
|
930
|
-
A = T1 + T2 | 0;
|
|
931
|
-
}
|
|
932
|
-
A = A + this.A | 0;
|
|
933
|
-
B = B + this.B | 0;
|
|
934
|
-
C = C + this.C | 0;
|
|
935
|
-
D = D + this.D | 0;
|
|
936
|
-
E = E + this.E | 0;
|
|
937
|
-
F = F + this.F | 0;
|
|
938
|
-
G = G + this.G | 0;
|
|
939
|
-
H = H + this.H | 0;
|
|
940
|
-
this.set(A, B, C, D, E, F, G, H);
|
|
941
|
-
}
|
|
942
|
-
roundClean() {
|
|
943
|
-
clean$1(SHA256_W);
|
|
944
|
-
}
|
|
945
|
-
destroy() {
|
|
946
|
-
this.destroyed = true;
|
|
947
|
-
this.set(0, 0, 0, 0, 0, 0, 0, 0);
|
|
948
|
-
clean$1(this.buffer);
|
|
949
|
-
}
|
|
950
|
-
};
|
|
951
|
-
/** Internal SHA-256 hash class grounded in RFC 6234 §6.2. */
|
|
952
|
-
var _SHA256 = class extends SHA2_32B {
|
|
953
|
-
constructor() {
|
|
954
|
-
super(32, SHA256_IV);
|
|
955
|
-
}
|
|
956
|
-
};
|
|
957
|
-
/**
|
|
958
|
-
* SHA2-256 hash function from RFC 4634. In JS it's the fastest: even faster than Blake3. Some info:
|
|
959
|
-
*
|
|
960
|
-
* - Trying 2^128 hashes would get 50% chance of collision, using birthday attack.
|
|
961
|
-
* - BTC network is doing 2^70 hashes/sec (2^95 hashes/year) as per 2025.
|
|
962
|
-
* - Each sha256 hash is executing 2^18 bit operations.
|
|
963
|
-
* - Good 2024 ASICs can do 200Th/sec with 3500 watts of power, corresponding to 2^36 hashes/joule.
|
|
964
|
-
* @param msg - message bytes to hash
|
|
965
|
-
* @param opts - Reserved hash options.
|
|
966
|
-
* @returns Digest bytes.
|
|
967
|
-
* @example
|
|
968
|
-
* Hash a message with SHA2-256.
|
|
969
|
-
* ```ts
|
|
970
|
-
* sha256(new Uint8Array([97, 98, 99]));
|
|
971
|
-
* ```
|
|
972
|
-
*/
|
|
973
|
-
const sha256 = /* @__PURE__ */ createHasher(() => new _SHA256(), /* @__PURE__ */ oidNist(1));
|
|
974
|
-
//#endregion
|
|
975
426
|
//#region ../../node_modules/.bun/jose@6.2.13/node_modules/jose/dist/webapi/lib/buffer_utils.js
|
|
976
427
|
const encoder$1 = new TextEncoder();
|
|
977
428
|
const decoder = new TextDecoder();
|
|
@@ -18780,4 +18231,4 @@ async function signParams(ctx, opts, flags) {
|
|
|
18780
18231
|
return params.toString();
|
|
18781
18232
|
}
|
|
18782
18233
|
//#endregion
|
|
18783
|
-
export { queueAfterTransactionHook as $,
|
|
18234
|
+
export { queueAfterTransactionHook as $, isDynamicBaseURLConfig as $t, freshSessionMiddleware as A, userSchema as At, sensitiveSessionMiddleware as B, jwtVerify as Bt, parseScopeField as C, parseAccountOutput as Ct, constantTimeEqual as D, parseUserInput as Dt, generateRandomString as E, parseSessionOutput as Et, listSessions as F, decodeJwt as Ft, createAuthMiddleware as G, JWTExpired as Gt, appendQueryParams as H, JOSEError as Ht, requestOnlySessionMiddleware as I, decodeProtectedHeader as It, defu as J, isPromise as Jt, isAPIError as K, hasServerSessionStore as Kt, revokeOtherSessions as L, importJWK as Lt, getSession as M, number as Mt, getSessionFromCtx as N, string as Nt, getOAuthServerContext as O, parseUserOutput as Ot, isStateful as P, signJWT$1 as Pt, getCurrentAdapter as Q, getProtocol as Qt, revokeSession as R, createLocalJWKSet as Rt, parseProviderEmailVerified as S, mergeSchema as St, symmetricEncrypt as T, parseSessionInput as Tt, normalizePathname as U, JWKSNoMatchingKey as Ut, sessionMiddleware as V, isJwkSet as Vt, createAuthEndpoint as W, JWKSTimeout as Wt, findInvalidTrustedProxies as X, getHost as Xt, createRateLimitKey as Y, getBaseURL as Yt, getIP as Z, getOrigin as Zt, encodeBasicCredentials as _, parseSetCookieHeader as _t, resolveSigningKey as a, wildcardMatch as an, tryGetCurrentAuthEndpointContext as at, getPrimaryClientId as b, buildSyntheticUserOutput as bt, getDefaultKeyAlg as c, deleteSessionCookie as ct, getOperationId as d, setCookieCache as dt, isRequestLike as en, runWithAdapter as et, verifyJwsAccessToken as f, setSessionCookie as ft, resolveClientAssertionParams as g, createRouter$1 as gt, betterFetch as h, setAccountCookie as ht, getJwtToken as i, defineErrorCodes as in, getCurrentAuthEndpointContext as it, getAuthoritativeSessionFromCtx as j, coreSchema as jt, setOAuthState as k, filterOutputFields as kt, getJwksAdapter as l, expireCookie as lt, fetchRefusingRedirects as m, getAccountCookie as mt, metadataResponse as n, trimTrailingSlashes as nn, runtimeSchemaCheckFor as nt, signJWT as o, createHash as ot, DPOP_SIGNING_ALGORITHMS as p, createHMAC as pt, isLoopbackHost as q, shouldBindAccountCookieToSessionUser as qt, oauthProvider as r, BASE_ERROR_CODES as rn, schemaCheckFor as rt, createJwk as s, createCookieGetter as st, getIssuer as t, resolveBaseURL as tn, runWithTransaction as tt, dispatchAuthEndpoint as u, getCookies as ut, generateCodeChallenge as v, parseCookieCachePayload as vt, symmetricDecrypt as w, parseAdditionalUserInputFromProviderProfile as wt, mergeScopes as x, getSessionDefaultFields as xt, getOAuth2Tokens as y, getDate as yt, revokeSessions as z, SignJWT as zt };
|
package/client.d.mts
CHANGED
package/client.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
import { a as FRAMES_PATH, c as serveSigned, l as signedHttp, o as SOCKET_PATH, s as client } from "./src-
|
|
1
|
+
import { a as FRAMES_PATH, c as serveSigned, l as signedHttp, o as SOCKET_PATH, s as client } from "./src-CQmtQTvJ.mjs";
|
|
2
2
|
export { FRAMES_PATH, SOCKET_PATH, client, serveSigned, signedHttp };
|
package/contract.d.mts
CHANGED