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

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

View File

@@ -0,0 +1,310 @@
import { formatters } from "./_lib/format/formatters.js";
import { longFormatters } from "./_lib/format/longFormatters.js";
import type {
AdditionalTokensOptions,
FirstWeekContainsDateOptions,
LocalizedOptions,
WeekOptions,
} from "./types.js";
export { formatters, longFormatters };
export { format as formatDate };
export type { FormatOptions as FormatDateOptions };
/**
* The {@link format} function options.
*/
export interface FormatOptions
extends LocalizedOptions<"options" | "localize" | "formatLong">,
WeekOptions,
FirstWeekContainsDateOptions,
AdditionalTokensOptions {}
/**
* @name format
* @alias formatDate
* @category Common Helpers
* @summary Format the date.
*
* @description
* Return the formatted date string in the given format. The result may vary by locale.
*
* > ⚠️ Please note that the `format` tokens differ from Moment.js and other libraries.
* > See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* The characters wrapped between two single quotes characters (') are escaped.
* Two single quotes in a row, whether inside or outside a quoted sequence, represent a 'real' single quote.
* (see the last example)
*
* Format of the string is based on Unicode Technical Standard #35:
* https://www.unicode.org/reports/tr35/tr35-dates.html#Date_Field_Symbol_Table
* with a few additions (see note 7 below the table).
*
* Accepted patterns:
* | Unit | Pattern | Result examples | Notes |
* |---------------------------------|---------|-----------------------------------|-------|
* | Era | G..GGG | AD, BC | |
* | | GGGG | Anno Domini, Before Christ | 2 |
* | | GGGGG | A, B | |
* | Calendar year | y | 44, 1, 1900, 2017 | 5 |
* | | yo | 44th, 1st, 0th, 17th | 5,7 |
* | | yy | 44, 01, 00, 17 | 5 |
* | | yyy | 044, 001, 1900, 2017 | 5 |
* | | yyyy | 0044, 0001, 1900, 2017 | 5 |
* | | yyyyy | ... | 3,5 |
* | Local week-numbering year | Y | 44, 1, 1900, 2017 | 5 |
* | | Yo | 44th, 1st, 1900th, 2017th | 5,7 |
* | | YY | 44, 01, 00, 17 | 5,8 |
* | | YYY | 044, 001, 1900, 2017 | 5 |
* | | YYYY | 0044, 0001, 1900, 2017 | 5,8 |
* | | YYYYY | ... | 3,5 |
* | ISO week-numbering year | R | -43, 0, 1, 1900, 2017 | 5,7 |
* | | RR | -43, 00, 01, 1900, 2017 | 5,7 |
* | | RRR | -043, 000, 001, 1900, 2017 | 5,7 |
* | | RRRR | -0043, 0000, 0001, 1900, 2017 | 5,7 |
* | | RRRRR | ... | 3,5,7 |
* | Extended year | u | -43, 0, 1, 1900, 2017 | 5 |
* | | uu | -43, 01, 1900, 2017 | 5 |
* | | uuu | -043, 001, 1900, 2017 | 5 |
* | | uuuu | -0043, 0001, 1900, 2017 | 5 |
* | | uuuuu | ... | 3,5 |
* | Quarter (formatting) | Q | 1, 2, 3, 4 | |
* | | Qo | 1st, 2nd, 3rd, 4th | 7 |
* | | QQ | 01, 02, 03, 04 | |
* | | QQQ | Q1, Q2, Q3, Q4 | |
* | | QQQQ | 1st quarter, 2nd quarter, ... | 2 |
* | | QQQQQ | 1, 2, 3, 4 | 4 |
* | Quarter (stand-alone) | q | 1, 2, 3, 4 | |
* | | qo | 1st, 2nd, 3rd, 4th | 7 |
* | | qq | 01, 02, 03, 04 | |
* | | qqq | Q1, Q2, Q3, Q4 | |
* | | qqqq | 1st quarter, 2nd quarter, ... | 2 |
* | | qqqqq | 1, 2, 3, 4 | 4 |
* | Month (formatting) | M | 1, 2, ..., 12 | |
* | | Mo | 1st, 2nd, ..., 12th | 7 |
* | | MM | 01, 02, ..., 12 | |
* | | MMM | Jan, Feb, ..., Dec | |
* | | MMMM | January, February, ..., December | 2 |
* | | MMMMM | J, F, ..., D | |
* | Month (stand-alone) | L | 1, 2, ..., 12 | |
* | | Lo | 1st, 2nd, ..., 12th | 7 |
* | | LL | 01, 02, ..., 12 | |
* | | LLL | Jan, Feb, ..., Dec | |
* | | LLLL | January, February, ..., December | 2 |
* | | LLLLL | J, F, ..., D | |
* | Local week of year | w | 1, 2, ..., 53 | |
* | | wo | 1st, 2nd, ..., 53th | 7 |
* | | ww | 01, 02, ..., 53 | |
* | ISO week of year | I | 1, 2, ..., 53 | 7 |
* | | Io | 1st, 2nd, ..., 53th | 7 |
* | | II | 01, 02, ..., 53 | 7 |
* | Day of month | d | 1, 2, ..., 31 | |
* | | do | 1st, 2nd, ..., 31st | 7 |
* | | dd | 01, 02, ..., 31 | |
* | Day of year | D | 1, 2, ..., 365, 366 | 9 |
* | | Do | 1st, 2nd, ..., 365th, 366th | 7 |
* | | DD | 01, 02, ..., 365, 366 | 9 |
* | | DDD | 001, 002, ..., 365, 366 | |
* | | DDDD | ... | 3 |
* | Day of week (formatting) | E..EEE | Mon, Tue, Wed, ..., Sun | |
* | | EEEE | Monday, Tuesday, ..., Sunday | 2 |
* | | EEEEE | M, T, W, T, F, S, S | |
* | | EEEEEE | Mo, Tu, We, Th, Fr, Sa, Su | |
* | ISO day of week (formatting) | i | 1, 2, 3, ..., 7 | 7 |
* | | io | 1st, 2nd, ..., 7th | 7 |
* | | ii | 01, 02, ..., 07 | 7 |
* | | iii | Mon, Tue, Wed, ..., Sun | 7 |
* | | iiii | Monday, Tuesday, ..., Sunday | 2,7 |
* | | iiiii | M, T, W, T, F, S, S | 7 |
* | | iiiiii | Mo, Tu, We, Th, Fr, Sa, Su | 7 |
* | Local day of week (formatting) | e | 2, 3, 4, ..., 1 | |
* | | eo | 2nd, 3rd, ..., 1st | 7 |
* | | ee | 02, 03, ..., 01 | |
* | | eee | Mon, Tue, Wed, ..., Sun | |
* | | eeee | Monday, Tuesday, ..., Sunday | 2 |
* | | eeeee | M, T, W, T, F, S, S | |
* | | eeeeee | Mo, Tu, We, Th, Fr, Sa, Su | |
* | Local day of week (stand-alone) | c | 2, 3, 4, ..., 1 | |
* | | co | 2nd, 3rd, ..., 1st | 7 |
* | | cc | 02, 03, ..., 01 | |
* | | ccc | Mon, Tue, Wed, ..., Sun | |
* | | cccc | Monday, Tuesday, ..., Sunday | 2 |
* | | ccccc | M, T, W, T, F, S, S | |
* | | cccccc | Mo, Tu, We, Th, Fr, Sa, Su | |
* | AM, PM | a..aa | AM, PM | |
* | | aaa | am, pm | |
* | | aaaa | a.m., p.m. | 2 |
* | | aaaaa | a, p | |
* | AM, PM, noon, midnight | b..bb | AM, PM, noon, midnight | |
* | | bbb | am, pm, noon, midnight | |
* | | bbbb | a.m., p.m., noon, midnight | 2 |
* | | bbbbb | a, p, n, mi | |
* | Flexible day period | B..BBB | at night, in the morning, ... | |
* | | BBBB | at night, in the morning, ... | 2 |
* | | BBBBB | at night, in the morning, ... | |
* | Hour [1-12] | h | 1, 2, ..., 11, 12 | |
* | | ho | 1st, 2nd, ..., 11th, 12th | 7 |
* | | hh | 01, 02, ..., 11, 12 | |
* | Hour [0-23] | H | 0, 1, 2, ..., 23 | |
* | | Ho | 0th, 1st, 2nd, ..., 23rd | 7 |
* | | HH | 00, 01, 02, ..., 23 | |
* | Hour [0-11] | K | 1, 2, ..., 11, 0 | |
* | | Ko | 1st, 2nd, ..., 11th, 0th | 7 |
* | | KK | 01, 02, ..., 11, 00 | |
* | Hour [1-24] | k | 24, 1, 2, ..., 23 | |
* | | ko | 24th, 1st, 2nd, ..., 23rd | 7 |
* | | kk | 24, 01, 02, ..., 23 | |
* | Minute | m | 0, 1, ..., 59 | |
* | | mo | 0th, 1st, ..., 59th | 7 |
* | | mm | 00, 01, ..., 59 | |
* | Second | s | 0, 1, ..., 59 | |
* | | so | 0th, 1st, ..., 59th | 7 |
* | | ss | 00, 01, ..., 59 | |
* | Fraction of second | S | 0, 1, ..., 9 | |
* | | SS | 00, 01, ..., 99 | |
* | | SSS | 000, 001, ..., 999 | |
* | | SSSS | ... | 3 |
* | Timezone (ISO-8601 w/ Z) | X | -08, +0530, Z | |
* | | XX | -0800, +0530, Z | |
* | | XXX | -08:00, +05:30, Z | |
* | | XXXX | -0800, +0530, Z, +123456 | 2 |
* | | XXXXX | -08:00, +05:30, Z, +12:34:56 | |
* | Timezone (ISO-8601 w/o Z) | x | -08, +0530, +00 | |
* | | xx | -0800, +0530, +0000 | |
* | | xxx | -08:00, +05:30, +00:00 | 2 |
* | | xxxx | -0800, +0530, +0000, +123456 | |
* | | xxxxx | -08:00, +05:30, +00:00, +12:34:56 | |
* | Timezone (GMT) | O...OOO | GMT-8, GMT+5:30, GMT+0 | |
* | | OOOO | GMT-08:00, GMT+05:30, GMT+00:00 | 2 |
* | Timezone (specific non-locat.) | z...zzz | GMT-8, GMT+5:30, GMT+0 | 6 |
* | | zzzz | GMT-08:00, GMT+05:30, GMT+00:00 | 2,6 |
* | Seconds timestamp | t | 512969520 | 7 |
* | | tt | ... | 3,7 |
* | Milliseconds timestamp | T | 512969520900 | 7 |
* | | TT | ... | 3,7 |
* | Long localized date | P | 04/29/1453 | 7 |
* | | PP | Apr 29, 1453 | 7 |
* | | PPP | April 29th, 1453 | 7 |
* | | PPPP | Friday, April 29th, 1453 | 2,7 |
* | Long localized time | p | 12:00 AM | 7 |
* | | pp | 12:00:00 AM | 7 |
* | | ppp | 12:00:00 AM GMT+2 | 7 |
* | | pppp | 12:00:00 AM GMT+02:00 | 2,7 |
* | Combination of date and time | Pp | 04/29/1453, 12:00 AM | 7 |
* | | PPpp | Apr 29, 1453, 12:00:00 AM | 7 |
* | | PPPppp | April 29th, 1453 at ... | 7 |
* | | PPPPpppp| Friday, April 29th, 1453 at ... | 2,7 |
* Notes:
* 1. "Formatting" units (e.g. formatting quarter) in the default en-US locale
* are the same as "stand-alone" units, but are different in some languages.
* "Formatting" units are declined according to the rules of the language
* in the context of a date. "Stand-alone" units are always nominative singular:
*
* `format(new Date(2017, 10, 6), 'do LLLL', {locale: cs}) //=> '6. listopad'`
*
* `format(new Date(2017, 10, 6), 'do MMMM', {locale: cs}) //=> '6. listopadu'`
*
* 2. Any sequence of the identical letters is a pattern, unless it is escaped by
* the single quote characters (see below).
* If the sequence is longer than listed in table (e.g. `EEEEEEEEEEE`)
* the output will be the same as default pattern for this unit, usually
* the longest one (in case of ISO weekdays, `EEEE`). Default patterns for units
* are marked with "2" in the last column of the table.
*
* `format(new Date(2017, 10, 6), 'MMM') //=> 'Nov'`
*
* `format(new Date(2017, 10, 6), 'MMMM') //=> 'November'`
*
* `format(new Date(2017, 10, 6), 'MMMMM') //=> 'N'`
*
* `format(new Date(2017, 10, 6), 'MMMMMM') //=> 'November'`
*
* `format(new Date(2017, 10, 6), 'MMMMMMM') //=> 'November'`
*
* 3. Some patterns could be unlimited length (such as `yyyyyyyy`).
* The output will be padded with zeros to match the length of the pattern.
*
* `format(new Date(2017, 10, 6), 'yyyyyyyy') //=> '00002017'`
*
* 4. `QQQQQ` and `qqqqq` could be not strictly numerical in some locales.
* These tokens represent the shortest form of the quarter.
*
* 5. The main difference between `y` and `u` patterns are B.C. years:
*
* | Year | `y` | `u` |
* |------|-----|-----|
* | AC 1 | 1 | 1 |
* | BC 1 | 1 | 0 |
* | BC 2 | 2 | -1 |
*
* Also `yy` always returns the last two digits of a year,
* while `uu` pads single digit years to 2 characters and returns other years unchanged:
*
* | Year | `yy` | `uu` |
* |------|------|------|
* | 1 | 01 | 01 |
* | 14 | 14 | 14 |
* | 376 | 76 | 376 |
* | 1453 | 53 | 1453 |
*
* The same difference is true for local and ISO week-numbering years (`Y` and `R`),
* except local week-numbering years are dependent on `options.weekStartsOn`
* and `options.firstWeekContainsDate` (compare [getISOWeekYear](https://date-fns.org/docs/getISOWeekYear)
* and [getWeekYear](https://date-fns.org/docs/getWeekYear)).
*
* 6. Specific non-location timezones are currently unavailable in `date-fns`,
* so right now these tokens fall back to GMT timezones.
*
* 7. These patterns are not in the Unicode Technical Standard #35:
* - `i`: ISO day of week
* - `I`: ISO week of year
* - `R`: ISO week-numbering year
* - `t`: seconds timestamp
* - `T`: milliseconds timestamp
* - `o`: ordinal number modifier
* - `P`: long localized date
* - `p`: long localized time
*
* 8. `YY` and `YYYY` tokens represent week-numbering years but they are often confused with years.
* You should enable `options.useAdditionalWeekYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* 9. `D` and `DD` tokens represent days of the year but they are often confused with days of the month.
* You should enable `options.useAdditionalDayOfYearTokens` to use them. See: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The original date
* @param format - The string of tokens
* @param options - An object with options
*
* @returns The formatted date string
*
* @throws `date` must not be Invalid Date
* @throws `options.locale` must contain `localize` property
* @throws `options.locale` must contain `formatLong` property
* @throws use `yyyy` instead of `YYYY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `yy` instead of `YY` for formatting years using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `d` instead of `D` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws use `dd` instead of `DD` for formatting days of the month using [format provided] to the input [input provided]; see: https://github.com/date-fns/date-fns/blob/master/docs/unicodeTokens.md
* @throws format string contains an unescaped latin alphabet character
*
* @example
* // Represent 11 February 2014 in middle-endian format:
* const result = format(new Date(2014, 1, 11), 'MM/dd/yyyy')
* //=> '02/11/2014'
*
* @example
* // Represent 2 July 2014 in Esperanto:
* import { eoLocale } from 'date-fns/locale/eo'
* const result = format(new Date(2014, 6, 2), "do 'de' MMMM yyyy", {
* locale: eoLocale
* })
* //=> '2-a de julio 2014'
*
* @example
* // Escape string by single quote characters:
* const result = format(new Date(2014, 6, 2, 15), "h 'o''clock'")
* //=> "3 o'clock"
*/
export declare function format<DateType extends Date>(
date: DateType | number | string,
formatStr: string,
options?: FormatOptions,
): string;

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/elements/EditMany/index.tsx"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,sBAAsB,EAAE,KAAK,EAAE,MAAM,SAAS,CAAA;AAG5D,OAAO,KAAmB,MAAM,OAAO,CAAA;AAWvC,OAAO,cAAc,CAAA;AAErB,eAAO,MAAM,SAAS,cAAc,CAAA;AAEpC,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,UAAU,EAAE,sBAAsB,CAAA;CAC5C,CAAA;AAED,eAAO,MAAM,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC,aAAa,CAY5C,CAAA;AAED,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EAAE,CAChC;IACE,KAAK,EAAE,MAAM,CAAA;IACb,GAAG,EAAE,CAAC,MAAM,GAAG,MAAM,CAAC,EAAE,CAAA;IACxB;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,SAAS,CAAC,EAAE,MAAM,IAAI,CAAA;IACtB,SAAS,EAAE,OAAO,CAAA;IAClB,KAAK,CAAC,EAAE,KAAK,CAAA;CACd,GAAG,IAAI,CAAC,aAAa,EAAE,KAAK,CAAC,CA6C/B,CAAA"}

View File

