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,45 @@
"use strict";
exports.lastDayOfISOWeekYear = lastDayOfISOWeekYear;
var _index = require("./constructFrom.cjs");
var _index2 = require("./getISOWeekYear.cjs");
var _index3 = require("./startOfISOWeek.cjs");
/**
* The {@link lastDayOfISOWeekYear} function options.
*/
/**
* @name lastDayOfISOWeekYear
* @category ISO Week-Numbering Year Helpers
* @summary Return the last day of an ISO week-numbering year for the given date.
*
* @description
* Return the last day of an ISO week-numbering year,
* which always starts 3 days before the year's first Thursday.
* The result will be in the local timezone.
*
* ISO week-numbering year: http://en.wikipedia.org/wiki/ISO_week_date
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The original date
* @param options - An object with options
*
* @returns The end of an ISO week-numbering year
*
* @example
* // The last day of an ISO week-numbering year for 2 July 2005:
* const result = lastDayOfISOWeekYear(new Date(2005, 6, 2))
* //=> Sun Jan 01 2006 00:00:00
*/
function lastDayOfISOWeekYear(date, options) {
const year = (0, _index2.getISOWeekYear)(date, options);
const fourthOfJanuary = (0, _index.constructFrom)(options?.in || date, 0);
fourthOfJanuary.setFullYear(year + 1, 0, 4);
fourthOfJanuary.setHours(0, 0, 0, 0);
const date_ = (0, _index3.startOfISOWeek)(fourthOfJanuary, options);
date_.setDate(date_.getDate() - 1);
return date_;
}

View File

@@ -0,0 +1,3 @@
'use strict';
module.exports = require('./async').priorityQueue;

View File

