fix(products): fix breadcrumbs and product filtering (backport from main)
Some checks failed
Build & Deploy / 🔍 Prepare (push) Successful in 20s
Build & Deploy / 🧪 QA (push) Failing after 34s
Build & Deploy / 🏗️ Build (push) Has started running
Build & Deploy / 🚀 Deploy (push) Has been cancelled
Build & Deploy / 🧪 Smoke Test (push) Has been cancelled
Build & Deploy / ⚡ Lighthouse (push) Has been cancelled
Build & Deploy / 🔔 Notify (push) Has been cancelled

This commit is contained in:
2026-02-24 16:04:21 +01:00
parent 915eb61613
commit 5397309103
43805 changed files with 4324295 additions and 3 deletions

View File

@@ -0,0 +1,131 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.js";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.js";
const matchOrdinalNumberPattern = /^(\d+)\./i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(pr\.n\.e\.|AD)/i,
abbreviated: /^(pr\.\s?Hr\.|po\.\s?Hr\.)/i,
wide: /^(Pre Hrista|pre nove ere|Posle Hrista|nova era)/i,
};
const parseEraPatterns = {
any: [/^pr/i, /^(po|nova)/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^[1234]\.\s?kv\.?/i,
wide: /^[1234]\. kvartal/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^(10|11|12|[123456789])\./i,
abbreviated: /^(jan|feb|mar|apr|maj|jun|jul|avg|sep|okt|nov|dec)/i,
wide: /^((januar|januara)|(februar|februara)|(mart|marta)|(april|aprila)|(maj|maja)|(jun|juna)|(jul|jula)|(avgust|avgusta)|(septembar|septembra)|(oktobar|oktobra)|(novembar|novembra)|(decembar|decembra))/i,
};
const parseMonthPatterns = {
narrow: [
/^1/i,
/^2/i,
/^3/i,
/^4/i,
/^5/i,
/^6/i,
/^7/i,
/^8/i,
/^9/i,
/^10/i,
/^11/i,
/^12/i,
],
any: [
/^ja/i,
/^f/i,
/^mar/i,
/^ap/i,
/^maj/i,
/^jun/i,
/^jul/i,
/^avg/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
};
const matchDayPatterns = {
narrow: /^[npusčc]/i,
short: /^(ned|pon|uto|sre|(čet|cet)|pet|sub)/i,
abbreviated: /^(ned|pon|uto|sre|(čet|cet)|pet|sub)/i,
wide: /^(nedelja|ponedeljak|utorak|sreda|(četvrtak|cetvrtak)|petak|subota)/i,
};
const parseDayPatterns = {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i],
};
const matchDayPeriodPatterns = {
any: /^(am|pm|ponoc|ponoć|(po)?podne|uvece|uveče|noću|posle podne|ujutru)/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^pono/i,
noon: /^pod/i,
morning: /jutro/i,
afternoon: /(posle\s|po)+podne/i,
evening: /(uvece|uveče)/i,
night: /(nocu|noću)/i,
},
};
export const match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};

View File

@@ -0,0 +1 @@
{"version":3,"file":"hasOptionLabelJSXElement.js","names":["isValidReactElement","hasOptionLabelJSXElement","cellClientProps","cellData","field","type","Array","isArray","options","matchingOption","find","option","value","label"],"sources":["../../src/utilities/hasOptionLabelJSXElement.ts"],"sourcesContent":["import type { DefaultCellComponentProps } from 'payload'\n\nimport { isValidReactElement } from './isValidReactElement.js'\n\nexport const hasOptionLabelJSXElement = (cellClientProps: DefaultCellComponentProps) => {\n const { cellData, field } = cellClientProps\n\n if ((field?.type === 'select' || field?.type == 'radio') && Array.isArray(field?.options)) {\n const matchingOption = field.options.find(\n (option) => typeof option === 'object' && option.value === cellData,\n )\n\n if (\n matchingOption &&\n typeof matchingOption === 'object' &&\n isValidReactElement(matchingOption.label)\n ) {\n return true\n }\n }\n\n return false\n}\n"],"mappings":"AAEA,SAASA,mBAAmB,QAAQ;AAEpC,OAAO,MAAMC,wBAAA,GAA4BC,eAAA;EACvC,MAAM;IAAEC,QAAQ;IAAEC;EAAK,CAAE,GAAGF,eAAA;EAE5B,IAAI,CAACE,KAAA,EAAOC,IAAA,KAAS,YAAYD,KAAA,EAAOC,IAAA,IAAQ,OAAM,KAAMC,KAAA,CAAMC,OAAO,CAACH,KAAA,EAAOI,OAAA,GAAU;IACzF,MAAMC,cAAA,GAAiBL,KAAA,CAAMI,OAAO,CAACE,IAAI,CACtCC,MAAA,IAAW,OAAOA,MAAA,KAAW,YAAYA,MAAA,CAAOC,KAAK,KAAKT,QAAA;IAG7D,IACEM,cAAA,IACA,OAAOA,cAAA,KAAmB,YAC1BT,mBAAA,CAAoBS,cAAA,CAAeI,KAAK,GACxC;MACA,OAAO;IACT;EACF;EAEA,OAAO;AACT","ignoreList":[]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"rawConstraint.d.ts","sourceRoot":"","sources":["../../src/utilities/rawConstraint.ts"],"names":[],"mappings":"AAEA,eAAO,MAAM,cAAc,eAA2B,CAAA;AAEtD;;GAEG;AACH,eAAO,MAAM,aAAa,UAAW,OAAO;;;CAG1C,CAAA;AAEF,eAAO,MAAM,eAAe,UAAW,OAAO,KAAG,KAAK,IAAI,UAAU,CAAC,OAAO,aAAa,CAExF,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"getQueryDraftsSort.d.ts","sourceRoot":"","sources":["../../../src/versions/drafts/getQueryDraftsSort.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,mCAAmC,CAAA;AAClF,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,sBAAsB,CAAA;AAEhD;;;GAGG;AACH,eAAO,MAAM,kBAAkB,gCAG5B;IACD,gBAAgB,EAAE,yBAAyB,CAAA;IAC3C,IAAI,CAAC,EAAE,IAAI,CAAA;CACZ,KAAG,IA6BH,CAAA"}

View File

@@ -0,0 +1,137 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.cjs");
var _index2 = require("../../_lib/buildMatchPatternFn.cjs");
const matchOrdinalNumberPattern = /^\d+/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^([bB]|[aA]|คศ)/i,
abbreviated:
/^([bB]\.?\s?[cC]\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?|ค\.?ศ\.?)/i,
wide: /^(ก่อนคริสตกาล|คริสต์ศักราช|คริสตกาล)/i,
};
const parseEraPatterns = {
any: [/^[bB]/i, /^(^[aA]|ค\.?ศ\.?|คริสตกาล|คริสต์ศักราช|)/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^ไตรมาส(ที่)? ?[1234]/i,
};
const parseQuarterPatterns = {
any: [/(1|แรก|หนึ่ง)/i, /(2|สอง)/i, /(3|สาม)/i, /(4|สี่)/i],
};
const matchMonthPatterns = {
narrow:
/^(ม\.?ค\.?|ก\.?พ\.?|มี\.?ค\.?|เม\.?ย\.?|พ\.?ค\.?|มิ\.?ย\.?|ก\.?ค\.?|ส\.?ค\.?|ก\.?ย\.?|ต\.?ค\.?|พ\.?ย\.?|ธ\.?ค\.?)/i,
abbreviated:
/^(ม\.?ค\.?|ก\.?พ\.?|มี\.?ค\.?|เม\.?ย\.?|พ\.?ค\.?|มิ\.?ย\.?|ก\.?ค\.?|ส\.?ค\.?|ก\.?ย\.?|ต\.?ค\.?|พ\.?ย\.?|ธ\.?ค\.?')/i,
wide: /^(มกราคม|กุมภาพันธ์|มีนาคม|เมษายน|พฤษภาคม|มิถุนายน|กรกฎาคม|สิงหาคม|กันยายน|ตุลาคม|พฤศจิกายน|ธันวาคม)/i,
};
const parseMonthPatterns = {
wide: [
/^มก/i,
/^กุม/i,
/^มี/i,
/^เม/i,
/^พฤษ/i,
/^มิ/i,
/^กรก/i,
/^ส/i,
/^กัน/i,
/^ต/i,
/^พฤศ/i,
/^ธ/i,
],
any: [
/^ม\.?ค\.?/i,
/^ก\.?พ\.?/i,
/^มี\.?ค\.?/i,
/^เม\.?ย\.?/i,
/^พ\.?ค\.?/i,
/^มิ\.?ย\.?/i,
/^ก\.?ค\.?/i,
/^ส\.?ค\.?/i,
/^ก\.?ย\.?/i,
/^ต\.?ค\.?/i,
/^พ\.?ย\.?/i,
/^ธ\.?ค\.?/i,
],
};
const matchDayPatterns = {
narrow: /^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,
short: /^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,
abbreviated: /^(อา\.?|จ\.?|อ\.?|พฤ\.?|พ\.?|ศ\.?|ส\.?)/i,
wide: /^(อาทิตย์|จันทร์|อังคาร|พุธ|พฤหัสบดี|ศุกร์|เสาร์)/i,
};
const parseDayPatterns = {
wide: [/^อา/i, /^จั/i, /^อั/i, /^พุธ/i, /^พฤ/i, /^ศ/i, /^เส/i],
any: [/^อา/i, /^จ/i, /^อ/i, /^พ(?!ฤ)/i, /^พฤ/i, /^ศ/i, /^ส/i],
};
const matchDayPeriodPatterns = {
any: /^(ก่อนเที่ยง|หลังเที่ยง|เที่ยงคืน|เที่ยง|(ตอน.*?)?.*(เที่ยง|เช้า|บ่าย|เย็น|กลางคืน))/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^ก่อนเที่ยง/i,
pm: /^หลังเที่ยง/i,
midnight: /^เที่ยงคืน/i,
noon: /^เที่ยง/i,
morning: /เช้า/i,
afternoon: /บ่าย/i,
evening: /เย็น/i,
night: /กลางคืน/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});

View File

@@ -0,0 +1,28 @@
import { toDate } from "./toDate.mjs";
/**
* @name isPast
* @category Common Helpers
* @summary Is the given date in the past?
* @pure false
*
* @description
* Is the given date in the past?
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to check
*
* @returns The date is in the past
*
* @example
* // If today is 6 October 2014, is 2 July 2014 in the past?
* const result = isPast(new Date(2014, 6, 2))
* //=> true
*/
export function isPast(date) {
return +toDate(date) < Date.now();
}
// Fallback for modularized imports:
export default isPast;

View File

@@ -0,0 +1,312 @@
function _toConsumableArray(arr) { return _arrayWithoutHoles(arr) || _iterableToArray(arr) || _unsupportedIterableToArray(arr) || _nonIterableSpread(); }
function _nonIterableSpread() { throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
function _iterableToArray(iter) { if (typeof Symbol !== "undefined" && iter[Symbol.iterator] != null || iter["@@iterator"] != null) return Array.from(iter); }
function _arrayWithoutHoles(arr) { if (Array.isArray(arr)) return _arrayLikeToArray(arr); }
function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
import * as leb from "@webassemblyjs/leb128";
import * as ieee754 from "@webassemblyjs/ieee754";
import * as utf8 from "@webassemblyjs/utf8";
import constants from "@webassemblyjs/helper-wasm-bytecode";
import { encodeNode } from "../index";
function assertNotIdentifierNode(n) {
if (n.type === "Identifier") {
throw new Error("Unsupported node Identifier");
}
}
export function encodeVersion(v) {
var bytes = constants.moduleVersion;
bytes[0] = v;
return bytes;
}
export function encodeHeader() {
return constants.magicModuleHeader;
}
export function encodeU32(v) {
var uint8view = new Uint8Array(leb.encodeU32(v));
var array = _toConsumableArray(uint8view);
return array;
}
export function encodeI32(v) {
var uint8view = new Uint8Array(leb.encodeI32(v));
var array = _toConsumableArray(uint8view);
return array;
}
export function encodeI64(v) {
var uint8view = new Uint8Array(leb.encodeI64(v));
var array = _toConsumableArray(uint8view);
return array;
}
export function encodeVec(elements) {
var size = encodeU32(elements.length);
return [].concat(_toConsumableArray(size), _toConsumableArray(elements));
}
export function encodeValtype(v) {
var _byte = constants.valtypesByString[v];
if (typeof _byte === "undefined") {
throw new Error("Unknown valtype: " + v);
}
return parseInt(_byte, 10);
}
export function encodeMutability(v) {
var _byte2 = constants.globalTypesByString[v];
if (typeof _byte2 === "undefined") {
throw new Error("Unknown mutability: " + v);
}
return parseInt(_byte2, 10);
}
export function encodeUTF8Vec(str) {
return encodeVec(utf8.encode(str));
}
export function encodeLimits(n) {
var out = [];
if (typeof n.max === "number") {
out.push(0x01);
out.push.apply(out, _toConsumableArray(encodeU32(n.min))); // $FlowIgnore: ensured by the typeof
out.push.apply(out, _toConsumableArray(encodeU32(n.max)));
} else {
out.push(0x00);
out.push.apply(out, _toConsumableArray(encodeU32(n.min)));
}
return out;
}
export function encodeModuleImport(n) {
var out = [];
out.push.apply(out, _toConsumableArray(encodeUTF8Vec(n.module)));
out.push.apply(out, _toConsumableArray(encodeUTF8Vec(n.name)));
switch (n.descr.type) {
case "GlobalType":
{
out.push(0x03); // $FlowIgnore: GlobalType ensure that these props exists
out.push(encodeValtype(n.descr.valtype)); // $FlowIgnore: GlobalType ensure that these props exists
out.push(encodeMutability(n.descr.mutability));
break;
}
case "Memory":
{
out.push(0x02); // $FlowIgnore
out.push.apply(out, _toConsumableArray(encodeLimits(n.descr.limits)));
break;
}
case "Table":
{
out.push(0x01);
out.push(0x70); // element type
// $FlowIgnore
out.push.apply(out, _toConsumableArray(encodeLimits(n.descr.limits)));
break;
}
case "FuncImportDescr":
{
out.push(0x00); // $FlowIgnore
assertNotIdentifierNode(n.descr.id); // $FlowIgnore
out.push.apply(out, _toConsumableArray(encodeU32(n.descr.id.value)));
break;
}
default:
throw new Error("Unsupport operation: encode module import of type: " + n.descr.type);
}
return out;
}
export function encodeSectionMetadata(n) {
var out = [];
var sectionId = constants.sections[n.section];
if (typeof sectionId === "undefined") {
throw new Error("Unknown section: " + n.section);
}
if (n.section === "start") {
/**
* This is not implemented yet because it's a special case which
* doesn't have a vector in its section.
*/
throw new Error("Unsupported section encoding of type start");
}
out.push(sectionId);
out.push.apply(out, _toConsumableArray(encodeU32(n.size.value)));
out.push.apply(out, _toConsumableArray(encodeU32(n.vectorOfSize.value)));
return out;
}
export function encodeCallInstruction(n) {
var out = [];
assertNotIdentifierNode(n.index);
out.push(0x10); // $FlowIgnore
out.push.apply(out, _toConsumableArray(encodeU32(n.index.value)));
return out;
}
export function encodeCallIndirectInstruction(n) {
var out = []; // $FlowIgnore
assertNotIdentifierNode(n.index);
out.push(0x11); // $FlowIgnore
out.push.apply(out, _toConsumableArray(encodeU32(n.index.value))); // add a reserved byte
out.push(0x00);
return out;
}
export function encodeModuleExport(n) {
var out = [];
assertNotIdentifierNode(n.descr.id);
var exportTypeByteString = constants.exportTypesByName[n.descr.exportType];
if (typeof exportTypeByteString === "undefined") {
throw new Error("Unknown export of type: " + n.descr.exportType);
}
var exportTypeByte = parseInt(exportTypeByteString, 10);
out.push.apply(out, _toConsumableArray(encodeUTF8Vec(n.name)));
out.push(exportTypeByte); // $FlowIgnore
out.push.apply(out, _toConsumableArray(encodeU32(n.descr.id.value)));
return out;
}
export function encodeTypeInstruction(n) {
var out = [0x60];
var params = n.functype.params.map(function (x) {
return x.valtype;
}).map(encodeValtype);
var results = n.functype.results.map(encodeValtype);
out.push.apply(out, _toConsumableArray(encodeVec(params)));
out.push.apply(out, _toConsumableArray(encodeVec(results)));
return out;
}
export function encodeInstr(n) {
var out = [];
var instructionName = n.id;
if (typeof n.object === "string") {
instructionName = "".concat(n.object, ".").concat(String(n.id));
}
var byteString = constants.symbolsByName[instructionName];
if (typeof byteString === "undefined") {
throw new Error("encodeInstr: unknown instruction " + JSON.stringify(instructionName));
}
var _byte3 = parseInt(byteString, 10);
out.push(_byte3);
if (n.args) {
n.args.forEach(function (arg) {
var encoder = encodeU32; // find correct encoder
if (n.object === "i32") {
encoder = encodeI32;
}
if (n.object === "i64") {
encoder = encodeI64;
}
if (n.object === "f32") {
encoder = ieee754.encodeF32;
}
if (n.object === "f64") {
encoder = ieee754.encodeF64;
}
if (arg.type === "NumberLiteral" || arg.type === "FloatLiteral" || arg.type === "LongNumberLiteral") {
// $FlowIgnore
out.push.apply(out, _toConsumableArray(encoder(arg.value)));
} else {
throw new Error("Unsupported instruction argument encoding " + JSON.stringify(arg.type));
}
});
}
return out;
}
function encodeExpr(instrs) {
var out = [];
instrs.forEach(function (instr) {
// $FlowIgnore
var n = encodeNode(instr);
out.push.apply(out, _toConsumableArray(n));
});
return out;
}
export function encodeStringLiteral(n) {
return encodeUTF8Vec(n.value);
}
export function encodeGlobal(n) {
var out = [];
var _n$globalType = n.globalType,
valtype = _n$globalType.valtype,
mutability = _n$globalType.mutability;
out.push(encodeValtype(valtype));
out.push(encodeMutability(mutability));
out.push.apply(out, _toConsumableArray(encodeExpr(n.init)));
return out;
}
export function encodeFuncBody(n) {
var out = [];
out.push(-1); // temporary function body size
// FIXME(sven): get the func locals?
var localBytes = encodeVec([]);
out.push.apply(out, _toConsumableArray(localBytes));
var funcBodyBytes = encodeExpr(n.body);
out[0] = funcBodyBytes.length + localBytes.length;
out.push.apply(out, _toConsumableArray(funcBodyBytes));
return out;
}
export function encodeIndexInFuncSection(n) {
assertNotIdentifierNode(n.index); // $FlowIgnore
return encodeU32(n.index.value);
}
export function encodeElem(n) {
var out = [];
assertNotIdentifierNode(n.table); // $FlowIgnore
out.push.apply(out, _toConsumableArray(encodeU32(n.table.value)));
out.push.apply(out, _toConsumableArray(encodeExpr(n.offset))); // $FlowIgnore
var funcs = n.funcs.reduce(function (acc, x) {
return [].concat(_toConsumableArray(acc), _toConsumableArray(encodeU32(x.value)));
}, []);
out.push.apply(out, _toConsumableArray(encodeVec(funcs)));
return out;
}

View File

@@ -0,0 +1,35 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var columns_exports = {};
module.exports = __toCommonJS(columns_exports);
__reExport(columns_exports, require("./blob.cjs"), module.exports);
__reExport(columns_exports, require("./common.cjs"), module.exports);
__reExport(columns_exports, require("./custom.cjs"), module.exports);
__reExport(columns_exports, require("./integer.cjs"), module.exports);
__reExport(columns_exports, require("./numeric.cjs"), module.exports);
__reExport(columns_exports, require("./real.cjs"), module.exports);
__reExport(columns_exports, require("./text.cjs"), module.exports);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
...require("./blob.cjs"),
...require("./common.cjs"),
...require("./custom.cjs"),
...require("./integer.cjs"),
...require("./numeric.cjs"),
...require("./real.cjs"),
...require("./text.cjs")
});
//# sourceMappingURL=index.cjs.map

View File

@@ -0,0 +1,5 @@
export declare const subHours: import("./types.js").FPFn2<
Date,
number,
import("../fp.js").DateArg<Date>
>;

View File

@@ -0,0 +1,2 @@
import "./emotion-cache.browser.development.cjs.js";
export { _default as default } from "./emotion-cache.browser.development.cjs.default.js";

View File

@@ -0,0 +1,2 @@
declare const usePromise: <Args extends any[], Result>(promise: (...inputs: Args) => Promise<Result>, inputs: Args, lifespan?: number) => Result;
export = usePromise;

View File