@@ -0,0 +1,134 @@
const formatDistanceLocale = {
lessThanXSeconds: {
one: "أقل من ثانية",
two: "أقل من ثانيتين",
threeToTen: "أقل من {{count}} ثواني",
other: "أقل من {{count}} ثانية",
},
xSeconds: {
one: "ثانية واحدة",
two: "ثانيتان",
threeToTen: "{{count}} ثواني",
other: "{{count}} ثانية",
},
halfAMinute: "نصف دقيقة",
lessThanXMinutes: {
one: "أقل من دقيقة",
two: "أقل من دقيقتين",
threeToTen: "أقل من {{count}} دقائق",
other: "أقل من {{count}} دقيقة",
},
xMinutes: {
one: "دقيقة واحدة",
two: "دقيقتان",
threeToTen: "{{count}} دقائق",
other: "{{count}} دقيقة",
},
aboutXHours: {
one: "ساعة واحدة تقريباً",
two: "ساعتين تقريبا",
threeToTen: "{{count}} ساعات تقريباً",
other: "{{count}} ساعة تقريباً",
},
xHours: {
one: "ساعة واحدة",
two: "ساعتان",
threeToTen: "{{count}} ساعات",
other: "{{count}} ساعة",
},
xDays: {
one: "يوم واحد",
two: "يومان",
threeToTen: "{{count}} أيام",
other: "{{count}} يوم",
},
aboutXWeeks: {
one: "أسبوع واحد تقريبا",
two: "أسبوعين تقريبا",
threeToTen: "{{count}} أسابيع تقريبا",
other: "{{count}} أسبوعا تقريبا",
},
xWeeks: {
one: "أسبوع واحد",
two: "أسبوعان",
threeToTen: "{{count}} أسابيع",
other: "{{count}} أسبوعا",
},
aboutXMonths: {
one: "شهر واحد تقريباً",
two: "شهرين تقريبا",
threeToTen: "{{count}} أشهر تقريبا",
other: "{{count}} شهرا تقريباً",
},
xMonths: {
one: "شهر واحد",
two: "شهران",
threeToTen: "{{count}} أشهر",
other: "{{count}} شهرا",
},
aboutXYears: {
one: "سنة واحدة تقريباً",
two: "سنتين تقريبا",
threeToTen: "{{count}} سنوات تقريباً",
other: "{{count}} سنة تقريباً",
},
xYears: {
one: "سنة واحد",
two: "سنتان",
threeToTen: "{{count}} سنوات",
other: "{{count}} سنة",
},
overXYears: {
one: "أكثر من سنة",
two: "أكثر من سنتين",
threeToTen: "أكثر من {{count}} سنوات",
other: "أكثر من {{count}} سنة",
},
almostXYears: {
one: "ما يقارب سنة واحدة",
two: "ما يقارب سنتين",
threeToTen: "ما يقارب {{count}} سنوات",
other: "ما يقارب {{count}} سنة",
},
};
export const formatDistance = (token, count, options) => {
const usageGroup = formatDistanceLocale[token];
let result;
if (typeof usageGroup === "string") {
result = usageGroup;
} else if (count === 1) {
result = usageGroup.one;
} else if (count === 2) {
result = usageGroup.two;
} else if (count <= 10) {
result = usageGroup.threeToTen.replace("{{count}}", String(count));
} else {
result = usageGroup.other.replace("{{count}}", String(count));
}
if (options?.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "خلال " + result;
} else {
return "منذ " + result;
}
}
return result;
};

View File

@@ -0,0 +1,7 @@
{
"name": "dom-helpers/removeEventListener",
"private": true,
"main": "../cjs/removeEventListener.js",
"module": "../esm/removeEventListener.js",
"types": "../esm/removeEventListener.d.ts"
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"createMissingInstrumentationContext.d.ts","sourceRoot":"","sources":["../../../src/utils/createMissingInstrumentationContext.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,6BAA6B,EAAE,MAAM,cAAc,CAAC;AAGlE,eAAO,MAAM,mCAAmC,GAAI,KAAK,MAAM,KAAG,6BAGhE,CAAC"}

View File

@@ -0,0 +1,2 @@
const e=require(`../../utils/throw-if-empty.cjs`),t=t=>()=>(e.throwIfEmpty(t,`Keys cannot be empty`),{path:`/panels`,body:JSON.stringify(t),method:`DELETE`}),n=t=>()=>(e.throwIfEmpty(t,`Key cannot be empty`),{path:`/panels/${t}`,method:`DELETE`});exports.deletePanel=n,exports.deletePanels=t;
//# sourceMappingURL=panels.cjs.map

View File

@@ -0,0 +1,227 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["pr.n.e.", "AD"],
abbreviated: ["pr. Kr.", "po. Kr."],
wide: ["Prije Krista", "Poslije Krista"],
};
const quarterValues = {
narrow: ["1.", "2.", "3.", "4."],
abbreviated: ["1. kv.", "2. kv.", "3. kv.", "4. kv."],
wide: ["1. kvartal", "2. kvartal", "3. kvartal", "4. kvartal"],
};
const monthValues = {
narrow: [
"1.",
"2.",
"3.",
"4.",
"5.",
"6.",
"7.",
"8.",
"9.",
"10.",
"11.",
"12.",
],
abbreviated: [
"sij",
"velj",
"ožu",
"tra",
"svi",
"lip",
"srp",
"kol",
"ruj",
"lis",
"stu",
"pro",
],
wide: [
"siječanj",
"veljača",
"ožujak",
"travanj",
"svibanj",
"lipanj",
"srpanj",
"kolovoz",
"rujan",
"listopad",
"studeni",
"prosinac",
],
};
const formattingMonthValues = {
narrow: [
"1.",
"2.",
"3.",
"4.",
"5.",
"6.",
"7.",
"8.",
"9.",
"10.",
"11.",
"12.",
],
abbreviated: [
"sij",
"velj",
"ožu",
"tra",
"svi",
"lip",
"srp",
"kol",
"ruj",
"lis",
"stu",
"pro",
],
wide: [
"siječnja",
"veljače",
"ožujka",
"travnja",
"svibnja",
"lipnja",
"srpnja",
"kolovoza",
"rujna",
"listopada",
"studenog",
"prosinca",
],
};
const dayValues = {
narrow: ["N", "P", "U", "S", "Č", "P", "S"],
short: ["ned", "pon", "uto", "sri", "čet", "pet", "sub"],
abbreviated: ["ned", "pon", "uto", "sri", "čet", "pet", "sub"],
wide: [
"nedjelja",
"ponedjeljak",
"utorak",
"srijeda",
"četvrtak",
"petak",
"subota",
],
};
const formattingDayPeriodValues = {
narrow: {
am: "AM",
pm: "PM",
midnight: "ponoć",
noon: "podne",
morning: "ujutro",
afternoon: "popodne",
evening: "navečer",
night: "noću",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "ponoć",
noon: "podne",
morning: "ujutro",
afternoon: "popodne",
evening: "navečer",
night: "noću",
},
wide: {
am: "AM",
pm: "PM",
midnight: "ponoć",
noon: "podne",
morning: "ujutro",
afternoon: "poslije podne",
evening: "navečer",
night: "noću",
},
};
const dayPeriodValues = {
narrow: {
am: "AM",
pm: "PM",
midnight: "ponoć",
noon: "podne",
morning: "ujutro",
afternoon: "popodne",
evening: "navečer",
night: "noću",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "ponoć",
noon: "podne",
morning: "ujutro",
afternoon: "popodne",
evening: "navečer",
night: "noću",
},
wide: {
am: "AM",
pm: "PM",
midnight: "ponoć",
noon: "podne",
morning: "ujutro",
afternoon: "poslije podne",
evening: "navečer",
night: "noću",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
return number + ".";
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
formattingValues: formattingMonthValues,
defaultFormattingWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

View File

@@ -0,0 +1,26 @@
import { bindIfParam } from "../sql/expressions/index.js";
import { sql } from "../sql/sql.js";
export * from "../sql/expressions/index.js";
function concat(column, value) {
return sql`${column} || ${bindIfParam(value, column)}`;
}
function substring(column, { from, for: _for }) {
const chunks = [sql`substring(`, column];
if (from !== void 0) {
chunks.push(sql` from `, bindIfParam(from, column));
}
if (_for !== void 0) {
chunks.push(sql` for `, bindIfParam(_for, column));
}
chunks.push(sql`)`);
return sql.join(chunks);
}
function rowId() {
return sql`rowid`;
}
export {
concat,
rowId,
substring
};
//# sourceMappingURL=expressions.js.map

View File

@@ -0,0 +1,125 @@
import rng from './rng.js';
import { unsafeStringify } from './stringify.js';
// **`v1()` - Generate time-based UUID**
//
// Inspired by https://github.com/LiosK/UUID.js
// and http://docs.python.org/library/uuid.html
var _nodeId;
var _clockseq;
// Previous uuid creation time
var _lastMSecs = 0;
var _lastNSecs = 0;
// See https://github.com/uuidjs/uuid for API details
function v1(options, buf, offset) {
var i = buf && offset || 0;
var b = buf || new Array(16);
options = options || {};
var node = options.node;
var clockseq = options.clockseq;
// v1 only: Use cached `node` and `clockseq` values
if (!options._v6) {
if (!node) {
node = _nodeId;
}
if (clockseq == null) {
clockseq = _clockseq;
}
}
// Handle cases where we need entropy. We do this lazily to minimize issues
// related to insufficient system entropy. See #189
if (node == null || clockseq == null) {
var seedBytes = options.random || (options.rng || rng)();
// Randomize node
if (node == null) {
node = [seedBytes[0], seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
// v1 only: cache node value for reuse
if (!_nodeId && !options._v6) {
// per RFC4122 4.5: Set MAC multicast bit (v1 only)
node[0] |= 0x01; // Set multicast bit
_nodeId = node;
}
}
// Randomize clockseq
if (clockseq == null) {
// Per 4.2.2, randomize (14 bit) clockseq
clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
if (_clockseq === undefined && !options._v6) {
_clockseq = clockseq;
}
}
}
// v1 & v6 timestamps are 100 nano-second units since the Gregorian epoch,
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so time is
// handled internally as 'msecs' (integer milliseconds) and 'nsecs'
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
var msecs = options.msecs !== undefined ? options.msecs : Date.now();
// Per 4.2.1.2, use count of uuid's generated during the current clock
// cycle to simulate higher resolution clock
var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
// Time since last uuid creation (in msecs)
var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000;
// Per 4.2.1.2, Bump clockseq on clock regression
if (dt < 0 && options.clockseq === undefined) {
clockseq = clockseq + 1 & 0x3fff;
}
// Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
// time interval
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
nsecs = 0;
}
// Per 4.2.1.2 Throw error if too many uuids are requested
if (nsecs >= 10000) {
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
}
_lastMSecs = msecs;
_lastNSecs = nsecs;
_clockseq = clockseq;
// Per 4.1.4 - Convert from unix epoch to Gregorian epoch
msecs += 12219292800000;
// `time_low`
var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
b[i++] = tl >>> 24 & 0xff;
b[i++] = tl >>> 16 & 0xff;
b[i++] = tl >>> 8 & 0xff;
b[i++] = tl & 0xff;
// `time_mid`
var tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
b[i++] = tmh >>> 8 & 0xff;
b[i++] = tmh & 0xff;
// `time_high_and_version`
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
b[i++] = tmh >>> 16 & 0xff;
// `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
b[i++] = clockseq >>> 8 | 0x80;
// `clock_seq_low`
b[i++] = clockseq & 0xff;
// `node`
for (var n = 0; n < 6; ++n) {
b[i + n] = node[n];
}
return buf || unsafeStringify(b);
}
export default v1;

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../src/elements/DocumentHeader/Tabs/tabs/VersionsPill/index.tsx"],"names":[],"mappings":"AAEA,OAAO,KAAK,MAAM,OAAO,CAAA;AAEzB,OAAO,cAAc,CAAA;AAIrB,eAAO,MAAM,YAAY,EAAE,KAAK,CAAC,EAQhC,CAAA"}

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2014, 2015, 2016, 2017, 2018 Simon Lydell
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.

View File

@@ -0,0 +1,33 @@
import toSnakeCase from 'to-snake-case';
import { upsertRow } from './upsertRow/index.js';
import { getTransaction } from './utilities/getTransaction.js';
export async function updateGlobal({ slug, data, req, returning, select }) {
const globalConfig = this.payload.globals.config.find((config)=>config.slug === slug);
const tableName = this.tableNameMap.get(toSnakeCase(globalConfig.slug));
const db = await getTransaction(this, req);
const existingGlobal = await db.query[tableName].findFirst({});
const result = await upsertRow({
...existingGlobal ? {
id: existingGlobal.id,
operation: 'update'
} : {
operation: 'create'
},
adapter: this,
data,
db,
fields: globalConfig.flattenedFields,
globalSlug: slug,
ignoreResult: returning === false,
req,
select,
tableName
});
if (returning === false) {
return null;
}
result.globalType = slug;
return result;
}
//# sourceMappingURL=updateGlobal.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/queues/operations/runJobs/runJSONJob/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,GAAG,EAAE,MAAM,sBAAsB,CAAA;AAC/C,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,4BAA4B,CAAA;AAChE,OAAO,KAAK,EAAE,YAAY,EAAgB,MAAM,4CAA4C,CAAA;AAC5F,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,wCAAwC,CAAA;AAC5E,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,sBAAsB,CAAA;AACzD,OAAO,KAAK,EAAE,iBAAiB,EAAE,MAAM,mCAAmC,CAAA;AAC1E,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAA;AAOtD,KAAK,IAAI,GAAG;IACV,GAAG,EAAE,GAAG,CAAA;IACR,GAAG,EAAE,cAAc,CAAA;IACnB;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,aAAa,CAAA;IACtB,SAAS,EAAE,iBAAiB,CAAA;IAC5B,cAAc,EAAE,cAAc,CAAA;IAC9B,eAAe,EAAE,YAAY,CAAA;CAC9B,CAAA;AAED,MAAM,MAAM,gBAAgB,GAAG;IAC7B,MAAM,EAAE,YAAY,CAAA;CACrB,CAAA;AAED,eAAO,MAAM,UAAU,sEAOpB,IAAI,KAAG,OAAO,CAAC,gBAAgB,CAuGjC,CAAA"}

View File

@@ -0,0 +1,192 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.js");
const eraValues = {
narrow: ["v.Chr.", "n.Chr."],
abbreviated: ["v.Chr.", "n.Chr."],
wide: ["vor Christus", "nach Christus"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1. Quartal", "2. Quartal", "3. Quartal", "4. Quartal"],
};
// Note: in German, 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: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"Jän",
"Feb",
"Mär",
"Apr",
"Mai",
"Jun",
"Jul",
"Aug",
"Sep",
"Okt",
"Nov",
"Dez",
],
wide: [
"Jänner",
"Februar",
"März",
"April",
"Mai",
"Juni",
"Juli",
"August",
"September",
"Oktober",
"November",
"Dezember",
],
};
// https://st.unicode.org/cldr-apps/v#/de_AT/Gregorian/
const formattingMonthValues = {
narrow: monthValues.narrow,
abbreviated: [
"Jän.",
"Feb.",
"März",
"Apr.",
"Mai",
"Juni",
"Juli",
"Aug.",
"Sep.",
"Okt.",
"Nov.",
"Dez.",
],
wide: monthValues.wide,
};
const dayValues = {
narrow: ["S", "M", "D", "M", "D", "F", "S"],
short: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
abbreviated: ["So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."],
wide: [
"Sonntag",
"Montag",
"Dienstag",
"Mittwoch",
"Donnerstag",
"Freitag",
"Samstag",
],
};
// https://www.unicode.org/cldr/charts/32/summary/de.html#1881
const dayPeriodValues = {
narrow: {
am: "vm.",
pm: "nm.",
midnight: "Mitternacht",
noon: "Mittag",
morning: "Morgen",
afternoon: "Nachm.",
evening: "Abend",
night: "Nacht",
},
abbreviated: {
am: "vorm.",
pm: "nachm.",
midnight: "Mitternacht",
noon: "Mittag",
morning: "Morgen",
afternoon: "Nachmittag",
evening: "Abend",
night: "Nacht",
},
wide: {
am: "vormittags",
pm: "nachmittags",
midnight: "Mitternacht",
noon: "Mittag",
morning: "Morgen",
afternoon: "Nachmittag",
evening: "Abend",
night: "Nacht",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "vm.",
pm: "nm.",
midnight: "Mitternacht",
noon: "Mittag",
morning: "morgens",
afternoon: "nachm.",
evening: "abends",
night: "nachts",
},
abbreviated: {
am: "vorm.",
pm: "nachm.",
midnight: "Mitternacht",
noon: "Mittag",
morning: "morgens",
afternoon: "nachmittags",
evening: "abends",
night: "nachts",
},
wide: {
am: "vormittags",
pm: "nachmittags",
midnight: "Mitternacht",
noon: "Mittag",
morning: "morgens",
afternoon: "nachmittags",
evening: "abends",
night: "nachts",
},
};
const ordinalNumber = (dirtyNumber) => {
const number = Number(dirtyNumber);
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,
formattingValues: formattingMonthValues,
defaultWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
});

View File

@@ -0,0 +1,92 @@
"use strict";
exports.formatRelative = formatRelative;
var _index = require("./_lib/defaultLocale.cjs");
var _index2 = require("./_lib/defaultOptions.cjs");
var _index3 = require("./_lib/normalizeDates.cjs");
var _index4 = require("./differenceInCalendarDays.cjs");
var _index5 = require("./format.cjs");
/**
* The {@link formatRelative} function options.
*/
/**
* @name formatRelative
* @category Common Helpers
* @summary Represent the date in words relative to the given base date.
*
* @description
* Represent the date in words relative to the given base date.
*
* | Distance to the base date | Result |
* |---------------------------|---------------------------|
* | Previous 6 days | last Sunday at 04:30 AM |
* | Last day | yesterday at 04:30 AM |
* | Same day | today at 04:30 AM |
* | Next day | tomorrow at 04:30 AM |
* | Next 6 days | Sunday at 04:30 AM |
* | Other | 12/31/2017 |
*
* @param date - The date to format
* @param baseDate - The date to compare with
* @param options - An object with options
*
* @returns The date in words
*
* @throws `date` must not be Invalid Date
* @throws `baseDate` must not be Invalid Date
* @throws `options.locale` must contain `localize` property
* @throws `options.locale` must contain `formatLong` property
* @throws `options.locale` must contain `formatRelative` property
*
* @example
* // Represent the date of 6 days ago in words relative to the given base date. In this example, today is Wednesday
* const result = formatRelative(subDays(new Date(), 6), new Date())
* //=> "last Thursday at 12:45 AM"
*/
function formatRelative(date, baseDate, options) {
const [date_, baseDate_] = (0, _index3.normalizeDates)(
options?.in,
date,
baseDate,
);
const defaultOptions = (0, _index2.getDefaultOptions)();
const locale =
options?.locale ?? defaultOptions.locale ?? _index.defaultLocale;
const weekStartsOn =
options?.weekStartsOn ??
options?.locale?.options?.weekStartsOn ??
defaultOptions.weekStartsOn ??
defaultOptions.locale?.options?.weekStartsOn ??
0;
const diff = (0, _index4.differenceInCalendarDays)(date_, baseDate_);
if (isNaN(diff)) {
throw new RangeError("Invalid time value");
}
let token;
if (diff < -6) {
token = "other";
} else if (diff < -1) {
token = "lastWeek";
} else if (diff < 0) {
token = "yesterday";
} else if (diff < 1) {
token = "today";
} else if (diff < 2) {
token = "tomorrow";
} else if (diff < 7) {
token = "nextWeek";
} else {
token = "other";
}
const formatStr = locale.formatRelative(token, date_, baseDate_, {
locale,
weekStartsOn,
});
return (0, _index5.format)(date_, formatStr, { locale, weekStartsOn });
}