@@ -0,0 +1,41 @@
'use client';
import { c as _c } from "react/compiler-runtime";
import { jsx as _jsx } from "react/jsx-runtime";
import React from 'react';
import { ExternalLinkIcon } from '../../icons/ExternalLink/index.js';
import './index.scss';
import { usePreviewURL } from '../../providers/LivePreview/context.js';
import { useTranslation } from '../../providers/Translation/index.js';
const baseClass = 'preview-btn';
export function PreviewButton(props) {
const $ = _c(3);
const {
previewURL
} = usePreviewURL();
const {
t
} = useTranslation();
if (!previewURL) {
return null;
}
let t0;
if ($[0] !== previewURL || $[1] !== t) {
t0 = _jsx("a", {
"aria-label": t("version:preview"),
className: baseClass,
href: previewURL,
id: "preview-button",
target: "_blank",
title: t("version:preview"),
children: _jsx(ExternalLinkIcon, {})
});
$[0] = previewURL;
$[1] = t;
$[2] = t0;
} else {
t0 = $[2];
}
return t0;
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,23 @@
/**
* @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 PencilLine = createLucideIcon("PencilLine", [
["path", { d: "M12 20h9", key: "t2du7b" }],
[
"path",
{
d: "M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",
key: "1ykcvy"
}
],
["path", { d: "m15 5 3 3", key: "1w25hb" }]
]);
export { PencilLine as default };
//# sourceMappingURL=pencil-line.js.map

View File

@@ -0,0 +1,29 @@
{
"name": "quick-format-unescaped",
"version": "4.0.4",
"description": "Solves a problem with util.format",
"main": "index.js",
"directories": {
"test": "test"
},
"scripts": {
"test": "nyc -- node test",
"test:html": "nyc --reporter=html -- node test"
},
"author": "David Mark Clements",
"devDependencies": {
"fastbench": "^1.0.1",
"nyc": "^15.0.0"
},
"dependencies": {},
"repository": {
"type": "git",
"url": "git+https://github.com/davidmarkclements/quick-format.git"
},
"keywords": [],
"license": "MIT",
"bugs": {
"url": "https://github.com/davidmarkclements/quick-format/issues"
},
"homepage": "https://github.com/davidmarkclements/quick-format#readme"
}

View File

@@ -0,0 +1,2 @@
const e=(e=!1)=>()=>({path:e?`/auth?sessionOnly`:`/auth`,method:`GET`});export{e as readProviders};
//# sourceMappingURL=providers.js.map

View File

@@ -0,0 +1,4 @@
export { useSortable } from './useSortable';
export type { Arguments as UseSortableArguments } from './useSortable';
export { defaultAnimateLayoutChanges, defaultNewIndexGetter } from './defaults';
export type { AnimateLayoutChanges, NewIndexGetter } from './types';

View File

@@ -0,0 +1,6 @@
global.process = { __proto__: process, pid: 123456 }
Date.now = function () { return 1459875739796 }
require('node:os').hostname = function () { return 'abcdefghijklmnopqr' }
const pino = require(require.resolve('./../../'))
const asyncLogger = pino(pino.destination({ sync: false })).child({ hello: 'world' })
asyncLogger.info('h')

View File

@@ -0,0 +1,23 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.finalize = finalize;
exports.flattenToSet = flattenToSet;
function finalize(deepArr) {
return Object.freeze(deepArr);
}
function flattenToSet(arr) {
const result = new Set();
const stack = [arr];
while (stack.length > 0) {
for (const el of stack.pop()) {
if (Array.isArray(el)) stack.push(el);else result.add(el);
}
}
return result;
}
0 && 0;
//# sourceMappingURL=deep-array.js.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"handler.d.ts","sourceRoot":"","sources":["../../../src/routes/graphql/handler.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAqC,eAAe,EAAE,MAAM,SAAS,CAAA;AAqEjF,eAAO,MAAM,UAAU,WAAkB,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,iBAyBlF,CAAA;AAED,eAAO,MAAM,IAAI,WACN,OAAO,CAAC,eAAe,CAAC,GAAG,eAAe,eAAqB,OAAO,sBAuD9E,CAAA"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"folders.cjs","names":[],"sources":["../../../../src/rest/commands/delete/folders.ts"],"sourcesContent":["import type { DirectusFolder } from '../../../schema/folder.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\n/**\n * Delete multiple existing folders.\n * @param keys\n * @returns\n * @throws Will throw if keys is empty\n */\nexport const deleteFolders =\n\t<Schema>(keys: DirectusFolder<Schema>['id'][]): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(keys, 'Keys cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/folders`,\n\t\t\tbody: JSON.stringify(keys),\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n\n/**\n * Delete an existing folder.\n * @param key\n * @returns\n * @throws Will throw if key is empty\n */\nexport const deleteFolder =\n\t<Schema>(key: DirectusFolder<Schema>['id']): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(key, 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/folders/${key}`,\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n"],"mappings":"kDAUa,EACH,QAER,EAAA,aAAa,EAAM,uBAAuB,CAEnC,CACN,KAAM,WACN,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,SACR,EASU,EACH,QAER,EAAA,aAAa,EAAK,sBAAsB,CAEjC,CACN,KAAM,YAAY,IAClB,OAAQ,SACR"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"anchor.js","sources":["../../../src/icons/anchor.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Anchor\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTIgMjJWOCIgLz4KICA8cGF0aCBkPSJNNSAxMkgyYTEwIDEwIDAgMCAwIDIwIDBoLTMiIC8+CiAgPGNpcmNsZSBjeD0iMTIiIGN5PSI1IiByPSIzIiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/anchor\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 Anchor = createLucideIcon('Anchor', [\n ['path', { d: 'M12 22V8', key: 'qkxhtm' }],\n ['path', { d: 'M5 12H2a10 10 0 0 0 20 0h-3', key: '1hv3nh' }],\n ['circle', { cx: '12', cy: '5', r: '3', key: 'rqqgnr' }],\n]);\n\nexport default Anchor;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA+B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC5D,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,GAAA,CAAK,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA;AACzD,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,200 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
/*
* Browser-compatible JavaScript MD5
*
* Modification of JavaScript MD5
* https://github.com/blueimp/JavaScript-MD5
*
* Copyright 2011, Sebastian Tschan
* https://blueimp.net
*
* Licensed under the MIT license:
* https://opensource.org/licenses/MIT
*
* Based on
* A JavaScript implementation of the RSA Data Security, Inc. MD5 Message
* Digest Algorithm, as defined in RFC 1321.
* Version 2.2 Copyright (C) Paul Johnston 1999 - 2009
* Other contributors: Greg Holt, Andrew Kepert, Ydnar, Lostinet
* Distributed under the BSD License
* See http://pajhome.org.uk/crypt/md5 for more info.
*/
function md5(bytes) {
if (typeof bytes === 'string') {
var msg = unescape(encodeURIComponent(bytes)); // UTF8 escape
bytes = new Uint8Array(msg.length);
for (var i = 0; i < msg.length; ++i) {
bytes[i] = msg.charCodeAt(i);
}
}
return md5ToHexEncodedArray(wordsToMd5(bytesToWords(bytes), bytes.length * 8));
}
/*
* Convert an array of little-endian words to an array of bytes
*/
function md5ToHexEncodedArray(input) {
var output = [];
var length32 = input.length * 32;
var hexTab = '0123456789abcdef';
for (var i = 0; i < length32; i += 8) {
var x = input[i >> 5] >>> i % 32 & 0xff;
var hex = parseInt(hexTab.charAt(x >>> 4 & 0x0f) + hexTab.charAt(x & 0x0f), 16);
output.push(hex);
}
return output;
}
/**
* Calculate output length with padding and bit length
*/
function getOutputLength(inputLength8) {
return (inputLength8 + 64 >>> 9 << 4) + 14 + 1;
}
/*
* Calculate the MD5 of an array of little-endian words, and a bit length.
*/
function wordsToMd5(x, len) {
/* append padding */
x[len >> 5] |= 0x80 << len % 32;
x[getOutputLength(len) - 1] = len;
var a = 1732584193;
var b = -271733879;
var c = -1732584194;
var d = 271733878;
for (var i = 0; i < x.length; i += 16) {
var olda = a;
var oldb = b;
var oldc = c;
var oldd = d;
a = md5ff(a, b, c, d, x[i], 7, -680876936);
d = md5ff(d, a, b, c, x[i + 1], 12, -389564586);
c = md5ff(c, d, a, b, x[i + 2], 17, 606105819);
b = md5ff(b, c, d, a, x[i + 3], 22, -1044525330);
a = md5ff(a, b, c, d, x[i + 4], 7, -176418897);
d = md5ff(d, a, b, c, x[i + 5], 12, 1200080426);
c = md5ff(c, d, a, b, x[i + 6], 17, -1473231341);
b = md5ff(b, c, d, a, x[i + 7], 22, -45705983);
a = md5ff(a, b, c, d, x[i + 8], 7, 1770035416);
d = md5ff(d, a, b, c, x[i + 9], 12, -1958414417);
c = md5ff(c, d, a, b, x[i + 10], 17, -42063);
b = md5ff(b, c, d, a, x[i + 11], 22, -1990404162);
a = md5ff(a, b, c, d, x[i + 12], 7, 1804603682);
d = md5ff(d, a, b, c, x[i + 13], 12, -40341101);
c = md5ff(c, d, a, b, x[i + 14], 17, -1502002290);
b = md5ff(b, c, d, a, x[i + 15], 22, 1236535329);
a = md5gg(a, b, c, d, x[i + 1], 5, -165796510);
d = md5gg(d, a, b, c, x[i + 6], 9, -1069501632);
c = md5gg(c, d, a, b, x[i + 11], 14, 643717713);
b = md5gg(b, c, d, a, x[i], 20, -373897302);
a = md5gg(a, b, c, d, x[i + 5], 5, -701558691);
d = md5gg(d, a, b, c, x[i + 10], 9, 38016083);
c = md5gg(c, d, a, b, x[i + 15], 14, -660478335);
b = md5gg(b, c, d, a, x[i + 4], 20, -405537848);
a = md5gg(a, b, c, d, x[i + 9], 5, 568446438);
d = md5gg(d, a, b, c, x[i + 14], 9, -1019803690);
c = md5gg(c, d, a, b, x[i + 3], 14, -187363961);
b = md5gg(b, c, d, a, x[i + 8], 20, 1163531501);
a = md5gg(a, b, c, d, x[i + 13], 5, -1444681467);
d = md5gg(d, a, b, c, x[i + 2], 9, -51403784);
c = md5gg(c, d, a, b, x[i + 7], 14, 1735328473);
b = md5gg(b, c, d, a, x[i + 12], 20, -1926607734);
a = md5hh(a, b, c, d, x[i + 5], 4, -378558);
d = md5hh(d, a, b, c, x[i + 8], 11, -2022574463);
c = md5hh(c, d, a, b, x[i + 11], 16, 1839030562);
b = md5hh(b, c, d, a, x[i + 14], 23, -35309556);
a = md5hh(a, b, c, d, x[i + 1], 4, -1530992060);
d = md5hh(d, a, b, c, x[i + 4], 11, 1272893353);
c = md5hh(c, d, a, b, x[i + 7], 16, -155497632);
b = md5hh(b, c, d, a, x[i + 10], 23, -1094730640);
a = md5hh(a, b, c, d, x[i + 13], 4, 681279174);
d = md5hh(d, a, b, c, x[i], 11, -358537222);
c = md5hh(c, d, a, b, x[i + 3], 16, -722521979);
b = md5hh(b, c, d, a, x[i + 6], 23, 76029189);
a = md5hh(a, b, c, d, x[i + 9], 4, -640364487);
d = md5hh(d, a, b, c, x[i + 12], 11, -421815835);
c = md5hh(c, d, a, b, x[i + 15], 16, 530742520);
b = md5hh(b, c, d, a, x[i + 2], 23, -995338651);
a = md5ii(a, b, c, d, x[i], 6, -198630844);
d = md5ii(d, a, b, c, x[i + 7], 10, 1126891415);
c = md5ii(c, d, a, b, x[i + 14], 15, -1416354905);
b = md5ii(b, c, d, a, x[i + 5], 21, -57434055);
a = md5ii(a, b, c, d, x[i + 12], 6, 1700485571);
d = md5ii(d, a, b, c, x[i + 3], 10, -1894986606);
c = md5ii(c, d, a, b, x[i + 10], 15, -1051523);
b = md5ii(b, c, d, a, x[i + 1], 21, -2054922799);
a = md5ii(a, b, c, d, x[i + 8], 6, 1873313359);
d = md5ii(d, a, b, c, x[i + 15], 10, -30611744);
c = md5ii(c, d, a, b, x[i + 6], 15, -1560198380);
b = md5ii(b, c, d, a, x[i + 13], 21, 1309151649);
a = md5ii(a, b, c, d, x[i + 4], 6, -145523070);
d = md5ii(d, a, b, c, x[i + 11], 10, -1120210379);
c = md5ii(c, d, a, b, x[i + 2], 15, 718787259);
b = md5ii(b, c, d, a, x[i + 9], 21, -343485551);
a = safeAdd(a, olda);
b = safeAdd(b, oldb);
c = safeAdd(c, oldc);
d = safeAdd(d, oldd);
}
return [a, b, c, d];
}
/*
* Convert an array bytes to an array of little-endian words
* Characters >255 have their high-byte silently ignored.
*/
function bytesToWords(input) {
if (input.length === 0) {
return [];
}
var length8 = input.length * 8;
var output = new Uint32Array(getOutputLength(length8));
for (var i = 0; i < length8; i += 8) {
output[i >> 5] |= (input[i / 8] & 0xff) << i % 32;
}
return output;
}
/*
* Add integers, wrapping at 2^32. This uses 16-bit operations internally
* to work around bugs in some JS interpreters.
*/
function safeAdd(x, y) {
var lsw = (x & 0xffff) + (y & 0xffff);
var msw = (x >> 16) + (y >> 16) + (lsw >> 16);
return msw << 16 | lsw & 0xffff;
}
/*
* Bitwise rotate a 32-bit number to the left.
*/
function bitRotateLeft(num, cnt) {
return num << cnt | num >>> 32 - cnt;
}
/*
* These functions implement the four basic operations the algorithm uses.
*/
function md5cmn(q, a, b, x, s, t) {
return safeAdd(bitRotateLeft(safeAdd(safeAdd(a, q), safeAdd(x, t)), s), b);
}
function md5ff(a, b, c, d, x, s, t) {
return md5cmn(b & c | ~b & d, a, b, x, s, t);
}
function md5gg(a, b, c, d, x, s, t) {
return md5cmn(b & d | c & ~d, a, b, x, s, t);
}
function md5hh(a, b, c, d, x, s, t) {
return md5cmn(b ^ c ^ d, a, b, x, s, t);
}
function md5ii(a, b, c, d, x, s, t) {
return md5cmn(c ^ (b | ~d), a, b, x, s, t);
}
var _default = exports.default = md5;

View File

@@ -0,0 +1,227 @@
'use strict'
process.env.TZ = 'UTC'
const { test } = require('node:test')
const prettifyTime = require('./prettify-time')
const {
TIMESTAMP_KEY
} = require('../constants')
const context = {
timestampKey: TIMESTAMP_KEY,
translateTime: true,
customPrettifiers: {}
}
test('returns `undefined` if `time` or `timestamp` not in log', t => {
const str = prettifyTime({ log: {}, context })
t.assert.strictEqual(str, undefined)
})
test('returns prettified formatted time from custom field', t => {
const log = { customtime: 1554642900000 }
let str = prettifyTime({
log,
context: {
...context,
timestampKey: 'customtime'
}
})
t.assert.strictEqual(str, '[13:15:00.000]')
str = prettifyTime({
log,
context: {
...context,
translateTime: false,
timestampKey: 'customtime'
}
})
t.assert.strictEqual(str, '[1554642900000]')
})
test('returns prettified formatted time', t => {
let log = { time: 1554642900000 }
let str = prettifyTime({
log,
context: {
...context
}
})
t.assert.strictEqual(str, '[13:15:00.000]')
log = { timestamp: 1554642900000 }
str = prettifyTime({
log,
context: {
...context
}
})
t.assert.strictEqual(str, '[13:15:00.000]')
log = { time: '2019-04-07T09:15:00.000-04:00' }
str = prettifyTime({
log,
context: {
...context
}
})
t.assert.strictEqual(str, '[13:15:00.000]')
log = { timestamp: '2019-04-07T09:15:00.000-04:00' }
str = prettifyTime({
log,
context: {
...context
}
})
t.assert.strictEqual(str, '[13:15:00.000]')
log = { time: 1554642900000 }
str = prettifyTime({
log,
context: {
...context,
translateTime: 'd mmm yyyy H:MM'
}
})
t.assert.strictEqual(str, '[7 Apr 2019 13:15]')
log = { timestamp: 1554642900000 }
str = prettifyTime({
log,
context: {
...context,
translateTime: 'd mmm yyyy H:MM'
}
})
t.assert.strictEqual(str, '[7 Apr 2019 13:15]')
log = { time: '2019-04-07T09:15:00.000-04:00' }
str = prettifyTime({
log,
context: {
...context,
translateTime: 'd mmm yyyy H:MM'
}
})
t.assert.strictEqual(str, '[7 Apr 2019 13:15]')
log = { timestamp: '2019-04-07T09:15:00.000-04:00' }
str = prettifyTime({
log,
context: {
...context,
translateTime: 'd mmm yyyy H:MM'
}
})
t.assert.strictEqual(str, '[7 Apr 2019 13:15]')
})
test('passes through value', t => {
let log = { time: 1554642900000 }
let str = prettifyTime({
log,
context: {
...context,
translateTime: undefined
}
})
t.assert.strictEqual(str, '[1554642900000]')
log = { timestamp: 1554642900000 }
str = prettifyTime({
log,
context: {
...context,
translateTime: undefined
}
})
t.assert.strictEqual(str, '[1554642900000]')
log = { time: '2019-04-07T09:15:00.000-04:00' }
str = prettifyTime({
log,
context: {
...context,
translateTime: undefined
}
})
t.assert.strictEqual(str, '[2019-04-07T09:15:00.000-04:00]')
log = { timestamp: '2019-04-07T09:15:00.000-04:00' }
str = prettifyTime({
log,
context: {
...context,
translateTime: undefined
}
})
t.assert.strictEqual(str, '[2019-04-07T09:15:00.000-04:00]')
})
test('handles the 0 timestamp', t => {
let log = { time: 0 }
let str = prettifyTime({
log,
context: {
...context,
translateTime: undefined
}
})
t.assert.strictEqual(str, '[0]')
log = { timestamp: 0 }
str = prettifyTime({
log,
context: {
...context,
translateTime: undefined
}
})
t.assert.strictEqual(str, '[0]')
})
test('works with epoch as a number or string', (t) => {
t.plan(3)
const epoch = 1522431328992
const asNumber = prettifyTime({
log: { time: epoch, msg: 'foo' },
context: {
...context,
translateTime: true
}
})
const asString = prettifyTime({
log: { time: `${epoch}`, msg: 'foo' },
context: {
...context,
translateTime: true
}
})
const invalid = prettifyTime({
log: { time: '2 days ago', msg: 'foo' },
context: {
...context,
translateTime: true
}
})
t.assert.strictEqual(asString, '[17:35:28.992]')
t.assert.strictEqual(asNumber, '[17:35:28.992]')
t.assert.strictEqual(invalid, '[2 days ago]')
})
test('uses custom prettifier', t => {
const str = prettifyTime({
log: { time: 0 },
context: {
...context,
customPrettifiers: {
time () {
return 'done'
}
}
}
})
t.assert.strictEqual(str, 'done')
})

View File

@@ -0,0 +1 @@
module.exports={C:{"5":0.07741,"115":1.22569,"125":0.00645,"127":0.00645,"128":0.00645,"131":0.00645,"133":0.00645,"134":0.00645,"136":0.00645,"138":0.00645,"139":0.01935,"140":0.16773,"141":0.00645,"142":0.0129,"143":0.0258,"144":0.03871,"145":2.00626,"146":3.2255,"147":0.10322,_:"2 3 4 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 116 117 118 119 120 121 122 123 124 126 129 130 132 135 137 148 149 3.5 3.6"},D:{"66":0.00645,"68":0.00645,"69":0.07741,"71":0.00645,"73":0.00645,"75":0.00645,"79":0.00645,"81":0.00645,"86":0.00645,"87":0.00645,"93":0.00645,"103":0.20643,"104":0.23869,"105":0.18063,"106":0.18063,"107":0.18063,"108":0.18708,"109":2.13528,"110":0.18063,"111":0.25804,"112":16.05654,"114":0.0129,"116":0.36771,"117":0.18063,"119":0.00645,"120":0.18708,"122":0.17418,"123":0.00645,"124":0.19353,"125":0.45802,"126":3.12874,"127":0.01935,"128":0.01935,"129":0.01935,"130":0.03871,"131":0.43222,"132":0.10967,"133":0.38706,"134":0.03871,"135":0.07096,"136":0.03871,"137":0.03226,"138":0.13547,"139":2.29656,"140":0.05806,"141":0.12257,"142":7.72185,"143":14.10834,"144":0.03871,"145":0.03871,_:"4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 67 70 72 74 76 77 78 80 83 84 85 88 89 90 91 92 94 95 96 97 98 99 100 101 102 113 115 118 121 146"},F:{"92":0.00645,"93":0.03871,"94":0.00645,"95":0.0129,"114":0.00645,"124":0.22579,"125":0.10967,_:"9 11 12 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 60 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 115 116 117 118 119 120 121 122 123 9.5-9.6 10.0-10.1 10.5 10.6 11.1 11.5 11.6 12.1"},B:{"18":0.00645,"92":0.00645,"109":0.00645,"114":0.0129,"122":0.00645,"131":0.00645,"132":0.00645,"133":0.00645,"134":0.00645,"135":0.00645,"136":0.00645,"137":0.00645,"138":0.00645,"139":0.00645,"140":0.00645,"141":0.0129,"142":0.28384,"143":0.99345,_:"12 13 14 15 16 17 79 80 81 83 84 85 86 87 88 89 90 91 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 110 111 112 113 115 116 117 118 119 120 121 123 124 125 126 127 128 129 130"},E:{_:"0 4 5 6 7 8 9 10 11 12 13 14 15 3.1 3.2 5.1 6.1 7.1 9.1 10.1 11.1 12.1 13.1 14.1 15.1 15.2-15.3 15.4 15.5 16.0 16.1 16.2 16.3 16.4 16.5 17.0 17.1 17.2 17.3 17.5 18.0 18.2 18.4 26.3","15.6":0.00645,"16.6":0.00645,"17.4":0.00645,"17.6":0.00645,"18.1":0.00645,"18.3":0.00645,"18.5-18.6":0.00645,"26.0":0.00645,"26.1":0.05161,"26.2":0.01935},G:{"8":0,"3.2":0,"4.0-4.1":0,"4.2-4.3":0.00033,"5.0-5.1":0,"6.0-6.1":0.00065,"7.0-7.1":0.00049,"8.1-8.4":0,"9.0-9.2":0,"9.3":0.0013,"10.0-10.2":0.00016,"10.3":0.00228,"11.0-11.2":0.02803,"11.3-11.4":0.00081,"12.0-12.1":0.00065,"12.2-12.5":0.00733,"13.0-13.1":0.00016,"13.2":0.00114,"13.3":0.00033,"13.4-13.7":0.00114,"14.0-14.4":0.00228,"14.5-14.8":0.00244,"15.0-15.1":0.00261,"15.2-15.3":0.00196,"15.4":0.00212,"15.5":0.00228,"15.6-15.8":0.03536,"16.0":0.00407,"16.1":0.00782,"16.2":0.00407,"16.3":0.00733,"16.4":0.00179,"16.5":0.0031,"16.6-16.7":0.04595,"17.0":0.00261,"17.1":0.00424,"17.2":0.0031,"17.3":0.00473,"17.4":0.00798,"17.5":0.01564,"17.6-17.7":0.03617,"18.0":0.00815,"18.1":0.01695,"18.2":0.00896,"18.3":0.02917,"18.4":0.01499,"18.5-18.7":1.07641,"26.0":0.02102,"26.1":0.17484,"26.2":0.03324,"26.3":0.00147},P:{"4":0.02182,"25":0.01091,"26":0.01091,"27":0.01091,"28":0.03273,"29":0.32729,_:"20 21 22 23 24 5.0-5.4 6.2-6.4 8.2 9.2 10.1 11.1-11.2 12.0 13.0 14.0 15.0 16.0 18.0 19.0","7.2-7.4":0.02182,"17.0":0.01091},I:{"0":0.02835,"3":0,"4":0,"2.1":0,"2.2":0,"2.3":0,"4.1":0,"4.2-4.3":0.00001,"4.4":0,"4.4.3-4.4.4":0.00002},A:{"8":0.06823,"9":0.01365,"10":0.01365,"11":0.25928,_:"6 7 5.5"},K:{"0":0.90655,_:"10 11 12 11.1 11.5 12.1"},N:{_:"10 11"},S:{"2.5":0.00355,_:"3.0-3.1"},J:{_:"7 10"},Q:{"14.9":0.00355},O:{"0":0.1065},H:{"0":0.02},L:{"0":36.44704},R:{_:"0"},M:{"0":0.1136}};

View File

@@ -0,0 +1,3 @@
'use strict';
module.exports = require('./async').sortBy;

View File

@@ -0,0 +1,750 @@
import { entityKind, is } from "../../entity.js";
import { TypedQueryBuilder } from "../../query-builders/query-builder.js";
import { QueryPromise } from "../../query-promise.js";
import { SelectionProxyHandler } from "../../selection-proxy.js";
import { SQL } from "../../sql/sql.js";
import { Subquery } from "../../subquery.js";
import { Table } from "../../table.js";
import {
applyMixins,
getTableColumns,
getTableLikeName,
haveSameKeys,
orderSelectedFields
} from "../../utils.js";
import { extractUsedTable } from "../utils.js";
class SingleStoreSelectBuilder {
static [entityKind] = "SingleStoreSelectBuilder";
fields;
session;
dialect;
withList = [];
distinct;
constructor(config) {
this.fields = config.fields;
this.session = config.session;
this.dialect = config.dialect;
if (config.withList) {
this.withList = config.withList;
}
this.distinct = config.distinct;
}
from(source) {
const isPartialSelect = !!this.fields;
let fields;
if (this.fields) {
fields = this.fields;
} else if (is(source, Subquery)) {
fields = Object.fromEntries(
Object.keys(source._.selectedFields).map((key) => [key, source[key]])
);
} else if (is(source, SQL)) {
fields = {};
} else {
fields = getTableColumns(source);
}
return new SingleStoreSelectBase(
{
table: source,
fields,
isPartialSelect,
session: this.session,
dialect: this.dialect,
withList: this.withList,
distinct: this.distinct
}
);
}
}
class SingleStoreSelectQueryBuilderBase extends TypedQueryBuilder {
static [entityKind] = "SingleStoreSelectQueryBuilder";
_;
config;
joinsNotNullableMap;
tableName;
isPartialSelect;
/** @internal */
session;
dialect;
cacheConfig = void 0;
usedTables = /* @__PURE__ */ new Set();
constructor({ table, fields, isPartialSelect, session, dialect, withList, distinct }) {
super();
this.config = {
withList,
table,
fields: { ...fields },
distinct,
setOperators: []
};
this.isPartialSelect = isPartialSelect;
this.session = session;
this.dialect = dialect;
this._ = {
selectedFields: fields,
config: this.config
};
this.tableName = getTableLikeName(table);
this.joinsNotNullableMap = typeof this.tableName === "string" ? { [this.tableName]: true } : {};
for (const item of extractUsedTable(table)) this.usedTables.add(item);
}
/** @internal */
getUsedTables() {
return [...this.usedTables];
}
createJoin(joinType, lateral) {
return (table, on) => {
const baseTableName = this.tableName;
const tableName = getTableLikeName(table);
for (const item of extractUsedTable(table)) this.usedTables.add(item);
if (typeof tableName === "string" && this.config.joins?.some((join) => join.alias === tableName)) {
throw new Error(`Alias "${tableName}" is already used in this query`);
}
if (!this.isPartialSelect) {
if (Object.keys(this.joinsNotNullableMap).length === 1 && typeof baseTableName === "string") {
this.config.fields = {
[baseTableName]: this.config.fields
};
}
if (typeof tableName === "string" && !is(table, SQL)) {
const selection = is(table, Subquery) ? table._.selectedFields : table[Table.Symbol.Columns];
this.config.fields[tableName] = selection;
}
}
if (typeof on === "function") {
on = on(
new Proxy(
this.config.fields,
new SelectionProxyHandler({ sqlAliasedBehavior: "sql", sqlBehavior: "sql" })
)
);
}
if (!this.config.joins) {
this.config.joins = [];
}
this.config.joins.push({ on, table, joinType, alias: tableName, lateral });
if (typeof tableName === "string") {
switch (joinType) {
case "left": {
this.joinsNotNullableMap[tableName] = false;
break;
}
case "right": {
this.joinsNotNullableMap = Object.fromEntries(
Object.entries(this.joinsNotNullableMap).map(([key]) => [key, false])
);
this.joinsNotNullableMap[tableName] = true;
break;
}
case "cross":
case "inner": {
this.joinsNotNullableMap[tableName] = true;
break;
}
case "full": {
this.joinsNotNullableMap = Object.fromEntries(
Object.entries(this.joinsNotNullableMap).map(([key]) => [key, false])
);
this.joinsNotNullableMap[tableName] = false;
break;
}
}
}
return this;
};
}
/**
* Executes a `left join` operation by adding another table to the current query.
*
* Calling this method associates each row of the table with the corresponding row from the joined table, if a match is found. If no matching row exists, it sets all columns of the joined table to null.
*
* See docs: {@link https://orm.drizzle.team/docs/joins#left-join}
*
* @param table the table to join.
* @param on the `on` clause.
*
* @example
*
* ```ts
* // Select all users and their pets
* const usersWithPets: { user: User; pets: Pet | null; }[] = await db.select()
* .from(users)
* .leftJoin(pets, eq(users.id, pets.ownerId))
*
* // Select userId and petId
* const usersIdsAndPetIds: { userId: number; petId: number | null; }[] = await db.select({
* userId: users.id,
* petId: pets.id,
* })
* .from(users)
* .leftJoin(pets, eq(users.id, pets.ownerId))
* ```
*/
leftJoin = this.createJoin("left", false);
/**
* Executes a `left join lateral` operation by adding subquery to the current query.
*
* A `lateral` join allows the right-hand expression to refer to columns from the left-hand side.
*
* Calling this method associates each row of the table with the corresponding row from the joined table, if a match is found. If no matching row exists, it sets all columns of the joined table to null.
*
* See docs: {@link https://orm.drizzle.team/docs/joins#left-join-lateral}
*
* @param table the subquery to join.
* @param on the `on` clause.
*/
leftJoinLateral = this.createJoin("left", true);
/**
* Executes a `right join` operation by adding another table to the current query.
*
* Calling this method associates each row of the joined table with the corresponding row from the main table, if a match is found. If no matching row exists, it sets all columns of the main table to null.
*
* See docs: {@link https://orm.drizzle.team/docs/joins#right-join}
*
* @param table the table to join.
* @param on the `on` clause.
*
* @example
*
* ```ts
* // Select all users and their pets
* const usersWithPets: { user: User | null; pets: Pet; }[] = await db.select()
* .from(users)
* .rightJoin(pets, eq(users.id, pets.ownerId))
*
* // Select userId and petId
* const usersIdsAndPetIds: { userId: number | null; petId: number; }[] = await db.select({
* userId: users.id,
* petId: pets.id,
* })
* .from(users)
* .rightJoin(pets, eq(users.id, pets.ownerId))
* ```
*/
rightJoin = this.createJoin("right", false);
/**
* Executes an `inner join` operation, creating a new table by combining rows from two tables that have matching values.
*
* Calling this method retrieves rows that have corresponding entries in both joined tables. Rows without matching entries in either table are excluded, resulting in a table that includes only matching pairs.
*
* See docs: {@link https://orm.drizzle.team/docs/joins#inner-join}
*
* @param table the table to join.
* @param on the `on` clause.
*
* @example
*
* ```ts
* // Select all users and their pets
* const usersWithPets: { user: User; pets: Pet; }[] = await db.select()
* .from(users)
* .innerJoin(pets, eq(users.id, pets.ownerId))
*
* // Select userId and petId
* const usersIdsAndPetIds: { userId: number; petId: number; }[] = await db.select({
* userId: users.id,
* petId: pets.id,
* })
* .from(users)
* .innerJoin(pets, eq(users.id, pets.ownerId))
* ```
*/
innerJoin = this.createJoin("inner", false);
/**
* Executes an `inner join lateral` operation, creating a new table by combining rows from two queries that have matching values.
*
* A `lateral` join allows the right-hand expression to refer to columns from the left-hand side.
*
* Calling this method retrieves rows that have corresponding entries in both joined tables. Rows without matching entries in either table are excluded, resulting in a table that includes only matching pairs.
*
* See docs: {@link https://orm.drizzle.team/docs/joins#inner-join-lateral}
*
* @param table the subquery to join.
* @param on the `on` clause.
*/
innerJoinLateral = this.createJoin("inner", true);
/**
* Executes a `full join` operation by combining rows from two tables into a new table.
*
* Calling this method retrieves all rows from both main and joined tables, merging rows with matching values and filling in `null` for non-matching columns.
*
* See docs: {@link https://orm.drizzle.team/docs/joins#full-join}
*
* @param table the table to join.
* @param on the `on` clause.
*
* @example
*
* ```ts
* // Select all users and their pets
* const usersWithPets: { user: User | null; pets: Pet | null; }[] = await db.select()
* .from(users)
* .fullJoin(pets, eq(users.id, pets.ownerId))
*
* // Select userId and petId
* const usersIdsAndPetIds: { userId: number | null; petId: number | null; }[] = await db.select({
* userId: users.id,
* petId: pets.id,
* })
* .from(users)
* .fullJoin(pets, eq(users.id, pets.ownerId))
* ```
*/
fullJoin = this.createJoin("full", false);
/**
* Executes a `cross join` operation by combining rows from two tables into a new table.
*
* Calling this method retrieves all rows from both main and joined tables, merging all rows from each table.
*
* See docs: {@link https://orm.drizzle.team/docs/joins#cross-join}
*
* @param table the table to join.
*
* @example
*
* ```ts
* // Select all users, each user with every pet
* const usersWithPets: { user: User; pets: Pet; }[] = await db.select()
* .from(users)
* .crossJoin(pets)
*
* // Select userId and petId
* const usersIdsAndPetIds: { userId: number; petId: number; }[] = await db.select({
* userId: users.id,
* petId: pets.id,
* })
* .from(users)
* .crossJoin(pets)
* ```
*/
crossJoin = this.createJoin("cross", false);
/**
* Executes a `cross join lateral` operation by combining rows from two queries into a new table.
*
* A `lateral` join allows the right-hand expression to refer to columns from the left-hand side.
*
* Calling this method retrieves all rows from both main and joined queries, merging all rows from each query.
*
* See docs: {@link https://orm.drizzle.team/docs/joins#cross-join-lateral}
*
* @param table the query to join.
*/
crossJoinLateral = this.createJoin("cross", true);
createSetOperator(type, isAll) {
return (rightSelection) => {
const rightSelect = typeof rightSelection === "function" ? rightSelection(getSingleStoreSetOperators()) : rightSelection;
if (!haveSameKeys(this.getSelectedFields(), rightSelect.getSelectedFields())) {
throw new Error(
"Set operator error (union / intersect / except): selected fields are not the same or are in a different order"
);
}
this.config.setOperators.push({ type, isAll, rightSelect });
return this;
};
}
/**
* Adds `union` set operator to the query.
*
* Calling this method will combine the result sets of the `select` statements and remove any duplicate rows that appear across them.
*
* See docs: {@link https://orm.drizzle.team/docs/set-operations#union}
*
* @example
*
* ```ts
* // Select all unique names from customers and users tables
* await db.select({ name: users.name })
* .from(users)
* .union(
* db.select({ name: customers.name }).from(customers)
* );
* // or
* import { union } from 'drizzle-orm/singlestore-core'
*
* await union(
* db.select({ name: users.name }).from(users),
* db.select({ name: customers.name }).from(customers)
* );
* ```
*/
union = this.createSetOperator("union", false);
/**
* Adds `union all` set operator to the query.
*
* Calling this method will combine the result-set of the `select` statements and keep all duplicate rows that appear across them.
*
* See docs: {@link https://orm.drizzle.team/docs/set-operations#union-all}
*
* @example
*
* ```ts
* // Select all transaction ids from both online and in-store sales
* await db.select({ transaction: onlineSales.transactionId })
* .from(onlineSales)
* .unionAll(
* db.select({ transaction: inStoreSales.transactionId }).from(inStoreSales)
* );
* // or
* import { unionAll } from 'drizzle-orm/singlestore-core'
*
* await unionAll(
* db.select({ transaction: onlineSales.transactionId }).from(onlineSales),
* db.select({ transaction: inStoreSales.transactionId }).from(inStoreSales)
* );
* ```
*/
unionAll = this.createSetOperator("union", true);
/**
* Adds `intersect` set operator to the query.
*
* Calling this method will retain only the rows that are present in both result sets and eliminate duplicates.
*
* See docs: {@link https://orm.drizzle.team/docs/set-operations#intersect}
*
* @example
*
* ```ts
* // Select course names that are offered in both departments A and B
* await db.select({ courseName: depA.courseName })
* .from(depA)
* .intersect(
* db.select({ courseName: depB.courseName }).from(depB)
* );
* // or
* import { intersect } from 'drizzle-orm/singlestore-core'
*
* await intersect(
* db.select({ courseName: depA.courseName }).from(depA),
* db.select({ courseName: depB.courseName }).from(depB)
* );
* ```
*/
intersect = this.createSetOperator("intersect", false);
/**
* Adds `except` set operator to the query.
*
* Calling this method will retrieve all unique rows from the left query, except for the rows that are present in the result set of the right query.
*
* See docs: {@link https://orm.drizzle.team/docs/set-operations#except}
*
* @example
*
* ```ts
* // Select all courses offered in department A but not in department B
* await db.select({ courseName: depA.courseName })
* .from(depA)
* .except(
* db.select({ courseName: depB.courseName }).from(depB)
* );
* // or
* import { except } from 'drizzle-orm/singlestore-core'
*
* await except(
* db.select({ courseName: depA.courseName }).from(depA),
* db.select({ courseName: depB.courseName }).from(depB)
* );
* ```
*/
except = this.createSetOperator("except", false);
/**
* Adds `minus` set operator to the query.
*
* This is an alias of `except` supported by SingleStore.
*
* @example
*
* ```ts
* // Select all courses offered in department A but not in department B
* await db.select({ courseName: depA.courseName })
* .from(depA)
* .minus(
* db.select({ courseName: depB.courseName }).from(depB)
* );
* // or
* import { minus } from 'drizzle-orm/singlestore-core'
*
* await minus(
* db.select({ courseName: depA.courseName }).from(depA),
* db.select({ courseName: depB.courseName }).from(depB)
* );
* ```
*/
minus = this.createSetOperator("except", false);
/** @internal */
addSetOperators(setOperators) {
this.config.setOperators.push(...setOperators);
return this;
}
/**
* Adds a `where` clause to the query.
*
* Calling this method will select only those rows that fulfill a specified condition.
*
* See docs: {@link https://orm.drizzle.team/docs/select#filtering}
*
* @param where the `where` clause.
*
* @example
* You can use conditional operators and `sql function` to filter the rows to be selected.
*
* ```ts
* // Select all cars with green color
* await db.select().from(cars).where(eq(cars.color, 'green'));
* // or
* await db.select().from(cars).where(sql`${cars.color} = 'green'`)
* ```
*
* You can logically combine conditional operators with `and()` and `or()` operators:
*
* ```ts
* // Select all BMW cars with a green color
* await db.select().from(cars).where(and(eq(cars.color, 'green'), eq(cars.brand, 'BMW')));
*
* // Select all cars with the green or blue color
* await db.select().from(cars).where(or(eq(cars.color, 'green'), eq(cars.color, 'blue')));
* ```
*/
where(where) {
if (typeof where === "function") {
where = where(
new Proxy(
this.config.fields,
new SelectionProxyHandler({ sqlAliasedBehavior: "sql", sqlBehavior: "sql" })
)
);
}
this.config.where = where;
return this;
}
/**
* Adds a `having` clause to the query.
*
* Calling this method will select only those rows that fulfill a specified condition. It is typically used with aggregate functions to filter the aggregated data based on a specified condition.
*
* See docs: {@link https://orm.drizzle.team/docs/select#aggregations}
*
* @param having the `having` clause.
*
* @example
*
* ```ts
* // Select all brands with more than one car
* await db.select({
* brand: cars.brand,
* count: sql<number>`cast(count(${cars.id}) as int)`,
* })
* .from(cars)
* .groupBy(cars.brand)
* .having(({ count }) => gt(count, 1));
* ```
*/
having(having) {
if (typeof having === "function") {
having = having(
new Proxy(
this.config.fields,
new SelectionProxyHandler({ sqlAliasedBehavior: "sql", sqlBehavior: "sql" })
)
);
}
this.config.having = having;
return this;
}
groupBy(...columns) {
if (typeof columns[0] === "function") {
const groupBy = columns[0](
new Proxy(
this.config.fields,
new SelectionProxyHandler({ sqlAliasedBehavior: "alias", sqlBehavior: "sql" })
)
);
this.config.groupBy = Array.isArray(groupBy) ? groupBy : [groupBy];
} else {
this.config.groupBy = columns;
}
return this;
}
orderBy(...columns) {
if (typeof columns[0] === "function") {
const orderBy = columns[0](
new Proxy(
this.config.fields,
new SelectionProxyHandler({ sqlAliasedBehavior: "alias", sqlBehavior: "sql" })
)
);
const orderByArray = Array.isArray(orderBy) ? orderBy : [orderBy];
if (this.config.setOperators.length > 0) {
this.config.setOperators.at(-1).orderBy = orderByArray;
} else {
this.config.orderBy = orderByArray;
}
} else {
const orderByArray = columns;
if (this.config.setOperators.length > 0) {
this.config.setOperators.at(-1).orderBy = orderByArray;
} else {
this.config.orderBy = orderByArray;
}
}
return this;
}
/**
* Adds a `limit` clause to the query.
*
* Calling this method will set the maximum number of rows that will be returned by this query.
*
* See docs: {@link https://orm.drizzle.team/docs/select#limit--offset}
*
* @param limit the `limit` clause.
*
* @example
*
* ```ts
* // Get the first 10 people from this query.
* await db.select().from(people).limit(10);
* ```
*/
limit(limit) {
if (this.config.setOperators.length > 0) {
this.config.setOperators.at(-1).limit = limit;
} else {
this.config.limit = limit;
}
return this;
}
/**
* Adds an `offset` clause to the query.
*
* Calling this method will skip a number of rows when returning results from this query.
*
* See docs: {@link https://orm.drizzle.team/docs/select#limit--offset}
*
* @param offset the `offset` clause.
*
* @example
*
* ```ts
* // Get the 10th-20th people from this query.
* await db.select().from(people).offset(10).limit(10);
* ```
*/
offset(offset) {
if (this.config.setOperators.length > 0) {
this.config.setOperators.at(-1).offset = offset;
} else {
this.config.offset = offset;
}
return this;
}
/**
* Adds a `for` clause to the query.
*
* Calling this method will specify a lock strength for this query that controls how strictly it acquires exclusive access to the rows being queried.
*
* @param strength the lock strength.
* @param config the lock configuration.
*/
for(strength, config = {}) {
this.config.lockingClause = { strength, config };
return this;
}
/** @internal */
getSQL() {
return this.dialect.buildSelectQuery(this.config);
}
toSQL() {
const { typings: _typings, ...rest } = this.dialect.sqlToQuery(this.getSQL());
return rest;
}
as(alias) {
const usedTables = [];
usedTables.push(...extractUsedTable(this.config.table));
if (this.config.joins) {
for (const it of this.config.joins) usedTables.push(...extractUsedTable(it.table));
}
return new Proxy(
new Subquery(this.getSQL(), this.config.fields, alias, false, [...new Set(usedTables)]),
new SelectionProxyHandler({ alias, sqlAliasedBehavior: "alias", sqlBehavior: "error" })
);
}
/** @internal */
getSelectedFields() {
return new Proxy(
this.config.fields,
new SelectionProxyHandler({ alias: this.tableName, sqlAliasedBehavior: "alias", sqlBehavior: "error" })
);
}
$dynamic() {
return this;
}
}
class SingleStoreSelectBase extends SingleStoreSelectQueryBuilderBase {
static [entityKind] = "SingleStoreSelect";
prepare() {
if (!this.session) {
throw new Error("Cannot execute a query on a query builder. Please use a database instance instead.");
}
const fieldsList = orderSelectedFields(this.config.fields);
const query = this.session.prepareQuery(this.dialect.sqlToQuery(this.getSQL()), fieldsList, void 0, void 0, void 0, {
type: "select",
tables: [...this.usedTables]
}, this.cacheConfig);
query.joinsNotNullableMap = this.joinsNotNullableMap;
return query;
}
$withCache(config) {
this.cacheConfig = config === void 0 ? { config: {}, enable: true, autoInvalidate: true } : config === false ? { enable: false } : { enable: true, autoInvalidate: true, ...config };
return this;
}
execute = (placeholderValues) => {
return this.prepare().execute(placeholderValues);
};
createIterator = () => {
const self = this;
return async function* (placeholderValues) {
yield* self.prepare().iterator(placeholderValues);
};
};
iterator = this.createIterator();
}
applyMixins(SingleStoreSelectBase, [QueryPromise]);
function createSetOperator(type, isAll) {
return (leftSelect, rightSelect, ...restSelects) => {
const setOperators = [rightSelect, ...restSelects].map((select) => ({
type,
isAll,
rightSelect: select
}));
for (const setOperator of setOperators) {
if (!haveSameKeys(leftSelect.getSelectedFields(), setOperator.rightSelect.getSelectedFields())) {
throw new Error(
"Set operator error (union / intersect / except): selected fields are not the same or are in a different order"
);
}
}
return leftSelect.addSetOperators(setOperators);
};
}
const getSingleStoreSetOperators = () => ({
union,
unionAll,
intersect,
except,
minus
});
const union = createSetOperator("union", false);
const unionAll = createSetOperator("union", true);
const intersect = createSetOperator("intersect", false);
const except = createSetOperator("except", false);
const minus = createSetOperator("except", true);
export {
SingleStoreSelectBase,
SingleStoreSelectBuilder,
SingleStoreSelectQueryBuilderBase,
except,
intersect,
minus,
union,
unionAll
};
//# sourceMappingURL=select.js.map

View File

@@ -0,0 +1,32 @@
const MAX_SUGGESTIONS = 5;
/**
* Given [ A, B, C ] return ' Did you mean A, B, or C?'.
*/
export function didYouMean(firstArg, secondArg) {
const [subMessage, suggestionsArg] = secondArg
? [firstArg, secondArg]
: [undefined, firstArg];
let message = ' Did you mean ';
if (subMessage) {
message += subMessage + ' ';
}
const suggestions = suggestionsArg.map((x) => `"${x}"`);
switch (suggestions.length) {
case 0:
return '';
case 1:
return message + suggestions[0] + '?';
case 2:
return message + suggestions[0] + ' or ' + suggestions[1] + '?';
}
const selected = suggestions.slice(0, MAX_SUGGESTIONS);
const lastItem = selected.pop();
return message + selected.join(', ') + ', or ' + lastItem + '?';
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"initContextState.d.ts","sourceRoot":"","sources":["../../../src/forms/Form/initContextState.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,OAAO,EAUR,MAAM,YAAY,CAAA;AAcnB,eAAO,MAAM,gBAAgB,EAAE,OA6B9B,CAAA"}

View File

@@ -0,0 +1,861 @@
import { describe, it, expect } from 'vitest';
import { countChangedFields, countChangedFieldsInRows } from './countChangedFields.js';
describe('countChangedFields', () => {
// locales can be undefined when not configured in payload.config.js
const locales = undefined;
it('should return 0 when no fields have changed', () => {
const fields = [{
name: 'a',
type: 'text'
}, {
name: 'b',
type: 'number'
}];
const valueFrom = {
a: 'original',
b: 123
};
const valueTo = {
a: 'original',
b: 123
};
const result = countChangedFields({
valueFrom,
fields,
valueTo,
locales
});
expect(result).toBe(0);
});
it('should count simple changed fields', () => {
const fields = [{
name: 'a',
type: 'text'
}, {
name: 'b',
type: 'number'
}];
const valueFrom = {
a: 'original',
b: 123
};
const valueTo = {
a: 'changed',
b: 123
};
const result = countChangedFields({
valueFrom,
fields,
valueTo,
locales
});
expect(result).toBe(1);
});
it('should count previously undefined fields', () => {
const fields = [{
name: 'a',
type: 'text'
}, {
name: 'b',
type: 'number'
}];
const valueFrom = {};
const valueTo = {
a: 'new',
b: 123
};
const result = countChangedFields({
valueFrom,
fields,
valueTo,
locales
});
expect(result).toBe(2);
});
it('should not count the id field because it is not displayed in the version view', () => {
const fields = [{
name: 'id',
type: 'text'
}, {
name: 'a',
type: 'text'
}];
const valueFrom = {
id: 'original',
a: 'original'
};
const valueTo = {
id: 'changed',
a: 'original'
};
const result = countChangedFields({
valueFrom,
fields,
valueTo,
locales
});
expect(result).toBe(0);
});
it('should count changed fields inside collapsible fields', () => {
const fields = [{
type: 'collapsible',
label: 'A collapsible field',
fields: [{
name: 'a',
type: 'text'
}, {
name: 'b',
type: 'text'
}, {
name: 'c',
type: 'text'
}]
}];
const valueFrom = {
a: 'original',
b: 'original',
c: 'original'
};
const valueTo = {
a: 'changed',
b: 'changed',
c: 'original'
};
const result = countChangedFields({
valueFrom,
fields,
valueTo,
locales
});
expect(result).toBe(2);
});
it('should count changed fields inside row fields', () => {
const fields = [{
type: 'row',
fields: [{
name: 'a',
type: 'text'
}, {
name: 'b',
type: 'text'
}, {
name: 'c',
type: 'text'
}]
}];
const valueFrom = {
a: 'original',
b: 'original',
c: 'original'
};
const valueTo = {
a: 'changed',
b: 'changed',
c: 'original'
};
const result = countChangedFields({
valueFrom,
fields,
valueTo,
locales
});
expect(result).toBe(2);
});
it('should count changed fields inside group fields', () => {
const fields = [{
type: 'group',
name: 'group',
fields: [{
name: 'a',
type: 'text'
}, {
name: 'b',
type: 'text'
}, {
name: 'c',
type: 'text'
}]
}];
const valueFrom = {
group: {
a: 'original',
b: 'original',
c: 'original'
}
};
const valueTo = {
group: {
a: 'changed',
b: 'changed',
c: 'original'
}
};
const result = countChangedFields({
valueFrom,
fields,
valueTo,
locales
});
expect(result).toBe(2);
});
it('should count changed fields inside unnamed tabs ', () => {
const fields = [{
type: 'tabs',
tabs: [{
label: 'Unnamed tab',
fields: [{
name: 'a',
type: 'text'
}, {
name: 'b',
type: 'text'
}, {
name: 'c',
type: 'text'
}]
}]
}];
const valueFrom = {
a: 'original',
b: 'original',
c: 'original'
};
const valueTo = {
a: 'changed',
b: 'changed',
c: 'original'
};
const result = countChangedFields({
valueFrom,
fields,
valueTo,
locales
});
expect(result).toBe(2);
});
it('should count changed fields inside named tabs ', () => {
const fields = [{
type: 'tabs',
tabs: [{
name: 'namedTab',
fields: [{
name: 'a',
type: 'text'
}, {
name: 'b',
type: 'text'
}, {
name: 'c',
type: 'text'
}]
}]
}];
const valueFrom = {
namedTab: {
a: 'original',
b: 'original',
c: 'original'
}
};
const valueTo = {
namedTab: {
a: 'changed',
b: 'changed',
c: 'original'
}
};
const result = countChangedFields({
valueFrom,
fields,
valueTo,
locales
});
expect(result).toBe(2);
});
it('should ignore UI fields', () => {
const fields = [{
name: 'a',
type: 'text'
}, {
name: 'b',
type: 'ui',
admin: {}
}];
const valueFrom = {
a: 'original',
b: 'original'
};
const valueTo = {
a: 'original',
b: 'changed'
};
const result = countChangedFields({
valueFrom,
fields,
valueTo,
locales
});
expect(result).toBe(0);
});
it('should count changed fields inside array fields', () => {
const fields = [{
name: 'arrayField',
type: 'array',
fields: [{
name: 'a',
type: 'text'
}, {
name: 'b',
type: 'text'
}, {
name: 'c',
type: 'text'
}]
}];
const valueFrom = {
arrayField: [{
a: 'original',
b: 'original',
c: 'original'
}, {
a: 'original',
b: 'original'
}]
};
const valueTo = {
arrayField: [{
a: 'changed',
b: 'changed',
c: 'original'
}, {
a: 'changed',
b: 'changed',
c: 'changed'
}]
};
const result = countChangedFields({
valueFrom,
fields,
valueTo,
locales
});
expect(result).toBe(5);
});
it('should count changed fields inside arrays nested inside of collapsibles', () => {
const fields = [{
type: 'collapsible',
label: 'A collapsible field',
fields: [{
name: 'arrayField',
type: 'array',
fields: [{
name: 'a',
type: 'text'
}, {
name: 'b',
type: 'text'
}, {
name: 'c',
type: 'text'
}]
}]
}];
const valueFrom = {
arrayField: [{
a: 'original',
b: 'original',
c: 'original'
}]
};
const valueTo = {
arrayField: [{
a: 'changed',
b: 'changed',
c: 'original'
}]
};
const result = countChangedFields({
valueFrom,
fields,
valueTo,
locales
});
expect(result).toBe(2);
});
it('should count changed fields inside blocks fields', () => {
const fields = [{
name: 'blocks',
type: 'blocks',
blocks: [{
slug: 'blockA',
fields: [{
name: 'a',
type: 'text'
}, {
name: 'b',
type: 'text'
}, {
name: 'c',
type: 'text'
}]
}]
}];
const valueFrom = {
blocks: [{
blockType: 'blockA',
a: 'original',
b: 'original',
c: 'original'
}, {
blockType: 'blockA',
a: 'original',
b: 'original'
}]
};
const valueTo = {
blocks: [{
blockType: 'blockA',
a: 'changed',
b: 'changed',
c: 'original'
}, {
blockType: 'blockA',
a: 'changed',
b: 'changed',
c: 'changed'
}]
};
const result = countChangedFields({
valueFrom,
fields,
valueTo,
locales
});
expect(result).toBe(5);
});
it('should count changed fields between blocks with different slugs', () => {
const fields = [{
name: 'blocks',
type: 'blocks',
blocks: [{
slug: 'blockA',
fields: [{
name: 'a',
type: 'text'
}, {
name: 'b',
type: 'text'
}, {
name: 'c',
type: 'text'
}]
}, {
slug: 'blockB',
fields: [{
name: 'b',
type: 'text'
}, {
name: 'c',
type: 'text'
}, {
name: 'd',
type: 'text'
}]
}]
}];
const valueFrom = {
blocks: [{
blockType: 'blockA',
a: 'removed',
b: 'original',
c: 'original'
}]
};
const valueTo = {
blocks: [{
blockType: 'blockB',
b: 'original',
c: 'changed',
d: 'new'
}]
};
const result = countChangedFields({
valueFrom,
fields,
valueTo,
locales
});
expect(result).toBe(3);
});
describe('localized fields', () => {
const locales = ['en', 'de'];
it('should count simple localized fields', () => {
const fields = [{
name: 'a',
type: 'text',
localized: true
}, {
name: 'b',
type: 'text',
localized: true
}];
const valueFrom = {
a: {
en: 'original',
de: 'original'
},
b: {
en: 'original',
de: 'original'
}
};
const valueTo = {
a: {
en: 'changed',
de: 'original'
},
b: {
en: 'original',
de: 'original'
}
};
const result = countChangedFields({
valueFrom,
fields,
valueTo,
locales
});
expect(result).toBe(1);
});
it('should count multiple locales of the same localized field', () => {
const locales = ['en', 'de'];
const fields = [{
name: 'a',
type: 'text',
localized: true
}, {
name: 'b',
type: 'text',
localized: true
}];
const valueFrom = {
a: {
en: 'original',
de: 'original'
},
b: {
en: 'original',
de: 'original'
}
};
const valueTo = {
a: {
en: 'changed',
de: 'changed'
},
b: {
en: 'original',
de: 'original'
}
};
const result = countChangedFields({
valueFrom,
fields,
valueTo,
locales
});
expect(result).toBe(2);
});
it('should count changed fields inside localized groups fields', () => {
const fields = [{
type: 'group',
name: 'group',
localized: true,
fields: [{
name: 'a',
type: 'text'
}, {
name: 'b',
type: 'text'
}, {
name: 'c',
type: 'text'
}]
}];
const valueFrom = {
group: {
en: {
a: 'original',
b: 'original',
c: 'original'
},
de: {
a: 'original',
b: 'original',
c: 'original'
}
}
};
const valueTo = {
group: {
en: {
a: 'changed',
b: 'changed',
c: 'original'
},
de: {
a: 'original',
b: 'changed',
c: 'original'
}
}
};
const result = countChangedFields({
valueFrom,
fields,
valueTo,
locales
});
expect(result).toBe(3);
});
it('should count changed fields inside localized tabs', () => {
const fields = [{
type: 'tabs',
tabs: [{
name: 'tab',
localized: true,
fields: [{
name: 'a',
type: 'text'
}, {
name: 'b',
type: 'text'
}, {
name: 'c',
type: 'text'
}]
}]
}];
const valueFrom = {
tab: {
en: {
a: 'original',
b: 'original',
c: 'original'
},
de: {
a: 'original',
b: 'original',
c: 'original'
}
}
};
const valueTo = {
tab: {
en: {
a: 'changed',
b: 'changed',
c: 'original'
},
de: {
a: 'original',
b: 'changed',
c: 'original'
}
}
};
const result = countChangedFields({
valueFrom,
fields,
valueTo,
locales
});
expect(result).toBe(3);
});
it('should count changed fields inside localized array fields', () => {
const fields = [{
name: 'arrayField',
type: 'array',
localized: true,
fields: [{
name: 'a',
type: 'text'
}, {
name: 'b',
type: 'text'
}, {
name: 'c',
type: 'text'
}]
}];
const valueFrom = {
arrayField: {
en: [{
a: 'original',
b: 'original',
c: 'original'
}],
de: [{
a: 'original',
b: 'original',
c: 'original'
}]
}
};
const valueTo = {
arrayField: {
en: [{
a: 'changed',
b: 'changed',
c: 'original'
}],
de: [{
a: 'original',
b: 'changed',
c: 'original'
}]
}
};
const result = countChangedFields({
valueFrom,
fields,
valueTo,
locales
});
expect(result).toBe(3);
});
it('should count changed fields inside localized blocks fields', () => {
const fields = [{
name: 'blocks',
type: 'blocks',
localized: true,
blocks: [{
slug: 'blockA',
fields: [{
name: 'a',
type: 'text'
}, {
name: 'b',
type: 'text'
}, {
name: 'c',
type: 'text'
}]
}]
}];
const valueFrom = {
blocks: {
en: [{
blockType: 'blockA',
a: 'original',
b: 'original',
c: 'original'
}],
de: [{
blockType: 'blockA',
a: 'original',
b: 'original',
c: 'original'
}]
}
};
const valueTo = {
blocks: {
en: [{
blockType: 'blockA',
a: 'changed',
b: 'changed',
c: 'original'
}],
de: [{
blockType: 'blockA',
a: 'original',
b: 'changed',
c: 'original'
}]
}
};
const result = countChangedFields({
valueFrom,
fields,
valueTo,
locales
});
expect(result).toBe(3);
});
});
});
describe('countChangedFieldsInRows', () => {
it('should count fields in array rows', () => {
const field = {
name: 'myArray',
type: 'array',
fields: [{
name: 'a',
type: 'text'
}, {
name: 'b',
type: 'text'
}, {
name: 'c',
type: 'text'
}]
};
const valueFromRows = [{
a: 'original',
b: 'original',
c: 'original'
}];
const valueToRows = [{
a: 'changed',
b: 'changed',
c: 'original'
}];
const result = countChangedFieldsInRows({
valueFromRows,
field,
locales: undefined,
valueToRows: valueToRows
});
expect(result).toBe(2);
});
it('should count fields in blocks', () => {
const field = {
name: 'myBlocks',
type: 'blocks',
blocks: [{
slug: 'blockA',
fields: [{
name: 'a',
type: 'text'
}, {
name: 'b',
type: 'text'
}, {
name: 'c',
type: 'text'
}]
}]
};
const valueFromRows = [{
blockType: 'blockA',
a: 'original',
b: 'original',
c: 'original'
}];
const valueToRows = [{
blockType: 'blockA',
a: 'changed',
b: 'changed',
c: 'original'
}];
const result = countChangedFieldsInRows({
valueFromRows,
field,
locales: undefined,
valueToRows
});
expect(result).toBe(2);
});
});
//# sourceMappingURL=countChangedFields.spec.js.map

View File

@@ -0,0 +1,32 @@
import { feedbackAsyncIntegration } from './feedbackAsync';
import { feedbackSyncIntegration } from './feedbackSync';
export * from './exports';
export { reportingObserverIntegration } from './integrations/reportingobserver';
export { httpClientIntegration } from './integrations/httpclient';
export { contextLinesIntegration } from './integrations/contextlines';
export { graphqlClientIntegration } from './integrations/graphqlClient';
export { captureConsoleIntegration, extraErrorDataIntegration, rewriteFramesIntegration, consoleLoggingIntegration, createConsolaReporter, } from '@sentry/core';
export { replayIntegration, getReplay } from '@sentry-internal/replay';
export type { ReplayEventType, ReplayEventWithTime, ReplayBreadcrumbFrame, ReplayBreadcrumbFrameEvent, ReplayOptionFrameEvent, ReplayFrame, ReplayFrameEvent, ReplaySpanFrame, ReplaySpanFrameEvent, } from '@sentry-internal/replay';
export { replayCanvasIntegration } from '@sentry-internal/replay-canvas';
export { feedbackAsyncIntegration, feedbackSyncIntegration, feedbackSyncIntegration as feedbackIntegration };
export { getFeedback, sendFeedback } from '@sentry-internal/feedback';
export { defaultRequestInstrumentationOptions, instrumentOutgoingRequests } from './tracing/request';
export { browserTracingIntegration, startBrowserTracingNavigationSpan, startBrowserTracingPageLoadSpan, } from './tracing/browserTracingIntegration';
export { reportPageLoaded } from './tracing/reportPageLoaded';
export { setActiveSpanInBrowser } from './tracing/setActiveSpan';
export type { RequestInstrumentationOptions } from './tracing/request';
export { registerSpanErrorInstrumentation, getActiveSpan, getRootSpan, startSpan, startInactiveSpan, startSpanManual, withActiveSpan, startNewTrace, getSpanDescendants, setMeasurement, getSpanStatusFromHttpCode, setHttpStatus, makeMultiplexedTransport, MULTIPLEXED_TRANSPORT_EXTRA_KEY, moduleMetadataIntegration, supabaseIntegration, instrumentSupabaseClient, zodErrorsIntegration, thirdPartyErrorFilterIntegration, featureFlagsIntegration, instrumentAnthropicAiClient, instrumentOpenAiClient, instrumentGoogleGenAIClient, instrumentLangGraph, createLangChainCallbackHandler, logger, } from '@sentry/core';
export type { Span, FeatureFlagsIntegration } from '@sentry/core';
export { makeBrowserOfflineTransport } from './transports/offline';
export { browserProfilingIntegration } from './profiling/integration';
export { spotlightBrowserIntegration } from './integrations/spotlight';
export { cultureContextIntegration } from './integrations/culturecontext';
export { launchDarklyIntegration, buildLaunchDarklyFlagUsedHandler } from './integrations/featureFlags/launchdarkly';
export { openFeatureIntegration, OpenFeatureIntegrationHook } from './integrations/featureFlags/openfeature';
export { unleashIntegration } from './integrations/featureFlags/unleash';
export { growthbookIntegration } from './integrations/featureFlags/growthbook';
export { statsigIntegration } from './integrations/featureFlags/statsig';
export { diagnoseSdkConnectivity } from './diagnose-sdk';
export { webWorkerIntegration, registerWebWorker } from './integrations/webWorker';
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,36 @@
import { InvalidConfiguration } from '../../errors/InvalidConfiguration.js';
import { fieldAffectsData } from '../../fields/config/types.js';
import { flattenTopLevelFields } from '../../utilities/flattenTopLevelFields.js';
/**
* Validate useAsTitle for collections.
*/ export const validateUseAsTitle = (config)=>{
if (config.admin?.useAsTitle?.includes('.')) {
throw new InvalidConfiguration(`"useAsTitle" cannot be a nested field. Please specify a top-level field in the collection "${config.slug}"`);
}
if (config?.admin && config.admin?.useAsTitle && config.admin.useAsTitle !== 'id') {
const fields = flattenTopLevelFields(config.fields);
const useAsTitleField = fields.find((field)=>{
if (fieldAffectsData(field) && config.admin) {
return field.name === config.admin.useAsTitle;
}
return false;
});
// If auth is enabled then we don't need to
if (config.auth) {
if (config.admin.useAsTitle !== 'email') {
if (!useAsTitleField) {
throw new InvalidConfiguration(`The field "${config.admin.useAsTitle}" specified in "admin.useAsTitle" does not exist in the collection "${config.slug}"`);
}
}
} else {
if (useAsTitleField && 'virtual' in useAsTitleField && useAsTitleField.virtual === true) {
throw new InvalidConfiguration(`The field "${config.admin.useAsTitle}" specified in "admin.useAsTitle" in the collection "${config.slug}" is virtual. A virtual field can be used as the title only when linked to a relationship field.`);
}
if (!useAsTitleField) {
throw new InvalidConfiguration(`The field "${config.admin.useAsTitle}" specified in "admin.useAsTitle" does not exist in the collection "${config.slug}"`);
}
}
}
};
//# sourceMappingURL=useAsTitle.js.map

View File

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

View File

@@ -0,0 +1 @@
{"version":3,"names":["generatorFunctions","require","deprecatedGeneratorFunctions","generatorInfosMap","exports","Map","index","key","Object","keys","sort","startsWith","set","undefined"],"sources":["../src/nodes.ts"],"sourcesContent":["import type * as t from \"@babel/types\";\n\nimport * as generatorFunctions from \"./generators/index.ts\";\nimport * as deprecatedGeneratorFunctions from \"./generators/deprecated.ts\";\nimport type { NodeHandler } from \"./node/index.ts\";\nimport type Printer from \"./printer.ts\";\n\ndeclare global {\n function __node(type: t.Node[\"type\"]): number;\n}\n\nconst generatorInfosMap = new Map<\n string,\n [\n (this: Printer, node: t.Node, parent?: t.Node | null) => void,\n number,\n NodeHandler<boolean> | undefined,\n ]\n>();\nlet index = 0;\n\nfor (const key of Object.keys(generatorFunctions).sort() as Exclude<\n keyof typeof generatorFunctions,\n `_${string}`\n>[]) {\n if (key.startsWith(\"_\")) continue;\n generatorInfosMap.set(key, [generatorFunctions[key], index++, undefined]);\n}\nif (!process.env.BABEL_8_BREAKING) {\n for (const key of Object.keys(\n deprecatedGeneratorFunctions,\n ) as (keyof typeof deprecatedGeneratorFunctions)[]) {\n generatorInfosMap.set(key, [\n deprecatedGeneratorFunctions[key],\n index++,\n undefined,\n ]);\n }\n}\n\nexport { generatorInfosMap };\n"],"mappings":";;;;;;AAEA,IAAAA,kBAAA,GAAAC,OAAA;AACA,IAAAC,4BAAA,GAAAD,OAAA;AAQA,MAAME,iBAAiB,GAAAC,OAAA,CAAAD,iBAAA,GAAG,IAAIE,GAAG,CAO/B,CAAC;AACH,IAAIC,KAAK,GAAG,CAAC;AAEb,KAAK,MAAMC,GAAG,IAAIC,MAAM,CAACC,IAAI,CAACT,kBAAkB,CAAC,CAACU,IAAI,CAAC,CAAC,EAGnD;EACH,IAAIH,GAAG,CAACI,UAAU,CAAC,GAAG,CAAC,EAAE;EACzBR,iBAAiB,CAACS,GAAG,CAACL,GAAG,EAAE,CAACP,kBAAkB,CAACO,GAAG,CAAC,EAAED,KAAK,EAAE,EAAEO,SAAS,CAAC,CAAC;AAC3E;AAEE,KAAK,MAAMN,GAAG,IAAIC,MAAM,CAACC,IAAI,CAC3BP,4BACF,CAAC,EAAmD;EAClDC,iBAAiB,CAACS,GAAG,CAACL,GAAG,EAAE,CACzBL,4BAA4B,CAACK,GAAG,CAAC,EACjCD,KAAK,EAAE,EACPO,SAAS,CACV,CAAC;AACJ","ignoreList":[]}

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 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","2":"C L M G N O P"},C:{"1":"0 1 2 3 4 5 6 7 8 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 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 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 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":"9 J bB K D E F A B C L M G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC","196":"6B XC 7B 8B","324":"9B"},E:{"1":"iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","2":"J bB K D E F A B C 6C bC 7C 8C 9C AD cC PC","516":"L M G QC BD CD DD dC eC RC ED SC fC gC hC"},F:{"1":"0 1 2 3 4 5 6 7 8 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":"9 F B C G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB JD KD LD MD PC xC ND QC"},G:{"1":"iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC","2":"E bC OD yC PD QD RD SD TD UD VD WD XD YD ZD aD bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC"},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:{"2":"9 J AB BB CB DB EB FB GB HB IB tD uD vD wD xD cC yD zD 0D 1D 2D SC TC UC 3D"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"7D","2":"6D"}},B:5,C:"Server Timing",D:true};

View File

@@ -0,0 +1,19 @@
import type { FolderBreadcrumb } from 'payload/shared';
import React from 'react';
import './index.scss';
type Props = {
readonly breadcrumbs: {
id: null | number | string;
name: React.ReactNode | string;
onClick: () => void;
}[];
className?: string;
};
export declare function FolderBreadcrumbs({ breadcrumbs, className }: Props): React.JSX.Element;
export declare function DroppableBreadcrumb({ id, children, className, onClick, }: {
children: React.ReactNode;
className?: string;
onClick: () => void;
} & Pick<FolderBreadcrumb, 'id'>): React.JSX.Element;
export {};
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,22 @@
import fs from 'fs/promises';
import { mapAsync } from '../utilities/mapAsync.js';
/**
* Cleanup temp files after operation lifecycle
*/ export const unlinkTempFiles = async ({ collectionConfig, config, req })=>{
if (config.upload?.useTempFiles && collectionConfig.upload) {
const { file } = req;
const fileArray = [
{
file
}
];
await mapAsync(fileArray, async ({ file })=>{
// Still need this check because this will not be populated if using local API
if (file?.tempFilePath) {
await fs.unlink(file.tempFilePath);
}
});
}
};
//# sourceMappingURL=unlinkTempFiles.js.map

View File

@@ -0,0 +1,530 @@
(() => {
var _window$dateFns;function _typeof(o) {"@babel/helpers - typeof";return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;}, _typeof(o);}function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}var __defProp = Object.defineProperty;
var __export = function __export(target, all) {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: function set(newValue) {return all[name] = function () {return newValue;};}
});
};
// lib/locale/en-US/_lib/formatDistance.js
var formatDistanceLocale = {
lessThanXSeconds: {
one: "less than a second",
other: "less than {{count}} seconds"
},
xSeconds: {
one: "1 second",
other: "{{count}} seconds"
},
halfAMinute: "half a minute",
lessThanXMinutes: {
one: "less than a minute",
other: "less than {{count}} minutes"
},
xMinutes: {
one: "1 minute",
other: "{{count}} minutes"
},
aboutXHours: {
one: "about 1 hour",
other: "about {{count}} hours"
},
xHours: {
one: "1 hour",
other: "{{count}} hours"
},
xDays: {
one: "1 day",
other: "{{count}} days"
},
aboutXWeeks: {
one: "about 1 week",
other: "about {{count}} weeks"
},
xWeeks: {
one: "1 week",
other: "{{count}} weeks"
},
aboutXMonths: {
one: "about 1 month",
other: "about {{count}} months"
},
xMonths: {
one: "1 month",
other: "{{count}} months"
},
aboutXYears: {
one: "about 1 year",
other: "about {{count}} years"
},
xYears: {
one: "1 year",
other: "{{count}} years"
},
overXYears: {
one: "over 1 year",
other: "over {{count}} years"
},
almostXYears: {
one: "almost 1 year",
other: "almost {{count}} years"
}
};
var formatDistance = function formatDistance(token, count, options) {
var result;
var tokenValue = formatDistanceLocale[token];
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", count.toString());
}
if (options !== null && options !== void 0 && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "in " + result;
} else {
return result + " ago";
}
}
return result;
};
// lib/locale/en-US/_lib/formatRelative.js
var formatRelativeLocale = {
lastWeek: "'last' eeee 'at' p",
yesterday: "'yesterday at' p",
today: "'today at' p",
tomorrow: "'tomorrow at' p",
nextWeek: "eeee 'at' p",
other: "P"
};
var formatRelative = function formatRelative(token, _date, _baseDate, _options) {return formatRelativeLocale[token];};
// lib/locale/_lib/buildLocalizeFn.js
function buildLocalizeFn(args) {
return function (value, options) {
var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
var valuesArray;
if (context === "formatting" && args.formattingValues) {
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
var _defaultWidth = args.defaultWidth;
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[_width] || args.values[_defaultWidth];
}
var index = args.argumentCallback ? args.argumentCallback(value) : value;
return valuesArray[index];
};
}
// lib/locale/en-US/_lib/localize.js
var eraValues = {
narrow: ["B", "A"],
abbreviated: ["BC", "AD"],
wide: ["Before Christ", "Anno Domini"]
};
var quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"]
};
var monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec"],
wide: [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December"]
};
var dayValues = {
narrow: ["S", "M", "T", "W", "T", "F", "S"],
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
wide: [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday"]
};
var dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night"
}
};
var formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night"
}
};
var ordinalNumber = function ordinalNumber(dirtyNumber, _options) {
var number = Number(dirtyNumber);
var rem100 = number % 100;
if (rem100 > 20 || rem100 < 10) {
switch (rem100 % 10) {
case 1:
return number + "st";
case 2:
return number + "nd";
case 3:
return number + "rd";
}
}
return number + "th";
};
var localize = {
ordinalNumber: ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide"
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: function argumentCallback(quarter) {return quarter - 1;}
}),
month: buildLocalizeFn({
values: monthValues,
defaultWidth: "wide"
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide"
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide"
})
};
// lib/locale/_lib/buildMatchFn.js
function buildMatchFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {return pattern.test(matchedString);}) : findKey(parsePatterns, function (pattern) {return pattern.test(matchedString);});
var value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
function findKey(object, predicate) {
for (var key in object) {
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
return key;
}
}
return;
}
function findIndex(array, predicate) {
for (var key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return;
}
// lib/locale/_lib/buildMatchPatternFn.js
function buildMatchPatternFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var matchResult = string.match(args.matchPattern);
if (!matchResult)
return null;
var matchedString = matchResult[0];
var parseResult = string.match(args.parsePattern);
if (!parseResult)
return null;
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
// lib/locale/en-US/_lib/match.js
var matchOrdinalNumberPattern = /^(\d+)(th|st|nd|rd)?/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
narrow: /^(b|a)/i,
abbreviated: /^(b\.?\s?c\.?|b\.?\s?c\.?\s?e\.?|a\.?\s?d\.?|c\.?\s?e\.?)/i,
wide: /^(before christ|before common era|anno domini|common era)/i
};
var parseEraPatterns = {
any: [/^b/i, /^(a|c)/i]
};
var matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](th|st|nd|rd)? quarter/i
};
var parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated: /^(jan|feb|mar|apr|may|jun|jul|aug|sep|oct|nov|dec)/i,
wide: /^(january|february|march|april|may|june|july|august|september|october|november|december)/i
};
var parseMonthPatterns = {
narrow: [
/^j/i,
/^f/i,
/^m/i,
/^a/i,
/^m/i,
/^j/i,
/^j/i,
/^a/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i],
any: [
/^ja/i,
/^f/i,
/^mar/i,
/^ap/i,
/^may/i,
/^jun/i,
/^jul/i,
/^au/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i]
};
var matchDayPatterns = {
narrow: /^[smtwf]/i,
short: /^(su|mo|tu|we|th|fr|sa)/i,
abbreviated: /^(sun|mon|tue|wed|thu|fri|sat)/i,
wide: /^(sunday|monday|tuesday|wednesday|thursday|friday|saturday)/i
};
var parseDayPatterns = {
narrow: [/^s/i, /^m/i, /^t/i, /^w/i, /^t/i, /^f/i, /^s/i],
any: [/^su/i, /^m/i, /^tu/i, /^w/i, /^th/i, /^f/i, /^sa/i]
};
var matchDayPeriodPatterns = {
narrow: /^(a|p|mi|n|(in the|at) (morning|afternoon|evening|night))/i,
any: /^([ap]\.?\s?m\.?|midnight|noon|(in the|at) (morning|afternoon|evening|night))/i
};
var parseDayPeriodPatterns = {
any: {
am: /^a/i,
pm: /^p/i,
midnight: /^mi/i,
noon: /^no/i,
morning: /morning/i,
afternoon: /afternoon/i,
evening: /evening/i,
night: /night/i
}
};
var match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function valueCallback(value) {return parseInt(value, 10);}
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any"
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: function valueCallback(index) {return index + 1;}
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any"
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any"
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any"
})
};
// lib/locale/_lib/buildFormatLongFn.js
function buildFormatLongFn(args) {
return function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var width = options.width ? String(options.width) : args.defaultWidth;
var format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
// lib/locale/en-ZA/_lib/formatLong.js
var dateFormats = {
full: "EEEE, dd MMMM yyyy",
long: "dd MMMM yyyy",
medium: "dd MMM yyyy",
short: "yyyy/MM/dd"
};
var timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm"
};
var dateTimeFormats = {
full: "{{date}} 'at' {{time}}",
long: "{{date}} 'at' {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}"
};
var formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full"
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full"
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full"
})
};
// lib/locale/en-ZA.js
var enZA = {
code: "en-ZA",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 0,
firstWeekContainsDate: 1
}
};
// lib/locale/en-ZA/cdn.js
window.dateFns = _objectSpread(_objectSpread({},
window.dateFns), {}, {
locale: _objectSpread(_objectSpread({}, (_window$dateFns =
window.dateFns) === null || _window$dateFns === void 0 ? void 0 : _window$dateFns.locale), {}, {
enZA: enZA }) });
//# debugId=5C6077049711990764756E2164756E21
//# sourceMappingURL=cdn.js.map
})();