@@ -0,0 +1,8 @@
import type { LookupMatcherResult } from "./types.js";
/**
* https://tc39.es/ecma402/#sec-lookupmatcher
* @param availableLocales
* @param requestedLocales
* @param getDefaultLocale
*/
export declare function LookupMatcher(availableLocales: readonly string[], requestedLocales: readonly string[], getDefaultLocale: () => string): LookupMatcherResult;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/sqlite-core/view-base.ts"],"sourcesContent":["import { entityKind } from '~/entity.ts';\nimport type { ColumnsSelection } from '~/sql/sql.ts';\nimport { View } from '~/sql/sql.ts';\n\nexport abstract class SQLiteViewBase<\n\tTName extends string = string,\n\tTExisting extends boolean = boolean,\n\tTSelection extends ColumnsSelection = ColumnsSelection,\n> extends View<TName, TExisting, TSelection> {\n\tstatic override readonly [entityKind]: string = 'SQLiteViewBase';\n\n\tdeclare _: View<TName, TExisting, TSelection>['_'] & {\n\t\tviewBrand: 'SQLiteView';\n\t};\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAA2B;AAE3B,iBAAqB;AAEd,MAAe,uBAIZ,gBAAmC;AAAA,EAC5C,QAA0B,wBAAU,IAAY;AAKjD;","names":[]}

View File

@@ -0,0 +1,14 @@
import { GetStaticProps } from 'next';
type Props = {
[key: string]: unknown;
};
/**
* Create a wrapped version of the user's exported `getStaticProps` function
*
* @param origGetStaticProps The user's `getStaticProps` function
* @param parameterizedRoute The page's parameterized route
* @returns A wrapped version of the function
*/
export declare function wrapGetStaticPropsWithSentry(origGetStaticPropsa: GetStaticProps<Props>, _parameterizedRoute: string): GetStaticProps<Props>;
export {};
//# sourceMappingURL=wrapGetStaticPropsWithSentry.d.ts.map

View File

@@ -0,0 +1,305 @@
"use strict";
var test = require("tape"),
sanitize = require("./");
function repeat(string, times) {
return new Array(times + 1).join(string);
}
var REPLACEMENT_OPTS = {
replacement: "_",
};
test("valid names", function(t) {
["the quick brown fox jumped over the lazy dog.mp3",
"résumé"].forEach(function(name) {
t.equal(sanitize(name), name);
});
t.end();
});
test("valid names", function(t) {
["valid name.mp3", "résumé"].forEach(function(name) {
t.equal(sanitize(name, REPLACEMENT_OPTS), name);
});
t.end();
});
test("null character", function(t) {
t.equal(sanitize("hello\u0000world"), "helloworld");
t.end();
});
test("null character", function(t) {
t.equal(sanitize("hello\u0000world", REPLACEMENT_OPTS), "hello_world");
t.end();
});
test("control characters", function(t) {
t.equal(sanitize("hello\nworld"), "helloworld");
t.end();
});
test("control characters", function(t) {
t.equal(sanitize("hello\nworld", REPLACEMENT_OPTS), "hello_world");
t.end();
});
test("restricted codes", function(t) {
["h?w", "h/w", "h*w"].forEach(function(name) {
t.equal(sanitize(name), "hw");
});
t.end();
});
test("restricted codes", function(t) {
["h?w", "h/w", "h*w"].forEach(function(name) {
t.equal(sanitize(name, REPLACEMENT_OPTS), "h_w");
});
t.end();
});
// https://msdn.microsoft.com/en-us/library/aa365247(v=vs.85).aspx
test("restricted suffixes", function(t) {
["mr.", "mr..", "mr ", "mr "].forEach(function(name) {
t.equal(sanitize(name), "mr");
});
t.end();
});
test("relative paths", function(t) {
[".", "..", "./", "../", "/..", "/../", "*.|."].forEach(function(name) {
t.equal(sanitize(name), "");
});
t.end();
});
test("relative path with replacement", function(t) {
t.equal(sanitize("..", REPLACEMENT_OPTS), "_");
t.end();
});
test("reserved filename in Windows", function(t) {
t.equal(sanitize("con"), "");
t.equal(sanitize("COM1"), "");
t.equal(sanitize("PRN."), "");
t.equal(sanitize("aux.txt"), "");
t.equal(sanitize("LPT9.asdfasdf"), "");
t.equal(sanitize("LPT10.txt"), "LPT10.txt");
t.end();
});
test("reserved filename in Windows with replacement", function(t) {
t.equal(sanitize("con", REPLACEMENT_OPTS), "_");
t.equal(sanitize("COM1", REPLACEMENT_OPTS), "_");
t.equal(sanitize("PRN.", REPLACEMENT_OPTS), "_");
t.equal(sanitize("aux.txt", REPLACEMENT_OPTS), "_");
t.equal(sanitize("LPT9.asdfasdf", REPLACEMENT_OPTS), "_");
t.equal(sanitize("LPT10.txt", REPLACEMENT_OPTS), "LPT10.txt");
t.end();
});
test("invalid replacement", function (t) {
t.equal(sanitize(".", { replacement: "."}), "");
t.equal(sanitize("foo?.txt", { replacement: ">"}), "foo.txt");
t.equal(sanitize("con.txt", { replacement: "aux"}), "");
t.equal(sanitize("valid.txt", { replacement: "\/:*?\"<>|"}), "valid.txt");
t.end();
});
test("255 characters max", function(t) {
var string = repeat("a", 300);
t.ok(string.length > 255);
t.ok(sanitize(string).length <= 255);
t.end();
});
// Test the handling of non-BMP chars in UTF-8
//
test("non-bmp SADDLES the limit", function(t){
var str25x = repeat("a", 252),
name = str25x + '\uD800\uDC00';
t.equal(sanitize(name), str25x);
t.end();
});
test("non-bmp JUST WITHIN the limit", function(t){
var str25x = repeat('a', 251),
name = str25x + '\uD800\uDC00';
t.equal(sanitize(name), name);
t.end();
});
test("non-bmp JUST OUTSIDE the limit", function(t){
var str25x = repeat('a', 253),
name = str25x + '\uD800\uDC00';
t.equal(sanitize(name), str25x);
t.end();
});
// Test invalid input
//
test("invalid input", function(t) {
t.throws(function() {
sanitize();
}, null, 'no arguments');
[
undefined,
null,
false,
true,
{},
{
replace: function() {
return "foo";
},
toString: function() {
return "bar";
},
},
[],
new Buffer('asdf'),
].forEach(function(input) {
t.throws(function() {
sanitize(input);
}, null, JSON.stringify(input));
});
t.end();
});
function testStringUsingFS(str, t) {
var sanitized = sanitize(str) || "default";
var filepath = path.join(tempdir, sanitized);
// Should not contain any directories or relative paths
t.equal(path.dirname(path.resolve("/abs/path", sanitized)), path.resolve("/abs/path"));
// Should be max 255 bytes
t.assert(Buffer.byteLength(sanitized) <= 255, "max 255 bytes");
// Should write and read file to disk
t.equal(path.dirname(path.normalize(filepath)), tempdir);
fs.writeFile(filepath, "foobar", function(err) {
t.ifError(err, "no error writing file");
fs.readFile(filepath, function(err, data) {
t.ifError(err, "no error reading file");
t.equal(data.toString(), "foobar", "file contents equals");
fs.unlink(filepath, function(err) {
t.ifError(err, "no error unlinking file");
t.end();
});
});
});
}
// Don't run these tests in browser environments
if ( ! process.browser) {
// ## Browserify Build
//
// Make sure Buffer is not used when building using browserify.
//
var browserify = require("browserify");
var concat = require("concat-stream");
test("browserify build", function(t) {
var bundle = browserify(__dirname).bundle();
bundle.on("error", t.ifError);
bundle.pipe(concat(function(data) {
var source = data.toString();
t.ok(source.indexOf("Buffer") === -1);
t.end();
}));
});
// ## Filesystem Tests
//
// Test writing files to the local filesystem.
//
var fs = require("fs");
var path = require("path");
var mktemp = require("mktemp");
var tempdir = mktemp.createDirSync("sanitize-filename-test-XXXXXX");
try {
var blns = require("./vendor/big-list-of-naughty-strings/blns.json");
}
catch (err) {
console.error("Error: Cannot load file './vendor/big-list-of-naughty-strings/blns.json'");
console.error();
console.error("Make sure you've initialized git submodules by running");
console.error();
console.error(" git submodule update --init");
console.error();
process.exit(1);
}
[].concat(
[
repeat("a", 300),
"the quick brown fox jumped over the lazy dog",
"résumé",
"hello\u0000world",
"hello\nworld",
"semi;colon.js",
";leading-semi.js",
"slash\\.js",
"slash/.js",
"col:on.js",
"star*.js",
"question?.js",
"quote\".js",
"singlequote'.js",
"brack<e>ts.js",
"p|pes.js",
"plus+.js",
"'five and six<seven'.js",
" space at front",
"space at end ",
".period",
"period.",
"relative/path/to/some/dir",
"/abs/path/to/some/dir",
"~/.\u0000notssh/authorized_keys",
"",
"h?w",
"h/w",
"h*w",
".",
"..",
"./",
"../",
"/..",
"/../",
"*.|.",
"./",
"./foobar",
"../foobar",
"../../foobar",
"./././foobar",
"|*.what",
"LPT9.asdf",
],
blns
).forEach(function(str) {
test(JSON.stringify(str), function(t) {
testStringUsingFS(str, t);
});
});
test("remove temp directory", function(t) {
fs.rmdir(tempdir, function(err) {
t.ifError(err);
t.end();
});
});
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"formatUtcOffset.d.ts","sourceRoot":"","sources":["../../src/utilities/formatUtcOffset.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;GAUG;AACH,eAAO,MAAM,eAAe,UAAW,MAAM,KAAG,IAAI,GAAG,MAYtD,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"saveSnapshot.d.ts","sourceRoot":"","sources":["../../src/versions/saveSnapshot.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAC/E,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,4BAA4B,CAAA;AACvE,OAAO,KAAK,EAAE,OAAO,EAAE,eAAe,EAAE,MAAM,aAAa,CAAA;AAC3D,OAAO,KAAK,EAAE,UAAU,EAAE,cAAc,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AAK/E,KAAK,IAAI,CAAC,CAAC,SAAS,UAAU,GAAG,UAAU,IAAI;IAC7C,QAAQ,CAAC,EAAE,OAAO,CAAA;IAClB,UAAU,CAAC,EAAE,yBAAyB,CAAA;IACtC,IAAI,CAAC,EAAE,CAAC,CAAA;IACR,MAAM,CAAC,EAAE,qBAAqB,CAAA;IAC9B,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACpB,OAAO,EAAE,OAAO,CAAA;IAChB,qBAAqB,CAAC,EAAE,MAAM,CAAA;IAC9B,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,MAAM,CAAC,EAAE,UAAU,CAAA;CACpB,CAAA;AAED,eAAO,MAAM,YAAY,GAAU,CAAC,SAAS,UAAU,yGAUpD,IAAI,CAAC,CAAC,CAAC,KAAG,OAAO,CAAC,IAAI,CAAC,eAAe,CAAC,CAAC,CAAC,EAAE,QAAQ,CAAC,GAAG,eAAe,CAAC,CAAC,CAAC,GAAG,SAAS,CAqCvF,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["getBestFitFromSizes","isImage","React","RelationshipContent","UploadCard","baseClass","UploadComponentHasOne","props","className","displayPreview","fileDoc","onRemove","readonly","reloadDoc","serverURL","showCollectionSlug","relationTo","value","id","String","src","thumbnailSrc","url","URL","toString","thumbnailURL","mimeType","sizes","width","_jsx","filter","Boolean","join","allowEdit","allowRemove","alt","filename","byteSize","filesize","collectionSlug","updatedAt","x","y","height"],"sources":["../../../../src/fields/Upload/HasOne/index.tsx"],"sourcesContent":["'use client'\n\nimport type { JsonObject } from 'payload'\n\nimport { getBestFitFromSizes, isImage } from 'payload/shared'\nimport React from 'react'\n\nimport type { ReloadDoc } from '../types.js'\n\nimport './index.scss'\nimport { RelationshipContent } from '../RelationshipContent/index.js'\nimport { UploadCard } from '../UploadCard/index.js'\n\nconst baseClass = 'upload upload--has-one'\n\ntype Props = {\n readonly className?: string\n readonly displayPreview?: boolean\n readonly fileDoc: {\n relationTo: string\n value: JsonObject\n }\n readonly onRemove?: () => void\n readonly readonly?: boolean\n readonly reloadDoc: ReloadDoc\n readonly serverURL: string\n readonly showCollectionSlug?: boolean\n}\n\nexport function UploadComponentHasOne(props: Props) {\n const {\n className,\n displayPreview,\n fileDoc,\n onRemove,\n readonly,\n reloadDoc,\n serverURL,\n showCollectionSlug = false,\n } = props\n const { relationTo, value } = fileDoc\n const id = String(value?.id)\n\n let src: string\n let thumbnailSrc: string\n\n if (value.url) {\n try {\n src = new URL(value.url, serverURL).toString()\n } catch {\n src = `${serverURL}${value.url}`\n }\n }\n\n if (value.thumbnailURL) {\n try {\n thumbnailSrc = new URL(value.thumbnailURL, serverURL).toString()\n } catch {\n thumbnailSrc = `${serverURL}${value.thumbnailURL}`\n }\n }\n\n if (isImage(value.mimeType)) {\n thumbnailSrc = getBestFitFromSizes({\n sizes: value.sizes,\n thumbnailURL: thumbnailSrc,\n url: src,\n width: value.width,\n })\n }\n\n return (\n <UploadCard className={[baseClass, className].filter(Boolean).join(' ')}>\n <RelationshipContent\n allowEdit={!readonly}\n allowRemove={!readonly}\n alt={(value?.alt || value?.filename) as string}\n byteSize={value.filesize as number}\n collectionSlug={relationTo}\n displayPreview={displayPreview}\n filename={value.filename as string}\n id={id}\n mimeType={value?.mimeType as string}\n onRemove={onRemove}\n reloadDoc={reloadDoc}\n showCollectionSlug={showCollectionSlug}\n src={src}\n thumbnailSrc={thumbnailSrc}\n updatedAt={value.updatedAt}\n x={value?.width as number}\n y={value?.height as number}\n />\n </UploadCard>\n )\n}\n"],"mappings":"AAAA;;;AAIA,SAASA,mBAAmB,EAAEC,OAAO,QAAQ;AAC7C,OAAOC,KAAA,MAAW;AAIlB,OAAO;AACP,SAASC,mBAAmB,QAAQ;AACpC,SAASC,UAAU,QAAQ;AAE3B,MAAMC,SAAA,GAAY;AAgBlB,OAAO,SAASC,sBAAsBC,KAAY;EAChD,MAAM;IACJC,SAAS;IACTC,cAAc;IACdC,OAAO;IACPC,QAAQ;IACRC,QAAQ;IACRC,SAAS;IACTC,SAAS;IACTC,kBAAA,GAAqB;EAAK,CAC3B,GAAGR,KAAA;EACJ,MAAM;IAAES,UAAU;IAAEC;EAAK,CAAE,GAAGP,OAAA;EAC9B,MAAMQ,EAAA,GAAKC,MAAA,CAAOF,KAAA,EAAOC,EAAA;EAEzB,IAAIE,GAAA;EACJ,IAAIC,YAAA;EAEJ,IAAIJ,KAAA,CAAMK,GAAG,EAAE;IACb,IAAI;MACFF,GAAA,GAAM,IAAIG,GAAA,CAAIN,KAAA,CAAMK,GAAG,EAAER,SAAA,EAAWU,QAAQ;IAC9C,EAAE,MAAM;MACNJ,GAAA,GAAM,GAAGN,SAAA,GAAYG,KAAA,CAAMK,GAAG,EAAE;IAClC;EACF;EAEA,IAAIL,KAAA,CAAMQ,YAAY,EAAE;IACtB,IAAI;MACFJ,YAAA,GAAe,IAAIE,GAAA,CAAIN,KAAA,CAAMQ,YAAY,EAAEX,SAAA,EAAWU,QAAQ;IAChE,EAAE,MAAM;MACNH,YAAA,GAAe,GAAGP,SAAA,GAAYG,KAAA,CAAMQ,YAAY,EAAE;IACpD;EACF;EAEA,IAAIxB,OAAA,CAAQgB,KAAA,CAAMS,QAAQ,GAAG;IAC3BL,YAAA,GAAerB,mBAAA,CAAoB;MACjC2B,KAAA,EAAOV,KAAA,CAAMU,KAAK;MAClBF,YAAA,EAAcJ,YAAA;MACdC,GAAA,EAAKF,GAAA;MACLQ,KAAA,EAAOX,KAAA,CAAMW;IACf;EACF;EAEA,oBACEC,IAAA,CAACzB,UAAA;IAAWI,SAAA,EAAW,CAACH,SAAA,EAAWG,SAAA,CAAU,CAACsB,MAAM,CAACC,OAAA,EAASC,IAAI,CAAC;cACjE,aAAAH,IAAA,CAAC1B,mBAAA;MACC8B,SAAA,EAAW,CAACrB,QAAA;MACZsB,WAAA,EAAa,CAACtB,QAAA;MACduB,GAAA,EAAMlB,KAAA,EAAOkB,GAAA,IAAOlB,KAAA,EAAOmB,QAAA;MAC3BC,QAAA,EAAUpB,KAAA,CAAMqB,QAAQ;MACxBC,cAAA,EAAgBvB,UAAA;MAChBP,cAAA,EAAgBA,cAAA;MAChB2B,QAAA,EAAUnB,KAAA,CAAMmB,QAAQ;MACxBlB,EAAA,EAAIA,EAAA;MACJQ,QAAA,EAAUT,KAAA,EAAOS,QAAA;MACjBf,QAAA,EAAUA,QAAA;MACVE,SAAA,EAAWA,SAAA;MACXE,kBAAA,EAAoBA,kBAAA;MACpBK,GAAA,EAAKA,GAAA;MACLC,YAAA,EAAcA,YAAA;MACdmB,SAAA,EAAWvB,KAAA,CAAMuB,SAAS;MAC1BC,CAAA,EAAGxB,KAAA,EAAOW,KAAA;MACVc,CAAA,EAAGzB,KAAA,EAAO0B;;;AAIlB","ignoreList":[]}

View File

@@ -0,0 +1,273 @@
/** numeric strings */
type NumberType = "float32" | "float64" | "int8" | "uint8" | "int16" | "uint16" | "int32" | "uint32"
/** string strings */
type StringType = "string" | "timestamp"
/** Generic JTD Schema without inference of the represented type */
export type SomeJTDSchemaType = (
| // ref
{ref: string}
// primitives
| {type: NumberType | StringType | "boolean"}
// enum
| {enum: string[]}
// elements
| {elements: SomeJTDSchemaType}
// values
| {values: SomeJTDSchemaType}
// properties
| {
properties: Record<string, SomeJTDSchemaType>
optionalProperties?: Record<string, SomeJTDSchemaType>
additionalProperties?: boolean
}
| {
properties?: Record<string, SomeJTDSchemaType>
optionalProperties: Record<string, SomeJTDSchemaType>
additionalProperties?: boolean
}
// discriminator
| {discriminator: string; mapping: Record<string, SomeJTDSchemaType>}
// empty
// NOTE see the end of
// https://github.com/typescript-eslint/typescript-eslint/issues/2063#issuecomment-675156492
// eslint-disable-next-line @typescript-eslint/ban-types
| {}
) & {
nullable?: boolean
metadata?: Record<string, unknown>
definitions?: Record<string, SomeJTDSchemaType>
}
/** required keys of an object, not undefined */
type RequiredKeys<T> = {
[K in keyof T]-?: undefined extends T[K] ? never : K
}[keyof T]
/** optional or undifined-able keys of an object */
type OptionalKeys<T> = {
[K in keyof T]-?: undefined extends T[K] ? K : never
}[keyof T]
/** type is true if T is a union type */
type IsUnion_<T, U extends T = T> = false extends (
T extends unknown ? ([U] extends [T] ? false : true) : never
)
? false
: true
type IsUnion<T> = IsUnion_<T>
/** type is true if T is identically E */
type TypeEquality<T, E> = [T] extends [E] ? ([E] extends [T] ? true : false) : false
/** type is true if T or null is identically E or null*/
type NullTypeEquality<T, E> = TypeEquality<T | null, E | null>
/** gets only the string literals of a type or null if a type isn't a string literal */
type EnumString<T> = [T] extends [never]
? null
: T extends string
? string extends T
? null
: T
: null
/** true if type is a union of string literals */
type IsEnum<T> = null extends EnumString<T> ? false : true
/** true only if all types are array types (not tuples) */
// NOTE relies on the fact that tuples don't have an index at 0.5, but arrays
// have an index at every number
type IsElements<T> = false extends IsUnion<T>
? [T] extends [readonly unknown[]]
? undefined extends T[0.5]
? false
: true
: false
: false
/** true if the the type is a values type */
type IsValues<T> = false extends IsUnion<T> ? TypeEquality<keyof T, string> : false
/** true if type is a properties type and Union is false, or type is a discriminator type and Union is true */
type IsRecord<T, Union extends boolean> = Union extends IsUnion<T>
? null extends EnumString<keyof T>
? false
: true
: false
/** true if type represents an empty record */
type IsEmptyRecord<T> = [T] extends [Record<string, never>]
? [T] extends [never]
? false
: true
: false
/** actual schema */
export type JTDSchemaType<T, D extends Record<string, unknown> = Record<string, never>> = (
| // refs - where null wasn't specified, must match exactly
(null extends EnumString<keyof D>
? never
:
| ({[K in keyof D]: [T] extends [D[K]] ? {ref: K} : never}[keyof D] & {nullable?: false})
// nulled refs - if ref is nullable and nullable is specified, then it can
// match either null or non-null definitions
| (null extends T
? {
[K in keyof D]: [Exclude<T, null>] extends [Exclude<D[K], null>]
? {ref: K}
: never
}[keyof D] & {nullable: true}
: never))
// empty - empty schemas also treat nullable differently in that it's now fully ignored
| (unknown extends T ? {nullable?: boolean} : never)
// all other types // numbers - only accepts the type number
| ((true extends NullTypeEquality<T, number>
? {type: NumberType}
: // booleans - accepts the type boolean
true extends NullTypeEquality<T, boolean>
? {type: "boolean"}
: // strings - only accepts the type string
true extends NullTypeEquality<T, string>
? {type: StringType}
: // strings - only accepts the type Date
true extends NullTypeEquality<T, Date>
? {type: "timestamp"}
: // enums - only accepts union of string literals
// TODO we can't actually check that everything in the union was specified
true extends IsEnum<Exclude<T, null>>
? {enum: EnumString<Exclude<T, null>>[]}
: // arrays - only accepts arrays, could be array of unions to be resolved later
true extends IsElements<Exclude<T, null>>
? T extends readonly (infer E)[]
? {
elements: JTDSchemaType<E, D>
}
: never
: // empty properties
true extends IsEmptyRecord<Exclude<T, null>>
?
| {properties: Record<string, never>; optionalProperties?: Record<string, never>}
| {optionalProperties: Record<string, never>}
: // values
true extends IsValues<Exclude<T, null>>
? T extends Record<string, infer V>
? {
values: JTDSchemaType<V, D>
}
: never
: // properties
true extends IsRecord<Exclude<T, null>, false>
? ([RequiredKeys<Exclude<T, null>>] extends [never]
? {
properties?: Record<string, never>
}
: {
properties: {[K in RequiredKeys<T>]: JTDSchemaType<T[K], D>}
}) &
([OptionalKeys<Exclude<T, null>>] extends [never]
? {
optionalProperties?: Record<string, never>
}
: {
optionalProperties: {
[K in OptionalKeys<T>]: JTDSchemaType<Exclude<T[K], undefined>, D>
}
}) & {
additionalProperties?: boolean
}
: // discriminator
true extends IsRecord<Exclude<T, null>, true>
? {
[K in keyof Exclude<T, null>]-?: Exclude<T, null>[K] extends string
? {
discriminator: K
mapping: {
// TODO currently allows descriminator to be present in schema
[M in Exclude<T, null>[K]]: JTDSchemaType<
Omit<T extends Record<K, M> ? T : never, K>,
D
>
}
}
: never
}[keyof Exclude<T, null>]
: never) &
(null extends T
? {
nullable: true
}
: {nullable?: false}))
) & {
// extra properties
metadata?: Record<string, unknown>
// TODO these should only be allowed at the top level
definitions?: {[K in keyof D]: JTDSchemaType<D[K], D>}
}
type JTDDataDef<S, D extends Record<string, unknown>> =
| // ref
(S extends {ref: string}
? D extends {[K in S["ref"]]: infer V}
? JTDDataDef<V, D>
: never
: // type
S extends {type: NumberType}
? number
: S extends {type: "boolean"}
? boolean
: S extends {type: "string"}
? string
: S extends {type: "timestamp"}
? string | Date
: // enum
S extends {enum: readonly (infer E)[]}
? string extends E
? never
: [E] extends [string]
? E
: never
: // elements
S extends {elements: infer E}
? JTDDataDef<E, D>[]
: // properties
S extends {
properties: Record<string, unknown>
optionalProperties?: Record<string, unknown>
additionalProperties?: boolean
}
? {-readonly [K in keyof S["properties"]]-?: JTDDataDef<S["properties"][K], D>} & {
-readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef<
S["optionalProperties"][K],
D
>
} & ([S["additionalProperties"]] extends [true] ? Record<string, unknown> : unknown)
: S extends {
properties?: Record<string, unknown>
optionalProperties: Record<string, unknown>
additionalProperties?: boolean
}
? {-readonly [K in keyof S["properties"]]-?: JTDDataDef<S["properties"][K], D>} & {
-readonly [K in keyof S["optionalProperties"]]+?: JTDDataDef<
S["optionalProperties"][K],
D
>
} & ([S["additionalProperties"]] extends [true] ? Record<string, unknown> : unknown)
: // values
S extends {values: infer V}
? Record<string, JTDDataDef<V, D>>
: // discriminator
S extends {discriminator: infer M; mapping: Record<string, unknown>}
? [M] extends [string]
? {
[K in keyof S["mapping"]]: JTDDataDef<S["mapping"][K], D> & {[KM in M]: K}
}[keyof S["mapping"]]
: never
: // empty
unknown)
| (S extends {nullable: true} ? null : never)
export type JTDDataType<S> = S extends {definitions: Record<string, unknown>}
? JTDDataDef<S, S["definitions"]>
: JTDDataDef<S, Record<string, never>>

View File

@@ -0,0 +1,21 @@
import type { TypeWithVersion } from 'payload';
import React from 'react';
import './index.scss';
type AutosaveCellProps = {
currentlyPublishedVersion?: TypeWithVersion<any>;
latestDraftVersion?: TypeWithVersion<any>;
rowData: {
autosave?: boolean;
id: number | string;
publishedLocale?: string;
updatedAt?: string;
version: {
[key: string]: unknown;
_status: 'draft' | 'published';
updatedAt: string;
};
};
};
export declare const AutosaveCell: React.FC<AutosaveCellProps>;
export {};
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,53 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
/*
* Copyright 2020 Google LLC
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
/**
* Takes a performance entry type and a callback function, and creates a
* `PerformanceObserver` instance that will observe the specified entry type
* with buffering enabled and call the callback _for each entry_.
*
* This function also feature-detects entry support and wraps the logic in a
* try/catch to avoid errors in unsupporting browsers.
*/
const observe = (
type,
callback,
opts = {},
) => {
try {
if (PerformanceObserver.supportedEntryTypes.includes(type)) {
const po = new PerformanceObserver(list => {
// Delay by a microtask to workaround a bug in Safari where the
// callback is invoked immediately, rather than in a separate task.
// See: https://github.com/GoogleChrome/web-vitals/issues/277
// eslint-disable-next-line @typescript-eslint/no-floating-promises
Promise.resolve().then(() => {
callback(list.getEntries() );
});
});
po.observe({ type, buffered: true, ...opts });
return po;
}
} catch {
// Do nothing.
}
return;
};
exports.observe = observe;
//# sourceMappingURL=observe.js.map

View File

@@ -0,0 +1,8 @@
import type { PayloadRequest } from '../types/index.js';
import type { SanitizedPermissions } from './types.js';
type GetAccessResultsArgs = {
req: PayloadRequest;
};
export declare function getAccessResults({ req, }: GetAccessResultsArgs): Promise<SanitizedPermissions>;
export {};
//# sourceMappingURL=getAccessResults.d.ts.map

View File

@@ -0,0 +1,329 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var emotionElement = require('./emotion-element-a1829a1e.cjs.js');
var React = require('react');
var utils = require('@emotion/utils');
var useInsertionEffectWithFallbacks = require('@emotion/use-insertion-effect-with-fallbacks');
var serialize = require('@emotion/serialize');
require('@emotion/cache');
require('@babel/runtime/helpers/extends');
require('@emotion/weak-memoize');
require('../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.cjs.js');
require('hoist-non-react-statics');
function _interopNamespace(e) {
if (e && e.__esModule) return e;
var n = Object.create(null);
if (e) {
Object.keys(e).forEach(function (k) {
if (k !== 'default') {
var d = Object.getOwnPropertyDescriptor(e, k);
Object.defineProperty(n, k, d.get ? d : {
enumerable: true,
get: function () { return e[k]; }
});
}
});
}
n["default"] = e;
return Object.freeze(n);
}
var React__namespace = /*#__PURE__*/_interopNamespace(React);
exports.jsx = function jsx(type, props) {
// eslint-disable-next-line prefer-rest-params
var args = arguments;
if (props == null || !emotionElement.hasOwn.call(props, 'css')) {
return React__namespace.createElement.apply(undefined, args);
}
var argsLength = args.length;
var createElementArgArray = new Array(argsLength);
createElementArgArray[0] = emotionElement.Emotion;
createElementArgArray[1] = emotionElement.createEmotionProps(type, props);
for (var i = 2; i < argsLength; i++) {
createElementArgArray[i] = args[i];
}
return React__namespace.createElement.apply(null, createElementArgArray);
};
(function (_jsx) {
var JSX;
(function (_JSX) {})(JSX || (JSX = _jsx.JSX || (_jsx.JSX = {})));
})(exports.jsx || (exports.jsx = {}));
// initial render from browser, insertBefore context.sheet.tags[0] or if a style hasn't been inserted there yet, appendChild
// initial client-side render from SSR, use place of hydrating tag
var Global = /* #__PURE__ */emotionElement.withEmotionCache(function (props, cache) {
var styles = props.styles;
var serialized = serialize.serializeStyles([styles], undefined, React__namespace.useContext(emotionElement.ThemeContext));
if (!emotionElement.isBrowser) {
var _ref;
var serializedNames = serialized.name;
var serializedStyles = serialized.styles;
var next = serialized.next;
while (next !== undefined) {
serializedNames += ' ' + next.name;
serializedStyles += next.styles;
next = next.next;
}
var shouldCache = cache.compat === true;
var rules = cache.insert("", {
name: serializedNames,
styles: serializedStyles
}, cache.sheet, shouldCache);
if (shouldCache) {
return null;
}
return /*#__PURE__*/React__namespace.createElement("style", (_ref = {}, _ref["data-emotion"] = cache.key + "-global " + serializedNames, _ref.dangerouslySetInnerHTML = {
__html: rules
}, _ref.nonce = cache.sheet.nonce, _ref));
} // yes, i know these hooks are used conditionally
// but it is based on a constant that will never change at runtime
// it's effectively like having two implementations and switching them out
// so it's not actually breaking anything
var sheetRef = React__namespace.useRef();
useInsertionEffectWithFallbacks.useInsertionEffectWithLayoutFallback(function () {
var key = cache.key + "-global"; // use case of https://github.com/emotion-js/emotion/issues/2675
var sheet = new cache.sheet.constructor({
key: key,
nonce: cache.sheet.nonce,
container: cache.sheet.container,
speedy: cache.sheet.isSpeedy
});
var rehydrating = false;
var node = document.querySelector("style[data-emotion=\"" + key + " " + serialized.name + "\"]");
if (cache.sheet.tags.length) {
sheet.before = cache.sheet.tags[0];
}
if (node !== null) {
rehydrating = true; // clear the hash so this node won't be recognizable as rehydratable by other <Global/>s
node.setAttribute('data-emotion', key);
sheet.hydrate([node]);
}
sheetRef.current = [sheet, rehydrating];
return function () {
sheet.flush();
};
}, [cache]);
useInsertionEffectWithFallbacks.useInsertionEffectWithLayoutFallback(function () {
var sheetRefCurrent = sheetRef.current;
var sheet = sheetRefCurrent[0],
rehydrating = sheetRefCurrent[1];
if (rehydrating) {
sheetRefCurrent[1] = false;
return;
}
if (serialized.next !== undefined) {
// insert keyframes
utils.insertStyles(cache, serialized.next, true);
}
if (sheet.tags.length) {
// if this doesn't exist then it will be null so the style element will be appended
var element = sheet.tags[sheet.tags.length - 1].nextElementSibling;
sheet.before = element;
sheet.flush();
}
cache.insert("", serialized, sheet, false);
}, [cache, serialized.name]);
return null;
});
function css() {
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
return serialize.serializeStyles(args);
}
function keyframes() {
var insertable = css.apply(void 0, arguments);
var name = "animation-" + insertable.name;
return {
name: name,
styles: "@keyframes " + name + "{" + insertable.styles + "}",
anim: 1,
toString: function toString() {
return "_EMO_" + this.name + "_" + this.styles + "_EMO_";
}
};
}
var classnames = function classnames(args) {
var len = args.length;
var i = 0;
var cls = '';
for (; i < len; i++) {
var arg = args[i];
if (arg == null) continue;
var toAdd = void 0;
switch (typeof arg) {
case 'boolean':
break;
case 'object':
{
if (Array.isArray(arg)) {
toAdd = classnames(arg);
} else {
toAdd = '';
for (var k in arg) {
if (arg[k] && k) {
toAdd && (toAdd += ' ');
toAdd += k;
}
}
}
break;
}
default:
{
toAdd = arg;
}
}
if (toAdd) {
cls && (cls += ' ');
cls += toAdd;
}
}
return cls;
};
function merge(registered, css, className) {
var registeredStyles = [];
var rawClassName = utils.getRegisteredStyles(registered, registeredStyles, className);
if (registeredStyles.length < 2) {
return className;
}
return rawClassName + css(registeredStyles);
}
var Insertion = function Insertion(_ref) {
var cache = _ref.cache,
serializedArr = _ref.serializedArr;
var rules = useInsertionEffectWithFallbacks.useInsertionEffectAlwaysWithSyncFallback(function () {
var rules = '';
for (var i = 0; i < serializedArr.length; i++) {
var res = utils.insertStyles(cache, serializedArr[i], false);
if (!emotionElement.isBrowser && res !== undefined) {
rules += res;
}
}
if (!emotionElement.isBrowser) {
return rules;
}
});
if (!emotionElement.isBrowser && rules.length !== 0) {
var _ref2;
return /*#__PURE__*/React__namespace.createElement("style", (_ref2 = {}, _ref2["data-emotion"] = cache.key + " " + serializedArr.map(function (serialized) {
return serialized.name;
}).join(' '), _ref2.dangerouslySetInnerHTML = {
__html: rules
}, _ref2.nonce = cache.sheet.nonce, _ref2));
}
return null;
};
var ClassNames = /* #__PURE__ */emotionElement.withEmotionCache(function (props, cache) {
var hasRendered = false;
var serializedArr = [];
var css = function css() {
if (hasRendered && emotionElement.isDevelopment) {
throw new Error('css can only be used during render');
}
for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {
args[_key] = arguments[_key];
}
var serialized = serialize.serializeStyles(args, cache.registered);
serializedArr.push(serialized); // registration has to happen here as the result of this might get consumed by `cx`
utils.registerStyles(cache, serialized, false);
return cache.key + "-" + serialized.name;
};
var cx = function cx() {
if (hasRendered && emotionElement.isDevelopment) {
throw new Error('cx can only be used during render');
}
for (var _len2 = arguments.length, args = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
args[_key2] = arguments[_key2];
}
return merge(cache.registered, css, classnames(args));
};
var content = {
css: css,
cx: cx,
theme: React__namespace.useContext(emotionElement.ThemeContext)
};
var ele = props.children(content);
hasRendered = true;
return /*#__PURE__*/React__namespace.createElement(React__namespace.Fragment, null, /*#__PURE__*/React__namespace.createElement(Insertion, {
cache: cache,
serializedArr: serializedArr
}), ele);
});
exports.CacheProvider = emotionElement.CacheProvider;
exports.ThemeContext = emotionElement.ThemeContext;
exports.ThemeProvider = emotionElement.ThemeProvider;
exports.__unsafe_useEmotionCache = emotionElement.__unsafe_useEmotionCache;
exports.useTheme = emotionElement.useTheme;
Object.defineProperty(exports, 'withEmotionCache', {
enumerable: true,
get: function () { return emotionElement.withEmotionCache; }
});
exports.withTheme = emotionElement.withTheme;
exports.ClassNames = ClassNames;
exports.Global = Global;
exports.createElement = exports.jsx;
exports.css = css;
exports.keyframes = keyframes;

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../../../../src/integrations/mcp-server/index.ts"],"sourcesContent":["import { getClient } from '../../currentScopes';\nimport { fill } from '../../utils/object';\nimport { wrapAllMCPHandlers } from './handlers';\nimport { wrapTransportError, wrapTransportOnClose, wrapTransportOnMessage, wrapTransportSend } from './transport';\nimport type { MCPServerInstance, McpServerWrapperOptions, MCPTransport, ResolvedMcpOptions } from './types';\nimport { validateMcpServerInstance } from './validation';\n\n/**\n * Tracks wrapped MCP server instances to prevent double-wrapping\n * @internal\n */\nconst wrappedMcpServerInstances = new WeakSet();\n\n/**\n * Wraps a MCP Server instance from the `@modelcontextprotocol/sdk` package with Sentry instrumentation.\n *\n * Compatible with versions `^1.9.0` of the `@modelcontextprotocol/sdk` package.\n * Automatically instruments transport methods and handler functions for comprehensive monitoring.\n *\n * @example\n * ```typescript\n * import * as Sentry from '@sentry/core';\n * import { McpServer } from '@modelcontextprotocol/sdk/server/mcp.js';\n * import { StreamableHTTPServerTransport } from '@modelcontextprotocol/sdk/server/streamableHttp.js';\n *\n * // Default: inputs/outputs captured based on sendDefaultPii option\n * const server = Sentry.wrapMcpServerWithSentry(\n * new McpServer({ name: \"my-server\", version: \"1.0.0\" })\n * );\n *\n * // Explicitly control input/output capture\n * const server = Sentry.wrapMcpServerWithSentry(\n * new McpServer({ name: \"my-server\", version: \"1.0.0\" }),\n * { recordInputs: true, recordOutputs: false }\n * );\n *\n * const transport = new StreamableHTTPServerTransport();\n * await server.connect(transport);\n * ```\n *\n * @param mcpServerInstance - MCP server instance to instrument\n * @param options - Optional configuration for recording inputs and outputs\n * @returns Instrumented server instance (same reference)\n */\nexport function wrapMcpServerWithSentry<S extends object>(mcpServerInstance: S, options?: McpServerWrapperOptions): S {\n if (wrappedMcpServerInstances.has(mcpServerInstance)) {\n return mcpServerInstance;\n }\n\n if (!validateMcpServerInstance(mcpServerInstance)) {\n return mcpServerInstance;\n }\n\n const serverInstance = mcpServerInstance as MCPServerInstance;\n const client = getClient();\n const sendDefaultPii = Boolean(client?.getOptions().sendDefaultPii);\n\n const resolvedOptions: ResolvedMcpOptions = {\n recordInputs: options?.recordInputs ?? sendDefaultPii,\n recordOutputs: options?.recordOutputs ?? sendDefaultPii,\n };\n\n fill(serverInstance, 'connect', originalConnect => {\n return async function (this: MCPServerInstance, transport: MCPTransport, ...restArgs: unknown[]) {\n const result = await (originalConnect as (...args: unknown[]) => Promise<unknown>).call(\n this,\n transport,\n ...restArgs,\n );\n\n wrapTransportOnMessage(transport, resolvedOptions);\n wrapTransportSend(transport, resolvedOptions);\n wrapTransportOnClose(transport);\n wrapTransportError(transport);\n\n return result;\n };\n });\n\n wrapAllMCPHandlers(serverInstance);\n\n wrappedMcpServerInstances.add(mcpServerInstance);\n return mcpServerInstance;\n}\n"],"names":[],"mappings":";;;;;;AAOA;AACA;AACA;AACA;AACA,MAAM,yBAAA,GAA4B,IAAI,OAAO,EAAE;;AAE/C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACO,SAAS,uBAAuB,CAAmB,iBAAiB,EAAK,OAAO,EAA+B;AACtH,EAAE,IAAI,yBAAyB,CAAC,GAAG,CAAC,iBAAiB,CAAC,EAAE;AACxD,IAAI,OAAO,iBAAiB;AAC5B,EAAE;;AAEF,EAAE,IAAI,CAAC,yBAAyB,CAAC,iBAAiB,CAAC,EAAE;AACrD,IAAI,OAAO,iBAAiB;AAC5B,EAAE;;AAEF,EAAE,MAAM,cAAA,GAAiB,iBAAA;AACzB,EAAE,MAAM,MAAA,GAAS,SAAS,EAAE;AAC5B,EAAE,MAAM,cAAA,GAAiB,OAAO,CAAC,MAAM,EAAE,UAAU,EAAE,CAAC,cAAc,CAAC;;AAErE,EAAE,MAAM,eAAe,GAAuB;AAC9C,IAAI,YAAY,EAAE,OAAO,EAAE,YAAA,IAAgB,cAAc;AACzD,IAAI,aAAa,EAAE,OAAO,EAAE,aAAA,IAAiB,cAAc;AAC3D,GAAG;;AAEH,EAAE,IAAI,CAAC,cAAc,EAAE,SAAS,EAAE,mBAAmB;AACrD,IAAI,OAAO,iBAAyC,SAAS,EAAgB,GAAG,QAAQ,EAAa;AACrG,MAAM,MAAM,SAAS,MAAM,CAAC,eAAA,GAA6D,IAAI;AAC7F,QAAQ,IAAI;AACZ,QAAQ,SAAS;AACjB,QAAQ,GAAG,QAAQ;AACnB,OAAO;;AAEP,MAAM,sBAAsB,CAAC,SAAS,EAAE,eAAe,CAAC;AACxD,MAAM,iBAAiB,CAAC,SAAS,EAAE,eAAe,CAAC;AACnD,MAAM,oBAAoB,CAAC,SAAS,CAAC;AACrC,MAAM,kBAAkB,CAAC,SAAS,CAAC;;AAEnC,MAAM,OAAO,MAAM;AACnB,IAAI,CAAC;AACL,EAAE,CAAC,CAAC;;AAEJ,EAAE,kBAAkB,CAAC,cAAc,CAAC;;AAEpC,EAAE,yBAAyB,CAAC,GAAG,CAAC,iBAAiB,CAAC;AAClD,EAAE,OAAO,iBAAiB;AAC1B;;;;"}

View File

@@ -0,0 +1,49 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var date_common_exports = {};
__export(date_common_exports, {
MySqlDateBaseColumn: () => MySqlDateBaseColumn,
MySqlDateColumnBaseBuilder: () => MySqlDateColumnBaseBuilder
});
module.exports = __toCommonJS(date_common_exports);
var import_entity = require("../../entity.cjs");
var import_sql = require("../../sql/sql.cjs");
var import_common = require("./common.cjs");
class MySqlDateColumnBaseBuilder extends import_common.MySqlColumnBuilder {
static [import_entity.entityKind] = "MySqlDateColumnBuilder";
defaultNow() {
return this.default(import_sql.sql`(now())`);
}
// "on update now" also adds an implicit default value to the column - https://dev.mysql.com/doc/refman/8.0/en/timestamp-initialization.html
onUpdateNow() {
this.config.hasOnUpdateNow = true;
this.config.hasDefault = true;
return this;
}
}
class MySqlDateBaseColumn extends import_common.MySqlColumn {
static [import_entity.entityKind] = "MySqlDateColumn";
hasOnUpdateNow = this.config.hasOnUpdateNow;
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
MySqlDateBaseColumn,
MySqlDateColumnBaseBuilder
});
//# sourceMappingURL=date.common.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/uploads/endpoints/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,uBAAuB,CAAA;AAMrD,eAAO,MAAM,yBAAyB,EAAE,QAAQ,EAW9C,CAAA"}

View File

@@ -0,0 +1,28 @@
import { formatDistance } from "./ja-Hira/_lib/formatDistance.mjs";
import { formatLong } from "./ja-Hira/_lib/formatLong.mjs";
import { formatRelative } from "./ja-Hira/_lib/formatRelative.mjs";
import { localize } from "./ja-Hira/_lib/localize.mjs";
import { match } from "./ja-Hira/_lib/match.mjs";
/**
* @category Locales
* @summary Japanese (Hiragana) locale.
* @language Japanese (Hiragana)
* @iso-639-2 jpn
* @author Eri Hiramatsu [@Eritutteo](https://github.com/Eritutteo)
*/
export const jaHira = {
code: "ja-Hira",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 0 /* Sunday */,
firstWeekContainsDate: 1,
},
};
// Fallback for modularized imports:
export default jaHira;