View File

@@ -0,0 +1,17 @@
import type { Client } from './client';
import type { ClientOptions } from './types-hoist/options';
/** A class object that can instantiate Client objects. */
export type ClientClass<F extends Client, O extends ClientOptions> = new (options: O) => F;
/**
* Internal function to create a new SDK client instance. The client is
* installed and then bound to the current scope.
*
* @param clientClass The client class to instantiate.
* @param options Options to pass to the client.
*/
export declare function initAndBind<F extends Client, O extends ClientOptions>(clientClass: ClientClass<F, O>, options: O): Client;
/**
* Make the given client the current client.
*/
export declare function setCurrentClient(client: Client): void;
//# sourceMappingURL=sdk.d.ts.map

View File

@@ -0,0 +1,7 @@
import { Span } from '../../types-hoist/span';
export declare const toolCallSpanMap: Map<string, Span>;
export declare const INVOKE_AGENT_OPS: Set<string>;
export declare const GENERATE_CONTENT_OPS: Set<string>;
export declare const EMBEDDINGS_OPS: Set<string>;
export declare const RERANK_OPS: Set<string>;
//# sourceMappingURL=constants.d.ts.map

View File

@@ -0,0 +1,361 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var db_exports = {};
__export(db_exports, {
BaseSQLiteDatabase: () => BaseSQLiteDatabase,
withReplicas: () => withReplicas
});
module.exports = __toCommonJS(db_exports);
var import_entity = require("../entity.cjs");
var import_selection_proxy = require("../selection-proxy.cjs");
var import_sql = require("../sql/sql.cjs");
var import_query_builders = require("./query-builders/index.cjs");
var import_subquery = require("../subquery.cjs");
var import_count = require("./query-builders/count.cjs");
var import_query = require("./query-builders/query.cjs");
var import_raw = require("./query-builders/raw.cjs");
class BaseSQLiteDatabase {
constructor(resultKind, dialect, session, schema) {
this.resultKind = resultKind;
this.dialect = dialect;
this.session = session;
this._ = schema ? {
schema: schema.schema,
fullSchema: schema.fullSchema,
tableNamesMap: schema.tableNamesMap
} : {
schema: void 0,
fullSchema: {},
tableNamesMap: {}
};
this.query = {};
const query = this.query;
if (this._.schema) {
for (const [tableName, columns] of Object.entries(this._.schema)) {
query[tableName] = new import_query.RelationalQueryBuilder(
resultKind,
schema.fullSchema,
this._.schema,
this._.tableNamesMap,
schema.fullSchema[tableName],
columns,
dialect,
session
);
}
}
this.$cache = { invalidate: async (_params) => {
} };
}
static [import_entity.entityKind] = "BaseSQLiteDatabase";
query;
/**
* Creates a subquery that defines a temporary named result set as a CTE.
*
* It is useful for breaking down complex queries into simpler parts and for reusing the result set in subsequent parts of the query.
*
* See docs: {@link https://orm.drizzle.team/docs/select#with-clause}
*
* @param alias The alias for the subquery.
*
* Failure to provide an alias will result in a DrizzleTypeError, preventing the subquery from being referenced in other queries.
*
* @example
*
* ```ts
* // Create a subquery with alias 'sq' and use it in the select query
* const sq = db.$with('sq').as(db.select().from(users).where(eq(users.id, 42)));
*
* const result = await db.with(sq).select().from(sq);
* ```
*
* To select arbitrary SQL values as fields in a CTE and reference them in other CTEs or in the main query, you need to add aliases to them:
*
* ```ts
* // Select an arbitrary SQL value as a field in a CTE and reference it in the main query
* const sq = db.$with('sq').as(db.select({
* name: sql<string>`upper(${users.name})`.as('name'),
* })
* .from(users));
*
* const result = await db.with(sq).select({ name: sq.name }).from(sq);
* ```
*/
$with = (alias, selection) => {
const self = this;
const as = (qb) => {
if (typeof qb === "function") {
qb = qb(new import_query_builders.QueryBuilder(self.dialect));
}
return new Proxy(
new import_subquery.WithSubquery(
qb.getSQL(),
selection ?? ("getSelectedFields" in qb ? qb.getSelectedFields() ?? {} : {}),
alias,
true
),
new import_selection_proxy.SelectionProxyHandler({ alias, sqlAliasedBehavior: "alias", sqlBehavior: "error" })
);
};
return { as };
};
$count(source, filters) {
return new import_count.SQLiteCountBuilder({ source, filters, session: this.session });
}
/**
* Incorporates a previously defined CTE (using `$with`) into the main query.
*
* This method allows the main query to reference a temporary named result set.
*
* See docs: {@link https://orm.drizzle.team/docs/select#with-clause}
*
* @param queries The CTEs to incorporate into the main query.
*
* @example
*
* ```ts
* // Define a subquery 'sq' as a CTE using $with
* const sq = db.$with('sq').as(db.select().from(users).where(eq(users.id, 42)));
*
* // Incorporate the CTE 'sq' into the main query and select from it
* const result = await db.with(sq).select().from(sq);
* ```
*/
with(...queries) {
const self = this;
function select(fields) {
return new import_query_builders.SQLiteSelectBuilder({
fields: fields ?? void 0,
session: self.session,
dialect: self.dialect,
withList: queries
});
}
function selectDistinct(fields) {
return new import_query_builders.SQLiteSelectBuilder({
fields: fields ?? void 0,
session: self.session,
dialect: self.dialect,
withList: queries,
distinct: true
});
}
function update(table) {
return new import_query_builders.SQLiteUpdateBuilder(table, self.session, self.dialect, queries);
}
function insert(into) {
return new import_query_builders.SQLiteInsertBuilder(into, self.session, self.dialect, queries);
}
function delete_(from) {
return new import_query_builders.SQLiteDeleteBase(from, self.session, self.dialect, queries);
}
return { select, selectDistinct, update, insert, delete: delete_ };
}
select(fields) {
return new import_query_builders.SQLiteSelectBuilder({ fields: fields ?? void 0, session: this.session, dialect: this.dialect });
}
selectDistinct(fields) {
return new import_query_builders.SQLiteSelectBuilder({
fields: fields ?? void 0,
session: this.session,
dialect: this.dialect,
distinct: true
});
}
/**
* Creates an update query.
*
* Calling this method without `.where()` clause will update all rows in a table. The `.where()` clause specifies which rows should be updated.
*
* Use `.set()` method to specify which values to update.
*
* See docs: {@link https://orm.drizzle.team/docs/update}
*
* @param table The table to update.
*
* @example
*
* ```ts
* // Update all rows in the 'cars' table
* await db.update(cars).set({ color: 'red' });
*
* // Update rows with filters and conditions
* await db.update(cars).set({ color: 'red' }).where(eq(cars.brand, 'BMW'));
*
* // Update with returning clause
* const updatedCar: Car[] = await db.update(cars)
* .set({ color: 'red' })
* .where(eq(cars.id, 1))
* .returning();
* ```
*/
update(table) {
return new import_query_builders.SQLiteUpdateBuilder(table, this.session, this.dialect);
}
$cache;
/**
* Creates an insert query.
*
* Calling this method will create new rows in a table. Use `.values()` method to specify which values to insert.
*
* See docs: {@link https://orm.drizzle.team/docs/insert}
*
* @param table The table to insert into.
*
* @example
*
* ```ts
* // Insert one row
* await db.insert(cars).values({ brand: 'BMW' });
*
* // Insert multiple rows
* await db.insert(cars).values([{ brand: 'BMW' }, { brand: 'Porsche' }]);
*
* // Insert with returning clause
* const insertedCar: Car[] = await db.insert(cars)
* .values({ brand: 'BMW' })
* .returning();
* ```
*/
insert(into) {
return new import_query_builders.SQLiteInsertBuilder(into, this.session, this.dialect);
}
/**
* Creates a delete query.
*
* Calling this method without `.where()` clause will delete all rows in a table. The `.where()` clause specifies which rows should be deleted.
*
* See docs: {@link https://orm.drizzle.team/docs/delete}
*
* @param table The table to delete from.
*
* @example
*
* ```ts
* // Delete all rows in the 'cars' table
* await db.delete(cars);
*
* // Delete rows with filters and conditions
* await db.delete(cars).where(eq(cars.color, 'green'));
*
* // Delete with returning clause
* const deletedCar: Car[] = await db.delete(cars)
* .where(eq(cars.id, 1))
* .returning();
* ```
*/
delete(from) {
return new import_query_builders.SQLiteDeleteBase(from, this.session, this.dialect);
}
run(query) {
const sequel = typeof query === "string" ? import_sql.sql.raw(query) : query.getSQL();
if (this.resultKind === "async") {
return new import_raw.SQLiteRaw(
async () => this.session.run(sequel),
() => sequel,
"run",
this.dialect,
this.session.extractRawRunValueFromBatchResult.bind(this.session)
);
}
return this.session.run(sequel);
}
all(query) {
const sequel = typeof query === "string" ? import_sql.sql.raw(query) : query.getSQL();
if (this.resultKind === "async") {
return new import_raw.SQLiteRaw(
async () => this.session.all(sequel),
() => sequel,
"all",
this.dialect,
this.session.extractRawAllValueFromBatchResult.bind(this.session)
);
}
return this.session.all(sequel);
}
get(query) {
const sequel = typeof query === "string" ? import_sql.sql.raw(query) : query.getSQL();
if (this.resultKind === "async") {
return new import_raw.SQLiteRaw(
async () => this.session.get(sequel),
() => sequel,
"get",
this.dialect,
this.session.extractRawGetValueFromBatchResult.bind(this.session)
);
}
return this.session.get(sequel);
}
values(query) {
const sequel = typeof query === "string" ? import_sql.sql.raw(query) : query.getSQL();
if (this.resultKind === "async") {
return new import_raw.SQLiteRaw(
async () => this.session.values(sequel),
() => sequel,
"values",
this.dialect,
this.session.extractRawValuesValueFromBatchResult.bind(this.session)
);
}
return this.session.values(sequel);
}
transaction(transaction, config) {
return this.session.transaction(transaction, config);
}
}
const withReplicas = (primary, replicas, getReplica = () => replicas[Math.floor(Math.random() * replicas.length)]) => {
const select = (...args) => getReplica(replicas).select(...args);
const selectDistinct = (...args) => getReplica(replicas).selectDistinct(...args);
const $count = (...args) => getReplica(replicas).$count(...args);
const $with = (...args) => getReplica(replicas).with(...args);
const update = (...args) => primary.update(...args);
const insert = (...args) => primary.insert(...args);
const $delete = (...args) => primary.delete(...args);
const run = (...args) => primary.run(...args);
const all = (...args) => primary.all(...args);
const get = (...args) => primary.get(...args);
const values = (...args) => primary.values(...args);
const transaction = (...args) => primary.transaction(...args);
return {
...primary,
update,
insert,
delete: $delete,
run,
all,
get,
values,
transaction,
$primary: primary,
$replicas: replicas,
select,
selectDistinct,
$count,
with: $with,
get query() {
return getReplica(replicas).query;
}
};
};
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
BaseSQLiteDatabase,
withReplicas
});
//# sourceMappingURL=db.cjs.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/admin/fields/RichText.ts"],"sourcesContent":["import type { MarkOptional } from 'ts-essentials'\n\nimport type { RichTextField, RichTextFieldClient } from '../../fields/config/types.js'\nimport type { RichTextFieldValidation } from '../../fields/validations.js'\nimport type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'\nimport type {\n ClientFieldBase,\n FieldClientComponent,\n FieldPaths,\n FieldServerComponent,\n ServerFieldBase,\n} from '../forms/Field.js'\nimport type {\n FieldDescriptionClientComponent,\n FieldDescriptionServerComponent,\n FieldDiffClientComponent,\n FieldDiffServerComponent,\n FieldLabelClientComponent,\n FieldLabelServerComponent,\n} from '../types.js'\n\ntype RichTextFieldClientWithoutType<\n TValue extends object = any,\n TAdapterProps = any,\n TExtraProperties = object,\n> = MarkOptional<RichTextFieldClient<TValue, TAdapterProps, TExtraProperties>, 'type'>\n\ntype RichTextFieldBaseClientProps<\n TValue extends object = any,\n TAdapterProps = any,\n TExtraProperties = object,\n> = {\n readonly path: string\n readonly validate?: RichTextFieldValidation\n}\n\ntype RichTextFieldBaseServerProps = Pick<FieldPaths, 'path'>\n\nexport type RichTextFieldClientProps<\n TValue extends object = any,\n TAdapterProps = any,\n TExtraProperties = object,\n> = ClientFieldBase<RichTextFieldClientWithoutType<TValue, TAdapterProps, TExtraProperties>> &\n RichTextFieldBaseClientProps<TValue, TAdapterProps, TExtraProperties>\n\nexport type RichTextFieldServerProps = RichTextFieldBaseServerProps &\n ServerFieldBase<RichTextField, RichTextFieldClientWithoutType>\n\nexport type RichTextFieldServerComponent = FieldServerComponent<\n RichTextField,\n RichTextFieldClientWithoutType,\n RichTextFieldBaseServerProps\n>\n\nexport type RichTextFieldClientComponent = FieldClientComponent<\n RichTextFieldClientWithoutType,\n RichTextFieldBaseClientProps\n>\n\nexport type RichTextFieldLabelServerComponent = FieldLabelServerComponent<\n RichTextField,\n RichTextFieldClientWithoutType\n>\n\nexport type RichTextFieldLabelClientComponent =\n FieldLabelClientComponent<RichTextFieldClientWithoutType>\n\nexport type RichTextFieldDescriptionServerComponent = FieldDescriptionServerComponent<\n RichTextField,\n RichTextFieldClientWithoutType\n>\n\nexport type RichTextFieldDescriptionClientComponent =\n FieldDescriptionClientComponent<RichTextFieldClientWithoutType>\n\nexport type RichTextFieldErrorServerComponent = FieldErrorServerComponent<\n RichTextField,\n RichTextFieldClientWithoutType\n>\n\nexport type RichTextFieldErrorClientComponent =\n FieldErrorClientComponent<RichTextFieldClientWithoutType>\n\nexport type RichTextFieldDiffServerComponent = FieldDiffServerComponent<\n RichTextField,\n RichTextFieldClient\n>\n\nexport type RichTextFieldDiffClientComponent = FieldDiffClientComponent<RichTextFieldClient>\n"],"names":[],"mappings":"AAwFA,WAA4F"}

View File

@@ -0,0 +1,17 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
import createLucideIcon from '../createLucideIcon.js';
const CircleArrowOutDownRight = createLucideIcon("CircleArrowOutDownRight", [
["path", { d: "M12 22a10 10 0 1 1 10-10", key: "130bv5" }],
["path", { d: "M22 22 12 12", key: "131aw7" }],
["path", { d: "M22 16v6h-6", key: "1gvm70" }]
]);
export { CircleArrowOutDownRight as default };
//# sourceMappingURL=circle-arrow-out-down-right.js.map

View File

@@ -0,0 +1,8 @@
import { entityKind } from "../entity.js";
import { type ColumnsSelection, View } from "../sql/sql.js";
export declare abstract class GelViewBase<TName extends string = string, TExisting extends boolean = boolean, TSelectedFields extends ColumnsSelection = ColumnsSelection> extends View<TName, TExisting, TSelectedFields> {
static readonly [entityKind]: string;
readonly _: View<TName, TExisting, TSelectedFields>['_'] & {
readonly viewBrand: 'GelViewBase';
};
}

View File

@@ -0,0 +1,38 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = toKeyAlias;
var _index = require("../validators/generated/index.js");
var _cloneNode = require("../clone/cloneNode.js");
var _removePropertiesDeep = require("../modifications/removePropertiesDeep.js");
function toKeyAlias(node, key = node.key) {
let alias;
if (node.kind === "method") {
return toKeyAlias.increment() + "";
} else if ((0, _index.isIdentifier)(key)) {
alias = key.name;
} else if ((0, _index.isStringLiteral)(key)) {
alias = JSON.stringify(key.value);
} else {
alias = JSON.stringify((0, _removePropertiesDeep.default)((0, _cloneNode.default)(key)));
}
if (node.computed) {
alias = `[${alias}]`;
}
if (node.static) {
alias = `static:${alias}`;
}
return alias;
}
toKeyAlias.uid = 0;
toKeyAlias.increment = function () {
if (toKeyAlias.uid >= Number.MAX_SAFE_INTEGER) {
return toKeyAlias.uid = 0;
} else {
return toKeyAlias.uid++;
}
};
//# sourceMappingURL=toKeyAlias.js.map

View File

@@ -0,0 +1,14 @@
import type { Column } from "./column.cjs";
import { entityKind } from "./entity.cjs";
import type { Casing } from "./utils.cjs";
export declare function toSnakeCase(input: string): string;
export declare function toCamelCase(input: string): string;
export declare class CasingCache {
static readonly [entityKind]: string;
private cachedTables;
private convert;
constructor(casing?: Casing);
getColumnCasing(column: Column): string;
private cacheTable;
clearCache(): void;
}

View File

@@ -0,0 +1,9 @@
/**
* @license lucide-react v0.441.0 - ISC
*
* This source code is licensed under the ISC license.
* See the LICENSE file in the root directory of this source tree.
*/
export { default } from './file-cog.js';
//# sourceMappingURL=file-cog-2.js.map

View File

