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

This commit is contained in:
2026-02-24 16:04:21 +01:00
parent 915eb61613
commit 5397309103
43805 changed files with 4324295 additions and 3 deletions
@@ -0,0 +1 @@
{"version":3,"file":"clipboardUtilities.d.ts","sourceRoot":"","sources":["../../../src/elements/ClipboardAction/clipboardUtilities.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,uBAAuB,EACvB,wBAAwB,EAGzB,MAAM,YAAY,CAAA;AAMnB;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,uBAAuB,GAAG,MAAM,GAAG,IAAI,CAc1E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,EAC7B,OAAO,EACP,IAAI,EAAE,SAAS,EACf,CAAC,EACD,GAAG,IAAI,EACR,EAAE,wBAAwB,GAAG,MAAM,GAAG,IAAI,CA4B1C"}
@@ -0,0 +1,114 @@
import { normalizeStackTracePath } from './stacktrace.js';
import { GLOBAL_OBJ } from './worldwide.js';
let parsedStackResults;
let lastSentryKeysCount;
let lastNativeKeysCount;
let cachedFilenameDebugIds;
/**
* Returns a map of filenames to debug identifiers.
* Supports both proprietary _sentryDebugIds and native _debugIds (e.g., from Vercel) formats.
*/
function getFilenameToDebugIdMap(stackParser) {
const sentryDebugIdMap = GLOBAL_OBJ._sentryDebugIds;
const nativeDebugIdMap = GLOBAL_OBJ._debugIds;
if (!sentryDebugIdMap && !nativeDebugIdMap) {
return {};
}
const sentryDebugIdKeys = sentryDebugIdMap ? Object.keys(sentryDebugIdMap) : [];
const nativeDebugIdKeys = nativeDebugIdMap ? Object.keys(nativeDebugIdMap) : [];
// If the count of registered globals hasn't changed since the last call, we
// can just return the cached result.
if (
cachedFilenameDebugIds &&
sentryDebugIdKeys.length === lastSentryKeysCount &&
nativeDebugIdKeys.length === lastNativeKeysCount
) {
return cachedFilenameDebugIds;
}
lastSentryKeysCount = sentryDebugIdKeys.length;
lastNativeKeysCount = nativeDebugIdKeys.length;
// Build a map of filename -> debug_id from both sources
cachedFilenameDebugIds = {};
if (!parsedStackResults) {
parsedStackResults = {};
}
const processDebugIds = (debugIdKeys, debugIdMap) => {
for (const key of debugIdKeys) {
const debugId = debugIdMap[key];
const result = parsedStackResults?.[key];
if (result && cachedFilenameDebugIds && debugId) {
// Use cached filename but update with current debug ID
cachedFilenameDebugIds[result[0]] = debugId;
// Update cached result with new debug ID
if (parsedStackResults) {
parsedStackResults[key] = [result[0], debugId];
}
} else if (debugId) {
const parsedStack = stackParser(key);
for (let i = parsedStack.length - 1; i >= 0; i--) {
const stackFrame = parsedStack[i];
const filename = stackFrame?.filename;
if (filename && cachedFilenameDebugIds && parsedStackResults) {
cachedFilenameDebugIds[filename] = debugId;
parsedStackResults[key] = [filename, debugId];
break;
}
}
}
}
};
if (sentryDebugIdMap) {
processDebugIds(sentryDebugIdKeys, sentryDebugIdMap);
}
// Native _debugIds will override _sentryDebugIds if same file
if (nativeDebugIdMap) {
processDebugIds(nativeDebugIdKeys, nativeDebugIdMap);
}
return cachedFilenameDebugIds;
}
/**
* Returns a list of debug images for the given resources.
*/
function getDebugImagesForResources(
stackParser,
resource_paths,
) {
const filenameDebugIdMap = getFilenameToDebugIdMap(stackParser);
if (!filenameDebugIdMap) {
return [];
}
const images = [];
for (const path of resource_paths) {
const normalizedPath = normalizeStackTracePath(path);
if (normalizedPath && filenameDebugIdMap[normalizedPath]) {
images.push({
type: 'sourcemap',
code_file: path,
debug_id: filenameDebugIdMap[normalizedPath],
});
}
}
return images;
}
export { getDebugImagesForResources, getFilenameToDebugIdMap };
//# sourceMappingURL=debug-ids.js.map
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/templates/Default/index.tsx"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,eAAe,EACf,oBAAoB,EACpB,cAAc,EACd,WAAW,EACX,SAAS,EACT,eAAe,EAChB,MAAM,SAAS,CAAA;AAWhB,OAAO,cAAc,CAAA;AAErB,OAAO,KAAK,MAAM,OAAO,CAAA;AAQzB,MAAM,MAAM,oBAAoB,GAAG;IACjC,QAAQ,CAAC,EAAE,KAAK,CAAC,SAAS,CAAA;IAC1B,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,cAAc,CAAC,EAAE,MAAM,CAAA;IACvB,KAAK,CAAC,EAAE,MAAM,GAAG,MAAM,CAAA;IACvB,mBAAmB,CAAC,EAAE,oBAAoB,CAAA;IAC1C,UAAU,CAAC,EAAE,MAAM,CAAA;IACnB,GAAG,CAAC,EAAE,cAAc,CAAA;IACpB,WAAW,CAAC,EAAE,eAAe,EAAE,CAAA;IAC/B,QAAQ,CAAC,EAAE,SAAS,CAAA;IACpB,eAAe,EAAE,eAAe,CAAA;CACjC,GAAG,WAAW,CAAA;AAEf,eAAO,MAAM,eAAe,EAAE,KAAK,CAAC,EAAE,CAAC,oBAAoB,CA8H1D,CAAA"}
@@ -0,0 +1 @@
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../src/resolvers/globals/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,OAAO,EAAE,MAAM,cAAc,CAAA;AACtC,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAA;AACtD,OAAO,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAA;AAChD,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAA;AACpD,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAA;AAEpC,OAAO,EAAE,OAAO,EAAE,eAAe,EAAE,YAAY,EAAE,cAAc,EAAE,MAAM,EAAE,CAAA"}
@@ -0,0 +1 @@
{"version":3,"file":"stacktrace.d.ts","sourceRoot":"","sources":["../../../src/utils/stacktrace.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,sBAAsB,CAAC;AAClD,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,2BAA2B,CAAC;AAC5D,OAAO,KAAK,EAAE,eAAe,EAAE,WAAW,EAAE,MAAM,2BAA2B,CAAC;AAC9E,OAAO,KAAK,EAAE,KAAK,EAAE,YAAY,EAAE,MAAM,oBAAoB,CAAC;AAG9D,eAAO,MAAM,gBAAgB,MAAM,CAAC;AAKpC;;;;;;GAMG;AACH,wBAAgB,iBAAiB,CAAC,GAAG,OAAO,EAAE,eAAe,EAAE,GAAG,WAAW,CA2C5E;AAED;;;;;GAKG;AACH,wBAAgB,iCAAiC,CAAC,WAAW,EAAE,WAAW,GAAG,eAAe,EAAE,GAAG,WAAW,CAK3G;AAED;;;;;GAKG;AACH,wBAAgB,2BAA2B,CAAC,KAAK,EAAE,aAAa,CAAC,UAAU,CAAC,GAAG,UAAU,EAAE,CAqC1F;AAQD;;GAEG;AACH,wBAAgB,eAAe,CAAC,EAAE,EAAE,OAAO,GAAG,MAAM,CAWnD;AAED;;GAEG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,KAAK,GAAG,UAAU,EAAE,GAAG,SAAS,CAoBzE;AAED;;;;GAIG;AACH,wBAAgB,kBAAkB,CAAC,KAAK,EAAE,YAAY,GAAG,KAAK,GAAG,MAAM,CAKtE;AAED;;GAEG;AACH,wBAAgB,uBAAuB,CAAC,IAAI,EAAE,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAOpF"}
@@ -0,0 +1 @@
{"version":3,"file":"chart-no-axes-column-increasing.js","sources":["../../../src/icons/chart-no-axes-column-increasing.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ChartNoAxesColumnIncreasing\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8bGluZSB4MT0iMTIiIHgyPSIxMiIgeTE9IjIwIiB5Mj0iMTAiIC8+CiAgPGxpbmUgeDE9IjE4IiB4Mj0iMTgiIHkxPSIyMCIgeTI9IjQiIC8+CiAgPGxpbmUgeDE9IjYiIHgyPSI2IiB5MT0iMjAiIHkyPSIxNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/chart-no-axes-column-increasing\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 ChartNoAxesColumnIncreasing = createLucideIcon('ChartNoAxesColumnIncreasing', [\n ['line', { x1: '12', x2: '12', y1: '20', y2: '10', key: '1vz5eb' }],\n ['line', { x1: '18', x2: '18', y1: '20', y2: '4', key: 'cun8e5' }],\n ['line', { x1: '6', x2: '6', y1: '20', y2: '16', key: 'hq0ia6' }],\n]);\n\nexport default ChartNoAxesColumnIncreasing;\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,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAA8B,iBAAiB,6BAA+B,CAAA,CAAA,CAAA;AAAA,CAClF,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAClE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAM,CAAA,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CACjE,CAAA,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAE,CAAA,CAAA,CAAA,EAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,EAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAClE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
{"version":3,"file":"table-properties.js","sources":["../../../src/icons/table-properties.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name TableProperties\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTUgM3YxOCIgLz4KICA8cmVjdCB3aWR0aD0iMTgiIGhlaWdodD0iMTgiIHg9IjMiIHk9IjMiIHJ4PSIyIiAvPgogIDxwYXRoIGQ9Ik0yMSA5SDMiIC8+CiAgPHBhdGggZD0iTTIxIDE1SDMiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/table-properties\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 TableProperties = createLucideIcon('TableProperties', [\n ['path', { d: 'M15 3v18', key: '14nvp0' }],\n ['rect', { width: '18', height: '18', x: '3', y: '3', rx: '2', key: 'afitv7' }],\n ['path', { d: 'M21 9H3', key: '1338ky' }],\n ['path', { d: 'M21 15H3', key: '9uk58r' }],\n]);\n\nexport default TableProperties;\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,CAAkB,iBAAiB,iBAAmB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC1D,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,CAAA,CAAQ,CAAA,CAAA,CAAE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAO,MAAM,CAAQ,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAM,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAG,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAI,CAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAY,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC3C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,3 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiaW5kZXguanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9saWIvb3B0aW9uYWwta2V5cy9pbmRleC50cyJdLCJuYW1lcyI6W10sIm1hcHBpbmdzIjoiIiwic291cmNlc0NvbnRlbnQiOlsiZXhwb3J0IHR5cGUgT3B0aW9uYWxLZXlzPFR5cGU+ID0gVHlwZSBleHRlbmRzIG9iamVjdFxuICA/IGtleW9mIHtcbiAgICAgIFtLZXkgaW4ga2V5b2YgVHlwZSBhcyBUeXBlIGV4dGVuZHMgUmVxdWlyZWQ8UGljazxUeXBlLCBLZXk+PiA/IG5ldmVyIDogS2V5XTogbmV2ZXI7XG4gICAgfVxuICA6IG5ldmVyO1xuIl19
@@ -0,0 +1,55 @@
import { LogSeverityLevel } from '@sentry/core';
/**
* Options for the Sentry Winston transport.
*/
interface WinstonTransportOptions {
/**
* Use this option to filter which levels should be captured. By default, all levels are captured.
*
* @example
* ```ts
* const SentryWinstonTransport = Sentry.createSentryWinstonTransport(Transport, {
* // Only capture error and warn logs
* levels: ['error', 'warn'],
* });
* ```
*/
levels?: Array<LogSeverityLevel>;
/**
* Use this option to map custom levels to Sentry log severity levels.
*
* @example
* ```ts
* const SentryWinstonTransport = Sentry.createSentryWinstonTransport(Transport, {
* customLevelMap: {
* myCustomLevel: 'info',
* customError: 'error',
* },
* });
* ```
*/
customLevelMap?: Record<string, LogSeverityLevel>;
}
/**
* Creates a new Sentry Winston transport that fowards logs to Sentry. Requires the `enableLogs` option to be enabled.
*
* Supports Winston 3.x.x.
*
* @param TransportClass - The Winston transport class to extend.
* @returns The extended transport class.
*
* @example
* ```ts
* const winston = require('winston');
* const Transport = require('winston-transport');
*
* const SentryWinstonTransport = Sentry.createSentryWinstonTransport(Transport);
*
* const logger = winston.createLogger({
* transports: [new SentryWinstonTransport()],
* });
* ```
*/
export declare function createSentryWinstonTransport<TransportStreamInstance extends object>(TransportClass: new (options?: any) => TransportStreamInstance, sentryWinstonOptions?: WinstonTransportOptions): typeof TransportClass;
export {};
//# sourceMappingURL=winston.d.ts.map
@@ -0,0 +1,23 @@
"use strict";
exports.__esModule = true;
exports.default = clear;
/**
* Removes all child nodes from a given node.
*
* @param node the node to clear
*/
function clear(node) {
if (node) {
while (node.firstChild) {
node.removeChild(node.firstChild);
}
return node;
}
return null;
}
module.exports = exports["default"];
@@ -0,0 +1,21 @@
The MIT License (MIT)
Copyright (c) 2012-2019 Paul Miller (https://paulmillr.com), Elan Shanker
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the “Software”), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.
@@ -0,0 +1,29 @@
import type { SanitizedCollectionConfig } from '../../collections/config/types.js';
import type { FlattenedField } from '../../fields/config/types.js';
import type { SanitizedGlobalConfig } from '../../globals/config/types.js';
import type { PayloadRequest, WhereField } from '../../types/index.js';
import type { EntityPolicies } from './types.js';
type Args = {
collectionConfig?: SanitizedCollectionConfig;
constraint: WhereField;
errors: {
path: string;
}[];
fields: FlattenedField[];
globalConfig?: SanitizedGlobalConfig;
operator: string;
overrideAccess: boolean;
parentIsLocalized?: boolean;
path: string;
policies: EntityPolicies;
polymorphicJoin?: boolean;
req: PayloadRequest;
val: unknown;
versionFields?: FlattenedField[];
};
/**
* Validate the Payload key / value / operator
*/
export declare function validateSearchParam({ collectionConfig, constraint, errors, fields, globalConfig, operator, overrideAccess, parentIsLocalized, path: incomingPath, policies, polymorphicJoin, req, val, versionFields, }: Args): Promise<void>;
export {};
//# sourceMappingURL=validateSearchParams.d.ts.map
@@ -0,0 +1,57 @@
{
"name": "@react-email/container",
"version": "0.0.15",
"description": "A layout component that centers all the email content",
"sideEffects": false,
"main": "./dist/index.js",
"module": "./dist/index.mjs",
"types": "./dist/index.d.ts",
"files": [
"dist/**"
],
"exports": {
".": {
"import": {
"types": "./dist/index.d.mts",
"default": "./dist/index.mjs"
},
"require": {
"types": "./dist/index.d.ts",
"default": "./dist/index.js"
}
}
},
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/resend/react-email.git",
"directory": "packages/container"
},
"keywords": [
"react",
"email"
],
"engines": {
"node": ">=18.0.0"
},
"peerDependencies": {
"react": "^18.0 || ^19.0 || ^19.0.0-rc"
},
"devDependencies": {
"typescript": "5.1.6",
"@react-email/render": "1.0.3",
"tsconfig": "0.0.0",
"eslint-config-custom": "0.0.0"
},
"publishConfig": {
"access": "public"
},
"scripts": {
"build": "tsup src/index.ts --format esm,cjs --dts --external react",
"clean": "rm -rf dist",
"dev": "tsup src/index.ts --format esm,cjs --dts --external react --watch",
"lint": "eslint .",
"test:watch": "vitest",
"test": "vitest run"
}
}
@@ -0,0 +1,10 @@
"use strict";
exports.getWeekYear = void 0;
var _index = require("../getWeekYear.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const getWeekYear = (exports.getWeekYear = (0, _index2.convertToFP)(
_index.getWeekYear,
1,
));
@@ -0,0 +1,29 @@
import { CanonicalizeUnicodeLocaleId } from "./CanonicalizeUnicodeLocaleId.js";
import { invariant } from "./utils.js";
export function InsertUnicodeExtensionAndCanonicalize(locale, attributes, keywords) {
invariant(locale.indexOf("-u-") === -1, "Expected locale to not have a Unicode locale extension");
let extension = "-u";
for (const attr of attributes) {
extension += `-${attr}`;
}
for (const kw of keywords) {
const { key, value } = kw;
extension += `-${key}`;
if (value !== "") {
extension += `-${value}`;
}
}
if (extension === "-u") {
return CanonicalizeUnicodeLocaleId(locale);
}
let privateIndex = locale.indexOf("-x-");
let newLocale;
if (privateIndex === -1) {
newLocale = locale + extension;
} else {
let preExtension = locale.slice(0, privateIndex);
let postExtension = locale.slice(privateIndex);
newLocale = preExtension + extension + postExtension;
}
return CanonicalizeUnicodeLocaleId(newLocale);
}
@@ -0,0 +1 @@
{"version":3,"file":"index.js","names":["React","baseClass","NoListResults","Actions","Message","_jsxs","className","length","_jsx","map","action","index","Fragment"],"sources":["../../../src/elements/NoListResults/index.tsx"],"sourcesContent":["import React from 'react'\n\nimport './index.scss'\n\nconst baseClass = 'no-results'\n\ntype NoResultsProps = {\n Actions?: React.ReactNode[]\n Message: React.ReactNode\n}\nexport function NoListResults({ Actions, Message }: NoResultsProps) {\n return (\n <div className={baseClass}>\n {Message}\n {Actions && Actions.length > 0 && (\n <div className={`${baseClass}__actions`}>\n {Actions.map((action, index) => (\n <React.Fragment key={index}>{action}</React.Fragment>\n ))}\n </div>\n )}\n </div>\n )\n}\n"],"mappings":";AAAA,OAAOA,KAAA,MAAW;AAElB,OAAO;AAEP,MAAMC,SAAA,GAAY;AAMlB,OAAO,SAASC,cAAc;EAAEC,OAAO;EAAEC;AAAO,CAAkB;EAChE,oBACEC,KAAA,CAAC;IAAIC,SAAA,EAAWL,SAAA;eACbG,OAAA,EACAD,OAAA,IAAWA,OAAA,CAAQI,MAAM,GAAG,kBAC3BC,IAAA,CAAC;MAAIF,SAAA,EAAW,GAAGL,SAAA,WAAoB;gBACpCE,OAAA,CAAQM,GAAG,CAAC,CAACC,MAAA,EAAQC,KAAA,kBACpBH,IAAA,CAACR,KAAA,CAAMY,QAAQ;kBAAcF;SAARC,KAAA;;;AAMjC","ignoreList":[]}
@@ -0,0 +1,43 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.mjs";
// Ref: https://www.unicode.org/cldr/charts/32/summary/ta.html
// CLDR #1846 - #1849
const dateFormats = {
full: "EEEE, d MMMM, y",
long: "d MMMM, y",
medium: "d MMM, y",
short: "d/M/yy",
};
// CLDR #1850 - #1853
const timeFormats = {
full: "a h:mm:ss zzzz",
long: "a h:mm:ss z",
medium: "a h:mm:ss",
short: "a h:mm",
};
const dateTimeFormats = {
full: "{{date}} {{time}}",
long: "{{date}} {{time}}",
medium: "{{date}}, {{time}}",
short: "{{date}}, {{time}}",
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};
@@ -0,0 +1,219 @@
import { getRootSpan, getCurrentScope, SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE, spanToJSON, debug, SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE, SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE } from '@sentry/core';
import { DEBUG_BUILD } from '../debug-build.js';
import { WINDOW } from '../helpers.js';
import '@sentry-internal/browser-utils';
import '../stack-parsers.js';
import '../integrations/breadcrumbs.js';
import '../integrations/browserapierrors.js';
import '../integrations/browsersession.js';
import '../integrations/culturecontext.js';
import '../integrations/globalhandlers.js';
import '../integrations/httpcontext.js';
import '../integrations/linkederrors.js';
import '../integrations/spotlight.js';
// 1h in seconds
const PREVIOUS_TRACE_MAX_DURATION = 3600;
// session storage key
const PREVIOUS_TRACE_KEY = 'sentry_previous_trace';
const PREVIOUS_TRACE_TMP_SPAN_ATTRIBUTE = 'sentry.previous_trace';
/**
* Takes care of linking traces and applying the (consistent) sampling behavoiour based on the passed options
* @param options - options for linking traces and consistent trace sampling (@see BrowserTracingOptions)
* @param client - Sentry client
*/
function linkTraces(
client,
{
linkPreviousTrace,
consistentTraceSampling,
}
,
) {
const useSessionStorage = linkPreviousTrace === 'session-storage';
let inMemoryPreviousTraceInfo = useSessionStorage ? getPreviousTraceFromSessionStorage() : undefined;
client.on('spanStart', span => {
if (getRootSpan(span) !== span) {
return;
}
const oldPropagationContext = getCurrentScope().getPropagationContext();
inMemoryPreviousTraceInfo = addPreviousTraceSpanLink(inMemoryPreviousTraceInfo, span, oldPropagationContext);
if (useSessionStorage) {
storePreviousTraceInSessionStorage(inMemoryPreviousTraceInfo);
}
});
let isFirstTraceOnPageload = true;
if (consistentTraceSampling) {
/*
When users opt into `consistentTraceSampling`, we need to ensure that we propagate
the previous trace's sample rate and rand to the current trace. This is necessary because otherwise, span
metric extrapolation is inaccurate, as we'd propagate too high of a sample rate for the subsequent traces.
So therefore, we pretend that the previous trace was the parent trace of the newly started trace. To do that,
we mutate the propagation context of the current trace and set the sample rate and sample rand of the previous trace.
Timing-wise, it is fine because it happens before we even sample the root span.
@see https://github.com/getsentry/sentry-javascript/issues/15754
*/
client.on('beforeSampling', mutableSamplingContextData => {
if (!inMemoryPreviousTraceInfo) {
return;
}
const scope = getCurrentScope();
const currentPropagationContext = scope.getPropagationContext();
// We do not want to force-continue the sampling decision if we continue a trace
// that was started on the backend. Most prominently, this will happen in MPAs where
// users hard-navigate between pages. In this case, the sampling decision of a potentially
// started trace on the server takes precedence.
// Why? We want to prioritize inter-trace consistency over intra-trace consistency.
if (isFirstTraceOnPageload && currentPropagationContext.parentSpanId) {
isFirstTraceOnPageload = false;
return;
}
scope.setPropagationContext({
...currentPropagationContext,
dsc: {
...currentPropagationContext.dsc,
sample_rate: String(inMemoryPreviousTraceInfo.sampleRate),
sampled: String(spanContextSampled(inMemoryPreviousTraceInfo.spanContext)),
},
sampleRand: inMemoryPreviousTraceInfo.sampleRand,
});
mutableSamplingContextData.parentSampled = spanContextSampled(inMemoryPreviousTraceInfo.spanContext);
mutableSamplingContextData.parentSampleRate = inMemoryPreviousTraceInfo.sampleRate;
mutableSamplingContextData.spanAttributes = {
...mutableSamplingContextData.spanAttributes,
[SEMANTIC_ATTRIBUTE_SENTRY_PREVIOUS_TRACE_SAMPLE_RATE]: inMemoryPreviousTraceInfo.sampleRate,
};
});
}
}
/**
* Adds a previous_trace span link to the passed span if the passed
* previousTraceInfo is still valid.
*
* @returns the updated previous trace info (based on the current span/trace) to
* be used on the next call
*/
function addPreviousTraceSpanLink(
previousTraceInfo,
span,
oldPropagationContext,
) {
const spanJson = spanToJSON(span);
function getSampleRate() {
try {
return (
Number(oldPropagationContext.dsc?.sample_rate) ?? Number(spanJson.data?.[SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE])
);
} catch {
return 0;
}
}
const updatedPreviousTraceInfo = {
spanContext: span.spanContext(),
startTimestamp: spanJson.start_timestamp,
sampleRate: getSampleRate(),
sampleRand: oldPropagationContext.sampleRand,
};
if (!previousTraceInfo) {
return updatedPreviousTraceInfo;
}
const previousTraceSpanCtx = previousTraceInfo.spanContext;
if (previousTraceSpanCtx.traceId === spanJson.trace_id) {
// This means, we're still in the same trace so let's not update the previous trace info
// or add a link to the current span.
// Once we move away from the long-lived, route-based trace model, we can remove this cases
return previousTraceInfo;
}
// Only add the link if the startTimeStamp of the previous trace's root span is within
// PREVIOUS_TRACE_MAX_DURATION (1h) of the current root span's startTimestamp
// This is done to
// - avoid adding links to "stale" traces
// - enable more efficient querying for previous/next traces in Sentry
if (Date.now() / 1000 - previousTraceInfo.startTimestamp <= PREVIOUS_TRACE_MAX_DURATION) {
if (DEBUG_BUILD) {
debug.log(
`Adding previous_trace \`${JSON.stringify(previousTraceSpanCtx)}\` link to span \`${JSON.stringify({
op: spanJson.op,
...span.spanContext(),
})}\``,
);
}
span.addLink({
context: previousTraceSpanCtx,
attributes: {
[SEMANTIC_LINK_ATTRIBUTE_LINK_TYPE]: 'previous_trace',
},
});
// TODO: Remove this once EAP can store span links. We currently only set this attribute so that we
// can obtain the previous trace information from the EAP store. Long-term, EAP will handle
// span links and then we should remove this again. Also throwing in a TODO(v11), to remind us
// to check this at v11 time :)
span.setAttribute(
PREVIOUS_TRACE_TMP_SPAN_ATTRIBUTE,
`${previousTraceSpanCtx.traceId}-${previousTraceSpanCtx.spanId}-${
spanContextSampled(previousTraceSpanCtx) ? 1 : 0
}`,
);
}
return updatedPreviousTraceInfo;
}
/**
* Stores @param previousTraceInfo in sessionStorage.
*/
function storePreviousTraceInSessionStorage(previousTraceInfo) {
try {
WINDOW.sessionStorage.setItem(PREVIOUS_TRACE_KEY, JSON.stringify(previousTraceInfo));
} catch (e) {
// Ignore potential errors (e.g. if sessionStorage is not available)
DEBUG_BUILD && debug.warn('Could not store previous trace in sessionStorage', e);
}
}
/**
* Retrieves the previous trace from sessionStorage if available.
*/
function getPreviousTraceFromSessionStorage() {
try {
const previousTraceInfo = WINDOW.sessionStorage?.getItem(PREVIOUS_TRACE_KEY);
// @ts-expect-error - intentionally risking JSON.parse throwing when previousTraceInfo is null to save bundle size
return JSON.parse(previousTraceInfo);
} catch {
return undefined;
}
}
/**
* see {@link import('@sentry/core').spanIsSampled}
*/
function spanContextSampled(ctx) {
return ctx.traceFlags === 0x1;
}
export { PREVIOUS_TRACE_KEY, PREVIOUS_TRACE_MAX_DURATION, PREVIOUS_TRACE_TMP_SPAN_ATTRIBUTE, addPreviousTraceSpanLink, getPreviousTraceFromSessionStorage, linkTraces, spanContextSampled, storePreviousTraceInSessionStorage };
//# sourceMappingURL=linkedTraces.js.map
@@ -0,0 +1,3 @@
import type { DefaultCellComponentProps } from 'payload';
export declare const hasOptionLabelJSXElement: (cellClientProps: DefaultCellComponentProps) => boolean;
//# sourceMappingURL=hasOptionLabelJSXElement.d.ts.map
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/supabase/rls.ts"],"sourcesContent":["import { bigserial, pgSchema, text, timestamp, uuid, varchar } from '~/pg-core/index.ts';\nimport { pgRole } from '~/pg-core/roles.ts';\nimport { sql } from '~/sql/sql.ts';\n\nexport const anonRole = pgRole('anon').existing();\nexport const authenticatedRole = pgRole('authenticated').existing();\nexport const serviceRole = pgRole('service_role').existing();\nexport const postgresRole = pgRole('postgres_role').existing();\nexport const supabaseAuthAdminRole = pgRole('supabase_auth_admin').existing();\n\n/* ------------------------------ auth schema; ------------------------------ */\nconst auth = pgSchema('auth');\n\nexport const authUsers = auth.table('users', {\n\tid: uuid().primaryKey().notNull(),\n\temail: varchar({ length: 255 }),\n\tphone: text().unique(),\n\temailConfirmedAt: timestamp('email_confirmed_at', { withTimezone: true }),\n\tphoneConfirmedAt: timestamp('phone_confirmed_at', { withTimezone: true }),\n\tlastSignInAt: timestamp('last_sign_in_at', { withTimezone: true }),\n\tcreatedAt: timestamp('created_at', { withTimezone: true }),\n\tupdatedAt: timestamp('updated_at', { withTimezone: true }),\n});\n\n/* ------------------------------ realtime schema; ------------------------------- */\nconst realtime = pgSchema('realtime');\n\nexport const realtimeMessages = realtime.table(\n\t'messages',\n\t{\n\t\tid: bigserial({ mode: 'bigint' }).primaryKey(),\n\t\ttopic: text().notNull(),\n\t\textension: text({\n\t\t\tenum: ['presence', 'broadcast', 'postgres_changes'],\n\t\t}).notNull(),\n\t},\n);\n\nexport const authUid = sql`(select auth.uid())`;\nexport const realtimeTopic = sql`realtime.topic()`;\n"],"mappings":"AAAA,SAAS,WAAW,UAAU,MAAM,WAAW,MAAM,eAAe;AACpE,SAAS,cAAc;AACvB,SAAS,WAAW;AAEb,MAAM,WAAW,OAAO,MAAM,EAAE,SAAS;AACzC,MAAM,oBAAoB,OAAO,eAAe,EAAE,SAAS;AAC3D,MAAM,cAAc,OAAO,cAAc,EAAE,SAAS;AACpD,MAAM,eAAe,OAAO,eAAe,EAAE,SAAS;AACtD,MAAM,wBAAwB,OAAO,qBAAqB,EAAE,SAAS;AAG5E,MAAM,OAAO,SAAS,MAAM;AAErB,MAAM,YAAY,KAAK,MAAM,SAAS;AAAA,EAC5C,IAAI,KAAK,EAAE,WAAW,EAAE,QAAQ;AAAA,EAChC,OAAO,QAAQ,EAAE,QAAQ,IAAI,CAAC;AAAA,EAC9B,OAAO,KAAK,EAAE,OAAO;AAAA,EACrB,kBAAkB,UAAU,sBAAsB,EAAE,cAAc,KAAK,CAAC;AAAA,EACxE,kBAAkB,UAAU,sBAAsB,EAAE,cAAc,KAAK,CAAC;AAAA,EACxE,cAAc,UAAU,mBAAmB,EAAE,cAAc,KAAK,CAAC;AAAA,EACjE,WAAW,UAAU,cAAc,EAAE,cAAc,KAAK,CAAC;AAAA,EACzD,WAAW,UAAU,cAAc,EAAE,cAAc,KAAK,CAAC;AAC1D,CAAC;AAGD,MAAM,WAAW,SAAS,UAAU;AAE7B,MAAM,mBAAmB,SAAS;AAAA,EACxC;AAAA,EACA;AAAA,IACC,IAAI,UAAU,EAAE,MAAM,SAAS,CAAC,EAAE,WAAW;AAAA,IAC7C,OAAO,KAAK,EAAE,QAAQ;AAAA,IACtB,WAAW,KAAK;AAAA,MACf,MAAM,CAAC,YAAY,aAAa,kBAAkB;AAAA,IACnD,CAAC,EAAE,QAAQ;AAAA,EACZ;AACD;AAEO,MAAM,UAAU;AAChB,MAAM,gBAAgB;","names":[]}
@@ -0,0 +1,174 @@
/// <reference types="react" />
import { Dimensions } from '@floating-ui/react-dom';
import { FocusableElement } from 'tabbable';
import * as React from 'react';
import type { UseFloatingReturn } from '@floating-ui/react-dom';
import useModernLayoutEffect from 'use-isomorphic-layout-effect';
import type { VirtualElement } from '@floating-ui/react-dom';
export declare function activeElement(doc: Document): Element | null;
declare type AnyFunction = (...args: any[]) => any;
export declare function contains(parent?: Element | null, child?: Element | null): boolean;
declare interface ContextData {
openEvent?: Event;
floatingContext?: FloatingContext;
/** @deprecated use `onTypingChange` prop in `useTypeahead` */
typing?: boolean;
[key: string]: any;
}
/** For each cell index, gets the item index that occupies that cell */
export declare function createGridCellMap(sizes: Dimensions[], cols: number, dense: boolean): (number | undefined)[];
declare type DisabledIndices = Array<number> | ((index: number) => boolean);
export declare function disableFocusInside(container: HTMLElement): void;
export declare function enableFocusInside(container: HTMLElement): void;
declare interface ExtendedElements<RT> {
reference: ReferenceType | null;
floating: HTMLElement | null;
domReference: NarrowedElement<RT> | null;
}
declare interface ExtendedRefs<RT> {
reference: React.MutableRefObject<ReferenceType | null>;
floating: React.MutableRefObject<HTMLElement | null>;
domReference: React.MutableRefObject<NarrowedElement<RT> | null>;
setReference(node: RT | null): void;
setFloating(node: HTMLElement | null): void;
setPositionReference(node: ReferenceType | null): void;
}
export declare function findNonDisabledListIndex(listRef: React.MutableRefObject<Array<HTMLElement | null>>, { startingIndex, decrement, disabledIndices, amount, }?: {
startingIndex?: number;
decrement?: boolean;
disabledIndices?: DisabledIndices;
amount?: number;
}): number;
declare type FloatingContext<RT extends ReferenceType = ReferenceType> = Omit<UseFloatingReturn<RT>, 'refs' | 'elements'> & {
open: boolean;
onOpenChange(open: boolean, event?: Event, reason?: OpenChangeReason): void;
events: FloatingEvents;
dataRef: React.MutableRefObject<ContextData>;
nodeId: string | undefined;
floatingId: string | undefined;
refs: ExtendedRefs<RT>;
elements: ExtendedElements<RT>;
};
declare interface FloatingEvents {
emit<T extends string>(event: T, data?: any): void;
on(event: string, handler: (data: any) => void): void;
off(event: string, handler: (data: any) => void): void;
}
declare interface FloatingNodeType<RT extends ReferenceType = ReferenceType> {
id: string | undefined;
parentId: string | null;
context?: FloatingContext<RT>;
}
export declare function getDeepestNode<RT extends ReferenceType = ReferenceType>(nodes: Array<FloatingNodeType<RT>>, id: string | undefined): FloatingNodeType<RT> | undefined;
export declare function getDocument(node: Element | null): Document;
export declare function getFloatingFocusElement(floatingElement: HTMLElement | null | undefined): HTMLElement | null;
/** Gets cell index of an item's corner or -1 when index is -1. */
export declare function getGridCellIndexOfCorner(index: number, sizes: Dimensions[], cellMap: (number | undefined)[], cols: number, corner: 'tl' | 'tr' | 'bl' | 'br'): number;
/** Gets all cell indices that correspond to the specified indices */
export declare function getGridCellIndices(indices: (number | undefined)[], cellMap: (number | undefined)[]): number[];
export declare function getGridNavigatedIndex(listRef: React.MutableRefObject<Array<HTMLElement | null>>, { event, orientation, loop, rtl, cols, disabledIndices, minIndex, maxIndex, prevIndex, stopEvent: stop, }: {
event: React.KeyboardEvent;
orientation: 'horizontal' | 'vertical' | 'both';
loop: boolean;
rtl: boolean;
cols: number;
disabledIndices: DisabledIndices | undefined;
minIndex: number;
maxIndex: number;
prevIndex: number;
stopEvent?: boolean;
}): number;
export declare function getMaxListIndex(listRef: React.MutableRefObject<Array<HTMLElement | null>>, disabledIndices: DisabledIndices | undefined): number;
export declare function getMinListIndex(listRef: React.MutableRefObject<Array<HTMLElement | null>>, disabledIndices: DisabledIndices | undefined): number;
export declare function getNextTabbable(referenceElement: Element | null): FocusableElement | null;
export declare function getNodeAncestors<RT extends ReferenceType = ReferenceType>(nodes: Array<FloatingNodeType<RT>>, id: string | undefined): FloatingNodeType<RT>[];
export declare function getNodeChildren<RT extends ReferenceType = ReferenceType>(nodes: Array<FloatingNodeType<RT>>, id: string | undefined, onlyOpenChildren?: boolean): Array<FloatingNodeType<RT>>;
export declare function getPlatform(): string;
export declare function getPreviousTabbable(referenceElement: Element | null): FocusableElement | null;
export declare const getTabbableOptions: () => {
readonly getShadowRoot: true;
readonly displayCheck: "none" | "full";
};
export declare function getTarget(event: Event): EventTarget | null;
export declare function getUserAgent(): string;
export declare function isAndroid(): boolean;
export declare function isDifferentGridRow(index: number, cols: number, prevRow: number): boolean;
export declare function isEventTargetWithin(event: Event, node: Node | null | undefined): boolean;
export declare function isIndexOutOfListBounds(listRef: React.MutableRefObject<Array<HTMLElement | null>>, index: number): boolean;
export declare function isJSDOM(): boolean;
export declare function isListIndexDisabled(listRef: React.MutableRefObject<Array<HTMLElement | null>>, index: number, disabledIndices?: DisabledIndices): boolean;
export declare function isMac(): boolean;
export declare function isMouseLikePointerType(pointerType: string | undefined, strict?: boolean): boolean;
export declare function isOutsideEvent(event: FocusEvent | React.FocusEvent, container?: Element): boolean;
export declare function isReactEvent(event: any): event is React.SyntheticEvent;
export declare function isRootElement(element: Element): boolean;
export declare function isSafari(): boolean;
export declare function isTypeableCombobox(element: Element | null): boolean;
export declare function isTypeableElement(element: unknown): boolean;
export declare function isVirtualClick(event: MouseEvent | PointerEvent): boolean;
export declare function isVirtualPointerEvent(event: PointerEvent): boolean;
export declare function matchesFocusVisible(element: Element | null): boolean;
declare type NarrowedElement<T> = T extends Element ? T : Element;
declare type OpenChangeReason = 'outside-press' | 'escape-key' | 'ancestor-scroll' | 'reference-press' | 'click' | 'hover' | 'focus' | 'focus-out' | 'list-navigation' | 'safe-polygon';
declare type ReferenceType = Element | VirtualElement;
export declare function stopEvent(event: Event | React.SyntheticEvent): void;
export declare function useEffectEvent<T extends AnyFunction>(callback?: T): T;
export declare function useLatestRef<T>(value: T): React.MutableRefObject<T>;
export { useModernLayoutEffect }
export { }
@@ -0,0 +1,29 @@
var eq = require('./eq');
/** Used for built-in method references. */
var objectProto = Object.prototype;
/** Used to check objects for own properties. */
var hasOwnProperty = objectProto.hasOwnProperty;
/**
* Used by `_.defaults` to customize its `_.assignIn` use to assign properties
* of source objects to the destination object for all destination properties
* that resolve to `undefined`.
*
* @private
* @param {*} objValue The destination value.
* @param {*} srcValue The source value.
* @param {string} key The key of the property to assign.
* @param {Object} object The parent object of `objValue`.
* @returns {*} Returns the value to assign.
*/
function customDefaultsAssignIn(objValue, srcValue, key, object) {
if (objValue === undefined ||
(eq(objValue, objectProto[key]) && !hasOwnProperty.call(object, key))) {
return srcValue;
}
return objValue;
}
module.exports = customDefaultsAssignIn;
@@ -0,0 +1,17 @@
import { importJWK } from '../key/import.js';
import isObject from '../lib/is_object.js';
import { JWSInvalid } from '../util/errors.js';
export async function EmbeddedJWK(protectedHeader, token) {
const joseHeader = {
...protectedHeader,
...token?.header,
};
if (!isObject(joseHeader.jwk)) {
throw new JWSInvalid('"jwk" (JSON Web Key) Header Parameter must be a JSON object');
}
const key = await importJWK({ ...joseHeader.jwk, ext: true }, joseHeader.alg);
if (key instanceof Uint8Array || key.type !== 'public') {
throw new JWSInvalid('"jwk" (JSON Web Key) Header Parameter must be a public key');
}
return key;
}
@@ -0,0 +1,52 @@
'use strict';
Object.defineProperty(exports, '__esModule', {
value: true,
});
exports.NoUndefinedVariablesRule = NoUndefinedVariablesRule;
var _GraphQLError = require('../../error/GraphQLError.js');
/**
* No undefined variables
*
* A GraphQL operation is only valid if all variables encountered, both directly
* and via fragment spreads, are defined by that operation.
*
* See https://spec.graphql.org/draft/#sec-All-Variable-Uses-Defined
*/
function NoUndefinedVariablesRule(context) {
let variableNameDefined = Object.create(null);
return {
OperationDefinition: {
enter() {
variableNameDefined = Object.create(null);
},
leave(operation) {
const usages = context.getRecursiveVariableUsages(operation);
for (const { node } of usages) {
const varName = node.name.value;
if (variableNameDefined[varName] !== true) {
context.reportError(
new _GraphQLError.GraphQLError(
operation.name
? `Variable "$${varName}" is not defined by operation "${operation.name.value}".`
: `Variable "$${varName}" is not defined.`,
{
nodes: [node, operation],
},
),
);
}
}
},
},
VariableDefinition(node) {
variableNameDefined[node.variable.name.value] = true;
},
};
}
@@ -0,0 +1,6 @@
import * as React from 'react';
type TextProps = Readonly<React.ComponentPropsWithoutRef<"p">>;
declare const Text: React.ForwardRefExoticComponent<Readonly<Omit<React.DetailedHTMLProps<React.HTMLAttributes<HTMLParagraphElement>, HTMLParagraphElement>, "ref">> & React.RefAttributes<HTMLParagraphElement>>;
export { Text, type TextProps };
@@ -0,0 +1,9 @@
import type { DrizzleAdapter } from '../types.js';
/**
* Pushes the development schema to the database using Drizzle.
*
* @param {DrizzleAdapter} adapter - The PostgresAdapter instance connected to the database.
* @returns {Promise<void>} - A promise that resolves once the schema push is complete.
*/
export declare const pushDevSchema: (adapter: DrizzleAdapter) => Promise<void>;
//# sourceMappingURL=pushDevSchema.d.ts.map
@@ -0,0 +1,5 @@
import type { FolderListViewClientProps } from 'payload';
import React from 'react';
import './index.scss';
export declare function DefaultCollectionFolderView({ allCollectionFolderSlugs: folderCollectionSlugs, allowCreateCollectionSlugs, baseFolderPath, breadcrumbs, documents, folderFieldName, folderID, FolderResultsComponent, search, sort, subfolders, ...restOfProps }: FolderListViewClientProps): React.JSX.Element;
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,8 @@
"use strict";
exports.startOfISOWeekYear = void 0;
var _index = require("../startOfISOWeekYear.js");
var _index2 = require("./_lib/convertToFP.js"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const startOfISOWeekYear = (exports.startOfISOWeekYear = (0,
_index2.convertToFP)(_index.startOfISOWeekYear, 1));
@@ -0,0 +1,77 @@
import { CustomTypesConfig } from "..";
declare enum builtins {
BOOL = 16,
BYTEA = 17,
CHAR = 18,
INT8 = 20,
INT2 = 21,
INT4 = 23,
REGPROC = 24,
TEXT = 25,
OID = 26,
TID = 27,
XID = 28,
CID = 29,
JSON = 114,
XML = 142,
PG_NODE_TREE = 194,
SMGR = 210,
PATH = 602,
POLYGON = 604,
CIDR = 650,
FLOAT4 = 700,
FLOAT8 = 701,
ABSTIME = 702,
RELTIME = 703,
TINTERVAL = 704,
CIRCLE = 718,
MACADDR8 = 774,
MONEY = 790,
MACADDR = 829,
INET = 869,
ACLITEM = 1033,
BPCHAR = 1042,
VARCHAR = 1043,
DATE = 1082,
TIME = 1083,
TIMESTAMP = 1114,
TIMESTAMPTZ = 1184,
INTERVAL = 1186,
TIMETZ = 1266,
BIT = 1560,
VARBIT = 1562,
NUMERIC = 1700,
REFCURSOR = 1790,
REGPROCEDURE = 2202,
REGOPER = 2203,
REGOPERATOR = 2204,
REGCLASS = 2205,
REGTYPE = 2206,
UUID = 2950,
TXID_SNAPSHOT = 2970,
PG_LSN = 3220,
PG_NDISTINCT = 3361,
PG_DEPENDENCIES = 3402,
TSVECTOR = 3614,
TSQUERY = 3615,
GTSVECTOR = 3642,
REGCONFIG = 3734,
REGDICTIONARY = 3769,
JSONB = 3802,
REGNAMESPACE = 4089,
REGROLE = 4096,
}
type TypeId = builtins;
type TypeParser<TOid = number, TReturn = any> = (oid: TOid) => TReturn;
type TypeFormat = "text" | "binary";
export = TypeOverrides;
declare class TypeOverrides implements CustomTypesConfig {
constructor(types?: CustomTypesConfig);
setTypeParser<T>(oid: number | TypeId, parseFn: TypeParser<string, T>): void;
setTypeParser<T>(oid: number | TypeId, format: "text", parseFn: TypeParser<string, T>): void;
setTypeParser<T>(oid: number | TypeId, format: "binary", parseFn: TypeParser<Buffer, T>): void;
getTypeParser<T>(oid: number | TypeId, format?: TypeFormat): TypeParser;
}
@@ -0,0 +1,54 @@
import { mixNumber } from '../../utils/mix/number.mjs';
import { percent } from '../../value/types/numbers/units.mjs';
import { scalePoint } from './delta-apply.mjs';
/**
* Remove a delta from a point. This is essentially the steps of applyPointDelta in reverse
*/
function removePointDelta(point, translate, scale, originPoint, boxScale) {
point -= translate;
point = scalePoint(point, 1 / scale, originPoint);
if (boxScale !== undefined) {
point = scalePoint(point, 1 / boxScale, originPoint);
}
return point;
}
/**
* Remove a delta from an axis. This is essentially the steps of applyAxisDelta in reverse
*/
function removeAxisDelta(axis, translate = 0, scale = 1, origin = 0.5, boxScale, originAxis = axis, sourceAxis = axis) {
if (percent.test(translate)) {
translate = parseFloat(translate);
const relativeProgress = mixNumber(sourceAxis.min, sourceAxis.max, translate / 100);
translate = relativeProgress - sourceAxis.min;
}
if (typeof translate !== "number")
return;
let originPoint = mixNumber(originAxis.min, originAxis.max, origin);
if (axis === originAxis)
originPoint -= translate;
axis.min = removePointDelta(axis.min, translate, scale, originPoint, boxScale);
axis.max = removePointDelta(axis.max, translate, scale, originPoint, boxScale);
}
/**
* Remove a transforms from an axis. This is essentially the steps of applyAxisTransforms in reverse
* and acts as a bridge between motion values and removeAxisDelta
*/
function removeAxisTransforms(axis, transforms, [key, scaleKey, originKey], origin, sourceAxis) {
removeAxisDelta(axis, transforms[key], transforms[scaleKey], transforms[originKey], transforms.scale, origin, sourceAxis);
}
/**
* The names of the motion values we want to apply as translation, scale and origin.
*/
const xKeys = ["x", "scaleX", "originX"];
const yKeys = ["y", "scaleY", "originY"];
/**
* Remove a transforms from an box. This is essentially the steps of applyAxisBox in reverse
* and acts as a bridge between motion values and removeAxisDelta
*/
function removeBoxTransforms(box, transforms, originBox, sourceBox) {
removeAxisTransforms(box.x, transforms, xKeys, originBox ? originBox.x : undefined, sourceBox ? sourceBox.x : undefined);
removeAxisTransforms(box.y, transforms, yKeys, originBox ? originBox.y : undefined, sourceBox ? sourceBox.y : undefined);
}
export { removeAxisDelta, removeAxisTransforms, removeBoxTransforms, removePointDelta };
@@ -0,0 +1,41 @@
'use strict'
const t = require('tap')
if (process.env.CI) {
t.skip('skip on CI')
process.exit(0)
}
const { join } = require('path')
const { file } = require('./helper')
const { createReadStream } = require('fs')
const ThreadStream = require('..')
const buffer = require('buffer')
const MAX_STRING = buffer.constants.MAX_STRING_LENGTH
t.plan(1)
const dest = file()
const stream = new ThreadStream({
filename: join(__dirname, 'to-file.js'),
workerData: { dest },
sync: false
})
stream.on('close', async () => {
t.comment('close emitted')
let buf
for await (const chunk of createReadStream(dest)) {
buf = chunk
}
t.equal('asd', buf.toString().slice(-3))
})
stream.on('ready', () => {
t.comment('open emitted')
stream.write('a'.repeat(MAX_STRING - 2))
stream.write('asd')
stream.end()
})
@@ -0,0 +1,26 @@
'use strict'
module.exports = createDate
const isValidDate = require('./is-valid-date')
/**
* Constructs a JS Date from a number or string. Accepts any single number
* or single string argument that is valid for the Date() constructor,
* or an epoch as a string.
*
* @param {string|number} epoch The representation of the Date.
*
* @returns {Date} The constructed Date.
*/
function createDate (epoch) {
// If epoch is already a valid argument, return the valid Date
let date = new Date(epoch)
if (isValidDate(date)) {
return date
}
// Convert to a number to permit epoch as a string
date = new Date(+epoch)
return date
}
@@ -0,0 +1 @@
{"version":3,"file":"NoopTracerProvider.js","sourceRoot":"","sources":["../../../src/trace/NoopTracerProvider.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;GAcG;AAEH,OAAO,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAK1C;;;;;GAKG;AACH,MAAM,OAAO,kBAAkB;IAC7B,SAAS,CACP,KAAc,EACd,QAAiB,EACjB,QAAwB;QAExB,OAAO,IAAI,UAAU,EAAE,CAAC;IAC1B,CAAC;CACF","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\nimport { NoopTracer } from './NoopTracer';\nimport { Tracer } from './tracer';\nimport { TracerOptions } from './tracer_options';\nimport { TracerProvider } from './tracer_provider';\n\n/**\n * An implementation of the {@link TracerProvider} which returns an impotent\n * Tracer for all calls to `getTracer`.\n *\n * All operations are no-op.\n */\nexport class NoopTracerProvider implements TracerProvider {\n getTracer(\n _name?: string,\n _version?: string,\n _options?: TracerOptions\n ): Tracer {\n return new NoopTracer();\n }\n}\n"]}
@@ -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 './user-round-cog.js';
//# sourceMappingURL=user-cog-2.js.map
@@ -0,0 +1,39 @@
import { buildFormatLongFn } from "../../_lib/buildFormatLongFn.js";
const dateFormats = {
full: "y'年'M'月'd'日' EEEE",
long: "y'年'M'月'd'日'",
medium: "yyyy-MM-dd",
short: "yy-MM-dd",
};
const timeFormats = {
full: "zzzz a h:mm:ss",
long: "z a h:mm:ss",
medium: "a h:mm:ss",
short: "a h:mm",
};
const dateTimeFormats = {
full: "{{date}} {{time}}",
long: "{{date}} {{time}}",
medium: "{{date}} {{time}}",
short: "{{date}} {{time}}",
};
export const formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full",
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full",
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full",
}),
};
@@ -0,0 +1,9 @@
The MIT License (MIT)
Copyright © 2026 Borewit
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
@@ -0,0 +1,24 @@
var OverloadYield = require("./OverloadYield.js");
function _asyncGeneratorDelegate(t) {
var e = {},
n = !1;
function pump(e, r) {
return n = !0, r = new Promise(function (n) {
n(t[e](r));
}), {
done: !1,
value: new OverloadYield(r, 1)
};
}
return e["undefined" != typeof Symbol && Symbol.iterator || "@@iterator"] = function () {
return this;
}, e.next = function (t) {
return n ? (n = !1, t) : pump("next", t);
}, "function" == typeof t["throw"] && (e["throw"] = function (t) {
if (n) throw n = !1, t;
return pump("throw", t);
}), "function" == typeof t["return"] && (e["return"] = function (t) {
return n ? (n = !1, t) : pump("return", t);
}), e;
}
module.exports = _asyncGeneratorDelegate, module.exports.__esModule = true, module.exports["default"] = module.exports;
@@ -0,0 +1,28 @@
import { StackFrame } from '@sentry/core';
interface ContextLinesOptions {
/**
* Sets the number of context lines for each frame when loading a file.
* Defaults to 7.
*
* Set to 0 to disable loading and inclusion of source files.
**/
frameContextLines?: number;
}
/**
* Collects source context lines around the lines of stackframes pointing to JS embedded in
* the current page's HTML.
*
* This integration DOES NOT work for stack frames pointing to JS files that are loaded by the browser.
* For frames pointing to files, context lines are added during ingestion and symbolication
* by attempting to download the JS files to the Sentry backend.
*
* Use this integration if you have inline JS code in HTML pages that can't be accessed
* by our backend (e.g. due to a login-protected page).
*/
export declare const contextLinesIntegration: (options?: ContextLinesOptions | undefined) => import("@sentry/core").Integration;
/**
* Only exported for testing
*/
export declare function applySourceContextToFrame(frame: StackFrame, htmlLines: string[], htmlFilename: string, linesOfContext: number): StackFrame;
export {};
//# sourceMappingURL=contextlines.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"texts.d.ts","sourceRoot":"","sources":["../../../src/transform/write/texts.ts"],"names":[],"mappings":"AAAA,KAAK,IAAI,GAAG;IACV,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,CAAA;IAChC,IAAI,EAAE,OAAO,EAAE,CAAA;IACf,KAAK,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,CAAA;CACjC,CAAA;AAED,eAAO,MAAM,cAAc,6BAA8B,IAAI,SAQ5D,CAAA"}
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/transform/write/texts.ts"],"sourcesContent":["type Args = {\n baseRow: Record<string, unknown>\n data: unknown[]\n texts: Record<string, unknown>[]\n}\n\nexport const transformTexts = ({ baseRow, data, texts }: Args) => {\n data.forEach((val, i) => {\n texts.push({\n ...baseRow,\n order: i + 1,\n text: val,\n })\n })\n}\n"],"names":["transformTexts","baseRow","data","texts","forEach","val","i","push","order","text"],"mappings":"AAMA,OAAO,MAAMA,iBAAiB,CAAC,EAAEC,OAAO,EAAEC,IAAI,EAAEC,KAAK,EAAQ;IAC3DD,KAAKE,OAAO,CAAC,CAACC,KAAKC;QACjBH,MAAMI,IAAI,CAAC;YACT,GAAGN,OAAO;YACVO,OAAOF,IAAI;YACXG,MAAMJ;QACR;IACF;AACF,EAAC"}
@@ -0,0 +1 @@
{"version":3,"file":"preventLockout.d.ts","sourceRoot":"","sources":["../../src/query-presets/preventLockout.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,QAAQ,EAAE,MAAM,2BAA2B,CAAA;AAQzD;;;;;;;;GAQG;AACH,eAAO,MAAM,cAAc,EAAE,QA0E5B,CAAA"}
@@ -0,0 +1,290 @@
import type { CollectionConfig, Job } from '../../../index.js';
import type { MaybePromise, Payload, PayloadRequest, Sort } from '../../../types/index.js';
import type { RunJobsSilent } from '../../localAPI.js';
import type { RunJobsArgs } from '../../operations/runJobs/index.js';
import type { JobStats } from '../global.js';
import type { TaskConfig } from './taskTypes.js';
import type { WorkflowConfig } from './workflowTypes.js';
export type AutorunCronConfig = {
/**
* If you want to autoRUn jobs from all queues, set this to true.
* If you set this to true, the `queue` property will be ignored.
*
* @default false
*/
allQueues?: boolean;
/**
* The cron schedule for the job.
* @default '* * * * *' (every minute).
*
* @example
* ┌───────────── (optional) second (0 - 59)
* │ ┌───────────── minute (0 - 59)
* │ │ ┌───────────── hour (0 - 23)
* │ │ │ ┌───────────── day of the month (1 - 31)
* │ │ │ │ ┌───────────── month (1 - 12)
* │ │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday)
* │ │ │ │ │ │
* │ │ │ │ │ │
* - '* 0 * * * *' every hour at minute 0
* - '* 0 0 * * *' daily at midnight
* - '* 0 0 * * 0' weekly at midnight on Sundays
* - '* 0 0 1 * *' monthly at midnight on the 1st day of the month
* - '* 0/5 * * * *' every 5 minutes
* - '* * * * * *' every second
*/
cron?: string;
/**
* By default, the autorun will attempt to schedule jobs for tasks and workflows that have a `schedule` property, given
* the queue name is the same.
*
* Set this to `true` to disable the scheduling of jobs automatically.
*
* @default false
*/
disableScheduling?: boolean;
/**
* The limit for the job. This can be overridden by the user. Defaults to 10.
*/
limit?: number;
/**
* The queue name for the job.
*
* @default 'default'
*/
queue?: string;
/**
* If set to true, the job system will not log any output to the console (for both info and error logs).
* Can be an option for more granular control over logging.
*
* This will not automatically affect user-configured logs (e.g. if you call `console.log` or `payload.logger.info` in your job code).
*
* @default false
*/
silent?: RunJobsSilent;
};
export type RunJobAccessArgs = {
req: PayloadRequest;
};
export type RunJobAccess = (args: RunJobAccessArgs) => MaybePromise<boolean>;
export type QueueJobAccessArgs = {
req: PayloadRequest;
};
export type CancelJobAccessArgs = {
req: PayloadRequest;
};
export type CancelJobAccess = (args: CancelJobAccessArgs) => MaybePromise<boolean>;
export type QueueJobAccess = (args: QueueJobAccessArgs) => MaybePromise<boolean>;
export type SanitizedJobsConfig = {
/**
* If set to `true`, the job system is enabled and a payload-jobs collection exists.
* This property is automatically set during sanitization.
*/
enabled?: boolean;
/**
* If set to `true`, at least one task or workflow has scheduling enabled.
* This property is automatically set during sanitization.
*/
scheduling?: boolean;
/**
* If set to `true`, a payload-job-stats global exists.
* This property is automatically set during sanitization.
*/
stats?: boolean;
} & JobsConfig;
export type JobsConfig = {
/**
* Specify access control to determine who can interact with jobs.
*/
access?: {
/**
* By default, all logged-in users can cancel jobs.
*/
cancel?: CancelJobAccess;
/**
* By default, all logged-in users can queue jobs.
*/
queue?: QueueJobAccess;
/**
* By default, all logged-in users can run jobs.
*/
run?: RunJobAccess;
};
/** Adds information about the parent job to the task log. This is useful for debugging and tracking the flow of tasks.
*
* In 4.0, this will default to `true`.
*
* @default false
*/
addParentToTaskLog?: boolean;
/**
* Allows you to configure cron jobs that automatically run queued jobs
* at specified intervals. Note that this does not _queue_ new jobs - only
* _runs_ jobs that are already in the specified queue.
*
* @remark this property should not be used on serverless platforms like Vercel
*/
autoRun?: ((payload: Payload) => MaybePromise<AutorunCronConfig[]>) | AutorunCronConfig[];
/**
* Determine whether or not to delete a job after it has successfully completed.
*/
deleteJobOnComplete?: boolean;
/**
* Specify depth for retrieving jobs from the queue.
* This should be as low as possible in order for job retrieval
* to be as efficient as possible. Setting it to anything higher than
* 0 will drastically affect performance, as less efficient database
* queries will be used.
*
* @default 0
* @deprecated - this will be removed in 4.0
*/
depth?: number;
/**
* Enable concurrency controls for workflows and tasks.
* When enabled, adds a `concurrencyKey` field to the jobs collection schema.
* This allows workflows and tasks to use the `concurrency` option to prevent race conditions.
*
* **Important:** Enabling this may require a database migration depending on your database adapter,
* as it adds a new indexed field to the jobs collection schema.
*
* @default false
* @todo In 4.0, this will default to `true`.
*/
enableConcurrencyControl?: boolean;
/**
* Override any settings on the default Jobs collection. Accepts the default collection and allows you to return
* a new collection.
*/
jobsCollectionOverrides?: (args: {
defaultJobsCollection: CollectionConfig;
}) => CollectionConfig;
/**
* Adjust the job processing order using a Payload sort string. This can be set globally or per queue.
*
* FIFO would equal `createdAt` and LIFO would equal `-createdAt`.
*
* @default all jobs for all queues will be executed in FIFO order.
*/
processingOrder?: ((args: RunJobsArgs) => Promise<Sort> | Sort) | {
default?: Sort;
queues: {
[queue: string]: Sort;
};
} | Sort;
/**
* By default, the job system uses direct database calls for optimal performance.
* If you added custom hooks to your jobs collection, you can set this to true to
* use the standard Payload API for all job operations. This is discouraged, as it will
* drastically affect performance.
*
* @default false
* @deprecated - this will be removed in 4.0
*/
runHooks?: boolean;
/**
* A function that will be executed before Payload picks up jobs which are configured by the `jobs.autorun` function.
* If this function returns true, jobs will be queried and picked up. If it returns false, jobs will not be run.
* @default undefined - if this function is not defined, jobs will be run - as if () => true was passed.
* @param payload
* @returns boolean
*/
shouldAutoRun?: (payload: Payload) => MaybePromise<boolean>;
/**
* Define all possible tasks here
*/
tasks?: TaskConfig<any>[];
/**
* Define all the workflows here. Workflows orchestrate the flow of multiple tasks.
*/
workflows?: WorkflowConfig<any>[];
};
export type Queueable = {
scheduleConfig: ScheduleConfig;
taskConfig?: TaskConfig;
waitUntil?: Date;
workflowConfig?: WorkflowConfig;
};
export type BeforeScheduleFn = (args: {
defaultBeforeSchedule: BeforeScheduleFn;
/**
* payload-job-stats global data
*/
jobStats: JobStats;
queueable: Queueable;
req: PayloadRequest;
}) => MaybePromise<{
input?: object;
shouldSchedule: boolean;
waitUntil?: Date;
}>;
export type AfterScheduleFn = (args: {
defaultAfterSchedule: AfterScheduleFn;
/**
* payload-job-stats global data. If the global does not exist, it will be null.
*/
jobStats: JobStats | null;
queueable: Queueable;
req: PayloadRequest;
} & ({
error: Error;
job?: never;
status: 'error';
} | {
error?: never;
job: Job;
status: 'success';
} | {
error?: never;
job?: never;
/**
* If the beforeSchedule hook returned `shouldSchedule: false`, this will be called with status `skipped`.
*/
status: 'skipped';
})) => MaybePromise<void>;
export type ScheduleConfig = {
/**
* The cron for scheduling the job.
*
* @example
* ┌───────────── (optional) second (0 - 59)
* │ ┌───────────── minute (0 - 59)
* │ │ ┌───────────── hour (0 - 23)
* │ │ │ ┌───────────── day of the month (1 - 31)
* │ │ │ │ ┌───────────── month (1 - 12)
* │ │ │ │ │ ┌───────────── day of the week (0 - 6) (Sunday to Saturday)
* │ │ │ │ │ │
* │ │ │ │ │ │
* - '* 0 * * * *' every hour at minute 0
* - '* 0 0 * * *' daily at midnight
* - '* 0 0 * * 0' weekly at midnight on Sundays
* - '* 0 0 1 * *' monthly at midnight on the 1st day of the month
* - '* 0/5 * * * *' every 5 minutes
* - '* * * * * *' every second
*/
cron: string;
hooks?: {
/**
* Functions that will be executed after the job has been successfully scheduled.
*
* @default By default, global update?? Unless global update should happen before
*/
afterSchedule?: AfterScheduleFn;
/**
* Functions that will be executed before the job is scheduled.
* You can use this to control whether or not the job should be scheduled, or what input
* data should be passed to the job.
*
* @default By default, this has one function that returns { shouldSchedule: true } if the following conditions are met:
* - There currently is no job of the same type in the specified queue that is currently running
* - There currently is no job of the same type in the specified queue that is scheduled to run in the future
* - There currently is no job of the same type in the specified queue that failed previously but can be retried
*/
beforeSchedule?: BeforeScheduleFn;
};
/**
* Queue to which the scheduled job will be added.
*/
queue: string;
};
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"user-round-plus.js","sources":["../../../src/icons/user-round-plus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name UserRoundPlus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMiAyMWE4IDggMCAwIDEgMTMuMjkyLTYiIC8+CiAgPGNpcmNsZSBjeD0iMTAiIGN5PSI4IiByPSI1IiAvPgogIDxwYXRoIGQ9Ik0xOSAxNnY2IiAvPgogIDxwYXRoIGQ9Ik0yMiAxOWgtNiIgLz4KPC9zdmc+Cg==) - https://lucide.dev/icons/user-round-plus\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 UserRoundPlus = createLucideIcon('UserRoundPlus', [\n ['path', { d: 'M2 21a8 8 0 0 1 13.292-6', key: 'bjp14o' }],\n ['circle', { cx: '10', cy: '8', r: '5', key: 'o932ke' }],\n ['path', { d: 'M19 16v6', key: 'tddt3s' }],\n ['path', { d: 'M22 19h-6', key: 'vcuq98' }],\n]);\n\nexport default UserRoundPlus;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAgB,iBAAiB,eAAiB,CAAA,CAAA,CAAA;AAAA,CAAA,CACtD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,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,CAAA;AAAA,CAAA,CACvD,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,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AAC5C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,16 @@
/**
* @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 ArrowBigLeftDash = createLucideIcon("ArrowBigLeftDash", [
["path", { d: "M19 15V9", key: "1hci5f" }],
["path", { d: "M15 15h-3v4l-7-7 7-7v4h3v6z", key: "16tjna" }]
]);
export { ArrowBigLeftDash as default };
//# sourceMappingURL=arrow-big-left-dash.js.map
@@ -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 './circle-stop.js';
//# sourceMappingURL=stop-circle.js.map
@@ -0,0 +1,12 @@
{
"title": "ProfilingPluginOptions",
"type": "object",
"additionalProperties": false,
"properties": {
"outputPath": {
"description": "Path to the output file e.g. `path.resolve(__dirname, 'profiling/events.json')`. Defaults to `events.json`.",
"type": "string",
"absolutePath": true
}
}
}
@@ -0,0 +1,43 @@
import { entityKind } from "../../entity.js";
import { getColumnNameAndConfig } from "../../utils.js";
import { SingleStoreColumn, SingleStoreColumnBuilder } from "./common.js";
class SingleStoreBinaryBuilder extends SingleStoreColumnBuilder {
static [entityKind] = "SingleStoreBinaryBuilder";
constructor(name, length) {
super(name, "string", "SingleStoreBinary");
this.config.length = length;
}
/** @internal */
build(table) {
return new SingleStoreBinary(
table,
this.config
);
}
}
class SingleStoreBinary extends SingleStoreColumn {
static [entityKind] = "SingleStoreBinary";
length = this.config.length;
mapFromDriverValue(value) {
if (typeof value === "string") return value;
if (Buffer.isBuffer(value)) return value.toString();
const str = [];
for (const v of value) {
str.push(v === 49 ? "1" : "0");
}
return str.join("");
}
getSQLType() {
return this.length === void 0 ? `binary` : `binary(${this.length})`;
}
}
function binary(a, b = {}) {
const { name, config } = getColumnNameAndConfig(a, b);
return new SingleStoreBinaryBuilder(name, config.length);
}
export {
SingleStoreBinary,
SingleStoreBinaryBuilder,
binary
};
//# sourceMappingURL=binary.js.map
@@ -0,0 +1,14 @@
import type { Carrier } from './../carrier';
import type { AsyncContextStrategy } from './types';
/**
* @private Private API with no semver guarantees!
*
* Sets the global async context strategy
*/
export declare function setAsyncContextStrategy(strategy: AsyncContextStrategy | undefined): void;
/**
* Get the current async context strategy.
* If none has been setup, the default will be used.
*/
export declare function getAsyncContextStrategy(carrier: Carrier): AsyncContextStrategy;
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,328 @@
import { en } from '@payloadcms/translations/languages/en';
import { deepMergeSimple } from '@payloadcms/translations/utilities';
import { defaultUserCollection } from '../auth/defaultUser.js';
import { authRootEndpoints } from '../auth/endpoints/index.js';
import { sanitizeCollection } from '../collections/config/sanitize.js';
import { migrationsCollection } from '../database/migrations/migrationsCollection.js';
import { DuplicateCollection, InvalidConfiguration } from '../errors/index.js';
import { defaultTimezones } from '../fields/baseFields/timezone/defaultTimezones.js';
import { addFolderCollection } from '../folders/addFolderCollection.js';
import { addFolderFieldToCollection } from '../folders/addFolderFieldToCollection.js';
import { sanitizeGlobal } from '../globals/config/sanitize.js';
import { baseBlockFields, formatLabels, sanitizeFields } from '../index.js';
import { getLockedDocumentsCollection, lockedDocumentsCollectionSlug } from '../locked-documents/config.js';
import { getPreferencesCollection, preferencesCollectionSlug } from '../preferences/config.js';
import { getQueryPresetsConfig, queryPresetsCollectionSlug } from '../query-presets/config.js';
import { getDefaultJobsCollection, jobsCollectionSlug } from '../queues/config/collection.js';
import { getJobStatsGlobal } from '../queues/config/global.js';
import { flattenBlock } from '../utilities/flattenAllFields.js';
import { hasScheduledPublishEnabled } from '../utilities/getVersionsConfig.js';
import { validateTimezones } from '../utilities/validateTimezones.js';
import { getSchedulePublishTask } from '../versions/schedule/job.js';
import { addDefaultsToConfig } from './defaults.js';
import { setupOrderable } from './orderable/index.js';
const sanitizeAdminConfig = (configToSanitize)=>{
const sanitizedConfig = {
...configToSanitize
};
if (configToSanitize?.compatibility?.allowLocalizedWithinLocalized) {
process.env.NEXT_PUBLIC_PAYLOAD_COMPATIBILITY_allowLocalizedWithinLocalized = 'true';
}
// default logging level will be 'error' if not provided
sanitizedConfig.loggingLevels = {
Forbidden: 'info',
Locked: 'info',
MissingFile: 'info',
NotFound: 'info',
ValidationError: 'info',
...sanitizedConfig.loggingLevels || {}
};
(sanitizedConfig.admin.dashboard ??= {
widgets: []
}).widgets.push({
slug: 'collections',
ComponentPath: '@payloadcms/next/rsc#CollectionCards',
minWidth: 'full'
});
sanitizedConfig.admin.dashboard.defaultLayout ??= [
{
widgetSlug: 'collections',
width: 'full'
}
];
// add default user collection if none provided
if (!sanitizedConfig?.admin?.user) {
const firstCollectionWithAuth = sanitizedConfig.collections.find(({ auth })=>Boolean(auth));
if (firstCollectionWithAuth) {
sanitizedConfig.admin.user = firstCollectionWithAuth.slug;
} else {
sanitizedConfig.admin.user = defaultUserCollection.slug;
sanitizedConfig.collections.push(defaultUserCollection);
}
}
const userCollection = sanitizedConfig.collections.find(({ slug })=>slug === sanitizedConfig.admin.user);
if (!userCollection || !userCollection.auth) {
throw new InvalidConfiguration(`${sanitizedConfig.admin.user} is not a valid admin user collection`);
}
if (sanitizedConfig?.admin?.timezones) {
if (typeof configToSanitize?.admin?.timezones?.supportedTimezones === 'function') {
sanitizedConfig.admin.timezones.supportedTimezones = configToSanitize.admin.timezones.supportedTimezones({
defaultTimezones
});
}
if (!sanitizedConfig?.admin?.timezones?.supportedTimezones) {
sanitizedConfig.admin.timezones.supportedTimezones = defaultTimezones;
}
} else {
sanitizedConfig.admin.timezones = {
supportedTimezones: defaultTimezones
};
}
validateTimezones({
source: 'admin.timezones.supportedTimezones',
timezones: sanitizedConfig.admin.timezones.supportedTimezones
});
return sanitizedConfig;
};
export const sanitizeConfig = async (incomingConfig)=>{
const configWithDefaults = addDefaultsToConfig(incomingConfig);
const config = sanitizeAdminConfig(configWithDefaults);
// Add orderable fields
setupOrderable(config);
if (!config.endpoints) {
config.endpoints = [];
}
for (const endpoint of authRootEndpoints){
config.endpoints.push(endpoint);
}
if (config.localization && config.localization.locales?.length > 0) {
// clone localization config so to not break everything
const firstLocale = config.localization.locales[0];
if (typeof firstLocale === 'string') {
config.localization.localeCodes = [
...config.localization.locales
];
// is string[], so convert to Locale[]
config.localization.locales = config.localization.locales.map((locale)=>({
code: locale,
label: locale,
rtl: false,
toString: ()=>locale
}));
} else {
// is Locale[], so convert to string[] for localeCodes
config.localization.localeCodes = config.localization.locales.map((locale)=>locale.code);
config.localization.locales = config.localization.locales.map((locale)=>({
...locale,
toString: ()=>locale.code
}));
}
// Default fallback to true if not provided
config.localization.fallback = config.localization?.fallback ?? true;
}
const i18nConfig = {
fallbackLanguage: 'en',
supportedLanguages: {
en
},
translations: {}
};
if (incomingConfig?.i18n) {
i18nConfig.supportedLanguages = incomingConfig.i18n?.supportedLanguages || i18nConfig.supportedLanguages;
const supportedLangKeys = Object.keys(i18nConfig.supportedLanguages);
const fallbackLang = incomingConfig.i18n?.fallbackLanguage || i18nConfig.fallbackLanguage;
i18nConfig.fallbackLanguage = supportedLangKeys.includes(fallbackLang) ? fallbackLang : supportedLangKeys[0];
i18nConfig.translations = incomingConfig.i18n?.translations || i18nConfig.translations;
}
config.i18n = i18nConfig;
const richTextSanitizationPromises = [];
const schedulePublishCollections = [];
const queryPresetsCollections = [];
const schedulePublishGlobals = [];
const collectionSlugs = new Set();
const validRelationships = [
...config.collections?.map((c)=>c.slug) ?? [],
jobsCollectionSlug,
lockedDocumentsCollectionSlug,
preferencesCollectionSlug
];
if (config.folders !== false) {
validRelationships.push(config.folders.slug);
}
/**
* Blocks sanitization needs to happen before collections, as collection/global join field sanitization needs config.blocks
* to be populated with the sanitized blocks
*/ config.blocks = [];
if (incomingConfig.blocks?.length) {
for (const block of incomingConfig.blocks){
const sanitizedBlock = block;
if (sanitizedBlock._sanitized === true) {
continue;
}
sanitizedBlock._sanitized = true;
sanitizedBlock.fields = sanitizedBlock.fields.concat(baseBlockFields);
sanitizedBlock.labels = !sanitizedBlock.labels ? formatLabels(sanitizedBlock.slug) : sanitizedBlock.labels;
sanitizedBlock.fields = await sanitizeFields({
config: config,
existingFieldNames: new Set(),
fields: sanitizedBlock.fields,
parentIsLocalized: false,
richTextSanitizationPromises,
validRelationships
});
const flattenedSanitizedBlock = flattenBlock({
block
});
config.blocks.push(flattenedSanitizedBlock);
}
}
const folderEnabledCollections = [];
for(let i = 0; i < config.collections.length; i++){
if (collectionSlugs.has(config.collections[i].slug)) {
throw new DuplicateCollection('slug', config.collections[i].slug);
}
collectionSlugs.add(config.collections[i].slug);
const draftsConfig = config.collections[i]?.versions?.drafts;
if (typeof draftsConfig === 'object' && draftsConfig.schedulePublish) {
schedulePublishCollections.push(config.collections[i].slug);
}
if (config.collections[i].enableQueryPresets) {
queryPresetsCollections.push(config.collections[i].slug);
if (!validRelationships.includes(queryPresetsCollectionSlug)) {
validRelationships.push(queryPresetsCollectionSlug);
}
}
if (config.folders !== false && config.collections[i].folders) {
addFolderFieldToCollection({
collection: config.collections[i],
collectionSpecific: config.folders.collectionSpecific,
folderFieldName: config.folders.fieldName,
folderSlug: config.folders.slug
});
}
config.collections[i] = await sanitizeCollection(config, config.collections[i], richTextSanitizationPromises, validRelationships);
if (config.folders !== false && config.collections[i].folders) {
folderEnabledCollections.push(config.collections[i]);
}
}
if (config.globals.length > 0) {
for(let i = 0; i < config.globals.length; i++){
if (hasScheduledPublishEnabled(config.globals[i])) {
schedulePublishGlobals.push(config.globals[i].slug);
}
config.globals[i] = await sanitizeGlobal(config, config.globals[i], richTextSanitizationPromises, validRelationships);
}
}
if (schedulePublishCollections.length || schedulePublishGlobals.length) {
;
((config.jobs ??= {}).tasks ??= []).push(getSchedulePublishTask({
adminUserSlug: config.admin.user,
collections: schedulePublishCollections,
globals: schedulePublishGlobals
}));
}
;
(config.jobs ??= {}).enabled = Boolean(Array.isArray(configWithDefaults.jobs?.tasks) && configWithDefaults.jobs?.tasks?.length || Array.isArray(configWithDefaults.jobs?.workflows) && configWithDefaults.jobs?.workflows?.length);
// Need to add default jobs collection before locked documents collections
if (config.jobs.enabled) {
// Check for schedule property in both tasks and workflows
const hasScheduleProperty = config?.jobs?.tasks?.length && config.jobs.tasks.some((task)=>task.schedule) || config?.jobs?.workflows?.length && config.jobs.workflows.some((workflow)=>workflow.schedule);
if (hasScheduleProperty) {
config.jobs.scheduling = true;
(config.globals ??= []).push(await sanitizeGlobal(config, getJobStatsGlobal(config), richTextSanitizationPromises, validRelationships));
config.jobs.stats = true;
}
let defaultJobsCollection = getDefaultJobsCollection(config.jobs);
if (typeof config.jobs.jobsCollectionOverrides === 'function') {
defaultJobsCollection = config.jobs.jobsCollectionOverrides({
defaultJobsCollection
});
const hooks = defaultJobsCollection?.hooks;
// @todo - delete this check in 4.0
if (hooks && config?.jobs?.runHooks !== true) {
for (const [hookKey, hook] of Object.entries(hooks)){
const defaultAmount = hookKey === 'afterRead' || hookKey === 'beforeChange' ? 1 : 0;
if (hook.length > defaultAmount) {
// eslint-disable-next-line no-console
console.warn(`The jobsCollectionOverrides function is returning a collection with an additional ${hookKey} hook defined. These hooks will not run unless the jobs.runHooks option is set to true. Setting this option to true will negatively impact performance.`);
break;
}
}
}
}
const sanitizedJobsCollection = await sanitizeCollection(config, defaultJobsCollection, richTextSanitizationPromises, validRelationships);
(config.collections ??= []).push(sanitizedJobsCollection);
}
if (config.folders !== false && folderEnabledCollections.length) {
await addFolderCollection({
collectionSpecific: config.folders.collectionSpecific,
config: config,
folderEnabledCollections,
richTextSanitizationPromises,
validRelationships
});
}
const lockedDocumentsCollection = getLockedDocumentsCollection(config);
if (lockedDocumentsCollection) {
configWithDefaults.collections.push(await sanitizeCollection(config, lockedDocumentsCollection, richTextSanitizationPromises, validRelationships));
}
configWithDefaults.collections.push(await sanitizeCollection(config, getPreferencesCollection(config), richTextSanitizationPromises, validRelationships));
const migrations = await sanitizeCollection(config, migrationsCollection, richTextSanitizationPromises, validRelationships);
// @ts-expect-error indexSortableFields is only valid for @payloadcms/db-mongodb
if (config?.db?.indexSortableFields) {
migrations.indexes = [
{
fields: [
'batch',
'name'
],
unique: false
}
];
}
configWithDefaults.collections.push(migrations);
if (queryPresetsCollections.length > 0) {
configWithDefaults.collections.push(await sanitizeCollection(config, getQueryPresetsConfig(config), richTextSanitizationPromises, validRelationships));
}
if (config.serverURL !== '') {
config.csrf.push(config.serverURL);
}
const uploadAdapters = new Set();
// interact with all collections
for (const collection of config.collections){
// deduped upload adapters
if (collection.upload?.adapter) {
uploadAdapters.add(collection.upload.adapter);
}
}
if (!config.upload) {
config.upload = {
adapters: []
};
}
config.upload.adapters = Array.from(new Set(config.collections.map((c)=>c.upload?.adapter).filter(Boolean)));
// Pass through the email config as is so adapters don't break
if (incomingConfig.email) {
config.email = incomingConfig.email;
}
/*
Execute richText sanitization
*/ if (typeof incomingConfig.editor === 'function') {
config.editor = await incomingConfig.editor({
config: config,
isRoot: true,
parentIsLocalized: false
});
if (config.editor.i18n && Object.keys(config.editor.i18n).length >= 0) {
config.i18n.translations = deepMergeSimple(config.i18n.translations, config.editor.i18n);
}
}
const promises = [];
for (const sanitizeFunction of richTextSanitizationPromises){
promises.push(sanitizeFunction(config));
}
await Promise.all(promises);
return config;
};
//# sourceMappingURL=sanitize.js.map
@@ -0,0 +1,24 @@
import type { Active, UniqueIdentifier } from '@dnd-kit/core';
import type { Transition } from '@dnd-kit/utilities';
export declare type SortableTransition = Pick<Transition, 'easing' | 'duration'>;
export declare type AnimateLayoutChanges = (args: {
active: Active | null;
containerId: UniqueIdentifier;
isDragging: boolean;
isSorting: boolean;
id: UniqueIdentifier;
index: number;
items: UniqueIdentifier[];
previousItems: UniqueIdentifier[];
previousContainerId: UniqueIdentifier;
newIndex: number;
transition: SortableTransition | null;
wasDragging: boolean;
}) => boolean;
export interface NewIndexGetterArguments {
id: UniqueIdentifier;
items: UniqueIdentifier[];
activeIndex: number;
overIndex: number;
}
export declare type NewIndexGetter = (args: NewIndexGetterArguments) => number;
@@ -0,0 +1,6 @@
"use strict";
function _class_call_check(instance, Constructor) {
if (!(instance instanceof Constructor)) throw new TypeError("Cannot call a class as a function");
}
exports._ = _class_call_check;
@@ -0,0 +1 @@
{"version":3,"file":"arrow-down-a-z.js","sources":["../../../src/icons/arrow-down-a-z.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ArrowDownAZ\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMyAxNiA0IDQgNC00IiAvPgogIDxwYXRoIGQ9Ik03IDIwVjQiIC8+CiAgPHBhdGggZD0iTTIwIDhoLTUiIC8+CiAgPHBhdGggZD0iTTE1IDEwVjYuNWEyLjUgMi41IDAgMCAxIDUgMFYxMCIgLz4KICA8cGF0aCBkPSJNMTUgMTRoNWwtNSA2aDUiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/arrow-down-a-z\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 ArrowDownAZ = createLucideIcon('ArrowDownAZ', [\n ['path', { d: 'm3 16 4 4 4-4', key: '1co6wj' }],\n ['path', { d: 'M7 20V4', key: '1yoxec' }],\n ['path', { d: 'M20 8h-5', key: '1vsyxs' }],\n ['path', { d: 'M15 10V6.5a2.5 2.5 0 0 1 5 0V10', key: 'ag13bf' }],\n ['path', { d: 'M15 14h5l-5 6h5', key: 'ur5jdg' }],\n]);\n\nexport default ArrowDownAZ;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAc,iBAAiB,aAAe,CAAA,CAAA,CAAA;AAAA,CAAA,CAClD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAiB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC9C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAW,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,CAAmC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAChE,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmB,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;AAClD,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,127 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __export = (target, all) => {
for (var name in all)
__defProp(target, name, { get: all[name], enumerable: true });
};
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var session_exports = {};
__export(session_exports, {
PreparedQuery: () => PreparedQuery,
SingleStoreProxyTransaction: () => SingleStoreProxyTransaction,
SingleStoreRemoteSession: () => SingleStoreRemoteSession
});
module.exports = __toCommonJS(session_exports);
var import_column = require("../column.cjs");
var import_entity = require("../entity.cjs");
var import_logger = require("../logger.cjs");
var import_singlestore_core = require("../singlestore-core/index.cjs");
var import_session = require("../singlestore-core/session.cjs");
var import_sql = require("../sql/sql.cjs");
var import_utils = require("../utils.cjs");
class SingleStoreRemoteSession extends import_session.SingleStoreSession {
constructor(client, dialect, schema, options) {
super(dialect);
this.client = client;
this.schema = schema;
this.logger = options.logger ?? new import_logger.NoopLogger();
}
static [import_entity.entityKind] = "SingleStoreRemoteSession";
logger;
prepareQuery(query, fields, customResultMapper, generatedIds, returningIds) {
return new PreparedQuery(
this.client,
query.sql,
query.params,
this.logger,
fields,
customResultMapper,
generatedIds,
returningIds
);
}
all(query) {
const querySql = this.dialect.sqlToQuery(query);
this.logger.logQuery(querySql.sql, querySql.params);
return this.client(querySql.sql, querySql.params, "all").then(({ rows }) => rows);
}
async transaction(_transaction, _config) {
throw new Error("Transactions are not supported by the SingleStore Proxy driver");
}
}
class SingleStoreProxyTransaction extends import_singlestore_core.SingleStoreTransaction {
static [import_entity.entityKind] = "SingleStoreProxyTransaction";
async transaction(_transaction) {
throw new Error("Transactions are not supported by the SingleStore Proxy driver");
}
}
class PreparedQuery extends import_session.SingleStorePreparedQuery {
constructor(client, queryString, params, logger, fields, customResultMapper, generatedIds, returningIds) {
super();
this.client = client;
this.queryString = queryString;
this.params = params;
this.logger = logger;
this.fields = fields;
this.customResultMapper = customResultMapper;
this.generatedIds = generatedIds;
this.returningIds = returningIds;
}
static [import_entity.entityKind] = "SingleStoreProxyPreparedQuery";
async execute(placeholderValues = {}) {
const params = (0, import_sql.fillPlaceholders)(this.params, placeholderValues);
const { fields, client, queryString, logger, joinsNotNullableMap, customResultMapper, returningIds, generatedIds } = this;
logger.logQuery(queryString, params);
if (!fields && !customResultMapper) {
const { rows: data } = await client(queryString, params, "execute");
const insertId = data[0].insertId;
const affectedRows = data[0].affectedRows;
if (returningIds) {
const returningResponse = [];
let j = 0;
for (let i = insertId; i < insertId + affectedRows; i++) {
for (const column of returningIds) {
const key = returningIds[0].path[0];
if ((0, import_entity.is)(column.field, import_column.Column)) {
if (column.field.primary && column.field.autoIncrement) {
returningResponse.push({ [key]: i });
}
if (column.field.defaultFn && generatedIds) {
returningResponse.push({ [key]: generatedIds[j][key] });
}
}
}
j++;
}
return returningResponse;
}
return data;
}
const { rows } = await client(queryString, params, "all");
if (customResultMapper) {
return customResultMapper(rows);
}
return rows.map((row) => (0, import_utils.mapResultRow)(fields, row, joinsNotNullableMap));
}
iterator(_placeholderValues = {}) {
throw new Error("Streaming is not supported by the SingleStore Proxy driver");
}
}
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
PreparedQuery,
SingleStoreProxyTransaction,
SingleStoreRemoteSession
});
//# sourceMappingURL=session.cjs.map
@@ -0,0 +1,3 @@
import Undici from './types/index'
export default Undici
export * from './types/index'
@@ -0,0 +1 @@
{"version":3,"names":["_inherit","require","inheritInnerComments","child","parent","inherit"],"sources":["../../src/comments/inheritInnerComments.ts"],"sourcesContent":["import inherit from \"../utils/inherit.ts\";\nimport type * as t from \"../index.ts\";\n\nexport default function inheritInnerComments(\n child: t.Node,\n parent: t.Node,\n): void {\n inherit(\"innerComments\", child, parent);\n}\n"],"mappings":";;;;;;AAAA,IAAAA,QAAA,GAAAC,OAAA;AAGe,SAASC,oBAAoBA,CAC1CC,KAAa,EACbC,MAAc,EACR;EACN,IAAAC,gBAAO,EAAC,eAAe,EAAEF,KAAK,EAAEC,MAAM,CAAC;AACzC","ignoreList":[]}
@@ -0,0 +1,27 @@
import type { ContextOptions, DateArg } from "./types.js";
/**
* The {@link isTuesday} function options.
*/
export interface IsTuesdayOptions extends ContextOptions<Date> {}
/**
* @name isTuesday
* @category Weekday Helpers
* @summary Is the given date Tuesday?
*
* @description
* Is the given date Tuesday?
*
* @param date - The date to check
* @param options - An object with options
*
* @returns The date is Tuesday
*
* @example
* // Is 23 September 2014 Tuesday?
* const result = isTuesday(new Date(2014, 8, 23))
* //=> true
*/
export declare function isTuesday(
date: DateArg<Date> & {},
options?: IsTuesdayOptions | undefined,
): boolean;
@@ -0,0 +1,8 @@
import { _ as _class_apply_descriptor_destructure } from "./_class_apply_descriptor_destructure.js";
import { _ as _class_extract_field_descriptor } from "./_class_extract_field_descriptor.js";
function _class_private_field_destructure(receiver, privateMap) {
var descriptor = _class_extract_field_descriptor(receiver, privateMap, "set");
return _class_apply_descriptor_destructure(receiver, descriptor);
}
export { _class_private_field_destructure as _ };
@@ -0,0 +1 @@
{"version":3,"file":"policies.js","names":[],"sources":["../../../../src/rest/commands/delete/policies.ts"],"sourcesContent":["import type { DirectusPolicy } from '../../../schema/policy.js';\nimport type { RestCommand } from '../../types.js';\nimport { throwIfEmpty } from '../../utils/index.js';\n\n/**\n * Delete multiple existing policies\n * @param keys\n * @returns\n * @throws Will throw if keys is empty\n */\nexport const deletePolicies =\n\t<Schema>(keys: DirectusPolicy<Schema>['id'][]): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(keys, 'Keys cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/policies`,\n\t\t\tbody: JSON.stringify(keys),\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n\n/**\n * Delete an existing policy\n * @param key\n * @returns\n * @throws Will throw if key is empty\n */\nexport const deletePolicy =\n\t<Schema>(key: DirectusPolicy<Schema>['id']): RestCommand<void, Schema> =>\n\t() => {\n\t\tthrowIfEmpty(String(key), 'Key cannot be empty');\n\n\t\treturn {\n\t\t\tpath: `/policies/${key}`,\n\t\t\tmethod: 'DELETE',\n\t\t};\n\t};\n"],"mappings":"6DAUA,MAAa,EACH,QAER,EAAa,EAAM,uBAAuB,CAEnC,CACN,KAAM,YACN,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,SACR,EASU,EACH,QAER,EAAa,OAAO,EAAI,CAAE,sBAAsB,CAEzC,CACN,KAAM,aAAa,IACnB,OAAQ,SACR"}
@@ -0,0 +1,60 @@
import type { Connection, FullResult, Tx } from '@tidbcloud/serverless';
import { type Cache } from "../cache/core/index.js";
import type { WithCacheConfig } from "../cache/core/types.js";
import { entityKind } from "../entity.js";
import type { Logger } from "../logger.js";
import type { MySqlDialect } from "../mysql-core/dialect.js";
import type { SelectedFieldsOrdered } from "../mysql-core/query-builders/select.types.js";
import { MySqlPreparedQuery, type MySqlPreparedQueryConfig, type MySqlPreparedQueryHKT, type MySqlQueryResultHKT, MySqlSession, MySqlTransaction } from "../mysql-core/session.js";
import type { RelationalSchemaConfig, TablesRelationalConfig } from "../relations.js";
import { type Query, type SQL } from "../sql/sql.js";
import { type Assume } from "../utils.js";
export declare class TiDBServerlessPreparedQuery<T extends MySqlPreparedQueryConfig> extends MySqlPreparedQuery<T> {
private client;
private queryString;
private params;
private logger;
private fields;
private customResultMapper?;
private generatedIds?;
private returningIds?;
static readonly [entityKind]: string;
constructor(client: Tx | Connection, queryString: string, params: unknown[], logger: Logger, cache: Cache, queryMetadata: {
type: 'select' | 'update' | 'delete' | 'insert';
tables: string[];
} | undefined, cacheConfig: WithCacheConfig | undefined, fields: SelectedFieldsOrdered | undefined, customResultMapper?: ((rows: unknown[][]) => T["execute"]) | undefined, generatedIds?: Record<string, unknown>[] | undefined, returningIds?: SelectedFieldsOrdered | undefined);
execute(placeholderValues?: Record<string, unknown> | undefined): Promise<T['execute']>;
iterator(_placeholderValues?: Record<string, unknown>): AsyncGenerator<T['iterator']>;
}
export interface TiDBServerlessSessionOptions {
logger?: Logger;
cache?: Cache;
}
export declare class TiDBServerlessSession<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends MySqlSession<TiDBServerlessQueryResultHKT, TiDBServerlessPreparedQueryHKT, TFullSchema, TSchema> {
private baseClient;
private schema;
private options;
static readonly [entityKind]: string;
private logger;
private client;
private cache;
constructor(baseClient: Connection, dialect: MySqlDialect, tx: Tx | undefined, schema: RelationalSchemaConfig<TSchema> | undefined, options?: TiDBServerlessSessionOptions);
prepareQuery<T extends MySqlPreparedQueryConfig = MySqlPreparedQueryConfig>(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): MySqlPreparedQuery<T>;
all<T = unknown>(query: SQL): Promise<T[]>;
count(sql: SQL): Promise<number>;
transaction<T>(transaction: (tx: TiDBServerlessTransaction<TFullSchema, TSchema>) => Promise<T>): Promise<T>;
}
export declare class TiDBServerlessTransaction<TFullSchema extends Record<string, unknown>, TSchema extends TablesRelationalConfig> extends MySqlTransaction<TiDBServerlessQueryResultHKT, TiDBServerlessPreparedQueryHKT, TFullSchema, TSchema> {
static readonly [entityKind]: string;
constructor(dialect: MySqlDialect, session: MySqlSession, schema: RelationalSchemaConfig<TSchema> | undefined, nestedIndex?: number);
transaction<T>(transaction: (tx: TiDBServerlessTransaction<TFullSchema, TSchema>) => Promise<T>): Promise<T>;
}
export interface TiDBServerlessQueryResultHKT extends MySqlQueryResultHKT {
type: FullResult;
}
export interface TiDBServerlessPreparedQueryHKT extends MySqlPreparedQueryHKT {
type: TiDBServerlessPreparedQuery<Assume<this['config'], MySqlPreparedQueryConfig>>;
}
@@ -0,0 +1,9 @@
import { IPropertyListDescriptor } from '../IPropertyDescriptor';
export declare type BackgroundRepeat = BACKGROUND_REPEAT[];
export declare const enum BACKGROUND_REPEAT {
REPEAT = 0,
NO_REPEAT = 1,
REPEAT_X = 2,
REPEAT_Y = 3
}
export declare const backgroundRepeat: IPropertyListDescriptor<BackgroundRepeat>;
@@ -0,0 +1 @@
{"version":3,"file":"alarm-clock-minus.js","sources":["../../../src/icons/alarm-clock-minus.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name AlarmClockMinus\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8Y2lyY2xlIGN4PSIxMiIgY3k9IjEzIiByPSI4IiAvPgogIDxwYXRoIGQ9Ik01IDMgMiA2IiAvPgogIDxwYXRoIGQ9Im0yMiA2LTMtMyIgLz4KICA8cGF0aCBkPSJNNi4zOCAxOC43IDQgMjEiIC8+CiAgPHBhdGggZD0iTTE3LjY0IDE4LjY3IDIwIDIxIiAvPgogIDxwYXRoIGQ9Ik05IDEzaDYiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/alarm-clock-minus\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 AlarmClockMinus = createLucideIcon('AlarmClockMinus', [\n ['circle', { cx: '12', cy: '13', r: '8', key: '3y4lt7' }],\n ['path', { d: 'M5 3 2 6', key: '18tl5t' }],\n ['path', { d: 'm22 6-3-3', key: '1opdir' }],\n ['path', { d: 'M6.38 18.7 4 21', key: '17xu3x' }],\n ['path', { d: 'M17.64 18.67 20 21', key: 'kv2oe2' }],\n ['path', { d: 'M9 13h6', key: '1uhe8q' }],\n]);\n\nexport default AlarmClockMinus;\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,CAAkB,iBAAiB,iBAAmB,CAAA,CAAA,CAAA;AAAA,CAC1D,CAAA,CAAC,QAAU,CAAA,CAAA,CAAA,CAAE,EAAI,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAM,CAAI,CAAA,CAAA,CAAA,IAAA,CAAM,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,GAAK,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,EAAU,CAAA,CAAA;AAAA,CAAA,CACxD,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,CAAa,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC1C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAmB,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,CAChD,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAsB,CAAA,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,CACnD,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;AAC1C,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
exports._default = require("./react-select-animated.cjs.js").default;
@@ -0,0 +1,42 @@
var constant = require('./constant'),
createInverter = require('./_createInverter'),
identity = require('./identity');
/** Used for built-in method references. */
var objectProto = Object.prototype;
/**
* Used to resolve the
* [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)
* of values.
*/
var nativeObjectToString = objectProto.toString;
/**
* Creates an object composed of the inverted keys and values of `object`.
* If `object` contains duplicate values, subsequent values overwrite
* property assignments of previous values.
*
* @static
* @memberOf _
* @since 0.7.0
* @category Object
* @param {Object} object The object to invert.
* @returns {Object} Returns the new inverted object.
* @example
*
* var object = { 'a': 1, 'b': 2, 'c': 1 };
*
* _.invert(object);
* // => { '1': 'c', '2': 'b' }
*/
var invert = createInverter(function(result, value, key) {
if (value != null &&
typeof value.toString != 'function') {
value = nativeObjectToString.call(value);
}
result[value] = key;
}, constant(identity));
module.exports = invert;
@@ -0,0 +1 @@
!function(a){var e={pattern:/\\[\\(){}[\]^$+*?|.]/,alias:"escape"},n=/\\(?:x[\da-fA-F]{2}|u[\da-fA-F]{4}|u\{[\da-fA-F]+\}|0[0-7]{0,2}|[123][0-7]{2}|c[a-zA-Z]|.)/,t="(?:[^\\\\-]|"+n.source+")",s=RegExp(t+"-"+t),i={pattern:/(<|')[^<>']+(?=[>']$)/,lookbehind:!0,alias:"variable"};a.languages.regex={"char-class":{pattern:/((?:^|[^\\])(?:\\\\)*)\[(?:[^\\\]]|\\[\s\S])*\]/,lookbehind:!0,inside:{"char-class-negation":{pattern:/(^\[)\^/,lookbehind:!0,alias:"operator"},"char-class-punctuation":{pattern:/^\[|\]$/,alias:"punctuation"},range:{pattern:s,inside:{escape:n,"range-punctuation":{pattern:/-/,alias:"operator"}}},"special-escape":e,"char-set":{pattern:/\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},escape:n}},"special-escape":e,"char-set":{pattern:/\.|\\[wsd]|\\p\{[^{}]+\}/i,alias:"class-name"},backreference:[{pattern:/\\(?![123][0-7]{2})[1-9]/,alias:"keyword"},{pattern:/\\k<[^<>']+>/,alias:"keyword",inside:{"group-name":i}}],anchor:{pattern:/[$^]|\\[ABbGZz]/,alias:"function"},escape:n,group:[{pattern:/\((?:\?(?:<[^<>']+>|'[^<>']+'|[>:]|<?[=!]|[idmnsuxU]+(?:-[idmnsuxU]+)?:?))?/,alias:"punctuation",inside:{"group-name":i}},{pattern:/\)/,alias:"punctuation"}],quantifier:{pattern:/(?:[+*?]|\{\d+(?:,\d*)?\})[?+]?/,alias:"number"},alternation:{pattern:/\|/,alias:"keyword"}}}(Prism);
@@ -0,0 +1,23 @@
import type { Maybe } from '../jsutils/Maybe';
import type { ObjMap } from '../jsutils/ObjMap';
import type { ValueNode } from '../language/ast';
/**
* Produces a JavaScript value given a GraphQL Value AST.
*
* Unlike `valueFromAST()`, no type is provided. The resulting JavaScript value
* will reflect the provided GraphQL value AST.
*
* | GraphQL Value | JavaScript Value |
* | -------------------- | ---------------- |
* | Input Object | Object |
* | List | Array |
* | Boolean | Boolean |
* | String / Enum | String |
* | Int / Float | Number |
* | Null | null |
*
*/
export declare function valueFromASTUntyped(
valueNode: ValueNode,
variables?: Maybe<ObjMap<unknown>>,
): unknown;
@@ -0,0 +1,67 @@
# parent-module [![Build Status](https://travis-ci.org/sindresorhus/parent-module.svg?branch=master)](https://travis-ci.org/sindresorhus/parent-module)
> Get the path of the parent module
Node.js exposes `module.parent`, but it only gives you the first cached parent, which is not necessarily the actual parent.
## Install
```
$ npm install parent-module
```
## Usage
```js
// bar.js
const parentModule = require('parent-module');
module.exports = () => {
console.log(parentModule());
//=> '/Users/sindresorhus/dev/unicorn/foo.js'
};
```
```js
// foo.js
const bar = require('./bar');
bar();
```
## API
### parentModule([filepath])
By default, it will return the path of the immediate parent.
#### filepath
Type: `string`<br>
Default: [`__filename`](https://nodejs.org/api/globals.html#globals_filename)
Filepath of the module of which to get the parent path.
Useful if you want it to work [multiple module levels down](https://github.com/sindresorhus/parent-module/tree/master/fixtures/filepath).
## Tip
Combine it with [`read-pkg-up`](https://github.com/sindresorhus/read-pkg-up) to read the package.json of the parent module.
```js
const path = require('path');
const readPkgUp = require('read-pkg-up');
const parentModule = require('parent-module');
console.log(readPkgUp.sync({cwd: path.dirname(parentModule())}).pkg);
//=> {name: 'chalk', version: '1.0.0', …}
```
## License
MIT © [Sindre Sorhus](https://sindresorhus.com)
@@ -0,0 +1,9 @@
import type { PayloadComponent } from '../../../config/types.js';
import type { ImportMap } from '../index.js';
export declare const getFromImportMap: <TOutput>(args: {
importMap: ImportMap;
PayloadComponent: PayloadComponent;
schemaPath?: string;
silent?: boolean;
}) => TOutput;
//# sourceMappingURL=getFromImportMap.d.ts.map
@@ -0,0 +1,22 @@
export type Replacer = (number | string)[] | null | undefined | ((key: string, value: unknown) => string | number | boolean | null | object)
export function stringify(value: undefined | symbol | ((...args: unknown[]) => unknown), replacer?: Replacer, space?: string | number): undefined
export function stringify(value: string | number | unknown[] | null | boolean | object, replacer?: Replacer, space?: string | number): string
export function stringify(value: unknown, replacer?: ((key: string, value: unknown) => unknown) | (number | string)[] | null | undefined, space?: string | number): string | undefined
export interface StringifyOptions {
bigint?: boolean,
circularValue?: string | null | TypeErrorConstructor | ErrorConstructor,
deterministic?: boolean | ((a: string, b: string) => number),
maximumBreadth?: number,
maximumDepth?: number,
strict?: boolean,
}
export namespace stringify {
export function configure(options: StringifyOptions): typeof stringify
}
export function configure(options: StringifyOptions): typeof stringify
export default stringify
@@ -0,0 +1,43 @@
"use strict";
exports.Hour1to12Parser = void 0;
var _constants = require("../constants.cjs");
var _Parser = require("../Parser.cjs");
var _utils = require("../utils.cjs");
class Hour1to12Parser extends _Parser.Parser {
priority = 70;
parse(dateString, token, match) {
switch (token) {
case "h":
return (0, _utils.parseNumericPattern)(
_constants.numericPatterns.hour12h,
dateString,
);
case "ho":
return match.ordinalNumber(dateString, { unit: "hour" });
default:
return (0, _utils.parseNDigits)(token.length, dateString);
}
}
validate(_date, value) {
return value >= 1 && value <= 12;
}
set(date, _flags, value) {
const isPM = date.getHours() >= 12;
if (isPM && value < 12) {
date.setHours(value + 12, 0, 0, 0);
} else if (!isPM && value === 12) {
date.setHours(0, 0, 0, 0);
} else {
date.setHours(value, 0, 0, 0);
}
return date;
}
incompatibleTokens = ["H", "K", "k", "t", "T"];
}
exports.Hour1to12Parser = Hour1to12Parser;
@@ -0,0 +1 @@
export { default as createNavigation } from './navigation/react-client/createNavigation.js';
@@ -0,0 +1,10 @@
"use strict";
exports.isFriday = void 0;
var _index = require("../isFriday.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const isFriday = (exports.isFriday = (0, _index2.convertToFP)(
_index.isFriday,
1,
));
@@ -0,0 +1 @@
module.exports={A:{A:{"1":"F A B","132":"K D E zC"},B:{"1":"0 1 2 3 4 5 6 7 8 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","260":"C L"},C:{"1":"0 1 2 3 4 5 6 7 8 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 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","4":"0C VC 4C 5C"},D:{"1":"0 1 2 3 4 5 6 7 8 9 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 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","4":"J"},E:{"1":"bB K D E F A B C L M G 7C 8C 9C AD cC PC QC BD CD DD dC eC RC ED SC fC gC hC iC jC FD TC kC lC mC nC oC GD UC pC qC rC sC HD tC uC vC wC ID","4":"J 6C bC"},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","260":"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 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","2":"VC J nD oD pD qD yC rD sD"},J:{"2":"D","16":"A"},K:{"1":"H","2":"A B C PC xC QC"},L:{"1":"I"},M:{"2":"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:{"2":"6D 7D"}},B:2,C:"CSS3 Cursors (original values)",D:true};
@@ -0,0 +1,26 @@
"use strict";
exports.nextWednesday = nextWednesday;
var _index = require("./nextDay.js");
/**
* @name nextWednesday
* @category Weekday Helpers
* @summary When is the next Wednesday?
*
* @description
* When is the next Wednesday?
*
* @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 next Wednesday
*
* @example
* // When is the next Wednesday after Mar, 22, 2020?
* const result = nextWednesday(new Date(2020, 2, 22))
* //=> Wed Mar 25 2020 00:00:00
*/
function nextWednesday(date) {
return (0, _index.nextDay)(date, 3);
}
@@ -0,0 +1,9 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { closestTo as fn } from "../closestTo.js";
import { convertToFP } from "./_lib/convertToFP.js";
export const closestTo = convertToFP(fn, 2);
// Fallback for modularized imports:
export default closestTo;
@@ -0,0 +1,199 @@
/// <reference types="node" />
import { IncomingHttpHeaders } from "http";
import { Readable, Writable } from "stream";
declare namespace busboy {
interface Limits {
/**
* Max field name size (in bytes).
*
* @default 100
*/
fieldNameSize?: number | undefined;
/**
* Max field value size (in bytes).
*
* @default 1048576 (1MB)
*/
fieldSize?: number | undefined;
/**
* Max number of non-file fields.
*
* @default Infinity
*/
fields?: number | undefined;
/**
* For multipart forms, the max file size (in bytes).
*
* @default Infinity
*/
fileSize?: number | undefined;
/**
* For multipart forms, the max number of file fields.
*
* @default Infinity
*/
files?: number | undefined;
/**
* For multipart forms, the max number of parts (fields + files).
*
* @default Infinity
*/
parts?: number | undefined;
/**
* For multipart forms, the max number of header key-value pairs to parse.
*
* @default 2000 (same as node's http module)
*/
headerPairs?: number | undefined;
}
interface BusboyConfig {
/**
* These are the HTTP headers of the incoming request, which are used by individual parsers.
*/
headers?: IncomingHttpHeaders | undefined;
/**
* 'highWaterMark' to use for the parser stream
*
* @default stream.Writable
*/
highWaterMark?: number | undefined;
/**
* 'highWaterMark' to use for individual file streams
*
* @default stream.Readable
*/
fileHwm?: number | undefined;
/**
* Default character set to use when one isn't defined.
*
* @default 'utf8'
*/
defCharset?: string | undefined;
/**
* For multipart forms, the default character set to use for values of part header parameters (e.g. filename)
* that are not extended parameters (that contain an explicit charset
*
* @default 'latin1'
*/
defParamCharset?: string | undefined;
/**
* If paths in filenames from file parts in a 'multipart/form-data' request shall be preserved.
*
* @default false
*/
preservePath?: boolean | undefined;
/**
* Various limits on incoming data.
*/
limits?: Limits | undefined;
}
interface Busboy extends Writable {
addListener<Event extends keyof BusboyEvents>(event: Event, listener: BusboyEvents[Event]): this;
addListener(event: string | symbol, listener: (...args: any[]) => void): this;
on<Event extends keyof BusboyEvents>(event: Event, listener: BusboyEvents[Event]): this;
on(event: string | symbol, listener: (...args: any[]) => void): this;
once<Event extends keyof BusboyEvents>(event: Event, listener: BusboyEvents[Event]): this;
once(event: string | symbol, listener: (...args: any[]) => void): this;
removeListener<Event extends keyof BusboyEvents>(event: Event, listener: BusboyEvents[Event]): this;
removeListener(event: string | symbol, listener: (...args: any[]) => void): this;
off<Event extends keyof BusboyEvents>(event: Event, listener: BusboyEvents[Event]): this;
off(event: string | symbol, listener: (...args: any[]) => void): this;
prependListener<Event extends keyof BusboyEvents>(event: Event, listener: BusboyEvents[Event]): this;
prependListener(event: string | symbol, listener: (...args: any[]) => void): this;
prependOnceListener<Event extends keyof BusboyEvents>(event: Event, listener: BusboyEvents[Event]): this;
prependOnceListener(event: string | symbol, listener: (...args: any[]) => void): this;
}
interface Info {
encoding: string;
mimeType: string;
}
interface FileInfo extends Info {
filename: string;
}
interface FieldInfo extends Info {
nameTruncated: boolean;
valueTruncated: boolean;
}
interface BusboyEvents {
/**
* Emitted for each new file form field found.
*
* * Note: if you listen for this event, you should always handle the `stream` no matter if you care about the
* file contents or not (e.g. you can simply just do `stream.resume();` if you want to discard the contents),
* otherwise the 'finish' event will never fire on the Busboy instance. However, if you don't care about **any**
* incoming files, you can simply not listen for the 'file' event at all and any/all files will be automatically
* and safely discarded (these discarded files do still count towards `files` and `parts` limits).
* * If a configured file size limit was reached, `stream` will both have a boolean property `truncated`
* (best checked at the end of the stream) and emit a 'limit' event to notify you when this happens.
*
* @param listener.transferEncoding Contains the 'Content-Transfer-Encoding' value for the file stream.
* @param listener.mimeType Contains the 'Content-Type' value for the file stream.
*/
file: (name: string, stream: Readable & { truncated?: boolean }, info: FileInfo) => void;
/**
* Emitted for each new non-file field found.
*/
field: (name: string, value: string, info: FieldInfo) => void;
/**
* Emitted when specified `parts` limit has been reached. No more 'file' or 'field' events will be emitted.
*/
partsLimit: () => void;
/**
* Emitted when specified `files` limit has been reached. No more 'file' events will be emitted.
*/
filesLimit: () => void;
/**
* Emitted when specified `fields` limit has been reached. No more 'field' events will be emitted.
*/
fieldsLimit: () => void;
error: (error: unknown) => void;
/**
* @deprecated
* @since 1.0
*/
finish: () => void;
/**
* Use 'close' event instead of 'finish' event when you need to execute
*
* @since 1.0
*/
close: () => void;
}
}
declare function busboy(config: busboy.BusboyConfig): busboy.Busboy;
export = busboy;
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/uploads/getImageSize.ts"],"sourcesContent":["import fs from 'fs/promises'\nimport { imageSize } from 'image-size'\nimport { imageSizeFromFile } from 'image-size/fromFile'\n\nimport type { PayloadRequest } from '../types/index.js'\nimport type { ProbedImageSize } from './types.js'\n\nimport { temporaryFileTask } from './tempFile.js'\n\nexport async function getImageSize(file: PayloadRequest['file']): Promise<ProbedImageSize> {\n if (file?.tempFilePath) {\n return imageSizeFromFile(file.tempFilePath)\n }\n\n // Tiff file do not support buffers or streams, so we must write to file first\n // then retrieve dimensions. https://github.com/image-size/image-size/issues/103\n if (file?.mimetype === 'image/tiff') {\n const dimensions = await temporaryFileTask(\n async (filepath: string) => {\n await fs.writeFile(filepath, file.data)\n return imageSizeFromFile(filepath)\n },\n { extension: 'tiff' },\n )\n return dimensions\n }\n\n return imageSize(file!.data)\n}\n"],"names":["fs","imageSize","imageSizeFromFile","temporaryFileTask","getImageSize","file","tempFilePath","mimetype","dimensions","filepath","writeFile","data","extension"],"mappings":"AAAA,OAAOA,QAAQ,cAAa;AAC5B,SAASC,SAAS,QAAQ,aAAY;AACtC,SAASC,iBAAiB,QAAQ,sBAAqB;AAKvD,SAASC,iBAAiB,QAAQ,gBAAe;AAEjD,OAAO,eAAeC,aAAaC,IAA4B;IAC7D,IAAIA,MAAMC,cAAc;QACtB,OAAOJ,kBAAkBG,KAAKC,YAAY;IAC5C;IAEA,8EAA8E;IAC9E,gFAAgF;IAChF,IAAID,MAAME,aAAa,cAAc;QACnC,MAAMC,aAAa,MAAML,kBACvB,OAAOM;YACL,MAAMT,GAAGU,SAAS,CAACD,UAAUJ,KAAKM,IAAI;YACtC,OAAOT,kBAAkBO;QAC3B,GACA;YAAEG,WAAW;QAAO;QAEtB,OAAOJ;IACT;IAEA,OAAOP,UAAUI,KAAMM,IAAI;AAC7B"}
@@ -0,0 +1,3 @@
'use strict';
module.exports = require('./async').omitLimit;
@@ -0,0 +1,12 @@
/*!
* mime-db
* Copyright(c) 2014 Jonathan Ong
* Copyright(c) 2015-2022 Douglas Christopher Wilson
* MIT Licensed
*/
/**
* Module exports.
*/
module.exports = require('./db.json')
@@ -0,0 +1,134 @@
"use strict";
exports.match = void 0;
var _index = require("../../_lib/buildMatchFn.js");
var _index2 = require("../../_lib/buildMatchPatternFn.js");
const matchOrdinalNumberPattern = /^(\d+)\.?/i;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,
abbreviated: /^(f\.? ?Kr\.?|fvt\.?|e\.? ?Kr\.?|evt\.?)/i,
wide: /^(før Kristus|før vår tid|etter Kristus|vår tid)/i,
};
const parseEraPatterns = {
any: [/^f/i, /^e/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](\.)? kvartal/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated: /^(jan|feb|mars?|apr|mai|juni?|juli?|aug|sep|okt|nov|des)\.?/i,
wide: /^(januar|februar|mars|april|mai|juni|juli|august|september|oktober|november|desember)/i,
};
const 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,
/^mai/i,
/^jun/i,
/^jul/i,
/^aug/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
};
const matchDayPatterns = {
narrow: /^[smtofl]/i,
short: /^(su|må|ty|on|to|fr|la)/i,
abbreviated: /^(sun|mån|tys|ons|tor|fre|laur)/i,
wide: /^(sundag|måndag|tysdag|onsdag|torsdag|fredag|laurdag)/i,
};
const parseDayPatterns = {
any: [/^s/i, /^m/i, /^ty/i, /^o/i, /^to/i, /^f/i, /^l/i],
};
const matchDayPeriodPatterns = {
narrow: /^(midnatt|middag|(på) (morgonen|ettermiddagen|kvelden|natta)|[ap])/i,
any: /^([ap]\.?\s?m\.?|midnatt|middag|(på) (morgonen|ettermiddagen|kvelden|natta))/i,
};
const parseDayPeriodPatterns = {
any: {
am: /^a(\.?\s?m\.?)?$/i,
pm: /^p(\.?\s?m\.?)?$/i,
midnight: /^midn/i,
noon: /^midd/i,
morning: /morgon/i,
afternoon: /ettermiddag/i,
evening: /kveld/i,
night: /natt/i,
},
};
const match = (exports.match = {
ordinalNumber: (0, _index2.buildMatchPatternFn)({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: (value) => parseInt(value, 10),
}),
era: (0, _index.buildMatchFn)({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: (0, _index.buildMatchFn)({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: (0, _index.buildMatchFn)({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: (0, _index.buildMatchFn)({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: (0, _index.buildMatchFn)({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
});
@@ -0,0 +1,49 @@
import type {ErrorObject, Vocabulary} from "../../types"
import limitNumber, {LimitNumberError} from "./limitNumber"
import multipleOf, {MultipleOfError} from "./multipleOf"
import limitLength from "./limitLength"
import pattern, {PatternError} from "./pattern"
import limitProperties from "./limitProperties"
import required, {RequiredError} from "./required"
import limitItems from "./limitItems"
import uniqueItems, {UniqueItemsError} from "./uniqueItems"
import constKeyword, {ConstError} from "./const"
import enumKeyword, {EnumError} from "./enum"
const validation: Vocabulary = [
// number
limitNumber,
multipleOf,
// string
limitLength,
pattern,
// object
limitProperties,
required,
// array
limitItems,
uniqueItems,
// any
{keyword: "type", schemaType: ["string", "array"]},
{keyword: "nullable", schemaType: "boolean"},
constKeyword,
enumKeyword,
]
export default validation
type LimitError = ErrorObject<
"maxItems" | "minItems" | "minProperties" | "maxProperties" | "minLength" | "maxLength",
{limit: number},
number | {$data: string}
>
export type ValidationKeywordError =
| LimitError
| LimitNumberError
| MultipleOfError
| PatternError
| RequiredError
| UniqueItemsError
| ConstError
| EnumError
@@ -0,0 +1,11 @@
import validate from './validate.js';
function version(uuid) {
if (!validate(uuid)) {
throw TypeError('Invalid UUID');
}
return parseInt(uuid.slice(14, 15), 16);
}
export default version;
@@ -0,0 +1,61 @@
import { toDate } from "./toDate.js";
/**
* The {@link parseJSON} function options.
*/
/**
* Converts a complete ISO date string in UTC time, the typical format for transmitting
* a date in JSON, to a JavaScript `Date` instance.
*
* This is a minimal implementation for converting dates retrieved from a JSON API to
* a `Date` instance which can be used with other functions in the `date-fns` library.
* The following formats are supported:
*
* - `2000-03-15T05:20:10.123Z`: The output of `.toISOString()` and `JSON.stringify(new Date())`
* - `2000-03-15T05:20:10Z`: Without milliseconds
* - `2000-03-15T05:20:10+00:00`: With a zero offset, the default JSON encoded format in some other languages
* - `2000-03-15T05:20:10+05:45`: With a positive or negative offset, the default JSON encoded format in some other languages
* - `2000-03-15T05:20:10+0000`: With a zero offset without a colon
* - `2000-03-15T05:20:10`: Without a trailing 'Z' symbol
* - `2000-03-15T05:20:10.1234567`: Up to 7 digits in milliseconds field. Only first 3 are taken into account since JS does not allow fractional milliseconds
* - `2000-03-15 05:20:10`: With a space instead of a 'T' separator for APIs returning a SQL date without reformatting
*
* For convenience and ease of use these other input types are also supported
* via [toDate](https://date-fns.org/docs/toDate):
*
* - A `Date` instance will be cloned
* - A `number` will be treated as a timestamp
*
* Any other input type or invalid date strings will return an `Invalid Date`.
*
* @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 dateStr - A fully formed ISO8601 date string to convert
* @param options - An object with options
*
* @returns The parsed date in the local time zone
*/
export function parseJSON(dateStr, options) {
const parts = dateStr.match(
/(\d{4})-(\d{2})-(\d{2})[T ](\d{2}):(\d{2}):(\d{2})(?:\.(\d{0,7}))?(?:Z|(.)(\d{2}):?(\d{2})?)?/,
);
if (!parts) return toDate(NaN, options?.in);
return toDate(
Date.UTC(
+parts[1],
+parts[2] - 1,
+parts[3],
+parts[4] - (+parts[9] || 0) * (parts[8] == "-" ? -1 : 1),
+parts[5] - (+parts[10] || 0) * (parts[8] == "-" ? -1 : 1),
+parts[6],
+((parts[7] || "0") + "00").substring(0, 3),
),
options?.in,
);
}
// Fallback for modularized imports:
export default parseJSON;
@@ -0,0 +1 @@
{"version":3,"file":"lazyLoadIntegration.d.ts","sourceRoot":"","sources":["../../../../src/utils/lazyLoadIntegration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,cAAc,CAAC;AAMlD,QAAA,MAAM,wBAAwB;;;;;;;;;;;;;;;;;;;;;;CAsBpB,CAAC;AAMX;;;GAGG;AACH,wBAAsB,mBAAmB,CACvC,IAAI,EAAE,MAAM,OAAO,wBAAwB,EAC3C,WAAW,CAAC,EAAE,MAAM,GACnB,OAAO,CAAC,aAAa,CAAC,CAwDxB"}
@@ -0,0 +1 @@
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../lib/refs/json-schema-2019-09/index.ts"],"names":[],"mappings":";;AAEA,4CAA2C;AAC3C,qDAAoD;AACpD,+CAA8C;AAC9C,yCAAwC;AACxC,6CAA4C;AAC5C,kDAAiD;AACjD,qDAAoD;AAEpD,MAAM,iBAAiB,GAAG,CAAC,aAAa,CAAC,CAAA;AAEzC,SAAwB,iBAAiB,CAAY,KAAe;IAClE,CAAC;IAAA;QACC,UAAU;QACV,UAAU;QACV,OAAO;QACP,IAAI;QACJ,SAAS,CAAC,IAAI,EAAE,MAAM,CAAC;QACvB,QAAQ;QACR,SAAS,CAAC,IAAI,EAAE,UAAU,CAAC;KAC5B,CAAC,OAAO,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,GAAG,EAAE,SAAS,EAAE,KAAK,CAAC,CAAC,CAAA;IAC7D,OAAO,IAAI,CAAA;IAEX,SAAS,SAAS,CAAC,GAAQ,EAAE,GAAoB;QAC/C,OAAO,KAAK,CAAC,CAAC,CAAC,GAAG,CAAC,eAAe,CAAC,GAAG,EAAE,iBAAiB,CAAC,CAAC,CAAC,CAAC,GAAG,CAAA;IAClE,CAAC;AACH,CAAC;AAfD,oCAeC"}
@@ -0,0 +1,43 @@
import { MongooseInstrumentation } from '@opentelemetry/instrumentation-mongoose';
import { defineIntegration } from '@sentry/core';
import { generateInstrumentOnce, addOriginToSpan } from '@sentry/node-core';
const INTEGRATION_NAME = 'Mongoose';
const instrumentMongoose = generateInstrumentOnce(
INTEGRATION_NAME,
() =>
new MongooseInstrumentation({
responseHook(span) {
addOriginToSpan(span, 'auto.db.otel.mongoose');
},
}),
);
const _mongooseIntegration = (() => {
return {
name: INTEGRATION_NAME,
setupOnce() {
instrumentMongoose();
},
};
}) ;
/**
* Adds Sentry tracing instrumentation for the [mongoose](https://www.npmjs.com/package/mongoose) library.
*
* For more information, see the [`mongooseIntegration` documentation](https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/mongoose/).
*
* @example
* ```javascript
* const Sentry = require('@sentry/node');
*
* Sentry.init({
* integrations: [Sentry.mongooseIntegration()],
* });
* ```
*/
const mongooseIntegration = defineIntegration(_mongooseIntegration);
export { instrumentMongoose, mongooseIntegration };
//# sourceMappingURL=mongoose.js.map
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/postgres-js/migrator.ts"],"sourcesContent":["import type { MigrationConfig } from '~/migrator.ts';\nimport { readMigrationFiles } from '~/migrator.ts';\nimport type { PostgresJsDatabase } from './driver.ts';\n\nexport async function migrate<TSchema extends Record<string, unknown>>(\n\tdb: PostgresJsDatabase<TSchema>,\n\tconfig: MigrationConfig,\n) {\n\tconst migrations = readMigrationFiles(config);\n\tawait db.dialect.migrate(migrations, db.session, config);\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AACA,sBAAmC;AAGnC,eAAsB,QACrB,IACA,QACC;AACD,QAAM,iBAAa,oCAAmB,MAAM;AAC5C,QAAM,GAAG,QAAQ,QAAQ,YAAY,GAAG,SAAS,MAAM;AACxD;","names":[]}
@@ -0,0 +1,30 @@
import { promise } from './promise.js';
export const traverseFields = async ({ blockData, collection, context, data, doc, fields, global, operation, parentIndexPath, parentIsLocalized, parentPath, parentSchemaPath, previousDoc, previousSiblingDoc, req, siblingData, siblingDoc, siblingFields })=>{
const promises = [];
fields.forEach((field, fieldIndex)=>{
promises.push(promise({
blockData,
collection,
context,
data,
doc,
field,
fieldIndex,
global,
operation,
parentIndexPath,
parentIsLocalized: parentIsLocalized,
parentPath,
parentSchemaPath,
previousDoc,
previousSiblingDoc,
req,
siblingData,
siblingDoc,
siblingFields
}));
});
await Promise.all(promises);
};
//# sourceMappingURL=traverseFields.js.map
@@ -0,0 +1 @@
{"version":3,"file":"Pagination.js","names":["c","_c","React","useListQuery","Pagination","RelationshipTablePagination","$","data","handlePageChange","t0","nextPage","t1","e","t2","page","t3","prevPage","undefined","t4","hasNextPage","hasPrevPage","limit","totalPages","_jsx","numberOfNeighbors","onChange"],"sources":["../../../src/elements/RelationshipTable/Pagination.tsx"],"sourcesContent":["'use client'\n\nimport React from 'react'\n\nimport { useListQuery } from '../../providers/ListQuery/index.js'\nimport { Pagination } from '../Pagination/index.js'\n\nexport const RelationshipTablePagination: React.FC = () => {\n const { data, handlePageChange } = useListQuery()\n\n return (\n <Pagination\n hasNextPage={data.hasNextPage}\n hasPrevPage={data.hasPrevPage}\n limit={data.limit}\n nextPage={data.nextPage || 2}\n numberOfNeighbors={1}\n onChange={(e) => {\n void handlePageChange(e)\n }}\n page={data.page || 1}\n prevPage={data.prevPage || undefined}\n totalPages={data.totalPages}\n />\n )\n}\n"],"mappings":"AAAA;;AAAA,SAAAA,CAAA,IAAAC,EAAA;;AAEA,OAAOC,KAAA,MAAW;AAElB,SAASC,YAAY,QAAQ;AAC7B,SAASC,UAAU,QAAQ;AAE3B,OAAO,MAAMC,2BAAA,GAAwCA,CAAA;EAAA,MAAAC,CAAA,GAAAL,EAAA;EACnD;IAAAM,IAAA;IAAAC;EAAA,IAAmCL,YAAA;EAOrB,MAAAM,EAAA,GAAAF,IAAA,CAAAG,QAAA,KAAiB;EAAA,IAAAC,EAAA;EAAA,IAAAL,CAAA,QAAAE,gBAAA;IAEjBG,EAAA,GAAAC,CAAA;MACHJ,gBAAA,CAAiBI,CAAA;IAAA;IACxBN,CAAA,MAAAE,gBAAA;IAAAF,CAAA,MAAAK,EAAA;EAAA;IAAAA,EAAA,GAAAL,CAAA;EAAA;EACM,MAAAO,EAAA,GAAAN,IAAA,CAAAO,IAAA,KAAa;EACT,MAAAC,EAAA,GAAAR,IAAA,CAAAS,QAAA,IAAAC,SAAiB;EAAA,IAAAC,EAAA;EAAA,IAAAZ,CAAA,QAAAC,IAAA,CAAAY,WAAA,IAAAb,CAAA,QAAAC,IAAA,CAAAa,WAAA,IAAAd,CAAA,QAAAC,IAAA,CAAAc,KAAA,IAAAf,CAAA,QAAAC,IAAA,CAAAe,UAAA,IAAAhB,CAAA,QAAAG,EAAA,IAAAH,CAAA,QAAAK,EAAA,IAAAL,CAAA,QAAAO,EAAA,IAAAP,CAAA,QAAAS,EAAA;IAV7BG,EAAA,GAAAK,IAAA,CAAAnB,UAAA;MAAAe,WAAA,EACeZ,IAAA,CAAAY,WAAA;MAAAC,WAAA,EACAb,IAAA,CAAAa,WAAA;MAAAC,KAAA,EACNd,IAAA,CAAAc,KAAA;MAAAX,QAAA,EACGD,EAAiB;MAAAe,iBAAA;MAAAC,QAAA,EAEjBd,EAEV;MAAAG,IAAA,EACMD,EAAa;MAAAG,QAAA,EACTD,EAAiB;MAAAO,UAAA,EACff,IAAA,CAAAe;IAAA,C;;;;;;;;;;;;;SAXdJ,E;CAcJ","ignoreList":[]}
@@ -0,0 +1,625 @@
/* eslint no-control-regex:0 */
'use strict';
const base64 = require('../base64');
const qp = require('../qp');
const mimeTypes = require('./mime-types');
module.exports = {
/**
* Checks if a value is plaintext string (uses only printable 7bit chars)
*
* @param {String} value String to be tested
* @returns {Boolean} true if it is a plaintext string
*/
isPlainText(value, isParam) {
const re = isParam ? /[\x00-\x08\x0b\x0c\x0e-\x1f"\u0080-\uFFFF]/ : /[\x00-\x08\x0b\x0c\x0e-\x1f\u0080-\uFFFF]/;
if (typeof value !== 'string' || re.test(value)) {
return false;
} else {
return true;
}
},
/**
* Checks if a multi line string containes lines longer than the selected value.
*
* Useful when detecting if a mail message needs any processing at all –
* if only plaintext characters are used and lines are short, then there is
* no need to encode the values in any way. If the value is plaintext but has
* longer lines then allowed, then use format=flowed
*
* @param {Number} lineLength Max line length to check for
* @returns {Boolean} Returns true if there is at least one line longer than lineLength chars
*/
hasLongerLines(str, lineLength) {
if (str.length > 128 * 1024) {
// do not test strings longer than 128kB
return true;
}
return new RegExp('^.{' + (lineLength + 1) + ',}', 'm').test(str);
},
/**
* Encodes a string or an Buffer to an UTF-8 MIME Word (rfc2047)
*
* @param {String|Buffer} data String to be encoded
* @param {String} mimeWordEncoding='Q' Encoding for the mime word, either Q or B
* @param {Number} [maxLength=0] If set, split mime words into several chunks if needed
* @return {String} Single or several mime words joined together
*/
encodeWord(data, mimeWordEncoding, maxLength) {
mimeWordEncoding = (mimeWordEncoding || 'Q').toString().toUpperCase().trim().charAt(0);
maxLength = maxLength || 0;
let encodedStr;
let toCharset = 'UTF-8';
if (maxLength && maxLength > 7 + toCharset.length) {
maxLength -= 7 + toCharset.length;
}
if (mimeWordEncoding === 'Q') {
// https://tools.ietf.org/html/rfc2047#section-5 rule (3)
encodedStr = qp.encode(data).replace(/[^a-z0-9!*+\-/=]/gi, chr => {
let ord = chr.charCodeAt(0).toString(16).toUpperCase();
if (chr === ' ') {
return '_';
} else {
return '=' + (ord.length === 1 ? '0' + ord : ord);
}
});
} else if (mimeWordEncoding === 'B') {
encodedStr = typeof data === 'string' ? data : base64.encode(data);
maxLength = maxLength ? Math.max(3, ((maxLength - (maxLength % 4)) / 4) * 3) : 0;
}
if (maxLength && (mimeWordEncoding !== 'B' ? encodedStr : base64.encode(data)).length > maxLength) {
if (mimeWordEncoding === 'Q') {
encodedStr = this.splitMimeEncodedString(encodedStr, maxLength).join('?= =?' + toCharset + '?' + mimeWordEncoding + '?');
} else {
// RFC2047 6.3 (2) states that encoded-word must include an integral number of characters, so no chopping unicode sequences
let parts = [];
let lpart = '';
for (let i = 0, len = encodedStr.length; i < len; i++) {
let chr = encodedStr.charAt(i);
if (/[\ud83c\ud83d\ud83e]/.test(chr) && i < len - 1) {
// composite emoji byte, so add the next byte as well
chr += encodedStr.charAt(++i);
}
// check if we can add this character to the existing string
// without breaking byte length limit
if (Buffer.byteLength(lpart + chr) <= maxLength || i === 0) {
lpart += chr;
} else {
// we hit the length limit, so push the existing string and start over
parts.push(base64.encode(lpart));
lpart = chr;
}
}
if (lpart) {
parts.push(base64.encode(lpart));
}
if (parts.length > 1) {
encodedStr = parts.join('?= =?' + toCharset + '?' + mimeWordEncoding + '?');
} else {
encodedStr = parts.join('');
}
}
} else if (mimeWordEncoding === 'B') {
encodedStr = base64.encode(data);
}
return '=?' + toCharset + '?' + mimeWordEncoding + '?' + encodedStr + (encodedStr.substr(-2) === '?=' ? '' : '?=');
},
/**
* Finds word sequences with non ascii text and converts these to mime words
*
* @param {String} value String to be encoded
* @param {String} mimeWordEncoding='Q' Encoding for the mime word, either Q or B
* @param {Number} [maxLength=0] If set, split mime words into several chunks if needed
* @param {Boolean} [encodeAll=false] If true and the value needs encoding then encodes entire string, not just the smallest match
* @return {String} String with possible mime words
*/
encodeWords(value, mimeWordEncoding, maxLength, encodeAll) {
maxLength = maxLength || 0;
let encodedValue;
// find first word with a non-printable ascii or special symbol in it
let firstMatch = value.match(/(?:^|\s)([^\s]*["\u0080-\uFFFF])/);
if (!firstMatch) {
return value;
}
if (encodeAll) {
// if it is requested to encode everything or the string contains something that resebles encoded word, then encode everything
return this.encodeWord(value, mimeWordEncoding, maxLength);
}
// find the last word with a non-printable ascii in it
let lastMatch = value.match(/(["\u0080-\uFFFF][^\s]*)[^"\u0080-\uFFFF]*$/);
if (!lastMatch) {
// should not happen
return value;
}
let startIndex =
firstMatch.index +
(
firstMatch[0].match(/[^\s]/) || {
index: 0
}
).index;
let endIndex = lastMatch.index + (lastMatch[1] || '').length;
encodedValue =
(startIndex ? value.substr(0, startIndex) : '') +
this.encodeWord(value.substring(startIndex, endIndex), mimeWordEncoding || 'Q', maxLength) +
(endIndex < value.length ? value.substr(endIndex) : '');
return encodedValue;
},
/**
* Joins parsed header value together as 'value; param1=value1; param2=value2'
* PS: We are following RFC 822 for the list of special characters that we need to keep in quotes.
* Refer: https://www.w3.org/Protocols/rfc1341/4_Content-Type.html
* @param {Object} structured Parsed header value
* @return {String} joined header value
*/
buildHeaderValue(structured) {
let paramsArray = [];
Object.keys(structured.params || {}).forEach(param => {
// filename might include unicode characters so it is a special case
// other values probably do not
let value = structured.params[param];
if (!this.isPlainText(value, true) || value.length >= 75) {
this.buildHeaderParam(param, value, 50).forEach(encodedParam => {
if (!/[\s"\\;:/=(),<>@[\]?]|^[-']|'$/.test(encodedParam.value) || encodedParam.key.substr(-1) === '*') {
paramsArray.push(encodedParam.key + '=' + encodedParam.value);
} else {
paramsArray.push(encodedParam.key + '=' + JSON.stringify(encodedParam.value));
}
});
} else if (/[\s'"\\;:/=(),<>@[\]?]|^-/.test(value)) {
paramsArray.push(param + '=' + JSON.stringify(value));
} else {
paramsArray.push(param + '=' + value);
}
});
return structured.value + (paramsArray.length ? '; ' + paramsArray.join('; ') : '');
},
/**
* Encodes a string or an Buffer to an UTF-8 Parameter Value Continuation encoding (rfc2231)
* Useful for splitting long parameter values.
*
* For example
* title="unicode string"
* becomes
* title*0*=utf-8''unicode
* title*1*=%20string
*
* @param {String|Buffer} data String to be encoded
* @param {Number} [maxLength=50] Max length for generated chunks
* @param {String} [fromCharset='UTF-8'] Source sharacter set
* @return {Array} A list of encoded keys and headers
*/
buildHeaderParam(key, data, maxLength) {
let list = [];
let encodedStr = typeof data === 'string' ? data : (data || '').toString();
let encodedStrArr;
let chr, ord;
let line;
let startPos = 0;
let i, len;
maxLength = maxLength || 50;
// process ascii only text
if (this.isPlainText(data, true)) {
// check if conversion is even needed
if (encodedStr.length <= maxLength) {
return [
{
key,
value: encodedStr
}
];
}
encodedStr = encodedStr.replace(new RegExp('.{' + maxLength + '}', 'g'), str => {
list.push({
line: str
});
return '';
});
if (encodedStr) {
list.push({
line: encodedStr
});
}
} else {
if (/[\uD800-\uDBFF]/.test(encodedStr)) {
// string containts surrogate pairs, so normalize it to an array of bytes
encodedStrArr = [];
for (i = 0, len = encodedStr.length; i < len; i++) {
chr = encodedStr.charAt(i);
ord = chr.charCodeAt(0);
if (ord >= 0xd800 && ord <= 0xdbff && i < len - 1) {
chr += encodedStr.charAt(i + 1);
encodedStrArr.push(chr);
i++;
} else {
encodedStrArr.push(chr);
}
}
encodedStr = encodedStrArr;
}
// first line includes the charset and language info and needs to be encoded
// even if it does not contain any unicode characters
line = "utf-8''";
let encoded = true;
startPos = 0;
// process text with unicode or special chars
for (i = 0, len = encodedStr.length; i < len; i++) {
chr = encodedStr[i];
if (encoded) {
chr = this.safeEncodeURIComponent(chr);
} else {
// try to urlencode current char
chr = chr === ' ' ? chr : this.safeEncodeURIComponent(chr);
// By default it is not required to encode a line, the need
// only appears when the string contains unicode or special chars
// in this case we start processing the line over and encode all chars
if (chr !== encodedStr[i]) {
// Check if it is even possible to add the encoded char to the line
// If not, there is no reason to use this line, just push it to the list
// and start a new line with the char that needs encoding
if ((this.safeEncodeURIComponent(line) + chr).length >= maxLength) {
list.push({
line,
encoded
});
line = '';
startPos = i - 1;
} else {
encoded = true;
i = startPos;
line = '';
continue;
}
}
}
// if the line is already too long, push it to the list and start a new one
if ((line + chr).length >= maxLength) {
list.push({
line,
encoded
});
line = chr = encodedStr[i] === ' ' ? ' ' : this.safeEncodeURIComponent(encodedStr[i]);
if (chr === encodedStr[i]) {
encoded = false;
startPos = i - 1;
} else {
encoded = true;
}
} else {
line += chr;
}
}
if (line) {
list.push({
line,
encoded
});
}
}
return list.map((item, i) => ({
// encoded lines: {name}*{part}*
// unencoded lines: {name}*{part}
// if any line needs to be encoded then the first line (part==0) is always encoded
key: key + '*' + i + (item.encoded ? '*' : ''),
value: item.line
}));
},
/**
* Parses a header value with key=value arguments into a structured
* object.
*
* parseHeaderValue('content-type: text/plain; CHARSET='UTF-8'') ->
* {
* 'value': 'text/plain',
* 'params': {
* 'charset': 'UTF-8'
* }
* }
*
* @param {String} str Header value
* @return {Object} Header value as a parsed structure
*/
parseHeaderValue(str) {
let response = {
value: false,
params: {}
};
let key = false;
let value = '';
let type = 'value';
let quote = false;
let escaped = false;
let chr;
for (let i = 0, len = str.length; i < len; i++) {
chr = str.charAt(i);
if (type === 'key') {
if (chr === '=') {
key = value.trim().toLowerCase();
type = 'value';
value = '';
continue;
}
value += chr;
} else {
if (escaped) {
value += chr;
} else if (chr === '\\') {
escaped = true;
continue;
} else if (quote && chr === quote) {
quote = false;
} else if (!quote && chr === '"') {
quote = chr;
} else if (!quote && chr === ';') {
if (key === false) {
response.value = value.trim();
} else {
response.params[key] = value.trim();
}
type = 'key';
value = '';
} else {
value += chr;
}
escaped = false;
}
}
if (type === 'value') {
if (key === false) {
response.value = value.trim();
} else {
response.params[key] = value.trim();
}
} else if (value.trim()) {
response.params[value.trim().toLowerCase()] = '';
}
// handle parameter value continuations
// https://tools.ietf.org/html/rfc2231#section-3
// preprocess values
Object.keys(response.params).forEach(key => {
let actualKey, nr, match, value;
if ((match = key.match(/(\*(\d+)|\*(\d+)\*|\*)$/))) {
actualKey = key.substr(0, match.index);
nr = Number(match[2] || match[3]) || 0;
if (!response.params[actualKey] || typeof response.params[actualKey] !== 'object') {
response.params[actualKey] = {
charset: false,
values: []
};
}
value = response.params[key];
if (nr === 0 && match[0].substr(-1) === '*' && (match = value.match(/^([^']*)'[^']*'(.*)$/))) {
response.params[actualKey].charset = match[1] || 'iso-8859-1';
value = match[2];
}
response.params[actualKey].values[nr] = value;
// remove the old reference
delete response.params[key];
}
});
// concatenate split rfc2231 strings and convert encoded strings to mime encoded words
Object.keys(response.params).forEach(key => {
let value;
if (response.params[key] && Array.isArray(response.params[key].values)) {
value = response.params[key].values.map(val => val || '').join('');
if (response.params[key].charset) {
// convert "%AB" to "=?charset?Q?=AB?="
response.params[key] =
'=?' +
response.params[key].charset +
'?Q?' +
value
// fix invalidly encoded chars
.replace(/[=?_\s]/g, s => {
let c = s.charCodeAt(0).toString(16);
if (s === ' ') {
return '_';
} else {
return '%' + (c.length < 2 ? '0' : '') + c;
}
})
// change from urlencoding to percent encoding
.replace(/%/g, '=') +
'?=';
} else {
response.params[key] = value;
}
}
});
return response;
},
/**
* Returns file extension for a content type string. If no suitable extensions
* are found, 'bin' is used as the default extension
*
* @param {String} mimeType Content type to be checked for
* @return {String} File extension
*/
detectExtension: mimeType => mimeTypes.detectExtension(mimeType),
/**
* Returns content type for a file extension. If no suitable content types
* are found, 'application/octet-stream' is used as the default content type
*
* @param {String} extension Extension to be checked for
* @return {String} File extension
*/
detectMimeType: extension => mimeTypes.detectMimeType(extension),
/**
* Folds long lines, useful for folding header lines (afterSpace=false) and
* flowed text (afterSpace=true)
*
* @param {String} str String to be folded
* @param {Number} [lineLength=76] Maximum length of a line
* @param {Boolean} afterSpace If true, leave a space in th end of a line
* @return {String} String with folded lines
*/
foldLines(str, lineLength, afterSpace) {
str = (str || '').toString();
lineLength = lineLength || 76;
let pos = 0,
len = str.length,
result = '',
line,
match;
while (pos < len) {
line = str.substr(pos, lineLength);
if (line.length < lineLength) {
result += line;
break;
}
if ((match = line.match(/^[^\n\r]*(\r?\n|\r)/))) {
line = match[0];
result += line;
pos += line.length;
continue;
} else if ((match = line.match(/(\s+)[^\s]*$/)) && match[0].length - (afterSpace ? (match[1] || '').length : 0) < line.length) {
line = line.substr(0, line.length - (match[0].length - (afterSpace ? (match[1] || '').length : 0)));
} else if ((match = str.substr(pos + line.length).match(/^[^\s]+(\s*)/))) {
line = line + match[0].substr(0, match[0].length - (!afterSpace ? (match[1] || '').length : 0));
}
result += line;
pos += line.length;
if (pos < len) {
result += '\r\n';
}
}
return result;
},
/**
* Splits a mime encoded string. Needed for dividing mime words into smaller chunks
*
* @param {String} str Mime encoded string to be split up
* @param {Number} maxlen Maximum length of characters for one part (minimum 12)
* @return {Array} Split string
*/
splitMimeEncodedString: (str, maxlen) => {
let curLine,
match,
chr,
done,
lines = [];
// require at least 12 symbols to fit possible 4 octet UTF-8 sequences
maxlen = Math.max(maxlen || 0, 12);
while (str.length) {
curLine = str.substr(0, maxlen);
// move incomplete escaped char back to main
if ((match = curLine.match(/[=][0-9A-F]?$/i))) {
curLine = curLine.substr(0, match.index);
}
done = false;
while (!done) {
done = true;
// check if not middle of a unicode char sequence
if ((match = str.substr(curLine.length).match(/^[=]([0-9A-F]{2})/i))) {
chr = parseInt(match[1], 16);
// invalid sequence, move one char back anc recheck
if (chr < 0xc2 && chr > 0x7f) {
curLine = curLine.substr(0, curLine.length - 3);
done = false;
}
}
}
if (curLine.length) {
lines.push(curLine);
}
str = str.substr(curLine.length);
}
return lines;
},
encodeURICharComponent: chr => {
let res = '';
let ord = chr.charCodeAt(0).toString(16).toUpperCase();
if (ord.length % 2) {
ord = '0' + ord;
}
if (ord.length > 2) {
for (let i = 0, len = ord.length / 2; i < len; i++) {
res += '%' + ord.substr(i, 2);
}
} else {
res += '%' + ord;
}
return res;
},
safeEncodeURIComponent(str) {
str = (str || '').toString();
try {
// might throw if we try to encode invalid sequences, eg. partial emoji
str = encodeURIComponent(str);
} catch (_E) {
// should never run
return str.replace(/[^\x00-\x1F *'()<>@,;:\\"[\]?=\u007F-\uFFFF]+/g, '');
}
// ensure chars that are not handled by encodeURICompent are converted as well
return str.replace(/[\x00-\x1F *'()<>@,;:\\"[\]?=\u007F-\uFFFF]/g, chr => this.encodeURICharComponent(chr));
}
};
@@ -0,0 +1,170 @@
import { hashQuery, NoopCache } from "../cache/core/cache.js";
import { entityKind, is } from "../entity.js";
import { DrizzleQueryError, TransactionRollbackError } from "../errors.js";
import { sql } from "../sql/index.js";
import { tracer } from "../tracing.js";
import { PgDatabase } from "./db.js";
class PgPreparedQuery {
constructor(query, cache, queryMetadata, cacheConfig) {
this.query = query;
this.cache = cache;
this.queryMetadata = queryMetadata;
this.cacheConfig = cacheConfig;
if (cache && cache.strategy() === "all" && cacheConfig === void 0) {
this.cacheConfig = { enable: true, autoInvalidate: true };
}
if (!this.cacheConfig?.enable) {
this.cacheConfig = void 0;
}
}
authToken;
getQuery() {
return this.query;
}
mapResult(response, _isFromBatch) {
return response;
}
/** @internal */
setToken(token) {
this.authToken = token;
return this;
}
static [entityKind] = "PgPreparedQuery";
/** @internal */
joinsNotNullableMap;
/** @internal */
async queryWithCache(queryString, params, query) {
if (this.cache === void 0 || is(this.cache, NoopCache) || this.queryMetadata === void 0) {
try {
return await query();
} catch (e) {
throw new DrizzleQueryError(queryString, params, e);
}
}
if (this.cacheConfig && !this.cacheConfig.enable) {
try {
return await query();
} catch (e) {
throw new DrizzleQueryError(queryString, params, e);
}
}
if ((this.queryMetadata.type === "insert" || this.queryMetadata.type === "update" || this.queryMetadata.type === "delete") && this.queryMetadata.tables.length > 0) {
try {
const [res] = await Promise.all([
query(),
this.cache.onMutate({ tables: this.queryMetadata.tables })
]);
return res;
} catch (e) {
throw new DrizzleQueryError(queryString, params, e);
}
}
if (!this.cacheConfig) {
try {
return await query();
} catch (e) {
throw new DrizzleQueryError(queryString, params, e);
}
}
if (this.queryMetadata.type === "select") {
const fromCache = await this.cache.get(
this.cacheConfig.tag ?? (await hashQuery(queryString, params)),
this.queryMetadata.tables,
this.cacheConfig.tag !== void 0,
this.cacheConfig.autoInvalidate
);
if (fromCache === void 0) {
let result;
try {
result = await query();
} catch (e) {
throw new DrizzleQueryError(queryString, params, e);
}
await this.cache.put(
this.cacheConfig.tag ?? (await hashQuery(queryString, params)),
result,
// make sure we send tables that were used in a query only if user wants to invalidate it on each write
this.cacheConfig.autoInvalidate ? this.queryMetadata.tables : [],
this.cacheConfig.tag !== void 0,
this.cacheConfig.config
);
return result;
}
return fromCache;
}
try {
return await query();
} catch (e) {
throw new DrizzleQueryError(queryString, params, e);
}
}
}
class PgSession {
constructor(dialect) {
this.dialect = dialect;
}
static [entityKind] = "PgSession";
/** @internal */
execute(query, token) {
return tracer.startActiveSpan("drizzle.operation", () => {
const prepared = tracer.startActiveSpan("drizzle.prepareQuery", () => {
return this.prepareQuery(
this.dialect.sqlToQuery(query),
void 0,
void 0,
false
);
});
return prepared.setToken(token).execute(void 0, token);
});
}
all(query) {
return this.prepareQuery(
this.dialect.sqlToQuery(query),
void 0,
void 0,
false
).all();
}
/** @internal */
async count(sql2, token) {
const res = await this.execute(sql2, token);
return Number(
res[0]["count"]
);
}
}
class PgTransaction extends PgDatabase {
constructor(dialect, session, schema, nestedIndex = 0) {
super(dialect, session, schema);
this.schema = schema;
this.nestedIndex = nestedIndex;
}
static [entityKind] = "PgTransaction";
rollback() {
throw new TransactionRollbackError();
}
/** @internal */
getTransactionConfigSQL(config) {
const chunks = [];
if (config.isolationLevel) {
chunks.push(`isolation level ${config.isolationLevel}`);
}
if (config.accessMode) {
chunks.push(config.accessMode);
}
if (typeof config.deferrable === "boolean") {
chunks.push(config.deferrable ? "deferrable" : "not deferrable");
}
return sql.raw(chunks.join(" "));
}
setTransaction(config) {
return this.session.execute(sql`set transaction ${this.getTransactionConfigSQL(config)}`);
}
}
export {
PgPreparedQuery,
PgSession,
PgTransaction
};
//# sourceMappingURL=session.js.map
@@ -0,0 +1,70 @@
import type {AnySchemaObject} from "./types"
import AjvCore from "./core"
import draft7Vocabularies from "./vocabularies/draft7"
import discriminator from "./vocabularies/discriminator"
import * as draft7MetaSchema from "./refs/json-schema-draft-07.json"
const META_SUPPORT_DATA = ["/properties"]
const META_SCHEMA_ID = "http://json-schema.org/draft-07/schema"
export class Ajv extends AjvCore {
_addVocabularies(): void {
super._addVocabularies()
draft7Vocabularies.forEach((v) => this.addVocabulary(v))
if (this.opts.discriminator) this.addKeyword(discriminator)
}
_addDefaultMetaSchema(): void {
super._addDefaultMetaSchema()
if (!this.opts.meta) return
const metaSchema = this.opts.$data
? this.$dataMetaSchema(draft7MetaSchema, META_SUPPORT_DATA)
: draft7MetaSchema
this.addMetaSchema(metaSchema, META_SCHEMA_ID, false)
this.refs["http://json-schema.org/schema"] = META_SCHEMA_ID
}
defaultMeta(): string | AnySchemaObject | undefined {
return (this.opts.defaultMeta =
super.defaultMeta() || (this.getSchema(META_SCHEMA_ID) ? META_SCHEMA_ID : undefined))
}
}
module.exports = exports = Ajv
module.exports.Ajv = Ajv
Object.defineProperty(exports, "__esModule", {value: true})
export default Ajv
export {
Format,
FormatDefinition,
AsyncFormatDefinition,
KeywordDefinition,
KeywordErrorDefinition,
CodeKeywordDefinition,
MacroKeywordDefinition,
FuncKeywordDefinition,
Vocabulary,
Schema,
SchemaObject,
AnySchemaObject,
AsyncSchema,
AnySchema,
ValidateFunction,
AsyncValidateFunction,
SchemaValidateFunction,
ErrorObject,
ErrorNoParams,
} from "./types"
export {Plugin, Options, CodeOptions, InstanceOptions, Logger, ErrorsTextOptions} from "./core"
export {SchemaCxt, SchemaObjCxt} from "./compile"
export {KeywordCxt} from "./compile/validate"
export {DefinedError} from "./vocabularies/errors"
export {JSONType} from "./compile/rules"
export {JSONSchemaType} from "./types/json-schema"
export {_, str, stringify, nil, Name, Code, CodeGen, CodeGenOptions} from "./compile/codegen"
export {default as ValidationError} from "./runtime/validation_error"
export {default as MissingRefError} from "./compile/ref_error"
@@ -0,0 +1,28 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.getPropertyByPath = getPropertyByPath;
// Resolves property names or property paths defined with period-delimited
// strings or arrays of strings. Property names that are found on the source
// object are used directly (even if they include a period).
// Nested property names that include periods, within a path, are only
// understood in array paths.
function getPropertyByPath(source, path) {
if (typeof path === 'string' && Object.prototype.hasOwnProperty.call(source, path)) {
return source[path];
}
const parsedPath = typeof path === 'string' ? path.split('.') : path; // eslint-disable-next-line @typescript-eslint/no-explicit-any
return parsedPath.reduce((previous, key) => {
if (previous === undefined) {
return previous;
}
return previous[key];
}, source);
}
//# sourceMappingURL=getPropertyByPath.js.map

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