View File

@@ -0,0 +1,18 @@
/**
Escape RegExp special characters.
You can also use this to escape a string that is inserted into the middle of a regex, for example, into a character class.
@example
```
import escapeStringRegexp = require('escape-string-regexp');
const escapedString = escapeStringRegexp('How much $ for a 🦄?');
//=> 'How much \\$ for a 🦄\\?'
new RegExp(escapedString);
```
*/
declare const escapeStringRegexp: (string: string) => string;
export = escapeStringRegexp;

View File

@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { getDecade as fn } from "../getDecade.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const getDecade = convertToFP(fn, 1);
// Fallback for modularized imports:
export default getDecade;

View File

@@ -0,0 +1,41 @@
var isSymbol = require('./isSymbol');
/**
* Compares values to sort them in ascending order.
*
* @private
* @param {*} value The value to compare.
* @param {*} other The other value to compare.
* @returns {number} Returns the sort order indicator for `value`.
*/
function compareAscending(value, other) {
if (value !== other) {
var valIsDefined = value !== undefined,
valIsNull = value === null,
valIsReflexive = value === value,
valIsSymbol = isSymbol(value);
var othIsDefined = other !== undefined,
othIsNull = other === null,
othIsReflexive = other === other,
othIsSymbol = isSymbol(other);
if ((!othIsNull && !othIsSymbol && !valIsSymbol && value > other) ||
(valIsSymbol && othIsDefined && othIsReflexive && !othIsNull && !othIsSymbol) ||
(valIsNull && othIsDefined && othIsReflexive) ||
(!valIsDefined && othIsReflexive) ||
!valIsReflexive) {
return 1;
}
if ((!valIsNull && !valIsSymbol && !othIsSymbol && value < other) ||
(othIsSymbol && valIsDefined && valIsReflexive && !valIsNull && !valIsSymbol) ||
(othIsNull && valIsDefined && valIsReflexive) ||
(!othIsDefined && valIsReflexive) ||
!othIsReflexive) {
return -1;
}
}
return 0;
}
module.exports = compareAscending;

View File