@@ -0,0 +1,173 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["vC", "nC"],
abbreviated: ["vC", "nC"],
wide: ["voor Christus", "na Christus"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["K1", "K2", "K3", "K4"],
wide: ["1ste kwartaal", "2de kwartaal", "3de kwartaal", "4de kwartaal"],
};
const monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"Jan",
"Feb",
"Mrt",
"Apr",
"Mei",
"Jun",
"Jul",
"Aug",
"Sep",
"Okt",
"Nov",
"Des",
],
wide: [
"Januarie",
"Februarie",
"Maart",
"April",
"Mei",
"Junie",
"Julie",
"Augustus",
"September",
"Oktober",
"November",
"Desember",
],
};
const dayValues = {
narrow: ["S", "M", "D", "W", "D", "V", "S"],
short: ["So", "Ma", "Di", "Wo", "Do", "Vr", "Sa"],
abbreviated: ["Son", "Maa", "Din", "Woe", "Don", "Vry", "Sat"],
wide: [
"Sondag",
"Maandag",
"Dinsdag",
"Woensdag",
"Donderdag",
"Vrydag",
"Saterdag",
],
};
const dayPeriodValues = {
narrow: {
am: "vm",
pm: "nm",
midnight: "middernag",
noon: "middaguur",
morning: "oggend",
afternoon: "middag",
evening: "laat middag",
night: "aand",
},
abbreviated: {
am: "vm",
pm: "nm",
midnight: "middernag",
noon: "middaguur",
morning: "oggend",
afternoon: "middag",
evening: "laat middag",
night: "aand",
},
wide: {
am: "vm",
pm: "nm",
midnight: "middernag",
noon: "middaguur",
morning: "oggend",
afternoon: "middag",
evening: "laat middag",
night: "aand",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "vm",
pm: "nm",
midnight: "middernag",
noon: "uur die middag",
morning: "uur die oggend",
afternoon: "uur die middag",
evening: "uur die aand",
night: "uur die aand",
},
abbreviated: {
am: "vm",
pm: "nm",
midnight: "middernag",
noon: "uur die middag",
morning: "uur die oggend",
afternoon: "uur die middag",
evening: "uur die aand",
night: "uur die aand",
},
wide: {
am: "vm",
pm: "nm",
midnight: "middernag",
noon: "uur die middag",
morning: "uur die oggend",
afternoon: "uur die middag",
evening: "uur die aand",
night: "uur die aand",
},
};
const ordinalNumber = (dirtyNumber) => {
const number = Number(dirtyNumber);
const rem100 = number % 100;
if (rem100 < 20) {
switch (rem100) {
case 1:
case 8:
return number + "ste";
default:
return number + "de";
}
}
return number + "ste";
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

View File

@@ -0,0 +1,69 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const util = require("util");
const defaultFactory = (key, hook) => hook;
class HookMap {
constructor(factory, name = undefined) {
this._map = new Map();
this.name = name;
this._factory = factory;
this._interceptors = [];
}
get(key) {
return this._map.get(key);
}
for(key) {
const hook = this.get(key);
if (hook !== undefined) {
return hook;
}
let newHook = this._factory(key);
const interceptors = this._interceptors;
for (let i = 0; i < interceptors.length; i++) {
newHook = interceptors[i].factory(key, newHook);
}
this._map.set(key, newHook);
return newHook;
}
intercept(interceptor) {
this._interceptors.push(
Object.assign(
{
factory: defaultFactory
},
interceptor
)
);
}
}
HookMap.prototype.tap = util.deprecate(function tap(key, options, fn) {
return this.for(key).tap(options, fn);
}, "HookMap#tap(key,…) is deprecated. Use HookMap#for(key).tap(…) instead.");
HookMap.prototype.tapAsync = util.deprecate(function tapAsync(
key,
options,
fn
) {
return this.for(key).tapAsync(options, fn);
}, "HookMap#tapAsync(key,…) is deprecated. Use HookMap#for(key).tapAsync(…) instead.");
HookMap.prototype.tapPromise = util.deprecate(function tapPromise(
key,
options,
fn
) {
return this.for(key).tapPromise(options, fn);
}, "HookMap#tapPromise(key,…) is deprecated. Use HookMap#for(key).tapPromise(…) instead.");
module.exports = HookMap;

View File

@@ -0,0 +1,56 @@
var baseIteratee = require('./_baseIteratee'),
createInverter = require('./_createInverter');
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/**
* This method is like `_.invert` except that the inverted object is generated
* from the results of running each element of `object` thru `iteratee`. The
* corresponding inverted value of each inverted key is an array of keys
* responsible for generating the inverted value. The iteratee is invoked
* with one argument: (value).
*
* @static
* @memberOf _
* @since 4.1.0
* @category Object
* @param {Object} object The object to invert.
* @param {Function} [iteratee=_.identity] The iteratee invoked per element.
* @returns {Object} Returns the new inverted object.
* @example
*
* var object = { 'a': 1, 'b': 2, 'c': 1 };
*
* _.invertBy(object);
* // => { '1': ['a', 'c'], '2': ['b'] }
*
* _.invertBy(object, function(value) {
* return 'group' + value;
* });
* // => { 'group1': ['a', 'c'], 'group2': ['b'] }
*/
var invertBy = createInverter(function(result, value, key) {
if (value != null &&
typeof value.toString != 'function') {
value = nativeObjectToString.call(value);
}
if (hasOwnProperty.call(result, value)) {
result[value].push(key);
} else {
result[value] = [key];
}
}, baseIteratee);
module.exports = invertBy;

View File

@@ -0,0 +1,72 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { getTranslation } from '@payloadcms/translations';
import { tabHasName } from 'payload/shared';
import React, { useState } from 'react';
import { ErrorPill } from '../../../elements/ErrorPill/index.js';
import { WatchChildErrors } from '../../../forms/WatchChildErrors/index.js';
import { useTranslation } from '../../../providers/Translation/index.js';
import './index.scss';
const baseClass = 'tabs-field__tab-button';
export const TabComponent = t0 => {
const $ = _c(12);
const {
hidden,
isActive,
parentPath,
setIsActive,
tab
} = t0;
const {
i18n
} = useTranslation();
const [errorCount, setErrorCount] = useState(undefined);
let t1;
if ($[0] !== errorCount || $[1] !== hidden || $[2] !== i18n || $[3] !== isActive || $[4] !== parentPath || $[5] !== setIsActive || $[6] !== tab) {
const path = [...(parentPath ? parentPath.split(".").slice(0, -1) : []), ...(tabHasName(tab) ? [tab.name] : [])];
const fieldHasErrors = errorCount > 0;
const t2 = _jsx(WatchChildErrors, {
fields: tab.fields,
path,
setErrorCount
});
const t3 = fieldHasErrors && `${baseClass}--has-error`;
const t4 = isActive && `${baseClass}--active`;
const t5 = hidden && `${baseClass}--hidden`;
let t6;
if ($[8] !== t3 || $[9] !== t4 || $[10] !== t5) {
t6 = [baseClass, t3, t4, t5].filter(Boolean);
$[8] = t3;
$[9] = t4;
$[10] = t5;
$[11] = t6;
} else {
t6 = $[11];
}
t1 = _jsxs(React.Fragment, {
children: [t2, _jsxs("button", {
className: t6.join(" "),
onClick: setIsActive,
type: "button",
children: [tab.label ? getTranslation(tab.label, i18n) : tabHasName(tab) ? tab.name : "", fieldHasErrors && _jsx(ErrorPill, {
count: errorCount,
i18n
})]
})]
});
$[0] = errorCount;
$[1] = hidden;
$[2] = i18n;
$[3] = isActive;
$[4] = parentPath;
$[5] = setIsActive;
$[6] = tab;
$[7] = t1;
} else {
t1 = $[7];
}
return t1;
};
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.mjs","sources":["../../src/index.ts"],"sourcesContent":["import { SentryWebpackPluginOptions, sentryWebpackUnpluginFactory } from \"./webpack4and5\";\n\n// eslint-disable-next-line @typescript-eslint/ban-ts-comment\n// @ts-ignore webpack is a peer dep\nimport * as webpack4or5 from \"webpack\";\n\nconst BannerPlugin = webpack4or5?.BannerPlugin || webpack4or5?.default?.BannerPlugin;\n\nconst DefinePlugin = webpack4or5?.DefinePlugin || webpack4or5?.default?.DefinePlugin;\n\nconst sentryUnplugin = sentryWebpackUnpluginFactory({\n BannerPlugin,\n DefinePlugin,\n});\n\n// eslint-disable-next-line @typescript-eslint/no-explicit-any\nexport const sentryWebpackPlugin: (options?: SentryWebpackPluginOptions) => any =\n sentryUnplugin.webpack;\n\nexport { sentryCliBinaryExists } from \"@sentry/bundler-plugin-core\";\n\nexport type { SentryWebpackPluginOptions };\n"],"names":["BannerPlugin","webpack4or5","_webpack4or5$default","DefinePlugin","_webpack4or5$default2","sentryUnplugin","sentryWebpackUnpluginFactory","sentryWebpackPlugin","webpack"],"mappings":";;;;;;;;AAMA,IAAMA,YAAY,GAAG,CAAAC,WAAW,KAAA,IAAA,IAAXA,WAAW,KAAXA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,WAAW,CAAED,YAAY,MAAIC,WAAW,aAAXA,WAAW,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,CAAAC,oBAAA,GAAXD,WAAW,CAAA,SAAA,CAAS,cAAAC,oBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAApBA,oBAAA,CAAsBF,YAAY,CAAA,CAAA;AAEpF,IAAMG,YAAY,GAAG,CAAAF,WAAW,KAAA,IAAA,IAAXA,WAAW,KAAXA,KAAAA,CAAAA,GAAAA,KAAAA,CAAAA,GAAAA,WAAW,CAAEE,YAAY,MAAIF,WAAW,aAAXA,WAAW,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAAA,CAAAG,qBAAA,GAAXH,WAAW,CAAA,SAAA,CAAS,cAAAG,qBAAA,KAAA,KAAA,CAAA,GAAA,KAAA,CAAA,GAApBA,qBAAA,CAAsBD,YAAY,CAAA,CAAA;AAEpF,IAAME,cAAc,GAAGC,4BAA4B,CAAC;AAClDN,EAAAA,YAAY,EAAZA,YAAY;AACZG,EAAAA,YAAY,EAAZA,YAAAA;AACF,CAAC,CAAC,CAAA;;AAEF;AACaI,IAAAA,mBAAkE,GAC7EF,cAAc,CAACG;;;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"scissors-square.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}

View File

@@ -0,0 +1,10 @@
"use strict";
var __importDefault = (this && this.__importDefault) || function (mod) {
return (mod && mod.__esModule) ? mod : { "default": mod };
};
Object.defineProperty(exports, "__esModule", { value: true });
const oneRequired_1 = __importDefault(require("../definitions/oneRequired"));
const oneRequired = (ajv) => ajv.addKeyword((0, oneRequired_1.default)());
exports.default = oneRequired;
module.exports = oneRequired;
//# sourceMappingURL=oneRequired.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["c","_c","React","createContext","use","useState","Context","mostRecentUpdate","reportUpdate","DocumentEventsProvider","t0","$","children","t1","_jsx","value","useDocumentEvents"],"sources":["../../../src/providers/DocumentEvents/index.tsx"],"sourcesContent":["'use client'\nimport type { DocumentEvent } from 'payload'\n\nimport React, { createContext, use, useState } from 'react'\n\nconst Context = createContext<{\n mostRecentUpdate: DocumentEvent | null\n reportUpdate: (event: DocumentEvent) => void\n}>({\n mostRecentUpdate: null,\n reportUpdate: () => null,\n})\n\nexport const DocumentEventsProvider: React.FC<{ children: React.ReactNode }> = ({ children }) => {\n const [mostRecentUpdate, reportUpdate] = useState<DocumentEvent>(null)\n\n return <Context value={{ mostRecentUpdate, reportUpdate }}>{children}</Context>\n}\n\n/**\n * The useDocumentEvents hook provides a way of subscribing to cross-document events,\n * such as updates made to nested documents within a drawer.\n * This hook will report document events that are outside the scope of the document currently being edited.\n *\n * @link https://payloadcms.com/docs/admin/react-hooks#usedocumentevents\n */\nexport const useDocumentEvents = () => use(Context)\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAGA,OAAOC,KAAA,IAASC,aAAa,EAAEC,GAAG,EAAEC,QAAQ,QAAQ;AAEpD,MAAMC,OAAA,gBAAUH,aAAA,CAGb;EACDI,gBAAA,EAAkB;EAClBC,YAAA,EAAcA,CAAA,KAAM;AACtB;AAEA,OAAO,MAAMC,sBAAA,GAAkEC,EAAA;EAAA,MAAAC,CAAA,GAAAV,EAAA;EAAC;IAAAW;EAAA,IAAAF,EAAY;EAC1F,OAAAH,gBAAA,EAAAC,YAAA,IAAyCH,QAAA,KAAwB;EAAA,IAAAQ,EAAA;EAAA,IAAAF,CAAA,QAAAC,QAAA,IAAAD,CAAA,QAAAJ,gBAAA;IAE1DM,EAAA,GAAAC,IAAA,CAAAR,OAAA;MAAAS,KAAA;QAAAR,gBAAA;QAAAC;MAAA;MAAAI;IAAA,C;;;;;;;SAAAC,E;CACT;AAEA;;;;;;;AAOA,OAAO,MAAMG,iBAAA,GAAoBA,CAAA,KAAMZ,GAAA,CAAIE,OAAA","ignoreList":[]}

View File

