@keystrokehq/cli 0.0.53 → 0.0.55
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/{anthropic-BW7tKfye.mjs → anthropic-OIjNEgxk.mjs} +3 -3
- package/dist/{anthropic-BW7tKfye.mjs.map → anthropic-OIjNEgxk.mjs.map} +1 -1
- package/dist/{azure-openai-responses-CbpqfHpG.mjs → azure-openai-responses-J2iGyy4d.mjs} +3 -3
- package/dist/{azure-openai-responses-CbpqfHpG.mjs.map → azure-openai-responses-J2iGyy4d.mjs.map} +1 -1
- package/dist/{cat-TSFMZVYS-BfwZOafs.mjs → cat-TSFMZVYS-BUlDi5Qf.mjs} +2 -2
- package/dist/{cat-TSFMZVYS-BfwZOafs.mjs.map → cat-TSFMZVYS-BUlDi5Qf.mjs.map} +1 -1
- package/dist/{cut-OKARJCCV-Cm3OStWG.mjs → cut-OKARJCCV-p9v-ig7a.mjs} +2 -2
- package/dist/{cut-OKARJCCV-Cm3OStWG.mjs.map → cut-OKARJCCV-p9v-ig7a.mjs.map} +1 -1
- package/dist/{dist-BSgBg_mF.mjs → dist-OeT0Z7by.mjs} +3 -3
- package/dist/{dist-BSgBg_mF.mjs.map → dist-OeT0Z7by.mjs.map} +1 -1
- package/dist/{du-572XNP42-DeJ11TW7.mjs → du-572XNP42-Br0wC4cR.mjs} +2 -2
- package/dist/{du-572XNP42-DeJ11TW7.mjs.map → du-572XNP42-Br0wC4cR.mjs.map} +1 -1
- package/dist/{emit-route-manifest-DRcNXHCP-CSOVo0UZ.mjs → emit-route-manifest-DRcNXHCP-CuH5IaKl.mjs} +210 -209
- package/dist/emit-route-manifest-DRcNXHCP-CuH5IaKl.mjs.map +1 -0
- package/dist/{env-api-keys-CjsGqLnm.mjs → env-api-keys-Dj0phNAZ.mjs} +2 -2
- package/dist/{env-api-keys-CjsGqLnm.mjs.map → env-api-keys-Dj0phNAZ.mjs.map} +1 -1
- package/dist/{from-BVavsm7Y.mjs → from-CM85M090.mjs} +2 -2
- package/dist/{from-BVavsm7Y.mjs.map → from-CM85M090.mjs.map} +1 -1
- package/dist/{google-B3pBIkED.mjs → google-CZqUzYLL.mjs} +3 -3
- package/dist/{google-B3pBIkED.mjs.map → google-CZqUzYLL.mjs.map} +1 -1
- package/dist/{google-shared-CZrnlDVf.mjs → google-shared-DpSg5iXi.mjs} +5 -5
- package/dist/{google-shared-CZrnlDVf.mjs.map → google-shared-DpSg5iXi.mjs.map} +1 -1
- package/dist/{google-vertex-CK79qwUV.mjs → google-vertex-BM9RkknB.mjs} +2 -2
- package/dist/{google-vertex-CK79qwUV.mjs.map → google-vertex-BM9RkknB.mjs.map} +1 -1
- package/dist/{html-to-markdown-JW4MSQZO-CvfnlE0t.mjs → html-to-markdown-JW4MSQZO-CL7jZmA2.mjs} +2 -2
- package/dist/{html-to-markdown-JW4MSQZO-CvfnlE0t.mjs.map → html-to-markdown-JW4MSQZO-CL7jZmA2.mjs.map} +1 -1
- package/dist/index.mjs +717 -8
- package/dist/index.mjs.map +1 -1
- package/dist/{jq-4XLYLOS5-DrYXLsYH.mjs → jq-4XLYLOS5-KSRW1t5y.mjs} +2 -2
- package/dist/{jq-4XLYLOS5-DrYXLsYH.mjs.map → jq-4XLYLOS5-KSRW1t5y.mjs.map} +1 -1
- package/dist/{json-parse-4wvL0yab.mjs → json-parse-D7gmIw6y.mjs} +2 -2
- package/dist/{json-parse-4wvL0yab.mjs.map → json-parse-D7gmIw6y.mjs.map} +1 -1
- package/dist/{lib-L8rwARiF.mjs → lib-15JvMO_y.mjs} +2 -2
- package/dist/{lib-L8rwARiF.mjs.map → lib-15JvMO_y.mjs.map} +1 -1
- package/dist/{ls-ZJGQER7M-C_1bAeGq.mjs → ls-ZJGQER7M-CvMghjGY.mjs} +2 -2
- package/dist/{ls-ZJGQER7M-C_1bAeGq.mjs.map → ls-ZJGQER7M-CvMghjGY.mjs.map} +1 -1
- package/dist/{mistral-CO6JoIDU.mjs → mistral-BMK3QxKa.mjs} +3 -3
- package/dist/{mistral-CO6JoIDU.mjs.map → mistral-BMK3QxKa.mjs.map} +1 -1
- package/dist/{multipart-parser-CybO63Pn.mjs → multipart-parser-ChdFj-Tf.mjs} +3 -3
- package/dist/{multipart-parser-CybO63Pn.mjs.map → multipart-parser-ChdFj-Tf.mjs.map} +1 -1
- package/dist/{openai-codex-responses-BsV2OXkO.mjs → openai-codex-responses-FPOFDQCI.mjs} +3 -3
- package/dist/{openai-codex-responses-BsV2OXkO.mjs.map → openai-codex-responses-FPOFDQCI.mjs.map} +1 -1
- package/dist/{openai-completions-DtKMQJXz.mjs → openai-completions-DaFkurXZ.mjs} +3 -3
- package/dist/{openai-completions-DtKMQJXz.mjs.map → openai-completions-DaFkurXZ.mjs.map} +1 -1
- package/dist/{openai-responses-Dn8IOWpx.mjs → openai-responses-DjcjpFVd.mjs} +3 -3
- package/dist/{openai-responses-Dn8IOWpx.mjs.map → openai-responses-DjcjpFVd.mjs.map} +1 -1
- package/dist/{openai-responses-shared-rmpfdSMl.mjs → openai-responses-shared-DOajVKFM.mjs} +2 -2
- package/dist/{openai-responses-shared-rmpfdSMl.mjs.map → openai-responses-shared-DOajVKFM.mjs.map} +1 -1
- package/dist/{openrouter-Cq37VS4X.mjs → openrouter-BD82J9ov.mjs} +2 -2
- package/dist/{openrouter-Cq37VS4X.mjs.map → openrouter-BD82J9ov.mjs.map} +1 -1
- package/dist/{printf-TWGXF445-BcIEiMjE.mjs → printf-TWGXF445-CtbOGcY-.mjs} +2 -2
- package/dist/{printf-TWGXF445-BcIEiMjE.mjs.map → printf-TWGXF445-CtbOGcY-.mjs.map} +1 -1
- package/dist/{sort-SW2YEO5B-D08jaQ5v.mjs → sort-SW2YEO5B-BT2dtrqE.mjs} +2 -2
- package/dist/{sort-SW2YEO5B-D08jaQ5v.mjs.map → sort-SW2YEO5B-BT2dtrqE.mjs.map} +1 -1
- package/dist/{sqlite3-CGOEFJAO-DVuaAgm0.mjs → sqlite3-CGOEFJAO-DKaf3b_T.mjs} +2 -2
- package/dist/{sqlite3-CGOEFJAO-DVuaAgm0.mjs.map → sqlite3-CGOEFJAO-DKaf3b_T.mjs.map} +1 -1
- package/dist/{src-xQsWiElt.mjs → src-BhFu0wxf.mjs} +4 -4
- package/dist/{src-xQsWiElt.mjs.map → src-BhFu0wxf.mjs.map} +1 -1
- package/dist/{src-DuFA6S6A.mjs → src-CO4ATuDw.mjs} +2 -2
- package/dist/{src-DuFA6S6A.mjs.map → src-CO4ATuDw.mjs.map} +1 -1
- package/dist/{tar-STHHZTZ6-C7-gpnmi.mjs → tar-STHHZTZ6-Cy8WppFl.mjs} +3 -3
- package/dist/{tar-STHHZTZ6-C7-gpnmi.mjs.map → tar-STHHZTZ6-Cy8WppFl.mjs.map} +1 -1
- package/dist/{tree-YLD52CNT-DiHyiFBi.mjs → tree-YLD52CNT-CFtEJCzO.mjs} +2 -2
- package/dist/{tree-YLD52CNT-DiHyiFBi.mjs.map → tree-YLD52CNT-CFtEJCzO.mjs.map} +1 -1
- package/dist/{uniq-XSIZR6PB-BA-vRB1O.mjs → uniq-XSIZR6PB-ERG9Mu92.mjs} +2 -2
- package/dist/{uniq-XSIZR6PB-BA-vRB1O.mjs.map → uniq-XSIZR6PB-ERG9Mu92.mjs.map} +1 -1
- package/dist/{watch-app-DTIeKrbl-BdEadl4m.mjs → watch-app-DTIeKrbl-C-BThJEO.mjs} +2 -2
- package/dist/{watch-app-DTIeKrbl-BdEadl4m.mjs.map → watch-app-DTIeKrbl-C-BThJEO.mjs.map} +1 -1
- package/dist/{wc-LF7NU4LA-BWoItyXd.mjs → wc-LF7NU4LA-CsPoPEAk.mjs} +2 -2
- package/dist/{wc-LF7NU4LA-BWoItyXd.mjs.map → wc-LF7NU4LA-CsPoPEAk.mjs.map} +1 -1
- package/dist/{websocket-server-DBCa1Df9.mjs → websocket-server-m6wiYSFm.mjs} +2 -2
- package/dist/{websocket-server-DBCa1Df9.mjs.map → websocket-server-m6wiYSFm.mjs.map} +1 -1
- package/dist/{xan-Y6WF3IRG-BilR2MsH.mjs → xan-Y6WF3IRG-ovCpFLkA.mjs} +2 -2
- package/dist/{xan-Y6WF3IRG-BilR2MsH.mjs.map → xan-Y6WF3IRG-ovCpFLkA.mjs.map} +1 -1
- package/package.json +8 -4
- package/dist/chunk-lXUa1qmO.mjs +0 -37
- package/dist/emit-route-manifest-DRcNXHCP-CSOVo0UZ.mjs.map +0 -1
package/dist/index.mjs
CHANGED
|
@@ -12,6 +12,7 @@ import "@better-auth/drizzle-adapter";
|
|
|
12
12
|
import "better-auth";
|
|
13
13
|
import "better-auth/plugins/bearer";
|
|
14
14
|
import "better-auth/plugins/device-authorization";
|
|
15
|
+
import "better-auth/plugins/magic-link";
|
|
15
16
|
import { deviceAuthorizationClient } from "better-auth/client/plugins";
|
|
16
17
|
import { createAuthClient } from "better-auth/client";
|
|
17
18
|
import { access, copyFile, cp, mkdir, readFile, readdir, stat, symlink, unlink, writeFile } from "node:fs/promises";
|
|
@@ -19,6 +20,40 @@ import { fileURLToPath, pathToFileURL } from "node:url";
|
|
|
19
20
|
import { build, mergeConfig } from "tsdown";
|
|
20
21
|
import "@aws-sdk/client-s3";
|
|
21
22
|
import "@aws-sdk/s3-request-presigner";
|
|
23
|
+
//#region \0rolldown/runtime.js
|
|
24
|
+
var __create = Object.create;
|
|
25
|
+
var __defProp = Object.defineProperty;
|
|
26
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
27
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
28
|
+
var __getProtoOf = Object.getPrototypeOf;
|
|
29
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
30
|
+
var __esmMin = (fn, res) => () => (fn && (res = fn(fn = 0)), res);
|
|
31
|
+
var __commonJSMin = (cb, mod) => () => (mod || (cb((mod = { exports: {} }).exports, mod), cb = null), mod.exports);
|
|
32
|
+
var __exportAll = (all, no_symbols) => {
|
|
33
|
+
let target = {};
|
|
34
|
+
for (var name in all) __defProp(target, name, {
|
|
35
|
+
get: all[name],
|
|
36
|
+
enumerable: true
|
|
37
|
+
});
|
|
38
|
+
if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
|
|
39
|
+
return target;
|
|
40
|
+
};
|
|
41
|
+
var __copyProps = (to, from, except, desc) => {
|
|
42
|
+
if (from && typeof from === "object" || typeof from === "function") for (var keys = __getOwnPropNames(from), i = 0, n = keys.length, key; i < n; i++) {
|
|
43
|
+
key = keys[i];
|
|
44
|
+
if (!__hasOwnProp.call(to, key) && key !== except) __defProp(to, key, {
|
|
45
|
+
get: ((k) => from[k]).bind(null, key),
|
|
46
|
+
enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
return to;
|
|
50
|
+
};
|
|
51
|
+
var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", {
|
|
52
|
+
value: mod,
|
|
53
|
+
enumerable: true
|
|
54
|
+
}) : target, mod));
|
|
55
|
+
var __require = /* @__PURE__ */ createRequire(import.meta.url);
|
|
56
|
+
//#endregion
|
|
22
57
|
//#region ../../node_modules/.pnpm/ky@2.0.2/node_modules/ky/distribution/errors/KyError.js
|
|
23
58
|
/**
|
|
24
59
|
Base class for all Ky-specific errors. `HTTPError`, `NetworkError`, `TimeoutError`, and `ForceRetryError` extend this class.
|
|
@@ -2355,7 +2390,7 @@ var Doc = class {
|
|
|
2355
2390
|
};
|
|
2356
2391
|
//#endregion
|
|
2357
2392
|
//#region ../../node_modules/.pnpm/zod@4.4.3/node_modules/zod/v4/core/versions.js
|
|
2358
|
-
const version = {
|
|
2393
|
+
const version$1 = {
|
|
2359
2394
|
major: 4,
|
|
2360
2395
|
minor: 4,
|
|
2361
2396
|
patch: 3
|
|
@@ -2367,7 +2402,7 @@ const $ZodType = /* @__PURE__ */ $constructor("$ZodType", (inst, def) => {
|
|
|
2367
2402
|
inst ?? (inst = {});
|
|
2368
2403
|
inst._zod.def = def;
|
|
2369
2404
|
inst._zod.bag = inst._zod.bag || {};
|
|
2370
|
-
inst._zod.version = version;
|
|
2405
|
+
inst._zod.version = version$1;
|
|
2371
2406
|
const checks = [...inst._zod.def.checks ?? []];
|
|
2372
2407
|
if (inst._zod.traits.has("$ZodCheck")) checks.unshift(inst);
|
|
2373
2408
|
for (const ch of checks) for (const fn of ch._zod.onattach) fn(inst);
|
|
@@ -12719,8 +12754,679 @@ const authVerifications = pgTable("verification", {
|
|
|
12719
12754
|
createdAt: timestamp("created_at", { withTimezone: true }).notNull(),
|
|
12720
12755
|
updatedAt: timestamp("updated_at", { withTimezone: true }).notNull()
|
|
12721
12756
|
}, (table) => [index("verification_identifier_idx").on(table.identifier)]);
|
|
12757
|
+
new TextEncoder();
|
|
12758
|
+
const base64Chars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";
|
|
12759
|
+
const base64Lookup = new Uint8Array(256);
|
|
12760
|
+
for (let i = 0; i < 64; i++) base64Lookup[base64Chars.charCodeAt(i)] = i;
|
|
12761
|
+
function getDecoder(charset) {
|
|
12762
|
+
charset = charset || "utf8";
|
|
12763
|
+
let decoder;
|
|
12764
|
+
try {
|
|
12765
|
+
decoder = new TextDecoder(charset);
|
|
12766
|
+
} catch (err) {
|
|
12767
|
+
decoder = new TextDecoder("windows-1252");
|
|
12768
|
+
}
|
|
12769
|
+
return decoder;
|
|
12770
|
+
}
|
|
12771
|
+
getDecoder();
|
|
12772
|
+
//#endregion
|
|
12773
|
+
//#region ../../node_modules/.pnpm/standardwebhooks@1.0.0/node_modules/standardwebhooks/dist/timing_safe_equal.js
|
|
12774
|
+
var require_timing_safe_equal = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
12775
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12776
|
+
exports.timingSafeEqual = void 0;
|
|
12777
|
+
function assert(expr, msg = "") {
|
|
12778
|
+
if (!expr) throw new Error(msg);
|
|
12779
|
+
}
|
|
12780
|
+
function timingSafeEqual(a, b) {
|
|
12781
|
+
if (a.byteLength !== b.byteLength) return false;
|
|
12782
|
+
if (!(a instanceof DataView)) a = new DataView(ArrayBuffer.isView(a) ? a.buffer : a);
|
|
12783
|
+
if (!(b instanceof DataView)) b = new DataView(ArrayBuffer.isView(b) ? b.buffer : b);
|
|
12784
|
+
assert(a instanceof DataView);
|
|
12785
|
+
assert(b instanceof DataView);
|
|
12786
|
+
const length = a.byteLength;
|
|
12787
|
+
let out = 0;
|
|
12788
|
+
let i = -1;
|
|
12789
|
+
while (++i < length) out |= a.getUint8(i) ^ b.getUint8(i);
|
|
12790
|
+
return out === 0;
|
|
12791
|
+
}
|
|
12792
|
+
exports.timingSafeEqual = timingSafeEqual;
|
|
12793
|
+
}));
|
|
12794
|
+
//#endregion
|
|
12795
|
+
//#region ../../node_modules/.pnpm/@stablelib+base64@1.0.1/node_modules/@stablelib/base64/lib/base64.js
|
|
12796
|
+
var require_base64 = /* @__PURE__ */ __commonJSMin(((exports) => {
|
|
12797
|
+
var __extends = exports && exports.__extends || (function() {
|
|
12798
|
+
var extendStatics = function(d, b) {
|
|
12799
|
+
extendStatics = Object.setPrototypeOf || { __proto__: [] } instanceof Array && function(d, b) {
|
|
12800
|
+
d.__proto__ = b;
|
|
12801
|
+
} || function(d, b) {
|
|
12802
|
+
for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
|
|
12803
|
+
};
|
|
12804
|
+
return extendStatics(d, b);
|
|
12805
|
+
};
|
|
12806
|
+
return function(d, b) {
|
|
12807
|
+
extendStatics(d, b);
|
|
12808
|
+
function __() {
|
|
12809
|
+
this.constructor = d;
|
|
12810
|
+
}
|
|
12811
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
12812
|
+
};
|
|
12813
|
+
})();
|
|
12814
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12815
|
+
/**
|
|
12816
|
+
* Package base64 implements Base64 encoding and decoding.
|
|
12817
|
+
*/
|
|
12818
|
+
var INVALID_BYTE = 256;
|
|
12819
|
+
/**
|
|
12820
|
+
* Implements standard Base64 encoding.
|
|
12821
|
+
*
|
|
12822
|
+
* Operates in constant time.
|
|
12823
|
+
*/
|
|
12824
|
+
var Coder = function() {
|
|
12825
|
+
function Coder(_paddingCharacter) {
|
|
12826
|
+
if (_paddingCharacter === void 0) _paddingCharacter = "=";
|
|
12827
|
+
this._paddingCharacter = _paddingCharacter;
|
|
12828
|
+
}
|
|
12829
|
+
Coder.prototype.encodedLength = function(length) {
|
|
12830
|
+
if (!this._paddingCharacter) return (length * 8 + 5) / 6 | 0;
|
|
12831
|
+
return (length + 2) / 3 * 4 | 0;
|
|
12832
|
+
};
|
|
12833
|
+
Coder.prototype.encode = function(data) {
|
|
12834
|
+
var out = "";
|
|
12835
|
+
var i = 0;
|
|
12836
|
+
for (; i < data.length - 2; i += 3) {
|
|
12837
|
+
var c = data[i] << 16 | data[i + 1] << 8 | data[i + 2];
|
|
12838
|
+
out += this._encodeByte(c >>> 18 & 63);
|
|
12839
|
+
out += this._encodeByte(c >>> 12 & 63);
|
|
12840
|
+
out += this._encodeByte(c >>> 6 & 63);
|
|
12841
|
+
out += this._encodeByte(c >>> 0 & 63);
|
|
12842
|
+
}
|
|
12843
|
+
var left = data.length - i;
|
|
12844
|
+
if (left > 0) {
|
|
12845
|
+
var c = data[i] << 16 | (left === 2 ? data[i + 1] << 8 : 0);
|
|
12846
|
+
out += this._encodeByte(c >>> 18 & 63);
|
|
12847
|
+
out += this._encodeByte(c >>> 12 & 63);
|
|
12848
|
+
if (left === 2) out += this._encodeByte(c >>> 6 & 63);
|
|
12849
|
+
else out += this._paddingCharacter || "";
|
|
12850
|
+
out += this._paddingCharacter || "";
|
|
12851
|
+
}
|
|
12852
|
+
return out;
|
|
12853
|
+
};
|
|
12854
|
+
Coder.prototype.maxDecodedLength = function(length) {
|
|
12855
|
+
if (!this._paddingCharacter) return (length * 6 + 7) / 8 | 0;
|
|
12856
|
+
return length / 4 * 3 | 0;
|
|
12857
|
+
};
|
|
12858
|
+
Coder.prototype.decodedLength = function(s) {
|
|
12859
|
+
return this.maxDecodedLength(s.length - this._getPaddingLength(s));
|
|
12860
|
+
};
|
|
12861
|
+
Coder.prototype.decode = function(s) {
|
|
12862
|
+
if (s.length === 0) return new Uint8Array(0);
|
|
12863
|
+
var paddingLength = this._getPaddingLength(s);
|
|
12864
|
+
var length = s.length - paddingLength;
|
|
12865
|
+
var out = new Uint8Array(this.maxDecodedLength(length));
|
|
12866
|
+
var op = 0;
|
|
12867
|
+
var i = 0;
|
|
12868
|
+
var haveBad = 0;
|
|
12869
|
+
var v0 = 0, v1 = 0, v2 = 0, v3 = 0;
|
|
12870
|
+
for (; i < length - 4; i += 4) {
|
|
12871
|
+
v0 = this._decodeChar(s.charCodeAt(i + 0));
|
|
12872
|
+
v1 = this._decodeChar(s.charCodeAt(i + 1));
|
|
12873
|
+
v2 = this._decodeChar(s.charCodeAt(i + 2));
|
|
12874
|
+
v3 = this._decodeChar(s.charCodeAt(i + 3));
|
|
12875
|
+
out[op++] = v0 << 2 | v1 >>> 4;
|
|
12876
|
+
out[op++] = v1 << 4 | v2 >>> 2;
|
|
12877
|
+
out[op++] = v2 << 6 | v3;
|
|
12878
|
+
haveBad |= v0 & INVALID_BYTE;
|
|
12879
|
+
haveBad |= v1 & INVALID_BYTE;
|
|
12880
|
+
haveBad |= v2 & INVALID_BYTE;
|
|
12881
|
+
haveBad |= v3 & INVALID_BYTE;
|
|
12882
|
+
}
|
|
12883
|
+
if (i < length - 1) {
|
|
12884
|
+
v0 = this._decodeChar(s.charCodeAt(i));
|
|
12885
|
+
v1 = this._decodeChar(s.charCodeAt(i + 1));
|
|
12886
|
+
out[op++] = v0 << 2 | v1 >>> 4;
|
|
12887
|
+
haveBad |= v0 & INVALID_BYTE;
|
|
12888
|
+
haveBad |= v1 & INVALID_BYTE;
|
|
12889
|
+
}
|
|
12890
|
+
if (i < length - 2) {
|
|
12891
|
+
v2 = this._decodeChar(s.charCodeAt(i + 2));
|
|
12892
|
+
out[op++] = v1 << 4 | v2 >>> 2;
|
|
12893
|
+
haveBad |= v2 & INVALID_BYTE;
|
|
12894
|
+
}
|
|
12895
|
+
if (i < length - 3) {
|
|
12896
|
+
v3 = this._decodeChar(s.charCodeAt(i + 3));
|
|
12897
|
+
out[op++] = v2 << 6 | v3;
|
|
12898
|
+
haveBad |= v3 & INVALID_BYTE;
|
|
12899
|
+
}
|
|
12900
|
+
if (haveBad !== 0) throw new Error("Base64Coder: incorrect characters for decoding");
|
|
12901
|
+
return out;
|
|
12902
|
+
};
|
|
12903
|
+
Coder.prototype._encodeByte = function(b) {
|
|
12904
|
+
var result = b;
|
|
12905
|
+
result += 65;
|
|
12906
|
+
result += 25 - b >>> 8 & 6;
|
|
12907
|
+
result += 51 - b >>> 8 & -75;
|
|
12908
|
+
result += 61 - b >>> 8 & -15;
|
|
12909
|
+
result += 62 - b >>> 8 & 3;
|
|
12910
|
+
return String.fromCharCode(result);
|
|
12911
|
+
};
|
|
12912
|
+
Coder.prototype._decodeChar = function(c) {
|
|
12913
|
+
var result = INVALID_BYTE;
|
|
12914
|
+
result += (42 - c & c - 44) >>> 8 & -INVALID_BYTE + c - 43 + 62;
|
|
12915
|
+
result += (46 - c & c - 48) >>> 8 & -INVALID_BYTE + c - 47 + 63;
|
|
12916
|
+
result += (47 - c & c - 58) >>> 8 & -INVALID_BYTE + c - 48 + 52;
|
|
12917
|
+
result += (64 - c & c - 91) >>> 8 & -INVALID_BYTE + c - 65 + 0;
|
|
12918
|
+
result += (96 - c & c - 123) >>> 8 & -INVALID_BYTE + c - 97 + 26;
|
|
12919
|
+
return result;
|
|
12920
|
+
};
|
|
12921
|
+
Coder.prototype._getPaddingLength = function(s) {
|
|
12922
|
+
var paddingLength = 0;
|
|
12923
|
+
if (this._paddingCharacter) {
|
|
12924
|
+
for (var i = s.length - 1; i >= 0; i--) {
|
|
12925
|
+
if (s[i] !== this._paddingCharacter) break;
|
|
12926
|
+
paddingLength++;
|
|
12927
|
+
}
|
|
12928
|
+
if (s.length < 4 || paddingLength > 2) throw new Error("Base64Coder: incorrect padding");
|
|
12929
|
+
}
|
|
12930
|
+
return paddingLength;
|
|
12931
|
+
};
|
|
12932
|
+
return Coder;
|
|
12933
|
+
}();
|
|
12934
|
+
exports.Coder = Coder;
|
|
12935
|
+
var stdCoder = new Coder();
|
|
12936
|
+
function encode(data) {
|
|
12937
|
+
return stdCoder.encode(data);
|
|
12938
|
+
}
|
|
12939
|
+
exports.encode = encode;
|
|
12940
|
+
function decode(s) {
|
|
12941
|
+
return stdCoder.decode(s);
|
|
12942
|
+
}
|
|
12943
|
+
exports.decode = decode;
|
|
12944
|
+
/**
|
|
12945
|
+
* Implements URL-safe Base64 encoding.
|
|
12946
|
+
* (Same as Base64, but '+' is replaced with '-', and '/' with '_').
|
|
12947
|
+
*
|
|
12948
|
+
* Operates in constant time.
|
|
12949
|
+
*/
|
|
12950
|
+
var URLSafeCoder = function(_super) {
|
|
12951
|
+
__extends(URLSafeCoder, _super);
|
|
12952
|
+
function URLSafeCoder() {
|
|
12953
|
+
return _super !== null && _super.apply(this, arguments) || this;
|
|
12954
|
+
}
|
|
12955
|
+
URLSafeCoder.prototype._encodeByte = function(b) {
|
|
12956
|
+
var result = b;
|
|
12957
|
+
result += 65;
|
|
12958
|
+
result += 25 - b >>> 8 & 6;
|
|
12959
|
+
result += 51 - b >>> 8 & -75;
|
|
12960
|
+
result += 61 - b >>> 8 & -13;
|
|
12961
|
+
result += 62 - b >>> 8 & 49;
|
|
12962
|
+
return String.fromCharCode(result);
|
|
12963
|
+
};
|
|
12964
|
+
URLSafeCoder.prototype._decodeChar = function(c) {
|
|
12965
|
+
var result = INVALID_BYTE;
|
|
12966
|
+
result += (44 - c & c - 46) >>> 8 & -INVALID_BYTE + c - 45 + 62;
|
|
12967
|
+
result += (94 - c & c - 96) >>> 8 & -INVALID_BYTE + c - 95 + 63;
|
|
12968
|
+
result += (47 - c & c - 58) >>> 8 & -INVALID_BYTE + c - 48 + 52;
|
|
12969
|
+
result += (64 - c & c - 91) >>> 8 & -INVALID_BYTE + c - 65 + 0;
|
|
12970
|
+
result += (96 - c & c - 123) >>> 8 & -INVALID_BYTE + c - 97 + 26;
|
|
12971
|
+
return result;
|
|
12972
|
+
};
|
|
12973
|
+
return URLSafeCoder;
|
|
12974
|
+
}(Coder);
|
|
12975
|
+
exports.URLSafeCoder = URLSafeCoder;
|
|
12976
|
+
var urlSafeCoder = new URLSafeCoder();
|
|
12977
|
+
function encodeURLSafe(data) {
|
|
12978
|
+
return urlSafeCoder.encode(data);
|
|
12979
|
+
}
|
|
12980
|
+
exports.encodeURLSafe = encodeURLSafe;
|
|
12981
|
+
function decodeURLSafe(s) {
|
|
12982
|
+
return urlSafeCoder.decode(s);
|
|
12983
|
+
}
|
|
12984
|
+
exports.decodeURLSafe = decodeURLSafe;
|
|
12985
|
+
exports.encodedLength = function(length) {
|
|
12986
|
+
return stdCoder.encodedLength(length);
|
|
12987
|
+
};
|
|
12988
|
+
exports.maxDecodedLength = function(length) {
|
|
12989
|
+
return stdCoder.maxDecodedLength(length);
|
|
12990
|
+
};
|
|
12991
|
+
exports.decodedLength = function(s) {
|
|
12992
|
+
return stdCoder.decodedLength(s);
|
|
12993
|
+
};
|
|
12994
|
+
}));
|
|
12722
12995
|
//#endregion
|
|
12723
|
-
//#region ../../
|
|
12996
|
+
//#region ../../node_modules/.pnpm/fast-sha256@1.3.0/node_modules/fast-sha256/sha256.js
|
|
12997
|
+
var require_sha256 = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
12998
|
+
(function(root, factory) {
|
|
12999
|
+
var exports$1 = {};
|
|
13000
|
+
factory(exports$1);
|
|
13001
|
+
var sha256 = exports$1["default"];
|
|
13002
|
+
for (var k in exports$1) sha256[k] = exports$1[k];
|
|
13003
|
+
if (typeof module === "object" && typeof module.exports === "object") module.exports = sha256;
|
|
13004
|
+
else if (typeof define === "function" && define.amd) define(function() {
|
|
13005
|
+
return sha256;
|
|
13006
|
+
});
|
|
13007
|
+
else root.sha256 = sha256;
|
|
13008
|
+
})(exports, function(exports$2) {
|
|
13009
|
+
"use strict";
|
|
13010
|
+
exports$2.__esModule = true;
|
|
13011
|
+
exports$2.digestLength = 32;
|
|
13012
|
+
exports$2.blockSize = 64;
|
|
13013
|
+
var K = new Uint32Array([
|
|
13014
|
+
1116352408,
|
|
13015
|
+
1899447441,
|
|
13016
|
+
3049323471,
|
|
13017
|
+
3921009573,
|
|
13018
|
+
961987163,
|
|
13019
|
+
1508970993,
|
|
13020
|
+
2453635748,
|
|
13021
|
+
2870763221,
|
|
13022
|
+
3624381080,
|
|
13023
|
+
310598401,
|
|
13024
|
+
607225278,
|
|
13025
|
+
1426881987,
|
|
13026
|
+
1925078388,
|
|
13027
|
+
2162078206,
|
|
13028
|
+
2614888103,
|
|
13029
|
+
3248222580,
|
|
13030
|
+
3835390401,
|
|
13031
|
+
4022224774,
|
|
13032
|
+
264347078,
|
|
13033
|
+
604807628,
|
|
13034
|
+
770255983,
|
|
13035
|
+
1249150122,
|
|
13036
|
+
1555081692,
|
|
13037
|
+
1996064986,
|
|
13038
|
+
2554220882,
|
|
13039
|
+
2821834349,
|
|
13040
|
+
2952996808,
|
|
13041
|
+
3210313671,
|
|
13042
|
+
3336571891,
|
|
13043
|
+
3584528711,
|
|
13044
|
+
113926993,
|
|
13045
|
+
338241895,
|
|
13046
|
+
666307205,
|
|
13047
|
+
773529912,
|
|
13048
|
+
1294757372,
|
|
13049
|
+
1396182291,
|
|
13050
|
+
1695183700,
|
|
13051
|
+
1986661051,
|
|
13052
|
+
2177026350,
|
|
13053
|
+
2456956037,
|
|
13054
|
+
2730485921,
|
|
13055
|
+
2820302411,
|
|
13056
|
+
3259730800,
|
|
13057
|
+
3345764771,
|
|
13058
|
+
3516065817,
|
|
13059
|
+
3600352804,
|
|
13060
|
+
4094571909,
|
|
13061
|
+
275423344,
|
|
13062
|
+
430227734,
|
|
13063
|
+
506948616,
|
|
13064
|
+
659060556,
|
|
13065
|
+
883997877,
|
|
13066
|
+
958139571,
|
|
13067
|
+
1322822218,
|
|
13068
|
+
1537002063,
|
|
13069
|
+
1747873779,
|
|
13070
|
+
1955562222,
|
|
13071
|
+
2024104815,
|
|
13072
|
+
2227730452,
|
|
13073
|
+
2361852424,
|
|
13074
|
+
2428436474,
|
|
13075
|
+
2756734187,
|
|
13076
|
+
3204031479,
|
|
13077
|
+
3329325298
|
|
13078
|
+
]);
|
|
13079
|
+
function hashBlocks(w, v, p, pos, len) {
|
|
13080
|
+
var a, b, c, d, e, f, g, h, u, i, j, t1, t2;
|
|
13081
|
+
while (len >= 64) {
|
|
13082
|
+
a = v[0];
|
|
13083
|
+
b = v[1];
|
|
13084
|
+
c = v[2];
|
|
13085
|
+
d = v[3];
|
|
13086
|
+
e = v[4];
|
|
13087
|
+
f = v[5];
|
|
13088
|
+
g = v[6];
|
|
13089
|
+
h = v[7];
|
|
13090
|
+
for (i = 0; i < 16; i++) {
|
|
13091
|
+
j = pos + i * 4;
|
|
13092
|
+
w[i] = (p[j] & 255) << 24 | (p[j + 1] & 255) << 16 | (p[j + 2] & 255) << 8 | p[j + 3] & 255;
|
|
13093
|
+
}
|
|
13094
|
+
for (i = 16; i < 64; i++) {
|
|
13095
|
+
u = w[i - 2];
|
|
13096
|
+
t1 = (u >>> 17 | u << 15) ^ (u >>> 19 | u << 13) ^ u >>> 10;
|
|
13097
|
+
u = w[i - 15];
|
|
13098
|
+
t2 = (u >>> 7 | u << 25) ^ (u >>> 18 | u << 14) ^ u >>> 3;
|
|
13099
|
+
w[i] = (t1 + w[i - 7] | 0) + (t2 + w[i - 16] | 0);
|
|
13100
|
+
}
|
|
13101
|
+
for (i = 0; i < 64; i++) {
|
|
13102
|
+
t1 = (((e >>> 6 | e << 26) ^ (e >>> 11 | e << 21) ^ (e >>> 25 | e << 7)) + (e & f ^ ~e & g) | 0) + (h + (K[i] + w[i] | 0) | 0) | 0;
|
|
13103
|
+
t2 = ((a >>> 2 | a << 30) ^ (a >>> 13 | a << 19) ^ (a >>> 22 | a << 10)) + (a & b ^ a & c ^ b & c) | 0;
|
|
13104
|
+
h = g;
|
|
13105
|
+
g = f;
|
|
13106
|
+
f = e;
|
|
13107
|
+
e = d + t1 | 0;
|
|
13108
|
+
d = c;
|
|
13109
|
+
c = b;
|
|
13110
|
+
b = a;
|
|
13111
|
+
a = t1 + t2 | 0;
|
|
13112
|
+
}
|
|
13113
|
+
v[0] += a;
|
|
13114
|
+
v[1] += b;
|
|
13115
|
+
v[2] += c;
|
|
13116
|
+
v[3] += d;
|
|
13117
|
+
v[4] += e;
|
|
13118
|
+
v[5] += f;
|
|
13119
|
+
v[6] += g;
|
|
13120
|
+
v[7] += h;
|
|
13121
|
+
pos += 64;
|
|
13122
|
+
len -= 64;
|
|
13123
|
+
}
|
|
13124
|
+
return pos;
|
|
13125
|
+
}
|
|
13126
|
+
var Hash = function() {
|
|
13127
|
+
function Hash() {
|
|
13128
|
+
this.digestLength = exports$2.digestLength;
|
|
13129
|
+
this.blockSize = exports$2.blockSize;
|
|
13130
|
+
this.state = new Int32Array(8);
|
|
13131
|
+
this.temp = new Int32Array(64);
|
|
13132
|
+
this.buffer = new Uint8Array(128);
|
|
13133
|
+
this.bufferLength = 0;
|
|
13134
|
+
this.bytesHashed = 0;
|
|
13135
|
+
this.finished = false;
|
|
13136
|
+
this.reset();
|
|
13137
|
+
}
|
|
13138
|
+
Hash.prototype.reset = function() {
|
|
13139
|
+
this.state[0] = 1779033703;
|
|
13140
|
+
this.state[1] = 3144134277;
|
|
13141
|
+
this.state[2] = 1013904242;
|
|
13142
|
+
this.state[3] = 2773480762;
|
|
13143
|
+
this.state[4] = 1359893119;
|
|
13144
|
+
this.state[5] = 2600822924;
|
|
13145
|
+
this.state[6] = 528734635;
|
|
13146
|
+
this.state[7] = 1541459225;
|
|
13147
|
+
this.bufferLength = 0;
|
|
13148
|
+
this.bytesHashed = 0;
|
|
13149
|
+
this.finished = false;
|
|
13150
|
+
return this;
|
|
13151
|
+
};
|
|
13152
|
+
Hash.prototype.clean = function() {
|
|
13153
|
+
for (var i = 0; i < this.buffer.length; i++) this.buffer[i] = 0;
|
|
13154
|
+
for (var i = 0; i < this.temp.length; i++) this.temp[i] = 0;
|
|
13155
|
+
this.reset();
|
|
13156
|
+
};
|
|
13157
|
+
Hash.prototype.update = function(data, dataLength) {
|
|
13158
|
+
if (dataLength === void 0) dataLength = data.length;
|
|
13159
|
+
if (this.finished) throw new Error("SHA256: can't update because hash was finished.");
|
|
13160
|
+
var dataPos = 0;
|
|
13161
|
+
this.bytesHashed += dataLength;
|
|
13162
|
+
if (this.bufferLength > 0) {
|
|
13163
|
+
while (this.bufferLength < 64 && dataLength > 0) {
|
|
13164
|
+
this.buffer[this.bufferLength++] = data[dataPos++];
|
|
13165
|
+
dataLength--;
|
|
13166
|
+
}
|
|
13167
|
+
if (this.bufferLength === 64) {
|
|
13168
|
+
hashBlocks(this.temp, this.state, this.buffer, 0, 64);
|
|
13169
|
+
this.bufferLength = 0;
|
|
13170
|
+
}
|
|
13171
|
+
}
|
|
13172
|
+
if (dataLength >= 64) {
|
|
13173
|
+
dataPos = hashBlocks(this.temp, this.state, data, dataPos, dataLength);
|
|
13174
|
+
dataLength %= 64;
|
|
13175
|
+
}
|
|
13176
|
+
while (dataLength > 0) {
|
|
13177
|
+
this.buffer[this.bufferLength++] = data[dataPos++];
|
|
13178
|
+
dataLength--;
|
|
13179
|
+
}
|
|
13180
|
+
return this;
|
|
13181
|
+
};
|
|
13182
|
+
Hash.prototype.finish = function(out) {
|
|
13183
|
+
if (!this.finished) {
|
|
13184
|
+
var bytesHashed = this.bytesHashed;
|
|
13185
|
+
var left = this.bufferLength;
|
|
13186
|
+
var bitLenHi = bytesHashed / 536870912 | 0;
|
|
13187
|
+
var bitLenLo = bytesHashed << 3;
|
|
13188
|
+
var padLength = bytesHashed % 64 < 56 ? 64 : 128;
|
|
13189
|
+
this.buffer[left] = 128;
|
|
13190
|
+
for (var i = left + 1; i < padLength - 8; i++) this.buffer[i] = 0;
|
|
13191
|
+
this.buffer[padLength - 8] = bitLenHi >>> 24 & 255;
|
|
13192
|
+
this.buffer[padLength - 7] = bitLenHi >>> 16 & 255;
|
|
13193
|
+
this.buffer[padLength - 6] = bitLenHi >>> 8 & 255;
|
|
13194
|
+
this.buffer[padLength - 5] = bitLenHi >>> 0 & 255;
|
|
13195
|
+
this.buffer[padLength - 4] = bitLenLo >>> 24 & 255;
|
|
13196
|
+
this.buffer[padLength - 3] = bitLenLo >>> 16 & 255;
|
|
13197
|
+
this.buffer[padLength - 2] = bitLenLo >>> 8 & 255;
|
|
13198
|
+
this.buffer[padLength - 1] = bitLenLo >>> 0 & 255;
|
|
13199
|
+
hashBlocks(this.temp, this.state, this.buffer, 0, padLength);
|
|
13200
|
+
this.finished = true;
|
|
13201
|
+
}
|
|
13202
|
+
for (var i = 0; i < 8; i++) {
|
|
13203
|
+
out[i * 4 + 0] = this.state[i] >>> 24 & 255;
|
|
13204
|
+
out[i * 4 + 1] = this.state[i] >>> 16 & 255;
|
|
13205
|
+
out[i * 4 + 2] = this.state[i] >>> 8 & 255;
|
|
13206
|
+
out[i * 4 + 3] = this.state[i] >>> 0 & 255;
|
|
13207
|
+
}
|
|
13208
|
+
return this;
|
|
13209
|
+
};
|
|
13210
|
+
Hash.prototype.digest = function() {
|
|
13211
|
+
var out = new Uint8Array(this.digestLength);
|
|
13212
|
+
this.finish(out);
|
|
13213
|
+
return out;
|
|
13214
|
+
};
|
|
13215
|
+
Hash.prototype._saveState = function(out) {
|
|
13216
|
+
for (var i = 0; i < this.state.length; i++) out[i] = this.state[i];
|
|
13217
|
+
};
|
|
13218
|
+
Hash.prototype._restoreState = function(from, bytesHashed) {
|
|
13219
|
+
for (var i = 0; i < this.state.length; i++) this.state[i] = from[i];
|
|
13220
|
+
this.bytesHashed = bytesHashed;
|
|
13221
|
+
this.finished = false;
|
|
13222
|
+
this.bufferLength = 0;
|
|
13223
|
+
};
|
|
13224
|
+
return Hash;
|
|
13225
|
+
}();
|
|
13226
|
+
exports$2.Hash = Hash;
|
|
13227
|
+
var HMAC = function() {
|
|
13228
|
+
function HMAC(key) {
|
|
13229
|
+
this.inner = new Hash();
|
|
13230
|
+
this.outer = new Hash();
|
|
13231
|
+
this.blockSize = this.inner.blockSize;
|
|
13232
|
+
this.digestLength = this.inner.digestLength;
|
|
13233
|
+
var pad = new Uint8Array(this.blockSize);
|
|
13234
|
+
if (key.length > this.blockSize) new Hash().update(key).finish(pad).clean();
|
|
13235
|
+
else for (var i = 0; i < key.length; i++) pad[i] = key[i];
|
|
13236
|
+
for (var i = 0; i < pad.length; i++) pad[i] ^= 54;
|
|
13237
|
+
this.inner.update(pad);
|
|
13238
|
+
for (var i = 0; i < pad.length; i++) pad[i] ^= 106;
|
|
13239
|
+
this.outer.update(pad);
|
|
13240
|
+
this.istate = new Uint32Array(8);
|
|
13241
|
+
this.ostate = new Uint32Array(8);
|
|
13242
|
+
this.inner._saveState(this.istate);
|
|
13243
|
+
this.outer._saveState(this.ostate);
|
|
13244
|
+
for (var i = 0; i < pad.length; i++) pad[i] = 0;
|
|
13245
|
+
}
|
|
13246
|
+
HMAC.prototype.reset = function() {
|
|
13247
|
+
this.inner._restoreState(this.istate, this.inner.blockSize);
|
|
13248
|
+
this.outer._restoreState(this.ostate, this.outer.blockSize);
|
|
13249
|
+
return this;
|
|
13250
|
+
};
|
|
13251
|
+
HMAC.prototype.clean = function() {
|
|
13252
|
+
for (var i = 0; i < this.istate.length; i++) this.ostate[i] = this.istate[i] = 0;
|
|
13253
|
+
this.inner.clean();
|
|
13254
|
+
this.outer.clean();
|
|
13255
|
+
};
|
|
13256
|
+
HMAC.prototype.update = function(data) {
|
|
13257
|
+
this.inner.update(data);
|
|
13258
|
+
return this;
|
|
13259
|
+
};
|
|
13260
|
+
HMAC.prototype.finish = function(out) {
|
|
13261
|
+
if (this.outer.finished) this.outer.finish(out);
|
|
13262
|
+
else {
|
|
13263
|
+
this.inner.finish(out);
|
|
13264
|
+
this.outer.update(out, this.digestLength).finish(out);
|
|
13265
|
+
}
|
|
13266
|
+
return this;
|
|
13267
|
+
};
|
|
13268
|
+
HMAC.prototype.digest = function() {
|
|
13269
|
+
var out = new Uint8Array(this.digestLength);
|
|
13270
|
+
this.finish(out);
|
|
13271
|
+
return out;
|
|
13272
|
+
};
|
|
13273
|
+
return HMAC;
|
|
13274
|
+
}();
|
|
13275
|
+
exports$2.HMAC = HMAC;
|
|
13276
|
+
function hash(data) {
|
|
13277
|
+
var h = new Hash().update(data);
|
|
13278
|
+
var digest = h.digest();
|
|
13279
|
+
h.clean();
|
|
13280
|
+
return digest;
|
|
13281
|
+
}
|
|
13282
|
+
exports$2.hash = hash;
|
|
13283
|
+
exports$2["default"] = hash;
|
|
13284
|
+
function hmac(key, data) {
|
|
13285
|
+
var h = new HMAC(key).update(data);
|
|
13286
|
+
var digest = h.digest();
|
|
13287
|
+
h.clean();
|
|
13288
|
+
return digest;
|
|
13289
|
+
}
|
|
13290
|
+
exports$2.hmac = hmac;
|
|
13291
|
+
function fillBuffer(buffer, hmac, info, counter) {
|
|
13292
|
+
var num = counter[0];
|
|
13293
|
+
if (num === 0) throw new Error("hkdf: cannot expand more");
|
|
13294
|
+
hmac.reset();
|
|
13295
|
+
if (num > 1) hmac.update(buffer);
|
|
13296
|
+
if (info) hmac.update(info);
|
|
13297
|
+
hmac.update(counter);
|
|
13298
|
+
hmac.finish(buffer);
|
|
13299
|
+
counter[0]++;
|
|
13300
|
+
}
|
|
13301
|
+
var hkdfSalt = new Uint8Array(exports$2.digestLength);
|
|
13302
|
+
function hkdf(key, salt, info, length) {
|
|
13303
|
+
if (salt === void 0) salt = hkdfSalt;
|
|
13304
|
+
if (length === void 0) length = 32;
|
|
13305
|
+
var counter = new Uint8Array([1]);
|
|
13306
|
+
var hmac_ = new HMAC(hmac(salt, key));
|
|
13307
|
+
var buffer = new Uint8Array(hmac_.digestLength);
|
|
13308
|
+
var bufpos = buffer.length;
|
|
13309
|
+
var out = new Uint8Array(length);
|
|
13310
|
+
for (var i = 0; i < length; i++) {
|
|
13311
|
+
if (bufpos === buffer.length) {
|
|
13312
|
+
fillBuffer(buffer, hmac_, info, counter);
|
|
13313
|
+
bufpos = 0;
|
|
13314
|
+
}
|
|
13315
|
+
out[i] = buffer[bufpos++];
|
|
13316
|
+
}
|
|
13317
|
+
hmac_.clean();
|
|
13318
|
+
buffer.fill(0);
|
|
13319
|
+
counter.fill(0);
|
|
13320
|
+
return out;
|
|
13321
|
+
}
|
|
13322
|
+
exports$2.hkdf = hkdf;
|
|
13323
|
+
function pbkdf2(password, salt, iterations, dkLen) {
|
|
13324
|
+
var prf = new HMAC(password);
|
|
13325
|
+
var len = prf.digestLength;
|
|
13326
|
+
var ctr = new Uint8Array(4);
|
|
13327
|
+
var t = new Uint8Array(len);
|
|
13328
|
+
var u = new Uint8Array(len);
|
|
13329
|
+
var dk = new Uint8Array(dkLen);
|
|
13330
|
+
for (var i = 0; i * len < dkLen; i++) {
|
|
13331
|
+
var c = i + 1;
|
|
13332
|
+
ctr[0] = c >>> 24 & 255;
|
|
13333
|
+
ctr[1] = c >>> 16 & 255;
|
|
13334
|
+
ctr[2] = c >>> 8 & 255;
|
|
13335
|
+
ctr[3] = c >>> 0 & 255;
|
|
13336
|
+
prf.reset();
|
|
13337
|
+
prf.update(salt);
|
|
13338
|
+
prf.update(ctr);
|
|
13339
|
+
prf.finish(u);
|
|
13340
|
+
for (var j = 0; j < len; j++) t[j] = u[j];
|
|
13341
|
+
for (var j = 2; j <= iterations; j++) {
|
|
13342
|
+
prf.reset();
|
|
13343
|
+
prf.update(u).finish(u);
|
|
13344
|
+
for (var k = 0; k < len; k++) t[k] ^= u[k];
|
|
13345
|
+
}
|
|
13346
|
+
for (var j = 0; j < len && i * len + j < dkLen; j++) dk[i * len + j] = t[j];
|
|
13347
|
+
}
|
|
13348
|
+
for (var i = 0; i < len; i++) t[i] = u[i] = 0;
|
|
13349
|
+
for (var i = 0; i < 4; i++) ctr[i] = 0;
|
|
13350
|
+
prf.clean();
|
|
13351
|
+
return dk;
|
|
13352
|
+
}
|
|
13353
|
+
exports$2.pbkdf2 = pbkdf2;
|
|
13354
|
+
});
|
|
13355
|
+
}));
|
|
13356
|
+
(/* @__PURE__ */ __commonJSMin(((exports) => {
|
|
13357
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13358
|
+
exports.Webhook = exports.WebhookVerificationError = void 0;
|
|
13359
|
+
const timing_safe_equal_1 = require_timing_safe_equal();
|
|
13360
|
+
const base64 = require_base64();
|
|
13361
|
+
const sha256 = require_sha256();
|
|
13362
|
+
const WEBHOOK_TOLERANCE_IN_SECONDS = 300;
|
|
13363
|
+
var ExtendableError = class ExtendableError extends Error {
|
|
13364
|
+
constructor(message) {
|
|
13365
|
+
super(message);
|
|
13366
|
+
Object.setPrototypeOf(this, ExtendableError.prototype);
|
|
13367
|
+
this.name = "ExtendableError";
|
|
13368
|
+
this.stack = new Error(message).stack;
|
|
13369
|
+
}
|
|
13370
|
+
};
|
|
13371
|
+
var WebhookVerificationError = class WebhookVerificationError extends ExtendableError {
|
|
13372
|
+
constructor(message) {
|
|
13373
|
+
super(message);
|
|
13374
|
+
Object.setPrototypeOf(this, WebhookVerificationError.prototype);
|
|
13375
|
+
this.name = "WebhookVerificationError";
|
|
13376
|
+
}
|
|
13377
|
+
};
|
|
13378
|
+
exports.WebhookVerificationError = WebhookVerificationError;
|
|
13379
|
+
var Webhook = class Webhook {
|
|
13380
|
+
constructor(secret, options) {
|
|
13381
|
+
if (!secret) throw new Error("Secret can't be empty.");
|
|
13382
|
+
if ((options === null || options === void 0 ? void 0 : options.format) === "raw") if (secret instanceof Uint8Array) this.key = secret;
|
|
13383
|
+
else this.key = Uint8Array.from(secret, (c) => c.charCodeAt(0));
|
|
13384
|
+
else {
|
|
13385
|
+
if (typeof secret !== "string") throw new Error("Expected secret to be of type string");
|
|
13386
|
+
if (secret.startsWith(Webhook.prefix)) secret = secret.substring(Webhook.prefix.length);
|
|
13387
|
+
this.key = base64.decode(secret);
|
|
13388
|
+
}
|
|
13389
|
+
}
|
|
13390
|
+
verify(payload, headers_) {
|
|
13391
|
+
const headers = {};
|
|
13392
|
+
for (const key of Object.keys(headers_)) headers[key.toLowerCase()] = headers_[key];
|
|
13393
|
+
const msgId = headers["webhook-id"];
|
|
13394
|
+
const msgSignature = headers["webhook-signature"];
|
|
13395
|
+
const msgTimestamp = headers["webhook-timestamp"];
|
|
13396
|
+
if (!msgSignature || !msgId || !msgTimestamp) throw new WebhookVerificationError("Missing required headers");
|
|
13397
|
+
const timestamp = this.verifyTimestamp(msgTimestamp);
|
|
13398
|
+
const expectedSignature = this.sign(msgId, timestamp, payload).split(",")[1];
|
|
13399
|
+
const passedSignatures = msgSignature.split(" ");
|
|
13400
|
+
const encoder = new globalThis.TextEncoder();
|
|
13401
|
+
for (const versionedSignature of passedSignatures) {
|
|
13402
|
+
const [version, signature] = versionedSignature.split(",");
|
|
13403
|
+
if (version !== "v1") continue;
|
|
13404
|
+
if ((0, timing_safe_equal_1.timingSafeEqual)(encoder.encode(signature), encoder.encode(expectedSignature))) return JSON.parse(payload.toString());
|
|
13405
|
+
}
|
|
13406
|
+
throw new WebhookVerificationError("No matching signature found");
|
|
13407
|
+
}
|
|
13408
|
+
sign(msgId, timestamp, payload) {
|
|
13409
|
+
if (typeof payload === "string") {} else if (payload.constructor.name === "Buffer") payload = payload.toString();
|
|
13410
|
+
else throw new Error("Expected payload to be of type string or Buffer.");
|
|
13411
|
+
const encoder = new TextEncoder();
|
|
13412
|
+
const timestampNumber = Math.floor(timestamp.getTime() / 1e3);
|
|
13413
|
+
const toSign = encoder.encode(`${msgId}.${timestampNumber}.${payload}`);
|
|
13414
|
+
return `v1,${base64.encode(sha256.hmac(this.key, toSign))}`;
|
|
13415
|
+
}
|
|
13416
|
+
verifyTimestamp(timestampHeader) {
|
|
13417
|
+
const now = Math.floor(Date.now() / 1e3);
|
|
13418
|
+
const timestamp = parseInt(timestampHeader, 10);
|
|
13419
|
+
if (isNaN(timestamp)) throw new WebhookVerificationError("Invalid Signature Headers");
|
|
13420
|
+
if (now - timestamp > WEBHOOK_TOLERANCE_IN_SECONDS) throw new WebhookVerificationError("Message timestamp too old");
|
|
13421
|
+
if (timestamp > now + WEBHOOK_TOLERANCE_IN_SECONDS) throw new WebhookVerificationError("Message timestamp too new");
|
|
13422
|
+
return /* @__PURE__ */ new Date(timestamp * 1e3);
|
|
13423
|
+
}
|
|
13424
|
+
};
|
|
13425
|
+
exports.Webhook = Webhook;
|
|
13426
|
+
Webhook.prefix = "whsec_";
|
|
13427
|
+
})))();
|
|
13428
|
+
//#endregion
|
|
13429
|
+
//#region ../../packages/auth/dist/server-CHoi4Eug.mjs
|
|
12724
13430
|
const CLI_CLIENT_ID = "keystroke-cli";
|
|
12725
13431
|
//#endregion
|
|
12726
13432
|
//#region ../../packages/auth/dist/cli.mjs
|
|
@@ -13209,8 +13915,10 @@ async function buildApp(options = {}) {
|
|
|
13209
13915
|
...options,
|
|
13210
13916
|
root
|
|
13211
13917
|
}));
|
|
13212
|
-
|
|
13213
|
-
|
|
13918
|
+
if (options.emitRouteManifest !== false) {
|
|
13919
|
+
const { emitRouteManifest } = await import("./emit-route-manifest-DRcNXHCP-CuH5IaKl.mjs");
|
|
13920
|
+
await emitRouteManifest(root);
|
|
13921
|
+
}
|
|
13214
13922
|
} finally {
|
|
13215
13923
|
process.chdir(previous);
|
|
13216
13924
|
}
|
|
@@ -13222,7 +13930,7 @@ async function buildApp(options = {}) {
|
|
|
13222
13930
|
* restart the API server in `onRebuild` so discovery picks up new/changed modules.
|
|
13223
13931
|
*/
|
|
13224
13932
|
async function watchApp(options = {}) {
|
|
13225
|
-
const { runWatchApp } = await import("./watch-app-DTIeKrbl-
|
|
13933
|
+
const { runWatchApp } = await import("./watch-app-DTIeKrbl-C-BThJEO.mjs");
|
|
13226
13934
|
await runWatchApp(buildApp, options);
|
|
13227
13935
|
}
|
|
13228
13936
|
//#endregion
|
|
@@ -13933,7 +14641,8 @@ async function runStart(options) {
|
|
|
13933
14641
|
ensureNativeDeps(runtimeNodeModules);
|
|
13934
14642
|
await buildApp({
|
|
13935
14643
|
root,
|
|
13936
|
-
clean: false
|
|
14644
|
+
clean: false,
|
|
14645
|
+
emitRouteManifest: false
|
|
13937
14646
|
});
|
|
13938
14647
|
const processes = [{
|
|
13939
14648
|
name: "api",
|
|
@@ -14156,6 +14865,6 @@ function runCli(argv) {
|
|
|
14156
14865
|
//#region src/index.ts
|
|
14157
14866
|
runCli(process.argv);
|
|
14158
14867
|
//#endregion
|
|
14159
|
-
export { getTableUniqueName as $, _enum as $t, applyMixins as A, TriggerListResponseSchema as At, Param as B, WorkflowSubscriptionListResponseSchema as Bt, PgJsonb as C, url as Cn, PollRunRequestSchema as Ct, PgDate as D, $ZodError as Dn, QueuedAgentPromptResponseSchema as Dt, integer as E, toJSONSchema as En, PromptResponseSchema as Et, isConfig as F, UpsertGatewayAttachmentBodySchema as Ft, fillPlaceholders as G, parsePollRunRequest as Gt, SQL as H, credentialInputSchema as Ht, mapResultRow as I, UpsertWorkflowSubscriptionBodySchema as It, sql as J, parseWorkflowRunDetailInclude as Jt, isDriverValueEncoder as K, parsePromptInput as Kt, mapUpdateSet as L, WorkflowRunDetailResponseSchema as Lt, getTableColumns as M, TriggerRunListQuerySchema as Mt, getTableLikeName as N, TriggerRunListResponseSchema as Nt, PgDateString as O, prettifyError as On, SkipResponseSchema as Ot, haveSameKeys as P, UpdateCredentialInstanceBodySchema as Pt, getTableName as Q, ZodType as Qt, orderSelectedFields as R, WorkflowRunListQuerySchema as Rt, PgNumeric as S, unknown as Sn, GatewayAttachmentRecordSchema as St, PgJson as T, datetime as Tn, PromptInputSchema as Tt, StringChunk as U, normalizeCredentialList as Ut, Placeholder as V, WorkflowSubscriptionRecordSchema as Vt, View as W, parseAgentSessionDetailInclude as Wt, Schema as X, boolean$1 as Xt, Columns as Y, validationErrorResponse as Yt, Table as Z, number as Zt, PgTimestamp as _, optional as _n, CredentialInstanceListResponseSchema as _t, entryIdFromFile as a, boolean$2 as an, PgColumn as at, PgTime as b, string as bn, ErrorResponseSchema as bt, authSessions as c, discriminatedUnion as cn, Column as ct, users as d, lazy as dn, AgentListResponseSchema as dt, _function as en, ViewBaseConfig as et, index as f, literal as fn, AgentSessionDetailResponseSchema as ft, PgUUID as g, object as gn, CreateCredentialInstanceBodySchema as gt, pgTable as h, number$1 as hn, CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE as ht, resolveSandboxRoot as i, array as in, pgEnum as it, getColumnNameAndConfig as j, TriggerRunDetailResponseSchema as jt, boolean as k, NEVER as kn, TriggerDetailResponseSchema as kt, authVerifications as l, int as ln, entityKind as lt, PgTable as m, nullable as mn, AgentSessionListResponseSchema as mt, ensureWorkspaceDir as n, _void as nn, Subquery as nt, authAccounts as o, custom as on, TableName as ot, uniqueIndex as p, looseObject as pn, AgentSessionListQuerySchema as pt, isSQLWrapper as q, parseTriggerRunDetailInclude as qt, materializeSandbox as r, any as rn, WithSubquery as rt, authDeviceCodes as s, date$1 as sn, ColumnBuilder as st, SandboxDefinitionSchema as t, _null as tn, tracer as tt, getDbFromContext as u, intersection as un, is as ut, PgTimestampString as v, preprocess as vn, CredentialInstanceRecordSchema as vt, jsonb as w, ZodError as wn, PollRunResponseSchema as wt, text as x, union as xn, GatewayAttachmentListResponseSchema as xt, timestamp as y, record as yn, DISCOVERY_CONVENTIONS as yt, textDecoder as z, WorkflowRunListResponseSchema as zt };
|
|
14868
|
+
export { getTableUniqueName as $, _enum as $t, applyMixins as A, __commonJSMin as An, TriggerListResponseSchema as At, Param as B, WorkflowSubscriptionListResponseSchema as Bt, PgJsonb as C, url as Cn, PollRunRequestSchema as Ct, PgDate as D, $ZodError as Dn, QueuedAgentPromptResponseSchema as Dt, integer as E, toJSONSchema as En, PromptResponseSchema as Et, isConfig as F, UpsertGatewayAttachmentBodySchema as Ft, fillPlaceholders as G, parsePollRunRequest as Gt, SQL as H, credentialInputSchema as Ht, mapResultRow as I, UpsertWorkflowSubscriptionBodySchema as It, sql as J, parseWorkflowRunDetailInclude as Jt, isDriverValueEncoder as K, parsePromptInput as Kt, mapUpdateSet as L, WorkflowRunDetailResponseSchema as Lt, getTableColumns as M, __exportAll as Mn, TriggerRunListQuerySchema as Mt, getTableLikeName as N, __require as Nn, TriggerRunListResponseSchema as Nt, PgDateString as O, prettifyError as On, SkipResponseSchema as Ot, haveSameKeys as P, __toESM as Pn, UpdateCredentialInstanceBodySchema as Pt, getTableName as Q, ZodType as Qt, orderSelectedFields as R, WorkflowRunListQuerySchema as Rt, PgNumeric as S, unknown as Sn, GatewayAttachmentRecordSchema as St, PgJson as T, datetime as Tn, PromptInputSchema as Tt, StringChunk as U, normalizeCredentialList as Ut, Placeholder as V, WorkflowSubscriptionRecordSchema as Vt, View as W, parseAgentSessionDetailInclude as Wt, Schema as X, boolean$1 as Xt, Columns as Y, validationErrorResponse as Yt, Table as Z, number as Zt, PgTimestamp as _, optional as _n, CredentialInstanceListResponseSchema as _t, entryIdFromFile as a, boolean$2 as an, PgColumn as at, PgTime as b, string as bn, ErrorResponseSchema as bt, authSessions as c, discriminatedUnion as cn, Column as ct, users as d, lazy as dn, AgentListResponseSchema as dt, _function as en, ViewBaseConfig as et, index as f, literal as fn, AgentSessionDetailResponseSchema as ft, PgUUID as g, object as gn, CreateCredentialInstanceBodySchema as gt, pgTable as h, number$1 as hn, CREDENTIAL_SCOPE_LEVEL_TO_SCOPE_TYPE as ht, resolveSandboxRoot as i, array as in, pgEnum as it, getColumnNameAndConfig as j, __esmMin as jn, TriggerRunDetailResponseSchema as jt, boolean as k, NEVER as kn, TriggerDetailResponseSchema as kt, authVerifications as l, int as ln, entityKind as lt, PgTable as m, nullable as mn, AgentSessionListResponseSchema as mt, ensureWorkspaceDir as n, _void as nn, Subquery as nt, authAccounts as o, custom as on, TableName as ot, uniqueIndex as p, looseObject as pn, AgentSessionListQuerySchema as pt, isSQLWrapper as q, parseTriggerRunDetailInclude as qt, materializeSandbox as r, any as rn, WithSubquery as rt, authDeviceCodes as s, date$1 as sn, ColumnBuilder as st, SandboxDefinitionSchema as t, _null as tn, tracer as tt, getDbFromContext as u, intersection as un, is as ut, PgTimestampString as v, preprocess as vn, CredentialInstanceRecordSchema as vt, jsonb as w, ZodError as wn, PollRunResponseSchema as wt, text as x, union as xn, GatewayAttachmentListResponseSchema as xt, timestamp as y, record as yn, DISCOVERY_CONVENTIONS as yt, textDecoder as z, WorkflowRunListResponseSchema as zt };
|
|
14160
14869
|
|
|
14161
14870
|
//# sourceMappingURL=index.mjs.map
|