View File

@@ -0,0 +1,211 @@
# Changelog
## [2.0.6](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v2.0.5...import-in-the-middle-v2.0.6) (2026-01-27)
### Bug Fixes
* ensure the callback 'name' arg is the module name when matching the module main file, even when 'internals: true' option is used ([#241](https://github.com/nodejs/import-in-the-middle/issues/241)) ([ad9d02c](https://github.com/nodejs/import-in-the-middle/commit/ad9d02cd774df110c5e2f72e6cca414d7c315404))
* fix a couple issues with duplicate entries and specifier (submodule) matching ([#237](https://github.com/nodejs/import-in-the-middle/issues/237)) ([fdc0b3d](https://github.com/nodejs/import-in-the-middle/commit/fdc0b3d5863a1338586e25a94b831fee1bd8bd0b))
* properly hook builtin modules that require the 'node:' prefix ([#240](https://github.com/nodejs/import-in-the-middle/issues/240)) ([de84589](https://github.com/nodejs/import-in-the-middle/commit/de8458962958182eac743e99edeb944160638e2c))
* properly hook builtin modules that require the 'node:' prefix ([#240](https://github.com/nodejs/import-in-the-middle/issues/240)) ([9d916a5](https://github.com/nodejs/import-in-the-middle/commit/9d916a59b4a95b2a22568d1e8f65948598178de9))
## [2.0.5](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v2.0.4...import-in-the-middle-v2.0.5) (2026-01-20)
### Bug Fixes
* handle lazy initialization and circular dependencies ([#229](https://github.com/nodejs/import-in-the-middle/issues/229)) ([d1421dc](https://github.com/nodejs/import-in-the-middle/commit/d1421dc0ae65ce6da5de5cb58f41af99f9d87371))
* entrypoint can be treated as CommonJS when loader chains add query params to file URLs ([#223](https://github.com/nodejs/import-in-the-middle/issues/223)) ([60ab14a](https://github.com/nodejs/import-in-the-middle/commit/60ab14aeed8960b5dec4bec571a81649363e256e))
## [2.0.4](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v2.0.3...import-in-the-middle-v2.0.4) (2026-01-14)
### Bug Fixes
* do not instrument the top level module ([#225](https://github.com/nodejs/import-in-the-middle/issues/225)) ([b563b35](https://github.com/nodejs/import-in-the-middle/commit/b563b35c74b96554b5112905391ec3842162b7ee))
## [2.0.3](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v2.0.2...import-in-the-middle-v2.0.3) (2026-01-13)
### Bug Fixes
* add missing JSDoc type information ([40c1009](https://github.com/nodejs/import-in-the-middle/commit/40c1009ef3acc45b5eec89ed1b866866933edace))
* add missing name for fast builtin lookup ([40c1009](https://github.com/nodejs/import-in-the-middle/commit/40c1009ef3acc45b5eec89ed1b866866933edace))
* do not crash on missing setters ([#223](https://github.com/nodejs/import-in-the-middle/issues/223)) ([fe44778](https://github.com/nodejs/import-in-the-middle/commit/fe4477832aa9a3422ebecf0a2460cf77be3b3581))
* handle undefined exports properly ([40c1009](https://github.com/nodejs/import-in-the-middle/commit/40c1009ef3acc45b5eec89ed1b866866933edace))
* multiple minor issues ([#221](https://github.com/nodejs/import-in-the-middle/issues/221)) ([40c1009](https://github.com/nodejs/import-in-the-middle/commit/40c1009ef3acc45b5eec89ed1b866866933edace))
* remove small memory leak ([40c1009](https://github.com/nodejs/import-in-the-middle/commit/40c1009ef3acc45b5eec89ed1b866866933edace))
### Performance Improvements
* improve perf by calculating less stack frames and fast paths ([#224](https://github.com/nodejs/import-in-the-middle/issues/224)) ([09ae8bf](https://github.com/nodejs/import-in-the-middle/commit/09ae8bfdeedf6c1c8c81c7338858004447e68233))
## [2.0.2](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v2.0.1...import-in-the-middle-v2.0.2) (2026-01-11)
### Bug Fixes
* grammar issue in README.md ([#216](https://github.com/nodejs/import-in-the-middle/issues/216)) ([46e4a2a](https://github.com/nodejs/import-in-the-middle/commit/46e4a2a9ad250c06fb52c9b782370071a6d1f3cc))
* properly handle internals when specifier matches ([#220](https://github.com/nodejs/import-in-the-middle/issues/220)) ([05e4216](https://github.com/nodejs/import-in-the-middle/commit/05e4216e10d11c7eb996d4124f36e476f3a6d42f))
## [2.0.1](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v2.0.0...import-in-the-middle-v2.0.1) (2025-12-18)
### Bug Fixes
* properly hook submodule package exports ([#215](https://github.com/nodejs/import-in-the-middle/issues/215)) ([a20f47a](https://github.com/nodejs/import-in-the-middle/commit/a20f47a3013105a235f2ba48bc17319f7a57636c))
## [2.0.0](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.15.0...import-in-the-middle-v2.0.0) (2025-10-14)
### ⚠ BREAKING CHANGES
Converting all modules running in the loader thread to ESM should not be a
breaking change for most users since it primarily affects internal implementation
details. However, if you were referencing internal CJS files like `hook.js` this will no longer work.
### Features
* convert all modules running in loader thread to ESM ([#210](https://github.com/nodejs/import-in-the-middle/issues/210)) ([da7c7a6](https://github.com/nodejs/import-in-the-middle/commit/da7c7a6904a40bf394b7b2a271a2838711c5417c))
## [1.15.0](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.14.4...import-in-the-middle-v1.15.0) (2025-10-09)
### Features
* Compatibility with specifier imports ([#211](https://github.com/nodejs/import-in-the-middle/issues/211)) ([83d662a](https://github.com/nodejs/import-in-the-middle/commit/83d662a8e1f9a7b8632bc78f7499ccc0ab4d12c2))
## [1.14.4](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.14.3...import-in-the-middle-v1.14.4) (2025-09-25)
### Bug Fixes
* Revert "use `createRequire` to load `hook.js` ([#205](https://github.com/nodejs/import-in-the-middle/issues/205))" ([#208](https://github.com/nodejs/import-in-the-middle/issues/208)) ([f23b7ef](https://github.com/nodejs/import-in-the-middle/commit/f23b7ef9e8d4103f21865ec7a1e5374f41d38ff5))
## [1.14.3](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.14.2...import-in-the-middle-v1.14.3) (2025-09-24)
### Bug Fixes
* use `createRequire` to load `hook.js` ([#205](https://github.com/nodejs/import-in-the-middle/issues/205)) ([81a2ae0](https://github.com/nodejs/import-in-the-middle/commit/81a2ae0ea094df27c9baaf6e267276e0acb21af1))
## [1.14.2](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.14.1...import-in-the-middle-v1.14.2) (2025-06-13)
### Bug Fixes
* do not replace dollar sign in shim variable name ([#200](https://github.com/nodejs/import-in-the-middle/issues/200)) ([20bf0e5](https://github.com/nodejs/import-in-the-middle/commit/20bf0e5c5f6f44f42a8618ad45d08622a63d4d45))
## [1.14.1](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.14.0...import-in-the-middle-v1.14.1) (2025-06-12)
### Bug Fixes
* Account for invalid identifiers ([#198](https://github.com/nodejs/import-in-the-middle/issues/198)) ([2cc8207](https://github.com/nodejs/import-in-the-middle/commit/2cc82070a5ca947463b70f28647b03496a9526f0))
## [1.14.0](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.13.2...import-in-the-middle-v1.14.0) (2025-05-24)
### Features
* Optionally hook internal paths like `require-in-the-middle` ([#194](https://github.com/nodejs/import-in-the-middle/issues/194)) ([976d032](https://github.com/nodejs/import-in-the-middle/commit/976d0320426dcbf8e6260504eccbb62d83513f5a))
## [1.13.2](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.13.1...import-in-the-middle-v1.13.2) (2025-05-12)
### Bug Fixes
* Don't attempt to wrap TypeScript modules ([#191](https://github.com/nodejs/import-in-the-middle/issues/191)) ([6deb87e](https://github.com/nodejs/import-in-the-middle/commit/6deb87ea069ec2ee749ce2297ea47ce071d18cf9))
## [1.13.1](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.13.0...import-in-the-middle-v1.13.1) (2025-02-28)
### Bug Fixes
* handling of circular dependencies ([#181](https://github.com/nodejs/import-in-the-middle/issues/181)) ([b58092e](https://github.com/nodejs/import-in-the-middle/commit/b58092ec9becf4a14f541da4cf5bfb190f2a9a9b))
* importing JSON files ([#182](https://github.com/nodejs/import-in-the-middle/issues/182)) ([8c52014](https://github.com/nodejs/import-in-the-middle/commit/8c52014658fcf698cc340d032b441d9e7a65be36))
* warning from use of context.importAssertions ([#179](https://github.com/nodejs/import-in-the-middle/issues/179)) ([8e56cf1](https://github.com/nodejs/import-in-the-middle/commit/8e56cf1e89752e6c8768d648c10c12fb3178e2ae))
## [1.13.0](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.12.0...import-in-the-middle-v1.13.0) (2025-02-06)
### Features
* Support import attributes ([#176](https://github.com/nodejs/import-in-the-middle/issues/176)) ([916af26](https://github.com/nodejs/import-in-the-middle/commit/916af2627e0e8cb6d50a3b54c1a280dc16e20925))
## [1.12.0](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.11.3...import-in-the-middle-v1.12.0) (2024-12-13)
### Features
* Support absolute paths for `include` ([#168](https://github.com/nodejs/import-in-the-middle/issues/168)) ([d0d9bc3](https://github.com/nodejs/import-in-the-middle/commit/d0d9bc3d1e0bcef1094af58c15cf997507777067))
* Warn on multiple hook initialization ([#165](https://github.com/nodejs/import-in-the-middle/issues/165)) ([9bd539e](https://github.com/nodejs/import-in-the-middle/commit/9bd539ea6ff1684c8807bc30c8b68882cc9e057f))
## [1.11.3](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.11.2...import-in-the-middle-v1.11.3) (2024-12-04)
### Bug Fixes
* Correct type definition for waitForAllMessagesAcknowledged ([#160](https://github.com/nodejs/import-in-the-middle/issues/160)) ([353d535](https://github.com/nodejs/import-in-the-middle/commit/353d535d1ce7ba485e137bcf3db08bbddd6b31d6))
## [1.11.2](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.11.1...import-in-the-middle-v1.11.2) (2024-09-30)
### Bug Fixes
* do nothing if target does not exist in getters map ([#155](https://github.com/nodejs/import-in-the-middle/issues/155)) ([5f6be49](https://github.com/nodejs/import-in-the-middle/commit/5f6be494fc11caf8dcf900807c5b6b646fcd8d74))
## [1.11.1](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.11.0...import-in-the-middle-v1.11.1) (2024-09-26)
### Bug Fixes
* Support Hooking multiple times ([#153](https://github.com/nodejs/import-in-the-middle/issues/153)) ([e0d8080](https://github.com/nodejs/import-in-the-middle/commit/e0d808041eff228f4b4519454f7eea8f0930238a))
## [1.11.0](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.10.0...import-in-the-middle-v1.11.0) (2024-07-29)
### Features
* Optionally only wrap modules hooked in `--import` ([#146](https://github.com/nodejs/import-in-the-middle/issues/146)) ([71c8d7b](https://github.com/nodejs/import-in-the-middle/commit/71c8d7bac512df94566d12c96fc2e438b4de2e2a))
### Bug Fixes
* `node:` prefixed build-in modules with `include`/`exclude` ([#149](https://github.com/nodejs/import-in-the-middle/issues/149)) ([736a944](https://github.com/nodejs/import-in-the-middle/commit/736a9446e209bc8649801a27cb431df663551dc5))
## [1.10.0](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.9.1...import-in-the-middle-v1.10.0) (2024-07-22)
### Features
* Allow regex for `include` and `exclude` options ([#148](https://github.com/nodejs/import-in-the-middle/issues/148)) ([697b0d2](https://github.com/nodejs/import-in-the-middle/commit/697b0d239b9a738f4952bb0f77c521c4a398ac79))
### Bug Fixes
* Use correct `format` when resolving exports from relative paths ([#145](https://github.com/nodejs/import-in-the-middle/issues/145)) ([632802f](https://github.com/nodejs/import-in-the-middle/commit/632802f4e7c797215b4e052ffdfa0fbda1780166))
## [1.9.1](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.9.0...import-in-the-middle-v1.9.1) (2024-07-15)
### Bug Fixes
* Don't wrap native modules ([#142](https://github.com/nodejs/import-in-the-middle/issues/142)) ([f3278a3](https://github.com/nodejs/import-in-the-middle/commit/f3278a3c76af78fe369b599d5b2bf1d87edf0a7a))
* Use correct `format` when resolving exports from sub-modules ([#140](https://github.com/nodejs/import-in-the-middle/issues/140)) ([1db08ef](https://github.com/nodejs/import-in-the-middle/commit/1db08ef5f51346c20b4b3c313bf993e9cf1ca7d5))
## [1.9.0](https://github.com/nodejs/import-in-the-middle/compare/import-in-the-middle-v1.8.1...import-in-the-middle-v1.9.0) (2024-07-08)
### Features
* Allow passing of `include` or `exclude` list via `module.register()` ([#124](https://github.com/nodejs/import-in-the-middle/issues/124)) ([381f48c](https://github.com/nodejs/import-in-the-middle/commit/381f48c07ff755e88495f688c75c4912926194c7))
### Bug Fixes
* CJS `require('.')` resolution ([#108](https://github.com/nodejs/import-in-the-middle/issues/108)) ([29c77b5](https://github.com/nodejs/import-in-the-middle/commit/29c77b560aec0429154632c950923d12db36f79e))
* Include source url for parsing failures ([#109](https://github.com/nodejs/import-in-the-middle/issues/109)) ([49d69ba](https://github.com/nodejs/import-in-the-middle/commit/49d69ba9e785d4b6a1b38d7da1293cb744b6d7e3))
* Use `process.emitWarning` to log wrapping errors ([#114](https://github.com/nodejs/import-in-the-middle/issues/114)) ([a3778ac](https://github.com/nodejs/import-in-the-middle/commit/a3778acfbe2220ce5d521232b41da23b4383e1e3))

View File

@@ -0,0 +1,105 @@
import type { WithCacheConfig } from "../../cache/core/types.js";
import { entityKind } from "../../entity.js";
import type { PgDialect } from "../dialect.js";
import type { PgPreparedQuery, PgQueryResultHKT, PgQueryResultKind, PgSession, PreparedQueryConfig } from "../session.js";
import type { PgTable } from "../table.js";
import type { TypedQueryBuilder } from "../../query-builders/query-builder.js";
import type { SelectResultFields } from "../../query-builders/select.types.js";
import { QueryPromise } from "../../query-promise.js";
import type { RunnableQuery } from "../../runnable-query.js";
import type { ColumnsSelection, Query, SQL, SQLWrapper } from "../../sql/sql.js";
import type { Subquery } from "../../subquery.js";
import type { SelectedFieldsFlat, SelectedFieldsOrdered } from "./select.types.js";
export type PgDeleteWithout<T extends AnyPgDeleteBase, TDynamic extends boolean, K extends keyof T & string> = TDynamic extends true ? T : Omit<PgDeleteBase<T['_']['table'], T['_']['queryResult'], T['_']['selectedFields'], T['_']['returning'], TDynamic, T['_']['excludedMethods'] | K>, T['_']['excludedMethods'] | K>;
export type PgDelete<TTable extends PgTable = PgTable, TQueryResult extends PgQueryResultHKT = PgQueryResultHKT, TSelectedFields extends ColumnsSelection | undefined = undefined, TReturning extends Record<string, unknown> | undefined = Record<string, unknown> | undefined> = PgDeleteBase<TTable, TQueryResult, TSelectedFields, TReturning, true, never>;
export interface PgDeleteConfig {
where?: SQL | undefined;
table: PgTable;
returningFields?: SelectedFieldsFlat;
returning?: SelectedFieldsOrdered;
withList?: Subquery[];
}
export type PgDeleteReturningAll<T extends AnyPgDeleteBase, TDynamic extends boolean> = PgDeleteWithout<PgDeleteBase<T['_']['table'], T['_']['queryResult'], T['_']['table']['_']['columns'], T['_']['table']['$inferSelect'], TDynamic, T['_']['excludedMethods']>, TDynamic, 'returning'>;
export type PgDeleteReturning<T extends AnyPgDeleteBase, TDynamic extends boolean, TSelectedFields extends SelectedFieldsFlat> = PgDeleteWithout<PgDeleteBase<T['_']['table'], T['_']['queryResult'], TSelectedFields, SelectResultFields<TSelectedFields>, TDynamic, T['_']['excludedMethods']>, TDynamic, 'returning'>;
export type PgDeletePrepare<T extends AnyPgDeleteBase> = PgPreparedQuery<PreparedQueryConfig & {
execute: T['_']['returning'] extends undefined ? PgQueryResultKind<T['_']['queryResult'], never> : T['_']['returning'][];
}>;
export type PgDeleteDynamic<T extends AnyPgDeleteBase> = PgDelete<T['_']['table'], T['_']['queryResult'], T['_']['selectedFields'], T['_']['returning']>;
export type AnyPgDeleteBase = PgDeleteBase<any, any, any, any, any, any>;
export interface PgDeleteBase<TTable extends PgTable, TQueryResult extends PgQueryResultHKT, TSelectedFields extends ColumnsSelection | undefined = undefined, TReturning extends Record<string, unknown> | undefined = undefined, TDynamic extends boolean = false, TExcludedMethods extends string = never> extends TypedQueryBuilder<TSelectedFields, TReturning extends undefined ? PgQueryResultKind<TQueryResult, never> : TReturning[]>, QueryPromise<TReturning extends undefined ? PgQueryResultKind<TQueryResult, never> : TReturning[]>, RunnableQuery<TReturning extends undefined ? PgQueryResultKind<TQueryResult, never> : TReturning[], 'pg'>, SQLWrapper {
readonly _: {
readonly dialect: 'pg';
readonly table: TTable;
readonly queryResult: TQueryResult;
readonly selectedFields: TSelectedFields;
readonly returning: TReturning;
readonly dynamic: TDynamic;
readonly excludedMethods: TExcludedMethods;
readonly result: TReturning extends undefined ? PgQueryResultKind<TQueryResult, never> : TReturning[];
};
}
export declare class PgDeleteBase<TTable extends PgTable, TQueryResult extends PgQueryResultHKT, TSelectedFields extends ColumnsSelection | undefined = undefined, TReturning extends Record<string, unknown> | undefined = undefined, TDynamic extends boolean = false, TExcludedMethods extends string = never> extends QueryPromise<TReturning extends undefined ? PgQueryResultKind<TQueryResult, never> : TReturning[]> implements TypedQueryBuilder<TSelectedFields, TReturning extends undefined ? PgQueryResultKind<TQueryResult, never> : TReturning[]>, RunnableQuery<TReturning extends undefined ? PgQueryResultKind<TQueryResult, never> : TReturning[], 'pg'>, SQLWrapper {
private session;
private dialect;
static readonly [entityKind]: string;
private config;
protected cacheConfig?: WithCacheConfig;
constructor(table: TTable, session: PgSession, dialect: PgDialect, withList?: Subquery[]);
/**
* Adds a `where` clause to the query.
*
* Calling this method will delete only those rows that fulfill a specified condition.
*
* See docs: {@link https://orm.drizzle.team/docs/delete}
*
* @param where the `where` clause.
*
* @example
* You can use conditional operators and `sql function` to filter the rows to be deleted.
*
* ```ts
* // Delete all cars with green color
* await db.delete(cars).where(eq(cars.color, 'green'));
* // or
* await db.delete(cars).where(sql`${cars.color} = 'green'`)
* ```
*
* You can logically combine conditional operators with `and()` and `or()` operators:
*
* ```ts
* // Delete all BMW cars with a green color
* await db.delete(cars).where(and(eq(cars.color, 'green'), eq(cars.brand, 'BMW')));
*
* // Delete all cars with the green or blue color
* await db.delete(cars).where(or(eq(cars.color, 'green'), eq(cars.color, 'blue')));
* ```
*/
where(where: SQL | undefined): PgDeleteWithout<this, TDynamic, 'where'>;
/**
* Adds a `returning` clause to the query.
*
* Calling this method will return the specified fields of the deleted rows. If no fields are specified, all fields will be returned.
*
* See docs: {@link https://orm.drizzle.team/docs/delete#delete-with-return}
*
* @example
* ```ts
* // Delete all cars with the green color and return all fields
* const deletedCars: Car[] = await db.delete(cars)
* .where(eq(cars.color, 'green'))
* .returning();
*
* // Delete all cars with the green color and return only their id and brand fields
* const deletedCarsIdsAndBrands: { id: number, brand: string }[] = await db.delete(cars)
* .where(eq(cars.color, 'green'))
* .returning({ id: cars.id, brand: cars.brand });
* ```
*/
returning(): PgDeleteReturningAll<this, TDynamic>;
returning<TSelectedFields extends SelectedFieldsFlat>(fields: TSelectedFields): PgDeleteReturning<this, TDynamic, TSelectedFields>;
toSQL(): Query;
prepare(name: string): PgDeletePrepare<this>;
private authToken?;
execute: ReturnType<this['prepare']>['execute'];
$dynamic(): PgDeleteDynamic<this>;
}

View File

@@ -0,0 +1,34 @@
import { formatDistance } from "./tr/_lib/formatDistance.mjs";
import { formatLong } from "./tr/_lib/formatLong.mjs";
import { formatRelative } from "./tr/_lib/formatRelative.mjs";
import { localize } from "./tr/_lib/localize.mjs";
import { match } from "./tr/_lib/match.mjs";
/**
* @category Locales
* @summary Turkish locale.
* @language Turkish
* @iso-639-2 tur
* @author Alpcan Aydın [@alpcanaydin](https://github.com/alpcanaydin)
* @author Berkay Sargın [@berkaey](https://github.com/berkaey)
* @author Fatih Bulut [@bulutfatih](https://github.com/bulutfatih)
* @author Ismail Demirbilek [@dbtek](https://github.com/dbtek)
* @author İsmail Kayar [@ikayar](https://github.com/ikayar)
*
*
*/
export const tr = {
code: "tr",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 1,
},
};
// Fallback for modularized imports:
export default tr;

View File

@@ -0,0 +1 @@
{"version":3,"file":"breadcrumb-log-level.js","sources":["../../../src/utils/breadcrumb-log-level.ts"],"sourcesContent":["import type { SeverityLevel } from '../types-hoist/severity';\n\n/**\n * Determine a breadcrumb's log level (only `warning` or `error`) based on an HTTP status code.\n */\nexport function getBreadcrumbLogLevelFromHttpStatusCode(statusCode: number | undefined): SeverityLevel | undefined {\n // NOTE: undefined defaults to 'info' in Sentry\n if (statusCode === undefined) {\n return undefined;\n } else if (statusCode >= 400 && statusCode < 500) {\n return 'warning';\n } else if (statusCode >= 500) {\n return 'error';\n } else {\n return undefined;\n }\n}\n"],"names":[],"mappings":";;AAEA;AACA;AACA;AACO,SAAS,uCAAuC,CAAC,UAAU,EAAiD;AACnH;AACA,EAAE,IAAI,UAAA,KAAe,SAAS,EAAE;AAChC,IAAI,OAAO,SAAS;AACpB,EAAE,CAAA,MAAO,IAAI,UAAA,IAAc,GAAA,IAAO,UAAA,GAAa,GAAG,EAAE;AACpD,IAAI,OAAO,SAAS;AACpB,EAAE,OAAO,IAAI,UAAA,IAAc,GAAG,EAAE;AAChC,IAAI,OAAO,OAAO;AAClB,EAAE,OAAO;AACT,IAAI,OAAO,SAAS;AACpB,EAAE;AACF;;;;"}

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/mergeHeaders.ts"],"sourcesContent":["export const mergeHeaders = (sourceHeaders: Headers, destinationHeaders: Headers): Headers => {\n // Create a new Headers object\n const combinedHeaders = new Headers(destinationHeaders)\n\n // Append sourceHeaders to combinedHeaders\n sourceHeaders.forEach((value, key) => {\n combinedHeaders.append(key, value)\n })\n\n return combinedHeaders\n}\n"],"names":["mergeHeaders","sourceHeaders","destinationHeaders","combinedHeaders","Headers","forEach","value","key","append"],"mappings":"AAAA,OAAO,MAAMA,eAAe,CAACC,eAAwBC;IACnD,8BAA8B;IAC9B,MAAMC,kBAAkB,IAAIC,QAAQF;IAEpC,0CAA0C;IAC1CD,cAAcI,OAAO,CAAC,CAACC,OAAOC;QAC5BJ,gBAAgBK,MAAM,CAACD,KAAKD;IAC9B;IAEA,OAAOH;AACT,EAAC"}

View File

@@ -0,0 +1,2 @@
export declare const resolveFrom: (fromDirectory: string, moduleId: string, silent?: boolean) => any;
//# sourceMappingURL=resolveFrom.d.ts.map

View File

@@ -0,0 +1 @@
{"version":3,"file":"thermometer-snowflake.js","sources":["../../../src/icons/thermometer-snowflake.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ThermometerSnowflake\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiAxMmgxMCIgLz4KICA8cGF0aCBkPSJNOSA0djE2IiAvPgogIDxwYXRoIGQ9Im0zIDkgMyAzLTMgMyIgLz4KICA8cGF0aCBkPSJNMTIgNiA5IDkgNiA2IiAvPgogIDxwYXRoIGQ9Im02IDE4IDMtMyAxLjUgMS41IiAvPgogIDxwYXRoIGQ9Ik0yMCA0djEwLjU0YTQgNCAwIDEgMS00IDBWNGEyIDIgMCAwIDEgNCAwWiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/thermometer-snowflake\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 ThermometerSnowflake = createLucideIcon('ThermometerSnowflake', [\n ['path', { d: 'M2 12h10', key: '19562f' }],\n ['path', { d: 'M9 4v16', key: '81ygyz' }],\n ['path', { d: 'm3 9 3 3-3 3', key: '1sas0l' }],\n ['path', { d: 'M12 6 9 9 6 6', key: 'pfrgxu' }],\n ['path', { d: 'm6 18 3-3 1.5 1.5', key: '1e277p' }],\n ['path', { d: 'M20 4v10.54a4 4 0 1 1-4 0V4a2 2 0 0 1 4 0Z', key: 'iof6y5' }],\n]);\n\nexport default ThermometerSnowflake;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAuB,iBAAiB,sBAAwB,CAAA,CAAA,CAAA;AAAA,CAAA,CACpE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACzC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgB,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,CAC7C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAqB,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,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA8C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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;AAC7E,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/graphics/Logo/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,eAAO,MAAM,WAAW,EAAE,KAAK,CAAC,EA0B/B,CAAA"}

View File

@@ -0,0 +1,114 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const Hash = require("../Hash");
const { digest, update } = require("./hash-digest");
const MAX_SHORT_STRING = require("./wasm-hash").MAX_SHORT_STRING;
/** @typedef {import("../../../declarations/WebpackOptions").HashDigest} Encoding */
class BatchedHash extends Hash {
/**
* @param {Hash} hash hash
*/
constructor(hash) {
super();
/** @type {undefined | string} */
this.string = undefined;
/** @type {undefined | Encoding} */
this.encoding = undefined;
/** @type {Hash} */
this.hash = hash;
}
/**
* Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
* @overload
* @param {string | Buffer} data data
* @returns {Hash} updated hash
*/
/**
* Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
* @overload
* @param {string} data data
* @param {Encoding} inputEncoding data encoding
* @returns {Hash} updated hash
*/
/**
* Update hash {@link https://nodejs.org/api/crypto.html#crypto_hash_update_data_inputencoding}
* @param {string | Buffer} data data
* @param {Encoding=} inputEncoding data encoding
* @returns {Hash} updated hash
*/
update(data, inputEncoding) {
if (this.string !== undefined) {
if (
typeof data === "string" &&
inputEncoding === this.encoding &&
this.string.length + data.length < MAX_SHORT_STRING
) {
this.string += data;
return this;
}
if (this.encoding) {
update(this.hash, this.string, this.encoding);
} else {
update(this.hash, this.string);
}
this.string = undefined;
}
if (typeof data === "string") {
if (
data.length < MAX_SHORT_STRING &&
// base64 encoding is not valid since it may contain padding chars
(!inputEncoding || !inputEncoding.startsWith("ba"))
) {
this.string = data;
this.encoding = inputEncoding;
} else if (inputEncoding) {
update(this.hash, data, inputEncoding);
} else {
update(this.hash, data);
}
} else {
update(this.hash, data);
}
return this;
}
/**
* Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
* @overload
* @returns {Buffer} digest
*/
/**
* Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
* @overload
* @param {Encoding} encoding encoding of the return value
* @returns {string} digest
*/
/**
* Calculates the digest {@link https://nodejs.org/api/crypto.html#crypto_hash_digest_encoding}
* @param {Encoding=} encoding encoding of the return value
* @returns {string | Buffer} digest
*/
digest(encoding) {
if (this.string !== undefined) {
if (this.encoding) {
update(this.hash, this.string, this.encoding);
} else {
update(this.hash, this.string);
}
}
if (!encoding) {
return digest(this.hash);
}
return digest(this.hash, encoding);
}
}
module.exports = BatchedHash;

View File

@@ -0,0 +1,241 @@
'use client';
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
import { useModal } from '@faceless-ui/modal';
import { getTranslation } from '@payloadcms/translations';
import { formatAdminURL, hasAutosaveEnabled, hasLocalizeStatusEnabled, hasScheduledPublishEnabled } from 'payload/shared';
import * as qs from 'qs-esm';
import React, { useCallback, useEffect, useState } from 'react';
import { useForm, useFormModified } from '../../forms/Form/context.js';
import { FormSubmit } from '../../forms/Submit/index.js';
import { useHotkey } from '../../hooks/useHotkey.js';
import { useConfig } from '../../providers/Config/index.js';
import { useDocumentInfo } from '../../providers/DocumentInfo/index.js';
import { useEditDepth } from '../../providers/EditDepth/index.js';
import { useLocale } from '../../providers/Locale/index.js';
import { useOperation } from '../../providers/Operation/index.js';
import { useTranslation } from '../../providers/Translation/index.js';
import { traverseForLocalizedFields } from '../../utilities/traverseForLocalizedFields.js';
import { PopupList } from '../Popup/index.js';
import { ScheduleDrawer } from './ScheduleDrawer/index.js';
export function PublishButton({
label: labelProp
} = {}) {
const {
id,
collectionSlug,
globalSlug,
hasPublishedDoc,
hasPublishPermission,
setHasPublishedDoc,
setMostRecentVersionIsAutosaved,
setUnpublishedVersionCount,
unpublishedVersionCount,
uploadStatus
} = useDocumentInfo();
const {
config,
getEntityConfig
} = useConfig();
const {
submit
} = useForm();
const modified = useFormModified();
const editDepth = useEditDepth();
const {
code: localeCode
} = useLocale();
const {
isModalOpen,
toggleModal
} = useModal();
const drawerSlug = `schedule-publish-${id}`;
const {
localization,
routes: {
api
}
} = config;
const {
i18n,
t
} = useTranslation();
const label = labelProp || t('version:publishChanges');
const entityConfig = React.useMemo(() => {
if (collectionSlug) {
return getEntityConfig({
collectionSlug
});
}
if (globalSlug) {
return getEntityConfig({
globalSlug
});
}
}, [collectionSlug, globalSlug, getEntityConfig]);
const hasNewerVersions = unpublishedVersionCount > 0;
const canPublish = hasPublishPermission && (modified || hasNewerVersions || !hasPublishedDoc) && uploadStatus !== 'uploading';
const scheduledPublishEnabled = hasScheduledPublishEnabled(entityConfig);
// If autosave is enabled the modified will always be true so only conditionally check on modified state
const hasAutosave = hasAutosaveEnabled(entityConfig);
const canSchedulePublish = Boolean(scheduledPublishEnabled && hasPublishPermission && (globalSlug || collectionSlug && id) && (hasAutosave || !modified));
const [hasLocalizedFields, setHasLocalizedFields] = useState(false);
useEffect(() => {
const hasLocalizedField = traverseForLocalizedFields(entityConfig?.fields);
setHasLocalizedFields(hasLocalizedField);
}, [entityConfig?.fields]);
const isSpecificLocalePublishEnabled = localization && hasLocalizedFields && hasPublishPermission;
const operation = useOperation();
const disabled = operation === 'update' && !modified;
const saveDraft = useCallback(async () => {
if (disabled) {
return;
}
const params = qs.stringify({
depth: 0,
draft: true,
'fallback-locale': 'null',
locale: localeCode
}, {
addQueryPrefix: true
});
let action;
let method = 'POST';
if (collectionSlug) {
action = formatAdminURL({
apiRoute: api,
path: `/${collectionSlug}${id ? `/${id}` : ''}${params}`
});
if (id) {
method = 'PATCH';
}
}
if (globalSlug) {
action = formatAdminURL({
apiRoute: api,
path: `/globals/${globalSlug}${params}`
});
}
await submit({
action,
method,
overrides: {
_status: 'draft'
},
skipValidation: true
});
}, [disabled, localeCode, collectionSlug, globalSlug, submit, api, id]);
useHotkey({
cmdCtrlKey: true,
editDepth,
keyCodes: ['s']
}, e => {
e.preventDefault();
e.stopPropagation();
if (saveDraft && hasAutosave) {
void saveDraft();
}
});
const localizeStatusEnabled = hasLocalizeStatusEnabled(entityConfig);
const publish = useCallback(async () => {
if (uploadStatus === 'uploading') {
return;
}
const params_0 = qs.stringify({
depth: 0,
locale: localeCode,
...(localizeStatusEnabled && {
publishAllLocales: true
})
}, {
addQueryPrefix: true
});
const action_0 = formatAdminURL({
apiRoute: api,
path: `${globalSlug ? `/globals/${globalSlug}` : `/${collectionSlug}${id ? `/${id}` : ''}`}${params_0}`
});
const result = await submit({
action: action_0,
overrides: {
_status: 'published'
}
});
if (result) {
setUnpublishedVersionCount(0);
setMostRecentVersionIsAutosaved(false);
setHasPublishedDoc(true);
}
}, [localeCode, localizeStatusEnabled, api, collectionSlug, globalSlug, id, setHasPublishedDoc, submit, setUnpublishedVersionCount, uploadStatus, setMostRecentVersionIsAutosaved]);
const publishSpecificLocale = useCallback(async locale => {
if (uploadStatus === 'uploading') {
return;
}
const params_1 = qs.stringify({
depth: 0,
locale,
publishSpecificLocale: locale
}, {
addQueryPrefix: true
});
const pathSegment = globalSlug ? `/globals/${globalSlug}` : `/${collectionSlug}${id ? `/${id}` : ''}`;
const action_1 = formatAdminURL({
apiRoute: api,
path: `${pathSegment}${params_1}`
});
const result_0 = await submit({
action: action_1,
overrides: {
_status: 'published'
}
});
if (result_0) {
setHasPublishedDoc(true);
}
}, [api, collectionSlug, globalSlug, id, setHasPublishedDoc, submit, uploadStatus]);
// Publish to all locales unless there are localized fields AND defaultLocalePublishOption is 'active'
const isDefaultPublishAll = !isSpecificLocalePublishEnabled || localization && localization?.defaultLocalePublishOption !== 'active';
const activeLocale = localization && localization?.locales.find(locale_0 => typeof locale_0 === 'string' ? locale_0 === localeCode : locale_0.code === localeCode);
const activeLocaleLabel = activeLocale && getTranslation(activeLocale.label, i18n);
if (!hasPublishPermission) {
return null;
}
return /*#__PURE__*/_jsxs(React.Fragment, {
children: [/*#__PURE__*/_jsx(FormSubmit, {
buttonId: "action-save",
disabled: !canPublish,
enableSubMenu: canSchedulePublish,
onClick: isDefaultPublishAll ? publish : () => publishSpecificLocale(activeLocale.code),
size: "medium",
SubMenuPopupContent: isSpecificLocalePublishEnabled || canSchedulePublish ? ({
close
}) => {
return /*#__PURE__*/_jsxs(React.Fragment, {
children: [canSchedulePublish && /*#__PURE__*/_jsx(PopupList.ButtonGroup, {
children: /*#__PURE__*/_jsx(PopupList.Button, {
id: "schedule-publish",
onClick: () => [toggleModal(drawerSlug), close()],
children: t('version:schedulePublish')
})
}, "schedule-publish"), isSpecificLocalePublishEnabled && /*#__PURE__*/_jsx(PopupList.ButtonGroup, {
children: /*#__PURE__*/_jsx(PopupList.Button, {
id: "publish-locale",
onClick: isDefaultPublishAll ? () => publishSpecificLocale(activeLocale.code) : publish,
children: isDefaultPublishAll ? t('version:publishIn', {
locale: activeLocaleLabel
}) : t('version:publishAllLocales')
})
})]
});
} : undefined,
type: "button",
children: !isDefaultPublishAll ? t('version:publishIn', {
locale: activeLocaleLabel
}) : label
}), canSchedulePublish && isModalOpen(drawerSlug) && /*#__PURE__*/_jsx(ScheduleDrawer, {
defaultType: !hasNewerVersions ? 'unpublish' : 'publish',
schedulePublishConfig: scheduledPublishEnabled && typeof entityConfig.versions.drafts.schedulePublish === 'object' ? entityConfig.versions.drafts.schedulePublish : undefined,
slug: drawerSlug
})]
});
}
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1,20 @@
var arrayPush = require('./_arrayPush'),
isArray = require('./isArray');
/**
* The base implementation of `getAllKeys` and `getAllKeysIn` which uses
* `keysFunc` and `symbolsFunc` to get the enumerable property names and
* symbols of `object`.
*
* @private
* @param {Object} object The object to query.
* @param {Function} keysFunc The function to get the keys of `object`.
* @param {Function} symbolsFunc The function to get the symbols of `object`.
* @returns {Array} Returns the array of property names and symbols.
*/
function baseGetAllKeys(object, keysFunc, symbolsFunc) {
var result = keysFunc(object);
return isArray(object) ? result : arrayPush(result, symbolsFunc(object));
}
module.exports = baseGetAllKeys;

View File

@@ -0,0 +1,45 @@
import { WebSocketAuthModes } from "../../../realtime/types.js";
import { RestCommand } from "../../types.js";
//#region src/rest/commands/server/info.d.ts
type ServerInfoOutput = {
project: {
project_name: string;
default_language: string;
public_registration: boolean;
public_registration_verify_email: boolean;
};
mcp_enabled?: boolean;
ai_enabled?: boolean;
rateLimit?: {
points: number;
duration: number;
} | false;
rateLimitGlobal?: {
points: number;
duration: number;
} | false;
queryLimit?: {
default: number;
max: number;
};
websocket?: {
rest: {
authentication: WebSocketAuthModes;
path: string;
} | false;
graphql: {
authentication: WebSocketAuthModes;
path: string;
} | false;
heartbeat: number | false;
} | false;
};
/**
* Get information about the current installation.
* @returns Information about the current installation.
*/
declare const serverInfo: <Schema>() => RestCommand<ServerInfoOutput, Schema>;
//#endregion
export { ServerInfoOutput, serverInfo };
//# sourceMappingURL=info.d.ts.map

View File

@@ -0,0 +1,38 @@
import { Column } from "../../column.js";
import { is } from "../../entity.js";
import { sql } from "../sql.js";
function count(expression) {
return sql`count(${expression || sql.raw("*")})`.mapWith(Number);
}
function countDistinct(expression) {
return sql`count(distinct ${expression})`.mapWith(Number);
}
function avg(expression) {
return sql`avg(${expression})`.mapWith(String);
}
function avgDistinct(expression) {
return sql`avg(distinct ${expression})`.mapWith(String);
}
function sum(expression) {
return sql`sum(${expression})`.mapWith(String);
}
function sumDistinct(expression) {
return sql`sum(distinct ${expression})`.mapWith(String);
}
function max(expression) {
return sql`max(${expression})`.mapWith(is(expression, Column) ? expression : String);
}
function min(expression) {
return sql`min(${expression})`.mapWith(is(expression, Column) ? expression : String);
}
export {
avg,
avgDistinct,
count,
countDistinct,
max,
min,
sum,
sumDistinct
};
//# sourceMappingURL=aggregate.js.map

View File

@@ -0,0 +1,48 @@
import { entityKind } from "../entity.js";
import type { AnyGelColumn, GelColumn } from "./columns/index.js";
import type { GelTable } from "./table.js";
export type UpdateDeleteAction = 'cascade' | 'restrict' | 'no action' | 'set null' | 'set default';
export type Reference = () => {
readonly name?: string;
readonly columns: GelColumn[];
readonly foreignTable: GelTable;
readonly foreignColumns: GelColumn[];
};
export declare class ForeignKeyBuilder {
static readonly [entityKind]: string;
constructor(config: () => {
name?: string;
columns: GelColumn[];
foreignColumns: GelColumn[];
}, actions?: {
onUpdate?: UpdateDeleteAction;
onDelete?: UpdateDeleteAction;
} | undefined);
onUpdate(action: UpdateDeleteAction): this;
onDelete(action: UpdateDeleteAction): this;
}
export type AnyForeignKeyBuilder = ForeignKeyBuilder;
export declare class ForeignKey {
readonly table: GelTable;
static readonly [entityKind]: string;
readonly reference: Reference;
readonly onUpdate: UpdateDeleteAction | undefined;
readonly onDelete: UpdateDeleteAction | undefined;
constructor(table: GelTable, builder: ForeignKeyBuilder);
getName(): string;
}
type ColumnsWithTable<TTableName extends string, TColumns extends GelColumn[]> = {
[Key in keyof TColumns]: AnyGelColumn<{
tableName: TTableName;
}>;
};
export declare function foreignKey<TTableName extends string, TForeignTableName extends string, TColumns extends [AnyGelColumn<{
tableName: TTableName;
}>, ...AnyGelColumn<{
tableName: TTableName;
}>[]]>(config: {
name?: string;
columns: TColumns;
foreignColumns: ColumnsWithTable<TForeignTableName, TColumns>;
}): ForeignKeyBuilder;
export {};

View File

@@ -0,0 +1,6 @@
function _assert_this_initialized(self) {
if (self === void 0) throw new ReferenceError("this hasn't been initialised - super() hasn't been called");
return self;
}
export { _assert_this_initialized as _ };

View File

@@ -0,0 +1,30 @@
"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 });
exports.BAGGAGE_MAX_TOTAL_LENGTH = exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = exports.BAGGAGE_HEADER = exports.BAGGAGE_ITEMS_SEPARATOR = exports.BAGGAGE_PROPERTIES_SEPARATOR = exports.BAGGAGE_KEY_PAIR_SEPARATOR = void 0;
exports.BAGGAGE_KEY_PAIR_SEPARATOR = '=';
exports.BAGGAGE_PROPERTIES_SEPARATOR = ';';
exports.BAGGAGE_ITEMS_SEPARATOR = ',';
// Name of the http header used to propagate the baggage
exports.BAGGAGE_HEADER = 'baggage';
// Maximum number of name-value pairs allowed by w3c spec
exports.BAGGAGE_MAX_NAME_VALUE_PAIRS = 180;
// Maximum number of bytes per a single name-value pair allowed by w3c spec
exports.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096;
// Maximum total length of all name-value pairs allowed by w3c spec
exports.BAGGAGE_MAX_TOTAL_LENGTH = 8192;
//# sourceMappingURL=constants.js.map

View File

@@ -0,0 +1,40 @@
# is-core-module <sup>[![Version Badge][2]][1]</sup>
[![github actions][actions-image]][actions-url]
[![coverage][codecov-image]][codecov-url]
[![dependency status][5]][6]
[![dev dependency status][7]][8]
[![License][license-image]][license-url]
[![Downloads][downloads-image]][downloads-url]
[![npm badge][11]][1]
Is this specifier a node.js core module? Optionally provide a node version to check; defaults to the current node version.
## Example
```js
var isCore = require('is-core-module');
var assert = require('assert');
assert(isCore('fs'));
assert(!isCore('butts'));
```
## Tests
Clone the repo, `npm install`, and run `npm test`
[1]: https://npmjs.org/package/is-core-module
[2]: https://versionbadg.es/inspect-js/is-core-module.svg
[5]: https://david-dm.org/inspect-js/is-core-module.svg
[6]: https://david-dm.org/inspect-js/is-core-module
[7]: https://david-dm.org/inspect-js/is-core-module/dev-status.svg
[8]: https://david-dm.org/inspect-js/is-core-module#info=devDependencies
[11]: https://nodei.co/npm/is-core-module.png?downloads=true&stars=true
[license-image]: https://img.shields.io/npm/l/is-core-module.svg
[license-url]: LICENSE
[downloads-image]: https://img.shields.io/npm/dm/is-core-module.svg
[downloads-url]: https://npm-stat.com/charts.html?package=is-core-module
[codecov-image]: https://codecov.io/gh/inspect-js/is-core-module/branch/main/graphs/badge.svg
[codecov-url]: https://app.codecov.io/gh/inspect-js/is-core-module/
[actions-image]: https://img.shields.io/endpoint?url=https://github-actions-badge-u3jn4tfpocch.runkit.sh/inspect-js/is-core-module
[actions-url]: https://github.com/inspect-js/is-core-module/actions

View File

@@ -0,0 +1,4 @@
export interface Disabled {
draggable?: boolean;
droppable?: boolean;
}

View File

@@ -0,0 +1,27 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @flow strict
*/
import type {EditorThemeClasses, LexicalEditor} from 'lexical';
export type LexicalComposerContextType = {
getTheme: () => ?EditorThemeClasses,
};
export type LexicalComposerContextWithEditor = [
LexicalEditor,
LexicalComposerContextType,
];
declare export var LexicalComposerContext: React.Context<?LexicalComposerContextWithEditor>;
declare export function createLexicalComposerContext(
parent: ?LexicalComposerContextWithEditor,
theme: ?EditorThemeClasses,
): LexicalComposerContextType;
declare export function useLexicalComposerContext(): LexicalComposerContextWithEditor;

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 './panel-left-close.js';
//# sourceMappingURL=sidebar-close.js.map

View File

@@ -0,0 +1,20 @@
var baseFindIndex = require('./_baseFindIndex'),
baseIsNaN = require('./_baseIsNaN'),
strictIndexOf = require('./_strictIndexOf');
/**
* The base implementation of `_.indexOf` without `fromIndex` bounds checks.
*
* @private
* @param {Array} array The array to inspect.
* @param {*} value The value to search for.
* @param {number} fromIndex The index to search from.
* @returns {number} Returns the index of the matched value, else `-1`.
*/
function baseIndexOf(array, value, fromIndex) {
return value === value
? strictIndexOf(array, value, fromIndex)
: baseFindIndex(array, baseIsNaN, fromIndex);
}
module.exports = baseIndexOf;

View File

@@ -0,0 +1 @@
{"version":3,"names":["_defineAccessor","type","obj","key","fn","desc","configurable","enumerable","Object","defineProperty"],"sources":["../../src/helpers/defineAccessor.ts"],"sourcesContent":["/* @minVersion 7.20.7 */\n\nexport default function _defineAccessor<Type extends \"get\" | \"set\">(\n type: Type,\n obj: any,\n key: string | symbol,\n fn: PropertyDescriptor[Type],\n) {\n var desc: PropertyDescriptor = { configurable: true, enumerable: true };\n desc[type] = fn;\n return Object.defineProperty(obj, key, desc);\n}\n"],"mappings":";;;;;;AAEe,SAASA,eAAeA,CACrCC,IAAU,EACVC,GAAQ,EACRC,GAAoB,EACpBC,EAA4B,EAC5B;EACA,IAAIC,IAAwB,GAAG;IAAEC,YAAY,EAAE,IAAI;IAAEC,UAAU,EAAE;EAAK,CAAC;EACvEF,IAAI,CAACJ,IAAI,CAAC,GAAGG,EAAE;EACf,OAAOI,MAAM,CAACC,cAAc,CAACP,GAAG,EAAEC,GAAG,EAAEE,IAAI,CAAC;AAC9C","ignoreList":[]}

View File

@@ -0,0 +1,183 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.js";
const eraValues = {
narrow: ["前", "公元"],
abbreviated: ["前", "公元"],
wide: ["公元前", "公元"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["第一刻", "第二刻", "第三刻", "第四刻"],
wide: ["第一刻鐘", "第二刻鐘", "第三刻鐘", "第四刻鐘"],
};
const monthValues = {
narrow: [
"一",
"二",
"三",
"四",
"五",
"六",
"七",
"八",
"九",
"十",
"十一",
"十二",
],
abbreviated: [
"1月",
"2月",
"3月",
"4月",
"5月",
"6月",
"7月",
"8月",
"9月",
"10月",
"11月",
"12月",
],
wide: [
"一月",
"二月",
"三月",
"四月",
"五月",
"六月",
"七月",
"八月",
"九月",
"十月",
"十一月",
"十二月",
],
};
const dayValues = {
narrow: ["日", "一", "二", "三", "四", "五", "六"],
short: ["日", "一", "二", "三", "四", "五", "六"],
abbreviated: ["週日", "週一", "週二", "週三", "週四", "週五", "週六"],
wide: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"],
};
const dayPeriodValues = {
narrow: {
am: "上",
pm: "下",
midnight: "凌晨",
noon: "午",
morning: "早",
afternoon: "下午",
evening: "晚",
night: "夜",
},
abbreviated: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜間",
},
wide: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜間",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "上",
pm: "下",
midnight: "凌晨",
noon: "午",
morning: "早",
afternoon: "下午",
evening: "晚",
night: "夜",
},
abbreviated: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜間",
},
wide: {
am: "上午",
pm: "下午",
midnight: "凌晨",
noon: "中午",
morning: "早晨",
afternoon: "中午",
evening: "晚上",
night: "夜間",
},
};
const ordinalNumber = (dirtyNumber, options) => {
const number = Number(dirtyNumber);
switch (options?.unit) {
case "date":
return number + "日";
case "hour":
return number + "時";
case "minute":
return number + "分";
case "second":
return number + "秒";
default:
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",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide",
}),
};

View File

@@ -0,0 +1,36 @@
import Ajv, {AnySchema, AnyValidateFunction, ErrorObject} from "../core"
import standaloneCode from "."
import * as requireFromString from "require-from-string"
export default class AjvPack {
errors?: ErrorObject[] | null // errors from the last validation
constructor(readonly ajv: Ajv) {}
validate(schemaKeyRef: AnySchema | string, data: unknown): boolean | Promise<unknown> {
return Ajv.prototype.validate.call(this, schemaKeyRef, data)
}
compile<T = unknown>(schema: AnySchema, meta?: boolean): AnyValidateFunction<T> {
return this.getStandalone(this.ajv.compile<T>(schema, meta))
}
getSchema<T = unknown>(keyRef: string): AnyValidateFunction<T> | undefined {
const v = this.ajv.getSchema<T>(keyRef)
if (!v) return undefined
return this.getStandalone(v)
}
private getStandalone<T = unknown>(v: AnyValidateFunction<T>): AnyValidateFunction<T> {
return requireFromString(standaloneCode(this.ajv, v)) as AnyValidateFunction<T>
}
addSchema(...args: Parameters<typeof Ajv.prototype.addSchema>): AjvPack {
this.ajv.addSchema.call(this.ajv, ...args)
return this
}
addKeyword(...args: Parameters<typeof Ajv.prototype.addKeyword>): AjvPack {
this.ajv.addKeyword.call(this.ajv, ...args)
return this
}
}

View File

@@ -0,0 +1 @@
{"version":3,"names":["_classApplyDescriptorSet","require","_classPrivateFieldGet","_classPrivateFieldSet","receiver","privateMap","value","descriptor","classPrivateFieldGet2","classApplyDescriptorSet"],"sources":["../../src/helpers/classPrivateFieldSet.js"],"sourcesContent":["/* @minVersion 7.0.0-beta.0 */\n/* @onlyBabel7 */\n\nimport classApplyDescriptorSet from \"classApplyDescriptorSet\";\nimport classPrivateFieldGet2 from \"classPrivateFieldGet2\";\nexport default function _classPrivateFieldSet(receiver, privateMap, value) {\n var descriptor = classPrivateFieldGet2(privateMap, receiver);\n classApplyDescriptorSet(receiver, descriptor, value);\n return value;\n}\n"],"mappings":";;;;;;AAGA,IAAAA,wBAAA,GAAAC,OAAA;AACA,IAAAC,qBAAA,GAAAD,OAAA;AACe,SAASE,qBAAqBA,CAACC,QAAQ,EAAEC,UAAU,EAAEC,KAAK,EAAE;EACzE,IAAIC,UAAU,GAAGC,qBAAqB,CAACH,UAAU,EAAED,QAAQ,CAAC;EAC5DK,wBAAuB,CAACL,QAAQ,EAAEG,UAAU,EAAED,KAAK,CAAC;EACpD,OAAOA,KAAK;AACd","ignoreList":[]}

View File

@@ -0,0 +1,126 @@
import { match } from '@formatjs/intl-localematcher';
import Negotiator from 'negotiator';
import { getPathnameMatch, isLocaleSupportedOnDomain, getHost } from './utils.js';
function findDomainFromHost(requestHeaders, domains) {
const host = getHost(requestHeaders);
if (host) {
return domains.find(cur => cur.domain === host);
}
return undefined;
}
function orderLocales(locales) {
// Workaround for https://github.com/formatjs/formatjs/issues/4469
return locales.slice().sort((a, b) => b.length - a.length);
}
function getAcceptLanguageLocale(requestHeaders, locales, defaultLocale) {
let locale;
const languages = new Negotiator({
headers: {
'accept-language': requestHeaders.get('accept-language') || undefined
}
}).languages();
try {
const orderedLocales = orderLocales(locales);
locale = match(languages, orderedLocales, defaultLocale);
} catch {
// Invalid language
}
return locale;
}
function getLocaleFromCookie(routing, requestCookies) {
if (routing.localeCookie && requestCookies.has(routing.localeCookie.name)) {
const value = requestCookies.get(routing.localeCookie.name)?.value;
if (value && routing.locales.includes(value)) {
return value;
}
}
}
function resolveLocaleFromPrefix(routing, requestHeaders, requestCookies, pathname) {
let locale;
// Prio 1: Use route prefix
if (pathname) {
locale = getPathnameMatch(pathname, routing.locales, routing.localePrefix)?.locale;
}
// Prio 2: Use existing cookie
if (!locale && routing.localeDetection) {
locale = getLocaleFromCookie(routing, requestCookies);
}
// Prio 3: Use the `accept-language` header
if (!locale && routing.localeDetection) {
locale = getAcceptLanguageLocale(requestHeaders, routing.locales, routing.defaultLocale);
}
// Prio 4: Use default locale
if (!locale) {
locale = routing.defaultLocale;
}
return locale;
}
function resolveLocaleFromDomain(routing, requestHeaders, requestCookies, pathname) {
const domains = routing.domains;
const domain = findDomainFromHost(requestHeaders, domains);
if (!domain) {
return {
locale: resolveLocaleFromPrefix(routing, requestHeaders, requestCookies, pathname)
};
}
let locale;
// Prio 1: Use route prefix
if (pathname) {
const prefixLocale = getPathnameMatch(pathname, routing.locales, routing.localePrefix, domain)?.locale;
if (prefixLocale) {
if (isLocaleSupportedOnDomain(prefixLocale, domain)) {
locale = prefixLocale;
} else {
// Causes a redirect to a domain that supports the locale
return {
locale: prefixLocale,
domain
};
}
}
}
// Prio 2: Use existing cookie
if (!locale && routing.localeDetection) {
const cookieLocale = getLocaleFromCookie(routing, requestCookies);
if (cookieLocale) {
if (isLocaleSupportedOnDomain(cookieLocale, domain)) {
locale = cookieLocale;
}
}
}
// Prio 3: Use the `accept-language` header
if (!locale && routing.localeDetection) {
const headerLocale = getAcceptLanguageLocale(requestHeaders, domain.locales, domain.defaultLocale);
if (headerLocale) {
locale = headerLocale;
}
}
// Prio 4: Use default locale
if (!locale) {
locale = domain.defaultLocale;
}
return {
locale,
domain
};
}
function resolveLocale(routing, requestHeaders, requestCookies, pathname) {
if (routing.domains) {
return resolveLocaleFromDomain(routing, requestHeaders, requestCookies, pathname);
} else {
return {
locale: resolveLocaleFromPrefix(routing, requestHeaders, requestCookies, pathname)
};
}
}
export { resolveLocale as default, getAcceptLanguageLocale };

View File

@@ -0,0 +1 @@
{"version":3,"file":"diff.js","names":[],"sources":["../../../../src/rest/commands/schema/diff.ts"],"sourcesContent":["import type { RestCommand } from '../../types.js';\nimport type { SchemaSnapshotOutput } from './snapshot.js';\n\n// TODO improve typing\nexport type SchemaDiffOutput = {\n\thash: string;\n\tdiff: Record<string, any>;\n};\n\n/**\n * Compare the current instance's schema against the schema snapshot in JSON request body and retrieve the difference. This endpoint is only available to admin users.\n * @param snapshot JSON object containing collections, fields, and relations to apply.\n * @param force Bypass version and database vendor restrictions.\n * @returns Returns the differences between the current instance's schema and the schema passed in the request body.\n */\nexport const schemaDiff =\n\t<Schema>(snapshot: SchemaSnapshotOutput, force = false): RestCommand<SchemaDiffOutput, Schema> =>\n\t() => ({\n\t\tmethod: 'POST',\n\t\tpath: '/schema/diff',\n\t\tparams: force ? { force } : {},\n\t\tbody: JSON.stringify(snapshot),\n\t});\n"],"mappings":"AAeA,MAAa,GACH,EAAgC,EAAQ,UAC1C,CACN,OAAQ,OACR,KAAM,eACN,OAAQ,EAAQ,CAAE,QAAO,CAAG,EAAE,CAC9B,KAAM,KAAK,UAAU,EAAS,CAC9B"}

View File

@@ -0,0 +1,170 @@
"use strict";
exports.localize = void 0;
var _index = require("../../_lib/buildLocalizeFn.js");
const eraValues = {
narrow: ["eaa.", "jaa."],
abbreviated: ["eaa.", "jaa."],
wide: ["ennen ajanlaskun alkua", "jälkeen ajanlaskun alun"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1. kvartaali", "2. kvartaali", "3. kvartaali", "4. kvartaali"],
};
const monthValues = {
narrow: ["T", "H", "M", "H", "T", "K", "H", "E", "S", "L", "M", "J"],
abbreviated: [
"tammi",
"helmi",
"maalis",
"huhti",
"touko",
"kesä",
"heinä",
"elo",
"syys",
"loka",
"marras",
"joulu",
],
wide: [
"tammikuu",
"helmikuu",
"maaliskuu",
"huhtikuu",
"toukokuu",
"kesäkuu",
"heinäkuu",
"elokuu",
"syyskuu",
"lokakuu",
"marraskuu",
"joulukuu",
],
};
const formattingMonthValues = {
narrow: monthValues.narrow,
abbreviated: monthValues.abbreviated,
wide: [
"tammikuuta",
"helmikuuta",
"maaliskuuta",
"huhtikuuta",
"toukokuuta",
"kesäkuuta",
"heinäkuuta",
"elokuuta",
"syyskuuta",
"lokakuuta",
"marraskuuta",
"joulukuuta",
],
};
const dayValues = {
narrow: ["S", "M", "T", "K", "T", "P", "L"],
short: ["su", "ma", "ti", "ke", "to", "pe", "la"],
abbreviated: ["sunn.", "maan.", "tiis.", "kesk.", "torst.", "perj.", "la"],
wide: [
"sunnuntai",
"maanantai",
"tiistai",
"keskiviikko",
"torstai",
"perjantai",
"lauantai",
],
};
const formattingDayValues = {
narrow: dayValues.narrow,
short: dayValues.short,
abbreviated: dayValues.abbreviated,
wide: [
"sunnuntaina",
"maanantaina",
"tiistaina",
"keskiviikkona",
"torstaina",
"perjantaina",
"lauantaina",
],
};
const dayPeriodValues = {
narrow: {
am: "ap",
pm: "ip",
midnight: "keskiyö",
noon: "keskipäivä",
morning: "ap",
afternoon: "ip",
evening: "illalla",
night: "yöllä",
},
abbreviated: {
am: "ap",
pm: "ip",
midnight: "keskiyö",
noon: "keskipäivä",
morning: "ap",
afternoon: "ip",
evening: "illalla",
night: "yöllä",
},
wide: {
am: "ap",
pm: "ip",
midnight: "keskiyöllä",
noon: "keskipäivällä",
morning: "aamupäivällä",
afternoon: "iltapäivällä",
evening: "illalla",
night: "yöllä",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
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,
defaultWidth: "wide",
formattingValues: formattingMonthValues,
defaultFormattingWidth: "wide",
}),
day: (0, _index.buildLocalizeFn)({
values: dayValues,
defaultWidth: "wide",
formattingValues: formattingDayValues,
defaultFormattingWidth: "wide",
}),
dayPeriod: (0, _index.buildLocalizeFn)({
values: dayPeriodValues,
defaultWidth: "wide",
}),
});

View File

@@ -0,0 +1 @@
{"version":3,"names":["_checkPrivateRedeclaration","obj","privateCollection","has","TypeError"],"sources":["../../src/helpers/checkPrivateRedeclaration.ts"],"sourcesContent":["/* @minVersion 7.14.1 */\n\nexport default function _checkPrivateRedeclaration(\n obj: object,\n privateCollection: WeakMap<object, unknown> | WeakSet<object>,\n) {\n if (privateCollection.has(obj)) {\n throw new TypeError(\n \"Cannot initialize the same private elements twice on an object\",\n );\n }\n}\n"],"mappings":";;;;;;AAEe,SAASA,0BAA0BA,CAChDC,GAAW,EACXC,iBAA6D,EAC7D;EACA,IAAIA,iBAAiB,CAACC,GAAG,CAACF,GAAG,CAAC,EAAE;IAC9B,MAAM,IAAIG,SAAS,CACjB,gEACF,CAAC;EACH;AACF","ignoreList":[]}

View File

@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2020 Vercel, Inc.
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,17 @@
import { killTransaction } from '../../utilities/killTransaction.js';
import { adminInit as adminInitTelemetry } from '../../utilities/telemetry/events/adminInit.js';
import { getAccessResults } from '../getAccessResults.js';
export const accessOperation = async (args)=>{
const { req } = args;
adminInitTelemetry(req);
try {
return getAccessResults({
req
});
} catch (e) {
await killTransaction(req);
throw e;
}
};
//# sourceMappingURL=access.js.map

View File

@@ -0,0 +1,6 @@
import type { CollisionDetection } from './types';
/**
* Returns the closest rectangles from an array of rectangles to the corners of
* another rectangle.
*/
export declare const closestCorners: CollisionDetection;

View File

@@ -0,0 +1,35 @@
// Copyright Joyent, Inc. and other Node 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.
'use strict';
require('./common');
var assert = require('assert');
var events = require('../');
var E = events.EventEmitter.prototype;
assert.strictEqual(E.constructor.name, 'EventEmitter');
assert.strictEqual(E.on, E.addListener); // Same method.
assert.strictEqual(E.off, E.removeListener); // Same method.
Object.getOwnPropertyNames(E).forEach(function(name) {
if (name === 'constructor' || name === 'on' || name === 'off') return;
if (typeof E[name] !== 'function') return;
assert.strictEqual(E[name].name, name);
});

View File

@@ -0,0 +1 @@
{"version":3,"file":"verifyEmail.d.ts","sourceRoot":"","sources":["../../../../src/auth/operations/local/verifyEmail.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,kBAAkB,EAAE,OAAO,EAAE,cAAc,EAAE,MAAM,mBAAmB,CAAA;AACpF,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAA;AAM7D,MAAM,MAAM,OAAO,CAAC,KAAK,SAAS,kBAAkB,IAAI;IACtD,UAAU,EAAE,KAAK,CAAA;IACjB,OAAO,CAAC,EAAE,cAAc,CAAA;IACxB,GAAG,CAAC,EAAE,OAAO,CAAC,cAAc,CAAC,CAAA;IAC7B,KAAK,EAAE,MAAM,CAAA;CACd,CAAA;AAED,wBAAsB,gBAAgB,CAAC,CAAC,SAAS,kBAAkB,EACjE,OAAO,EAAE,OAAO,EAChB,OAAO,EAAE,OAAO,CAAC,CAAC,CAAC,GAClB,OAAO,CAAC,OAAO,CAAC,CAgBlB"}

View File

@@ -0,0 +1,33 @@
"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 });
exports.defaultServiceName = exports.emptyResource = exports.defaultResource = exports.resourceFromAttributes = exports.serviceInstanceIdDetector = exports.processDetector = exports.osDetector = exports.hostDetector = exports.envDetector = exports.detectResources = void 0;
var detect_resources_1 = require("./detect-resources");
Object.defineProperty(exports, "detectResources", { enumerable: true, get: function () { return detect_resources_1.detectResources; } });
var detectors_1 = require("./detectors");
Object.defineProperty(exports, "envDetector", { enumerable: true, get: function () { return detectors_1.envDetector; } });
Object.defineProperty(exports, "hostDetector", { enumerable: true, get: function () { return detectors_1.hostDetector; } });
Object.defineProperty(exports, "osDetector", { enumerable: true, get: function () { return detectors_1.osDetector; } });
Object.defineProperty(exports, "processDetector", { enumerable: true, get: function () { return detectors_1.processDetector; } });
Object.defineProperty(exports, "serviceInstanceIdDetector", { enumerable: true, get: function () { return detectors_1.serviceInstanceIdDetector; } });
var ResourceImpl_1 = require("./ResourceImpl");
Object.defineProperty(exports, "resourceFromAttributes", { enumerable: true, get: function () { return ResourceImpl_1.resourceFromAttributes; } });
Object.defineProperty(exports, "defaultResource", { enumerable: true, get: function () { return ResourceImpl_1.defaultResource; } });
Object.defineProperty(exports, "emptyResource", { enumerable: true, get: function () { return ResourceImpl_1.emptyResource; } });
var default_service_name_1 = require("./default-service-name");
Object.defineProperty(exports, "defaultServiceName", { enumerable: true, get: function () { return default_service_name_1.defaultServiceName; } });
//# sourceMappingURL=index.js.map

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/bin/generateSchema.ts"],"sourcesContent":["import type { SanitizedConfig } from 'payload'\n\nimport fs from 'fs'\nimport { printSchema } from 'graphql'\n\nimport { configToSchema } from '../index.js'\nexport function generateSchema(config: SanitizedConfig): void {\n const outputFile = process.env.PAYLOAD_GRAPHQL_SCHEMA_PATH || config.graphQL.schemaOutputFile\n\n const { schema } = configToSchema(config)\n\n fs.writeFileSync(outputFile, printSchema(schema))\n}\n"],"names":["fs","printSchema","configToSchema","generateSchema","config","outputFile","process","env","PAYLOAD_GRAPHQL_SCHEMA_PATH","graphQL","schemaOutputFile","schema","writeFileSync"],"mappings":"AAEA,OAAOA,QAAQ,KAAI;AACnB,SAASC,WAAW,QAAQ,UAAS;AAErC,SAASC,cAAc,QAAQ,cAAa;AAC5C,OAAO,SAASC,eAAeC,MAAuB;IACpD,MAAMC,aAAaC,QAAQC,GAAG,CAACC,2BAA2B,IAAIJ,OAAOK,OAAO,CAACC,gBAAgB;IAE7F,MAAM,EAAEC,MAAM,EAAE,GAAGT,eAAeE;IAElCJ,GAAGY,aAAa,CAACP,YAAYJ,YAAYU;AAC3C"}

View File

@@ -0,0 +1,46 @@
var createRange = require('./_createRange');
/**
* Creates an array of numbers (positive and/or negative) progressing from
* `start` up to, but not including, `end`. A step of `-1` is used if a negative
* `start` is specified without an `end` or `step`. If `end` is not specified,
* it's set to `start` with `start` then set to `0`.
*
* **Note:** JavaScript follows the IEEE-754 standard for resolving
* floating-point values which can produce unexpected results.
*
* @static
* @since 0.1.0
* @memberOf _
* @category Util
* @param {number} [start=0] The start of the range.
* @param {number} end The end of the range.
* @param {number} [step=1] The value to increment or decrement by.
* @returns {Array} Returns the range of numbers.
* @see _.inRange, _.rangeRight
* @example
*
* _.range(4);
* // => [0, 1, 2, 3]
*
* _.range(-4);
* // => [0, -1, -2, -3]
*
* _.range(1, 5);
* // => [1, 2, 3, 4]
*
* _.range(0, 20, 5);
* // => [0, 5, 10, 15]
*
* _.range(0, -4, -1);
* // => [0, -1, -2, -3]
*
* _.range(1, 4, 0);
* // => [1, 1, 1]
*
* _.range(0);
* // => []
*/
var range = createRange();
module.exports = range;

View File

@@ -0,0 +1 @@
module.exports={A:{A:{"2":"K D E F A zC","132":"B"},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 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","66":"EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB"},D:{"1":"0 1 2 3 4 5 6 7 8 eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B WC 6B XC 7B 8B 9B AC BC CC DC EC FC GC HC IC JC KC LC MC NC Q H R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z JB 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 M G N","33":"CB DB EB FB GB HB IB dB","66":"9 O P cB AB BB"},E:{"1":"E F A B C L M G AD cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","2":"J bB K D 6C bC 7C 8C 9C"},F:{"1":"0 1 2 3 4 5 6 7 8 9 G N O P cB AB BB CB DB EB FB GB HB IB dB eB fB gB hB iB jB kB lB mB nB oB pB qB rB sB tB uB vB wB xB yB zB 0B 1B 2B 3B 4B 5B 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"},G:{"2":"E bC OD yC PD QD RD SD TD UD VD WD XD YD ZD aD","260":"bD cD dD eD fD gD hD dC eC RC iD SC fC gC hC iC jC jD TC kC lC mC nC oC kD UC pC qC rC sC lD tC uC vC wC"},H:{"2":"mD"},I:{"1":"I sD","2":"VC J nD oD pD qD yC rD"},J:{"2":"D A"},K:{"1":"H","2":"A B C PC xC QC"},L:{"1":"I"},M:{"1":"OC"},N:{"1":"B","2":"A"},O:{"1":"RC"},P:{"1":"9 AB BB CB DB EB FB GB HB IB xD cC yD zD 0D 1D 2D SC TC UC 3D","2":"J tD uD vD wD"},Q:{"1":"4D"},R:{"1":"5D"},S:{"1":"6D 7D"}},B:2,C:"Media Source Extensions",D:true};

View File

@@ -0,0 +1,59 @@
"use strict";
exports.setDay = setDay;
var _index = require("./_lib/defaultOptions.cjs");
var _index2 = require("./addDays.cjs");
var _index3 = require("./toDate.cjs");
/**
* The {@link setDay} function options.
*/
/**
* @name setDay
* @category Weekday Helpers
* @summary Set the day of the week to the given date.
*
* @description
* Set the day of the week to the given date.
*
* @typeParam DateType - The `Date` type, the function operates on. Gets inferred from passed arguments. Allows to use extensions like [`UTCDate`](https://github.com/date-fns/utc).
* @typeParam ResultDate - The result `Date` type, it is the type returned from the context function if it is passed, or inferred from the arguments.
*
* @param date - The date to be changed
* @param day - The day of the week of the new date
* @param options - An object with options.
*
* @returns The new date with the day of the week set
*
* @example
* // Set week day to Sunday, with the default weekStartsOn of Sunday:
* const result = setDay(new Date(2014, 8, 1), 0)
* //=> Sun Aug 31 2014 00:00:00
*
* @example
* // Set week day to Sunday, with a weekStartsOn of Monday:
* const result = setDay(new Date(2014, 8, 1), 0, { weekStartsOn: 1 })
* //=> Sun Sep 07 2014 00:00:00
*/
function setDay(date, day, options) {
const defaultOptions = (0, _index.getDefaultOptions)();
const weekStartsOn =
options?.weekStartsOn ??
options?.locale?.options?.weekStartsOn ??
defaultOptions.weekStartsOn ??
defaultOptions.locale?.options?.weekStartsOn ??
0;
const date_ = (0, _index3.toDate)(date, options?.in);
const currentDay = date_.getDay();
const remainder = day % 7;
const dayIndex = (remainder + 7) % 7;
const delta = 7 - weekStartsOn;
const diff =
day < 0 || day > 6
? day - ((currentDay + delta) % 7)
: ((dayIndex + delta) % 7) - ((currentDay + delta) % 7);
return (0, _index2.addDays)(date_, diff, options);
}

View File

@@ -0,0 +1,123 @@
# convert-source-map [![Build Status][ci-image]][ci-url]
Converts a source-map from/to different formats and allows adding/changing properties.
```js
var convert = require('convert-source-map');
var json = convert
.fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQvZm9vLm1pbi5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=')
.toJSON();
var modified = convert
.fromComment('//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYnVpbGQvZm9vLm1pbi5qcyIsInNvdXJjZXMiOlsic3JjL2Zvby5qcyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiQUFBQSIsInNvdXJjZVJvb3QiOiIvIn0=')
.setProperty('sources', [ 'SRC/FOO.JS' ])
.toJSON();
console.log(json);
console.log(modified);
```
```json
{"version":3,"file":"build/foo.min.js","sources":["src/foo.js"],"names":[],"mappings":"AAAA","sourceRoot":"/"}
{"version":3,"file":"build/foo.min.js","sources":["SRC/FOO.JS"],"names":[],"mappings":"AAAA","sourceRoot":"/"}
```
## API
### fromObject(obj)
Returns source map converter from given object.
### fromJSON(json)
Returns source map converter from given json string.
### fromBase64(base64)
Returns source map converter from given base64 encoded json string.
### fromComment(comment)
Returns source map converter from given base64 encoded json string prefixed with `//# sourceMappingURL=...`.
### fromMapFileComment(comment, mapFileDir)
Returns source map converter from given `filename` by parsing `//# sourceMappingURL=filename`.
`filename` must point to a file that is found inside the `mapFileDir`. Most tools store this file right next to the
generated file, i.e. the one containing the source map.
### fromSource(source)
Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was found.
### fromMapFileSource(source, mapFileDir)
Finds last sourcemap comment in file and returns source map converter or returns null if no source map comment was
found.
The sourcemap will be read from the map file found by parsing `# sourceMappingURL=file` comment. For more info see
fromMapFileComment.
### toObject()
Returns a copy of the underlying source map.
### toJSON([space])
Converts source map to json string. If `space` is given (optional), this will be passed to
[JSON.stringify](https://developer.mozilla.org/en-US/docs/JavaScript/Reference/Global_Objects/JSON/stringify) when the
JSON string is generated.
### toBase64()
Converts source map to base64 encoded json string.
### toComment([options])
Converts source map to an inline comment that can be appended to the source-file.
By default, the comment is formatted like: `//# sourceMappingURL=...`, which you would
normally see in a JS source file.
When `options.multiline == true`, the comment is formatted like: `/*# sourceMappingURL=... */`, which you would find in a CSS source file.
### addProperty(key, value)
Adds given property to the source map. Throws an error if property already exists.
### setProperty(key, value)
Sets given property to the source map. If property doesn't exist it is added, otherwise its value is updated.
### getProperty(key)
Gets given property of the source map.
### removeComments(src)
Returns `src` with all source map comments removed
### removeMapFileComments(src)
Returns `src` with all source map comments pointing to map files removed.
### commentRegex
Provides __a fresh__ RegExp each time it is accessed. Can be used to find source map comments.
### mapFileCommentRegex
Provides __a fresh__ RegExp each time it is accessed. Can be used to find source map comments pointing to map files.
### generateMapFileComment(file, [options])
Returns a comment that links to an external source map via `file`.
By default, the comment is formatted like: `//# sourceMappingURL=...`, which you would normally see in a JS source file.
When `options.multiline == true`, the comment is formatted like: `/*# sourceMappingURL=... */`, which you would find in a CSS source file.
[ci-url]: https://github.com/thlorenz/convert-source-map/actions?query=workflow:ci
[ci-image]: https://img.shields.io/github/workflow/status/thlorenz/convert-source-map/CI?style=flat-square

View File

@@ -0,0 +1 @@
{"version":3,"file":"esmLoader.d.ts","sourceRoot":"","sources":["../../../src/sdk/esmLoader.ts"],"names":[],"mappings":"AAKA;;;;;GAKG;AACH,wBAAgB,mBAAmB,IAAI,IAAI,CAmB1C"}

View File

@@ -0,0 +1,187 @@
import { buildLocalizeFn } from "../../_lib/buildLocalizeFn.mjs";
const eraValues = {
narrow: ["B", "A"],
abbreviated: ["BC", "AD"],
wide: ["Before Christ", "Anno Domini"],
};
const quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1st quarter", "2nd quarter", "3rd quarter", "4th quarter"],
};
// Note: in English, the names of days of the week and months are capitalized.
// If you are making a new locale based on this one, check if the same is true for the language you're working on.
// Generally, formatted dates should look like they are in the middle of a sentence,
// e.g. in Spanish language the weekdays and months should be in the lowercase.
const monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"Jan",
"Feb",
"Mar",
"Apr",
"May",
"Jun",
"Jul",
"Aug",
"Sep",
"Oct",
"Nov",
"Dec",
],
wide: [
"January",
"February",
"March",
"April",
"May",
"June",
"July",
"August",
"September",
"October",
"November",
"December",
],
};
const dayValues = {
narrow: ["S", "M", "T", "W", "T", "F", "S"],
short: ["Su", "Mo", "Tu", "We", "Th", "Fr", "Sa"],
abbreviated: ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"],
wide: [
"Sunday",
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
],
};
const dayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "morning",
afternoon: "afternoon",
evening: "evening",
night: "night",
},
};
const formattingDayPeriodValues = {
narrow: {
am: "a",
pm: "p",
midnight: "mi",
noon: "n",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night",
},
abbreviated: {
am: "AM",
pm: "PM",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night",
},
wide: {
am: "a.m.",
pm: "p.m.",
midnight: "midnight",
noon: "noon",
morning: "in the morning",
afternoon: "in the afternoon",
evening: "in the evening",
night: "at night",
},
};
const ordinalNumber = (dirtyNumber, _options) => {
const number = Number(dirtyNumber);
// If ordinal numbers depend on context, for example,
// if they are different for different grammatical genders,
// use `options.unit`.
//
// `unit` can be 'year', 'quarter', 'month', 'week', 'date', 'dayOfYear',
// 'day', 'hour', 'minute', 'second'.
const rem100 = number % 100;
if (rem100 > 20 || rem100 < 10) {
switch (rem100 % 10) {
case 1:
return number + "st";
case 2:
return number + "nd";
case 3:
return number + "rd";
}
}
return number + "th";
};
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,27 @@
import { previousDay } from "./previousDay.mjs";
/**
* @name previousTuesday
* @category Weekday Helpers
* @summary When is the previous Tuesday?
*
* @description
* When is the previous Tuesday?
*
* @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 Tuesday
*
* @example
* // When is the previous Tuesday before Jun, 18, 2021?
* const result = previousTuesday(new Date(2021, 5, 18))
* //=> Tue June 15 2021 00:00:00
*/
export function previousTuesday(date) {
return previousDay(date, 2);
}
// Fallback for modularized imports:
export default previousTuesday;

View File

@@ -0,0 +1,78 @@
import { type Cache } from "../cache/core/cache.cjs";
import type { WithCacheConfig } from "../cache/core/types.cjs";
import { entityKind } from "../entity.cjs";
import type { RelationalSchemaConfig, TablesRelationalConfig } from "../relations.cjs";
import { type Query, type SQL } from "../sql/sql.cjs";
import type { Assume, Equal } from "../utils.cjs";
import { SingleStoreDatabase } from "./db.cjs";
import type { SingleStoreDialect } from "./dialect.cjs";
import type { SelectedFieldsOrdered } from "./query-builders/select.types.cjs";
export interface SingleStoreQueryResultHKT {
readonly $brand: 'SingleStoreQueryResultHKT';
readonly row: unknown;
readonly type: unknown;
}
export interface AnySingleStoreQueryResultHKT extends SingleStoreQueryResultHKT {
readonly type: any;
}
export type SingleStoreQueryResultKind<TKind extends SingleStoreQueryResultHKT, TRow> = (TKind & {
readonly row: TRow;
})['type'];
export interface SingleStorePreparedQueryConfig {
execute: unknown;
iterator: unknown;
}
export interface SingleStorePreparedQueryHKT {
readonly $brand: 'SingleStorePreparedQueryHKT';
readonly config: unknown;
readonly type: unknown;
}
export type PreparedQueryKind<TKind extends SingleStorePreparedQueryHKT, TConfig extends SingleStorePreparedQueryConfig, TAssume extends boolean = false> = Equal<TAssume, true> extends true ? Assume<(TKind & {
readonly config: TConfig;
})['type'], SingleStorePreparedQuery<TConfig>> : (TKind & {
readonly config: TConfig;
})['type'];
export declare abstract class SingleStorePreparedQuery<T extends SingleStorePreparedQueryConfig> {
private cache?;
private queryMetadata?;
private cacheConfig?;
static readonly [entityKind]: string;
constructor(cache?: Cache | undefined, queryMetadata?: {
type: 'select' | 'update' | 'delete' | 'insert';
tables: string[];
} | undefined, cacheConfig?: WithCacheConfig | undefined);
abstract execute(placeholderValues?: Record<string, unknown>): Promise<T['execute']>;
abstract iterator(placeholderValues?: Record<string, unknown>): AsyncGenerator<T['iterator']>;
}
export interface SingleStoreTransactionConfig {
withConsistentSnapshot?: boolean;
accessMode?: 'read only' | 'read write';
isolationLevel: 'read committed';
}
export declare abstract class SingleStoreSession<TQueryResult extends SingleStoreQueryResultHKT = SingleStoreQueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase = PreparedQueryHKTBase, TFullSchema extends Record<string, unknown> = Record<string, never>, TSchema extends TablesRelationalConfig = Record<string, never>> {
protected dialect: SingleStoreDialect;
static readonly [entityKind]: string;
constructor(dialect: SingleStoreDialect);
abstract prepareQuery<T extends SingleStorePreparedQueryConfig, TPreparedQueryHKT extends SingleStorePreparedQueryHKT>(query: Query, fields: SelectedFieldsOrdered | undefined, customResultMapper?: (rows: unknown[][]) => T['execute'], generatedIds?: Record<string, unknown>[], returningIds?: SelectedFieldsOrdered, queryMetadata?: {
type: 'select' | 'update' | 'delete' | 'insert';
tables: string[];
}, cacheConfig?: WithCacheConfig): PreparedQueryKind<TPreparedQueryHKT, T>;
execute<T>(query: SQL): Promise<T>;
abstract all<T = unknown>(query: SQL): Promise<T[]>;
count(sql: SQL): Promise<number>;
abstract transaction<T>(transaction: (tx: SingleStoreTransaction<TQueryResult, TPreparedQueryHKT, TFullSchema, TSchema>) => Promise<T>, config?: SingleStoreTransactionConfig): Promise<T>;
protected getSetTransactionSQL(config: SingleStoreTransactionConfig): SQL | undefined;
protected getStartTransactionSQL(config: SingleStoreTransactionConfig): SQL | undefined;
}
export declare abstract class SingleStoreTransaction<TQueryResult extends SingleStoreQueryResultHKT, TPreparedQueryHKT extends PreparedQueryHKTBase, TFullSchema extends Record<string, unknown> = Record<string, never>, TSchema extends TablesRelationalConfig = Record<string, never>> extends SingleStoreDatabase<TQueryResult, TPreparedQueryHKT, TFullSchema, TSchema> {
protected schema: RelationalSchemaConfig<TSchema> | undefined;
protected readonly nestedIndex: number;
static readonly [entityKind]: string;
constructor(dialect: SingleStoreDialect, session: SingleStoreSession, schema: RelationalSchemaConfig<TSchema> | undefined, nestedIndex: number);
rollback(): never;
/** Nested transactions (aka savepoints) only work with InnoDB engine. */
abstract transaction<T>(transaction: (tx: SingleStoreTransaction<TQueryResult, TPreparedQueryHKT, TFullSchema, TSchema>) => Promise<T>): Promise<T>;
}
export interface PreparedQueryHKTBase extends SingleStorePreparedQueryHKT {
type: SingleStorePreparedQuery<Assume<this['config'], SingleStorePreparedQueryConfig>>;
}

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=attributes.js.map

View File

@@ -0,0 +1,24 @@
/**
* @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 PawPrint = createLucideIcon("PawPrint", [
["circle", { cx: "11", cy: "4", r: "2", key: "vol9p0" }],
["circle", { cx: "18", cy: "8", r: "2", key: "17gozi" }],
["circle", { cx: "20", cy: "16", r: "2", key: "1v9bxh" }],
[
"path",
{
d: "M9 10a5 5 0 0 1 5 5v3.5a3.5 3.5 0 0 1-6.84 1.045Q6.52 17.48 4.46 16.84A3.5 3.5 0 0 1 5.5 10Z",
key: "1ydw1z"
}
]
]);
export { PawPrint as default };
//# sourceMappingURL=paw-print.js.map

View File

@@ -0,0 +1,15 @@
/** JSDoc */
export declare function resolve(...args: string[]): string;
/** JSDoc */
export declare function relative(from: string, to: string): string;
/** JSDoc */
export declare function normalizePath(path: string): string;
/** JSDoc */
export declare function isAbsolute(path: string): boolean;
/** JSDoc */
export declare function join(...args: string[]): string;
/** JSDoc */
export declare function dirname(path: string): string;
/** JSDoc */
export declare function basename(path: string, ext?: string): string;
//# sourceMappingURL=path.d.ts.map

View File

@@ -0,0 +1,3 @@
import React from 'react';
export declare const Success: React.FC;
//# sourceMappingURL=Success.d.ts.map

View File

@@ -0,0 +1,35 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Ivan Kopeykin @vankop
*/
"use strict";
const RuntimeGlobals = require("../RuntimeGlobals");
const RuntimeModule = require("../RuntimeModule");
/** @typedef {import("../../declarations/WebpackOptions").EntryDescriptionNormalized} EntryDescription */
/** @typedef {import("../Chunk")} Chunk */
class BaseUriRuntimeModule extends RuntimeModule {
constructor() {
super("base uri", RuntimeModule.STAGE_ATTACH);
}
/**
* @returns {string | null} runtime code
*/
generate() {
const chunk = /** @type {Chunk} */ (this.chunk);
const options =
/** @type {EntryDescription} */
(chunk.getEntryOptions());
return `${RuntimeGlobals.baseURI} = ${
options.baseUri === undefined
? "undefined"
: JSON.stringify(options.baseUri)
};`;
}
}
module.exports = BaseUriRuntimeModule;

View File

@@ -0,0 +1,15 @@
ISC License
Copyright (c) for portions of Lucide are held by Cole Bemis 2013-2022 as part of Feather (MIT). All other copyright (c) for Lucide are held by Lucide Contributors 2022.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR
ANY SPECIAL, DIRECT, INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.

View File

@@ -0,0 +1,57 @@
// @ts-ignore TS6133
import { expect, test } from "vitest";
import * as z from "zod/v3";
test("function parsing", () => {
const schema = z.union([z.string().refine(() => false), z.number().refine(() => false)]);
const result = schema.safeParse("asdf");
expect(result.success).toEqual(false);
});
test("union 2", () => {
const result = z.union([z.number(), z.string().refine(() => false)]).safeParse("a");
expect(result.success).toEqual(false);
});
test("return valid over invalid", () => {
const schema = z.union([
z.object({
email: z.string().email(),
}),
z.string(),
]);
expect(schema.parse("asdf")).toEqual("asdf");
expect(schema.parse({ email: "asdlkjf@lkajsdf.com" })).toEqual({
email: "asdlkjf@lkajsdf.com",
});
});
test("return dirty result over aborted", () => {
const result = z.union([z.number(), z.string().refine(() => false)]).safeParse("a");
expect(result.success).toEqual(false);
if (!result.success) {
expect(result.error.issues).toEqual([
{
code: "custom",
message: "Invalid input",
path: [],
},
]);
}
});
test("options getter", async () => {
const union = z.union([z.string(), z.number()]);
union.options[0].parse("asdf");
union.options[1].parse(1234);
await union.options[0].parseAsync("asdf");
await union.options[1].parseAsync(1234);
});
test("readonly union", async () => {
const options = [z.string(), z.number()] as const;
const union = z.union(options);
union.parse("asdf");
union.parse(12);
});

View File

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

View File

@@ -0,0 +1,31 @@
"use strict";
exports.de = void 0;
var _index = require("./de/_lib/formatDistance.js");
var _index2 = require("./de/_lib/formatLong.js");
var _index3 = require("./de/_lib/formatRelative.js");
var _index4 = require("./de/_lib/localize.js");
var _index5 = require("./de/_lib/match.js");
/**
* @category Locales
* @summary German locale.
* @language German
* @iso-639-2 deu
* @author Thomas Eilmsteiner [@DeMuu](https://github.com/DeMuu)
* @author Asia [@asia-t](https://github.com/asia-t)
* @author Van Vuong Ngo [@vanvuongngo](https://github.com/vanvuongngo)
* @author RomanErnst [@pex](https://github.com/pex)
* @author Philipp Keck [@Philipp91](https://github.com/Philipp91)
*/
const de = (exports.de = {
code: "de",
formatDistance: _index.formatDistance,
formatLong: _index2.formatLong,
formatRelative: _index3.formatRelative,
localize: _index4.localize,
match: _index5.match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
});

View File

@@ -0,0 +1,150 @@
import React, { Component } from "react";
import { type DateFilterOptions, type DateNumberType, type Locale, type HolidaysMap } from "./date_utils";
interface DayProps extends Pick<DateFilterOptions, "minDate" | "maxDate" | "excludeDates" | "excludeDateIntervals" | "includeDateIntervals" | "includeDates" | "filterDate"> {
ariaLabelPrefixWhenEnabled?: string;
ariaLabelPrefixWhenDisabled?: string;
disabledKeyboardNavigation?: boolean;
day: Date;
dayClassName?: (date: Date) => string;
highlightDates?: Map<string, string[]>;
holidays?: HolidaysMap;
inline?: boolean;
shouldFocusDayInline?: boolean;
month: number;
onClick?: React.MouseEventHandler<HTMLDivElement>;
onMouseEnter?: React.MouseEventHandler<HTMLDivElement>;
handleOnKeyDown?: React.KeyboardEventHandler<HTMLDivElement>;
usePointerEvent?: boolean;
preSelection?: Date | null;
selected?: Date | null;
selectingDate?: Date;
selectsEnd?: boolean;
selectsStart?: boolean;
selectsRange?: boolean;
showWeekPicker?: boolean;
showWeekNumber?: boolean;
selectsDisabledDaysInRange?: boolean;
selectsMultiple?: boolean;
selectedDates?: Date[];
startDate?: Date | null;
endDate?: Date | null;
renderDayContents?: (day: number, date: Date) => React.ReactNode;
containerRef?: React.RefObject<HTMLDivElement>;
calendarStartDay?: DateNumberType;
locale?: Locale;
monthShowsDuplicateDaysEnd?: boolean;
monthShowsDuplicateDaysStart?: boolean;
}
/**
* `Day` is a React component that represents a single day in a date picker.
* It handles the rendering and interaction of a day.
*
* @prop ariaLabelPrefixWhenEnabled - Aria label prefix when the day is enabled.
* @prop ariaLabelPrefixWhenDisabled - Aria label prefix when the day is disabled.
* @prop disabledKeyboardNavigation - Whether keyboard navigation is disabled.
* @prop day - The day to be displayed.
* @prop dayClassName - Function to customize the CSS class of the day.
* @prop endDate - The end date in a range.
* @prop highlightDates - Map of dates to be highlighted.
* @prop holidays - Map of holiday dates.
* @prop inline - Whether the date picker is inline.
* @prop shouldFocusDayInline - Whether the day should be focused when date picker is inline.
* @prop month - The month the day belongs to.
* @prop onClick - Click event handler.
* @prop onMouseEnter - Mouse enter event handler.
* @prop handleOnKeyDown - Key down event handler.
* @prop usePointerEvent - Whether to use pointer events.
* @prop preSelection - The date that is currently selected.
* @prop selected - The selected date.
* @prop selectingDate - The date currently being selected.
* @prop selectsEnd - Whether the day can be the end date in a range.
* @prop selectsStart - Whether the day can be the start date in a range.
* @prop selectsRange - Whether the day can be in a range.
* @prop showWeekPicker - Whether to show week picker.
* @prop showWeekNumber - Whether to show week numbers.
* @prop selectsDisabledDaysInRange - Whether to select disabled days in a range.
* @prop selectsMultiple - Whether to allow multiple date selection.
* @prop selectedDates - Array of selected dates.
* @prop startDate - The start date in a range.
* @prop renderDayContents - Function to customize the rendering of the day's contents.
* @prop containerRef - Ref for the container.
* @prop excludeDates - Array of dates to be excluded.
* @prop calendarStartDay - The start day of the week.
* @prop locale - The locale object.
* @prop monthShowsDuplicateDaysEnd - Whether to show duplicate days at the end of the month.
* @prop monthShowsDuplicateDaysStart - Whether to show duplicate days at the start of the month.
* @prop includeDates - Array of dates to be included.
* @prop includeDateIntervals - Array of date intervals to be included.
* @prop minDate - The minimum date that can be selected.
* @prop maxDate - The maximum date that can be selected.
*
* @example
* ```tsx
* import React from 'react';
* import Day from './day';
*
* function MyComponent() {
* const handleDayClick = (event) => {
* console.log('Day clicked', event);
* };
*
* const handleDayMouseEnter = (event) => {
* console.log('Mouse entered day', event);
* };
*
* const renderDayContents = (date) => {
* return <div>{date.getDate()}</div>;
* };
*
* return (
* <Day
* day={new Date()}
* onClick={handleDayClick}
* onMouseEnter={handleDayMouseEnter}
* renderDayContents={renderDayContents}
* />
* );
* }
*
* export default MyComponent;
* ```
*/
export default class Day extends Component<DayProps> {
componentDidMount(): void;
componentDidUpdate(): void;
dayEl: React.RefObject<HTMLDivElement>;
handleClick: DayProps["onClick"];
handleMouseEnter: DayProps["onMouseEnter"];
handleOnKeyDown: React.KeyboardEventHandler<HTMLDivElement>;
isSameDay: (other: Date | null | undefined) => boolean;
isKeyboardSelected: () => boolean | undefined;
isDisabled: (day?: Date) => boolean;
isExcluded: () => boolean;
isStartOfWeek: () => boolean;
isSameWeek: (other?: Date | null) => boolean | undefined;
isSameDayOrWeek: (other?: Date | null) => boolean | undefined;
getHighLightedClass: () => false | string[] | undefined;
getHolidaysClass: () => (string | undefined)[];
isInRange: () => boolean;
isInSelectingRange: () => boolean;
isSelectingRangeStart: () => boolean;
isSelectingRangeEnd: () => boolean;
isRangeStart: () => boolean;
isRangeEnd: () => boolean;
isWeekend: () => boolean;
isAfterMonth: () => boolean;
isBeforeMonth: () => boolean;
isCurrentDay: () => boolean;
isSelected: () => boolean | undefined;
getClassNames: (date: Date) => string;
getAriaLabel: () => string;
getTitle: () => string;
getTabIndex: () => 0 | -1;
handleFocusDay: () => void;
private shouldFocusDay;
private isDayActiveElement;
private isDuplicateDay;
renderDayContents: () => React.ReactNode;
render: () => React.JSX.Element;
}
export {};

View File

@@ -0,0 +1,55 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.DEFAULT_HEADER_ALIGNMENT = exports.DEFAULT_ROW_ALIGNMENT = exports.DEFAULT_HEADER_FONT_COLOR = exports.DEFAULT_ROW_FONT_COLOR = exports.COLORS = exports.ALIGNMENTS = exports.DEFAULT_TABLE_STYLE = exports.DEFAULT_ROW_SEPARATOR = exports.DEFAULT_COLUMN_LEN = void 0;
exports.DEFAULT_COLUMN_LEN = 20;
exports.DEFAULT_ROW_SEPARATOR = false;
exports.DEFAULT_TABLE_STYLE = {
/*
Default Style
┌────────────┬─────┬──────┐
│ foo │ bar │ baz │
│ frobnicate │ bar │ quuz │
└────────────┴─────┴──────┘
*/
headerTop: {
left: '┌',
mid: '┬',
right: '┐',
other: '─',
},
headerBottom: {
left: '├',
mid: '┼',
right: '┤',
other: '─',
},
tableBottom: {
left: '└',
mid: '┴',
right: '┘',
other: '─',
},
vertical: '│',
rowSeparator: {
left: '├',
mid: '┼',
right: '┤',
other: '─',
},
};
exports.ALIGNMENTS = ['right', 'left', 'center'];
exports.COLORS = [
'red',
'green',
'yellow',
'white',
'blue',
'magenta',
'cyan',
'white_bold',
'reset',
];
exports.DEFAULT_ROW_FONT_COLOR = 'white';
exports.DEFAULT_HEADER_FONT_COLOR = 'white_bold';
exports.DEFAULT_ROW_ALIGNMENT = 'right';
exports.DEFAULT_HEADER_ALIGNMENT = 'center';

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,6DAA4D;AAAnD,oHAAA,gBAAgB,OAAA;AACzB,yDAAwD;AAA/C,gHAAA,cAAc,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 { ExpressInstrumentation } from './instrumentation';\nexport { ExpressLayerType } from './enums/ExpressLayerType';\nexport { AttributeNames } from './enums/AttributeNames';\nexport type {\n ExpressInstrumentationConfig,\n ExpressRequestCustomAttributeFunction,\n ExpressRequestInfo,\n IgnoreMatcher,\n LayerPathSegment,\n SpanNameHook,\n} from './types';\n"]}

View File

@@ -0,0 +1 @@
{"version":3,"file":"addHeadersAsAttributes.js","sources":["../../../../src/common/utils/addHeadersAsAttributes.ts"],"sourcesContent":["import type { Span, WebFetchHeaders } from '@sentry/core';\nimport { getClient, httpHeadersToSpanAttributes, winterCGHeadersToDict } from '@sentry/core';\n\n/**\n * Extracts HTTP request headers as span attributes and optionally applies them to a span.\n */\nexport function addHeadersAsAttributes(\n headers: WebFetchHeaders | Headers | Record<string, string | string[] | undefined> | undefined,\n span?: Span,\n): Record<string, string> {\n if (!headers) {\n return {};\n }\n\n const headersDict: Record<string, string | string[] | undefined> =\n headers instanceof Headers || (typeof headers === 'object' && 'get' in headers)\n ? winterCGHeadersToDict(headers as Headers)\n : headers;\n\n const headerAttributes = httpHeadersToSpanAttributes(headersDict, getClient()?.getOptions().sendDefaultPii ?? false);\n\n if (span) {\n span.setAttributes(headerAttributes);\n }\n\n return headerAttributes;\n}\n"],"names":[],"mappings":";;AAGA;AACA;AACA;AACO,SAAS,sBAAsB;AACtC,EAAE,OAAO;AACT,EAAE,IAAI;AACN,EAA0B;AAC1B,EAAE,IAAI,CAAC,OAAO,EAAE;AAChB,IAAI,OAAO,EAAE;AACb,EAAE;;AAEF,EAAE,MAAM,WAAW;AACnB,IAAI,OAAA,YAAmB,OAAA,KAAY,OAAO,OAAA,KAAY,QAAA,IAAY,KAAA,IAAS,OAAO;AAClF,QAAQ,qBAAqB,CAAC,OAAA;AAC9B,QAAQ,OAAO;;AAEf,EAAE,MAAM,gBAAA,GAAmB,2BAA2B,CAAC,WAAW,EAAE,SAAS,EAAE,EAAE,UAAU,EAAE,CAAC,cAAA,IAAkB,KAAK,CAAC;;AAEtH,EAAE,IAAI,IAAI,EAAE;AACZ,IAAI,IAAI,CAAC,aAAa,CAAC,gBAAgB,CAAC;AACxC,EAAE;;AAEF,EAAE,OAAO,gBAAgB;AACzB;;;;"}

View File

@@ -0,0 +1 @@
{"version":3,"file":"scroll.js","sources":["../../../src/icons/scroll.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Scroll\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTkgMTdWNWEyIDIgMCAwIDAtMi0ySDQiIC8+CiAgPHBhdGggZD0iTTggMjFoMTJhMiAyIDAgMCAwIDItMnYtMWExIDEgMCAwIDAtMS0xSDExYTEgMSAwIDAgMC0xIDF2MWEyIDIgMCAxIDEtNCAwVjVhMiAyIDAgMSAwLTQgMHYyYTEgMSAwIDAgMCAxIDFoMyIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/scroll\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 Scroll = createLucideIcon('Scroll', [\n ['path', { d: 'M19 17V5a2 2 0 0 0-2-2H4', key: 'zz82l3' }],\n [\n 'path',\n {\n d: 'M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3',\n key: '1ph1d7',\n },\n ],\n]);\n\nexport default Scroll;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA4B,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CACzD,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}

View File

@@ -0,0 +1,15 @@
import type { ImportMap, SanitizedConfig, ServerFunctionClient } from 'payload';
import React from 'react';
import '@payloadcms/ui/scss/app.scss';
export declare const metadata: {
description: string;
title: string;
};
export declare const RootLayout: ({ children, config: configPromise, htmlProps, importMap, serverFunction, }: {
readonly children: React.ReactNode;
readonly config: Promise<SanitizedConfig>;
readonly htmlProps?: React.HtmlHTMLAttributes<HTMLHtmlElement>;
readonly importMap: ImportMap;
readonly serverFunction: ServerFunctionClient;
}) => Promise<React.JSX.Element>;
//# sourceMappingURL=index.d.ts.map

View File

@@ -0,0 +1,169 @@
/**
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
*/
import type { LexicalNode } from '../LexicalNode';
import type { CaretDirection, CaretRange, NodeCaret, PointCaret, RootMode, SiblingCaret, TextPointCaret } from './LexicalCaret';
import { type PointType, type RangeSelection } from '../LexicalSelection';
import { type ElementNode } from '../nodes/LexicalElementNode';
import { type TextNode } from '../nodes/LexicalTextNode';
/**
* @param point
* @returns a PointCaret for the point
*/
export declare function $caretFromPoint<D extends CaretDirection>(point: Pick<PointType, 'type' | 'key' | 'offset'>, direction: D): PointCaret<D>;
/**
* Update the given point in-place from the PointCaret
*
* @param point the point to set
* @param caret the caret to set the point from
*/
export declare function $setPointFromCaret<D extends CaretDirection>(point: PointType, caret: PointCaret<D>): void;
/**
* Set a RangeSelection on the editor from the given CaretRange
*
* @returns The new RangeSelection
*/
export declare function $setSelectionFromCaretRange(caretRange: CaretRange): RangeSelection;
/**
* Update the points of a RangeSelection based on the given PointCaret.
*/
export declare function $updateRangeSelectionFromCaretRange(selection: RangeSelection, caretRange: CaretRange): void;
/**
* Get a pair of carets for a RangeSelection.
*
* If the focus is before the anchor, then the direction will be
* 'previous', otherwise the direction will be 'next'.
*/
export declare function $caretRangeFromSelection(selection: RangeSelection): CaretRange;
/**
* Given a SiblingCaret we can always compute a caret that points to the
* origin of that caret in the same direction. The adjacent caret of the
* returned caret will be equivalent to the given caret.
*
* @example
* ```ts
* siblingCaret.is($rewindSiblingCaret(siblingCaret).getAdjacentCaret())
* ```
*
* @param caret The caret to "rewind"
* @returns A new caret (ChildCaret or SiblingCaret) with the same direction
*/
export declare function $rewindSiblingCaret<T extends LexicalNode, D extends CaretDirection>(caret: SiblingCaret<T, D>): NodeCaret<D>;
/**
* Remove all text and nodes in the given range. If the range spans multiple
* blocks then the remaining contents of the later block will be merged with
* the earlier block.
*
* @param initialRange The range to remove text and nodes from
* @param sliceMode If 'preserveEmptyTextPointCaret' it will leave an empty TextPointCaret at the anchor for insert if one exists, otherwise empty slices will be removed
* @returns The new collapsed range (biased towards the earlier node)
*/
export declare function $removeTextFromCaretRange<D extends CaretDirection>(initialRange: CaretRange<D>, sliceMode?: 'removeEmptySlices' | 'preserveEmptyTextSliceCaret'): CaretRange<D>;
/**
* Normalize a caret to the deepest equivalent PointCaret.
* This will return a TextPointCaret with the offset set according
* to the direction if given a caret with a TextNode origin
* or a caret with an ElementNode origin with the deepest ChildCaret
* having an adjacent TextNode.
*
* If given a TextPointCaret, it will be returned, as no normalization
* is required when an offset is already present.
*
* @param initialCaret
* @returns The normalized PointCaret
*/
export declare function $normalizeCaret<D extends CaretDirection>(initialCaret: PointCaret<D>): PointCaret<D>;
declare const PointCaretIsExtendableBrand: unique symbol;
/**
* Determine whether the TextPointCaret's offset can be extended further without leaving the TextNode.
* Returns false if the given caret is not a TextPointCaret or the offset can not be moved further in
* direction.
*
* @param caret A PointCaret
* @returns true if caret is a TextPointCaret with an offset that is not at the end of the text given the direction.
*/
export declare function $isExtendableTextPointCaret<D extends CaretDirection>(caret: PointCaret<D>): caret is TextPointCaret<TextNode, D> & {
[PointCaretIsExtendableBrand]: never;
};
/**
* Return the caret if it's in the given direction, otherwise return
* caret.getFlipped().
*
* @param caret Any PointCaret
* @param direction The desired direction
* @returns A PointCaret in direction
*/
export declare function $getCaretInDirection<Caret extends PointCaret<CaretDirection>, D extends CaretDirection>(caret: Caret, direction: D): NodeCaret<D> | (Caret extends TextPointCaret<TextNode, CaretDirection> ? TextPointCaret<TextNode, D> : never);
/**
* Return the range if it's in the given direction, otherwise
* construct a new range using a flipped focus as the anchor
* and a flipped anchor as the focus. This transformation
* preserves the section of the document that it's working
* with, but reverses the order of iteration.
*
* @param range Any CaretRange
* @param direction The desired direction
* @returns A CaretRange in direction
*/
export declare function $getCaretRangeInDirection<D extends CaretDirection>(range: CaretRange<CaretDirection>, direction: D): CaretRange<D>;
/**
* Get a caret pointing at the child at the given index, or the last
* caret in that node if out of bounds.
*
* @param parent An ElementNode
* @param index The index of the origin for the caret
* @returns A caret pointing towards the node at that index
*/
export declare function $getChildCaretAtIndex<D extends CaretDirection>(parent: ElementNode, index: number, direction: D): NodeCaret<D>;
/**
* Returns the Node sibling when this exists, otherwise the closest parent sibling. For example
* R -> P -> T1, T2
* -> P2
* returns T2 for node T1, P2 for node T2, and null for node P2.
* @param startCaret The initial caret
* @param rootMode The root mode, 'root' ('default') or 'shadowRoot'
* @returns An array (tuple) containing the found caret and the depth difference, or null, if this node doesn't exist.
*/
export declare function $getAdjacentSiblingOrParentSiblingCaret<D extends CaretDirection>(startCaret: NodeCaret<D>, rootMode?: RootMode): null | [NodeCaret<D>, number];
/**
* Get the adjacent nodes to initialCaret in the given direction.
*
* @example
* ```ts
* expect($getAdjacentNodes($getChildCaret(parent, 'next'))).toEqual(parent.getChildren());
* expect($getAdjacentNodes($getChildCaret(parent, 'previous'))).toEqual(parent.getChildren().reverse());
* expect($getAdjacentNodes($getSiblingCaret(node, 'next'))).toEqual(node.getNextSiblings());
* expect($getAdjacentNodes($getSiblingCaret(node, 'previous'))).toEqual(node.getPreviousSiblings().reverse());
* ```
*
* @param initialCaret The caret to start at (the origin will not be included)
* @returns An array of siblings.
*/
export declare function $getAdjacentNodes(initialCaret: NodeCaret<CaretDirection>): LexicalNode[];
export declare function $splitTextPointCaret<D extends CaretDirection>(textPointCaret: TextPointCaret<TextNode, D>): NodeCaret<D>;
export interface SplitAtPointCaretNextOptions {
/** The function to create the right side of a split ElementNode (default {@link $copyNode}) */
$copyElementNode?: (node: ElementNode) => ElementNode;
/** The function to split a TextNode (default {@link $splitTextPointCaret}) */
$splitTextPointCaretNext?: (caret: TextPointCaret<TextNode, 'next'>) => NodeCaret<'next'>;
/** If the parent matches rootMode a split will not occur, default is 'shadowRoot' */
rootMode?: RootMode;
/**
* If element.canBeEmpty() and would create an empty split, this function will be
* called with the element and 'first' | 'last'. If it returns false, the empty
* split will not be created. Default is `() => true` to always split when possible.
*/
$shouldSplit?: (node: ElementNode, edge: 'first' | 'last') => boolean;
}
/**
* Split a node at a PointCaret and return a NodeCaret at that point, or null if the
* node can't be split. This is non-recursive and will only perform at most one split.
*
* @returns The NodeCaret pointing to the location of the split (or null if a split is not possible)
*/
export declare function $splitAtPointCaretNext(pointCaret: PointCaret<'next'>, { $copyElementNode, $splitTextPointCaretNext, rootMode, $shouldSplit, }?: SplitAtPointCaretNextOptions): null | NodeCaret<'next'>;
export {};

View File

@@ -0,0 +1 @@
{"version":3,"sources":["../../src/email/defaults.ts"],"sourcesContent":["import type { InitializedEmailAdapter } from './types.js'\n\nexport const emailDefaults: Pick<\n InitializedEmailAdapter,\n 'defaultFromAddress' | 'defaultFromName'\n> = {\n defaultFromAddress: 'info@payloadcms.com',\n defaultFromName: 'Payload',\n}\n"],"names":["emailDefaults","defaultFromAddress","defaultFromName"],"mappings":"AAEA,OAAO,MAAMA,gBAGT;IACFC,oBAAoB;IACpBC,iBAAiB;AACnB,EAAC"}

View File

@@ -0,0 +1,43 @@
export let ErrorCode = /* @__PURE__ */ function(ErrorCode) {
// When we have a placeholder but no value to format
ErrorCode["MISSING_VALUE"] = "MISSING_VALUE";
// When value supplied is invalid
ErrorCode["INVALID_VALUE"] = "INVALID_VALUE";
// When we need specific Intl API but it's not available
ErrorCode["MISSING_INTL_API"] = "MISSING_INTL_API";
return ErrorCode;
}({});
export class FormatError extends Error {
code;
/**
* Original message we're trying to format
* `undefined` if we're only dealing w/ AST
*
* @type {(string | undefined)}
* @memberof FormatError
*/
originalMessage;
constructor(msg, code, originalMessage) {
super(msg);
this.code = code;
this.originalMessage = originalMessage;
}
toString() {
return `[formatjs Error: ${this.code}] ${this.message}`;
}
}
export class InvalidValueError extends FormatError {
constructor(variableId, value, options, originalMessage) {
super(`Invalid values for "${variableId}": "${value}". Options are "${Object.keys(options).join("\", \"")}"`, ErrorCode.INVALID_VALUE, originalMessage);
}
}
export class InvalidValueTypeError extends FormatError {
constructor(value, type, originalMessage) {
super(`Value for "${value}" must be of type ${type}`, ErrorCode.INVALID_VALUE, originalMessage);
}
}
export class MissingValueError extends FormatError {
constructor(variableId, originalMessage) {
super(`The intl string context variable "${variableId}" was not provided to the string "${originalMessage}"`, ErrorCode.MISSING_VALUE, originalMessage);
}
}

View File

@@ -0,0 +1,150 @@
import { inspect } from '../../jsutils/inspect.mjs';
import { invariant } from '../../jsutils/invariant.mjs';
import { GraphQLError } from '../../error/GraphQLError.mjs';
import { OperationTypeNode } from '../../language/ast.mjs';
import { DirectiveLocation } from '../../language/directiveLocation.mjs';
import { Kind } from '../../language/kinds.mjs';
import { specifiedDirectives } from '../../type/directives.mjs';
/**
* Known directives
*
* A GraphQL document is only valid if all `@directives` are known by the
* schema and legally positioned.
*
* See https://spec.graphql.org/draft/#sec-Directives-Are-Defined
*/
export function KnownDirectivesRule(context) {
const locationsMap = Object.create(null);
const schema = context.getSchema();
const definedDirectives = schema
? schema.getDirectives()
: specifiedDirectives;
for (const directive of definedDirectives) {
locationsMap[directive.name] = directive.locations;
}
const astDefinitions = context.getDocument().definitions;
for (const def of astDefinitions) {
if (def.kind === Kind.DIRECTIVE_DEFINITION) {
locationsMap[def.name.value] = def.locations.map((name) => name.value);
}
}
return {
Directive(node, _key, _parent, _path, ancestors) {
const name = node.name.value;
const locations = locationsMap[name];
if (!locations) {
context.reportError(
new GraphQLError(`Unknown directive "@${name}".`, {
nodes: node,
}),
);
return;
}
const candidateLocation = getDirectiveLocationForASTPath(ancestors);
if (candidateLocation && !locations.includes(candidateLocation)) {
context.reportError(
new GraphQLError(
`Directive "@${name}" may not be used on ${candidateLocation}.`,
{
nodes: node,
},
),
);
}
},
};
}
function getDirectiveLocationForASTPath(ancestors) {
const appliedTo = ancestors[ancestors.length - 1];
'kind' in appliedTo || invariant(false);
switch (appliedTo.kind) {
case Kind.OPERATION_DEFINITION:
return getDirectiveLocationForOperation(appliedTo.operation);
case Kind.FIELD:
return DirectiveLocation.FIELD;
case Kind.FRAGMENT_SPREAD:
return DirectiveLocation.FRAGMENT_SPREAD;
case Kind.INLINE_FRAGMENT:
return DirectiveLocation.INLINE_FRAGMENT;
case Kind.FRAGMENT_DEFINITION:
return DirectiveLocation.FRAGMENT_DEFINITION;
case Kind.VARIABLE_DEFINITION:
return DirectiveLocation.VARIABLE_DEFINITION;
case Kind.SCHEMA_DEFINITION:
case Kind.SCHEMA_EXTENSION:
return DirectiveLocation.SCHEMA;
case Kind.SCALAR_TYPE_DEFINITION:
case Kind.SCALAR_TYPE_EXTENSION:
return DirectiveLocation.SCALAR;
case Kind.OBJECT_TYPE_DEFINITION:
case Kind.OBJECT_TYPE_EXTENSION:
return DirectiveLocation.OBJECT;
case Kind.FIELD_DEFINITION:
return DirectiveLocation.FIELD_DEFINITION;
case Kind.INTERFACE_TYPE_DEFINITION:
case Kind.INTERFACE_TYPE_EXTENSION:
return DirectiveLocation.INTERFACE;
case Kind.UNION_TYPE_DEFINITION:
case Kind.UNION_TYPE_EXTENSION:
return DirectiveLocation.UNION;
case Kind.ENUM_TYPE_DEFINITION:
case Kind.ENUM_TYPE_EXTENSION:
return DirectiveLocation.ENUM;
case Kind.ENUM_VALUE_DEFINITION:
return DirectiveLocation.ENUM_VALUE;
case Kind.INPUT_OBJECT_TYPE_DEFINITION:
case Kind.INPUT_OBJECT_TYPE_EXTENSION:
return DirectiveLocation.INPUT_OBJECT;
case Kind.INPUT_VALUE_DEFINITION: {
const parentNode = ancestors[ancestors.length - 3];
'kind' in parentNode || invariant(false);
return parentNode.kind === Kind.INPUT_OBJECT_TYPE_DEFINITION
? DirectiveLocation.INPUT_FIELD_DEFINITION
: DirectiveLocation.ARGUMENT_DEFINITION;
}
// Not reachable, all possible types have been considered.
/* c8 ignore next */
default:
false || invariant(false, 'Unexpected kind: ' + inspect(appliedTo.kind));
}
}
function getDirectiveLocationForOperation(operation) {
switch (operation) {
case OperationTypeNode.QUERY:
return DirectiveLocation.QUERY;
case OperationTypeNode.MUTATION:
return DirectiveLocation.MUTATION;
case OperationTypeNode.SUBSCRIPTION:
return DirectiveLocation.SUBSCRIPTION;
}
}

View File

@@ -0,0 +1,268 @@
/*
Copyright (c) 2014, Yahoo! Inc. All rights reserved.
Copyrights licensed under the New BSD License.
See the accompanying LICENSE file for terms.
*/
'use strict';
var randomBytes = require('randombytes');
// Generate an internal UID to make the regexp pattern harder to guess.
var UID_LENGTH = 16;
var UID = generateUID();
var PLACE_HOLDER_REGEXP = new RegExp('(\\\\)?"@__(F|R|D|M|S|A|U|I|B|L)-' + UID + '-(\\d+)__@"', 'g');
var IS_NATIVE_CODE_REGEXP = /\{\s*\[native code\]\s*\}/g;
var IS_PURE_FUNCTION = /function.*?\(/;
var IS_ARROW_FUNCTION = /.*?=>.*?/;
var UNSAFE_CHARS_REGEXP = /[<>\/\u2028\u2029]/g;
var RESERVED_SYMBOLS = ['*', 'async'];
// Mapping of unsafe HTML and invalid JavaScript line terminator chars to their
// Unicode char counterparts which are safe to use in JavaScript strings.
var ESCAPED_CHARS = {
'<' : '\\u003C',
'>' : '\\u003E',
'/' : '\\u002F',
'\u2028': '\\u2028',
'\u2029': '\\u2029'
};
function escapeUnsafeChars(unsafeChar) {
return ESCAPED_CHARS[unsafeChar];
}
function generateUID() {
var bytes = randomBytes(UID_LENGTH);
var result = '';
for(var i=0; i<UID_LENGTH; ++i) {
result += bytes[i].toString(16);
}
return result;
}
function deleteFunctions(obj){
var functionKeys = [];
for (var key in obj) {
if (typeof obj[key] === "function") {
functionKeys.push(key);
}
}
for (var i = 0; i < functionKeys.length; i++) {
delete obj[functionKeys[i]];
}
}
module.exports = function serialize(obj, options) {
options || (options = {});
// Backwards-compatibility for `space` as the second argument.
if (typeof options === 'number' || typeof options === 'string') {
options = {space: options};
}
var functions = [];
var regexps = [];
var dates = [];
var maps = [];
var sets = [];
var arrays = [];
var undefs = [];
var infinities= [];
var bigInts = [];
var urls = [];
// Returns placeholders for functions and regexps (identified by index)
// which are later replaced by their string representation.
function replacer(key, value) {
// For nested function
if(options.ignoreFunction){
deleteFunctions(value);
}
if (!value && value !== undefined && value !== BigInt(0)) {
return value;
}
// If the value is an object w/ a toJSON method, toJSON is called before
// the replacer runs, so we use this[key] to get the non-toJSONed value.
var origValue = this[key];
var type = typeof origValue;
if (type === 'object') {
if(origValue instanceof RegExp) {
return '@__R-' + UID + '-' + (regexps.push(origValue) - 1) + '__@';
}
if(origValue instanceof Date) {
return '@__D-' + UID + '-' + (dates.push(origValue) - 1) + '__@';
}
if(origValue instanceof Map) {
return '@__M-' + UID + '-' + (maps.push(origValue) - 1) + '__@';
}
if(origValue instanceof Set) {
return '@__S-' + UID + '-' + (sets.push(origValue) - 1) + '__@';
}
if(origValue instanceof Array) {
var isSparse = origValue.filter(function(){return true}).length !== origValue.length;
if (isSparse) {
return '@__A-' + UID + '-' + (arrays.push(origValue) - 1) + '__@';
}
}
if(origValue instanceof URL) {
return '@__L-' + UID + '-' + (urls.push(origValue) - 1) + '__@';
}
}
if (type === 'function') {
return '@__F-' + UID + '-' + (functions.push(origValue) - 1) + '__@';
}
if (type === 'undefined') {
return '@__U-' + UID + '-' + (undefs.push(origValue) - 1) + '__@';
}
if (type === 'number' && !isNaN(origValue) && !isFinite(origValue)) {
return '@__I-' + UID + '-' + (infinities.push(origValue) - 1) + '__@';
}
if (type === 'bigint') {
return '@__B-' + UID + '-' + (bigInts.push(origValue) - 1) + '__@';
}
return value;
}
function serializeFunc(fn) {
var serializedFn = fn.toString();
if (IS_NATIVE_CODE_REGEXP.test(serializedFn)) {
throw new TypeError('Serializing native function: ' + fn.name);
}
// pure functions, example: {key: function() {}}
if(IS_PURE_FUNCTION.test(serializedFn)) {
return serializedFn;
}
// arrow functions, example: arg1 => arg1+5
if(IS_ARROW_FUNCTION.test(serializedFn)) {
return serializedFn;
}
var argsStartsAt = serializedFn.indexOf('(');
var def = serializedFn.substr(0, argsStartsAt)
.trim()
.split(' ')
.filter(function(val) { return val.length > 0 });
var nonReservedSymbols = def.filter(function(val) {
return RESERVED_SYMBOLS.indexOf(val) === -1
});
// enhanced literal objects, example: {key() {}}
if(nonReservedSymbols.length > 0) {
return (def.indexOf('async') > -1 ? 'async ' : '') + 'function'
+ (def.join('').indexOf('*') > -1 ? '*' : '')
+ serializedFn.substr(argsStartsAt);
}
// arrow functions
return serializedFn;
}
// Check if the parameter is function
if (options.ignoreFunction && typeof obj === "function") {
obj = undefined;
}
// Protects against `JSON.stringify()` returning `undefined`, by serializing
// to the literal string: "undefined".
if (obj === undefined) {
return String(obj);
}
var str;
// Creates a JSON string representation of the value.
// NOTE: Node 0.12 goes into slow mode with extra JSON.stringify() args.
if (options.isJSON && !options.space) {
str = JSON.stringify(obj);
} else {
str = JSON.stringify(obj, options.isJSON ? null : replacer, options.space);
}
// Protects against `JSON.stringify()` returning `undefined`, by serializing
// to the literal string: "undefined".
if (typeof str !== 'string') {
return String(str);
}
// Replace unsafe HTML and invalid JavaScript line terminator chars with
// their safe Unicode char counterpart. This _must_ happen before the
// regexps and functions are serialized and added back to the string.
if (options.unsafe !== true) {
str = str.replace(UNSAFE_CHARS_REGEXP, escapeUnsafeChars);
}
if (functions.length === 0 && regexps.length === 0 && dates.length === 0 && maps.length === 0 && sets.length === 0 && arrays.length === 0 && undefs.length === 0 && infinities.length === 0 && bigInts.length === 0 && urls.length === 0) {
return str;
}
// Replaces all occurrences of function, regexp, date, map and set placeholders in the
// JSON string with their string representations. If the original value can
// not be found, then `undefined` is used.
return str.replace(PLACE_HOLDER_REGEXP, function (match, backSlash, type, valueIndex) {
// The placeholder may not be preceded by a backslash. This is to prevent
// replacing things like `"a\"@__R-<UID>-0__@"` and thus outputting
// invalid JS.
if (backSlash) {
return match;
}
if (type === 'D') {
return "new Date(\"" + dates[valueIndex].toISOString() + "\")";
}
if (type === 'R') {
return "new RegExp(" + serialize(regexps[valueIndex].source) + ", \"" + regexps[valueIndex].flags + "\")";
}
if (type === 'M') {
return "new Map(" + serialize(Array.from(maps[valueIndex].entries()), options) + ")";
}
if (type === 'S') {
return "new Set(" + serialize(Array.from(sets[valueIndex].values()), options) + ")";
}
if (type === 'A') {
return "Array.prototype.slice.call(" + serialize(Object.assign({ length: arrays[valueIndex].length }, arrays[valueIndex]), options) + ")";
}
if (type === 'U') {
return 'undefined'
}
if (type === 'I') {
return infinities[valueIndex];
}
if (type === 'B') {
return "BigInt(\"" + bigInts[valueIndex] + "\")";
}
if (type === 'L') {
return "new URL(" + serialize(urls[valueIndex].toString(), options) + ")";
}
var fn = functions[valueIndex];
return serializeFunc(fn);
});
}

View File

@@ -0,0 +1 @@
{"version":3,"file":"getSupportedMonacoLocale.js","names":["getSupportedMonacoLocale","locale","supportedLocales","de","es","fr","it","ja","ko","ru","zh"],"sources":["../../src/utilities/getSupportedMonacoLocale.ts"],"sourcesContent":["export const getSupportedMonacoLocale = (locale: string): string => {\n const supportedLocales = {\n de: 'de',\n es: 'es',\n fr: 'fr',\n it: 'it',\n ja: 'ja',\n ko: 'ko',\n ru: 'ru',\n zh: 'zh-cn',\n 'zh-tw': 'zh-tw',\n }\n\n return supportedLocales[locale]\n}\n"],"mappings":"AAAA,OAAO,MAAMA,wBAAA,GAA4BC,MAAA;EACvC,MAAMC,gBAAA,GAAmB;IACvBC,EAAA,EAAI;IACJC,EAAA,EAAI;IACJC,EAAA,EAAI;IACJC,EAAA,EAAI;IACJC,EAAA,EAAI;IACJC,EAAA,EAAI;IACJC,EAAA,EAAI;IACJC,EAAA,EAAI;IACJ,SAAS;EACX;EAEA,OAAOR,gBAAgB,CAACD,MAAA,CAAO;AACjC","ignoreList":[]}

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