@@ -0,0 +1,5 @@
var convert = require('./convert'),
func = convert('curryRightN', require('../curryRight'));
func.placeholder = require('./placeholder');
module.exports = func;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/preferences/requestHandlers/findOne.ts"],"sourcesContent":["import { status as httpStatus } from 'http-status'\n\nimport type { PayloadHandler } from '../../config/types.js'\nimport type { PayloadRequest } from '../../types/index.js'\n\nimport { findOne } from '../operations/findOne.js'\n\nexport const findByIDHandler: PayloadHandler = async (incomingReq): Promise<Response> => {\n // We cannot import the addDataAndFileToRequest utility here from the 'next' package because of dependency issues\n // However that utility should be used where possible instead of manually appending the data\n let data\n\n try {\n data = await incomingReq.json?.()\n } catch (ignore) {\n data = {}\n }\n\n const reqWithData: PayloadRequest = incomingReq\n\n if (data) {\n reqWithData.data = data\n // @ts-expect-error\n reqWithData.json = () => Promise.resolve(data)\n }\n\n const result = await findOne({\n key: reqWithData.routeParams?.key as string,\n req: reqWithData,\n user: reqWithData.user,\n })\n\n return Response.json(\n {\n ...(result\n ? result\n : {\n message: reqWithData.t('general:notFound'),\n value: null,\n }),\n },\n {\n status: httpStatus.OK,\n },\n )\n}\n"],"names":["status","httpStatus","findOne","findByIDHandler","incomingReq","data","json","ignore","reqWithData","Promise","resolve","result","key","routeParams","req","user","Response","message","t","value","OK"],"mappings":"AAAA,SAASA,UAAUC,UAAU,QAAQ,cAAa;AAKlD,SAASC,OAAO,QAAQ,2BAA0B;AAElD,OAAO,MAAMC,kBAAkC,OAAOC;IACpD,iHAAiH;IACjH,4FAA4F;IAC5F,IAAIC;IAEJ,IAAI;QACFA,OAAO,MAAMD,YAAYE,IAAI;IAC/B,EAAE,OAAOC,QAAQ;QACfF,OAAO,CAAC;IACV;IAEA,MAAMG,cAA8BJ;IAEpC,IAAIC,MAAM;QACRG,YAAYH,IAAI,GAAGA;QACnB,mBAAmB;QACnBG,YAAYF,IAAI,GAAG,IAAMG,QAAQC,OAAO,CAACL;IAC3C;IAEA,MAAMM,SAAS,MAAMT,QAAQ;QAC3BU,KAAKJ,YAAYK,WAAW,EAAED;QAC9BE,KAAKN;QACLO,MAAMP,YAAYO,IAAI;IACxB;IAEA,OAAOC,SAASV,IAAI,CAClB;QACE,GAAIK,SACAA,SACA;YACEM,SAAST,YAAYU,CAAC,CAAC;YACvBC,OAAO;QACT,CAAC;IACP,GACA;QACEnB,QAAQC,WAAWmB,EAAE;IACvB;AAEJ,EAAC"}

View File

@@ -0,0 +1,29 @@
import { Context } from '@opentelemetry/api';
import { SpanKind } from '@opentelemetry/api';
import { Sampler, SamplingResult } from '@opentelemetry/sdk-trace-base';
import { SamplingDecision } from '@opentelemetry/sdk-trace-base';
import { Client, SpanAttributes } from '@sentry/core';
/**
* A custom OTEL sampler that uses Sentry sampling rates to make its decision
*/
export declare class SentrySampler implements Sampler {
private _client;
constructor(client: Client);
/** @inheritDoc */
shouldSample(context: Context, traceId: string, spanName: string, spanKind: SpanKind, spanAttributes: SpanAttributes, _links: unknown): SamplingResult;
/** Returns the sampler name or short description with the configuration. */
toString(): string;
}
/**
* Wrap a sampling decision with data that Sentry needs to work properly with it.
* If you pass `decision: undefined`, it will be treated as `NOT_RECORDING`, but in contrast to passing `NOT_RECORDING`
* it will not propagate this decision to downstream Sentry SDKs.
*/
export declare function wrapSamplingDecision({ decision, context, spanAttributes, sampleRand, downstreamTraceSampleRate, }: {
decision: SamplingDecision | undefined;
context: Context;
spanAttributes: SpanAttributes;
sampleRand?: number;
downstreamTraceSampleRate?: number;
}): SamplingResult;
//# sourceMappingURL=sampler.d.ts.map

View File

@@ -0,0 +1,7 @@
/*
* This file was automatically generated.
* DO NOT MODIFY BY HAND.
* Run `yarn fix:special` to update
*/
declare const check: (options: import("../../../declarations/plugins/ids/OccurrenceModuleIdsPlugin").OccurrenceModuleIdsPluginOptions) => boolean;
export = check;

View File

@@ -0,0 +1,19 @@
interface SentryTrpcMiddlewareOptions {
/** Whether to include procedure inputs in reported events. Defaults to `false`. */
attachRpcInput?: boolean;
forceTransaction?: boolean;
}
export interface SentryTrpcMiddlewareArguments<T> {
path?: unknown;
type?: unknown;
next: () => T;
rawInput?: unknown;
getRawInput?: () => Promise<unknown>;
}
type SentryTrpcMiddleware<T> = T extends Promise<unknown> ? T : Promise<T>;
/**
* Sentry tRPC middleware that captures errors and creates spans for tRPC procedures.
*/
export declare function trpcMiddleware(options?: SentryTrpcMiddlewareOptions): <T>(opts: SentryTrpcMiddlewareArguments<T>) => SentryTrpcMiddleware<T>;
export {};
//# sourceMappingURL=trpc.d.ts.map

View File

@@ -0,0 +1,22 @@
import type { FindOptions } from '../../collections/operations/local/find.js';
import type { JsonObject, PayloadRequest, PopulateType, SelectType } from '../../types/index.js';
import type { SanitizedGlobalConfig } from '../config/types.js';
import { type AfterReadArgs } from '../../fields/hooks/afterRead/index.js';
export type GlobalFindOneArgs = {
/**
* You may pass the document data directly which will skip the `db.findOne` database query.
* This is useful if you want to use this endpoint solely for running hooks and populating data.
*/
data?: Record<string, unknown>;
depth?: number;
draft?: boolean;
globalConfig: SanitizedGlobalConfig;
includeLockStatus?: boolean;
overrideAccess?: boolean;
populate?: PopulateType;
req: PayloadRequest;
showHiddenFields?: boolean;
slug: string;
} & Pick<AfterReadArgs<JsonObject>, 'flattenLocales'> & Pick<FindOptions<string, SelectType>, 'select'>;
export declare const findOneOperation: <T extends Record<string, unknown>>(args: GlobalFindOneArgs) => Promise<T>;
//# sourceMappingURL=findOne.d.ts.map

View File

@@ -0,0 +1,2 @@
import { pullAllWith } from "../fp";
export = pullAllWith;

View File

@@ -0,0 +1,15 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = removeComments;
var _index = require("../constants/index.js");
function removeComments(node) {
_index.COMMENT_KEYS.forEach(key => {
node[key] = null;
});
return node;
}
//# sourceMappingURL=removeComments.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,qDAA2D;AAAlD,yHAAA,sBAAsB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { IORedisInstrumentation } from './instrumentation';\nexport type {\n CommandArgs,\n DbStatementSerializer,\n IORedisInstrumentationConfig,\n IORedisRequestHookInformation,\n RedisRequestCustomAttributeFunction,\n RedisResponseCustomAttributeFunction,\n} from './types';\n"]}

View File

@@ -0,0 +1,54 @@
import { entityKind } from "./entity.js";
class Column {
constructor(table, config) {
this.table = table;
this.config = config;
this.name = config.name;
this.keyAsName = config.keyAsName;
this.notNull = config.notNull;
this.default = config.default;
this.defaultFn = config.defaultFn;
this.onUpdateFn = config.onUpdateFn;
this.hasDefault = config.hasDefault;
this.primary = config.primaryKey;
this.isUnique = config.isUnique;
this.uniqueName = config.uniqueName;
this.uniqueType = config.uniqueType;
this.dataType = config.dataType;
this.columnType = config.columnType;
this.generated = config.generated;
this.generatedIdentity = config.generatedIdentity;
}
static [entityKind] = "Column";
name;
keyAsName;
primary;
notNull;
default;
defaultFn;
onUpdateFn;
hasDefault;
isUnique;
uniqueName;
uniqueType;
dataType;
columnType;
enumValues = void 0;
generated = void 0;
generatedIdentity = void 0;
config;
mapFromDriverValue(value) {
return value;
}
mapToDriverValue(value) {
return value;
}
// ** @internal */
shouldDisableInsert() {
return this.config.generated !== void 0 && this.config.generated.type !== "byDefault";
}
}
export {
Column
};
//# sourceMappingURL=column.js.map

View File

@@ -0,0 +1,15 @@
import type { Data, Field as FieldSchema, PayloadRequest, SelectMode, SelectType, TypedUser } from 'payload';
type Args = {
data: Data;
fields: FieldSchema[];
id?: number | string;
locale: string | undefined;
req: PayloadRequest;
select?: SelectType;
selectMode?: SelectMode;
siblingData: Data;
user: TypedUser;
};
export declare const calculateDefaultValues: ({ id, data, fields, locale, req, select, selectMode, user, }: Args) => Promise<Data>;
export {};
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,189 @@
'use strict'
const { isColorSupported } = require('colorette')
const pump = require('pump')
const { Transform } = require('node:stream')
const abstractTransport = require('pino-abstract-transport')
const colors = require('./lib/colors')
const {
ERROR_LIKE_KEYS,
LEVEL_KEY,
LEVEL_LABEL,
MESSAGE_KEY,
TIMESTAMP_KEY
} = require('./lib/constants')
const {
buildSafeSonicBoom,
parseFactoryOptions
} = require('./lib/utils')
const pretty = require('./lib/pretty')
/**
* @typedef {object} PinoPrettyOptions
* @property {boolean} [colorize] Indicates if colors should be used when
* prettifying. The default will be determined by the terminal capabilities at
* run time.
* @property {boolean} [colorizeObjects=true] Apply coloring to rendered objects
* when coloring is enabled.
* @property {boolean} [crlf=false] End lines with `\r\n` instead of `\n`.
* @property {string|null} [customColors=null] A comma separated list of colors
* to use for specific level labels, e.g. `err:red,info:blue`.
* @property {string|null} [customLevels=null] A comma separated list of user
* defined level names and numbers, e.g. `err:99,info:1`.
* @property {CustomPrettifiers} [customPrettifiers={}] A set of prettifier
* functions to apply to keys defined in this object.
* @property {K_ERROR_LIKE_KEYS} [errorLikeObjectKeys] A list of string property
* names to consider as error objects.
* @property {string} [errorProps=''] A comma separated list of properties on
* error objects to include in the output.
* @property {boolean} [hideObject=false] When `true`, data objects will be
* omitted from the output (except for error objects).
* @property {string} [ignore='hostname'] A comma separated list of log keys
* to omit when outputting the prettified log information.
* @property {undefined|string} [include=undefined] A comma separated list of
* log keys to include in the prettified log information. Only the keys in this
* list will be included in the output.
* @property {boolean} [levelFirst=false] When true, the log level will be the
* first field in the prettified output.
* @property {string} [levelKey='level'] The key name in the log data that
* contains the level value for the log.
* @property {string} [levelLabel='levelLabel'] Token name to use in
* `messageFormat` to represent the name of the logged level.
* @property {null|MessageFormatString|MessageFormatFunction} [messageFormat=null]
* When a string, defines how the prettified line should be formatted according
* to defined tokens. When a function, a synchronous function that returns a
* formatted string.
* @property {string} [messageKey='msg'] Defines the key in incoming logs that
* contains the message of the log, if present.
* @property {undefined|string|number} [minimumLevel=undefined] The minimum
* level for logs that should be processed. Any logs below this level will
* be omitted.
* @property {object} [outputStream=process.stdout] The stream to write
* prettified log lines to.
* @property {boolean} [singleLine=false] When `true` any objects, except error
* objects, in the log data will be printed as a single line instead as multiple
* lines.
* @property {string} [timestampKey='time'] Defines the key in incoming logs
* that contains the timestamp of the log, if present.
* @property {boolean|string} [translateTime=true] When true, will translate a
* JavaScript date integer into a human-readable string. If set to a string,
* it must be a format string.
* @property {boolean} [useOnlyCustomProps=true] When true, only custom levels
* and colors will be used if they have been provided.
*/
/**
* The default options that will be used when prettifying log lines.
*
* @type {PinoPrettyOptions}
*/
const defaultOptions = {
colorize: isColorSupported,
colorizeObjects: true,
crlf: false,
customColors: null,
customLevels: null,
customPrettifiers: {},
errorLikeObjectKeys: ERROR_LIKE_KEYS,
errorProps: '',
hideObject: false,
ignore: 'hostname',
include: undefined,
levelFirst: false,
levelKey: LEVEL_KEY,
levelLabel: LEVEL_LABEL,
messageFormat: null,
messageKey: MESSAGE_KEY,
minimumLevel: undefined,
outputStream: process.stdout,
singleLine: false,
timestampKey: TIMESTAMP_KEY,
translateTime: true,
useOnlyCustomProps: true
}
/**
* Processes the supplied options and returns a function that accepts log data
* and produces a prettified log string.
*
* @param {PinoPrettyOptions} options Configuration for the prettifier.
* @returns {LogPrettifierFunc}
*/
function prettyFactory (options) {
const context = parseFactoryOptions(Object.assign({}, defaultOptions, options))
return pretty.bind({ ...context, context })
}
/**
* @typedef {PinoPrettyOptions} BuildStreamOpts
* @property {object|number|string} [destination] A destination stream, file
* descriptor, or target path to a file.
* @property {boolean} [append]
* @property {boolean} [mkdir]
* @property {boolean} [sync=false]
*/
/**
* Constructs a {@link LogPrettifierFunc} and a stream to which the produced
* prettified log data will be written.
*
* @param {BuildStreamOpts} opts
* @returns {Transform | (Transform & OnUnknown)}
*/
function build (opts = {}) {
let pretty = prettyFactory(opts)
let destination
return abstractTransport(function (source) {
source.on('message', function pinoConfigListener (message) {
if (!message || message.code !== 'PINO_CONFIG') return
Object.assign(opts, {
messageKey: message.config.messageKey,
errorLikeObjectKeys: Array.from(new Set([...(opts.errorLikeObjectKeys || ERROR_LIKE_KEYS), message.config.errorKey])),
customLevels: message.config.levels.values
})
pretty = prettyFactory(opts)
source.off('message', pinoConfigListener)
})
const stream = new Transform({
objectMode: true,
autoDestroy: true,
transform (chunk, enc, cb) {
const line = pretty(chunk)
cb(null, line)
}
})
if (typeof opts.destination === 'object' && typeof opts.destination.write === 'function') {
destination = opts.destination
} else {
destination = buildSafeSonicBoom({
dest: opts.destination || 1,
append: opts.append,
mkdir: opts.mkdir,
sync: opts.sync // by default sonic will be async
})
}
source.on('unknown', function (line) {
destination.write(line + '\n')
})
pump(source, stream, destination)
return stream
}, {
parse: 'lines',
close (err, cb) {
destination.on('close', () => {
cb(err)
})
}
})
}
module.exports = build
module.exports.build = build
module.exports.PinoPretty = build
module.exports.prettyFactory = prettyFactory
module.exports.colorizerFactory = colors
module.exports.isColorSupported = isColorSupported
module.exports.default = build

View File

@@ -0,0 +1,8 @@
import React from 'react';
import './index.scss';
type Props = {
showRelationCell?: boolean;
};
export declare function FolderFileTable({ showRelationCell }: Props): React.JSX.Element;
export {};
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,200 @@
"use strict";
exports.formatDistance = void 0;
const formatDistanceLocale = {
lessThanXSeconds: {
standalone: {
one: "weniger als 1 Sekunde",
other: "weniger als {{count}} Sekunden",
},
withPreposition: {
one: "weniger als 1 Sekunde",
other: "weniger als {{count}} Sekunden",
},
},
xSeconds: {
standalone: {
one: "1 Sekunde",
other: "{{count}} Sekunden",
},
withPreposition: {
one: "1 Sekunde",
other: "{{count}} Sekunden",
},
},
halfAMinute: {
standalone: "eine halbe Minute",
withPreposition: "einer halben Minute",
},
lessThanXMinutes: {
standalone: {
one: "weniger als 1 Minute",
other: "weniger als {{count}} Minuten",
},
withPreposition: {
one: "weniger als 1 Minute",
other: "weniger als {{count}} Minuten",
},
},
xMinutes: {
standalone: {
one: "1 Minute",
other: "{{count}} Minuten",
},
withPreposition: {
one: "1 Minute",
other: "{{count}} Minuten",
},
},
aboutXHours: {
standalone: {
one: "etwa 1 Stunde",
other: "etwa {{count}} Stunden",
},
withPreposition: {
one: "etwa 1 Stunde",
other: "etwa {{count}} Stunden",
},
},
xHours: {
standalone: {
one: "1 Stunde",
other: "{{count}} Stunden",
},
withPreposition: {
one: "1 Stunde",
other: "{{count}} Stunden",
},
},
xDays: {
standalone: {
one: "1 Tag",
other: "{{count}} Tage",
},
withPreposition: {
one: "1 Tag",
other: "{{count}} Tagen",
},
},
aboutXWeeks: {
standalone: {
one: "etwa 1 Woche",
other: "etwa {{count}} Wochen",
},
withPreposition: {
one: "etwa 1 Woche",
other: "etwa {{count}} Wochen",
},
},
xWeeks: {
standalone: {
one: "1 Woche",
other: "{{count}} Wochen",
},
withPreposition: {
one: "1 Woche",
other: "{{count}} Wochen",
},
},
aboutXMonths: {
standalone: {
one: "etwa 1 Monat",
other: "etwa {{count}} Monate",
},
withPreposition: {
one: "etwa 1 Monat",
other: "etwa {{count}} Monaten",
},
},
xMonths: {
standalone: {
one: "1 Monat",
other: "{{count}} Monate",
},
withPreposition: {
one: "1 Monat",
other: "{{count}} Monaten",
},
},
aboutXYears: {
standalone: {
one: "etwa 1 Jahr",
other: "etwa {{count}} Jahre",
},
withPreposition: {
one: "etwa 1 Jahr",
other: "etwa {{count}} Jahren",
},
},
xYears: {
standalone: {
one: "1 Jahr",
other: "{{count}} Jahre",
},
withPreposition: {
one: "1 Jahr",
other: "{{count}} Jahren",
},
},
overXYears: {
standalone: {
one: "mehr als 1 Jahr",
other: "mehr als {{count}} Jahre",
},
withPreposition: {
one: "mehr als 1 Jahr",
other: "mehr als {{count}} Jahren",
},
},
almostXYears: {
standalone: {
one: "fast 1 Jahr",
other: "fast {{count}} Jahre",
},
withPreposition: {
one: "fast 1 Jahr",
other: "fast {{count}} Jahren",
},
},
};
const formatDistance = (token, count, options) => {
let result;
const tokenValue = options?.addSuffix
? formatDistanceLocale[token].withPreposition
: formatDistanceLocale[token].standalone;
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 "in " + result;
} else {
return "vor " + result;
}
}
return result;
};
exports.formatDistance = formatDistance;

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../src/migrator.ts"],"sourcesContent":["import crypto from 'node:crypto';\nimport fs from 'node:fs';\n\nexport interface KitConfig {\n\tout: string;\n\tschema: string;\n}\n\nexport interface MigrationConfig {\n\tmigrationsFolder: string;\n\tmigrationsTable?: string;\n\tmigrationsSchema?: string;\n}\n\nexport interface MigrationMeta {\n\tsql: string[];\n\tfolderMillis: number;\n\thash: string;\n\tbps: boolean;\n}\n\nexport function readMigrationFiles(config: MigrationConfig): MigrationMeta[] {\n\tconst migrationFolderTo = config.migrationsFolder;\n\n\tconst migrationQueries: MigrationMeta[] = [];\n\n\tconst journalPath = `${migrationFolderTo}/meta/_journal.json`;\n\tif (!fs.existsSync(journalPath)) {\n\t\tthrow new Error(`Can't find meta/_journal.json file`);\n\t}\n\n\tconst journalAsString = fs.readFileSync(`${migrationFolderTo}/meta/_journal.json`).toString();\n\n\tconst journal = JSON.parse(journalAsString) as {\n\t\tentries: { idx: number; when: number; tag: string; breakpoints: boolean }[];\n\t};\n\n\tfor (const journalEntry of journal.entries) {\n\t\tconst migrationPath = `${migrationFolderTo}/${journalEntry.tag}.sql`;\n\n\t\ttry {\n\t\t\tconst query = fs.readFileSync(`${migrationFolderTo}/${journalEntry.tag}.sql`).toString();\n\n\t\t\tconst result = query.split('--> statement-breakpoint').map((it) => {\n\t\t\t\treturn it;\n\t\t\t});\n\n\t\t\tmigrationQueries.push({\n\t\t\t\tsql: result,\n\t\t\t\tbps: journalEntry.breakpoints,\n\t\t\t\tfolderMillis: journalEntry.when,\n\t\t\t\thash: crypto.createHash('sha256').update(query).digest('hex'),\n\t\t\t});\n\t\t} catch {\n\t\t\tthrow new Error(`No file ${migrationPath} found in ${migrationFolderTo} folder`);\n\t\t}\n\t}\n\n\treturn migrationQueries;\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,yBAAmB;AACnB,qBAAe;AAoBR,SAAS,mBAAmB,QAA0C;AAC5E,QAAM,oBAAoB,OAAO;AAEjC,QAAM,mBAAoC,CAAC;AAE3C,QAAM,cAAc,GAAG,iBAAiB;AACxC,MAAI,CAAC,eAAAA,QAAG,WAAW,WAAW,GAAG;AAChC,UAAM,IAAI,MAAM,oCAAoC;AAAA,EACrD;AAEA,QAAM,kBAAkB,eAAAA,QAAG,aAAa,GAAG,iBAAiB,qBAAqB,EAAE,SAAS;AAE5F,QAAM,UAAU,KAAK,MAAM,eAAe;AAI1C,aAAW,gBAAgB,QAAQ,SAAS;AAC3C,UAAM,gBAAgB,GAAG,iBAAiB,IAAI,aAAa,GAAG;AAE9D,QAAI;AACH,YAAM,QAAQ,eAAAA,QAAG,aAAa,GAAG,iBAAiB,IAAI,aAAa,GAAG,MAAM,EAAE,SAAS;AAEvF,YAAM,SAAS,MAAM,MAAM,0BAA0B,EAAE,IAAI,CAAC,OAAO;AAClE,eAAO;AAAA,MACR,CAAC;AAED,uBAAiB,KAAK;AAAA,QACrB,KAAK;AAAA,QACL,KAAK,aAAa;AAAA,QAClB,cAAc,aAAa;AAAA,QAC3B,MAAM,mBAAAC,QAAO,WAAW,QAAQ,EAAE,OAAO,KAAK,EAAE,OAAO,KAAK;AAAA,MAC7D,CAAC;AAAA,IACF,QAAQ;AACP,YAAM,IAAI,MAAM,WAAW,aAAa,aAAa,iBAAiB,SAAS;AAAA,IAChF;AAAA,EACD;AAEA,SAAO;AACR;","names":["fs","crypto"]}

View File

@@ -0,0 +1,40 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
export function urlMatches(url, urlToMatch) {
if (typeof urlToMatch === 'string') {
return url === urlToMatch;
}
else {
return !!url.match(urlToMatch);
}
}
/**
* Check if {@param url} should be ignored when comparing against {@param ignoredUrls}
* @param url
* @param ignoredUrls
*/
export function isUrlIgnored(url, ignoredUrls) {
if (!ignoredUrls) {
return false;
}
for (const ignoreUrl of ignoredUrls) {
if (urlMatches(url, ignoreUrl)) {
return true;
}
}
return false;
}
//# sourceMappingURL=url.js.map

View File

@@ -0,0 +1,26 @@
import type { ColumnBuilderBaseConfig } from "../../column-builder.cjs";
import type { ColumnBaseConfig } from "../../column.cjs";
import { entityKind } from "../../entity.cjs";
import { GelColumn, GelColumnBuilder } from "./common.cjs";
type GelTextBuilderInitial<TName extends string> = GelTextBuilder<{
name: TName;
dataType: 'string';
columnType: 'GelText';
data: string;
driverParam: string;
enumValues: undefined;
}>;
export declare class GelTextBuilder<T extends ColumnBuilderBaseConfig<'string', 'GelText'>> extends GelColumnBuilder<T> {
static readonly [entityKind]: string;
constructor(name: T['name']);
}
export declare class GelText<T extends ColumnBaseConfig<'string', 'GelText'>> extends GelColumn<T, {
enumValues: T['enumValues'];
}> {
static readonly [entityKind]: string;
readonly enumValues: T["enumValues"];
getSQLType(): string;
}
export declare function text(): GelTextBuilderInitial<''>;
export declare function text<TName extends string>(name: TName): GelTextBuilderInitial<TName>;
export {};

View File

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

View File

@@ -0,0 +1,534 @@
import { Linter } from "../index";
export interface ECMAScript6 extends Linter.RulesRecord {
/**
* Rule to require braces around arrow function bodies.
*
* @since 1.8.0
* @see https://eslint.org/docs/rules/arrow-body-style
*/
"arrow-body-style":
| Linter.RuleEntry<
[
"as-needed",
Partial<{
/**
* @default false
*/
requireReturnForObjectLiteral: boolean;
}>,
]
>
| Linter.RuleEntry<["always" | "never"]>;
/**
* Rule to require parentheses around arrow function arguments.
*
* @since 1.0.0-rc-1
* @see https://eslint.org/docs/rules/arrow-parens
*/
"arrow-parens":
| Linter.RuleEntry<["always"]>
| Linter.RuleEntry<
[
"as-needed",
Partial<{
/**
* @default false
*/
requireForBlockBody: boolean;
}>,
]
>;
/**
* Rule to enforce consistent spacing before and after the arrow in arrow functions.
*
* @since 1.0.0-rc-1
* @see https://eslint.org/docs/rules/arrow-spacing
*/
"arrow-spacing": Linter.RuleEntry<[]>;
/**
* Rule to require `super()` calls in constructors.
*
* @remarks
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
*
* @since 0.24.0
* @see https://eslint.org/docs/rules/constructor-super
*/
"constructor-super": Linter.RuleEntry<[]>;
/**
* Rule to enforce consistent spacing around `*` operators in generator functions.
*
* @since 0.17.0
* @see https://eslint.org/docs/rules/generator-star-spacing
*/
"generator-star-spacing": Linter.RuleEntry<
[
| Partial<{
before: boolean;
after: boolean;
named:
| Partial<{
before: boolean;
after: boolean;
}>
| "before"
| "after"
| "both"
| "neither";
anonymous:
| Partial<{
before: boolean;
after: boolean;
}>
| "before"
| "after"
| "both"
| "neither";
method:
| Partial<{
before: boolean;
after: boolean;
}>
| "before"
| "after"
| "both"
| "neither";
}>
| "before"
| "after"
| "both"
| "neither",
]
>;
/**
* Require or disallow logical assignment operator shorthand.
*
* @since 8.24.0
* @see https://eslint.org/docs/rules/logical-assignment-operators
*/
"logical-assignment-operators":
| Linter.RuleEntry<
[
"always",
Partial<{
/**
* @default false
*/
enforceForIfStatements: boolean;
}>,
]
>
| Linter.RuleEntry<["never"]>;
/**
* Rule to disallow reassigning class members.
*
* @remarks
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
*
* @since 1.0.0-rc-1
* @see https://eslint.org/docs/rules/no-class-assign
*/
"no-class-assign": Linter.RuleEntry<[]>;
/**
* Rule to disallow arrow functions where they could be confused with comparisons.
*
* @since 2.0.0-alpha-2
* @see https://eslint.org/docs/rules/no-confusing-arrow
*/
"no-confusing-arrow": Linter.RuleEntry<
[
Partial<{
/**
* @default true
*/
allowParens: boolean;
}>,
]
>;
/**
* Rule to disallow reassigning `const` variables.
*
* @remarks
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
*
* @since 1.0.0-rc-1
* @see https://eslint.org/docs/rules/no-const-assign
*/
"no-const-assign": Linter.RuleEntry<[]>;
/**
* Rule to disallow duplicate class members.
*
* @remarks
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
*
* @since 1.2.0
* @see https://eslint.org/docs/rules/no-dupe-class-members
*/
"no-dupe-class-members": Linter.RuleEntry<[]>;
/**
* Rule to disallow duplicate module imports.
*
* @since 2.5.0
* @see https://eslint.org/docs/rules/no-duplicate-imports
*/
"no-duplicate-imports": Linter.RuleEntry<
[
Partial<{
/**
* @default false
*/
includeExports: boolean;
}>,
]
>;
/**
* Rule to disallow `new` operators with the `Symbol` object.
*
* @remarks
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
*
* @since 2.0.0-beta.1
* @see https://eslint.org/docs/rules/no-new-symbol
*/
"no-new-symbol": Linter.RuleEntry<[]>;
/**
* Rule to disallow specified modules when loaded by `import`.
*
* @since 2.0.0-alpha-1
* @see https://eslint.org/docs/rules/no-restricted-imports
*/
"no-restricted-imports": Linter.RuleEntry<
[
...Array<
| string
| {
name: string;
importNames?: string[] | undefined;
message?: string | undefined;
}
| Partial<{
paths: Array<
| string
| {
name: string;
importNames?: string[] | undefined;
message?: string | undefined;
}
>;
patterns: string[];
}>
>,
]
>;
/**
* Rule to disallow `this`/`super` before calling `super()` in constructors.
*
* @remarks
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
*
* @since 0.24.0
* @see https://eslint.org/docs/rules/no-this-before-super
*/
"no-this-before-super": Linter.RuleEntry<[]>;
/**
* Rule to disallow unnecessary computed property keys in object literals.
*
* @since 2.9.0
* @see https://eslint.org/docs/rules/no-useless-computed-key
*/
"no-useless-computed-key": Linter.RuleEntry<[]>;
/**
* Rule to disallow unnecessary constructors.
*
* @since 2.0.0-beta.1
* @see https://eslint.org/docs/rules/no-useless-constructor
*/
"no-useless-constructor": Linter.RuleEntry<[]>;
/**
* Rule to disallow renaming import, export, and destructured assignments to the same name.
*
* @since 2.11.0
* @see https://eslint.org/docs/rules/no-useless-rename
*/
"no-useless-rename": Linter.RuleEntry<
[
Partial<{
/**
* @default false
*/
ignoreImport: boolean;
/**
* @default false
*/
ignoreExport: boolean;
/**
* @default false
*/
ignoreDestructuring: boolean;
}>,
]
>;
/**
* Rule to require `let` or `const` instead of `var`.
*
* @since 0.12.0
* @see https://eslint.org/docs/rules/no-var
*/
"no-var": Linter.RuleEntry<[]>;
/**
* Rule to require or disallow method and property shorthand syntax for object literals.
*
* @since 0.20.0
* @see https://eslint.org/docs/rules/object-shorthand
*/
"object-shorthand":
| Linter.RuleEntry<
[
"always" | "methods",
Partial<{
/**
* @default false
*/
avoidQuotes: boolean;
/**
* @default false
*/
ignoreConstructors: boolean;
/**
* @default false
*/
avoidExplicitReturnArrows: boolean;
}>,
]
>
| Linter.RuleEntry<
[
"properties",
Partial<{
/**
* @default false
*/
avoidQuotes: boolean;
}>,
]
>
| Linter.RuleEntry<["never" | "consistent" | "consistent-as-needed"]>;
/**
* Rule to require using arrow functions for callbacks.
*
* @since 1.2.0
* @see https://eslint.org/docs/rules/prefer-arrow-callback
*/
"prefer-arrow-callback": Linter.RuleEntry<
[
Partial<{
/**
* @default false
*/
allowNamedFunctions: boolean;
/**
* @default true
*/
allowUnboundThis: boolean;
}>,
]
>;
/**
* Rule to require `const` declarations for variables that are never reassigned after declared.
*
* @since 0.23.0
* @see https://eslint.org/docs/rules/prefer-const
*/
"prefer-const": Linter.RuleEntry<
[
Partial<{
/**
* @default 'any'
*/
destructuring: "any" | "all";
/**
* @default false
*/
ignoreReadBeforeAssign: boolean;
}>,
]
>;
/**
* Rule to require destructuring from arrays and/or objects.
*
* @since 3.13.0
* @see https://eslint.org/docs/rules/prefer-destructuring
*/
"prefer-destructuring": Linter.RuleEntry<
[
Partial<
| {
VariableDeclarator: Partial<{
array: boolean;
object: boolean;
}>;
AssignmentExpression: Partial<{
array: boolean;
object: boolean;
}>;
}
| {
array: boolean;
object: boolean;
}
>,
Partial<{
enforceForRenamedProperties: boolean;
}>,
]
>;
/**
* Disallow the use of `Math.pow` in favor of the `**` operator.
*
* @since 6.7.0
* @see https://eslint.org/docs/latest/rules/prefer-exponentiation-operator
*/
"prefer-exponentiation-operator": Linter.RuleEntry<[]>;
/**
* Rule to disallow `parseInt()` and `Number.parseInt()` in favor of binary, octal, and hexadecimal literals.
*
* @since 3.5.0
* @see https://eslint.org/docs/rules/prefer-numeric-literals
*/
"prefer-numeric-literals": Linter.RuleEntry<[]>;
/**
* Rule to require rest parameters instead of `arguments`.
*
* @since 2.0.0-alpha-1
* @see https://eslint.org/docs/rules/prefer-rest-params
*/
"prefer-rest-params": Linter.RuleEntry<[]>;
/**
* Rule to require spread operators instead of `.apply()`.
*
* @since 1.0.0-rc-1
* @see https://eslint.org/docs/rules/prefer-spread
*/
"prefer-spread": Linter.RuleEntry<[]>;
/**
* Rule to require template literals instead of string concatenation.
*
* @since 1.2.0
* @see https://eslint.org/docs/rules/prefer-template
*/
"prefer-template": Linter.RuleEntry<[]>;
/**
* Rule to require generator functions to contain `yield`.
*
* @remarks
* Recommended by ESLint, the rule was enabled in `eslint:recommended`.
*
* @since 1.0.0-rc-1
* @see https://eslint.org/docs/rules/require-yield
*/
"require-yield": Linter.RuleEntry<[]>;
/**
* Rule to enforce spacing between rest and spread operators and their expressions.
*
* @since 2.12.0
* @see https://eslint.org/docs/rules/rest-spread-spacing
*/
"rest-spread-spacing": Linter.RuleEntry<["never" | "always"]>;
/**
* Rule to enforce sorted import declarations within modules.
*
* @since 2.0.0-beta.1
* @see https://eslint.org/docs/rules/sort-imports
*/
"sort-imports": Linter.RuleEntry<
[
Partial<{
/**
* @default false
*/
ignoreCase: boolean;
/**
* @default false
*/
ignoreDeclarationSort: boolean;
/**
* @default false
*/
ignoreMemberSort: boolean;
/**
* @default ['none', 'all', 'multiple', 'single']
*/
memberSyntaxSortOrder: Array<"none" | "all" | "multiple" | "single">;
/**
* @default false
*/
allowSeparatedGroups: boolean;
}>,
]
>;
/**
* Rule to require symbol descriptions.
*
* @since 3.4.0
* @see https://eslint.org/docs/rules/symbol-description
*/
"symbol-description": Linter.RuleEntry<[]>;
/**
* Rule to require or disallow spacing around embedded expressions of template strings.
*
* @since 2.0.0-rc.0
* @see https://eslint.org/docs/rules/template-curly-spacing
*/
"template-curly-spacing": Linter.RuleEntry<["never" | "always"]>;
/**
* Rule to require or disallow spacing around the `*` in `yield*` expressions.
*
* @since 2.0.0-alpha-1
* @see https://eslint.org/docs/rules/yield-star-spacing
*/
"yield-star-spacing": Linter.RuleEntry<
[
| Partial<{
before: boolean;
after: boolean;
}>
| "before"
| "after"
| "both"
| "neither",
]
>;
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"instrumentation.d.ts","sourceRoot":"","sources":["../../../../../src/integrations/tracing/vercelai/instrumentation.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,qBAAqB,EAAE,+BAA+B,EAAE,MAAM,gCAAgC,CAAC;AAC7G,OAAO,EAAE,mBAAmB,EAAuC,MAAM,gCAAgC,CAAC;AAuC1G,UAAU,gBAAgB;IACxB,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,aAAa,CAAC,EAAE,OAAO,CAAC;CACzB;AA8FD;;;;;;;;GAQG;AACH,wBAAgB,0BAA0B,CACxC,2BAA2B,EAAE,gBAAgB,GAAG,SAAS,EACzD,sBAAsB,EAAE,gBAAgB,EACxC,0BAA0B,EAAE,OAAO,GAAG,SAAS,EAC/C,uBAAuB,EAAE,OAAO,GAC/B;IAAE,YAAY,EAAE,OAAO,CAAC;IAAC,aAAa,EAAE,OAAO,CAAA;CAAE,CAoBnD;AAED;;;;;GAKG;AACH,qBAAa,6BAA8B,SAAQ,mBAAmB;IACpE,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,UAAU,CAAsB;gBAErB,MAAM,GAAE,qBAA0B;IAIrD;;OAEG;IACI,IAAI,IAAI,+BAA+B;IAK9C;;;OAGG;IACI,eAAe,CAAC,QAAQ,EAAE,MAAM,IAAI,GAAG,IAAI;IAQlD;;OAEG;IACH,OAAO,CAAC,MAAM;CA6Ef"}

View File

@@ -0,0 +1,21 @@
export const createUploadTimer = (timeout = 0, callback = ()=>{})=>{
let timer = null;
const clear = ()=>{
clearTimeout(timer);
};
const set = ()=>{
// Do not start a timer if zero timeout or it hasn't been set.
if (!timeout) {
return false;
}
clear();
timer = setTimeout(callback, timeout);
return true;
};
return {
clear,
set
};
};
//# sourceMappingURL=uploadTimer.js.map

View File

@@ -0,0 +1,41 @@
import * as core from "../core/index.js";
import { $ZodError } from "../core/index.js";
const initializer = (inst, issues) => {
$ZodError.init(inst, issues);
inst.name = "ZodError";
Object.defineProperties(inst, {
format: {
value: (mapper) => core.formatError(inst, mapper),
// enumerable: false,
},
flatten: {
value: (mapper) => core.flattenError(inst, mapper),
// enumerable: false,
},
addIssue: {
value: (issue) => inst.issues.push(issue),
// enumerable: false,
},
addIssues: {
value: (issues) => inst.issues.push(...issues),
// enumerable: false,
},
isEmpty: {
get() {
return inst.issues.length === 0;
},
// enumerable: false,
},
});
// Object.defineProperty(inst, "isEmpty", {
// get() {
// return inst.issues.length === 0;
// },
// });
};
export const ZodError = core.$constructor("ZodError", initializer);
export const ZodRealError = core.$constructor("ZodError", initializer, {
Parent: Error,
});
// /** @deprecated Use `z.core.$ZodErrorMapCtx` instead. */
// export type ErrorMapCtx = core.$ZodErrorMapCtx;

View File

@@ -0,0 +1,39 @@
@import '../../scss/styles.scss';
@layer payload-default {
.preview-btn {
background: none;
border: none;
border: 1px solid;
border-color: var(--theme-elevation-100);
border-radius: var(--style-radius-s);
line-height: var(--btn-line-height);
font-size: var(--base-body-size);
padding: calc(var(--base) * 0.2) calc(var(--base) * 0.4);
cursor: pointer;
transition-property: border, color, background;
transition-duration: 100ms;
transition-timing-function: cubic-bezier(0, 0.2, 0.2, 1);
height: calc(var(--base) * 1.6);
width: calc(var(--base) * 1.6);
position: relative;
.icon {
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
.stroke {
transition-property: stroke;
transition-duration: 100ms;
transition-timing-function: cubic-bezier(0, 0.2, 0.2, 1);
}
}
&:hover {
border-color: var(--theme-elevation-300);
background-color: var(--theme-elevation-100);
}
}
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"realPath.d.ts","sourceRoot":"","sources":["../../../src/utilities/dependencies/realPath.ts"],"names":[],"mappings":"AAeA,OAAO,EAAE,MAAM,IAAI,CAAA;AAQnB,eAAO,MAAM,YAAY,+BAAuD,CAAA"}

View File

@@ -0,0 +1,12 @@
import type { VersionField } from 'payload';
import './index.scss';
import React from 'react';
export declare const RenderVersionFieldsToDiff: ({ parent, versionFields, }: {
/**
* If true, this is the parent render version fields component, not one nested in
* a field with children (e.g. group)
*/
parent?: boolean;
versionFields: VersionField[];
}) => React.ReactNode;
//# sourceMappingURL=RenderVersionFieldsToDiff.d.ts.map

View File

@@ -0,0 +1,5 @@
export declare const isSameISOWeekYear: import("./types.js").FPFn2<
boolean,
string | number | Date,
string | number | Date
>;

View File

@@ -0,0 +1,33 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var migrator_exports = {};
__export(migrator_exports, {
migrate: () => migrate
});
module.exports = __toCommonJS(migrator_exports);
var import_migrator = require("../../migrator.cjs");
async function migrate(db, config) {
const migrations = (0, import_migrator.readMigrationFiles)(config);
await db.dialect.migrate(migrations, db.session, config);
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
migrate
});
//# sourceMappingURL=migrator.cjs.map

View File

@@ -0,0 +1,58 @@
import type { LoadState, Metric } from './base';
/**
* A CLS-specific version of the Metric object.
*/
export interface CLSMetric extends Metric {
name: 'CLS';
entries: LayoutShift[];
}
/**
* An object containing potentially-helpful debugging information that
* can be sent along with the CLS value for the current page visit in order
* to help identify issues happening to real-users in the field.
*/
export interface CLSAttribution {
/**
* By default, a selector identifying the first element (in document order)
* that shifted when the single largest layout shift that contributed to the
* page's CLS score occurred. If the `generateTarget` configuration option
* was passed, then this will instead be the return value of that function,
* falling back to the default if that returns null or undefined.
*/
largestShiftTarget?: string;
/**
* The time when the single largest layout shift contributing to the page's
* CLS score occurred.
*/
largestShiftTime?: DOMHighResTimeStamp;
/**
* The layout shift score of the single largest layout shift contributing to
* the page's CLS score.
*/
largestShiftValue?: number;
/**
* The `LayoutShiftEntry` representing the single largest layout shift
* contributing to the page's CLS score. (Useful when you need more than just
* `largestShiftTarget`, `largestShiftTime`, and `largestShiftValue`).
*/
largestShiftEntry?: LayoutShift;
/**
* The first element source (in document order) among the `sources` list
* of the `largestShiftEntry` object. (Also useful when you need more than
* just `largestShiftTarget`, `largestShiftTime`, and `largestShiftValue`).
*/
largestShiftSource?: LayoutShiftAttribution;
/**
* The loading state of the document at the time when the largest layout
* shift contribution to the page's CLS score occurred (see `LoadState`
* for details).
*/
loadState?: LoadState;
}
/**
* A CLS-specific version of the Metric object with attribution.
*/
export interface CLSMetricWithAttribution extends CLSMetric {
attribution: CLSAttribution;
}
//# sourceMappingURL=cls.d.ts.map

View File

@@ -0,0 +1,6 @@
import type { ASTNode } from './ast';
/**
* Converts an AST into a string, using one set of reasonable
* formatting rules.
*/
export declare function print(ast: ASTNode): string;

View File

@@ -0,0 +1 @@
export declare function useScrollIntoViewIfNeeded(element: HTMLElement | null | undefined): void;

View File

@@ -0,0 +1,11 @@
export declare const AttributeNames: {
readonly HONO_TYPE: "hono.type";
readonly HONO_NAME: "hono.name";
};
export type AttributeNames = (typeof AttributeNames)[keyof typeof AttributeNames];
export declare const HonoTypes: {
readonly MIDDLEWARE: "middleware";
readonly REQUEST_HANDLER: "request_handler";
};
export type HonoTypes = (typeof HonoTypes)[keyof typeof HonoTypes];
//# sourceMappingURL=constants.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"send-horizonal.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"globalThis.js","sourceRoot":"","sources":["../../../../src/platform/browser/globalThis.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,2EAA2E;AAC3E,2BAA2B;AAE3B;;;;;;GAMG;AAEH,gEAAgE;AAChE,2EAA2E;AAC3E,MAAM,CAAC,MAAM,WAAW,GACtB,OAAO,UAAU,KAAK,QAAQ;IAC5B,CAAC,CAAC,UAAU;IACZ,CAAC,CAAC,OAAO,IAAI,KAAK,QAAQ;QACxB,CAAC,CAAC,IAAI;QACN,CAAC,CAAC,OAAO,MAAM,KAAK,QAAQ;YAC1B,CAAC,CAAC,MAAM;YACR,CAAC,CAAC,OAAO,MAAM,KAAK,QAAQ;gBAC1B,CAAC,CAAE,MAAuC;gBAC1C,CAAC,CAAE,EAAwB,CAAC","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\n// Updates to this file should also be replicated to @opentelemetry/api and\n// @opentelemetry/core too.\n\n/**\n * - globalThis (New standard)\n * - self (Will return the current window instance for supported browsers)\n * - window (fallback for older browser implementations)\n * - global (NodeJS implementation)\n * - <object> (When all else fails)\n */\n\n/** only globals that common to node and browsers are allowed */\n// eslint-disable-next-line n/no-unsupported-features/es-builtins, no-undef\nexport const _globalThis: typeof globalThis =\n typeof globalThis === 'object'\n ? globalThis\n : typeof self === 'object'\n ? self\n : typeof window === 'object'\n ? window\n : typeof global === 'object'\n ? (global as unknown as typeof globalThis)\n : ({} as typeof globalThis);\n"]}

View File

@@ -0,0 +1,23 @@
import { DirectusComment } from "../../../schema/comment.cjs";
import { Query } from "../../../types/query.cjs";
import { RestCommand } from "../../types.cjs";
//#region src/rest/commands/delete/comments.d.ts
/**
* Delete multiple existing comments.
* @param keysOrQuery The primary keys or a query
* @returns
* @throws Will throw if keys is empty
*/
declare const deleteComments: <Schema>(keysOrQuery: DirectusComment<Schema>["id"][] | Query<Schema, DirectusComment<Schema>>) => RestCommand<void, Schema>;
/**
* Delete an existing comment.
* @param key
* @returns
* @throws Will throw if key is empty
*/
declare const deleteComment: <Schema>(key: DirectusComment<Schema>["id"]) => RestCommand<void, Schema>;
//#endregion
export { deleteComment, deleteComments };
//# sourceMappingURL=comments.d.cts.map

View File

@@ -0,0 +1 @@
export type StrictExtract<Type, Union extends Partial<Type>> = Extract<Type, Union>;

View File

@@ -0,0 +1,29 @@
import { DirectusShare } from "../../../schema/share.cjs";
import { NestedPartial } from "../../../types/utils.cjs";
import { ApplyQueryFields } from "../../../types/output.cjs";
import { Query } from "../../../types/query.cjs";
import { RestCommand } from "../../types.cjs";
//#region src/rest/commands/create/shares.d.ts
type CreateShareOutput<Schema, TQuery extends Query<Schema, Item>, Item extends object = DirectusShare<Schema>> = ApplyQueryFields<Schema, Item, TQuery['fields']>;
/**
* Create multiple new shares.
*
* @param items The shares to create
* @param query Optional return data query
*
* @returns Returns the share objects for the created shares.
*/
declare const createShares: <Schema, const TQuery extends Query<Schema, DirectusShare<Schema>>>(items: NestedPartial<DirectusShare<Schema>>[], query?: TQuery) => RestCommand<CreateShareOutput<Schema, TQuery>[], Schema>;
/**
* Create a new share.
*
* @param item The share to create
* @param query Optional return data query
*
* @returns Returns the share object for the created share.
*/
declare const createShare: <Schema, const TQuery extends Query<Schema, DirectusShare<Schema>>>(item: NestedPartial<DirectusShare<Schema>>, query?: TQuery) => RestCommand<CreateShareOutput<Schema, TQuery>, Schema>;
//#endregion
export { CreateShareOutput, createShare, createShares };
//# sourceMappingURL=shares.d.cts.map

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A B zC"},B:{"1":"0 1 2 3 4 5 6 7 8 C L M G N O P 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:{"1":"0 1 2 3 4 5 6 7 8 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 XB YB ZB aB I ZC aC OC 1C 2C 3C","2":"9 0C VC J bB K D E F A B C L M G N O P cB AB BB CB DB 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 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 KB LB MB NB OB PB QB RB SB TB UB VB WB XB YB ZB aB I ZC aC OC","2":"J bB K D E F A B C L","33":"9 M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB"},E:{"1":"G 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 6C bC 7C","33":"K D E F A B C L M 8C 9C AD cC PC QC BD"},F:{"1":"0 1 2 3 4 5 6 7 8 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 w x y z","2":"F B C JD KD LD MD PC xC ND QC","33":"9 G N O P cB AB"},G:{"1":"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","33":"E QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD fD"},H:{"2":"mD"},I:{"1":"I","2":"VC J nD oD pD qD yC rD sD"},J:{"2":"D A"},K:{"1":"H","2":"A B C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"2":"A B"},O:{"1":"RC"},P:{"1":"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:{"1":"4D"},R:{"1":"5D"},S:{"1":"6D 7D"}},B:2,C:"Web Audio API",D:true};

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAEH,qDAA2D;AAAlD,yHAAA,sBAAsB,OAAA;AAC/B,iCAA6C;AAApC,2GAAA,kBAAkB,OAAA","sourcesContent":["/*\n * Copyright The OpenTelemetry Authors\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * https://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nexport { MongoDBInstrumentation } from './instrumentation';\nexport { MongodbCommandType } from './types';\nexport type {\n CommandResult,\n DbStatementSerializer,\n MongoDBInstrumentationConfig,\n MongoDBInstrumentationExecutionResponseHook,\n MongoResponseHookInformation,\n} from './types';\n"]}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/singlestore-core/columns/float.ts"],"sourcesContent":["import type { ColumnBuilderBaseConfig, ColumnBuilderRuntimeConfig, MakeColumnConfig } from '~/column-builder.ts';\nimport type { ColumnBaseConfig } from '~/column.ts';\nimport { entityKind } from '~/entity.ts';\nimport type { AnySingleStoreTable } from '~/singlestore-core/table.ts';\nimport { getColumnNameAndConfig } from '~/utils.ts';\nimport { SingleStoreColumnBuilderWithAutoIncrement, SingleStoreColumnWithAutoIncrement } from './common.ts';\n\nexport type SingleStoreFloatBuilderInitial<TName extends string> = SingleStoreFloatBuilder<{\n\tname: TName;\n\tdataType: 'number';\n\tcolumnType: 'SingleStoreFloat';\n\tdata: number;\n\tdriverParam: number | string;\n\tenumValues: undefined;\n\tgenerated: undefined;\n}>;\n\nexport class SingleStoreFloatBuilder<T extends ColumnBuilderBaseConfig<'number', 'SingleStoreFloat'>>\n\textends SingleStoreColumnBuilderWithAutoIncrement<T, SingleStoreFloatConfig>\n{\n\tstatic override readonly [entityKind]: string = 'SingleStoreFloatBuilder';\n\n\tconstructor(name: T['name'], config: SingleStoreFloatConfig | undefined) {\n\t\tsuper(name, 'number', 'SingleStoreFloat');\n\t\tthis.config.precision = config?.precision;\n\t\tthis.config.scale = config?.scale;\n\t\tthis.config.unsigned = config?.unsigned;\n\t}\n\n\t/** @internal */\n\toverride build<TTableName extends string>(\n\t\ttable: AnySingleStoreTable<{ name: TTableName }>,\n\t): SingleStoreFloat<MakeColumnConfig<T, TTableName>> {\n\t\treturn new SingleStoreFloat<MakeColumnConfig<T, TTableName>>(\n\t\t\ttable,\n\t\t\tthis.config as ColumnBuilderRuntimeConfig<any, any>,\n\t\t);\n\t}\n}\n\nexport class SingleStoreFloat<T extends ColumnBaseConfig<'number', 'SingleStoreFloat'>>\n\textends SingleStoreColumnWithAutoIncrement<T, SingleStoreFloatConfig>\n{\n\tstatic override readonly [entityKind]: string = 'SingleStoreFloat';\n\n\treadonly precision: number | undefined = this.config.precision;\n\treadonly scale: number | undefined = this.config.scale;\n\treadonly unsigned: boolean | undefined = this.config.unsigned;\n\n\tgetSQLType(): string {\n\t\tlet type = '';\n\t\tif (this.precision !== undefined && this.scale !== undefined) {\n\t\t\ttype += `float(${this.precision},${this.scale})`;\n\t\t} else if (this.precision === undefined) {\n\t\t\ttype += 'float';\n\t\t} else {\n\t\t\ttype += `float(${this.precision},0)`;\n\t\t}\n\t\treturn this.unsigned ? `${type} unsigned` : type;\n\t}\n}\n\nexport interface SingleStoreFloatConfig {\n\tprecision?: number;\n\tscale?: number;\n\tunsigned?: boolean;\n}\n\nexport function float(): SingleStoreFloatBuilderInitial<''>;\nexport function float(\n\tconfig?: SingleStoreFloatConfig,\n): SingleStoreFloatBuilderInitial<''>;\nexport function float<TName extends string>(\n\tname: TName,\n\tconfig?: SingleStoreFloatConfig,\n): SingleStoreFloatBuilderInitial<TName>;\nexport function float(a?: string | SingleStoreFloatConfig, b?: SingleStoreFloatConfig) {\n\tconst { name, config } = getColumnNameAndConfig<SingleStoreFloatConfig>(a, b);\n\treturn new SingleStoreFloatBuilder(name, config);\n}\n"],"mappings":"AAEA,SAAS,kBAAkB;AAE3B,SAAS,8BAA8B;AACvC,SAAS,2CAA2C,0CAA0C;AAYvF,MAAM,gCACJ,0CACT;AAAA,EACC,QAA0B,UAAU,IAAY;AAAA,EAEhD,YAAY,MAAiB,QAA4C;AACxE,UAAM,MAAM,UAAU,kBAAkB;AACxC,SAAK,OAAO,YAAY,QAAQ;AAChC,SAAK,OAAO,QAAQ,QAAQ;AAC5B,SAAK,OAAO,WAAW,QAAQ;AAAA,EAChC;AAAA;AAAA,EAGS,MACR,OACoD;AACpD,WAAO,IAAI;AAAA,MACV;AAAA,MACA,KAAK;AAAA,IACN;AAAA,EACD;AACD;AAEO,MAAM,yBACJ,mCACT;AAAA,EACC,QAA0B,UAAU,IAAY;AAAA,EAEvC,YAAgC,KAAK,OAAO;AAAA,EAC5C,QAA4B,KAAK,OAAO;AAAA,EACxC,WAAgC,KAAK,OAAO;AAAA,EAErD,aAAqB;AACpB,QAAI,OAAO;AACX,QAAI,KAAK,cAAc,UAAa,KAAK,UAAU,QAAW;AAC7D,cAAQ,SAAS,KAAK,SAAS,IAAI,KAAK,KAAK;AAAA,IAC9C,WAAW,KAAK,cAAc,QAAW;AACxC,cAAQ;AAAA,IACT,OAAO;AACN,cAAQ,SAAS,KAAK,SAAS;AAAA,IAChC;AACA,WAAO,KAAK,WAAW,GAAG,IAAI,cAAc;AAAA,EAC7C;AACD;AAgBO,SAAS,MAAM,GAAqC,GAA4B;AACtF,QAAM,EAAE,MAAM,OAAO,IAAI,uBAA+C,GAAG,CAAC;AAC5E,SAAO,IAAI,wBAAwB,MAAM,MAAM;AAChD;","names":[]}

