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,"sources":["../../../src/transform/read/index.ts"],"sourcesContent":["import type { FlattenedField, JoinQuery, SanitizedConfig, TypeWithID } from 'payload'\n\nimport type { DrizzleAdapter } from '../../types.js'\n\nimport { createBlocksMap } from '../../utilities/createBlocksMap.js'\nimport { createPathMap } from '../../utilities/createRelationshipMap.js'\nimport { traverseFields } from './traverseFields.js'\n\ntype TransformArgs = {\n adapter: DrizzleAdapter\n config: SanitizedConfig\n data: Record<string, unknown>\n fallbackLocale?: false | string\n fields: FlattenedField[]\n joinQuery?: JoinQuery\n locale?: string\n parentIsLocalized?: boolean\n tableName: string\n}\n\n// This is the entry point to transform Drizzle output data\n// into the shape Payload expects based on field schema\nexport const transform = <T extends Record<string, unknown> | TypeWithID>({\n adapter,\n config,\n data,\n fields,\n joinQuery,\n parentIsLocalized,\n tableName,\n}: TransformArgs): T => {\n let relationships: Record<string, Record<string, unknown>[]> = {}\n let texts: Record<string, Record<string, unknown>[]> = {}\n let numbers: Record<string, Record<string, unknown>[]> = {}\n\n if ('_rels' in data) {\n relationships = createPathMap(data._rels)\n delete data._rels\n }\n\n if ('_texts' in data) {\n texts = createPathMap(data._texts)\n delete data._texts\n }\n\n if ('_numbers' in data) {\n numbers = createPathMap(data._numbers)\n delete data._numbers\n }\n\n const blocks = createBlocksMap(data)\n\n const deletions = []\n\n const result = traverseFields<T>({\n adapter,\n blocks,\n config,\n currentTableName: tableName,\n dataRef: {\n id: data.id,\n },\n deletions,\n fieldPrefix: '',\n fields,\n joinQuery,\n numbers,\n parentIsLocalized,\n path: '',\n relationships,\n table: data,\n tablePath: '',\n texts,\n topLevelTableName: tableName,\n })\n\n deletions.forEach((deletion) => deletion())\n\n return result\n}\n"],"names":["createBlocksMap","createPathMap","traverseFields","transform","adapter","config","data","fields","joinQuery","parentIsLocalized","tableName","relationships","texts","numbers","_rels","_texts","_numbers","blocks","deletions","result","currentTableName","dataRef","id","fieldPrefix","path","table","tablePath","topLevelTableName","forEach","deletion"],"mappings":"AAIA,SAASA,eAAe,QAAQ,qCAAoC;AACpE,SAASC,aAAa,QAAQ,2CAA0C;AACxE,SAASC,cAAc,QAAQ,sBAAqB;AAcpD,2DAA2D;AAC3D,uDAAuD;AACvD,OAAO,MAAMC,YAAY,CAAiD,EACxEC,OAAO,EACPC,MAAM,EACNC,IAAI,EACJC,MAAM,EACNC,SAAS,EACTC,iBAAiB,EACjBC,SAAS,EACK;IACd,IAAIC,gBAA2D,CAAC;IAChE,IAAIC,QAAmD,CAAC;IACxD,IAAIC,UAAqD,CAAC;IAE1D,IAAI,WAAWP,MAAM;QACnBK,gBAAgBV,cAAcK,KAAKQ,KAAK;QACxC,OAAOR,KAAKQ,KAAK;IACnB;IAEA,IAAI,YAAYR,MAAM;QACpBM,QAAQX,cAAcK,KAAKS,MAAM;QACjC,OAAOT,KAAKS,MAAM;IACpB;IAEA,IAAI,cAAcT,MAAM;QACtBO,UAAUZ,cAAcK,KAAKU,QAAQ;QACrC,OAAOV,KAAKU,QAAQ;IACtB;IAEA,MAAMC,SAASjB,gBAAgBM;IAE/B,MAAMY,YAAY,EAAE;IAEpB,MAAMC,SAASjB,eAAkB;QAC/BE;QACAa;QACAZ;QACAe,kBAAkBV;QAClBW,SAAS;YACPC,IAAIhB,KAAKgB,EAAE;QACb;QACAJ;QACAK,aAAa;QACbhB;QACAC;QACAK;QACAJ;QACAe,MAAM;QACNb;QACAc,OAAOnB;QACPoB,WAAW;QACXd;QACAe,mBAAmBjB;IACrB;IAEAQ,UAAUU,OAAO,CAAC,CAACC,WAAaA;IAEhC,OAAOV;AACT,EAAC"}
@@ -0,0 +1 @@
{"version":3,"file":"upload.js","sources":["../../../src/icons/upload.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Upload\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMjEgMTV2NGEyIDIgMCAwIDEtMiAySDVhMiAyIDAgMCAxLTItMnYtNCIgLz4KICA8cG9seWxpbmUgcG9pbnRzPSIxNyA4IDEyIDMgNyA4IiAvPgogIDxsaW5lIHgxPSIxMiIgeDI9IjEyIiB5MT0iMyIgeTI9IjE1IiAvPgo8L3N2Zz4K) - https://lucide.dev/icons/upload\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 Upload = createLucideIcon('Upload', [\n ['path', { d: 'M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4', key: 'ih7n3h' }],\n ['polyline', { points: '17 8 12 3 7 8', key: 't8dd8p' }],\n ['line', { x1: '12', x2: '12', y1: '3', y2: '15', key: 'widbto' }],\n]);\n\nexport default Upload;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAS,iBAAiB,QAAU,CAAA,CAAA,CAAA;AAAA,CAAA,CACxC,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAA6C,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,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,CAC1E,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,CAAA,CAAA,CAAA,CAAE,QAAQ,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,CACvD,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,CAAK,CAAA,CAAA,CAAA,CAAA,CAAI,CAAA,CAAA,CAAA,CAAA,CAAM,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA;AACnE,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1 @@
"use strict";Object.defineProperty(exports, "__esModule", {value: true});var _chunkLTNXLTPScjs = require('./chunk-LTNXLTPS.cjs');var r={...Object.fromEntries(Object.entries(_chunkLTNXLTPScjs.a).filter(([e])=>e!=="extra")),..._chunkLTNXLTPScjs.a.extra.unofficial},i= exports.default =r;exports.default = i; exports.status = r;
@@ -0,0 +1 @@
{"version":3,"file":"combineWhereConstraints.d.ts","sourceRoot":"","sources":["../../src/utilities/combineWhereConstraints.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,KAAK,EAAE,MAAM,mBAAmB,CAAA;AAE9C,wBAAgB,uBAAuB,CACrC,WAAW,EAAE,KAAK,CAAC,SAAS,GAAG,KAAK,CAAC,EACrC,EAAE,GAAE,KAAK,GAAG,IAAY,GACvB,KAAK,CA4BP"}
@@ -0,0 +1,38 @@
import { warnOnce } from '../../utils/warn-once.mjs';
function createDOMMotionComponentProxy(componentFactory) {
if (typeof Proxy === "undefined") {
return componentFactory;
}
/**
* A cache of generated `motion` components, e.g `motion.div`, `motion.input` etc.
* Rather than generating them anew every render.
*/
const componentCache = new Map();
const deprecatedFactoryFunction = (...args) => {
if (process.env.NODE_ENV !== "production") {
warnOnce(false, "motion() is deprecated. Use motion.create() instead.");
}
return componentFactory(...args);
};
return new Proxy(deprecatedFactoryFunction, {
/**
* Called when `motion` is referenced with a prop: `motion.div`, `motion.input` etc.
* The prop name is passed through as `key` and we can use that to generate a `motion`
* DOM component with that name.
*/
get: (_target, key) => {
if (key === "create")
return componentFactory;
/**
* If this element doesn't exist in the component cache, create it and cache.
*/
if (!componentCache.has(key)) {
componentCache.set(key, componentFactory(key));
}
return componentCache.get(key);
},
});
}
export { createDOMMotionComponentProxy };
@@ -0,0 +1,19 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
class Hub {
getCode() {}
getScope() {}
addHelper() {
throw new Error("Helpers are not supported by the default hub.");
}
buildError(node, msg, Error = TypeError) {
return new Error(msg);
}
}
exports.default = Hub;
//# sourceMappingURL=hub.js.map
@@ -0,0 +1,48 @@
import * as serverComponentModule from '__SENTRY_WRAPPING_TARGET_FILE__';
export * from '__SENTRY_WRAPPING_TARGET_FILE__';
import * as Sentry from '@sentry/nextjs';
/*
* This file is a template for the code which will be substituted when our webpack loader handles middleware files.
*
* We use `__SENTRY_WRAPPING_TARGET_FILE__` as a placeholder for the path to the file being wrapped. Because it's not a real package,
* this causes both TS and ESLint to complain, hence the pragma comments below.
*/
const userApiModule = serverComponentModule ;
// Default to undefined. It's possible for Next.js users to not define any exports/handlers in an API route. If that is
// the case Next.js wil crash during runtime but the Sentry SDK should definitely not crash so we need tohandle it.
let userProvidedNamedHandler = undefined;
let userProvidedDefaultHandler = undefined;
let userProvidedMiddleware = false;
let userProvidedProxy = false;
if ('middleware' in userApiModule && typeof userApiModule.middleware === 'function') {
// Handle when user defines via named ESM export: `export { middleware };`
userProvidedNamedHandler = userApiModule.middleware;
userProvidedMiddleware = true;
} else if ('proxy' in userApiModule && typeof userApiModule.proxy === 'function') {
// Handle when user defines via named ESM export (Next.js 16): `export { proxy };`
userProvidedNamedHandler = userApiModule.proxy;
userProvidedProxy = true;
} else if ('default' in userApiModule && typeof userApiModule.default === 'function') {
// Handle when user defines via ESM export: `export default myFunction;`
userProvidedDefaultHandler = userApiModule.default;
} else if (typeof userApiModule === 'function') {
// Handle when user defines via CJS export: "module.exports = myFunction;"
userProvidedDefaultHandler = userApiModule;
}
// Wrap the handler that the user provided (middleware, proxy, or default)
// We preserve the original export names so Next.js can handle its internal renaming logic
const wrappedHandler = userProvidedNamedHandler ? Sentry.wrapMiddlewareWithSentry(userProvidedNamedHandler) : undefined;
// Only export the named export that the user actually provided
// This ensures Next.js sees the same export structure and can apply its renaming logic
const middleware = userProvidedMiddleware ? wrappedHandler : undefined;
const proxy = userProvidedProxy ? wrappedHandler : undefined;
const middlewareWrapperTemplate = userProvidedDefaultHandler ? Sentry.wrapMiddlewareWithSentry(userProvidedDefaultHandler) : undefined;
export { middlewareWrapperTemplate as default, middleware, proxy };
@@ -0,0 +1,2 @@
const e=require(`../../utils/throw-if-empty.cjs`),t=e=>()=>({path:`/comments`,params:e??{},method:`GET`}),n=(t,n)=>()=>(e.throwIfEmpty(String(t),`Key cannot be empty`),{path:`/comments/${t}`,params:n??{},method:`GET`});exports.readComment=n,exports.readComments=t;
//# sourceMappingURL=comments.cjs.map
@@ -0,0 +1 @@
{"version":3,"file":"registerFirstUser.d.ts","sourceRoot":"","sources":["../../../src/auth/endpoints/registerFirstUser.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,uBAAuB,CAAA;AAO3D,eAAO,MAAM,wBAAwB,EAAE,cA8CtC,CAAA"}
@@ -0,0 +1,241 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Tobias Koppers @sokra
*/
"use strict";
const NO_MARKER = 0;
const IN_PROGRESS_MARKER = 1;
const DONE_MARKER = 2;
const DONE_MAYBE_ROOT_CYCLE_MARKER = 3;
const DONE_AND_ROOT_MARKER = 4;
/**
* @template T
* @typedef {Set<Node<T>>} Nodes
*/
/**
* @template T
* @typedef {Set<Cycle<T>>} Cycles
*/
/**
* @template T
*/
class Node {
/**
* @param {T} item the value of the node
*/
constructor(item) {
this.item = item;
/** @type {Nodes<T>} */
this.dependencies = new Set();
this.marker = NO_MARKER;
/** @type {Cycle<T> | undefined} */
this.cycle = undefined;
this.incoming = 0;
}
}
/**
* @template T
*/
class Cycle {
constructor() {
/** @type {Nodes<T>} */
this.nodes = new Set();
}
}
/**
* @template T
* @typedef {object} StackEntry
* @property {Node<T>} node
* @property {Node<T>[]} openEdges
*/
/**
* @template T
* @param {Iterable<T>} items list of items
* @param {(item: T) => Iterable<T>} getDependencies function to get dependencies of an item (items that are not in list are ignored)
* @returns {Iterable<T>} graph roots of the items
*/
module.exports = (items, getDependencies) => {
/** @type {Map<T, Node<T>>} */
const itemToNode = new Map();
for (const item of items) {
const node = new Node(item);
itemToNode.set(item, node);
}
// early exit when there is only a single item
if (itemToNode.size <= 1) return items;
// grab all the dependencies
for (const node of itemToNode.values()) {
for (const dep of getDependencies(node.item)) {
const depNode = itemToNode.get(dep);
if (depNode !== undefined) {
node.dependencies.add(depNode);
}
}
}
// Set of current root modules
// items will be removed if a new reference to it has been found
/** @type {Nodes<T>} */
const roots = new Set();
// Set of current cycles without references to it
// cycles will be removed if a new reference to it has been found
// that is not part of the cycle
/** @type {Cycles<T>} */
const rootCycles = new Set();
// For all non-marked nodes
for (const selectedNode of itemToNode.values()) {
if (selectedNode.marker === NO_MARKER) {
// deep-walk all referenced modules
// in a non-recursive way
// start by entering the selected node
selectedNode.marker = IN_PROGRESS_MARKER;
// keep a stack to avoid recursive walk
/** @type {StackEntry<T>[]} */
const stack = [
{
node: selectedNode,
openEdges: [...selectedNode.dependencies]
}
];
// process the top item until stack is empty
while (stack.length > 0) {
const topOfStack = stack[stack.length - 1];
// Are there still edges unprocessed in the current node?
if (topOfStack.openEdges.length > 0) {
// Process one dependency
const dependency =
/** @type {Node<T>} */
(topOfStack.openEdges.pop());
switch (dependency.marker) {
case NO_MARKER:
// dependency has not be visited yet
// mark it as in-progress and recurse
stack.push({
node: dependency,
openEdges: [...dependency.dependencies]
});
dependency.marker = IN_PROGRESS_MARKER;
break;
case IN_PROGRESS_MARKER: {
// It's a in-progress cycle
let cycle = dependency.cycle;
if (!cycle) {
cycle = new Cycle();
cycle.nodes.add(dependency);
dependency.cycle = cycle;
}
// set cycle property for each node in the cycle
// if nodes are already part of a cycle
// we merge the cycles to a shared cycle
for (
let i = stack.length - 1;
stack[i].node !== dependency;
i--
) {
const node = stack[i].node;
if (node.cycle) {
if (node.cycle !== cycle) {
// merge cycles
for (const cycleNode of node.cycle.nodes) {
cycleNode.cycle = cycle;
cycle.nodes.add(cycleNode);
}
}
} else {
node.cycle = cycle;
cycle.nodes.add(node);
}
}
// don't recurse into dependencies
// these are already on the stack
break;
}
case DONE_AND_ROOT_MARKER:
// This node has be visited yet and is currently a root node
// But as this is a new reference to the node
// it's not really a root
// so we have to convert it to a normal node
dependency.marker = DONE_MARKER;
roots.delete(dependency);
break;
case DONE_MAYBE_ROOT_CYCLE_MARKER:
// This node has be visited yet and
// is maybe currently part of a completed root cycle
// we found a new reference to the cycle
// so it's not really a root cycle
// remove the cycle from the root cycles
// and convert it to a normal node
rootCycles.delete(/** @type {Cycle<T>} */ (dependency.cycle));
dependency.marker = DONE_MARKER;
break;
// DONE_MARKER: nothing to do, don't recurse into dependencies
}
} else {
// All dependencies of the current node has been visited
// we leave the node
stack.pop();
topOfStack.node.marker = DONE_MARKER;
}
}
const cycle = selectedNode.cycle;
if (cycle) {
for (const node of cycle.nodes) {
node.marker = DONE_MAYBE_ROOT_CYCLE_MARKER;
}
rootCycles.add(cycle);
} else {
selectedNode.marker = DONE_AND_ROOT_MARKER;
roots.add(selectedNode);
}
}
}
// Extract roots from root cycles
// We take the nodes with most incoming edges
// inside of the cycle
for (const cycle of rootCycles) {
let max = 0;
/** @type {Nodes<T>} */
const cycleRoots = new Set();
const nodes = cycle.nodes;
for (const node of nodes) {
for (const dep of node.dependencies) {
if (nodes.has(dep)) {
dep.incoming++;
if (dep.incoming < max) continue;
if (dep.incoming > max) {
cycleRoots.clear();
max = dep.incoming;
}
cycleRoots.add(dep);
}
}
}
for (const cycleRoot of cycleRoots) {
roots.add(cycleRoot);
}
}
// When roots were found, return them
if (roots.size > 0) {
return Array.from(roots, (r) => r.item);
}
throw new Error("Implementation of findGraphRoots is broken");
};
@@ -0,0 +1 @@
{"version":3,"file":"assert-valid-pattern.js","sourceRoot":"","sources":["../../src/assert-valid-pattern.ts"],"names":[],"mappings":"AAAA,MAAM,kBAAkB,GAAG,IAAI,GAAG,EAAE,CAAA;AACpC,MAAM,CAAC,MAAM,kBAAkB,GAA2B,CACxD,OAAY,EACe,EAAE;IAC7B,IAAI,OAAO,OAAO,KAAK,QAAQ,EAAE,CAAC;QAChC,MAAM,IAAI,SAAS,CAAC,iBAAiB,CAAC,CAAA;IACxC,CAAC;IAED,IAAI,OAAO,CAAC,MAAM,GAAG,kBAAkB,EAAE,CAAC;QACxC,MAAM,IAAI,SAAS,CAAC,qBAAqB,CAAC,CAAA;IAC5C,CAAC;AACH,CAAC,CAAA","sourcesContent":["const MAX_PATTERN_LENGTH = 1024 * 64\nexport const assertValidPattern: (pattern: any) => void = (\n pattern: any,\n): asserts pattern is string => {\n if (typeof pattern !== 'string') {\n throw new TypeError('invalid pattern')\n }\n\n if (pattern.length > MAX_PATTERN_LENGTH) {\n throw new TypeError('pattern is too long')\n }\n}\n"]}
@@ -0,0 +1,160 @@
"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 = {
abbreviated: /^(pr\. n\. št\.|po n\. št\.)/i,
wide: /^(pred Kristusom|pred na[sš]im [sš]tetjem|po Kristusu|po na[sš]em [sš]tetju|na[sš]ega [sš]tetja)/i,
};
const parseEraPatterns = {
any: [/^pr/i, /^(po|na[sš]em)/i],
};
const matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^[1234]\.\s?[čc]et\.?/i,
wide: /^[1234]\. [čc]etrtletje/i,
};
const parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i],
};
const matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated:
/^(jan\.|feb\.|mar\.|apr\.|maj|jun\.|jul\.|avg\.|sep\.|okt\.|nov\.|dec\.)/i,
wide: /^(januar|februar|marec|april|maj|junij|julij|avgust|september|oktober|november|december)/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,
],
abbreviated: [
/^ja/i,
/^fe/i,
/^mar/i,
/^ap/i,
/^maj/i,
/^jun/i,
/^jul/i,
/^av/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
wide: [
/^ja/i,
/^fe/i,
/^mar/i,
/^ap/i,
/^maj/i,
/^jun/i,
/^jul/i,
/^av/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i,
],
};
const matchDayPatterns = {
narrow: /^[nptsčc]/i,
short: /^(ned\.|pon\.|tor\.|sre\.|[cč]et\.|pet\.|sob\.)/i,
abbreviated: /^(ned\.|pon\.|tor\.|sre\.|[cč]et\.|pet\.|sob\.)/i,
wide: /^(nedelja|ponedeljek|torek|sreda|[cč]etrtek|petek|sobota)/i,
};
const parseDayPatterns = {
narrow: [/^n/i, /^p/i, /^t/i, /^s/i, /^[cč]/i, /^p/i, /^s/i],
any: [/^n/i, /^po/i, /^t/i, /^sr/i, /^[cč]/i, /^pe/i, /^so/i],
};
const matchDayPeriodPatterns = {
narrow: /^(d|po?|z?v|n|z?j|24\.00|12\.00)/i,
any: /^(dop\.|pop\.|o?poln(\.|o[cč]i?)|o?pold(\.|ne)|z?ve[cč](\.|er)|(po)?no[cč]i?|popold(ne|an)|jut(\.|ro)|zjut(\.|raj))/i,
};
const parseDayPeriodPatterns = {
narrow: {
am: /^d/i,
pm: /^p/i,
midnight: /^24/i,
noon: /^12/i,
morning: /^(z?j)/i,
afternoon: /^p/i,
evening: /^(z?v)/i,
night: /^(n|po)/i,
},
any: {
am: /^dop\./i,
pm: /^pop\./i,
midnight: /^o?poln/i,
noon: /^o?pold/i,
morning: /j/i,
afternoon: /^pop\./i,
evening: /^z?ve/i,
night: /(po)?no/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: "wide",
}),
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,8 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { getWeekOfMonth as fn } from "../getWeekOfMonth.mjs";
import { convertToFP } from "./_lib/convertToFP.mjs";
export const getWeekOfMonthWithOptions = convertToFP(fn, 2);
// Fallback for modularized imports:
export default getWeekOfMonthWithOptions;
@@ -0,0 +1 @@
{"version":3,"file":"getRequestTheme.js","names":["defaultTheme","acceptedThemes","getRequestTheme","config","cookies","headers","admin","theme","includes","themeCookie","get","cookiePrefix","themeFromCookie","value","themeFromHeader"],"sources":["../../src/utilities/getRequestTheme.ts"],"sourcesContent":["import type { ReadonlyRequestCookies } from 'next/dist/server/web/spec-extension/adapters/request-cookies.js'\nimport type { SanitizedConfig } from 'payload'\n\nimport { defaultTheme, type Theme } from '@payloadcms/ui'\n\ntype GetRequestLanguageArgs = {\n config: SanitizedConfig\n cookies: Map<string, string> | ReadonlyRequestCookies\n headers: Request['headers']\n}\n\nconst acceptedThemes: Theme[] = ['dark', 'light']\n\nexport const getRequestTheme = ({ config, cookies, headers }: GetRequestLanguageArgs): Theme => {\n if (config.admin.theme !== 'all' && acceptedThemes.includes(config.admin.theme)) {\n return config.admin.theme\n }\n\n const themeCookie = cookies.get(`${config.cookiePrefix || 'payload'}-theme`)\n\n const themeFromCookie: Theme = (\n typeof themeCookie === 'string' ? themeCookie : themeCookie?.value\n ) as Theme\n\n if (themeFromCookie && acceptedThemes.includes(themeFromCookie)) {\n return themeFromCookie\n }\n\n const themeFromHeader = headers.get('Sec-CH-Prefers-Color-Scheme') as Theme\n\n if (themeFromHeader && acceptedThemes.includes(themeFromHeader)) {\n return themeFromHeader\n }\n\n return defaultTheme\n}\n"],"mappings":"AAGA,SAASA,YAAY,QAAoB;AAQzC,MAAMC,cAAA,GAA0B,CAAC,QAAQ,QAAQ;AAEjD,OAAO,MAAMC,eAAA,GAAkBA,CAAC;EAAEC,MAAM;EAAEC,OAAO;EAAEC;AAAO,CAA0B;EAClF,IAAIF,MAAA,CAAOG,KAAK,CAACC,KAAK,KAAK,SAASN,cAAA,CAAeO,QAAQ,CAACL,MAAA,CAAOG,KAAK,CAACC,KAAK,GAAG;IAC/E,OAAOJ,MAAA,CAAOG,KAAK,CAACC,KAAK;EAC3B;EAEA,MAAME,WAAA,GAAcL,OAAA,CAAQM,GAAG,CAAC,GAAGP,MAAA,CAAOQ,YAAY,IAAI,iBAAiB;EAE3E,MAAMC,eAAA,GACJ,OAAOH,WAAA,KAAgB,WAAWA,WAAA,GAAcA,WAAA,EAAaI,KAAA;EAG/D,IAAID,eAAA,IAAmBX,cAAA,CAAeO,QAAQ,CAACI,eAAA,GAAkB;IAC/D,OAAOA,eAAA;EACT;EAEA,MAAME,eAAA,GAAkBT,OAAA,CAAQK,GAAG,CAAC;EAEpC,IAAII,eAAA,IAAmBb,cAAA,CAAeO,QAAQ,CAACM,eAAA,GAAkB;IAC/D,OAAOA,eAAA;EACT;EAEA,OAAOd,YAAA;AACT","ignoreList":[]}
@@ -0,0 +1,4 @@
export declare const formatRFC7231: import("./types.js").FPFn1<
string,
string | number | Date
>;
@@ -0,0 +1,630 @@
function _typeof(o) {"@babel/helpers - typeof";return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (o) {return typeof o;} : function (o) {return o && "function" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? "symbol" : typeof o;}, _typeof(o);}function ownKeys(e, r) {var t = Object.keys(e);if (Object.getOwnPropertySymbols) {var o = Object.getOwnPropertySymbols(e);r && (o = o.filter(function (r) {return Object.getOwnPropertyDescriptor(e, r).enumerable;})), t.push.apply(t, o);}return t;}function _objectSpread(e) {for (var r = 1; r < arguments.length; r++) {var t = null != arguments[r] ? arguments[r] : {};r % 2 ? ownKeys(Object(t), !0).forEach(function (r) {_defineProperty(e, r, t[r]);}) : Object.getOwnPropertyDescriptors ? Object.defineProperties(e, Object.getOwnPropertyDescriptors(t)) : ownKeys(Object(t)).forEach(function (r) {Object.defineProperty(e, r, Object.getOwnPropertyDescriptor(t, r));});}return e;}function _defineProperty(obj, key, value) {key = _toPropertyKey(key);if (key in obj) {Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true });} else {obj[key] = value;}return obj;}function _toPropertyKey(t) {var i = _toPrimitive(t, "string");return "symbol" == _typeof(i) ? i : String(i);}function _toPrimitive(t, r) {if ("object" != _typeof(t) || !t) return t;var e = t[Symbol.toPrimitive];if (void 0 !== e) {var i = e.call(t, r || "default");if ("object" != _typeof(i)) return i;throw new TypeError("@@toPrimitive must return a primitive value.");}return ("string" === r ? String : Number)(t);}(function (_window$dateFns) {var __defProp = Object.defineProperty;
var __export = function __export(target, all) {
for (var name in all)
__defProp(target, name, {
get: all[name],
enumerable: true,
configurable: true,
set: function set(newValue) {return all[name] = function () {return newValue;};}
});
};
// lib/locale/de/_lib/formatDistance.mjs
var formatDistanceLocale = {
lessThanXSeconds: {
standalone: {
one: "weniger als 1 Sekunde",
other: "weniger als {{count}} Sekunden"
},
withPreposition: {
one: "weniger als 1 Sekunde",
other: "weniger als {{count}} Sekunden"
}
},
xSeconds: {
standalone: {
one: "1 Sekunde",
other: "{{count}} Sekunden"
},
withPreposition: {
one: "1 Sekunde",
other: "{{count}} Sekunden"
}
},
halfAMinute: {
standalone: "eine halbe Minute",
withPreposition: "einer halben Minute"
},
lessThanXMinutes: {
standalone: {
one: "weniger als 1 Minute",
other: "weniger als {{count}} Minuten"
},
withPreposition: {
one: "weniger als 1 Minute",
other: "weniger als {{count}} Minuten"
}
},
xMinutes: {
standalone: {
one: "1 Minute",
other: "{{count}} Minuten"
},
withPreposition: {
one: "1 Minute",
other: "{{count}} Minuten"
}
},
aboutXHours: {
standalone: {
one: "etwa 1 Stunde",
other: "etwa {{count}} Stunden"
},
withPreposition: {
one: "etwa 1 Stunde",
other: "etwa {{count}} Stunden"
}
},
xHours: {
standalone: {
one: "1 Stunde",
other: "{{count}} Stunden"
},
withPreposition: {
one: "1 Stunde",
other: "{{count}} Stunden"
}
},
xDays: {
standalone: {
one: "1 Tag",
other: "{{count}} Tage"
},
withPreposition: {
one: "1 Tag",
other: "{{count}} Tagen"
}
},
aboutXWeeks: {
standalone: {
one: "etwa 1 Woche",
other: "etwa {{count}} Wochen"
},
withPreposition: {
one: "etwa 1 Woche",
other: "etwa {{count}} Wochen"
}
},
xWeeks: {
standalone: {
one: "1 Woche",
other: "{{count}} Wochen"
},
withPreposition: {
one: "1 Woche",
other: "{{count}} Wochen"
}
},
aboutXMonths: {
standalone: {
one: "etwa 1 Monat",
other: "etwa {{count}} Monate"
},
withPreposition: {
one: "etwa 1 Monat",
other: "etwa {{count}} Monaten"
}
},
xMonths: {
standalone: {
one: "1 Monat",
other: "{{count}} Monate"
},
withPreposition: {
one: "1 Monat",
other: "{{count}} Monaten"
}
},
aboutXYears: {
standalone: {
one: "etwa 1 Jahr",
other: "etwa {{count}} Jahre"
},
withPreposition: {
one: "etwa 1 Jahr",
other: "etwa {{count}} Jahren"
}
},
xYears: {
standalone: {
one: "1 Jahr",
other: "{{count}} Jahre"
},
withPreposition: {
one: "1 Jahr",
other: "{{count}} Jahren"
}
},
overXYears: {
standalone: {
one: "mehr als 1 Jahr",
other: "mehr als {{count}} Jahre"
},
withPreposition: {
one: "mehr als 1 Jahr",
other: "mehr als {{count}} Jahren"
}
},
almostXYears: {
standalone: {
one: "fast 1 Jahr",
other: "fast {{count}} Jahre"
},
withPreposition: {
one: "fast 1 Jahr",
other: "fast {{count}} Jahren"
}
}
};
var formatDistance = function formatDistance(token, count, options) {
var result;
var tokenValue = options !== null && options !== void 0 && options.addSuffix ? formatDistanceLocale[token].withPreposition : formatDistanceLocale[token].standalone;
if (typeof tokenValue === "string") {
result = tokenValue;
} else if (count === 1) {
result = tokenValue.one;
} else {
result = tokenValue.other.replace("{{count}}", String(count));
}
if (options !== null && options !== void 0 && options.addSuffix) {
if (options.comparison && options.comparison > 0) {
return "in " + result;
} else {
return "vor " + result;
}
}
return result;
};
// lib/locale/_lib/buildFormatLongFn.mjs
function buildFormatLongFn(args) {
return function () {var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};
var width = options.width ? String(options.width) : args.defaultWidth;
var format = args.formats[width] || args.formats[args.defaultWidth];
return format;
};
}
// lib/locale/de/_lib/formatLong.mjs
var dateFormats = {
full: "EEEE, do MMMM y",
long: "do MMMM y",
medium: "do MMM y",
short: "dd.MM.y"
};
var timeFormats = {
full: "HH:mm:ss zzzz",
long: "HH:mm:ss z",
medium: "HH:mm:ss",
short: "HH:mm"
};
var dateTimeFormats = {
full: "{{date}} 'um' {{time}}",
long: "{{date}} 'um' {{time}}",
medium: "{{date}} {{time}}",
short: "{{date}} {{time}}"
};
var formatLong = {
date: buildFormatLongFn({
formats: dateFormats,
defaultWidth: "full"
}),
time: buildFormatLongFn({
formats: timeFormats,
defaultWidth: "full"
}),
dateTime: buildFormatLongFn({
formats: dateTimeFormats,
defaultWidth: "full"
})
};
// lib/locale/de/_lib/formatRelative.mjs
var formatRelativeLocale = {
lastWeek: "'letzten' eeee 'um' p",
yesterday: "'gestern um' p",
today: "'heute um' p",
tomorrow: "'morgen um' p",
nextWeek: "eeee 'um' p",
other: "P"
};
var formatRelative = function formatRelative(token, _date, _baseDate, _options) {return formatRelativeLocale[token];};
// lib/locale/_lib/buildMatchFn.mjs
function buildMatchFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var width = options.width;
var matchPattern = width && args.matchPatterns[width] || args.matchPatterns[args.defaultMatchWidth];
var matchResult = string.match(matchPattern);
if (!matchResult) {
return null;
}
var matchedString = matchResult[0];
var parsePatterns = width && args.parsePatterns[width] || args.parsePatterns[args.defaultParseWidth];
var key = Array.isArray(parsePatterns) ? findIndex(parsePatterns, function (pattern) {return pattern.test(matchedString);}) : findKey(parsePatterns, function (pattern) {return pattern.test(matchedString);});
var value;
value = args.valueCallback ? args.valueCallback(key) : key;
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
var findKey = function findKey(object, predicate) {
for (var key in object) {
if (Object.prototype.hasOwnProperty.call(object, key) && predicate(object[key])) {
return key;
}
}
return;
};
var findIndex = function findIndex(array, predicate) {
for (var key = 0; key < array.length; key++) {
if (predicate(array[key])) {
return key;
}
}
return;
};
// lib/locale/_lib/buildMatchPatternFn.mjs
function buildMatchPatternFn(args) {
return function (string) {var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};
var matchResult = string.match(args.matchPattern);
if (!matchResult)
return null;
var matchedString = matchResult[0];
var parseResult = string.match(args.parsePattern);
if (!parseResult)
return null;
var value = args.valueCallback ? args.valueCallback(parseResult[0]) : parseResult[0];
value = options.valueCallback ? options.valueCallback(value) : value;
var rest = string.slice(matchedString.length);
return { value: value, rest: rest };
};
}
// lib/locale/de/_lib/match.mjs
var matchOrdinalNumberPattern = /^(\d+)(\.)?/i;
var parseOrdinalNumberPattern = /\d+/i;
var matchEraPatterns = {
narrow: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
abbreviated: /^(v\.? ?Chr\.?|n\.? ?Chr\.?)/i,
wide: /^(vor Christus|vor unserer Zeitrechnung|nach Christus|unserer Zeitrechnung)/i
};
var parseEraPatterns = {
any: [/^v/i, /^n/i]
};
var matchQuarterPatterns = {
narrow: /^[1234]/i,
abbreviated: /^q[1234]/i,
wide: /^[1234](\.)? Quartal/i
};
var parseQuarterPatterns = {
any: [/1/i, /2/i, /3/i, /4/i]
};
var matchMonthPatterns = {
narrow: /^[jfmasond]/i,
abbreviated: /^(j[aä]n|feb|mär[z]?|apr|mai|jun[i]?|jul[i]?|aug|sep|okt|nov|dez)\.?/i,
wide: /^(januar|februar|märz|april|mai|juni|juli|august|september|oktober|november|dezember)/i
};
var parseMonthPatterns = {
narrow: [
/^j/i,
/^f/i,
/^m/i,
/^a/i,
/^m/i,
/^j/i,
/^j/i,
/^a/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i],
any: [
/^j[aä]/i,
/^f/i,
/^mär/i,
/^ap/i,
/^mai/i,
/^jun/i,
/^jul/i,
/^au/i,
/^s/i,
/^o/i,
/^n/i,
/^d/i]
};
var matchDayPatterns = {
narrow: /^[smdmf]/i,
short: /^(so|mo|di|mi|do|fr|sa)/i,
abbreviated: /^(son?|mon?|die?|mit?|don?|fre?|sam?)\.?/i,
wide: /^(sonntag|montag|dienstag|mittwoch|donnerstag|freitag|samstag)/i
};
var parseDayPatterns = {
any: [/^so/i, /^mo/i, /^di/i, /^mi/i, /^do/i, /^f/i, /^sa/i]
};
var matchDayPeriodPatterns = {
narrow: /^(vm\.?|nm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,
abbreviated: /^(vorm\.?|nachm\.?|Mitternacht|Mittag|morgens|nachm\.?|abends|nachts)/i,
wide: /^(vormittags|nachmittags|Mitternacht|Mittag|morgens|nachmittags|abends|nachts)/i
};
var parseDayPeriodPatterns = {
any: {
am: /^v/i,
pm: /^n/i,
midnight: /^Mitte/i,
noon: /^Mitta/i,
morning: /morgens/i,
afternoon: /nachmittags/i,
evening: /abends/i,
night: /nachts/i
}
};
var match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function valueCallback(value) {return parseInt(value);}
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any"
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: function valueCallback(index) {return index + 1;}
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any"
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any"
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any"
})
};
// lib/locale/_lib/buildLocalizeFn.mjs
function buildLocalizeFn(args) {
return function (value, options) {
var context = options !== null && options !== void 0 && options.context ? String(options.context) : "standalone";
var valuesArray;
if (context === "formatting" && args.formattingValues) {
var defaultWidth = args.defaultFormattingWidth || args.defaultWidth;
var width = options !== null && options !== void 0 && options.width ? String(options.width) : defaultWidth;
valuesArray = args.formattingValues[width] || args.formattingValues[defaultWidth];
} else {
var _defaultWidth = args.defaultWidth;
var _width = options !== null && options !== void 0 && options.width ? String(options.width) : args.defaultWidth;
valuesArray = args.values[_width] || args.values[_defaultWidth];
}
var index = args.argumentCallback ? args.argumentCallback(value) : value;
return valuesArray[index];
};
}
// lib/locale/de-AT/_lib/localize.mjs
var eraValues = {
narrow: ["v.Chr.", "n.Chr."],
abbreviated: ["v.Chr.", "n.Chr."],
wide: ["vor Christus", "nach Christus"]
};
var quarterValues = {
narrow: ["1", "2", "3", "4"],
abbreviated: ["Q1", "Q2", "Q3", "Q4"],
wide: ["1. Quartal", "2. Quartal", "3. Quartal", "4. Quartal"]
};
var monthValues = {
narrow: ["J", "F", "M", "A", "M", "J", "J", "A", "S", "O", "N", "D"],
abbreviated: [
"J\xE4n",
"Feb",
"M\xE4r",
"Apr",
"Mai",
"Jun",
"Jul",
"Aug",
"Sep",
"Okt",
"Nov",
"Dez"],
wide: [
"J\xE4nner",
"Februar",
"M\xE4rz",
"April",
"Mai",
"Juni",
"Juli",
"August",
"September",
"Oktober",
"November",
"Dezember"]
};
var formattingMonthValues = {
narrow: monthValues.narrow,
abbreviated: [
"J\xE4n.",
"Feb.",
"M\xE4rz",
"Apr.",
"Mai",
"Juni",
"Juli",
"Aug.",
"Sep.",
"Okt.",
"Nov.",
"Dez."],
wide: monthValues.wide
};
var dayValues = {
narrow: ["S", "M", "D", "M", "D", "F", "S"],
short: ["So", "Mo", "Di", "Mi", "Do", "Fr", "Sa"],
abbreviated: ["So.", "Mo.", "Di.", "Mi.", "Do.", "Fr.", "Sa."],
wide: [
"Sonntag",
"Montag",
"Dienstag",
"Mittwoch",
"Donnerstag",
"Freitag",
"Samstag"]
};
var dayPeriodValues = {
narrow: {
am: "vm.",
pm: "nm.",
midnight: "Mitternacht",
noon: "Mittag",
morning: "Morgen",
afternoon: "Nachm.",
evening: "Abend",
night: "Nacht"
},
abbreviated: {
am: "vorm.",
pm: "nachm.",
midnight: "Mitternacht",
noon: "Mittag",
morning: "Morgen",
afternoon: "Nachmittag",
evening: "Abend",
night: "Nacht"
},
wide: {
am: "vormittags",
pm: "nachmittags",
midnight: "Mitternacht",
noon: "Mittag",
morning: "Morgen",
afternoon: "Nachmittag",
evening: "Abend",
night: "Nacht"
}
};
var formattingDayPeriodValues = {
narrow: {
am: "vm.",
pm: "nm.",
midnight: "Mitternacht",
noon: "Mittag",
morning: "morgens",
afternoon: "nachm.",
evening: "abends",
night: "nachts"
},
abbreviated: {
am: "vorm.",
pm: "nachm.",
midnight: "Mitternacht",
noon: "Mittag",
morning: "morgens",
afternoon: "nachmittags",
evening: "abends",
night: "nachts"
},
wide: {
am: "vormittags",
pm: "nachmittags",
midnight: "Mitternacht",
noon: "Mittag",
morning: "morgens",
afternoon: "nachmittags",
evening: "abends",
night: "nachts"
}
};
var ordinalNumber = function ordinalNumber(dirtyNumber) {
var number = Number(dirtyNumber);
return number + ".";
};
var localize = {
ordinalNumber: ordinalNumber,
era: buildLocalizeFn({
values: eraValues,
defaultWidth: "wide"
}),
quarter: buildLocalizeFn({
values: quarterValues,
defaultWidth: "wide",
argumentCallback: function argumentCallback(quarter) {return quarter - 1;}
}),
month: buildLocalizeFn({
values: monthValues,
formattingValues: formattingMonthValues,
defaultWidth: "wide"
}),
day: buildLocalizeFn({
values: dayValues,
defaultWidth: "wide"
}),
dayPeriod: buildLocalizeFn({
values: dayPeriodValues,
defaultWidth: "wide",
formattingValues: formattingDayPeriodValues,
defaultFormattingWidth: "wide"
})
};
// lib/locale/de-AT.mjs
var deAT = {
code: "de-AT",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1,
firstWeekContainsDate: 4
}
};
// lib/locale/de-AT/cdn.js
window.dateFns = _objectSpread(_objectSpread({},
window.dateFns), {}, {
locale: _objectSpread(_objectSpread({}, (_window$dateFns =
window.dateFns) === null || _window$dateFns === void 0 ? void 0 : _window$dateFns.locale), {}, {
deAT: deAT }) });
//# debugId=72DCC2250AF899E764756e2164756e21
})();
//# sourceMappingURL=cdn.js.map
@@ -0,0 +1,3 @@
import type { Collection } from 'payload';
export declare function resetPassword(collection: Collection): any;
//# sourceMappingURL=resetPassword.d.ts.map
@@ -0,0 +1,137 @@
import { buildMatchFn } from "../../_lib/buildMatchFn.js";
import { buildMatchPatternFn } from "../../_lib/buildMatchPatternFn.js";
const matchOrdinalNumberPattern = /^(\d+)/;
const parseOrdinalNumberPattern = /\d+/i;
const matchEraPatterns = {
narrow: /^(ق|ب)/g,
abbreviated: /^(ق.م|ب.م)/g,
wide: /^(قبل الميلاد|بعد الميلاد)/g,
};
const parseEraPatterns = {
any: [/^ق/g, /^ب/g],
};
const matchQuarterPatterns = {
narrow: /^[1234]/,
abbreviated: /^ر[1234]/,
wide: /^الربع (الأول|الثاني|الثالث|الرابع)/,
};
const parseQuarterPatterns = {
wide: [/الربع الأول/, /الربع الثاني/, /الربع الثالث/, /الربع الرابع/],
any: [/1/, /2/, /3/, /4/],
};
const matchMonthPatterns = {
narrow: /^(ي|ف|م|أ|س|ن|د)/,
abbreviated: /^(ينا|فبر|مارس|أبريل|مايو|يونـ|يولـ|أغسـ|سبتـ|أكتـ|نوفـ|ديسـ)/,
wide: /^(يناير|فبراير|مارس|أبريل|مايو|يونيو|يوليو|أغسطس|سبتمبر|أكتوبر|نوفمبر|ديسمبر)/,
};
const parseMonthPatterns = {
narrow: [
/^ي/,
/^ف/,
/^م/,
/^أ/,
/^م/,
/^ي/,
/^ي/,
/^أ/,
/^س/,
/^أ/,
/^ن/,
/^د/,
],
any: [
/^ينا/,
/^فبر/,
/^مارس/,
/^أبريل/,
/^مايو/,
/^يون/,
/^يول/,
/^أغس/,
/^سبت/,
/^أكت/,
/^نوف/,
/^ديس/,
],
};
const matchDayPatterns = {
narrow: /^(ح|ن|ث|ر|خ|ج|س)/,
short: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/,
abbreviated: /^(أحد|اثنين|ثلاثاء|أربعاء|خميس|جمعة|سبت)/,
wide: /^(الأحد|الاثنين|الثلاثاء|الأربعاء|الخميس|الجمعة|السبت)/,
};
const parseDayPatterns = {
narrow: [/^ح/, /^ن/, /^ث/, /^ر/, /^خ/, /^ج/, /^س/],
any: [/أحد/, /اثنين/, /ثلاثاء/, /أربعاء/, /خميس/, /جمعة/, /سبت/],
};
const matchDayPeriodPatterns = {
narrow: /^(ص|م|ن|ظ|في الصباح|بعد الظهر|في المساء|في الليل)/,
abbreviated: /^(ص|م|نصف الليل|ظهراً|في الصباح|بعد الظهر|في المساء|في الليل)/,
wide: /^(ص|م|نصف الليل|في الصباح|ظهراً|بعد الظهر|في المساء|في الليل)/,
any: /^(ص|م|صباح|ظهر|مساء|ليل)/,
};
const parseDayPeriodPatterns = {
any: {
am: /^ص/,
pm: /^م/,
midnight: /^ن/,
noon: /^ظ/,
morning: /^ص/,
afternoon: /^بعد/,
evening: /^م/,
night: /^ل/,
},
};
export const match = {
ordinalNumber: buildMatchPatternFn({
matchPattern: matchOrdinalNumberPattern,
parsePattern: parseOrdinalNumberPattern,
valueCallback: function (value) {
return parseInt(value, 10);
},
}),
era: buildMatchFn({
matchPatterns: matchEraPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseEraPatterns,
defaultParseWidth: "any",
}),
quarter: buildMatchFn({
matchPatterns: matchQuarterPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseQuarterPatterns,
defaultParseWidth: "any",
valueCallback: (index) => index + 1,
}),
month: buildMatchFn({
matchPatterns: matchMonthPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseMonthPatterns,
defaultParseWidth: "any",
}),
day: buildMatchFn({
matchPatterns: matchDayPatterns,
defaultMatchWidth: "wide",
parsePatterns: parseDayPatterns,
defaultParseWidth: "any",
}),
dayPeriod: buildMatchFn({
matchPatterns: matchDayPeriodPatterns,
defaultMatchWidth: "any",
parsePatterns: parseDayPeriodPatterns,
defaultParseWidth: "any",
}),
};
@@ -0,0 +1,47 @@
import { addDatabaseChangeListener } from "expo-sqlite";
import { useEffect, useState } from "react";
import { is } from "../entity.js";
import { SQL } from "../sql/sql.js";
import { getTableConfig, getViewConfig, SQLiteTable, SQLiteView } from "../sqlite-core/index.js";
import { SQLiteRelationalQuery } from "../sqlite-core/query-builders/query.js";
import { Subquery } from "../subquery.js";
const useLiveQuery = (query, deps = []) => {
const [data, setData] = useState(
is(query, SQLiteRelationalQuery) && query.mode === "first" ? void 0 : []
);
const [error, setError] = useState();
const [updatedAt, setUpdatedAt] = useState();
useEffect(() => {
const entity = is(query, SQLiteRelationalQuery) ? query.table : query.config.table;
if (is(entity, Subquery) || is(entity, SQL)) {
setError(new Error("Selecting from subqueries and SQL are not supported in useLiveQuery"));
return;
}
let listener;
const handleData = (data2) => {
setData(data2);
setUpdatedAt(/* @__PURE__ */ new Date());
};
query.then(handleData).catch(setError);
if (is(entity, SQLiteTable) || is(entity, SQLiteView)) {
const config = is(entity, SQLiteTable) ? getTableConfig(entity) : getViewConfig(entity);
listener = addDatabaseChangeListener(({ tableName }) => {
if (config.name === tableName) {
query.then(handleData).catch(setError);
}
});
}
return () => {
listener?.remove();
};
}, deps);
return {
data,
error,
updatedAt
};
};
export {
useLiveQuery
};
//# sourceMappingURL=query.js.map
@@ -0,0 +1,8 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { interval as fn } from "../interval.mjs";
import { convertToFP } from "./_lib/convertToFP.mjs";
export const interval = convertToFP(fn, 2);
// Fallback for modularized imports:
export default interval;
@@ -0,0 +1,8 @@
export declare const BAGGAGE_KEY_PAIR_SEPARATOR = "=";
export declare const BAGGAGE_PROPERTIES_SEPARATOR = ";";
export declare const BAGGAGE_ITEMS_SEPARATOR = ",";
export declare const BAGGAGE_HEADER = "baggage";
export declare const BAGGAGE_MAX_NAME_VALUE_PAIRS = 180;
export declare const BAGGAGE_MAX_PER_NAME_VALUE_PAIRS = 4096;
export declare const BAGGAGE_MAX_TOTAL_LENGTH = 8192;
//# sourceMappingURL=constants.d.ts.map
@@ -0,0 +1,131 @@
"use strict";
Object.defineProperty(exports, "__esModule", {
value: true
});
exports.default = void 0;
var _rng = _interopRequireDefault(require("./rng.js"));
var _stringify = require("./stringify.js");
function _interopRequireDefault(e) { return e && e.__esModule ? e : { default: e }; }
// **`v1()` - Generate time-based UUID**
//
// Inspired by https://github.com/LiosK/UUID.js
// and http://docs.python.org/library/uuid.html
var _nodeId;
var _clockseq;
// Previous uuid creation time
var _lastMSecs = 0;
var _lastNSecs = 0;
// See https://github.com/uuidjs/uuid for API details
function v1(options, buf, offset) {
var i = buf && offset || 0;
var b = buf || new Array(16);
options = options || {};
var node = options.node;
var clockseq = options.clockseq;
// v1 only: Use cached `node` and `clockseq` values
if (!options._v6) {
if (!node) {
node = _nodeId;
}
if (clockseq == null) {
clockseq = _clockseq;
}
}
// Handle cases where we need entropy. We do this lazily to minimize issues
// related to insufficient system entropy. See #189
if (node == null || clockseq == null) {
var seedBytes = options.random || (options.rng || _rng.default)();
// Randomize node
if (node == null) {
node = [seedBytes[0], seedBytes[1], seedBytes[2], seedBytes[3], seedBytes[4], seedBytes[5]];
// v1 only: cache node value for reuse
if (!_nodeId && !options._v6) {
// per RFC4122 4.5: Set MAC multicast bit (v1 only)
node[0] |= 0x01; // Set multicast bit
_nodeId = node;
}
}
// Randomize clockseq
if (clockseq == null) {
// Per 4.2.2, randomize (14 bit) clockseq
clockseq = (seedBytes[6] << 8 | seedBytes[7]) & 0x3fff;
if (_clockseq === undefined && !options._v6) {
_clockseq = clockseq;
}
}
}
// v1 & v6 timestamps are 100 nano-second units since the Gregorian epoch,
// (1582-10-15 00:00). JSNumbers aren't precise enough for this, so time is
// handled internally as 'msecs' (integer milliseconds) and 'nsecs'
// (100-nanoseconds offset from msecs) since unix epoch, 1970-01-01 00:00.
var msecs = options.msecs !== undefined ? options.msecs : Date.now();
// Per 4.2.1.2, use count of uuid's generated during the current clock
// cycle to simulate higher resolution clock
var nsecs = options.nsecs !== undefined ? options.nsecs : _lastNSecs + 1;
// Time since last uuid creation (in msecs)
var dt = msecs - _lastMSecs + (nsecs - _lastNSecs) / 10000;
// Per 4.2.1.2, Bump clockseq on clock regression
if (dt < 0 && options.clockseq === undefined) {
clockseq = clockseq + 1 & 0x3fff;
}
// Reset nsecs if clock regresses (new clockseq) or we've moved onto a new
// time interval
if ((dt < 0 || msecs > _lastMSecs) && options.nsecs === undefined) {
nsecs = 0;
}
// Per 4.2.1.2 Throw error if too many uuids are requested
if (nsecs >= 10000) {
throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");
}
_lastMSecs = msecs;
_lastNSecs = nsecs;
_clockseq = clockseq;
// Per 4.1.4 - Convert from unix epoch to Gregorian epoch
msecs += 12219292800000;
// `time_low`
var tl = ((msecs & 0xfffffff) * 10000 + nsecs) % 0x100000000;
b[i++] = tl >>> 24 & 0xff;
b[i++] = tl >>> 16 & 0xff;
b[i++] = tl >>> 8 & 0xff;
b[i++] = tl & 0xff;
// `time_mid`
var tmh = msecs / 0x100000000 * 10000 & 0xfffffff;
b[i++] = tmh >>> 8 & 0xff;
b[i++] = tmh & 0xff;
// `time_high_and_version`
b[i++] = tmh >>> 24 & 0xf | 0x10; // include version
b[i++] = tmh >>> 16 & 0xff;
// `clock_seq_hi_and_reserved` (Per 4.2.2 - include variant)
b[i++] = clockseq >>> 8 | 0x80;
// `clock_seq_low`
b[i++] = clockseq & 0xff;
// `node`
for (var n = 0; n < 6; ++n) {
b[i + n] = node[n];
}
return buf || (0, _stringify.unsafeStringify)(b);
}
var _default = exports.default = v1;
@@ -0,0 +1,8 @@
/**
* Returns the closest parent element that matches a given selector.
*
* @param node the reference element
* @param selector the selector to match
* @param stopAt stop traversing when this element is found
*/
export default function closest(node: Element, selector: string, stopAt?: Element): Element | null;
@@ -0,0 +1 @@
{"version":3,"file":"SuccessIcon.d.ts","sourceRoot":"","sources":["../../../../../src/modal/components/SuccessIcon.ts"],"names":[],"mappings":"AAOA;;GAEG;AACH,wBAAgB,WAAW,IAAI,UAAU,CA2CxC"}
@@ -0,0 +1,2 @@
export declare const getActivationStart: () => number;
//# sourceMappingURL=getActivationStart.d.ts.map
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/extendDrizzleTable.ts"],"sourcesContent":["/**\n * Implemented from:\n * https://github.com/drizzle-team/drizzle-orm/blob/main/drizzle-orm/src/pg-core/table.ts#L73\n * Drizzle uses @internal JSDoc to remove their internal methods from types, for example\n * Table.Symbol, columnBuilder.build - but they actually exist.\n */\nimport type { ColumnBuilderBase } from 'drizzle-orm'\n\nimport { Table } from 'drizzle-orm'\nimport { APIError } from 'payload'\n\nconst { Symbol: DrizzleSymbol } = Table as unknown as {\n Symbol: {\n Columns: symbol\n ExtraConfigBuilder: symbol\n ExtraConfigColumns: symbol\n }\n}\n\ntype Args = {\n columns?: Record<string, ColumnBuilderBase<any>>\n extraConfig?: (self: Record<string, any>) => object\n table: Table\n}\n\n/**\n * Extends the passed table with additional columns / extra config\n */\nexport const extendDrizzleTable = ({ columns, extraConfig, table }: Args): void => {\n const InlineForeignKeys = Object.getOwnPropertySymbols(table).find((symbol) => {\n return symbol.description?.includes('InlineForeignKeys')\n })\n\n if (!InlineForeignKeys) {\n throw new APIError(`Error when finding InlineForeignKeys Symbol`, 500)\n }\n\n if (columns) {\n for (const [name, columnBuilder] of Object.entries(columns) as [string, any][]) {\n const column = columnBuilder.build(table)\n\n table[name] = column\n table[InlineForeignKeys].push(...columnBuilder.buildForeignKeys(column, table))\n table[DrizzleSymbol.Columns][name] = column\n\n table[DrizzleSymbol.ExtraConfigColumns][name] =\n 'buildExtraConfigColumn' in columnBuilder\n ? columnBuilder.buildExtraConfigColumn(table)\n : column\n }\n }\n\n if (extraConfig) {\n const originalExtraConfigBuilder = table[DrizzleSymbol.ExtraConfigBuilder]\n\n table[DrizzleSymbol.ExtraConfigBuilder] = (t) => {\n return {\n ...originalExtraConfigBuilder(t),\n ...extraConfig(t),\n }\n }\n }\n}\n"],"names":["Table","APIError","Symbol","DrizzleSymbol","extendDrizzleTable","columns","extraConfig","table","InlineForeignKeys","Object","getOwnPropertySymbols","find","symbol","description","includes","name","columnBuilder","entries","column","build","push","buildForeignKeys","Columns","ExtraConfigColumns","buildExtraConfigColumn","originalExtraConfigBuilder","ExtraConfigBuilder","t"],"mappings":"AAAA;;;;;CAKC,GAGD,SAASA,KAAK,QAAQ,cAAa;AACnC,SAASC,QAAQ,QAAQ,UAAS;AAElC,MAAM,EAAEC,QAAQC,aAAa,EAAE,GAAGH;AAclC;;CAEC,GACD,OAAO,MAAMI,qBAAqB,CAAC,EAAEC,OAAO,EAAEC,WAAW,EAAEC,KAAK,EAAQ;IACtE,MAAMC,oBAAoBC,OAAOC,qBAAqB,CAACH,OAAOI,IAAI,CAAC,CAACC;QAClE,OAAOA,OAAOC,WAAW,EAAEC,SAAS;IACtC;IAEA,IAAI,CAACN,mBAAmB;QACtB,MAAM,IAAIP,SAAS,CAAC,2CAA2C,CAAC,EAAE;IACpE;IAEA,IAAII,SAAS;QACX,KAAK,MAAM,CAACU,MAAMC,cAAc,IAAIP,OAAOQ,OAAO,CAACZ,SAA6B;YAC9E,MAAMa,SAASF,cAAcG,KAAK,CAACZ;YAEnCA,KAAK,CAACQ,KAAK,GAAGG;YACdX,KAAK,CAACC,kBAAkB,CAACY,IAAI,IAAIJ,cAAcK,gBAAgB,CAACH,QAAQX;YACxEA,KAAK,CAACJ,cAAcmB,OAAO,CAAC,CAACP,KAAK,GAAGG;YAErCX,KAAK,CAACJ,cAAcoB,kBAAkB,CAAC,CAACR,KAAK,GAC3C,4BAA4BC,gBACxBA,cAAcQ,sBAAsB,CAACjB,SACrCW;QACR;IACF;IAEA,IAAIZ,aAAa;QACf,MAAMmB,6BAA6BlB,KAAK,CAACJ,cAAcuB,kBAAkB,CAAC;QAE1EnB,KAAK,CAACJ,cAAcuB,kBAAkB,CAAC,GAAG,CAACC;YACzC,OAAO;gBACL,GAAGF,2BAA2BE,EAAE;gBAChC,GAAGrB,YAAYqB,EAAE;YACnB;QACF;IACF;AACF,EAAC"}
@@ -0,0 +1,191 @@
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction, and
distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by the copyright
owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all other entities
that control, are controlled by, or are under common control with that entity.
For the purposes of this definition, "control" means (i) the power, direct or
indirect, to cause the direction or management of such entity, whether by
contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity exercising
permissions granted by this License.
"Source" form shall mean the preferred form for making modifications, including
but not limited to software source code, documentation source, and configuration
files.
"Object" form shall mean any form resulting from mechanical transformation or
translation of a Source form, including but not limited to compiled object code,
generated documentation, and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or Object form, made
available under the License, as indicated by a copyright notice that is included
in or attached to the work (an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object form, that
is based on (or derived from) the Work and for which the editorial revisions,
annotations, elaborations, or other modifications represent, as a whole, an
original work of authorship. For the purposes of this License, Derivative Works
shall not include works that remain separable from, or merely link (or bind by
name) to the interfaces of, the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including the original version
of the Work and any modifications or additions to that Work or Derivative Works
thereof, that is intentionally submitted to Licensor for inclusion in the Work
by the copyright owner or by an individual or Legal Entity authorized to submit
on behalf of the copyright owner. For the purposes of this definition,
"submitted" means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems, and
issue tracking systems that are managed by, or on behalf of, the Licensor for
the purpose of discussing and improving the Work, but excluding communication
that is conspicuously marked or otherwise designated in writing by the copyright
owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity on behalf
of whom a Contribution has been received by Licensor and subsequently
incorporated within the Work.
2. Grant of Copyright License.
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the Work and such
Derivative Works in Source or Object form.
3. Grant of Patent License.
Subject to the terms and conditions of this License, each Contributor hereby
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
irrevocable (except as stated in this section) patent license to make, have
made, use, offer to sell, sell, import, and otherwise transfer the Work, where
such license applies only to those patent claims licensable by such Contributor
that are necessarily infringed by their Contribution(s) alone or by combination
of their Contribution(s) with the Work to which such Contribution(s) was
submitted. If You institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work or a
Contribution incorporated within the Work constitutes direct or contributory
patent infringement, then any patent licenses granted to You under this License
for that Work shall terminate as of the date such litigation is filed.
4. Redistribution.
You may reproduce and distribute copies of the Work or Derivative Works thereof
in any medium, with or without modifications, and in Source or Object form,
provided that You meet the following conditions:
You must give any other recipients of the Work or Derivative Works a copy of
this License; and
You must cause any modified files to carry prominent notices stating that You
changed the files; and
You must retain, in the Source form of any Derivative Works that You distribute,
all copyright, patent, trademark, and attribution notices from the Source form
of the Work, excluding those notices that do not pertain to any part of the
Derivative Works; and
If the Work includes a "NOTICE" text file as part of its distribution, then any
Derivative Works that You distribute must include a readable copy of the
attribution notices contained within such NOTICE file, excluding those notices
that do not pertain to any part of the Derivative Works, in at least one of the
following places: within a NOTICE text file distributed as part of the
Derivative Works; within the Source form or documentation, if provided along
with the Derivative Works; or, within a display generated by the Derivative
Works, if and wherever such third-party notices normally appear. The contents of
the NOTICE file are for informational purposes only and do not modify the
License. You may add Your own attribution notices within Derivative Works that
You distribute, alongside or as an addendum to the NOTICE text from the Work,
provided that such additional attribution notices cannot be construed as
modifying the License.
You may add Your own copyright statement to Your modifications and may provide
additional or different license terms and conditions for use, reproduction, or
distribution of Your modifications, or for any such Derivative Works as a whole,
provided Your use, reproduction, and distribution of the Work otherwise complies
with the conditions stated in this License.
5. Submission of Contributions.
Unless You explicitly state otherwise, any Contribution intentionally submitted
for inclusion in the Work by You to the Licensor shall be under the terms and
conditions of this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify the terms of
any separate license agreement you may have executed with Licensor regarding
such Contributions.
6. Trademarks.
This License does not grant permission to use the trade names, trademarks,
service marks, or product names of the Licensor, except as required for
reasonable and customary use in describing the origin of the Work and
reproducing the content of the NOTICE file.
7. Disclaimer of Warranty.
Unless required by applicable law or agreed to in writing, Licensor provides the
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
including, without limitation, any warranties or conditions of TITLE,
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE. You are
solely responsible for determining the appropriateness of using or
redistributing the Work and assume any risks associated with Your exercise of
permissions under this License.
8. Limitation of Liability.
In no event and under no legal theory, whether in tort (including negligence),
contract, or otherwise, unless required by applicable law (such as deliberate
and grossly negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special, incidental,
or consequential damages of any character arising as a result of this License or
out of the use or inability to use the Work (including but not limited to
damages for loss of goodwill, work stoppage, computer failure or malfunction, or
any and all other commercial damages or losses), even if such Contributor has
been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability.
While redistributing the Work or Derivative Works thereof, You may choose to
offer, and charge a fee for, acceptance of support, warranty, indemnity, or
other liability obligations and/or rights consistent with this License. However,
in accepting such obligations, You may act only on Your own behalf and on Your
sole responsibility, not on behalf of any other Contributor, and only if You
agree to indemnify, defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason of your
accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work
To apply the Apache License to your work, attach the following boilerplate
notice, with the fields enclosed by brackets "[]" replaced with your own
identifying information. (Don't include the brackets!) The text should be
enclosed in the appropriate comment syntax for the file format. We also
recommend that a file or class name and description of purpose be included on
the same "printed page" as the copyright notice for easier identification within
third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
@@ -0,0 +1,63 @@
"use strict";
var __defProp = Object.defineProperty;
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
var __getOwnPropNames = Object.getOwnPropertyNames;
var __hasOwnProp = Object.prototype.hasOwnProperty;
var __copyProps = (to, from, except, desc) => {
if (from && typeof from === "object" || typeof from === "function") {
for (let key of __getOwnPropNames(from))
if (!__hasOwnProp.call(to, key) && key !== except)
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
}
return to;
};
var __reExport = (target, mod, secondTarget) => (__copyProps(target, mod, "default"), secondTarget && __copyProps(secondTarget, mod, "default"));
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
var pg_core_exports = {};
module.exports = __toCommonJS(pg_core_exports);
__reExport(pg_core_exports, require("./alias.cjs"), module.exports);
__reExport(pg_core_exports, require("./checks.cjs"), module.exports);
__reExport(pg_core_exports, require("./columns/index.cjs"), module.exports);
__reExport(pg_core_exports, require("./db.cjs"), module.exports);
__reExport(pg_core_exports, require("./dialect.cjs"), module.exports);
__reExport(pg_core_exports, require("./foreign-keys.cjs"), module.exports);
__reExport(pg_core_exports, require("./indexes.cjs"), module.exports);
__reExport(pg_core_exports, require("./policies.cjs"), module.exports);
__reExport(pg_core_exports, require("./primary-keys.cjs"), module.exports);
__reExport(pg_core_exports, require("./query-builders/index.cjs"), module.exports);
__reExport(pg_core_exports, require("./roles.cjs"), module.exports);
__reExport(pg_core_exports, require("./schema.cjs"), module.exports);
__reExport(pg_core_exports, require("./sequence.cjs"), module.exports);
__reExport(pg_core_exports, require("./session.cjs"), module.exports);
__reExport(pg_core_exports, require("./subquery.cjs"), module.exports);
__reExport(pg_core_exports, require("./table.cjs"), module.exports);
__reExport(pg_core_exports, require("./unique-constraint.cjs"), module.exports);
__reExport(pg_core_exports, require("./utils.cjs"), module.exports);
__reExport(pg_core_exports, require("./utils/index.cjs"), module.exports);
__reExport(pg_core_exports, require("./view-common.cjs"), module.exports);
__reExport(pg_core_exports, require("./view.cjs"), module.exports);
// Annotate the CommonJS export names for ESM import in node:
0 && (module.exports = {
...require("./alias.cjs"),
...require("./checks.cjs"),
...require("./columns/index.cjs"),
...require("./db.cjs"),
...require("./dialect.cjs"),
...require("./foreign-keys.cjs"),
...require("./indexes.cjs"),
...require("./policies.cjs"),
...require("./primary-keys.cjs"),
...require("./query-builders/index.cjs"),
...require("./roles.cjs"),
...require("./schema.cjs"),
...require("./sequence.cjs"),
...require("./session.cjs"),
...require("./subquery.cjs"),
...require("./table.cjs"),
...require("./unique-constraint.cjs"),
...require("./utils.cjs"),
...require("./utils/index.cjs"),
...require("./view-common.cjs"),
...require("./view.cjs")
});
//# sourceMappingURL=index.cjs.map
@@ -0,0 +1,8 @@
export { useDraggable } from './useDraggable';
export type { DraggableAttributes, DraggableSyntheticListeners, UseDraggableArguments, } from './useDraggable';
export { useDndContext } from './useDndContext';
export type { UseDndContextReturnValue } from './useDndContext';
export { useDroppable } from './useDroppable';
export type { UseDroppableArguments } from './useDroppable';
export { AutoScrollActivator, MeasuringStrategy, MeasuringFrequency, TraversalOrder, } from './utilities';
export type { AutoScrollOptions, DroppableMeasuring } from './utilities';
@@ -0,0 +1,8 @@
// This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
import { eachMinuteOfInterval as fn } from "../eachMinuteOfInterval.mjs";
import { convertToFP } from "./_lib/convertToFP.mjs";
export const eachMinuteOfInterval = convertToFP(fn, 1);
// Fallback for modularized imports:
export default eachMinuteOfInterval;
@@ -0,0 +1 @@
{"version":3,"sources":["../../../src/pg-core/columns/all.ts"],"sourcesContent":["import { bigint } from './bigint.ts';\nimport { bigserial } from './bigserial.ts';\nimport { boolean } from './boolean.ts';\nimport { char } from './char.ts';\nimport { cidr } from './cidr.ts';\nimport { customType } from './custom.ts';\nimport { date } from './date.ts';\nimport { doublePrecision } from './double-precision.ts';\nimport { inet } from './inet.ts';\nimport { integer } from './integer.ts';\nimport { interval } from './interval.ts';\nimport { json } from './json.ts';\nimport { jsonb } from './jsonb.ts';\nimport { line } from './line.ts';\nimport { macaddr } from './macaddr.ts';\nimport { macaddr8 } from './macaddr8.ts';\nimport { numeric } from './numeric.ts';\nimport { point } from './point.ts';\nimport { geometry } from './postgis_extension/geometry.ts';\nimport { real } from './real.ts';\nimport { serial } from './serial.ts';\nimport { smallint } from './smallint.ts';\nimport { smallserial } from './smallserial.ts';\nimport { text } from './text.ts';\nimport { time } from './time.ts';\nimport { timestamp } from './timestamp.ts';\nimport { uuid } from './uuid.ts';\nimport { varchar } from './varchar.ts';\nimport { bit } from './vector_extension/bit.ts';\nimport { halfvec } from './vector_extension/halfvec.ts';\nimport { sparsevec } from './vector_extension/sparsevec.ts';\nimport { vector } from './vector_extension/vector.ts';\n\nexport function getPgColumnBuilders() {\n\treturn {\n\t\tbigint,\n\t\tbigserial,\n\t\tboolean,\n\t\tchar,\n\t\tcidr,\n\t\tcustomType,\n\t\tdate,\n\t\tdoublePrecision,\n\t\tinet,\n\t\tinteger,\n\t\tinterval,\n\t\tjson,\n\t\tjsonb,\n\t\tline,\n\t\tmacaddr,\n\t\tmacaddr8,\n\t\tnumeric,\n\t\tpoint,\n\t\tgeometry,\n\t\treal,\n\t\tserial,\n\t\tsmallint,\n\t\tsmallserial,\n\t\ttext,\n\t\ttime,\n\t\ttimestamp,\n\t\tuuid,\n\t\tvarchar,\n\t\tbit,\n\t\thalfvec,\n\t\tsparsevec,\n\t\tvector,\n\t};\n}\n\nexport type PgColumnsBuilders = ReturnType<typeof getPgColumnBuilders>;\n"],"mappings":";;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,oBAAuB;AACvB,uBAA0B;AAC1B,qBAAwB;AACxB,kBAAqB;AACrB,kBAAqB;AACrB,oBAA2B;AAC3B,kBAAqB;AACrB,8BAAgC;AAChC,kBAAqB;AACrB,qBAAwB;AACxB,sBAAyB;AACzB,kBAAqB;AACrB,mBAAsB;AACtB,kBAAqB;AACrB,qBAAwB;AACxB,sBAAyB;AACzB,qBAAwB;AACxB,mBAAsB;AACtB,sBAAyB;AACzB,kBAAqB;AACrB,oBAAuB;AACvB,sBAAyB;AACzB,yBAA4B;AAC5B,kBAAqB;AACrB,kBAAqB;AACrB,uBAA0B;AAC1B,kBAAqB;AACrB,qBAAwB;AACxB,iBAAoB;AACpB,qBAAwB;AACxB,uBAA0B;AAC1B,oBAAuB;AAEhB,SAAS,sBAAsB;AACrC,SAAO;AAAA,IACN;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,IACA;AAAA,EACD;AACD;","names":[]}
@@ -0,0 +1,2 @@
import { PickProperties } from "../pick-properties";
export type PickKeys<Type, Value> = keyof PickProperties<Type, Value>;
@@ -0,0 +1,147 @@
import type { ColumnBuilderBase, ColumnBuilderBaseConfig, ColumnBuilderExtraConfig, ColumnBuilderRuntimeConfig, ColumnDataType, HasGenerated } from "../../column-builder.cjs";
import { ColumnBuilder } from "../../column-builder.cjs";
import type { ColumnBaseConfig } from "../../column.cjs";
import { Column } from "../../column.cjs";
import { entityKind } from "../../entity.cjs";
import type { Simplify, Update } from "../../utils.cjs";
import type { UpdateDeleteAction } from "../foreign-keys.cjs";
import type { AnyGelTable, GelTable } from "../table.cjs";
import type { SQL } from "../../sql/sql.cjs";
import type { GelIndexOpClass } from "../indexes.cjs";
export interface ReferenceConfig {
ref: () => GelColumn;
actions: {
onUpdate?: UpdateDeleteAction;
onDelete?: UpdateDeleteAction;
};
}
export interface GelColumnBuilderBase<T extends ColumnBuilderBaseConfig<ColumnDataType, string> = ColumnBuilderBaseConfig<ColumnDataType, string>, TTypeConfig extends object = object> extends ColumnBuilderBase<T, TTypeConfig & {
dialect: 'gel';
}> {
}
export declare abstract class GelColumnBuilder<T extends ColumnBuilderBaseConfig<ColumnDataType, string> = ColumnBuilderBaseConfig<ColumnDataType, string>, TRuntimeConfig extends object = object, TTypeConfig extends object = object, TExtraConfig extends ColumnBuilderExtraConfig = ColumnBuilderExtraConfig> extends ColumnBuilder<T, TRuntimeConfig, TTypeConfig & {
dialect: 'gel';
}, TExtraConfig> implements GelColumnBuilderBase<T, TTypeConfig> {
private foreignKeyConfigs;
static readonly [entityKind]: string;
array<TSize extends number | undefined = undefined>(size?: TSize): GelArrayBuilder<{
name: T['name'];
dataType: 'array';
columnType: 'GelArray';
data: T['data'][];
driverParam: T['driverParam'][] | string;
enumValues: T['enumValues'];
size: TSize;
baseBuilder: T;
} & (T extends {
notNull: true;
} ? {
notNull: true;
} : {}) & (T extends {
hasDefault: true;
} ? {
hasDefault: true;
} : {}), T>;
references(ref: ReferenceConfig['ref'], actions?: ReferenceConfig['actions']): this;
unique(name?: string, config?: {
nulls: 'distinct' | 'not distinct';
}): this;
generatedAlwaysAs(as: SQL | T['data'] | (() => SQL)): HasGenerated<this, {
type: 'always';
}>;
}
export declare abstract class GelColumn<T extends ColumnBaseConfig<ColumnDataType, string> = ColumnBaseConfig<ColumnDataType, string>, TRuntimeConfig extends object = {}, TTypeConfig extends object = {}> extends Column<T, TRuntimeConfig, TTypeConfig & {
dialect: 'gel';
}> {
readonly table: GelTable;
static readonly [entityKind]: string;
constructor(table: GelTable, config: ColumnBuilderRuntimeConfig<T['data'], TRuntimeConfig>);
}
export type IndexedExtraConfigType = {
order?: 'asc' | 'desc';
nulls?: 'first' | 'last';
opClass?: string;
};
export declare class GelExtraConfigColumn<T extends ColumnBaseConfig<ColumnDataType, string> = ColumnBaseConfig<ColumnDataType, string>> extends GelColumn<T, IndexedExtraConfigType> {
static readonly [entityKind]: string;
getSQLType(): string;
indexConfig: IndexedExtraConfigType;
defaultConfig: IndexedExtraConfigType;
asc(): Omit<this, 'asc' | 'desc'>;
desc(): Omit<this, 'asc' | 'desc'>;
nullsFirst(): Omit<this, 'nullsFirst' | 'nullsLast'>;
nullsLast(): Omit<this, 'nullsFirst' | 'nullsLast'>;
/**
* ### PostgreSQL documentation quote
*
* > An operator class with optional parameters can be specified for each column of an index.
* The operator class identifies the operators to be used by the index for that column.
* For example, a B-tree index on four-byte integers would use the int4_ops class;
* this operator class includes comparison functions for four-byte integers.
* In practice the default operator class for the column's data type is usually sufficient.
* The main point of having operator classes is that for some data types, there could be more than one meaningful ordering.
* For example, we might want to sort a complex-number data type either by absolute value or by real part.
* We could do this by defining two operator classes for the data type and then selecting the proper class when creating an index.
* More information about operator classes check:
*
* ### Useful links
* https://www.postgresql.org/docs/current/sql-createindex.html
*
* https://www.postgresql.org/docs/current/indexes-opclass.html
*
* https://www.postgresql.org/docs/current/xindex.html
*
* ### Additional types
* If you have the `Gel_vector` extension installed in your database, you can use the
* `vector_l2_ops`, `vector_ip_ops`, `vector_cosine_ops`, `vector_l1_ops`, `bit_hamming_ops`, `bit_jaccard_ops`, `halfvec_l2_ops`, `sparsevec_l2_ops` options, which are predefined types.
*
* **You can always specify any string you want in the operator class, in case Drizzle doesn't have it natively in its types**
*
* @param opClass
* @returns
*/
op(opClass: GelIndexOpClass): Omit<this, 'op'>;
}
export declare class IndexedColumn {
static readonly [entityKind]: string;
constructor(name: string | undefined, keyAsName: boolean, type: string, indexConfig: IndexedExtraConfigType);
name: string | undefined;
keyAsName: boolean;
type: string;
indexConfig: IndexedExtraConfigType;
}
export type AnyGelColumn<TPartial extends Partial<ColumnBaseConfig<ColumnDataType, string>> = {}> = GelColumn<Required<Update<ColumnBaseConfig<ColumnDataType, string>, TPartial>>>;
export type GelArrayColumnBuilderBaseConfig = ColumnBuilderBaseConfig<'array', 'GelArray'> & {
size: number | undefined;
baseBuilder: ColumnBuilderBaseConfig<ColumnDataType, string>;
};
export declare class GelArrayBuilder<T extends GelArrayColumnBuilderBaseConfig, TBase extends ColumnBuilderBaseConfig<ColumnDataType, string> | GelArrayColumnBuilderBaseConfig> extends GelColumnBuilder<T, {
baseBuilder: TBase extends GelArrayColumnBuilderBaseConfig ? GelArrayBuilder<TBase, TBase extends {
baseBuilder: infer TBaseBuilder extends ColumnBuilderBaseConfig<any, any>;
} ? TBaseBuilder : never> : GelColumnBuilder<TBase, {}, Simplify<Omit<TBase, keyof ColumnBuilderBaseConfig<any, any>>>>;
size: T['size'];
}, {
baseBuilder: TBase extends GelArrayColumnBuilderBaseConfig ? GelArrayBuilder<TBase, TBase extends {
baseBuilder: infer TBaseBuilder extends ColumnBuilderBaseConfig<any, any>;
} ? TBaseBuilder : never> : GelColumnBuilder<TBase, {}, Simplify<Omit<TBase, keyof ColumnBuilderBaseConfig<any, any>>>>;
size: T['size'];
}> {
static readonly [entityKind] = "GelArrayBuilder";
constructor(name: string, baseBuilder: GelArrayBuilder<T, TBase>['config']['baseBuilder'], size: T['size']);
}
export declare class GelArray<T extends ColumnBaseConfig<'array', 'GelArray'> & {
size: number | undefined;
baseBuilder: ColumnBuilderBaseConfig<ColumnDataType, string>;
}, TBase extends ColumnBuilderBaseConfig<ColumnDataType, string>> extends GelColumn<T, {}, {
size: T['size'];
baseBuilder: T['baseBuilder'];
}> {
readonly baseColumn: GelColumn;
readonly range?: [number | undefined, number | undefined] | undefined;
readonly size: T['size'];
static readonly [entityKind]: string;
constructor(table: AnyGelTable<{
name: T['tableName'];
}>, config: GelArrayBuilder<T, TBase>['config'], baseColumn: GelColumn, range?: [number | undefined, number | undefined] | undefined);
getSQLType(): string;
}
@@ -0,0 +1,29 @@
import type { ContextOptions, DateArg } from "./types.js";
/**
* The {@link differenceInYears} function options.
*/
export interface DifferenceInYearsOptions extends ContextOptions<Date> {}
/**
* @name differenceInYears
* @category Year Helpers
* @summary Get the number of full years between the given dates.
*
* @description
* Get the number of full years between the given dates.
*
* @param laterDate - The later date
* @param earlierDate - The earlier date
* @param options - An object with options
*
* @returns The number of full years
*
* @example
* // How many full years are between 31 December 2013 and 11 February 2015?
* const result = differenceInYears(new Date(2015, 1, 11), new Date(2013, 11, 31))
* //=> 1
*/
export declare function differenceInYears(
laterDate: DateArg<Date> & {},
earlierDate: DateArg<Date> & {},
options?: DifferenceInYearsOptions | undefined,
): number;
@@ -0,0 +1 @@
{"version":3,"file":"InMemorySpanExporter.js","sourceRoot":"","sources":["../../../src/export/InMemorySpanExporter.ts"],"names":[],"mappings":";AAAA;;;;;;;;;;;;;;GAcG;;;AAIH,8CAAqE;AAErE;;;;GAIG;AACH,MAAa,oBAAoB;IACvB,cAAc,GAAmB,EAAE,CAAC;IAC5C;;;OAGG;IACO,QAAQ,GAAG,KAAK,CAAC;IAE3B,MAAM,CACJ,KAAqB,EACrB,cAA8C;QAE9C,IAAI,IAAI,CAAC,QAAQ;YACf,OAAO,cAAc,CAAC;gBACpB,IAAI,EAAE,uBAAgB,CAAC,MAAM;gBAC7B,KAAK,EAAE,IAAI,KAAK,CAAC,2BAA2B,CAAC;aAC9C,CAAC,CAAC;QACL,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,KAAK,CAAC,CAAC;QAEnC,UAAU,CAAC,GAAG,EAAE,CAAC,cAAc,CAAC,EAAE,IAAI,EAAE,uBAAgB,CAAC,OAAO,EAAE,CAAC,EAAE,CAAC,CAAC,CAAC;IAC1E,CAAC;IAED,QAAQ;QACN,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC;QACrB,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;QACzB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;IAED;;OAEG;IACH,UAAU;QACR,OAAO,OAAO,CAAC,OAAO,EAAE,CAAC;IAC3B,CAAC;IAED,KAAK;QACH,IAAI,CAAC,cAAc,GAAG,EAAE,CAAC;IAC3B,CAAC;IAED,gBAAgB;QACd,OAAO,IAAI,CAAC,cAAc,CAAC;IAC7B,CAAC;CACF;AA1CD,oDA0CC","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 { SpanExporter } from './SpanExporter';\nimport { ReadableSpan } from './ReadableSpan';\nimport { ExportResult, ExportResultCode } from '@opentelemetry/core';\n\n/**\n * This class can be used for testing purposes. It stores the exported spans\n * in a list in memory that can be retrieved using the `getFinishedSpans()`\n * method.\n */\nexport class InMemorySpanExporter implements SpanExporter {\n private _finishedSpans: ReadableSpan[] = [];\n /**\n * Indicates if the exporter has been \"shutdown.\"\n * When false, exported spans will not be stored in-memory.\n */\n protected _stopped = false;\n\n export(\n spans: ReadableSpan[],\n resultCallback: (result: ExportResult) => void\n ): void {\n if (this._stopped)\n return resultCallback({\n code: ExportResultCode.FAILED,\n error: new Error('Exporter has been stopped'),\n });\n this._finishedSpans.push(...spans);\n\n setTimeout(() => resultCallback({ code: ExportResultCode.SUCCESS }), 0);\n }\n\n shutdown(): Promise<void> {\n this._stopped = true;\n this._finishedSpans = [];\n return this.forceFlush();\n }\n\n /**\n * Exports any pending spans in the exporter\n */\n forceFlush(): Promise<void> {\n return Promise.resolve();\n }\n\n reset(): void {\n this._finishedSpans = [];\n }\n\n getFinishedSpans(): ReadableSpan[] {\n return this._finishedSpans;\n }\n}\n"]}
@@ -0,0 +1 @@
{"version":3,"file":"index.instrumentopenaiclient.d.ts","sourceRoot":"","sources":["../../../../src/integrations-bundle/index.instrumentopenaiclient.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,sBAAsB,EAAE,MAAM,cAAc,CAAC"}
@@ -0,0 +1,21 @@
/**
* Method configuration and request processing for MCP server instrumentation
*/
/**
* Extracts target info from method and params based on method type
* @param method - MCP method name
* @param params - Method parameters
* @returns Target name and attributes for span instrumentation
*/
export declare function extractTargetInfo(method: string, params: Record<string, unknown>): {
target?: string;
attributes: Record<string, string>;
};
/**
* Extracts request arguments based on method type
* @param method - MCP method name
* @param params - Method parameters
* @returns Arguments as span attributes with mcp.request.argument prefix
*/
export declare function getRequestArguments(method: string, params: Record<string, unknown>): Record<string, string>;
//# sourceMappingURL=methodConfig.d.ts.map
@@ -0,0 +1,38 @@
{
"name": "commander",
"version": "2.20.3",
"description": "the complete solution for node.js command-line programs",
"keywords": [
"commander",
"command",
"option",
"parser"
],
"author": "TJ Holowaychuk <tj@vision-media.ca>",
"license": "MIT",
"repository": {
"type": "git",
"url": "https://github.com/tj/commander.js.git"
},
"scripts": {
"lint": "eslint index.js",
"test": "node test/run.js && npm run test-typings",
"test-typings": "tsc -p tsconfig.json"
},
"main": "index",
"files": [
"index.js",
"typings/index.d.ts"
],
"dependencies": {},
"devDependencies": {
"@types/node": "^12.7.8",
"eslint": "^6.4.0",
"should": "^13.2.3",
"sinon": "^7.5.0",
"standard": "^14.3.1",
"ts-node": "^8.4.1",
"typescript": "^3.6.3"
},
"typings": "typings/index.d.ts"
}
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/neon-serverless/index.ts"],"sourcesContent":["export * from './driver.ts';\nexport * from './session.ts';\n"],"mappings":"AAAA,cAAc;AACd,cAAc;","names":[]}
@@ -0,0 +1,22 @@
Copyright (c) 2021 Niklas von Hertzen
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 @@
{"version":3,"file":"reactrouter.d.ts","sourceRoot":"","sources":["../../src/reactrouter.tsx"],"names":[],"mappings":"AAAA,OAAO,EACL,yBAAyB,EAI1B,MAAM,iBAAiB,CAAC;AACzB,OAAO,KAAK,EAAU,WAAW,EAA2B,MAAM,cAAc,CAAC;AAUjF,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,OAAO,CAAC;AAC1C,OAAO,KAAK,KAAK,MAAM,OAAO,CAAC;AAE/B,OAAO,KAAK,EAAE,MAAM,EAAE,QAAQ,EAAE,MAAM,SAAS,CAAC;AAIhD,KAAK,KAAK,GAAG;IAAE,IAAI,EAAE,MAAM,CAAC;IAAC,GAAG,EAAE,MAAM,CAAC;IAAC,MAAM,EAAE,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;IAAC,OAAO,EAAE,OAAO,CAAA;CAAE,CAAC;AAE1F,MAAM,MAAM,aAAa,GAAG;IAC1B,QAAQ,CAAC,EAAE,QAAQ,CAAC;IACpB,MAAM,CAAC,CAAC,EAAE,EAAE,CAAC,QAAQ,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,KAAK,IAAI,GAAG,IAAI,CAAC;CACjE,GAAG,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,CAAC;AAExB,MAAM,MAAM,WAAW,GAAG;IACxB,CAAC,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC;IAC5B,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,EAAE,CAAC;IACzB,KAAK,CAAC,EAAE,OAAO,CAAC;IAChB,SAAS,CAAC,EAAE,YAAY,CAAC;IACzB,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;CACxB,CAAC;AAEF,MAAM,MAAM,SAAS,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,EAAE,GAAG,GAAG,EAAE,MAAM,CAAC,EAAE,KAAK,GAAG,IAAI,KAAK,KAAK,GAAG,IAAI,CAAC;AAElH,UAAU,kBAAkB;IAC1B,OAAO,EAAE,aAAa,CAAC;IACvB,MAAM,CAAC,EAAE,WAAW,EAAE,CAAC;IACvB,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED;;;GAGG;AACH,wBAAgB,sCAAsC,CACpD,OAAO,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,GAAG,kBAAkB,GAC5E,WAAW,CAyBb;AAED;;;GAGG;AACH,wBAAgB,sCAAsC,CACpD,OAAO,EAAE,UAAU,CAAC,OAAO,yBAAyB,CAAC,CAAC,CAAC,CAAC,GAAG,kBAAkB,GAC5E,WAAW,CAyBb;AAiHD,wBAAgB,iBAAiB,CAAC,CAAC,SAAS,MAAM,CAAC,MAAM,EAAE,GAAG,CAAC,EAAE,CAAC,SAAS,KAAK,CAAC,aAAa,CAAC,CAAC,CAAC,EAAE,KAAK,EAAE,CAAC,GAAG,CAAC,CA4B9G"}
@@ -0,0 +1,28 @@
var createCompounder = require('./_createCompounder');
/**
* Converts `string` to
* [snake case](https://en.wikipedia.org/wiki/Snake_case).
*
* @static
* @memberOf _
* @since 3.0.0
* @category String
* @param {string} [string=''] The string to convert.
* @returns {string} Returns the snake cased string.
* @example
*
* _.snakeCase('Foo Bar');
* // => 'foo_bar'
*
* _.snakeCase('fooBar');
* // => 'foo_bar'
*
* _.snakeCase('--FOO-BAR--');
* // => 'foo_bar'
*/
var snakeCase = createCompounder(function(result, word, index) {
return result + (index ? '_' : '') + word.toLowerCase();
});
module.exports = snakeCase;
@@ -0,0 +1,6 @@
import type { GenerateEditViewMetadata } from '../Document/getMetaBySegment.js';
/**
* @todo Remove the `MetaConfig` type assertions. They are currently required because of how the `Metadata` type from `next` consumes the `URL` type.
*/
export declare const generateAPIViewMetadata: GenerateEditViewMetadata;
//# sourceMappingURL=metadata.d.ts.map
@@ -0,0 +1,10 @@
"use strict";
exports.getWeekYear = void 0;
var _index = require("../getWeekYear.js");
var _index2 = require("./_lib/convertToFP.js"); // 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,11 @@
const formatRelativeLocale = {
lastWeek: "eeee 'pase nan lè' p",
yesterday: "'yè nan lè' p",
today: "'jodi a' p",
tomorrow: "'demen nan lè' p'",
nextWeek: "eeee 'pwochen nan lè' p",
other: "P",
};
export const formatRelative = (token, _date, _baseDate, _options) =>
formatRelativeLocale[token];
@@ -0,0 +1,10 @@
import type { Span } from '../types-hoist/span';
/**
* Print a log message for a started span.
*/
export declare function logSpanStart(span: Span): void;
/**
* Print a log message for an ended span.
*/
export declare function logSpanEnd(span: Span): void;
//# sourceMappingURL=logSpans.d.ts.map
@@ -0,0 +1,254 @@
import { executeAccess } from '../../auth/executeAccess.js';
import { combineQueries } from '../../database/combineQueries.js';
import { sanitizeJoinQuery } from '../../database/sanitizeJoinQuery.js';
import { sanitizeWhereQuery } from '../../database/sanitizeWhereQuery.js';
import { NotFound } from '../../errors/index.js';
import { afterRead } from '../../fields/hooks/afterRead/index.js';
import { validateQueryPaths } from '../../index.js';
import { lockedDocumentsCollectionSlug } from '../../locked-documents/config.js';
import { appendNonTrashedFilter } from '../../utilities/appendNonTrashedFilter.js';
import { getSelectMode } from '../../utilities/getSelectMode.js';
import { hasDraftsEnabled } from '../../utilities/getVersionsConfig.js';
import { killTransaction } from '../../utilities/killTransaction.js';
import { sanitizeSelect } from '../../utilities/sanitizeSelect.js';
import { replaceWithDraftIfAvailable } from '../../versions/drafts/replaceWithDraftIfAvailable.js';
import { buildAfterOperation } from './utilities/buildAfterOperation.js';
import { buildBeforeOperation } from './utilities/buildBeforeOperation.js';
export const findByIDOperation = async (incomingArgs)=>{
let args = incomingArgs;
try {
// /////////////////////////////////////
// beforeOperation - Collection
// /////////////////////////////////////
args = await buildBeforeOperation({
args,
collection: args.collection.config,
operation: 'read',
overrideAccess: args.overrideAccess
});
const { id, collection: { config: collectionConfig }, currentDepth, depth, disableErrors, draft: replaceWithVersion = false, flattenLocales, includeLockStatus: includeLockStatusFromArgs, joins, overrideAccess = false, populate, req: { fallbackLocale, locale, t }, req, select: incomingSelect, showHiddenFields, trash = false } = args;
const includeLockStatus = includeLockStatusFromArgs && req.payload.collections?.[lockedDocumentsCollectionSlug];
const select = sanitizeSelect({
fields: collectionConfig.flattenedFields,
forceSelect: collectionConfig.forceSelect,
select: incomingSelect
});
// /////////////////////////////////////
// Access
// /////////////////////////////////////
const accessResult = !overrideAccess ? await executeAccess({
id,
disableErrors,
req
}, collectionConfig.access.read) : true;
// If errors are disabled, and access returns false, return null
if (accessResult === false) {
return null;
}
const where = {
id: {
equals: id
}
};
let fullWhere = combineQueries(where, accessResult);
// Exclude trashed documents when trash: false
fullWhere = appendNonTrashedFilter({
enableTrash: collectionConfig.trash,
trash,
where: fullWhere
});
sanitizeWhereQuery({
fields: collectionConfig.flattenedFields,
payload: args.req.payload,
where: fullWhere
});
const sanitizedJoins = await sanitizeJoinQuery({
collectionConfig,
joins,
overrideAccess,
req
});
// execute only if there's a custom ID and potentially overwriten access on id
if (req.payload.collections[collectionConfig.slug].customIDType) {
await validateQueryPaths({
collectionConfig,
overrideAccess,
req,
where
});
}
// /////////////////////////////////////
// Find by ID
// /////////////////////////////////////
let dbSelect = select;
if (collectionConfig.versions?.drafts && replaceWithVersion && select && getSelectMode(select) === 'include') {
dbSelect = {
...select,
createdAt: true,
updatedAt: true
};
}
const findOneArgs = {
collection: collectionConfig.slug,
draftsEnabled: replaceWithVersion,
joins: req.payloadAPI === 'GraphQL' ? false : sanitizedJoins,
locale: locale,
req: {
transactionID: req.transactionID
},
select: dbSelect,
where: fullWhere
};
if (!findOneArgs.where?.and?.[0]?.id) {
throw new NotFound(t);
}
const docFromDB = await req.payload.db.findOne(findOneArgs);
if (!docFromDB && !args.data) {
if (!disableErrors) {
throw new NotFound(req.t);
}
return null;
}
let result = args.data ?? docFromDB;
// /////////////////////////////////////
// Add collection property for auth collections
// /////////////////////////////////////
if (collectionConfig.auth) {
result = {
...result,
collection: collectionConfig.slug
};
}
// /////////////////////////////////////
// Include Lock Status if required
// /////////////////////////////////////
if (includeLockStatus && id) {
let lockStatus = null;
try {
const lockDocumentsProp = collectionConfig?.lockDocuments;
const lockDurationDefault = 300 // Default 5 minutes in seconds
;
const lockDuration = typeof lockDocumentsProp === 'object' ? lockDocumentsProp.duration : lockDurationDefault;
const lockDurationInMilliseconds = lockDuration * 1000;
const lockedDocument = await req.payload.find({
collection: lockedDocumentsCollectionSlug,
depth: 1,
limit: 1,
overrideAccess: false,
pagination: false,
req,
where: {
and: [
{
'document.relationTo': {
equals: collectionConfig.slug
}
},
{
'document.value': {
equals: id
}
},
// Query where the lock is newer than the current time minus lock time
{
updatedAt: {
greater_than: new Date(new Date().getTime() - lockDurationInMilliseconds)
}
}
]
}
});
if (lockedDocument && lockedDocument.docs.length > 0) {
lockStatus = lockedDocument.docs[0];
}
} catch {
// swallow error
}
result._isLocked = !!lockStatus;
result._userEditing = lockStatus?.user?.value ?? null;
}
// /////////////////////////////////////
// Replace document with draft if available
// /////////////////////////////////////
if (replaceWithVersion && hasDraftsEnabled(collectionConfig)) {
result = await replaceWithDraftIfAvailable({
accessResult,
doc: result,
entity: collectionConfig,
entityType: 'collection',
overrideAccess,
req,
select
});
}
// /////////////////////////////////////
// beforeRead - Collection
// /////////////////////////////////////
if (collectionConfig.hooks?.beforeRead?.length) {
for (const hook of collectionConfig.hooks.beforeRead){
result = await hook({
collection: collectionConfig,
context: req.context,
doc: result,
overrideAccess,
query: findOneArgs.where,
req
}) || result;
}
}
// /////////////////////////////////////
// afterRead - Fields
// /////////////////////////////////////
result = await afterRead({
collection: collectionConfig,
context: req.context,
currentDepth,
depth: depth,
doc: result,
draft: replaceWithVersion,
fallbackLocale: fallbackLocale,
flattenLocales,
global: null,
locale: locale,
overrideAccess,
populate,
req,
select,
showHiddenFields: showHiddenFields
});
// /////////////////////////////////////
// afterRead - Collection
// /////////////////////////////////////
if (collectionConfig.hooks?.afterRead?.length) {
for (const hook of collectionConfig.hooks.afterRead){
result = await hook({
collection: collectionConfig,
context: req.context,
doc: result,
overrideAccess,
query: findOneArgs.where,
req
}) || result;
}
}
// /////////////////////////////////////
// afterOperation - Collection
// /////////////////////////////////////
result = await buildAfterOperation({
args,
collection: collectionConfig,
operation: 'findByID',
overrideAccess,
result
});
// /////////////////////////////////////
// Return results
// /////////////////////////////////////
return result;
} catch (error) {
await killTransaction(args.req);
throw error;
}
};
//# sourceMappingURL=findByID.js.map
@@ -0,0 +1,12 @@
import { _ as _class_apply_descriptor_set } from "./_class_apply_descriptor_set.js";
import { _ as _class_check_private_static_access } from "./_class_check_private_static_access.js";
import { _ as _class_check_private_static_field_descriptor } from "./_class_check_private_static_field_descriptor.js";
function _class_static_private_field_spec_set(receiver, classConstructor, descriptor, value) {
_class_check_private_static_access(receiver, classConstructor);
_class_check_private_static_field_descriptor(descriptor, "set");
_class_apply_descriptor_set(receiver, descriptor, value);
return value;
}
export { _class_static_private_field_spec_set as _ };
@@ -0,0 +1 @@
export { _ as default } from "../esm/_class_private_field_get.js";
@@ -0,0 +1,25 @@
{
'defines': [ 'NAPI_CPP_EXCEPTIONS' ],
'cflags!': [ '-fno-exceptions' ],
'cflags_cc!': [ '-fno-exceptions' ],
'conditions': [
["OS=='win'", {
"defines": [
"_HAS_EXCEPTIONS=1"
],
"msvs_settings": {
"VCCLCompilerTool": {
"ExceptionHandling": 1,
'EnablePREfast': 'true',
},
},
}],
["OS=='mac'", {
'xcode_settings': {
'GCC_ENABLE_CPP_EXCEPTIONS': 'YES',
'CLANG_CXX_LIBRARY': 'libc++',
'MACOSX_DEPLOYMENT_TARGET': '10.7',
},
}],
],
}
@@ -0,0 +1,10 @@
'use strict'
const { readFileSync, writeFileSync } = require('node:fs')
const { transcode } = require('node:buffer')
const buffer = transcode
? transcode(readFileSync('./undici-fetch.js'), 'utf8', 'latin1')
: readFileSync('./undici-fetch.js')
writeFileSync('./undici-fetch.js', buffer.toString('latin1'))
@@ -0,0 +1,110 @@
(function () {
if (typeof Prism === 'undefined') {
return;
}
/**
* @callback ClassMapper
* @param {string} className
* @param {string} language
* @returns {string}
*
* @callback ClassAdder
* @param {ClassAdderEnvironment} env
* @returns {undefined | string | string[]}
*
* @typedef ClassAdderEnvironment
* @property {string} language
* @property {string} type
* @property {string} content
*/
// options
/** @type {ClassAdder | undefined} */
var adder;
/** @type {ClassMapper | undefined} */
var mapper;
/** @type {string} */
var prefixString = '';
/**
* @param {string} className
* @param {string} language
*/
function apply(className, language) {
return prefixString + (mapper ? mapper(className, language) : className);
}
Prism.plugins.customClass = {
/**
* Sets the function which can be used to add custom aliases to any token.
*
* @param {ClassAdder} classAdder
*/
add: function (classAdder) {
adder = classAdder;
},
/**
* Maps all class names using the given object or map function.
*
* This does not affect the prefix.
*
* @param {Object<string, string> | ClassMapper} classMapper
*/
map: function map(classMapper) {
if (typeof classMapper === 'function') {
mapper = classMapper;
} else {
mapper = function (className) {
return classMapper[className] || className;
};
}
},
/**
* Adds the given prefix to all class names.
*
* @param {string} string
*/
prefix: function prefix(string) {
prefixString = string || '';
},
/**
* Applies the current mapping and prefix to the given class name.
*
* @param {string} className A single class name.
* @param {string} language The language of the code that contains this class name.
*
* If the language is unknown, pass `"none"`.
*/
apply: apply
};
Prism.hooks.add('wrap', function (env) {
if (adder) {
var result = adder({
content: env.content,
type: env.type,
language: env.language
});
if (Array.isArray(result)) {
env.classes.push.apply(env.classes, result);
} else if (result) {
env.classes.push(result);
}
}
if (!mapper && !prefixString) {
return;
}
env.classes = env.classes.map(function (c) {
return apply(c, env.language);
});
});
}());
@@ -0,0 +1,30 @@
/// <reference types="node" />
import type { Headers } from './fetch'
export interface Cookie {
name: string
value: string
expires?: Date | number
maxAge?: number
domain?: string
path?: string
secure?: boolean
httpOnly?: boolean
sameSite?: 'Strict' | 'Lax' | 'None'
unparsed?: string[]
}
export function deleteCookie (
headers: Headers,
name: string,
attributes?: { name?: string, domain?: string }
): void
export function getCookies (headers: Headers): Record<string, string>
export function getSetCookies (headers: Headers): Cookie[]
export function setCookie (headers: Headers, cookie: Cookie): void
export function parseCookie (cookie: string): Cookie | null
@@ -0,0 +1 @@
{"version":3,"file":"arrow-up-wide-narrow.js","sources":["../../../src/icons/arrow-up-wide-narrow.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name ArrowUpWideNarrow\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJtMyA4IDQtNCA0IDQiIC8+CiAgPHBhdGggZD0iTTcgNHYxNiIgLz4KICA8cGF0aCBkPSJNMTEgMTJoMTAiIC8+CiAgPHBhdGggZD0iTTExIDE2aDciIC8+CiAgPHBhdGggZD0iTTExIDIwaDQiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/arrow-up-wide-narrow\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 ArrowUpWideNarrow = createLucideIcon('ArrowUpWideNarrow', [\n ['path', { d: 'm3 8 4-4 4 4', key: '11wl7u' }],\n ['path', { d: 'M7 4v16', key: '1glfcx' }],\n ['path', { d: 'M11 12h10', key: '1438ji' }],\n ['path', { d: 'M11 16h7', key: 'uosisv' }],\n ['path', { d: 'M11 20h4', key: '1krc32' }],\n]);\n\nexport default ArrowUpWideNarrow;\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,CAAoB,iBAAiB,mBAAqB,CAAA,CAAA,CAAA;AAAA,CAAA,CAC9D,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,CAAgB,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,UAAU,CAAA,CAAA;AAAA,CAAA,CAC7C,CAAC,CAAA,CAAA,CAAA,CAAA,CAAA,CAAQ,CAAA,CAAA,CAAA,CAAE,GAAG,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,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,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,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,144 @@
import { AST } from './ast.js';
export type Platform = 'aix' | 'android' | 'darwin' | 'freebsd' | 'haiku' | 'linux' | 'openbsd' | 'sunos' | 'win32' | 'cygwin' | 'netbsd';
export interface MinimatchOptions {
/** do not expand `{x,y}` style braces */
nobrace?: boolean;
/** do not treat patterns starting with `#` as a comment */
nocomment?: boolean;
/** do not treat patterns starting with `!` as a negation */
nonegate?: boolean;
/** print LOTS of debugging output */
debug?: boolean;
/** treat `**` the same as `*` */
noglobstar?: boolean;
/** do not expand extglobs like `+(a|b)` */
noext?: boolean;
/** return the pattern if nothing matches */
nonull?: boolean;
/** treat `\\` as a path separator, not an escape character */
windowsPathsNoEscape?: boolean;
/**
* inverse of {@link MinimatchOptions.windowsPathsNoEscape}
* @deprecated
*/
allowWindowsEscape?: boolean;
/**
* Compare a partial path to a pattern. As long as the parts
* of the path that are present are not contradicted by the
* pattern, it will be treated as a match. This is useful in
* applications where you're walking through a folder structure,
* and don't yet have the full path, but want to ensure that you
* do not walk down paths that can never be a match.
*/
partial?: boolean;
/** allow matches that start with `.` even if the pattern does not */
dot?: boolean;
/** ignore case */
nocase?: boolean;
/** ignore case only in wildcard patterns */
nocaseMagicOnly?: boolean;
/** consider braces to be "magic" for the purpose of `hasMagic` */
magicalBraces?: boolean;
/**
* If set, then patterns without slashes will be matched
* against the basename of the path if it contains slashes.
* For example, `a?b` would match the path `/xyz/123/acb`, but
* not `/xyz/acb/123`.
*/
matchBase?: boolean;
/** invert the results of negated matches */
flipNegate?: boolean;
/** do not collapse multiple `/` into a single `/` */
preserveMultipleSlashes?: boolean;
/**
* A number indicating the level of optimization that should be done
* to the pattern prior to parsing and using it for matches.
*/
optimizationLevel?: number;
/** operating system platform */
platform?: Platform;
/**
* When a pattern starts with a UNC path or drive letter, and in
* `nocase:true` mode, do not convert the root portions of the
* pattern into a case-insensitive regular expression, and instead
* leave them as strings.
*
* This is the default when the platform is `win32` and
* `nocase:true` is set.
*/
windowsNoMagicRoot?: boolean;
/**
* max number of `{...}` patterns to expand. Default 100_000.
*/
braceExpandMax?: number;
}
export declare const minimatch: {
(p: string, pattern: string, options?: MinimatchOptions): boolean;
sep: Sep;
GLOBSTAR: typeof GLOBSTAR;
filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
defaults: (def: MinimatchOptions) => typeof minimatch;
braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
AST: typeof AST;
Minimatch: typeof Minimatch;
escape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
unescape: (s: string, { windowsPathsNoEscape, magicalBraces, }?: Pick<MinimatchOptions, "windowsPathsNoEscape" | "magicalBraces">) => string;
};
export type Sep = '\\' | '/';
export declare const sep: Sep;
export declare const GLOBSTAR: unique symbol;
export declare const filter: (pattern: string, options?: MinimatchOptions) => (p: string) => boolean;
export declare const defaults: (def: MinimatchOptions) => typeof minimatch;
export declare const braceExpand: (pattern: string, options?: MinimatchOptions) => string[];
export declare const makeRe: (pattern: string, options?: MinimatchOptions) => false | MMRegExp;
export declare const match: (list: string[], pattern: string, options?: MinimatchOptions) => string[];
export type MMRegExp = RegExp & {
_src?: string;
_glob?: string;
};
export type ParseReturnFiltered = string | MMRegExp | typeof GLOBSTAR;
export type ParseReturn = ParseReturnFiltered | false;
export declare class Minimatch {
options: MinimatchOptions;
set: ParseReturnFiltered[][];
pattern: string;
windowsPathsNoEscape: boolean;
nonegate: boolean;
negate: boolean;
comment: boolean;
empty: boolean;
preserveMultipleSlashes: boolean;
partial: boolean;
globSet: string[];
globParts: string[][];
nocase: boolean;
isWindows: boolean;
platform: Platform;
windowsNoMagicRoot: boolean;
regexp: false | null | MMRegExp;
constructor(pattern: string, options?: MinimatchOptions);
hasMagic(): boolean;
debug(..._: any[]): void;
make(): void;
preprocess(globParts: string[][]): string[][];
adjascentGlobstarOptimize(globParts: string[][]): string[][];
levelOneOptimize(globParts: string[][]): string[][];
levelTwoFileOptimize(parts: string | string[]): string[];
firstPhasePreProcess(globParts: string[][]): string[][];
secondPhasePreProcess(globParts: string[][]): string[][];
partsMatch(a: string[], b: string[], emptyGSMatch?: boolean): false | string[];
parseNegate(): void;
matchOne(file: string[], pattern: ParseReturn[], partial?: boolean): boolean;
braceExpand(): string[];
parse(pattern: string): ParseReturn;
makeRe(): false | MMRegExp;
slashSplit(p: string): string[];
match(f: string, partial?: boolean): boolean;
static defaults(def: MinimatchOptions): typeof Minimatch;
}
export { AST } from './ast.js';
export { escape } from './escape.js';
export { unescape } from './unescape.js';
//# sourceMappingURL=index.d.ts.map
@@ -0,0 +1,37 @@
import { encoder, decoder } from '../lib/buffer_utils.js';
export const encodeBase64 = (input) => {
let unencoded = input;
if (typeof unencoded === 'string') {
unencoded = encoder.encode(unencoded);
}
const CHUNK_SIZE = 0x8000;
const arr = [];
for (let i = 0; i < unencoded.length; i += CHUNK_SIZE) {
arr.push(String.fromCharCode.apply(null, unencoded.subarray(i, i + CHUNK_SIZE)));
}
return btoa(arr.join(''));
};
export const encode = (input) => {
return encodeBase64(input).replace(/=/g, '').replace(/\+/g, '-').replace(/\//g, '_');
};
export const decodeBase64 = (encoded) => {
const binary = atob(encoded);
const bytes = new Uint8Array(binary.length);
for (let i = 0; i < binary.length; i++) {
bytes[i] = binary.charCodeAt(i);
}
return bytes;
};
export const decode = (input) => {
let encoded = input;
if (encoded instanceof Uint8Array) {
encoded = decoder.decode(encoded);
}
encoded = encoded.replace(/-/g, '+').replace(/_/g, '/').replace(/\s/g, '');
try {
return decodeBase64(encoded);
}
catch {
throw new TypeError('The input to be decoded is not correctly encoded.');
}
};
@@ -0,0 +1 @@
{"version":3,"file":"getMachineId.js","sourceRoot":"","sources":["../../../../../../src/detectors/platform/node/machine-id/getMachineId.ts"],"names":[],"mappings":";;;AAAA;;;;;;;;;;;;;;GAcG;AACH,mCAAmC;AAEnC,IAAI,gBAAiE,CAAC;AAE/D,KAAK,UAAU,YAAY;IAChC,IAAI,CAAC,gBAAgB,EAAE;QACrB,QAAQ,OAAO,CAAC,QAAQ,EAAE;YACxB,KAAK,QAAQ;gBACX,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,0BAA0B,CAAC,CAAC;qBAC1D,YAAY,CAAC;gBAChB,MAAM;YACR,KAAK,OAAO;gBACV,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,yBAAyB,CAAC,CAAC;qBACzD,YAAY,CAAC;gBAChB,MAAM;YACR,KAAK,SAAS;gBACZ,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,YAAY,CAAC;gBACxE,MAAM;YACR,KAAK,OAAO;gBACV,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,uBAAuB,CAAC,CAAC,CAAC,YAAY,CAAC;gBACxE,MAAM;YACR;gBACE,gBAAgB,GAAG,CAAC,MAAM,MAAM,CAAC,+BAA+B,CAAC,CAAC;qBAC/D,YAAY,CAAC;gBAChB,MAAM;SACT;KACF;IAED,OAAO,gBAAgB,EAAE,CAAC;AAC5B,CAAC;AAzBD,oCAyBC","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 */\nimport * as process from 'process';\n\nlet getMachineIdImpl: undefined | (() => Promise<string | undefined>);\n\nexport async function getMachineId(): Promise<string | undefined> {\n if (!getMachineIdImpl) {\n switch (process.platform) {\n case 'darwin':\n getMachineIdImpl = (await import('./getMachineId-darwin.js'))\n .getMachineId;\n break;\n case 'linux':\n getMachineIdImpl = (await import('./getMachineId-linux.js'))\n .getMachineId;\n break;\n case 'freebsd':\n getMachineIdImpl = (await import('./getMachineId-bsd.js')).getMachineId;\n break;\n case 'win32':\n getMachineIdImpl = (await import('./getMachineId-win.js')).getMachineId;\n break;\n default:\n getMachineIdImpl = (await import('./getMachineId-unsupported.js'))\n .getMachineId;\n break;\n }\n }\n\n return getMachineIdImpl();\n}\n"]}
@@ -0,0 +1,10 @@
"use strict";
exports.isSaturday = void 0;
var _index = require("../isSaturday.cjs");
var _index2 = require("./_lib/convertToFP.cjs"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const isSaturday = (exports.isSaturday = (0, _index2.convertToFP)(
_index.isSaturday,
1,
));
@@ -0,0 +1,231 @@
"use strict";
var _interopRequireDefault = require("@babel/runtime/helpers/interopRequireDefault");
exports.__esModule = true;
exports.default = void 0;
var _activeElement = _interopRequireDefault(require("./activeElement"));
exports.activeElement = _activeElement.default;
var _addClass = _interopRequireDefault(require("./addClass"));
exports.addClass = _addClass.default;
var _addEventListener = _interopRequireDefault(require("./addEventListener"));
exports.addEventListener = _addEventListener.default;
var _animate = _interopRequireDefault(require("./animate"));
exports.animate = _animate.default;
var _animationFrame = require("./animationFrame");
exports.cancelAnimationFrame = _animationFrame.cancel;
exports.requestAnimationFrame = _animationFrame.request;
var _attribute = _interopRequireDefault(require("./attribute"));
exports.attribute = _attribute.default;
var _childElements = _interopRequireDefault(require("./childElements"));
exports.childElements = _childElements.default;
var _clear = _interopRequireDefault(require("./clear"));
exports.clear = _clear.default;
var _closest = _interopRequireDefault(require("./closest"));
exports.closest = _closest.default;
var _contains = _interopRequireDefault(require("./contains"));
exports.contains = _contains.default;
var _childNodes = _interopRequireDefault(require("./childNodes"));
exports.childNodes = _childNodes.default;
var _css = _interopRequireDefault(require("./css"));
exports.style = _css.default;
var _filterEventHandler = _interopRequireDefault(require("./filterEventHandler"));
exports.filter = _filterEventHandler.default;
var _getComputedStyle = _interopRequireDefault(require("./getComputedStyle"));
exports.getComputedStyle = _getComputedStyle.default;
var _hasClass = _interopRequireDefault(require("./hasClass"));
exports.hasClass = _hasClass.default;
var _height = _interopRequireDefault(require("./height"));
exports.height = _height.default;
var _insertAfter = _interopRequireDefault(require("./insertAfter"));
exports.insertAfter = _insertAfter.default;
var _isInput = _interopRequireDefault(require("./isInput"));
exports.isInput = _isInput.default;
var _isVisible = _interopRequireDefault(require("./isVisible"));
exports.isVisible = _isVisible.default;
var _listen = _interopRequireDefault(require("./listen"));
exports.listen = _listen.default;
var _matches = _interopRequireDefault(require("./matches"));
exports.matches = _matches.default;
var _nextUntil = _interopRequireDefault(require("./nextUntil"));
exports.nextUntil = _nextUntil.default;
var _offset = _interopRequireDefault(require("./offset"));
exports.offset = _offset.default;
var _offsetParent = _interopRequireDefault(require("./offsetParent"));
exports.offsetParent = _offsetParent.default;
var _ownerDocument = _interopRequireDefault(require("./ownerDocument"));
exports.ownerDocument = _ownerDocument.default;
var _ownerWindow = _interopRequireDefault(require("./ownerWindow"));
exports.ownerWindow = _ownerWindow.default;
var _parents = _interopRequireDefault(require("./parents"));
exports.parents = _parents.default;
var _position = _interopRequireDefault(require("./position"));
exports.position = _position.default;
var _prepend = _interopRequireDefault(require("./prepend"));
exports.prepend = _prepend.default;
var _querySelectorAll = _interopRequireDefault(require("./querySelectorAll"));
exports.querySelectorAll = _querySelectorAll.default;
var _remove = _interopRequireDefault(require("./remove"));
exports.remove = _remove.default;
var _removeClass = _interopRequireDefault(require("./removeClass"));
exports.removeClass = _removeClass.default;
var _removeEventListener = _interopRequireDefault(require("./removeEventListener"));
exports.removeEventListener = _removeEventListener.default;
var _scrollbarSize = _interopRequireDefault(require("./scrollbarSize"));
exports.scrollbarSize = _scrollbarSize.default;
var _scrollLeft = _interopRequireDefault(require("./scrollLeft"));
exports.scrollLeft = _scrollLeft.default;
var _scrollParent = _interopRequireDefault(require("./scrollParent"));
exports.scrollParent = _scrollParent.default;
var _scrollTo = _interopRequireDefault(require("./scrollTo"));
exports.scrollTo = _scrollTo.default;
var _scrollTop = _interopRequireDefault(require("./scrollTop"));
exports.scrollTop = _scrollTop.default;
var _siblings = _interopRequireDefault(require("./siblings"));
exports.siblings = _siblings.default;
var _text = _interopRequireDefault(require("./text"));
exports.text = _text.default;
var _toggleClass = _interopRequireDefault(require("./toggleClass"));
exports.toggleClass = _toggleClass.default;
var _transitionEnd = _interopRequireDefault(require("./transitionEnd"));
exports.transitionEnd = _transitionEnd.default;
var _triggerEvent = _interopRequireDefault(require("./triggerEvent"));
exports.triggerEvent = _triggerEvent.default;
var _width = _interopRequireDefault(require("./width"));
exports.width = _width.default;
var _default = {
addEventListener: _addEventListener.default,
removeEventListener: _removeEventListener.default,
triggerEvent: _triggerEvent.default,
animate: _animate.default,
filter: _filterEventHandler.default,
listen: _listen.default,
style: _css.default,
getComputedStyle: _getComputedStyle.default,
attribute: _attribute.default,
activeElement: _activeElement.default,
ownerDocument: _ownerDocument.default,
ownerWindow: _ownerWindow.default,
requestAnimationFrame: _animationFrame.request,
cancelAnimationFrame: _animationFrame.cancel,
matches: _matches.default,
height: _height.default,
width: _width.default,
offset: _offset.default,
offsetParent: _offsetParent.default,
position: _position.default,
contains: _contains.default,
scrollbarSize: _scrollbarSize.default,
scrollLeft: _scrollLeft.default,
scrollParent: _scrollParent.default,
scrollTo: _scrollTo.default,
scrollTop: _scrollTop.default,
querySelectorAll: _querySelectorAll.default,
closest: _closest.default,
addClass: _addClass.default,
removeClass: _removeClass.default,
hasClass: _hasClass.default,
toggleClass: _toggleClass.default,
transitionEnd: _transitionEnd.default,
childNodes: _childNodes.default,
childElements: _childElements.default,
nextUntil: _nextUntil.default,
parents: _parents.default,
siblings: _siblings.default,
clear: _clear.default,
insertAfter: _insertAfter.default,
isInput: _isInput.default,
isVisible: _isVisible.default,
prepend: _prepend.default,
remove: _remove.default,
text: _text.default
};
exports.default = _default;
@@ -0,0 +1,23 @@
import { Instrumentation } from '@opentelemetry/instrumentation';
/** Exported only for tests. */
export declare const INSTRUMENTED: Record<string, Instrumentation>;
export declare function generateInstrumentOnce<Options, InstrumentationClass extends new (...args: any[]) => Instrumentation>(name: string, instrumentationClass: InstrumentationClass, optionsCallback: (options: Options) => ConstructorParameters<InstrumentationClass>[0]): ((options: Options) => InstanceType<InstrumentationClass>) & {
id: string;
};
export declare function generateInstrumentOnce<Options = unknown, InstrumentationInstance extends Instrumentation = Instrumentation>(name: string, creator: (options?: Options) => InstrumentationInstance): ((options?: Options) => InstrumentationInstance) & {
id: string;
};
/**
* Ensure a given callback is called when the instrumentation is actually wrapping something.
* This can be used to ensure some logic is only called when the instrumentation is actually active.
*
* This function returns a function that can be invoked with a callback.
* This callback will either be invoked immediately
* (e.g. if the instrumentation was already wrapped, or if _wrap could not be patched),
* or once the instrumentation is actually wrapping something.
*
* Make sure to call this function right after adding the instrumentation, otherwise it may be too late!
* The returned callback can be used any time, and also multiple times.
*/
export declare function instrumentWhenWrapped<T extends Instrumentation>(instrumentation: T): (callback: () => void) => void;
//# sourceMappingURL=instrument.d.ts.map
@@ -0,0 +1,226 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
*/
"use strict";
const memoize = require("../util/memoize");
const LAZY_TARGET = Symbol("lazy serialization target");
const LAZY_SERIALIZED_VALUE = Symbol("lazy serialization data");
/** @typedef {SerializerMiddleware<EXPECTED_ANY, EXPECTED_ANY, Record<string, EXPECTED_ANY>>} LazyTarget */
/** @typedef {Record<string, EXPECTED_ANY>} LazyOptions */
/**
* @template InputValue
* @template OutputValue
* @template {LazyTarget} InternalLazyTarget
* @template {LazyOptions | undefined} InternalLazyOptions
* @typedef {(() => InputValue | Promise<InputValue>) & Partial<{ [LAZY_TARGET]: InternalLazyTarget, options: InternalLazyOptions, [LAZY_SERIALIZED_VALUE]?: OutputValue | LazyFunction<OutputValue, InputValue, InternalLazyTarget, InternalLazyOptions> | undefined }>} LazyFunction
*/
/**
* @template DeserializedType
* @template SerializedType
* @template Context
*/
class SerializerMiddleware {
/* istanbul ignore next */
/**
* @abstract
* @param {DeserializedType} data data
* @param {Context} context context object
* @returns {SerializedType | Promise<SerializedType> | null} serialized data
*/
serialize(data, context) {
const AbstractMethodError = require("../AbstractMethodError");
throw new AbstractMethodError();
}
/* istanbul ignore next */
/**
* @abstract
* @param {SerializedType} data data
* @param {Context} context context object
* @returns {DeserializedType | Promise<DeserializedType>} deserialized data
*/
deserialize(data, context) {
const AbstractMethodError = require("../AbstractMethodError");
throw new AbstractMethodError();
}
/**
* @template TLazyInputValue
* @template TLazyOutputValue
* @template {LazyTarget} TLazyTarget
* @template {LazyOptions | undefined} TLazyOptions
* @param {TLazyInputValue | (() => TLazyInputValue)} value contained value or function to value
* @param {TLazyTarget} target target middleware
* @param {TLazyOptions=} options lazy options
* @param {TLazyOutputValue=} serializedValue serialized value
* @returns {LazyFunction<TLazyInputValue, TLazyOutputValue, TLazyTarget, TLazyOptions>} lazy function
*/
static createLazy(
value,
target,
options = /** @type {TLazyOptions} */ ({}),
serializedValue = undefined
) {
if (SerializerMiddleware.isLazy(value, target)) return value;
const fn =
/** @type {LazyFunction<TLazyInputValue, TLazyOutputValue, TLazyTarget, TLazyOptions>} */
(typeof value === "function" ? value : () => value);
fn[LAZY_TARGET] = target;
fn.options = options;
fn[LAZY_SERIALIZED_VALUE] = serializedValue;
return fn;
}
/**
* @template {LazyTarget} TLazyTarget
* @param {EXPECTED_ANY} fn lazy function
* @param {TLazyTarget=} target target middleware
* @returns {fn is LazyFunction<EXPECTED_ANY, EXPECTED_ANY, TLazyTarget, EXPECTED_ANY>} true, when fn is a lazy function (optionally of that target)
*/
static isLazy(fn, target) {
if (typeof fn !== "function") return false;
const t = fn[LAZY_TARGET];
return target ? t === target : Boolean(t);
}
/**
* @template TLazyInputValue
* @template TLazyOutputValue
* @template {LazyTarget} TLazyTarget
* @template {Record<string, EXPECTED_ANY>} TLazyOptions
* @param {LazyFunction<TLazyInputValue, TLazyOutputValue, TLazyTarget, TLazyOptions>} fn lazy function
* @returns {LazyOptions | undefined} options
*/
static getLazyOptions(fn) {
if (typeof fn !== "function") return;
return fn.options;
}
/**
* @template TLazyInputValue
* @template TLazyOutputValue
* @template {LazyTarget} TLazyTarget
* @template {LazyOptions} TLazyOptions
* @param {LazyFunction<TLazyInputValue, TLazyOutputValue, TLazyTarget, TLazyOptions> | EXPECTED_ANY} fn lazy function
* @returns {TLazyOutputValue | undefined} serialized value
*/
static getLazySerializedValue(fn) {
if (typeof fn !== "function") return;
return fn[LAZY_SERIALIZED_VALUE];
}
/**
* @template TLazyInputValue
* @template TLazyOutputValue
* @template {LazyTarget} TLazyTarget
* @template {LazyOptions} TLazyOptions
* @param {LazyFunction<TLazyInputValue, TLazyOutputValue, TLazyTarget, TLazyOptions>} fn lazy function
* @param {TLazyOutputValue} value serialized value
* @returns {void}
*/
static setLazySerializedValue(fn, value) {
fn[LAZY_SERIALIZED_VALUE] = value;
}
/**
* @template TLazyInputValue DeserializedValue
* @template TLazyOutputValue SerializedValue
* @template {LazyTarget} TLazyTarget
* @template {LazyOptions | undefined} TLazyOptions
* @param {LazyFunction<TLazyInputValue, TLazyOutputValue, TLazyTarget, TLazyOptions>} lazy lazy function
* @param {(value: TLazyInputValue) => TLazyOutputValue} serialize serialize function
* @returns {LazyFunction<TLazyOutputValue, TLazyInputValue, TLazyTarget, TLazyOptions>} new lazy
*/
static serializeLazy(lazy, serialize) {
const fn =
/** @type {LazyFunction<TLazyOutputValue, TLazyInputValue, TLazyTarget, TLazyOptions>} */
(
memoize(() => {
const r = lazy();
if (
r &&
typeof (/** @type {Promise<TLazyInputValue>} */ (r).then) ===
"function"
) {
return (
/** @type {Promise<TLazyInputValue>} */
(r).then((data) => data && serialize(data))
);
}
return serialize(/** @type {TLazyInputValue} */ (r));
})
);
fn[LAZY_TARGET] = lazy[LAZY_TARGET];
fn.options = lazy.options;
lazy[LAZY_SERIALIZED_VALUE] = fn;
return fn;
}
/**
* @template TLazyInputValue SerializedValue
* @template TLazyOutputValue DeserializedValue
* @template {LazyTarget} TLazyTarget
* @template {LazyOptions | undefined} TLazyOptions
* @param {LazyFunction<TLazyInputValue, TLazyOutputValue, TLazyTarget, TLazyOptions>} lazy lazy function
* @param {(data: TLazyInputValue) => TLazyOutputValue} deserialize deserialize function
* @returns {LazyFunction<TLazyOutputValue, TLazyInputValue, TLazyTarget, TLazyOptions>} new lazy
*/
static deserializeLazy(lazy, deserialize) {
const fn =
/** @type {LazyFunction<TLazyOutputValue, TLazyInputValue, TLazyTarget, TLazyOptions>} */ (
memoize(() => {
const r = lazy();
if (
r &&
typeof (/** @type {Promise<TLazyInputValue>} */ (r).then) ===
"function"
) {
return (
/** @type {Promise<TLazyInputValue>} */
(r).then((data) => deserialize(data))
);
}
return deserialize(/** @type {TLazyInputValue} */ (r));
})
);
fn[LAZY_TARGET] = lazy[LAZY_TARGET];
fn.options = lazy.options;
fn[LAZY_SERIALIZED_VALUE] = lazy;
return fn;
}
/**
* @template TLazyInputValue
* @template TLazyOutputValue
* @template {LazyTarget} TLazyTarget
* @template {LazyOptions} TLazyOptions
* @param {LazyFunction<TLazyInputValue | TLazyOutputValue, TLazyInputValue | TLazyOutputValue, TLazyTarget, TLazyOptions> | undefined} lazy lazy function
* @returns {LazyFunction<TLazyInputValue | TLazyOutputValue, TLazyInputValue | TLazyOutputValue, TLazyTarget, TLazyOptions> | undefined} new lazy
*/
static unMemoizeLazy(lazy) {
if (!SerializerMiddleware.isLazy(lazy)) return lazy;
/** @type {LazyFunction<TLazyInputValue | TLazyOutputValue, TLazyInputValue | TLazyOutputValue, TLazyTarget, TLazyOptions>} */
const fn = () => {
throw new Error(
"A lazy value that has been unmemorized can't be called again"
);
};
fn[LAZY_SERIALIZED_VALUE] = SerializerMiddleware.unMemoizeLazy(
/** @type {LazyFunction<TLazyInputValue | TLazyOutputValue, TLazyInputValue | TLazyOutputValue, TLazyTarget, TLazyOptions>} */
(lazy[LAZY_SERIALIZED_VALUE])
);
fn[LAZY_TARGET] = lazy[LAZY_TARGET];
fn.options = lazy.options;
return fn;
}
}
module.exports = SerializerMiddleware;
@@ -0,0 +1,18 @@
import { DirectusUser } from "./user.js";
import { MergeCoreCollection } from "../types/schema.js";
//#region src/schema/notification.d.ts
type DirectusNotification<Schema = any> = MergeCoreCollection<Schema, 'directus_notifications', {
id: string;
timestamp: 'datetime' | null;
status: string | null;
recipient: DirectusUser<Schema> | string;
sender: DirectusUser<Schema> | string | null;
subject: string;
message: string | null;
collection: string | null;
item: string | null;
}>;
//#endregion
export { DirectusNotification };
//# sourceMappingURL=notification.d.ts.map
@@ -0,0 +1,630 @@
import * as core from "../core/index.cjs";
import { util } from "../core/index.cjs";
import * as parse from "./parse.cjs";
export interface RefinementCtx<T = unknown> extends core.ParsePayload<T> {
addIssue(arg: string | core.$ZodRawIssue | Partial<core.$ZodIssueCustom>): void;
}
export interface ZodType<out Output = unknown, out Input = unknown, out Internals extends core.$ZodTypeInternals<Output, Input> = core.$ZodTypeInternals<Output, Input>> extends core.$ZodType<Output, Input, Internals> {
def: Internals["def"];
type: Internals["def"]["type"];
/** @deprecated Use `.def` instead. */
_def: Internals["def"];
/** @deprecated Use `z.output<typeof schema>` instead. */
_output: Internals["output"];
/** @deprecated Use `z.input<typeof schema>` instead. */
_input: Internals["input"];
check(...checks: (core.CheckFn<core.output<this>> | core.$ZodCheck<core.output<this>>)[]): this;
clone(def?: Internals["def"], params?: {
parent: boolean;
}): this;
register<R extends core.$ZodRegistry>(registry: R, ...meta: this extends R["_schema"] ? undefined extends R["_meta"] ? [core.$replace<R["_meta"], this>?] : [core.$replace<R["_meta"], this>] : ["Incompatible schema"]): this;
brand<T extends PropertyKey = PropertyKey>(value?: T): PropertyKey extends T ? this : core.$ZodBranded<this, T>;
parse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): core.output<this>;
safeParse(data: unknown, params?: core.ParseContext<core.$ZodIssue>): parse.ZodSafeParseResult<core.output<this>>;
parseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<core.output<this>>;
safeParseAsync(data: unknown, params?: core.ParseContext<core.$ZodIssue>): Promise<parse.ZodSafeParseResult<core.output<this>>>;
spa: (data: unknown, params?: core.ParseContext<core.$ZodIssue>) => Promise<parse.ZodSafeParseResult<core.output<this>>>;
refine(check: (arg: core.output<this>) => unknown | Promise<unknown>, params?: string | core.$ZodCustomParams): this;
/** @deprecated Use `.check()` instead. */
superRefine(refinement: (arg: core.output<this>, ctx: RefinementCtx<core.output<this>>) => void | Promise<void>): this;
overwrite(fn: (x: core.output<this>) => core.output<this>): this;
optional(): ZodOptional<this>;
nonoptional(params?: string | core.$ZodNonOptionalParams): ZodNonOptional<this>;
nullable(): ZodNullable<this>;
nullish(): ZodOptional<ZodNullable<this>>;
default(def: core.output<this>): ZodDefault<this>;
default(def: () => util.NoUndefined<core.output<this>>): ZodDefault<this>;
prefault(def: () => core.input<this>): ZodPrefault<this>;
prefault(def: core.input<this>): ZodPrefault<this>;
array(): ZodArray<this>;
or<T extends core.SomeType>(option: T): ZodUnion<[this, T]>;
and<T extends core.SomeType>(incoming: T): ZodIntersection<this, T>;
transform<NewOut>(transform: (arg: core.output<this>, ctx: RefinementCtx<core.output<this>>) => NewOut | Promise<NewOut>): ZodPipe<this, ZodTransform<Awaited<NewOut>, core.output<this>>>;
catch(def: core.output<this>): ZodCatch<this>;
catch(def: (ctx: core.$ZodCatchCtx) => core.output<this>): ZodCatch<this>;
pipe<T extends core.$ZodType<any, core.output<this>>>(target: T | core.$ZodType<any, core.output<this>>): ZodPipe<this, T>;
readonly(): ZodReadonly<this>;
/** Returns a new instance that has been registered in `z.globalRegistry` with the specified description */
describe(description: string): this;
description?: string;
/** Returns the metadata associated with this instance in `z.globalRegistry` */
meta(): core.$replace<core.GlobalMeta, this> | undefined;
/** Returns a new instance that has been registered in `z.globalRegistry` with the specified metadata */
meta(data: core.$replace<core.GlobalMeta, this>): this;
/** @deprecated Try safe-parsing `undefined` (this is what `isOptional` does internally):
*
* ```ts
* const schema = z.string().optional();
* const isOptional = schema.safeParse(undefined).success; // true
* ```
*/
isOptional(): boolean;
/**
* @deprecated Try safe-parsing `null` (this is what `isNullable` does internally):
*
* ```ts
* const schema = z.string().nullable();
* const isNullable = schema.safeParse(null).success; // true
* ```
*/
isNullable(): boolean;
}
export interface _ZodType<out Internals extends core.$ZodTypeInternals = core.$ZodTypeInternals> extends ZodType<any, any, Internals> {
}
export declare const ZodType: core.$constructor<ZodType>;
export interface _ZodString<T extends core.$ZodStringInternals<unknown> = core.$ZodStringInternals<unknown>> extends _ZodType<T> {
format: string | null;
minLength: number | null;
maxLength: number | null;
regex(regex: RegExp, params?: string | core.$ZodCheckRegexParams): this;
includes(value: string, params?: core.$ZodCheckIncludesParams): this;
startsWith(value: string, params?: string | core.$ZodCheckStartsWithParams): this;
endsWith(value: string, params?: string | core.$ZodCheckEndsWithParams): this;
min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
max(maxLength: number, params?: string | core.$ZodCheckMaxLengthParams): this;
length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
nonempty(params?: string | core.$ZodCheckMinLengthParams): this;
lowercase(params?: string | core.$ZodCheckLowerCaseParams): this;
uppercase(params?: string | core.$ZodCheckUpperCaseParams): this;
trim(): this;
normalize(form?: "NFC" | "NFD" | "NFKC" | "NFKD" | (string & {})): this;
toLowerCase(): this;
toUpperCase(): this;
}
/** @internal */
export declare const _ZodString: core.$constructor<_ZodString>;
export interface ZodString extends _ZodString<core.$ZodStringInternals<string>> {
/** @deprecated Use `z.email()` instead. */
email(params?: string | core.$ZodCheckEmailParams): this;
/** @deprecated Use `z.url()` instead. */
url(params?: string | core.$ZodCheckURLParams): this;
/** @deprecated Use `z.jwt()` instead. */
jwt(params?: string | core.$ZodCheckJWTParams): this;
/** @deprecated Use `z.emoji()` instead. */
emoji(params?: string | core.$ZodCheckEmojiParams): this;
/** @deprecated Use `z.guid()` instead. */
guid(params?: string | core.$ZodCheckGUIDParams): this;
/** @deprecated Use `z.uuid()` instead. */
uuid(params?: string | core.$ZodCheckUUIDParams): this;
/** @deprecated Use `z.uuid()` instead. */
uuidv4(params?: string | core.$ZodCheckUUIDParams): this;
/** @deprecated Use `z.uuid()` instead. */
uuidv6(params?: string | core.$ZodCheckUUIDParams): this;
/** @deprecated Use `z.uuid()` instead. */
uuidv7(params?: string | core.$ZodCheckUUIDParams): this;
/** @deprecated Use `z.nanoid()` instead. */
nanoid(params?: string | core.$ZodCheckNanoIDParams): this;
/** @deprecated Use `z.guid()` instead. */
guid(params?: string | core.$ZodCheckGUIDParams): this;
/** @deprecated Use `z.cuid()` instead. */
cuid(params?: string | core.$ZodCheckCUIDParams): this;
/** @deprecated Use `z.cuid2()` instead. */
cuid2(params?: string | core.$ZodCheckCUID2Params): this;
/** @deprecated Use `z.ulid()` instead. */
ulid(params?: string | core.$ZodCheckULIDParams): this;
/** @deprecated Use `z.base64()` instead. */
base64(params?: string | core.$ZodCheckBase64Params): this;
/** @deprecated Use `z.base64url()` instead. */
base64url(params?: string | core.$ZodCheckBase64URLParams): this;
/** @deprecated Use `z.xid()` instead. */
xid(params?: string | core.$ZodCheckXIDParams): this;
/** @deprecated Use `z.ksuid()` instead. */
ksuid(params?: string | core.$ZodCheckKSUIDParams): this;
/** @deprecated Use `z.ipv4()` instead. */
ipv4(params?: string | core.$ZodCheckIPv4Params): this;
/** @deprecated Use `z.ipv6()` instead. */
ipv6(params?: string | core.$ZodCheckIPv6Params): this;
/** @deprecated Use `z.cidrv4()` instead. */
cidrv4(params?: string | core.$ZodCheckCIDRv4Params): this;
/** @deprecated Use `z.cidrv6()` instead. */
cidrv6(params?: string | core.$ZodCheckCIDRv6Params): this;
/** @deprecated Use `z.e164()` instead. */
e164(params?: string | core.$ZodCheckE164Params): this;
/** @deprecated Use `z.iso.datetime()` instead. */
datetime(params?: string | core.$ZodCheckISODateTimeParams): this;
/** @deprecated Use `z.iso.date()` instead. */
date(params?: string | core.$ZodCheckISODateParams): this;
/** @deprecated Use `z.iso.time()` instead. */
time(params?: string | core.$ZodCheckISOTimeParams): this;
/** @deprecated Use `z.iso.duration()` instead. */
duration(params?: string | core.$ZodCheckISODurationParams): this;
}
export declare const ZodString: core.$constructor<ZodString>;
export declare function string(params?: string | core.$ZodStringParams): ZodString;
export declare function string<T extends string>(params?: string | core.$ZodStringParams): core.$ZodType<T, T>;
export interface ZodStringFormat<Format extends string = string> extends _ZodString<core.$ZodStringFormatInternals<Format>> {
}
export declare const ZodStringFormat: core.$constructor<ZodStringFormat>;
export interface ZodEmail extends ZodStringFormat<"email"> {
_zod: core.$ZodEmailInternals;
}
export declare const ZodEmail: core.$constructor<ZodEmail>;
export declare function email(params?: string | core.$ZodEmailParams): ZodEmail;
export interface ZodGUID extends ZodStringFormat<"guid"> {
_zod: core.$ZodGUIDInternals;
}
export declare const ZodGUID: core.$constructor<ZodGUID>;
export declare function guid(params?: string | core.$ZodGUIDParams): ZodGUID;
export interface ZodUUID extends ZodStringFormat<"uuid"> {
_zod: core.$ZodUUIDInternals;
}
export declare const ZodUUID: core.$constructor<ZodUUID>;
export declare function uuid(params?: string | core.$ZodUUIDParams): ZodUUID;
export declare function uuidv4(params?: string | core.$ZodUUIDv4Params): ZodUUID;
export declare function uuidv6(params?: string | core.$ZodUUIDv6Params): ZodUUID;
export declare function uuidv7(params?: string | core.$ZodUUIDv7Params): ZodUUID;
export interface ZodURL extends ZodStringFormat<"url"> {
_zod: core.$ZodURLInternals;
}
export declare const ZodURL: core.$constructor<ZodURL>;
export declare function url(params?: string | core.$ZodURLParams): ZodURL;
export interface ZodEmoji extends ZodStringFormat<"emoji"> {
_zod: core.$ZodEmojiInternals;
}
export declare const ZodEmoji: core.$constructor<ZodEmoji>;
export declare function emoji(params?: string | core.$ZodEmojiParams): ZodEmoji;
export interface ZodNanoID extends ZodStringFormat<"nanoid"> {
_zod: core.$ZodNanoIDInternals;
}
export declare const ZodNanoID: core.$constructor<ZodNanoID>;
export declare function nanoid(params?: string | core.$ZodNanoIDParams): ZodNanoID;
export interface ZodCUID extends ZodStringFormat<"cuid"> {
_zod: core.$ZodCUIDInternals;
}
export declare const ZodCUID: core.$constructor<ZodCUID>;
export declare function cuid(params?: string | core.$ZodCUIDParams): ZodCUID;
export interface ZodCUID2 extends ZodStringFormat<"cuid2"> {
_zod: core.$ZodCUID2Internals;
}
export declare const ZodCUID2: core.$constructor<ZodCUID2>;
export declare function cuid2(params?: string | core.$ZodCUID2Params): ZodCUID2;
export interface ZodULID extends ZodStringFormat<"ulid"> {
_zod: core.$ZodULIDInternals;
}
export declare const ZodULID: core.$constructor<ZodULID>;
export declare function ulid(params?: string | core.$ZodULIDParams): ZodULID;
export interface ZodXID extends ZodStringFormat<"xid"> {
_zod: core.$ZodXIDInternals;
}
export declare const ZodXID: core.$constructor<ZodXID>;
export declare function xid(params?: string | core.$ZodXIDParams): ZodXID;
export interface ZodKSUID extends ZodStringFormat<"ksuid"> {
_zod: core.$ZodKSUIDInternals;
}
export declare const ZodKSUID: core.$constructor<ZodKSUID>;
export declare function ksuid(params?: string | core.$ZodKSUIDParams): ZodKSUID;
export interface ZodIPv4 extends ZodStringFormat<"ipv4"> {
_zod: core.$ZodIPv4Internals;
}
export declare const ZodIPv4: core.$constructor<ZodIPv4>;
export declare function ipv4(params?: string | core.$ZodIPv4Params): ZodIPv4;
export interface ZodIPv6 extends ZodStringFormat<"ipv6"> {
_zod: core.$ZodIPv6Internals;
}
export declare const ZodIPv6: core.$constructor<ZodIPv6>;
export declare function ipv6(params?: string | core.$ZodIPv6Params): ZodIPv6;
export interface ZodCIDRv4 extends ZodStringFormat<"cidrv4"> {
_zod: core.$ZodCIDRv4Internals;
}
export declare const ZodCIDRv4: core.$constructor<ZodCIDRv4>;
export declare function cidrv4(params?: string | core.$ZodCIDRv4Params): ZodCIDRv4;
export interface ZodCIDRv6 extends ZodStringFormat<"cidrv6"> {
_zod: core.$ZodCIDRv6Internals;
}
export declare const ZodCIDRv6: core.$constructor<ZodCIDRv6>;
export declare function cidrv6(params?: string | core.$ZodCIDRv6Params): ZodCIDRv6;
export interface ZodBase64 extends ZodStringFormat<"base64"> {
_zod: core.$ZodBase64Internals;
}
export declare const ZodBase64: core.$constructor<ZodBase64>;
export declare function base64(params?: string | core.$ZodBase64Params): ZodBase64;
export interface ZodBase64URL extends ZodStringFormat<"base64url"> {
_zod: core.$ZodBase64URLInternals;
}
export declare const ZodBase64URL: core.$constructor<ZodBase64URL>;
export declare function base64url(params?: string | core.$ZodBase64URLParams): ZodBase64URL;
export interface ZodE164 extends ZodStringFormat<"e164"> {
_zod: core.$ZodE164Internals;
}
export declare const ZodE164: core.$constructor<ZodE164>;
export declare function e164(params?: string | core.$ZodE164Params): ZodE164;
export interface ZodJWT extends ZodStringFormat<"jwt"> {
_zod: core.$ZodJWTInternals;
}
export declare const ZodJWT: core.$constructor<ZodJWT>;
export declare function jwt(params?: string | core.$ZodJWTParams): ZodJWT;
export interface ZodCustomStringFormat<Format extends string = string> extends ZodStringFormat<Format>, core.$ZodCustomStringFormat<Format> {
_zod: core.$ZodCustomStringFormatInternals<Format>;
}
export declare const ZodCustomStringFormat: core.$constructor<ZodCustomStringFormat>;
export declare function stringFormat<Format extends string>(format: Format, fnOrRegex: ((arg: string) => util.MaybeAsync<unknown>) | RegExp, _params?: string | core.$ZodStringFormatParams): ZodCustomStringFormat<Format>;
export interface _ZodNumber<Internals extends core.$ZodNumberInternals = core.$ZodNumberInternals> extends _ZodType<Internals> {
gt(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
/** Identical to .min() */
gte(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
min(value: number, params?: string | core.$ZodCheckGreaterThanParams): this;
lt(value: number, params?: string | core.$ZodCheckLessThanParams): this;
/** Identical to .max() */
lte(value: number, params?: string | core.$ZodCheckLessThanParams): this;
max(value: number, params?: string | core.$ZodCheckLessThanParams): this;
/** Consider `z.int()` instead. This API is considered *legacy*; it will never be removed but a better alternative exists. */
int(params?: string | core.$ZodCheckNumberFormatParams): this;
/** @deprecated This is now identical to `.int()`. Only numbers in the safe integer range are accepted. */
safe(params?: string | core.$ZodCheckNumberFormatParams): this;
positive(params?: string | core.$ZodCheckGreaterThanParams): this;
nonnegative(params?: string | core.$ZodCheckGreaterThanParams): this;
negative(params?: string | core.$ZodCheckLessThanParams): this;
nonpositive(params?: string | core.$ZodCheckLessThanParams): this;
multipleOf(value: number, params?: string | core.$ZodCheckMultipleOfParams): this;
/** @deprecated Use `.multipleOf()` instead. */
step(value: number, params?: string | core.$ZodCheckMultipleOfParams): this;
/** @deprecated In v4 and later, z.number() does not allow infinite values by default. This is a no-op. */
finite(params?: unknown): this;
minValue: number | null;
maxValue: number | null;
/** @deprecated Check the `format` property instead. */
isInt: boolean;
/** @deprecated Number schemas no longer accept infinite values, so this always returns `true`. */
isFinite: boolean;
format: string | null;
}
export interface ZodNumber extends _ZodNumber<core.$ZodNumberInternals<number>> {
}
export declare const ZodNumber: core.$constructor<ZodNumber>;
export declare function number(params?: string | core.$ZodNumberParams): ZodNumber;
export interface ZodNumberFormat extends ZodNumber {
_zod: core.$ZodNumberFormatInternals;
}
export declare const ZodNumberFormat: core.$constructor<ZodNumberFormat>;
export interface ZodInt extends ZodNumberFormat {
}
export declare function int(params?: string | core.$ZodCheckNumberFormatParams): ZodInt;
export interface ZodFloat32 extends ZodNumberFormat {
}
export declare function float32(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat32;
export interface ZodFloat64 extends ZodNumberFormat {
}
export declare function float64(params?: string | core.$ZodCheckNumberFormatParams): ZodFloat64;
export interface ZodInt32 extends ZodNumberFormat {
}
export declare function int32(params?: string | core.$ZodCheckNumberFormatParams): ZodInt32;
export interface ZodUInt32 extends ZodNumberFormat {
}
export declare function uint32(params?: string | core.$ZodCheckNumberFormatParams): ZodUInt32;
export interface _ZodBoolean<T extends core.$ZodBooleanInternals = core.$ZodBooleanInternals> extends _ZodType<T> {
}
export interface ZodBoolean extends _ZodBoolean<core.$ZodBooleanInternals<boolean>> {
}
export declare const ZodBoolean: core.$constructor<ZodBoolean>;
export declare function boolean(params?: string | core.$ZodBooleanParams): ZodBoolean;
export interface _ZodBigInt<T extends core.$ZodBigIntInternals = core.$ZodBigIntInternals> extends _ZodType<T> {
gte(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
/** Alias of `.gte()` */
min(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
gt(value: bigint, params?: string | core.$ZodCheckGreaterThanParams): this;
/** Alias of `.lte()` */
lte(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
max(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
lt(value: bigint, params?: string | core.$ZodCheckLessThanParams): this;
positive(params?: string | core.$ZodCheckGreaterThanParams): this;
negative(params?: string | core.$ZodCheckLessThanParams): this;
nonpositive(params?: string | core.$ZodCheckLessThanParams): this;
nonnegative(params?: string | core.$ZodCheckGreaterThanParams): this;
multipleOf(value: bigint, params?: string | core.$ZodCheckMultipleOfParams): this;
minValue: bigint | null;
maxValue: bigint | null;
format: string | null;
}
export interface ZodBigInt extends _ZodBigInt<core.$ZodBigIntInternals<bigint>> {
}
export declare const ZodBigInt: core.$constructor<ZodBigInt>;
export declare function bigint(params?: string | core.$ZodBigIntParams): ZodBigInt;
export interface ZodBigIntFormat extends ZodBigInt {
_zod: core.$ZodBigIntFormatInternals;
}
export declare const ZodBigIntFormat: core.$constructor<ZodBigIntFormat>;
export declare function int64(params?: string | core.$ZodBigIntFormatParams): ZodBigIntFormat;
export declare function uint64(params?: string | core.$ZodBigIntFormatParams): ZodBigIntFormat;
export interface ZodSymbol extends _ZodType<core.$ZodSymbolInternals> {
}
export declare const ZodSymbol: core.$constructor<ZodSymbol>;
export declare function symbol(params?: string | core.$ZodSymbolParams): ZodSymbol;
export interface ZodUndefined extends _ZodType<core.$ZodUndefinedInternals> {
}
export declare const ZodUndefined: core.$constructor<ZodUndefined>;
declare function _undefined(params?: string | core.$ZodUndefinedParams): ZodUndefined;
export { _undefined as undefined };
export interface ZodNull extends _ZodType<core.$ZodNullInternals> {
}
export declare const ZodNull: core.$constructor<ZodNull>;
declare function _null(params?: string | core.$ZodNullParams): ZodNull;
export { _null as null };
export interface ZodAny extends _ZodType<core.$ZodAnyInternals> {
}
export declare const ZodAny: core.$constructor<ZodAny>;
export declare function any(): ZodAny;
export interface ZodUnknown extends _ZodType<core.$ZodUnknownInternals> {
}
export declare const ZodUnknown: core.$constructor<ZodUnknown>;
export declare function unknown(): ZodUnknown;
export interface ZodNever extends _ZodType<core.$ZodNeverInternals> {
}
export declare const ZodNever: core.$constructor<ZodNever>;
export declare function never(params?: string | core.$ZodNeverParams): ZodNever;
export interface ZodVoid extends _ZodType<core.$ZodVoidInternals> {
}
export declare const ZodVoid: core.$constructor<ZodVoid>;
declare function _void(params?: string | core.$ZodVoidParams): ZodVoid;
export { _void as void };
export interface _ZodDate<T extends core.$ZodDateInternals = core.$ZodDateInternals> extends _ZodType<T> {
min(value: number | Date, params?: string | core.$ZodCheckGreaterThanParams): this;
max(value: number | Date, params?: string | core.$ZodCheckLessThanParams): this;
/** @deprecated Not recommended. */
minDate: Date | null;
/** @deprecated Not recommended. */
maxDate: Date | null;
}
export interface ZodDate extends _ZodDate<core.$ZodDateInternals<Date>> {
}
export declare const ZodDate: core.$constructor<ZodDate>;
export declare function date(params?: string | core.$ZodDateParams): ZodDate;
export interface ZodArray<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodArrayInternals<T>>, core.$ZodArray<T> {
element: T;
min(minLength: number, params?: string | core.$ZodCheckMinLengthParams): this;
nonempty(params?: string | core.$ZodCheckMinLengthParams): this;
max(maxLength: number, params?: string | core.$ZodCheckMaxLengthParams): this;
length(len: number, params?: string | core.$ZodCheckLengthEqualsParams): this;
unwrap(): T;
}
export declare const ZodArray: core.$constructor<ZodArray>;
export declare function array<T extends core.SomeType>(element: T, params?: string | core.$ZodArrayParams): ZodArray<T>;
export declare function keyof<T extends ZodObject>(schema: T): ZodLiteral<Exclude<keyof T["_zod"]["output"], symbol>>;
export interface ZodObject<
/** @ts-ignore Cast variance */
out Shape extends core.$ZodShape = core.$ZodLooseShape, out Config extends core.$ZodObjectConfig = core.$strip> extends _ZodType<core.$ZodObjectInternals<Shape, Config>>, core.$ZodObject<Shape, Config> {
shape: Shape;
keyof(): ZodEnum<util.ToEnum<keyof Shape & string>>;
/** Define a schema to validate all unrecognized keys. This overrides the existing strict/loose behavior. */
catchall<T extends core.SomeType>(schema: T): ZodObject<Shape, core.$catchall<T>>;
/** @deprecated Use `z.looseObject()` or `.loose()` instead. */
passthrough(): ZodObject<Shape, core.$loose>;
/** Consider `z.looseObject(A.shape)` instead */
loose(): ZodObject<Shape, core.$loose>;
/** Consider `z.strictObject(A.shape)` instead */
strict(): ZodObject<Shape, core.$strict>;
/** This is the default behavior. This method call is likely unnecessary. */
strip(): ZodObject<Shape, core.$strip>;
extend<U extends core.$ZodLooseShape & Partial<Record<keyof Shape, core.SomeType>>>(shape: U): ZodObject<util.Extend<Shape, U>, Config>;
/**
* @deprecated Use spread syntax and the `.shape` property to combine two object schemas:
*
* ```ts
* const A = z.object({ a: z.string() });
* const B = z.object({ b: z.number() });
*
* const C = z.object({
* ...A.shape,
* ...B.shape
* });
* ```
*/
merge<U extends ZodObject>(other: U): ZodObject<util.Extend<Shape, U["shape"]>, U["_zod"]["config"]>;
pick<M extends util.Mask<keyof Shape>>(mask: M): ZodObject<util.Flatten<Pick<Shape, Extract<keyof Shape, keyof M>>>, Config>;
omit<M extends util.Mask<keyof Shape>>(mask: M): ZodObject<util.Flatten<Omit<Shape, Extract<keyof Shape, keyof M>>>, Config>;
partial(): ZodObject<{
[k in keyof Shape]: ZodOptional<Shape[k]>;
}, Config>;
partial<M extends util.Mask<keyof Shape>>(mask: M): ZodObject<{
[k in keyof Shape]: k extends keyof M ? ZodOptional<Shape[k]> : Shape[k];
}, Config>;
required(): ZodObject<{
[k in keyof Shape]: ZodNonOptional<Shape[k]>;
}, Config>;
required<M extends util.Mask<keyof Shape>>(mask: M): ZodObject<{
[k in keyof Shape]: k extends keyof M ? ZodNonOptional<Shape[k]> : Shape[k];
}, Config>;
}
export declare const ZodObject: core.$constructor<ZodObject>;
export declare function object<T extends core.$ZodLooseShape = Partial<Record<never, core.SomeType>>>(shape?: T, params?: string | core.$ZodObjectParams): ZodObject<util.Writeable<T>, core.$strip>;
export declare function strictObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodObject<T, core.$strict>;
export declare function looseObject<T extends core.$ZodLooseShape>(shape: T, params?: string | core.$ZodObjectParams): ZodObject<T, core.$loose>;
export interface ZodUnion<T extends readonly core.SomeType[] = readonly core.$ZodType[]> extends _ZodType<core.$ZodUnionInternals<T>>, core.$ZodUnion<T> {
options: T;
}
export declare const ZodUnion: core.$constructor<ZodUnion>;
export declare function union<const T extends readonly core.SomeType[]>(options: T, params?: string | core.$ZodUnionParams): ZodUnion<T>;
export interface ZodDiscriminatedUnion<Options extends readonly core.SomeType[] = readonly core.$ZodType[]> extends ZodUnion<Options>, core.$ZodDiscriminatedUnion<Options> {
_zod: core.$ZodDiscriminatedUnionInternals<Options>;
}
export declare const ZodDiscriminatedUnion: core.$constructor<ZodDiscriminatedUnion>;
export declare function discriminatedUnion<Types extends readonly [core.$ZodTypeDiscriminable, ...core.$ZodTypeDiscriminable[]]>(discriminator: string, options: Types, params?: string | core.$ZodDiscriminatedUnionParams): ZodDiscriminatedUnion<Types>;
export interface ZodIntersection<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodIntersectionInternals<A, B>>, core.$ZodIntersection<A, B> {
}
export declare const ZodIntersection: core.$constructor<ZodIntersection>;
export declare function intersection<T extends core.SomeType, U extends core.SomeType>(left: T, right: U): ZodIntersection<T, U>;
export interface ZodTuple<T extends util.TupleItems = readonly core.$ZodType[], Rest extends core.SomeType | null = core.$ZodType | null> extends _ZodType<core.$ZodTupleInternals<T, Rest>>, core.$ZodTuple<T, Rest> {
rest<Rest extends core.SomeType = core.$ZodType>(rest: Rest): ZodTuple<T, Rest>;
}
export declare const ZodTuple: core.$constructor<ZodTuple>;
export declare function tuple<T extends readonly [core.SomeType, ...core.SomeType[]]>(items: T, params?: string | core.$ZodTupleParams): ZodTuple<T, null>;
export declare function tuple<T extends readonly [core.SomeType, ...core.SomeType[]], Rest extends core.SomeType>(items: T, rest: Rest, params?: string | core.$ZodTupleParams): ZodTuple<T, Rest>;
export declare function tuple(items: [], params?: string | core.$ZodTupleParams): ZodTuple<[], null>;
export interface ZodRecord<Key extends core.$ZodRecordKey = core.$ZodRecordKey, Value extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodRecordInternals<Key, Value>>, core.$ZodRecord<Key, Value> {
keyType: Key;
valueType: Value;
}
export declare const ZodRecord: core.$constructor<ZodRecord>;
export declare function record<Key extends core.$ZodRecordKey, Value extends core.SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodRecord<Key, Value>;
export declare function partialRecord<Key extends core.$ZodRecordKey, Value extends core.SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodRecordParams): ZodRecord<Key & core.$partial, Value>;
export interface ZodMap<Key extends core.SomeType = core.$ZodType, Value extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodMapInternals<Key, Value>>, core.$ZodMap<Key, Value> {
keyType: Key;
valueType: Value;
}
export declare const ZodMap: core.$constructor<ZodMap>;
export declare function map<Key extends core.SomeType, Value extends core.SomeType>(keyType: Key, valueType: Value, params?: string | core.$ZodMapParams): ZodMap<Key, Value>;
export interface ZodSet<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodSetInternals<T>>, core.$ZodSet<T> {
min(minSize: number, params?: string | core.$ZodCheckMinSizeParams): this;
/** */
nonempty(params?: string | core.$ZodCheckMinSizeParams): this;
max(maxSize: number, params?: string | core.$ZodCheckMaxSizeParams): this;
size(size: number, params?: string | core.$ZodCheckSizeEqualsParams): this;
}
export declare const ZodSet: core.$constructor<ZodSet>;
export declare function set<Value extends core.SomeType>(valueType: Value, params?: string | core.$ZodSetParams): ZodSet<Value>;
export interface ZodEnum<
/** @ts-ignore Cast variance */
out T extends util.EnumLike = util.EnumLike> extends _ZodType<core.$ZodEnumInternals<T>>, core.$ZodEnum<T> {
enum: T;
options: Array<T[keyof T]>;
extract<const U extends readonly (keyof T)[]>(values: U, params?: string | core.$ZodEnumParams): ZodEnum<util.Flatten<Pick<T, U[number]>>>;
exclude<const U extends readonly (keyof T)[]>(values: U, params?: string | core.$ZodEnumParams): ZodEnum<util.Flatten<Omit<T, U[number]>>>;
}
export declare const ZodEnum: core.$constructor<ZodEnum>;
declare function _enum<const T extends readonly string[]>(values: T, params?: string | core.$ZodEnumParams): ZodEnum<util.ToEnum<T[number]>>;
declare function _enum<const T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodEnum<T>;
export { _enum as enum };
/** @deprecated This API has been merged into `z.enum()`. Use `z.enum()` instead.
*
* ```ts
* enum Colors { red, green, blue }
* z.enum(Colors);
* ```
*/
export declare function nativeEnum<T extends util.EnumLike>(entries: T, params?: string | core.$ZodEnumParams): ZodEnum<T>;
export interface ZodLiteral<T extends util.Literal = util.Literal> extends _ZodType<core.$ZodLiteralInternals<T>>, core.$ZodLiteral<T> {
values: Set<T>;
/** @legacy Use `.values` instead. Accessing this property will throw an error if the literal accepts multiple values. */
value: T;
}
export declare const ZodLiteral: core.$constructor<ZodLiteral>;
export declare function literal<const T extends ReadonlyArray<util.Literal>>(value: T, params?: string | core.$ZodLiteralParams): ZodLiteral<T[number]>;
export declare function literal<const T extends util.Literal>(value: T, params?: string | core.$ZodLiteralParams): ZodLiteral<T>;
export interface ZodFile extends _ZodType<core.$ZodFileInternals>, core.$ZodFile {
min(size: number, params?: string | core.$ZodCheckMinSizeParams): this;
max(size: number, params?: string | core.$ZodCheckMaxSizeParams): this;
mime(types: util.MimeTypes | Array<util.MimeTypes>, params?: string | core.$ZodCheckMimeTypeParams): this;
}
export declare const ZodFile: core.$constructor<ZodFile>;
export declare function file(params?: string | core.$ZodFileParams): ZodFile;
export interface ZodTransform<O = unknown, I = unknown> extends _ZodType<core.$ZodTransformInternals<O, I>>, core.$ZodTransform<O, I> {
}
export declare const ZodTransform: core.$constructor<ZodTransform>;
export declare function transform<I = unknown, O = I>(fn: (input: I, ctx: core.ParsePayload) => O): ZodTransform<Awaited<O>, I>;
export interface ZodOptional<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodOptionalInternals<T>>, core.$ZodOptional<T> {
unwrap(): T;
}
export declare const ZodOptional: core.$constructor<ZodOptional>;
export declare function optional<T extends core.SomeType>(innerType: T): ZodOptional<T>;
export interface ZodNullable<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodNullableInternals<T>>, core.$ZodNullable<T> {
unwrap(): T;
}
export declare const ZodNullable: core.$constructor<ZodNullable>;
export declare function nullable<T extends core.SomeType>(innerType: T): ZodNullable<T>;
export declare function nullish<T extends core.SomeType>(innerType: T): ZodOptional<ZodNullable<T>>;
export interface ZodDefault<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodDefaultInternals<T>>, core.$ZodDefault<T> {
unwrap(): T;
/** @deprecated Use `.unwrap()` instead. */
removeDefault(): T;
}
export declare const ZodDefault: core.$constructor<ZodDefault>;
export declare function _default<T extends core.SomeType>(innerType: T, defaultValue: util.NoUndefined<core.output<T>> | (() => util.NoUndefined<core.output<T>>)): ZodDefault<T>;
export interface ZodPrefault<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodPrefaultInternals<T>>, core.$ZodPrefault<T> {
unwrap(): T;
}
export declare const ZodPrefault: core.$constructor<ZodPrefault>;
export declare function prefault<T extends core.SomeType>(innerType: T, defaultValue: core.input<T> | (() => core.input<T>)): ZodPrefault<T>;
export interface ZodNonOptional<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodNonOptionalInternals<T>>, core.$ZodNonOptional<T> {
unwrap(): T;
}
export declare const ZodNonOptional: core.$constructor<ZodNonOptional>;
export declare function nonoptional<T extends core.SomeType>(innerType: T, params?: string | core.$ZodNonOptionalParams): ZodNonOptional<T>;
export interface ZodSuccess<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodSuccessInternals<T>>, core.$ZodSuccess<T> {
unwrap(): T;
}
export declare const ZodSuccess: core.$constructor<ZodSuccess>;
export declare function success<T extends core.SomeType>(innerType: T): ZodSuccess<T>;
export interface ZodCatch<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodCatchInternals<T>>, core.$ZodCatch<T> {
unwrap(): T;
/** @deprecated Use `.unwrap()` instead. */
removeCatch(): T;
}
export declare const ZodCatch: core.$constructor<ZodCatch>;
declare function _catch<T extends core.SomeType>(innerType: T, catchValue: core.output<T> | ((ctx: core.$ZodCatchCtx) => core.output<T>)): ZodCatch<T>;
export { _catch as catch };
export interface ZodNaN extends _ZodType<core.$ZodNaNInternals>, core.$ZodNaN {
}
export declare const ZodNaN: core.$constructor<ZodNaN>;
export declare function nan(params?: string | core.$ZodNaNParams): ZodNaN;
export interface ZodPipe<A extends core.SomeType = core.$ZodType, B extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodPipeInternals<A, B>>, core.$ZodPipe<A, B> {
in: A;
out: B;
}
export declare const ZodPipe: core.$constructor<ZodPipe>;
export declare function pipe<const A extends core.SomeType, B extends core.$ZodType<unknown, core.output<A>> = core.$ZodType<unknown, core.output<A>>>(in_: A, out: B | core.$ZodType<unknown, core.output<A>>): ZodPipe<A, B>;
export interface ZodReadonly<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodReadonlyInternals<T>>, core.$ZodReadonly<T> {
}
export declare const ZodReadonly: core.$constructor<ZodReadonly>;
export declare function readonly<T extends core.SomeType>(innerType: T): ZodReadonly<T>;
export interface ZodTemplateLiteral<Template extends string = string> extends _ZodType<core.$ZodTemplateLiteralInternals<Template>>, core.$ZodTemplateLiteral<Template> {
}
export declare const ZodTemplateLiteral: core.$constructor<ZodTemplateLiteral>;
export declare function templateLiteral<const Parts extends core.$ZodTemplateLiteralPart[]>(parts: Parts, params?: string | core.$ZodTemplateLiteralParams): ZodTemplateLiteral<core.$PartsToTemplateLiteral<Parts>>;
export interface ZodLazy<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodLazyInternals<T>>, core.$ZodLazy<T> {
unwrap(): T;
}
export declare const ZodLazy: core.$constructor<ZodLazy>;
export declare function lazy<T extends core.SomeType>(getter: () => T): ZodLazy<T>;
export interface ZodPromise<T extends core.SomeType = core.$ZodType> extends _ZodType<core.$ZodPromiseInternals<T>>, core.$ZodPromise<T> {
unwrap(): T;
}
export declare const ZodPromise: core.$constructor<ZodPromise>;
export declare function promise<T extends core.SomeType>(innerType: T): ZodPromise<T>;
export interface ZodCustom<O = unknown, I = unknown> extends _ZodType<core.$ZodCustomInternals<O, I>>, core.$ZodCustom<O, I> {
}
export declare const ZodCustom: core.$constructor<ZodCustom>;
export declare function check<O = unknown>(fn: core.CheckFn<O>): core.$ZodCheck<O>;
export declare function custom<O>(fn?: (data: unknown) => unknown, _params?: string | core.$ZodCustomParams | undefined): ZodCustom<O, O>;
export declare function refine<T>(fn: (arg: NoInfer<T>) => util.MaybeAsync<unknown>, _params?: string | core.$ZodCustomParams): core.$ZodCheck<T>;
export declare function superRefine<T>(fn: (arg: T, payload: RefinementCtx<T>) => void | Promise<void>): core.$ZodCheck<T>;
type ZodInstanceOfParams = core.Params<ZodCustom, core.$ZodIssueCustom, "type" | "check" | "checks" | "fn" | "abort" | "error" | "params" | "path">;
declare function _instanceof<T extends typeof util.Class>(cls: T, params?: ZodInstanceOfParams): ZodCustom<InstanceType<T>, InstanceType<T>>;
export { _instanceof as instanceof };
export declare const stringbool: (_params?: string | core.$ZodStringBoolParams) => ZodPipe<ZodPipe<ZodString, ZodTransform<boolean, string>>, ZodBoolean>;
type _ZodJSONSchema = ZodUnion<[
ZodString,
ZodNumber,
ZodBoolean,
ZodNull,
ZodArray<ZodJSONSchema>,
ZodRecord<ZodString, ZodJSONSchema>
]>;
type _ZodJSONSchemaInternals = _ZodJSONSchema["_zod"];
export interface ZodJSONSchemaInternals extends _ZodJSONSchemaInternals {
output: util.JSONType;
input: util.JSONType;
}
export interface ZodJSONSchema extends _ZodJSONSchema {
_zod: ZodJSONSchemaInternals;
}
export declare function json(params?: string | core.$ZodCustomParams): ZodJSONSchema;
export declare function preprocess<A, U extends core.SomeType, B = unknown>(fn: (arg: B, ctx: RefinementCtx) => A, schema: U): ZodPipe<ZodTransform<A, B>, U>;
@@ -0,0 +1 @@
{"version":3,"file":"drumstick.js","sources":["../../../src/icons/drumstick.ts"],"sourcesContent":["import createLucideIcon from '../createLucideIcon';\n\n/**\n * @component @name Drumstick\n * @description Lucide SVG icon component, renders SVG Element with children.\n *\n * @preview ![img](data:image/svg+xml;base64,PHN2ZyAgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIgogIHdpZHRoPSIyNCIKICBoZWlnaHQ9IjI0IgogIHZpZXdCb3g9IjAgMCAyNCAyNCIKICBmaWxsPSJub25lIgogIHN0cm9rZT0iIzAwMCIgc3R5bGU9ImJhY2tncm91bmQtY29sb3I6ICNmZmY7IGJvcmRlci1yYWRpdXM6IDJweCIKICBzdHJva2Utd2lkdGg9IjIiCiAgc3Ryb2tlLWxpbmVjYXA9InJvdW5kIgogIHN0cm9rZS1saW5lam9pbj0icm91bmQiCj4KICA8cGF0aCBkPSJNMTUuNCAxNS42M2E3Ljg3NSA2IDEzNSAxIDEgNi4yMy02LjIzIDQuNSAzLjQzIDEzNSAwIDAtNi4yMyA2LjIzIiAvPgogIDxwYXRoIGQ9Im04LjI5IDEyLjcxLTIuNiAyLjZhMi41IDIuNSAwIDEgMC0xLjY1IDQuNjVBMi41IDIuNSAwIDEgMCA4LjcgMTguM2wyLjU5LTIuNTkiIC8+Cjwvc3ZnPgo=) - https://lucide.dev/icons/drumstick\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 Drumstick = createLucideIcon('Drumstick', [\n [\n 'path',\n { d: 'M15.4 15.63a7.875 6 135 1 1 6.23-6.23 4.5 3.43 135 0 0-6.23 6.23', key: '1dtqwm' },\n ],\n [\n 'path',\n {\n d: 'm8.29 12.71-2.6 2.6a2.5 2.5 0 1 0-1.65 4.65A2.5 2.5 0 1 0 8.7 18.3l2.59-2.59',\n key: '1oq1fw',\n },\n ],\n]);\n\nexport default Drumstick;\n"],"names":[],"mappings":";;;;;;;;;AAaM,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAY,iBAAiB,WAAa,CAAA,CAAA,CAAA;AAAA,CAC9C,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA,CAAE,CAAA,CAAG,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAoE,EAAA,CAAA,CAAA,CAAA,CAAA,CAAK,QAAS,CAAA,CAAA;AAAA,CACzF,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA;AAAA,CAAA,CAAA,CAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACA,CAAA,CAAA,CAAA,CAAA;AAAA,CACE,CAAA,CAAA,CAAA,CAAA,CAAA,CAAG,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACH,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAK,EAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA,CAAA;AAAA,CACP,CAAA,CAAA,CAAA,CAAA;AAAA,CACF,CAAA,CAAA;AACF,CAAC,CAAA,CAAA;;"}
@@ -0,0 +1,39 @@
{
"name": "immutable",
"version": "4.3.7",
"description": "Immutable Data Collections",
"license": "MIT",
"homepage": "https://immutable-js.com",
"author": {
"name": "Lee Byron",
"url": "https://github.com/leebyron"
},
"repository": {
"type": "git",
"url": "git://github.com/immutable-js/immutable-js.git"
},
"bugs": {
"url": "https://github.com/immutable-js/immutable-js/issues"
},
"main": "dist/immutable.js",
"module": "dist/immutable.es.js",
"sideEffects": false,
"types": "dist/immutable.d.ts",
"files": [
"dist",
"README.md",
"LICENSE"
],
"keywords": [
"immutable",
"persistent",
"lazy",
"data",
"datastructure",
"functional",
"collection",
"stateless",
"sequence",
"iteration"
]
}
@@ -0,0 +1,164 @@
import { fieldAffectsData } from '../../fields/config/types.js';
import { getEntityPermissions } from '../../utilities/getEntityPermissions/getEntityPermissions.js';
import { isolateObjectProperty } from '../../utilities/isolateObjectProperty.js';
import { getLocalizedPaths } from '../getLocalizedPaths.js';
import { validateQueryPaths } from './validateQueryPaths.js';
/**
* Validate the Payload key / value / operator
*/ export async function validateSearchParam({ collectionConfig, constraint, errors, fields, globalConfig, operator, overrideAccess, parentIsLocalized, path: incomingPath, policies, polymorphicJoin, req, val, versionFields }) {
// Replace GraphQL nested field double underscore formatting
let sanitizedPath;
if (incomingPath === '_id') {
sanitizedPath = 'id';
} else {
sanitizedPath = incomingPath.replace(/__/g, '.');
}
let paths = [];
const { slug } = collectionConfig || globalConfig;
const blockReferencesPermissions = {};
if (globalConfig && !policies.globals[slug]) {
policies.globals[slug] = await getEntityPermissions({
blockReferencesPermissions,
entity: globalConfig,
entityType: 'global',
fetchData: false,
operations: [
'read'
],
req
});
}
if (sanitizedPath !== 'id') {
paths = getLocalizedPaths({
collectionSlug: collectionConfig?.slug,
fields,
globalSlug: globalConfig?.slug,
incomingPath: sanitizedPath,
locale: req.locale,
overrideAccess,
parentIsLocalized,
payload: req.payload
});
}
const promises = [];
// Sanitize relation.otherRelation.id to relation.otherRelation
if (paths.at(-1)?.path === 'id') {
const previousField = paths.at(-2)?.field;
if (previousField && (previousField.type === 'relationship' || previousField.type === 'upload') && typeof previousField.relationTo === 'string') {
paths.pop();
}
}
promises.push(...paths.map(async ({ collectionSlug, field, invalid, path }, i)=>{
if (invalid) {
if (!polymorphicJoin) {
errors.push({
path
});
}
return;
}
// where: { relatedPosts: { equals: 1}} -> { 'relatedPosts.id': { equals: 1}}
if (field.type === 'join' && path === incomingPath) {
constraint[`${path}.id`] = constraint[path];
delete constraint[path];
}
if ('virtual' in field && field.virtual) {
if (field.virtual === true) {
errors.push({
path
});
}
}
if (polymorphicJoin && path === 'relationTo') {
return;
}
if (!overrideAccess && fieldAffectsData(field)) {
if (collectionSlug) {
if (!policies.collections[collectionSlug]) {
policies.collections[collectionSlug] = await getEntityPermissions({
blockReferencesPermissions,
entity: req.payload.collections[collectionSlug].config,
entityType: 'collection',
fetchData: false,
operations: [
'read'
],
req: isolateObjectProperty(req, 'transactionID')
});
}
if ([
'hash',
'salt'
].includes(incomingPath) && collectionConfig.auth && !collectionConfig.auth?.disableLocalStrategy) {
errors.push({
path: incomingPath
});
}
}
let fieldPath = path;
// remove locale from end of path
if (path.endsWith(`.${req.locale}`)) {
fieldPath = path.slice(0, -(req.locale.length + 1));
}
// remove ".value" from ends of polymorphic relationship paths
if ((field.type === 'relationship' || field.type === 'upload') && Array.isArray(field.relationTo)) {
fieldPath = fieldPath.replace('.value', '');
}
const entityType = globalConfig ? 'globals' : 'collections';
const entitySlug = collectionSlug || globalConfig.slug;
const segments = fieldPath.split('.');
let fieldAccess;
if (versionFields) {
fieldAccess = policies[entityType][entitySlug].fields;
if (segments[0] === 'parent' || segments[0] === 'version' || segments[0] === 'snapshot' || segments[0] === 'latest') {
segments.shift();
}
} else {
fieldAccess = policies[entityType][entitySlug].fields;
}
if (segments.length) {
segments.forEach((segment)=>{
if (fieldAccess[segment]) {
if ('fields' in fieldAccess[segment]) {
fieldAccess = fieldAccess[segment].fields;
} else {
fieldAccess = fieldAccess[segment];
}
}
});
if (!fieldAccess?.read?.permission) {
errors.push({
path: fieldPath
});
}
}
}
if (i > 1) {
// Remove top collection and reverse array
// to work backwards from top
const pathsToQuery = paths.slice(1).reverse();
pathsToQuery.forEach(({ collectionSlug: pathCollectionSlug, path: subPath }, pathToQueryIndex)=>{
// On the "deepest" collection,
// validate query of the relationship
if (pathToQueryIndex === 0) {
promises.push(validateQueryPaths({
collectionConfig: req.payload.collections[pathCollectionSlug].config,
errors,
globalConfig: undefined,
overrideAccess,
policies,
req,
where: {
[subPath]: {
[operator]: val
}
}
}));
}
});
}
}));
await Promise.all(promises);
}
//# sourceMappingURL=validateSearchParams.js.map
@@ -0,0 +1,70 @@
/*
MIT License http://www.opensource.org/licenses/mit-license.php
Author Ivan Kopeykin @vankop
*/
"use strict";
/** @typedef {import("./Resolver")} Resolver */
/** @typedef {import("./Resolver").ResolveStepHook} ResolveStepHook */
const slashCode = "/".charCodeAt(0);
const backslashCode = "\\".charCodeAt(0);
/**
* @param {string} path path
* @param {string} parent parent path
* @returns {boolean} true, if path is inside of parent
*/
const isInside = (path, parent) => {
if (!path.startsWith(parent)) return false;
if (path.length === parent.length) return true;
const charCode = path.charCodeAt(parent.length);
return charCode === slashCode || charCode === backslashCode;
};
module.exports = class RestrictionsPlugin {
/**
* @param {string | ResolveStepHook} source source
* @param {Set<string | RegExp>} restrictions restrictions
*/
constructor(source, restrictions) {
this.source = source;
this.restrictions = restrictions;
}
/**
* @param {Resolver} resolver the resolver
* @returns {void}
*/
apply(resolver) {
resolver
.getHook(this.source)
.tapAsync("RestrictionsPlugin", (request, resolveContext, callback) => {
if (typeof request.path === "string") {
const { path } = request;
for (const rule of this.restrictions) {
if (typeof rule === "string") {
if (!isInside(path, rule)) {
if (resolveContext.log) {
resolveContext.log(
`${path} is not inside of the restriction ${rule}`,
);
}
return callback(null, null);
}
} else if (!rule.test(path)) {
if (resolveContext.log) {
resolveContext.log(
`${path} doesn't match the restriction ${rule}`,
);
}
return callback(null, null);
}
}
}
callback();
});
}
};
@@ -0,0 +1,20 @@
The MIT License (MIT)
Copyright 2013 Andrey Sitnik <andrey@sitnik.ru>
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 @@
{"version":3,"file":"is-response.js","names":[],"sources":["../../src/utils/is-response.ts"],"sourcesContent":["/**\n * Custom type guard to check if an object is likely a Fetch Response\n */\nexport function isFetchResponse(result: unknown): result is Response {\n\tif (typeof result !== 'object' || !result) return false;\n\n\treturn (\n\t\t'headers' in result &&\n\t\t'ok' in result &&\n\t\t'json' in result &&\n\t\ttypeof result.json === 'function' &&\n\t\t'text' in result &&\n\t\ttypeof result.json === 'function'\n\t);\n}\n"],"mappings":"AAGA,SAAgB,EAAgB,EAAqC,CAGpE,OAFI,OAAO,GAAW,UAAY,CAAC,EAAe,GAGjD,YAAa,GACb,OAAQ,GACR,SAAU,GACV,OAAO,EAAO,MAAS,YACvB,SAAU,GACV,OAAO,EAAO,MAAS"}
@@ -0,0 +1,104 @@
'use strict'
const { test } = require('tap')
const pino = require('../browser')
const customLevels = {
trace: 10,
debug: 20,
info: 30,
warn: 40,
error: 50,
fatal: 60
}
test('Default levels suite', ({ test, end }) => {
test('can check if current level enabled', async ({ equal }) => {
const log = pino({ level: 'debug' })
equal(true, log.isLevelEnabled('debug'))
})
test('can check if current level enabled when as object', async ({ equal }) => {
const log = pino({ asObject: true, level: 'debug' })
equal(true, log.isLevelEnabled('debug'))
})
test('can check if level enabled after level set', async ({ equal }) => {
const log = pino()
equal(false, log.isLevelEnabled('debug'))
log.level = 'debug'
equal(true, log.isLevelEnabled('debug'))
})
test('can check if higher level enabled', async ({ equal }) => {
const log = pino({ level: 'debug' })
equal(true, log.isLevelEnabled('error'))
})
test('can check if lower level is disabled', async ({ equal }) => {
const log = pino({ level: 'error' })
equal(false, log.isLevelEnabled('trace'))
})
test('ASC: can check if child has current level enabled', async ({ equal }) => {
const log = pino().child({}, { level: 'debug' })
equal(true, log.isLevelEnabled('debug'))
equal(true, log.isLevelEnabled('error'))
equal(false, log.isLevelEnabled('trace'))
})
test('can check if custom level is enabled', async ({ equal }) => {
const log = pino({
customLevels: { foo: 35 },
level: 'debug'
})
equal(true, log.isLevelEnabled('foo'))
equal(true, log.isLevelEnabled('error'))
equal(false, log.isLevelEnabled('trace'))
})
end()
})
test('Custom levels suite', ({ test, end }) => {
test('can check if current level enabled', async ({ equal }) => {
const log = pino({ level: 'debug', customLevels })
equal(true, log.isLevelEnabled('debug'))
})
test('can check if level enabled after level set', async ({ equal }) => {
const log = pino({ customLevels })
equal(false, log.isLevelEnabled('debug'))
log.level = 'debug'
equal(true, log.isLevelEnabled('debug'))
})
test('can check if higher level enabled', async ({ equal }) => {
const log = pino({ level: 'debug', customLevels })
equal(true, log.isLevelEnabled('error'))
})
test('can check if lower level is disabled', async ({ equal }) => {
const log = pino({ level: 'error', customLevels })
equal(false, log.isLevelEnabled('trace'))
})
test('can check if child has current level enabled', async ({ equal }) => {
const log = pino().child({ customLevels }, { level: 'debug' })
equal(true, log.isLevelEnabled('debug'))
equal(true, log.isLevelEnabled('error'))
equal(false, log.isLevelEnabled('trace'))
})
test('can check if custom level is enabled', async ({ equal }) => {
const log = pino({
customLevels: { foo: 35, ...customLevels },
level: 'debug'
})
equal(true, log.isLevelEnabled('foo'))
equal(true, log.isLevelEnabled('error'))
equal(false, log.isLevelEnabled('trace'))
})
end()
})
@@ -0,0 +1,80 @@
import { Kind } from '../language/kinds.mjs';
import { visit } from '../language/visitor.mjs';
/**
* separateOperations accepts a single AST document which may contain many
* operations and fragments and returns a collection of AST documents each of
* which contains a single operation as well the fragment definitions it
* refers to.
*/
export function separateOperations(documentAST) {
const operations = [];
const depGraph = Object.create(null); // Populate metadata and build a dependency graph.
for (const definitionNode of documentAST.definitions) {
switch (definitionNode.kind) {
case Kind.OPERATION_DEFINITION:
operations.push(definitionNode);
break;
case Kind.FRAGMENT_DEFINITION:
depGraph[definitionNode.name.value] = collectDependencies(
definitionNode.selectionSet,
);
break;
default: // ignore non-executable definitions
}
} // For each operation, produce a new synthesized AST which includes only what
// is necessary for completing that operation.
const separatedDocumentASTs = Object.create(null);
for (const operation of operations) {
const dependencies = new Set();
for (const fragmentName of collectDependencies(operation.selectionSet)) {
collectTransitiveDependencies(dependencies, depGraph, fragmentName);
} // Provides the empty string for anonymous operations.
const operationName = operation.name ? operation.name.value : ''; // The list of definition nodes to be included for this operation, sorted
// to retain the same order as the original document.
separatedDocumentASTs[operationName] = {
kind: Kind.DOCUMENT,
definitions: documentAST.definitions.filter(
(node) =>
node === operation ||
(node.kind === Kind.FRAGMENT_DEFINITION &&
dependencies.has(node.name.value)),
),
};
}
return separatedDocumentASTs;
}
// From a dependency graph, collects a list of transitive dependencies by
// recursing through a dependency graph.
function collectTransitiveDependencies(collected, depGraph, fromName) {
if (!collected.has(fromName)) {
collected.add(fromName);
const immediateDeps = depGraph[fromName];
if (immediateDeps !== undefined) {
for (const toName of immediateDeps) {
collectTransitiveDependencies(collected, depGraph, toName);
}
}
}
}
function collectDependencies(selectionSet) {
const dependencies = [];
visit(selectionSet, {
FragmentSpread(node) {
dependencies.push(node.name.value);
},
});
return dependencies;
}
@@ -0,0 +1 @@
export { useAnimateMini as useAnimate } from './animation/hooks/use-animate-style.mjs';
@@ -0,0 +1,3 @@
declare const binaryExtensionsJson: readonly string[];
export = binaryExtensionsJson;
@@ -0,0 +1,63 @@
{
"name": "path-to-regexp",
"version": "6.3.0",
"description": "Express style path to RegExp utility",
"keywords": [
"express",
"regexp",
"route",
"routing"
],
"repository": {
"type": "git",
"url": "https://github.com/pillarjs/path-to-regexp.git"
},
"license": "MIT",
"sideEffects": false,
"main": "dist/index.js",
"module": "dist.es2015/index.js",
"typings": "dist/index.d.ts",
"files": [
"dist.es2015/",
"dist/"
],
"scripts": {
"build": "ts-scripts build",
"format": "ts-scripts format",
"lint": "ts-scripts lint",
"prepare": "ts-scripts install && npm run build",
"size": "size-limit",
"specs": "ts-scripts specs",
"test": "ts-scripts test && npm run size"
},
"devDependencies": {
"@borderless/ts-scripts": "^0.15.0",
"@size-limit/preset-small-lib": "^11.1.2",
"@types/node": "^20.4.9",
"@types/semver": "^7.3.1",
"@vitest/coverage-v8": "^1.4.0",
"recheck": "^4.4.5",
"semver": "^7.3.5",
"size-limit": "^11.1.2",
"typescript": "^5.1.6"
},
"publishConfig": {
"access": "public"
},
"size-limit": [
{
"path": "dist.es2015/index.js",
"limit": "2.1 kB"
}
],
"ts-scripts": {
"dist": [
"dist",
"dist.es2015"
],
"project": [
"tsconfig.build.json",
"tsconfig.es2015.json"
]
}
}
@@ -0,0 +1,45 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.GraphQLHSL = exports.GraphQLHSLConfig = void 0;
const graphql_1 = require("graphql");
const error_js_1 = require("../error.js");
const HSL_REGEX = /^hsl\(\s*(-?\d+|-?\d*.\d+)\s*,\s*(-?\d+|-?\d*.\d+)%\s*,\s*(-?\d+|-?\d*.\d+)%\s*\)$/;
const validate = (value, ast) => {
if (typeof value !== 'string') {
throw (0, error_js_1.createGraphQLError)(`Value is not string: ${value}`, ast ? { nodes: ast } : undefined);
}
if (!HSL_REGEX.test(value)) {
throw (0, error_js_1.createGraphQLError)(`Value is not a valid HSL color: ${value}`, ast ? { nodes: ast } : undefined);
}
return value;
};
const specifiedByURL = 'https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#hsl()_and_hsla()';
exports.GraphQLHSLConfig = {
name: `HSL`,
description: `A field whose value is a CSS HSL color: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value#hsl()_and_hsla().`,
serialize(value) {
return validate(value);
},
parseValue(value) {
return validate(value);
},
parseLiteral(ast) {
if (ast.kind !== graphql_1.Kind.STRING) {
throw (0, error_js_1.createGraphQLError)(`Can only validate strings as HSL colors but got a: ${ast.kind}`, {
nodes: ast,
});
}
return validate(ast.value, ast);
},
specifiedByURL,
specifiedByUrl: specifiedByURL,
extensions: {
codegenScalarType: 'string',
jsonSchema: {
title: 'HSL',
type: 'string',
pattern: HSL_REGEX.source,
},
},
};
exports.GraphQLHSL = new graphql_1.GraphQLScalarType(exports.GraphQLHSLConfig);
@@ -0,0 +1,2 @@
export declare function getMachineId(): Promise<string | undefined>;
//# sourceMappingURL=getMachineId-bsd.d.ts.map
@@ -0,0 +1 @@
{"version":3,"file":"background-position.js","sourceRoot":"","sources":["../../../../src/css/property-descriptors/background-position.ts"],"names":[],"mappings":";;;AACA,2CAA6D;AAC7D,gEAAiH;AAMpG,QAAA,kBAAkB,GAAgD;IAC3E,IAAI,EAAE,qBAAqB;IAC3B,YAAY,EAAE,OAAO;IACrB,IAAI,cAAoC;IACxC,MAAM,EAAE,KAAK;IACb,KAAK,EAAE,UAAC,QAAiB,EAAE,MAAkB;QACzC,OAAO,0BAAiB,CAAC,MAAM,CAAC;aAC3B,GAAG,CAAC,UAAC,MAAkB,IAAK,OAAA,MAAM,CAAC,MAAM,CAAC,sCAAkB,CAAC,EAAjC,CAAiC,CAAC;aAC9D,GAAG,CAAC,8CAA0B,CAAC,CAAC;IACzC,CAAC;CACJ,CAAC"}
@@ -0,0 +1 @@
{"version":3,"file":"folders.cjs","names":[],"sources":["../../../../src/rest/commands/create/folders.ts"],"sourcesContent":["import type { DirectusFolder } from '../../../schema/folder.js';\nimport type { ApplyQueryFields, NestedPartial, Query } from '../../../types/index.js';\nimport type { RestCommand } from '../../types.js';\n\nexport type CreateFolderOutput<\n\tSchema,\n\tTQuery extends Query<Schema, Item>,\n\tItem extends object = DirectusFolder<Schema>,\n> = ApplyQueryFields<Schema, Item, TQuery['fields']>;\n\n/**\n * Create multiple new (virtual) folders.\n *\n * @param item The folder to create\n * @param query Optional return data query\n *\n * @returns Returns the folder object of the folder that was created.\n */\nexport const createFolders =\n\t<Schema, const TQuery extends Query<Schema, DirectusFolder<Schema>>>(\n\t\titems: NestedPartial<DirectusFolder<Schema>>[],\n\t\tquery?: TQuery,\n\t): RestCommand<CreateFolderOutput<Schema, TQuery>[], Schema> =>\n\t() => ({\n\t\tpath: `/folders`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(items),\n\t\tmethod: 'POST',\n\t});\n\n/**\n * Create a new (virtual) folder.\n *\n * @param item The folder to create\n * @param query Optional return data query\n *\n * @returns Returns the folder object of the folder that was created.\n */\nexport const createFolder =\n\t<Schema, const TQuery extends Query<Schema, DirectusFolder<Schema>>>(\n\t\titem: NestedPartial<DirectusFolder<Schema>>,\n\t\tquery?: TQuery,\n\t): RestCommand<CreateFolderOutput<Schema, TQuery>, Schema> =>\n\t() => ({\n\t\tpath: `/folders`,\n\t\tparams: query ?? {},\n\t\tbody: JSON.stringify(item),\n\t\tmethod: 'POST',\n\t});\n"],"mappings":"AAkBA,MAAa,GAEX,EACA,SAEM,CACN,KAAM,WACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAM,CAC3B,OAAQ,OACR,EAUW,GAEX,EACA,SAEM,CACN,KAAM,WACN,OAAQ,GAAS,EAAE,CACnB,KAAM,KAAK,UAAU,EAAK,CAC1B,OAAQ,OACR"}
@@ -0,0 +1,18 @@
# Contributing
Please feel free to file GitHub Issues or propose Pull Requests. We're always happy to discuss improvements to this library!
## Testing
```shell
npm test
```
## Releasing
Releases are supposed to be done from master, version bumping is automated through [`standard-version`](https://github.com/conventional-changelog/standard-version):
```shell
npm run release -- --dry-run # verify output manually
npm run release # follow the instructions from the output of this command
```
@@ -0,0 +1,75 @@
"use strict";
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
Object.defineProperty(exports, "__esModule", { value: true });
const assert = require("assert");
const api_1 = require("@opentelemetry/api");
const index_1 = require("../src/index");
describe('addSqlCommenterComment', () => {
it('adds comment to a simple query', () => {
const spanContext = {
traceId: 'd4cda95b652f4a1592b449d5929fda1b',
spanId: '6e0c63257de34c92',
traceFlags: api_1.TraceFlags.SAMPLED,
};
const query = 'SELECT * from FOO;';
assert.strictEqual((0, index_1.addSqlCommenterComment)(api_1.trace.wrapSpanContext(spanContext), query), "SELECT * from FOO; /*traceparent='00-d4cda95b652f4a1592b449d5929fda1b-6e0c63257de34c92-01'*/");
});
it('does not add a comment if query already has a comment', () => {
const span = api_1.trace.wrapSpanContext({
traceId: 'd4cda95b652f4a1592b449d5929fda1b',
spanId: '6e0c63257de34c92',
traceFlags: api_1.TraceFlags.SAMPLED,
});
const blockComment = 'SELECT * from FOO; /* Test comment */';
assert.strictEqual((0, index_1.addSqlCommenterComment)(span, blockComment), blockComment);
const dashedComment = 'SELECT * from FOO; -- Test comment';
assert.strictEqual((0, index_1.addSqlCommenterComment)(span, dashedComment), dashedComment);
});
it('does not add a comment to an empty query', () => {
const spanContext = {
traceId: 'd4cda95b652f4a1592b449d5929fda1b',
spanId: '6e0c63257de34c92',
traceFlags: api_1.TraceFlags.SAMPLED,
};
assert.strictEqual((0, index_1.addSqlCommenterComment)(api_1.trace.wrapSpanContext(spanContext), ''), '');
});
it('does not add a comment if span context is invalid', () => {
const query = 'SELECT * from FOO;';
assert.strictEqual((0, index_1.addSqlCommenterComment)(api_1.trace.wrapSpanContext(api_1.INVALID_SPAN_CONTEXT), query), query);
});
it('correctly also sets trace state', () => {
const spanContext = {
traceId: 'd4cda95b652f4a1592b449d5929fda1b',
spanId: '6e0c63257de34c92',
traceFlags: api_1.TraceFlags.SAMPLED,
traceState: (0, api_1.createTraceState)('foo=bar,baz=qux'),
};
const query = 'SELECT * from FOO;';
assert.strictEqual((0, index_1.addSqlCommenterComment)(api_1.trace.wrapSpanContext(spanContext), query), "SELECT * from FOO; /*traceparent='00-d4cda95b652f4a1592b449d5929fda1b-6e0c63257de34c92-01',tracestate='foo%3Dbar%2Cbaz%3Dqux'*/");
});
it('escapes special characters in values', () => {
const spanContext = {
traceId: 'd4cda95b652f4a1592b449d5929fda1b',
spanId: '6e0c63257de34c92',
traceFlags: api_1.TraceFlags.SAMPLED,
traceState: (0, api_1.createTraceState)("foo='bar,baz='qux!()*',hack='DROP TABLE"),
};
const query = 'SELECT * from FOO;';
assert.strictEqual((0, index_1.addSqlCommenterComment)(api_1.trace.wrapSpanContext(spanContext), query), "SELECT * from FOO; /*traceparent='00-d4cda95b652f4a1592b449d5929fda1b-6e0c63257de34c92-01',tracestate='foo%3D%27bar%2Cbaz%3D%27qux%21%28%29%2A%27%2Chack%3D%27DROP%20TABLE'*/");
});
});
//# sourceMappingURL=sql-common.test.js.map
@@ -0,0 +1,181 @@
/*
* Copyright The OpenTelemetry Authors
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* https://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
var __extends = (this && this.__extends) || (function () {
var extendStatics = function (d, b) {
extendStatics = Object.setPrototypeOf ||
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
return extendStatics(d, b);
};
return function (d, b) {
if (typeof b !== "function" && b !== null)
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
extendStatics(d, b);
function __() { this.constructor = d; }
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
};
})();
/**
* NoopMeter is a noop implementation of the {@link Meter} interface. It reuses
* constant NoopMetrics for all of its methods.
*/
var NoopMeter = /** @class */ (function () {
function NoopMeter() {
}
/**
* @see {@link Meter.createGauge}
*/
NoopMeter.prototype.createGauge = function (_name, _options) {
return NOOP_GAUGE_METRIC;
};
/**
* @see {@link Meter.createHistogram}
*/
NoopMeter.prototype.createHistogram = function (_name, _options) {
return NOOP_HISTOGRAM_METRIC;
};
/**
* @see {@link Meter.createCounter}
*/
NoopMeter.prototype.createCounter = function (_name, _options) {
return NOOP_COUNTER_METRIC;
};
/**
* @see {@link Meter.createUpDownCounter}
*/
NoopMeter.prototype.createUpDownCounter = function (_name, _options) {
return NOOP_UP_DOWN_COUNTER_METRIC;
};
/**
* @see {@link Meter.createObservableGauge}
*/
NoopMeter.prototype.createObservableGauge = function (_name, _options) {
return NOOP_OBSERVABLE_GAUGE_METRIC;
};
/**
* @see {@link Meter.createObservableCounter}
*/
NoopMeter.prototype.createObservableCounter = function (_name, _options) {
return NOOP_OBSERVABLE_COUNTER_METRIC;
};
/**
* @see {@link Meter.createObservableUpDownCounter}
*/
NoopMeter.prototype.createObservableUpDownCounter = function (_name, _options) {
return NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC;
};
/**
* @see {@link Meter.addBatchObservableCallback}
*/
NoopMeter.prototype.addBatchObservableCallback = function (_callback, _observables) { };
/**
* @see {@link Meter.removeBatchObservableCallback}
*/
NoopMeter.prototype.removeBatchObservableCallback = function (_callback) { };
return NoopMeter;
}());
export { NoopMeter };
var NoopMetric = /** @class */ (function () {
function NoopMetric() {
}
return NoopMetric;
}());
export { NoopMetric };
var NoopCounterMetric = /** @class */ (function (_super) {
__extends(NoopCounterMetric, _super);
function NoopCounterMetric() {
return _super !== null && _super.apply(this, arguments) || this;
}
NoopCounterMetric.prototype.add = function (_value, _attributes) { };
return NoopCounterMetric;
}(NoopMetric));
export { NoopCounterMetric };
var NoopUpDownCounterMetric = /** @class */ (function (_super) {
__extends(NoopUpDownCounterMetric, _super);
function NoopUpDownCounterMetric() {
return _super !== null && _super.apply(this, arguments) || this;
}
NoopUpDownCounterMetric.prototype.add = function (_value, _attributes) { };
return NoopUpDownCounterMetric;
}(NoopMetric));
export { NoopUpDownCounterMetric };
var NoopGaugeMetric = /** @class */ (function (_super) {
__extends(NoopGaugeMetric, _super);
function NoopGaugeMetric() {
return _super !== null && _super.apply(this, arguments) || this;
}
NoopGaugeMetric.prototype.record = function (_value, _attributes) { };
return NoopGaugeMetric;
}(NoopMetric));
export { NoopGaugeMetric };
var NoopHistogramMetric = /** @class */ (function (_super) {
__extends(NoopHistogramMetric, _super);
function NoopHistogramMetric() {
return _super !== null && _super.apply(this, arguments) || this;
}
NoopHistogramMetric.prototype.record = function (_value, _attributes) { };
return NoopHistogramMetric;
}(NoopMetric));
export { NoopHistogramMetric };
var NoopObservableMetric = /** @class */ (function () {
function NoopObservableMetric() {
}
NoopObservableMetric.prototype.addCallback = function (_callback) { };
NoopObservableMetric.prototype.removeCallback = function (_callback) { };
return NoopObservableMetric;
}());
export { NoopObservableMetric };
var NoopObservableCounterMetric = /** @class */ (function (_super) {
__extends(NoopObservableCounterMetric, _super);
function NoopObservableCounterMetric() {
return _super !== null && _super.apply(this, arguments) || this;
}
return NoopObservableCounterMetric;
}(NoopObservableMetric));
export { NoopObservableCounterMetric };
var NoopObservableGaugeMetric = /** @class */ (function (_super) {
__extends(NoopObservableGaugeMetric, _super);
function NoopObservableGaugeMetric() {
return _super !== null && _super.apply(this, arguments) || this;
}
return NoopObservableGaugeMetric;
}(NoopObservableMetric));
export { NoopObservableGaugeMetric };
var NoopObservableUpDownCounterMetric = /** @class */ (function (_super) {
__extends(NoopObservableUpDownCounterMetric, _super);
function NoopObservableUpDownCounterMetric() {
return _super !== null && _super.apply(this, arguments) || this;
}
return NoopObservableUpDownCounterMetric;
}(NoopObservableMetric));
export { NoopObservableUpDownCounterMetric };
export var NOOP_METER = new NoopMeter();
// Synchronous instruments
export var NOOP_COUNTER_METRIC = new NoopCounterMetric();
export var NOOP_GAUGE_METRIC = new NoopGaugeMetric();
export var NOOP_HISTOGRAM_METRIC = new NoopHistogramMetric();
export var NOOP_UP_DOWN_COUNTER_METRIC = new NoopUpDownCounterMetric();
// Asynchronous instruments
export var NOOP_OBSERVABLE_COUNTER_METRIC = new NoopObservableCounterMetric();
export var NOOP_OBSERVABLE_GAUGE_METRIC = new NoopObservableGaugeMetric();
export var NOOP_OBSERVABLE_UP_DOWN_COUNTER_METRIC = new NoopObservableUpDownCounterMetric();
/**
* Create a no-op Meter
*/
export function createNoopMeter() {
return NOOP_METER;
}
//# sourceMappingURL=NoopMeter.js.map
@@ -0,0 +1 @@
{"version":3,"sources":["../../src/utilities/optionsAreEqual.ts"],"sourcesContent":["import type { Option } from '../fields/config/types.js'\n\n/**\n * Extracts the value from an option-like object or string.\n */\nconst getOptionValue = (option: Option): string => {\n if (typeof option === 'string') {\n return option\n }\n return option.value\n}\n\n/**\n * Compares two arrays of options by their values.\n * Returns true if both arrays contain the same values (order-independent).\n */\nexport const optionsAreEqual = (\n options1: Option[] | undefined,\n options2: Option[] | undefined,\n): boolean => {\n if (!options1 && !options2) {\n return true\n }\n\n if (!options1 || !options2) {\n return false\n }\n\n if (options1.length !== options2.length) {\n return false\n }\n\n const values1 = new Set(options1.map(getOptionValue))\n const values2 = new Set(options2.map(getOptionValue))\n\n if (values1.size !== values2.size) {\n return false\n }\n\n for (const value of values1) {\n if (!values2.has(value)) {\n return false\n }\n }\n\n return true\n}\n"],"names":["getOptionValue","option","value","optionsAreEqual","options1","options2","length","values1","Set","map","values2","size","has"],"mappings":"AAEA;;CAEC,GACD,MAAMA,iBAAiB,CAACC;IACtB,IAAI,OAAOA,WAAW,UAAU;QAC9B,OAAOA;IACT;IACA,OAAOA,OAAOC,KAAK;AACrB;AAEA;;;CAGC,GACD,OAAO,MAAMC,kBAAkB,CAC7BC,UACAC;IAEA,IAAI,CAACD,YAAY,CAACC,UAAU;QAC1B,OAAO;IACT;IAEA,IAAI,CAACD,YAAY,CAACC,UAAU;QAC1B,OAAO;IACT;IAEA,IAAID,SAASE,MAAM,KAAKD,SAASC,MAAM,EAAE;QACvC,OAAO;IACT;IAEA,MAAMC,UAAU,IAAIC,IAAIJ,SAASK,GAAG,CAACT;IACrC,MAAMU,UAAU,IAAIF,IAAIH,SAASI,GAAG,CAACT;IAErC,IAAIO,QAAQI,IAAI,KAAKD,QAAQC,IAAI,EAAE;QACjC,OAAO;IACT;IAEA,KAAK,MAAMT,SAASK,QAAS;QAC3B,IAAI,CAACG,QAAQE,GAAG,CAACV,QAAQ;YACvB,OAAO;QACT;IACF;IAEA,OAAO;AACT,EAAC"}
@@ -0,0 +1,28 @@
import { formatDistance } from "./bs/_lib/formatDistance.mjs";
import { formatLong } from "./bs/_lib/formatLong.mjs";
import { formatRelative } from "./bs/_lib/formatRelative.mjs";
import { localize } from "./bs/_lib/localize.mjs";
import { match } from "./bs/_lib/match.mjs";
/**
* @category Locales
* @summary Bosnian locale.
* @language Bosnian
* @iso-639-2 bos
* @author Branislav Lazić [@branislavlazic](https://github.com/branislavlazic)
*/
export const bs = {
code: "bs",
formatDistance: formatDistance,
formatLong: formatLong,
formatRelative: formatRelative,
localize: localize,
match: match,
options: {
weekStartsOn: 1 /* Monday */,
firstWeekContainsDate: 4,
},
};
// Fallback for modularized imports:
export default bs;
@@ -0,0 +1,46 @@
import { URL } from 'url';
import { formatAdminURL } from '../utilities/formatAdminURL.js';
export async function sendVerificationEmail(args) {
// Verify token from e-mail
const { collection: { config: collectionConfig }, config, disableEmail, email, req, token, user } = args;
if (!disableEmail) {
const protocol = new URL(req.url).protocol // includes the final :
;
const serverURL = config.serverURL !== null && config.serverURL !== '' ? config.serverURL : `${protocol}//${req.headers.get('host')}`;
const verificationURL = formatAdminURL({
adminRoute: config.routes.admin,
path: `/${collectionConfig.slug}/verify/${token}`,
serverURL
});
let html = `${req.t('authentication:newAccountCreated', {
serverURL: config.serverURL,
verificationURL
})}`;
const verify = collectionConfig.auth.verify;
// Allow config to override email content
if (typeof verify.generateEmailHTML === 'function') {
html = await verify.generateEmailHTML({
req,
token,
user
});
}
let subject = req.t('authentication:verifyYourEmail');
// Allow config to override email subject
if (typeof verify.generateEmailSubject === 'function') {
subject = await verify.generateEmailSubject({
req,
token,
user
});
}
await email.sendEmail({
from: `"${email.defaultFromName}" <${email.defaultFromAddress}>`,
html,
subject,
to: user.email
});
}
}
//# sourceMappingURL=sendVerificationEmail.js.map
@@ -0,0 +1,71 @@
"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.decrypt = exports.encrypt = void 0;
const node_crypto_1 = require("node:crypto");
const node_util_1 = require("node:util");
const check_key_length_js_1 = require("./check_key_length.js");
const webcrypto_js_1 = require("./webcrypto.js");
const crypto_key_js_1 = require("../lib/crypto_key.js");
const is_key_object_js_1 = require("./is_key_object.js");
const invalid_key_input_js_1 = require("../lib/invalid_key_input.js");
const is_key_like_js_1 = require("./is_key_like.js");
const checkKey = (key, alg) => {
if (key.asymmetricKeyType !== 'rsa') {
throw new TypeError('Invalid key for this operation, its asymmetricKeyType must be rsa');
}
(0, check_key_length_js_1.default)(key, alg);
};
const RSA1_5 = (0, node_util_1.deprecate)(() => node_crypto_1.constants.RSA_PKCS1_PADDING, 'The RSA1_5 "alg" (JWE Algorithm) is deprecated and will be removed in the next major revision.');
const resolvePadding = (alg) => {
switch (alg) {
case 'RSA-OAEP':
case 'RSA-OAEP-256':
case 'RSA-OAEP-384':
case 'RSA-OAEP-512':
return node_crypto_1.constants.RSA_PKCS1_OAEP_PADDING;
case 'RSA1_5':
return RSA1_5();
default:
return undefined;
}
};
const resolveOaepHash = (alg) => {
switch (alg) {
case 'RSA-OAEP':
return 'sha1';
case 'RSA-OAEP-256':
return 'sha256';
case 'RSA-OAEP-384':
return 'sha384';
case 'RSA-OAEP-512':
return 'sha512';
default:
return undefined;
}
};
function ensureKeyObject(key, alg, ...usages) {
if ((0, is_key_object_js_1.default)(key)) {
return key;
}
if ((0, webcrypto_js_1.isCryptoKey)(key)) {
(0, crypto_key_js_1.checkEncCryptoKey)(key, alg, ...usages);
return node_crypto_1.KeyObject.from(key);
}
throw new TypeError((0, invalid_key_input_js_1.default)(key, ...is_key_like_js_1.types));
}
const encrypt = (alg, key, cek) => {
const padding = resolvePadding(alg);
const oaepHash = resolveOaepHash(alg);
const keyObject = ensureKeyObject(key, alg, 'wrapKey', 'encrypt');
checkKey(keyObject, alg);
return (0, node_crypto_1.publicEncrypt)({ key: keyObject, oaepHash, padding }, cek);
};
exports.encrypt = encrypt;
const decrypt = (alg, key, encryptedKey) => {
const padding = resolvePadding(alg);
const oaepHash = resolveOaepHash(alg);
const keyObject = ensureKeyObject(key, alg, 'unwrapKey', 'decrypt');
checkKey(keyObject, alg);
return (0, node_crypto_1.privateDecrypt)({ key: keyObject, oaepHash, padding }, encryptedKey);
};
exports.decrypt = decrypt;
@@ -0,0 +1,8 @@
"use strict";
exports.differenceInCalendarMonths = void 0;
var _index = require("../differenceInCalendarMonths.js");
var _index2 = require("./_lib/convertToFP.js"); // This file is generated automatically by `scripts/build/fp.ts`. Please, don't change it.
const differenceInCalendarMonths = (exports.differenceInCalendarMonths = (0,
_index2.convertToFP)(_index.differenceInCalendarMonths, 2));
@@ -0,0 +1,245 @@
import { subscribe } from 'node:diagnostics_channel';
import { createContextKey, context, propagation } from '@opentelemetry/api';
import { debug, addNonEnumerableProperty, getClient, getIsolationScope, httpRequestToRequestData, stripUrlQueryAndFragment, withIsolationScope, getCurrentScope, generateSpanId } from '@sentry/core';
import { DEBUG_BUILD } from '../../debug-build.js';
import { patchRequestToCaptureBody } from '../../utils/captureRequestBody.js';
const HTTP_SERVER_INSTRUMENTED_KEY = createContextKey('sentry_http_server_instrumented');
const INTEGRATION_NAME = 'Http.Server';
const clientToRequestSessionAggregatesMap = new Map
();
// We keep track of emit functions we wrapped, to avoid double wrapping
// We do this instead of putting a non-enumerable property on the function, because
// sometimes the property seems to be migrated to forks of the emit function, which we do not want to happen
// This was the case in the nestjs-distributed-tracing E2E test
const wrappedEmitFns = new WeakSet();
/**
* Add a callback to the request object that will be called when the request is started.
* The callback will receive the next function to continue processing the request.
*/
function addStartSpanCallback(request, callback) {
addNonEnumerableProperty(request, '_startSpanCallback', new WeakRef(callback));
}
const _httpServerIntegration = ((options = {}) => {
const _options = {
sessions: options.sessions ?? true,
sessionFlushingDelayMS: options.sessionFlushingDelayMS ?? 60000,
maxRequestBodySize: options.maxRequestBodySize ?? 'medium',
ignoreRequestBody: options.ignoreRequestBody,
};
return {
name: INTEGRATION_NAME,
setupOnce() {
const onHttpServerRequestStart = ((_data) => {
const data = _data ;
instrumentServer(data.server, _options);
}) ;
subscribe('http.server.request.start', onHttpServerRequestStart);
},
afterAllSetup(client) {
if (DEBUG_BUILD && client.getIntegrationByName('Http')) {
debug.warn(
'It seems that you have manually added `httpServerIntegration` while `httpIntegration` is also present. Make sure to remove `httpServerIntegration` when adding `httpIntegration`.',
);
}
},
};
}) ;
/**
* This integration handles request isolation, trace continuation and other core Sentry functionality around incoming http requests
* handled via the node `http` module.
*
* This version uses OpenTelemetry for context propagation and span management.
*
* @see {@link ../../light/integrations/httpServerIntegration.ts} for the lightweight version without OpenTelemetry
*/
const httpServerIntegration = _httpServerIntegration
;
/**
* Instrument a server to capture incoming requests.
*
*/
function instrumentServer(
server,
{
ignoreRequestBody,
maxRequestBodySize,
sessions,
sessionFlushingDelayMS,
}
,
) {
// eslint-disable-next-line @typescript-eslint/unbound-method
const originalEmit = server.emit;
if (wrappedEmitFns.has(originalEmit)) {
return;
}
const newEmit = new Proxy(originalEmit, {
apply(target, thisArg, args) {
// Only traces request events
if (args[0] !== 'request') {
return target.apply(thisArg, args);
}
const client = getClient();
// Make sure we do not double execute our wrapper code, for edge cases...
// Without this check, if we double-wrap emit, for whatever reason, you'd get two http.server spans (one the children of the other)
if (context.active().getValue(HTTP_SERVER_INSTRUMENTED_KEY) || !client) {
return target.apply(thisArg, args);
}
DEBUG_BUILD && debug.log(INTEGRATION_NAME, 'Handling incoming request');
const isolationScope = getIsolationScope().clone();
const request = args[1] ;
const response = args[2] ;
const normalizedRequest = httpRequestToRequestData(request);
// request.ip is non-standard but some frameworks set this
const ipAddress = (request ).ip || request.socket?.remoteAddress;
const url = request.url || '/';
if (maxRequestBodySize !== 'none' && !ignoreRequestBody?.(url, request)) {
patchRequestToCaptureBody(request, isolationScope, maxRequestBodySize, INTEGRATION_NAME);
}
// Update the isolation scope, isolate this request
isolationScope.setSDKProcessingMetadata({ normalizedRequest, ipAddress });
// attempt to update the scope's `transactionName` based on the request URL
// Ideally, framework instrumentations coming after the HttpInstrumentation
// update the transactionName once we get a parameterized route.
const httpMethod = (request.method || 'GET').toUpperCase();
const httpTargetWithoutQueryFragment = stripUrlQueryAndFragment(url);
const bestEffortTransactionName = `${httpMethod} ${httpTargetWithoutQueryFragment}`;
isolationScope.setTransactionName(bestEffortTransactionName);
if (sessions && client) {
recordRequestSession(client, {
requestIsolationScope: isolationScope,
response,
sessionFlushingDelayMS: sessionFlushingDelayMS ?? 60000,
});
}
return withIsolationScope(isolationScope, () => {
// Set a new propagationSpanId for this request
// We rely on the fact that `withIsolationScope()` will implicitly also fork the current scope
// This way we can save an "unnecessary" `withScope()` invocation
getCurrentScope().getPropagationContext().propagationSpanId = generateSpanId();
const ctx = propagation
.extract(context.active(), normalizedRequest.headers)
.setValue(HTTP_SERVER_INSTRUMENTED_KEY, true);
return context.with(ctx, () => {
// This is used (optionally) by the httpServerSpansIntegration to attach _startSpanCallback to the request object
client.emit('httpServerRequest', request, response, normalizedRequest);
const callback = (request )._startSpanCallback?.deref();
if (callback) {
return callback(() => target.apply(thisArg, args));
}
return target.apply(thisArg, args);
});
});
},
});
wrappedEmitFns.add(newEmit);
server.emit = newEmit;
}
/**
* Starts a session and tracks it in the context of a given isolation scope.
* When the passed response is finished, the session is put into a task and is
* aggregated with other sessions that may happen in a certain time window
* (sessionFlushingDelayMs).
*
* The sessions are always aggregated by the client that is on the current scope
* at the time of ending the response (if there is one).
*/
// Exported for unit tests
function recordRequestSession(
client,
{
requestIsolationScope,
response,
sessionFlushingDelayMS,
}
,
) {
requestIsolationScope.setSDKProcessingMetadata({
requestSession: { status: 'ok' },
});
response.once('close', () => {
const requestSession = requestIsolationScope.getScopeData().sdkProcessingMetadata.requestSession;
if (client && requestSession) {
DEBUG_BUILD && debug.log(`Recorded request session with status: ${requestSession.status}`);
const roundedDate = new Date();
roundedDate.setSeconds(0, 0);
const dateBucketKey = roundedDate.toISOString();
const existingClientAggregate = clientToRequestSessionAggregatesMap.get(client);
const bucket = existingClientAggregate?.[dateBucketKey] || { exited: 0, crashed: 0, errored: 0 };
bucket[({ ok: 'exited', crashed: 'crashed', errored: 'errored' } )[requestSession.status]]++;
if (existingClientAggregate) {
existingClientAggregate[dateBucketKey] = bucket;
} else {
DEBUG_BUILD && debug.log('Opened new request session aggregate.');
const newClientAggregate = { [dateBucketKey]: bucket };
clientToRequestSessionAggregatesMap.set(client, newClientAggregate);
const flushPendingClientAggregates = () => {
clearTimeout(timeout);
unregisterClientFlushHook();
clientToRequestSessionAggregatesMap.delete(client);
const aggregatePayload = Object.entries(newClientAggregate).map(
([timestamp, value]) => ({
started: timestamp,
exited: value.exited,
errored: value.errored,
crashed: value.crashed,
}),
);
client.sendSession({ aggregates: aggregatePayload });
};
const unregisterClientFlushHook = client.on('flush', () => {
DEBUG_BUILD && debug.log('Sending request session aggregate due to client flush');
flushPendingClientAggregates();
});
const timeout = setTimeout(() => {
DEBUG_BUILD && debug.log('Sending request session aggregate due to flushing schedule');
flushPendingClientAggregates();
}, sessionFlushingDelayMS).unref();
}
}
});
}
export { addStartSpanCallback, httpServerIntegration, recordRequestSession };
//# sourceMappingURL=httpServerIntegration.js.map
@@ -0,0 +1,23 @@
import type { Match } from "../../../locale/types.js";
import { Parser } from "../Parser.js";
import type { ParseFlags, ParseResult, ParserOptions } from "../types.js";
import type { YearParserValue } from "./YearParser.js";
export declare class LocalWeekYearParser extends Parser<YearParserValue> {
priority: number;
parse(
dateString: string,
token: string,
match: Match,
): ParseResult<YearParserValue>;
validate<DateType extends Date>(
_date: DateType,
value: YearParserValue,
): boolean;
set<DateType extends Date>(
date: DateType,
flags: ParseFlags,
value: YearParserValue,
options: ParserOptions,
): DateType;
incompatibleTokens: string[];
}

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