@@ -0,0 +1 @@
Prism.languages.dhall={comment:/--.*|\{-(?:[^-{]|-(?!\})|\{(?!-)|\{-(?:[^-{]|-(?!\})|\{(?!-))*-\})*-\}/,string:{pattern:/"(?:[^"\\]|\\.)*"|''(?:[^']|'(?!')|'''|''\$\{)*''(?!'|\$)/,greedy:!0,inside:{interpolation:{pattern:/\$\{[^{}]*\}/,inside:{expression:{pattern:/(^\$\{)[\s\S]+(?=\}$)/,lookbehind:!0,alias:"language-dhall",inside:null},punctuation:/\$\{|\}/}}}},label:{pattern:/`[^`]*`/,greedy:!0},url:{pattern:/\bhttps?:\/\/[\w.:%!$&'*+;=@~-]+(?:\/[\w.:%!$&'*+;=@~-]*)*(?:\?[/?\w.:%!$&'*+;=@~-]*)?/,greedy:!0},env:{pattern:/\benv:(?:(?!\d)\w+|"(?:[^"\\=]|\\.)*")/,greedy:!0,inside:{function:/^env/,operator:/^:/,variable:/[\s\S]+/}},hash:{pattern:/\bsha256:[\da-fA-F]{64}\b/,inside:{function:/sha256/,operator:/:/,number:/[\da-fA-F]{64}/}},keyword:/\b(?:as|assert|else|forall|if|in|let|merge|missing|then|toMap|using|with)\b|\u2200/,builtin:/\b(?:None|Some)\b/,boolean:/\b(?:False|True)\b/,number:/\bNaN\b|-?\bInfinity\b|[+-]?\b(?:0x[\da-fA-F]+|\d+(?:\.\d+)?(?:e[+-]?\d+)?)\b/,operator:/\/\\|\/\/\\\\|&&|\|\||===|[!=]=|\/\/|->|\+\+|::|[+*#@=:?<>|\\\u2227\u2a53\u2261\u2afd\u03bb\u2192]/,punctuation:/\.\.|[{}\[\](),./]/,"class-name":/\b[A-Z]\w*\b/},Prism.languages.dhall.string.inside.interpolation.inside.expression.inside=Prism.languages.dhall;

View File

@@ -0,0 +1,5 @@
// Does this device prefer reduced motion? Returns `null` server-side.
const prefersReducedMotion = { current: null };
const hasReducedMotionListener = { current: false };
export { hasReducedMotionListener, prefersReducedMotion };

View File

@@ -0,0 +1,10 @@
"use strict";
exports.subMonths = void 0;
var _index = require("../subMonths.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const subMonths = (exports.subMonths = (0, _index2.convertToFP)(
_index.subMonths,
2,
));

View File

@@ -0,0 +1,43 @@
# postgres-array [![Build Status](https://travis-ci.org/bendrucker/postgres-array.svg?branch=master)](https://travis-ci.org/bendrucker/postgres-array)
> Parse postgres array columns
## Install
```
$ npm install --save postgres-array
```
## Usage
```js
var postgresArray = require('postgres-array')
postgresArray.parse('{1,2,3}', (value) => parseInt(value, 10))
//=> [1, 2, 3]
```
## API
#### `parse(input, [transform])` -> `array`
##### input
*Required*
Type: `string`
A Postgres array string.
##### transform
Type: `function`
Default: `identity`
A function that transforms non-null values inserted into the array.
## License
MIT © [Ben Drucker](http://bendrucker.me)

View File

@@ -0,0 +1 @@
{"version":3,"names":["_importInjector","require","_isModule","addDefault","path","importedSource","opts","ImportInjector","addNamed","name","addNamespace","addSideEffect"],"sources":["../src/index.ts"],"sourcesContent":["import ImportInjector, { type ImportOptions } from \"./import-injector.ts\";\nimport type { NodePath } from \"@babel/traverse\";\nimport type * as t from \"@babel/types\";\n\nexport { ImportInjector };\n\nexport { default as isModule } from \"./is-module.ts\";\n\nexport function addDefault(\n path: NodePath,\n importedSource: string,\n opts?: Partial<ImportOptions>,\n) {\n return new ImportInjector(path).addDefault(importedSource, opts);\n}\n\nfunction addNamed(\n path: NodePath,\n name: string,\n importedSource: string,\n opts?: Omit<\n Partial<ImportOptions>,\n \"ensureLiveReference\" | \"ensureNoContext\"\n >,\n): t.Identifier;\nfunction addNamed(\n path: NodePath,\n name: string,\n importedSource: string,\n opts?: Omit<Partial<ImportOptions>, \"ensureLiveReference\"> & {\n ensureLiveReference: true;\n },\n): t.MemberExpression;\nfunction addNamed(\n path: NodePath,\n name: string,\n importedSource: string,\n opts?: Omit<Partial<ImportOptions>, \"ensureNoContext\"> & {\n ensureNoContext: true;\n },\n): t.SequenceExpression;\n/**\n * add a named import to the program path of given path\n *\n * @export\n * @param {NodePath} path The starting path to find a program path\n * @param {string} name The name of the generated binding. Babel will prefix it with `_`\n * @param {string} importedSource The source of the import\n * @param {Partial<ImportOptions>} [opts]\n * @returns {t.Identifier | t.MemberExpression | t.SequenceExpression} If opts.ensureNoContext is true, returns a SequenceExpression,\n * else if opts.ensureLiveReference is true, returns a MemberExpression, else returns an Identifier\n */\nfunction addNamed(\n path: NodePath,\n name: string,\n importedSource: string,\n opts?: Partial<ImportOptions>,\n) {\n return new ImportInjector(path).addNamed(name, importedSource, opts);\n}\nexport { addNamed };\n\nexport function addNamespace(\n path: NodePath,\n importedSource: string,\n opts?: Partial<ImportOptions>,\n) {\n return new ImportInjector(path).addNamespace(importedSource, opts);\n}\n\nexport function addSideEffect(\n path: NodePath,\n importedSource: string,\n opts?: Partial<ImportOptions>,\n) {\n return new ImportInjector(path).addSideEffect(importedSource, opts);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA,IAAAA,eAAA,GAAAC,OAAA;AAMA,IAAAC,SAAA,GAAAD,OAAA;AAEO,SAASE,UAAUA,CACxBC,IAAc,EACdC,cAAsB,EACtBC,IAA6B,EAC7B;EACA,OAAO,IAAIC,uBAAc,CAACH,IAAI,CAAC,CAACD,UAAU,CAACE,cAAc,EAAEC,IAAI,CAAC;AAClE;AAsCA,SAASE,QAAQA,CACfJ,IAAc,EACdK,IAAY,EACZJ,cAAsB,EACtBC,IAA6B,EAC7B;EACA,OAAO,IAAIC,uBAAc,CAACH,IAAI,CAAC,CAACI,QAAQ,CAACC,IAAI,EAAEJ,cAAc,EAAEC,IAAI,CAAC;AACtE;AAGO,SAASI,YAAYA,CAC1BN,IAAc,EACdC,cAAsB,EACtBC,IAA6B,EAC7B;EACA,OAAO,IAAIC,uBAAc,CAACH,IAAI,CAAC,CAACM,YAAY,CAACL,cAAc,EAAEC,IAAI,CAAC;AACpE;AAEO,SAASK,aAAaA,CAC3BP,IAAc,EACdC,cAAsB,EACtBC,IAA6B,EAC7B;EACA,OAAO,IAAIC,uBAAc,CAACH,IAAI,CAAC,CAACO,aAAa,CAACN,cAAc,EAAEC,IAAI,CAAC;AACrE","ignoreList":[]}

View File

@@ -0,0 +1,27 @@
"use strict";
exports.ta = void 0;
var _index = require("./ta/_lib/formatDistance.cjs");
var _index2 = require("./ta/_lib/formatLong.cjs");
var _index3 = require("./ta/_lib/formatRelative.cjs");
var _index4 = require("./ta/_lib/localize.cjs");
var _index5 = require("./ta/_lib/match.cjs");
/**
* @category Locales
* @summary Tamil locale (India).
* @language Tamil
* @iso-639-2 tam
* @author Sibiraj [@sibiraj-s](https://github.com/sibiraj-s)
*/
const ta = (exports.ta = {
code: "ta",
formatDistance: _index.formatDistance,
formatLong: _index2.formatLong,
formatRelative: _index3.formatRelative,
localize: _index4.localize,
match: _index5.match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
});

View File

@@ -0,0 +1,205 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.js");
const eraValues = {
narrow: ["ab. J.C.", "apr. J.C."],
abbreviated: ["ab. J.C.", "apr. J.C."],
wide: ["abans Jèsus-Crist", "après Jèsus-Crist"],
};
const quarterValues = {
narrow: ["T1", "T2", "T3", "T4"],
abbreviated: ["1èr trim.", "2nd trim.", "3en trim.", "4en trim."],
wide: ["1èr trimèstre", "2nd trimèstre", "3en trimèstre", "4en trimèstre"],
};
const monthValues = {
narrow: [
"GN",
"FB",
"MÇ",
"AB",
"MA",
"JN",
"JL",
"AG",
"ST",
"OC",
"NV",
"DC",
],
abbreviated: [
"gen.",
"febr.",
"març",
"abr.",
"mai",
"junh",
"jul.",
"ag.",
"set.",
"oct.",
"nov.",
"dec.",
],
wide: [
"genièr",
"febrièr",
"març",
"abril",
"mai",
"junh",
"julhet",
"agost",
"setembre",
"octòbre",
"novembre",
"decembre",
],
};
const dayValues = {
narrow: ["dg.", "dl.", "dm.", "dc.", "dj.", "dv.", "ds."],
short: ["dg.", "dl.", "dm.", "dc.", "dj.", "dv.", "ds."],
abbreviated: ["dg.", "dl.", "dm.", "dc.", "dj.", "dv.", "ds."],
wide: [
"dimenge",
"diluns",
"dimars",
"dimècres",
"dijòus",
"divendres",
"dissabte",
],
};
const dayPeriodValues = {
narrow: {
am: "am",
pm: "pm",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "matin",
afternoon: "aprèp-miègjorn",
evening: "vèspre",
night: "nuèch",
},
abbreviated: {
am: "a.m.",
pm: "p.m.",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "matin",
afternoon: "aprèp-miègjorn",
evening: "vèspre",
night: "nuèch",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "matin",
afternoon: "aprèp-miègjorn",
evening: "vèspre",
night: "nuèch",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "am",
pm: "pm",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "del matin",
afternoon: "de laprèp-miègjorn",
evening: "del ser",
night: "de la nuèch",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "del matin",
afternoon: "de laprèp-miègjorn",
evening: "del ser",
night: "de la nuèch",
},
wide: {
am: "ante meridiem",
pm: "post meridiem",
midnight: "mièjanuèch",
noon: "miègjorn",
morning: "del matin",
afternoon: "de laprèp-miègjorn",
evening: "del ser",
night: "de la nuèch",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
const unit = options?.unit;
let ordinal;
switch (number) {
case 1:
ordinal = "èr";
break;
case 2:
ordinal = "nd";
break;
default:
ordinal = "en";
}
// feminine for year, week, hour, minute, second
if (
unit === "year" ||
unit === "week" ||
unit === "hour" ||
unit === "minute" ||
unit === "second"
) {
ordinal += "a";
}
return number + ordinal;
};
const localize = (exports.localize = {
ordinalNumber,
era: (0, _index.buildLocalizeFn)({
values: eraValues,
defaultWidth: "wide",
}),
quarter: (0, _index.buildLocalizeFn)({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: (0, _index.buildLocalizeFn)({
values: monthValues,
defaultWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

View File

@@ -0,0 +1,2 @@
import{getRequestUrl as e}from"../utils/get-request-url.js";import{request as t}from"../utils/request.js";const n={},r=(r={})=>i=>{let a={...n,...r};return{async request(n){let o=n();if(o.headers||={},`Content-Type`in o.headers?o.headers[`Content-Type`]===`multipart/form-data`&&delete o.headers[`Content-Type`]:o.headers[`Content-Type`]=`application/json`,`getToken`in this&&!(`Authorization`in o.headers)){let e=await this.getToken();e&&(o.headers.Authorization=`Bearer ${e}`)}let s=e(i.url,o.path,o.params),c={method:o.method??`GET`,headers:o.headers??{}};`credentials`in a&&(c.credentials=a.credentials),o.body&&(c.body=o.body),o.onRequest&&(c=await o.onRequest(c)),a.onRequest&&(c=await a.onRequest(c));let l=await t(s.toString(),c,i.globals.fetch);return`onResponse`in o&&(l=await o.onResponse(l,c)),`onResponse`in r&&(l=await r.onResponse(l,c)),l}}};export{r as rest};
//# sourceMappingURL=composable.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/gel-core/index.ts"],"sourcesContent":["export * from './alias.ts';\nexport * from './checks.ts';\nexport * from './columns/index.ts';\nexport * from './db.ts';\nexport * from './dialect.ts';\nexport * from './foreign-keys.ts';\nexport * from './indexes.ts';\nexport * from './policies.ts';\nexport * from './primary-keys.ts';\nexport * from './query-builders/index.ts';\nexport * from './roles.ts';\nexport * from './schema.ts';\nexport * from './sequence.ts';\nexport * from './session.ts';\nexport * from './subquery.ts';\nexport * from './table.ts';\nexport * from './unique-constraint.ts';\nexport * from './utils.ts';\nexport * from './view-common.ts';\nexport * from './view.ts';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;AACd,cAAc;","names":[]}

View File

@@ -0,0 +1,178 @@
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { DocumentInfoProvider, EditDepthProvider, HydrateAuthProvider } from '@payloadcms/ui';
import { RenderServerComponent } from '@payloadcms/ui/elements/RenderServerComponent';
import { buildFormState } from '@payloadcms/ui/utilities/buildFormState';
import { notFound } from 'next/navigation.js';
import { formatAdminURL } from 'payload/shared';
import React from 'react';
import { DocumentHeader } from '../../elements/DocumentHeader/index.js';
import { getDocPreferences } from '../Document/getDocPreferences.js';
import { getDocumentData } from '../Document/getDocumentData.js';
import { getDocumentPermissions } from '../Document/getDocumentPermissions.js';
import { getIsLocked } from '../Document/getIsLocked.js';
import { getVersions } from '../Document/getVersions.js';
import { EditView } from '../Edit/index.js';
import { AccountClient } from './index.client.js';
import { Settings } from './Settings/index.js';
export async function AccountView({
initPageResult,
params,
searchParams
}) {
const {
languageOptions,
locale,
permissions,
req,
req: {
i18n,
payload,
payload: {
config
},
user
}
} = initPageResult;
const {
admin: {
theme,
user: userSlug
},
routes: {
api
},
serverURL
} = config;
const collectionConfig = payload?.collections?.[userSlug]?.config;
if (collectionConfig && user?.id) {
// Fetch the data required for the view
const data = await getDocumentData({
id: user.id,
collectionSlug: collectionConfig.slug,
locale,
payload,
req,
user
});
if (!data) {
throw new Error('not-found');
}
// Get document preferences
const docPreferences = await getDocPreferences({
id: user.id,
collectionSlug: collectionConfig.slug,
payload,
user
});
// Get permissions
const {
docPermissions,
hasPublishPermission,
hasSavePermission
} = await getDocumentPermissions({
id: user.id,
collectionConfig,
data,
req
});
// Build initial form state from data
const {
state: formState
} = await buildFormState({
id: user.id,
collectionSlug: collectionConfig.slug,
data,
docPermissions,
docPreferences,
locale: locale?.code,
operation: 'update',
renderAllFields: true,
req,
schemaPath: collectionConfig.slug,
skipValidation: true
});
// Fetch document lock state
const {
currentEditor,
isLocked,
lastUpdateTime
} = await getIsLocked({
id: user.id,
collectionConfig,
isEditing: true,
req
});
// Get all versions required for UI
const {
hasPublishedDoc,
mostRecentVersionIsAutosaved,
unpublishedVersionCount,
versionCount
} = await getVersions({
id: user.id,
collectionConfig,
doc: data,
docPermissions,
locale: locale?.code,
payload,
user
});
return /*#__PURE__*/_jsx(DocumentInfoProvider, {
AfterFields: /*#__PURE__*/_jsx(Settings, {
i18n: i18n,
languageOptions: languageOptions,
payload: payload,
theme: theme,
user: user
}),
apiURL: formatAdminURL({
apiRoute: api,
path: `/${userSlug}${user?.id ? `/${user.id}` : ''}`
}),
collectionSlug: userSlug,
currentEditor: currentEditor,
docPermissions: docPermissions,
hasPublishedDoc: hasPublishedDoc,
hasPublishPermission: hasPublishPermission,
hasSavePermission: hasSavePermission,
id: user?.id,
initialData: data,
initialState: formState,
isEditing: true,
isLocked: isLocked,
lastUpdateTime: lastUpdateTime,
mostRecentVersionIsAutosaved: mostRecentVersionIsAutosaved,
unpublishedVersionCount: unpublishedVersionCount,
versionCount: versionCount,
children: /*#__PURE__*/_jsxs(EditDepthProvider, {
children: [/*#__PURE__*/_jsx(DocumentHeader, {
collectionConfig: collectionConfig,
hideTabs: true,
permissions: permissions,
req: req
}), /*#__PURE__*/_jsx(HydrateAuthProvider, {
permissions: permissions
}), RenderServerComponent({
Component: config.admin?.components?.views?.account?.Component,
Fallback: EditView,
importMap: payload.importMap,
serverProps: {
doc: data,
hasPublishedDoc,
i18n,
initPageResult,
locale,
params,
payload,
permissions,
routeSegments: [],
searchParams,
user
}
}), /*#__PURE__*/_jsx(AccountClient, {})]
})
});
}
return notFound();
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,33 @@
"use strict";
exports.addWeeks = addWeeks;
var _index = require("./addDays.cjs");
/**
* The {@link addWeeks} function options.
*/
/**
* @name addWeeks
* @category Week Helpers
* @summary Add the specified number of weeks to the given date.
*
* @description
* Add the specified number of weeks to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to be changed
* @param amount - The amount of weeks to be added.
* @param options - An object with options
*
* @returns The new date with the weeks added
*
* @example
* // Add 4 weeks to 1 September 2014:
* const result = addWeeks(new Date(2014, 8, 1), 4)
* //=> Mon Sep 29 2014 00:00:00
*/
function addWeeks(date, amount, options) {
return (0, _index.addDays)(date, amount * 7, options);
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"calendar-check.js","sources":["../../../src/icons/calendar-check.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name CalendarCheck\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNOCAydjQiIC8+CiAgPHBhdGggZD0iTTE2IDJ2NCIgLz4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjQiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik0zIDEwaDE4IiAvPgogIDxwYXRoIGQ9Im05IDE2IDIgMiA0LTQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/calendar-check\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst CalendarCheck = createLucideIcon('CalendarCheck', [\n ['path', { d: 'M8 2v4', key: '1cmpym' }],\n ['path', { d: 'M16 2v4', key: '4m81vk' }],\n ['rect', { width: '18', height: '18', x: '3', y: '4', rx: '2', key: '1hopcy' }],\n ['path', { d: 'M3 10h18', key: '8toen8' }],\n ['path', { d: 'm9 16 2 2 4-4', key: '19s6y9' }],\n]);\n\nexport default CalendarCheck;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAU,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACvC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAChD,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,7 @@
export declare const defaultMessages = "End-Of-Stream";
/**
* Thrown on read operation of the end of file or stream has been reached
*/
export declare class EndOfStreamError extends Error {
constructor();
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"handleRunAfterProductionCompile.js","sources":["../../../src/config/handleRunAfterProductionCompile.ts"],"sourcesContent":["import type { createSentryBuildPluginManager as createSentryBuildPluginManagerType } from '@sentry/bundler-plugin-core';\nimport { loadModule } from '@sentry/core';\nimport { getBuildPluginOptions } from './getBuildPluginOptions';\nimport type { SentryBuildOptions } from './types';\n\n/**\n * This function is called by Next.js after the production build is complete.\n * It is used to upload sourcemaps to Sentry.\n */\nexport async function handleRunAfterProductionCompile(\n {\n releaseName,\n distDir,\n buildTool,\n usesNativeDebugIds,\n }: { releaseName?: string; distDir: string; buildTool: 'webpack' | 'turbopack'; usesNativeDebugIds?: boolean },\n sentryBuildOptions: SentryBuildOptions,\n): Promise<void> {\n if (sentryBuildOptions.debug) {\n // eslint-disable-next-line no-console\n console.debug('[@sentry/nextjs] Running runAfterProductionCompile logic.');\n }\n\n const { createSentryBuildPluginManager } =\n loadModule<{ createSentryBuildPluginManager: typeof createSentryBuildPluginManagerType }>(\n '@sentry/bundler-plugin-core',\n module,\n ) ?? {};\n\n if (!createSentryBuildPluginManager) {\n // eslint-disable-next-line no-console\n console.warn(\n '[@sentry/nextjs] Could not load build manager package. Will not run runAfterProductionCompile logic.',\n );\n return;\n }\n\n const options = getBuildPluginOptions({\n sentryBuildOptions,\n releaseName,\n distDirAbsPath: distDir,\n buildTool: `after-production-compile-${buildTool}`,\n });\n\n const sentryBuildPluginManager = createSentryBuildPluginManager(options, {\n buildTool,\n loggerPrefix: '[@sentry/nextjs - After Production Compile]',\n });\n\n await sentryBuildPluginManager.telemetry.emitBundlerPluginExecutionSignal();\n await sentryBuildPluginManager.createRelease();\n\n // Skip debug ID injection if sourcemaps are disabled which are only relevant for sourcemap correlation\n if (!usesNativeDebugIds && sentryBuildOptions.sourcemaps?.disable !== true) {\n await sentryBuildPluginManager.injectDebugIds([distDir]);\n }\n\n await sentryBuildPluginManager.uploadSourcemaps([distDir], {\n // We don't want to prepare the artifacts because we injected debug ids manually before\n prepareArtifacts: false,\n });\n await sentryBuildPluginManager.deleteArtifacts();\n}\n"],"names":["loadModule","getBuildPluginOptions"],"mappings":";;;;;AAKA;AACA;AACA;AACA;AACO,eAAe,+BAA+B;AACrD,EAAE;AACF,IAAI,WAAW;AACf,IAAI,OAAO;AACX,IAAI,SAAS;AACb,IAAI,kBAAkB;AACtB,GAAG;AACH,EAAE,kBAAkB;AACpB,EAAiB;AACjB,EAAE,IAAI,kBAAkB,CAAC,KAAK,EAAE;AAChC;AACA,IAAI,OAAO,CAAC,KAAK,CAAC,2DAA2D,CAAC;AAC9E,EAAE;;AAEF,EAAE,MAAM,EAAE,8BAAA,EAA+B;AACzC,IAAIA,eAAU;AACd,MAAM,6BAA6B;AACnC,MAAM,MAAM;AACZ,KAAI,IAAK,EAAE;;AAEX,EAAE,IAAI,CAAC,8BAA8B,EAAE;AACvC;AACA,IAAI,OAAO,CAAC,IAAI;AAChB,MAAM,sGAAsG;AAC5G,KAAK;AACL,IAAI;AACJ,EAAE;;AAEF,EAAE,MAAM,OAAA,GAAUC,2CAAqB,CAAC;AACxC,IAAI,kBAAkB;AACtB,IAAI,WAAW;AACf,IAAI,cAAc,EAAE,OAAO;AAC3B,IAAI,SAAS,EAAE,CAAC,yBAAyB,EAAE,SAAS,CAAC,CAAA;AACA,GAAA,CAAA;;AAEA,EAAA,MAAA,wBAAA,GAAA,8BAAA,CAAA,OAAA,EAAA;AACA,IAAA,SAAA;AACA,IAAA,YAAA,EAAA,6CAAA;AACA,GAAA,CAAA;;AAEA,EAAA,MAAA,wBAAA,CAAA,SAAA,CAAA,gCAAA,EAAA;AACA,EAAA,MAAA,wBAAA,CAAA,aAAA,EAAA;;AAEA;AACA,EAAA,IAAA,CAAA,kBAAA,IAAA,kBAAA,CAAA,UAAA,EAAA,OAAA,KAAA,IAAA,EAAA;AACA,IAAA,MAAA,wBAAA,CAAA,cAAA,CAAA,CAAA,OAAA,CAAA,CAAA;AACA,EAAA;;AAEA,EAAA,MAAA,wBAAA,CAAA,gBAAA,CAAA,CAAA,OAAA,CAAA,EAAA;AACA;AACA,IAAA,gBAAA,EAAA,KAAA;AACA,GAAA,CAAA;AACA,EAAA,MAAA,wBAAA,CAAA,eAAA,EAAA;AACA;;;;"}

View File

@@ -0,0 +1,19 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const ScreenShare = createLucideIcon("ScreenShare", [
["path", { d: "M13 3H4a2 2 0 0 0-2 2v10a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-3", key: "i8wdob" }],
["path", { d: "M8 21h8", key: "1ev6f3" }],
["path", { d: "M12 17v4", key: "1riwvh" }],
["path", { d: "m17 8 5-5", key: "fqif7o" }],
["path", { d: "M17 3h5v5", key: "1o3tu8" }]
]);
export { ScreenShare as default };
//# sourceMappingURL=screen-share.js.map

View File

@@ -0,0 +1,40 @@
import { entityKind } from "../entity.js";
import { DefaultLogger } from "../logger.js";
import { MySqlDatabase } from "../mysql-core/db.js";
import { MySqlDialect } from "../mysql-core/dialect.js";
import {
createTableRelationsHelpers,
extractTablesRelationalConfig
} from "../relations.js";
import { MySqlRemoteSession } from "./session.js";
class MySqlRemoteDatabase extends MySqlDatabase {
static [entityKind] = "MySqlRemoteDatabase";
}
function drizzle(callback, config = {}) {
const dialect = new MySqlDialect({ casing: config.casing });
let logger;
if (config.logger === true) {
logger = new DefaultLogger();
} else if (config.logger !== false) {
logger = config.logger;
}
let schema;
if (config.schema) {
const tablesConfig = extractTablesRelationalConfig(
config.schema,
createTableRelationsHelpers
);
schema = {
fullSchema: config.schema,
schema: tablesConfig.tables,
tableNamesMap: tablesConfig.tableNamesMap
};
}
const session = new MySqlRemoteSession(callback, dialect, schema, { logger });
return new MySqlRemoteDatabase(dialect, session, schema, "default");
}
export {
MySqlRemoteDatabase,
drizzle
};
//# sourceMappingURL=driver.js.map

View File

@@ -0,0 +1,12 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import * as modDev from './useLexicalTextEntity.dev.mjs';
import * as modProd from './useLexicalTextEntity.prod.mjs';
const mod = process.env.NODE_ENV !== 'production' ? modDev : modProd;
export const useLexicalTextEntity = mod.useLexicalTextEntity;

View File

@@ -0,0 +1,72 @@
# FP Guide
**date-fns** v2.x provides [functional programming](https://en.wikipedia.org/wiki/Functional_programming) (FP)
friendly functions, like those in [lodash](https://github.com/lodash/lodash/wiki/FP-Guide),
that support [currying](https://en.wikipedia.org/wiki/Currying).
## Table of Contents
- [Usage](#usage)
- [Using Function Composition](#using-function-composition)
## Usage
FP functions are provided via `'date-fns/fp'` submodule.
Functions with options (`format`, `parse`, etc.) have two FP counterparts:
one that has the options object as its first argument and one that hasn't.
The name of the former has `WithOptions` added to the end of its name.
In **date-fns'** FP functions, the order of arguments is reversed.
```javascript
import { addYears, formatWithOptions } from "date-fns/fp";
import { eo } from "date-fns/locale";
import toUpper from "lodash/fp/toUpper"; // 'date-fns/fp' is compatible with 'lodash/fp'!
// If FP function has not received enough arguments, it returns another function
const addFiveYears = addYears(5);
// Several arguments can be curried at once
const dateToString = formatWithOptions({ locale: eo }, "d MMMM yyyy");
const dates = [
new Date(2017, 0 /* Jan */, 1),
new Date(2017, 1 /* Feb */, 11),
new Date(2017, 6 /* Jul */, 2),
];
const formattedDates = dates.map(addFiveYears).map(dateToString).map(toUpper);
//=> ['1 JANUARO 2022', '11 FEBRUARO 2022', '2 JULIO 2022']
```
## Using Function Composition
The main advantage of FP functions is support of functional-style
[function composing](https://medium.com/making-internets/why-using-chain-is-a-mistake-9bc1f80d51ba).
In the example above, you can compose `addFiveYears`, `dateToString` and `toUpper` into a single function:
```javascript
const formattedDates = dates.map((date) =>
toUpper(dateToString(addFiveYears(date))),
);
```
Or you can use `compose` function provided by [lodash](https://lodash.com) to do the same in more idiomatic way:
```javascript
import { compose } from "lodash/fp/compose";
const formattedDates = dates.map(compose(toUpper, dateToString, addFiveYears));
```
Or if you prefer natural direction of composing (as opposed to the computationally correct order),
you can use lodash' `flow` instead:
```javascript
import flow from "lodash/fp/flow";
const formattedDates = dates.map(flow(addFiveYears, dateToString, toUpper));
```

View File

@@ -0,0 +1,14 @@
/**
* Vue 2/3 VM type.
*/
export interface VueViewModel {
__isVue?: boolean;
_isVue?: boolean;
}
/**
* Vue 3 VNode type.
*/
export interface VNode {
__v_isVNode?: boolean;
}
//# sourceMappingURL=vue.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"radial-gradient.js","sourceRoot":"","sources":["../../../../../../src/css/types/functions/__tests__/radial-gradient.ts"],"names":[],"mappings":";;AAAA,iCAAuC;AACvC,iDAA2D;AAC3D,sDAAkD;AAElD,qCAAkC;AAElC,6DAAuE;AAGvE,IAAM,KAAK,GAAG,UAAC,KAAa,IAAK,OAAA,gCAAc,CAAC,EAAa,EAAG,eAAM,CAAC,WAAW,CAAC,KAAK,CAAC,CAAC,CAAC,CAAiB,CAAC,MAAM,CAAC,EAAnF,CAAmF,CAAC;AACrH,IAAM,UAAU,GAAG,UAAC,KAAa,IAAK,OAAA,aAAK,CAAC,KAAK,CAAC,EAAa,EAAE,eAAM,CAAC,UAAU,CAAC,KAAK,CAAC,CAAC,EAApD,CAAoD,CAAC;AAE3F,QAAQ,CAAC,WAAW,EAAE;IAClB,QAAQ,CAAC,iBAAiB,EAAE;QACxB,QAAQ,CAAC,SAAS,EAAE;YAChB,EAAE,CAAC,iEAAiE,EAAE;gBAClE,OAAA,wBAAe,CAAC,KAAK,CAAC,kEAAkE,CAAC,EAAE;oBACvF,IAAI,yBAA8B;oBAClC,KAAK,iBAAwB;oBAC7B,IAAI,sBAA8B;oBAClC,QAAQ,EAAE,EAAE;oBACZ,KAAK,EAAE;wBACH,EAAC,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,EAAC;wBAC1C,EAAC,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,EAAC;wBAC1C,EAAC,KAAK,EAAE,UAAU,CAAC,SAAS,CAAC,EAAE,IAAI,EAAE,IAAI,EAAC;qBAC7C;iBACJ,CAAC;YAVF,CAUE,CAAC,CAAC;YACR,EAAE,CAAC,4DAA4D,EAAE;gBAC7D,OAAA,wBAAe,CAAC,KAAK,CAAC,4DAA4D,CAAC,EAAE;oBACjF,IAAI,yBAA8B;oBAClC,KAAK,gBAAuB;oBAC5B,IAAI,yBAAiC;oBACrC,QAAQ,EAAE,CAAC,iCAAa,CAAC;oBACzB,KAAK,EAAE;wBACH,EAAC,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,EAAC,IAAI,uBAAwB,EAAE,MAAM,EAAE,CAAC,EAAE,KAAK,EAAE,CAAC,EAAC,EAAC;wBACrF,EAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAC;wBACvC,EAAC,KAAK,EAAE,UAAU,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,EAAC,IAAI,2BAA4B,EAAE,MAAM,EAAE,GAAG,EAAE,KAAK,EAAE,CAAC,EAAC,EAAC;qBAChG;iBACJ,CAAC;YAVF,CAUE,CAAC,CAAC;YACR,EAAE,CAAC,qEAAqE,EAAE;gBACtE,OAAA,wBAAe,CAAC,KAAK,CAAC,qEAAqE,CAAC,EAAE;oBAC1F,IAAI,yBAA8B;oBAClC,KAAK,gBAAuB;oBAC5B,IAAI,yBAAiC;oBACrC,QAAQ,EAAE,CAAC,mCAAe,CAAC;oBAC3B,KAAK,EAAE;wBACH,EAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAC;wBACvC,EAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,EAAC,IAAI,2BAA4B,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAC,EAAC;wBAC3F,EAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,EAAC,IAAI,2BAA4B,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAC,EAAC;wBAC3F,EAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,EAAC,IAAI,2BAA4B,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAC,EAAC;qBAC9F;iBACJ,CAAC;YAXF,CAWE,CAAC,CAAC;YACR,EAAE,CAAC,kCAAkC,EAAE;gBACnC,OAAA,wBAAe,CAAC,KAAK,CAAC,kCAAkC,CAAC,EAAE;oBACvD,IAAI,yBAA8B;oBAClC,KAAK,gBAAuB;oBAC5B,IAAI,EAAE,CAAC,EAAC,IAAI,0BAA2B,EAAE,MAAM,EAAE,EAAE,EAAE,KAAK,EAAE,CAAC,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC;oBAC3E,QAAQ,EAAE,EAAE;oBACZ,KAAK,EAAE;wBACH,EAAC,KAAK,EAAE,UAAU,CAAC,KAAK,CAAC,EAAE,IAAI,EAAE,IAAI,EAAC;wBACtC,EAAC,KAAK,EAAE,UAAU,CAAC,MAAM,CAAC,EAAE,IAAI,EAAE,IAAI,EAAC;qBAC1C;iBACJ,CAAC;YATF,CASE,CAAC,CAAC;QACZ,CAAC,CAAC,CAAC;IACP,CAAC,CAAC,CAAC;AACP,CAAC,CAAC,CAAC"}

View File

@@ -0,0 +1,54 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GraphQLTimeZone = void 0;
const graphql_1 = require("graphql");
const error_js_1 = require("../error.js");
const validateTimeZone = (str, ast) => {
if (!(Intl === null || Intl === void 0 ? void 0 : Intl.DateTimeFormat().resolvedOptions().timeZone)) {
throw (0, error_js_1.createGraphQLError)('Time zones are not available in this environment', ast
? {
nodes: ast,
}
: undefined);
}
try {
Intl.DateTimeFormat(undefined, { timeZone: str });
return str;
}
catch (ex) {
if (ex instanceof RangeError) {
throw (0, error_js_1.createGraphQLError)(`Value is not a valid IANA time zone: ${str}`, ast
? {
nodes: ast,
}
: undefined);
}
else {
throw (0, error_js_1.createGraphQLError)('Could not validate time zone.', ast
? {
nodes: ast,
}
: undefined);
}
}
};
exports.GraphQLTimeZone = new graphql_1.GraphQLScalarType({
name: 'TimeZone',
description: 'A field whose value exists in the standard IANA Time Zone Database: https://www.iana.org/time-zones',
serialize: validateTimeZone,
parseValue: validateTimeZone,
parseLiteral(ast) {
if (ast.kind !== graphql_1.Kind.STRING) {
throw (0, error_js_1.createGraphQLError)(`Can only sanitize time zone strings, but got: ${ast.kind}`);
}
return validateTimeZone(ast.value);
},
extensions: {
codegenScalarType: 'string',
jsonSchema: {
title: 'TimeZone',
type: 'string',
pattern: '^(?:[A-Za-z0-9_]|(?:%[0-9A-Fa-f]{2}))+',
},
},
});

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sources":["../../../../../src/integrations/tracing/langchain/index.ts"],"sourcesContent":["import type { IntegrationFn, LangChainOptions } from '@sentry/core';\nimport { defineIntegration, LANGCHAIN_INTEGRATION_NAME } from '@sentry/core';\nimport { generateInstrumentOnce } from '@sentry/node-core';\nimport { SentryLangChainInstrumentation } from './instrumentation';\n\nexport const instrumentLangChain = generateInstrumentOnce<LangChainOptions>(\n LANGCHAIN_INTEGRATION_NAME,\n options => new SentryLangChainInstrumentation(options),\n);\n\nconst _langChainIntegration = ((options: LangChainOptions = {}) => {\n return {\n name: LANGCHAIN_INTEGRATION_NAME,\n setupOnce() {\n instrumentLangChain(options);\n },\n };\n}) satisfies IntegrationFn;\n\n/**\n * Adds Sentry tracing instrumentation for LangChain.\n *\n * This integration is enabled by default.\n *\n * When configured, this integration automatically instruments LangChain runnable instances\n * to capture telemetry data by injecting Sentry callback handlers into all LangChain calls.\n *\n * **Important:** This integration automatically skips wrapping the OpenAI, Anthropic, and Google GenAI\n * providers to prevent duplicate spans when using LangChain with these AI providers.\n * LangChain handles the instrumentation for all underlying AI providers.\n *\n * @example\n * ```javascript\n * import * as Sentry from '@sentry/node';\n * import { ChatOpenAI } from '@langchain/openai';\n *\n * Sentry.init({\n * integrations: [Sentry.langChainIntegration()],\n * sendDefaultPii: true, // Enable to record inputs/outputs\n * });\n *\n * // LangChain calls are automatically instrumented\n * const model = new ChatOpenAI();\n * await model.invoke(\"What is the capital of France?\");\n * ```\n *\n * ## Manual Callback Handler\n *\n * You can also manually add the Sentry callback handler alongside other callbacks:\n *\n * @example\n * ```javascript\n * import * as Sentry from '@sentry/node';\n * import { ChatOpenAI } from '@langchain/openai';\n *\n * const sentryHandler = Sentry.createLangChainCallbackHandler({\n * recordInputs: true,\n * recordOutputs: true\n * });\n *\n * const model = new ChatOpenAI();\n * await model.invoke(\n * \"What is the capital of France?\",\n * { callbacks: [sentryHandler, myOtherCallback] }\n * );\n * ```\n *\n * ## Options\n *\n * - `recordInputs`: Whether to record input messages/prompts (default: respects `sendDefaultPii` client option)\n * - `recordOutputs`: Whether to record response text (default: respects `sendDefaultPii` client option)\n *\n * ### Default Behavior\n *\n * By default, the integration will:\n * - Record inputs and outputs ONLY if `sendDefaultPii` is set to `true` in your Sentry client options\n * - Otherwise, inputs and outputs are NOT recorded unless explicitly enabled\n *\n * @example\n * ```javascript\n * // Record inputs and outputs when sendDefaultPii is false\n * Sentry.init({\n * integrations: [\n * Sentry.langChainIntegration({\n * recordInputs: true,\n * recordOutputs: true\n * })\n * ],\n * });\n *\n * // Never record inputs/outputs regardless of sendDefaultPii\n * Sentry.init({\n * sendDefaultPii: true,\n * integrations: [\n * Sentry.langChainIntegration({\n * recordInputs: false,\n * recordOutputs: false\n * })\n * ],\n * });\n * ```\n *\n * ## Supported Events\n *\n * The integration captures the following LangChain lifecycle events:\n * - LLM/Chat Model: start, end, error\n * - Chain: start, end, error\n * - Tool: start, end, error\n *\n */\nexport const langChainIntegration = defineIntegration(_langChainIntegration);\n"],"names":[],"mappings":";;;;AAKO,MAAM,mBAAA,GAAsB,sBAAsB;AACzD,EAAE,0BAA0B;AAC5B,EAAE,WAAW,IAAI,8BAA8B,CAAC,OAAO,CAAC;AACxD;;AAEA,MAAM,qBAAA,IAAyB,CAAC,OAAO,GAAqB,EAAE,KAAK;AACnE,EAAE,OAAO;AACT,IAAI,IAAI,EAAE,0BAA0B;AACpC,IAAI,SAAS,GAAG;AAChB,MAAM,mBAAmB,CAAC,OAAO,CAAC;AAClC,IAAI,CAAC;AACL,GAAG;AACH,CAAC,CAAA;;AAED;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;MACa,oBAAA,GAAuB,iBAAiB,CAAC,qBAAqB;;;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"bug-off.js","sources":["../../../src/icons/bug-off.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name BugOff\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTUgNy4xM1Y2YTMgMyAwIDAgMC01LjE0LTIuMUw4IDIiIC8+CiAgPHBhdGggZD0iTTE0LjEyIDMuODggMTYgMiIgLz4KICA8cGF0aCBkPSJNMjIgMTNoLTR2LTJhNCA0IDAgMCAwLTQtNGgtMS4zIiAvPgogIDxwYXRoIGQ9Ik0yMC45NyA1YzAgMi4xLTEuNiAzLjgtMy41IDQiIC8+CiAgPHBhdGggZD0ibTIgMiAyMCAyMCIgLz4KICA8cGF0aCBkPSJNNy43IDcuN0E0IDQgMCAwIDAgNiAxMXYzYTYgNiAwIDAgMCAxMS4xMyAzLjEzIiAvPgogIDxwYXRoIGQ9Ik0xMiAyMHYtOCIgLz4KICA8cGF0aCBkPSJNNiAxM0gyIiAvPgogIDxwYXRoIGQ9Ik0zIDIxYzAtMi4xIDEuNy0zLjkgMy44LTQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/bug-off\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst BugOff = createLucideIcon('BugOff', [\n ['path', { d: 'M15 7.13V6a3 3 0 0 0-5.14-2.1L8 2', key: 'vl8zik' }],\n ['path', { d: 'M14.12 3.88 16 2', key: 'qol33r' }],\n ['path', { d: 'M22 13h-4v-2a4 4 0 0 0-4-4h-1.3', key: '1ou0bd' }],\n ['path', { d: 'M20.97 5c0 2.1-1.6 3.8-3.5 4', key: '18gb23' }],\n ['path', { d: 'm2 2 20 20', key: '1ooewy' }],\n ['path', { d: 'M7.7 7.7A4 4 0 0 0 6 11v3a6 6 0 0 0 11.13 3.13', key: '1njkjs' }],\n ['path', { d: 'M12 20v-8', key: 'i3yub9' }],\n ['path', { d: 'M6 13H2', key: '82j7cp' }],\n ['path', { d: 'M3 21c0-2.1 1.7-3.9 3.8-4', key: '4p0ekp' }],\n]);\n\nexport default BugOff;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAClE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAoB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACjD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAChE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAc,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC3C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC/E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5D,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { previousSunday as fn } from "../previousSunday.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const previousSundayWithOptions = convertToFP(fn, 2);
// Fallback for modularized imports:
export default previousSundayWithOptions;

View File

@@ -0,0 +1,27 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { KlassConstructor, LexicalEditor } from '../LexicalEditor';
import type { ElementNode } from './LexicalElementNode';
import type { EditorConfig } from 'lexical';
import { LexicalNode } from '../LexicalNode';
export interface DecoratorNode<T> {
getTopLevelElement(): ElementNode | this | null;
getTopLevelElementOrThrow(): ElementNode | this;
}
/** @noInheritDoc */
export declare class DecoratorNode<T> extends LexicalNode {
['constructor']: KlassConstructor<typeof DecoratorNode<T>>;
/**
* The returned value is added to the LexicalEditor._decorators
*/
decorate(editor: LexicalEditor, config: EditorConfig): T;
isIsolated(): boolean;
isInline(): boolean;
isKeyboardSelectable(): boolean;
}
export declare function $isDecoratorNode<T>(node: LexicalNode | null | undefined): node is DecoratorNode<T>;

View File

@@ -0,0 +1,105 @@
import * as React from 'react'
import weakMemoize from '@emotion/weak-memoize'
import isDevelopment from '#is-development'
import hoistNonReactStatics from './_isolated-hnrs'
import { DistributiveOmit, PropsOf } from './types'
// tslint:disable-next-line: no-empty-interface
export interface Theme {}
export interface ThemeProviderProps {
theme: Partial<Theme> | ((outerTheme: Theme) => Theme)
children: React.ReactNode
}
export interface ThemeProvider {
(props: ThemeProviderProps): React.ReactElement
}
export type WithTheme<P, T> = P extends { theme: infer Theme }
? P & { theme: Exclude<Theme, undefined> }
: P & { theme: T }
export const ThemeContext = /* #__PURE__ */ React.createContext({} as Theme)
if (isDevelopment) {
ThemeContext.displayName = 'EmotionThemeContext'
}
export const useTheme = () => React.useContext(ThemeContext)
const getTheme = (
outerTheme: Theme,
theme: Partial<Theme> | ((theme: Theme) => Theme)
): Theme => {
if (typeof theme === 'function') {
const mergedTheme = theme(outerTheme)
if (
isDevelopment &&
(mergedTheme == null ||
typeof mergedTheme !== 'object' ||
Array.isArray(mergedTheme))
) {
throw new Error(
'[ThemeProvider] Please return an object from your theme function, i.e. theme={() => ({})}!'
)
}
return mergedTheme
}
if (
isDevelopment &&
(theme == null || typeof theme !== 'object' || Array.isArray(theme))
) {
throw new Error(
'[ThemeProvider] Please make your theme prop a plain object'
)
}
return { ...outerTheme, ...theme }
}
let createCacheWithTheme = /* #__PURE__ */ weakMemoize((outerTheme: Theme) => {
return weakMemoize((theme: Partial<Theme> | ((theme: Theme) => Theme)) => {
return getTheme(outerTheme, theme)
})
})
export interface ThemeProviderProps {
theme: Partial<Theme> | ((outerTheme: Theme) => Theme)
children: React.ReactNode
}
export const ThemeProvider = (props: ThemeProviderProps) => {
let theme = React.useContext(ThemeContext)
if (props.theme !== theme) {
theme = createCacheWithTheme(theme)(props.theme)
}
return (
<ThemeContext.Provider value={theme}>
{props.children}
</ThemeContext.Provider>
)
}
export function withTheme<
C extends React.ComponentType<React.ComponentProps<C>>
>(
Component: C
): React.ForwardRefExoticComponent<
DistributiveOmit<PropsOf<C>, 'theme'> & { theme?: Theme }
>
export function withTheme(
Component: React.ComponentType<any>
): React.ForwardRefExoticComponent<any> {
const componentName = Component.displayName || Component.name || 'Component'
let WithTheme = React.forwardRef(function render(props, ref) {
let theme = React.useContext(ThemeContext)
return <Component theme={theme} ref={ref} {...props} />
})
WithTheme.displayName = `WithTheme(${componentName})`
return hoistNonReactStatics(WithTheme, Component)
}

View File

@@ -0,0 +1,15 @@
import type { ParserOptions } from "./options.js";
import type { JSONSchema } from "./types/index.js";
import type $RefParser from "./index.js";
/**
* Crawls the JSON schema, finds all external JSON references, and resolves their values.
* This method does not mutate the JSON schema. The resolved values are added to {@link $RefParser#$refs}.
*
* NOTE: We only care about EXTERNAL references here. INTERNAL references are only relevant when dereferencing.
*
* @returns
* The promise resolves once all JSON references in the schema have been resolved,
* including nested references that are contained in externally-referenced files.
*/
declare function resolveExternal<S extends object = JSONSchema, O extends ParserOptions<S> = ParserOptions<S>>(parser: $RefParser<S, O>, options: O): Promise<void> | Promise<any[]>;
export default resolveExternal;

View File

@@ -0,0 +1,16 @@
/** Build a full URL from request options. */
function getRequestUrl(requestOptions) {
const protocol = requestOptions.protocol || '';
const hostname = requestOptions.hostname || requestOptions.host || '';
// Don't log standard :80 (http) and :443 (https) ports to reduce the noise
// Also don't add port if the hostname already includes a port
const port =
!requestOptions.port || requestOptions.port === 80 || requestOptions.port === 443 || /^(.*):(\d+)$/.test(hostname)
? ''
: `:${requestOptions.port}`;
const path = requestOptions.path ? requestOptions.path : '/';
return `${protocol}//${hostname}${port}${path}`;
}
export { getRequestUrl };
//# sourceMappingURL=getRequestUrl.js.map

View File

@@ -0,0 +1,22 @@
# Changelog
All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/)
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
## v1.0.0 - 2022-01-02
### Commits
- Tests [`e2f59ad`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/e2f59ad74e2ae0f5f4899fcde6a6f693ab7cc074)
- Initial commit [`dc222aa`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/dc222aad3c0b940d8d3af1ca9937d108bd2dc4b9)
- [meta] do not publish workflow files [`5ef77f7`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/5ef77f7cb6946d16ee38672be9ec0f1bbdf63262)
- npm init [`992b068`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/992b068503a461f7e8676f40ca2aab255fd8d6ff)
- read me [`6c9afa9`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/6c9afa9fabc8eaf0814aaed6dd01e6df0931b76d)
- Initial implementation [`2f98925`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/2f9892546396d4ab0ad9f1ff83e76c3f01234ae8)
- [meta] add `auto-changelog` [`6c476ae`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/6c476ae1ed7ce68b0480344f090ac2844f35509d)
- [Dev Deps] add `eslint`, `@ljharb/eslint-config` [`d0fffc8`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/d0fffc886d25fba119355520750a909d64da0087)
- Only apps should have lockfiles [`ab318ed`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/ab318ed7ae62f6c2c0e80a50398d40912afd8f69)
- [meta] add `safe-publish-latest` [`2bb23b3`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/2bb23b3ebab02dc4135c4cdf0217db82835b9fca)
- [meta] add `sideEffects` flag [`600223b`](https://github.com/inspect-js/node-supports-preserve-symlinks-flag/commit/600223ba24f30779f209d9097721eff35ed62741)

View File

@@ -0,0 +1,63 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx } from "react/jsx-runtime";
import React from 'react';
import { useIntersect } from '../../hooks/useIntersect.js';
export const RenderIfInViewport = t0 => {
const $ = _c(9);
const {
children,
className,
forceRender
} = t0;
const [hasRendered, setHasRendered] = React.useState(Boolean(forceRender));
let t1;
if ($[0] === Symbol.for("react.memo_cache_sentinel")) {
t1 = {
rootMargin: "1000px"
};
$[0] = t1;
} else {
t1 = $[0];
}
const [intersectionRef, entry] = useIntersect(t1, Boolean(forceRender));
const isIntersecting = Boolean(entry?.isIntersecting);
const isAboveViewport = entry?.boundingClientRect?.top < 0;
const shouldRender = forceRender || isIntersecting || isAboveViewport;
let t2;
let t3;
if ($[1] !== hasRendered || $[2] !== shouldRender) {
t2 = () => {
if (shouldRender && !hasRendered) {
setHasRendered(true);
}
};
t3 = [shouldRender, hasRendered];
$[1] = hasRendered;
$[2] = shouldRender;
$[3] = t2;
$[4] = t3;
} else {
t2 = $[3];
t3 = $[4];
}
React.useEffect(t2, t3);
const t4 = hasRendered ? children : null;
let t5;
if ($[5] !== className || $[6] !== intersectionRef || $[7] !== t4) {
t5 = _jsx("div", {
className,
ref: intersectionRef,
children: t4
});
$[5] = className;
$[6] = intersectionRef;
$[7] = t4;
$[8] = t5;
} else {
t5 = $[8];
}
return t5;
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,5 @@
import type { Maybe } from './Maybe';
import type { ReadOnlyObjMap, ReadOnlyObjMapLike } from './ObjMap';
export declare function toObjMap<T>(
obj: Maybe<ReadOnlyObjMapLike<T>>,
): ReadOnlyObjMap<T>;

View File

@@ -0,0 +1,10 @@
type IDocumentTitleContext = {
setDocumentTitle: (title: string) => void;
title: string;
};
export declare const useDocumentTitle: () => IDocumentTitleContext;
export declare const DocumentTitleProvider: React.FC<{
children: React.ReactNode;
}>;
export {};
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,116 @@
{
"name": "lru-cache",
"publishConfig": {
"tag": "legacy-v10"
},
"description": "A cache object that deletes the least-recently-used items.",
"version": "10.4.3",
"author": "Isaac Z. Schlueter <i@izs.me>",
"keywords": [
"mru",
"lru",
"cache"
],
"sideEffects": false,
"scripts": {
"build": "npm run prepare",
"prepare": "tshy && bash fixup.sh",
"pretest": "npm run prepare",
"presnap": "npm run prepare",
"test": "tap",
"snap": "tap",
"preversion": "npm test",
"postversion": "npm publish",
"prepublishOnly": "git push origin --follow-tags",
"format": "prettier --write .",
"typedoc": "typedoc --tsconfig ./.tshy/esm.json ./src/*.ts",
"benchmark-results-typedoc": "bash scripts/benchmark-results-typedoc.sh",
"prebenchmark": "npm run prepare",
"benchmark": "make -C benchmark",
"preprofile": "npm run prepare",
"profile": "make -C benchmark profile"
},
"main": "./dist/commonjs/index.js",
"types": "./dist/commonjs/index.d.ts",
"tshy": {
"exports": {
".": "./src/index.ts",
"./min": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.min.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.min.js"
}
}
}
},
"repository": {
"type": "git",
"url": "git://github.com/isaacs/node-lru-cache.git"
},
"devDependencies": {
"@types/node": "^20.2.5",
"@types/tap": "^15.0.6",
"benchmark": "^2.1.4",
"esbuild": "^0.17.11",
"eslint-config-prettier": "^8.5.0",
"marked": "^4.2.12",
"mkdirp": "^2.1.5",
"prettier": "^2.6.2",
"tap": "^20.0.3",
"tshy": "^2.0.0",
"tslib": "^2.4.0",
"typedoc": "^0.25.3",
"typescript": "^5.2.2"
},
"license": "ISC",
"files": [
"dist"
],
"prettier": {
"semi": false,
"printWidth": 70,
"tabWidth": 2,
"useTabs": false,
"singleQuote": true,
"jsxSingleQuote": false,
"bracketSameLine": true,
"arrowParens": "avoid",
"endOfLine": "lf"
},
"tap": {
"node-arg": [
"--expose-gc"
],
"plugin": [
"@tapjs/clock"
]
},
"exports": {
".": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.js"
}
},
"./min": {
"import": {
"types": "./dist/esm/index.d.ts",
"default": "./dist/esm/index.min.js"
},
"require": {
"types": "./dist/commonjs/index.d.ts",
"default": "./dist/commonjs/index.min.js"
}
}
},
"type": "module",
"module": "./dist/esm/index.js"
}

View File

@@ -0,0 +1,6 @@
export declare const GOOGLE_GENAI_INTEGRATION_NAME = "Google_GenAI";
export declare const GOOGLE_GENAI_INSTRUMENTED_METHODS: readonly ["models.generateContent", "models.generateContentStream", "chats.create", "sendMessage", "sendMessageStream"];
export declare const GOOGLE_GENAI_SYSTEM_NAME = "google_genai";
export declare const CHATS_CREATE_METHOD = "chats.create";
export declare const CHAT_PATH = "chat";
//# sourceMappingURL=constants.d.ts.map

View File

@@ -0,0 +1,135 @@
import type {AnySchema} from "../../types"
import type {SchemaObjCxt} from ".."
import {_, str, getProperty, Code, Name} from "../codegen"
import {escapeFragment, getErrorPath, Type} from "../util"
import type {JSONType} from "../rules"
export interface SubschemaContext {
// TODO use Optional? align with SchemCxt property types
schema: AnySchema
schemaPath: Code
errSchemaPath: string
topSchemaRef?: Code
errorPath?: Code
dataLevel?: number
dataTypes?: JSONType[]
data?: Name
parentData?: Name
parentDataProperty?: Code | number
dataNames?: Name[]
dataPathArr?: (Code | number)[]
propertyName?: Name
jtdDiscriminator?: string
jtdMetadata?: boolean
compositeRule?: true
createErrors?: boolean
allErrors?: boolean
}
export type SubschemaArgs = Partial<{
keyword: string
schemaProp: string | number
schema: AnySchema
schemaPath: Code
errSchemaPath: string
topSchemaRef: Code
data: Name | Code
dataProp: Code | string | number
dataTypes: JSONType[]
definedProperties: Set<string>
propertyName: Name
dataPropType: Type
jtdDiscriminator: string
jtdMetadata: boolean
compositeRule: true
createErrors: boolean
allErrors: boolean
}>
export function getSubschema(
it: SchemaObjCxt,
{keyword, schemaProp, schema, schemaPath, errSchemaPath, topSchemaRef}: SubschemaArgs
): SubschemaContext {
if (keyword !== undefined && schema !== undefined) {
throw new Error('both "keyword" and "schema" passed, only one allowed')
}
if (keyword !== undefined) {
const sch = it.schema[keyword]
return schemaProp === undefined
? {
schema: sch,
schemaPath: _`${it.schemaPath}${getProperty(keyword)}`,
errSchemaPath: `${it.errSchemaPath}/${keyword}`,
}
: {
schema: sch[schemaProp],
schemaPath: _`${it.schemaPath}${getProperty(keyword)}${getProperty(schemaProp)}`,
errSchemaPath: `${it.errSchemaPath}/${keyword}/${escapeFragment(schemaProp)}`,
}
}
if (schema !== undefined) {
if (schemaPath === undefined || errSchemaPath === undefined || topSchemaRef === undefined) {
throw new Error('"schemaPath", "errSchemaPath" and "topSchemaRef" are required with "schema"')
}
return {
schema,
schemaPath,
topSchemaRef,
errSchemaPath,
}
}
throw new Error('either "keyword" or "schema" must be passed')
}
export function extendSubschemaData(
subschema: SubschemaContext,
it: SchemaObjCxt,
{dataProp, dataPropType: dpType, data, dataTypes, propertyName}: SubschemaArgs
): void {
if (data !== undefined && dataProp !== undefined) {
throw new Error('both "data" and "dataProp" passed, only one allowed')
}
const {gen} = it
if (dataProp !== undefined) {
const {errorPath, dataPathArr, opts} = it
const nextData = gen.let("data", _`${it.data}${getProperty(dataProp)}`, true)
dataContextProps(nextData)
subschema.errorPath = str`${errorPath}${getErrorPath(dataProp, dpType, opts.jsPropertySyntax)}`
subschema.parentDataProperty = _`${dataProp}`
subschema.dataPathArr = [...dataPathArr, subschema.parentDataProperty]
}
if (data !== undefined) {
const nextData = data instanceof Name ? data : gen.let("data", data, true) // replaceable if used once?
dataContextProps(nextData)
if (propertyName !== undefined) subschema.propertyName = propertyName
// TODO something is possibly wrong here with not changing parentDataProperty and not appending dataPathArr
}
if (dataTypes) subschema.dataTypes = dataTypes
function dataContextProps(_nextData: Name): void {
subschema.data = _nextData
subschema.dataLevel = it.dataLevel + 1
subschema.dataTypes = []
it.definedProperties = new Set<string>()
subschema.parentData = it.data
subschema.dataNames = [...it.dataNames, _nextData]
}
}
export function extendSubschemaMode(
subschema: SubschemaContext,
{jtdDiscriminator, jtdMetadata, compositeRule, createErrors, allErrors}: SubschemaArgs
): void {
if (compositeRule !== undefined) subschema.compositeRule = compositeRule
if (createErrors !== undefined) subschema.createErrors = createErrors
if (allErrors !== undefined) subschema.allErrors = allErrors
subschema.jtdDiscriminator = jtdDiscriminator // not inherited
subschema.jtdMetadata = jtdMetadata // not inherited
}

View File

@@ -0,0 +1,54 @@
{
"name": "find-up",
"version": "5.0.0",
"description": "Find a file or directory by walking up parent directories",
"license": "MIT",
"repository": "sindresorhus/find-up",
"funding": "https://github.com/sponsors/sindresorhus",
"author": {
"name": "Sindre Sorhus",
"email": "sindresorhus@gmail.com",
"url": "https://sindresorhus.com"
},
"engines": {
"node": ">=10"
},
"scripts": {
"test": "xo && ava && tsd"
},
"files": [
"index.js",
"index.d.ts"
],
"keywords": [
"find",
"up",
"find-up",
"findup",
"look-up",
"look",
"file",
"search",
"match",
"package",
"resolve",
"parent",
"parents",
"folder",
"directory",
"walk",
"walking",
"path"
],
"dependencies": {
"locate-path": "^6.0.0",
"path-exists": "^4.0.0"
},
"devDependencies": {
"ava": "^2.1.0",
"is-path-inside": "^2.1.0",
"tempy": "^0.6.0",
"tsd": "^0.13.1",
"xo": "^0.33.0"
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"buildFormState.d.ts","sourceRoot":"","sources":["../../src/utilities/buildFormState.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,kBAAkB,EAClB,YAAY,EACZ,UAAU,EACV,WAAW,EACX,SAAS,EACT,cAAc,EACf,MAAM,SAAS,CAAA;AAchB,MAAM,MAAM,WAAW,GAAG;IACxB,QAAQ,EAAE,OAAO,CAAA;IACjB,YAAY,EAAE,MAAM,CAAA;IACpB,IAAI,CAAC,EAAE,UAAU,GAAG,MAAM,GAAG,MAAM,CAAA;CACpC,CAAA;AAED,KAAK,2BAA2B,GAAG;IACjC,YAAY,CAAC,EAAE,YAAY,CAAA;IAC3B,MAAM,CAAC,EAAE,KAAK,CAAA;IACd,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,WAAW,CAAC,EAAE,WAAW,CAAA;IACzB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,KAAK,EAAE,SAAS,CAAA;CACjB,CAAA;AAED,KAAK,yBAAyB,GAAG;IAC/B,cAAc,CAAC,EAAE,KAAK,CAAA;IACtB,WAAW,CAAC,EAAE,KAAK,CAAA;IACnB,UAAU,CAAC,EAAE,KAAK,CAAA;IAClB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,GAAG,CACA;IACE,OAAO,EAAE,MAAM,CAAA;CAChB,GACD,WAAW,CACd,CAAA;AAED,MAAM,MAAM,oBAAoB,GAAG,yBAAyB,GAAG,2BAA2B,CAAA;AAE1F,eAAO,MAAM,qBAAqB,EAAE,cAAc,CAChD,kBAAkB,EAClB,OAAO,CAAC,oBAAoB,CAAC,CAwB9B,CAAA;AAED,eAAO,MAAM,cAAc,SACnB,kBAAkB,KACvB,OAAO,CAAC,2BAA2B,CAoMrC,CAAA"}

View File

@@ -0,0 +1,18 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import { noopDetector } from '../../NoopDetector';
export const processDetector = noopDetector;
//# sourceMappingURL=ProcessDetector.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"message-circle-heart.js","sources":["../../../src/icons/message-circle-heart.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name MessageCircleHeart\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNy45IDIwQTkgOSAwIDEgMCA0IDE2LjFMMiAyMloiIC8+CiAgPHBhdGggZD0iTTE1LjggOS4yYTIuNSAyLjUgMCAwIDAtMy41IDBsLS4zLjQtLjM1LS4zYTIuNDIgMi40MiAwIDEgMC0zLjIgMy42bDMuNiAzLjUgMy42LTMuNWMxLjItMS4yIDEuMS0yLjcuMi0zLjciIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/message-circle-heart\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst MessageCircleHeart = createLucideIcon('MessageCircleHeart', [\n ['path', { d: 'M7.9 20A9 9 0 1 0 4 16.1L2 22Z', key: 'vv11sd' }],\n [\n 'path',\n {\n d: 'M15.8 9.2a2.5 2.5 0 0 0-3.5 0l-.3.4-.35-.3a2.42 2.42 0 1 0-3.2 3.6l3.6 3.5 3.6-3.5c1.2-1.2 1.1-2.7.2-3.7',\n key: '43lnbm',\n },\n ],\n]);\n\nexport default MessageCircleHeart;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqB,iBAAiB,oBAAsB,CAAA,CAAA,CAAA;AAAA,CAAA,CAChE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAkC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAC/D,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,10 @@
"use strict";
exports.endOfDecade = void 0;
var _index = require("../endOfDecade.js");
var _index2 = require("./_lib/convertToFP.js"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const endOfDecade = (exports.endOfDecade = (0, _index2.convertToFP)(
_index.endOfDecade,
1,
));

View File

@@ -0,0 +1,22 @@
"use strict";
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
var desc = Object.getOwnPropertyDescriptor(m, k);
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
desc = { enumerable: true, get: function() { return m[k]; } };
}
Object.defineProperty(o, k2, desc);
}) : (function(o, m, k, k2) {
if (k2 === undefined) k2 = k;
o[k2] = m[k];
}));
var __exportStar = (this && this.__exportStar) || function(m, exports) {
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
};
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const index_js_1 = __importDefault(require("./classic/index.cjs"));
__exportStar(require("./classic/index.cjs"), exports);
exports.default = index_js_1.default;

View File

@@ -0,0 +1,8 @@
"use strict";
exports.lastDayOfISOWeekWithOptions = void 0;
var _index = require("../lastDayOfISOWeek.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const lastDayOfISOWeekWithOptions = (exports.lastDayOfISOWeekWithOptions = (0,
_index2.convertToFP)(_index.lastDayOfISOWeek, 2));

View File

@@ -0,0 +1,31 @@
import { expect, test } from "vitest";
import * as z from "zod/v4";
const beforeBenchmarkDate = new Date(2022, 10, 4);
const benchmarkDate = new Date(2022, 10, 5);
const afterBenchmarkDate = new Date(2022, 10, 6);
const minCheck = z.date().min(benchmarkDate);
const maxCheck = z.date().max(benchmarkDate);
test("passing validations", () => {
minCheck.parse(benchmarkDate);
minCheck.parse(afterBenchmarkDate);
maxCheck.parse(benchmarkDate);
maxCheck.parse(beforeBenchmarkDate);
});
test("failing validations", () => {
expect(() => minCheck.parse(beforeBenchmarkDate)).toThrow();
expect(() => maxCheck.parse(afterBenchmarkDate)).toThrow();
});
test("min max getters", () => {
expect(minCheck.minDate).toEqual(benchmarkDate);
expect(minCheck.min(afterBenchmarkDate).minDate).toEqual(afterBenchmarkDate);
expect(maxCheck.maxDate).toEqual(benchmarkDate);
expect(maxCheck.max(beforeBenchmarkDate).maxDate).toEqual(beforeBenchmarkDate);
});

View File

@@ -0,0 +1 @@
{"version":3,"file":"updateOne.d.ts","sourceRoot":"","sources":["../src/updateOne.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,SAAS,CAAA;AAWxC,eAAO,MAAM,SAAS,EAAE,SAqFvB,CAAA"}

View File

@@ -0,0 +1,715 @@
/**
* KeyLike are runtime-specific classes representing asymmetric keys or symmetric secrets. These are
* instances of {@link !CryptoKey} and additionally {@link !KeyObject} in Node.js runtime.
* {@link !Uint8Array} instances are also accepted as symmetric secret representation only.
*
* {@link key/import Key Import Functions} can be used to import PEM, or JWK formatted asymmetric
* keys and certificates to these runtime-specific representations.
*
* In Node.js the {@link !Buffer} class is a subclass of {@link !Uint8Array} and so {@link !Buffer} can
* be provided for symmetric secrets as well.
*
* {@link !KeyObject} is a representation of a key/secret available in the Node.js runtime. In
* addition to the {@link key/import Key Import Functions} you may use the runtime APIs
* {@link !createPublicKey}, {@link !createPrivateKey}, and {@link !createSecretKey} to obtain a
* {@link !KeyObject} from your existing key material.
*
* {@link !CryptoKey} is a representation of a key/secret available in the Browser and
* Web-interoperable runtimes. In addition to the {@link key/import Key Import Functions} you may use
* the {@link !SubtleCrypto.importKey} API to obtain a {@link !CryptoKey} from your existing key
* material.
*
*/
export type KeyLike = { type: string }
/** Generic JSON Web Key Parameters. */
export interface JWKParameters {
/** JWK "kty" (Key Type) Parameter */
kty: string
/**
* JWK "alg" (Algorithm) Parameter
*
* @see {@link https://github.com/panva/jose/issues/210 Algorithm Key Requirements}
*/
alg?: string
/** JWK "key_ops" (Key Operations) Parameter */
key_ops?: string[]
/** JWK "ext" (Extractable) Parameter */
ext?: boolean
/** JWK "use" (Public Key Use) Parameter */
use?: string
/** JWK "x5c" (X.509 Certificate Chain) Parameter */
x5c?: string[]
/** JWK "x5t" (X.509 Certificate SHA-1 Thumbprint) Parameter */
x5t?: string
/** JWK "x5t#S256" (X.509 Certificate SHA-256 Thumbprint) Parameter */
'x5t#S256'?: string
/** JWK "x5u" (X.509 URL) Parameter */
x5u?: string
/** JWK "kid" (Key ID) Parameter */
kid?: string
}
/** Convenience interface for Public OKP JSON Web Keys */
export interface JWK_OKP_Public extends JWKParameters {
/** OKP JWK "crv" (The Subtype of Key Pair) Parameter */
crv: string
/** OKP JWK "x" (The public key) Parameter */
x: string
}
/** Convenience interface for Private OKP JSON Web Keys */
export interface JWK_OKP_Private extends JWK_OKP_Public, JWKParameters {
/** OKP JWK "d" (The Private Key) Parameter */
d: string
}
/** Convenience interface for Public EC JSON Web Keys */
export interface JWK_EC_Public extends JWKParameters {
/** EC JWK "crv" (Curve) Parameter */
crv: string
/** EC JWK "x" (X Coordinate) Parameter */
x: string
/** EC JWK "y" (Y Coordinate) Parameter */
y: string
}
/** Convenience interface for Private EC JSON Web Keys */
export interface JWK_EC_Private extends JWK_EC_Public, JWKParameters {
/** EC JWK "d" (ECC Private Key) Parameter */
d: string
}
/** Convenience interface for Public RSA JSON Web Keys */
export interface JWK_RSA_Public extends JWKParameters {
/** RSA JWK "e" (Exponent) Parameter */
e: string
/** RSA JWK "n" (Modulus) Parameter */
n: string
}
/** Convenience interface for Private RSA JSON Web Keys */
export interface JWK_RSA_Private extends JWK_RSA_Public, JWKParameters {
/** RSA JWK "d" (Private Exponent) Parameter */
d: string
/** RSA JWK "dp" (First Factor CRT Exponent) Parameter */
dp: string
/** RSA JWK "dq" (Second Factor CRT Exponent) Parameter */
dq: string
/**
* RSA JWK "oth" (Other Primes Info) Parameter
*
* This parameter is not supported
*/
oth?: Array<{
d?: string
r?: string
t?: string
}>
/** RSA JWK "p" (First Prime Factor) Parameter */
p: string
/** RSA JWK "q" (Second Prime Factor) Parameter */
q: string
/** RSA JWK "qi" (First CRT Coefficient) Parameter */
qi: string
}
/** Convenience interface for oct JSON Web Keys */
export interface JWK_oct extends JWKParameters {
/** Oct JWK "k" (Key Value) Parameter */
k: string
}
/**
* JSON Web Key ({@link https://www.rfc-editor.org/rfc/rfc7517 JWK}). "RSA", "EC", "OKP", and "oct"
* key types are supported.
*
* @see {@link JWK_OKP_Public}
* @see {@link JWK_OKP_Private}
* @see {@link JWK_EC_Public}
* @see {@link JWK_EC_Private}
* @see {@link JWK_RSA_Public}
* @see {@link JWK_RSA_Private}
* @see {@link JWK_oct}
*/
export interface JWK extends JWKParameters {
/**
* - EC JWK "crv" (Curve) Parameter
* - OKP JWK "crv" (The Subtype of Key Pair) Parameter
*/
crv?: string
/**
* - Private RSA JWK "d" (Private Exponent) Parameter
* - Private EC JWK "d" (ECC Private Key) Parameter
* - Private OKP JWK "d" (The Private Key) Parameter
*/
d?: string
/** Private RSA JWK "dp" (First Factor CRT Exponent) Parameter */
dp?: string
/** Private RSA JWK "dq" (Second Factor CRT Exponent) Parameter */
dq?: string
/** RSA JWK "e" (Exponent) Parameter */
e?: string
/** Oct JWK "k" (Key Value) Parameter */
k?: string
/** RSA JWK "n" (Modulus) Parameter */
n?: string
/**
* Private RSA JWK "oth" (Other Primes Info) Parameter
*
* This parameter is not supported
*/
oth?: Array<{
d?: string
r?: string
t?: string
}>
/** Private RSA JWK "p" (First Prime Factor) Parameter */
p?: string
/** Private RSA JWK "q" (Second Prime Factor) Parameter */
q?: string
/** Private RSA JWK "qi" (First CRT Coefficient) Parameter */
qi?: string
/**
* - EC JWK "x" (X Coordinate) Parameter
* - OKP JWK "x" (The public key) Parameter
*/
x?: string
/** EC JWK "y" (Y Coordinate) Parameter */
y?: string
}
/**
* @private
*
* @internal
*/
export interface GenericGetKeyFunction<IProtectedHeader, IToken, ReturnKeyTypes> {
/**
* Dynamic key resolution function. No token components have been verified at the time of this
* function call.
*
* If you cannot match a key suitable for the token, throw an error instead.
*
* @param protectedHeader JWE or JWS Protected Header.
* @param token The consumed JWE or JWS token.
*/
(protectedHeader: IProtectedHeader, token: IToken): Promise<ReturnKeyTypes> | ReturnKeyTypes
}
/**
* Generic Interface for consuming operations dynamic key resolution.
*
* @param IProtectedHeader Type definition of the JWE or JWS Protected Header.
* @param IToken Type definition of the consumed JWE or JWS token.
*/
export interface GetKeyFunction<IProtectedHeader, IToken>
extends GenericGetKeyFunction<IProtectedHeader, IToken, KeyLike | Uint8Array> {}
/**
* Flattened JWS definition for verify function inputs, allows payload as {@link !Uint8Array} for
* detached signature validation.
*/
export interface FlattenedJWSInput {
/**
* The "header" member MUST be present and contain the value JWS Unprotected Header when the JWS
* Unprotected Header value is non- empty; otherwise, it MUST be absent. This value is represented
* as an unencoded JSON object, rather than as a string. These Header Parameter values are not
* integrity protected.
*/
header?: JWSHeaderParameters
/**
* The "payload" member MUST be present and contain the value BASE64URL(JWS Payload). When RFC7797
* "b64": false is used the value passed may also be a {@link !Uint8Array}.
*/
payload: string | Uint8Array
/**
* The "protected" member MUST be present and contain the value BASE64URL(UTF8(JWS Protected
* Header)) when the JWS Protected Header value is non-empty; otherwise, it MUST be absent. These
* Header Parameter values are integrity protected.
*/
protected?: string
/** The "signature" member MUST be present and contain the value BASE64URL(JWS Signature). */
signature: string
}
/**
* General JWS definition for verify function inputs, allows payload as {@link !Uint8Array} for
* detached signature validation.
*/
export interface GeneralJWSInput {
/**
* The "payload" member MUST be present and contain the value BASE64URL(JWS Payload). When when
* JWS Unencoded Payload ({@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}) "b64": false is
* used the value passed may also be a {@link !Uint8Array}.
*/
payload: string | Uint8Array
/**
* The "signatures" member value MUST be an array of JSON objects. Each object represents a
* signature or MAC over the JWS Payload and the JWS Protected Header.
*/
signatures: Omit<FlattenedJWSInput, 'payload'>[]
}
/**
* Flattened JWS definition. Payload is returned as an empty string when JWS Unencoded Payload
* ({@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}) is used.
*/
export interface FlattenedJWS extends Partial<FlattenedJWSInput> {
payload: string
signature: string
}
/**
* General JWS definition. Payload is returned as an empty string when JWS Unencoded Payload
* ({@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}) is used.
*/
export interface GeneralJWS {
payload: string
signatures: Omit<FlattenedJWSInput, 'payload'>[]
}
export interface JoseHeaderParameters {
/** "kid" (Key ID) Header Parameter */
kid?: string
/** "x5t" (X.509 Certificate SHA-1 Thumbprint) Header Parameter */
x5t?: string
/** "x5c" (X.509 Certificate Chain) Header Parameter */
x5c?: string[]
/** "x5u" (X.509 URL) Header Parameter */
x5u?: string
/** "jku" (JWK Set URL) Header Parameter */
jku?: string
/** "jwk" (JSON Web Key) Header Parameter */
jwk?: Pick<JWK, 'kty' | 'crv' | 'x' | 'y' | 'e' | 'n'>
/** "typ" (Type) Header Parameter */
typ?: string
/** "cty" (Content Type) Header Parameter */
cty?: string
}
/** Recognized JWS Header Parameters, any other Header Members may also be present. */
export interface JWSHeaderParameters extends JoseHeaderParameters {
/**
* JWS "alg" (Algorithm) Header Parameter
*
* @see {@link https://github.com/panva/jose/issues/210#jws-alg Algorithm Key Requirements}
*/
alg?: string
/**
* This JWS Extension Header Parameter modifies the JWS Payload representation and the JWS Signing
* Input computation as per {@link https://www.rfc-editor.org/rfc/rfc7797 RFC7797}.
*/
b64?: boolean
/** JWS "crit" (Critical) Header Parameter */
crit?: string[]
/** Any other JWS Header member. */
[propName: string]: unknown
}
/** Recognized JWE Key Management-related Header Parameters. */
export interface JWEKeyManagementHeaderParameters {
apu?: Uint8Array
apv?: Uint8Array
/**
* @deprecated You should not use this parameter. It is only really intended for test and vector
* validation purposes.
*/
p2c?: number
/**
* @deprecated You should not use this parameter. It is only really intended for test and vector
* validation purposes.
*/
p2s?: Uint8Array
/**
* @deprecated You should not use this parameter. It is only really intended for test and vector
* validation purposes.
*/
iv?: Uint8Array
/**
* @deprecated You should not use this parameter. It is only really intended for test and vector
* validation purposes.
*/
epk?: KeyLike
}
/** Flattened JWE definition. */
export interface FlattenedJWE {
/**
* The "aad" member MUST be present and contain the value BASE64URL(JWE AAD)) when the JWE AAD
* value is non-empty; otherwise, it MUST be absent. A JWE AAD value can be included to supply a
* base64url-encoded value to be integrity protected but not encrypted.
*/
aad?: string
/** The "ciphertext" member MUST be present and contain the value BASE64URL(JWE Ciphertext). */
ciphertext: string
/**
* The "encrypted_key" member MUST be present and contain the value BASE64URL(JWE Encrypted Key)
* when the JWE Encrypted Key value is non-empty; otherwise, it MUST be absent.
*/
encrypted_key?: string
/**
* The "header" member MUST be present and contain the value JWE Per- Recipient Unprotected Header
* when the JWE Per-Recipient Unprotected Header value is non-empty; otherwise, it MUST be absent.
* This value is represented as an unencoded JSON object, rather than as a string. These Header
* Parameter values are not integrity protected.
*/
header?: JWEHeaderParameters
/**
* The "iv" member MUST be present and contain the value BASE64URL(JWE Initialization Vector) when
* the JWE Initialization Vector value is non-empty; otherwise, it MUST be absent.
*/
iv?: string
/**
* The "protected" member MUST be present and contain the value BASE64URL(UTF8(JWE Protected
* Header)) when the JWE Protected Header value is non-empty; otherwise, it MUST be absent. These
* Header Parameter values are integrity protected.
*/
protected?: string
/**
* The "tag" member MUST be present and contain the value BASE64URL(JWE Authentication Tag) when
* the JWE Authentication Tag value is non-empty; otherwise, it MUST be absent.
*/
tag?: string
/**
* The "unprotected" member MUST be present and contain the value JWE Shared Unprotected Header
* when the JWE Shared Unprotected Header value is non-empty; otherwise, it MUST be absent. This
* value is represented as an unencoded JSON object, rather than as a string. These Header
* Parameter values are not integrity protected.
*/
unprotected?: JWEHeaderParameters
}
export interface GeneralJWE extends Omit<FlattenedJWE, 'encrypted_key' | 'header'> {
recipients: Pick<FlattenedJWE, 'encrypted_key' | 'header'>[]
}
/** Recognized JWE Header Parameters, any other Header members may also be present. */
export interface JWEHeaderParameters extends JoseHeaderParameters {
/**
* JWE "alg" (Algorithm) Header Parameter
*
* @see {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}
*/
alg?: string
/**
* JWE "enc" (Encryption Algorithm) Header Parameter
*
* @see {@link https://github.com/panva/jose/issues/210#jwe-alg Algorithm Key Requirements}
*/
enc?: string
/** JWE "crit" (Critical) Header Parameter */
crit?: string[]
/**
* JWE "zip" (Compression Algorithm) Header Parameter. This parameter is not supported anymore.
*
* @deprecated Compression of data SHOULD NOT be done before encryption, because such compressed
* data often reveals information about the plaintext.
*
* @see {@link https://www.rfc-editor.org/rfc/rfc8725#name-avoid-compression-of-encryp Avoid Compression of Encryption Inputs}
*/
zip?: string
/** Any other JWE Header member. */
[propName: string]: unknown
}
/** Shared Interface with a "crit" property for all sign, verify, encrypt and decrypt operations. */
export interface CritOption {
/**
* An object with keys representing recognized "crit" (Critical) Header Parameter names. The value
* for those is either `true` or `false`. `true` when the Header Parameter MUST be integrity
* protected, `false` when it's irrelevant.
*
* This makes the "Extension Header Parameter "..." is not recognized" error go away.
*
* Use this when a given JWS/JWT/JWE profile requires the use of proprietary non-registered "crit"
* (Critical) Header Parameters. This will only make sure the Header Parameter is syntactically
* correct when provided and that it is optionally integrity protected. It will not process the
* Header Parameter in any way or reject the operation if it is missing. You MUST still verify the
* Header Parameter was present and process it according to the profile's validation steps after
* the operation succeeds.
*
* The JWS extension Header Parameter `b64` is always recognized and processed properly. No other
* registered Header Parameters that need this kind of default built-in treatment are currently
* available.
*/
crit?: {
[propName: string]: boolean
}
}
/** JWE Decryption options. */
export interface DecryptOptions extends CritOption {
/**
* A list of accepted JWE "alg" (Algorithm) Header Parameter values. By default all "alg"
* (Algorithm) Header Parameter values applicable for the used key/secret are allowed except for
* all PBES2 Key Management Algorithms, these need to be explicitly allowed using this option.
*/
keyManagementAlgorithms?: string[]
/**
* A list of accepted JWE "enc" (Encryption Algorithm) Header Parameter values. By default all
* "enc" (Encryption Algorithm) values applicable for the used key/secret are allowed.
*/
contentEncryptionAlgorithms?: string[]
/**
* (PBES2 Key Management Algorithms only) Maximum allowed "p2c" (PBES2 Count) Header Parameter
* value. The PBKDF2 iteration count defines the algorithm's computational expense. By default
* this value is set to 10000.
*/
maxPBES2Count?: number
}
/** JWE Encryption options. */
export interface EncryptOptions extends CritOption {}
/** JWT Claims Set verification options. */
export interface JWTClaimVerificationOptions {
/**
* Expected JWT "aud" (Audience) Claim value(s).
*
* This option makes the JWT "aud" (Audience) Claim presence required.
*/
audience?: string | string[]
/**
* Expected clock tolerance
*
* - In seconds when number (e.g. 5)
* - Parsed as seconds when a string (e.g. "5 seconds", "10 minutes", "2 hours").
*/
clockTolerance?: string | number
/**
* Expected JWT "iss" (Issuer) Claim value(s).
*
* This option makes the JWT "iss" (Issuer) Claim presence required.
*/
issuer?: string | string[]
/**
* Maximum time elapsed (in seconds) from the JWT "iat" (Issued At) Claim value.
*
* - In seconds when number (e.g. 5)
* - Parsed as seconds when a string (e.g. "5 seconds", "10 minutes", "2 hours").
*
* This option makes the JWT "iat" (Issued At) Claim presence required.
*/
maxTokenAge?: string | number
/**
* Expected JWT "sub" (Subject) Claim value.
*
* This option makes the JWT "sub" (Subject) Claim presence required.
*/
subject?: string
/**
* Expected JWT "typ" (Type) Header Parameter value.
*
* This option makes the JWT "typ" (Type) Header Parameter presence required.
*/
typ?: string
/** Date to use when comparing NumericDate claims, defaults to `new Date()`. */
currentDate?: Date
/**
* Array of required Claim Names that must be present in the JWT Claims Set. Default is that: if
* the {@link JWTClaimVerificationOptions.issuer `issuer` option} is set, then JWT "iss" (Issuer)
* Claim must be present; if the {@link JWTClaimVerificationOptions.audience `audience` option} is
* set, then JWT "aud" (Audience) Claim must be present; if the
* {@link JWTClaimVerificationOptions.subject `subject` option} is set, then JWT "sub" (Subject)
* Claim must be present; if the
* {@link JWTClaimVerificationOptions.maxTokenAge `maxTokenAge` option} is set, then JWT "iat"
* (Issued At) Claim must be present.
*/
requiredClaims?: string[]
}
/** JWS Verification options. */
export interface VerifyOptions extends CritOption {
/**
* A list of accepted JWS "alg" (Algorithm) Header Parameter values. By default all "alg"
* (Algorithm) values applicable for the used key/secret are allowed.
*
* Note: Unsecured JWTs (`{ "alg": "none" }`) are never accepted by this API.
*/
algorithms?: string[]
}
/** JWS Signing options. */
export interface SignOptions extends CritOption {}
/** Recognized JWT Claims Set members, any other members may also be present. */
export interface JWTPayload {
/**
* JWT Issuer
*
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.1 RFC7519#section-4.1.1}
*/
iss?: string
/**
* JWT Subject
*
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.2 RFC7519#section-4.1.2}
*/
sub?: string
/**
* JWT Audience
*
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.3 RFC7519#section-4.1.3}
*/
aud?: string | string[]
/**
* JWT ID
*
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.7 RFC7519#section-4.1.7}
*/
jti?: string
/**
* JWT Not Before
*
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.5 RFC7519#section-4.1.5}
*/
nbf?: number
/**
* JWT Expiration Time
*
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.4 RFC7519#section-4.1.4}
*/
exp?: number
/**
* JWT Issued At
*
* @see {@link https://www.rfc-editor.org/rfc/rfc7519#section-4.1.6 RFC7519#section-4.1.6}
*/
iat?: number
/** Any other JWT Claim Set member. */
[propName: string]: unknown
}
export interface FlattenedDecryptResult {
/** JWE AAD. */
additionalAuthenticatedData?: Uint8Array
/** Plaintext. */
plaintext: Uint8Array
/** JWE Protected Header. */
protectedHeader?: JWEHeaderParameters
/** JWE Shared Unprotected Header. */
sharedUnprotectedHeader?: JWEHeaderParameters
/** JWE Per-Recipient Unprotected Header. */
unprotectedHeader?: JWEHeaderParameters
}
export interface GeneralDecryptResult extends FlattenedDecryptResult {}
export interface CompactDecryptResult {
/** Plaintext. */
plaintext: Uint8Array
/** JWE Protected Header. */
protectedHeader: CompactJWEHeaderParameters
}
export interface FlattenedVerifyResult {
/** JWS Payload. */
payload: Uint8Array
/** JWS Protected Header. */
protectedHeader?: JWSHeaderParameters
/** JWS Unprotected Header. */
unprotectedHeader?: JWSHeaderParameters
}
export interface GeneralVerifyResult extends FlattenedVerifyResult {}
export interface CompactVerifyResult {
/** JWS Payload. */
payload: Uint8Array
/** JWS Protected Header. */
protectedHeader: CompactJWSHeaderParameters
}
export interface JWTVerifyResult<PayloadType = JWTPayload> {
/** JWT Claims Set. */
payload: PayloadType & JWTPayload
/** JWS Protected Header. */
protectedHeader: JWTHeaderParameters
}
export interface JWTDecryptResult<PayloadType = JWTPayload> {
/** JWT Claims Set. */
payload: PayloadType & JWTPayload
/** JWE Protected Header. */
protectedHeader: CompactJWEHeaderParameters
}
export interface ResolvedKey<KeyLikeType extends KeyLike = KeyLike> {
/** Key resolved from the key resolver function. */
key: KeyLikeType | Uint8Array
}
/** Recognized Compact JWS Header Parameters, any other Header Members may also be present. */
export interface CompactJWSHeaderParameters extends JWSHeaderParameters {
alg: string
}
/** Recognized Signed JWT Header Parameters, any other Header Members may also be present. */
export interface JWTHeaderParameters extends CompactJWSHeaderParameters {
b64?: true
}
/** Recognized Compact JWE Header Parameters, any other Header Members may also be present. */
export interface CompactJWEHeaderParameters extends JWEHeaderParameters {
alg: string
enc: string
}
/** JSON Web Key Set */
export interface JSONWebKeySet {
keys: JWK[]
}
export type CryptoRuntime = 'WebCryptoAPI' | 'node:crypto'

View File

@@ -0,0 +1 @@
{"version":3,"file":"streaming.d.ts","sourceRoot":"","sources":["../../../../src/tracing/openai/streaming.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,wBAAwB,CAAC;AA8MnD;;;;;;;;;GASG;AACH,wBAAuB,gBAAgB,CAAC,CAAC,EACvC,MAAM,EAAE,aAAa,CAAC,CAAC,CAAC,EACxB,IAAI,EAAE,IAAI,EACV,aAAa,EAAE,OAAO,GACrB,cAAc,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,CAAC,CAwDlC"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"types.js","names":[],"sources":["../../../src/elements/DatePicker/types.ts"],"sourcesContent":["import type { DayPickerProps, SharedProps, TimePickerProps } from 'payload'\n\nexport type Props = {\n id?: string\n onChange?: (val: Date) => void\n placeholder?: string\n readOnly?: boolean\n value?: Date | string\n} & DayPickerProps &\n SharedProps &\n TimePickerProps\n"],"mappings":"AAEA","ignoreList":[]}

View File

@@ -0,0 +1,236 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const util = require("util");
/** @typedef {import("../../declarations/WebpackOptions").Falsy} Falsy */
/** @typedef {import("../../declarations/WebpackOptions").RuleSetLoader} RuleSetLoader */
/** @typedef {import("../../declarations/WebpackOptions").RuleSetLoaderOptions} RuleSetLoaderOptions */
/** @typedef {import("../../declarations/WebpackOptions").RuleSetRule} RuleSetRule */
/** @typedef {import("../../declarations/WebpackOptions").RuleSetUse} RuleSetUse */
/** @typedef {import("../../declarations/WebpackOptions").RuleSetUseItem} RuleSetUseItem */
/** @typedef {import("./RuleSetCompiler")} RuleSetCompiler */
/** @typedef {import("./RuleSetCompiler").Effect} Effect */
/** @typedef {import("./RuleSetCompiler").EffectData} EffectData */
/** @typedef {import("./RuleSetCompiler").EffectUseType} EffectUseType */
const PLUGIN_NAME = "UseEffectRulePlugin";
class UseEffectRulePlugin {
/**
* @param {RuleSetCompiler} ruleSetCompiler the rule set compiler
* @returns {void}
*/
apply(ruleSetCompiler) {
ruleSetCompiler.hooks.rule.tap(
PLUGIN_NAME,
(path, rule, unhandledProperties, result, references) => {
/**
* @param {keyof RuleSetRule} property property
* @param {string} correctProperty correct property
*/
const conflictWith = (property, correctProperty) => {
if (unhandledProperties.has(property)) {
throw ruleSetCompiler.error(
`${path}.${property}`,
rule[property],
`A Rule must not have a '${property}' property when it has a '${correctProperty}' property`
);
}
};
if (unhandledProperties.has("use")) {
unhandledProperties.delete("use");
unhandledProperties.delete("enforce");
conflictWith("loader", "use");
conflictWith("options", "use");
const use = /** @type {RuleSetUse} */ (rule.use);
const enforce = rule.enforce;
const type =
/** @type {EffectUseType} */
(enforce ? `use-${enforce}` : "use");
/**
* @param {string} path options path
* @param {string} defaultIdent default ident when none is provided
* @param {RuleSetUseItem} item user provided use value
* @returns {(Effect | ((effectData: EffectData) => Effect[]))} effect
*/
const useToEffect = (path, defaultIdent, item) => {
if (typeof item === "function") {
return (data) =>
useToEffectsWithoutIdent(
path,
/** @type {RuleSetUseItem | RuleSetUseItem[]} */
(item(data))
);
}
return useToEffectRaw(path, defaultIdent, item);
};
/**
* @param {string} path options path
* @param {string} defaultIdent default ident when none is provided
* @param {Exclude<NonNullable<RuleSetUseItem>, EXPECTED_FUNCTION>} item user provided use value
* @returns {Effect} effect
*/
const useToEffectRaw = (path, defaultIdent, item) => {
if (typeof item === "string") {
return {
type,
value: {
loader: item,
options: undefined,
ident: undefined
}
};
}
const loader = /** @type {string} */ (item.loader);
const options = item.options;
let ident = item.ident;
if (options && typeof options === "object") {
if (!ident) ident = defaultIdent;
references.set(ident, options);
}
if (typeof options === "string") {
util.deprecate(
() => {},
`Using a string as loader options is deprecated (${path}.options)`,
"DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING"
)();
}
return {
type: enforce ? `use-${enforce}` : "use",
value: {
loader,
options,
ident
}
};
};
/**
* @param {string} path options path
* @param {RuleSetUseItem | (Falsy | RuleSetUseItem)[]} items user provided use value
* @returns {Effect[]} effects
*/
const useToEffectsWithoutIdent = (path, items) => {
if (Array.isArray(items)) {
return items.filter(Boolean).map((item, idx) =>
useToEffectRaw(
`${path}[${idx}]`,
"[[missing ident]]",
/** @type {Exclude<RuleSetUseItem, EXPECTED_FUNCTION>} */
(item)
)
);
}
return [
useToEffectRaw(
path,
"[[missing ident]]",
/** @type {Exclude<RuleSetUseItem, EXPECTED_FUNCTION>} */
(items)
)
];
};
/**
* @param {string} path current path
* @param {RuleSetUse} items user provided use value
* @returns {(Effect | ((effectData: EffectData) => Effect[]))[]} effects
*/
const useToEffects = (path, items) => {
if (Array.isArray(items)) {
return items.filter(Boolean).map((item, idx) => {
const subPath = `${path}[${idx}]`;
return useToEffect(
subPath,
subPath,
/** @type {RuleSetUseItem} */
(item)
);
});
}
return [
useToEffect(path, path, /** @type {RuleSetUseItem} */ (items))
];
};
if (typeof use === "function") {
result.effects.push((data) =>
useToEffectsWithoutIdent(`${path}.use`, use(data))
);
} else {
for (const effect of useToEffects(`${path}.use`, use)) {
result.effects.push(effect);
}
}
}
if (unhandledProperties.has("loader")) {
unhandledProperties.delete("loader");
unhandledProperties.delete("options");
unhandledProperties.delete("enforce");
const loader = /** @type {RuleSetLoader} */ (rule.loader);
const options = rule.options;
const enforce = rule.enforce;
if (loader.includes("!")) {
throw ruleSetCompiler.error(
`${path}.loader`,
loader,
"Exclamation mark separated loader lists has been removed in favor of the 'use' property with arrays"
);
}
if (loader.includes("?")) {
throw ruleSetCompiler.error(
`${path}.loader`,
loader,
"Query arguments on 'loader' has been removed in favor of the 'options' property"
);
}
if (typeof options === "string") {
util.deprecate(
() => {},
`Using a string as loader options is deprecated (${path}.options)`,
"DEP_WEBPACK_RULE_LOADER_OPTIONS_STRING"
)();
}
const ident =
options && typeof options === "object" ? path : undefined;
if (ident) {
references.set(
ident,
/** @type {RuleSetLoaderOptions} */
(options)
);
}
result.effects.push({
type: enforce ? `use-${enforce}` : "use",
value: {
loader,
options,
ident
}
});
}
}
);
}
}
module.exports = UseEffectRulePlugin;

View File

@@ -0,0 +1,6 @@
reporters:
- '@jsumners/line-reporter'
files:
- 'lib/**/*.test.js'
- 'test/**/*.test.js'

View File

@@ -0,0 +1 @@
Prism.languages.jsonp=Prism.languages.extend("json",{punctuation:/[{}[\]();,.]/}),Prism.languages.insertBefore("jsonp","punctuation",{function:/(?!\s)[_$a-zA-Z\xA0-\uFFFF](?:(?!\s)[$\w\xA0-\uFFFF])*(?=\s*\()/});

View File

@@ -0,0 +1,77 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.extendError = void 0;
const isomorphic_node_1 = require("./isomorphic.node");
const stack_1 = require("./stack");
const to_json_1 = require("./to-json");
const protectedProps = ["name", "message", "stack"];
/**
* Extends the new error with the properties of the original error and the `props` object.
*
* @param newError - The error object to extend
* @param originalError - The original error object, if any
* @param props - Additional properties to add, if any
*/
function extendError(error, originalError, props) {
let onoError = error;
extendStack(onoError, originalError);
// Copy properties from the original error
if (originalError && typeof originalError === "object") {
mergeErrors(onoError, originalError);
}
// The default `toJSON` method doesn't output props like `name`, `message`, `stack`, etc.
// So replace it with one that outputs every property of the error.
onoError.toJSON = to_json_1.toJSON;
// On Node.js, add support for the `util.inspect()` method
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
if (isomorphic_node_1.addInspectMethod) {
isomorphic_node_1.addInspectMethod(onoError);
}
// Finally, copy custom properties that were specified by the user.
// These props OVERWRITE any previous props
if (props && typeof props === "object") {
Object.assign(onoError, props);
}
return onoError;
}
exports.extendError = extendError;
/**
* Extend the error stack to include its cause
*/
function extendStack(newError, originalError) {
let stackProp = Object.getOwnPropertyDescriptor(newError, "stack");
if (stack_1.isLazyStack(stackProp)) {
stack_1.lazyJoinStacks(stackProp, newError, originalError);
}
else if (stack_1.isWritableStack(stackProp)) {
newError.stack = stack_1.joinStacks(newError, originalError);
}
}
/**
* Merges properties of the original error with the new error.
*
* @param newError - The error object to extend
* @param originalError - The original error object, if any
*/
function mergeErrors(newError, originalError) {
// Get the original error's keys
// NOTE: We specifically exclude properties that we have already set on the new error.
// This is _especially_ important for the `stack` property, because this property has
// a lazy getter in some environments
let keys = to_json_1.getDeepKeys(originalError, protectedProps);
// HACK: We have to cast the errors to `any` so we can use symbol indexers.
// see https://github.com/Microsoft/TypeScript/issues/1863
let _newError = newError;
let _originalError = originalError;
for (let key of keys) {
if (_newError[key] === undefined) {
try {
_newError[key] = _originalError[key];
}
catch (e) {
// This property is read-only, so it can't be copied
}
}
}
}
//# sourceMappingURL=extend-error.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"arrow-right-left.js","sources":["../../../src/icons/arrow-right-left.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ArrowRightLeft\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMTYgMyA0IDQtNCA0IiAvPgogIDxwYXRoIGQ9Ik0yMCA3SDQiIC8+CiAgPHBhdGggZD0ibTggMjEtNC00IDQtNCIgLz4KICA8cGF0aCBkPSJNNCAxN2gxNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/arrow-right-left\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst ArrowRightLeft = createLucideIcon('ArrowRightLeft', [\n ['path', { d: 'm16 3 4 4-4 4', key: '1x1c3m' }],\n ['path', { d: 'M20 7H4', key: 'zbl0bi' }],\n ['path', { d: 'm8 21-4-4 4-4', key: 'h9nckh' }],\n ['path', { d: 'M4 17h16', key: 'g4d7ey' }],\n]);\n\nexport default ArrowRightLeft;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAiB,iBAAiB,gBAAkB,CAAA,CAAA,CAAA;AAAA,CAAA,CACxD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,90 @@
"use strict";
exports.differenceInBusinessDays = differenceInBusinessDays;
var _index = require("./_lib/normalizeDates.cjs");
var _index2 = require("./addDays.cjs");
var _index3 = require("./differenceInCalendarDays.cjs");
var _index4 = require("./isSameDay.cjs");
var _index5 = require("./isValid.cjs");
var _index6 = require("./isWeekend.cjs");
/**
* The {@link differenceInBusinessDays} function options.
*/
/**
* @name differenceInBusinessDays
* @category Day Helpers
* @summary Get the number of business days between the given dates.
*
* @description
* Get the number of business day periods between the given dates.
* Business days being days that aren't in the weekend.
* Like `differenceInCalendarDays`, the function removes the times from
* the dates before calculating the difference.
*
* @param laterDate - The later date
* @param earlierDate - The earlier date
* @param options - An object with options
*
* @returns The number of business days
*
* @example
* // How many business days are between
* // 10 January 2014 and 20 July 2014?
* const result = differenceInBusinessDays(
* new Date(2014, 6, 20),
* new Date(2014, 0, 10)
* )
* //=> 136
*
* // How many business days are between
* // 30 November 2021 and 1 November 2021?
* const result = differenceInBusinessDays(
* new Date(2021, 10, 30),
* new Date(2021, 10, 1)
* )
* //=> 21
*
* // How many business days are between
* // 1 November 2021 and 1 December 2021?
* const result = differenceInBusinessDays(
* new Date(2021, 10, 1),
* new Date(2021, 11, 1)
* )
* //=> -22
*
* // How many business days are between
* // 1 November 2021 and 1 November 2021 ?
* const result = differenceInBusinessDays(
* new Date(2021, 10, 1),
* new Date(2021, 10, 1)
* )
* //=> 0
*/
function differenceInBusinessDays(laterDate, earlierDate, options) {
const [laterDate_, earlierDate_] = (0, _index.normalizeDates)(
options?.in,
laterDate,
earlierDate,
);
if (!(0, _index5.isValid)(laterDate_) || !(0, _index5.isValid)(earlierDate_))
return NaN;
const diff = (0, _index3.differenceInCalendarDays)(laterDate_, earlierDate_);
const sign = diff < 0 ? -1 : 1;
const weeks = Math.trunc(diff / 7);
let result = weeks * 5;
let movingDate = (0, _index2.addDays)(earlierDate_, weeks * 7);
// the loop below will run at most 6 times to account for the remaining days that don't makeup a full week
while (!(0, _index4.isSameDay)(laterDate_, movingDate)) {
// sign is used to account for both negative and positive differences
result += (0, _index6.isWeekend)(movingDate, options) ? 0 : sign;
movingDate = (0, _index2.addDays)(movingDate, sign);
}
// Prevent negative zero
return result === 0 ? 0 : result;
}

View File

@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const BringToFront = createLucideIcon("BringToFront", [
["rect", { x: "8", y: "8", width: "8", height: "8", rx: "2", key: "yj20xf" }],
["path", { d: "M4 10a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2", key: "1ltk23" }],
["path", { d: "M14 20a2 2 0 0 0 2 2h4a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2", key: "1q24h9" }]
]);
export { BringToFront as default };
//# sourceMappingURL=bring-to-front.js.map

View File

@@ -0,0 +1,3 @@
import type { Count } from 'payload';
export declare const count: Count;
//# sourceMappingURL=count.d.ts.map

View File

@@ -0,0 +1,9 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { LexicalEditor } from 'lexical';
export declare function usePlainTextSetup(editor: LexicalEditor): void;

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["c","_c","FieldDiffContainer","getHTMLDiffComponents","useConfig","useTranslation","formatDate","React","baseClass","DateDiffComponent","t0","$","comparisonValue","valueFrom","field","locale","nestingLevel","versionValue","valueTo","i18n","config","t1","admin","t2","dateFormat","formattedFromDate","date","Date","pattern","formattedToDate","t3","t4","t5","label","From","To","fromHTML","toHTML","tokenizeByCharacter","_jsx","className"],"sources":["../../../../../../src/views/Version/RenderFieldsToDiff/fields/Date/index.tsx"],"sourcesContent":["'use client'\nimport type { DateFieldDiffClientComponent } from 'payload'\n\nimport {\n FieldDiffContainer,\n getHTMLDiffComponents,\n useConfig,\n useTranslation,\n} from '@payloadcms/ui'\nimport { formatDate } from '@payloadcms/ui/shared'\n\nimport './index.scss'\n\nimport React from 'react'\n\nconst baseClass = 'date-diff'\n\nexport const DateDiffComponent: DateFieldDiffClientComponent = ({\n comparisonValue: valueFrom,\n field,\n locale,\n nestingLevel,\n versionValue: valueTo,\n}) => {\n const { i18n } = useTranslation()\n const {\n config: {\n admin: { dateFormat },\n },\n } = useConfig()\n\n const formattedFromDate = valueFrom\n ? formatDate({\n date: typeof valueFrom === 'string' ? new Date(valueFrom) : (valueFrom as Date),\n i18n,\n pattern: dateFormat,\n })\n : ''\n\n const formattedToDate = valueTo\n ? formatDate({\n date: typeof valueTo === 'string' ? new Date(valueTo) : (valueTo as Date),\n i18n,\n pattern: dateFormat,\n })\n : ''\n\n const { From, To } = getHTMLDiffComponents({\n fromHTML:\n `<div class=\"${baseClass}\" data-enable-match=\"true\" data-date=\"${formattedFromDate}\"><p>` +\n formattedFromDate +\n '</p></div>',\n toHTML:\n `<div class=\"${baseClass}\" data-enable-match=\"true\" data-date=\"${formattedToDate}\"><p>` +\n formattedToDate +\n '</p></div>',\n tokenizeByCharacter: false,\n })\n\n return (\n <FieldDiffContainer\n className={baseClass}\n From={From}\n i18n={i18n}\n label={{\n label: field.label,\n locale,\n }}\n nestingLevel={nestingLevel}\n To={To}\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,SACEC,kBAAkB,EAClBC,qBAAqB,EACrBC,SAAS,EACTC,cAAc,QACT;AACP,SAASC,UAAU,QAAQ;AAI3B,OAAOC,KAAA,MAAW;AAElB,MAAMC,SAAA,GAAY;AAElB,OAAO,MAAMC,iBAAA,GAAkDC,EAAA;EAAA,MAAAC,CAAA,GAAAV,EAAA;EAAC;IAAAW,eAAA,EAAAC,SAAA;IAAAC,KAAA;IAAAC,MAAA;IAAAC,YAAA;IAAAC,YAAA,EAAAC;EAAA,IAAAR,EAM/D;EACC;IAAAS;EAAA,IAAiBd,cAAA;EACjB;IAAAe,MAAA,EAAAC;EAAA,IAIIjB,SAAA;EAHM;IAAAkB,KAAA,EAAAC;EAAA,IAAAF,EAEP;EADQ;IAAAG;EAAA,IAAAD,EAAc;EAIzB,MAAAE,iBAAA,GAA0BZ,SAAA,GACtBP,UAAA;IAAAoB,IAAA,EACQ,OAAOb,SAAA,KAAc,eAAAc,IAAA,CAAoBd,SAAA,IAAcA,SAAA;IAAAM,IAAA;IAAAS,OAAA,EAEpDJ;EAAA,CACX,IACA;EAEJ,MAAAK,eAAA,GAAwBX,OAAA,GACpBZ,UAAA;IAAAoB,IAAA,EACQ,OAAOR,OAAA,KAAY,eAAAS,IAAA,CAAoBT,OAAA,IAAYA,OAAA;IAAAC,IAAA;IAAAS,OAAA,EAEhDJ;EAAA,CACX,IACA;EAIA,MAAAM,EAAA,kBAAAtB,SAAA,yCAAiEiB,iBAAA,OAAwB,GACzFA,iBAAA,GACA;EAEA,MAAAM,EAAA,kBAAAvB,SAAA,yCAAiEqB,eAAA,OAAsB,GACvFA,eAAA,GACA;EAAA,IAAAG,EAAA;EAAA,IAAArB,CAAA,QAAAG,KAAA,CAAAmB,KAAA,IAAAtB,CAAA,QAAAQ,IAAA,IAAAR,CAAA,QAAAI,MAAA,IAAAJ,CAAA,QAAAK,YAAA,IAAAL,CAAA,QAAAmB,EAAA,IAAAnB,CAAA,QAAAoB,EAAA;IARJ;MAAAG,IAAA;MAAAC;IAAA,IAAqBhC,qBAAA;MAAAiC,QAAA,EAEjBN,EAEA;MAAAO,MAAA,EAEAN,EAEA;MAAAO,mBAAA;IAAA,CAEJ;IAGEN,EAAA,GAAAO,IAAA,CAAArC,kBAAA;MAAAsC,SAAA,EAAAhC,SAAA;MAAA0B,IAAA;MAAAf,IAAA;MAAAc,KAAA;QAAAA,KAAA,EAKWnB,KAAA,CAAAmB,KAAA;QAAAlB;MAAA;MAAAC,YAAA;MAAAmB;IAAA,C;;;;;;;;;;;SALXH,E;CAYJ","ignoreList":[]}

View File

@@ -0,0 +1,767 @@
function _typeof(o) {"@babel/helpers - typeof";return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;}, _typeof(o);}function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}(function (_window$dateFns) {var __defProp = Object.defineProperty;
var __export = function __export(target, all) {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: function set(newValue) {return all[name] = function () {return newValue;};}
});
};
// lib/locale/cs/_lib/formatDistance.mjs
var formatDistanceLocale = {
lessThanXSeconds: {
one: {
regular: "m\xE9n\u011B ne\u017E 1 sekunda",
past: "p\u0159ed m\xE9n\u011B ne\u017E 1 sekundou",
future: "za m\xE9n\u011B ne\u017E 1 sekundu"
},
few: {
regular: "m\xE9n\u011B ne\u017E {{count}} sekundy",
past: "p\u0159ed m\xE9n\u011B ne\u017E {{count}} sekundami",
future: "za m\xE9n\u011B ne\u017E {{count}} sekundy"
},
many: {
regular: "m\xE9n\u011B ne\u017E {{count}} sekund",
past: "p\u0159ed m\xE9n\u011B ne\u017E {{count}} sekundami",
future: "za m\xE9n\u011B ne\u017E {{count}} sekund"
}
},
xSeconds: {
one: {
regular: "1 sekunda",
past: "p\u0159ed 1 sekundou",
future: "za 1 sekundu"
},
few: {
regular: "{{count}} sekundy",
past: "p\u0159ed {{count}} sekundami",
future: "za {{count}} sekundy"
},
many: {
regular: "{{count}} sekund",
past: "p\u0159ed {{count}} sekundami",
future: "za {{count}} sekund"
}
},
halfAMinute: {
type: "other",
other: {
regular: "p\u016Fl minuty",
past: "p\u0159ed p\u016Fl minutou",
future: "za p\u016Fl minuty"
}
},
lessThanXMinutes: {
one: {
regular: "m\xE9n\u011B ne\u017E 1 minuta",
past: "p\u0159ed m\xE9n\u011B ne\u017E 1 minutou",
future: "za m\xE9n\u011B ne\u017E 1 minutu"
},
few: {
regular: "m\xE9n\u011B ne\u017E {{count}} minuty",
past: "p\u0159ed m\xE9n\u011B ne\u017E {{count}} minutami",
future: "za m\xE9n\u011B ne\u017E {{count}} minuty"
},
many: {
regular: "m\xE9n\u011B ne\u017E {{count}} minut",
past: "p\u0159ed m\xE9n\u011B ne\u017E {{count}} minutami",
future: "za m\xE9n\u011B ne\u017E {{count}} minut"
}
},
xMinutes: {
one: {
regular: "1 minuta",
past: "p\u0159ed 1 minutou",
future: "za 1 minutu"
},
few: {
regular: "{{count}} minuty",
past: "p\u0159ed {{count}} minutami",
future: "za {{count}} minuty"
},
many: {
regular: "{{count}} minut",
past: "p\u0159ed {{count}} minutami",
future: "za {{count}} minut"
}
},
aboutXHours: {
one: {
regular: "p\u0159ibli\u017En\u011B 1 hodina",
past: "p\u0159ibli\u017En\u011B p\u0159ed 1 hodinou",
future: "p\u0159ibli\u017En\u011B za 1 hodinu"
},
few: {
regular: "p\u0159ibli\u017En\u011B {{count}} hodiny",
past: "p\u0159ibli\u017En\u011B p\u0159ed {{count}} hodinami",
future: "p\u0159ibli\u017En\u011B za {{count}} hodiny"
},
many: {
regular: "p\u0159ibli\u017En\u011B {{count}} hodin",
past: "p\u0159ibli\u017En\u011B p\u0159ed {{count}} hodinami",
future: "p\u0159ibli\u017En\u011B za {{count}} hodin"
}
},
xHours: {
one: {
regular: "1 hodina",
past: "p\u0159ed 1 hodinou",
future: "za 1 hodinu"
},
few: {
regular: "{{count}} hodiny",
past: "p\u0159ed {{count}} hodinami",
future: "za {{count}} hodiny"
},
many: {
regular: "{{count}} hodin",
past: "p\u0159ed {{count}} hodinami",
future: "za {{count}} hodin"
}
},
xDays: {
one: {
regular: "1 den",
past: "p\u0159ed 1 dnem",
future: "za 1 den"
},
few: {
regular: "{{count}} dny",
past: "p\u0159ed {{count}} dny",
future: "za {{count}} dny"
},
many: {
regular: "{{count}} dn\xED",
past: "p\u0159ed {{count}} dny",
future: "za {{count}} dn\xED"
}
},
aboutXWeeks: {
one: {
regular: "p\u0159ibli\u017En\u011B 1 t\xFDden",
past: "p\u0159ibli\u017En\u011B p\u0159ed 1 t\xFDdnem",
future: "p\u0159ibli\u017En\u011B za 1 t\xFDden"
},
few: {
regular: "p\u0159ibli\u017En\u011B {{count}} t\xFDdny",
past: "p\u0159ibli\u017En\u011B p\u0159ed {{count}} t\xFDdny",
future: "p\u0159ibli\u017En\u011B za {{count}} t\xFDdny"
},
many: {
regular: "p\u0159ibli\u017En\u011B {{count}} t\xFDdn\u016F",
past: "p\u0159ibli\u017En\u011B p\u0159ed {{count}} t\xFDdny",
future: "p\u0159ibli\u017En\u011B za {{count}} t\xFDdn\u016F"
}
},
xWeeks: {
one: {
regular: "1 t\xFDden",
past: "p\u0159ed 1 t\xFDdnem",
future: "za 1 t\xFDden"
},
few: {
regular: "{{count}} t\xFDdny",
past: "p\u0159ed {{count}} t\xFDdny",
future: "za {{count}} t\xFDdny"
},
many: {
regular: "{{count}} t\xFDdn\u016F",
past: "p\u0159ed {{count}} t\xFDdny",
future: "za {{count}} t\xFDdn\u016F"
}
},
aboutXMonths: {
one: {
regular: "p\u0159ibli\u017En\u011B 1 m\u011Bs\xEDc",
past: "p\u0159ibli\u017En\u011B p\u0159ed 1 m\u011Bs\xEDcem",
future: "p\u0159ibli\u017En\u011B za 1 m\u011Bs\xEDc"
},
few: {
regular: "p\u0159ibli\u017En\u011B {{count}} m\u011Bs\xEDce",
past: "p\u0159ibli\u017En\u011B p\u0159ed {{count}} m\u011Bs\xEDci",
future: "p\u0159ibli\u017En\u011B za {{count}} m\u011Bs\xEDce"
},
many: {
regular: "p\u0159ibli\u017En\u011B {{count}} m\u011Bs\xEDc\u016F",
past: "p\u0159ibli\u017En\u011B p\u0159ed {{count}} m\u011Bs\xEDci",
future: "p\u0159ibli\u017En\u011B za {{count}} m\u011Bs\xEDc\u016F"
}
},
xMonths: {
one: {
regular: "1 m\u011Bs\xEDc",
past: "p\u0159ed 1 m\u011Bs\xEDcem",
future: "za 1 m\u011Bs\xEDc"
},
few: {
regular: "{{count}} m\u011Bs\xEDce",
past: "p\u0159ed {{count}} m\u011Bs\xEDci",
future: "za {{count}} m\u011Bs\xEDce"
},
many: {
regular: "{{count}} m\u011Bs\xEDc\u016F",
past: "p\u0159ed {{count}} m\u011Bs\xEDci",
future: "za {{count}} m\u011Bs\xEDc\u016F"
}
},
aboutXYears: {
one: {
regular: "p\u0159ibli\u017En\u011B 1 rok",
past: "p\u0159ibli\u017En\u011B p\u0159ed 1 rokem",
future: "p\u0159ibli\u017En\u011B za 1 rok"
},
few: {
regular: "p\u0159ibli\u017En\u011B {{count}} roky",
past: "p\u0159ibli\u017En\u011B p\u0159ed {{count}} roky",
future: "p\u0159ibli\u017En\u011B za {{count}} roky"
},
many: {
regular: "p\u0159ibli\u017En\u011B {{count}} rok\u016F",
past: "p\u0159ibli\u017En\u011B p\u0159ed {{count}} roky",
future: "p\u0159ibli\u017En\u011B za {{count}} rok\u016F"
}
},
xYears: {
one: {
regular: "1 rok",
past: "p\u0159ed 1 rokem",
future: "za 1 rok"
},
few: {
regular: "{{count}} roky",
past: "p\u0159ed {{count}} roky",
future: "za {{count}} roky"
},
many: {
regular: "{{count}} rok\u016F",
past: "p\u0159ed {{count}} roky",
future: "za {{count}} rok\u016F"
}
},
overXYears: {
one: {
regular: "v\xEDce ne\u017E 1 rok",
past: "p\u0159ed v\xEDce ne\u017E 1 rokem",
future: "za v\xEDce ne\u017E 1 rok"
},
few: {
regular: "v\xEDce ne\u017E {{count}} roky",
past: "p\u0159ed v\xEDce ne\u017E {{count}} roky",
future: "za v\xEDce ne\u017E {{count}} roky"
},
many: {
regular: "v\xEDce ne\u017E {{count}} rok\u016F",
past: "p\u0159ed v\xEDce ne\u017E {{count}} roky",
future: "za v\xEDce ne\u017E {{count}} rok\u016F"
}
},
almostXYears: {
one: {
regular: "skoro 1 rok",
past: "skoro p\u0159ed 1 rokem",
future: "skoro za 1 rok"
},
few: {
regular: "skoro {{count}} roky",
past: "skoro p\u0159ed {{count}} roky",
future: "skoro za {{count}} roky"
},
many: {
regular: "skoro {{count}} rok\u016F",
past: "skoro p\u0159ed {{count}} roky",
future: "skoro za {{count}} rok\u016F"
}
}
};
var formatDistance = function formatDistance(token, count, options) {
var pluralResult;
var tokenValue = formatDistanceLocale[token];
if (tokenValue.type === "other") {
pluralResult = tokenValue.other;
} else if (count === 1) {
pluralResult = tokenValue.one;
} else if (count > 1 && count < 5) {
pluralResult = tokenValue.few;
} else {
pluralResult = tokenValue.many;
}
var suffixExist = (options === null || options === void 0 ? void 0 : options.addSuffix) === true;
var comparison = options === null || options === void 0 ? void 0 : options.comparison;
var timeResult;
if (suffixExist && comparison === -1) {
timeResult = pluralResult.past;
} else if (suffixExist && comparison === 1) {
timeResult = pluralResult.future;
} else {
timeResult = pluralResult.regular;
}
return timeResult.replace("{{count}}", String(count));
};
// lib/locale/_lib/buildFormatLongFn.mjs
function buildFormatLongFn(args) {
return function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var width = options.width ? String(options.width) : args.defaultWidth;
var format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
// lib/locale/cs/_lib/formatLong.mjs
var dateFormats = {
full: "EEEE, d. MMMM yyyy",
long: "d. MMMM yyyy",
medium: "d. M. yyyy",
short: "dd.MM.yyyy"
};
var timeFormats = {
full: "H:mm:ss zzzz",
long: "H:mm:ss z",
medium: "H:mm:ss",
short: "H:mm"
};
var dateTimeFormats = {
full: "{{date}} 'v' {{time}}",
long: "{{date}} 'v' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}"
};
var formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full"
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full"
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full"
})
};
// lib/locale/cs/_lib/formatRelative.mjs
var accusativeWeekdays = [
"ned\u011Bli",
"pond\u011Bl\xED",
"\xFAter\xFD",
"st\u0159edu",
"\u010Dtvrtek",
"p\xE1tek",
"sobotu"];
var formatRelativeLocale = {
lastWeek: "'posledn\xED' eeee 've' p",
yesterday: "'v\u010Dera v' p",
today: "'dnes v' p",
tomorrow: "'z\xEDtra v' p",
nextWeek: function nextWeek(date) {
var day = date.getDay();
return "'v " + accusativeWeekdays[day] + " o' p";
},
other: "P"
};
var formatRelative = function formatRelative(token, date) {
var format = formatRelativeLocale[token];
if (typeof format === "function") {
return format(date);
}
return format;
};
// lib/locale/_lib/buildLocalizeFn.mjs
function buildLocalizeFn(args) {
return function (value, options) {
var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
var valuesArray;
if (context === "formatting" && args.formattingValues) {
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
var _defaultWidth = args.defaultWidth;
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[_width] || args.values[_defaultWidth];
}
var index = args.argumentCallback ? args.argumentCallback(value) : value;
return valuesArray[index];
};
}
// lib/locale/cs/_lib/localize.mjs
var eraValues = {
narrow: ["p\u0159. n. l.", "n. l."],
abbreviated: ["p\u0159. n. l.", "n. l."],
wide: ["p\u0159ed na\u0161\xEDm letopo\u010Dtem", "na\u0161eho letopo\u010Dtu"]
};
var quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["1. \u010Dtvrtlet\xED", "2. \u010Dtvrtlet\xED", "3. \u010Dtvrtlet\xED", "4. \u010Dtvrtlet\xED"],
wide: ["1. \u010Dtvrtlet\xED", "2. \u010Dtvrtlet\xED", "3. \u010Dtvrtlet\xED", "4. \u010Dtvrtlet\xED"]
};
var monthValues = {
narrow: ["L", "\xDA", "B", "D", "K", "\u010C", "\u010C", "S", "Z", "\u0158", "L", "P"],
abbreviated: [
"led",
"\xFAno",
"b\u0159e",
"dub",
"kv\u011B",
"\u010Dvn",
"\u010Dvc",
"srp",
"z\xE1\u0159",
"\u0159\xEDj",
"lis",
"pro"],
wide: [
"leden",
"\xFAnor",
"b\u0159ezen",
"duben",
"kv\u011Bten",
"\u010Derven",
"\u010Dervenec",
"srpen",
"z\xE1\u0159\xED",
"\u0159\xEDjen",
"listopad",
"prosinec"]
};
var formattingMonthValues = {
narrow: ["L", "\xDA", "B", "D", "K", "\u010C", "\u010C", "S", "Z", "\u0158", "L", "P"],
abbreviated: [
"led",
"\xFAno",
"b\u0159e",
"dub",
"kv\u011B",
"\u010Dvn",
"\u010Dvc",
"srp",
"z\xE1\u0159",
"\u0159\xEDj",
"lis",
"pro"],
wide: [
"ledna",
"\xFAnora",
"b\u0159ezna",
"dubna",
"kv\u011Btna",
"\u010Dervna",
"\u010Dervence",
"srpna",
"z\xE1\u0159\xED",
"\u0159\xEDjna",
"listopadu",
"prosince"]
};
var dayValues = {
narrow: ["ne", "po", "\xFAt", "st", "\u010Dt", "p\xE1", "so"],
short: ["ne", "po", "\xFAt", "st", "\u010Dt", "p\xE1", "so"],
abbreviated: ["ned", "pon", "\xFAte", "st\u0159", "\u010Dtv", "p\xE1t", "sob"],
wide: ["ned\u011Ble", "pond\u011Bl\xED", "\xFAter\xFD", "st\u0159eda", "\u010Dtvrtek", "p\xE1tek", "sobota"]
};
var dayPeriodValues = {
narrow: {
am: "dop.",
pm: "odp.",
midnight: "p\u016Flnoc",
noon: "poledne",
morning: "r\xE1no",
afternoon: "odpoledne",
evening: "ve\u010Der",
night: "noc"
},
abbreviated: {
am: "dop.",
pm: "odp.",
midnight: "p\u016Flnoc",
noon: "poledne",
morning: "r\xE1no",
afternoon: "odpoledne",
evening: "ve\u010Der",
night: "noc"
},
wide: {
am: "dopoledne",
pm: "odpoledne",
midnight: "p\u016Flnoc",
noon: "poledne",
morning: "r\xE1no",
afternoon: "odpoledne",
evening: "ve\u010Der",
night: "noc"
}
};
var formattingDayPeriodValues = {
narrow: {
am: "dop.",
pm: "odp.",
midnight: "p\u016Flnoc",
noon: "poledne",
morning: "r\xE1no",
afternoon: "odpoledne",
evening: "ve\u010Der",
night: "noc"
},
abbreviated: {
am: "dop.",
pm: "odp.",
midnight: "p\u016Flnoc",
noon: "poledne",
morning: "r\xE1no",
afternoon: "odpoledne",
evening: "ve\u010Der",
night: "noc"
},
wide: {
am: "dopoledne",
pm: "odpoledne",
midnight: "p\u016Flnoc",
noon: "poledne",
morning: "r\xE1no",
afternoon: "odpoledne",
evening: "ve\u010Der",
night: "noc"
}
};
var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
var number = Number(dirtyNumber);
return number + ".";
};
var localize = {
ordinalNumber: ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide"
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: function argumentCallback(quarter) {return quarter - 1;}
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
formattingValues: formattingMonthValues,
defaultFormattingWidth: "wide"
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide"
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide"
})
};
// lib/locale/_lib/buildMatchFn.mjs
function buildMatchFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {return pattern.test(matchedString);}) : findKey(parsePatterns, function (pattern) {return pattern.test(matchedString);});
var value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
var findKey = function findKey(object, predicate) {
for (var key in object) {
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
return key;
}
}
return;
};
var findIndex = function findIndex(array, predicate) {
for (var key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return;
};
// lib/locale/_lib/buildMatchPatternFn.mjs
function buildMatchPatternFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var matchResult = string.match(args.matchPattern);
if (!matchResult)
return null;
var matchedString = matchResult[0];
var parseResult = string.match(args.parsePattern);
if (!parseResult)
return null;
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
// lib/locale/cs/_lib/match.mjs
var matchOrdinalNumberPattern = /^(\d+)\.?/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
narrow: /^(p[řr](\.|ed) Kr\.|p[řr](\.|ed) n\. l\.|po Kr\.|n\. l\.)/i,
abbreviated: /^(p[řr](\.|ed) Kr\.|p[řr](\.|ed) n\. l\.|po Kr\.|n\. l\.)/i,
wide: /^(p[řr](\.|ed) Kristem|p[řr](\.|ed) na[šs][íi]m letopo[čc]tem|po Kristu|na[šs]eho letopo[čc]tu)/i
};
var parseEraPatterns = {
any: [/^p[řr]/i, /^(po|n)/i]
};
var matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^[1234]\. [čc]tvrtlet[íi]/i,
wide: /^[1234]\. [čc]tvrtlet[íi]/i
};
var parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns = {
narrow: /^[lúubdkčcszřrlp]/i,
abbreviated: /^(led|[úu]no|b[řr]e|dub|kv[ěe]|[čc]vn|[čc]vc|srp|z[áa][řr]|[řr][íi]j|lis|pro)/i,
wide: /^(leden|ledna|[úu]nora?|b[řr]ezen|b[řr]ezna|duben|dubna|kv[ěe]ten|kv[ěe]tna|[čc]erven(ec|ce)?|[čc]ervna|srpen|srpna|z[áa][řr][íi]|[řr][íi]jen|[řr][íi]jna|listopad(a|u)?|prosinec|prosince)/i
};
var parseMonthPatterns = {
narrow: [
/^l/i,
/^[úu]/i,
/^b/i,
/^d/i,
/^k/i,
/^[čc]/i,
/^[čc]/i,
/^s/i,
/^z/i,
/^[řr]/i,
/^l/i,
/^p/i],
any: [
/^led/i,
/^[úu]n/i,
/^b[řr]e/i,
/^dub/i,
/^kv[ěe]/i,
/^[čc]vn|[čc]erven(?!\w)|[čc]ervna/i,
/^[čc]vc|[čc]erven(ec|ce)/i,
/^srp/i,
/^z[áa][řr]/i,
/^[řr][íi]j/i,
/^lis/i,
/^pro/i]
};
var matchDayPatterns = {
narrow: /^[npuúsčps]/i,
short: /^(ne|po|[úu]t|st|[čc]t|p[áa]|so)/i,
abbreviated: /^(ned|pon|[úu]te|st[rř]|[čc]tv|p[áa]t|sob)/i,
wide: /^(ned[ěe]le|pond[ěe]l[íi]|[úu]ter[ýy]|st[řr]eda|[čc]tvrtek|p[áa]tek|sobota)/i
};
var parseDayPatterns = {
narrow: [/^n/i, /^p/i, /^[úu]/i, /^s/i, /^[čc]/i, /^p/i, /^s/i],
any: [/^ne/i, /^po/i, /^[úu]t/i, /^st/i, /^[čc]t/i, /^p[áa]/i, /^so/i]
};
var matchDayPeriodPatterns = {
any: /^dopoledne|dop\.?|odpoledne|odp\.?|p[ůu]lnoc|poledne|r[áa]no|odpoledne|ve[čc]er|(v )?noci?/i
};
var parseDayPeriodPatterns = {
any: {
am: /^dop/i,
pm: /^odp/i,
midnight: /^p[ůu]lnoc/i,
noon: /^poledne/i,
morning: /r[áa]no/i,
afternoon: /odpoledne/i,
evening: /ve[čc]er/i,
night: /noc/i
}
};
var match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function valueCallback(value) {return parseInt(value, 10);}
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any"
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: function valueCallback(index) {return index + 1;}
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any"
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any"
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any"
})
};
// lib/locale/cs.mjs
var cs = {
code: "cs",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1,
firstWeekContainsDate: 4
}
};
// lib/locale/cs/cdn.js
window.dateFns = _objectSpread(_objectSpread({},
window.dateFns), {}, {
locale: _objectSpread(_objectSpread({}, (_window$dateFns =
window.dateFns) === null || _window$dateFns === void 0 ? void 0 : _window$dateFns.locale), {}, {
cs: cs }) });
//# debugId=139EC565817313A564756e2164756e21
})();
//# sourceMappingURL=cdn.js.map

View File

@@ -0,0 +1,28 @@
@layer payload-default {
.upload-field-card {
background: var(--theme-elevation-50);
border: 1px solid var(--theme-border-color);
border-radius: var(--style-radius-s);
display: flex;
align-items: center;
width: 100%;
gap: calc(var(--base) / 2);
&--size-medium {
padding: calc(var(--base) * 0.5);
.thumbnail {
width: 40px;
height: 40px;
}
}
&--size-small {
padding: calc(var(--base) / 3) calc(var(--base) / 2);
.thumbnail {
width: 25px;
height: 25px;
}
}
}
}

View File

@@ -0,0 +1 @@
Prism.languages.bqn={shebang:{pattern:/^#![ \t]*\/.*/,alias:"important",greedy:!0},comment:{pattern:/#.*/,greedy:!0},"string-literal":{pattern:/"(?:[^"]|"")*"/,greedy:!0,alias:"string"},"character-literal":{pattern:/'(?:[\s\S]|[\uD800-\uDBFF][\uDC00-\uDFFF])'/,greedy:!0,alias:"char"},function:/•[\w¯.∞π]+[\w¯.∞π]*/,"dot-notation-on-brackets":{pattern:/\{(?=.*\}\.)|\}\./,alias:"namespace"},"special-name":{pattern:/(?:𝕨|𝕩|𝕗|𝕘|𝕤|𝕣|𝕎|𝕏|𝔽|𝔾|𝕊|_𝕣_|_𝕣)/,alias:"keyword"},"dot-notation-on-name":{pattern:/[A-Za-z_][\w¯∞π]*\./,alias:"namespace"},"word-number-scientific":{pattern:/\d+(?:\.\d+)?[eE]¯?\d+/,alias:"number"},"word-name":{pattern:/[A-Za-z_][\w¯∞π]*/,alias:"symbol"},"word-number":{pattern:/[¯∞π]?(?:\d*\.?\b\d+(?:e[+¯]?\d+|E[+¯]?\d+)?|¯|∞|π)(?:j¯?(?:(?:\d+(?:\.\d+)?|\.\d+)(?:e[+¯]?\d+|E[+¯]?\d+)?|¯|∞|π))?/,alias:"number"},"null-literal":{pattern:/@/,alias:"char"},"primitive-functions":{pattern:/[-+×÷⋆√⌊⌈|¬∧∨<>≠=≤≥≡≢⊣⊢⥊∾≍⋈↑↓↕«»⌽⍉/⍋⍒⊏⊑⊐⊒∊⍷⊔!]/,alias:"operator"},"primitive-1-operators":{pattern:/[`˜˘¨⁼⌜´˝˙]/,alias:"operator"},"primitive-2-operators":{pattern:/[∘⊸⟜○⌾⎉⚇⍟⊘◶⎊]/,alias:"operator"},punctuation:/[←⇐↩(){}⟨⟩[\]‿·⋄,.;:?]/};

View File

@@ -0,0 +1,335 @@
/**
*
* handler
*
*/
import { ExecutionArgs, ExecutionResult, GraphQLSchema, validate as graphqlValidate, ValidationRule, execute as graphqlExecute, parse as graphqlParse, getOperationAST as graphqlGetOperationAST, GraphQLError } from 'graphql';
import { RequestParams } from './common';
/**
* The incoming request headers the implementing server should provide.
*
* @category Server
*/
export type RequestHeaders = {
/**
* Always an array in Node. Duplicates are added to it.
* Not necessarily true for other environments.
*/
'set-cookie'?: string | string[] | undefined;
[key: string]: string | string[] | undefined;
} | {
get: (key: string) => string | null;
};
/**
* Server agnostic request interface containing the raw request
* which is server dependant.
*
* @category Server
*/
export interface Request<Raw, Context> {
readonly method: string;
readonly url: string;
readonly headers: RequestHeaders;
/**
* Parsed request body or a parser function.
*
* If the provided function throws, the error message "Unparsable JSON body" will
* be in the erroneous response.
*/
readonly body: string | Record<string, unknown> | null | (() => string | Record<string, unknown> | null | Promise<string | Record<string, unknown> | null>);
/**
* The raw request itself from the implementing server.
*
* For example: `express.Request` when using Express, or maybe
* `http.IncomingMessage` when just using Node with `http.createServer`.
*/
readonly raw: Raw;
/**
* Context value about the incoming request, you're free to pass any information here.
*/
readonly context: Context;
}
/**
* The response headers that get returned from graphql-http.
*
* @category Server
*/
export type ResponseHeaders = {
accept?: string;
allow?: string;
'content-type'?: string;
} & Record<string, string>;
/**
* Server agnostic response body returned from `graphql-http` needing
* to be coerced to the server implementation in use.
*
* @category Server
*/
export type ResponseBody = string;
/**
* Server agnostic response options (ex. status and headers) returned from
* `graphql-http` needing to be coerced to the server implementation in use.
*
* @category Server
*/
export interface ResponseInit {
readonly status: number;
readonly statusText: string;
readonly headers?: ResponseHeaders;
}
/**
* Server agnostic response returned from `graphql-http` containing the
* body and init options needing to be coerced to the server implementation in use.
*
* @category Server
*/
export type Response = readonly [body: ResponseBody | null, init: ResponseInit];
/**
* A concrete GraphQL execution context value type.
*
* Mainly used because TypeScript collapses unions
* with `any` or `unknown` to `any` or `unknown`. So,
* we use a custom type to allow definitions such as
* the `context` server option.
*
* @category Server
*/
export type OperationContext = Record<PropertyKey, unknown> | symbol | number | string | boolean | undefined | null;
/**
* The (GraphQL) error formatter function.
*
* @category Server
*/
export type FormatError = (err: Readonly<GraphQLError | Error>) => GraphQLError | Error;
/**
* The request parser for an incoming GraphQL request in the handler.
*
* It should parse and validate the request itself, including the request method
* and the content-type of the body.
*
* In case you are extending the server to handle more request types, this is the
* perfect place to do so.
*
* If an error is thrown, it will be formatted using the provided {@link FormatError}
* and handled following the spec to be gracefully reported to the client.
*
* Throwing an instance of `Error` will _always_ have the client respond with a `400: Bad Request`
* and the error's message in the response body; however, if an instance of `GraphQLError` is thrown,
* it will be reported depending on the accepted content-type.
*
* If you return nothing, the default parser will be used instead.
*
* @category Server
*/
export type ParseRequestParams<RequestRaw = unknown, RequestContext = unknown> = (req: Request<RequestRaw, RequestContext>) => Promise<RequestParams | Response | void> | RequestParams | Response | void;
/**
* The GraphQL over HTTP spec compliant request parser for an incoming GraphQL request.
* It parses and validates the request itself, including the request method and the
* content-type of the body.
*
* If the HTTP request itself is invalid or malformed, the function will return an
* appropriate {@link Response}.
*
* If the HTTP request is valid, but is not a well-formatted GraphQL request, the
* function will throw an error and it is up to the user to handle and respond as
* they see fit.
*
* @category Server
*/
export declare function parseRequestParams<RequestRaw = unknown, RequestContext = unknown>(req: Request<RequestRaw, RequestContext>): Promise<Response | RequestParams>;
/** @category Server */
export type OperationArgs<Context extends OperationContext = undefined> = ExecutionArgs & {
contextValue?: Context;
};
/** @category Server */
export interface HandlerOptions<RequestRaw = unknown, RequestContext = unknown, Context extends OperationContext = undefined> {
/**
* The GraphQL schema on which the operations will
* be executed and validated against.
*
* If a function is provided, it will be called on every
* operation request allowing you to manipulate schema
* dynamically.
*
* If the schema is left undefined, you're trusted to
* provide one in the returned `ExecutionArgs` from the
* `onSubscribe` callback.
*
* If you want to respond to the client with a custom status and/or body,
* you should do by returning a `Request` argument which will stop
* further execution.
*/
schema?: GraphQLSchema | ((req: Request<RequestRaw, RequestContext>, args: Omit<OperationArgs<Context>, 'schema'>) => Promise<GraphQLSchema | Response> | GraphQLSchema | Response);
/**
* A value which is provided to every resolver and holds
* important contextual information like the currently
* logged in user, or access to a database.
*/
context?: Context | ((req: Request<RequestRaw, RequestContext>, params: RequestParams) => Promise<Context | Response> | Context | Response);
/**
* A custom GraphQL validate function allowing you to apply your
* own validation rules.
*
* Will not be used when implementing a custom `onSubscribe`.
*/
validate?: typeof graphqlValidate;
/**
* The validation rules for running GraphQL validate.
*
* When providing an array, the rules will be APPENDED to the default
* `specifiedRules` array provided by the graphql-js module.
*
* Alternatively, providing a function instead will OVERWRITE the defaults
* and use exclusively the rules returned by the function. The third (last)
* argument of the function are the default `specifiedRules` array provided
* by the graphql-js module, you're free to prepend/append the defaults to
* your rule set, or omit them altogether.
*/
validationRules?: readonly ValidationRule[] | ((req: Request<RequestRaw, RequestContext>, args: OperationArgs<Context>, specifiedRules: readonly ValidationRule[]) => Promise<readonly ValidationRule[]> | readonly ValidationRule[]);
/**
* Is the `execute` function from GraphQL which is
* used to execute the query and mutation operations.
*/
execute?: typeof graphqlExecute;
/**
* GraphQL parse function allowing you to apply a custom parser.
*/
parse?: typeof graphqlParse;
/**
* GraphQL operation AST getter used for detecting the operation type.
*/
getOperationAST?: typeof graphqlGetOperationAST;
/**
* The GraphQL root value or resolvers to go alongside the execution.
* Learn more about them here: https://graphql.org/learn/execution/#root-fields-resolvers.
*
* If you return from `onSubscribe`, and the returned value is
* missing the `rootValue` field, the relevant operation root
* will be used instead.
*/
rootValue?: unknown;
/**
* The subscribe callback executed right after processing the request
* before proceeding with the GraphQL operation execution.
*
* If you return `ExecutionResult` from the callback, it will be used
* directly for responding to the request. Useful for implementing a response
* cache.
*
* If you return `ExecutionArgs` from the callback, it will be used instead of
* trying to build one internally. In this case, you are responsible for providing
* a ready set of arguments which will be directly plugged in the operation execution.
*
* You *must* validate the `ExecutionArgs` yourself if returning them.
*
* If you return an array of `GraphQLError` from the callback, they will be reported
* to the client while complying with the spec.
*
* Omitting the fields `contextValue` from the returned `ExecutionArgs` will use the
* provided `context` option, if available.
*
* Useful for preparing the execution arguments following a custom logic. A typical
* use-case is persisted queries. You can identify the query from the request parameters
* and supply the appropriate GraphQL operation execution arguments.
*
* If you want to respond to the client with a custom status and/or body,
* you should do by returning a `Request` argument which will stop
* further execution.
*/
onSubscribe?: (req: Request<RequestRaw, RequestContext>, params: RequestParams) => Promise<ExecutionResult | OperationArgs<Context> | readonly GraphQLError[] | Response | void> | ExecutionResult | OperationArgs<Context> | readonly GraphQLError[] | Response | void;
/**
* Executed after the operation call resolves.
*
* The `OperationResult` argument is the result of operation
* execution. It can be an iterator or already a value.
*
* Use this callback to listen for GraphQL operations and
* execution result manipulation.
*
* If you want to respond to the client with a custom status and/or body,
* you should do by returning a `Request` argument which will stop
* further execution.
*/
onOperation?: (req: Request<RequestRaw, RequestContext>, args: OperationArgs<Context>, result: ExecutionResult) => Promise<ExecutionResult | Response | void> | ExecutionResult | Response | void;
/**
* Format handled errors to your satisfaction. Either GraphQL errors
* or safe request processing errors are meant by "handled errors".
*
* If multiple errors have occurred, all of them will be mapped using
* this formatter.
*/
formatError?: FormatError;
/**
* The request parser for an incoming GraphQL request.
*
* Read more about it in {@link ParseRequestParams}.
*/
parseRequestParams?: ParseRequestParams<RequestRaw, RequestContext>;
}
/**
* The ready-to-use handler. Simply plug it in your favorite HTTP framework
* and enjoy.
*
* Errors thrown from **any** of the provided options or callbacks (or even due to
* library misuse or potential bugs) will reject the handler's promise. They are
* considered internal errors and you should take care of them accordingly.
*
* @category Server
*/
export type Handler<RequestRaw = unknown, RequestContext = unknown> = (req: Request<RequestRaw, RequestContext>) => Promise<Response>;
/**
* Makes a GraphQL over HTTP spec compliant server handler. The handler can
* be used with your favorite server library.
*
* Beware that the handler resolves only after the whole operation completes.
*
* Errors thrown from **any** of the provided options or callbacks (or even due to
* library misuse or potential bugs) will reject the handler's promise. They are
* considered internal errors and you should take care of them accordingly.
*
* For production environments, its recommended not to transmit the exact internal
* error details to the client, but instead report to an error logging tool or simply
* the console.
*
* Simple example usage with Node:
*
* ```js
* import http from 'http';
* import { createHandler } from 'graphql-http';
* import { schema } from './my-graphql-schema';
*
* // Create the GraphQL over HTTP handler
* const handler = createHandler({ schema });
*
* // Create a HTTP server using the handler on `/graphql`
* const server = http.createServer(async (req, res) => {
* if (!req.url.startsWith('/graphql')) {
* return res.writeHead(404).end();
* }
*
* try {
* const [body, init] = await handler({
* url: req.url,
* method: req.method,
* headers: req.headers,
* body: () => new Promise((resolve) => {
* let body = '';
* req.on('data', (chunk) => (body += chunk));
* req.on('end', () => resolve(body));
* }),
* raw: req,
* });
* res.writeHead(init.status, init.statusText, init.headers).end(body);
* } catch (err) {
* // BEWARE not to transmit the exact internal error message in production environments
* res.writeHead(500).end(err.message);
* }
* });
*
* server.listen(4000);
* console.log('Listening to port 4000');
* ```
*
* @category Server
*/
export declare function createHandler<RequestRaw = unknown, RequestContext = unknown, Context extends OperationContext = undefined>(options: HandlerOptions<RequestRaw, RequestContext, Context>): Handler<RequestRaw, RequestContext>;

View File

@@ -0,0 +1,152 @@
import { isTag, isText } from "domhandler";
import { filter, findOne } from "./querying.js";
/**
* A map of functions to check nodes against.
*/
const Checks = {
tag_name(name) {
if (typeof name === "function") {
return (elem) => isTag(elem) && name(elem.name);
}
else if (name === "*") {
return isTag;
}
return (elem) => isTag(elem) && elem.name === name;
},
tag_type(type) {
if (typeof type === "function") {
return (elem) => type(elem.type);
}
return (elem) => elem.type === type;
},
tag_contains(data) {
if (typeof data === "function") {
return (elem) => isText(elem) && data(elem.data);
}
return (elem) => isText(elem) && elem.data === data;
},
};
/**
* Returns a function to check whether a node has an attribute with a particular
* value.
*
* @param attrib Attribute to check.
* @param value Attribute value to look for.
* @returns A function to check whether the a node has an attribute with a
* particular value.
*/
function getAttribCheck(attrib, value) {
if (typeof value === "function") {
return (elem) => isTag(elem) && value(elem.attribs[attrib]);
}
return (elem) => isTag(elem) && elem.attribs[attrib] === value;
}
/**
* Returns a function that returns `true` if either of the input functions
* returns `true` for a node.
*
* @param a First function to combine.
* @param b Second function to combine.
* @returns A function taking a node and returning `true` if either of the input
* functions returns `true` for the node.
*/
function combineFuncs(a, b) {
return (elem) => a(elem) || b(elem);
}
/**
* Returns a function that executes all checks in `options` and returns `true`
* if any of them match a node.
*
* @param options An object describing nodes to look for.
* @returns A function that executes all checks in `options` and returns `true`
* if any of them match a node.
*/
function compileTest(options) {
const funcs = Object.keys(options).map((key) => {
const value = options[key];
return Object.prototype.hasOwnProperty.call(Checks, key)
? Checks[key](value)
: getAttribCheck(key, value);
});
return funcs.length === 0 ? null : funcs.reduce(combineFuncs);
}
/**
* Checks whether a node matches the description in `options`.
*
* @category Legacy Query Functions
* @param options An object describing nodes to look for.
* @param node The element to test.
* @returns Whether the element matches the description in `options`.
*/
export function testElement(options, node) {
const test = compileTest(options);
return test ? test(node) : true;
}
/**
* Returns all nodes that match `options`.
*
* @category Legacy Query Functions
* @param options An object describing nodes to look for.
* @param nodes Nodes to search through.
* @param recurse Also consider child nodes.
* @param limit Maximum number of nodes to return.
* @returns All nodes that match `options`.
*/
export function getElements(options, nodes, recurse, limit = Infinity) {
const test = compileTest(options);
return test ? filter(test, nodes, recurse, limit) : [];
}
/**
* Returns the node with the supplied ID.
*
* @category Legacy Query Functions
* @param id The unique ID attribute value to look for.
* @param nodes Nodes to search through.
* @param recurse Also consider child nodes.
* @returns The node with the supplied ID.
*/
export function getElementById(id, nodes, recurse = true) {
if (!Array.isArray(nodes))
nodes = [nodes];
return findOne(getAttribCheck("id", id), nodes, recurse);
}
/**
* Returns all nodes with the supplied `tagName`.
*
* @category Legacy Query Functions
* @param tagName Tag name to search for.
* @param nodes Nodes to search through.
* @param recurse Also consider child nodes.
* @param limit Maximum number of nodes to return.
* @returns All nodes with the supplied `tagName`.
*/
export function getElementsByTagName(tagName, nodes, recurse = true, limit = Infinity) {
return filter(Checks["tag_name"](tagName), nodes, recurse, limit);
}
/**
* Returns all nodes with the supplied `className`.
*
* @category Legacy Query Functions
* @param className Class name to search for.
* @param nodes Nodes to search through.
* @param recurse Also consider child nodes.
* @param limit Maximum number of nodes to return.
* @returns All nodes with the supplied `className`.
*/
export function getElementsByClassName(className, nodes, recurse = true, limit = Infinity) {
return filter(getAttribCheck("class", className), nodes, recurse, limit);
}
/**
* Returns all nodes with the supplied `type`.
*
* @category Legacy Query Functions
* @param type Element type to look for.
* @param nodes Nodes to search through.
* @param recurse Also consider child nodes.
* @param limit Maximum number of nodes to return.
* @returns All nodes with the supplied `type`.
*/
export function getElementsByTagType(type, nodes, recurse = true, limit = Infinity) {
return filter(Checks["tag_type"](type), nodes, recurse, limit);
}
//# sourceMappingURL=legacy.js.map

View File

@@ -0,0 +1,47 @@
import type { CollectionSlug } from '../../../index.js';
import type { BeforeOperationArg, OperationArgs, OperationMap } from './types.js';
/**
* TODO V4: remove overloads and operations should be the literal operation that was called
*
* - `read`: replace with `find` and `findByID` in both operations
* - `delete`: replace with `deleteByID` in deleteByID operation
* - `update`: replace with `updateByID` in updateByID operation
*/
/**
* @deprecated
*
* Should use `find` or `findByID`
*/
export declare function buildBeforeOperation<TOperationGeneric extends CollectionSlug, TArgs>(operationArgs: {
args: TArgs;
operation: 'read';
} & Omit<BeforeOperationArg<TOperationGeneric>, 'args' | 'context' | 'operation' | 'req'>): Promise<TArgs>;
/**
* Overload for 'readDistinct' operation
*
* @deprecated - use `findDistinct`
*/
export declare function buildBeforeOperation<TOperationGeneric extends CollectionSlug, TArgs>(operationArgs: {
args: TArgs;
operation: 'readDistinct';
} & Omit<BeforeOperationArg<TOperationGeneric>, 'args' | 'context' | 'operation' | 'req'>): Promise<TArgs>;
export declare function buildBeforeOperation<TOperationGeneric extends CollectionSlug, TArgs>(operationArgs: {
args: TArgs;
operation: 'update';
} & Omit<BeforeOperationArg<TOperationGeneric>, 'args' | 'context' | 'operation' | 'req'>): Promise<TArgs>;
export declare function buildBeforeOperation<TOperationGeneric extends CollectionSlug, TArgs>(operationArgs: {
args: TArgs;
operation: 'updateByID';
} & Omit<BeforeOperationArg<TOperationGeneric>, 'args' | 'context' | 'operation' | 'req'>): Promise<TArgs>;
export declare function buildBeforeOperation<TOperationGeneric extends CollectionSlug, TArgs>(operationArgs: {
args: TArgs;
operation: 'delete';
} & Omit<BeforeOperationArg<TOperationGeneric>, 'args' | 'context' | 'operation' | 'req'>): Promise<TArgs>;
export declare function buildBeforeOperation<TOperationGeneric extends CollectionSlug, TArgs>(operationArgs: {
args: TArgs;
operation: 'deleteByID';
} & Omit<BeforeOperationArg<TOperationGeneric>, 'args' | 'context' | 'operation' | 'req'>): Promise<TArgs>;
export declare function buildBeforeOperation<TOperationGeneric extends CollectionSlug, O extends keyof OperationMap<TOperationGeneric>>(operationArgs: {
operation: O;
} & Omit<BeforeOperationArg<TOperationGeneric>, 'context' | 'req'>): Promise<OperationArgs<TOperationGeneric, O>>;
//# sourceMappingURL=buildBeforeOperation.d.ts.map

View File

@@ -0,0 +1,46 @@
import type {CodeKeywordDefinition, KeywordCxt, KeywordErrorDefinition, ErrorObject} from "ajv"
import {_, str, and} from "ajv/dist/compile/codegen"
import {usePattern} from "./_util"
export type PatternRequiredError = ErrorObject<"patternRequired", {missingPattern: string}>
const error: KeywordErrorDefinition = {
message: ({params: {missingPattern}}) =>
str`should have property matching pattern '${missingPattern}'`,
params: ({params: {missingPattern}}) => _`{missingPattern: ${missingPattern}}`,
}
export default function getDef(): CodeKeywordDefinition {
return {
keyword: "patternRequired",
type: "object",
schemaType: "array",
error,
code(cxt: KeywordCxt) {
const {gen, schema, data} = cxt
if (schema.length === 0) return
const valid = gen.let("valid", true)
for (const pat of schema) validateProperties(pat)
function validateProperties(pattern: string): void {
const matched = gen.let("matched", false)
gen.forIn("key", data, (key) => {
gen.assign(matched, _`${usePattern(cxt, pattern)}.test(${key})`)
gen.if(matched, () => gen.break())
})
cxt.setParams({missingPattern: pattern})
gen.assign(valid, and(valid, matched))
cxt.pass(valid)
}
},
metaSchema: {
type: "array",
items: {type: "string", format: "regex"},
uniqueItems: true,
},
}
}
module.exports = getDef

Some files were not shown because too many files have changed in this diff Show More