View File

@@ -0,0 +1,12 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = _classExtractFieldDescriptor;
var _classPrivateFieldGet = require("classPrivateFieldGet2");
function _classExtractFieldDescriptor(receiver, privateMap) {
return _classPrivateFieldGet(privateMap, receiver);
}
//# sourceMappingURL=classExtractFieldDescriptor.js.map

View File

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

View File

@@ -0,0 +1,36 @@
"use strict";
exports.startOfYear = startOfYear;
var _index = require("./toDate.cjs");
/**
* The {@link startOfYear} function options.
*/
/**
* @name startOfYear
* @category Year Helpers
* @summary Return the start of a year for the given date.
*
* @description
* Return the start 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 - The options
*
* @returns The start of a year
*
* @example
* // The start of a year for 2 September 2014 11:55:00:
* const result = startOfYear(new Date(2014, 8, 2, 11, 55, 00))
* //=> Wed Jan 01 2014 00:00:00
*/
function startOfYear(date, options) {
const date_ = (0, _index.toDate)(date, options?.in);
date_.setFullYear(date_.getFullYear(), 0, 1);
date_.setHours(0, 0, 0, 0);
return date_;
}

View File

@@ -0,0 +1,65 @@
import { toDate } from "./toDate.mjs";
/**
* The {@link eachMonthOfInterval} function options.
*/
/**
* @name eachMonthOfInterval
* @category Interval Helpers
* @summary Return the array of months within the specified time interval.
*
* @description
* Return the array of months within the specified time interval.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param interval - The interval
*
* @returns The array with starts of months from the month of the interval start to the month of the interval end
*
* @example
* // Each month between 6 February 2014 and 10 August 2014:
* const result = eachMonthOfInterval({
* start: new Date(2014, 1, 6),
* end: new Date(2014, 7, 10)
* })
* //=> [
* // Sat Feb 01 2014 00:00:00,
* // Sat Mar 01 2014 00:00:00,
* // Tue Apr 01 2014 00:00:00,
* // Thu May 01 2014 00:00:00,
* // Sun Jun 01 2014 00:00:00,
* // Tue Jul 01 2014 00:00:00,
* // Fri Aug 01 2014 00:00:00
* // ]
*/
export function eachMonthOfInterval(interval, options) {
const startDate = toDate(interval.start);
const endDate = toDate(interval.end);
let reversed = +startDate > +endDate;
const endTime = reversed ? +startDate : +endDate;
const currentDate = reversed ? endDate : startDate;
currentDate.setHours(0, 0, 0, 0);
currentDate.setDate(1);
let step = options?.step ?? 1;
if (!step) return [];
if (step < 0) {
step = -step;
reversed = !reversed;
}
const dates = [];
while (+currentDate <= endTime) {
dates.push(toDate(currentDate));
currentDate.setMonth(currentDate.getMonth() + step);
}
return reversed ? dates.reverse() : dates;
}
// Fallback for modularized imports:
export default eachMonthOfInterval;

