fix(products): fix breadcrumbs and product filtering (backport from main)
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
@@ -0,0 +1,10 @@
"use strict";
exports.isWithinInterval = void 0;
var _index = require("../isWithinInterval.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const isWithinInterval = (exports.isWithinInterval = (0, _index2.convertToFP)(
_index.isWithinInterval,
2,
));
@@ -0,0 +1 @@
{"version":3,"file":"pong.cjs","names":[],"sources":["../../../src/realtime/commands/pong.ts"],"sourcesContent":["export const pong = () => JSON.stringify({ type: 'pong' });\n"],"mappings":"AAAA,MAAa,MAAa,KAAK,UAAU,CAAE,KAAM,OAAQ,CAAC"}
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"A B","2":"K D E F zC"},B:{"1":"C L M G N O P","322":"0 1 2 3 4 5 6 7 8 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I"},C:{"2":"9 0C VC J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB 4C 5C","194":"0 1 2 3 4 5 6 7 8 gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC 1C 2C 3C"},D:{"2":"9 J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB","322":"0 1 2 3 4 5 6 7 8 sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC"},E:{"1":"D E F A B C L M G 8C 9C AD cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","2":"J bB K 6C bC 7C"},F:{"2":"9 F B C G N O P cB AB BB CB DB EB FB GB HB IB dB eB JD KD LD MD PC xC ND QC","322":"0 1 2 3 4 5 6 7 8 fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z"},G:{"1":"E RD SD TD UD VD WD XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC","2":"bC OD yC PD QD"},H:{"2":"mD"},I:{"2":"VC J I nD oD pD qD yC rD sD"},J:{"2":"D A"},K:{"2":"A B C PC xC QC","322":"H"},L:{"322":"I"},M:{"2":"OC"},N:{"1":"A B"},O:{"322":"RC"},P:{"2":"9 J AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D"},Q:{"322":"4D"},R:{"322":"5D"},S:{"194":"6D 7D"}},B:1,C:"Audio Tracks",D:true};
@@ -0,0 +1,344 @@
"use strict";
exports.formatDistance = void 0;
function isPluralType(val) {
return val.one !== undefined;
}
const formatDistanceLocale = {
lessThanXSeconds: {
present: {
one: "manj kot {{count}} sekunda",
two: "manj kot {{count}} sekundi",
few: "manj kot {{count}} sekunde",
other: "manj kot {{count}} sekund",
},
past: {
one: "manj kot {{count}} sekundo",
two: "manj kot {{count}} sekundama",
few: "manj kot {{count}} sekundami",
other: "manj kot {{count}} sekundami",
},
future: {
one: "manj kot {{count}} sekundo",
two: "manj kot {{count}} sekundi",
few: "manj kot {{count}} sekunde",
other: "manj kot {{count}} sekund",
},
},
xSeconds: {
present: {
one: "{{count}} sekunda",
two: "{{count}} sekundi",
few: "{{count}} sekunde",
other: "{{count}} sekund",
},
past: {
one: "{{count}} sekundo",
two: "{{count}} sekundama",
few: "{{count}} sekundami",
other: "{{count}} sekundami",
},
future: {
one: "{{count}} sekundo",
two: "{{count}} sekundi",
few: "{{count}} sekunde",
other: "{{count}} sekund",
},
},
halfAMinute: "pol minute",
lessThanXMinutes: {
present: {
one: "manj kot {{count}} minuta",
two: "manj kot {{count}} minuti",
few: "manj kot {{count}} minute",
other: "manj kot {{count}} minut",
},
past: {
one: "manj kot {{count}} minuto",
two: "manj kot {{count}} minutama",
few: "manj kot {{count}} minutami",
other: "manj kot {{count}} minutami",
},
future: {
one: "manj kot {{count}} minuto",
two: "manj kot {{count}} minuti",
few: "manj kot {{count}} minute",
other: "manj kot {{count}} minut",
},
},
xMinutes: {
present: {
one: "{{count}} minuta",
two: "{{count}} minuti",
few: "{{count}} minute",
other: "{{count}} minut",
},
past: {
one: "{{count}} minuto",
two: "{{count}} minutama",
few: "{{count}} minutami",
other: "{{count}} minutami",
},
future: {
one: "{{count}} minuto",
two: "{{count}} minuti",
few: "{{count}} minute",
other: "{{count}} minut",
},
},
aboutXHours: {
present: {
one: "približno {{count}} ura",
two: "približno {{count}} uri",
few: "približno {{count}} ure",
other: "približno {{count}} ur",
},
past: {
one: "približno {{count}} uro",
two: "približno {{count}} urama",
few: "približno {{count}} urami",
other: "približno {{count}} urami",
},
future: {
one: "približno {{count}} uro",
two: "približno {{count}} uri",
few: "približno {{count}} ure",
other: "približno {{count}} ur",
},
},
xHours: {
present: {
one: "{{count}} ura",
two: "{{count}} uri",
few: "{{count}} ure",
other: "{{count}} ur",
},
past: {
one: "{{count}} uro",
two: "{{count}} urama",
few: "{{count}} urami",
other: "{{count}} urami",
},
future: {
one: "{{count}} uro",
two: "{{count}} uri",
few: "{{count}} ure",
other: "{{count}} ur",
},
},
xDays: {
present: {
one: "{{count}} dan",
two: "{{count}} dni",
few: "{{count}} dni",
other: "{{count}} dni",
},
past: {
one: "{{count}} dnem",
two: "{{count}} dnevoma",
few: "{{count}} dnevi",
other: "{{count}} dnevi",
},
future: {
one: "{{count}} dan",
two: "{{count}} dni",
few: "{{count}} dni",
other: "{{count}} dni",
},
},
// no tenses for weeks?
aboutXWeeks: {
one: "približno {{count}} teden",
two: "približno {{count}} tedna",
few: "približno {{count}} tedne",
other: "približno {{count}} tednov",
},
// no tenses for weeks?
xWeeks: {
one: "{{count}} teden",
two: "{{count}} tedna",
few: "{{count}} tedne",
other: "{{count}} tednov",
},
aboutXMonths: {
present: {
one: "približno {{count}} mesec",
two: "približno {{count}} meseca",
few: "približno {{count}} mesece",
other: "približno {{count}} mesecev",
},
past: {
one: "približno {{count}} mesecem",
two: "približno {{count}} mesecema",
few: "približno {{count}} meseci",
other: "približno {{count}} meseci",
},
future: {
one: "približno {{count}} mesec",
two: "približno {{count}} meseca",
few: "približno {{count}} mesece",
other: "približno {{count}} mesecev",
},
},
xMonths: {
present: {
one: "{{count}} mesec",
two: "{{count}} meseca",
few: "{{count}} meseci",
other: "{{count}} mesecev",
},
past: {
one: "{{count}} mesecem",
two: "{{count}} mesecema",
few: "{{count}} meseci",
other: "{{count}} meseci",
},
future: {
one: "{{count}} mesec",
two: "{{count}} meseca",
few: "{{count}} mesece",
other: "{{count}} mesecev",
},
},
aboutXYears: {
present: {
one: "približno {{count}} leto",
two: "približno {{count}} leti",
few: "približno {{count}} leta",
other: "približno {{count}} let",
},
past: {
one: "približno {{count}} letom",
two: "približno {{count}} letoma",
few: "približno {{count}} leti",
other: "približno {{count}} leti",
},
future: {
one: "približno {{count}} leto",
two: "približno {{count}} leti",
few: "približno {{count}} leta",
other: "približno {{count}} let",
},
},
xYears: {
present: {
one: "{{count}} leto",
two: "{{count}} leti",
few: "{{count}} leta",
other: "{{count}} let",
},
past: {
one: "{{count}} letom",
two: "{{count}} letoma",
few: "{{count}} leti",
other: "{{count}} leti",
},
future: {
one: "{{count}} leto",
two: "{{count}} leti",
few: "{{count}} leta",
other: "{{count}} let",
},
},
overXYears: {
present: {
one: "več kot {{count}} leto",
two: "več kot {{count}} leti",
few: "več kot {{count}} leta",
other: "več kot {{count}} let",
},
past: {
one: "več kot {{count}} letom",
two: "več kot {{count}} letoma",
few: "več kot {{count}} leti",
other: "več kot {{count}} leti",
},
future: {
one: "več kot {{count}} leto",
two: "več kot {{count}} leti",
few: "več kot {{count}} leta",
other: "več kot {{count}} let",
},
},
almostXYears: {
present: {
one: "skoraj {{count}} leto",
two: "skoraj {{count}} leti",
few: "skoraj {{count}} leta",
other: "skoraj {{count}} let",
},
past: {
one: "skoraj {{count}} letom",
two: "skoraj {{count}} letoma",
few: "skoraj {{count}} leti",
other: "skoraj {{count}} leti",
},
future: {
one: "skoraj {{count}} leto",
two: "skoraj {{count}} leti",
few: "skoraj {{count}} leta",
other: "skoraj {{count}} let",
},
},
};
function getFormFromCount(count) {
switch (count % 100) {
case 1:
return "one";
case 2:
return "two";
case 3:
case 4:
return "few";
default:
return "other";
}
}
const formatDistance = (token, count, options) => {
let result = "";
let tense = "present";
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
tense = "future";
result = "čez ";
} else {
tense = "past";
result = "pred ";
}
}
const tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result += tokenValue;
} else {
const form = getFormFromCount(count);
if (isPluralType(tokenValue)) {
result += tokenValue[form].replace("{{count}}", String(count));
} else {
result += tokenValue[tense][form].replace("{{count}}", String(count));
}
}
return result;
};
exports.formatDistance = formatDistance;
@@ -0,0 +1,250 @@
'use strict';
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
const color = require('kleur');
const Prompt = require('./prompt');
const _require = require('../util'),
style = _require.style,
clear = _require.clear,
figures = _require.figures;
const _require2 = require('sisteransi'),
erase = _require2.erase,
cursor = _require2.cursor;
const _require3 = require('../dateparts'),
DatePart = _require3.DatePart,
Meridiem = _require3.Meridiem,
Day = _require3.Day,
Hours = _require3.Hours,
Milliseconds = _require3.Milliseconds,
Minutes = _require3.Minutes,
Month = _require3.Month,
Seconds = _require3.Seconds,
Year = _require3.Year;
const regex = /\\(.)|"((?:\\["\\]|[^"])+)"|(D[Do]?|d{3,4}|d)|(M{1,4})|(YY(?:YY)?)|([aA])|([Hh]{1,2})|(m{1,2})|(s{1,2})|(S{1,4})|./g;
const regexGroups = {
1: ({
token
}) => token.replace(/\\(.)/g, '$1'),
2: opts => new Day(opts),
// Day // TODO
3: opts => new Month(opts),
// Month
4: opts => new Year(opts),
// Year
5: opts => new Meridiem(opts),
// AM/PM // TODO (special)
6: opts => new Hours(opts),
// Hours
7: opts => new Minutes(opts),
// Minutes
8: opts => new Seconds(opts),
// Seconds
9: opts => new Milliseconds(opts) // Fractional seconds
};
const dfltLocales = {
months: 'January,February,March,April,May,June,July,August,September,October,November,December'.split(','),
monthsShort: 'Jan,Feb,Mar,Apr,May,Jun,Jul,Aug,Sep,Oct,Nov,Dec'.split(','),
weekdays: 'Sunday,Monday,Tuesday,Wednesday,Thursday,Friday,Saturday'.split(','),
weekdaysShort: 'Sun,Mon,Tue,Wed,Thu,Fri,Sat'.split(',')
};
/**
* DatePrompt Base Element
* @param {Object} opts Options
* @param {String} opts.message Message
* @param {Number} [opts.initial] Index of default value
* @param {String} [opts.mask] The format mask
* @param {object} [opts.locales] The date locales
* @param {String} [opts.error] The error message shown on invalid value
* @param {Function} [opts.validate] Function to validate the submitted value
* @param {Stream} [opts.stdin] The Readable stream to listen to
* @param {Stream} [opts.stdout] The Writable stream to write readline data to
*/
class DatePrompt extends Prompt {
constructor(opts = {}) {
super(opts);
this.msg = opts.message;
this.cursor = 0;
this.typed = '';
this.locales = Object.assign(dfltLocales, opts.locales);
this._date = opts.initial || new Date();
this.errorMsg = opts.error || 'Please Enter A Valid Value';
this.validator = opts.validate || (() => true);
this.mask = opts.mask || 'YYYY-MM-DD HH:mm:ss';
this.clear = clear('', this.out.columns);
this.render();
}
get value() {
return this.date;
}
get date() {
return this._date;
}
set date(date) {
if (date) this._date.setTime(date.getTime());
}
set mask(mask) {
let result;
this.parts = [];
while (result = regex.exec(mask)) {
let match = result.shift();
let idx = result.findIndex(gr => gr != null);
this.parts.push(idx in regexGroups ? regexGroups[idx]({
token: result[idx] || match,
date: this.date,
parts: this.parts,
locales: this.locales
}) : result[idx] || match);
}
let parts = this.parts.reduce((arr, i) => {
if (typeof i === 'string' && typeof arr[arr.length - 1] === 'string') arr[arr.length - 1] += i;else arr.push(i);
return arr;
}, []);
this.parts.splice(0);
this.parts.push(...parts);
this.reset();
}
moveCursor(n) {
this.typed = '';
this.cursor = n;
this.fire();
}
reset() {
this.moveCursor(this.parts.findIndex(p => p instanceof DatePart));
this.fire();
this.render();
}
exit() {
this.abort();
}
abort() {
this.done = this.aborted = true;
this.error = false;
this.fire();
this.render();
this.out.write('\n');
this.close();
}
validate() {
var _this = this;
return _asyncToGenerator(function* () {
let valid = yield _this.validator(_this.value);
if (typeof valid === 'string') {
_this.errorMsg = valid;
valid = false;
}
_this.error = !valid;
})();
}
submit() {
var _this2 = this;
return _asyncToGenerator(function* () {
yield _this2.validate();
if (_this2.error) {
_this2.color = 'red';
_this2.fire();
_this2.render();
return;
}
_this2.done = true;
_this2.aborted = false;
_this2.fire();
_this2.render();
_this2.out.write('\n');
_this2.close();
})();
}
up() {
this.typed = '';
this.parts[this.cursor].up();
this.render();
}
down() {
this.typed = '';
this.parts[this.cursor].down();
this.render();
}
left() {
let prev = this.parts[this.cursor].prev();
if (prev == null) return this.bell();
this.moveCursor(this.parts.indexOf(prev));
this.render();
}
right() {
let next = this.parts[this.cursor].next();
if (next == null) return this.bell();
this.moveCursor(this.parts.indexOf(next));
this.render();
}
next() {
let next = this.parts[this.cursor].next();
this.moveCursor(next ? this.parts.indexOf(next) : this.parts.findIndex(part => part instanceof DatePart));
this.render();
}
_(c) {
if (/\d/.test(c)) {
this.typed += c;
this.parts[this.cursor].setTo(this.typed);
this.render();
}
}
render() {
if (this.closed) return;
if (this.firstRender) this.out.write(cursor.hide);else this.out.write(clear(this.outputText, this.out.columns));
super.render(); // Print prompt
this.outputText = [style.symbol(this.done, this.aborted), color.bold(this.msg), style.delimiter(false), this.parts.reduce((arr, p, idx) => arr.concat(idx === this.cursor && !this.done ? color.cyan().underline(p.toString()) : p), []).join('')].join(' '); // Print error
if (this.error) {
this.outputText += this.errorMsg.split('\n').reduce((a, l, i) => a + `\n${i ? ` ` : figures.pointerSmall} ${color.red().italic(l)}`, ``);
}
this.out.write(erase.line + cursor.to(0) + this.outputText);
}
}
module.exports = DatePrompt;
@@ -0,0 +1,32 @@
<h1 align="center">
<br>
<picture>
<source media="(prefers-color-scheme: dark)" srcset=".github/logo-dark.svg">
<img width="160" alt="tsx" src=".github/logo-light.svg">
</picture>
<br><br>
<a href="https://npm.im/tsx"><img src="https://badgen.net/npm/v/tsx"></a> <a href="https://npm.im/tsx"><img src="https://badgen.net/npm/dm/tsx"></a>
</h1>
<p align="center">
TypeScript Execute (tsx): The easiest way to run TypeScript in Node.js
<br><br>
<a href="https://tsx.is">Documentation</a>&nbsp;&nbsp;&nbsp;&nbsp;|&nbsp;&nbsp;&nbsp;&nbsp;<a href="https://tsx.is/getting-started">Getting started →</a>
</p>
<br>
<p align="center">
<a href="https://github.com/sponsors/privatenumber/sponsorships?tier_id=398771"><img width="412" src="https://raw.githubusercontent.com/privatenumber/sponsors/master/banners/assets/donate.webp"></a>
<a href="https://github.com/sponsors/privatenumber/sponsorships?tier_id=416984"><img width="412" src="https://raw.githubusercontent.com/privatenumber/sponsors/master/banners/assets/sponsor.webp"></a>
</p>
<p align="center"><sup><i>Already a sponsor?</i> Join the discussion in the <a href="https://github.com/pvtnbr/tsx">Development repo</a>!</sup></p>
## Sponsors
<p align="center">
<a href="https://github.com/sponsors/privatenumber">
<img src="https://cdn.jsdelivr.net/gh/privatenumber/sponsors/sponsorkit/sponsors.svg">
</a>
</p>
@@ -0,0 +1 @@
{"version":3,"file":"appendVersionToQueryKey.d.ts","sourceRoot":"","sources":["../../../src/versions/drafts/appendVersionToQueryKey.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAA;AAEjD,eAAO,MAAM,uBAAuB,WAAW,KAAK,KAAQ,KAqB3D,CAAA"}
@@ -0,0 +1,171 @@
import type {KeywordCxt} from "."
import type {
AnySchema,
SchemaValidateFunction,
AnyValidateFunction,
AddedKeywordDefinition,
MacroKeywordDefinition,
FuncKeywordDefinition,
} from "../../types"
import type {SchemaObjCxt} from ".."
import {_, nil, not, stringify, Code, Name, CodeGen} from "../codegen"
import N from "../names"
import type {JSONType} from "../rules"
import {callValidateCode} from "../../vocabularies/code"
import {extendErrors} from "../errors"
type KeywordCompilationResult = AnySchema | SchemaValidateFunction | AnyValidateFunction
export function macroKeywordCode(cxt: KeywordCxt, def: MacroKeywordDefinition): void {
const {gen, keyword, schema, parentSchema, it} = cxt
const macroSchema = def.macro.call(it.self, schema, parentSchema, it)
const schemaRef = useKeyword(gen, keyword, macroSchema)
if (it.opts.validateSchema !== false) it.self.validateSchema(macroSchema, true)
const valid = gen.name("valid")
cxt.subschema(
{
schema: macroSchema,
schemaPath: nil,
errSchemaPath: `${it.errSchemaPath}/${keyword}`,
topSchemaRef: schemaRef,
compositeRule: true,
},
valid
)
cxt.pass(valid, () => cxt.error(true))
}
export function funcKeywordCode(cxt: KeywordCxt, def: FuncKeywordDefinition): void {
const {gen, keyword, schema, parentSchema, $data, it} = cxt
checkAsyncKeyword(it, def)
const validate =
!$data && def.compile ? def.compile.call(it.self, schema, parentSchema, it) : def.validate
const validateRef = useKeyword(gen, keyword, validate)
const valid = gen.let("valid")
cxt.block$data(valid, validateKeyword)
cxt.ok(def.valid ?? valid)
function validateKeyword(): void {
if (def.errors === false) {
assignValid()
if (def.modifying) modifyData(cxt)
reportErrs(() => cxt.error())
} else {
const ruleErrs = def.async ? validateAsync() : validateSync()
if (def.modifying) modifyData(cxt)
reportErrs(() => addErrs(cxt, ruleErrs))
}
}
function validateAsync(): Name {
const ruleErrs = gen.let("ruleErrs", null)
gen.try(
() => assignValid(_`await `),
(e) =>
gen.assign(valid, false).if(
_`${e} instanceof ${it.ValidationError as Name}`,
() => gen.assign(ruleErrs, _`${e}.errors`),
() => gen.throw(e)
)
)
return ruleErrs
}
function validateSync(): Code {
const validateErrs = _`${validateRef}.errors`
gen.assign(validateErrs, null)
assignValid(nil)
return validateErrs
}
function assignValid(_await: Code = def.async ? _`await ` : nil): void {
const passCxt = it.opts.passContext ? N.this : N.self
const passSchema = !(("compile" in def && !$data) || def.schema === false)
gen.assign(
valid,
_`${_await}${callValidateCode(cxt, validateRef, passCxt, passSchema)}`,
def.modifying
)
}
function reportErrs(errors: () => void): void {
gen.if(not(def.valid ?? valid), errors)
}
}
function modifyData(cxt: KeywordCxt): void {
const {gen, data, it} = cxt
gen.if(it.parentData, () => gen.assign(data, _`${it.parentData}[${it.parentDataProperty}]`))
}
function addErrs(cxt: KeywordCxt, errs: Code): void {
const {gen} = cxt
gen.if(
_`Array.isArray(${errs})`,
() => {
gen
.assign(N.vErrors, _`${N.vErrors} === null ? ${errs} : ${N.vErrors}.concat(${errs})`)
.assign(N.errors, _`${N.vErrors}.length`)
extendErrors(cxt)
},
() => cxt.error()
)
}
function checkAsyncKeyword({schemaEnv}: SchemaObjCxt, def: FuncKeywordDefinition): void {
if (def.async && !schemaEnv.$async) throw new Error("async keyword in sync schema")
}
function useKeyword(gen: CodeGen, keyword: string, result?: KeywordCompilationResult): Name {
if (result === undefined) throw new Error(`keyword "${keyword}" failed to compile`)
return gen.scopeValue(
"keyword",
typeof result == "function" ? {ref: result} : {ref: result, code: stringify(result)}
)
}
export function validSchemaType(
schema: unknown,
schemaType: JSONType[],
allowUndefined = false
): boolean {
// TODO add tests
return (
!schemaType.length ||
schemaType.some((st) =>
st === "array"
? Array.isArray(schema)
: st === "object"
? schema && typeof schema == "object" && !Array.isArray(schema)
: typeof schema == st || (allowUndefined && typeof schema == "undefined")
)
)
}
export function validateKeywordUsage(
{schema, opts, self, errSchemaPath}: SchemaObjCxt,
def: AddedKeywordDefinition,
keyword: string
): void {
/* istanbul ignore if */
if (Array.isArray(def.keyword) ? !def.keyword.includes(keyword) : def.keyword !== keyword) {
throw new Error("ajv implementation error")
}
const deps = def.dependencies
if (deps?.some((kwd) => !Object.prototype.hasOwnProperty.call(schema, kwd))) {
throw new Error(`parent schema must have dependencies of ${keyword}: ${deps.join(",")}`)
}
if (def.validateSchema) {
const valid = def.validateSchema(schema[keyword])
if (!valid) {
const msg =
`keyword "${keyword}" value is invalid at path "${errSchemaPath}": ` +
self.errorsText(def.validateSchema.errors)
if (opts.validateSchema === "log") self.logger.error(msg)
else throw new Error(msg)
}
}
}
@@ -0,0 +1 @@
{"version":3,"file":"envPaths.d.ts","sourceRoot":"","sources":["../../../../src/utilities/telemetry/conf/envPaths.ts"],"names":[],"mappings":"AACA;;;;;;;;;;;;GAYG;AAkDH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,MAAiB,EAAE;;CAAK;;;;;;EAmBhE"}
@@ -0,0 +1 @@
{"version":3,"file":"buildAfterOperation.d.ts","sourceRoot":"","sources":["../../../../src/collections/operations/utilities/buildAfterOperation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACvD,OAAO,KAAK,EAAE,iBAAiB,EAAE,YAAY,EAAE,eAAe,EAAE,MAAM,YAAY,CAAA;AAElF,eAAO,MAAM,mBAAmB,GAC9B,iBAAiB,SAAS,cAAc,EACxC,CAAC,SAAS,MAAM,YAAY,CAAC,iBAAiB,CAAC,yDAEhC;IAAE,SAAS,EAAE,CAAC,CAAA;CAAE,GAAG,IAAI,CAAC,iBAAiB,CAAC,iBAAiB,CAAC,EAAE,KAAK,CAAC,KAClF,OAAO,CAAC,GAAG,GAAG,eAAe,CAAC,iBAAiB,EAAE,CAAC,CAAC,CAuBrD,CAAA"}
@@ -0,0 +1 @@
{"version":3,"file":"rewriteframes.d.ts","sourceRoot":"","sources":["../../../src/integrations/rewriteframes.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAK5D,KAAK,kBAAkB,GAAG,CAAC,KAAK,EAAE,UAAU,KAAK,UAAU,CAAC;AAI5D,UAAU,oBAAoB;IAC5B;;;;;;;;;;;;;;;;;;OAkBG;IACH,IAAI,CAAC,EAAE,MAAM,CAAC;IAEd;;;;;;;;OAQG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,QAAQ,CAAC,EAAE,kBAAkB,CAAC;CAC/B;AAED;;GAEG;AACH,eAAO,MAAM,wBAAwB,0EAgDnC,CAAC;AAEH;;GAEG;AACH,wBAAgB,gBAAgB,CAAC,EAC/B,SAAS,EACT,IAAI,EACJ,MAAM,GACP,EAAE;IACD,SAAS,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CAChB,GAAG,kBAAkB,CAoCrB"}
@@ -0,0 +1,143 @@
"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 __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
Object.defineProperty(o, "default", { enumerable: true, value: v });
}) : function(o, v) {
o["default"] = v;
});
var __importStar = (this && this.__importStar) || function (mod) {
if (mod && mod.__esModule) return mod;
var result = {};
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
__setModuleDefault(result, mod);
return result;
};
Object.defineProperty(exports, "__esModule", { value: true });
exports.default = default_1;
const util = __importStar(require("../core/util.cjs"));
const error = () => {
const Sizable = {
string: { unit: "znaków", verb: "mieć" },
file: { unit: "bajtów", verb: "mieć" },
array: { unit: "elementów", verb: "mieć" },
set: { unit: "elementów", verb: "mieć" },
};
function getSizing(origin) {
return Sizable[origin] ?? null;
}
const parsedType = (data) => {
const t = typeof data;
switch (t) {
case "number": {
return Number.isNaN(data) ? "NaN" : "liczba";
}
case "object": {
if (Array.isArray(data)) {
return "tablica";
}
if (data === null) {
return "null";
}
if (Object.getPrototypeOf(data) !== Object.prototype && data.constructor) {
return data.constructor.name;
}
}
}
return t;
};
const Nouns = {
regex: "wyrażenie",
email: "adres email",
url: "URL",
emoji: "emoji",
uuid: "UUID",
uuidv4: "UUIDv4",
uuidv6: "UUIDv6",
nanoid: "nanoid",
guid: "GUID",
cuid: "cuid",
cuid2: "cuid2",
ulid: "ULID",
xid: "XID",
ksuid: "KSUID",
datetime: "data i godzina w formacie ISO",
date: "data w formacie ISO",
time: "godzina w formacie ISO",
duration: "czas trwania ISO",
ipv4: "adres IPv4",
ipv6: "adres IPv6",
cidrv4: "zakres IPv4",
cidrv6: "zakres IPv6",
base64: "ciąg znaków zakodowany w formacie base64",
base64url: "ciąg znaków zakodowany w formacie base64url",
json_string: "ciąg znaków w formacie JSON",
e164: "liczba E.164",
jwt: "JWT",
template_literal: "wejście",
};
return (issue) => {
switch (issue.code) {
case "invalid_type":
return `Nieprawidłowe dane wejściowe: oczekiwano ${issue.expected}, otrzymano ${parsedType(issue.input)}`;
case "invalid_value":
if (issue.values.length === 1)
return `Nieprawidłowe dane wejściowe: oczekiwano ${util.stringifyPrimitive(issue.values[0])}`;
return `Nieprawidłowa opcja: oczekiwano jednej z wartości ${util.joinValues(issue.values, "|")}`;
case "too_big": {
const adj = issue.inclusive ? "<=" : "<";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Za duża wartość: oczekiwano, że ${issue.origin ?? "wartość"} będzie mieć ${adj}${issue.maximum.toString()} ${sizing.unit ?? "elementów"}`;
}
return `Zbyt duż(y/a/e): oczekiwano, że ${issue.origin ?? "wartość"} będzie wynosić ${adj}${issue.maximum.toString()}`;
}
case "too_small": {
const adj = issue.inclusive ? ">=" : ">";
const sizing = getSizing(issue.origin);
if (sizing) {
return `Za mała wartość: oczekiwano, że ${issue.origin ?? "wartość"} będzie mieć ${adj}${issue.minimum.toString()} ${sizing.unit ?? "elementów"}`;
}
return `Zbyt mał(y/a/e): oczekiwano, że ${issue.origin ?? "wartość"} będzie wynosić ${adj}${issue.minimum.toString()}`;
}
case "invalid_format": {
const _issue = issue;
if (_issue.format === "starts_with")
return `Nieprawidłowy ciąg znaków: musi zaczynać się od "${_issue.prefix}"`;
if (_issue.format === "ends_with")
return `Nieprawidłowy ciąg znaków: musi kończyć się na "${_issue.suffix}"`;
if (_issue.format === "includes")
return `Nieprawidłowy ciąg znaków: musi zawierać "${_issue.includes}"`;
if (_issue.format === "regex")
return `Nieprawidłowy ciąg znaków: musi odpowiadać wzorcowi ${_issue.pattern}`;
return `Nieprawidłow(y/a/e) ${Nouns[_issue.format] ?? issue.format}`;
}
case "not_multiple_of":
return `Nieprawidłowa liczba: musi być wielokrotnością ${issue.divisor}`;
case "unrecognized_keys":
return `Nierozpoznane klucze${issue.keys.length > 1 ? "s" : ""}: ${util.joinValues(issue.keys, ", ")}`;
case "invalid_key":
return `Nieprawidłowy klucz w ${issue.origin}`;
case "invalid_union":
return "Nieprawidłowe dane wejściowe";
case "invalid_element":
return `Nieprawidłowa wartość w ${issue.origin}`;
default:
return `Nieprawidłowe dane wejściowe`;
}
};
};
function default_1() {
return {
localeError: error(),
};
}
@@ -0,0 +1,166 @@
// https://www.postgresql.org/docs/current/protocol-message-formats.html
import BufferList from './buffer-list'
const buffers = {
readyForQuery: function () {
return new BufferList().add(Buffer.from('I')).join(true, 'Z')
},
authenticationOk: function () {
return new BufferList().addInt32(0).join(true, 'R')
},
authenticationCleartextPassword: function () {
return new BufferList().addInt32(3).join(true, 'R')
},
authenticationMD5Password: function () {
return new BufferList()
.addInt32(5)
.add(Buffer.from([1, 2, 3, 4]))
.join(true, 'R')
},
authenticationSASL: function () {
return new BufferList().addInt32(10).addCString('SCRAM-SHA-256').addCString('').join(true, 'R')
},
authenticationSASLContinue: function () {
return new BufferList().addInt32(11).addString('data').join(true, 'R')
},
authenticationSASLFinal: function () {
return new BufferList().addInt32(12).addString('data').join(true, 'R')
},
parameterStatus: function (name: string, value: string) {
return new BufferList().addCString(name).addCString(value).join(true, 'S')
},
backendKeyData: function (processID: number, secretKey: number) {
return new BufferList().addInt32(processID).addInt32(secretKey).join(true, 'K')
},
commandComplete: function (string: string) {
return new BufferList().addCString(string).join(true, 'C')
},
rowDescription: function (fields: any[]) {
fields = fields || []
const buf = new BufferList()
buf.addInt16(fields.length)
fields.forEach(function (field) {
buf
.addCString(field.name)
.addInt32(field.tableID || 0)
.addInt16(field.attributeNumber || 0)
.addInt32(field.dataTypeID || 0)
.addInt16(field.dataTypeSize || 0)
.addInt32(field.typeModifier || 0)
.addInt16(field.formatCode || 0)
})
return buf.join(true, 'T')
},
parameterDescription: function (dataTypeIDs: number[]) {
dataTypeIDs = dataTypeIDs || []
const buf = new BufferList()
buf.addInt16(dataTypeIDs.length)
dataTypeIDs.forEach(function (dataTypeID) {
buf.addInt32(dataTypeID)
})
return buf.join(true, 't')
},
dataRow: function (columns: any[]) {
columns = columns || []
const buf = new BufferList()
buf.addInt16(columns.length)
columns.forEach(function (col) {
if (col == null) {
buf.addInt32(-1)
} else {
const strBuf = Buffer.from(col, 'utf8')
buf.addInt32(strBuf.length)
buf.add(strBuf)
}
})
return buf.join(true, 'D')
},
error: function (fields: any) {
return buffers.errorOrNotice(fields).join(true, 'E')
},
notice: function (fields: any) {
return buffers.errorOrNotice(fields).join(true, 'N')
},
errorOrNotice: function (fields: any) {
fields = fields || []
const buf = new BufferList()
fields.forEach(function (field: any) {
buf.addChar(field.type)
buf.addCString(field.value)
})
return buf.add(Buffer.from([0])) // terminator
},
parseComplete: function () {
return new BufferList().join(true, '1')
},
bindComplete: function () {
return new BufferList().join(true, '2')
},
notification: function (id: number, channel: string, payload: string) {
return new BufferList().addInt32(id).addCString(channel).addCString(payload).join(true, 'A')
},
emptyQuery: function () {
return new BufferList().join(true, 'I')
},
portalSuspended: function () {
return new BufferList().join(true, 's')
},
closeComplete: function () {
return new BufferList().join(true, '3')
},
copyIn: function (cols: number) {
const list = new BufferList()
// text mode
.addByte(0)
// column count
.addInt16(cols)
for (let i = 0; i < cols; i++) {
list.addInt16(i)
}
return list.join(true, 'G')
},
copyOut: function (cols: number) {
const list = new BufferList()
// text mode
.addByte(0)
// column count
.addInt16(cols)
for (let i = 0; i < cols; i++) {
list.addInt16(i)
}
return list.join(true, 'H')
},
copyData: function (bytes: Buffer) {
return new BufferList().add(bytes).join(true, 'd')
},
copyDone: function () {
return new BufferList().join(true, 'c')
},
}
export default buffers
@@ -0,0 +1 @@
{"version":3,"file":"getIsLocked.js","names":["sanitizeID","extractID","getIsLocked","id","collectionConfig","globalConfig","isEditing","req","entityConfig","entityHasLockingEnabled","lockDocuments","undefined","payload","collections","isLocked","where","lockDurationDefault","lockDuration","duration","lockDurationInMilliseconds","now","Date","getTime","and","globalSlug","equals","slug","updatedAt","greater_than","docs","find","collection","depth","overrideAccess","length","currentEditor","user","value","lastUpdateTime"],"sources":["../../../src/views/Document/getIsLocked.ts"],"sourcesContent":["import type {\n PayloadRequest,\n SanitizedCollectionConfig,\n SanitizedGlobalConfig,\n TypedUser,\n Where,\n} from 'payload'\n\nimport { sanitizeID } from '@payloadcms/ui/shared'\nimport { extractID } from 'payload/shared'\n\ntype Args = {\n collectionConfig?: SanitizedCollectionConfig\n globalConfig?: SanitizedGlobalConfig\n id?: number | string\n isEditing: boolean\n req: PayloadRequest\n}\n\ntype Result = Promise<{\n currentEditor?: TypedUser\n isLocked: boolean\n lastUpdateTime?: number\n}>\n\nexport const getIsLocked = async ({\n id,\n collectionConfig,\n globalConfig,\n isEditing,\n req,\n}: Args): Result => {\n const entityConfig = collectionConfig || globalConfig\n\n const entityHasLockingEnabled =\n entityConfig?.lockDocuments !== undefined ? entityConfig?.lockDocuments : true\n\n // Check if the locked-documents collection exists\n if (!req.payload.collections?.['payload-locked-documents']) {\n // If the collection doesn't exist, locking is not available\n return {\n isLocked: false,\n }\n }\n\n if (!entityHasLockingEnabled || !isEditing) {\n return {\n isLocked: false,\n }\n }\n\n const where: Where = {}\n\n const lockDurationDefault = 300 // Default 5 minutes in seconds\n const lockDuration =\n typeof entityConfig.lockDocuments === 'object'\n ? entityConfig.lockDocuments.duration\n : lockDurationDefault\n const lockDurationInMilliseconds = lockDuration * 1000\n\n const now = new Date().getTime()\n\n if (globalConfig) {\n where.and = [\n {\n globalSlug: {\n equals: globalConfig.slug,\n },\n },\n {\n updatedAt: {\n greater_than: new Date(now - lockDurationInMilliseconds),\n },\n },\n ]\n } else {\n where.and = [\n {\n 'document.value': {\n equals: sanitizeID(id),\n },\n },\n {\n 'document.relationTo': {\n equals: collectionConfig.slug,\n },\n },\n {\n updatedAt: {\n greater_than: new Date(now - lockDurationInMilliseconds),\n },\n },\n ]\n }\n\n const { docs } = await req.payload.find({\n collection: 'payload-locked-documents',\n depth: 1,\n overrideAccess: false,\n req,\n where,\n })\n\n if (docs.length > 0) {\n const currentEditor = docs[0].user?.value\n const lastUpdateTime = new Date(docs[0].updatedAt).getTime()\n\n if (extractID(currentEditor) !== req.user.id) {\n return {\n currentEditor,\n isLocked: true,\n lastUpdateTime,\n }\n }\n }\n\n return {\n isLocked: false,\n }\n}\n"],"mappings":"AAQA,SAASA,UAAU,QAAQ;AAC3B,SAASC,SAAS,QAAQ;AAgB1B,OAAO,MAAMC,WAAA,GAAc,MAAAA,CAAO;EAChCC,EAAE;EACFC,gBAAgB;EAChBC,YAAY;EACZC,SAAS;EACTC;AAAG,CACE;EACL,MAAMC,YAAA,GAAeJ,gBAAA,IAAoBC,YAAA;EAEzC,MAAMI,uBAAA,GACJD,YAAA,EAAcE,aAAA,KAAkBC,SAAA,GAAYH,YAAA,EAAcE,aAAA,GAAgB;EAE5E;EACA,IAAI,CAACH,GAAA,CAAIK,OAAO,CAACC,WAAW,GAAG,2BAA2B,EAAE;IAC1D;IACA,OAAO;MACLC,QAAA,EAAU;IACZ;EACF;EAEA,IAAI,CAACL,uBAAA,IAA2B,CAACH,SAAA,EAAW;IAC1C,OAAO;MACLQ,QAAA,EAAU;IACZ;EACF;EAEA,MAAMC,KAAA,GAAe,CAAC;EAEtB,MAAMC,mBAAA,GAAsB,IAAI;AAAA;EAChC,MAAMC,YAAA,GACJ,OAAOT,YAAA,CAAaE,aAAa,KAAK,WAClCF,YAAA,CAAaE,aAAa,CAACQ,QAAQ,GACnCF,mBAAA;EACN,MAAMG,0BAAA,GAA6BF,YAAA,GAAe;EAElD,MAAMG,GAAA,GAAM,IAAIC,IAAA,GAAOC,OAAO;EAE9B,IAAIjB,YAAA,EAAc;IAChBU,KAAA,CAAMQ,GAAG,GAAG,CACV;MACEC,UAAA,EAAY;QACVC,MAAA,EAAQpB,YAAA,CAAaqB;MACvB;IACF,GACA;MACEC,SAAA,EAAW;QACTC,YAAA,EAAc,IAAIP,IAAA,CAAKD,GAAA,GAAMD,0BAAA;MAC/B;IACF,EACD;EACH,OAAO;IACLJ,KAAA,CAAMQ,GAAG,GAAG,CACV;MACE,kBAAkB;QAChBE,MAAA,EAAQzB,UAAA,CAAWG,EAAA;MACrB;IACF,GACA;MACE,uBAAuB;QACrBsB,MAAA,EAAQrB,gBAAA,CAAiBsB;MAC3B;IACF,GACA;MACEC,SAAA,EAAW;QACTC,YAAA,EAAc,IAAIP,IAAA,CAAKD,GAAA,GAAMD,0BAAA;MAC/B;IACF,EACD;EACH;EAEA,MAAM;IAAEU;EAAI,CAAE,GAAG,MAAMtB,GAAA,CAAIK,OAAO,CAACkB,IAAI,CAAC;IACtCC,UAAA,EAAY;IACZC,KAAA,EAAO;IACPC,cAAA,EAAgB;IAChB1B,GAAA;IACAQ;EACF;EAEA,IAAIc,IAAA,CAAKK,MAAM,GAAG,GAAG;IACnB,MAAMC,aAAA,GAAgBN,IAAI,CAAC,EAAE,CAACO,IAAI,EAAEC,KAAA;IACpC,MAAMC,cAAA,GAAiB,IAAIjB,IAAA,CAAKQ,IAAI,CAAC,EAAE,CAACF,SAAS,EAAEL,OAAO;IAE1D,IAAIrB,SAAA,CAAUkC,aAAA,MAAmB5B,GAAA,CAAI6B,IAAI,CAACjC,EAAE,EAAE;MAC5C,OAAO;QACLgC,aAAA;QACArB,QAAA,EAAU;QACVwB;MACF;IACF;EACF;EAEA,OAAO;IACLxB,QAAA,EAAU;EACZ;AACF","ignoreList":[]}
@@ -0,0 +1,15 @@
import { getPrivacyOptions } from './getPrivacyOptions';
interface MaskAttributeParams {
maskAttributes: string[];
maskAllText: boolean;
privacyOptions: ReturnType<typeof getPrivacyOptions>;
key: string;
value: string;
el: HTMLElement;
}
/**
* Masks an attribute if necessary, otherwise return attribute value as-is.
*/
export declare function maskAttribute({ el, key, maskAttributes, maskAllText, privacyOptions, value, }: MaskAttributeParams): string;
export {};
//# sourceMappingURL=maskAttribute.d.ts.map
@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { differenceInCalendarYears as fn } from "../differenceInCalendarYears.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const differenceInCalendarYearsWithOptions = convertToFP(fn, 3);
// Fallback for modularized imports:
export default differenceInCalendarYearsWithOptions;
@@ -0,0 +1 @@
{"version":3,"file":"all-signals.d.ts","sourceRoot":"","sources":["../../src/all-signals.ts"],"names":[],"mappings":"AACA,eAAO,MAAM,UAAU,EAShB,MAAM,CAAC,OAAO,EAAE,CAAA"}
@@ -0,0 +1,62 @@
import { jsx as _jsx } from "react/jsx-runtime";
import { createContext, use, useEffect, useState } from 'react';
import { formatDocTitle } from '../../utilities/formatDocTitle/index.js';
import { useConfig } from '../Config/index.js';
import { useDocumentInfo } from '../DocumentInfo/index.js';
import { useTranslation } from '../Translation/index.js';
const DocumentTitleContext = /*#__PURE__*/createContext({});
export const useDocumentTitle = () => use(DocumentTitleContext);
export const DocumentTitleProvider = ({
children
}) => {
const {
id,
collectionSlug,
data,
docConfig,
globalSlug,
initialData
} = useDocumentInfo();
const {
config: {
admin: {
dateFormat
}
}
} = useConfig();
const {
i18n
} = useTranslation();
const [title, setDocumentTitle] = useState(() => formatDocTitle({
collectionConfig: collectionSlug ? docConfig : undefined,
data: {
...(initialData || {}),
id
},
dateFormat,
fallback: id?.toString(),
globalConfig: globalSlug ? docConfig : undefined,
i18n
}));
useEffect(() => {
setDocumentTitle(formatDocTitle({
collectionConfig: collectionSlug ? docConfig : undefined,
data: {
...data,
id
},
dateFormat,
fallback: id?.toString(),
globalConfig: globalSlug ? docConfig : undefined,
i18n
}));
}, [data, dateFormat, i18n, id, collectionSlug, docConfig, globalSlug]);
return /*#__PURE__*/_jsx(DocumentTitleContext, {
value: {
setDocumentTitle,
title
},
children: children
});
};
//# sourceMappingURL=index.js.map
@@ -0,0 +1,9 @@
export {
NonceProvider,
components,
createFilter,
defaultTheme,
mergeStyles,
useStateManager
} from "./react-select.cjs.js";
export { _default as default } from "./react-select.cjs.default.js";
@@ -0,0 +1,3 @@
export { sv } from '@payloadcms/translations/languages/sv';
//# sourceMappingURL=sv.js.map
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/auth/endpoints/access.ts"],"sourcesContent":["import { status as httpStatus } from 'http-status'\n\nimport type { PayloadHandler } from '../../config/types.js'\n\nimport { headersWithCors } from '../../utilities/headersWithCors.js'\nimport { accessOperation } from '../operations/access.js'\n\nexport const accessHandler: PayloadHandler = async (req) => {\n const headers = headersWithCors({\n headers: new Headers(),\n req,\n })\n\n try {\n const results = await accessOperation({\n req,\n })\n\n return Response.json(results, {\n headers,\n status: httpStatus.OK,\n })\n } catch (e: unknown) {\n return Response.json(\n {\n error: e,\n },\n {\n headers,\n status: httpStatus.INTERNAL_SERVER_ERROR,\n },\n )\n }\n}\n"],"names":["status","httpStatus","headersWithCors","accessOperation","accessHandler","req","headers","Headers","results","Response","json","OK","e","error","INTERNAL_SERVER_ERROR"],"mappings":"AAAA,SAASA,UAAUC,UAAU,QAAQ,cAAa;AAIlD,SAASC,eAAe,QAAQ,qCAAoC;AACpE,SAASC,eAAe,QAAQ,0BAAyB;AAEzD,OAAO,MAAMC,gBAAgC,OAAOC;IAClD,MAAMC,UAAUJ,gBAAgB;QAC9BI,SAAS,IAAIC;QACbF;IACF;IAEA,IAAI;QACF,MAAMG,UAAU,MAAML,gBAAgB;YACpCE;QACF;QAEA,OAAOI,SAASC,IAAI,CAACF,SAAS;YAC5BF;YACAN,QAAQC,WAAWU,EAAE;QACvB;IACF,EAAE,OAAOC,GAAY;QACnB,OAAOH,SAASC,IAAI,CAClB;YACEG,OAAOD;QACT,GACA;YACEN;YACAN,QAAQC,WAAWa,qBAAqB;QAC1C;IAEJ;AACF,EAAC"}
@@ -0,0 +1,57 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const instrumentationKnex = require('@opentelemetry/instrumentation-knex');
const core = require('@sentry/core');
const nodeCore = require('@sentry/node-core');
const INTEGRATION_NAME = 'Knex';
const instrumentKnex = nodeCore.generateInstrumentOnce(
INTEGRATION_NAME,
() => new instrumentationKnex.KnexInstrumentation({ requireParentSpan: true }),
);
const _knexIntegration = (() => {
let instrumentationWrappedCallback;
return {
name: INTEGRATION_NAME,
setupOnce() {
const instrumentation = instrumentKnex();
instrumentationWrappedCallback = nodeCore.instrumentWhenWrapped(instrumentation);
},
setup(client) {
instrumentationWrappedCallback?.(() =>
client.on('spanStart', span => {
const { data } = core.spanToJSON(span);
// knex.version is always set in the span data
// https://github.com/open-telemetry/opentelemetry-js-contrib/blob/0309caeafc44ac9cb13a3345b790b01b76d0497d/plugins/node/opentelemetry-instrumentation-knex/src/instrumentation.ts#L138
if ('knex.version' in data) {
span.setAttribute(core.SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN, 'auto.db.otel.knex');
}
}),
);
},
};
}) ;
/**
* Knex integration
*
* Capture tracing data for [Knex](https://knexjs.org/).
*
* @example
* ```javascript
* import * as Sentry from '@sentry/node';
*
* Sentry.init({
* integrations: [Sentry.knexIntegration()],
* });
* ```
*/
const knexIntegration = core.defineIntegration(_knexIntegration);
exports.instrumentKnex = instrumentKnex;
exports.knexIntegration = knexIntegration;
//# sourceMappingURL=knex.js.map
@@ -0,0 +1,38 @@
import { toDate } from "./toDate.js";
/**
* The {@link lastDayOfYear} function options.
*/
/**
* @name lastDayOfYear
* @category Year Helpers
* @summary Return the last day of a year for the given date.
*
* @description
* Return the last day of a year for the given date.
* The result will be in the local timezone.
*
* @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 original date
* @param options - An object with options
*
* @returns The last day of a year
*
* @example
* // The last day of a year for 2 September 2014 11:55:00:
* const result = lastDayOfYear(new Date(2014, 8, 2, 11, 55, 00))
* //=> Wed Dec 31 2014 00:00:00
*/
export function lastDayOfYear(date, options) {
const date_ = toDate(date, options?.in);
const year = date_.getFullYear();
date_.setFullYear(year + 1, 0, 0);
date_.setHours(0, 0, 0, 0);
return date_;
}
// Fallback for modularized imports:
export default lastDayOfYear;
@@ -0,0 +1,7 @@
/**
* Inserts a node after a given reference node.
*
* @param node the node to insert
* @param refNode the reference node
*/
export default function insertAfter(node: Node | null, refNode: Node | null): Node | null;
@@ -0,0 +1,120 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
/** @typedef {import("./CachedSource").CachedData} CachedData */
/** @typedef {import("./CompatSource").SourceLike} SourceLike */
/** @typedef {import("./ConcatSource").Child} ConcatSourceChild */
/** @typedef {import("./ReplaceSource").Replacement} Replacement */
/** @typedef {import("./Source").HashLike} HashLike */
/** @typedef {import("./Source").MapOptions} MapOptions */
/** @typedef {import("./Source").RawSourceMap} RawSourceMap */
/** @typedef {import("./Source").SourceAndMap} SourceAndMap */
/** @typedef {import("./Source").SourceValue} SourceValue */
/** @typedef {import("./helpers/getGeneratedSourceInfo").GeneratedSourceInfo} GeneratedSourceInfo */
/** @typedef {import("./helpers/streamChunks").OnChunk} OnChunk */
/** @typedef {import("./helpers/streamChunks").OnName} OnName */
/** @typedef {import("./helpers/streamChunks").OnSource} OnSource */
/** @typedef {import("./helpers/streamChunks").Options} StreamChunksOptions */
/**
* @template T
* @param {() => T} fn memorized function
* @returns {() => T} new function
*/
const memoize = (fn) => {
let cache = false;
/** @type {T | undefined} */
let result;
return () => {
if (cache) {
return /** @type {T} */ (result);
}
result = fn();
cache = true;
// Allow to clean up memory for fn
// and all dependent resources
/** @type {(() => T) | undefined} */
(fn) = undefined;
return /** @type {T} */ (result);
};
};
/**
* @template A
* @template B
* @param {A} obj input a
* @param {B} exports input b
* @returns {A & B} merged
*/
const mergeExports = (obj, exports) => {
const descriptors = Object.getOwnPropertyDescriptors(exports);
for (const name of Object.keys(descriptors)) {
const descriptor = descriptors[name];
if (descriptor.get) {
const fn = descriptor.get;
Object.defineProperty(obj, name, {
configurable: false,
enumerable: true,
get: memoize(fn),
});
} else if (typeof descriptor.value === "object") {
Object.defineProperty(obj, name, {
configurable: false,
enumerable: true,
writable: false,
value: mergeExports({}, descriptor.value),
});
} else {
throw new Error(
"Exposed values must be either a getter or an nested object",
);
}
}
return /** @type {A & B} */ (Object.freeze(obj));
};
module.exports = mergeExports(
{},
{
get Source() {
return require("./Source");
},
get RawSource() {
return require("./RawSource");
},
get OriginalSource() {
return require("./OriginalSource");
},
get SourceMapSource() {
return require("./SourceMapSource");
},
get CachedSource() {
return require("./CachedSource");
},
get ConcatSource() {
return require("./ConcatSource");
},
get ReplaceSource() {
return require("./ReplaceSource");
},
get PrefixSource() {
return require("./PrefixSource");
},
get SizeOnlySource() {
return require("./SizeOnlySource");
},
get CompatSource() {
return require("./CompatSource");
},
util: {
get stringBufferUtils() {
return require("./helpers/stringBufferUtils");
},
},
},
);
@@ -0,0 +1,18 @@
/**
* 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 { LexicalCommand } from 'lexical';
export type InsertTableCommandPayloadHeaders = Readonly<{
rows: boolean;
columns: boolean;
}> | boolean;
export type InsertTableCommandPayload = Readonly<{
columns: string;
rows: string;
includeHeaders?: InsertTableCommandPayloadHeaders;
}>;
export declare const INSERT_TABLE_COMMAND: LexicalCommand<InsertTableCommandPayload>;
@@ -0,0 +1 @@
module.exports={C:{"5":0.0044,"78":0.0088,"92":0.0044,"115":0.14077,"128":0.0088,"136":0.0044,"137":0.10118,"138":0.0044,"140":0.18916,"142":0.0088,"143":0.0176,"144":0.04399,"145":1.97515,"146":2.41065,"147":0.0088,_:"2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 79 80 81 82 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 127 129 130 131 132 133 134 135 139 141 148 149 3.5 3.6"},D:{"38":0.0088,"42":0.0044,"69":0.0088,"72":0.0044,"87":0.0044,"88":0.022,"98":0.0044,"102":0.0176,"103":0.0088,"108":0.0044,"109":0.21995,"111":0.0132,"114":0.0044,"116":0.14517,"119":0.0044,"120":0.05719,"122":0.022,"123":0.0044,"124":0.0132,"125":0.25074,"126":0.02639,"127":0.02639,"128":0.15836,"129":0.0044,"130":0.50149,"131":0.16716,"132":0.03079,"133":0.0132,"134":0.022,"135":0.03079,"136":0.0132,"137":0.0132,"138":0.22435,"139":0.11437,"140":0.07038,"141":0.25074,"142":5.2656,"143":11.03709,"144":0.0044,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 39 40 41 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 70 71 73 74 75 76 77 78 79 80 81 83 84 85 86 89 90 91 92 93 94 95 96 97 99 100 101 104 105 106 107 110 112 113 115 117 118 121 145 146"},F:{"46":0.0132,"92":0.0044,"93":0.05719,"95":0.0044,"120":0.0176,"121":0.0044,"122":0.0176,"123":0.022,"124":1.12175,"125":1.69362,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"13":0.0044,"109":0.0044,"125":0.0088,"126":0.0044,"127":0.0044,"131":0.0044,"132":0.10998,"134":0.0044,"135":0.0088,"138":0.022,"139":0.0044,"140":0.02639,"141":0.13637,"142":1.07776,"143":4.30662,_:"12 14 15 16 17 18 79 80 81 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 128 129 130 133 136 137"},E:{"14":0.0044,_:"0 4 5 6 7 8 9 10 11 12 13 15 3.1 3.2 5.1 6.1 7.1 9.1 11.1 15.2-15.3 16.0 16.2 17.0","10.1":0.03959,"12.1":0.0132,"13.1":0.0176,"14.1":0.022,"15.1":0.0176,"15.4":0.0088,"15.5":0.0088,"15.6":0.09238,"16.1":0.04839,"16.3":0.022,"16.4":0.0044,"16.5":0.0044,"16.6":0.14077,"17.1":0.62026,"17.2":0.0044,"17.3":0.08798,"17.4":0.022,"17.5":0.03519,"17.6":0.33872,"18.0":0.022,"18.1":0.03079,"18.2":0.0088,"18.3":0.02639,"18.4":0.0132,"18.5-18.6":0.36952,"26.0":0.14517,"26.1":0.71704,"26.2":0.40471,"26.3":0.0088},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00262,"5.0-5.1":0,"6.0-6.1":0.00525,"7.0-7.1":0.00394,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.0105,"10.0-10.2":0.00131,"10.3":0.01837,"11.0-11.2":0.22572,"11.3-11.4":0.00656,"12.0-12.1":0.00525,"12.2-12.5":0.05905,"13.0-13.1":0.00131,"13.2":0.00919,"13.3":0.00262,"13.4-13.7":0.00919,"14.0-14.4":0.01837,"14.5-14.8":0.01968,"15.0-15.1":0.021,"15.2-15.3":0.01575,"15.4":0.01706,"15.5":0.01837,"15.6-15.8":0.28477,"16.0":0.03281,"16.1":0.06299,"16.2":0.03281,"16.3":0.05905,"16.4":0.01444,"16.5":0.02493,"16.6-16.7":0.37007,"17.0":0.021,"17.1":0.03412,"17.2":0.02493,"17.3":0.03806,"17.4":0.0643,"17.5":0.12598,"17.6-17.7":0.29133,"18.0":0.06562,"18.1":0.13648,"18.2":0.07218,"18.3":0.2349,"18.4":0.12073,"18.5-18.7":8.66915,"26.0":0.16929,"26.1":1.40811,"26.2":0.26771,"26.3":0.01181},P:{"4":0.01052,"20":0.22101,"22":0.01052,"23":0.01052,"24":0.07367,"25":0.01052,"26":0.03157,"27":0.0421,"28":0.19996,"29":2.95726,_:"21 6.2-6.4 8.2 9.2 10.1 12.0 13.0 14.0 15.0 16.0 17.0 18.0","5.0-5.4":0.01052,"7.2-7.4":0.01052,"11.1-11.2":0.01052,"19.0":0.05262},I:{"0":0.08388,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00002,"4.4":0,"4.4.3-4.4.4":0.00007},A:{_:"6 7 8 9 10 11 5.5"},K:{"0":0.11762,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{_:"14.9"},O:{_:"0"},H:{"0":0},L:{"0":42.70494},R:{_:"0"},M:{"0":0.97457}};
@@ -0,0 +1,36 @@
{
"name": "forwarded-parse",
"version": "2.1.2",
"description": "Parse the Forwarded header (RFC 7239) into an array of objects",
"keywords": [
"forwarded",
"RFC-7239",
"rfc-7239",
"RFC7239",
"rfc7239",
"header",
"parser",
"7239",
"RFC",
"rfc"
],
"homepage": "https://github.com/lpinca/forwarded-parse",
"bugs": "https://github.com/lpinca/forwarded-parse/issues",
"license": "MIT",
"author": "Luigi Pinca",
"files": [
"lib",
"index.js",
"index.d.ts"
],
"main": "index.js",
"repository": "lpinca/forwarded-parse",
"scripts": {
"test": "c8 --reporter=lcov --reporter=text tape test.js"
},
"devDependencies": {
"c8": "^7.3.0",
"pre-commit": "^1.2.2",
"tape": "^5.0.1"
}
}
@@ -0,0 +1 @@
{"version":3,"names":["_path","data","require","normalizeOptions","config","filename","cwd","filenameRelative","path","relative","sourceType","inputSourceMap","sourceMaps","sourceRoot","options","moduleRoot","sourceFileName","basename","comments","compact","opts","Object","assign","parserOpts","extname","plugins","generatorOpts","auxiliaryCommentBefore","auxiliaryCommentAfter","retainLines","shouldPrintComment","minified","passes","plugin","manipulateOptions"],"sources":["../../src/transformation/normalize-opts.ts"],"sourcesContent":["import path from \"node:path\";\nimport type { ResolvedConfig } from \"../config/index.ts\";\nimport type { ResolvedOptions } from \"../config/validation/options.ts\";\n\nexport default function normalizeOptions(\n config: ResolvedConfig,\n): ResolvedOptions {\n const {\n filename,\n cwd,\n filenameRelative = typeof filename === \"string\"\n ? path.relative(cwd, filename)\n : \"unknown\",\n sourceType = \"module\",\n inputSourceMap,\n sourceMaps = !!inputSourceMap,\n sourceRoot = process.env.BABEL_8_BREAKING\n ? undefined\n : // @ts-ignore(Babel 7 vs Babel 8) moduleRoot is a Babel 7 option\n config.options.moduleRoot,\n\n sourceFileName = path.basename(filenameRelative),\n\n comments = true,\n compact = \"auto\",\n } = config.options;\n\n const opts = config.options;\n\n const options: ResolvedOptions = {\n ...opts,\n\n parserOpts: {\n sourceType:\n path.extname(filenameRelative) === \".mjs\" ? \"module\" : sourceType,\n\n // @ts-expect-error We should have passed `sourceFilename` here\n // pending https://github.com/babel/babel/issues/15917#issuecomment-2789278964\n sourceFileName: filename,\n plugins: [],\n ...opts.parserOpts,\n },\n\n generatorOpts: {\n // General generator flags.\n filename,\n\n auxiliaryCommentBefore: opts.auxiliaryCommentBefore,\n auxiliaryCommentAfter: opts.auxiliaryCommentAfter,\n retainLines: opts.retainLines,\n comments,\n shouldPrintComment: opts.shouldPrintComment,\n compact,\n minified: opts.minified,\n\n // Source-map generation flags.\n // babel-generator does not differentiate between `true`, `\"inline\"` or `\"both\"`\n sourceMaps: !!sourceMaps,\n sourceRoot,\n sourceFileName,\n\n ...opts.generatorOpts,\n },\n };\n\n for (const plugins of config.passes) {\n for (const plugin of plugins) {\n if (plugin.manipulateOptions) {\n plugin.manipulateOptions(options, options.parserOpts);\n }\n }\n }\n\n return options;\n}\n"],"mappings":";;;;;;AAAA,SAAAA,MAAA;EAAA,MAAAC,IAAA,GAAAC,OAAA;EAAAF,KAAA,YAAAA,CAAA;IAAA,OAAAC,IAAA;EAAA;EAAA,OAAAA,IAAA;AAAA;AAIe,SAASE,gBAAgBA,CACtCC,MAAsB,EACL;EACjB,MAAM;IACJC,QAAQ;IACRC,GAAG;IACHC,gBAAgB,GAAG,OAAOF,QAAQ,KAAK,QAAQ,GAC3CG,MAAGA,CAAC,CAACC,QAAQ,CAACH,GAAG,EAAED,QAAQ,CAAC,GAC5B,SAAS;IACbK,UAAU,GAAG,QAAQ;IACrBC,cAAc;IACdC,UAAU,GAAG,CAAC,CAACD,cAAc;IAC7BE,UAAU,GAGNT,MAAM,CAACU,OAAO,CAACC,UAAU;IAE7BC,cAAc,GAAGR,MAAGA,CAAC,CAACS,QAAQ,CAACV,gBAAgB,CAAC;IAEhDW,QAAQ,GAAG,IAAI;IACfC,OAAO,GAAG;EACZ,CAAC,GAAGf,MAAM,CAACU,OAAO;EAElB,MAAMM,IAAI,GAAGhB,MAAM,CAACU,OAAO;EAE3B,MAAMA,OAAwB,GAAAO,MAAA,CAAAC,MAAA,KACzBF,IAAI;IAEPG,UAAU,EAAAF,MAAA,CAAAC,MAAA;MACRZ,UAAU,EACRF,MAAGA,CAAC,CAACgB,OAAO,CAACjB,gBAAgB,CAAC,KAAK,MAAM,GAAG,QAAQ,GAAGG,UAAU;MAInEM,cAAc,EAAEX,QAAQ;MACxBoB,OAAO,EAAE;IAAE,GACRL,IAAI,CAACG,UAAU,CACnB;IAEDG,aAAa,EAAAL,MAAA,CAAAC,MAAA;MAEXjB,QAAQ;MAERsB,sBAAsB,EAAEP,IAAI,CAACO,sBAAsB;MACnDC,qBAAqB,EAAER,IAAI,CAACQ,qBAAqB;MACjDC,WAAW,EAAET,IAAI,CAACS,WAAW;MAC7BX,QAAQ;MACRY,kBAAkB,EAAEV,IAAI,CAACU,kBAAkB;MAC3CX,OAAO;MACPY,QAAQ,EAAEX,IAAI,CAACW,QAAQ;MAIvBnB,UAAU,EAAE,CAAC,CAACA,UAAU;MACxBC,UAAU;MACVG;IAAc,GAEXI,IAAI,CAACM,aAAa;EACtB,EACF;EAED,KAAK,MAAMD,OAAO,IAAIrB,MAAM,CAAC4B,MAAM,EAAE;IACnC,KAAK,MAAMC,MAAM,IAAIR,OAAO,EAAE;MAC5B,IAAIQ,MAAM,CAACC,iBAAiB,EAAE;QAC5BD,MAAM,CAACC,iBAAiB,CAACpB,OAAO,EAAEA,OAAO,CAACS,UAAU,CAAC;MACvD;IACF;EACF;EAEA,OAAOT,OAAO;AAChB;AAAC","ignoreList":[]}
@@ -0,0 +1,27 @@
import { GraphQLScalarType, Kind } from 'graphql';
import { createGraphQLError } from '../error.js';
import { processValue } from './utilities.js';
export const GraphQLPositiveFloat = /*#__PURE__*/ new GraphQLScalarType({
name: 'PositiveFloat',
description: 'Floats that will have a value greater than 0.',
serialize(value) {
return processValue(value, 'PositiveFloat');
},
parseValue(value) {
return processValue(value, 'PositiveFloat');
},
parseLiteral(ast) {
if (ast.kind !== Kind.FLOAT && ast.kind !== Kind.INT) {
throw createGraphQLError(`Can only validate floating point numbers as positive floating point numbers but got a: ${ast.kind}`, { nodes: ast });
}
return processValue(ast.value, 'PositiveFloat');
},
extensions: {
codegenScalarType: 'number',
jsonSchema: {
title: 'PositiveFloat',
type: 'number',
minimum: 0,
},
},
});
@@ -0,0 +1,3 @@
export { };
//# sourceMappingURL=WithServerSideProps.js.map
@@ -0,0 +1,40 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.js";
// DIN 5008: https://de.wikipedia.org/wiki/Datumsformat#DIN_5008
const dateFormats = {
full: "EEEE, do MMMM y", // Montag, 7. Januar 2018
long: "do MMMM y", // 7. Januar 2018
medium: "do MMM y", // 7. Jan. 2018
short: "dd.MM.y", // 07.01.2018
};
const timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm",
};
const dateTimeFormats = {
full: "{{date}} 'um' {{time}}",
long: "{{date}} 'um' {{time}}",
medium: "{{date}} {{time}}",
short: "{{date}} {{time}}",
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};
@@ -0,0 +1,28 @@
import { formatDistance } from "./ar-TN/_lib/formatDistance.mjs";
import { formatLong } from "./ar-TN/_lib/formatLong.mjs";
import { formatRelative } from "./ar-TN/_lib/formatRelative.mjs";
import { localize } from "./ar-TN/_lib/localize.mjs";
import { match } from "./ar-TN/_lib/match.mjs";
/**
* @category Locales
* @summary Arabic locale (Tunisian Arabic).
* @language Arabic
* @iso-639-2 ara
* @author Koussay Haj Kacem [@essana3](https://github.com/essana3)
*/
export const arTN = {
code: "ar-TN",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 1,
},
};
// Fallback for modularized imports:
export default arTN;
@@ -0,0 +1,8 @@
{
"extends": "./declarations.json",
"compilerOptions": {
"declarationDir": "../dist/esm/types",
"module": "ESNext",
"outDir": "../dist/esm"
}
}
@@ -0,0 +1,72 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.cjs";
import type { ColumnBaseConfig } from "../../column.cjs";
import { entityKind } from "../../entity.cjs";
import { type Equal } from "../../utils.cjs";
import { SQLiteColumn, SQLiteColumnBuilder } from "./common.cjs";
type BlobMode = 'buffer' | 'json' | 'bigint';
export type SQLiteBigIntBuilderInitial<TName extends string> = SQLiteBigIntBuilder<{
name: TName;
dataType: 'bigint';
columnType: 'SQLiteBigInt';
data: bigint;
driverParam: Buffer;
enumValues: undefined;
}>;
export declare class SQLiteBigIntBuilder<T extends ColumnBuilderBaseConfig<'bigint', 'SQLiteBigInt'>> extends SQLiteColumnBuilder<T> {
static readonly [entityKind]: string;
constructor(name: T['name']);
}
export declare class SQLiteBigInt<T extends ColumnBaseConfig<'bigint', 'SQLiteBigInt'>> extends SQLiteColumn<T> {
static readonly [entityKind]: string;
getSQLType(): string;
mapFromDriverValue(value: Buffer | Uint8Array | ArrayBuffer): bigint;
mapToDriverValue(value: bigint): Buffer;
}
export type SQLiteBlobJsonBuilderInitial<TName extends string> = SQLiteBlobJsonBuilder<{
name: TName;
dataType: 'json';
columnType: 'SQLiteBlobJson';
data: unknown;
driverParam: Buffer;
enumValues: undefined;
}>;
export declare class SQLiteBlobJsonBuilder<T extends ColumnBuilderBaseConfig<'json', 'SQLiteBlobJson'>> extends SQLiteColumnBuilder<T> {
static readonly [entityKind]: string;
constructor(name: T['name']);
}
export declare class SQLiteBlobJson<T extends ColumnBaseConfig<'json', 'SQLiteBlobJson'>> extends SQLiteColumn<T> {
static readonly [entityKind]: string;
getSQLType(): string;
mapFromDriverValue(value: Buffer | Uint8Array | ArrayBuffer): T['data'];
mapToDriverValue(value: T['data']): Buffer;
}
export type SQLiteBlobBufferBuilderInitial<TName extends string> = SQLiteBlobBufferBuilder<{
name: TName;
dataType: 'buffer';
columnType: 'SQLiteBlobBuffer';
data: Buffer;
driverParam: Buffer;
enumValues: undefined;
}>;
export declare class SQLiteBlobBufferBuilder<T extends ColumnBuilderBaseConfig<'buffer', 'SQLiteBlobBuffer'>> extends SQLiteColumnBuilder<T> {
static readonly [entityKind]: string;
constructor(name: T['name']);
}
export declare class SQLiteBlobBuffer<T extends ColumnBaseConfig<'buffer', 'SQLiteBlobBuffer'>> extends SQLiteColumn<T> {
static readonly [entityKind]: string;
mapFromDriverValue(value: Buffer | Uint8Array | ArrayBuffer): T['data'];
getSQLType(): string;
}
export interface BlobConfig<TMode extends BlobMode = BlobMode> {
mode: TMode;
}
/**
* It's recommended to use `text('...', { mode: 'json' })` instead of `blob` in JSON mode, because it supports JSON functions:
* >All JSON functions currently throw an error if any of their arguments are BLOBs because BLOBs are reserved for a future enhancement in which BLOBs will store the binary encoding for JSON.
*
* https://www.sqlite.org/json1.html
*/
export declare function blob(): SQLiteBlobJsonBuilderInitial<''>;
export declare function blob<TMode extends BlobMode = BlobMode>(config?: BlobConfig<TMode>): Equal<TMode, 'bigint'> extends true ? SQLiteBigIntBuilderInitial<''> : Equal<TMode, 'buffer'> extends true ? SQLiteBlobBufferBuilderInitial<''> : SQLiteBlobJsonBuilderInitial<''>;
export declare function blob<TName extends string, TMode extends BlobMode = BlobMode>(name: TName, config?: BlobConfig<TMode>): Equal<TMode, 'bigint'> extends true ? SQLiteBigIntBuilderInitial<TName> : Equal<TMode, 'buffer'> extends true ? SQLiteBlobBufferBuilderInitial<TName> : SQLiteBlobJsonBuilderInitial<TName>;
export {};
@@ -0,0 +1,41 @@
import { GraphQLScalarType, Kind } from 'graphql';
import { createGraphQLError } from '../error.js';
const validate = (value, ast) => {
const UUID_REGEX = /^(\{){0,1}[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}(\}){0,1}$/gi;
if (typeof value !== 'string') {
throw createGraphQLError(`Value is not string: ${value}`, ast ? { nodes: ast } : undefined);
}
if (value.startsWith('{')) {
value = value.substring(1, value.length - 1);
}
if (!UUID_REGEX.test(value)) {
throw createGraphQLError(`Value is not a valid UUID: ${value}`, ast ? { nodes: ast } : undefined);
}
return value;
};
export const GraphQLUUIDConfig = /*#__PURE__*/ {
name: `UUID`,
description: `A field whose value is a generic Universally Unique Identifier: https://en.wikipedia.org/wiki/Universally_unique_identifier.`,
serialize(value) {
return validate(value);
},
parseValue(value) {
return validate(value);
},
parseLiteral(ast) {
if (ast.kind !== Kind.STRING) {
throw createGraphQLError(`Can only validate strings as UUIDs but got a: ${ast.kind}`, {
nodes: ast,
});
}
return validate(ast.value, ast);
},
extensions: {
codegenScalarType: 'string',
jsonSchema: {
type: 'string',
format: 'uuid',
},
},
};
export const GraphQLUUID = /*#__PURE__*/ new GraphQLScalarType(GraphQLUUIDConfig);
@@ -0,0 +1,2 @@
import { ReadonlyKeys } from "../readonly-keys";
export type WritableKeys<Type extends object> = Type extends unknown ? Exclude<keyof Type, ReadonlyKeys<Type>> : never;
@@ -0,0 +1,135 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { getTranslation } from '@payloadcms/translations';
import { useConfig, useDocumentTitle, useLocale, useStepNav, useTranslation } from '@payloadcms/ui';
import { formatAdminURL } from 'payload/shared';
import { useEffect } from 'react';
export const SetStepNav = t0 => {
const $ = _c(24);
const {
id,
collectionConfig,
globalConfig,
isTrashed,
versionToCreatedAtFormatted,
versionToID
} = t0;
const {
config
} = useConfig();
const {
setStepNav
} = useStepNav();
const {
i18n,
t
} = useTranslation();
const locale = useLocale();
const {
title
} = useDocumentTitle();
let t1;
if ($[0] !== collectionConfig || $[1] !== config || $[2] !== globalConfig || $[3] !== i18n || $[4] !== id || $[5] !== isTrashed || $[6] !== setStepNav || $[7] !== t || $[8] !== title || $[9] !== versionToCreatedAtFormatted) {
t1 = () => {
const {
routes: t2
} = config;
const {
admin: adminRoute
} = t2;
if (collectionConfig) {
const collectionSlug = collectionConfig.slug;
const pluralLabel = collectionConfig.labels?.plural;
const docBasePath = isTrashed ? `/collections/${collectionSlug}/trash/${id}` : `/collections/${collectionSlug}/${id}`;
const nav = [{
label: getTranslation(pluralLabel, i18n),
url: formatAdminURL({
adminRoute,
path: `/collections/${collectionSlug}`
})
}];
if (isTrashed) {
nav.push({
label: t("general:trash"),
url: formatAdminURL({
adminRoute,
path: `/collections/${collectionSlug}/trash`
})
});
}
nav.push({
label: title,
url: formatAdminURL({
adminRoute,
path: docBasePath
})
}, {
label: t("version:versions"),
url: formatAdminURL({
adminRoute,
path: `${docBasePath}/versions`
})
}, {
label: versionToCreatedAtFormatted,
url: undefined
});
setStepNav(nav);
return;
}
if (globalConfig) {
const globalSlug = globalConfig.slug;
setStepNav([{
label: globalConfig.label,
url: formatAdminURL({
adminRoute,
path: `/globals/${globalSlug}`
})
}, {
label: t("version:versions"),
url: formatAdminURL({
adminRoute,
path: `/globals/${globalSlug}/versions`
})
}, {
label: versionToCreatedAtFormatted
}]);
}
};
$[0] = collectionConfig;
$[1] = config;
$[2] = globalConfig;
$[3] = i18n;
$[4] = id;
$[5] = isTrashed;
$[6] = setStepNav;
$[7] = t;
$[8] = title;
$[9] = versionToCreatedAtFormatted;
$[10] = t1;
} else {
t1 = $[10];
}
let t2;
if ($[11] !== collectionConfig || $[12] !== config || $[13] !== globalConfig || $[14] !== i18n || $[15] !== id || $[16] !== isTrashed || $[17] !== locale || $[18] !== setStepNav || $[19] !== t || $[20] !== title || $[21] !== versionToCreatedAtFormatted || $[22] !== versionToID) {
t2 = [config, setStepNav, id, isTrashed, locale, t, i18n, collectionConfig, globalConfig, title, versionToCreatedAtFormatted, versionToID];
$[11] = collectionConfig;
$[12] = config;
$[13] = globalConfig;
$[14] = i18n;
$[15] = id;
$[16] = isTrashed;
$[17] = locale;
$[18] = setStepNav;
$[19] = t;
$[20] = title;
$[21] = versionToCreatedAtFormatted;
$[22] = versionToID;
$[23] = t2;
} else {
t2 = $[23];
}
useEffect(t1, t2);
return null;
};
//# sourceMappingURL=SetStepNav.js.map
@@ -0,0 +1,285 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const RuntimeModule = require("../RuntimeModule");
const Template = require("../Template");
const {
generateJavascriptHMR
} = require("../hmr/JavascriptHotModuleReplacementHelper");
const {
chunkHasJs,
getChunkFilenameTemplate
} = require("../javascript/JavascriptModulesPlugin");
const { getInitialChunkIds } = require("../javascript/StartupHelpers");
const compileBooleanMatcher = require("../util/compileBooleanMatcher");
const { getUndoPath } = require("../util/identifier");
/** @typedef {import("../Chunk")} Chunk */
/** @typedef {import("../ChunkGraph")} ChunkGraph */
/** @typedef {import("../Compilation")} Compilation */
/** @typedef {import("../RuntimeTemplate")} RuntimeTemplate */
/** @typedef {import("../Module").ReadOnlyRuntimeRequirements} ReadOnlyRuntimeRequirements */
class ReadFileChunkLoadingRuntimeModule extends RuntimeModule {
/**
* @param {ReadOnlyRuntimeRequirements} runtimeRequirements runtime requirements
*/
constructor(runtimeRequirements) {
super("readFile chunk loading", RuntimeModule.STAGE_ATTACH);
this.runtimeRequirements = runtimeRequirements;
}
/**
* @private
* @param {Chunk} chunk chunk
* @param {string} rootOutputDir root output directory
* @param {RuntimeTemplate} runtimeTemplate the runtime template
* @returns {string} generated code
*/
_generateBaseUri(chunk, rootOutputDir, runtimeTemplate) {
const options = chunk.getEntryOptions();
if (options && options.baseUri) {
return `${RuntimeGlobals.baseURI} = ${JSON.stringify(options.baseUri)};`;
}
return `${RuntimeGlobals.baseURI} = require(${runtimeTemplate.renderNodePrefixForCoreModule("url")}).pathToFileURL(${
rootOutputDir
? `__dirname + ${JSON.stringify(`/${rootOutputDir}`)}`
: "__filename"
});`;
}
/**
* @returns {string | null} runtime code
*/
generate() {
const compilation = /** @type {Compilation} */ (this.compilation);
const chunkGraph = /** @type {ChunkGraph} */ (this.chunkGraph);
const chunk = /** @type {Chunk} */ (this.chunk);
const { runtimeTemplate } = compilation;
const fn = RuntimeGlobals.ensureChunkHandlers;
const withBaseURI = this.runtimeRequirements.has(RuntimeGlobals.baseURI);
const withExternalInstallChunk = this.runtimeRequirements.has(
RuntimeGlobals.externalInstallChunk
);
const withOnChunkLoad = this.runtimeRequirements.has(
RuntimeGlobals.onChunksLoaded
);
const withLoading = this.runtimeRequirements.has(
RuntimeGlobals.ensureChunkHandlers
);
const withHmr = this.runtimeRequirements.has(
RuntimeGlobals.hmrDownloadUpdateHandlers
);
const withHmrManifest = this.runtimeRequirements.has(
RuntimeGlobals.hmrDownloadManifest
);
const conditionMap = chunkGraph.getChunkConditionMap(chunk, chunkHasJs);
const hasJsMatcher = compileBooleanMatcher(conditionMap);
const initialChunkIds = getInitialChunkIds(chunk, chunkGraph, chunkHasJs);
const outputName = compilation.getPath(
getChunkFilenameTemplate(chunk, compilation.outputOptions),
{
chunk,
contentHashType: "javascript"
}
);
const rootOutputDir = getUndoPath(
outputName,
compilation.outputOptions.path,
false
);
const stateExpression = withHmr
? `${RuntimeGlobals.hmrRuntimeStatePrefix}_readFileVm`
: undefined;
return Template.asString([
withBaseURI
? this._generateBaseUri(chunk, rootOutputDir, runtimeTemplate)
: "// no baseURI",
"",
"// object to store loaded chunks",
'// "0" means "already loaded", Promise means loading',
`var installedChunks = ${
stateExpression ? `${stateExpression} = ${stateExpression} || ` : ""
}{`,
Template.indent(
Array.from(initialChunkIds, (id) => `${JSON.stringify(id)}: 0`).join(
",\n"
)
),
"};",
"",
withOnChunkLoad
? `${
RuntimeGlobals.onChunksLoaded
}.readFileVm = ${runtimeTemplate.returningFunction(
"installedChunks[chunkId] === 0",
"chunkId"
)};`
: "// no on chunks loaded",
"",
withLoading || withExternalInstallChunk
? `var installChunk = ${runtimeTemplate.basicFunction("chunk", [
"var moreModules = chunk.modules, chunkIds = chunk.ids, runtime = chunk.runtime;",
"for(var moduleId in moreModules) {",
Template.indent([
`if(${RuntimeGlobals.hasOwnProperty}(moreModules, moduleId)) {`,
Template.indent([
`${RuntimeGlobals.moduleFactories}[moduleId] = moreModules[moduleId];`
]),
"}"
]),
"}",
`if(runtime) runtime(${RuntimeGlobals.require});`,
"for(var i = 0; i < chunkIds.length; i++) {",
Template.indent([
"if(installedChunks[chunkIds[i]]) {",
Template.indent(["installedChunks[chunkIds[i]][0]();"]),
"}",
"installedChunks[chunkIds[i]] = 0;"
]),
"}",
withOnChunkLoad ? `${RuntimeGlobals.onChunksLoaded}();` : ""
])};`
: "// no chunk install function needed",
"",
withLoading
? Template.asString([
"// ReadFile + VM.run chunk loading for javascript",
`${fn}.readFileVm = function(chunkId, promises) {`,
hasJsMatcher !== false
? Template.indent([
"",
"var installedChunkData = installedChunks[chunkId];",
'if(installedChunkData !== 0) { // 0 means "already installed".',
Template.indent([
'// array of [resolve, reject, promise] means "currently loading"',
"if(installedChunkData) {",
Template.indent(["promises.push(installedChunkData[2]);"]),
"} else {",
Template.indent([
hasJsMatcher === true
? "if(true) { // all chunks have JS"
: `if(${hasJsMatcher("chunkId")}) {`,
Template.indent([
"// load the chunk and return promise to it",
"var promise = new Promise(function(resolve, reject) {",
Template.indent([
"installedChunkData = installedChunks[chunkId] = [resolve, reject];",
`var filename = require(${runtimeTemplate.renderNodePrefixForCoreModule("path")}).join(__dirname, ${JSON.stringify(
rootOutputDir
)} + ${
RuntimeGlobals.getChunkScriptFilename
}(chunkId));`,
`require(${runtimeTemplate.renderNodePrefixForCoreModule("fs")}).readFile(filename, 'utf-8', function(err, content) {`,
Template.indent([
"if(err) return reject(err);",
"var chunk = {};",
`require(${runtimeTemplate.renderNodePrefixForCoreModule("vm")}).runInThisContext('(function(exports, require, __dirname, __filename) {' + content + '\\n})', filename)` +
`(chunk, require, require(${runtimeTemplate.renderNodePrefixForCoreModule("path")}).dirname(filename), filename);`,
"installChunk(chunk);"
]),
"});"
]),
"});",
"promises.push(installedChunkData[2] = promise);"
]),
hasJsMatcher === true
? "}"
: "} else installedChunks[chunkId] = 0;"
]),
"}"
]),
"}"
])
: Template.indent(["installedChunks[chunkId] = 0;"]),
"};"
])
: "// no chunk loading",
"",
withExternalInstallChunk
? Template.asString([
`module.exports = ${RuntimeGlobals.require};`,
`${RuntimeGlobals.externalInstallChunk} = installChunk;`
])
: "// no external install chunk",
"",
withHmr
? Template.asString([
"function loadUpdateChunk(chunkId, updatedModulesList) {",
Template.indent([
"return new Promise(function(resolve, reject) {",
Template.indent([
`var filename = require(${runtimeTemplate.renderNodePrefixForCoreModule("path")}).join(__dirname, ${JSON.stringify(
rootOutputDir
)} + ${RuntimeGlobals.getChunkUpdateScriptFilename}(chunkId));`,
`require(${runtimeTemplate.renderNodePrefixForCoreModule("fs")}).readFile(filename, 'utf-8', function(err, content) {`,
Template.indent([
"if(err) return reject(err);",
"var update = {};",
`require(${runtimeTemplate.renderNodePrefixForCoreModule("vm")}).runInThisContext('(function(exports, require, __dirname, __filename) {' + content + '\\n})', filename)` +
`(update, require, require(${runtimeTemplate.renderNodePrefixForCoreModule("path")}).dirname(filename), filename);`,
"var updatedModules = update.modules;",
"var runtime = update.runtime;",
"for(var moduleId in updatedModules) {",
Template.indent([
`if(${RuntimeGlobals.hasOwnProperty}(updatedModules, moduleId)) {`,
Template.indent([
"currentUpdate[moduleId] = updatedModules[moduleId];",
"if(updatedModulesList) updatedModulesList.push(moduleId);"
]),
"}"
]),
"}",
"if(runtime) currentUpdateRuntime.push(runtime);",
"resolve();"
]),
"});"
]),
"});"
]),
"}",
"",
generateJavascriptHMR("readFileVm")
])
: "// no HMR",
"",
withHmrManifest
? Template.asString([
`${RuntimeGlobals.hmrDownloadManifest} = function() {`,
Template.indent([
"return new Promise(function(resolve, reject) {",
Template.indent([
`var filename = require(${runtimeTemplate.renderNodePrefixForCoreModule("path")}).join(__dirname, ${JSON.stringify(
rootOutputDir
)} + ${RuntimeGlobals.getUpdateManifestFilename}());`,
`require(${runtimeTemplate.renderNodePrefixForCoreModule("fs")}).readFile(filename, 'utf-8', function(err, content) {`,
Template.indent([
"if(err) {",
Template.indent([
'if(["MODULE_NOT_FOUND", "ENOENT"].includes(err.code)) return resolve();',
"return reject(err);"
]),
"}",
"try { resolve(JSON.parse(content)); }",
"catch(e) { reject(e); }"
]),
"});"
]),
"});"
]),
"}"
])
: "// no HMR manifest"
]);
}
}
module.exports = ReadFileChunkLoadingRuntimeModule;
@@ -0,0 +1,314 @@
import {
createEmotionMacro,
transformers as vanillaTransformers
} from './emotion-macro'
import { createStyledMacro, styledTransformer } from './styled-macro'
import coreMacro, {
transformers as coreTransformers,
transformCsslessArrayExpression,
transformCsslessObjectExpression
} from './core-macro'
import { getStyledOptions, createTransformerMacro } from './utils'
const getCssExport = (reexported, importSource, mapping) => {
const cssExport = Object.keys(mapping).find(localExportName => {
const [packageName, exportName] = mapping[localExportName].canonicalImport
return packageName === '@emotion/react' && exportName === 'css'
})
if (!cssExport) {
throw new Error(
`You have specified that '${importSource}' re-exports '${reexported}' from '@emotion/react' but it doesn't also re-export 'css' from '@emotion/react', 'css' is necessary for certain optimisations, please re-export it from '${importSource}'`
)
}
return cssExport
}
let webStyledMacro = createStyledMacro({
importSource: '@emotion/styled/base',
originalImportSource: '@emotion/styled',
isWeb: true
})
let nativeStyledMacro = createStyledMacro({
importSource: '@emotion/native',
originalImportSource: '@emotion/native',
isWeb: false
})
let primitivesStyledMacro = createStyledMacro({
importSource: '@emotion/primitives',
originalImportSource: '@emotion/primitives',
isWeb: false
})
let vanillaEmotionMacro = createEmotionMacro('@emotion/css')
let transformersSource = {
'@emotion/css': vanillaTransformers,
'@emotion/react': coreTransformers,
'@emotion/styled': {
default: [
styledTransformer,
{ styledBaseImport: ['@emotion/styled/base', 'default'], isWeb: true }
]
},
'@emotion/primitives': {
default: [styledTransformer, { isWeb: false }]
},
'@emotion/native': {
default: [styledTransformer, { isWeb: false }]
}
}
export const macros = {
core: coreMacro,
nativeStyled: nativeStyledMacro,
primitivesStyled: primitivesStyledMacro,
webStyled: webStyledMacro,
vanillaEmotion: vanillaEmotionMacro
}
/*
export type BabelPath = any
export type EmotionBabelPluginPass = any
*/
const AUTO_LABEL_VALUES = ['dev-only', 'never', 'always']
export default function (babel, options) {
if (
options.autoLabel !== undefined &&
!AUTO_LABEL_VALUES.includes(options.autoLabel)
) {
throw new Error(
`The 'autoLabel' option must be undefined, or one of the following: ${AUTO_LABEL_VALUES.map(
s => `"${s}"`
).join(', ')}`
)
}
let t = babel.types
return {
name: '@emotion',
// https://github.com/babel/babel/blob/0c97749e0fe8ad845b902e0b23a24b308b0bf05d/packages/babel-plugin-syntax-jsx/src/index.ts#L9-L18
manipulateOptions(opts, parserOpts) {
const { plugins } = parserOpts
if (
plugins.some(p => {
const plugin = Array.isArray(p) ? p[0] : p
return plugin === 'typescript' || plugin === 'jsx'
})
) {
return
}
plugins.push('jsx')
},
visitor: {
ImportDeclaration(path, state) {
const macro = state.pluginMacros[path.node.source.value]
// most of this is from https://github.com/kentcdodds/babel-plugin-macros/blob/main/src/index.js
if (macro === undefined) {
return
}
if (t.isImportNamespaceSpecifier(path.node.specifiers[0])) {
return
}
const imports = path.node.specifiers.map(s => ({
localName: s.local.name,
importedName:
s.type === 'ImportDefaultSpecifier' ? 'default' : s.imported.name
}))
let shouldExit = false
let hasReferences = false
const referencePathsByImportName = imports.reduce(
(byName, { importedName, localName }) => {
let binding = path.scope.getBinding(localName)
if (!binding) {
shouldExit = true
return byName
}
byName[importedName] = binding.referencePaths
hasReferences =
hasReferences || Boolean(byName[importedName].length)
return byName
},
{}
)
if (!hasReferences || shouldExit) {
return
}
/**
* Other plugins that run before babel-plugin-macros might use path.replace, where a path is
* put into its own replacement. Apparently babel does not update the scope after such
* an operation. As a remedy, the whole scope is traversed again with an empty "Identifier"
* visitor - this makes the problem go away.
*
* See: https://github.com/kentcdodds/import-all.macro/issues/7
*/
state.file.scope.path.traverse({
Identifier() {}
})
macro({
path,
references: referencePathsByImportName,
state,
babel,
isEmotionCall: true,
isBabelMacrosCall: true
})
},
Program(path, state) {
let macros = {}
let jsxReactImports /*: Array<{
importSource: string,
export: string,
cssExport: string
}> */ = [
{ importSource: '@emotion/react', export: 'jsx', cssExport: 'css' }
]
state.jsxReactImport = jsxReactImports[0]
Object.keys(state.opts.importMap || {}).forEach(importSource => {
let value = state.opts.importMap[importSource]
let transformers = {}
Object.keys(value).forEach(localExportName => {
let { canonicalImport, ...options } = value[localExportName]
let [packageName, exportName] = canonicalImport
if (packageName === '@emotion/react' && exportName === 'jsx') {
jsxReactImports.push({
importSource,
export: localExportName,
cssExport: getCssExport('jsx', importSource, value)
})
return
}
let packageTransformers = transformersSource[packageName]
if (packageTransformers === undefined) {
throw new Error(
`There is no transformer for the export '${exportName}' in '${packageName}'`
)
}
let extraOptions
if (packageName === '@emotion/react' && exportName === 'Global') {
// this option is not supposed to be set in importMap
extraOptions = {
cssExport: getCssExport('Global', importSource, value)
}
} else if (
packageName === '@emotion/styled' &&
exportName === 'default'
) {
// this is supposed to override defaultOptions value
// and let correct value to be set if coming in options
extraOptions = {
styledBaseImport: undefined
}
}
let [exportTransformer, defaultOptions] = Array.isArray(
packageTransformers[exportName]
)
? packageTransformers[exportName]
: [packageTransformers[exportName]]
transformers[localExportName] = [
exportTransformer,
{
...defaultOptions,
...extraOptions,
...options
}
]
})
macros[importSource] = createTransformerMacro(transformers, {
importSource
})
})
state.pluginMacros = {
'@emotion/styled': webStyledMacro,
'@emotion/react': coreMacro,
'@emotion/primitives': primitivesStyledMacro,
'@emotion/native': nativeStyledMacro,
'@emotion/css': vanillaEmotionMacro,
...macros
}
for (const node of path.node.body) {
if (t.isImportDeclaration(node)) {
let jsxReactImport = jsxReactImports.find(
thing =>
node.source.value === thing.importSource &&
node.specifiers.some(
x =>
t.isImportSpecifier(x) && x.imported.name === thing.export
)
)
if (jsxReactImport) {
state.jsxReactImport = jsxReactImport
break
}
}
}
if (state.opts.cssPropOptimization === false) {
state.transformCssProp = false
} else {
state.transformCssProp = true
}
if (state.opts.sourceMap === false) {
state.emotionSourceMap = false
} else {
state.emotionSourceMap = true
}
},
JSXAttribute(path, state) {
if (path.node.name.name !== 'css' || !state.transformCssProp) {
return
}
if (t.isJSXExpressionContainer(path.node.value)) {
if (t.isArrayExpression(path.node.value.expression)) {
transformCsslessArrayExpression({
state,
babel,
path
})
} else if (t.isObjectExpression(path.node.value.expression)) {
transformCsslessObjectExpression({
state,
babel,
path,
cssImport: state.jsxReactImport
})
}
}
},
CallExpression: {
exit(path /*: BabelPath */, state /*: EmotionBabelPluginPass */) {
try {
if (
path.node.callee &&
path.node.callee.property &&
path.node.callee.property.name === 'withComponent'
) {
switch (path.node.arguments.length) {
case 1:
case 2: {
path.node.arguments[1] = getStyledOptions(t, path, state)
}
}
}
} catch (e) {
throw path.buildCodeFrameError(e)
}
}
}
}
}
}
@@ -0,0 +1,20 @@
import { AsyncLocalStorage } from 'node:async_hooks';
import { ContextManager } from '@opentelemetry/api';
export type AsyncLocalStorageLookup = {
asyncLocalStorage: AsyncLocalStorage<unknown>;
contextSymbol: symbol;
};
type ExtendedContextManagerInstance<ContextManagerInstance extends ContextManager> = new (...args: unknown[]) => ContextManagerInstance & {
getAsyncLocalStorageLookup(): AsyncLocalStorageLookup;
};
/**
* Wrap an OpenTelemetry ContextManager in a way that ensures the context is kept in sync with the Sentry Scope.
*
* Usage:
* import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks';
* const SentryContextManager = wrapContextManagerClass(AsyncLocalStorageContextManager);
* const contextManager = new SentryContextManager();
*/
export declare function wrapContextManagerClass<ContextManagerInstance extends ContextManager>(ContextManagerClass: new (...args: unknown[]) => ContextManagerInstance): ExtendedContextManagerInstance<ContextManagerInstance>;
export {};
//# sourceMappingURL=contextManager.d.ts.map
@@ -0,0 +1,16 @@
import type { ColumnBuilderBaseConfig, ColumnBuilderExtraConfig, ColumnDataType, HasDefault } from "../../column-builder.js";
import type { ColumnBaseConfig } from "../../column.js";
import { entityKind } from "../../entity.js";
import { SingleStoreColumn, SingleStoreColumnBuilder } from "./common.js";
export interface SingleStoreDateColumnBaseConfig {
hasOnUpdateNow: boolean;
}
export declare abstract class SingleStoreDateColumnBaseBuilder<T extends ColumnBuilderBaseConfig<ColumnDataType, string>, TRuntimeConfig extends object = object, TExtraConfig extends ColumnBuilderExtraConfig = ColumnBuilderExtraConfig> extends SingleStoreColumnBuilder<T, TRuntimeConfig & SingleStoreDateColumnBaseConfig, TExtraConfig> {
static readonly [entityKind]: string;
defaultNow(): HasDefault<this>;
onUpdateNow(): HasDefault<this>;
}
export declare abstract class SingleStoreDateBaseColumn<T extends ColumnBaseConfig<ColumnDataType, string>, TRuntimeConfig extends object = object> extends SingleStoreColumn<T, SingleStoreDateColumnBaseConfig & TRuntimeConfig> {
static readonly [entityKind]: string;
readonly hasOnUpdateNow: boolean;
}
@@ -0,0 +1 @@
{"version":3,"file":"li-element-container.js","sourceRoot":"","sources":["../../../../src/dom/elements/li-element-container.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;AAAA,0DAAsD;AAEtD;IAAwC,sCAAgB;IAGpD,4BAAY,OAAgB,EAAE,OAAsB;QAApD,YACI,kBAAM,OAAO,EAAE,OAAO,CAAC,SAE1B;QADG,KAAI,CAAC,KAAK,GAAG,OAAO,CAAC,KAAK,CAAC;;IAC/B,CAAC;IACL,yBAAC;AAAD,CAAC,AAPD,CAAwC,oCAAgB,GAOvD;AAPY,gDAAkB"}
@@ -0,0 +1,95 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const debugBuild = require('../../debug-build.js');
const debugLogger = require('../../utils/debug-logger.js');
/**
* Message validation functions for MCP server instrumentation
*
* Provides JSON-RPC 2.0 message type validation and MCP server instance validation.
*/
/**
* Validates if a message is a JSON-RPC request
* @param message - Message to validate
* @returns True if message is a JSON-RPC request
*/
function isJsonRpcRequest(message) {
return (
typeof message === 'object' &&
message !== null &&
'jsonrpc' in message &&
(message ).jsonrpc === '2.0' &&
'method' in message &&
'id' in message
);
}
/**
* Validates if a message is a JSON-RPC notification
* @param message - Message to validate
* @returns True if message is a JSON-RPC notification
*/
function isJsonRpcNotification(message) {
return (
typeof message === 'object' &&
message !== null &&
'jsonrpc' in message &&
(message ).jsonrpc === '2.0' &&
'method' in message &&
!('id' in message)
);
}
/**
* Validates if a message is a JSON-RPC response
* @param message - Message to validate
* @returns True if message is a JSON-RPC response
*/
function isJsonRpcResponse(message) {
return (
typeof message === 'object' &&
message !== null &&
'jsonrpc' in message &&
(message ).jsonrpc === '2.0' &&
'id' in message &&
('result' in message || 'error' in message)
);
}
/**
* Validates MCP server instance with type checking
* @param instance - Object to validate as MCP server instance
* @returns True if instance has required MCP server methods
*/
function validateMcpServerInstance(instance) {
if (
typeof instance === 'object' &&
instance !== null &&
'resource' in instance &&
'tool' in instance &&
'prompt' in instance &&
'connect' in instance
) {
return true;
}
debugBuild.DEBUG_BUILD && debugLogger.debug.warn('Did not patch MCP server. Interface is incompatible.');
return false;
}
/**
* Check if the item is a valid content item
* @param item - The item to check
* @returns True if the item is a valid content item, false otherwise
*/
function isValidContentItem(item) {
return item != null && typeof item === 'object';
}
exports.isJsonRpcNotification = isJsonRpcNotification;
exports.isJsonRpcRequest = isJsonRpcRequest;
exports.isJsonRpcResponse = isJsonRpcResponse;
exports.isValidContentItem = isValidContentItem;
exports.validateMcpServerInstance = validateMcpServerInstance;
//# sourceMappingURL=validation.js.map
@@ -0,0 +1,11 @@
"use strict";
var _array_with_holes = require("./_array_with_holes.cjs");
var _iterable_to_array = require("./_iterable_to_array.cjs");
var _non_iterable_rest = require("./_non_iterable_rest.cjs");
var _unsupported_iterable_to_array = require("./_unsupported_iterable_to_array.cjs");
function _to_array(arr) {
return _array_with_holes._(arr) || _iterable_to_array._(arr) || _unsupported_iterable_to_array._(arr) || _non_iterable_rest._();
}
exports._ = _to_array;
@@ -0,0 +1 @@
export { _ as default } from "../esm/_ts_dispose_resources.js";
@@ -0,0 +1 @@
module.exports={C:{"5":0.00977,"50":0.00326,"52":0.00326,"91":0.00326,"99":0.00326,"115":0.09442,"127":0.00651,"135":0.00326,"136":0.00326,"140":0.00977,"141":0.00651,"142":0.00326,"143":0.00651,"144":0.01302,"145":0.33862,"146":0.61213,"147":0.01302,_:"2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 51 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 92 93 94 95 96 97 98 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 125 126 128 129 130 131 132 133 134 137 138 139 148 149 3.5 3.6"},D:{"69":0.00977,"77":0.00977,"79":0.00651,"81":0.00326,"83":0.00326,"87":0.00651,"88":0.00326,"91":0.00326,"93":0.00326,"103":0.06512,"104":0.04233,"105":0.03582,"106":0.03582,"107":0.03256,"108":0.03582,"109":1.03541,"110":0.03582,"111":0.04558,"112":2.43874,"114":0.00326,"116":0.09442,"117":0.03582,"119":0.00326,"120":0.04233,"121":0.00326,"122":0.03256,"123":0.00977,"124":0.04884,"125":0.27025,"126":0.5991,"127":0.00977,"128":0.02279,"129":0.00651,"130":0.01302,"131":0.10419,"132":0.04233,"133":0.08466,"134":0.01954,"135":0.03907,"136":0.02605,"137":0.0293,"138":0.1921,"139":0.07489,"140":0.06186,"141":0.11722,"142":6.06267,"143":11.38298,"144":0.09442,"145":0.00326,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 70 71 72 73 74 75 76 78 80 84 85 86 89 90 92 94 95 96 97 98 99 100 101 102 113 115 118 146"},F:{"79":0.00326,"92":0.00326,"93":0.08791,"95":0.00651,"123":0.00326,"124":0.1628,"125":0.09117,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 80 81 82 83 84 85 86 87 88 89 90 91 94 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00326,"92":0.00326,"109":0.00651,"114":0.00326,"125":0.00326,"131":0.00326,"134":0.00977,"135":0.00326,"136":0.00326,"137":0.00326,"138":0.00326,"139":0.00326,"140":0.00651,"141":0.00651,"142":0.39723,"143":1.48148,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 119 120 121 122 123 124 126 127 128 129 130 132 133"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 15.1 15.2-15.3 15.4 16.0 16.2 16.4 17.0 18.2","12.1":0.00326,"13.1":0.00651,"14.1":0.00651,"15.5":0.00326,"15.6":0.01954,"16.1":0.00977,"16.3":0.00326,"16.5":0.00326,"16.6":0.02605,"17.1":0.00651,"17.2":0.00326,"17.3":0.00651,"17.4":0.00326,"17.5":0.00977,"17.6":0.03256,"18.0":0.00326,"18.1":0.00651,"18.3":0.00651,"18.4":0.00326,"18.5-18.6":0.01954,"26.0":0.01954,"26.1":0.10419,"26.2":0.03256,"26.3":0.00326},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00239,"5.0-5.1":0,"6.0-6.1":0.00479,"7.0-7.1":0.00359,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.00957,"10.0-10.2":0.0012,"10.3":0.01675,"11.0-11.2":0.20578,"11.3-11.4":0.00598,"12.0-12.1":0.00479,"12.2-12.5":0.05384,"13.0-13.1":0.0012,"13.2":0.00837,"13.3":0.00239,"13.4-13.7":0.00837,"14.0-14.4":0.01675,"14.5-14.8":0.01795,"15.0-15.1":0.01914,"15.2-15.3":0.01436,"15.4":0.01555,"15.5":0.01675,"15.6-15.8":0.25962,"16.0":0.02991,"16.1":0.05743,"16.2":0.02991,"16.3":0.05384,"16.4":0.01316,"16.5":0.02273,"16.6-16.7":0.33738,"17.0":0.01914,"17.1":0.03111,"17.2":0.02273,"17.3":0.0347,"17.4":0.05862,"17.5":0.11485,"17.6-17.7":0.2656,"18.0":0.05982,"18.1":0.12442,"18.2":0.0658,"18.3":0.21415,"18.4":0.11007,"18.5-18.7":7.90332,"26.0":0.15433,"26.1":1.28372,"26.2":0.24406,"26.3":0.01077},P:{"23":0.0106,"26":0.0106,"27":0.0212,"28":0.03179,"29":0.50869,_:"4 20 21 22 24 25 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 17.0 18.0 19.0","7.2-7.4":0.0106},I:{"0":0.0202,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0,"4.4":0,"4.4.3-4.4.4":0.00002},A:{_:"6 7 8 9 10 11 5.5"},K:{"0":0.53278,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{_:"2.5 3.0-3.1"},J:{_:"7 10"},Q:{_:"14.9"},O:{"0":0.08767},H:{"0":0},L:{"0":58.54319},R:{_:"0"},M:{"0":0.06744}};
@@ -0,0 +1,85 @@
import type { CollectionSlug, DataFromCollectionSlug, Document, PaginatedDistinctDocs, Payload, PayloadRequest, PopulateType, RequestContext, Sort, TypedLocale, Where } from '../../../index.js';
export type Options<TSlug extends CollectionSlug, TField extends keyof DataFromCollectionSlug<TSlug>> = {
/**
* the Collection slug to operate against.
*/
collection: TSlug;
/**
* [Context](https://payloadcms.com/docs/hooks/context), which will then be passed to `context` and `req.context`,
* which can be read by hooks. Useful if you want to pass additional information to the hooks which
* shouldn't be necessarily part of the document, for example a `triggerBeforeChange` option which can be read by the BeforeChange hook
* to determine if it should run or not.
*/
context?: RequestContext;
/**
* [Control auto-population](https://payloadcms.com/docs/queries/depth) of nested relationship and upload fields.
*/
depth?: number;
/**
* When set to `true`, errors will not be thrown.
*/
disableErrors?: boolean;
/**
* The field to get distinct values for
*/
field: ({} & string) | TField;
/**
* The maximum distinct field values to be returned.
* By default the operation returns all the values.
*/
limit?: number;
/**
* Specify [locale](https://payloadcms.com/docs/configuration/localization) for any returned documents.
*/
locale?: 'all' | TypedLocale;
/**
* Skip access control.
* Set to `false` if you want to respect Access Control for the operation, for example when fetching data for the front-end.
* @default true
*/
overrideAccess?: boolean;
/**
* Get a specific page number (if limit is specified)
* @default 1
*/
page?: number;
/**
* Specify [populate](https://payloadcms.com/docs/queries/select#populate) to control which fields to include to the result from populated documents.
*/
populate?: PopulateType;
/**
* The `PayloadRequest` object. You can pass it to thread the current [transaction](https://payloadcms.com/docs/database/transactions), user and locale to the operation.
* Recommended to pass when using the Local API from hooks, as usually you want to execute the operation within the current transaction.
*/
req?: Partial<PayloadRequest>;
/**
* Opt-in to receiving hidden fields. By default, they are hidden from returned documents in accordance to your config.
* @default false
*/
showHiddenFields?: boolean;
/**
* Sort the documents, can be a string or an array of strings
* @example '-createdAt' // Sort DESC by createdAt
* @example ['group', '-createdAt'] // sort by 2 fields, ASC group and DESC createdAt
*/
sort?: Sort;
/**
* When set to `true`, the query will include both normal and trashed documents.
* To query only trashed documents, pass `trash: true` and combine with a `where` clause filtering by `deletedAt`.
* By default (`false`), the query will only include normal documents and exclude those with a `deletedAt` field.
*
* This argument has no effect unless `trash` is enabled on the collection.
* @default false
*/
trash?: boolean;
/**
* If you set `overrideAccess` to `false`, you can pass a user to use against the access control checks.
*/
user?: Document;
/**
* A filter [query](https://payloadcms.com/docs/queries/overview)
*/
where?: Where;
};
export declare function findDistinct<TSlug extends CollectionSlug, TField extends keyof DataFromCollectionSlug<TSlug> & string>(payload: Payload, options: Options<TSlug, TField>): Promise<PaginatedDistinctDocs<Record<TField, DataFromCollectionSlug<TSlug>[TField]>>>;
//# sourceMappingURL=findDistinct.d.ts.map
@@ -0,0 +1,2 @@
export { Trie, createTrieFromBase64 } from './Trie';
export { TrieBuilder, serializeBase64 } from './TrieBuilder';
@@ -0,0 +1,131 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const stacktrace = require('./stacktrace.js');
/**
* Does this filename look like it's part of the app code?
*/
function filenameIsInApp(filename, isNative = false) {
const isInternal =
isNative ||
(filename &&
// It's not internal if it's an absolute linux path
!filename.startsWith('/') &&
// It's not internal if it's an absolute windows path
!filename.match(/^[A-Z]:/) &&
// It's not internal if the path is starting with a dot
!filename.startsWith('.') &&
// It's not internal if the frame has a protocol. In node, this is usually the case if the file got pre-processed with a bundler like webpack
!filename.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//)); // Schema from: https://stackoverflow.com/a/3641782
// in_app is all that's not an internal Node function or a module within node_modules
// note that isNative appears to return true even for node core libraries
// see https://github.com/getsentry/raven-node/issues/176
return !isInternal && filename !== undefined && !filename.includes('node_modules/');
}
/** Node Stack line parser */
function node(getModule) {
const FILENAME_MATCH = /^\s*[-]{4,}$/;
const FULL_MATCH = /at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;
const DATA_URI_MATCH = /at (?:async )?(.+?) \(data:(.*?),/;
return (line) => {
const dataUriMatch = line.match(DATA_URI_MATCH);
if (dataUriMatch) {
return {
filename: `<data:${dataUriMatch[2]}>`,
function: dataUriMatch[1],
};
}
const lineMatch = line.match(FULL_MATCH);
if (lineMatch) {
let object;
let method;
let functionName;
let typeName;
let methodName;
if (lineMatch[1]) {
functionName = lineMatch[1];
let methodStart = functionName.lastIndexOf('.');
if (functionName[methodStart - 1] === '.') {
methodStart--;
}
if (methodStart > 0) {
object = functionName.slice(0, methodStart);
method = functionName.slice(methodStart + 1);
const objectEnd = object.indexOf('.Module');
if (objectEnd > 0) {
functionName = functionName.slice(objectEnd + 1);
object = object.slice(0, objectEnd);
}
}
typeName = undefined;
}
if (method) {
typeName = object;
methodName = method;
}
if (method === '<anonymous>') {
methodName = undefined;
functionName = undefined;
}
if (functionName === undefined) {
methodName = methodName || stacktrace.UNKNOWN_FUNCTION;
functionName = typeName ? `${typeName}.${methodName}` : methodName;
}
let filename = stacktrace.normalizeStackTracePath(lineMatch[2]);
const isNative = lineMatch[5] === 'native';
if (!filename && lineMatch[5] && !isNative) {
filename = lineMatch[5];
}
return {
filename: filename ? decodeURI(filename) : undefined,
module: getModule ? getModule(filename) : undefined,
function: functionName,
lineno: _parseIntOrUndefined(lineMatch[3]),
colno: _parseIntOrUndefined(lineMatch[4]),
in_app: filenameIsInApp(filename || '', isNative),
};
}
if (line.match(FILENAME_MATCH)) {
return {
filename: line,
};
}
return undefined;
};
}
/**
* Node.js stack line parser
*
* This is in @sentry/core so it can be used from the Electron SDK in the browser for when `nodeIntegration == true`.
* This allows it to be used without referencing or importing any node specific code which causes bundlers to complain
*/
function nodeStackLineParser(getModule) {
return [90, node(getModule)];
}
function _parseIntOrUndefined(input) {
return parseInt(input || '', 10) || undefined;
}
exports.filenameIsInApp = filenameIsInApp;
exports.node = node;
exports.nodeStackLineParser = nodeStackLineParser;
//# sourceMappingURL=node-stack-trace.js.map
@@ -0,0 +1,15 @@
"use strict";
exports.formatRelative = void 0;
const formatRelativeLocale = {
lastWeek: "'Praėjusį' eeee p",
yesterday: "'Vakar' p",
today: "'Šiandien' p",
tomorrow: "'Rytoj' p",
nextWeek: "eeee p",
other: "P",
};
const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];
exports.formatRelative = formatRelative;
@@ -0,0 +1,101 @@
const formatDistanceLocale = {
lessThanXSeconds: {
one: "少於 1 秒",
other: "少於 {{count}} 秒",
},
xSeconds: {
one: "1 秒",
other: "{{count}} 秒",
},
halfAMinute: "半分鐘",
lessThanXMinutes: {
one: "少於 1 分鐘",
other: "少於 {{count}} 分鐘",
},
xMinutes: {
one: "1 分鐘",
other: "{{count}} 分鐘",
},
xHours: {
one: "1 小時",
other: "{{count}} 小時",
},
aboutXHours: {
one: "大約 1 小時",
other: "大約 {{count}} 小時",
},
xDays: {
one: "1 天",
other: "{{count}} 天",
},
aboutXWeeks: {
one: "大約 1 個星期",
other: "大約 {{count}} 個星期",
},
xWeeks: {
one: "1 個星期",
other: "{{count}} 個星期",
},
aboutXMonths: {
one: "大約 1 個月",
other: "大約 {{count}} 個月",
},
xMonths: {
one: "1 個月",
other: "{{count}} 個月",
},
aboutXYears: {
one: "大約 1 年",
other: "大約 {{count}} 年",
},
xYears: {
one: "1 年",
other: "{{count}} 年",
},
overXYears: {
one: "超過 1 年",
other: "超過 {{count}} 年",
},
almostXYears: {
one: "將近 1 年",
other: "將近 {{count}} 年",
},
};
export const formatDistance = (token, count, options) => {
let result;
const tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", String(count));
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return result + "內";
} else {
return result + "前";
}
}
return result;
};
@@ -0,0 +1 @@
{"version":3,"file":"execute.d.ts","sourceRoot":"","sources":["../../src/postgres/execute.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,YAAY,CAAA;AAEzC,eAAO,MAAM,OAAO,EAAE,OAAO,CAAC,GAAG,CAQhC,CAAA"}
@@ -0,0 +1,137 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.mjs";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.mjs";
const matchOrdinalNumberPattern = /^(\d+)/;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(ق|ب)/g,
abbreviated: /^(ق.م|ب.م)/g,
wide: /^(قبل الميلاد|بعد الميلاد)/g,
};
const parseEraPatterns = {
any: [/^ق/g, /^ب/g],
};
const matchQuarterPatterns = {
narrow: /^[1234]/,
abbreviated: /^ر[1234]/,
wide: /^الربع (الأول|الثاني|الثالث|الرابع)/,
};
const parseQuarterPatterns = {
wide: [/الربع الأول/, /الربع الثاني/, /الربع الثالث/, /الربع الرابع/],
any: [/1/, /2/, /3/, /4/],
};
const matchMonthPatterns = {
narrow: /^(ي|ف|م|أ|س|ن|د)/,
abbreviated: /^(ينا|فبر|مارس|أبريل|مايو|يونـ|يولـ|أغسـ|سبتـ|أكتـ|نوفـ|ديسـ)/,
wide: /^(يناير|فبراير|مارس|أبريل|مايو|يونيو|يوليو|أغسطس|سبتمبر|أكتوبر|نوفمبر|ديسمبر)/,
};
const parseMonthPatterns = {
narrow: [
/^ي/,
/^ف/,
/^م/,
/^أ/,
/^م/,
/^ي/,
/^ي/,
/^أ/,
/^س/,
/^أ/,
/^ن/,
/^د/,
],
any: [
/^ينا/,
/^فبر/,
/^مارس/,
/^أبريل/,
/^مايو/,
/^يون/,
/^يول/,
/^أغس/,
/^سبت/,
/^أكت/,
/^نوف/,
/^ديس/,
],
};
const matchDayPatterns = {
narrow: /^(ح|ن|ث|ر|خ|ج|س)/,
short: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/,
abbreviated: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/,
wide: /^(الأحد|الاثنين|الثلاثاء|الأربعاء|الخميس|الجمعة|السبت)/,
};
const parseDayPatterns = {
narrow: [/^ح/, /^ن/, /^ث/, /^ر/, /^خ/, /^ج/, /^س/],
any: [/أحد/, /اثنين/, /ثلاثاء/, /أربعاء/, /خميس/, /جمعة/, /سبت/],
};
const matchDayPeriodPatterns = {
narrow: /^(ص|م|ن|ظ|في الصباح|بعد الظهر|في المساء|في الليل)/,
abbreviated: /^(ص|م|نصف الليل|ظهراً|في الصباح|بعد الظهر|في المساء|في الليل)/,
wide: /^(ص|م|نصف الليل|في الصباح|ظهراً|بعد الظهر|في المساء|في الليل)/,
any: /^(ص|م|صباح|ظهر|مساء|ليل)/,
};
const parseDayPeriodPatterns = {
any: {
am: /^ص/,
pm: /^م/,
midnight: /^ن/,
noon: /^ظ/,
morning: /^ص/,
afternoon: /^بعد/,
evening: /^م/,
night: /^ل/,
},
};
export const match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function (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: (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",
}),
};
@@ -0,0 +1,2 @@
const e=require(`../../utils/throw-if-empty.cjs`),t=t=>()=>(e.throwIfEmpty(t,`Keys cannot be empty`),{path:`/notifications`,body:JSON.stringify(t),method:`DELETE`}),n=t=>()=>(e.throwIfEmpty(t,`Key cannot be empty`),{path:`/notifications/${t}`,method:`DELETE`});exports.deleteNotification=n,exports.deleteNotifications=t;
//# sourceMappingURL=notifications.cjs.map
@@ -0,0 +1,44 @@
const formatRelativeLocale = {
lastWeek: (date) => {
const day = date.getDay();
switch (day) {
case 0:
return "'prejšnjo nedeljo ob' p";
case 3:
return "'prejšnjo sredo ob' p";
case 6:
return "'prejšnjo soboto ob' p";
default:
return "'prejšnji' EEEE 'ob' p";
}
},
yesterday: "'včeraj ob' p",
today: "'danes ob' p",
tomorrow: "'jutri ob' p",
nextWeek: (date) => {
const day = date.getDay();
switch (day) {
case 0:
return "'naslednjo nedeljo ob' p";
case 3:
return "'naslednjo sredo ob' p";
case 6:
return "'naslednjo soboto ob' p";
default:
return "'naslednji' EEEE 'ob' p";
}
},
other: "P",
};
export const formatRelative = (token, date, _baseDate, _options) => {
const format = formatRelativeLocale[token];
if (typeof format === "function") {
return format(date);
}
return format;
};
@@ -0,0 +1,19 @@
import { Span } from '@opentelemetry/api';
import type { HandleFunction, NextFunction, Server } from 'connect';
import { Use } from './internal-types';
import { InstrumentationBase, InstrumentationConfig, InstrumentationNodeModuleDefinition } from '@opentelemetry/instrumentation';
export declare const ANONYMOUS_NAME = "anonymous";
/** Connect instrumentation for OpenTelemetry */
export declare class ConnectInstrumentation extends InstrumentationBase {
constructor(config?: InstrumentationConfig);
init(): InstrumentationNodeModuleDefinition[];
private _patchApp;
private _patchConstructor;
_patchNext(next: NextFunction, finishSpan: () => void): NextFunction;
_startSpan(routeName: string, middleWare: HandleFunction): Span;
_patchMiddleware(routeName: string, middleWare: HandleFunction): HandleFunction;
_patchUse(original: Server['use']): Use;
_patchHandle(original: Server['handle']): Server['handle'];
_patchOut(out: NextFunction, completeStack: () => void): NextFunction;
}
//# sourceMappingURL=instrumentation.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"traverseForLocalizedFields.d.ts","sourceRoot":"","sources":["../../src/utilities/traverseForLocalizedFields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,2BAA2B,CAAA;AAEtD,eAAO,MAAM,0BAA0B,WAAY,KAAK,EAAE,KAAG,OA0C5D,CAAA"}
@@ -0,0 +1,219 @@
'use strict';
var bundlerPluginCore = require('@sentry/bundler-plugin-core');
var node_module = require('node:module');
var path = require('path');
var uuid = require('uuid');
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 path__namespace = /*#__PURE__*/_interopNamespace(path);
function ownKeys(object, enumerableOnly) {
var keys = Object.keys(object);
if (Object.getOwnPropertySymbols) {
var symbols = Object.getOwnPropertySymbols(object);
enumerableOnly && (symbols = symbols.filter(function (sym) {
return Object.getOwnPropertyDescriptor(object, sym).enumerable;
})), keys.push.apply(keys, symbols);
}
return keys;
}
function _objectSpread2(target) {
for (var i = 1; i < arguments.length; i++) {
var source = null != arguments[i] ? arguments[i] : {};
i % 2 ? ownKeys(Object(source), !0).forEach(function (key) {
_defineProperty(target, key, source[key]);
}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) {
Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key));
});
}
return target;
}
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 _toPrimitive(input, hint) {
if (typeof input !== "object" || input === null) return input;
var prim = input[Symbol.toPrimitive];
if (prim !== undefined) {
var res = prim.call(input, hint || "default");
if (typeof res !== "object") return res;
throw new TypeError("@@toPrimitive must return a primitive value.");
}
return (hint === "string" ? String : Number)(input);
}
function _toPropertyKey(arg) {
var key = _toPrimitive(arg, "string");
return typeof key === "symbol" ? key : String(key);
}
// since webpack 5.1 compiler contains webpack module so plugins always use correct webpack version
// https://github.com/webpack/webpack/commit/65eca2e529ce1d79b79200d4bdb1ce1b81141459
function webpackInjectionPlugin(UnsafeBannerPlugin) {
return function (injectionCode, debugIds) {
return {
name: "sentry-webpack-injection-plugin",
webpack: function webpack(compiler) {
var _compiler$webpack;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore webpack version compatibility shenanigans
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
var BannerPlugin =
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore webpack version compatibility shenanigans
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
(compiler === null || compiler === void 0 ? void 0 : (_compiler$webpack = compiler.webpack) === null || _compiler$webpack === void 0 ? void 0 : _compiler$webpack.BannerPlugin) || UnsafeBannerPlugin;
compiler.options.plugins = compiler.options.plugins || [];
compiler.options.plugins.push(
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call
new BannerPlugin({
raw: true,
include: /\.(js|ts|jsx|tsx|mjs|cjs)(\?[^?]*)?(#[^#]*)?$/,
banner: function banner(arg) {
var codeToInject = injectionCode.clone();
if (debugIds) {
var _arg$chunk$contentHas, _arg$chunk, _arg$chunk$contentHas2, _arg$chunk2;
var hash = (_arg$chunk$contentHas = arg === null || arg === void 0 ? void 0 : (_arg$chunk = arg.chunk) === null || _arg$chunk === void 0 ? void 0 : (_arg$chunk$contentHas2 = _arg$chunk.contentHash) === null || _arg$chunk$contentHas2 === void 0 ? void 0 : _arg$chunk$contentHas2.javascript) !== null && _arg$chunk$contentHas !== void 0 ? _arg$chunk$contentHas : arg === null || arg === void 0 ? void 0 : (_arg$chunk2 = arg.chunk) === null || _arg$chunk2 === void 0 ? void 0 : _arg$chunk2.hash;
var debugId = hash ? bundlerPluginCore.stringToUUID(hash) : uuid.v4();
codeToInject.append(bundlerPluginCore.getDebugIdSnippet(debugId));
}
return codeToInject.code();
}
}));
}
};
};
}
function webpackComponentNameAnnotatePlugin() {
return function (ignoredComponents, injectIntoHtml) {
return {
name: "sentry-webpack-component-name-annotate-plugin",
enforce: "pre",
// Webpack needs this hook for loader logic, so the plugin is not run on unsupported file types
transformInclude: function transformInclude(id) {
return id.endsWith(".tsx") || id.endsWith(".jsx");
},
transform: bundlerPluginCore.createComponentNameAnnotateHooks(ignoredComponents, injectIntoHtml).transform
};
};
}
function webpackBundleSizeOptimizationsPlugin(UnsafeDefinePlugin) {
return function (replacementValues) {
return {
name: "sentry-webpack-bundle-size-optimizations-plugin",
webpack: function webpack(compiler) {
var _compiler$webpack2;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore webpack version compatibility shenanigans
// eslint-disable-next-line @typescript-eslint/no-unsafe-assignment, @typescript-eslint/no-unsafe-member-access
var DefinePlugin =
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore webpack version compatibility shenanigans
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
(compiler === null || compiler === void 0 ? void 0 : (_compiler$webpack2 = compiler.webpack) === null || _compiler$webpack2 === void 0 ? void 0 : _compiler$webpack2.DefinePlugin) || UnsafeDefinePlugin;
compiler.options.plugins = compiler.options.plugins || [];
compiler.options.plugins.push(
// eslint-disable-next-line @typescript-eslint/no-unsafe-argument, @typescript-eslint/no-unsafe-call
new DefinePlugin(_objectSpread2({}, replacementValues)));
}
};
};
}
function webpackDebugIdUploadPlugin(upload, logger, createDependencyOnBuildArtifacts, forceExitOnBuildCompletion) {
var pluginName = "sentry-webpack-debug-id-upload-plugin";
return {
name: pluginName,
webpack: function webpack(compiler) {
var freeGlobalDependencyOnDebugIdSourcemapArtifacts = createDependencyOnBuildArtifacts();
compiler.hooks.afterEmit.tapAsync(pluginName, function (compilation, callback) {
var _ref;
// eslint-disable-next-line @typescript-eslint/no-unsafe-member-access
var outputPath = (_ref = compilation.outputOptions.path) !== null && _ref !== void 0 ? _ref : path__namespace.resolve();
var buildArtifacts = Object.keys(compilation.assets).map(function (asset) {
return path__namespace.join(outputPath, asset);
});
void upload(buildArtifacts).then(function () {
callback();
})["finally"](function () {
freeGlobalDependencyOnDebugIdSourcemapArtifacts();
});
});
if (forceExitOnBuildCompletion && compiler.options.mode === "production") {
compiler.hooks.done.tap(pluginName, function () {
setTimeout(function () {
logger.debug("Exiting process after debug file upload");
process.exit(0);
});
});
}
}
};
}
// Detect webpack major version for telemetry (helps differentiate webpack 4 vs 5 usage)
function getWebpackMajorVersion() {
try {
var _webpack$version, _webpack$default;
// eslint-disable-next-line @typescript-eslint/ban-ts-comment
// @ts-ignore - Rollup already transpiles this for us
var req = node_module.createRequire((typeof document === 'undefined' ? new (require('u' + 'rl').URL)('file:' + __filename).href : (document.currentScript && document.currentScript.tagName.toUpperCase() === 'SCRIPT' && document.currentScript.src || new URL('webpack4and5.js', document.baseURI).href)));
var webpack = req("webpack");
var version = (_webpack$version = webpack === null || webpack === void 0 ? void 0 : webpack.version) !== null && _webpack$version !== void 0 ? _webpack$version : webpack === null || webpack === void 0 ? void 0 : (_webpack$default = webpack["default"]) === null || _webpack$default === void 0 ? void 0 : _webpack$default.version;
var webpackMajorVersion = version === null || version === void 0 ? void 0 : version.split(".")[0]; // "4" or "5"
return webpackMajorVersion;
} catch (error) {
return undefined;
}
}
/**
* The factory function accepts BannerPlugin and DefinePlugin classes in
* order to avoid direct dependencies on webpack.
*
* This allow us to export version of the plugin for webpack 5.1+ and compatible environments.
*
* Since webpack 5.1 compiler contains webpack module so plugins always use correct webpack version.
*/
function sentryWebpackUnpluginFactory() {
var _ref2 = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {},
BannerPlugin = _ref2.BannerPlugin,
DefinePlugin = _ref2.DefinePlugin;
return bundlerPluginCore.sentryUnpluginFactory({
injectionPlugin: webpackInjectionPlugin(BannerPlugin),
componentNameAnnotatePlugin: webpackComponentNameAnnotatePlugin(),
debugIdUploadPlugin: webpackDebugIdUploadPlugin,
bundleSizeOptimizationsPlugin: webpackBundleSizeOptimizationsPlugin(DefinePlugin),
getBundlerMajorVersion: getWebpackMajorVersion
});
}
exports.sentryWebpackUnpluginFactory = sentryWebpackUnpluginFactory;
//# sourceMappingURL=webpack4and5.js.map
@@ -0,0 +1,20 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _construct;
var _isNativeReflectConstruct = require("./isNativeReflectConstruct.js");
var _setPrototypeOf = require("./setPrototypeOf.js");
function _construct(Parent, args, Class) {
if ((0, _isNativeReflectConstruct.default)()) {
return Reflect.construct.apply(null, arguments);
}
var a = [null];
a.push.apply(a, args);
var instance = new (Parent.bind.apply(Parent, a))();
if (Class) (0, _setPrototypeOf.default)(instance, Class.prototype);
return instance;
}
//# sourceMappingURL=construct.js.map
@@ -0,0 +1,24 @@
import { generatePayloadCookie, isolateObjectProperty, refreshOperation } from 'payload';
export function refresh(collection) {
async function resolver(_, __, context) {
const options = {
collection,
depth: 0,
req: isolateObjectProperty(context.req, 'transactionID')
};
const result = await refreshOperation(options);
const cookie = generatePayloadCookie({
collectionAuthConfig: collection.config.auth,
cookiePrefix: context.req.payload.config.cookiePrefix,
token: result.refreshedToken
});
context.headers['Set-Cookie'] = cookie;
if (collection.config.auth.removeTokenFromResponses) {
delete result.refreshedToken;
}
return result;
}
return resolver;
}
//# sourceMappingURL=refresh.js.map
@@ -0,0 +1,70 @@
import { executeAccess } from '../../auth/executeAccess.js';
import { APIError } from '../../errors/APIError.js';
import { Forbidden } from '../../errors/Forbidden.js';
import { getRequestCollectionWithID } from '../../utilities/getRequestEntity.js';
import { isURLAllowed } from '../../utilities/isURLAllowed.js';
// If doc id is provided, it means we are updating the doc
// /:collectionSlug/paste-url/:doc-id?src=:fileUrl
// If doc id is not provided, it means we are creating a new doc
// /:collectionSlug/paste-url?src=:fileUrl
export const getFileFromURLHandler = async (req)=>{
const { id, collection } = getRequestCollectionWithID(req, {
optionalID: true
});
if (!req.user) {
throw new Forbidden(req.t);
}
const config = collection?.config;
if (id) {
// updating doc
const accessResult = await executeAccess({
req
}, config.access.update);
if (!accessResult) {
throw new Forbidden(req.t);
}
} else {
// creating doc
const accessResult = await executeAccess({
req
}, config.access?.create);
if (!accessResult) {
throw new Forbidden(req.t);
}
}
try {
if (!req.url) {
throw new APIError('Request URL is missing.', 400);
}
const { searchParams } = new URL(req.url);
const src = searchParams.get('src');
if (!src || typeof src !== 'string') {
throw new APIError('A valid URL string is required.', 400);
}
const validatedUrl = new URL(src);
if (typeof config.upload?.pasteURL === 'object' && !isURLAllowed(validatedUrl.href, config.upload.pasteURL.allowList)) {
throw new APIError(`The provided URL (${validatedUrl.href}) is not allowed.`, 400);
}
// Fetch the file with no compression
const response = await fetch(validatedUrl.href, {
headers: {
'Accept-Encoding': 'identity'
}
});
if (!response.ok) {
throw new APIError(`Failed to fetch file from ${validatedUrl.href}`, response.status);
}
const decodedFileName = decodeURIComponent(validatedUrl.pathname.split('/').pop() || '');
return new Response(response.body, {
headers: {
'Content-Disposition': `attachment; filename="${decodedFileName}"`,
'Content-Length': response.headers.get('content-length') || '',
'Content-Type': response.headers.get('content-type') || 'application/octet-stream'
}
});
} catch (err) {
throw new APIError(`Error fetching file: ${err instanceof Error ? err.message : 'Unknown error'}`, 500);
}
};
//# sourceMappingURL=getFileFromURL.js.map
@@ -0,0 +1,5 @@
export declare const OPENAI_INTEGRATION_NAME = "OpenAI";
export declare const INSTRUMENTED_METHODS: readonly ["responses.create", "chat.completions.create", "embeddings.create", "conversations.create"];
export declare const RESPONSES_TOOL_CALL_EVENT_TYPES: readonly ["response.output_item.added", "response.function_call_arguments.delta", "response.function_call_arguments.done", "response.output_item.done"];
export declare const RESPONSE_EVENT_TYPES: readonly ["response.created", "response.in_progress", "response.failed", "response.completed", "response.incomplete", "response.queued", "response.output_text.delta", "response.output_item.added", "response.function_call_arguments.delta", "response.function_call_arguments.done", "response.output_item.done"];
//# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1,102 @@
"use strict";
exports.lightFormatters = void 0;
var _index = require("../addLeadingZeros.cjs");
/*
* | | Unit | | Unit |
* |-----|--------------------------------|-----|--------------------------------|
* | a | AM, PM | A* | |
* | d | Day of month | D | |
* | h | Hour [1-12] | H | Hour [0-23] |
* | m | Minute | M | Month |
* | s | Second | S | Fraction of second |
* | y | Year (abs) | Y | |
*
* Letters marked by * are not implemented but reserved by Unicode standard.
*/
const lightFormatters = (exports.lightFormatters = {
// Year
y(date, token) {
// From http://www.unicode.org/reports/tr35/tr35-31/tr35-dates.html#Date_Format_tokens
// | Year | y | yy | yyy | yyyy | yyyyy |
// |----------|-------|----|-------|-------|-------|
// | AD 1 | 1 | 01 | 001 | 0001 | 00001 |
// | AD 12 | 12 | 12 | 012 | 0012 | 00012 |
// | AD 123 | 123 | 23 | 123 | 0123 | 00123 |
// | AD 1234 | 1234 | 34 | 1234 | 1234 | 01234 |
// | AD 12345 | 12345 | 45 | 12345 | 12345 | 12345 |
const signedYear = date.getFullYear();
// Returns 1 for 1 BC (which is year 0 in JavaScript)
const year = signedYear > 0 ? signedYear : 1 - signedYear;
return (0, _index.addLeadingZeros)(
token === "yy" ? year % 100 : year,
token.length,
);
},
// Month
M(date, token) {
const month = date.getMonth();
return token === "M"
? String(month + 1)
: (0, _index.addLeadingZeros)(month + 1, 2);
},
// Day of the month
d(date, token) {
return (0, _index.addLeadingZeros)(date.getDate(), token.length);
},
// AM or PM
a(date, token) {
const dayPeriodEnumValue = date.getHours() / 12 >= 1 ? "pm" : "am";
switch (token) {
case "a":
case "aa":
return dayPeriodEnumValue.toUpperCase();
case "aaa":
return dayPeriodEnumValue;
case "aaaaa":
return dayPeriodEnumValue[0];
case "aaaa":
default:
return dayPeriodEnumValue === "am" ? "a.m." : "p.m.";
}
},
// Hour [1-12]
h(date, token) {
return (0, _index.addLeadingZeros)(
date.getHours() % 12 || 12,
token.length,
);
},
// Hour [0-23]
H(date, token) {
return (0, _index.addLeadingZeros)(date.getHours(), token.length);
},
// Minute
m(date, token) {
return (0, _index.addLeadingZeros)(date.getMinutes(), token.length);
},
// Second
s(date, token) {
return (0, _index.addLeadingZeros)(date.getSeconds(), token.length);
},
// Fraction of second
S(date, token) {
const numberOfDigits = token.length;
const milliseconds = date.getMilliseconds();
const fractionalSeconds = Math.trunc(
milliseconds * Math.pow(10, numberOfDigits - 3),
);
return (0, _index.addLeadingZeros)(fractionalSeconds, token.length);
},
});
@@ -0,0 +1,5 @@
import { type NumberFormatInternal, type NumberFormatOptions } from "../types/number.js";
/**
* https://tc39.es/ecma402/#sec-setnumberformatunitoptions
*/
export declare function SetNumberFormatUnitOptions(internalSlots: NumberFormatInternal, options?: NumberFormatOptions | undefined): void;
@@ -0,0 +1,48 @@
import type { Database } from 'sql.js';
import { entityKind } from "../entity.cjs";
import type { Logger } from "../logger.cjs";
import type { RelationalSchemaConfig, TablesRelationalConfig } from "../relations.cjs";
import { type Query } from "../sql/sql.cjs";
import type { SQLiteSyncDialect } from "../sqlite-core/dialect.cjs";
import { SQLiteTransaction } from "../sqlite-core/index.cjs";
import type { SelectedFieldsOrdered } from "../sqlite-core/query-builders/select.types.cjs";
import type { PreparedQueryConfig as PreparedQueryConfigBase, SQLiteExecuteMethod, SQLiteTransactionConfig } from "../sqlite-core/session.cjs";
import { SQLitePreparedQuery as PreparedQueryBase, SQLiteSession } from "../sqlite-core/session.cjs";
export interface SQLJsSessionOptions {
logger?: Logger;
}
type PreparedQueryConfig = Omit<PreparedQueryConfigBase, 'statement' | 'run'>;
export declare class SQLJsSession<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends SQLiteSession<'sync', void, TFullSchema, TSchema> {
private client;
private schema;
static readonly [entityKind]: string;
private logger;
constructor(client: Database, dialect: SQLiteSyncDialect, schema: RelationalSchemaConfig<TSchema> | undefined, options?: SQLJsSessionOptions);
prepareQuery<T extends Omit<PreparedQueryConfig, 'run'>>(query: Query, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, isResponseInArrayMode: boolean): PreparedQuery<T>;
transaction<T>(transaction: (tx: SQLJsTransaction<TFullSchema, TSchema>) => T, config?: SQLiteTransactionConfig): T;
}
export declare class SQLJsTransaction<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends SQLiteTransaction<'sync', void, TFullSchema, TSchema> {
static readonly [entityKind]: string;
transaction<T>(transaction: (tx: SQLJsTransaction<TFullSchema, TSchema>) => T): T;
}
export declare class PreparedQuery<T extends PreparedQueryConfig = PreparedQueryConfig> extends PreparedQueryBase<{
type: 'sync';
run: void;
all: T['all'];
get: T['get'];
values: T['values'];
execute: T['execute'];
}> {
private client;
private logger;
private fields;
private _isResponseInArrayMode;
private customResultMapper?;
static readonly [entityKind]: string;
constructor(client: Database, query: Query, logger: Logger, fields: SelectedFieldsOrdered | undefined, executeMethod: SQLiteExecuteMethod, _isResponseInArrayMode: boolean, customResultMapper?: ((rows: unknown[][], mapColumnValue?: (value: unknown) => unknown) => unknown) | undefined);
run(placeholderValues?: Record<string, unknown>): void;
all(placeholderValues?: Record<string, unknown>): T['all'];
get(placeholderValues?: Record<string, unknown>): T['get'];
values(placeholderValues?: Record<string, unknown>): T['values'];
}
export {};
@@ -0,0 +1,92 @@
"use strict";
exports.formatRelative = void 0;
var _index = require("../../../isSameWeek.cjs");
var _index2 = require("../../../toDate.cjs");
const accusativeWeekdays = [
"нядзелю",
"панядзелак",
"аўторак",
"сераду",
"чацьвер",
"пятніцу",
"суботу",
];
function lastWeek(day) {
const weekday = accusativeWeekdays[day];
switch (day) {
case 0:
case 3:
case 5:
case 6:
return "'у мінулую " + weekday + " а' p";
case 1:
case 2:
case 4:
return "'у мінулы " + weekday + " а' p";
}
}
function thisWeek(day) {
const weekday = accusativeWeekdays[day];
return "'у " + weekday + " а' p";
}
function nextWeek(day) {
const weekday = accusativeWeekdays[day];
switch (day) {
case 0:
case 3:
case 5:
case 6:
return "'у наступную " + weekday + " а' p";
case 1:
case 2:
case 4:
return "'у наступны " + weekday + " а' p";
}
}
const lastWeekFormat = (dirtyDate, baseDate, options) => {
const date = (0, _index2.toDate)(dirtyDate);
const day = date.getDay();
if ((0, _index.isSameWeek)(date, baseDate, options)) {
return thisWeek(day);
} else {
return lastWeek(day);
}
};
const nextWeekFormat = (dirtyDate, baseDate, options) => {
const date = (0, _index2.toDate)(dirtyDate);
const day = date.getDay();
if ((0, _index.isSameWeek)(date, baseDate, options)) {
return thisWeek(day);
} else {
return nextWeek(day);
}
};
const formatRelativeLocale = {
lastWeek: lastWeekFormat,
yesterday: "'учора а' p",
today: "'сёньня а' p",
tomorrow: "'заўтра а' p",
nextWeek: nextWeekFormat,
other: "P",
};
const formatRelative = (token, date, baseDate, options) => {
const format = formatRelativeLocale[token];
if (typeof format === "function") {
return format(date, baseDate, options);
}
return format;
};
exports.formatRelative = formatRelative;
@@ -0,0 +1,6 @@
var getNative = require('./_getNative');
/* Built-in method references that are verified to be native. */
var nativeCreate = getNative(Object, 'create');
module.exports = nativeCreate;
@@ -0,0 +1,38 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const ModuleDependency = require("./ModuleDependency");
/** @typedef {import("../Dependency").GetConditionFn} GetConditionFn */
/** @typedef {import("../ModuleGraph")} ModuleGraph */
class LoaderDependency extends ModuleDependency {
/**
* @param {string} request request string
*/
constructor(request) {
super(request);
}
get type() {
return "loader";
}
get category() {
return "loader";
}
/**
* @param {ModuleGraph} moduleGraph module graph
* @returns {null | false | GetConditionFn} function to determine if the connection is active
*/
getCondition(moduleGraph) {
return false;
}
}
module.exports = LoaderDependency;
@@ -0,0 +1,32 @@
import { readMigrationFiles } from "../migrator.js";
import { sql } from "../sql/sql.js";
async function migrate(db, config) {
const migrations = readMigrationFiles(config);
const migrationsTable = config.migrationsTable ?? "__drizzle_migrations";
const migrationTableCreate = sql`
CREATE TABLE IF NOT EXISTS ${sql.identifier(migrationsTable)} (
id SERIAL PRIMARY KEY,
hash text NOT NULL,
created_at bigint
)
`;
await db.session.execute(migrationTableCreate);
const dbMigrations = await db.session.all(
sql`select id, hash, created_at from ${sql.identifier(migrationsTable)} order by created_at desc limit 1`
);
const lastDbMigration = dbMigrations[0];
for await (const migration of migrations) {
if (!lastDbMigration || Number(lastDbMigration.created_at) < migration.folderMillis) {
for (const stmt of migration.sql) {
await db.session.execute(sql.raw(stmt));
}
await db.session.execute(
sql`insert into ${sql.identifier(migrationsTable)} ("hash", "created_at") values(${migration.hash}, ${migration.folderMillis})`
);
}
}
}
export {
migrate
};
//# sourceMappingURL=migrator.js.map
@@ -0,0 +1 @@
Prism.languages.ebnf={comment:/\(\*[\s\S]*?\*\)/,string:{pattern:/"[^"\r\n]*"|'[^'\r\n]*'/,greedy:!0},special:{pattern:/\?[^?\r\n]*\?/,greedy:!0,alias:"class-name"},definition:{pattern:/^([\t ]*)[a-z]\w*(?:[ \t]+[a-z]\w*)*(?=\s*=)/im,lookbehind:!0,alias:["rule","keyword"]},rule:/\b[a-z]\w*(?:[ \t]+[a-z]\w*)*\b/i,punctuation:/\([:/]|[:/]\)|[.,;()[\]{}]/,operator:/[-=|*/!]/};
@@ -0,0 +1,22 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.cjs";
import type { ColumnBaseConfig } from "../../column.cjs";
import { entityKind } from "../../entity.cjs";
import { GelColumn, GelColumnBuilder } from "./common.cjs";
export type GelBytesBuilderInitial<TName extends string> = GelBytesBuilder<{
name: TName;
dataType: 'buffer';
columnType: 'GelBytes';
data: Uint8Array;
driverParam: Uint8Array | Buffer;
enumValues: undefined;
}>;
export declare class GelBytesBuilder<T extends ColumnBuilderBaseConfig<'buffer', 'GelBytes'>> extends GelColumnBuilder<T> {
static readonly [entityKind]: string;
constructor(name: T['name']);
}
export declare class GelBytes<T extends ColumnBaseConfig<'buffer', 'GelBytes'>> extends GelColumn<T> {
static readonly [entityKind]: string;
getSQLType(): string;
}
export declare function bytes(): GelBytesBuilderInitial<''>;
export declare function bytes<TName extends string>(name: TName): GelBytesBuilderInitial<TName>;
@@ -0,0 +1,3 @@
export var forceReflow = function forceReflow(node) {
return node.scrollTop;
};
@@ -0,0 +1,21 @@
MIT License
Copyright (c) 2021 Abbas Mashayekh
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
@@ -0,0 +1,25 @@
.close-modal-button {
flex-shrink: 0;
border: 0;
background-color: transparent;
padding: 0;
margin: 0;
cursor: pointer;
overflow: hidden;
width: var(--base);
height: var(--base);
align-self: flex-start;
svg {
width: calc(var(--base) * 2);
height: calc(var(--base) * 2);
position: relative;
inset-inline-start: calc(var(--base) * -0.5);
top: calc(var(--base) * -0.5);
.stroke {
stroke-width: 2px;
vector-effect: non-scaling-stroke;
}
}
}
@@ -0,0 +1,27 @@
import React from 'react';
import type { LoadingOverlayTypes } from '../../elements/LoadingOverlay/types.js';
import './index.scss';
type LoadingOverlayProps = {
animationDuration?: string;
loadingText?: string;
overlayType?: string;
show?: boolean;
};
export declare const LoadingOverlay: React.FC<LoadingOverlayProps>;
export type UseLoadingOverlayToggleProps = {
loadingText?: string;
name: string;
show: boolean;
type?: LoadingOverlayTypes;
};
export declare const LoadingOverlayToggle: React.FC<UseLoadingOverlayToggleProps>;
export type FormLoadingOverlayToggleProps = {
action: 'create' | 'loading' | 'update';
formIsLoading?: boolean;
loadingSuffix?: string;
name: string;
type?: LoadingOverlayTypes;
};
export declare const FormLoadingOverlayToggle: React.FC<FormLoadingOverlayToggleProps>;
export {};
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,189 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.js");
const eraValues = {
narrow: ["ჩ.წ-მდე", "ჩ.წ"],
abbreviated: ["ჩვ.წ-მდე", "ჩვ.წ"],
wide: ["ჩვენს წელთაღრიცხვამდე", "ჩვენი წელთაღრიცხვით"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["1-ლი კვ", "2-ე კვ", "3-ე კვ", "4-ე კვ"],
wide: ["1-ლი კვარტალი", "2-ე კვარტალი", "3-ე კვარტალი", "4-ე კვარტალი"],
};
// Note: in English, the names of days of the week and months are capitalized.
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
// Generally, formatted dates should look like they are in the middle of a sentence,
// e.g. in Spanish language the weekdays and months should be in the lowercase.
const monthValues = {
narrow: [
"ია",
"თე",
"მა",
"აპ",
"მს",
"ვნ",
"ვლ",
"აგ",
"სე",
"ოქ",
"ნო",
"დე",
],
abbreviated: [
"იან",
"თებ",
"მარ",
"აპრ",
"მაი",
"ივნ",
"ივლ",
"აგვ",
"სექ",
"ოქტ",
"ნოე",
"დეკ",
],
wide: [
"იანვარი",
"თებერვალი",
"მარტი",
"აპრილი",
"მაისი",
"ივნისი",
"ივლისი",
"აგვისტო",
"სექტემბერი",
"ოქტომბერი",
"ნოემბერი",
"დეკემბერი",
],
};
const dayValues = {
narrow: ["კვ", "ორ", "სა", "ოთ", "ხუ", "პა", "შა"],
short: ["კვი", "ორშ", "სამ", "ოთხ", "ხუთ", "პარ", "შაბ"],
abbreviated: ["კვი", "ორშ", "სამ", "ოთხ", "ხუთ", "პარ", "შაბ"],
wide: [
"კვირა",
"ორშაბათი",
"სამშაბათი",
"ოთხშაბათი",
"ხუთშაბათი",
"პარასკევი",
"შაბათი",
],
};
const dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "შუაღამე",
noon: "შუადღე",
morning: "დილა",
afternoon: "საღამო",
evening: "საღამო",
night: "ღამე",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "შუაღამე",
noon: "შუადღე",
morning: "დილა",
afternoon: "საღამო",
evening: "საღამო",
night: "ღამე",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "შუაღამე",
noon: "შუადღე",
morning: "დილა",
afternoon: "საღამო",
evening: "საღამო",
night: "ღამე",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "შუაღამით",
noon: "შუადღისას",
morning: "დილით",
afternoon: "ნაშუადღევს",
evening: "საღამოს",
night: "ღამით",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "შუაღამით",
noon: "შუადღისას",
morning: "დილით",
afternoon: "ნაშუადღევს",
evening: "საღამოს",
night: "ღამით",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "შუაღამით",
noon: "შუადღისას",
morning: "დილით",
afternoon: "ნაშუადღევს",
evening: "საღამოს",
night: "ღამით",
},
};
const ordinalNumber = (dirtyNumber) => {
const number = Number(dirtyNumber);
if (number === 1) {
return number + "-ლი";
}
return number + "-ე";
};
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",
}),
});
@@ -0,0 +1,65 @@
// this are dev dependencies
var diff = require("jest-diff");
var _require = require("jest-diff/build/constants"),
NO_DIFF_MESSAGE = _require.NO_DIFF_MESSAGE;
var _require2 = require("@webassemblyjs/wasm-parser"),
decode = _require2.decode;
var oldConsoleLog = console.log;
export function compareArrayBuffers(l, r) {
/**
* Decode left
*/
var bufferL = "";
console.log = function () {
for (var _len = arguments.length, texts = new Array(_len), _key = 0; _key < _len; _key++) {
texts[_key] = arguments[_key];
}
return bufferL += texts.join("") + "\n";
};
try {
decode(l, {
dump: true
});
} catch (e) {
console.error(bufferL);
console.error(e);
throw e;
}
/**
* Decode right
*/
var bufferR = "";
console.log = function () {
for (var _len2 = arguments.length, texts = new Array(_len2), _key2 = 0; _key2 < _len2; _key2++) {
texts[_key2] = arguments[_key2];
}
return bufferR += texts.join("") + "\n";
};
try {
decode(r, {
dump: true
});
} catch (e) {
console.error(bufferR);
console.error(e);
throw e;
}
console.log = oldConsoleLog;
var out = diff(bufferL, bufferR);
if (out !== null && out !== NO_DIFF_MESSAGE) {
throw new Error("\n" + out);
}
}
@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E zC","260":"F A B"},B:{"2":"UB VB WB XB YB ZB aB I","66":"KB LB MB NB OB PB QB RB SB TB","132":"0 1 2 3 4 5 6 7 8 Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB","260":"C L M G N O P"},C:{"2":"0C VC J bB XB YB ZB aB I ZC aC OC 1C 2C 3C 4C 5C","260":"0 1 2 3 4 5 6 7 8 9 K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB KB LB MB NB OB PB QB RB SB TB UB VB WB"},D:{"2":"SB TB UB VB WB XB YB ZB aB I ZC aC OC","16":"J bB K D E F A B C L M","66":"KB LB MB NB OB PB QB RB","132":"0 1 2 3 4 5 6 7 8 9 G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB"},E:{"2":"tC uC vC wC ID","16":"6C bC","132":"J bB K D E F A B C L M G 7C 8C 9C AD cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD"},F:{"1":"C ND QC","2":"F JD KD LD MD","16":"B PC xC","66":"0 1 2 3 4 5 6 7 8 w x y z","132":"9 G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 6B 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R YC S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v"},G:{"2":"tC uC vC wC","16":"bC OD","132":"E yC PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD"},H:{"2":"mD"},I:{"2":"I","16":"nD oD","132":"VC J pD qD yC rD sD"},J:{"132":"D A"},K:{"1":"C QC","2":"A","16":"B PC xC","132":"H"},L:{"2":"I"},M:{"2":"OC"},N:{"260":"A B"},O:{"132":"RC"},P:{"132":"9 J AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D"},Q:{"132":"4D"},R:{"132":"5D"},S:{"260":"6D 7D"}},B:7,C:"Mutation events",D:true};
@@ -0,0 +1,91 @@
import type { HttpRequest, HttpResponse } from 'uWebSockets.js';
import { HandlerOptions as RawHandlerOptions, OperationContext } from '../handler.mjs';
import { RequestParams } from '../common.mjs';
/**
* The context in the request for the handler.
*
* @category Server/uWebSockets
*/
export interface RequestContext {
res: HttpResponse;
}
/**
* The GraphQL over HTTP spec compliant request parser for an incoming GraphQL request.
*
* It is important to pass in the `abortedRef` so that the parser does not perform any
* operations on a disposed request (see example).
*
* If the HTTP request _is not_ a [well-formatted GraphQL over HTTP request](https://graphql.github.io/graphql-over-http/draft/#sec-Request), the function will respond
* on the `HttpResponse` argument and return `null`.
*
* If the HTTP request _is_ a [well-formatted GraphQL over HTTP request](https://graphql.github.io/graphql-over-http/draft/#sec-Request), but is invalid or malformed,
* the function will throw an error and it is up to the user to handle and respond as they see fit.
*
* ```js
* import uWS from 'uWebSockets.js'; // yarn add uWebSockets.js@uNetworking/uWebSockets.js#<version>
* import { parseRequestParams } from 'graphql-http/lib/use/uWebSockets';
*
* uWS
* .App()
* .any('/graphql', async (res, req) => {
* const abortedRef = { current: false };
* res.onAborted(() => (abortedRef.current = true));
* try {
* const maybeParams = await parseRequestParams(req, res, abortedRef);
* if (!maybeParams) {
* // not a well-formatted GraphQL over HTTP request,
* // parser responded and there's nothing else to do
* return;
* }
*
* // well-formatted GraphQL over HTTP request,
* // with valid parameters
* if (!abortedRef.current) {
* res.writeStatus('200 OK');
* res.end(JSON.stringify(maybeParams, null, ' '));
* }
* } catch (err) {
* // well-formatted GraphQL over HTTP request,
* // but with invalid parameters
* if (!abortedRef.current) {
* res.writeStatus('400 Bad Request');
* res.end(err.message);
* }
* }
* })
* .listen(4000, () => {
* console.log('Listening to port 4000');
* });
* ```
*
* @category Server/uWebSockets
*/
export declare function parseRequestParams(req: HttpRequest, res: HttpResponse, abortedRef: {
current: boolean;
}): Promise<RequestParams | null>;
/**
* Handler options when using the http adapter.
*
* @category Server/uWebSockets
*/
export type HandlerOptions<Context extends OperationContext = undefined> = RawHandlerOptions<HttpRequest, RequestContext, Context>;
/**
* Create a GraphQL over HTTP spec compliant request handler for
* the Node environment [uWebSockets.js module](https://github.com/uNetworking/uWebSockets.js/).
*
* ```js
* import uWS from 'uWebSockets.js'; // yarn add uWebSockets.js@uNetworking/uWebSockets.js#<version>
* import { createHandler } from 'graphql-http/lib/use/uWebSockets';
* import { schema } from './my-graphql-schema/index.mjs';
*
* uWS
* .App()
* .any('/graphql', createHandler({ schema }))
* .listen(4000, () => {
* console.log('Listening to port 4000');
* });
* ```
*
* @category Server/uWebSockets
*/
export declare function createHandler<Context extends OperationContext = undefined>(options: HandlerOptions<Context>): (res: HttpResponse, req: HttpRequest) => Promise<void>;
@@ -0,0 +1,23 @@
import type { DateArg } from "./types.js";
/**
* @name isAfter
* @category Common Helpers
* @summary Is the first date after the second one?
*
* @description
* Is the first date after the second one?
*
* @param date - The date that should be after the other one to return true
* @param dateToCompare - The date to compare with
*
* @returns The first date is after the second date
*
* @example
* // Is 10 July 1989 after 11 February 1987?
* const result = isAfter(new Date(1989, 6, 10), new Date(1987, 1, 11))
* //=> true
*/
export declare function isAfter(
date: DateArg<Date> & {},
dateToCompare: DateArg<Date> & {},
): boolean;
@@ -0,0 +1,5 @@
export function hasWhereAccessResult(result) {
return result && typeof result === 'object';
}
//# sourceMappingURL=types.js.map
@@ -0,0 +1,16 @@
'use strict';
Object.defineProperty(exports, '__esModule', { value: true });
var compose = function compose() {
for (var _len = arguments.length, fns = new Array(_len), _key = 0; _key < _len; _key++) {
fns[_key] = arguments[_key];
}
return function (x) {
return fns.reduceRight(function (y, f) {
return f(y);
}, x);
};
};
exports.default = compose;
@@ -0,0 +1,52 @@
/**
* 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 { JSX } from 'react';
import { CommandListenerPriority, LexicalCommand, LexicalEditor, TextNode } from 'lexical';
import { MutableRefObject, ReactPortal } from 'react';
export type MenuTextMatch = {
leadOffset: number;
matchingString: string;
replaceableString: string;
};
export type MenuResolution = {
match?: MenuTextMatch;
getRect: () => DOMRect;
};
export declare const PUNCTUATION = "\\.,\\+\\*\\?\\$\\@\\|#{}\\(\\)\\^\\-\\[\\]\\\\/!%'\"~=<>_:;";
export declare class MenuOption {
key: string;
ref?: MutableRefObject<HTMLElement | null>;
constructor(key: string);
setRefElement(element: HTMLElement | null): void;
}
export type MenuRenderFn<TOption extends MenuOption> = (anchorElementRef: MutableRefObject<HTMLElement | null>, itemProps: {
selectedIndex: number | null;
selectOptionAndCleanUp: (option: TOption) => void;
setHighlightedIndex: (index: number) => void;
options: Array<TOption>;
}, matchingString: string | null) => ReactPortal | JSX.Element | null;
export declare function getScrollParent(element: HTMLElement, includeHidden: boolean): HTMLElement | HTMLBodyElement;
export declare function useDynamicPositioning(resolution: MenuResolution | null, targetElement: HTMLElement | null, onReposition: () => void, onVisibilityChange?: (isInView: boolean) => void): void;
export declare const SCROLL_TYPEAHEAD_OPTION_INTO_VIEW_COMMAND: LexicalCommand<{
index: number;
option: MenuOption;
}>;
export declare function LexicalMenu<TOption extends MenuOption>({ close, editor, anchorElementRef, resolution, options, menuRenderFn, onSelectOption, shouldSplitNodeWithQuery, commandPriority, preselectFirstItem, }: {
close: () => void;
editor: LexicalEditor;
anchorElementRef: MutableRefObject<HTMLElement | null>;
resolution: MenuResolution;
options: Array<TOption>;
shouldSplitNodeWithQuery?: boolean;
menuRenderFn: MenuRenderFn<TOption>;
onSelectOption: (option: TOption, textNodeContainingQuery: TextNode | null, closeMenu: () => void, matchingString: string) => void;
commandPriority?: CommandListenerPriority;
preselectFirstItem?: boolean;
}): JSX.Element | null;
export declare function useMenuAnchorRef(resolution: MenuResolution | null, setResolution: (r: MenuResolution | null) => void, className?: string, parent?: HTMLElement | undefined, shouldIncludePageYOffset__EXPERIMENTAL?: boolean): MutableRefObject<HTMLElement | null>;
export type TriggerFn = (text: string, editor: LexicalEditor) => MenuTextMatch | null;
@@ -0,0 +1,22 @@
import { DirectusTranslation } from "../../../schema/translation.js";
import { RestCommand } from "../../types.js";
//#region src/rest/commands/delete/translations.d.ts
/**
* Delete multiple existing translations.
* @param keys
* @returns
* @throws Will throw if keys is empty
*/
declare const deleteTranslations: <Schema>(keys: DirectusTranslation<Schema>["id"][]) => RestCommand<void, Schema>;
/**
* Delete an existing translation.
* @param key
* @returns
* @throws Will throw if key is empty
*/
declare const deleteTranslation: <Schema>(key: DirectusTranslation<Schema>["id"]) => RestCommand<void, Schema>;
//#endregion
export { deleteTranslation, deleteTranslations };
//# sourceMappingURL=translations.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"https://raw.githubusercontent.com/fb55/entities/61afd4701eaa736978b13c7351cd3de9a96b04bc/src/","sources":["index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAyB,YAAY,EAAE,MAAM,aAAa,CAAC;AASlE,wCAAwC;AACxC,oBAAY,WAAW;IACnB,iCAAiC;IACjC,GAAG,IAAI;IACP,mEAAmE;IACnE,IAAI,IAAI;CACX;AAED,oBAAY,YAAY;IACpB;;;OAGG;IACH,IAAI,IAAA;IACJ;;;;OAIG;IACH,KAAK,IAAA;IACL;;;OAGG;IACH,SAAS,IAAA;IACT;;;OAGG;IACH,SAAS,IAAA;IACT;;;OAGG;IACH,IAAI,IAAA;CACP;AAED,MAAM,WAAW,eAAe;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;;;;;;;;OAUG;IACH,IAAI,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;CACnC;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAe,GAAG,WAA6B,GACzD,MAAM,CASR;AAED;;;;;;GAMG;AACH,wBAAgB,YAAY,CACxB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAe,GAAG,WAA6B,GACzD,MAAM,CAKR;AAED;;GAEG;AACH,MAAM,WAAW,eAAe;IAC5B;;;OAGG;IACH,KAAK,CAAC,EAAE,WAAW,CAAC;IACpB;;;OAGG;IACH,IAAI,CAAC,EAAE,YAAY,CAAC;CACvB;AAED;;;;;GAKG;AACH,wBAAgB,MAAM,CAClB,IAAI,EAAE,MAAM,EACZ,OAAO,GAAE,eAAe,GAAG,WAA6B,GACzD,MAAM,CAkBR;AAED,OAAO,EACH,SAAS,EACT,MAAM,EACN,UAAU,EACV,eAAe,EACf,UAAU,GACb,MAAM,aAAa,CAAC;AAErB,OAAO,EACH,UAAU,EACV,kBAAkB,EAElB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,GAC5B,MAAM,aAAa,CAAC;AAErB,OAAO,EACH,aAAa,EACb,YAAY,EACZ,SAAS,EACT,UAAU,EACV,gBAAgB,EAChB,mBAAmB,EAEnB,UAAU,IAAI,WAAW,EACzB,UAAU,IAAI,WAAW,EACzB,gBAAgB,IAAI,iBAAiB,EACrC,gBAAgB,IAAI,iBAAiB,EACrC,SAAS,IAAI,eAAe,GAC/B,MAAM,aAAa,CAAC"}
@@ -0,0 +1,2 @@
const e=(e,t)=>()=>({path:`/translations`,params:t??{},body:JSON.stringify(e),method:`POST`}),t=(e,t)=>()=>({path:`/translations`,params:t??{},body:JSON.stringify(e),method:`POST`});export{t as createTranslation,e as createTranslations};
//# sourceMappingURL=translations.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../src/types-hoist/feedback/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAChD,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAClD,OAAO,KAAK,EACV,iBAAiB,EACjB,4BAA4B,EAC5B,yBAAyB,EACzB,0BAA0B,EAC3B,MAAM,UAAU,CAAC;AAClB,OAAO,KAAK,EAAE,aAAa,EAAE,YAAY,EAAE,kBAAkB,EAAE,YAAY,EAAE,MAAM,gBAAgB,CAAC;AAEpG,YAAY,EAAE,gBAAgB,EAAE,MAAM,QAAQ,CAAC;AAC/C,YAAY,EAAE,aAAa,EAAE,YAAY,EAAE,YAAY,EAAE,kBAAkB,EAAE,CAAC;AAE9E;;GAEG;AACH,MAAM,WAAW,uBACf,SAAQ,4BAA4B,EAAE,0BAA0B,EAAE,yBAAyB,EAAE,iBAAiB;CAAG;AAEnH,KAAK,KAAK,GAAG,OAAO,CAAC;AACrB,KAAK,WAAW,GAAG,OAAO,CAAC;AAC3B,KAAK,KAAK,GAAG,OAAO,CAAC;AACrB,KAAK,UAAU,GAAG,OAAO,CAAC;AAC1B,KAAK,KAAK,GAAG,OAAO,CAAC;AAErB,KAAK,cAAc,GAAG;IACpB;;OAEG;IACH,EAAE,EAAE,WAAW,CAAC;IAEhB;;;;OAIG;IACH,WAAW,EAAE,MAAM,IAAI,CAAC;IAExB;;OAEG;IACH,aAAa,EAAE,MAAM,IAAI,CAAC;IAE1B;;OAEG;IACH,IAAI,EAAE,MAAM,IAAI,CAAC;IAEjB;;OAEG;IACH,KAAK,EAAE,MAAM,IAAI,CAAC;CACnB,CAAC;AAEF,UAAU,uBAAuB;IAC/B;;OAEG;IACH,KAAK,EAAE,CAAC,KAAK,EAAE;QAAE,OAAO,EAAE,CAAC,KAAK,EAAE,KAAK,KAAK,IAAI,CAAA;KAAE,KAAK,KAAK,CAAC;IAE7D;;OAEG;IACH,KAAK,EAAE,MAAM,OAAO,CAAC,UAAU,GAAG,SAAS,CAAC,CAAC;CAC9C;AAED,UAAU,iBAAiB;IACzB,OAAO,EAAE,uBAAuB,CAAC;IACjC,qBAAqB,EAAE,6BAA6B,GAAG,SAAS,CAAC;IACjE,YAAY,EAAE,YAAY,CAAC;IAC3B,MAAM,EAAE,UAAU,CAAC;CACpB;AACD,MAAM,WAAW,wBAAyB,SAAQ,WAAW;IAC3D,YAAY,EAAE,CAAC,KAAK,EAAE,iBAAiB,KAAK,cAAc,CAAC;CAC5D;AAED,UAAU,gBAAgB;IACxB,CAAC,EAAE,KAAK,CAAC;IACT,KAAK,EAAE,KAAK,CAAC;IACb,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,EAAE,uBAAuB,CAAC;CAClC;AACD,MAAM,WAAW,6BAA8B,SAAQ,WAAW;IAChE,WAAW,EAAE,CAAC,KAAK,EAAE,gBAAgB,KAAK,uBAAuB,CAAC;CACnE"}
@@ -0,0 +1,3 @@
import type { ClientField } from 'payload';
export declare const createNestedClientFieldPath: (parentPath: string, field: ClientField) => string;
//# sourceMappingURL=createNestedClientFieldPath.d.ts.map
@@ -0,0 +1,44 @@
import { SourceMapGenerator } from 'source-map'
import convert from 'convert-source-map'
function getGeneratorOpts(file) {
return file.opts.generatorOpts ? file.opts.generatorOpts : file.opts
}
export function makeSourceMapGenerator(file) {
const generatorOpts = getGeneratorOpts(file)
const filename = generatorOpts.sourceFileName
const generator = new SourceMapGenerator({
file: filename,
sourceRoot: generatorOpts.sourceRoot
})
generator.setSourceContent(filename, file.code)
return generator
}
export function getSourceMap(
offset /*: {
line: number,
column: number
} */,
state
) /*: string */ {
const generator = makeSourceMapGenerator(state.file)
const generatorOpts = getGeneratorOpts(state.file)
if (
generatorOpts.sourceFileName &&
generatorOpts.sourceFileName !== 'unknown'
) {
generator.addMapping({
generated: {
line: 1,
column: 0
},
source: generatorOpts.sourceFileName,
original: offset
})
return convert.fromObject(generator).toComment({ multiline: true })
}
return ''
}

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