@utilix-tech/sdk 0.69.0 → 0.71.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +7 -0
- package/README.md +14 -6
- package/dist/{api-DmTNE4c1.d.cts → api-C8rImfka.d.cts} +55 -2
- package/dist/{api-DmTNE4c1.d.ts → api-C8rImfka.d.ts} +55 -2
- package/dist/{chunk-52ZDKSIX.js → chunk-4S63T7Y4.js} +72 -1
- package/dist/{chunk-4HNHEOJL.js → chunk-653HDWXW.js} +41 -1
- package/dist/{chunk-226EH3ZI.js → chunk-PT4N4UBL.js} +132 -1
- package/dist/index.cjs +242 -0
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/{media-BUvwm4wU.d.cts → media-56zrIBw4.d.cts} +47 -2
- package/dist/{media-BUvwm4wU.d.ts → media-56zrIBw4.d.ts} +47 -2
- package/dist/tools/api.cjs +71 -0
- package/dist/tools/api.d.cts +1 -1
- package/dist/tools/api.d.ts +1 -1
- package/dist/tools/api.js +1 -1
- package/dist/tools/media.cjs +131 -0
- package/dist/tools/media.d.cts +1 -1
- package/dist/tools/media.d.ts +1 -1
- package/dist/tools/media.js +1 -1
- package/dist/tools/units.cjs +40 -0
- package/dist/tools/units.d.cts +1 -1
- package/dist/tools/units.d.ts +1 -1
- package/dist/tools/units.js +1 -1
- package/dist/{units-DPefgzmH.d.ts → units-BT8P27G0.d.cts} +29 -2
- package/dist/{units-DPefgzmH.d.cts → units-BT8P27G0.d.ts} +29 -2
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -8581,6 +8581,7 @@ __export(units_exports, {
|
|
|
8581
8581
|
calculateSavingsGoal: () => calculateSavingsGoal,
|
|
8582
8582
|
calculateSimpleInterest: () => calculateSimpleInterest,
|
|
8583
8583
|
calculateTax: () => calculateTax,
|
|
8584
|
+
calculateTaxEquivalentYield: () => calculateTaxEquivalentYield,
|
|
8584
8585
|
calculateTimeValue: () => calculateTimeValue,
|
|
8585
8586
|
calculateTipSplit: () => calculateTipSplit,
|
|
8586
8587
|
calculateVideoBitrate: () => calculateVideoBitrate,
|
|
@@ -11037,6 +11038,45 @@ function calculateLoanRefinance(currentBalance, currentRatePercent, currentRemai
|
|
|
11037
11038
|
totalInterestSavings: round2(current.totalInterest - refinanced.totalInterest)
|
|
11038
11039
|
};
|
|
11039
11040
|
}
|
|
11041
|
+
function calculateTaxEquivalentYield(inputYieldPercent, federalTaxRatePercent, stateTaxRatePercent = 0, direction) {
|
|
11042
|
+
if (!Number.isFinite(inputYieldPercent) || inputYieldPercent < 0) {
|
|
11043
|
+
return { error: "Yield must be zero or a positive number" };
|
|
11044
|
+
}
|
|
11045
|
+
if (!Number.isFinite(federalTaxRatePercent) || federalTaxRatePercent < 0 || federalTaxRatePercent >= 100) {
|
|
11046
|
+
return { error: "Federal tax rate must be a percentage between 0 and 100 (exclusive of 100)" };
|
|
11047
|
+
}
|
|
11048
|
+
if (!Number.isFinite(stateTaxRatePercent) || stateTaxRatePercent < 0 || stateTaxRatePercent >= 100) {
|
|
11049
|
+
return { error: "State tax rate must be a percentage between 0 and 100 (exclusive of 100)" };
|
|
11050
|
+
}
|
|
11051
|
+
if (direction !== "tax-free-to-taxable" && direction !== "taxable-to-tax-free") {
|
|
11052
|
+
return { error: 'Direction must be "tax-free-to-taxable" or "taxable-to-tax-free"' };
|
|
11053
|
+
}
|
|
11054
|
+
const combinedTaxRatePercent = federalTaxRatePercent + stateTaxRatePercent;
|
|
11055
|
+
if (combinedTaxRatePercent >= 100) {
|
|
11056
|
+
return { error: "Combined federal and state tax rate must be less than 100%" };
|
|
11057
|
+
}
|
|
11058
|
+
const round6 = (n) => Math.round(n * 1e6) / 1e6;
|
|
11059
|
+
const combinedRateDecimal = combinedTaxRatePercent / 100;
|
|
11060
|
+
let taxFreeYield;
|
|
11061
|
+
let taxableYield;
|
|
11062
|
+
if (direction === "tax-free-to-taxable") {
|
|
11063
|
+
taxFreeYield = inputYieldPercent;
|
|
11064
|
+
taxableYield = taxFreeYield / (1 - combinedRateDecimal);
|
|
11065
|
+
} else {
|
|
11066
|
+
taxableYield = inputYieldPercent;
|
|
11067
|
+
taxFreeYield = taxableYield * (1 - combinedRateDecimal);
|
|
11068
|
+
}
|
|
11069
|
+
return {
|
|
11070
|
+
direction,
|
|
11071
|
+
inputYield: round6(inputYieldPercent),
|
|
11072
|
+
federalTaxRatePercent: round6(federalTaxRatePercent),
|
|
11073
|
+
stateTaxRatePercent: round6(stateTaxRatePercent),
|
|
11074
|
+
combinedTaxRatePercent: round6(combinedTaxRatePercent),
|
|
11075
|
+
taxFreeYield: round6(taxFreeYield),
|
|
11076
|
+
taxableYield: round6(taxableYield),
|
|
11077
|
+
yieldDifference: round6(taxableYield - taxFreeYield)
|
|
11078
|
+
};
|
|
11079
|
+
}
|
|
11040
11080
|
|
|
11041
11081
|
// src/tools/network.ts
|
|
11042
11082
|
var network_exports = {};
|
|
@@ -14547,7 +14587,9 @@ __export(api_exports, {
|
|
|
14547
14587
|
generateCors: () => generateCors,
|
|
14548
14588
|
generateCspHeader: () => generateCspHeader,
|
|
14549
14589
|
generateFullHeader: () => generateFullHeader,
|
|
14590
|
+
generateHotp: () => generateHotp,
|
|
14550
14591
|
generateMetaHtml: () => generateMetaHtml,
|
|
14592
|
+
generateTotp: () => generateTotp,
|
|
14551
14593
|
getParam: () => getParam,
|
|
14552
14594
|
getStats: () => getStats,
|
|
14553
14595
|
isValidUrl: () => isValidUrl,
|
|
@@ -15826,6 +15868,75 @@ function generateMetaHtml(tags) {
|
|
|
15826
15868
|
}
|
|
15827
15869
|
return lines.join("\n");
|
|
15828
15870
|
}
|
|
15871
|
+
var OTP_ALG_TO_NODE_HASH = {
|
|
15872
|
+
SHA1: "sha1",
|
|
15873
|
+
SHA256: "sha256",
|
|
15874
|
+
SHA512: "sha512"
|
|
15875
|
+
};
|
|
15876
|
+
function decodeBase32Secret(secret) {
|
|
15877
|
+
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
|
|
15878
|
+
const cleaned = secret.toUpperCase().replace(/[\s=]/g, "");
|
|
15879
|
+
if (!cleaned) {
|
|
15880
|
+
return { error: "Secret must not be empty" };
|
|
15881
|
+
}
|
|
15882
|
+
const bytes = [];
|
|
15883
|
+
let buffer = 0;
|
|
15884
|
+
let bitsLeft = 0;
|
|
15885
|
+
for (const char of cleaned) {
|
|
15886
|
+
const val = alphabet.indexOf(char);
|
|
15887
|
+
if (val === -1) {
|
|
15888
|
+
return { error: `Invalid base32 character '${char}' in secret` };
|
|
15889
|
+
}
|
|
15890
|
+
buffer = buffer << 5 | val;
|
|
15891
|
+
bitsLeft += 5;
|
|
15892
|
+
if (bitsLeft >= 8) {
|
|
15893
|
+
bitsLeft -= 8;
|
|
15894
|
+
bytes.push(buffer >> bitsLeft & 255);
|
|
15895
|
+
}
|
|
15896
|
+
}
|
|
15897
|
+
return Buffer.from(bytes);
|
|
15898
|
+
}
|
|
15899
|
+
function hotpFromCounter(keyBytes, counter, digits, algorithm) {
|
|
15900
|
+
const counterBuffer = Buffer.alloc(8);
|
|
15901
|
+
counterBuffer.writeUInt32BE(Math.floor(counter / 4294967296), 0);
|
|
15902
|
+
counterBuffer.writeUInt32BE(counter % 4294967296, 4);
|
|
15903
|
+
const hmac = crypto.createHmac(OTP_ALG_TO_NODE_HASH[algorithm], keyBytes).update(counterBuffer).digest();
|
|
15904
|
+
const offset = hmac[hmac.length - 1] & 15;
|
|
15905
|
+
const binCode = (hmac[offset] & 127) << 24 | (hmac[offset + 1] & 255) << 16 | (hmac[offset + 2] & 255) << 8 | hmac[offset + 3] & 255;
|
|
15906
|
+
const code = (binCode % 10 ** digits).toString().padStart(digits, "0");
|
|
15907
|
+
return code;
|
|
15908
|
+
}
|
|
15909
|
+
function generateHotp(secret, counter, options = {}) {
|
|
15910
|
+
const digits = options.digits ?? 6;
|
|
15911
|
+
const algorithm = options.algorithm ?? "SHA1";
|
|
15912
|
+
if (!Number.isInteger(counter) || counter < 0) {
|
|
15913
|
+
return { error: "Counter must be a non-negative whole number" };
|
|
15914
|
+
}
|
|
15915
|
+
if (!Number.isInteger(digits) || digits < 6 || digits > 8) {
|
|
15916
|
+
return { error: "Digits must be an integer between 6 and 8" };
|
|
15917
|
+
}
|
|
15918
|
+
if (!(algorithm in OTP_ALG_TO_NODE_HASH)) {
|
|
15919
|
+
return { error: "Algorithm must be one of SHA1, SHA256, SHA512" };
|
|
15920
|
+
}
|
|
15921
|
+
const keyBytes = decodeBase32Secret(secret);
|
|
15922
|
+
if ("error" in keyBytes) return keyBytes;
|
|
15923
|
+
return { code: hotpFromCounter(keyBytes, counter, digits, algorithm), counter, digits, algorithm };
|
|
15924
|
+
}
|
|
15925
|
+
function generateTotp(secret, options = {}) {
|
|
15926
|
+
const periodSeconds = options.periodSeconds ?? 30;
|
|
15927
|
+
const timestamp = options.timestamp ?? Math.floor(Date.now() / 1e3);
|
|
15928
|
+
if (!Number.isFinite(periodSeconds) || periodSeconds <= 0) {
|
|
15929
|
+
return { error: "Period must be a positive number of seconds" };
|
|
15930
|
+
}
|
|
15931
|
+
if (!Number.isFinite(timestamp) || timestamp < 0) {
|
|
15932
|
+
return { error: "Timestamp must be a non-negative number of seconds" };
|
|
15933
|
+
}
|
|
15934
|
+
const counter = Math.floor(timestamp / periodSeconds);
|
|
15935
|
+
const hotp = generateHotp(secret, counter, options);
|
|
15936
|
+
if ("error" in hotp) return hotp;
|
|
15937
|
+
const secondsRemaining = periodSeconds - timestamp % periodSeconds;
|
|
15938
|
+
return { ...hotp, periodSeconds, secondsRemaining };
|
|
15939
|
+
}
|
|
15829
15940
|
|
|
15830
15941
|
// src/tools/code.ts
|
|
15831
15942
|
var code_exports = {};
|
|
@@ -24246,6 +24357,7 @@ __export(media_exports, {
|
|
|
24246
24357
|
readIcoInfo: () => readIcoInfo,
|
|
24247
24358
|
readId3Tags: () => readId3Tags,
|
|
24248
24359
|
readImageInfo: () => readImageInfo,
|
|
24360
|
+
readMidiInfo: () => readMidiInfo,
|
|
24249
24361
|
readPdfMetadata: () => readPdfMetadata,
|
|
24250
24362
|
readPdfPageDimensions: () => readPdfPageDimensions,
|
|
24251
24363
|
readVideoInfo: () => readVideoInfo,
|
|
@@ -25543,6 +25655,136 @@ function inspectGifFrames(bytes) {
|
|
|
25543
25655
|
hasTransparency
|
|
25544
25656
|
};
|
|
25545
25657
|
}
|
|
25658
|
+
function readU16BE(bytes, offset) {
|
|
25659
|
+
return bytes[offset] << 8 | bytes[offset + 1];
|
|
25660
|
+
}
|
|
25661
|
+
function readMidiVarLen(bytes, pos) {
|
|
25662
|
+
let value = 0;
|
|
25663
|
+
let i = pos;
|
|
25664
|
+
for (let n = 0; n < 4; n++) {
|
|
25665
|
+
if (i >= bytes.length) return null;
|
|
25666
|
+
const b = bytes[i];
|
|
25667
|
+
value = value << 7 | b & 127;
|
|
25668
|
+
i++;
|
|
25669
|
+
if ((b & 128) === 0) return { value, next: i };
|
|
25670
|
+
}
|
|
25671
|
+
return null;
|
|
25672
|
+
}
|
|
25673
|
+
function readMidiInfo(bytes) {
|
|
25674
|
+
if (bytes.length < 14) return { error: "File is too small to be a valid MIDI file" };
|
|
25675
|
+
if (Buffer.from(bytes.subarray(0, 4)).toString("ascii") !== "MThd") {
|
|
25676
|
+
return { error: 'Not a valid MIDI file (missing "MThd" header chunk)' };
|
|
25677
|
+
}
|
|
25678
|
+
const headerLength = readU32BE(bytes, 4);
|
|
25679
|
+
if (headerLength < 6 || 8 + headerLength > bytes.length) return { error: "Truncated or invalid MThd header chunk" };
|
|
25680
|
+
const format = readU16BE(bytes, 8);
|
|
25681
|
+
if (format !== 0 && format !== 1 && format !== 2) return { error: `Unsupported MIDI format: ${format} (expected 0, 1, or 2)` };
|
|
25682
|
+
const trackCount = readU16BE(bytes, 10);
|
|
25683
|
+
if (trackCount < 1) return { error: "MIDI file declares zero tracks" };
|
|
25684
|
+
const divisionRaw = readU16BE(bytes, 12);
|
|
25685
|
+
const division = (divisionRaw & 32768) !== 0 ? { type: "smpte", framesPerSecond: -(divisionRaw >> 8 << 24 >> 24), ticksPerFrame: divisionRaw & 255 } : { type: "ppq", ticksPerQuarterNote: divisionRaw & 32767 };
|
|
25686
|
+
const tracks = [];
|
|
25687
|
+
const tempoChanges = [];
|
|
25688
|
+
let timeSignature = null;
|
|
25689
|
+
let maxEndTick = 0;
|
|
25690
|
+
let offset = 8 + headerLength;
|
|
25691
|
+
let tracksParsed = 0;
|
|
25692
|
+
while (tracksParsed < trackCount && offset + 8 <= bytes.length) {
|
|
25693
|
+
const chunkId = Buffer.from(bytes.subarray(offset, offset + 4)).toString("ascii");
|
|
25694
|
+
const chunkLength = readU32BE(bytes, offset + 4);
|
|
25695
|
+
const dataStart = offset + 8;
|
|
25696
|
+
const dataEnd = Math.min(dataStart + chunkLength, bytes.length);
|
|
25697
|
+
if (chunkId !== "MTrk") {
|
|
25698
|
+
offset = dataEnd;
|
|
25699
|
+
continue;
|
|
25700
|
+
}
|
|
25701
|
+
let pos = dataStart;
|
|
25702
|
+
let runningStatus = 0;
|
|
25703
|
+
let absoluteTick = 0;
|
|
25704
|
+
let eventCount = 0;
|
|
25705
|
+
let noteOnCount = 0;
|
|
25706
|
+
let name = null;
|
|
25707
|
+
while (pos < dataEnd) {
|
|
25708
|
+
const delta = readMidiVarLen(bytes, pos);
|
|
25709
|
+
if (!delta) break;
|
|
25710
|
+
pos = delta.next;
|
|
25711
|
+
absoluteTick += delta.value;
|
|
25712
|
+
if (pos >= dataEnd) break;
|
|
25713
|
+
let statusByte = bytes[pos];
|
|
25714
|
+
if (statusByte & 128) {
|
|
25715
|
+
runningStatus = statusByte;
|
|
25716
|
+
pos++;
|
|
25717
|
+
}
|
|
25718
|
+
statusByte = runningStatus;
|
|
25719
|
+
eventCount++;
|
|
25720
|
+
if (statusByte === 255) {
|
|
25721
|
+
const metaType = bytes[pos];
|
|
25722
|
+
pos++;
|
|
25723
|
+
const len = readMidiVarLen(bytes, pos);
|
|
25724
|
+
if (!len) break;
|
|
25725
|
+
pos = len.next;
|
|
25726
|
+
const data = bytes.subarray(pos, Math.min(pos + len.value, dataEnd));
|
|
25727
|
+
pos += len.value;
|
|
25728
|
+
if (metaType === 81 && data.length >= 3) {
|
|
25729
|
+
tempoChanges.push({ tick: absoluteTick, usPerQuarter: data[0] << 16 | data[1] << 8 | data[2] });
|
|
25730
|
+
} else if (metaType === 88 && data.length >= 2) {
|
|
25731
|
+
if (!timeSignature) timeSignature = { numerator: data[0], denominator: 2 ** data[1] };
|
|
25732
|
+
} else if (metaType === 3 && name === null) {
|
|
25733
|
+
name = Buffer.from(data).toString("utf8").trim() || null;
|
|
25734
|
+
} else if (metaType === 47) {
|
|
25735
|
+
break;
|
|
25736
|
+
}
|
|
25737
|
+
} else if (statusByte === 240 || statusByte === 247) {
|
|
25738
|
+
const len = readMidiVarLen(bytes, pos);
|
|
25739
|
+
if (!len) break;
|
|
25740
|
+
pos = len.next + len.value;
|
|
25741
|
+
} else if (statusByte >= 128) {
|
|
25742
|
+
const type = statusByte & 240;
|
|
25743
|
+
if (type === 192 || type === 208) {
|
|
25744
|
+
pos += 1;
|
|
25745
|
+
} else {
|
|
25746
|
+
if (type === 144 && (bytes[pos + 1] ?? 0) > 0) noteOnCount++;
|
|
25747
|
+
pos += 2;
|
|
25748
|
+
}
|
|
25749
|
+
} else {
|
|
25750
|
+
break;
|
|
25751
|
+
}
|
|
25752
|
+
}
|
|
25753
|
+
tracks.push({ index: tracksParsed, name, eventCount, noteOnCount });
|
|
25754
|
+
maxEndTick = Math.max(maxEndTick, absoluteTick);
|
|
25755
|
+
offset = dataEnd;
|
|
25756
|
+
tracksParsed++;
|
|
25757
|
+
}
|
|
25758
|
+
if (tracks.length === 0) return { error: "No MTrk track chunks found in this MIDI file" };
|
|
25759
|
+
const DEFAULT_US_PER_QUARTER = 5e5;
|
|
25760
|
+
const initialTempoBpm = Math.round(6e7 / (tempoChanges[0]?.usPerQuarter ?? DEFAULT_US_PER_QUARTER) * 100) / 100;
|
|
25761
|
+
let durationSeconds = null;
|
|
25762
|
+
if (division.type === "smpte") {
|
|
25763
|
+
const ticksPerSecond = division.framesPerSecond * division.ticksPerFrame;
|
|
25764
|
+
durationSeconds = ticksPerSecond > 0 ? Math.round(maxEndTick / ticksPerSecond * 1e3) / 1e3 : null;
|
|
25765
|
+
} else {
|
|
25766
|
+
const sorted = [...tempoChanges].sort((a, b) => a.tick - b.tick);
|
|
25767
|
+
let seconds = 0;
|
|
25768
|
+
let prevTick = 0;
|
|
25769
|
+
let currentUsPerQuarter = DEFAULT_US_PER_QUARTER;
|
|
25770
|
+
for (const change of sorted) {
|
|
25771
|
+
seconds += (change.tick - prevTick) / division.ticksPerQuarterNote * (currentUsPerQuarter / 1e6);
|
|
25772
|
+
prevTick = change.tick;
|
|
25773
|
+
currentUsPerQuarter = change.usPerQuarter;
|
|
25774
|
+
}
|
|
25775
|
+
seconds += (maxEndTick - prevTick) / division.ticksPerQuarterNote * (currentUsPerQuarter / 1e6);
|
|
25776
|
+
durationSeconds = Math.round(seconds * 1e3) / 1e3;
|
|
25777
|
+
}
|
|
25778
|
+
return {
|
|
25779
|
+
format,
|
|
25780
|
+
trackCount: tracks.length,
|
|
25781
|
+
division,
|
|
25782
|
+
initialTempoBpm,
|
|
25783
|
+
timeSignature,
|
|
25784
|
+
durationSeconds,
|
|
25785
|
+
tracks
|
|
25786
|
+
};
|
|
25787
|
+
}
|
|
25546
25788
|
|
|
25547
25789
|
// src/index.ts
|
|
25548
25790
|
var version = "0.1.0";
|
package/dist/index.d.cts
CHANGED
|
@@ -5,15 +5,15 @@ export { t as text } from './text-DWUcY8H1.cjs';
|
|
|
5
5
|
export { d as data } from './data-26TALa9U.cjs';
|
|
6
6
|
export { g as generators } from './generators-DAXXrMvG.cjs';
|
|
7
7
|
export { t as time } from './time-KqJjdqII.cjs';
|
|
8
|
-
export { u as units } from './units-
|
|
8
|
+
export { u as units } from './units-BT8P27G0.cjs';
|
|
9
9
|
export { n as network } from './network-BmqYmfqY.cjs';
|
|
10
|
-
export { a as api } from './api-
|
|
10
|
+
export { a as api } from './api-C8rImfka.cjs';
|
|
11
11
|
export { c as code } from './code-CoeD4Fmq.cjs';
|
|
12
12
|
export { c as color } from './color-tPwZCr9H.cjs';
|
|
13
13
|
export { c as css } from './css-Cf7AMGM-.cjs';
|
|
14
14
|
export { m as misc } from './misc-CA3N198T.cjs';
|
|
15
15
|
export { a as ai_agent } from './ai_agent-CmrVjvYH.cjs';
|
|
16
|
-
export { m as media } from './media-
|
|
16
|
+
export { m as media } from './media-56zrIBw4.cjs';
|
|
17
17
|
|
|
18
18
|
declare const version = "0.1.0";
|
|
19
19
|
|
package/dist/index.d.ts
CHANGED
|
@@ -5,15 +5,15 @@ export { t as text } from './text-DWUcY8H1.js';
|
|
|
5
5
|
export { d as data } from './data-26TALa9U.js';
|
|
6
6
|
export { g as generators } from './generators-DAXXrMvG.js';
|
|
7
7
|
export { t as time } from './time-KqJjdqII.js';
|
|
8
|
-
export { u as units } from './units-
|
|
8
|
+
export { u as units } from './units-BT8P27G0.js';
|
|
9
9
|
export { n as network } from './network-BmqYmfqY.js';
|
|
10
|
-
export { a as api } from './api-
|
|
10
|
+
export { a as api } from './api-C8rImfka.js';
|
|
11
11
|
export { c as code } from './code-CoeD4Fmq.js';
|
|
12
12
|
export { c as color } from './color-tPwZCr9H.js';
|
|
13
13
|
export { c as css } from './css-Cf7AMGM-.js';
|
|
14
14
|
export { m as misc } from './misc-CA3N198T.js';
|
|
15
15
|
export { a as ai_agent } from './ai_agent-CmrVjvYH.js';
|
|
16
|
-
export { m as media } from './media-
|
|
16
|
+
export { m as media } from './media-56zrIBw4.js';
|
|
17
17
|
|
|
18
18
|
declare const version = "0.1.0";
|
|
19
19
|
|
package/dist/index.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
export { media_exports as media } from './chunk-
|
|
2
|
-
export { units_exports as units } from './chunk-
|
|
1
|
+
export { media_exports as media } from './chunk-PT4N4UBL.js';
|
|
2
|
+
export { units_exports as units } from './chunk-653HDWXW.js';
|
|
3
3
|
export { network_exports as network } from './chunk-ACGCCOCK.js';
|
|
4
|
-
export { api_exports as api } from './chunk-
|
|
4
|
+
export { api_exports as api } from './chunk-4S63T7Y4.js';
|
|
5
5
|
export { code_exports as code } from './chunk-DAD2ZOTJ.js';
|
|
6
6
|
export { color_exports as color } from './chunk-BPVAB4P2.js';
|
|
7
7
|
export { css_exports as css } from './chunk-6YPV2AB5.js';
|
|
@@ -224,6 +224,45 @@ interface GifInfoError {
|
|
|
224
224
|
* any LZW-compressed pixel data.
|
|
225
225
|
*/
|
|
226
226
|
declare function inspectGifFrames(bytes: Uint8Array): GifInfo | GifInfoError;
|
|
227
|
+
type MidiDivision = {
|
|
228
|
+
type: 'ppq';
|
|
229
|
+
ticksPerQuarterNote: number;
|
|
230
|
+
} | {
|
|
231
|
+
type: 'smpte';
|
|
232
|
+
framesPerSecond: number;
|
|
233
|
+
ticksPerFrame: number;
|
|
234
|
+
};
|
|
235
|
+
interface MidiTrackInfo {
|
|
236
|
+
index: number;
|
|
237
|
+
name: string | null;
|
|
238
|
+
eventCount: number;
|
|
239
|
+
noteOnCount: number;
|
|
240
|
+
}
|
|
241
|
+
interface MidiTimeSignature {
|
|
242
|
+
numerator: number;
|
|
243
|
+
denominator: number;
|
|
244
|
+
}
|
|
245
|
+
interface MidiInfo {
|
|
246
|
+
format: number;
|
|
247
|
+
trackCount: number;
|
|
248
|
+
division: MidiDivision;
|
|
249
|
+
initialTempoBpm: number;
|
|
250
|
+
timeSignature: MidiTimeSignature | null;
|
|
251
|
+
durationSeconds: number | null;
|
|
252
|
+
tracks: MidiTrackInfo[];
|
|
253
|
+
}
|
|
254
|
+
interface MidiInfoError {
|
|
255
|
+
error: string;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Parse a Standard MIDI File (SMF) header and every track chunk to report
|
|
259
|
+
* format (0/1/2), the tick division, initial tempo, time signature, a
|
|
260
|
+
* per-track event/note-on count, and total duration in seconds. Duration
|
|
261
|
+
* accounts for tempo-change meta events across the whole file when the
|
|
262
|
+
* division is ticks-per-quarter-note; the rarer SMPTE division uses a fixed
|
|
263
|
+
* frames-per-second/ticks-per-frame rate instead.
|
|
264
|
+
*/
|
|
265
|
+
declare function readMidiInfo(bytes: Uint8Array): MidiInfo | MidiInfoError;
|
|
227
266
|
|
|
228
267
|
type media_ExifData = ExifData;
|
|
229
268
|
type media_ExifError = ExifError;
|
|
@@ -239,6 +278,11 @@ type media_Id3TagsError = Id3TagsError;
|
|
|
239
278
|
type media_ImageFormat = ImageFormat;
|
|
240
279
|
type media_ImageInfo = ImageInfo;
|
|
241
280
|
type media_ImageInfoError = ImageInfoError;
|
|
281
|
+
type media_MidiDivision = MidiDivision;
|
|
282
|
+
type media_MidiInfo = MidiInfo;
|
|
283
|
+
type media_MidiInfoError = MidiInfoError;
|
|
284
|
+
type media_MidiTimeSignature = MidiTimeSignature;
|
|
285
|
+
type media_MidiTrackInfo = MidiTrackInfo;
|
|
242
286
|
type media_PdfMetadata = PdfMetadata;
|
|
243
287
|
type media_PdfMetadataError = PdfMetadataError;
|
|
244
288
|
type media_PdfPageDimension = PdfPageDimension;
|
|
@@ -254,12 +298,13 @@ declare const media_readFlacInfo: typeof readFlacInfo;
|
|
|
254
298
|
declare const media_readIcoInfo: typeof readIcoInfo;
|
|
255
299
|
declare const media_readId3Tags: typeof readId3Tags;
|
|
256
300
|
declare const media_readImageInfo: typeof readImageInfo;
|
|
301
|
+
declare const media_readMidiInfo: typeof readMidiInfo;
|
|
257
302
|
declare const media_readPdfMetadata: typeof readPdfMetadata;
|
|
258
303
|
declare const media_readPdfPageDimensions: typeof readPdfPageDimensions;
|
|
259
304
|
declare const media_readVideoInfo: typeof readVideoInfo;
|
|
260
305
|
declare const media_readWavInfo: typeof readWavInfo;
|
|
261
306
|
declare namespace media {
|
|
262
|
-
export { type media_ExifData as ExifData, type media_ExifError as ExifError, type media_FlacInfo as FlacInfo, type media_FlacInfoError as FlacInfoError, type media_GifInfo as GifInfo, type media_GifInfoError as GifInfoError, type media_IcoImageEntry as IcoImageEntry, type media_IcoInfo as IcoInfo, type media_IcoInfoError as IcoInfoError, type media_Id3Tags as Id3Tags, type media_Id3TagsError as Id3TagsError, type media_ImageFormat as ImageFormat, type media_ImageInfo as ImageInfo, type media_ImageInfoError as ImageInfoError, type media_PdfMetadata as PdfMetadata, type media_PdfMetadataError as PdfMetadataError, type media_PdfPageDimension as PdfPageDimension, type media_PdfPageDimensionsResult as PdfPageDimensionsResult, type media_PdfPageOrientation as PdfPageOrientation, type media_VideoInfo as VideoInfo, type media_VideoInfoError as VideoInfoError, type media_WavInfo as WavInfo, type media_WavInfoError as WavInfoError, media_inspectGifFrames as inspectGifFrames, media_readExifData as readExifData, media_readFlacInfo as readFlacInfo, media_readIcoInfo as readIcoInfo, media_readId3Tags as readId3Tags, media_readImageInfo as readImageInfo, media_readPdfMetadata as readPdfMetadata, media_readPdfPageDimensions as readPdfPageDimensions, media_readVideoInfo as readVideoInfo, media_readWavInfo as readWavInfo };
|
|
307
|
+
export { type media_ExifData as ExifData, type media_ExifError as ExifError, type media_FlacInfo as FlacInfo, type media_FlacInfoError as FlacInfoError, type media_GifInfo as GifInfo, type media_GifInfoError as GifInfoError, type media_IcoImageEntry as IcoImageEntry, type media_IcoInfo as IcoInfo, type media_IcoInfoError as IcoInfoError, type media_Id3Tags as Id3Tags, type media_Id3TagsError as Id3TagsError, type media_ImageFormat as ImageFormat, type media_ImageInfo as ImageInfo, type media_ImageInfoError as ImageInfoError, type media_MidiDivision as MidiDivision, type media_MidiInfo as MidiInfo, type media_MidiInfoError as MidiInfoError, type media_MidiTimeSignature as MidiTimeSignature, type media_MidiTrackInfo as MidiTrackInfo, type media_PdfMetadata as PdfMetadata, type media_PdfMetadataError as PdfMetadataError, type media_PdfPageDimension as PdfPageDimension, type media_PdfPageDimensionsResult as PdfPageDimensionsResult, type media_PdfPageOrientation as PdfPageOrientation, type media_VideoInfo as VideoInfo, type media_VideoInfoError as VideoInfoError, type media_WavInfo as WavInfo, type media_WavInfoError as WavInfoError, media_inspectGifFrames as inspectGifFrames, media_readExifData as readExifData, media_readFlacInfo as readFlacInfo, media_readIcoInfo as readIcoInfo, media_readId3Tags as readId3Tags, media_readImageInfo as readImageInfo, media_readMidiInfo as readMidiInfo, media_readPdfMetadata as readPdfMetadata, media_readPdfPageDimensions as readPdfPageDimensions, media_readVideoInfo as readVideoInfo, media_readWavInfo as readWavInfo };
|
|
263
308
|
}
|
|
264
309
|
|
|
265
|
-
export {
|
|
310
|
+
export { readImageInfo as A, readMidiInfo as B, readPdfMetadata as C, readPdfPageDimensions as D, type ExifData as E, type FlacInfo as F, type GifInfo as G, readVideoInfo as H, type IcoImageEntry as I, readWavInfo as J, type MidiDivision as M, type PdfMetadata as P, type VideoInfo as V, type WavInfo as W, type ExifError as a, type FlacInfoError as b, type GifInfoError as c, type IcoInfo as d, type IcoInfoError as e, type Id3Tags as f, type Id3TagsError as g, type ImageFormat as h, type ImageInfo as i, type ImageInfoError as j, type MidiInfo as k, type MidiInfoError as l, media as m, type MidiTimeSignature as n, type MidiTrackInfo as o, type PdfMetadataError as p, type PdfPageDimension as q, type PdfPageDimensionsResult as r, type PdfPageOrientation as s, type VideoInfoError as t, type WavInfoError as u, inspectGifFrames as v, readExifData as w, readFlacInfo as x, readIcoInfo as y, readId3Tags as z };
|
|
@@ -224,6 +224,45 @@ interface GifInfoError {
|
|
|
224
224
|
* any LZW-compressed pixel data.
|
|
225
225
|
*/
|
|
226
226
|
declare function inspectGifFrames(bytes: Uint8Array): GifInfo | GifInfoError;
|
|
227
|
+
type MidiDivision = {
|
|
228
|
+
type: 'ppq';
|
|
229
|
+
ticksPerQuarterNote: number;
|
|
230
|
+
} | {
|
|
231
|
+
type: 'smpte';
|
|
232
|
+
framesPerSecond: number;
|
|
233
|
+
ticksPerFrame: number;
|
|
234
|
+
};
|
|
235
|
+
interface MidiTrackInfo {
|
|
236
|
+
index: number;
|
|
237
|
+
name: string | null;
|
|
238
|
+
eventCount: number;
|
|
239
|
+
noteOnCount: number;
|
|
240
|
+
}
|
|
241
|
+
interface MidiTimeSignature {
|
|
242
|
+
numerator: number;
|
|
243
|
+
denominator: number;
|
|
244
|
+
}
|
|
245
|
+
interface MidiInfo {
|
|
246
|
+
format: number;
|
|
247
|
+
trackCount: number;
|
|
248
|
+
division: MidiDivision;
|
|
249
|
+
initialTempoBpm: number;
|
|
250
|
+
timeSignature: MidiTimeSignature | null;
|
|
251
|
+
durationSeconds: number | null;
|
|
252
|
+
tracks: MidiTrackInfo[];
|
|
253
|
+
}
|
|
254
|
+
interface MidiInfoError {
|
|
255
|
+
error: string;
|
|
256
|
+
}
|
|
257
|
+
/**
|
|
258
|
+
* Parse a Standard MIDI File (SMF) header and every track chunk to report
|
|
259
|
+
* format (0/1/2), the tick division, initial tempo, time signature, a
|
|
260
|
+
* per-track event/note-on count, and total duration in seconds. Duration
|
|
261
|
+
* accounts for tempo-change meta events across the whole file when the
|
|
262
|
+
* division is ticks-per-quarter-note; the rarer SMPTE division uses a fixed
|
|
263
|
+
* frames-per-second/ticks-per-frame rate instead.
|
|
264
|
+
*/
|
|
265
|
+
declare function readMidiInfo(bytes: Uint8Array): MidiInfo | MidiInfoError;
|
|
227
266
|
|
|
228
267
|
type media_ExifData = ExifData;
|
|
229
268
|
type media_ExifError = ExifError;
|
|
@@ -239,6 +278,11 @@ type media_Id3TagsError = Id3TagsError;
|
|
|
239
278
|
type media_ImageFormat = ImageFormat;
|
|
240
279
|
type media_ImageInfo = ImageInfo;
|
|
241
280
|
type media_ImageInfoError = ImageInfoError;
|
|
281
|
+
type media_MidiDivision = MidiDivision;
|
|
282
|
+
type media_MidiInfo = MidiInfo;
|
|
283
|
+
type media_MidiInfoError = MidiInfoError;
|
|
284
|
+
type media_MidiTimeSignature = MidiTimeSignature;
|
|
285
|
+
type media_MidiTrackInfo = MidiTrackInfo;
|
|
242
286
|
type media_PdfMetadata = PdfMetadata;
|
|
243
287
|
type media_PdfMetadataError = PdfMetadataError;
|
|
244
288
|
type media_PdfPageDimension = PdfPageDimension;
|
|
@@ -254,12 +298,13 @@ declare const media_readFlacInfo: typeof readFlacInfo;
|
|
|
254
298
|
declare const media_readIcoInfo: typeof readIcoInfo;
|
|
255
299
|
declare const media_readId3Tags: typeof readId3Tags;
|
|
256
300
|
declare const media_readImageInfo: typeof readImageInfo;
|
|
301
|
+
declare const media_readMidiInfo: typeof readMidiInfo;
|
|
257
302
|
declare const media_readPdfMetadata: typeof readPdfMetadata;
|
|
258
303
|
declare const media_readPdfPageDimensions: typeof readPdfPageDimensions;
|
|
259
304
|
declare const media_readVideoInfo: typeof readVideoInfo;
|
|
260
305
|
declare const media_readWavInfo: typeof readWavInfo;
|
|
261
306
|
declare namespace media {
|
|
262
|
-
export { type media_ExifData as ExifData, type media_ExifError as ExifError, type media_FlacInfo as FlacInfo, type media_FlacInfoError as FlacInfoError, type media_GifInfo as GifInfo, type media_GifInfoError as GifInfoError, type media_IcoImageEntry as IcoImageEntry, type media_IcoInfo as IcoInfo, type media_IcoInfoError as IcoInfoError, type media_Id3Tags as Id3Tags, type media_Id3TagsError as Id3TagsError, type media_ImageFormat as ImageFormat, type media_ImageInfo as ImageInfo, type media_ImageInfoError as ImageInfoError, type media_PdfMetadata as PdfMetadata, type media_PdfMetadataError as PdfMetadataError, type media_PdfPageDimension as PdfPageDimension, type media_PdfPageDimensionsResult as PdfPageDimensionsResult, type media_PdfPageOrientation as PdfPageOrientation, type media_VideoInfo as VideoInfo, type media_VideoInfoError as VideoInfoError, type media_WavInfo as WavInfo, type media_WavInfoError as WavInfoError, media_inspectGifFrames as inspectGifFrames, media_readExifData as readExifData, media_readFlacInfo as readFlacInfo, media_readIcoInfo as readIcoInfo, media_readId3Tags as readId3Tags, media_readImageInfo as readImageInfo, media_readPdfMetadata as readPdfMetadata, media_readPdfPageDimensions as readPdfPageDimensions, media_readVideoInfo as readVideoInfo, media_readWavInfo as readWavInfo };
|
|
307
|
+
export { type media_ExifData as ExifData, type media_ExifError as ExifError, type media_FlacInfo as FlacInfo, type media_FlacInfoError as FlacInfoError, type media_GifInfo as GifInfo, type media_GifInfoError as GifInfoError, type media_IcoImageEntry as IcoImageEntry, type media_IcoInfo as IcoInfo, type media_IcoInfoError as IcoInfoError, type media_Id3Tags as Id3Tags, type media_Id3TagsError as Id3TagsError, type media_ImageFormat as ImageFormat, type media_ImageInfo as ImageInfo, type media_ImageInfoError as ImageInfoError, type media_MidiDivision as MidiDivision, type media_MidiInfo as MidiInfo, type media_MidiInfoError as MidiInfoError, type media_MidiTimeSignature as MidiTimeSignature, type media_MidiTrackInfo as MidiTrackInfo, type media_PdfMetadata as PdfMetadata, type media_PdfMetadataError as PdfMetadataError, type media_PdfPageDimension as PdfPageDimension, type media_PdfPageDimensionsResult as PdfPageDimensionsResult, type media_PdfPageOrientation as PdfPageOrientation, type media_VideoInfo as VideoInfo, type media_VideoInfoError as VideoInfoError, type media_WavInfo as WavInfo, type media_WavInfoError as WavInfoError, media_inspectGifFrames as inspectGifFrames, media_readExifData as readExifData, media_readFlacInfo as readFlacInfo, media_readIcoInfo as readIcoInfo, media_readId3Tags as readId3Tags, media_readImageInfo as readImageInfo, media_readMidiInfo as readMidiInfo, media_readPdfMetadata as readPdfMetadata, media_readPdfPageDimensions as readPdfPageDimensions, media_readVideoInfo as readVideoInfo, media_readWavInfo as readWavInfo };
|
|
263
308
|
}
|
|
264
309
|
|
|
265
|
-
export {
|
|
310
|
+
export { readImageInfo as A, readMidiInfo as B, readPdfMetadata as C, readPdfPageDimensions as D, type ExifData as E, type FlacInfo as F, type GifInfo as G, readVideoInfo as H, type IcoImageEntry as I, readWavInfo as J, type MidiDivision as M, type PdfMetadata as P, type VideoInfo as V, type WavInfo as W, type ExifError as a, type FlacInfoError as b, type GifInfoError as c, type IcoInfo as d, type IcoInfoError as e, type Id3Tags as f, type Id3TagsError as g, type ImageFormat as h, type ImageInfo as i, type ImageInfoError as j, type MidiInfo as k, type MidiInfoError as l, media as m, type MidiTimeSignature as n, type MidiTrackInfo as o, type PdfMetadataError as p, type PdfPageDimension as q, type PdfPageDimensionsResult as r, type PdfPageOrientation as s, type VideoInfoError as t, type WavInfoError as u, inspectGifFrames as v, readExifData as w, readFlacInfo as x, readIcoInfo as y, readId3Tags as z };
|
package/dist/tools/api.cjs
CHANGED
|
@@ -1265,6 +1265,75 @@ function generateMetaHtml(tags) {
|
|
|
1265
1265
|
}
|
|
1266
1266
|
return lines.join("\n");
|
|
1267
1267
|
}
|
|
1268
|
+
var OTP_ALG_TO_NODE_HASH = {
|
|
1269
|
+
SHA1: "sha1",
|
|
1270
|
+
SHA256: "sha256",
|
|
1271
|
+
SHA512: "sha512"
|
|
1272
|
+
};
|
|
1273
|
+
function decodeBase32Secret(secret) {
|
|
1274
|
+
const alphabet = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567";
|
|
1275
|
+
const cleaned = secret.toUpperCase().replace(/[\s=]/g, "");
|
|
1276
|
+
if (!cleaned) {
|
|
1277
|
+
return { error: "Secret must not be empty" };
|
|
1278
|
+
}
|
|
1279
|
+
const bytes = [];
|
|
1280
|
+
let buffer = 0;
|
|
1281
|
+
let bitsLeft = 0;
|
|
1282
|
+
for (const char of cleaned) {
|
|
1283
|
+
const val = alphabet.indexOf(char);
|
|
1284
|
+
if (val === -1) {
|
|
1285
|
+
return { error: `Invalid base32 character '${char}' in secret` };
|
|
1286
|
+
}
|
|
1287
|
+
buffer = buffer << 5 | val;
|
|
1288
|
+
bitsLeft += 5;
|
|
1289
|
+
if (bitsLeft >= 8) {
|
|
1290
|
+
bitsLeft -= 8;
|
|
1291
|
+
bytes.push(buffer >> bitsLeft & 255);
|
|
1292
|
+
}
|
|
1293
|
+
}
|
|
1294
|
+
return Buffer.from(bytes);
|
|
1295
|
+
}
|
|
1296
|
+
function hotpFromCounter(keyBytes, counter, digits, algorithm) {
|
|
1297
|
+
const counterBuffer = Buffer.alloc(8);
|
|
1298
|
+
counterBuffer.writeUInt32BE(Math.floor(counter / 4294967296), 0);
|
|
1299
|
+
counterBuffer.writeUInt32BE(counter % 4294967296, 4);
|
|
1300
|
+
const hmac = crypto.createHmac(OTP_ALG_TO_NODE_HASH[algorithm], keyBytes).update(counterBuffer).digest();
|
|
1301
|
+
const offset = hmac[hmac.length - 1] & 15;
|
|
1302
|
+
const binCode = (hmac[offset] & 127) << 24 | (hmac[offset + 1] & 255) << 16 | (hmac[offset + 2] & 255) << 8 | hmac[offset + 3] & 255;
|
|
1303
|
+
const code = (binCode % 10 ** digits).toString().padStart(digits, "0");
|
|
1304
|
+
return code;
|
|
1305
|
+
}
|
|
1306
|
+
function generateHotp(secret, counter, options = {}) {
|
|
1307
|
+
const digits = options.digits ?? 6;
|
|
1308
|
+
const algorithm = options.algorithm ?? "SHA1";
|
|
1309
|
+
if (!Number.isInteger(counter) || counter < 0) {
|
|
1310
|
+
return { error: "Counter must be a non-negative whole number" };
|
|
1311
|
+
}
|
|
1312
|
+
if (!Number.isInteger(digits) || digits < 6 || digits > 8) {
|
|
1313
|
+
return { error: "Digits must be an integer between 6 and 8" };
|
|
1314
|
+
}
|
|
1315
|
+
if (!(algorithm in OTP_ALG_TO_NODE_HASH)) {
|
|
1316
|
+
return { error: "Algorithm must be one of SHA1, SHA256, SHA512" };
|
|
1317
|
+
}
|
|
1318
|
+
const keyBytes = decodeBase32Secret(secret);
|
|
1319
|
+
if ("error" in keyBytes) return keyBytes;
|
|
1320
|
+
return { code: hotpFromCounter(keyBytes, counter, digits, algorithm), counter, digits, algorithm };
|
|
1321
|
+
}
|
|
1322
|
+
function generateTotp(secret, options = {}) {
|
|
1323
|
+
const periodSeconds = options.periodSeconds ?? 30;
|
|
1324
|
+
const timestamp = options.timestamp ?? Math.floor(Date.now() / 1e3);
|
|
1325
|
+
if (!Number.isFinite(periodSeconds) || periodSeconds <= 0) {
|
|
1326
|
+
return { error: "Period must be a positive number of seconds" };
|
|
1327
|
+
}
|
|
1328
|
+
if (!Number.isFinite(timestamp) || timestamp < 0) {
|
|
1329
|
+
return { error: "Timestamp must be a non-negative number of seconds" };
|
|
1330
|
+
}
|
|
1331
|
+
const counter = Math.floor(timestamp / periodSeconds);
|
|
1332
|
+
const hotp = generateHotp(secret, counter, options);
|
|
1333
|
+
if ("error" in hotp) return hotp;
|
|
1334
|
+
const secondsRemaining = periodSeconds - timestamp % periodSeconds;
|
|
1335
|
+
return { ...hotp, periodSeconds, secondsRemaining };
|
|
1336
|
+
}
|
|
1268
1337
|
|
|
1269
1338
|
exports.COMMON_HEADERS = COMMON_HEADERS;
|
|
1270
1339
|
exports.COMMON_PRESETS = COMMON_PRESETS;
|
|
@@ -1291,7 +1360,9 @@ exports.formatResponse = formatResponse;
|
|
|
1291
1360
|
exports.generateCors = generateCors;
|
|
1292
1361
|
exports.generateCspHeader = generateCspHeader;
|
|
1293
1362
|
exports.generateFullHeader = generateFullHeader;
|
|
1363
|
+
exports.generateHotp = generateHotp;
|
|
1294
1364
|
exports.generateMetaHtml = generateMetaHtml;
|
|
1365
|
+
exports.generateTotp = generateTotp;
|
|
1295
1366
|
exports.getParam = getParam;
|
|
1296
1367
|
exports.getStats = getStats;
|
|
1297
1368
|
exports.isValidUrl = isValidUrl;
|
package/dist/tools/api.d.cts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as COMMON_HEADERS, b as COMMON_PRESETS, c as CORS_COMMON_HEADERS, d as CorsConfig, e as CorsOutput, f as CspConfig, g as CspDirective, h as CspSource, i as CurlCommand, j as CurlConfig, D as DEFAULT_CORS_CONFIG, k as DIRECTIVE_DESCRIPTIONS, l as DirectiveConfig, F as FormatResult, H as HTTP_METHODS, m as Header, n as HttpMethod, J as JwkSummary,
|
|
1
|
+
export { C as COMMON_HEADERS, b as COMMON_PRESETS, c as CORS_COMMON_HEADERS, d as CorsConfig, e as CorsOutput, f as CspConfig, g as CspDirective, h as CspSource, i as CurlCommand, j as CurlConfig, D as DEFAULT_CORS_CONFIG, k as DIRECTIVE_DESCRIPTIONS, l as DirectiveConfig, F as FormatResult, H as HTTP_METHODS, m as Header, n as HotpResult, o as HttpMethod, J as JwkSummary, p as JwkThumbprintErrorResult, q as JwkThumbprintHash, r as JwkThumbprintOutcome, s as JwkThumbprintResult, t as JwksError, u as JwksParseResult, v as JwksResult, w as JwtAlgorithm, x as JwtDecodeError, y as JwtDecodeResult, z as JwtExpiry, A as JwtPart, B as JwtResult, E as JwtSignOptions, M as MetaTags, O as OgTags, G as OtpAlgorithm, I as OtpOptions, P as ParsedUrl, R as ResponseFormat, S as SUPPORTED_LANGUAGES, T as TargetLanguage, K as TotpOptions, L as TotpResult, N as TwitterTags, Q as addParam, U as base64urlDecode, V as base64urlEncode, W as buildCurl, X as buildCurlMultiline, Y as buildUrl, Z as computeJwkThumbprint, _ as convertToCode, $ as decodeJwt, a0 as decodeUrlComponent, a1 as detectFormat, a2 as encodeUrlComponent, a3 as extractJsonPaths, a4 as formatJwtJson, a5 as formatResponse, a6 as generateCors, a7 as generateCspHeader, a8 as generateFullHeader, a9 as generateHotp, aa as generateMetaHtml, ab as generateTotp, ac as getParam, ad as getStats, ae as isValidUrl, af as normalizeUrl, ag as parseCspHeader, ah as parseCurl, ai as parseCurlCommand, aj as parseJwks, ak as parseMetaTags, al as parseUrl, am as removeParam, an as signJwt, ao as validateCorsConfig, ap as validateCspConfig, aq as validateOgTags } from '../api-C8rImfka.cjs';
|
package/dist/tools/api.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export { C as COMMON_HEADERS, b as COMMON_PRESETS, c as CORS_COMMON_HEADERS, d as CorsConfig, e as CorsOutput, f as CspConfig, g as CspDirective, h as CspSource, i as CurlCommand, j as CurlConfig, D as DEFAULT_CORS_CONFIG, k as DIRECTIVE_DESCRIPTIONS, l as DirectiveConfig, F as FormatResult, H as HTTP_METHODS, m as Header, n as HttpMethod, J as JwkSummary,
|
|
1
|
+
export { C as COMMON_HEADERS, b as COMMON_PRESETS, c as CORS_COMMON_HEADERS, d as CorsConfig, e as CorsOutput, f as CspConfig, g as CspDirective, h as CspSource, i as CurlCommand, j as CurlConfig, D as DEFAULT_CORS_CONFIG, k as DIRECTIVE_DESCRIPTIONS, l as DirectiveConfig, F as FormatResult, H as HTTP_METHODS, m as Header, n as HotpResult, o as HttpMethod, J as JwkSummary, p as JwkThumbprintErrorResult, q as JwkThumbprintHash, r as JwkThumbprintOutcome, s as JwkThumbprintResult, t as JwksError, u as JwksParseResult, v as JwksResult, w as JwtAlgorithm, x as JwtDecodeError, y as JwtDecodeResult, z as JwtExpiry, A as JwtPart, B as JwtResult, E as JwtSignOptions, M as MetaTags, O as OgTags, G as OtpAlgorithm, I as OtpOptions, P as ParsedUrl, R as ResponseFormat, S as SUPPORTED_LANGUAGES, T as TargetLanguage, K as TotpOptions, L as TotpResult, N as TwitterTags, Q as addParam, U as base64urlDecode, V as base64urlEncode, W as buildCurl, X as buildCurlMultiline, Y as buildUrl, Z as computeJwkThumbprint, _ as convertToCode, $ as decodeJwt, a0 as decodeUrlComponent, a1 as detectFormat, a2 as encodeUrlComponent, a3 as extractJsonPaths, a4 as formatJwtJson, a5 as formatResponse, a6 as generateCors, a7 as generateCspHeader, a8 as generateFullHeader, a9 as generateHotp, aa as generateMetaHtml, ab as generateTotp, ac as getParam, ad as getStats, ae as isValidUrl, af as normalizeUrl, ag as parseCspHeader, ah as parseCurl, ai as parseCurlCommand, aj as parseJwks, ak as parseMetaTags, al as parseUrl, am as removeParam, an as signJwt, ao as validateCorsConfig, ap as validateCspConfig, aq as validateOgTags } from '../api-C8rImfka.js';
|
package/dist/tools/api.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export { COMMON_HEADERS, COMMON_PRESETS, CORS_COMMON_HEADERS, DEFAULT_CORS_CONFIG, DIRECTIVE_DESCRIPTIONS, HTTP_METHODS, SUPPORTED_LANGUAGES, addParam, base64urlDecode, base64urlEncode, buildCurl, buildCurlMultiline, buildUrl, computeJwkThumbprint, convertToCode, decodeJwt, decodeUrlComponent, detectFormat, encodeUrlComponent, extractJsonPaths, formatJwtJson, formatResponse, generateCors, generateCspHeader, generateFullHeader, generateMetaHtml, getParam, getStats, isValidUrl, normalizeUrl, parseCspHeader, parseCurl, parseCurlCommand, parseJwks, parseMetaTags, parseUrl, removeParam, signJwt, validateCorsConfig, validateCspConfig, validateOgTags } from '../chunk-
|
|
1
|
+
export { COMMON_HEADERS, COMMON_PRESETS, CORS_COMMON_HEADERS, DEFAULT_CORS_CONFIG, DIRECTIVE_DESCRIPTIONS, HTTP_METHODS, SUPPORTED_LANGUAGES, addParam, base64urlDecode, base64urlEncode, buildCurl, buildCurlMultiline, buildUrl, computeJwkThumbprint, convertToCode, decodeJwt, decodeUrlComponent, detectFormat, encodeUrlComponent, extractJsonPaths, formatJwtJson, formatResponse, generateCors, generateCspHeader, generateFullHeader, generateHotp, generateMetaHtml, generateTotp, getParam, getStats, isValidUrl, normalizeUrl, parseCspHeader, parseCurl, parseCurlCommand, parseJwks, parseMetaTags, parseUrl, removeParam, signJwt, validateCorsConfig, validateCspConfig, validateOgTags } from '../chunk-4S63T7Y4.js';
|
|
2
2
|
import '../chunk-MLKGABMK.js';
|