View File

@@ -0,0 +1 @@
{"version":3,"file":"getDependencies.d.ts","sourceRoot":"","sources":["../../../src/utilities/dependencies/getDependencies.ts"],"names":[],"mappings":"AA8BA,MAAM,MAAM,qBAAqB,GAAG;IAClC,OAAO,EAAE,MAAM,EAAE,CAAA;IACjB,QAAQ,EAAE,GAAG,CACX,MAAM,EACN;QACE,IAAI,EAAE,MAAM,CAAA;QACZ,OAAO,EAAE,MAAM,CAAA;KAChB,CACF,CAAA;CACF,CAAA;AAED,wBAAsB,eAAe,CACnC,OAAO,EAAE,MAAM,EACf,gBAAgB,EAAE,MAAM,EAAE,GACzB,OAAO,CAAC,qBAAqB,CAAC,CA0DhC"}

View File

@@ -0,0 +1,129 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.js";
const eraValues = {
narrow: ["f.Kr.", "e.Kr."],
abbreviated: ["f.Kr.", "e.Kr."],
wide: ["før Kristus", "etter Kristus"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1. kvartal", "2. kvartal", "3. kvartal", "4. kvartal"],
};
const monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"jan.",
"feb.",
"mars",
"apr.",
"mai",
"juni",
"juli",
"aug.",
"sep.",
"okt.",
"nov.",
"des.",
],
wide: [
"januar",
"februar",
"mars",
"april",
"mai",
"juni",
"juli",
"august",
"september",
"oktober",
"november",
"desember",
],
};
const dayValues = {
narrow: ["S", "M", "T", "O", "T", "F", "L"],
short: ["sø", "ma", "ti", "on", "to", "fr", "lø"],
abbreviated: ["søn", "man", "tir", "ons", "tor", "fre", "lør"],
wide: [
"søndag",
"mandag",
"tirsdag",
"onsdag",
"torsdag",
"fredag",
"lørdag",
],
};
const dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "midnatt",
noon: "middag",
morning: "på morg.",
afternoon: "på etterm.",
evening: "på kvelden",
night: "på natten",
},
abbreviated: {
am: "a.m.",
pm: "p.m.",
midnight: "midnatt",
noon: "middag",
morning: "på morg.",
afternoon: "på etterm.",
evening: "på kvelden",
night: "på natten",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnatt",
noon: "middag",
morning: "på morgenen",
afternoon: "på ettermiddagen",
evening: "på kvelden",
night: "på natten",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
return number + ".";
};
export const localize = {
ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide",
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: (quarter) => quarter - 1,
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide",
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide",
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
}),
};

View File

@@ -0,0 +1,26 @@
import { SpanAttributes } from './attributes';
import { SpanContext } from './span_context';
/**
* A pointer from the current {@link Span} to another span in the same trace or
* in a different trace.
* Few examples of Link usage.
* 1. Batch Processing: A batch of elements may contain elements associated
* with one or more traces/spans. Since there can only be one parent
* SpanContext, Link is used to keep reference to SpanContext of all
* elements in the batch.
* 2. Public Endpoint: A SpanContext in incoming client request on a public
* endpoint is untrusted from service provider perspective. In such case it
* is advisable to start a new trace with appropriate sampling decision.
* However, it is desirable to associate incoming SpanContext to new trace
* initiated on service provider side so two traces (from Client and from
* Service Provider) can be correlated.
*/
export interface Link {
/** The {@link SpanContext} of a linked span. */
context: SpanContext;
/** A set of {@link SpanAttributes} on the link. */
attributes?: SpanAttributes;
/** Count of attributes of the link that were dropped due to collection limits */
droppedAttributesCount?: number;
}
//# sourceMappingURL=link.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"file-json-2.js","sources":["../../../src/icons/file-json-2.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name FileJson2\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNNCAyMmgxNGEyIDIgMCAwIDAgMi0yVjdsLTUtNUg2YTIgMiAwIDAgMC0yIDJ2NCIgLz4KICA8cGF0aCBkPSJNMTQgMnY0YTIgMiAwIDAgMCAyIDJoNCIgLz4KICA8cGF0aCBkPSJNNCAxMmExIDEgMCAwIDAtMSAxdjFhMSAxIDAgMCAxLTEgMSAxIDEgMCAwIDEgMSAxdjFhMSAxIDAgMCAwIDEgMSIgLz4KICA8cGF0aCBkPSJNOCAxOGExIDEgMCAwIDAgMS0xdi0xYTEgMSAwIDAgMSAxLTEgMSAxIDAgMCAxLTEtMXYtMWExIDEgMCAwIDAtMS0xIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/file-json-2\n * @see https://lucide.dev/guide/packages/lucide-react - Documentation\n *\n * @param {Object} props - Lucide icons props and any valid SVG attribute\n * @returns {JSX.Element} JSX Element\n *\n */\nconst FileJson2 = createLucideIcon('FileJson2', [\n ['path', { d: 'M4 22h14a2 2 0 0 0 2-2V7l-5-5H6a2 2 0 0 0-2 2v4', key: '1pf5j1' }],\n ['path', { d: 'M14 2v4a2 2 0 0 0 2 2h4', key: 'tnqrlb' }],\n [\n 'path',\n { d: 'M4 12a1 1 0 0 0-1 1v1a1 1 0 0 1-1 1 1 1 0 0 1 1 1v1a1 1 0 0 0 1 1', key: 'fq0c9t' },\n ],\n [\n 'path',\n { d: 'M8 18a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1 1 1 0 0 1-1-1v-1a1 1 0 0 0-1-1', key: '4gibmv' },\n ],\n]);\n\nexport default FileJson2;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmD,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAChF,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA2B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACxD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAqE,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAC1F,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuE,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CAC5F,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,61 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.statements = exports.statement = exports.smart = exports.program = exports.expression = void 0;
var _t = require("@babel/types");
const {
assertExpressionStatement
} = _t;
function makeStatementFormatter(fn) {
return {
code: str => `/* @babel/template */;\n${str}`,
validate: () => {},
unwrap: ast => {
return fn(ast.program.body.slice(1));
}
};
}
const smart = exports.smart = makeStatementFormatter(body => {
if (body.length > 1) {
return body;
} else {
return body[0];
}
});
const statements = exports.statements = makeStatementFormatter(body => body);
const statement = exports.statement = makeStatementFormatter(body => {
if (body.length === 0) {
throw new Error("Found nothing to return.");
}
if (body.length > 1) {
throw new Error("Found multiple statements but wanted one");
}
return body[0];
});
const expression = exports.expression = {
code: str => `(\n${str}\n)`,
validate: ast => {
if (ast.program.body.length > 1) {
throw new Error("Found multiple statements but wanted one");
}
if (expression.unwrap(ast).start === 0) {
throw new Error("Parse result included parens.");
}
},
unwrap: ({
program
}) => {
const [stmt] = program.body;
assertExpressionStatement(stmt);
return stmt.expression;
}
};
const program = exports.program = {
code: str => str,
validate: () => {},
unwrap: ast => ast.program
};
//# sourceMappingURL=formatters.js.map

View File

@@ -0,0 +1,2 @@
var convert = require('./convert');
module.exports = convert(require('../lang'));

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/postgres/predefinedMigrations/v2-v3/fetchAndResave/index.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAEtE,OAAO,KAAK,EAAE,mBAAmB,EAAE,UAAU,EAAE,MAAM,mBAAmB,CAAA;AACxE,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAA;AAK/C,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,mBAAmB,CAAA;IAC5B,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,EAAE,EAAE,UAAU,CAAA;IACd,KAAK,EAAE,OAAO,CAAA;IACd,YAAY,EAAE,YAAY,CAAA;IAC1B,MAAM,EAAE,cAAc,EAAE,CAAA;IACxB,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,UAAU,EAAE,OAAO,CAAA;IACnB,OAAO,EAAE,OAAO,CAAA;IAChB,GAAG,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;IAC7B,SAAS,EAAE,MAAM,CAAA;CAClB,CAAA;AAED,eAAO,MAAM,cAAc,mHAYxB,IAAI,kBA4MN,CAAA"}

View File

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

View File

@@ -0,0 +1,27 @@
import { previousDay } from "./previousDay.mjs";
/**
* @name previousFriday
* @category Weekday Helpers
* @summary When is the previous Friday?
*
* @description
* When is the previous Friday?
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
*
* @param date - The date to start counting from
*
* @returns The previous Friday
*
* @example
* // When is the previous Friday before Jun, 19, 2021?
* const result = previousFriday(new Date(2021, 5, 19))
* //=> Fri June 18 2021 00:00:00
*/
export function previousFriday(date) {
return previousDay(date, 5);
}
// Fallback for modularized imports:
export default previousFriday;

View File

@@ -0,0 +1,22 @@
import * as ReactJSXRuntimeDev from 'react/jsx-dev-runtime';
import { h as hasOwn, E as Emotion, c as createEmotionProps } from '../../dist/emotion-element-516430c7.development.edge-light.esm.js';
import 'react';
import '@emotion/cache';
import '@babel/runtime/helpers/extends';
import '@emotion/weak-memoize';
import '../../_isolated-hnrs/dist/emotion-react-_isolated-hnrs.development.edge-light.esm.js';
import 'hoist-non-react-statics';
import '@emotion/utils';
import '@emotion/serialize';
import '@emotion/use-insertion-effect-with-fallbacks';
var Fragment = ReactJSXRuntimeDev.Fragment;
var jsxDEV = function jsxDEV(type, props, key, isStaticChildren, source, self) {
if (!hasOwn.call(props, 'css')) {
return ReactJSXRuntimeDev.jsxDEV(type, props, key, isStaticChildren, source, self);
}
return ReactJSXRuntimeDev.jsxDEV(Emotion, createEmotionProps(type, props), key, isStaticChildren, source, self);
};
export { Fragment, jsxDEV };

View File

@@ -0,0 +1,59 @@
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
const core = require('@sentry/core');
const debugBuild = require('../debug-build.js');
/**
* Starts the Sentry UI profiler.
* This mode is exclusive with the transaction profiler and will only work if the profilesSampleRate is set to a falsy value.
* In UI profiling mode, the profiler will keep reporting profile chunks to Sentry until it is stopped, which allows for continuous profiling of the application.
*/
function startProfiler() {
const client = core.getClient();
if (!client) {
debugBuild.DEBUG_BUILD && core.debug.warn('No Sentry client available, profiling is not started');
return;
}
const integration = client.getIntegrationByName('BrowserProfiling');
if (!integration) {
debugBuild.DEBUG_BUILD && core.debug.warn('BrowserProfiling integration is not available');
return;
}
client.emit('startUIProfiler');
}
/**
* Stops the Sentry UI profiler.
* Calls to stop will stop the profiler and flush the currently collected profile data to Sentry.
*/
function stopProfiler() {
const client = core.getClient();
if (!client) {
debugBuild.DEBUG_BUILD && core.debug.warn('No Sentry client available, profiling is not started');
return;
}
const integration = client.getIntegrationByName('BrowserProfiling');
if (!integration) {
debugBuild.DEBUG_BUILD && core.debug.warn('ProfilingIntegration is not available');
return;
}
client.emit('stopUIProfiler');
}
/**
* Profiler namespace for controlling the JS profiler in 'manual' mode.
*
* Requires the `browserProfilingIntegration` from the `@sentry/browser` package.
*/
const uiProfiler = {
startProfiler,
stopProfiler,
};
exports.uiProfiler = uiProfiler;
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,22 @@
MIT License
Copyright (c) 2014-present Sebastian McKenzie and other contributors
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.

View File

@@ -0,0 +1,12 @@
import { AsyncLocalStorageContextManager } from '@opentelemetry/context-async-hooks';
/**
* This is a custom ContextManager for OpenTelemetry, which extends the default AsyncLocalStorageContextManager.
* It ensures that we create a new hub per context, so that the OTEL Context & the Sentry Scopes are always in sync.
*
* Note that we currently only support AsyncHooks with this,
* but since this should work for Node 14+ anyhow that should be good enough.
*/
export declare const SentryContextManager: new (...args: unknown[]) => AsyncLocalStorageContextManager & {
getAsyncLocalStorageLookup(): import("@sentry/opentelemetry").AsyncLocalStorageLookup;
};
//# sourceMappingURL=contextManager.d.ts.map

View File

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

View File

@@ -0,0 +1,2 @@
export declare const VERSION = "0.211.0";
//# sourceMappingURL=version.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"relations.js","names":[],"sources":["../../../../src/rest/commands/delete/relations.ts"],"sourcesContent":["import type { DirectusRelation } from '../../../schema/relation.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\n/**\n * Delete an existing relation.\n * @param collection\n * @param field\n * @returns\n * @throws Will throw if collection is empty\n * @throws Will throw if field is empty\n */\nexport const deleteRelation =\n\t<Schema>(\n\t\tcollection: DirectusRelation<Schema>['collection'],\n\t\tfield: DirectusRelation<Schema>['field'],\n\t): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(collection, 'Collection cannot be empty');\n\t\tthrowIfEmpty(field, 'Field cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/relations/${collection}/${field}`,\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n"],"mappings":"6DAYA,MAAa,GAEX,EACA,SAGA,EAAa,EAAY,6BAA6B,CACtD,EAAa,EAAO,wBAAwB,CAErC,CACN,KAAM,cAAc,EAAW,GAAG,IAClC,OAAQ,SACR"}

View File

@@ -0,0 +1,4 @@
{
"main": "../../cjs/_assert_this_initialized.cjs",
"module": "../../esm/_assert_this_initialized.js"
}

View File

@@ -0,0 +1,119 @@
# leac
![lint status badge](https://github.com/mxxii/leac/workflows/lint/badge.svg)
![test status badge](https://github.com/mxxii/leac/workflows/test/badge.svg)
[![License: MIT](https://img.shields.io/badge/license-MIT-green.svg)](https://github.com/mxxii/leac/blob/main/LICENSE)
[![npm](https://img.shields.io/npm/v/leac?logo=npm)](https://www.npmjs.com/package/leac)
[![deno](https://img.shields.io/badge/deno.land%2Fx%2F-leac-informational?logo=deno)](https://deno.land/x/leac)
Lexer / tokenizer.
## Features
- **Lightweight**. Zero dependencies. Not a lot of code.
- **Well tested** - comes will tests for everything including examples.
- **Compact syntax** - less boilerplate. Rule name is enough when it is the same as the lookup string.
- **No failures** - it just stops when there are no matching rules and returns the information about whether it completed and where it stopped in addition to tokens array.
- **Composable lexers** - instead of states within a lexer.
- **Stateless lexers** - all inputs are passed as arguments, all outputs are returned in a result object.
- **No streaming** - accepts a string at a time.
- **Only text tokens, no arbitrary values**. It seems to be a good habit to have tokens that are *trivially* serializable back into a valid input string. Don't do the parser's job. There are a couple of convenience features such as the ability to discard matches or string replacements for regular expression rules but that has to be used mindfully (more on this below).
## Install
### Node
```shell
> npm i leac
> yarn add leac
```
```ts
import { createLexer, Token } from 'leac';
```
### Deno
```ts
import { createLexer, Token } from 'https://deno.land/x/leac@.../leac.ts';
```
## Examples
- [JSON](https://github.com/mxxii/leac/blob/main/examples/json.ts) ([output snapshot](https://github.com/mxxii/leac/blob/main/test/snapshots/examples.ts.md#json));
- [Calc](https://github.com/mxxii/leac/blob/main/examples/calc.ts) ([output snapshot](https://github.com/mxxii/leac/blob/main/test/snapshots/examples.ts.md#calc)).
```typescript
const lex = createLexer([
{ name: '-', str: '-' },
{ name: '+' },
{ name: 'ws', regex: /\s+/, discard: true },
{ name: 'number', regex: /[0-9]|[1-9][0-9]+/ },
]);
const { tokens, offset, complete } = lex('2 + 2');
```
## API
- [docs/index.md](https://github.com/mxxii/leac/blob/main/docs/index.md)
## A word of caution
It is often really tempting to rewrite token on the go. But it can be dangerous unless you are absolutely mindful of all edge cases.
For example, who needs to carry string quotes around, right? Parser will only need the string content...
We'll have to consider following things:
- Regular expressions. Sometimes we want to match strings that can have a length *from zero* and up.
- Tokens are not produced without changing the offset. If something is missing - there is no token.
If we allow a token with zero length - it will cause an infinite loop, as the same rule will be matched at the same offset, again and again.
- Discardable tokens - a convenience feature that may seem harmless at a first glance.
When put together, these things plus some intuition traps can lead to a broken array of tokens.
Strings can be empty, which means the token can be absent. With no content and no quotes the tokens array will most likely make no sense for a parser.
How to avoid potential issues:
- Don't discard anything that you may need to insert back if you try to immediately serialize the tokens array to string. This means whitespace are usually safe to discard while string quotes are not (what can be considered safe will heavily depend on the grammar - you may have a language with significant spaces and insignificant quotes...);
- You can introduce a higher priority rule to capture an empty string (opening quote immediately followed by closing quote) and emit a special token for that. This way empty string between quotes can't occur down the line;
- Match the whole string (content and quotes) with a single regular expression, let the parser deal with it. This can actually lead to a cleaner design than trying to be clever and removing "unnecessary" parts early;
- Match the whole string (content and quotes) with a single regular expression, use capture groups and [replace](https://github.com/mxxii/leac/blob/main/docs/interfaces/RegexRule.md#replace) property. This can produce a non-zero length token with empty text.
Another note about quotes: If the grammar allows for different quotes and you're still willing to get rid of them early - think how you're going to unescape the string later. Make sure you carry the information about the exact string kind in the token name at least - you will need it later.
## What about ...?
- performance - The code is very simple but I won't put any unverified assumptions here. I'd be grateful to anyone who can provide a good benchmark project to compare different lexers.
- stable release - Current release is well thought out and tested. I leave a chance that some changes might be needed based on feedback. Before version 1.0.0 this will be done without a deprecation cycle.
## Some other lexer / tokenizer packages
- [moo](https://github.com/no-context/moo);
- [doken](https://github.com/yishn/doken);
- [tokenizr](https://github.com/rse/tokenizr);
- [flex-js](https://github.com/sormy/flex-js);
- *and more, with varied level of maintenance.*

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